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 |
|---|---|---|---|---|---|---|
Removes a turtle from the vivarium. | public void removeTurtle(AbstractTurtle t)
{
// Remove the turtle from the vivarium and stop observing it
this.turtles.remove(t);
t.removeObserver(this);
// Then, fire paint event
this.repaint();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void removeTurtles()\n {\n // Stop observing every turtle\n for(AbstractTurtle t : this.turtles)\n {\n t.removeObserver(this);\n }\n\n // And remove them from the vivarium\n this.turtles.clear();\n\n // Then, fire paint event\n this.repaint();\n }",
"public abstract void removeTurtle(int turtleID);",
"public synchronized boolean removeBodyFor(UUID turtle) {\n\t\tif (turtle != null) {\n\t\t\tRealTurtleBody body = this.bodies.remove(turtle);\n\t\t\tif (body != null) {\n\t\t\t\tPoint2i position = body.getPosition();\n\t\t\t\tthis.grid.removeTurtle(position.x(), position.y(), body);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"void removeRobot(Position pos);",
"public int hideTurtle () {\n myTurtleShowing = false;\n return 0;\n }",
"public void remove(SVGElementModel model) {\n \t\tif (model.getOwner() == this) {\n \t\t\t// Update the SVG model\n \t\t\torphan(model);\n \n \t\t\t// Update the DOM tree\n \t\t\tElement element = model.getElement();\n \t\t\tElement parentElement = element.getParentElement();\n \t\t\tif (parentElement != null) {\n \t\t\t\tparentElement.removeChild(element);\n \t\t\t}\n \t\t\tElement twin = model.getTwin();\n \t\t\tElement parentTwin = twin.getParentElement();\n \t\t\tif (parentTwin != null) {\n \t\t\t\tparentTwin.removeChild(twin);\n \t\t\t}\n \t\t\t\n \t\t\t// Update the model tree\n \t\t\tif (model.getParent() != null) {\n \t\t\t\tmodel.getParent().remove(model);\n \t\t\t}\n \t\t\t\n \t\t\t// Update the store\n \t\t\tstore.removeAll(model);\n \t\t\tstore.remove(model);\n \t\t}\n \t}",
"public void remove()\n {\n removed();\n node.shapeRemoved(shape);\n }",
"public void removeVehicle() {\n\t\tmVehicles.removeFirst();\n\t}",
"public void removeVertex();",
"public void remove () { this.setAsDown(); n.remove(); }",
"void unsetStraight();",
"public void removeTile(){\n\t\toccupied = false;\n\t\tcurrentTile = null;\n\t}",
"void unsetWheel();",
"public void removeThing(){\n thing = null;\n }",
"public void removeUnit(){\r\n tacUnit = null;\r\n }",
"public void remove() {\n\t\tstopFloating();\t\n\t\tPacketHandler.toggleRedTint(player, false);\n\t\tplayer.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 30, 1));\n\t\tplayer.stopSound(Sound.MUSIC_DISC_CHIRP);\n\t\tcleanTasks();\n\t\tactiveScenarios.remove(player.getUniqueId());\n\t}",
"public void unsetPenClr()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(PENCLR$12, 0);\n }\n }",
"public void supprimerJoueur() {\n cercle.setStroke(Color.TRANSPARENT);\n isVisible = false;\n }",
"public void remove() {\n removeNode(this);\n }",
"public void remove()\n {\n ShapeParent parent = getShapeParent();\n \n if (parent != null)\n {\n parent.remove(this);\n }\n }",
"private void unhilitNode()\n {\n\tif (hilited==null) return;\n\tGraphics g = getGraphics();\n\tsetRenderColor(g,Color.black);\n\trenderCircle(g,hilited.x,hilited.y,hilited.diameter+4);\n\thilited = null;\n }",
"public void removeFromSilkBag() {\r\n silkBag.remove(0);\r\n }",
"public void erase()\n {\n this.top = null;\n }",
"public void erase()\n {\n canvas.eraseCircle(xPosition, yPosition, diameter);\n }",
"public void removeShape(RetainedShape shapePeer) {\r\n\t\tshapePeer.vboHandle.delete();\r\n\t}",
"@Override\n public void deselectGolem() {\n }",
"public void cleanRemove(Element element){\n\t\tfor(Element el : element.getElements()){\n\t\t\tnifty.removeElement(nifty.getScreen(\"hud\"),el);\n\t\t}\n\t\tnifty.removeElement(nifty.getScreen(\"hud\"), element);\n\t\tnifty.executeEndOfFrameElementActions();\n\t}",
"public void erase() {\n g2.setPaint(Color.white);\r\n }",
"public void deselect();",
"public void removeFromPlanet() {\n this.currentPlanet = null;\n }",
"public void removeTrail(Trail removedTrail) {\n for(int i = 0; i < trails.size(); i++) {\n if(trails.get(i).getTrailCode() == removedTrail.getTrailCode()) {\n trails.remove(i);\n break;\n }\n }\n }",
"void removeArrow() {\n Drawer.getInstance().removeElement(this);\n Drawer.getInstance().removeElement(triangle);\n }",
"public void remove()\n {\n this.morphs.remove(this.index);\n this.clamp();\n }",
"public void removeRobot(String name){\n robotNames.remove(name);\n measurementHandlers.remove(name);\n }",
"public void deleteCurrentJoueur(){\n\t\tElement elementPreviousToCurrent = this.getCurrentElement().getPrevious();\n\t\tElement elementNextToCurrent = this.getCurrentElement().getNext();\n\t\t\n\t\telementPreviousToCurrent.setNext(elementNextToCurrent);\n\t\telementNextToCurrent.setPrevious(elementPreviousToCurrent);\n\t\t\n\t\t// l'element suivant devient l'element courant (on passe au suivant)\n\t\tthis.setCurrentElement(this.getCurrentElement().getNext());\n\t}",
"void nuke() {\n\t\tfor (int a = 0; a < height; a++) {\n\t\t\tfor (int b = 0; b < width; b++) {\n\t\t\t\tif (FWorld[a][b] != null) {\n\t\t\t\t\tEZ.removeEZElement(FWorld[a][b]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tEZ.removeEZElement(background);\n\t\tEZ.removeEZElement(explosion);\n\t\tturtle.kill();\n\t}",
"public void doRemove() throws VisADException, RemoteException {\n rangeRings = null;\n super.doRemove();\n }",
"public static void removeTower(Tower t)\n\t{\n\t\ttowers.remove(t);\n\t}",
"public void removeAgent() {agent = null;}",
"public void unsetSmallCircle()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(SMALLCIRCLE$2, 0);\n }\n }",
"public static void remove() {\n if (create()) {\n DOM.removeChild((com.google.gwt.user.client.Element) \n tag.getParentElement(), \n (com.google.gwt.user.client.Element) tag);\n tag = null;\n removed = true;\n }\n }",
"public void onImpact() {\n die();\r\n this.getArrow().remove();\r\n }",
"public void remove() {\n this.getNext().setPrev(this.getPrev());\n this.getPrev().setNext(this.getNext());\n }",
"public void stopAnim() {\n // stop the timer\n t.stop();\n }",
"public void removeTile(Tile tile) {\r\n frame.remove(tile);\r\n }",
"public void killMe()\n\t{\n\t\tme = null;\n\t\tthis.removeAllViews();\n\t}",
"public void removeSelected()\n {\n for (int i = shapes.size() - 1; i >= 0; i--)\n {\n SceneShape s = shapes.get(i);\n if (s.isSelected()) shapes.remove(i);\n }\n repaint();\n }",
"public void deselect() {\n if (selection != null) {\n \t\tworld.destroyJoint(mouseJoint);\n \t selection = null;\n \t mouseJoint = null;\n\t }\n }",
"public void supprimerHacker() {\n if (hacker != null) {\n g.getChildren().remove(hacker);\n\n }\n }",
"public V removeVertex(V v);",
"public void remove(SelectableGraphElement element)\n {\n if (element != null) {\n element.setSelected(false);\n elements.remove(element);\n }\n }",
"public void unsetThead()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(THEAD$6, 0);\n }\n }",
"public void removeScenery(){\n\t\tfor(int i=0;i<grid.length;i++){\n\t\t\tfor(int j=0;j<grid[0].length;j++){\n\t\t\t\tif(grid[i][j].isScenery())\n\t\t\t\t\tgrid[i][j]=null;\n\t\t\t}\n\t\t}\n\t}",
"public void removeButton() {\n pan.remove(playButton);\n }",
"public void deleteLaser() {\n shotVisible = false;\n shot.setVisible(false);\n }",
"public void removeShape(Shapes obj) {\n \tthis.listShapes.remove(obj);\n \t W.repaint();\n }",
"public void removePiece() {\n\t\troot.getChildren().clear();\n\t\tthis.piece = null;\n\t\troot.getChildren().add(rectangle);\n\t}",
"@Override\r\n public void removeFromView() {\r\n currentAnimation.stop();\r\n super.removeFromView();\r\n }",
"public void remove() {\n\t\tif (current == head) {\n\t\t\thead = current.getNext();\n\t\t\tcurrent = head;\n\t\t}\n\t\tif (current.getNext() == null) {\n\t\t\tcurrent.getPrevious().setNext(null);\n\t\t\tcurrent = current.getPrevious();\n\t\t}\n\t\telse {\n\t\t\tcurrent.getPrevious().setNext(current.getNext());\n\t\t\tcurrent.getNext().setPrevious(current.getPrevious());\n\t\t\tcurrent = current.getPrevious();\n\t\t}\n\t}",
"public void DelTrack(int position);",
"private void tear() {\n\t\tthis.torn = true;\n\t\tthis.getContainer().addToContents(getDucatContent());\n\t\tthis.getContainer().removeFromContents(this);\n\t}",
"public void unsetPatent()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(PATENT$16, 0);\r\n }\r\n }",
"public void removePainter(Integer id);",
"public void removeSelection() {\n this.selection = null;\n }",
"public void removeShape(PhysicsShape shape) {\n\t\tshapes.remove(shape);\n\t}",
"public void removeGraphic(int id)\n\t{\n\t\tgetObject().removeGraphic(id);\n\t\treturn;\n\t}",
"private void clearStage(GOval ball) {\n remove(ball);\n remove((paddle));\n }",
"void removeBall(Coordinates at);",
"private final void unparkCar(Car car){\n inTerminalGUI.unparkCar(car);\n }",
"public final native void clearStroke() /*-{\n\t\tthis.setStroke(null);\n\t}-*/;",
"public void remove(T t) {\n Node<T> position = this.find(t);\n if (position == null) { return; }\n if (position.next != null) {\n position.next.prev = position.prev;\n }\n if (position.prev != null) {\n position.prev.next = position.next;\n } else {\n this.head = position.next;\n }\n }",
"public void enemyoff(){\n getWorld().removeObject(this);\n }",
"public void removeWizard() {\n\t\tyellowWizard = null;\n\t\tplayer.getHintIconsManager().removeAll();\n\t\tplayer.WizardUsed = true;\n\t}",
"private void removeRobot(Actor r) {\n\t\tfor (int i = 0; i < attackRobots.size(); i++) {\n\t\t\tif (attackRobots.get(i).equals(r)) {\n\t\t\t\tattackRobots.remove(i);\n\t\t\t\tcheckLost();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < supportRobots.size(); i++) {\n\t\t\tif (supportRobots.get(i).equals(r))\n\t\t\t\tsupportRobots.remove(i);\n\t\t}\n\t}",
"private void unhighlightText(Text text){\r\n\t text.changeColor(AnimalScript.COLORCHANGE_COLOR, Color.BLACK, new TicksTiming(0), new TicksTiming(0));\r\n\r\n\t }",
"void remove(Vertex vertex);",
"public void unlinkLR()\n {\n this.L.R = this.R;\n this.R.L = this.L;\n }",
"public void clear(View v) {\n myFingerPainterView.clearCanvas();\n }",
"public void removeDrawingClickListener(DrawingClickListener listener);",
"public void remove() {\n btRemove().push();\n }",
"public void remove() {\n btRemove().push();\n }",
"public void removeElement(ThingNode element)\n\t{\n\t\tsuper.removeElement(element);\n\t\telements.remove(element);\n\t}",
"public void clearCircle();",
"@Override\n\tpublic void removeTrigger() {\n\t\tplayer.removeListener(this.listener, EventNameType.SOUL_FIGHT);\n\t}",
"void unsetTarget();",
"private void removeStep(PlanGraphStep stepToRemove, int currentLevel) {\n\t\t\n\t\tremoveEffects(stepToRemove, currentLevel);\n\t\tremoveInvalidMutex(stepToRemove, currentLevel);\n\t\tupdateUnsupportedPreconditionInconsistencies(currentLevel);\n\t\t\n\t}",
"public void wipe(){\n\t \tg2d.setColor(Color.yellow);\n g2d.fillRect(0,0, width, height);\n\t\t\n\n\t }",
"public void clearScreen() \n\t{\n\t\tthis.myLineView.clearScreen();\n\t}",
"public void kill()\r\n {\n if(isTouching(TopDownPlayer.class))\r\n {\r\n health(1);\r\n\r\n getWorld().removeObject(player);\r\n //getWorld().addObject (new Test(), 20, 20);\r\n\r\n }\r\n // if(healthCount >= 1)\r\n // {\r\n // World world;\r\n // world = getWorld();\r\n // getWorld().removeObject(player);\r\n // \r\n // getWorld().addObject (new Test(), 20, 20);\r\n // }\r\n }",
"public void removeLevel()\n {\n clearLevelAndDecreaseCount();\n }",
"public boolean removeVehicle(){\r\n veh = null;\r\n return true;\r\n }",
"public void dropRamp() {\n if (currentSpeed == 0) {\n storage.dropRamp();\n }\n }",
"void unsetBox();",
"void despawnHitbox() {\n\t\tif (hitbox == null) return;\n\t\thitbox.remove();\n\t\thitbox = null;\n\t}",
"void unsetRaceList();",
"public void removePalette(Palette palette);",
"private void onDeleteElement(View view) {\n\n\n Node exist = arSceneView.getScene().findByName(TEMP_LINE_STRING);\n if(exist !=null)\n\n {\n arSceneView.getScene().removeChild(exist);\n\n tempLine = null;\n\n }\n\n if(listElements.size()<1) {\n Toast.makeText(MainActivity.this, \"List empty\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n Description r = listElements.get(listElements.size() - 1);\n if (r != null) {\n arSceneView.getScene().removeChild(r.getNode());\n r.getNode().setParent(null);\n listElements.remove(listElements.size() - 1);\n\n }\n\n\n\n\n\n\n\n\n }",
"protected void desactiveBoat() {\n if (activeBoat!=null) {\n activeBoat.setActive(false);\n activeBoat.getBoatRectangle().setMouseTransparent(false);\n activeBoat.getBoatRectangle().setFill(activeBoat.getDisactiveColor());\n activeBoat=null;\n closeMsg();\n } \n }",
"private void removeScreenshotView() {\n if (screenshotView == null) return;\n\n removeView(screenshotView);\n screenshotView = null;\n TurbolinksLog.d(\"Screenshot removed\");\n }",
"public void move() {\n\t\tif (!visible) {\r\n\t\t\thideTurtle();\r\n\t\t}\r\n\t}"
] | [
"0.71948713",
"0.6847977",
"0.5898403",
"0.5833805",
"0.58095044",
"0.5803228",
"0.5732902",
"0.5724268",
"0.57014763",
"0.56663305",
"0.5664549",
"0.56428623",
"0.56390274",
"0.5551469",
"0.55475944",
"0.5540142",
"0.55187696",
"0.5499195",
"0.5490171",
"0.54850614",
"0.5460751",
"0.5459078",
"0.5443858",
"0.5435257",
"0.5427855",
"0.5427624",
"0.5412154",
"0.54013",
"0.5400251",
"0.53871316",
"0.5370979",
"0.5359907",
"0.53526056",
"0.5336728",
"0.5325894",
"0.5313466",
"0.5313184",
"0.5312343",
"0.53031975",
"0.52921987",
"0.5288794",
"0.5283973",
"0.5272425",
"0.52662987",
"0.5252707",
"0.52383786",
"0.52372324",
"0.5231468",
"0.5225214",
"0.52230746",
"0.52193743",
"0.52185476",
"0.5210766",
"0.5205593",
"0.5203001",
"0.5200996",
"0.5197062",
"0.5190016",
"0.5189443",
"0.51850545",
"0.517217",
"0.51655245",
"0.5155148",
"0.514385",
"0.51394486",
"0.5126016",
"0.512437",
"0.51217586",
"0.5118472",
"0.5105113",
"0.5103808",
"0.5102915",
"0.5101527",
"0.5099927",
"0.5092505",
"0.5091872",
"0.50907546",
"0.5083927",
"0.5079139",
"0.50777227",
"0.50777227",
"0.5076882",
"0.50739247",
"0.5073001",
"0.5062451",
"0.5061756",
"0.505896",
"0.50540954",
"0.50538087",
"0.5051671",
"0.505136",
"0.5049334",
"0.5044123",
"0.5044013",
"0.50387096",
"0.5037471",
"0.50319797",
"0.50306565",
"0.50289375",
"0.50272506"
] | 0.79357624 | 0 |
Removes every turtle from the vivarium. | public void removeTurtles()
{
// Stop observing every turtle
for(AbstractTurtle t : this.turtles)
{
t.removeObserver(this);
}
// And remove them from the vivarium
this.turtles.clear();
// Then, fire paint event
this.repaint();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void removeTurtle(AbstractTurtle t)\n {\n // Remove the turtle from the vivarium and stop observing it\n this.turtles.remove(t);\n t.removeObserver(this);\n\n // Then, fire paint event\n this.repaint();\n }",
"public void removeVehicles() {\r\n numberOfVehicles = 0;\r\n for (Lane lane : lanes) {\r\n lane.removeVehicles();\r\n }\r\n }",
"private void clean() {\n // TODO: Your code here.\n for (Long id : vertices()) {\n if (adj.get(id).size() == 1) {\n adj.remove(id);\n }\n }\n }",
"void nuke() {\n\t\tfor (int a = 0; a < height; a++) {\n\t\t\tfor (int b = 0; b < width; b++) {\n\t\t\t\tif (FWorld[a][b] != null) {\n\t\t\t\t\tEZ.removeEZElement(FWorld[a][b]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tEZ.removeEZElement(background);\n\t\tEZ.removeEZElement(explosion);\n\t\tturtle.kill();\n\t}",
"private void clean() {\n Iterable<Long> v = vertices();\n Iterator<Long> iter = v.iterator();\n while (iter.hasNext()) {\n Long n = iter.next();\n if (world.get(n).adj.size() == 0) {\n iter.remove();\n }\n }\n }",
"public void removeScenery(){\n\t\tfor(int i=0;i<grid.length;i++){\n\t\t\tfor(int j=0;j<grid[0].length;j++){\n\t\t\t\tif(grid[i][j].isScenery())\n\t\t\t\t\tgrid[i][j]=null;\n\t\t\t}\n\t\t}\n\t}",
"public void clearTerrain(){\n for (Terrain[] terrains : getTerrains()) {\n for (Terrain terrain : terrains) {\n terrain.setCharacter(null); //Clear terrain of fake characters\n }\n }\n }",
"public void removeAllLines()\n {\n // get list of all ride lines and remove each\n removeObjects(getObjects(RideLines.class)); //remove RideLines\n removeObjects(getObjects(AddButton.class));//remove AddButton\n removeObjects(getObjects(ReleaseButton.class));//remove ReleaseButton\n removeObjects(getObjects(Person.class));//remove Person\n currentRide=0; // reset actual rides at zero\n }",
"public void removeAllLights() {\n if (_lights != null){\n _lights.clear();\n }\n }",
"public void clear() {\n for (int i = collisionBodies.size() - 1; i >= 0; i--) {\n CollisionBody line = collisionBodies.get(i);\n root.getChildren().remove(line.getLine());\n collisionBodies.remove(line);\n }\n }",
"public void clear_strokes() {\n this.contours = new ArrayList<ContourClass>(); // Argument (if any) specifies initial capacity (default 10)\n }",
"private void clearAll( )\n {\n for( Vertex v : vertexMap.values( ) )\n v.reset( );\n }",
"public void removeAllElements();",
"@Override\n\tpublic void removeAll() {\n\t\tfor (PhatVay phatVay : findAll()) {\n\t\t\tremove(phatVay);\n\t\t}\n\t}",
"public void clearMotors() {\n\t\tmotors.clear();\n\t}",
"public void suppressionRdV_all() {\n //on vide l'agenda de ses elements\n for (RdV elem_agenda : this.agd) {\n this.getAgenda().remove(elem_agenda);\n }\n //on reinitialise a null l'objet agenda\n //this.agd = null;\n }",
"private void removeAllObjects()\n {\n removeObjects (getObjects(Actor.class));\n }",
"public void svuotaCaselle() {\n for (CasellaGraphic casella : listaCaselle) {\n casella.getPedine().getChildren().clear();\n }\n }",
"public void clear() {\r\n for (Edge edge : edges)\r\n edge.disconnect();\r\n for (Vertex vertex : vertices)\r\n vertex.disconnect();\r\n edges.clear();\r\n vertices.clear();\r\n getChildren().remove(1, getChildren().size());\r\n }",
"public void clear()\n\t{\n\t\tIterator<DSAGraphVertex> itr = vertices.iterator();\n\t\twhile(itr.hasNext())\n\t\t{\n\t\t\titr.next().clearVisited();\n\t\t}\n\t}",
"private void remove() {\n \t\tfor(int i = 0; i < 5; i++) {\n \t\t\trMol[i].setText(\"\");\n \t\t\trGrams[i].setText(\"\");\n \t\t\tpMol[i].setText(\"\");\n \t\t\tpGrams[i].setText(\"\");\n \t\t}\n }",
"private void clear() {\n\t\tremoveAll();\n\t\taddCircle();\n\t}",
"public void removeAllElements() {\n for (int i = 0; i < OLast; i++) O[i] = null;\n ON = OLast = 0;\n Gap = -1;\n }",
"@Override\n\tpublic void removeAll() {\n\t\tfor (Paper paper : findAll()) {\n\t\t\tremove(paper);\n\t\t}\n\t}",
"public void erasePolylines() {\n for (Polyline line : polylines) {\n line.remove(); ////removing each lines\n\n }\n polylines.clear(); ////clearing the polylines array\n }",
"public void clearVectors();",
"public void clear() {\n\t\tvector.clear();\n\t}",
"@Override\n public void removeAll(){\n gameCollection.removeAllElements();\n }",
"void unsetStraight();",
"public void removeAll()\r\n {\r\n if (level ==2)\r\n {\r\n removeObjects(getObjects(Platforms.class));\r\n removeObjects(getObjects(Ladder.class));\r\n removeObjects(getObjects(SmallPlatform.class));\r\n removeObjects(getObjects(Door.class)); \r\n removeObjects(getObjects(Tomato.class)); \r\n removeObjects(getObjects(Bullet.class));\r\n removeObjects(getObjects(DeadTomato.class));\r\n player.setLocation();\r\n }\r\n if (level == 3)\r\n {\r\n removeObjects(getObjects(Tomato.class));\r\n removeObject(door2);\r\n removeObjects(getObjects(Canon.class));\r\n removeObjects(getObjects(CanonBullet.class));\r\n removeObjects(getObjects(Bullet.class));\r\n removeObjects(getObjects(Pedestal.class));\r\n removeObjects(getObjects(Platforms.class));\r\n removeObjects(getObjects(DeadTomato.class));\r\n }\r\n if (level == 4)\r\n {\r\n removeObjects(getObjects(Platforms.class));\r\n removeObjects(getObjects(Text.class));\r\n removeObjects(getObjects(Bullet.class));\r\n removeObjects(getObjects(Ladder.class));\r\n removeObjects(getObjects(Door.class)); \r\n removeObjects(getObjects(Boss.class)); \r\n removeObjects(getObjects(Thorns.class));\r\n player.setLocation();\r\n }\r\n }",
"private void Clean(){\n \t NodeIterable nodeit = graphModel.getGraph().getNodes();\n \t\n \t for (Node node : nodeit) {\n\t\t\t\n \t\t \n \t\t \n\t\t}\n \t\n }",
"public void removeAll() {\n\t\tsynchronized (mNpcs) {\n\t\t\tmNpcs = Collections.synchronizedList(new ArrayList<Npc>());\n\t\t\tmDemonCount = 0;\n\t\t\tmHumanCount = 0;\n\t\t}\n\t}",
"public void clear(){\n\t\tfor (LinkedList<Line> list : lineLists){\n\t\t\tfor (Line l : list){\n\t\t\t\tpane.getChildren().remove(l);\n\t\t\t}\n\t\t\tlist.clear();\n\t\t}\n\t\tfor (Line l : bezierCurve){\n\t\t\tpane.getChildren().remove(l);\n\t\t}\n\t\tbezierCurve.clear();\n\t\t\n\t\tlineLists.clear();\n\t\tlineLists.add(new LinkedList<Line>());\n\t}",
"public void clear()\n {\n for (SelectableGraphElement element : elements) {\n element.setSelected(false);\n }\n elements.clear();\n }",
"public void cleanRemove(Element element){\n\t\tfor(Element el : element.getElements()){\n\t\t\tnifty.removeElement(nifty.getScreen(\"hud\"),el);\n\t\t}\n\t\tnifty.removeElement(nifty.getScreen(\"hud\"), element);\n\t\tnifty.executeEndOfFrameElementActions();\n\t}",
"@Test\n public void highlightedElementsCleared() {\n radar.loop();\n radar.loop();\n radar.loop();\n radar.loop();\n radar.loop();\n MovingWorldObject obj = radar.getNearestCollideableElement();\n assertFalse(world.getWorldObjects().stream().anyMatch(WorldObject::isHighlightedWhenRadarIsOn));\n assertFalse(world.getDynamics().stream().anyMatch(WorldObject::isHighlightedWhenRadarIsOn));\n }",
"public void reset() {\n for (int i = 0; i < numberOfRows; i++ ) {\n for (int j =0; j < numberOfColumns; j++) {\n if (grid[i][j] == LASER) {\n this.Remove(i,j);\n }\n }\n }\n }",
"public void resetTurrets(){\n\t\tfor(Turret turret : this.turrets){\n\t\t\tturret.reset();\n\t\t}\n\t}",
"public void removeFromSilkBag() {\r\n silkBag.remove(0);\r\n }",
"public abstract void removeTurtle(int turtleID);",
"@Override\n\tpublic void removeAll() throws SystemException {\n\t\tfor (TvShow tvShow : findAll()) {\n\t\t\tremove(tvShow);\n\t\t}\n\t}",
"public void freeLights(){\n\t\t//android.util.Log.d(TAG,\"freeLights()\");\n\t\tfinal int size = this.lights.size();\n\t\tfor(int index=0; index < size; index++){\n\t\t\tthis.lights.delete(this.lights.keyAt(index));\n\t\t}\n\t}",
"static void wipeLocations(){\n\t \tfor (int i= 0; i < places.length; i++){\n\t\t\t\tfor (int j = 0; j < places[i].items.size(); j++)\n\t\t\t\t\tplaces[i].items.clear();\n\t\t\t\tfor (int k = 0; k < places[i].receptacle.size(); k++)\n\t\t\t\t\tplaces[i].receptacle.clear();\n\t \t}\n\t \tContainer.emptyContainer();\n\t }",
"public void supprimerToutesLesLignes() {\n\t\tlisteVente.clear();\r\n\t\tfireTableDataChanged();\r\n\t}",
"public void cleanAll() {\n\t\tfor (VirtualPet p : shelterPets.values()) {\n\t\t\tp.cleanPet();\n\t\t}\n\t}",
"public void CleanScr() {\n\t\tint a = 0;\n\t\twhile (a < 16) {\n\t\t\tR0[a].setSelected(false);\n\t\t\tR1[a].setSelected(false);\n\t\t\tR2[a].setSelected(false);\n\t\t\tR3[a].setSelected(false);\n\t\t\tX1[a].setSelected(false);\n\t\t\tX2[a].setSelected(false);\n\t\t\tX3[a].setSelected(false);\n\t\t\tMAR[a].setSelected(false);\n\t\t\tMBR[a].setSelected(false);\n\t\t\tIR[a].setSelected(false);\n//\t\t\tMem[a].setSelected(false);\n\t\t\ta++;\n\t\t}\n\t\tint b = 0;\n\t\twhile (b < 12) {\n\t\t\tPC[b].setSelected(false);\n\t\t\tb++;\n\t\t}\n\t}",
"private void clearStragglers() {\n for (int i = 0; i < game.gridPieces.length; i++) {\n GridPiece piece = game.gridPieces[i];\n\n if (piece.state == game.STATE_TEMP) {\n piece.restoreState();\n //restoreState(piece);\n } else if (piece.state == game.STATE_TEMP_NOTOUCH) {\n piece.setState(game.STATE_FINAL);\n }\n }\n }",
"public void clear(){\n this.entities.clear();\n /*for(QuadTree node: this.getNodes()){\n node.clear();\n this.getNodes().remove(node);\n }*/\n this.nodes.clear();\n }",
"public void removeAll () {\n\t\teffects.clear();\n\t}",
"private void clean() {\n nodesToRemove.clear();\n edgesToRemove.clear();\n }",
"public void turnOffAllTheLights() {\r\n for (Light li : lightsArray) {\r\n li.turnOffLight();\r\n }\r\n }",
"public void clear ()\n {\n for (int index = 0; index <= lastIndex; index++)\n {\n vertices[index] = null;\n adjacencySequences[index] = null;\n }\n lastIndex = -1;\n }",
"public void clear() {\n\t\t//Kill all entities\n\t\tentities.parallelStream().forEach(e -> e.kill());\n\n\t\t//Clear the lists\n\t\tentities.clear();\n\t\tdrawables.clear();\n\t\tcollidables.clear();\n\t}",
"public void clearLineVehicles(AnchorPane anchor_pane_map)\r\n {\r\n for (Circle c : all_line_vehicles)\r\n {\r\n anchor_pane_map.getChildren().remove(c);\r\n }\r\n }",
"public void turnOffAllLights() {\r\n\t\tfor (Light light : lights) {\r\n\t\t\tif(light.isOn()) {\r\n\t\t\t\tlight.toogle();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void clear() {\n this.mRatios.clear();\n }",
"void clear() {\n\t\t\tfor (int i = 0 ; i < nodes.length; i++) {\n\t\t\t\tnodes[i].clear((byte) 1);\n\t\t\t}\n\t\t\tsize = 0;\n\t\t}",
"void unsetDSTSavings();",
"public void clearOfertas() {\r\n\t\tcoi.clearOfertas();\r\n\t}",
"public void removeAll()\n {\n this.front = null;\n this.rear = null;\n }",
"public void removeBalls() {\r\n for (Ball ball : this.ballsList) {\r\n ball.removeFromGame(this);\r\n }\r\n this.ballsList.clear();\r\n }",
"private void clearVisited(){\r\n\t\tfor(int i=0; i<graphSize; i++){\r\n\t\t\tmyGraph[i].visited = false;\r\n\t\t\tAdjVertex vert = myGraph[i].adjVertexHead;\r\n\t\t\twhile(vert != null){\r\n\t\t\t\tvert.visited = false;\r\n\t\t\t\tvert= vert.next;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void clearShapes() {\n\t\tcollectionOfNodes.clear();\n\t}",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"void unsetRaceList();",
"public void clearSymbolsGraphics()\r\n {\r\n symbols.clear();\r\n }",
"public void vacateGarage() {\n\t\tvehicles.clear(); \n\t}",
"public void clearNeighborhoods()\n\t{\n\t\tfor (int i=0; i<numberOfNeighborhoods; i++)\n\t\t{\n\t\t\t(listOfNeighborhoods.get(i)).clear();\n\t\t}\n\t}",
"void unsetObjectives();",
"public void clean() {\n \tfor(int f=0; f<NUMCARTAS;f++) \n \tfor(int c=0; c<NUMCARTAS;c++) {\n \t\ttablero[f][c].setSelected(false);\n\t \t \t//Devuelve al color original\n\t if(tablero[f][c].getText().length()==2) tablero[f][c].setBackground(colorDiagonal);\n\t else if(tablero[f][c].getText().charAt(2)=='s') tablero[f][c].setBackground(colorSuited);\n\t else tablero[f][c].setBackground(colorOffsuited);\n \t}\n }",
"@Override\n\tpublic void clear() {\n\t\tthis.vector.clear();\n\t}",
"public void removeAllInterpretedBy() {\r\n\t\tBase.removeAll(this.model, this.getResource(), INTERPRETEDBY);\r\n\t}",
"public void unselect(java.util.List<Node> tbs) {\n\t\tfor(Node node : tbs) {\n\t\t\tif(selected_nodes.contains(node)) {\n\t\t\t\tselected_nodes.remove(node);\n\t\t\t}\n\t\t}\n\t}",
"public void removeAllSeconderyColorsFromBoard() {\n\t\tArrayList<Tile> boardTiles= getAllBoardTiles();\n\t\tif(!this.coloredTilesList.isEmpty()) {\n\t\t\tboardTiles.retainAll(coloredTilesList);\n\t\t\tfor(Tile t :boardTiles) {\n\t\t\t\tTile basicTile= new Tile.Builder(t.getLocation(), t.getColor1()).setPiece(t.getPiece()).build();\n\t\t\t\treplaceTileInSameTileLocation(basicTile);\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tthis.coloredTilesList=null;\n\t\tthis.coloredTilesList=new ArrayList<Tile>();\n\t\tthis.orangeTiles=null;\n\t\tthis.orangeTiles=new ArrayList<Tile>();\n\n\t}",
"public void clear() {\n \tthis.listShapes.clear();\n }",
"private void tear() {\n\t\tthis.torn = true;\n\t\tthis.getContainer().addToContents(getDucatContent());\n\t\tthis.getContainer().removeFromContents(this);\n\t}",
"@Override\n\tpublic void removeAll() {\n\t\tif(isEmpty())\n\t\t\treturn;\n\t\t// Remove until the frontier is empty\n\t\twhile(!isEmpty())\n\t\t\tfrontier.removeFirst();\n\t}",
"@NoProxy\n public void clearVoters() {\n final List<BwXproperty> props = getXproperties(BwXproperty.pollVoter);\n\n if (Util.isEmpty(props)) {\n return;\n }\n\n for (final BwXproperty p: props) {\n removeXproperty(p);\n }\n }",
"public void clearAllSquares()\n\t{\n\t\t/* loop through all rows and columns and remove all the highlighting */\n\t\tfor (int i = 0; i < m_rows; i++) {\n\t\t\tfor (int j = 0; j < m_cols; j++) {\n\t\t\t\tclearSquare(i, j);\n\t\t\t}\n\t\t}\n\t}",
"public void removeAgents() {\n\t\tfor (TestLiveAgent agent : agents.values()) {\n\t\t\tagent.stop();\n\t\t}\n\t\tagents.clear();\n\t}",
"public void vaciar(){\n\t\tingredientes.clear();\n\t}",
"public void clearAll() {\r\n\t\tfor (EnTablero et : listaElementos) et.setTablero( null ); // Anula tablero de todos los elementos previos\r\n\t\tlistaElementos.clear();\r\n\t\tfor (int f=0; f<numFilas; f++) {\r\n\t\t\tfor (int c=0; c<numColumnas; c++) {\r\n\t\t\t\telementosTablero[f][c] = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void clearBalls();",
"public void clearAll() {\n\n\t\t// Removing the graphics from the layer\n\t\trouteLayer.removeAll();\n\t\t// hiddenSegmentsLayer.removeAll();\n\t\tmMapViewHelper.removeAllGraphics();\n\t\tmResults = null;\n\n\t}",
"public void clear(){\r\n MetersList.clear();\r\n }",
"void removeAllSpawn();",
"public void clear() {\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tbeams[i] = null;\n\t\t}\n\t}",
"public void clearVelocity();",
"void removeSpeeds(int i);"
] | [
"0.67819875",
"0.6505071",
"0.6426741",
"0.6411947",
"0.6356181",
"0.62774384",
"0.6204117",
"0.61388886",
"0.61372155",
"0.6092336",
"0.60637313",
"0.60620373",
"0.6033512",
"0.6032632",
"0.6022858",
"0.59535515",
"0.59499365",
"0.5937674",
"0.59109277",
"0.59083223",
"0.58935845",
"0.5870805",
"0.5859862",
"0.584456",
"0.58440524",
"0.5835461",
"0.5831252",
"0.5830717",
"0.58121353",
"0.5808998",
"0.5794719",
"0.5778805",
"0.5769889",
"0.5769136",
"0.5757344",
"0.57553285",
"0.57338107",
"0.5714014",
"0.5712483",
"0.5711773",
"0.5706129",
"0.570358",
"0.57016265",
"0.56942385",
"0.5681133",
"0.5679846",
"0.5672313",
"0.5668202",
"0.5663072",
"0.56620216",
"0.5652268",
"0.56506217",
"0.5650133",
"0.56472945",
"0.5642039",
"0.56400603",
"0.56358707",
"0.5631337",
"0.562165",
"0.56165904",
"0.56083405",
"0.5603905",
"0.5596193",
"0.55916905",
"0.55916905",
"0.55916905",
"0.55916905",
"0.55916905",
"0.55916905",
"0.55916905",
"0.55916905",
"0.55916905",
"0.55916905",
"0.55916905",
"0.55916905",
"0.5582427",
"0.55720294",
"0.5571608",
"0.55657697",
"0.55619055",
"0.5561774",
"0.555584",
"0.55551714",
"0.5550786",
"0.55496484",
"0.5548878",
"0.5542317",
"0.5539544",
"0.5537778",
"0.553282",
"0.5524216",
"0.55182403",
"0.55159944",
"0.55145824",
"0.55132073",
"0.55063874",
"0.5501865",
"0.5496784",
"0.54963547",
"0.54962593"
] | 0.8140332 | 0 |
Sets the debug mode of the vivarium. In debug mode, informations is written: sight areas, speed, direction, and the turtles' actual position. | public void setDebug(boolean isDebug)
{
this.isDebug = isDebug;
this.repaint();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setDebugMode(final boolean dMode) { debugMode = dMode; }",
"void setDebug(boolean mode) {\n\t\tdebug = mode;\n\t}",
"public void setDebugMode(boolean debugMode)\r\n {\r\n this.debugMode = debugMode;\r\n }",
"@Override\n\tpublic void setDebugMode(boolean debug) {\n\n\t}",
"public void setDebug(boolean value) {\n\t\tdebug = value;\n\t}",
"public void setDebugMode(boolean debugMode) {\n this.debugMode = debugMode;\n }",
"public void setDebugMode(boolean status)\n {\n debugMode = status;\n }",
"@Override\n\tpublic void setDebugMode(int debugMode) {\n\n\t}",
"public static void setDebugMode(boolean debugMode) {\n mDebug = debugMode;\n }",
"public void setDebug(boolean b) { debug = b; }",
"public void setDebug(boolean f) {\n debug = f;\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 void setDebug( boolean debugF ) {\n\t\tthis.debug = debugF;\n\t\t}",
"public static void setDebug(boolean debug) {\n IsDebug = debug;\n if (debug)\n setLevel(VERBOSE);\n else\n setLevel(INFO);\n }",
"public void setDebug(boolean debug) {\n this.debug=debug;\n }",
"void setDebugEnabled(boolean value) {\r\n debug_enabled = value;\r\n }",
"public static void setDebug(boolean d) {\n\t\tdebug = d;\n\t}",
"@Override\n\tpublic void setDebug(boolean isDebug) {\n\t\t\n\t}",
"public void setDebugging(boolean on)\n\t{\n\t\t_options.setDebugging(on);\n\t}",
"public void setDebug(boolean debug) {\n this.debug = debug;\n }",
"public void setDebug(boolean debug) {\n this.debug = debug;\n }",
"void debug() {\n this.renderer.debug = !this.renderer.debug;\n reload();\n }",
"public void setDebug(final boolean debug)\n {\n this.debug = debug;\n }",
"public void setDebug(boolean debug) {\n\t\tthis._debug = debug;\n\t}",
"void setDebugPort(Integer debugPort);",
"public void enableDebug() {\n this.debug = true;\n }",
"public final void setDebug() {\r\n setLevel(org.apache.log4j.Level.DEBUG);\r\n }",
"public void toggleDebug() {\n\t\tdebug = debug ? false : true;\n\t}",
"public void toggleDebugMode() {\r\n DEBUG = !DEBUG;\r\n }",
"public void setDebug(IRubyObject debug) {\n this.debug = debug.isTrue();\n }",
"public void setDebug(IRubyObject debug) {\n this.debug = debug.isTrue();\n }",
"public static void enableDebugging(){\n DEBUG = true;\n }",
"public void setDebuggable(boolean debug) {\n this.debug = debug;\n }",
"public static void setDebug(boolean db) {\n\n\t\tdebug = db;\n\n\t}",
"public static void setDebug(boolean flag)\n\t{\n\t\tm_debugFlag = flag;\n\t}",
"public void debug( int level ) {\r\n\t\tdebugLevel = level;\r\n\t\ts.debug(debugLevel);\r\n\t}",
"public boolean getDebugMode() { return debugMode; }",
"public void setDebug(boolean debug, PrintStream out)\n {\n session.setDebug(debug);\n if (debug)\n session.setDebugOut(out);\n }",
"public static void setDebug(int b) {\n debug = b;\n }",
"public void setDebugEnabled(boolean debugEnabled) {\n this.debugEnabled = debugEnabled;\n }",
"public void logDebugData() {\n SmartDashboard.putNumber(\"Ele Pos\", getPosition());\n SmartDashboard.putBoolean(\"Ele Switch\", bottomSwitchValue());\n SmartDashboard.putNumber(\"Ele Current\", getCurrent());\n SmartDashboard.putNumber(\"Ele Out %\", elevatorSpark.getAppliedOutput());\n }",
"public void setDisplayDebug(boolean displayDebug) {\n this.displayDebug = displayDebug;\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 static void debug(boolean d) {\n D = d;\n }",
"public void setBufferDebug( boolean debug ) {\n\t\tthis.buffer.setDebug( debug );\n\t\t}",
"protected void doDebug(Renderer r) {\n \t\t\tif (showBounds) {\n \t\t\t\tDebugger.drawBounds(rootNode, r, true);\n \t\t\t}\n \n \t\t\tif (showNormals) {\n \t\t\t\tDebugger.drawNormals(rootNode, r);\n \t\t\t\tDebugger.drawTangents(rootNode, r);\n \t\t\t}\n \t\t}",
"public void debug() {\n\n }",
"static void debug() {\n ProcessRunnerImpl.setGlobalDebug(true);\n }",
"protected void setDebugging(boolean debugging) {\n\t\tthis.debugging = debugging;\n\t}",
"public boolean isDebugMode() {\n return debugMode;\n }",
"public boolean getDebugMode()\n {\n return debugMode;\n }",
"@FXML\n\tpublic void logDebugLevel() {\n\t\tcheckFieldEditOrNot = true;\n\t\tSX3Manager.getInstance().addLog(\"Debug Level : \" + debugValue.getValue() + \".<br>\");\n\t\tlogDetails1.getEngine().setUserStyleSheetLocation(\"data:,body{font: 12px Arial;}\");\n\n\t\tlogDetails1.getEngine().executeScript(\"window.scrollTo(0, document.body.scrollHeight);\");\n\t}",
"protected static void setDebugLevel(int debugLevel) {\n Program.debugLevel = debugLevel;\n }",
"static public void setLevel( byte level ) {\n Debug.level=level;\n }",
"public void setDebugOn(boolean flag)\n {\n this.setProperty(GUILoggerSeverityProperty.DEBUG, flag);\n }",
"public boolean isDebug( ) {\n\t\treturn debug;\n\t}",
"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 boolean debugOn()\r\n {\r\n on = true;\r\n System.out.println(\"Debug Mode On\");\r\n return on;\r\n }",
"void displayDebugInformation() {\n\t\tmyParent.text(\"X\", X.x + 10, X.y + 5);\n\t\tmyParent.text(\"Y\", Y.x + 10, Y.y + 5);\n\t\tmyParent.text(\"Z\", Z.x + 10, Z.y + 5);\n\t\tmyParent.text(\"Q\", Q.x + 10, Q.y + 5);\n\t\tmyParent.fill(255);\n\n\t\tString pointFocuses = \"\";\n\t\tString stickedPoints = \"\";\n\t\tfor (int i = 0; i < amount; i++) {\n\t\t\tpointFocuses += point[i].isFocusedOnThePoint() + \" \";\n\t\t\tstickedPoints += point[i].sticked + \" \";\n\n\t\t\t// fill(200);\n\t\t\tmyParent.text(i, point[i].x + 10, point[i].y + 5);\n\t\t}\n\n\t\tmyParent.text(\"state: \" + state + \"\\nfocused on line: \" + selectedLine + \"\\nfocused on point: \" + selectedPoint\n\t\t\t\t+ \"\\nmouseLockedToLine: \" + mouseLockedToLine + \"\\npointFocuses: \" + pointFocuses + \"\\nstickedPoints: \"\n\t\t\t\t+ stickedPoints + \"\\ndragLock: \" + dragLock + \"\\ndiagonal scale factor: \" + diagonalScaleFactor\n\t\t\t\t+ \"\\npress D to hide debug\", 40, myParent.height - 160);\n\n\t\t// diplayNeighborPoints();\n\t}",
"@Override\n\tpublic boolean isDebugEnabled() {\n\t\treturn debugEnabled;\n\t}",
"@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}",
"void k2h_set_debug_level_silent();",
"public void setDebugSend( boolean debug_on_off )\n {\n debug_send = debug_on_off;\n }",
"public void debug()\r\n {\n \t\treload();\r\n }",
"public void print_DEBUG() {\n\t\tSystem.out.println(\"Direction\");\n\t\tSystem.out.println(\"ID: \" + ID);\n\t\tSystem.out.println(\"FROM: \" + from.name() );\n\t\tSystem.out.println(\"TO: \" + to.name() );\n\t\tSystem.out.println(\"dir: \" + dir);\n\t\tSystem.out.println(\"Locked: \" + locked);\n\t\tSystem.out.println(\"LockPattern: \" + lockPattern);\n\t}",
"public boolean isDebugEnabled();",
"boolean isDebugEnabled();",
"public boolean isDebug() {\n\t\treturn debug;\n\t}",
"public boolean isDebug() {\n\t\treturn debug;\n\t}",
"public void printDebugMaze() {\n\t\tSystem.out.println(width);\n\t\tSystem.out.println(height);\n\n\t\tfor (int y = 0; y < height; y++) {\n\t\t\tfor (int x = 0; x < width; x++) {\n\t\t\t\tSystem.out.print(maze[x][y]);\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}",
"protected void debug(String string) {\n\t\tif (DEBUGMODE)\n\t\t\tSystem.out.println(string);\n\t}",
"public boolean isDebug();",
"public void disableDebug() {\n this.debug = false;\n }",
"public static void setVerbose(int b) {\n debug = b;\n }",
"public void setDebugCamera(String name) {\n if (mPresentationEngine != null) {\n mPresentationEngine.setDebugCamera(name);\n }\n }",
"public void setDebugServer(final boolean debugServer)\n {\n this.debugServer = debugServer;\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 }",
"public static void setDebug(boolean debug) {\n ButterKnife.debug = debug;\n }",
"public static void normalDebug(){\n enableVerbos = false;\n }",
"protected boolean isDebugEnable() {\n return BlurDialogEngine.DEFAULT_DEBUG_POLICY;\n }",
"public LagartoDOMBuilder enableDebug() {\n\t\tconfig.collectErrors = true;\n\t\tconfig.parserConfig.setCalculatePosition(true);\n\t\treturn this;\n\t}",
"public CompilationBuilder setDebug(boolean debug) {\n\t\tcompilerConfiguration.setDebug(debug);\n\t\treturn this;\n\t}",
"public final void debugStatement() throws RecognitionException {\n\t\ttry {\n\t\t\t// PrePro.g:71:15: ( DEBUG )\n\t\t\t// PrePro.g:71:17: DEBUG\n\t\t\t{\n\t\t\tmatch(input,DEBUG,FOLLOW_DEBUG_in_debugStatement270); if (state.failed) return;\n\t\t\t}\n\n\t\t}\n\t\tcatch (RecognitionException re) {\n\t\t\treportError(re);\n\t\t\trecover(input,re);\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t}",
"public static void disableDebugging(){\n DEBUG = false;\n }",
"public boolean getDebug() {\n return debug;\n }",
"public boolean getDebug() {\n return debug;\n }",
"public void setDebugFile(String fileName) {\r\n DEBUG_FILE = new File(fileName);\r\n }",
"public boolean isDebug()\n\t{\n\t\treturn this.debug;\n\t}",
"public boolean isDebug() {\n\t\treturn _debug;\n\t}",
"public static void debug(String message) {\n if (_debugMode) {\n System.out.println(\"[DEBUG] \" + message);\n }\n }",
"protected void execute() {\n \tRobot.debug.Update(Robot.lift.DebugMotionMagic());\n }",
"@Override\n protected boolean isDebugEnable() {\n return false;\n }",
"public void drawDebug(){\n debugRenderer.setProjectionMatrix(cam.combined);\n debugRenderer.begin(ShapeRenderer.ShapeType.Line);\n\n for (Object e : world.getEnemies()) {\n Enemy enemy = (Enemy)e;\n Rectangle rect = enemy.getBounds();\n float x1 = rect.x;\n float y1 = rect.y;\n debugRenderer.setColor(new Color(1, 0, 0, 1));\n debugRenderer.rect(x1, y1, rect.width, rect.height);\n }\n\n for(Bullet b : world.getPlayer().getWeapon().getBullets()) {\n Rectangle rect = b.getBounds();\n float x1 = rect.x;\n float y1 = rect.y;\n debugRenderer.setColor(new Color(1, 0, 0, 1));\n debugRenderer.rect(x1, y1, rect.width, rect.height);\n }\n\n for(Enemy e : world.getEnemies()) {\n for(Bullet b : e.getWeapon().getBullets()){\n Rectangle rect = b.getBounds();\n float x1 = rect.x;\n float y1 = rect.y;\n debugRenderer.setColor(new Color(1, 0, 0, 1));\n debugRenderer.rect(x1, y1, rect.width, rect.height);\n }\n }\n\n Player player = world.getPlayer();\n Rectangle rect = player.getBounds();\n float x1 = rect.x;\n float y1 = rect.y;\n debugRenderer.setColor(new Color(0, 1, 0, 1));\n debugRenderer.rect(x1, y1, rect.width, rect.height);\n debugRenderer.end();\n }",
"public boolean isDebugEnabled() {\n return debugEnabled;\n }",
"public boolean getDebug() {\n return this.debug;\n }",
"public boolean getDebug() {\n return this.debug;\n }",
"boolean isDebug();",
"boolean isDebug();",
"public void continueDebugStep() {\n \tthis.continueDebug = true;\n }",
"public static void setVerbose(boolean d, boolean i, boolean e) {\n D = d;\n I = i;\n E = e;\n }"
] | [
"0.72711664",
"0.7244664",
"0.70407593",
"0.7027068",
"0.7024826",
"0.70242673",
"0.7022962",
"0.70074457",
"0.6947203",
"0.6914258",
"0.68787986",
"0.68429554",
"0.68372655",
"0.6819996",
"0.6788898",
"0.6784682",
"0.6753676",
"0.6722735",
"0.6715798",
"0.6712605",
"0.6712605",
"0.6689563",
"0.66247845",
"0.66147757",
"0.6531591",
"0.65149385",
"0.64943796",
"0.647715",
"0.63985723",
"0.63918906",
"0.63918906",
"0.6306767",
"0.6290504",
"0.62626636",
"0.6230877",
"0.62127954",
"0.62035936",
"0.6195123",
"0.61523145",
"0.6143571",
"0.6083574",
"0.6081066",
"0.60725266",
"0.60716116",
"0.60645413",
"0.60143286",
"0.6005518",
"0.5997996",
"0.59914917",
"0.5990598",
"0.5965193",
"0.5944511",
"0.5928891",
"0.59226143",
"0.5890525",
"0.5864028",
"0.58599305",
"0.5832959",
"0.5824665",
"0.5823544",
"0.57840866",
"0.57745",
"0.5769536",
"0.5755886",
"0.5750574",
"0.57368547",
"0.57298857",
"0.5723266",
"0.5723266",
"0.5718443",
"0.56875825",
"0.5680342",
"0.56761247",
"0.56709415",
"0.5649749",
"0.56403625",
"0.5615962",
"0.55918026",
"0.55706763",
"0.5565832",
"0.5565262",
"0.5550697",
"0.55441797",
"0.5543364",
"0.55427724",
"0.55427724",
"0.55363494",
"0.5528799",
"0.5501883",
"0.549562",
"0.5489234",
"0.54867774",
"0.5486692",
"0.5483859",
"0.54591095",
"0.54591095",
"0.54530877",
"0.54530877",
"0.5450957",
"0.54348224"
] | 0.70242673 | 6 |
Paints this panel to represent the vivarium. | @Override
public void paint(Graphics g)
{
super.paint(g);
if(g instanceof Graphics2D)
{
// Initialize vars
Graphics2D graphics = (Graphics2D) g;
Dimension panelDimension = this.getSize();
Rectangle2D turtleBounds;
int fontHeight = g.getFontMetrics().getHeight();
// Clear drawing sheet
graphics.setColor(Color.WHITE);
graphics.fillRect(0, 0, (int) panelDimension.getWidth(), (int) panelDimension.getHeight());
// Draw every turtle
for(AbstractTurtle turtle : this.turtles)
{
// Draw the turtle's shape
graphics.setColor(turtle.getColor());
graphics.fill(turtle.getShape());
// Debug mode
if(this.isDebug)
{
// Draw the turtle's sight
graphics.setColor(Color.BLACK);
graphics.draw(turtle.getSight());
// Draw the turtle's center
graphics.setColor(Color.CYAN);
graphics.drawLine(
(int) turtle.getX() - 10,
(int) turtle.getY(),
(int) turtle.getX() + 10,
(int) turtle.getY()
);
graphics.drawLine(
(int) turtle.getX(),
(int) turtle.getY() - 10,
(int) turtle.getX(),
(int) turtle.getY() + 10
);
// Write the turtle's speed
turtleBounds = turtle.getShape().getBounds2D();
graphics.setColor(Color.BLACK);
graphics.drawString(
"Vitesse : " + String.format("%.2f", turtle.getSpeed()),
(int) turtleBounds.getMaxX() + 5,
(int) turtleBounds.getMinY() - 5
);
graphics.drawString(
"Direction : " + String.format("%.2f", turtle.getDirection()),
(int) turtleBounds.getMaxX() + 5,
(int) turtleBounds.getMinY() - 5 + fontHeight
);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public VivariumPanel()\n {\n // Call super constructor\n super();\n\n // Initialize properties\n this.turtles = new HashSet<>();\n this.isDebug = false;\n }",
"public VixHedgePanel() {\n initComponents();\n \n JPanel p1 = new VerticalPanel();\n p1.add(\"Strike Pirce\", m_strikePrice);\n \n this.add(p1, BorderLayout.NORTH);\n \n }",
"public Vivid() {\n super(\n new Color(229, 134, 6),\n new Color(93, 105, 177),\n new Color(82, 188, 163),\n new Color(153, 201, 69),\n new Color(204, 97, 176),\n new Color(36, 121, 108),\n new Color(218, 165, 27),\n new Color(47, 138, 196),\n new Color(118, 78, 159),\n new Color(237, 100, 90),\n new Color(204, 58, 142),\n new Color(165, 170, 153)\n\n );\n\n }",
"public void paint( VisualGraphComponent component, Graphics2D g2d );",
"public ValmarFrame(){\n\t\tsetTitle(\"Valmar\");\n\t setSize(500, 450);\n\t addWindowListener (new Closer());\n\t setVisible(true);\n\t setResizable(false);\n\t //add the game panel\n\t Dimension dim = getSize();\n\t Insets in=getInsets();\n\t setSize(dim.width+in.right+in.left, dim.height+in.top+in.bottom);\n\t Panel pan=new ValmarPanel(createImage(dim.width, dim.height),null);\n\t pan.setBounds(in.left, in.top, dim.width, dim.height);\n\t add(pan);\n\t}",
"@Override\r\n\tpublic void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\r\n\t\t\tthis.draw(g);\r\n\t\t\r\n\t\r\n\t}",
"public PanelVentas() {\n initComponents();\n \n this.scpContenedor.getVerticalScrollBar().setUnitIncrement(Recursos.scpDesplazamiento);\n this.scpContenedor.getHorizontalScrollBar().setUnitIncrement(Recursos.scpDesplazamiento);\n \n }",
"@Override\n public void paintComponent(Graphics g) {\n g.setColor(Color.WHITE);\n g.fillRect(0,0,super.getWidth(),super.getHeight());\n\n for (DrawableVector instruction : instructions){\n instruction.draw(g, getWidth(), getHeight());\n }\n if (currentInstruction != null){\n currentInstruction.draw(g, getWidth(), getHeight());\n }\n }",
"public ParticleDisplayer(int width, int height, VisualizerMain vm){\n\t\tthis.setPreferredSize(new Dimension(width, height));\n\t\tthis.setBackground(Color.magenta);\n\t\tthis.vm = vm;\n\t\t\n\t\tFlowLayout flowLayout = new FlowLayout();\n\t\tflowLayout.setVgap(0);\n\t\tflowLayout.setHgap(0);\n\t\tthis.setLayout(flowLayout);\n\t\t\n\t\t\n\t\tdisplayPred = new JList();\n\t\tdisplayPred.setLayout(flowLayout);\n\t\tdisplayPred.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\t\tdisplayPred.setLayoutOrientation(JList.VERTICAL);\n\t\tdisplayPred.addListSelectionListener(this);\n\t\tdisplayPred.setName(\"pred\");\n\t\tJScrollPane listScroller = new JScrollPane(displayPred);\n\t\tlistScroller.setPreferredSize(new Dimension(width, height-100));\n\t\t\n\t\tdisplayPrey = new JList();\n\t\tdisplayPrey.setLayout(flowLayout);\n\t\tdisplayPrey.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\t\tdisplayPrey.setLayoutOrientation(JList.VERTICAL);\n\t\tdisplayPrey.addListSelectionListener(this);\n\t\tdisplayPrey.setName(\"prey\");\n\t\tJScrollPane listScroller2 = new JScrollPane(displayPrey);\n\t\tlistScroller2.setPreferredSize(new Dimension(width, height-100));\n\n\t\t\n\t\tJTabbedPane tp = new JTabbedPane();\n\t\ttp.add(\"Predator\", listScroller);\n\t\ttp.add(\"Prey\", listScroller2);\n\t\ttp.setTabPlacement(JTabbedPane.BOTTOM);\n\t\tthis.add(tp);\n\t\t\n\t\t\n\t\tthis.add(new JLabel(\"Epoch:\"));\n\t\tSpinnerNumberModel model1 = new SpinnerNumberModel(minEpoch, minEpoch, maxEpoch, 1); \n\t\tepochSelector = new JSpinner(model1);\n\t\tepochSelector.setValue(0);\n\t\tepochSelector.setPreferredSize(new Dimension(width-50, 50));\n\t\tepochSelector.addChangeListener(this);\n\t\tthis.add(epochSelector);\n\t}",
"public VirtualPanel() {}",
"public VerticalProfileControl() {\n setAttributeFlags(FLAG_COLOR | FLAG_DATACONTROL | FLAG_DISPLAYUNIT);\n }",
"public Visualizador() {\n initComponents();\n inicializar();\n }",
"protected void paintComponent(Graphics graphics) {\n Graphics g = graphics.create();\n\tg.drawImage(vimage, 0, 0, null); \n g.dispose(); \n }",
"public Ventana_P() {\n\n try\n {\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n\n jPanelRentaAutos = new JPanelRentaAutos();\n jPanelGenerador = new JPanelGenerador();\n jPanelPrueba_Est = new JPanelPrueba_Est();\n jPanelInformacion = new JPanelInformacion();\n jPanelJuegoVolados = new JPanelJuegoVolados();\n jPanelSimulacionInventario = new JPanelSimulacionInventario();\n jPanelSevenEleven = new JPanelSevenEleven();\n jPanelRuleta = new JPanelRuleta();\n jPanelEjercicio4 = new JPanelEjercicio4();\n jPanelSimulacionesEjercicios6 = new JPanelSimulacionesEjercicios_6();\n jPanelSimulacionesEjercicio7 = new JPanelSimulacionesEjercicio7();\n jPanelEjercicio10 = new JPanelEjercicio10();\n jPanelEjercicio11 = new JPanelEjercicio11();\n jPanelEjercicio15 = new JPanelEjercicio15();\n numeros = new ArrayList<Float>();\n initComponents();\n this.setSize(800, 700);\n this.setResizable(false);\n NumerosRectangulares n = new NumerosRectangulares();\n \n ModVentana.centrar(this);\n }",
"public void paintComponent(Graphics g)\n {\n paintBorder(g);\n paintPlanets(g);\n paintEnemies(g);\n paintEntity(g, player);\n paintCameraBox(g);\n }",
"public void draw(){\n\t\tcomponent.draw();\r\n\t}",
"public void paintComponent(Graphics g, int width, int height) {\n g.setColor(Color.WHITE);\n g.fillRect(0,0,width,height);\n\n for (DrawableVector instruction : instructions){\n instruction.draw(g, width, height);\n }\n if (currentInstruction != null){\n currentInstruction.draw(g, width, height);\n }\n }",
"@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n\n Graphics2D g2 = (Graphics2D) g;\n g2.scale(2, 2);\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n g2.setColor(Color.WHITE);\n\n Application.grid.draw(g2);\n ui.draw(g2);\n }",
"@Override\n protected void paintInternal(IGraphicsTarget target,\n PaintProperties paintProps) throws VizException {\n }",
"public void draw() {\n\t\tsuper.repaint();\n\t}",
"@Override\r\n protected void paintComponent(Graphics g) {\r\n\r\n Graphics2D g2d = (Graphics2D) g;\r\n\r\n g2d.setColor(new Color(52, 73, 94));\r\n g2d.fillRect(0, 0, getWidth(), getHeight());\r\n }",
"@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n\n paintBackground(g);\n }",
"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}",
"protected synchronized void paintComponent (Graphics g)\n {\n super.paintComponent(g); \n JPanel Phil = new JPanel(); \n int width = getWidth();\n int height = getHeight();\n double x;\n double y;\n int phil_length;\n int phil_height;\n if(_panel_num==1)\n {\n phil_length = width/10;\n phil_height = height/3;\n x = width/3*1.35;\n y = height/3*1.2;\n if(_eats_status_array[0]==true)\n g.fillOval((int)x,(int)y,phil_length,phil_height);\n else\n g.fillRect((int)x,(int)y,phil_length,phil_height);\n }\n else if(_panel_num==2)\n {\n phil_length = width/3;\n phil_height = height/10;\n x = width/3;\n y = height/3*1.2;\n if(_eats_status_array[1]==true)\n g.fillOval((int)x,(int)y,phil_length,phil_height);\n else\n g.fillRect((int)x,(int)y,phil_length,phil_height);\n }\n else if(_panel_num==3)\n {\n phil_length = width/10;\n phil_height = height/3;\n x = width/6*3.42;\n y = height/4;\n if(_eats_status_array[2]==true)\n g.fillOval((int)x,(int)y,phil_length,phil_height);\n else\n g.fillRect((int)x,(int)y,phil_length,phil_height); \n x = width/6*1.92;\n y = height/4;\n if(_eats_status_array[3]==true)\n g.fillOval((int)x,(int)y,phil_length,phil_height);\n else\n g.fillRect((int)x,(int)y,phil_length,phil_height);\n }\n else \n {\n phil_length = width/3;\n phil_height = height/10;\n x = width/3;\n y = height/3*1.2;\n if(_eats_status_array[4]==true)\n g.fillOval((int)x,(int)y,phil_length,phil_height);\n else\n g.fillRect((int)x,(int)y,phil_length,phil_height);\n } \n }",
"public void paint(Graphics g) {\n\t\tthis.recalculateSize();\n\t\t\n\t\tif(this.isOpaque())\t{\n\t\t\tg.setColor(getBackground());\n\t\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\t}\n\t\t\n\t\t\n\t\tComponent[] components = this.getComponents();\n\t\tfor(int i = components.length - 1; i >= 0; i --) {\n\t\t\tComponent c = components[i];\n\t\t\tint vc_x0 = c.getX();\n\t\t\tint vc_y0 = c.getY();\n\t\t\tint vc_x1 = vc_x0 + c.getPreferredSize().width;\n\t\t\tint vc_y1 = vc_y0 + c.getPreferredSize().height;\n\t\t\t\n\t\t\tif(this.insideSlideShow(vc_x0, vc_y0) || this.insideSlideShow(vc_x0, vc_y1)\n\t\t\t\t|| this.insideSlideShow(vc_x1, vc_y0) || this.insideSlideShow(vc_x1, vc_y1)) {\n\t\t\t\tc.setSize(c.getPreferredSize());\n\t\t\t\tc.paint(g.create(vc_x0, vc_y0, c.getPreferredSize().width, c.getPreferredSize().height));\n\t\t\t}\n\t\t}\n\t}",
"private JPanel createCanvas() {\n return new JPanel() {\n\n @Override\n protected void paintComponent(Graphics g) {\n super.paintComponent(g);\n element.drawMe((Graphics2D) g);\n }\n\n };\n }",
"@Override\r\n public void paint(Graphics g) {\r\n if (colorWheel == null)\r\n colorWheel = makeColorWheel();\r\n if (valueBar == null) {\r\n valueBar = createImage(valueBarWidth + 3, diameter + 3);\r\n redrawValueBar = true;\r\n }\r\n if (redrawValueBar)\r\n drawValueBar(valueBar);\r\n\r\n // Draw the color wheel and value bar\r\n g.drawImage(colorWheel, offsetX, offsetY, this);\r\n\r\n int x = offsetX + colorWheelWidth + spacing;\r\n ;\r\n int y = offsetY + selectDiameter / 2;\r\n g.drawImage(valueBar, x, y, this);\r\n\r\n // Draw circle around current value in color wheel\r\n g.setColor(Color.black);\r\n g.drawOval(offsetX + colorX, offsetY + colorY,\r\n selectDiameter, selectDiameter);\r\n\r\n // Draw line at current color value\r\n g.setXORMode(Color.yellow);\r\n y += (diameter - diameter * currentHSBColor[2]);\r\n g.drawLine(x + 1, y + 1, x + valueBarWidth - 1, y + 1);\r\n }",
"public void draw(){\n if(isVisible) {\n double diameter = calcularLado(area);\n double side = 2*diameter;\n Canvas circle = Canvas.canvas;\n circle.draw(this, color, \n new Ellipse2D.Double(xPosition, yPosition, \n (int)diameter, side));\n }\n }",
"public SOSCanvas( SOS game ) {\n\t\t\n\t\tthis.game = game;\n\t\tthis.boxesPerLine = game.getDimension();\n\t\tthis.boxesPerLinePlace = CANVAS_SIZE / boxesPerLine; \n\t\tthis.setBackground( Color.CYAN );\n\t\tthis.setPreferredSize( new Dimension ( CANVAS_SIZE, CANVAS_SIZE ) );\n\t\trepaint();\n\t\t\n\t}",
"protected PersonajeGrafico(int v, int x, int y){\r\n\t\tthis.velocidad=v;\r\n\t\tpos = new Point(ancho * x, alto * y);\r\n\t\tsprites = new Vector<Vector<Icon>>();\r\n\t\t\t\t\r\n\t}",
"public void Display() \n {\n float theta = velocity.heading() + PI/2;\n fill(175);\n stroke(0);\n pushMatrix();\n translate(pos.x,pos.y);\n rotate(theta);\n beginShape();\n vertex(0, -birdSize*2);\n vertex(-birdSize, birdSize*2);\n vertex(birdSize, birdSize*2);\n endShape(CLOSE);\n popMatrix();\n }",
"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 }",
"@Override\n public void paintComponent() {\n Graphics2D graphics = gameInstance.getGameGraphics();\n graphics.setColor(Color.ORANGE);\n\n final int diff = (PacmanGame.GRID_SIZE/2) - pointCircleRadius;\n graphics.fill(new Ellipse2D.Double(this.x + diff, this.y + diff, pointCircleRadius*2, pointCircleRadius*2));\n }",
"@Override\n public void paint(Graphics g) {\n g.setColor(Color.white);\n g.fillRect(0, 0, getWidth(), getHeight() );\n\n for (PieceUI pieceUI : pieceUIList) {\n pieceUI.draw(g);\n }\n\n g.drawImage(trapeze.getTrapezeView(), 200, 400, null);\n }",
"public JPanel graficarMem (){\r\n\t\tJPanel panel = new JPanel(){\r\n\t\t\t@Override\r\n\t\t\tpublic void paint(Graphics g) {\r\n\t\t\t\t// dibujo la memoria\r\n\t\t\t\tint xpoints[] = { 20, 20, 140, 140};\r\n\t\t\t\tint ypoints[] = { 0, 15 * tamaņo,15 * tamaņo, 0 };\r\n\t\t\t\tint npoints = 4;\r\n\t\t\t\tg.drawPolygon(xpoints, ypoints, npoints);\r\n\t\t\t\t\r\n\t\t\t\t// dibujo las lineas de separacion de los espacios de la memoria\r\n\t\t\t\tint altura = 0;\r\n\t\t\t\tint sumaEspacios = 0;\r\n\t\t\t\tg.drawString(sumaEspacios + \"\", 0, 15);\r\n\t\t\t\tfor(int i = 0; i < numEspacios; i++){\r\n\t\t\t\t\taltura += espacios[i].getTamaņo() * 15;\r\n\t\t\t\t\tsumaEspacios += espacios[i].getTamaņo();\r\n\t\t\t\t\tg.drawString(sumaEspacios + \"\", 0, altura);\r\n\t\t\t\t\tg.drawString(espacios[i].getTamaņo() + \"\", 140, altura - (espacios[i].getTamaņo() * 15) / 2);\r\n\t\t\t\t\tg.drawLine(20, altura, 140, altura);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// dibujo las variables de los espacios\r\n\t\t\t\tint altura1 = 0;\r\n\t\t\t\tBasicStroke Bs = new BasicStroke(2f);\r\n\t\t\t\tGraphics2D g2D = (Graphics2D) g;\r\n\t\t\t\tg2D.setStroke(Bs);\r\n\t\t\t\tfor (int i = 0; i < numEspacios; i++) {\r\n\t\t\t\t\tint tamV = 0;\r\n\t\t\t\t\tint tamE = espacios[i].getTamaņo() * 15;\r\n\t\t\t\t\tint alturaV = altura1; \r\n\t\t\t\t\tfor (int j = 0; j < espacios[i].getVarEnMem().size(); j++) {\r\n\t\t\t\t\t\ttamV = espacios[i].getVarEnMem().get(j).getTamaņo() * 15;\r\n\t\t\t\t\t\tint puntosY[] = { alturaV, alturaV + tamV, alturaV + tamV, alturaV};\r\n\t\t\t\t\t\tg2D.setColor(espacios[i].getVarEnMem().get(j).getColor());\r\n\t\t\t\t\t\tif (espacios[i].getVarEnMem().get(j).getTamaņo() > 1) {\r\n\t\t\t\t\t\t\tg2D.drawString(espacios[i].getVarEnMem().get(j).getNombre() + \" \" + espacios[i].getVarEnMem().get(j).getTamaņo() + \"M\", 90, alturaV + (tamV / 2));\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tg2D.drawString(espacios[i].getVarEnMem().get(j).getNombre() + \" \" + espacios[i].getVarEnMem().get(j).getTamaņo() + \"M\", 90, alturaV + tamV);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tg2D.drawPolygon(xpoints, puntosY, npoints);\r\n\t\t\t\t\t\talturaV += tamV; \r\n\t\t\t\t\t}\r\n\t\t\t\t\taltura1 += tamE;\r\n\t\t\t\t}\r\n\t\t\t\tg2D.setColor(Color.BLACK);\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\tpanel.setPreferredSize(new Dimension(160, 15*this.getTamaņo() + 10));\r\n\t\t\r\n\t\treturn panel;\r\n\t}",
"@Override\n\tprotected void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\n\t\tGraphics2D g2 = (Graphics2D) g; \n\t\tg2.setColor(Color.lightGray);\n\t\tg2.fill(model.bg);\n\t\tg2.setColor(Color.darkGray);\n\t\tg2.fillPolygon(model.terrain);\n\t\tg2.setColor(Color.gray);\n\t\tfor (int i = 0; i < 20; i++) {\n\t\t\tg2.draw(model.circles.get(i));\n\t\t}\n\t\tif (model.curCircleSel != -1) {\n\t\t\tg2.setColor(Color.white);\n\t\t\tg2.setStroke(new BasicStroke(3));\n\t\t\tg2.draw(model.circles.get(model.curCircleSel));\n\t\t}\n\t\tg2.setColor(Color.RED);\n\t\tg2.fill(model.pad);\n\t\tif (curPadSel) {\n\t\t\tg2.setColor(Color.white);\n\t\t\tg2.setStroke(new BasicStroke(3));\n\t\t\tg2.draw(model.pad);\n\t\t}\n\t}",
"@Override\n public void display() {\n EasyViewer.beginOverlay();\n \n glColor4d( 0,1,0,alpha.getValue() );\n glLineWidth(2); \n glBegin( GL_LINE_STRIP );\n for ( int i = 0; i < 10; i++) {\n glVertex2d( 200 + i*10, 100 +i*i );\n }\n glEnd();\n \n glColor4d( 1,0,0,alpha.getValue() );\n glPointSize(5);\n glBegin( GL_POINTS );\n for ( int i = 0; i < 10; i++) {\n glVertex2d( 200 + i*10, 100+i*i );\n } \n glEnd();\n \n \n // lets draw some 2D text\n// glColor4d( 1,1,1,1 ); \n// EasyViewer.printTextLines( \"(100,100)\", 100, 100, 12, GLUT.BITMAP_HELVETICA_10 );\n// glRasterPos2d( 200, 200 );\n// EasyViewer.printTextLines( \"(200,200)\\ncan have a second line of text\", 200, 200, 12, GLUT.BITMAP_HELVETICA_10 );\n \n EasyViewer.endOverlay();\n \n }",
"public JPanel buildPanel() {\n\t\tsetLayout(new BorderLayout());\n\t\tsetBackground(ClientConstants.LIGHT_YELLOW);\n\t\tJLabel graphPlotLabel = new JLabel(ClientConstants.GRAPH_PLOT, JLabel.CENTER);\n\t\tgraphPlotLabel.setFont(ClientConstants.TEXT_FONT);\n\t\tadd(graphPlotLabel, BorderLayout.NORTH);\n\t\tsetLayout(new BorderLayout());\n\t\taffectiveGraphPlot = new AffectivePlot();\n\t\tClientDataSingleton.getInstance().setAffectivePlot(affectiveGraphPlot);\n\t\taffectiveGraphPlot.setBackground(Color.WHITE);\n\t\tadd(affectiveGraphPlot);\n\t\treturn this;\n\t}",
"protected abstract void paintVectors(Graphics2D g);",
"public void draw() {\n draw(this.root, new RectHV(0.0, 0.0, 1.0, 1.0));\n }",
"public void paintComponent(Graphics page)\n {\n super.paintComponent(page);\n\n //set color, then draw a rectangle\n page.setColor(currentColor);\n\n page.drawRect(x1, y1, currentWidth, currentHeight);\n }",
"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}",
"@Override\n public void paint(Graphics g) {\n }",
"public JVDraw() {\r\n\t\tsetDefaultCloseOperation(DISPOSE_ON_CLOSE);\r\n\t\tsetLocation(250, 250);\r\n\t\tsetSize(500, 500);\r\n\t\tsetTitle(\"JVDraw\");\r\n\r\n\t\tsetLayout(new BorderLayout());\r\n\r\n\t\tJPanel toolbar = new JPanel(new FlowLayout(FlowLayout.LEFT));\r\n\r\n\t\tJColorArea jca = new JColorArea(Color.BLACK);\r\n\t\tJColorArea jca2 = new JColorArea(Color.WHITE);\r\n\r\n\t\ttoolbar.add(jca);\r\n\t\ttoolbar.add(jca2);\r\n\t\tShapeButtons sbg = new ShapeButtons(Shape.LINE);\r\n\t\ttoolbar.add(sbg);\r\n\t\tadd(toolbar, BorderLayout.NORTH);\r\n\r\n\t\tdrawingModel = new DrawingModelImpl();\r\n\t\tdrawingCanvas = new JDrawingCanvas(drawingModel);\r\n\r\n\t\tadd(drawingCanvas, BorderLayout.CENTER);\r\n\r\n\t\tdrawingModel.addDrawingModelListener(drawingCanvas);\r\n\t\tmouseCreator = new MouseCreator(drawingModel, jca, jca2, sbg);\r\n\t\tdrawingCanvas.addMouseListener(mouseCreator);\r\n\t\tdrawingCanvas.addMouseMotionListener(mouseCreator);\r\n\r\n\t\tlistModel = new DrawingObjectListModel(drawingModel);\r\n\t\tdrawingModel.addDrawingModelListener(listModel);\r\n\r\n\t\tadd(new DrawingObjectList(listModel), BorderLayout.EAST);\r\n\r\n\t\tJMenuBar menuBar = new JMenuBar();\r\n\t\tsetJMenuBar(menuBar);\r\n\t\tJMenu fileMenu = new JMenu(\"File\");\r\n\t\tmenuBar.add(fileMenu);\r\n\t\tfileMenu.add(new OpenAction(this));\r\n\t\tfileMenu.add(new SaveAction(this));\r\n\t\tfileMenu.add(new SaveAsAction(this));\r\n\t\tfileMenu.add(new ExportAction(this));\r\n\t\tfileMenu.add(new ExitAction(this));\r\n\r\n\t\tdrawingModel.addDrawingModelListener(new DrawingModelListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void objectsRemoved(DrawingModel source, int index0, int index1) {\r\n\t\t\t\tmodified = true;\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void objectsChanged(DrawingModel source, int index0, int index1) {\r\n\t\t\t\tmodified = true;\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void objectsAdded(DrawingModel source, int index0, int index1) {\r\n\t\t\t\tmodified = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tadd(new StatusBar(jca, jca2), BorderLayout.SOUTH);\r\n\t}",
"private void draw() {\n Graphics2D g2 = (Graphics2D) image.getGraphics();\n\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);\n\n AffineTransform transform = AffineTransform.getTranslateInstance(0, height);\n transform.concatenate(AffineTransform.getScaleInstance(1, -1));\n g2.setTransform(transform);\n\n int width = this.width;\n int height = this.height;\n if (scale != 1) {\n g2.scale(scale, scale);\n width = (int) Math.round(width / scale);\n height = (int) Math.round(height / scale);\n }\n AbstractGraphics g = new GraphicsSWT(g2);\n\n g.setScale(scale);\n if (background != null) {\n g.drawImage(background, 0, 0, width, height);\n }\n\n synchronized (WFEventsLoader.GLOBAL_LOCK) {\n for (Widget widget : widgets) {\n if (widget != null) widget.paint(g, width, height);\n }\n }\n // draw semi-transparent pixel in top left corner to workaround famous OpenGL feature\n g.drawRect(0, 0, 1, 1, Color.WHITE, .5, PlateStyle.RectangleType.SOLID);\n\n g2.dispose();\n }",
"@Override\n\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\tsuper.paintComponent(g);\n\t\t\t\tfor (int i = 0; i < inc.length; i++) {\n\t\t\t\t\tg.setColor(new Color(220 - i * 50, 220 - i * 50, 220 - i * 50));\n\t\t\t\t\tg.fillOval(inc[i][0], inc[i][1], 30, 30);\n\t\t\t\t}\n\t\t\t\tg.setColor(Color.yellow);\n\t\t\t\tg.fillOval(x, h, 30, 30);\n\n\t\t\t\t// 장애물\n\t\t\t\tg.setColor(Color.red);\n\t\t\t\tg.fillRect(0, 480, 800, 20);\n\t\t\t\tg.fillRect(400, 200, 50, 300);\n\t\t\t\tg.fillRect(300, 350, 100, 30);\n\t\t\t\t//\n\t\t\t\tGraphics2D g2 = bi.createGraphics();\n//\t\t\t\tthis.paintAll(g2);\n\t\t\t}",
"public void paintComponent(Graphics g)\r\n\t{\r\n\t\t//Sets the size and locations.\r\n\t\tsuper.paintComponent(g);\r\n\t\tsetSize(205,95);\r\n\t\tsetLocation(445,380);\r\n\r\n\t\t//Draws the outer rectangle of the slider.\r\n\t\tg.setColor(Color.black);\r\n\t\tg.drawRect(0, 20, 200, 30);\r\n\r\n\t\t//Draws the button that is moved when controlling the system.\r\n\t\tg.fillRect(border, 22, 25, 25);\r\n\t\tg.setColor(Color.red);\r\n\r\n\t\t//Sets the middle line, indicating the current value.\r\n\t\tg.drawLine((int)getCurrentValue(), 22, (int)getCurrentValue(), 46);\r\n\r\n\t\t//Markers for the inside of the Controller\r\n\t\tg.setColor(Color.GRAY);\r\n\t\tg.drawLine(100, 25, 100, 50); //Med\r\n\r\n\t\tfor (int i = 0; i<20; i++)\r\n\t\t\tg.drawLine(14+i*9, 28, 14+i*9, 42);\r\n\r\n\t\t//Draws the OFF, MED and MAX markers for the controller.\r\n\t\tg.setColor(Color.black);\r\n\t\tg.drawString(\"O\", 10, 65);\r\n\t\tg.drawString(\"F\", 10, 78);\r\n\t\tg.drawString(\"F\", 10, 91);\r\n\t\tg.drawString(\"M\", 96, 65);\r\n\t\tg.drawString(\"E\", 96, 78);\r\n\t\tg.drawString(\"D\", 96, 91);\r\n\t\tg.drawString(\"M\", 181, 65);\r\n\t\tg.drawString(\"A\", 181, 78);\r\n\t\tg.drawString(\"X\", 181, 91);\r\n\r\n\t\tg.drawString(\"System Controller\", 50, 15);\r\n\r\n\t}",
"protected void paintComponent(Graphics g) {\r\n\t\tsuper.paintComponent(g);\r\n\r\n\t\t\r\n\t\tInsets ins = this.getInsets();\r\n\t\tint varX = ins.left+5;\r\n\t\tint varY = ins.top+5;\r\n\r\n\t\tif ( pozicijaIgraca.equals(\"gore\")){\t\t\t\r\n\t\t\tfor(Card karta : karte){\r\n\t\t\t\tkarta.moveTo(varX, varY);\r\n\t\t\t\tkarta.draw(g, this);\r\n\t\t\t\tvarX = varX + karta.getWidth()+5;\r\n\t\t\t}\r\n\t\t\tg.setColor(Color.RED);\r\n\t\t\tg.drawString(imeIgraca, varX - 120, varY + 100);\r\n\t\t} else {\r\n\t\t\tfor(Card karta : karte){\r\n\t\t\t\tkarta.moveTo(varX, varY);\r\n\t\t\t\tkarta.draw(g, this);\r\n\t\t\t\tvarX = varX + karta.getWidth()/2;\r\n\t\t\t\tvarY = varY + karta.getHeight()/10;\r\n\t\t\t}\r\n\t\t\tg.setColor(Color.RED);\r\n\t\t\tg.drawString(imeIgraca, varX - 100 , varY + 90);\r\n\t\t}\r\n\t\t\r\n\r\n\t}",
"@Override\r\n\t\tpublic void paint(Graphics g) {\n\t\t\tsuper.paint(g);\r\n\t\t}",
"@Override\r\n\tpublic void paintComponent(Graphics g) {\r\n\t\tsuper.paintComponent(g);\r\n\t\t//parent.log(\"Height = \" + getHeight());\r\n\t\tpaintGrid((Graphics2D) g);\r\n\t\tpaintMap((Graphics2D) g);\r\n\t\tif (parent.showMesh) paintMesh((Graphics2D) g);\r\n\t\tpaintParticles((Graphics2D) g);\r\n\t\tpaintRobot((Graphics2D) g);\r\n\t\tpaintTarget((Graphics2D) g);\r\n\t\tpaintPath((Graphics2D) g);\r\n\t\tpaintMoves((Graphics2D) g);\r\n\t\tpaintFeatures((Graphics2D) g);\r\n\t\tpaintWaypoints((Graphics2D) g);\r\n\t}",
"void effacer() {\r\n Graphics g = this.zoneDessin.getGraphics();\r\n g.setColor(Color.gray);\r\n g.fillRect(0, 0, this.getWidth(), this.getHeight());\r\n }",
"public void paint(Graphics pane) {\r\n\t\tfinal int DELTA = 2; // The offset within the box/frame\r\n\r\n\t\tpane.setColor(Color.black); // Drawing the box/frame of the element\r\n\t\tpane.drawRect(x, y, WIDTH, HEIGHT);\r\n\r\n\t\tpane.setColor(color); // and the inside of the element\r\n\t\tpane.fill3DRect(x + DELTA, y + DELTA, WIDTH - 2 * DELTA + 1, HEIGHT - 2\r\n\t\t\t\t* DELTA + 1, hilite);\r\n\t}",
"@Override\n protected void paintComponent(Graphics g)\n {\n Graphics2D g2 = (Graphics2D) g;\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\n RenderingHints.VALUE_ANTIALIAS_ON);\n\n Rectangle r = getBounds();\n g2.setColor(theme.getPitColor());\n // Paint different shapes depending on the shape type\n switch(theme.getPitShape())\n {\n case CIRCLE:\n g2.fillOval(0, 0, r.width, r.height);\n break;\n case SQUARE:\n g2.fillRect(0, 0, r.width, r.height);\n break;\n }\n\n paintStoneCount(g2);\n }",
"protected void drawPlot()\n\t{\n \t\tfill(255);\n \t\tbeginShape();\n \t\tvertex(m_ViewCoords[0] - 1, m_ViewCoords[1] - 1);\n \t\tvertex(m_ViewCoords[2] + 1, m_ViewCoords[1] - 1);\n \t\tvertex(m_ViewCoords[2] + 1, m_ViewCoords[3] + 1);\n \t\tvertex(m_ViewCoords[0] - 1, m_ViewCoords[3] + 1);\n \t\tendShape(CLOSE);\n\t}",
"private JPanel getJPGraficoViolacao()\n\t{\n\t\tif ( jPGraficoViolacao == null )\n\t\t{\n\t\t\tjPGraficoViolacao = new JPanel();\n\t\t\tjPGraficoViolacao.setLayout(null);\n\t\t\tjPGraficoViolacao.setBounds(new Rectangle(530, 210, 465, 400));\n\t\t}\n\t\treturn jPGraficoViolacao;\n\t}",
"public TetrisGameView(TetrisGame game) {\r\n\t\tsuper();\r\n\t\tthis.game = game;\r\n\t\t// creates a new panel based on the width (num of blocks wide) * the actual length of each block,\r\n\t\t// and the height (num of blocks tall) * the actual length of each block.\r\n\t\tpanel = new DrawingPanel(TetrisGame.PANEL_WIDTH * TetrisGame.SQUARE_LENGTH,\r\n\t\t\t\t TetrisGame.PANEL_HEIGHT * TetrisGame.SQUARE_LENGTH);\r\n\t\t// gets the graphics on the panel.\r\n\t\tg = panel.getGraphics();\r\n\t}",
"public void paint() {\r\n\r\n\t\tsuper.paint();\r\n\t\r\n\t\tint len = _composites.size();\r\n\t\tfor (int i = 0; i < len; i++) {\r\n\t\t\tComposite c = _composites.get(i);\r\n\t\t\tc.paint();\r\n\t\t}\t\t\t\t\t\t\r\n\t}",
"@Override\n protected void paint2d(Graphics2D g) {\n \n }",
"public void voroDiagram() {\n\t\tPowerDiagram diagram = new PowerDiagram();\n\t\tdiagram.setSites(sites);\n\t\tdiagram.setClipPoly(clipPolygon);\n\t\tdiagram.computeDiagram();\n\t}",
"public void Draw() {\n \tapp.fill(this.r,this.g,this.b);\n\t\tapp.ellipse(posX, posY, 80, 80);\n\n\t}",
"public VoronoiVisualization()\n\t \t{\n\t\t super();\n\t \t}",
"public void paintComponent(Graphics g);",
"public void paintComponent(Graphics g)\r\n\t\t{\t\t\t\r\n\t\t\tsuper.paintComponent(g);\r\n\t\t\tthis.draw(g);\r\n\t\t}",
"public void paintComponent(Graphics g)\r\n\t\t{\t\t\t\r\n\t\t\tsuper.paintComponent(g);\r\n\t\t\tthis.draw(g);\r\n\t\t}",
"public void draw() {\n \n // TODO\n }",
"public void paint(Graphics pane){\n\t\tdrawPellet(pane, x, y);\n\t}",
"public AerithPanelPainter() {\n super();\n setUseCache(false);\n setAntialiasing(RenderingHints.VALUE_ANTIALIAS_ON);\n }",
"@Override\n public void paintComponent(Graphics g) \n {\n super.paintComponent(g);\n doDrawing(g);\n }",
"@Override\r\n\tprotected void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\r\n\t\tg.setColor(new Color(255, 0, 0));\r\n\t\tg.drawOval(mp1.getX(), mp1.getY(), 3*length, 3*length);\r\n\t\tg.setColor(new Color(0,0,255));\r\n\t\tg.drawOval(enenmy.getX(), enenmy.getY(), 3, 3);\r\n\t}",
"public ViewPanel(final ViewFrame viewFrame) {\n\t\tthis.setViewFrame(viewFrame);\n\t\tviewFrame.getModel().getObservable().addObserver(this);\n\t\t//this.setSize(640,384);\n\t\t/*JLabel image = new JLabel( new ImageIcon( \"C:/Users/Drazyl Dul/Desktop/sprite/pd.png\"));\n\t\tJLabel image2 = new JLabel( new ImageIcon( \"C:/Users/Drazyl Dul/Desktop/sprite/purse.png\"));\n\t\tJLabel image3 = new JLabel( new ImageIcon( \"C:/Users/Drazyl Dul/Desktop/sprite/gate_open.png\"));\n\t\tBorder blackline = BorderFactory.createLineBorder(Color.black,1); \n\t\t\n\t\tthis.setLayout(new GridLayout(12,20));\n\t\tfor(int i = 0; i<240;i++){*/\n\t\t //JPanel ptest = new JPanel();\n\t\t //ptest.setBorder(blackline);\n\t\t //this.add(image,0,0);\n\t\t \n\t\t// this.add(image3,0,2);\n\t\t\n\t\t}",
"public DadosVertice() {\n initComponents();\n }",
"@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n render(g);\n }",
"void paintComponent();",
"public void paintComponent(Graphics g) {\n \n g.setColor(Color.yellow);\n g.fillRect(0, 0, 150, 250);\n\n //rondeur des couleurs (taille et position)\n \n g.setColor(rouge);\n g.fillOval(50, 30, 50, 50);\n \n g.setColor(jaune);\n g.fillOval(50, 100, 50, 50);\n \n g.setColor(vert);\n g.fillOval(50, 170, 50, 50); \n }",
"public void draw() {\n drawBox();\n if (root == null) {\n return;\n }\n\n draw(root, ORIENTATION_VERTICAL);\n }",
"public void paint( java.awt.Graphics g )\n {\n super.paint( g ); // Ord gave us this\n\n canvasWidth = canvas.getWidth(); // Update original\n canvasHeight = canvas.getHeight(); // canvas dimensions\n\n double newHLineY = hLineProportion * canvas.getHeight();\n double newVLineX = vLineProportion * canvas.getWidth();\n\n hLine.setEndPoints(0, newHLineY, canvasWidth, newHLineY);\n vLine.setEndPoints(newVLineX, 0, newVLineX, canvasHeight);\n\n hLineMoved = vLineMoved = true;\n }",
"public void repaint() {\n setBackground(Color.white);\n super.repaint();\n setVisible(true);\n\n }",
"protected void paintComponent(Graphics g) \n {\t\t\n // clear panel\n g.setColor(Color.white);\n g.fillRect(0, 0, getSize().width, getSize().height);\n if( coords == null )\n return;\n\n int[][] tour = scaleTour(getSize().width, getSize().height);\n int nnodes = tour[0].length;\n\t\t\n // draw red lines connecting successive nodes \n g.setColor(Color.red);\n for( int i = 0; i < nnodes; i++ )\n {\n g.drawLine(tour[0][i], tour[1][i], tour[0][(i+1) % nnodes], tour[1][(i+1) % nnodes]);\n }\n\n // draw a yellow circle with orange boundary for each node\n for( int i = 0; i < nnodes; i++ )\n {\n g.setColor(Color.yellow);\n g.fillOval(tour[0][i] - diam/2, tour[1][i] - diam/2, diam, diam);\n g.setColor(Color.orange);\n g.drawOval(tour[0][i] - diam/2, tour[1][i] - diam/2, diam, diam);\n }\n }",
"public void paint(Graphics g) {\n super.paint(g);\n\n }",
"protected void paintComponent(Graphics g) {\r\n super.paintComponent(g);\r\n g.drawImage(i, 0, 0, null); // see javadoc for more info on the parameters \r\n }",
"@Override\r\n\tpublic void mouseClicked(MouseEvent me) {\n\t\tpgXYmov = new PaintGraphCircle(\"Vx\", \"Vy\", MC.getVX(), MC.getVY(), 1,\r\n\t\t\t\t1, 20, 20, 1);\r\n\t\tnew BigGraphicUniFrame(pgXYmov);\r\n\t}",
"@Override public void draw(){\n // this take care of applying all styles (colors/stroke)\n super.draw();\n // draw our shape\n pg.ellipseMode(PGraphics.CORNER); // TODO: make configurable\n pg.ellipse(0,0,getSize().x,getSize().y);\n }",
"private JPanel productVendArea() {\n JPanel productsToVend = new JPanel();\n productsToVend.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));\n int size = inventoryManager.getProductNumber();\n size = size % 2 == 0 ? size / 2 : size / 2 + 1;\n productButtons = new ArrayList<>();\n productsToVend.setLayout(new GridLayout(size,size, 10, 10)); // creating a 10x10 area\n ArrayList<String> products = inventoryManager.getProductInventory();\n for (String prod : products) {\n JButton temp = new JButton(prod);\n temp.addActionListener(new productListener());\n productButtons.add(temp);\n productsToVend.add(temp);\n }\n return productsToVend;\n }",
"public void draw(){\n super.repaint();\n }",
"@Override\n\tpublic void paintComponent(Graphics g)\n\t{\n\t\tsuper.paintComponent(g);\n\t\t//Draw the board and the table\n\t\tif (isTableVisible) {\n\t\t\tdrawBackground(this, g, gameInstance);\n\t\t}\n\n\t\tGraphics2D g2 = (Graphics2D)g;\n\t\tRenderingHints rh = new RenderingHints(RenderingHints.KEY_RENDERING,RenderingHints.VALUE_RENDER_QUALITY);\n\t\tg2.setRenderingHints(rh);\n\t\tg2.setTransform(boardToScreenTransformation);\n\t\tdrawPlayerIcons(this, g, gameInstance);\n\t\t//Draw all player related information\n\t\tdrawPlayerPositions(this, g, gameInstance, player, infoText);\n\n\t\t//Draw all objects not in some private area\n\t\tObjectFunctions.getDrawOrder(gameInstance, ial);\n\t\toiList.clear();\n\t\tgameInstance.getObjects(oiList);\n\t\tArrayList<ObjectInstance> drawableObjects = new ArrayList<>();\n\t\tCheckFunctions.drawableObjectsOnTable(oiList, drawableObjects);\n\t\tdrawableObjects.sort(ObjectFunctions.objectInstanceDrawValueComparator);\n\t\tial.clear();\n\t\tObjectFunctions.addObjectListToIdList(drawableObjects, ial);\n\t\tdrawObjectsFromList(this,g,gameInstance,player, ial);\n\n\t\t//Draw selection rectangle\n\t\tdrawSelection(this, g, player);\n\n\t\t//Draw Private Area\n\t\tif (!player.visitor) {\n\t\t\tdrawPrivateArea(this, g);\n\t\t}\n\n\n\t\tAffineTransform tmp = g2.getTransform();\n\t\tg2.setTransform(boardToScreenTransformation);\n\n\t\t//Redraw selected objects not in some private area\n\t\tial.clear();\n\t\tIntegerArrayList selectedObjects = new IntegerArrayList();\n\t\tObjectFunctions.getSelectedObjects(gameInstance, selectedObjects);\n\t\tfor (int id : selectedObjects){\n\t\t ial.addUnique(id);\n\t\t\tObjectFunctions.getAllAboveLyingObjects(gameInstance, player, gameInstance.getObjectInstanceById(id), ial2);\n ial.addUnique(ial2);\n\t\t}\n\t\tObjectFunctions.sortByDrawValue(gameInstance, ial);\n\t\t//ArrayUtil.unifySorted(ial);\n\t\tdrawObjectsFromList(this, g, gameInstance, player, ial, ial2);\n\n\n\t\t//Draw objects in private area\n\t\tif (!player.visitor && privateArea.zooming != 0) {\n\t\t\tdrawTokensInPrivateArea(this, g, gameInstance, player, hoveredObject);\n\t\t}\n\n\n\t\tg2.setTransform(tmp);\n\n\t\t//Draw debug informations\n\t\tif (isDebug) {\n\t\t\tDrawFunctions.drawDebugInfo(this, g2, gameInstance, player);\n\t\t}\n\t\tif (show_ping) {\n\t\t\tg2.drawString(\"Last Signal\", getWidth() - 100, 80);\n\t\t\tfor (int i = 0; i < gameInstance.getPlayerCount(); ++i)\n\t\t\t{\n\t\t\t\tPlayer pl = gameInstance.getPlayerByIndex(i);\n\t\t\t\tg2.drawString(pl.getName() + \" \" + ((System.nanoTime() - pl.lastReceivedSignal) / 100000000) / 10f, getWidth() - 100, 100 + 20 * i);\n\t\t\t}\n\t\t}\n\t}",
"public void paintComponent(Graphics g)\n {\n super.paintComponent(g);\n draw(g);\n }",
"public ColorPanel() {\r\n setLayout(null);\r\n\r\n chooser = new ColorChooserComboBox[8];\r\n chooserLabel = new JLabel[8];\r\n String[][] text = new String[][] {\r\n {\"Hintergrund\", \"Background\"},\r\n {\"Kante I\", \"Edge I\"},\r\n {\"Kante II\", \"Edge II\"},\r\n {\"Gewicht\", \"Weight\"},\r\n {\"Kantenspitze\", \"Edge Arrow\"},\r\n {\"Rand der Knoten\", \"Node Borders\"},\r\n {\"Knoten\", \"Node Background\"},\r\n {\"Knoten Kennzeichnung\", \"Node Tag\"}};\r\n\r\n for (int i = 0; i < 8; i++) {\r\n createChooser(i, text[i], 10 + 30 * i);\r\n }\r\n\r\n add(createResetButton());\r\n add(createApplyButton());\r\n add(createReturnButton());\r\n\r\n setColorSelection();\r\n this.changeLanguageSettings(mainclass.getLanguageSettings());\r\n }",
"void draw() {\n canvas.drawColor(Color.BLACK);\n insertSort(vstar);\n for( int i=0; i<NUMSTARS; i++){\n vstar[i].draw();\n }\n }",
"public void paintComponent(Graphics g)\n {\n int xRange = Integer.parseInt(xLabel);\n \n // Udhezimi per kthimin e vleres se variablave x1-6 ne proporcion me gjatsine e boshtit x te shprehur ne pixela\n int propX1 = ((x1*axisLength)/xRange)+xPos;\n int propX2 = ((x2*axisLength)/xRange)+xPos;\n int propX3 = ((x3*axisLength)/xRange)+xPos;\n int propX4 = ((x4*axisLength)/xRange)+xPos;\n int propX5 = ((x5*axisLength)/xRange)+xPos;\n int propX6 = ((x6*axisLength)/xRange)+xPos;\n \n g.setColor(Color.white);\n g.fillRect(0,0,width,height);\n g.setColor(Color.black);\n \n // Boshti x dhe y me gjatesi prej axisLength\n g.drawLine(xPos+2, yPos, xPos+axisLength, yPos);\n g.drawLine(xPos, yPos, xPos, yPos-axisLength);\n \n // Paraqitja e pikes max te boshtit x(xLabel) dhe boshtit y(yLabel)\n g.drawString(xLabel, xPos+axisLength, yPos+20);\n g.drawString(yLabel, xPos-20, yPos-axisLength);\n g.drawString(\"0\", xPos+5,yPos+20);\n g.drawString(\"0\", xPos-15,yPos-5);\n \n // Udhezimi per paraqitjen grafike te pikave ne panel\n g.fillOval(propX1,propY1-3,4,4);\n g.fillOval(propX2,propY2-3,4,4);\n g.fillOval(propX3,propY3-3,4,4);\n g.fillOval(propX4,propY4-3,4,4);\n g.fillOval(propX5,propY5-3,4,4);\n g.fillOval(propX6,propY6-3,4,4);\n \n // Udhezimi per paraqitjen e drejtezave te cilat lidhin pikat x1-5\n g.drawLine(propX1, propY1, propX2 ,propY2);\n g.drawLine(propX2, propY2, propX3, propY3);\n g.drawLine(propX3, propY3, propX4, propY4);\n g.drawLine(propX4, propY4, propX5, propY5);\n g.drawLine(propX5, propY5, propX6, propY6);\n }",
"@Override\n\tprotected void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\n\t\tfor (int i = 0; i < MyFrame.ROW; i++)\n\t\t\tfor (int j = 0; j < MyFrame.COLUMN; j++)\n\t\t\t\tMyFrame.cells[i][j].paint(g);\n\t}",
"@Override \r\n public void paintComponent(final Graphics theGraphics) { \r\n super.paintComponent(theGraphics); \r\n final Graphics2D g2d = (Graphics2D) theGraphics; \r\n \r\n final int width = myBoard.getWidth(); \r\n final int height = myBoard.getHeight(); \r\n g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, \r\n RenderingHints.VALUE_ANTIALIAS_ON); \r\n \r\n // draw purple game grid\r\n g2d.setColor(PURPLE); \r\n for (int i = 0; i < Math.max(width, height); i++) { \r\n final int lines = i * GRID_SIZING; \r\n \r\n //draws horizontal lines\r\n g2d.draw(new Line2D.Double(lines, ZERO, lines, height * GRID_SIZING));\r\n \r\n //draws vertical lines\r\n g2d.draw(new Line2D.Double(ZERO, lines, width * GRID_SIZING, lines));\r\n \r\n if (myBoard.isGameOver()) { \r\n myGameOver = true; \r\n myGamePaused = true; \r\n }\r\n } \r\n \r\n //update blocks\r\n drawCurrentPiece(g2d, height, width);\r\n drawFrozenBlocks(g2d, height, width);\r\n handlePausedGame(g2d);\r\n }",
"@Override\n protected void paintComponent(Graphics g) {\n super.paintComponent(g);\n g.drawImage(volvoImage, volvoPoint.x, volvoPoint.y, null); // see javadoc for more in fo on the parameters\n g.drawImage(saabImage, saabPoint.x, saabPoint.y, null);\n g.drawImage(scaniaImage, scaniaPoint.x, scaniaPoint.y, null);\n }",
"private synchronized void paint() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t\tBufferStrategy bs;\n\t\tbs = this.getBufferStrategy();\n\t\t\n\t\tGraphics2D g = (Graphics2D) bs.getDrawGraphics();\n\t\tg.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n\t\t\n\t\tg.setColor(Color.BLACK);\n\t\tg.fillRect(0, 0, this.getWidth(), this.getHeight());\n\t\t\n\t\tif(this.reiniciar == true){\n\t\t\tString ca = \"\" + cuentaAtras;\n\t\t\tg.setColor(Color.WHITE); \n\t\t\tg.setFont(new Font (\"Consolas\", Font.BOLD, 80));\n\t g.drawString(\"Puntuación: \" + puntuacion, 100, 200);\n\t \n\t g.setColor(Color.WHITE); \n\t\t\tg.setFont(new Font (\"Consolas\", Font.BOLD, 300));\n\t g.drawString(ca, 400, 500);\n\t \n\t g.setColor(Color.WHITE); \n\t\t\tg.setFont(new Font (\"Consolas\", Font.BOLD, 40));\n\t\t\tg.drawString(\"Pulsa enter para volver a jugar\", 150, 600);\n\t\t}\n\t\t\n\t\telse if(this.reiniciar == false){\n\t\t\tfor(int i=0;i<numDisparos;i++){ \n\t\t\t\t disparos[i].paint(g);\n\t\t\t}\n\t\t\tfor(int i=0;i<numAsteroides;i++){\n\t\t\t\t asteroides[i].paint(g);\n\t\t\t}\n\t\t\t\n\t\t\tif(this.isNaveCreada()==true && nave!=null){\n\t\t\t\tnave.paint(g);\n\t\t\t}\n\t\t\t\n\t\t\tif(enemigo.isVivo()==true){\n\t\t\t\tenemigo.paint(g);\n\t\t\t\t\n\t\t\t\tfor(int i=0;i<numDisparosE;i++){ \n\t\t\t\t\t disparosE[i].paint(g);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tg.setColor(Color.WHITE); \n\t\t\tg.drawString(\"Puntuacion \" + puntuacion,20,20); \n\t\t\t\n\t\t\tg.setColor(Color.WHITE); \n\t\t\tg.drawString(\"Vida \" + this.getVidas(),20,40);\n\t\t}\n\t\t\n\t\tg.dispose();\n\t\tbs.show();\n\t}",
"@Override\n\tpublic String toString() {\n\t\treturn \"\\n\\n \\tVertice [label=\" + label + \"] \";\n\t}",
"private static void draw() {\n\t\tinitField();\n\t\tview = new View(field);\n\t\tview.setSize(viewWidth, viewHeight);\n\t\tframe = new JFrame();\n\t\tframe.setSize(fwidth, fheight);\n\t\tframe.setTitle(\"Land Mine\");\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.add(view);\n\t\tframe.setVisible(true);\n\t}",
"public EnhancedVisualView(IReadOnlyModel model, int speed) {\n super();\n this.mm = (AnimationModel) model;\n VisualView vView = new VisualView(mm, speed);\n this.setTitle(vView.getTitle());\n this.setSize(vView.getSize());\n this.setExtendedState(this.getExtendedState() | JFrame.MAXIMIZED_BOTH);\n this.setDefaultCloseOperation(vView.getDefaultCloseOperation());\n\n //use a borderlayout with drawing panel in center and button panel in south\n this.setLayout(vView.getLayout());\n this.vPanel = new VisualPanel(mm, speed);\n vPanel.setPreferredSize(new Dimension(500, 500));\n this.add(vPanel, BorderLayout.CENTER);\n\n //set play button\n buttonPanel = new ButtonPanel();\n this.add(buttonPanel, BorderLayout.SOUTH);\n\n //sets the menu bar\n menuBar = new MenuPanel(mm.getShapes());\n this.add(menuBar, BorderLayout.WEST);\n\n vPanel.setSlider(menuBar.getJSlider());\n this.menuBar.getJSlider().setMinimum(0);\n this.menuBar.getJSlider().setMaximum(this.vPanel.getMaxTick());\n menuBar.getJSlider().setValue(0);\n menuBar.getJSlider().addChangeListener((ChangeEvent e) -> {\n JSlider source = (JSlider) e.getSource();\n int fps = (int) source.getValue();\n if (source.getValueIsAdjusting()) {\n vPanel.stopTimer();\n vPanel.setTick(fps);\n vPanel.repaint();\n } else {\n vPanel.startTimer();\n }\n });\n\n }",
"@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n\n Graphics2D g2d = (Graphics2D) g;\n drawAxis(g2d);\n \n drawCurve(g2d);\n \n drawPoints(g2d);\n \n // drawObject(g2d); **\n // El panel, por defecto no es \"focusable\". \n // Hay que incluir estas líneas para que el panel pueda\n // agregarse como KeyListsener.\n this.setFocusable(true);\n this.requestFocusInWindow();\n }",
"public void paintComponent(Graphics g) {\r\n\t\tsuper.paintComponent(g);\r\n\t\t\r\n\t\t// Setting drawings the global color.\r\n\t\tg.setColor( this.model.defaultV.movingColor ); \r\n\r\n\t\t//Painting all of the particles.\r\n\t\tfor(int i = 0; i < this.model.particleArray.size(); i++) {\r\n\t\t\tParticle p = (Particle) this.model.particleArray.get(i);\r\n\t\t\tint x = (int) p.x;\r\n\t\t\tint y = (int) p.y;\r\n\t\t\t\r\n\t\t\t// Changing the color accordingly.\r\n\t\t\tif( p.isMoving ) {\r\n\t\t\t\tg.setColor( p.color );\r\n\t\t\t} else {\r\n\t\t\t\tg.setColor( this.model.defaultV.stuckColor );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Painting each particle.\r\n\t\t\tg.fillRect(x, y, this.model.defaultV.particleSize, this.model.defaultV.particleSize);\r\n\t\t\t\r\n\t\t\tif (p.isTracking && p.trackingPath.size() > 1) {\r\n\t\t\t\tParticle firstPos = p.trackingPath.get(0); // Our very first particle position.\r\n\t\t\t\tfor(int j = 1; j < p.trackingPath.size() - 1; j++) {\r\n\t\t\t\t\tParticle secondPos = p.trackingPath.get(j);\r\n\t\t\t\t\t// draw line from first to second.\r\n\t\t\t\t\tGraphics2D g2 = (Graphics2D) g;\r\n\t\t\t\t\tLine2D lin = new Line2D.Float((int) firstPos.x, (int) firstPos.y, (int) secondPos.x, (int) secondPos.y);\r\n\t\t\t\t\tg.setColor( p.color );\r\n\t\t\t\t\tg2.draw(lin);\r\n\t\t\t\t\t// Set our first to the next.\r\n\t\t\t\t\tfirstPos = secondPos;\r\n\t\t\t\t}\r\n\t\t\t}\r\n }\r\n\t}",
"@Override\r\n\tpublic void paintComponent(Graphics g)\r\n {\r\n\t\tsuper.paintComponent(g);\r\n\t\tg.setColor(getForeground());\r\n\t\tg.fillOval(0,0, this.getWidth(),this.getHeight());\r\n }",
"public VectorPanel(BaseDataInstanceDoubleVector vector) {\n Vector = vector;\n initComponents();\n fillTable();\n }"
] | [
"0.6957113",
"0.66994464",
"0.62168586",
"0.5997642",
"0.5989472",
"0.59305245",
"0.5890003",
"0.58781385",
"0.58413583",
"0.5812258",
"0.5811426",
"0.5783746",
"0.5777757",
"0.57681376",
"0.5767648",
"0.576294",
"0.57469493",
"0.57089806",
"0.5700056",
"0.5688653",
"0.5684064",
"0.56681174",
"0.5662417",
"0.56514907",
"0.5633809",
"0.5632775",
"0.56221",
"0.5620837",
"0.5612329",
"0.5608697",
"0.56016415",
"0.55947435",
"0.5584632",
"0.5583759",
"0.5582473",
"0.557234",
"0.55657136",
"0.556417",
"0.55532414",
"0.55437285",
"0.55429155",
"0.55396485",
"0.5539431",
"0.55367744",
"0.5536698",
"0.55365944",
"0.5529482",
"0.552654",
"0.55204594",
"0.55189115",
"0.550697",
"0.55033237",
"0.54974884",
"0.54939365",
"0.54938143",
"0.54789025",
"0.54729635",
"0.5472931",
"0.54674006",
"0.5464087",
"0.5462552",
"0.54606396",
"0.5456481",
"0.5456481",
"0.5456433",
"0.5443132",
"0.54419607",
"0.54389083",
"0.5432959",
"0.5432811",
"0.5430849",
"0.5427088",
"0.54246277",
"0.5421873",
"0.5419909",
"0.5419449",
"0.541802",
"0.5417283",
"0.5414697",
"0.5413564",
"0.5413435",
"0.541235",
"0.54119134",
"0.5406708",
"0.5395636",
"0.539027",
"0.53837055",
"0.5379293",
"0.5377389",
"0.5376321",
"0.536817",
"0.5367121",
"0.53631675",
"0.53607064",
"0.53601205",
"0.53579634",
"0.53575534",
"0.5357493",
"0.53543997",
"0.53518057"
] | 0.57425 | 17 |
Called when a turtle is updated, be it its position or its color. | @Override
public void onTurtleUpdated(AbstractTurtle t)
{
// Fire paint event
this.repaint();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateTurtleOnView()\n\t{\n\t\t// update turtle info to View\n\t\tsetInfoParamsOfTurtleAndLine();\n\t\t\n\t\tif (this.isVisible() == 1)\n\t\t{\n\t\t\t// make turtle visible, then update turtle movement\n\t\t\tthis.myTurtleView.showTurtle(true);\n\t\t\tthis.myTurtleView.rotateAndMoveTurtle(this.getTurtleLocation(), this.getTurtleOrientation());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// tell view to make turtle invisible\n\t\t\tthis.myTurtleView.showTurtle(false);\n\t\t}\n\t}",
"protected abstract void updateShapeColor(Color color);",
"public void onUpdateColor() {\n getVertexBufferObject().onUpdateColor(this);\n }",
"@Override\n void individualUpdate() {\n timeToLive--;\n radius++;\n setColor();\n }",
"public static void update(){\n\t\t\n\t\tgraphFrame.setColor(color);\n\t}",
"@Override\n public void setTurtlePosition(double xPosition, double yPosition) {\n screenCreator.setTurtlePosition(xPosition,yPosition);\n }",
"public void update() {\n\t\tfirstMove = false;\n\t\tif (color == 1) xrange = -1;\n\t\tif (color == 0) xrange = 1;\n\t}",
"abstract public void setTurtle(TurtleModel t);",
"public void changeLocationOfTurtle(Point2D newLoc){ //WORKS\n\t\tsetTurtleLocToViewTurtleLoc();\n\t\tPoint2D locOrig = myTurtle.getLoc();\n\t\tmyTurtle.setLocation(newLoc);\n\t\tPoint2D locNew = myTurtle.getLoc();\n\t\tthis.moveTurtleImageAndDraw(locOrig, locNew);\n\t\tsetTurtleLocToViewTurtleLoc();\n\t\tthis.updateTurtleOnView();\n\t}",
"public void update() {\n\n difT();\n difXY();\n solveFlow();\n //drawColorFlow();\n }",
"public void setDataColor(Color c)\r\n/* 48: */ {\r\n/* 49: 36 */ this.ballColor = c;repaint();\r\n/* 50: */ }",
"public void update(){\n \tSystem.out.println(model.toString());\n\t\tnumberofsteps.setText(model.toString());\n\t\tint selectedColor = model.getCurrentSelectedColor();\n\t\t\n\t\t// Update dots\n\t\tfor (int i = 0; i < size; i++){\n\t\t\tfor (int j = 0; j < size; j++){\n\t\t\t\t// Assign captured dots to correct colour\n\t\t\t\tif (model.isCaptured(i, j))\n\t\t\t\t\tdots[i][j].setColor(selectedColor);\n\t\t\t}\n\t\t}\n\t\t\n }",
"public void updateCell() {\n alive = !alive;\n simulator.getSimulation().changeState(xPosition, yPosition);\n setColor();\n }",
"void hueUpdated() {\n\t\t\tfloat sin120 = (float) (Math.sqrt(3.) / 2.);\n\t\t\tfloat cos120 = -0.5f;\n\n\t\t\t// corners of the triangle\n\n\t\t\tax = (float) Math.cos(hue * 2 * Math.PI);\n\t\t\tay = (float) Math.sin(hue * 2 * Math.PI);\n\n\t\t\tcx = ax * cos120 - ay * sin120;\n\t\t\tcy = ax * sin120 + ay * cos120;\n\n\t\t\tbx = cx * cos120 - cy * sin120;\n\t\t\tby = cx * sin120 + cy * cos120;\n\n\t\t\tupdateGeometry();\n\t\t}",
"private void setTurtleLocToViewTurtleLoc()\n\t{\n\t\tSystem.out.println(\" in setTurtleLocToViewTurtleLoc \" + this.myTurtle.getLoc().getX() + \" \" +this.myTurtle.getLoc().getX());\n\t\tmyTurtle.setLocation(getViewTurtleLocation());\n\t}",
"private void updateLight() {\r\n\t}",
"public void setColor()\n {\n if(wall != null) // only if it's painted already...\n {\n wall.changeColor(\"yellow\");\n window.changeColor(\"black\");\n roof.changeColor(\"red\");\n sun.changeColor(\"yellow\");\n }\n }",
"public void setColor()\n {\n if (wall != null) // only if it's painted already...\n {\n wall.changeColor(\"red\");\n window.changeColor(\"black\");\n roof.changeColor(\"green\");\n sun.changeColor(\"yellow\");\n }\n }",
"@Override\n\tpublic void setShapeColor(Color color) {\n\t\tthis.currentColor = color;\n\t}",
"public void setColor()\n {\n if(wall != null) // only if it's painted already...\n {\n wall.changeColor(\"red\");\n window.changeColor(\"black\");\n roof.changeColor(\"green\");\n sun.changeColor(\"yellow\");\n }\n }",
"@Override\r\n\tpublic void updateGameState(float x, float y, float radius, Color color) {\n\t\tmain.updateGameState(x, y, radius, color);\r\n\t}",
"protected void update(){\n\t\t_offx = _x.valueToPosition(0);\n\t\t_offy = _y.valueToPosition(0);\n\t}",
"public void update( ) {\n\t\tdraw( );\n\t}",
"public void setColor(int color) {\n/* 77 */ this.color = color;\n/* 78 */ this.paint.setColor(this.color);\n/* */ }",
"public void update () {\n fill (175);\n rect(mouseX,mouseY,w,h);\n }",
"@Override\n public void init() {\n head.setFill(getColor());\n body.setFill(getColor());\n update();\n }",
"public void setColor(Color newColor)\n {\n this.color = newColor;\n conditionallyRepaint();\n }",
"public Color update() {\n /*\n * The method GetColor() returns a normalized color value from the sensor and\n * can be Useful if outputting the color to use an RGB LED or similar. To read\n * the raw color, or use GetRawColor().\n *\n * The color sensor works best when within a few inches from an object in well\n * lit conditions (the built in LED is a big help here!). The farther an object\n * is the more light from the surroundings will bleed into the measurements and\n * make it difficult to accurately determine its color.\n */\n edu.wpi.first.wpilibj.util.Color detectedColor = m_ColorSensor.getColor();\n /*\n * Run the color match algorithm on our detected color\n */\n String colorString;\n ColorMatchResult match = m_colorMatcher.matchClosestColor(detectedColor);\n\n if (match.color == kBlueTarget) {\n colorString = \"Blue\";\n mCurrentColor = Color.blue;\n } else if (match.color == kRedTarget) {\n colorString = \"Red\";\n mCurrentColor = Color.red;\n } else if (match.color == kGreenTarget) {\n colorString = \"Green\";\n mCurrentColor = Color.green;\n } else if (match.color == kYellowTarget) {\n colorString = \"Yellow\";\n mCurrentColor = Color.yellow;\n } else {\n colorString = \"Unknown\";\n mCurrentColor = Color.unknown;\n }\n /**\n * Open Smart Dashboard or Shuffleboard to see the color detected by the Sensor.\n */\n SmartDashboard.putNumber(\"Red\", detectedColor.red);\n SmartDashboard.putNumber(\"Green\", detectedColor.green);\n SmartDashboard.putNumber(\"Blue\", detectedColor.blue);\n SmartDashboard.putNumber(\"Confidence\", match.confidence);\n SmartDashboard.putString(\"Detected Color\", colorString);\n return mCurrentColor;\n }",
"@Override\n public void update(Observable o, Object arg) {\n if (arg instanceof Color && this.shapeSelected()) {\n Color color = (Color) arg;\n this.selectedShape.setColor(color);\n }\n }",
"void setColorWithRedraw(@ColorInt int color) {\n/* 167 */ this.mPaint.setColor(color);\n/* 168 */ onRedrawIfInitialized();\n/* */ }",
"public void setColor(Color newColor) ;",
"void setColor(){\n this.objectColour = new Color(rValue,gValue,bValue,timeToLive).brighter();\n }",
"private void changeShapeColor(int r, int g, int b)\n\t{\n\t\tthis.red = r;\n\t\tthis.green = g;\n\t\tthis.blue = b;\n\t}",
"private Point2D getViewTurtleLocation()\n\t{\n\t\treturn myTurtleView.getNewPoint();\n\t\n\t}",
"public void getColor() {\n\t\tPoint point = MouseInfo.getPointerInfo().getLocation();\n\t\trobot.mouseMove(point.x, point.y);\n\t\tColor color = robot.getPixelColor(point.x, point.y);\n//\t\tSystem.out.println(color);\n\t}",
"public void update() {\r\n\t\ttimePassed++; //increment time\r\n\t\t\r\n\t\tswitch(state) {\r\n\t\tcase GNS_REW:\r\n\t\t\tif (timePassed > greenNS) {\r\n\t\t\t\tstate = LightState.YNS_REW; // turn NS light yellow\r\n\t\t\t\ttimePassed = 0;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase YNS_REW:\r\n\t\t\tif (timePassed > yellowNS) {\r\n\t\t\t\tstate = LightState.RNS_GEW; // turn NS light red and EW light green\r\n\t\t\t\ttimePassed = 0;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase RNS_GEW:\r\n\t\t\tif (timePassed > greenEW) {\r\n\t\t\t\tstate = LightState.RNS_YEW; // turn EW light yellow\r\n\t\t\t\ttimePassed = 0;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase RNS_YEW:\r\n\t\t\tif (timePassed > yellowEW) {\r\n\t\t\t\tstate = LightState.GNS_REW; // turn NS light green and EW light red\r\n\t\t\t\ttimePassed = 0;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\t//if the state is something other than these four options, we have a serious issue...\r\n\t\t\tSystem.out.println(\"update(StopLight): something has gone horribly wrong\"); \r\n\t\t}\r\n\t}",
"void oscillate( float redColor, float greenColor, float blueColor ) {\n\t\t\tr = redColor;\n\t\t\tg = greenColor;\n\t\t\tb = blueColor;\n\t\t}",
"@Override\r\n\tpublic void update() {\n\t\tthis.repaint();\r\n\t}",
"synchronized private void changeColor()\n {\n if ( ++colorIndex == someColors.length )\n colorIndex = 0;\n setForeground( currentColor() );\n repaint();\n }",
"public void addTurtle(AbstractTurtle t)\n {\n // Add the turtle to the vivarium and observe it\n this.turtles.add(t);\n t.addObserver(this);\n\n // Then, fire paint event\n this.repaint();\n }",
"public void setColor( GraphColor newVal ) {\n color = newVal;\n }",
"public void Color() {\n\t\t\r\n\t}",
"public abstract void setColor(Color color);",
"public abstract void setColor(Color color);",
"void moveTurtle(int turtleIndex, Coordinate start, Coordinate end);",
"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 interface MovementView {\n\n /**\n * Tells the view to add al line for the turtle with the given index starting and ending at the given coordinates\n *\n * @param index - integer turtle index whose movement has drawn the line\n * @param start - coordinate start value in slogo coordinate system\n * @param end - coordinate end value in slogo coordinate system\n */\n void addLine(int index, Coordinate start, Coordinate end);\n\n /**\n * Tells the view to move the turtle with the given index from the start coordinate to the end coordinate\n *\n * @param turtleIndex - integer index of turtle to move\n * @param start - coordinate from which the turtle starts in slogo coordinate system\n * @param end - coordinate from which the turtle ends\n */\n void moveTurtle(int turtleIndex, Coordinate start, Coordinate end);\n\n /**\n * Tells the view to rotate a turtle with the given index\n *\n * @param turtleIndex - integer index of turtle to be rotated\n * @param degrees - double number of degrees to rotate the turtle clockwise\n */\n void rotateTurtle(int turtleIndex, double degrees);\n\n}",
"public void update(){\n y -= 1; // Making the text float up\n // Making the text more transparent\n color = new Color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha() - 2);\n }",
"public void changeColor(){\r\n if(color == 1)\r\n color = 2;\r\n else\r\n color = 1;\r\n }",
"public void lightSensorChanged(Position position,\r\n\t\t\tUpdatingSensor updatingsensor, float oldValue, float newValue);",
"public void setAreaColor(Color c)\r\n/* 53: */ {\r\n/* 54: 37 */ this.areaColor = c;repaint();\r\n/* 55: */ }",
"protected synchronized void updateColorAnimation() {\n synchronized (getViewController()) {\n if (colorStateTime < COLOR_ANIMATION_DURATION) {\n colorStateTime += Gdx.graphics.getDeltaTime();\n if (isColorAnimationFinished()) {\n getViewController().notifyAll();\n }\n }\n }\n }",
"@Override\n public void changeColor(ColorEvent ce) {\n \n txtRed.setText(\"\"+ ce.getColor().getRed());\n txtGreen.setText(\"\"+ ce.getColor().getGreen());\n txtBlue.setText(\"\"+ ce.getColor().getBlue());\n \n \n }",
"@Override\n public void paint(Graphics g)\n {\n super.paint(g);\n\n if(g instanceof Graphics2D)\n {\n // Initialize vars\n Graphics2D graphics = (Graphics2D) g;\n Dimension panelDimension = this.getSize();\n Rectangle2D turtleBounds;\n int fontHeight = g.getFontMetrics().getHeight();\n\n // Clear drawing sheet\n graphics.setColor(Color.WHITE);\n graphics.fillRect(0, 0, (int) panelDimension.getWidth(), (int) panelDimension.getHeight());\n\n // Draw every turtle\n for(AbstractTurtle turtle : this.turtles)\n {\n // Draw the turtle's shape\n graphics.setColor(turtle.getColor());\n graphics.fill(turtle.getShape());\n\n // Debug mode\n if(this.isDebug)\n {\n // Draw the turtle's sight\n graphics.setColor(Color.BLACK);\n graphics.draw(turtle.getSight());\n\n // Draw the turtle's center\n graphics.setColor(Color.CYAN);\n graphics.drawLine(\n (int) turtle.getX() - 10,\n (int) turtle.getY(),\n (int) turtle.getX() + 10,\n (int) turtle.getY()\n );\n graphics.drawLine(\n (int) turtle.getX(),\n (int) turtle.getY() - 10,\n (int) turtle.getX(),\n (int) turtle.getY() + 10\n );\n\n // Write the turtle's speed\n turtleBounds = turtle.getShape().getBounds2D();\n\n graphics.setColor(Color.BLACK);\n graphics.drawString(\n \"Vitesse : \" + String.format(\"%.2f\", turtle.getSpeed()),\n (int) turtleBounds.getMaxX() + 5,\n (int) turtleBounds.getMinY() - 5\n );\n graphics.drawString(\n \"Direction : \" + String.format(\"%.2f\", turtle.getDirection()),\n (int) turtleBounds.getMaxX() + 5,\n (int) turtleBounds.getMinY() - 5 + fontHeight\n );\n }\n }\n }\n }",
"private void setPenColor() {\n\t}",
"@Override\n public void excute() {\n drawable.setColor(color);\n }",
"public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawBackGround();\r\n\t\tdrawGraph();\r\n\t}",
"public void setColor()\n {\n if(eyeL != null) // only if it's painted already...\n {\n eyeL.changeColor(\"yellow\");\n eyeR.changeColor(\"yellow\");\n nose.changeColor(\"green\");\n mouthM.changeColor(\"red\");\n mouthL.changeColor(\"red\");\n mouthR.changeColor(\"red\");\n }\n }",
"public void setColor(Color color);",
"void updatePosition() {\n\t\t\n\t\tcoords.x = body.getPosition().x*Simulation.meterToPixel;\n\t\tcoords.y = body.getPosition().y*Simulation.meterToPixel;\n\t\tspeed.x = body.m_linearVelocity.x;\n\t\tspeed.y = body.m_linearVelocity.y;\n\t}",
"public void update() {\n\t\tfinal StarSystem oldLocation = getPlayer().getLocation();\n\t\tfinal StarSystem newLocation = getChart().getSelected();\n\t\tgetPlayer().setLocation(newLocation);\n\t\tgetPlayer().setFuel(-oldLocation.distanceToStarSystem(newLocation));\n\t\tgetChart().setSelected(null);\n\t\tgetChart().repaint();\n\t\tplanetLbl.setText(\"Current Location: \" + player.getLocation().getName()\n\t\t\t\t+ \"....Tech Level: \" + player.getLocation().getTechLevel());\n\n\t}",
"public void update() {\r\n\t\tdiffuse();\r\n\t\tdecay();\r\n\t}",
"public void setTurtleStep(int step)\n\t{\n\t\tturt.setStepLength(step);\n\t\trepaint();\n\t}",
"@Override\n public void setActiveTurtle(int turtleID) {\n screenCreator.setActiveTurtle(turtleID);\n }",
"public TurtleState(Vector2D position, Vector2D direction, Color color, double shift) {\n\t\tthis.position = position;\n\t\tthis.direction = direction;\n\t\tthis.color = color;\n\t\tthis.shift = shift;\n\t}",
"public void update(){\n\t\tsetChanged();\n\t\trender();\n\t\tprintTimer();\n\t}",
"private void fixColorState() {\n\t\tfinal Spatial lines = this.getChild(LINES_NAME);\n \tTealWorldManager.getWorldManager().addRenderUpdater(new RenderUpdater(){\n \t\tpublic void update(Object arg) { \t\t\t\n \t\t\tboolean coloredVertices = (Boolean) arg;\n \t\t\tMaterialState ms = (MaterialState) lines.getRenderState(RenderState.StateType.Material);\n \t\t\tif(ms == null) {\n \t\t\t\tms = DisplaySystem.getDisplaySystem().getRenderer().createMaterialState();\n \t\t\t\tms.setColorMaterial(ColorMaterial.AmbientAndDiffuse);\n \t\t\t\tlines.setRenderState(ms);\n \t\t\t}\n \t\t\tms.setEnabled(coloredVertices);\n \t\t};\n \t}, this.coloredVertices);\n\t}",
"public void repaint( long tm ) {\n }",
"@Override\r\n\tpublic void update(Graphics g) {\r\n\t\t// S*ystem.out.println(\"Graph.update\");\r\n\t\t// paint(g);\r\n\t\t// super.update(g);\r\n\t}",
"boolean changeColor(Color newColor){\n boolean change=false;\r\n\r\n if (fShapes.size() > 0) {\r\n Iterator iter = fShapes.iterator();\r\n\r\n while (iter.hasNext()) {\r\n TShape theShape = (TShape) iter.next();\r\n\r\n if (theShape.getSelected()) {\r\n theShape.setColor(newColor);\r\n change = true;\r\n }\r\n }\r\n }\r\n\r\n if (!change){\r\n TShape prototype=fPalette.getPrototype();\r\n\r\n if (prototype!=null)\r\n prototype.setColor(newColor);\r\n fPalette.repaint(); // no listeners for change in the palette\r\n }\r\n\r\n return\r\n change; // to drawing itself\r\n }",
"void setColor(Vector color);",
"private void cursorPosChanged( double x, double y )\n {\n }",
"public void setColor (Color color)\n {\n this.color = color;\n repaint();\n }",
"public void updatePosition() {\n\n this.x = this.temp_x;\n this.y = this.temp_y;\n this.ax = 0;\n this.ay = 0;\n\t\tthis.axplusone = 0;\n this.ayplusone = 0;\n \n }",
"void updateTouchPoint(Canvas c) {\n \t c.drawColor(0xff000000); \n }",
"public void draw()\n {\n canvas.setForegroundColor(color);\n canvas.fillCircle(xPosition, yPosition, diameter);\n }",
"public void render() {\r\n\t\tif ((this instanceof Turtles && ((Turtles) this).isAboveWater()) || !(this instanceof Turtles)) {\r\n\t\t\timage.drawCentered(xCoordinate, yCoordinate);\r\n\t\t}\r\n\t}",
"public void update(MazeEventPushed e) {\r\n }",
"@Override\n\tpublic void color() {\n\t\tSystem.out.println(\"Colour is red\");\n\t\t\n\t}",
"private void updateView(Connect4MoveMessage message) {\n\t\tif(message.getColor() == message.YELLOW) {\n\t\t\tSystem.out.println(message.getColor());\n\t\t\tchangeColor(message.getRow(),message.getColumn(),Color.YELLOW);\n\t\t} else if (message.getColor() == message.RED) {\n\t\t\tSystem.out.println(message.getColor());\n\t\t\tchangeColor(message.getRow(),message.getColumn(),Color.RED);\n\t\t}else {\n\t\t\tchangeColor(message.getRow(),message.getColumn(),Color.WHITE);\n\t\t}\n\t\t\n\t}",
"@Override\n public void reset() {\n this.posx = 0;\n this.posy = 0;\n this.rad = 0;\n this.property = new Property();\n this.property.setColor(new Color(Color.BLUE));\n }",
"public void setTrackColor(@ColorInt int color){\n this.mTrackColor = color;\n refreshTheView();\n }",
"public void setColor(Color c);",
"public void onLivingUpdate()\n {\n this.updateArmSwingProgress();\n float var1 = this.getBrightness(1.0F);\n\n if (var1 > 0.5F)\n {\n this.entityAge += 2;\n }\n\n super.onLivingUpdate();\n }",
"public void setColor(Color c) { color.set(c); }",
"private void update() {\n\t\tColor fColor = fgColorProvider.getCurrentColor();\n\t\tColor bColor = bgColorProvider.getCurrentColor();\n\t\tsetText(String.format(\"Foreground color: (%d, %d, %d), background color: (%d, %d, %d).\", \n\t\t\t\tfColor.getRed(), fColor.getGreen(), fColor.getBlue(),\n\t\t\t\tbColor.getRed(), bColor.getGreen(), bColor.getBlue()));\n\t}",
"public void setInfoParamsOfTurtleAndLine()\n\t{\n\t\tthis.myTurtleView.setTurtleInfo(\"Position: \\t\\t[\" + Math.floor(getTurtleLocation().getX()) + \", \" + Math.floor(getTurtleLocation().getY()) + \"]\"\n\t\t\t\t+ \" \\n\" + \"Heading: \\t\\t\" + this.getTurtleOrientation()\n\t\t\t\t+ \" \\n\" + \"Pen Status: \\t\" + myPenHandler.getPenStatus()\n\t\t\t\t);\n\t\t\n\t\tthis.myPenHandler.setThicknessParameter();\n\t}",
"public void setTurtleActive(boolean turtleActive) {\n isTurtleActive = turtleActive;\n }",
"private void setCurrentPos() {\n\t\tcurrentPos=layout_Circle[l.y][l.x];\n\t\tcurrentPos.setFill(Paint.valueOf(\"Red\"));\n\n\t\tsetValidMoves();\n\t}",
"public void setColor(Color color) {\n this.color = color;\n }",
"public synchronized void visitorPositionChanged (CityMap sender) {\n cityMap.getVisitorXY (tmpXY);\n visitorX = tmpXY[CityMap.X];\n visitorY = tmpXY[CityMap.Y];\n repaint ();\n }",
"public abstract void addTurtle(Turtle turtle, boolean isActive);",
"@Override\n\tvoid update(){\n\n\t\t\tif(Frogger.flag==1){\n\t\t\t\tif(orientation == Orientation.UP) y -= step;\n\t\t\t\telse if (orientation == Orientation.DOWN) y += step;\n\t\t\t\telse if (orientation == Orientation.RIGHT) x += step;\n\t\t\t\telse if (orientation == Orientation.LEFT) x -= step;\n\t\t}\n\t\tsetChanged();\n\t\tnotifyObservers();\n\t}",
"public void changePenColor(Color color) {\n\t\tscreen.changePenColor(color);\n\t}",
"public void color(Color the_color) {\n \n }",
"public int showTurtle () {\n myTurtleShowing = true;\n return 1;\n }",
"public void update(Tempo t) {\n\t\tif(Math.abs(t.getXPos() - pos.x) < rad) {\n\t\t\tif(!firedLastUpdate) fire();\n\t\t\tfiredLastUpdate = true;\n\t\t} else {\n\t\t\tfiredLastUpdate = false;\n\t\t}\n\t}",
"private void lineColor() {\n\n\t}",
"public void mazeChanged(Maze maze);",
"@Override\n\tpublic void setColour(float r, float g, float b) {\n\n\t}"
] | [
"0.6840448",
"0.66094613",
"0.6523883",
"0.64964783",
"0.6382279",
"0.5903425",
"0.5887622",
"0.58700275",
"0.58279854",
"0.57915294",
"0.57671857",
"0.57322186",
"0.57195014",
"0.57190806",
"0.5715383",
"0.56963056",
"0.56850696",
"0.56809586",
"0.56604165",
"0.56587297",
"0.56359184",
"0.55962807",
"0.55859613",
"0.55836636",
"0.5566522",
"0.5500159",
"0.54591465",
"0.5440629",
"0.54289",
"0.54237646",
"0.5420611",
"0.5419746",
"0.53918564",
"0.53804755",
"0.53642726",
"0.53585535",
"0.5353438",
"0.5340482",
"0.5335293",
"0.5318417",
"0.5316178",
"0.53144306",
"0.530698",
"0.530698",
"0.5299603",
"0.5298347",
"0.5293909",
"0.5290303",
"0.52881277",
"0.5287684",
"0.5286046",
"0.5285438",
"0.52777404",
"0.5273983",
"0.52718055",
"0.5261712",
"0.5258155",
"0.52494013",
"0.5247636",
"0.5247475",
"0.5246028",
"0.5245101",
"0.52214766",
"0.52211875",
"0.52192676",
"0.5213837",
"0.52057076",
"0.52031225",
"0.5198859",
"0.5193742",
"0.5184261",
"0.5181833",
"0.5180546",
"0.51801753",
"0.5179122",
"0.517385",
"0.51680255",
"0.51673305",
"0.5165557",
"0.5165537",
"0.5165459",
"0.51600796",
"0.5159497",
"0.5158503",
"0.51579535",
"0.5152174",
"0.51448417",
"0.513067",
"0.51289475",
"0.5114114",
"0.51140887",
"0.51136696",
"0.51072335",
"0.51018614",
"0.5099958",
"0.5094703",
"0.50914633",
"0.509006",
"0.50892395",
"0.5087472"
] | 0.7849112 | 0 |
String targetDir = "C:\\Users\\User\\Desktop\\"; File originFile = new File(targetDir, "000001806252569_20180704_20180705093600_1_1.zip"); decompressZip(originFile, targetDir); | public static void main(String[] args) throws IOException {
File targetFile = new File("D:\\program\\360cse\\360Chrome\\test.zip");
File sourceFiles = new File("D:\\temple\\sysMenu-add.html");
boolean flag = compressZip(false, targetFile, sourceFiles);
System.out.println(flag);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void unzipDownloadedFile(String zipFile) throws ZipException, IOException{\n\t int BUFFER = 2048;\n\t \n\t // get zip file\n\t File file = new File(zipFile);\n\t ZipFile zip = new ZipFile(file);\n\t \n\t // unzip to directory of the same name\n\t // When sip is a directory, this gets two folders\n\t //String newPath = zipFile.substring(0, zipFile.length() - 4);\n\t //new File(newPath).mkdir();\n\t \n\t // unzip to parent directory of the zip file\n\t // This is assuming zip if of a directory\n\t String newPath = file.getParent();\n\t \n\t // Process each entry\n\t Enumeration<? extends ZipEntry> zipFileEntries = zip.entries();\n\t while (zipFileEntries.hasMoreElements())\n\t {\n\t // grab a zip file entry\n\t ZipEntry entry = (ZipEntry) zipFileEntries.nextElement();\n\t String currentEntry = entry.getName();\n\t File destFile = new File(newPath, currentEntry);\n\t File destinationParent = destFile.getParentFile();\n\n\t // create the parent directory structure if needed\n\t destinationParent.mkdirs();\n\n\t if (!entry.isDirectory())\n\t {\n\t BufferedInputStream is = new BufferedInputStream(zip.getInputStream(entry));\n\t int currentByte;\n\t // establish buffer for writing file\n\t byte data[] = new byte[BUFFER];\n\n\t // write the current file to disk\n\t FileOutputStream fos = new FileOutputStream(destFile);\n\t BufferedOutputStream dest = new BufferedOutputStream(fos,\n\t BUFFER);\n\n\t // read and write until last byte is encountered\n\t while ((currentByte = is.read(data, 0, BUFFER)) != -1) {\n\t dest.write(data, 0, currentByte);\n\t }\n\t dest.flush();\n\t dest.close();\n\t is.close();\n\t }\n\n\t if (currentEntry.endsWith(\".zip\"))\n\t {\n\t // found a zip file, try to open\n\t \tunzipDownloadedFile(destFile.getAbsolutePath());\n\t }\n\t }\n\t zip.close();\n\t}",
"public void unZip(String apkFile) throws Exception \r\n\t{\r\n\t\tLog.p(tag, apkFile);\r\n\t\tFile file = new File(apkFile);\r\n\t\r\n\t\t/*\r\n\t\t * Create the Base Directory, whose name should be same as Zip file name.\r\n\t\t * All decompressed contents will be placed under this folder.\r\n\t\t */\r\n\t\tString apkFileName = file.getName();\r\n\t\t\r\n\t\tif(apkFileName.indexOf('.') != -1)\r\n\t\t\tapkFileName = apkFileName.substring(0, apkFileName.indexOf('.'));\r\n\t\t\r\n\t\tLog.d(tag, \"Folder name: \"+ apkFileName);\r\n\t\t\r\n\t\tFile extractFolder = new File((file.getParent() == null ? \"\" : file.getParent() + File.separator) + apkFileName);\r\n\t\tif(!extractFolder.exists())\r\n\t\t\textractFolder.mkdir();\r\n\t\t\r\n\t\t/*\r\n\t\t * Read zip entries.\r\n\t\t */\r\n\t\tFileInputStream fin = new FileInputStream(apkFile);\r\n\t\tZipInputStream zin = new ZipInputStream(new BufferedInputStream(fin));\r\n\t\t\r\n\t\t/*\r\n\t\t * Zip InputStream shifts its index to every Zip entry when getNextEntry() is called.\r\n\t\t * If this method returns null, Zip InputStream reaches EOF.\r\n\t\t */\r\n\t\tZipEntry ze = null;\r\n\t\tBufferedOutputStream dest;\r\n\t\t\r\n\t\twhile((ze = zin.getNextEntry()) != null)\r\n\t\t{\r\n\t\t\tLog.d(tag, \"Zip entry: \" + ze.getName() + \" Size: \"+ ze.getSize());\r\n\t\t\t/*\r\n\t\t\t * Create decompressed file for each Zip entry. A Zip entry can be a file or directory.\r\n\t\t\t * ASSUMPTION: APK Zip entry uses Unix style File seperator- \"/\"\r\n\t\t\t * \r\n\t\t\t * 1. Create the prefix Zip Entry folder, if it is not yet available\r\n\t\t\t * 2. Create the individual Zip Entry file.\r\n\t\t\t */\r\n\t\t\tString zeName = ze.getName();\r\n\t\t\tString zeFolder = zeName;\r\n\t\t\t\r\n\t\t\tif(ze.isDirectory())\r\n\t\t\t{\r\n\t\t\t\tzeName = null; // Don't create Zip Entry file\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif(zeName.indexOf(\"/\") == -1) // Zip entry uses \"/\"\r\n\t\t\t\t\tzeFolder = null; // It is File. don't create Zip entry Folder\r\n\t\t\t\telse {\r\n\t\t\t\t\tzeFolder = zeName.substring(0, zeName.lastIndexOf(\"/\"));\r\n\t\t\t\t\tzeName = zeName.substring( zeName.lastIndexOf(\"/\") + 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tLog.d(tag, \"zeFolder: \"+ zeFolder +\" zeName: \"+ zeName);\r\n\t\t\t\r\n\t\t\t// Create Zip Entry Folder\r\n\t\t\tFile zeFile = extractFolder;\r\n\t\t\tif(zeFolder != null)\r\n\t\t\t{\r\n\t\t\t\tzeFile = new File(extractFolder.getPath() + File.separator + zeFolder);\r\n\t\t\t\tif(!zeFile.exists())\r\n\t\t\t\t\tzeFile.mkdirs();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Create Zip Entry File\r\n\t\t\tif(zeName == null)\r\n\t\t\t\tcontinue;\r\n\t\t\t\r\n\t\t\t// Keep track of XML files, they are in Android Binary XML format\r\n\t\t\tif(zeName.endsWith(\".xml\"))\r\n\t\t\t\txmlFiles.add(zeFile.getPath() + File.separator + zeName);\r\n\t\t\t\r\n\t\t\t// Keep track of the Dex/ODex file. Need to convert to Jar\r\n\t\t\tif(zeName.endsWith(\".dex\") || zeName.endsWith(\".odex\"))\r\n\t\t\t\tdexFile = zeFile.getPath() + File.separator + zeName;\r\n\t\t\t\r\n\t\t\t// Keep track of Resources.arsc file- resources.arsc\r\n\t\t\tif(zeName.endsWith(\".arsc\"))\r\n\t\t\t\tresFile = zeFile.getPath() + File.separator + zeName;\r\n\t\t\t\r\n\t\t\t// Write Zip entry File to the disk\r\n\t\t\tint count;\r\n\t\t\tbyte data[] = new byte[BUFFER];\r\n\t\t\t\r\n\t\t\tFileOutputStream fos = new FileOutputStream(zeFile.getPath() + File.separator + zeName);\r\n\t\t\tdest = new BufferedOutputStream(fos, BUFFER);\r\n\r\n\t\t\twhile ((count = zin.read(data, 0, BUFFER)) != -1) \r\n\t\t\t{\r\n\t\t\t\tdest.write(data, 0, count);\r\n\t\t\t}\r\n\t\t\tdest.flush();\r\n\t\t\tdest.close();\r\n\t\t}\r\n\r\n\t\t// Close Zip InputStream\r\n\t\tzin.close();\r\n\t\tfin.close();\r\n\t}",
"public void toUnzip(String zipFile, String targetDir) {\n\n\t\tMessage message = new Message();\n\t\tmessage.what = SUCCESS;\n\n\t\tint SIZE = 4096; // buffer size: 4KB\n\t\tString strEntry; // each zip entry name\n\t\ttry {\n\t\t\tBufferedOutputStream dest = null; // buffer output stream\n\t\t\tFileInputStream fis = new FileInputStream(zipFile);\n\t\t\tZipInputStream zis = new ZipInputStream(\n\t\t\t\t\tnew BufferedInputStream(fis));\n\t\t\tZipEntry entry; // each zip entry\n\t\t\twhile ((entry = zis.getNextEntry()) != null) {\n\t\t\t\ttry {\n\t\t\t\t\tint count;\n\t\t\t\t\tbyte data[] = new byte[SIZE];\n\t\t\t\t\tstrEntry = entry.getName();\n\n\t\t\t\t\tFile entryFile = new File(targetDir + strEntry);\n\t\t\t\t\tFile entryDir = new File(entryFile.getParent());\n\t\t\t\t\tif (!entryDir.exists()) {\n\t\t\t\t\t\tentryDir.mkdirs();\n\t\t\t\t\t}\n\n\t\t\t\t\tFileOutputStream fos = new FileOutputStream(entryFile);\n\t\t\t\t\tdest = new BufferedOutputStream(fos, SIZE);\n\t\t\t\t\twhile ((count = zis.read(data, 0, SIZE)) != -1) {\n\t\t\t\t\t\tdest.write(data, 0, count);\n\n\t\t\t\t\t\tMessage msg = Message.obtain();\n\t\t\t\t\t\tmsg.what = PROGRESS;\n\t\t\t\t\t\tmsg.obj = count;\n\t\t\t\t\t\thandler.sendMessage(msg);\n\t\t\t\t\t}\n\t\t\t\t\tdest.flush();\n\t\t\t\t\tdest.close();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tmessage.what = ERROR;\n\t\t\t\t\tmessage.obj = ex.getMessage();\n\t\t\t\t\tex.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tzis.close();\n\t\t\tFile fileszipe = new File(zipFile);\n\t\t\tfileszipe.delete();\n\t\t} catch (Exception cwj) {\n\t\t\tmessage.what = ERROR;\n\t\t\tmessage.obj = cwj.getMessage();\n\t\t\tcwj.printStackTrace();\n\t\t}\n\t\thandler.sendMessage(message);\n\t}",
"private static void decompressJarFile(String destDirectory, String jarFilePath) throws IOException {\n File destDir = new File(destDirectory);\n if (!destDir.exists()) {\n destDir.mkdir();\n }\n JarInputStream jarIn = new JarInputStream(new FileInputStream(jarFilePath));\n JarEntry entry = jarIn.getNextJarEntry();\n // iterates over all the entries in the jar file\n while (entry != null) {\n String filePath = destDirectory + \"/\" + entry.getName();\n if (!entry.isDirectory()) {\n new File(filePath).getParentFile().mkdirs();\n // if the entry is a file, extracts it\n extractFile(jarIn, filePath);\n }/* else {\n System.out.println(\"New dir: \" + filePath);\n // if the entry is a directory, make the directory\n File dir = new File(filePath);\n dir.mkdir();\n System.out.println(dir.canWrite());\n }*/\n jarIn.closeEntry();\n entry = jarIn.getNextJarEntry();\n }\n jarIn.close();\n }",
"public static final void unzip(String zipfileName, String baseOutputDir) {\r\n Enumeration entries;\r\n ZipFile zipFile;\r\n try {\r\n zipFile = new ZipFile(zipfileName);\r\n entries = zipFile.entries();\r\n while (entries.hasMoreElements()) {\r\n ZipEntry entry = (ZipEntry) entries.nextElement();\r\n String entryName = entry.getName();\r\n String theName = baseOutputDir + '/' + entryName;\r\n if (entry.isDirectory()) {\r\n // Assume directories are stored parents first then children.\r\n System.out.println(\"Extracting directory: \" + entry.getName());\r\n // This is not robust, just for demonstration purposes.\r\n (new File(theName)).mkdirs();\r\n continue;\r\n }\r\n //(new File(theName)).mkdirs();\r\n forceParentDirectories(theName);\r\n System.out.println(\"Extracting file: \" + theName);\r\n copyInputStream(zipFile.getInputStream(entry), new BufferedOutputStream(new FileOutputStream(theName)));\r\n }\r\n zipFile.close();\r\n } catch (Exception ioe) {\r\n System.err.println(\"Unhandled exception:\");\r\n ioe.printStackTrace();\r\n return;\r\n }\r\n }",
"public void unzip(String _zipFile, String _targetLocation) {\n dirChecker(_targetLocation);\n\n try {\n FileInputStream fin = new FileInputStream(_zipFile);\n ZipInputStream zin = new ZipInputStream(fin);\n ZipEntry ze = null;\n while ((ze = zin.getNextEntry()) != null) {\n\n //create dir if required while unzipping\n if (ze.isDirectory()) {\n dirChecker(ze.getName());\n } else {\n FileOutputStream fout = new FileOutputStream(_targetLocation + ze.getName());\n for (int c = zin.read(); c != -1; c = zin.read()) {\n fout.write(c);\n }\n\n zin.closeEntry();\n fout.close();\n }\n\n }\n zin.close();\n } catch (Exception e) {\n System.out.println(e);\n }\n }",
"@Override\r\n public void extractArchive(ArchiveExtractor decompressor) throws ArcException {\r\n\r\n\tString fileName = ManipString.substringAfterFirst(this.idSource, \"_\");\r\n\r\n\tboolean uncompressInProgress=false;\r\n\tFile dir = new File(this.archiveChargement + \".dir\");\r\n\tif (!dir.exists()) {\r\n\t\ttry {\r\n\t\t if (dir.mkdir())\r\n\t\t {\r\n\t\t \tStaticLoggerDispatcher.debug(LOGGER,\"$$\"+Thread.currentThread().getId()+\" is decompressing \"+dir.getAbsolutePath());\r\n\t\t \tdecompressor.extract(this.archiveChargement);\r\n\t\t \tuncompressInProgress=true;\r\n\t\t }\r\n\t\t}\r\n\t\t catch (Exception ex)\r\n\t\t{\r\n\t\t\t throw new ArcException(ex, ArcExceptionMessage.FILE_EXTRACT_FAILED, this.archiveChargement).logFullException();\r\n\t\t}\r\n\t}\r\n\t\r\n\tif (!uncompressInProgress) {\r\n\t\t\t// check if file exists\r\n\t File toRead = new File(dir + File.separator + ManipString.redoEntryName(fileName));\r\n\t while (!toRead.exists()) {\r\n\t \ttry {\r\n\t\t\t\tThread.sleep(MILLISECOND_UNCOMPRESSION_CHECK_INTERVAL);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\tThread.currentThread().interrupt();\r\n\t\t\t StaticLoggerDispatcher.error(LOGGER, \"Error in thread sleep extractArchive()\");\r\n\t\t\t}\r\n\t \ttoRead = new File(dir + File.separator + ManipString.redoEntryName(fileName));\r\n\t }\r\n\t}\r\n\r\n\r\n\t\r\n }",
"public void unzip(String zipFilePath, String destDirectory) throws IOException {\n File destDir = new File(destDirectory);\n if (!destDir.exists()) {\n destDir.mkdir();\n }\n ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(zipFilePath));\n ZipEntry ZipEntry = zipInputStream.getNextEntry();\n\t\twhile (ZipEntry != null) {\n String fileName = ZipEntry.getName();\n\t\t\tString filePath = destDirectory + File.separator + fileName;\n if (!ZipEntry.isDirectory() && fileName.endsWith(\".jar\")) {\n extractFile(zipInputStream, filePath);\n } \n zipInputStream.closeEntry();\n ZipEntry = zipInputStream.getNextEntry();\n }\n zipInputStream.close();\n }",
"private void unzip(File zipFile, File targetDirectory) throws LpException {\n try {\n final ZipFile zip = new ZipFile(zipFile);\n if (zip.isEncrypted()) {\n throw new LpException(\"File is encrypted: {}\",\n zipFile.getName());\n }\n zip.extractAll(targetDirectory.toString());\n } catch (ZipException ex) {\n throw new LpException(\"Extraction failure: {}\",\n zipFile.getName(), ex);\n }\n }",
"public static int unzip(String srcZipFile, String specifiedFile, String targetDirectory, String passwd) {\n File srcFile = new File(srcZipFile);\n if (!srcFile.exists() || srcFile.isDirectory()) {\n System.out.println(\"[JZip] Source file does not exist or correct.\");\n return SOURCE_FILE_ERROR;\n }\n \n // Check target directory\n File destDir = new File(targetDirectory);\n destDir.mkdir();\n if (!destDir.isDirectory()) {\n System.out.println(\"[JZip] targetDirectory should be directory.\");\n return TARGET_DIR_ERROR;\n }\n \n // Init and set password\n ZipFile zipFile;\n try {\n zipFile = new ZipFile(srcZipFile);\n \n if (zipFile.isEncrypted()) {\n if (passwd != null && !passwd.isEmpty()) {\n zipFile.setPassword(passwd.toCharArray());\n }\n else {\n System.out.println(\"[JZip] No password indicated for a password-protected file.\");\n return PASSWORD_NOT_FOUND;\n }\n }\n else {\n System.out.println(\"[JZip] This zip file should has password but it doesn't.\");\n return SOURCE_SHOULD_HAS_PASSWORD;\n }\n }\n catch (ZipException e) {\n System.out.println(\"[JZip] Create zip object or set password causes cexception.\");\n return ZIP_INITIAL_ERROR;\n }\n \n // Check content and extract\n String targetFile = targetDirectory + (targetDirectory.endsWith(File.separator) ? \"\" : File.separator) + specifiedFile;\n try {\n \tList<?> fileHeaderList = zipFile.getFileHeaders();\n for (int i = 0; i < fileHeaderList.size(); i++) {\n \tFileHeader fileHeader = (FileHeader)fileHeaderList.get(i);\n \tif (fileHeader != null && fileHeader.getFileName().equals(specifiedFile)) {\n \t\tzipFile.extractFile(specifiedFile, targetDirectory);\n \t\tbreak;\n \t}\n }\n if (!new File(targetFile).isFile()) {\n \tSystem.out.println(\"[JZip] Input zip file does not have correct content.\");\n \treturn SOURCE_CONTENT_ERROR;\n }\n }\n catch (ZipException e) {\n System.out.println(\"[JZip] Extract zip file causes exception.\");\n // It will extract a zero-size file when password is incorrect, should be deleted\n new File(targetFile).delete();\n return EXTRACT_FILE_ERROR;\n }\n \n return NO_ERROR;\n }",
"private static void extractFile(ZipInputStream inStreamZip, FSDataOutputStream destDirectory) throws IOException {\n BufferedOutputStream bos = new BufferedOutputStream(destDirectory);\n byte[] bytesIn = new byte[BUFFER_SIZE];\n int read = 0;\n while ((read = inStreamZip.read(bytesIn)) != -1) {\n bos.write(bytesIn, 0, read);\n }\n bos.close();\n }",
"public void extractPackage(String zipPath, String destPath) throws IOException {\n File destDir = new File(destPath);\n if(!destDir.exists()) {\n destDir.mkdir();\n }\n ZipInputStream zipIn = new ZipInputStream(new FileInputStream((zipPath)));\n ZipEntry entry = zipIn.getNextEntry();\n while(entry != null) {\n String filePath = destPath+File.separator+entry.getName();\n //filePath = filePath.replaceAll(\" \",\"_\");\n if(!entry.isDirectory()) {\n Log.i(\"extract\",\"Package Name: \"+entry.getName());\n Log.i(\"extract\",filePath);\n String[] temp = entry.getName().split(\"\\\\.\");\n if(validExtension(temp[temp.length-1].toLowerCase())) {\n extractFile(zipIn,filePath);\n }\n //extractFile(zipIn,filePath);\n } else {\n File dir = new File(filePath);\n dir.mkdirs();\n }\n zipIn.closeEntry();;\n entry = zipIn.getNextEntry();\n }\n zipIn.close();\n }",
"public static void extractZipArchive(byte[] zipFileData, String directory) throws IOException {\n new File(directory).mkdirs();\n // get the zip file content\n ZipInputStream inputStream = new ZipInputStream(new ByteArrayInputStream(zipFileData));\n // get the zipped file list entry\n ZipEntry zipEntry = inputStream.getNextEntry();\n byte[] buffer = new byte[BUFFER_SIZE];\n while (zipEntry != null) {\n if (!zipEntry.isDirectory()) {\n String fileName = zipEntry.getName();\n File newFile = new File(directory + File.separator + fileName);\n new File(newFile.getParent()).mkdirs();\n\n FileOutputStream fos = new FileOutputStream(newFile);\n\n int len;\n while ((len = inputStream.read(buffer)) > 0) {\n fos.write(buffer, 0, len);\n }\n\n fos.close();\n\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"File unzipped: \" + newFile.getAbsoluteFile());\n }\n }\n zipEntry = inputStream.getNextEntry();\n }\n inputStream.closeEntry();\n inputStream.close();\n }",
"protected void getFile(ZipEntry e) throws IOException {\n String zipName = e.getName();\n switch (mode) {\n case EXTRACT:\n if (zipName.startsWith(\"/\")) {\n if (!warnedMkDir)\n System.out.println(\"Ignoring absolute paths\");\n warnedMkDir = true;\n zipName = zipName.substring(1);\n }\n // if a directory, just return. We mkdir for every file,\n // since some widely-used Zip creators don't put out\n // any directory entries, or put them in the wrong place.\n if (zipName.endsWith(\"/\")) {\n return;\n }\n // Else must be a file; open the file for output\n // Get the directory part.\n int ix = zipName.lastIndexOf('/');\n if (ix > 0) {\n //String dirName = zipName.substring(0, ix);\n String fileName = zipName.substring(ix + 1, zipName.length());\n zipName = fileName;\n\n }\n String targetFile = this.unzipFileTargetLocation;\n File file = new File(targetFile);\n if (!file.exists())\n file.createNewFile();\n FileOutputStream os = null;\n InputStream is = null;\n try {\n os = new FileOutputStream(targetFile);\n is = zippy.getInputStream(e);\n int n = 0;\n while ((n = is.read(b)) > 0)\n os.write(b, 0, n);\n\n } finally {\n if (is != null) {\n try {\n is.close();\n } catch (Exception ee) {\n ee.printStackTrace();\n }\n }\n if (os != null) {\n try {\n os.close();\n } catch (Exception ee) {\n ee.printStackTrace();\n }\n }\n }\n break;\n case LIST:\n // Not extracting, just list\n if (e.isDirectory()) {\n System.out.println(\"Directory \" + zipName);\n } else {\n System.out.println(\"File \" + zipName);\n }\n break;\n default:\n throw new IllegalStateException(\"mode value (\" + mode + \") bad\");\n }\n }",
"public static void unzip(File zipFile, File destDir) throws IOException {\n BufferedOutputStream dest = null;\n FileInputStream fis = new FileInputStream(zipFile);\n ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis));\n ZipEntry entry;\n while ((entry = zis.getNextEntry()) != null) {\n if (log.isDebugEnabled()) {\n log.debug(\"Extracting: \" + entry);\n }\n int count;\n byte[] data = new byte[BUFFER_SIZE];\n FileOutputStream fos = new FileOutputStream(destDir.getAbsolutePath() + \"/\" + entry.getName());\n dest = new BufferedOutputStream(fos, BUFFER_SIZE);\n while ((count = zis.read(data, 0, BUFFER_SIZE)) != -1) {\n dest.write(data, 0, count);\n }\n dest.flush();\n dest.close();\n }\n zis.close();\n }",
"public static boolean UnzipFile(ZipFile zf, String filepathinzip, File fileinfiledir) {\r\n BufferedOutputStream Output_fos = null;\r\n BufferedInputStream bufbr = null;\r\n try {\r\n ZipEntry ze = zf.getEntry(filepathinzip);\r\n if (ze != null) {\r\n BufferedOutputStream Output_fos2 = new BufferedOutputStream(new FileOutputStream(fileinfiledir));\r\n try {\r\n byte[] buf = new byte[65536];\r\n BufferedInputStream bufbr2 = new BufferedInputStream(zf.getInputStream(ze));\r\n while (true) {\r\n try {\r\n int readlen = bufbr2.read(buf);\r\n if (readlen < 0) {\r\n break;\r\n }\r\n Output_fos2.write(buf, 0, readlen);\r\n } catch (Exception e) {\r\n e = e;\r\n bufbr = bufbr2;\r\n Output_fos = Output_fos2;\r\n } catch (Throwable th) {\r\n th = th;\r\n bufbr = bufbr2;\r\n Output_fos = Output_fos2;\r\n if (Output_fos != null) {\r\n try {\r\n Output_fos.close();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e2) {\r\n e2.printStackTrace();\r\n return false;\r\n }\r\n }\r\n } catch (IOException e3) {\r\n e3.printStackTrace();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e4) {\r\n e4.printStackTrace();\r\n return false;\r\n }\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e5) {\r\n e5.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n throw th;\r\n }\r\n }\r\n if (Output_fos2 != null) {\r\n try {\r\n Output_fos2.close();\r\n if (bufbr2 != null) {\r\n try {\r\n bufbr2.close();\r\n } catch (IOException e6) {\r\n e6.printStackTrace();\r\n BufferedInputStream bufferedInputStream = bufbr2;\r\n BufferedOutputStream bufferedOutputStream = Output_fos2;\r\n return false;\r\n }\r\n }\r\n } catch (IOException e7) {\r\n e7.printStackTrace();\r\n if (bufbr2 != null) {\r\n try {\r\n bufbr2.close();\r\n } catch (IOException e8) {\r\n e8.printStackTrace();\r\n BufferedInputStream bufferedInputStream2 = bufbr2;\r\n BufferedOutputStream bufferedOutputStream2 = Output_fos2;\r\n return false;\r\n }\r\n }\r\n BufferedInputStream bufferedInputStream3 = bufbr2;\r\n BufferedOutputStream bufferedOutputStream3 = Output_fos2;\r\n return false;\r\n } finally {\r\n if (bufbr2 != null) {\r\n try {\r\n bufbr2.close();\r\n } catch (IOException e9) {\r\n e9.printStackTrace();\r\n BufferedInputStream bufferedInputStream4 = bufbr2;\r\n BufferedOutputStream bufferedOutputStream4 = Output_fos2;\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n BufferedInputStream bufferedInputStream5 = bufbr2;\r\n BufferedOutputStream bufferedOutputStream5 = Output_fos2;\r\n return true;\r\n } catch (Exception e10) {\r\n e = e10;\r\n Output_fos = Output_fos2;\r\n try {\r\n e.printStackTrace();\r\n if (Output_fos == null) {\r\n return false;\r\n }\r\n try {\r\n Output_fos.close();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e11) {\r\n e11.printStackTrace();\r\n return false;\r\n }\r\n } catch (IOException e12) {\r\n e12.printStackTrace();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e13) {\r\n e13.printStackTrace();\r\n return false;\r\n }\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e14) {\r\n e14.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n } catch (Throwable th2) {\r\n th = th2;\r\n if (Output_fos != null) {\r\n }\r\n throw th;\r\n }\r\n } catch (Throwable th3) {\r\n th = th3;\r\n Output_fos = Output_fos2;\r\n if (Output_fos != null) {\r\n }\r\n throw th;\r\n }\r\n } else if (Output_fos == null) {\r\n return false;\r\n } else {\r\n try {\r\n Output_fos.close();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e15) {\r\n e15.printStackTrace();\r\n return false;\r\n }\r\n } catch (IOException e16) {\r\n e16.printStackTrace();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e17) {\r\n e17.printStackTrace();\r\n return false;\r\n }\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e18) {\r\n e18.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n } catch (Exception e19) {\r\n e = e19;\r\n }\r\n }",
"public void unZip(String fileName, String unZipTarget) throws IOException {\n this.unzipFileTargetLocation = unZipTarget;\n dirsMade = new TreeSet();\n zippy = new ZipFile(fileName);\n Enumeration all = zippy.entries();\n while (all.hasMoreElements()) {\n getFile((ZipEntry) all.nextElement());\n }\n }",
"public static File unpackArchive(File theFile, File targetDir)\n\t\t\tthrows IOException {\n\t\tif (!theFile.exists()) {\n\t\t\tthrow new IOException(theFile.getAbsolutePath() + \" does not exist\");\n\t\t}\n\t\tif (!buildDirectory(targetDir)) {\n\t\t\tthrow new IOException(\"Could not create directory: \" + targetDir);\n\t\t}\n\t\tZipFile zipFile = new ZipFile(theFile);\n\t\tfor (Enumeration<? extends ZipEntry> entries = zipFile.entries(); entries.hasMoreElements();) {\n\t\t\tZipEntry entry = (ZipEntry) entries.nextElement();\n\t\t\tFile file = new File(targetDir, File.separator + entry.getName());\n\t\t\tif (!buildDirectory(file.getParentFile())) {\n\t\t\t\tthrow new IOException(\"Could not create directory: \"\n\t\t\t\t\t\t+ file.getParentFile());\n\t\t\t}\n\t\t\tif (!entry.isDirectory()) {\n\t\t\t\tcopyInputStream(zipFile.getInputStream(entry),\n\t\t\t\t\t\tnew BufferedOutputStream(new FileOutputStream(file)));\n\t\t\t} else {\n\t\t\t\tif (!buildDirectory(file)) {\n\t\t\t\t\tthrow new IOException(\"Could not create directory: \" + file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tzipFile.close();\n\t\treturn theFile;\n\t}",
"public static void unzip(File targetDir,File zipFile) throws ZipException, IOException{\n\t\tZipFile zip = new ZipFile(zipFile);\n\t\t\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tEnumeration<ZipEntry> z = (Enumeration<ZipEntry>) zip.entries();\n\t\twhile(z.hasMoreElements()){\n\t\t\tZipEntry entry = z.nextElement();\n\t\t\tFile f = new File(targetDir, entry.getName());\n\t\t\tif(f.isDirectory()){\n\t\t\t\tif(!f.exists())\n\t\t\t\t\tf.mkdirs();\n\t\t\t}else{\n\t\t\t\tf.getParentFile().mkdirs();\n\t\t\t\tInputStream in = zip.getInputStream(entry);\n\t\t\t\tif(f.getPath().contains(\"__MACOSX\")) continue;\n\t\t\t\tBufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(f));\n\t\t\t\tIOUtils.copy(in, out);\n\t\t\t\tin.close();\n\t\t\t\tout.flush();\n\t\t\t\tout.close();\n\t\t\t}\n\t\t}\n\t\tzip.close();\n\t}",
"private static void extract (Path zipPath, Path destination)\n\t\tthrows IOException\n\t{\n\t\tif (Files.isDirectory (zipPath))\n\t\t{\n\t\t\ttry (DirectoryStream<Path> directoryStream = Files\n\t\t\t\t.newDirectoryStream (zipPath);)\n\t\t\t{\n\t\t\t\tfor (Path file : directoryStream)\n\t\t\t\t{\n\t\t\t\t\textract (file, destination);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tPath fileOutZip = destination\n\t\t\t\t.resolve (\"./\" + zipPath.normalize ().toString ()).normalize ();\n\t\t\tFiles.createDirectories (fileOutZip.getParent ());\n\t\t\tFiles.copy (zipPath, fileOutZip, Utils.COPY_OPTION);\n\t\t}\n\t}",
"public static void unzip(Context context, InputStream zipFile) {\n try (BufferedInputStream bis = new BufferedInputStream(zipFile)) {\n try (ZipInputStream zis = new ZipInputStream(bis)) {\n ZipEntry ze;\n int count;\n byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];\n while ((ze = zis.getNextEntry()) != null) {\n try (FileOutputStream fout = context.openFileOutput(ze.getName(), Context.MODE_PRIVATE)) {\n while ((count = zis.read(buffer)) != -1)\n fout.write(buffer, 0, count);\n }\n }\n }\n } catch (IOException | NullPointerException ex) {\n Log.v(MainActivity.TAG, \"Zip not opened.\\n\"+ex.getMessage());\n }\n }",
"public void unzip(String zipFilePath, String destDirectory) throws IOException {\n File destDir = new File(destDirectory);\n if (!destDir.exists()) {\n destDir.mkdir();\n }\n ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));\n ZipEntry entry = zipIn.getNextEntry();\n // iterates over entries in the zip file\n while (entry != null) {\n String filePath = destDirectory + \"\\\\\" + entry.getName();\n if (!entry.isDirectory()) {\n // if the entry is a file, extracts it\n extractFile(zipIn, filePath);\n } else {\n // if the entry is a directory, make the directory\n File dir = new File(filePath);\n dir.mkdir();\n }\n zipIn.closeEntry();\n entry = zipIn.getNextEntry();\n }\n zipIn.close();\n }",
"public static void unzip(String zipFilePath, String destDirectory) throws IOException {\n File destDir = new File(destDirectory);\n if (!destDir.exists()) {\n destDir.mkdir();\n }\n ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));\n ZipEntry entry = zipIn.getNextEntry();\n // iterates over entries in the zip file\n while (entry != null) {\n String filePath = destDirectory + File.separator + entry.getName();\n if (!entry.isDirectory()) {\n // if the entry is a file, extracts it\n extractFile(zipIn, filePath);\n } else {\n // if the entry is a directory, make the directory\n File dir = new File(filePath);\n dir.mkdir();\n }\n zipIn.closeEntry();\n entry = zipIn.getNextEntry();\n }\n zipIn.close();\n }",
"public static void unzip(String zipFilePath, String destDirectory) throws IOException {\n File destDir = new File(destDirectory);\n if (!destDir.exists()) {\n destDir.mkdir();\n }\n ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));\n ZipEntry entry = zipIn.getNextEntry();\n // iterates over entries in the zip file\n while (entry != null) {\n String filePath = destDirectory + File.separator + entry.getName();\n if (!entry.isDirectory()) {\n // if the entry is a file, extracts it\n extractFile(zipIn, filePath);\n } else {\n // if the entry is a directory, make the directory\n File dir = new File(filePath);\n dir.mkdir();\n }\n zipIn.closeEntry();\n entry = zipIn.getNextEntry();\n }\n zipIn.close();\n }",
"public void decompressFile(String fileToDeCompress, String deCompressFile) throws IOException {\n try (\n FileInputStream fin = new FileInputStream(fileToDeCompress);\n InflaterInputStream in = new InflaterInputStream(fin);\n FileOutputStream fout = new FileOutputStream(deCompressFile)) {\n int i;\n while ((i = in.read()) != -1) {\n fout.write((byte) i);\n fout.flush();\n }\n\n }\n\n }",
"List<CompressResult> decompress(Path input, Path output) throws IOException;",
"public static void unzipArchive(File archive, String outputDir) throws IOException {\n\t\tZipFile zipfile = new ZipFile(archive);\n\t\tfor (Enumeration<?> e = zipfile.entries(); e.hasMoreElements();) {\n\t\t\tZipEntry entry = (ZipEntry) e.nextElement();\n\t\t\tunzipEntry(zipfile, entry, outputDir);\n\t\t}\n\t}",
"private static void extractFile(ZipInputStream zipIn, String filePath) throws IOException {\n BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));\n byte[] bytesIn = new byte[BUFFER_SIZE];\n int read = 0;\n while ((read = zipIn.read(bytesIn)) != -1) {\n bos.write(bytesIn, 0, read);\n }\n bos.close();\n }",
"public ZipEntry decompress(File compressedFile, File outputDirectory) throws IOException {\n\t\tObjects.requireNonNull(compressedFile);\n\t\tObjects.requireNonNull(outputDirectory);\n\t\tZipEntry ret = null;\n\t\tif (!outputDirectory.exists()) {\n\t\t\toutputDirectory.mkdirs();\n\t\t}\n\t\tZipInputStream input = new ZipInputStream(new FileInputStream(compressedFile));\n\t\tfor (ZipEntry entry = input.getNextEntry(); Objects.nonNull(entry); entry = input.getNextEntry()) {\n\t\t\tif (Objects.isNull(ret)) {\n\t\t\t\tret = entry;\n\t\t\t}\n\n\t\t\tString fileName = entry.getName();\n\t\t\tFile newFile = new File(outputDirectory + File.separator + fileName);\n\n\t\t\t(new File(newFile.getParent())).mkdirs();\n\n\t\t\tif (entry.isDirectory()) {\n\t\t\t\tnewFile.mkdirs();\n\t\t\t} else {\n\t\t\t\tstoreFile(input, newFile);\n\t\t\t}\n\n\t\t}\n\t\tinput.closeEntry();\n\t\tinput.close();\n\t\treturn ret;\n\t}",
"public static void extractZip(String archiveFile, String destinationPath) {\n\t\tFile targetDir = new File(destinationPath);\n\t\ttry (InputStream is = new FileInputStream(new File(archiveFile));\n\t\t\t\tArchiveInputStream i = new ArchiveStreamFactory().createArchiveInputStream(ArchiveStreamFactory.ZIP, is);) {\n\t\t\tArchiveEntry entry = null;\n\t\t\twhile ((entry = i.getNextEntry()) != null) {\n\t\t\t\tif (!i.canReadEntryData(entry)) {\n\t\t\t\t\tlog.error(\"entry cannot be read!! \" + entry.getName());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (entry.isDirectory()) {\n\t\t\t\t\t// ignore dirs as we don't want to extract any directories (non will exist in this case)\n\t\t\t\t} else {\n\t\t\t\t\t//no point in unzipping empty files\n\t\t\t\t\tif(entry.getSize() > 0) {\n\t\t\t\t\t\tString name = entry.getName();\n\t\t\t\t\t\t//in case the file was a child to a folder, we remove the parent name\n\t\t\t\t\t\tif(name.lastIndexOf(\"/\")!=-1) {\n\t\t\t\t\t\t\tname = name.substring(name.lastIndexOf(\"/\")+1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tFile f = new File(targetDir + \"/\" + name);\n\t\t\t\t\t\tOutputStream o = Files.newOutputStream(f.toPath());\n\t\t\t\t\t\tIOUtils.copy(i, o);\n\t\t\t\t\t\to.close();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlog.fatal(\"Exception thrown while zipping\", e);\n\t\t}\n\t}",
"private void extractFile(ZipInputStream zipIn, String filePath) throws IOException {\n BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));\n byte[] bytesIn = new byte[BUFFER_SIZE];\n int read = 0;\n while ((read = zipIn.read(bytesIn)) != -1) {\n bos.write(bytesIn, 0, read);\n }\n bos.close();\n }",
"private void extractFile(ZipInputStream zipIn, String filePath) throws IOException {\n BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));\n byte[] bytesIn = new byte[BUFFER_SIZE];\n int read = 0;\n while ((read = zipIn.read(bytesIn)) != -1) {\n bos.write(bytesIn, 0, read);\n }\n bos.close();\n }",
"public void ExtractFileFromJar()\n\t{\n\t\tString thisDir = getClass().getResource(\"\").getPath();\n\t\t\n\t\tif(thisDir.contains(\"file:\")) //Mac system path\n\t\t\tthisDir= thisDir.replace(\"file:\", \"\");\n\t\telse //Windows system path \"/C:/\", we need to get rid of the first '/'\n\t\t\tthisDir= thisDir.substring(1);\n\t\t\n\t\t//System.out.println(\"thisDir is \"+thisDir);\n\t\tString jarPath = thisDir.replace(\"!/data/\", \"\"); //Get path of jar file\n\t\tint lastSlashIndex = jarPath.lastIndexOf(\"/\");\n\t\tjarFileName = new String(jarPath.substring(lastSlashIndex+1));\n\t\tdestDir = thisDir.replace(jarFileName+\"!/data/\", \"\"); //Set destDir as the current folder in which jar file sits\n\n\t\t//Find Jar file\n\t\ttry {\n\t\t\tFile jarFile = new File(jarPath);\n\t\t\tif (jarFile.isDirectory() || !jarFile.exists()) { //If we cant find jar File in this jarPath\n\t\t\t\t//In windows it is like this \"C:/Users/Esheen/Desktop/ConnChem_1.1.0/Simulation/data/\" \n\t\t\t\tFile newJarfile = new File(jarPath);\n\t\t\t\tString parent = newJarfile.getParentFile().getParent();\n\t\t\t\tparent = parent.concat(new String(\"\\\\\"+jarFileName));\n\t\t\t\t\n\t\t\t\tjarPath= new String(parent);\n\t\t\t\t\n\t\t\t} \n\t\t\tjava.util.jar.JarFile jar = new java.util.jar.JarFile(jarPath);\n\t\t\t\n\t\t\t//Unzip database from jar file\n\t\t\tZipEntry entry = jar.getEntry(\"data/chemdb\");\n\t\t\tFile outputFile = new File(destDir, dbFileName);\n\t\t\t\n\t\t\t\tif (entry.isDirectory()) { // if its a directory, create it\n\t\t\t\t\toutputFile.mkdir();\n\t\t\t\t}\n\t\t\t\tInputStream in = jar.getInputStream(entry);\n\t\t\t\tFileOutputStream fos = new java.io.FileOutputStream(outputFile);\n\t\t\t\twhile (in.available() > 0) { // write contents of 'is' to 'fos'\n\t\t\t\t\tfos.write(in.read());\n\t\t\t\t}\n\t\t\t\tfos.close();\n\t\t\t\tin.close();\n\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void unzip(File f) throws Exception {\r\n String destDir = workplace + \"/temp/\";\r\n File tmp = new File(destDir);\r\n if(!tmp.exists())tmp.mkdir();\r\n byte b[] = new byte [1024];\r\n int length;\r\n \r\n ZipFile zipFile;\r\n zipFile = new ZipFile(f);\r\n Enumeration enumeration = zipFile.entries();\r\n ZipEntry zipEntry = null ;\r\n OutputStream outputStream = null;\r\n InputStream inputStream = null;\r\n while (enumeration.hasMoreElements()) {\r\n zipEntry = (ZipEntry) enumeration.nextElement();\r\n File loadFile = new File(destDir + zipEntry.getName());\r\n if (zipEntry.isDirectory()) {\r\n // 这段都可以不要,因为每次都貌似从最底层开始遍历的\r\n loadFile.mkdirs();\r\n }else{\r\n if (!loadFile.getParentFile().exists())\r\n loadFile.getParentFile().mkdirs();\r\n outputStream = new FileOutputStream(loadFile);\r\n inputStream = zipFile.getInputStream(zipEntry);\r\n while ((length = inputStream.read(b)) > 0)\r\n outputStream.write(b, 0, length);\r\n }\r\n }\r\n outputStream.flush();\r\n outputStream.close();\r\n inputStream.close();\r\n }",
"@SuppressWarnings(\"unchecked\")\n private boolean unzipFolder(File archiveFile, long compressedSize, File unzipDestFolder, String description, String[] outZipRootFolder, ITaskMonitor monitor) {\n description += \" (%1$d%%)\";\n ZipFile zipFile = null;\n try {\n zipFile = new ZipFile(archiveFile);\n boolean usingUnixPerm = SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_DARWIN || SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_LINUX;\n long incStep = compressedSize / NUM_MONITOR_INC;\n long incTotal = 0;\n long incCurr = 0;\n int lastPercent = 0;\n byte[] buf = new byte[65536];\n Enumeration<ZipArchiveEntry> entries = zipFile.getEntries();\n while (entries.hasMoreElements()) {\n ZipArchiveEntry entry = entries.nextElement();\n String name = entry.getName();\n name = name.replace('\\\\', '/');\n int pos = name.indexOf('/');\n if (pos < 0 || pos == name.length() - 1) {\n continue;\n } else {\n if (outZipRootFolder[0] == null && pos > 0) {\n outZipRootFolder[0] = name.substring(0, pos);\n }\n name = name.substring(pos + 1);\n }\n File destFile = new File(unzipDestFolder, name);\n if (name.endsWith(\"/\")) {\n if (!destFile.isDirectory() && !destFile.mkdirs()) {\n monitor.setResult(\"Failed to create temp directory %1$s\", destFile.getPath());\n return false;\n }\n continue;\n } else if (name.indexOf('/') != -1) {\n File parentDir = destFile.getParentFile();\n if (!parentDir.isDirectory()) {\n if (!parentDir.mkdirs()) {\n monitor.setResult(\"Failed to create temp directory %1$s\", parentDir.getPath());\n return false;\n }\n }\n }\n FileOutputStream fos = null;\n try {\n fos = new FileOutputStream(destFile);\n int n;\n InputStream entryContent = zipFile.getInputStream(entry);\n while ((n = entryContent.read(buf)) != -1) {\n if (n > 0) {\n fos.write(buf, 0, n);\n }\n }\n } finally {\n if (fos != null) {\n fos.close();\n }\n }\n if (usingUnixPerm && destFile.isFile()) {\n int mode = entry.getUnixMode();\n if ((mode & 0111) != 0) {\n setExecutablePermission(destFile);\n }\n }\n for (incTotal += entry.getCompressedSize(); incCurr < incTotal; incCurr += incStep) {\n monitor.incProgress(1);\n }\n int percent = (int) (100 * incTotal / compressedSize);\n if (percent != lastPercent) {\n monitor.setDescription(description, percent);\n lastPercent = percent;\n }\n if (monitor.isCancelRequested()) {\n return false;\n }\n }\n return true;\n } catch (IOException e) {\n monitor.setResult(\"Unzip failed: %1$s\", e.getMessage());\n } finally {\n if (zipFile != null) {\n try {\n zipFile.close();\n } catch (IOException e) {\n }\n }\n }\n return false;\n }",
"public static boolean unzip(String unZipFile, String saveFilePath) {\n boolean succeed = true;\n ZipInputStream zin = null;\n ZipEntry entry;\n try {\n // zip file path\n File olddirec = new File(unZipFile);\n zin = new ZipInputStream(new FileInputStream(unZipFile));\n // iterate ZipEntry in zip\n while ((entry = zin.getNextEntry()) != null) {\n // if folder,create it\n if (entry.isDirectory()) {\n File directory = new File(olddirec.getParent(),\n entry.getName());\n if (!directory.exists()) {\n if (!directory.mkdirs()) {\n System.out.println(\"Create foler in \"\n + directory.getAbsoluteFile() + \" failed\");\n }\n }\n zin.closeEntry();\n }\n // if file,unzip it\n if (!entry.isDirectory()) {\n File myFile = new File(saveFilePath);\n FileOutputStream fout = null;\n DataOutputStream dout = null;\n try {\n fout = new FileOutputStream(myFile);\n dout = new DataOutputStream(fout);\n byte[] b = new byte[1024];\n int len = 0;\n while ((len = zin.read(b)) != -1) {\n dout.write(b, 0, len);\n }\n } finally {\n if (dout != null) {\n try {\n dout.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n if (fout != null) {\n try {\n fout.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n zin.closeEntry();\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n succeed = false;\n System.out.println(e);\n } finally {\n if (null != zin) {\n try {\n zin.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n if (succeed)\n System.out.println(\"File unzipped successfully!\");\n else\n System.out.println(\"File unzipped with failure!\");\n return succeed;\n }",
"public static void extractFile(String zipFilePath, String inZipFilePath, String destDirectory) throws IOException {\n ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));\n ZipEntry entry = zipIn.getNextEntry();\n // iterates over entries in the zip file\n while (entry != null) {\n if (!entry.isDirectory() && inZipFilePath.equals(entry.getName())) {\n String filePath = entry.getName();\n int separatorIndex = filePath.lastIndexOf(File.separator);\n if (separatorIndex > -1)\n filePath = filePath.substring(separatorIndex + 1, filePath.length());\n filePath = destDirectory + File.separator + filePath;\n extractFile(zipIn, filePath);\n break;\n }\n zipIn.closeEntry();\n entry = zipIn.getNextEntry();\n }\n zipIn.close();\n }",
"public void extractFile(ZipInputStream zipIn, String filePath) throws IOException {\n final int BUFFER_SIZE = (int) 1e8;\n BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));\n byte[] bytesIn = new byte[BUFFER_SIZE];\n int read = 0;\n while ((read = zipIn.read(bytesIn)) != -1) {\n bos.write(bytesIn, 0, read);\n }\n bos.close();\n }",
"static void unzip(String zipFilePath, String destDirectory, boolean recursive, boolean teacherZip) throws IOException {\n\n if (students == null) {\n students = new ArrayList<Student>();\n }\n\n ZipInputStream zipIn = null;\n\n try {\n zipIn = new ZipInputStream(new FileInputStream(zipFilePath));\n ZipEntry entry = zipIn.getNextEntry();\n\n // iterates over entries in the zip file\n while (entry != null) {\n createFiles(destDirectory, zipIn, entry, recursive);\n\n zipIn.closeEntry();\n entry = zipIn.getNextEntry();\n }\n\n } catch (IOException e) {\n System.err.println(e.getMessage());\n Errors.setUnzipperError(true);\n\n } finally {\n if (zipIn != null) {\n zipIn.close();\n }\n }\n }",
"public static boolean SafeUnzipFile(ZipFile zf, String filepathinzip, File fileinfiledir, long crc) {\r\n BufferedOutputStream Output_fos = null;\r\n BufferedInputStream bufbr = null;\r\n try {\r\n ZipEntry ze = zf.getEntry(filepathinzip);\r\n if (ze == null) {\r\n if (Output_fos != null) {\r\n try {\r\n Output_fos.close();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n }\r\n }\r\n } catch (IOException e2) {\r\n e2.printStackTrace();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e3) {\r\n e3.printStackTrace();\r\n return false;\r\n }\r\n }\r\n return false;\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e4) {\r\n e4.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n if (crc != 0) {\r\n if (ze.getCrc() == crc) {\r\n if (Output_fos != null) {\r\n try {\r\n Output_fos.close();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e5) {\r\n e5.printStackTrace();\r\n return false;\r\n }\r\n }\r\n } catch (IOException e6) {\r\n e6.printStackTrace();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e7) {\r\n e7.printStackTrace();\r\n return false;\r\n }\r\n }\r\n return false;\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e8) {\r\n e8.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n }\r\n byte[] buf = UnzipFile(zf, ze);\r\n if (1 != 0) {\r\n BufferedOutputStream Output_fos2 = new BufferedOutputStream(new FileOutputStream(fileinfiledir));\r\n try {\r\n Output_fos2.write(buf, 0, buf.length);\r\n Output_fos = Output_fos2;\r\n } catch (Exception e9) {\r\n e = e9;\r\n Output_fos = Output_fos2;\r\n try {\r\n e.printStackTrace();\r\n if (Output_fos != null) {\r\n try {\r\n Output_fos.close();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e10) {\r\n e10.printStackTrace();\r\n return false;\r\n }\r\n }\r\n } catch (IOException e11) {\r\n e11.printStackTrace();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e12) {\r\n e12.printStackTrace();\r\n return false;\r\n }\r\n }\r\n return false;\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e13) {\r\n e13.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n } catch (Throwable th) {\r\n th = th;\r\n if (Output_fos != null) {\r\n }\r\n throw th;\r\n }\r\n } catch (Throwable th2) {\r\n th = th2;\r\n Output_fos = Output_fos2;\r\n if (Output_fos != null) {\r\n try {\r\n Output_fos.close();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e14) {\r\n e14.printStackTrace();\r\n return false;\r\n }\r\n }\r\n } catch (IOException e15) {\r\n e15.printStackTrace();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e16) {\r\n e16.printStackTrace();\r\n return false;\r\n }\r\n }\r\n return false;\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e17) {\r\n e17.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n throw th;\r\n }\r\n }\r\n if (Output_fos != null) {\r\n try {\r\n Output_fos.close();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e18) {\r\n e18.printStackTrace();\r\n return false;\r\n }\r\n }\r\n } catch (IOException e19) {\r\n e19.printStackTrace();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e20) {\r\n e20.printStackTrace();\r\n return false;\r\n }\r\n }\r\n return false;\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e21) {\r\n e21.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n } catch (Exception e22) {\r\n e = e22;\r\n }\r\n }",
"void onUnzipCompleted(String output);",
"public boolean ZipFile(String sSourceFilePath, String sDestinationZipFilePath, boolean bReplaceExisting) {\n byte[] buffer = new byte[30720];\n FileInputStream fin = null;\n FileOutputStream fout = null;\n ZipOutputStream zout = null;\n int length;\n String sZipEntryFileName = \"\";\n File objFile = null;\n try {\n //check for source file\n if (sSourceFilePath.trim().equalsIgnoreCase(\"\")) {\n throw new Exception(\"Invalid Source File : \" + sSourceFilePath);\n }\n objFile = new File(sSourceFilePath);\n if (!objFile.exists()) {\n throw new Exception(\"Source file not found : \" + sSourceFilePath);\n }\n\n //check for destination Zip file\n if (sDestinationZipFilePath.trim().equalsIgnoreCase(\"\") || sDestinationZipFilePath == null) {\n String stmp_Path = objFile.getAbsolutePath();\n String stmp_Name = objFile.getName();\n if (stmp_Name.contains(\".\")) { //check for removing extension\n int indx = 0;\n try {\n indx = stmp_Name.indexOf(\".\", stmp_Name.length() - 5);\n } catch (Exception e) {\n indx = 0;\n }\n if (indx <= 0) {\n indx = stmp_Name.length();\n }\n\n stmp_Name = stmp_Name.substring(0, indx);\n stmp_Name = stmp_Name + \".zip\";\n }\n sDestinationZipFilePath = stmp_Path + File.separator + stmp_Name;\n }\n\n objFile = new File(sDestinationZipFilePath);\n if (objFile.exists()) {\n if (bReplaceExisting) {\n objFile.delete();\n } else {\n throw new Exception(\"Destination ZipFile Already exists : \" + sDestinationZipFilePath);\n }\n }\n\n //Zipping File\n sZipEntryFileName = sSourceFilePath.substring(sSourceFilePath.lastIndexOf(\"\\\\\") + 1);\n fout = new FileOutputStream(sDestinationZipFilePath);\n zout = new ZipOutputStream(fout);\n fin = new FileInputStream(sSourceFilePath);\n zout.putNextEntry(new ZipEntry(sZipEntryFileName));\n while ((length = fin.read(buffer)) > 0) {\n zout.write(buffer, 0, length);\n }\n\n return true;\n\n } catch (Exception exp) {\n println(\"Src = \" + sSourceFilePath + \" : Dest = \" + sDestinationZipFilePath + \" : \" + exp.toString());\n return false;\n } finally {\n try {\n fin.close();\n } catch (Exception exp) {\n }\n try {\n zout.closeEntry();\n } catch (Exception exp) {\n }\n try {\n zout.close();\n } catch (Exception exp) {\n }\n }\n }",
"public Result unzip() {\n MultipartFormData<File> body = request().body().asMultipartFormData();\n MultipartFormData.FilePart<File> fileInput = body.getFile(\"inputFile\");\n String filename = fileInput.getFilename();\n if (fileInput != null) {\n File file = (File) fileInput.getFile();\n File nf = new File(ZIP_URL + filename);\n boolean rst = file.renameTo(nf);\n String destDir = ZipUtils.unZip(ZIP_URL + filename, ZIP_URL);\n File dir = new File(ZIP_URL);\n String[] dirList = dir.list();\n return ok(afterUpload.render(Arrays.asList(dirList)));\n } else {\n return badRequest(\"error\");\n }\n }",
"private void unCompress()\n\t{\n\t\ttry\n\t\t{\n\t\t\tbyte[] buffer = new byte[4096];\n\t\t\tint bytesIn;\n\t\t\tZipFile rfoFile = new ZipFile(path + fileName);\n\t\t\tEnumeration<? extends ZipEntry> allFiles = rfoFile.entries();\n\t\t\twhile(allFiles.hasMoreElements())\n\t\t\t{\n\t\t\t\tZipEntry ze = (ZipEntry)allFiles.nextElement();\n\t\t\t\tInputStream is = rfoFile.getInputStream(ze);\n\t\t\t\tString fName = processSeparators(ze.getName());\n\t\t\t\tFile element = new File(tempDir + fName);\n\t\t\t\torg.reprap.Main.ftd.add(element);\n\t\t\t\tFileOutputStream os = new FileOutputStream(element);\n\t\t\t\twhile((bytesIn = is.read(buffer)) != -1) \n\t\t\t\t\tos.write(buffer, 0, bytesIn);\n\t\t\t\tos.close();\n\t\t\t}\n\t\t} catch (Exception e)\n\t\t{\n\t\t\tDebug.e(\"RFO.unCompress(): \" + e);\n\t\t}\n\t}",
"public static void unZip(String zipFilePath, String outPath) throws Exception {\n unZip(new FileInputStream(zipFilePath), outPath);\n }",
"public void jieya() {\n\t\tlong startTime=System.currentTimeMillis();\n\t\ttry {\n\t\t\tZipInputStream Zin=new ZipInputStream(new FileInputStream(\n\t\t\t\t\tf1.getText()));//输入源zip路径\n\t\t\tBufferedInputStream Bin=new BufferedInputStream(Zin);\n\t\t\tString Parent=\"D:\\\\XM\\\\解压\"; //输出路径(文件夹目录)\n\t\t\tFile Fout=null;\n\t\t\tZipEntry entry;\n\t\t\ttry {\n\t\t\t\twhile((entry = Zin.getNextEntry())!=null && !entry.isDirectory()){\n\t\t\t\t\tFout=new File(Parent,entry.getName());\n\t\t\t\t\tif(!Fout.exists()){\n\t\t\t\t\t\t(new File(Fout.getParent())).mkdirs();\n\t\t\t\t\t}\n\t\t\t\t\tFileOutputStream out=new FileOutputStream(Fout);\n\t\t\t\t\tBufferedOutputStream Bout=new BufferedOutputStream(out);\n\t\t\t\t\tint b;\n\t\t\t\t\twhile((b=Bin.read())!=-1){\n\t\t\t\t\t\tBout.write(b);\n\t\t\t\t\t}\n\t\t\t\t\tBout.close();\n\t\t\t\t\tout.close();\n\t\t\t\t\tJOptionPane.showMessageDialog(null,Fout+\"解压成功\");\t\n\t\t\t\t}\n\t\t\t\tBin.close();\n\t\t\t\tZin.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\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tlong endTime=System.currentTimeMillis();\n\t}",
"@Test\n public void testDecompressWithoutPrefix() throws Exception {\n\n Path outputDir =\n new CompressedTarFunction() {\n @Override\n protected InputStream getDecompressorStream(DecompressorDescriptor descriptor)\n throws IOException {\n return new GZIPInputStream(new FileInputStream(descriptor.archivePath().getPathFile()));\n }\n }.decompress(descriptorBuilder.build());\n\n assertOutputFiles(outputDir.getRelative(ROOT_FOLDER_NAME).getRelative(INNER_FOLDER_NAME));\n }",
"private boolean unZipFileFromUrl(final String zipUrl, final File unzipFolder)\n {\n // cleanup left over files\n FileUtils.deleteFile(unzipFolder);\n FileUtils.createDirectories(unzipFolder);\n\n final URL downloadUrl;\n\n try {\n downloadUrl = new URL(zipUrl);\n\n } catch (final MalformedURLException e) {\n LOGGER.error(String.format(FishStatJFileConstants.DOWNLOAD_ERROR, zipUrl), e);\n return false;\n }\n\n try\n (InputStream urlInputStream = downloadUrl.openStream();\n ZipInputStream zipStream = new ZipInputStream(urlInputStream)) {\n\n // iterate through the files of the zip input stream\n while (true) {\n final ZipEntry entry = zipStream.getNextEntry();\n\n if (entry == null)\n break;\n\n // open streams for writing files to disk\n try\n (OutputStream fileOut = Files.newOutputStream(new File(unzipFolder, entry.getName()).toPath());\n BufferedOutputStream bufferedFileOut = new BufferedOutputStream(fileOut, FishStatJFileConstants.ZIP_EXTRACT_BUFFER_SIZE)) {\n\n // write the file from the stream to disk\n final byte[] fileOutBuffer = new byte[FishStatJFileConstants.ZIP_EXTRACT_BUFFER_SIZE];\n\n while (true) {\n final int readByteCount = zipStream.read(fileOutBuffer, 0, fileOutBuffer.length);\n\n if (readByteCount == -1)\n break;\n else\n bufferedFileOut.write(fileOutBuffer, 0, readByteCount);\n }\n\n bufferedFileOut.flush();\n }\n }\n\n return true;\n\n } catch (final ZipException e) {\n LOGGER.error(String.format(FishStatJFileConstants.UNZIP_ERROR, zipUrl), e);\n\n } catch (final IOException e) {\n LOGGER.error(String.format(FishStatJFileConstants.DOWNLOAD_ERROR, zipUrl), e);\n }\n\n return false;\n }",
"public static void unzip(InputStream is, String outdir) throws IOException {\r\n\r\n\t\tbyte[] buffer = new byte[buffSize];\r\n\r\n\t\tjava.util.zip.ZipInputStream zis = new java.util.zip.ZipInputStream(new BufferedInputStream(is));\r\n\r\n\t\tjava.util.zip.ZipEntry entry;\r\n\r\n\t\ttry {\r\n\t\t\twhile ((entry = zis.getNextEntry()) != null) {\r\n\r\n\t\t\t\tFile of = new File(outdir + File.separator + entry.getName());\r\n\r\n\t\t\t\tif (entry.isDirectory()) {\r\n\t\t\t\t\tof.mkdirs();\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tFile xx = new File(of.getParent());\r\n\t\t\t\t\tif (!xx.exists()) {\r\n\t\t\t\t\t\tStack<String> todo = new Stack<String>();\r\n\t\t\t\t\t\tdo {\r\n\t\t\t\t\t\t\ttodo.push(xx.getAbsolutePath());\r\n\t\t\t\t\t\t\txx = new File(xx.getParent());\r\n\t\t\t\t\t\t} while (!xx.exists());\r\n\t\t\t\t\t\twhile (todo.size() > 0) {\r\n\t\t\t\t\t\t\txx = new File(todo.pop());\r\n\t\t\t\t\t\t\tif (!xx.exists()) {\r\n\t\t\t\t\t\t\t\txx.mkdirs();\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\r\n\t\t\t\tBufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(of), buffer.length);\r\n\r\n\t\t\t\tcpio(new BufferedInputStream(zis), bos, \"unzip:\" + entry.getName());\r\n\r\n\t\t\t\tbos.flush();\r\n\t\t\t\tbos.close();\r\n\t\t\t}\r\n\t\t} catch (IllegalArgumentException e) {\r\n\t\t\t// problem with chars in entry name likely\r\n\t\t}\r\n\t\tzis.close();\r\n\r\n\t}",
"private void compress()\n\t{\n\t\ttry\n\t\t{\n\t\t\tZipOutputStream rfoFile = new ZipOutputStream(new FileOutputStream(path + fileName)); \n\t\t\tFile dirToZip = new File(rfoDir); \n\t\t\tString[] fileList = dirToZip.list(); \n\t\t\tbyte[] buffer = new byte[4096]; \n\t\t\tint bytesIn = 0; \n\n\t\t\tfor(int i=0; i<fileList.length; i++) \n\t\t\t{ \n\t\t\t\tFile f = new File(dirToZip, fileList[i]); \n\t\t\t\tFileInputStream fis = new FileInputStream(f); \n\t\t\t\tString zEntry = f.getPath();\n\t\t\t\t//System.out.println(\"\\n\" + zEntry);\n\t\t\t\tint start = zEntry.indexOf(uniqueName);\n\t\t\t\tzEntry = zEntry.substring(start + uniqueName.length() + 1, zEntry.length());\n\t\t\t\t//System.out.println(tempDir);\n\t\t\t\t//System.out.println(zEntry + \"\\n\");\n\t\t\t\tZipEntry entry = new ZipEntry(zEntry); \n\t\t\t\trfoFile.putNextEntry(entry); \n\t\t\t\twhile((bytesIn = fis.read(buffer)) != -1) \n\t\t\t\t\trfoFile.write(buffer, 0, bytesIn); \n\t\t\t\tfis.close();\n\t\t\t}\n\t\t\trfoFile.close();\n\t\t} catch (Exception e)\n\t\t{\n\t\t\tDebug.e(\"RFO.compress(): \" + e);\n\t\t}\n\t}",
"public FilesArchived(File rootDir, String zip) {\n this.root = rootDir;\n this.compression = (\"zstd\".equals(zip)) ? Compression.ZSTD : Compression.GZIP;\n rescan();\n Thread thread = new Thread(this::run);\n thread.setDaemon(true);\n thread.setName(\"FilesArchived-maintainer\");\n thread.start();\n }",
"public void unarchive(String baseDir) throws MojoExecutionException {\n try (FileInputStream fis = new FileInputStream(archive);\n ZipArchiveInputStream zipIn = new ZipArchiveInputStream(fis)) {\n ZipArchiveEntry zipEnry = zipIn.getNextZipEntry();\n while (zipEnry != null) {\n // Create a file for this tarEntry\n final File destPath = new File(baseDir + File.separator + zipEnry.getName());\n if (zipEnry.isDirectory()) {\n destPath.mkdirs();\n }\n else {\n destPath.createNewFile();\n try (BufferedOutputStream bout = new BufferedOutputStream(new FileOutputStream(destPath))) {\n IOUtils.copy(zipIn, bout);\n }\n }\n zipEnry = zipIn.getNextZipEntry();\n }\n }\n catch (IOException ex) {\n throw new MojoExecutionException(\"Could not extract archive: \" + archive.getAbsolutePath(), ex);\n }\n\n // delete archive after extraction\n archive.delete();\n }",
"public static void packToZip(String sourceDirPath, String zipFilePath) throws IOException {\n Path p;\n p = Files.createFile(Paths.get(zipFilePath));\n try (ZipOutputStream zs = new ZipOutputStream(Files.newOutputStream(p))) {\n Path pp = Paths.get(sourceDirPath);\n Files.walk(pp)\n .filter(path -> !Files.isDirectory(path))\n .forEach(path -> {\n if (!path.toString().endsWith(\".zip\")) {\n ZipEntry zipEntry = new ZipEntry(pp.relativize(path).toString());\n try {\n zs.putNextEntry(zipEntry);\n Files.copy(path, zs);\n zs.closeEntry();\n } catch (IOException e) {\n System.err.println(e);\n }\n }\n });\n }\n }",
"protected static void zipDir(File zipDir, ZipOutputStream zos, String archiveSourceDir)\n throws IOException {\n String[] dirList = zipDir.list();\n byte[] readBuffer = new byte[40960];\n int bytesIn;\n //loop through dirList, and zip the files\n if (dirList != null) {\n for (String aDirList : dirList) {\n File f = new File(zipDir, aDirList);\n //place the zip entry in the ZipOutputStream object\n zos.putNextEntry(new ZipEntry(getZipEntryPath(f, archiveSourceDir)));\n if (f.isDirectory()) {\n //if the File object is a directory, call this\n //function again to add its content recursively\n zipDir(f, zos, archiveSourceDir);\n //loop again\n continue;\n }\n //if we reached here, the File object f was not a directory\n //create a FileInputStream on top of f\n try (FileInputStream fis = new FileInputStream(f)) {\n //now write the content of the file to the ZipOutputStream\n while ((bytesIn = fis.read(readBuffer)) != -1) {\n zos.write(readBuffer, 0, bytesIn);\n }\n }\n }\n }\n }",
"Decompress() {\r\n // this.destinationLocation = null ; //destinationLocation;\r\n }",
"private static void extractArchive(Path sourcePath, Path targetPath) throws IOException {\n\n // TODO: janv_capgemini check if sourcePath is an archive and throw exception if not\n FileSystem fs = FileSystems.newFileSystem(sourcePath, null);\n\n Path path = fs.getPath(\"/\");\n Files.walkFileTree(path, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n\n Path relativePath = path.relativize(file);\n Path targetPathResolved = targetPath.resolve(relativePath.toString());\n Files.deleteIfExists(targetPathResolved);\n Files.createDirectories(targetPathResolved.getParent());\n Files.copy(file, targetPathResolved);\n return FileVisitResult.CONTINUE;\n }\n\n @Override\n public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {\n\n // Log errors but do not throw an exception\n LOG.warn(\"An IOException occurred while reading a file on path {} with message: {}\", file, exc.getMessage());\n LOG.debug(\"An IOException occurred while reading a file on path {} with message: {}\", file,\n LOG.isDebugEnabled() ? exc : null);\n return FileVisitResult.CONTINUE;\n }\n });\n\n }",
"public void readZip(File f) {\r\n try {\r\n unzip(f);\r\n File file = new File(workplace + \"/temp/USQ_IMAGE\");\r\n File old = new File(workplace + \"/old\");\r\n if(!old.exists())old.mkdir();\r\n if(old.exists()&&old.isFile())old.mkdir();\r\n File files[] = file.listFiles();\r\n for(int i=0 ; i<files.length ; i++){\r\n readFile(files[i]);\r\n }\r\n //new session\r\n createSes(f);\r\n } catch (Exception ex) {\r\n JOptionPane.showMessageDialog(null, \"read zip file failed.\", \"System Message\", JOptionPane.ERROR_MESSAGE);\r\n ex.printStackTrace();\r\n }\r\n }",
"public File extractTo (File destination) throws IOException\n\t{\n\t\ttry (DirectoryStream<Path> directoryStream = Files\n\t\t\t.newDirectoryStream (zipfs.getPath (\"/\"));)\n\t\t{\n\t\t\tfor (Path file : directoryStream)\n\t\t\t{\n\t\t\t\textract (file, destination.toPath ());\n\t\t\t}\n\t\t}\n\t\treturn destination;\n\t}",
"public static void decompress(String inFile) throws Exception{\n\tIO.Decompressor io = new IO.Decompressor(inFile);\n HashMap<Integer, String> dictionary = new HashMap<Integer, String>();\n int count = 1;\n dictionary.put(new Integer(0), new String() );\n String output = \"\";\n Integer index;\n char character = 1;\n while( character != 0 ) {\n \t IO.Pair next = io.decode();\n index = new Integer(next.getIndex());\n character = next.getCharacter();\n \n output = dictionary.get(index);\n if (character == 0) io.append(output);\n else output = output + character;\n \t io.append(output);\n dictionary.put(new Integer(count), output);\n count++;\n }\n \n \n /* Close all relevant files */\n io.done();\n\n\n\n }",
"public String execute(File directoryToZip, String zipName) {\r\n String fileName = null;\r\n if(directoryToZip != null){\r\n try{\r\n List<File> fileList = new ArrayList<File>();\r\n getAllFiles(directoryToZip, fileList);\r\n fileName = writeZipFile(directoryToZip, fileList, zipName);\r\n } catch(Exception e){\r\n e.printStackTrace();\r\n }\r\n }\r\n return fileName;\r\n }",
"@Test\n public void testDecompressWithPrefix() throws Exception {\n\n descriptorBuilder.setPrefix(ROOT_FOLDER_NAME);\n\n Path outputDir =\n new CompressedTarFunction() {\n @Override\n protected InputStream getDecompressorStream(DecompressorDescriptor descriptor)\n throws IOException {\n return new GZIPInputStream(new FileInputStream(descriptor.archivePath().getPathFile()));\n }\n }.decompress(descriptorBuilder.build());\n\n assertOutputFiles(outputDir.getRelative(INNER_FOLDER_NAME));\n }",
"private static FileSystem openZip(Path zipPath) throws IOException, URISyntaxException{\n\t Map<String, String> providerProps = new HashMap<>();\r\n\t\tproviderProps.put(\"create\", \"true\");\r\n\t\t\r\n\t\t// Um ZipFiles zu erstellen benötigt man URIs, deswegen werden sie hier erstellt\r\n\t\tURI zipUri = new URI(\"jar:file\", zipPath.toUri().getPath(), null);\r\n\t\tFileSystem zipFs = FileSystems.newFileSystem(zipUri, providerProps); // Statische Methode wird hier angewendet\r\n\t\t\r\n\t\treturn zipFs;\r\n\t}",
"public static void extractAndSaveFile(ZipInputStream zip,\n \t\t\tFileOutputStream destinationFile) throws IOException {\n \t\tByteArrayOutputStream out = readZipEntry(zip);\n \t\tdestinationFile.write(out.toByteArray());\n \t\tout.close();\n \t\tdestinationFile.close();\n \t}",
"private static void createZipArchiv(String xmlStream, String path, String name) {\r\n\t\ttry {\r\n\t\t\tFile file = new File(path, name + \".xml\");\r\n\t\t\tif (!file.exists()) {\r\n\t\t\t\tfile.createNewFile();\r\n\t\t\t}\r\n\t\t\t//XMLStream in Datei schreiben\r\n\t\t\tPrintWriter writer = new PrintWriter(file);\r\n\t\t\twriter.write(xmlStream);\r\n\t\t\twriter.close();\r\n\t\t\t\r\n\t\t\t//Commando für die Shell um ein Tgz zu erstellen.\r\n\t\t\tString[] str = new String[] {\r\n\t\t\t\t\t\"/bin/bash\",\r\n\t\t\t\t\t\"-c\",\r\n\t\t\t\t\t\"tar cfvz \" + path + \"/\" + name + \".tgz -C \" + path + \" \" + name\r\n\t\t\t\t\t\t\t+ \".xml -C \" + path + \" \" + name + \".pdf\" };\r\n\r\n\t\t\t//Shell Aufruf\r\n\t\t\tProcess p = Runtime.getRuntime().exec(str);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tint timeout = 10;\r\n\t\t\twhile (!new File(path + name + \".tgz\").exists() && timeout != 0) {\r\n\t\t\t\t//warten bis Datei erstellt wurde oder 10 sec vergangen sind\r\n\t\t\t\ttry {\r\n\t\t\t\t\ttimeout--;\r\n\t\t\t\t\tThread.sleep(1000);\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\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}",
"public static void unzip(File fileToUnzip, File outputFolder)\n\t\t\tthrows IOException {\n\t\tZipFile zipFile = new ZipFile(fileToUnzip);\n\t\tEnumeration<?> enu = zipFile.entries();\n\t\tunzipingFileSize = 0;\n\t\tunzipingLen = 0;\n\t\twhile (enu.hasMoreElements())\n\t\t\tunzipingFileSize += (long)((ZipEntry) enu.nextElement()).getSize();\n\t\tenu = zipFile.entries();\n\t\twhile (enu.hasMoreElements()) {\n\t\t\tZipEntry zipEntry = (ZipEntry) enu.nextElement();\n\t\t\tString name = zipEntry.getName();\n\t\t\tFile file = new File(outputFolder, name);\n\t\t\tdownloadingFile = file;\n\t\t\tif (name.endsWith(\"/\")) {\n\t\t\t\tfile.mkdirs();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tFile parent = file.getParentFile();\n\t\t\tif (parent != null)\n\t\t\t\tparent.mkdirs();\n\t\t\tInputStream is = zipFile.getInputStream(zipEntry);\n\t\t\tFileOutputStream fos = new FileOutputStream(file);\n\t\t\tbyte[] bytes = new byte[1024];\n\t\t\tint length;\n\t\t\twhile ((length = is.read(bytes)) >= 0) {\n\t\t\t\tfos.write(bytes, 0, length);\n\t\t\t\tunzipingLen += length;\n\t\t\t}\n\t\t\tis.close();\n\t\t\tfos.close();\n\t\t}\n\t\tzipFile.close();\n\t\tremove(new File(outputFolder, \"__MACOSX/\"));\n\t}",
"@Test\r\n public void testUnzipArchive() throws Exception {\r\n\r\n\r\n (new ZipUtils(\"Cp866\")).unzipArchive(\r\n \"src/test/resources/archive/testfile.zip\",\r\n \"target/test-classes/import/archive\"\r\n );\r\n\r\n File [] files = (new File(\"target/test-classes/import/archive\")).listFiles();\r\n\r\n boolean found = false;\r\n \r\n for (File file : files) {\r\n if (file.getAbsolutePath().contains(\"Привет, я файло.txt\")) {\r\n found = true;\r\n break;\r\n }\r\n }\r\n assertTrue(found);\r\n\r\n\r\n }",
"public void zip(String directoryInZip, \n String filePath) throws Exception\n {\n File thisFile = new File(filePath);\n\n if (thisFile.exists()) {\n\n try {\n FileInputStream fi = new FileInputStream(thisFile);\n\n origin = new BufferedInputStream(fi, BUFFER);\n\n ZipEntry entry = new ZipEntry(directoryInZip + File.separator\n + thisFile.getName());\n out.putNextEntry(entry);\n\n int count;\n while ((count = origin.read(data, 0, BUFFER)) != -1) {\n out.write(data, 0, count);\n }\n origin.close();\n\n } catch (FileNotFoundException e) {\n logger.error(\"File \" + filePath + \" not found !!\", e);\n } catch (IOException e) {\n logger.error(\"Could not write to Zip File \", e);\n throw new Exception(\"Could not write to Zip File \", e);\n }\n\n } else {\n // Log message if file does not exist\n logger.info(\"File \" + thisFile.getName()\n + \" does not exist on file system\");\n\n } \t\t\n }",
"public static boolean unZipFile(String _location, String _zipFile) {\n boolean unzipped = false;\n try {\n FileInputStream fin = new FileInputStream(_location + \"/\" + _zipFile);\n ZipInputStream zin = new ZipInputStream(fin);\n ZipEntry ze;\n while ((ze = zin.getNextEntry()) != null) {\n if (ze.isDirectory()) {\n File f = new File(_location + \"/\" + ze.getName());\n if(!f.isDirectory()) {\n f.mkdirs();\n }\n } else {\n FileOutputStream fOut = new FileOutputStream(_location + \"/\" + ze.getName());\n BufferedOutputStream bufOut = new BufferedOutputStream(fOut);\n byte[] buffer = new byte[1024];\n int read;\n while ((read = zin.read(buffer)) != -1) {\n bufOut.write(buffer, 0, read);\n }\n bufOut.close();\n zin.closeEntry();\n fOut.close();\n }\n }\n zin.close();\n unzipped = true;\n } catch (Exception e) {\n writeLog(LOG_LEVEL.ERROR, \"Unzipping failed - \" + e.getLocalizedMessage());\n }\n return unzipped;\n }",
"public StreamUnzipper(InputStream zipStream, File destDir)\n {\n if (zipStream == null)\n throw new IllegalArgumentException(\"zip stream cannot be null\");\n this.zis = new ZipInputStream(zipStream);\n this.destDir = destDir;\n }",
"protected File createZipArchive(File directoryToZip, String modpackName, String workspace) throws Exception {\n zipName = LocalDateTime.now().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd-HH-mm-ss\")) + \"--\" + modpackName + \".zip\";\n uploadStatus = \"Creating Zipfile from Directory\";\n File zipFile = new File(workspace + \"\\\\\" + zipName);\n try {\n ProgressBarLogic progressBarLogic = new ProgressBarLogic(directoryToZip);\n ZipUtil.pack(directoryToZip, zipFile, name -> {\n uploadStatus = \"Adding file: \" + name + \" to the zip\";\n progressBarLogic.progressPercentage = 0;\n progressBarLogic.progress.add(name);\n progressBarLogic.calculateProgress(progressBarLogic.progress);\n notifyObserver();\n return name;\n });\n } catch (ZipException e) {\n throw e;\n } catch (Exception e) {\n System.out.println(e);\n }\n return zipFile;\n }",
"public static void generateZip(File file) {\r\n\t\t\r\n\t\tFile zipfile=new File(file.toString().replaceAll(\".xlsx\",\".zip\" ));\r\n\t\tFileOutputStream fos=null;\r\n\t\tZipOutputStream zos=null;\r\n\t\tFileInputStream fin=null;\r\n\t\tZipEntry ze=null; \r\n\t\t\t\r\n\t\tif(!zipfile.exists()){\r\n\t\t\ttry {\r\n\t\t\t\tzipfile.createNewFile();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\t//create ZipOutputStream to write to the zipfile\r\n fos=new FileOutputStream(zipfile);\r\n\t\t\t zos=new ZipOutputStream(fos);\r\n\t\t\t \r\n\t\t//add a new Zip Entry to the ZipOutPutStream \r\n\t\t\t ze=new ZipEntry(file.getName());\r\n\t\t\t zos.putNextEntry(ze);\r\n\t\t\t \r\n\t\t//read the file and write to the ZipOutPutStream\t \r\n\t\t\t fin=new FileInputStream(file);\r\n\t\t\t int i;\r\n\t\t\t \r\n\t\t\t while((i=fin.read())!=-1){\r\n\t\t\t\t zos.write(i);\r\n\t\t\t }\r\n\t\t\t\r\n\t\t\t \r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\r\n\t\t\te.printStackTrace();\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\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\tif(zos!=null && fos!=null && fin!=null){\r\n\t\t\t\t\ttry {\r\n\t\t\t\t //close the zip entry to write to to zip file\r\n\t\t\t\t\t\tzos.closeEntry();\r\n\t\t\t\t\t//close Resources.\t\r\n\t\t\t\t\t\tzos.close();\r\n\t\t\t\t\t\tfos.close();\r\n\t\t\t\t\t\tfin.close();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"public static void main(String [] args){\n\t\t String zipFilePath = args[1];\n\t\t //Directory of unzip Files\n\t\t String destDir = \"Dictionary\";\n\t\t //Calling a functions 5to unzip the directory\n\t\t unzip(zipFilePath, destDir);\n\t\t \n\n\t\t// The name of the file to open. File to be passed from arguments\n String fileName = args[0];\t\t\n\n // This will reference one line at a time\n String line = null;\n\n try {\n // FileReader reads text files in the default encoding.\n FileReader fileReader = \n new FileReader(fileName);\n\n // Always wrap FileReader in BufferedReader.\n BufferedReader bufferedReader = \n new BufferedReader(fileReader);\n\t\t\t\tint count = 0;\t\t\t\t\t\t//For counting how many words are wrong\n while((line = bufferedReader.readLine()) != null) {\n String[] words = line.split(\"\\\\W\");\t\t\t\t//Keeps the words in a line the the array \n int len = words.length;\n for(int i=0;i<len;i++){\n \t//System.out.println(words[i]);\n \tint flag = 0; \t\t\t\t//Just to check whether the words present or not\n \t//System.out.println(\"HI I am reading the file.\");\n \tFile folder = new File(\"Dictionary/dictionaries\");\n\t\t\t\t\tFile[] listOfFiles = folder.listFiles();\n\t\t\t\t\t//System.out.println(listOfFiles.length);\n\t\t\t\t\tfor (int i1 = 0; i1 < listOfFiles.length; i1++) {\n\t\t\t\t\t\tif(flag == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t File file = listOfFiles[i1];\n\t\t\t\t\t if (file.isFile()) {\n\t\t\t\t\t\t//I am checking\n\t\t\t\t\t\t // The name of the file to open.\n //String fileName1 = file;\n\n // This will reference one line at a time\n //String line1 = null;\n\t\t\tScanner myScanner = null;\t\t\t\t//Using Scanner Class to Read the words From file\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tmyScanner = new Scanner(file);\n\t\t\t\t\twhile(myScanner.hasNextLine()){\n \t\t\t\t\tif(flag==1){\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\tString contents=myScanner.nextLine();\n \t\t\t\t\t//...\n\t\t\t\t\t\tif(words[i].equalsIgnoreCase(contents)){\n\t\t\t\t\t\t//System.out.println(\"The given word is \" + words[i]);\n\t\t\t\t\t\tflag = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//String contents = myScanner.nextLine();\n\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\tfinally\n\t\t\t\t{\n\t\t\t\t\tif(myScanner != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tmyScanner.close(); \n\t\t\t\t\t}\n\t\t\t\t}\n \n\t\t\t\t\t } \n\t\t\t\t\t}\n\t\t\t\t\tif(flag==0){\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\tSystem.out.println(\"The wrong word is \" + words[i]);\n\t\t\t\t\t\t//System.out.println(i+1);\n\t\t\t\t\t}\n }\n //System.out.println(line);\n } \n\n // Always close files.\n bufferedReader.close(); \n System.out.println(\"The total number of wrong words are \");\n System.out.println(count);\n \n }\n catch(FileNotFoundException ex) {\n System.out.println(\n \"Unable to open file '\" + \n fileName + \"'\"); \n }\n catch(IOException ex) {\n System.out.println(\n \"Error reading file '\" \n + fileName + \"'\"); \n // Or we could just do this: \n // ex.printStackTrace();\n }\n \t}",
"public byte[] decompress() throws FlateDecompressException {\r\n //byte[] newData = new byte[16384];\r\n byte[] newData = new byte[1024*512];\r\n int len;\r\n try {\r\n while ((len=in.read(newData, 0, newData.length)) != -1) {\r\n out.write(newData, 0, len);\r\n }\r\n out.close();\r\n in.close();\r\n } catch (java.util.zip.ZipException ze) {\r\n ze.printStackTrace();\r\n //throw new FlateDecompressException(\"ZipException during decompression\");\r\n byte[] r = {0x0D, 0x0A};\r\n return r;\r\n } catch (java.io.IOException e) {\r\n e.printStackTrace();\r\n throw new FlateDecompressException(\"IO Exception during decompression\");\r\n }\r\n return out.toByteArray(); \r\n }",
"private ZipEntry parseCentralDirectoryEntry() throws IOException {\n // Positions the archive at the \"compressed size\" and read the value.\n skipBytes(ZipConstants.CENSIZ - ZipConstants.CENVEM);\n long compressSize = getInt();\n\n // Positions the archive at the \"filename length\" and read the value.\n skipBytes(ZipConstants.CENNAM - ZipConstants.CENLEN);\n int fileNameLen = getShort();\n\n // Reads the extra field length and the comment length.\n int extraLen = getShort();\n int commentLen = getShort();\n\n // Positions the archive at the \"local file header offset\" and read the value.\n skipBytes(ZipConstants.CENOFF - ZipConstants.CENDSK);\n long localHeaderOffset = getInt();\n\n // Reads the file name.\n byte[] fileNameBuf = new byte[fileNameLen];\n archive.read(ByteBuffer.wrap(fileNameBuf));\n String fileName = new String(fileNameBuf, Charset.forName(\"UTF-8\"));\n\n // Skips the extra field and the comment.\n skipBytes(extraLen + commentLen);\n\n ZipEntry entry = new ZipEntry();\n entry.setSize(compressSize);\n entry.setLocalHeaderOffset(localHeaderOffset);\n entry.setName(fileName);\n\n return entry;\n }",
"public String zipDirectoryInternalPath(String sourceDirectoryPath, String zipOutputPath) throws IOException {\n\t\t \t // DECLARATION:\n\t\t \t if(sourceDirectoryPath.endsWith(\"\\\\\")) { sourceDirectoryPath = sourceDirectoryPath.substring(0, sourceDirectoryPath.length() - 1); }\n\t\t \t sourceDirectoryPath = sourceDirectoryPath.replace(\"\\\\\", \"/\");\n\t\t \t zipOutputPath = zipOutputPath.replace(\"\\\\\", \"/\");\n\t\t \t // MESSAGE:\n\t\t \t fileWriterPrinter(\"\\nSOURCE DIRECTORY: \" + sourceDirectoryPath);\n\t\t \t fileWriterPrinter(\" ZIP OUTPUT PATH: \" + zipOutputPath + \"\\n\");\n\t\t \t \n\t\t File dir = new File(sourceDirectoryPath);\n\t\t File file = new File(zipOutputPath);\n\t\t // System.out.println(mydir.toURI().relativize(myfile.toURI()).getPath());\t\n\t\t zip(dir, file);\n\t\t return zipOutputPath;\n\t\t\t}",
"public static void unzip(BasicShell shell, File archive, File destination) {\n\t\ttry {\n\t\t\tshell.printOut(\"Extracting files from archive '\" + archive.getPath() + \"'.\");\n\t\t\tZipFile zipFile = new ZipFile(archive);\n\t\t\tEnumeration<? extends ZipEntry> e = zipFile.entries();\n\t\t\twhile (e.hasMoreElements() ) {\n\t\t\t\tZipEntry entry = e.nextElement();\n\t\t\t\tFile entryFile = new File(destination, entry.getName());\n\t\t\t\tif ( entry.isDirectory() ) {\n\t\t\t\t\tentryFile.mkdirs();\n\t\t\t\t} else {\n\t\t\t\t\tentryFile.getParentFile().mkdirs();\n\t\t\t\t\t\n\t\t\t\t\tInputStream entryStream = zipFile.getInputStream(entry);\n\t\t\t\t\tBufferedOutputStream outStream = new BufferedOutputStream(new FileOutputStream(entryFile));\n\t\t\t\t\tbyte[] buffer = new byte[2048];\n\t\t\t\t\tint count = entryStream.read(buffer);\n\t\t\t\t\twhile ( count > -1 ) {\n\t\t\t\t\t\toutStream.write(buffer, 0, count);\n\t\t\t\t\t\tcount = entryStream.read(buffer);\n\t\t\t\t\t}\n\t\t\t\t\toutStream.flush();\n\t\t\t\t\toutStream.close();\n\t\t\t\t\tentryStream.close();\n\t\t\t\t}\n\t\t\t\tshell.printOut(\"Extracted file '\" + entry.getName() + \"'.\") ;\n\t\t\t}\n\t\t\tzipFile.close();\n\t\t} catch (Exception e) {\n\t\t\tshell.getErrorHandler().handleError(Diagnostic.ERROR, e.getClass().getSimpleName() + \": \"+ e.getMessage());\n\t\t}\n\n\t\t\n\t}",
"private ZipCompressor(){}",
"@Test\n public void testDERIVATIVE_EXTRACT_CRC___() throws IOException {\n \n\t Configuration.CRC=true;\n\t Configuration.EXTRACT=true;\n\t Configuration.DERIVATIVE_EXTRACT_CRC=true;\n\t Configuration.COMPRESS=true;\n if(Configuration.CRC && Configuration.EXTRACT && Configuration.DERIVATIVE_EXTRACT_CRC && Configuration.COMPRESS) {\n \n ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(new File(\n homeDir + \"/files/Teste.txt.zip\")));\n zos.putNextEntry(new ZipEntry(homeDir + \"/files/Teste.txt.zip\"));\n zos.write(new byte[32]);\n ZipInputStream zis = new ZipInputStream(new FileInputStream(new File(\n homeDir + \"/files/Teste.txt.zip\")));\n ZipEntry ze = zis.getNextEntry();\n assertTrue(ze != null);\n zis.available();\n zos.close();\n }\n }",
"public String execute(File directoryToZip) {\r\n return execute(directoryToZip,null);\r\n }",
"private boolean extractSettingsZip(File fSettingsZip, String destDir, int index)\n {\n boolean result = false;\n try\n {\n //m_logWriter.write(\"Unzipping to destination: \"+destDir+\"\\n\");\n //m_logWriter.flush();\n \tboolean backFavFile = false;\n \tFile dest = new File(destDir);\n \tif (dest.exists()) {\n \t\tString userPath = destDir + \"/userdata/\";\n \t\tFile userFile = new File(userPath);\n \t\tString favDir = userPath + Update.FavouriteFile;\n \t\tFile favFile = new File(favDir);\n \t\tif (userFile.exists() && favFile.exists()) {\n \t\t\tCopyFile(userPath, Update.FavouriteFile, Update.pathSD);\n \t\t\tbackFavFile = true;\n \t\t}\n \t\t\n \t\tDeleteDir(destDir);\n \t}\n \telse\n \t\tdest.mkdirs();\n \t\n publishProgress(PROGRESS_EXTRACT, (int)(0.5 * index));\n // open the zip\n ZipFile zip = new ZipFile(fSettingsZip);\n int count=0;\n int zipSize = zip.size();\n Enumeration<? extends ZipEntry> entries = zip.entries();\n //while(entries.hasMoreElements())\n while (true)\n {\n if (isCancelled()) {\n \tresult = false;\n \tm_ErrorCode = 4;\n break;\n }\n\n if (m_DownloadStop)\n \tcontinue;\n \n if (!entries.hasMoreElements())\n \tbreak;\n \n // todo: update progress\n ZipEntry ze = (ZipEntry)entries.nextElement();\n count++;\n String entryName = ze.getName();\n String destFullpath = destDir+\"/\"+entryName;\n //m_logWriter.write(\"Extracting: \"+destFullpath+\"\\n\");\n File fDestPath = new File(destFullpath);\n if (ze.isDirectory())\n {\n fDestPath.mkdirs();\n publishProgress(PROGRESS_EXTRACT, (int)(0.5 * (index + count*100/zipSize)));\n continue;\n }\n fDestPath.getParentFile().mkdirs();\n\n // write file\n try {\n InputStream is = zip.getInputStream(ze);\n BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(destFullpath));\n int n=0;\n byte buf[] = new byte[4096];\n while((n = is.read(buf, 0, 4096)) > -1)\n {\n bos.write(buf, 0, n);\n }\n // close\n is.close();\n bos.close();\n } catch(IOException ioe) {\n \tm_ErrorCode = 5;\n //m_logWriter.write(\"Could not write, error: \"+ioe.toString());\n }\n\n // update progress\n //publishProgress(PROGRESS_EXTRACT, (count*100/zipSize));\n }\n\n // close zip and bail\n zip.close();\n //m_logWriter.write(\"Successfully extracted: \"+fSettingsZip.getName()+\"\\n\");\n //m_logWriter.flush();\n if (backFavFile) {\n \t\tString userPath = destDir + \"/userdata/\";\n \t\tFile userFile = new File(userPath);\n \t\tif (!userFile.exists())\n \t\t\tuserFile.mkdirs();\n \t\t\n \t\tFile inputFile = new File(Update.pathSD + Update.FavouriteFile);\n \t\tif (inputFile.exists())\n \t\t\tCopyFile(Update.pathSD, Update.FavouriteFile, userPath);\n }\n \n result = !isCancelled();\n }\n catch(Exception e)\n {\n //Log.e(\"SettingsDownloader\", \"Error: \"+e.toString());\n result = false;\n m_ErrorCode = 6;\n }\n\n return result;\n }",
"private String writeZipFile(File directoryToZip, List<File> fileList, String zipName) throws IOException{\r\n // If the zip name is null then provide the name of the directory\r\n if(zipName == null){\r\n zipName = directoryToZip.getName();\r\n }\r\n // Store the file name\r\n String fileName = zipName;\r\n // Create the zip file\r\n FileOutputStream fos = new FileOutputStream(fileName);\r\n ZipOutputStream zos = new ZipOutputStream(fos);\r\n for (File file : fileList) {\r\n if (!file.isDirectory()) { // we only zip files, not directories\r\n // Add files that are not in the skip list\r\n if(!isFileToSkip(file.getName())) {\r\n addToZip(directoryToZip, file, zos);\r\n }\r\n }\r\n }\r\n zos.close();\r\n fos.close();\r\n // Return the full name of the file\r\n return fileName;\r\n }",
"private void downloadZippedDirectory(String selectedFolder) {\n if (selectedFolder != null) {\n File file = getFile(selectedFolder);\n StreamSource zipSource = getZipSource(file);\n getMainWindow().open(new VaadinFileDownloadResource(zipSource, selectedFolder+\".zip\", 0, getMainWindow().getApplication()), \"_self\");\n }\n }",
"public static void writeZipOneFile(File directoryToZip, String fileName) {\r\n\t\ttry {\r\n\t\t\t//FileOutputStream fos = new FileOutputStream(directoryToZip.getName() + \".zip\");\r\n\t\t\tFileOutputStream fos = new FileOutputStream(directoryToZip +\"\\\\\"+ fileName.replace(\".xls\", \"\")+\".zip\");\r\n\t\t\tZipOutputStream zos = new ZipOutputStream(fos);\r\n\r\n\t\t\tFile file = new File(directoryToZip + \"\\\\\"+ fileName);\r\n\t\t\taddToZip(directoryToZip, file, zos);\r\n\r\n\t\t\tzos.close();\r\n\t\t\tfos.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tlogger.error(e.getMessage());\t\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\tlogger.error(e.getMessage());\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public static void Descomprimir(String ficheroZip, String directorioSalida) throws Exception {\n\t\t\n\t\tfinal int TAM_BUFFER = 4096;\n\t\tbyte[] buffer = new byte[TAM_BUFFER];\n\n\t\tZipInputStream flujo = null;\n\t\ttry {\n\t\t flujo = new ZipInputStream(new BufferedInputStream(new FileInputStream(ficheroZip)));\n\t\t \n\t\t ZipEntry entrada;\n\t\t while ((entrada = flujo.getNextEntry()) != null) {\n\t\t\tString nombreSalida = directorioSalida + File.separator + entrada.getName();\n\t\t\tif (entrada.isDirectory()) {\n\t\t\t File directorio = new File(nombreSalida);\n\t\t\t directorio.mkdir();\n\t\t\t} else {\n\t\t\t BufferedOutputStream salida = null;\n\t\t\t try {\n\t\t\t\tint leido;\n\t\t\t\tsalida = new BufferedOutputStream(new FileOutputStream(nombreSalida), TAM_BUFFER);\n\t\t\t\twhile ((leido = flujo.read(buffer, 0, TAM_BUFFER)) != -1) {\n\t\t\t\t salida.write(buffer, 0, leido);\n\t\t\t\t}\n\t\t\t } finally {\n\t\t\t\tif (salida != null) {\n\t\t\t\t salida.close();\n\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t }\n\t\t} finally {\n\t\t if (flujo != null) {\n\t\t\tflujo.close();\n\t\t }\n\n\t\t}\n\t}",
"private static void unzip(EmailTypes collection) {\n File dir = new File(destDir);\n // create output directory if it doesn't exist\n if(!dir.exists()) {\n dir.mkdirs();\n }\n FileInputStream fis;\n //buffer for read and write data to file\n byte[] buffer = new byte[1024];\n try {\n fis = new FileInputStream(sourceFiles.get(collection).getPath());\n ZipInputStream is = new ZipInputStream(fis);\n ZipEntry zipEntry = is.getNextEntry();\n System.out.println(\"Unzipping set: \" + collection.getCollection() + \".\");\n while(zipEntry != null){\n String fileName = zipEntry.getName();\n File newFile = new File(unpackedFiles.get(collection) + File.separator + fileName);\n new File(newFile.getParent()).mkdirs();\n FileOutputStream fos = new FileOutputStream(newFile);\n int len;\n while ((len = is.read(buffer)) > 0) {\n fos.write(buffer, 0, len);\n }\n fos.close();\n is.closeEntry();\n zipEntry = is.getNextEntry();\n }\n is.closeEntry();\n is.close();\n fis.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"private static java.io.File c(java.lang.String r8, java.lang.String r9) {\n /*\n r0 = 0;\n r1 = 0;\n r2 = new java.io.File;\t Catch:{ Exception -> 0x00e8, all -> 0x00e4 }\n r2.<init>(r8);\t Catch:{ Exception -> 0x00e8, all -> 0x00e4 }\n r8 = r2.exists();\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n if (r8 != 0) goto L_0x001d;\n L_0x000d:\n r8 = \"DecryptUtils\";\n r9 = \"unZipSingleFile file don't exist\";\n r3 = new java.lang.Object[r0];\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n com.taobao.sophix.e.d.e(r8, r9, r3);\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n com.taobao.sophix.e.b.a(r1);\n r2.delete();\n return r1;\n L_0x001d:\n r8 = new java.lang.StringBuilder;\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r8.<init>();\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r8.append(r9);\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r9 = java.io.File.separator;\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r8.append(r9);\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r9 = \"unzip\";\n r8.append(r9);\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r8 = r8.toString();\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r9 = new java.io.File;\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r9.<init>(r8);\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n com.taobao.sophix.e.b.a(r9);\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r3 = r9.exists();\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n if (r3 != 0) goto L_0x0044;\n L_0x0041:\n r9.mkdirs();\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n L_0x0044:\n r9 = new java.util.zip.ZipInputStream;\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r3 = new java.io.FileInputStream;\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r3.<init>(r2);\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n r9.<init>(r3);\t Catch:{ Exception -> 0x00e1, all -> 0x00de }\n L_0x004e:\n r3 = r9.getNextEntry();\t Catch:{ Exception -> 0x00dc }\n if (r3 == 0) goto L_0x00f4;\n L_0x0054:\n r4 = r3.getName();\t Catch:{ Exception -> 0x00dc }\n r3 = r3.isDirectory();\t Catch:{ Exception -> 0x00dc }\n if (r3 == 0) goto L_0x0085;\n L_0x005e:\n r3 = r4.length();\t Catch:{ Exception -> 0x00dc }\n r3 = r3 + -1;\n r3 = r4.substring(r0, r3);\t Catch:{ Exception -> 0x00dc }\n r4 = new java.io.File;\t Catch:{ Exception -> 0x00dc }\n r5 = new java.lang.StringBuilder;\t Catch:{ Exception -> 0x00dc }\n r5.<init>();\t Catch:{ Exception -> 0x00dc }\n r5.append(r8);\t Catch:{ Exception -> 0x00dc }\n r6 = java.io.File.separator;\t Catch:{ Exception -> 0x00dc }\n r5.append(r6);\t Catch:{ Exception -> 0x00dc }\n r5.append(r3);\t Catch:{ Exception -> 0x00dc }\n r3 = r5.toString();\t Catch:{ Exception -> 0x00dc }\n r4.<init>(r3);\t Catch:{ Exception -> 0x00dc }\n r4.mkdirs();\t Catch:{ Exception -> 0x00dc }\n goto L_0x004e;\n L_0x0085:\n r3 = new java.io.File;\t Catch:{ Exception -> 0x00dc }\n r5 = new java.lang.StringBuilder;\t Catch:{ Exception -> 0x00dc }\n r5.<init>();\t Catch:{ Exception -> 0x00dc }\n r5.append(r8);\t Catch:{ Exception -> 0x00dc }\n r6 = java.io.File.separator;\t Catch:{ Exception -> 0x00dc }\n r5.append(r6);\t Catch:{ Exception -> 0x00dc }\n r5.append(r4);\t Catch:{ Exception -> 0x00dc }\n r4 = r5.toString();\t Catch:{ Exception -> 0x00dc }\n r3.<init>(r4);\t Catch:{ Exception -> 0x00dc }\n r3.createNewFile();\t Catch:{ Exception -> 0x00dc }\n r4 = new java.io.FileOutputStream;\t Catch:{ Exception -> 0x00c7, all -> 0x00c4 }\n r4.<init>(r3);\t Catch:{ Exception -> 0x00c7, all -> 0x00c4 }\n r5 = 1024; // 0x400 float:1.435E-42 double:5.06E-321;\n r5 = new byte[r5];\t Catch:{ Exception -> 0x00c2 }\n L_0x00aa:\n r6 = r9.read(r5);\t Catch:{ Exception -> 0x00c2 }\n r7 = -1;\n if (r6 == r7) goto L_0x00b8;\n L_0x00b1:\n r4.write(r5, r0, r6);\t Catch:{ Exception -> 0x00c2 }\n r4.flush();\t Catch:{ Exception -> 0x00c2 }\n goto L_0x00aa;\n L_0x00b8:\n com.taobao.sophix.e.b.a(r4);\t Catch:{ Exception -> 0x00dc }\n com.taobao.sophix.e.b.a(r9);\n r2.delete();\n return r3;\n L_0x00c2:\n r3 = move-exception;\n goto L_0x00c9;\n L_0x00c4:\n r8 = move-exception;\n r4 = r1;\n goto L_0x00d8;\n L_0x00c7:\n r3 = move-exception;\n r4 = r1;\n L_0x00c9:\n r5 = \"DecryptUtils\";\n r6 = \"unZipSingleFile unZip hotfix patch file error\";\n r7 = new java.lang.Object[r0];\t Catch:{ all -> 0x00d7 }\n com.taobao.sophix.e.d.a(r5, r6, r3, r7);\t Catch:{ all -> 0x00d7 }\n com.taobao.sophix.e.b.a(r4);\t Catch:{ Exception -> 0x00dc }\n goto L_0x004e;\n L_0x00d7:\n r8 = move-exception;\n L_0x00d8:\n com.taobao.sophix.e.b.a(r4);\t Catch:{ Exception -> 0x00dc }\n throw r8;\t Catch:{ Exception -> 0x00dc }\n L_0x00dc:\n r8 = move-exception;\n goto L_0x00eb;\n L_0x00de:\n r8 = move-exception;\n r9 = r1;\n goto L_0x00fc;\n L_0x00e1:\n r8 = move-exception;\n r9 = r1;\n goto L_0x00eb;\n L_0x00e4:\n r8 = move-exception;\n r9 = r1;\n r2 = r9;\n goto L_0x00fc;\n L_0x00e8:\n r8 = move-exception;\n r9 = r1;\n r2 = r9;\n L_0x00eb:\n r3 = \"DecryptUtils\";\n r4 = \"unZipSingleFile unZip hotfix patch file error\";\n r0 = new java.lang.Object[r0];\t Catch:{ all -> 0x00fb }\n com.taobao.sophix.e.d.a(r3, r4, r8, r0);\t Catch:{ all -> 0x00fb }\n L_0x00f4:\n com.taobao.sophix.e.b.a(r9);\n r2.delete();\n return r1;\n L_0x00fb:\n r8 = move-exception;\n L_0x00fc:\n com.taobao.sophix.e.b.a(r9);\n r2.delete();\n throw r8;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.taobao.sophix.e.a.c(java.lang.String, java.lang.String):java.io.File\");\n }",
"public static int Comparetxtinzip(ZipFile apkzf, String filepathinzip, File fileinfiledir) {\r\n String tmpzipstr;\r\n BufferedInputStream checkfbr;\r\n int result;\r\n BufferedInputStream checkzbr = null;\r\n BufferedInputStream checkfbr2 = null;\r\n ZipEntry cookie_entry = apkzf.getEntry(filepathinzip);\r\n if (cookie_entry == null) {\r\n try {\r\n Log.i(TAG, \"no this file in zip\");\r\n if (checkzbr != null) {\r\n try {\r\n checkzbr.close();\r\n if (checkfbr2 != null) {\r\n try {\r\n checkfbr2.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n return ERROR_EXCEPTION;\r\n }\r\n }\r\n } catch (IOException e2) {\r\n e2.printStackTrace();\r\n if (checkfbr2 != null) {\r\n try {\r\n checkfbr2.close();\r\n } catch (IOException e3) {\r\n e3.printStackTrace();\r\n return ERROR_EXCEPTION;\r\n }\r\n }\r\n return ERROR_EXCEPTION;\r\n } finally {\r\n if (checkfbr2 != null) {\r\n try {\r\n checkfbr2.close();\r\n } catch (IOException e4) {\r\n e4.printStackTrace();\r\n return ERROR_EXCEPTION;\r\n }\r\n }\r\n }\r\n }\r\n return ERROR_FILE_NOT_FOUND_INZIP;\r\n } catch (Exception e5) {\r\n e = e5;\r\n try {\r\n e.printStackTrace();\r\n if (checkzbr != null) {\r\n try {\r\n checkzbr.close();\r\n if (checkfbr2 != null) {\r\n try {\r\n checkfbr2.close();\r\n } catch (IOException e6) {\r\n e6.printStackTrace();\r\n return ERROR_EXCEPTION;\r\n }\r\n }\r\n } catch (IOException e7) {\r\n e7.printStackTrace();\r\n if (checkfbr2 != null) {\r\n try {\r\n checkfbr2.close();\r\n } catch (IOException e8) {\r\n e8.printStackTrace();\r\n return ERROR_EXCEPTION;\r\n }\r\n }\r\n return ERROR_EXCEPTION;\r\n } finally {\r\n if (checkfbr2 != null) {\r\n try {\r\n checkfbr2.close();\r\n } catch (IOException e9) {\r\n e9.printStackTrace();\r\n return ERROR_EXCEPTION;\r\n }\r\n }\r\n }\r\n }\r\n return ERROR_EXCEPTION;\r\n } catch (Throwable th) {\r\n th = th;\r\n if (checkzbr != null) {\r\n try {\r\n checkzbr.close();\r\n if (checkfbr2 != null) {\r\n try {\r\n checkfbr2.close();\r\n } catch (IOException e10) {\r\n e10.printStackTrace();\r\n return ERROR_EXCEPTION;\r\n }\r\n }\r\n } catch (IOException e11) {\r\n e11.printStackTrace();\r\n if (checkfbr2 != null) {\r\n try {\r\n checkfbr2.close();\r\n } catch (IOException e12) {\r\n e12.printStackTrace();\r\n return ERROR_EXCEPTION;\r\n }\r\n }\r\n return ERROR_EXCEPTION;\r\n } finally {\r\n if (checkfbr2 != null) {\r\n try {\r\n checkfbr2.close();\r\n } catch (IOException e13) {\r\n e13.printStackTrace();\r\n return ERROR_EXCEPTION;\r\n }\r\n }\r\n }\r\n }\r\n throw th;\r\n }\r\n }\r\n } else {\r\n byte[] checkzipbuf = new byte[1024];\r\n byte[] checkfilebuf = new byte[1024];\r\n BufferedInputStream checkzbr2 = new BufferedInputStream(apkzf.getInputStream(cookie_entry));\r\n try {\r\n tmpzipstr = new String(checkzipbuf).substring(0, checkzbr2.read(checkzipbuf));\r\n checkfbr = new BufferedInputStream(new FileInputStream(fileinfiledir));\r\n } catch (Exception e14) {\r\n e = e14;\r\n checkzbr = checkzbr2;\r\n e.printStackTrace();\r\n if (checkzbr != null) {\r\n }\r\n return ERROR_EXCEPTION;\r\n } catch (Throwable th2) {\r\n th = th2;\r\n checkzbr = checkzbr2;\r\n if (checkzbr != null) {\r\n }\r\n throw th;\r\n }\r\n try {\r\n if (new String(checkfilebuf).substring(0, checkfbr.read(checkfilebuf)).equals(tmpzipstr)) {\r\n result = 1;\r\n } else {\r\n result = 0;\r\n }\r\n if (checkzbr2 != null) {\r\n try {\r\n checkzbr2.close();\r\n if (checkfbr != null) {\r\n try {\r\n checkfbr.close();\r\n } catch (IOException e15) {\r\n e15.printStackTrace();\r\n BufferedInputStream bufferedInputStream = checkfbr;\r\n BufferedInputStream bufferedInputStream2 = checkzbr2;\r\n return ERROR_EXCEPTION;\r\n }\r\n }\r\n } catch (IOException e16) {\r\n e16.printStackTrace();\r\n if (checkfbr != null) {\r\n try {\r\n checkfbr.close();\r\n } catch (IOException e17) {\r\n e17.printStackTrace();\r\n BufferedInputStream bufferedInputStream3 = checkfbr;\r\n BufferedInputStream bufferedInputStream4 = checkzbr2;\r\n return ERROR_EXCEPTION;\r\n }\r\n }\r\n BufferedInputStream bufferedInputStream5 = checkfbr;\r\n BufferedInputStream bufferedInputStream6 = checkzbr2;\r\n return ERROR_EXCEPTION;\r\n } finally {\r\n if (checkfbr != null) {\r\n try {\r\n checkfbr.close();\r\n } catch (IOException e18) {\r\n e18.printStackTrace();\r\n BufferedInputStream bufferedInputStream7 = checkfbr;\r\n BufferedInputStream bufferedInputStream8 = checkzbr2;\r\n return ERROR_EXCEPTION;\r\n }\r\n }\r\n }\r\n }\r\n BufferedInputStream bufferedInputStream9 = checkfbr;\r\n BufferedInputStream bufferedInputStream10 = checkzbr2;\r\n return result;\r\n } catch (Exception e19) {\r\n e = e19;\r\n checkfbr2 = checkfbr;\r\n checkzbr = checkzbr2;\r\n } catch (Throwable th3) {\r\n th = th3;\r\n checkfbr2 = checkfbr;\r\n checkzbr = checkzbr2;\r\n if (checkzbr != null) {\r\n }\r\n throw th;\r\n }\r\n }\r\n }",
"private void addToZipStream(Path file, ZipOutputStream zipStream, String dirName)\r\n throws Exception {\r\n String inputFileName = file.toFile().getPath();\r\n try (FileInputStream inputStream = new FileInputStream(inputFileName)) {\r\n\r\n // create a new ZipEntry, which is basically another file\r\n // within the archive. We omit the path from the filename\r\n Path directory = Paths.get(dirName);\r\n ZipEntry entry = new ZipEntry(directory.relativize(file).toString());\r\n\r\n zipStream.putNextEntry(entry);\r\n\r\n // Now we copy the existing file into the zip archive. To do\r\n // this we write into the zip stream, the call to putNextEntry\r\n // above prepared the stream, we now write the bytes for this\r\n // entry. For another source such as an in memory array, you'd\r\n // just change where you read the information from.\r\n byte[] readBuffer = new byte[2048];\r\n int amountRead;\r\n int written = 0;\r\n\r\n while ((amountRead = inputStream.read(readBuffer)) > 0) {\r\n zipStream.write(readBuffer, 0, amountRead);\r\n written += amountRead;\r\n }\r\n } catch (IOException e) {\r\n throw new Exception(\"Unable to process \" + inputFileName, e);\r\n }\r\n }",
"@Test\n public void compressAndDecompress() throws IOException {\n byte[] compressed = Utils.compress(\"123a\");\n String decompressed = Utils.decompress(compressed);\n Assert.assertEquals(\"123a\", decompressed);\n }",
"public List<File> unzipSubtitle(File zipFile, File targetDirectory) throws IOException {\n List<File> subtitles = new ArrayList<File>();\n ZipInputStream zis = new ZipInputStream(\n new BufferedInputStream(new FileInputStream(zipFile)));\n try {\n ZipEntry ze;\n byte[] buffer = new byte[2048];\n while ((ze = zis.getNextEntry()) != null) {\n File file = new File(targetDirectory, ze.getName());\n File dir = ze.isDirectory() ? file : file.getParentFile();\n if (!dir.isDirectory() && !dir.mkdirs())\n throw new FileNotFoundException(\"Failed to ensure directory: \" +\n dir.getAbsolutePath());\n if (ze.isDirectory())\n continue;\n String ext = FilenameUtils.getExtension(ze.getName());\n if(ext.equalsIgnoreCase(\"srt\") || ext.equalsIgnoreCase(\"vtt\") ) {\n FileOutputStream fout = new FileOutputStream(file);\n BufferedOutputStream bufout = new BufferedOutputStream(fout);\n int count;\n try {\n while ((count = zis.read(buffer)) != -1)\n bufout.write(buffer, 0, count);\n } finally {\n subtitles.add(file);\n bufout.close();\n fout.close();\n }\n }\n\n }\n } finally {\n zis.close();\n }\n\n\n return subtitles;\n }",
"public void extractFile(ZipModel zipModel, String outputPath, UnzipParameters unzipParameters, String newFileName,\r\n ProgressMonitor progressMonitor, boolean runInThread, char[] password) throws ZipException {\r\n if (zipModel == null) {\r\n throw new ZipException(\"input zipModel is null\");\r\n }\r\n\r\n if (!Zip4jUtil.checkOutputFolder(outputPath)) {\r\n throw new ZipException(\"Invalid output path\");\r\n }\r\n\r\n if (this == null) {\r\n throw new ZipException(\"invalid file header\");\r\n }\r\n\r\n UnzipEngine unzipEngine = new UnzipEngine(zipModel, progressMonitor, password);\r\n unzipEngine.extractFile(this, outputPath, newFileName, runInThread, unzipParameters);\r\n }",
"public ZipURLConnection(URL url, File file, String zipEntryName) {\r\n super(url);\r\n\r\n this.file = file;\r\n this.zipEntryName = zipEntryName;\r\n }",
"private String generateZipEntry(String file) {\n return file.substring(srcFolder.length() + 1, file.length());\n }",
"public static List<File> unjar(InputStream in, File dest)\r\n\t\t\tthrows IOException {\r\n\r\n\t\tfinal List<File> back = new ArrayList<File>();\r\n\t\tif (!dest.exists()) {\r\n\t\t\tdest.mkdirs();\r\n\t\t}\r\n\r\n\t\tif (!dest.isDirectory()) {\r\n\t\t\tthrow new IOException(\"Destination must be a directory.\");\r\n\t\t}\r\n\r\n\t\tJarInputStream jin = new JarInputStream(in);\r\n\t\tfinal byte[] buffer = new byte[1024];\r\n\t\tZipEntry entry = jin.getNextEntry();\r\n\t\twhile (entry != null) {\r\n\r\n\t\t\tString fileName = entry.getName();\r\n\t\t\tif (fileName.charAt(fileName.length() - 1) == '/') {\r\n\t\t\t\tfileName = fileName.substring(0, fileName.length() - 1);\r\n\t\t\t}\r\n\r\n\t\t\tif (fileName.charAt(0) == '/') {\r\n\t\t\t\tfileName = fileName.substring(1);\r\n\t\t\t}\r\n\r\n\t\t\tif (File.separatorChar != '/') {\r\n\t\t\t\tfileName = fileName.replace('/', File.separatorChar);\r\n\t\t\t}\r\n\r\n\t\t\tfinal File file = new File(dest, fileName);\r\n\t\t\tif (entry.isDirectory()) {\r\n\t\t\t\t// make sure the directory exists\r\n\t\t\t\tfile.mkdirs();\r\n\t\t\t\tjin.closeEntry();\r\n\t\t\t} else {\r\n\t\t\t\t// make sure the directory exists\r\n\t\t\t\tfinal File parent = file.getParentFile();\r\n\t\t\t\tif (parent != null && !parent.exists()) {\r\n\t\t\t\t\tparent.mkdirs();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// dump the file\r\n\r\n\t\t\t\tfinal OutputStream out = new FileOutputStream(file);\r\n\t\t\t\tint len = 0;\r\n\t\t\t\twhile ((len = jin.read(buffer, 0, buffer.length)) != -1) {\r\n\t\t\t\t\tout.write(buffer, 0, len);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tout.flush();\r\n\t\t\t\tout.close();\r\n\t\t\t\tjin.closeEntry();\r\n\t\t\t\tback.add(file);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tentry = jin.getNextEntry();\r\n\t\t}\r\n\t\tjin.close();\r\n\t\treturn back;\r\n\t}",
"public static boolean generateZipFile(ArrayList<String> sourcesFilenames, String destinationDir, String zipFilename){\n byte[] buf = new byte[1024]; \r\n\r\n try \r\n {\r\n // VER SI HAY QUE CREAR EL ROOT PATH\r\n boolean result = (new File(destinationDir)).mkdirs();\r\n\r\n String zipFullFilename = destinationDir + \"/\" + zipFilename;\r\n\r\n System.out.println(result);\r\n\r\n // Create the ZIP file \r\n ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFullFilename)); \r\n \r\n // Compress the files \r\n for (String filename: sourcesFilenames) { \r\n FileInputStream in = new FileInputStream(filename); \r\n // Add ZIP entry to output stream. \r\n File file = new File(filename); //\"Users/you/image.jpg\"\r\n out.putNextEntry(new ZipEntry(file.getName())); //\"image.jpg\" \r\n // Transfer bytes from the file to the ZIP file \r\n int len; \r\n while ((len = in.read(buf)) > 0) { \r\n out.write(buf, 0, len); \r\n } \r\n // Complete the entry \r\n out.closeEntry(); \r\n in.close(); \r\n } // Complete the ZIP file \r\n out.close();\r\n\r\n return true;\r\n } \r\n catch (Exception e) \r\n { \r\n System.out.println(e);\r\n return false;\r\n } \r\n }",
"public static boolean zipFile(String fileName) throws IOException {\r\n File targetFile = new File(fileName);\r\n if (targetFile == null || !targetFile.exists()) {\r\n throw new IOException(\"target [\"+fileName+\"] doesn't exist!\");\r\n }\r\n if (!targetFile.canRead()) {\r\n throw new IOException(\"target [\"+fileName+\"] can't be read!\");\r\n }\r\n boolean result = false;\r\n byte[] buf = new byte[1024];\r\n // validate some stuff\r\n File zipFile = new File(fileName+\".zip\");\r\n if (zipFile.exists()) {\r\n zipFile.delete();\r\n }\r\n zipFile.createNewFile();\r\n ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile));\r\n FileInputStream in = new FileInputStream(targetFile.getAbsolutePath());\r\n out.putNextEntry(new ZipEntry(targetFile.getName()));\r\n int len;\r\n while ((len = in.read(buf)) > 0) {\r\n out.write(buf, 0, len);\r\n }\r\n out.closeEntry();\r\n in.close();\r\n out.close();\r\n // delete the source\r\n if (targetFile.delete()) {\r\n // rename to the original file\r\n result = zipFile.renameTo(targetFile);\r\n } else {\r\n zipFile.delete();\r\n }\r\n return result;\r\n }",
"private static String createZipFile(String directory, String zipFilename, List<File> filesToAdd)\n throws IOException {\n String zipFilePath = String.format(\"%s/%s\", directory, zipFilename);\n File zipFile = new File(zipFilePath);\n if (zipFile.exists()) {\n if (zipFile.delete()) {\n log.info(\"Zipfile existed and was deleted: \" + zipFilePath);\n } else {\n log.warn(\"Zipfile exists but was not deleted: \" + zipFilePath);\n }\n }\n\n // Create and add files to zip file\n addFilesToZip(zipFile, filesToAdd);\n\n return zipFilePath;\n }",
"public CombineArchive (File zipFile)\n\t\tthrows IOException,\n\t\t\tJDOMException,\n\t\t\tParseException,\n\t\t\tCombineArchiveException\n\t{\n\t\tinit (zipFile, false);\n\t}",
"public File getZip() {\r\n try {\r\n close(); // if the file is currently open close it\r\n Log.d(LOG_TAG, \"getZip()\");\r\n File zipFile = new File(mBaseFileName + \".zip\");\r\n zipFile.delete();\r\n ZipOutputStream zipStream = new ZipOutputStream(new FileOutputStream(zipFile));\r\n for (int i = 0; i < mNumSegments; i++) {\r\n File chunk = new File(getFileNameForIndex(i));\r\n if (chunk.exists()) {\r\n FileInputStream fis = new FileInputStream(chunk);\r\n writeToZipFile(zipStream, fis, chunk.getName());\r\n }\r\n }\r\n zipStream.close();\r\n return zipFile;\r\n } catch (Exception e) {\r\n Log.e(LOG_TAG, \"Failed to create zip file\", e);\r\n }\r\n\r\n return null;\r\n }",
"protected void createFile (ZipFile file, ZipEntry entry, File target)\n {\n if (_buffer == null) {\n _buffer = new byte[COPY_BUFFER_SIZE];\n }\n\n // make sure the file's parent directory exists\n File pdir = target.getParentFile();\n if (!pdir.exists() && !pdir.mkdirs()) {\n log.warning(\"Failed to create parent for '\" + target + \"'.\");\n }\n\n try (InputStream in = file.getInputStream(entry);\n FileOutputStream fout = new FileOutputStream(target)) {\n\n int total = 0, read;\n while ((read = in.read(_buffer)) != -1) {\n total += read;\n fout.write(_buffer, 0, read);\n updateProgress(total);\n }\n\n } catch (IOException ioe) {\n log.warning(\"Error creating '\" + target + \"': \" + ioe);\n }\n }"
] | [
"0.7477943",
"0.72352964",
"0.7092123",
"0.69583106",
"0.69270384",
"0.6914786",
"0.6893954",
"0.68629736",
"0.6798962",
"0.67907304",
"0.6762368",
"0.6745107",
"0.67409015",
"0.6698537",
"0.6688504",
"0.6687228",
"0.66714627",
"0.6640792",
"0.6620453",
"0.66053057",
"0.65626824",
"0.65589035",
"0.6537528",
"0.6537528",
"0.64006263",
"0.63811237",
"0.63676333",
"0.6363267",
"0.6361329",
"0.63535136",
"0.63435584",
"0.63435584",
"0.63018775",
"0.6249232",
"0.6208124",
"0.6130594",
"0.6128603",
"0.6127965",
"0.6124577",
"0.6098613",
"0.60984784",
"0.6082499",
"0.60690325",
"0.60638314",
"0.6040747",
"0.6036381",
"0.59950095",
"0.5981812",
"0.5918317",
"0.5896888",
"0.5893647",
"0.588342",
"0.58810735",
"0.587669",
"0.5875577",
"0.58163214",
"0.5815224",
"0.5811097",
"0.58054423",
"0.5796622",
"0.5795594",
"0.5793355",
"0.5787199",
"0.5782415",
"0.5772056",
"0.575828",
"0.5754871",
"0.57499206",
"0.57189405",
"0.5718118",
"0.5688666",
"0.56849664",
"0.56714684",
"0.56507987",
"0.5647417",
"0.5639016",
"0.5633725",
"0.56235844",
"0.5612807",
"0.5612261",
"0.56060636",
"0.559823",
"0.5536823",
"0.550783",
"0.5496227",
"0.54914135",
"0.548879",
"0.5487433",
"0.54793805",
"0.54777324",
"0.5467839",
"0.5451134",
"0.54376686",
"0.5434394",
"0.54313344",
"0.54260856",
"0.5407646",
"0.53986526",
"0.53887403",
"0.53708667"
] | 0.5532357 | 83 |
Convertie une arrayList en un tableau | public static Double[] convertirTableau(ArrayList<Double> valeurs) {
Double[] tab = new Double[valeurs.size()];
for(int i = 0; i <valeurs.size(); i++) {
tab[i] = valeurs.get(i);
}
return tab;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"List<List<Object>> getTableValues();",
"public abstract List<V> makeRowData();",
"private void tableAdapt(ArrayList<String[]> lista, boolean isTraslateAvalible) {\n TableLayout table = (TableLayout) findViewById(R.id.table);\n //declaramos el objeto que nos creará la tabla dinámica\n TableModel tbModel = new TableModel(MainActivity.this, table);\n //indicamos los encabezados de la tabla\n if (isTraslateAvalible) {\n tbModel.setHeaders(new String[]{\"N\", \"Object\", \"Traslated\", \"Accuracy\"});\n } else {\n tbModel.setHeaders(new String[]{\"N\", \"Object\", \"Accuracy\"});\n }\n //enviamos los datos del cuerpo de la tabla\n tbModel.setRows(lista);\n //configuramos la tabla, colores del encabezado y el cuerpo\n // tanto del texto como el fondo\n tbModel.setHeaderBackGroundColor(R.color.back_black);\n tbModel.setRowsBackGroundColor(R.color.back_white);\n\n tbModel.setHeadersForeGroundColor(R.color.back_white);\n tbModel.setRowsForeGroundColor(R.color.back_black);\n //Modifica la tabla a partir de los datos enviados y los parámetros enviados\n tbModel.makeTable();\n\n MyLogs.info(\" FIN \");\n }",
"private void preencherTabela(List<br.cefet.renatathiago.trabalhoBim2.Entidade.Produto> lista) {\n if (lista != null){\n String[] vetor = new String[6];\n vetor [0]= \"Cod\";\n vetor [1]= \"Nome\";\n vetor [2]= \"Marca\";\n vetor [3] = \"Preço Compra\";\n vetor [4] = \"Preço Venda\";\n vetor [5] = \"Qtd em Estoque\";\n String [][] matriz = new String[lista.size()][6];\n \n for (int i = 0; i<lista.size(); i++){\n matriz [i][0]=lista.get(i).getCod()+\"\";\n matriz [i][1]=lista.get(i).getNome();\n matriz [i][2]=lista.get(i).getMarca();\n matriz [i][3]=lista.get(i).getPrecoCompra()+\"\";\n matriz [i][4]=lista.get(i).getPrecoVenda()+\"\";\n matriz [i][5]=lista.get(i).getQtdEstoque()+\"\";\n }\n \n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n matriz, vetor));\n }\n }",
"public interface Tabular {\n\t\n\t/**\n\t * Get an array-based representation of the elements in a list\n\t * \n\t * @return A 2-dimensional array representation of list elements,\n\t * where each element of the list is represented as a \n\t * \"row\" and each field in an element is a \"column\" in \n\t * the returned array.\n\t */\n\tpublic Object[][] get2DArray();\n\n}",
"private String[] convertList(String[][] l){\n String[] list = new String[l.length];\n for(int i =0; i<list.length;i++){\n String input = l[i][1];\n System.out.println(input);\n list[i] = input;\n }\n \n return list;\n }",
"private <T> void populateArrayFromList(T[] arr, ArrayList<T> arrayList) {\n\t\tSystem.out.println(\"Array size \" + arr.length);\n\t\tSystem.out.println(\"ArrayList size \" + arrayList.size());\n\t\tfor (int i = 0; i < arrayList.size(); i++) {\n\t\t\tsavedListModel.addElement(arrayList.get(i).toString());\n\t\t\tarr[i] = arrayList.get(i);\n\t\t}\n\t}",
"private final void prepareOrginalValiesTable() {\n\t\torig_values_list = new ArrayList<ArrayList<String>>();\n\t\tfor (int col = 0; col < previewTable.getColumnCount(); ++col) {\n\t\t\tfinal ArrayList<String> n = new ArrayList<String>();\n\t\t orig_values_list.add( n);\n\t\t for (int row = 0; row < previewTable.getRowCount(); ++row) {\n\t\t \t//TODO what about list values?\n\t\t\t\tString v = (String) previewTable.getValueAt(row, col);\n\t\t\t\tn.add(v);\n\t\t\t}\n\t\t}\n\t}",
"public void convertHashtoArray(ArrayList<Manufacturer> manu){\r\n\t\tfor(Manufacturer d: manu){\r\n\t\tManlist.add(t.get(d.code));\r\n\t\t}\r\n\t}",
"public void preencherTabela(ArrayList<Livro> lista) {\n\t\tDefaultTableModel modelo = (DefaultTableModel) table.getModel();\n\t\tObject[] linha = new Object[4];\n\t\tmodelo.setRowCount(0);\n\t\tfor (Livro l : lista) {\n\t\t\tlinha[0] = l.getNome();\n\t\t\tlinha[1] = l.getAutor();\n\t\t\tlinha[2] = l.getDataDeLancamento();\n\t\t\tif (l.isDisponivel())\n\t\t\t\tlinha[3] = \"Disponivel\";\n\t\t\telse\n\t\t\t\tlinha[3] = \"Indisponivel\";\n\t\t\tmodelo.addRow(linha);\n\n\t\t}\n\n\t}",
"private ArrayList<ArrayList<String>> createArrayListsFromBaselineTable(){\n ArrayList<ArrayList<String>> returnArrayList = new ArrayList<>();\n ArrayList<String> station1ArrayList = new ArrayList<>();\n ArrayList<String> station2ArrayList = new ArrayList<>();\n DefaultTableModel bsltm = (DefaultTableModel)baselineStationsTable.getModel();\n if(bsltm.getRowCount()>0){\n for(int i = 0; i<bsltm.getRowCount();i++){\n String station1 = ((ArrayList)bsltm.getDataVector().elementAt(i)).get(0).toString();\n String station2 = ((ArrayList)bsltm.getDataVector().elementAt(i)).get(1).toString();\n station1ArrayList.add(station1);\n station2ArrayList.add(station2);\n }\n }\n \n returnArrayList.add(station1ArrayList);\n returnArrayList.add(station2ArrayList);\n \n return returnArrayList;\n }",
"private ArrayList<String[]> getTableRowData() \n {\n int numRow, numCol;\n ArrayList<String[]> data = new ArrayList<>();\n numRow = jtModel.getRowCount(); \n numCol = jtModel.getColumnCount();\n String[] row;\n for(int i = 0; i< numRow; i++)\n {\n row = new String[numCol];\n for(int j = 0; j< numCol; j++)\n {\n row[j] = jtModel.getValueAt(i, j).toString();\n } \n data.add(row);\n } \n return data;\n }",
"List<List<Object>> getTableValues(TableParameters tableParameters);",
"public static ArrayList<Tablet> fillTabletsArray(ArrayList<Tablet> tabletArrayList){\n\n tabletArrayList.add(PrepareData.tablet);\n tabletArrayList.add(PrepareData.tablet1);\n tabletArrayList.add(PrepareData.tablet2);\n\n\n return tabletArrayList;\n\n\n\n }",
"private void apresentarListaNaTabela() {\n DefaultTableModel modelo = (DefaultTableModel) tblAlunos.getModel();\n modelo.setNumRows(0);\n for (Aluno item : bus.getLista()) {\n modelo.addRow(new Object[]{\n item.getIdAluno(),\n item.getNome(),\n item.getEmail(),\n item.getTelefone()\n });\n }\n }",
"public ArrayList<ArrayList<Integer>> toListRow(int [][] mergearray)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tArrayList<ArrayList<Integer>> manylistsrow = new ArrayList<ArrayList<Integer>>();\r\n\t\t\t\t\t\tArrayList<Integer> templist=new ArrayList<Integer>();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//System.out.println(\"=================================================================================\");\r\n\t\t\t\t\t\t//System.out.println(\"Copying Array items to lists\");\r\n\t\t\t\t\t\t//System.out.println(\"=================================================================================\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tfor (int i=0;i<mergearray.length;i++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tfor(int j=0;j<mergearray[0].length;j++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\ttemplist.add(mergearray[i][j]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tmanylistsrow.add(new ArrayList<Integer>());\r\n\t\t\t\t\t\t\tmanylistsrow.get(i).addAll(templist);\r\n\t\t\t\t\t\t\ttemplist.clear();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// System.out.println(manylists.size());\r\n\t\t\t\t\t\t//System.out.println(manylists);\r\n\t\t\t\t\t\treturn manylistsrow;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}",
"private void displayArrays(ArrayList list){}",
"void populateTable(List<String[]> entries) throws SQLException;",
"private void getArbeitspaketArray(ObservableList<ArbeitspaketTableData> paketList) {\r\n\t\t// Initialisieren des Arrays\r\n\t\tpakete = new Arbeitspaket[paketList.size()];\r\n\r\n\t\tfor (int i = 0; i < paketList.size(); i++) {\r\n\t\t\t// herauslesen der externen ID, damit diese nicht verloren geht (Konstruktor\r\n\t\t\t// nimmt nur einen Parameter für die ID entgegen und setzt die interne und\r\n\t\t\t// externe ID auf diesen Wert)\r\n\t\t\tString idExtern = paketList.get(i).getIdExtern();\r\n\r\n\t\t\t// automatisches Setzen der Vorgangsdauer, da diese in der Tabelle nicht\r\n\t\t\t// angegeben wird\r\n\t\t\tint vorgangsdauer = paketList.get(i).getFez() - paketList.get(i).getFaz() + 1;\r\n\r\n\t\t\t// setzen der einzelnen Werte der Arbeitspakte\r\n\t\t\tpakete[i] = new Arbeitspaket(paketList.get(i).getIdIntern(), paketList.get(i).getFaz(),\r\n\t\t\t\t\tpaketList.get(i).getFez(), paketList.get(i).getSaz(), paketList.get(i).getSez(), vorgangsdauer,\r\n\t\t\t\t\tpaketList.get(i).getMitarbeiteranzahl(), paketList.get(i).getAufwand());\r\n\r\n\t\t\t// Da die externe ID auf die interne ID gesetzt wurde, wird diese nun wieder auf\r\n\t\t\t// die vorher herausgelesene externe ID gesetzt\r\n\t\t\tpakete[i].setIdExtern(idExtern);\r\n\t\t}\r\n\t}",
"@Test\n public void testCourseTable() {\n CourseTable courseTableObject = courseTableService.getCourseTable(5, 1);\n ArrayList<ArrayList<ArrayList<Object>>> courseTable = courseTableObject.getCourseTable();\n for (int i = 0; i < courseTable.size(); i++) {\n System.out.print(\"第\" + i + \"节:\");\n ArrayList<ArrayList<Object>> column = courseTable.get(i);\n for (int j = 0; j < column.size(); j++) {\n System.out.print(\"{\");\n List<Object> cell = column.get(j);\n for (int k = 0; k < cell.size(); k++) {\n System.out.print(k + \": \");\n System.out.print(cell.get(k));\n }\n System.out.print(\"},\");\n }\n System.out.println();\n }\n }",
"public TabellaModel() {\r\n lista = new Lista();\r\n elenco = new Vector<Persona>();\r\n elenco =lista.getElenco();\r\n values = new String[elenco.size()][3];\r\n Iterator<Persona> iterator = elenco.iterator();\r\n while (iterator.hasNext()) {\r\n\t\t\tfor (int i = 0; i < elenco.size(); i++) {\r\n\t\t\t\tpersona = new Persona();\r\n\t\t\t\tpersona = (Persona) iterator.next();\r\n\t\t\t\tvalues[i][0] = persona.getNome();\r\n\t\t\t\tvalues[i][1] = persona.getCognome();\r\n\t\t\t\tvalues[i][2] = persona.getTelefono();\t\r\n\t\t\t}\r\n\t\t}\r\n setDataVector(values, columnNames);\t\r\n }",
"public Table<Integer, Integer, String> getData();",
"private PyObject[] listtoarray(ArrayList<PyObject> a)\n {\n PyObject[] results = new PyObject[a.size()];\n int iter = 0;\n for (PyObject pt : a) {\n results[iter] = pt;\n iter++;\n }\n return results;\n }",
"List <JAVATYPE> convertList(List<JAVATYPE> oldList, final METATYPE meta);",
"public ArrayList<MensurationRow> toRow() {\n\t\tArrayList<MensurationRow> arr = new ArrayList<MensurationRow>();\n\t\t\n\t\tarr.add(new MensurationRow(\"Tour de hanches\", String.valueOf(tourHanches)));\n\t\tarr.add(new MensurationRow(\"Tour de bassin\", String.valueOf(tourBassin)));\n\t\tarr.add(new MensurationRow(\"Tour de cuisse\", String.valueOf(tourCuisse)));\n\t\tarr.add(new MensurationRow(\"Tour de genou\", String.valueOf(tourGenou)));\n\t\tarr.add(new MensurationRow(\"Tour de mollet\", String.valueOf(tourMollet)));\n\t\tarr.add(new MensurationRow(\"Tour de cheville\", String.valueOf(tourCheville)));\n\t\tarr.add(new MensurationRow(\"Montant dos\", String.valueOf(montantDos)));\n\t\tarr.add(new MensurationRow(\"Longueur enfourchure\", String.valueOf(longueurEnfourchure)));\n\t\tarr.add(new MensurationRow(\"Hauteur taille-sol\", String.valueOf(hauteurTailleSol)));\n\t\tarr.add(new MensurationRow(\"Hauteur taille-genou\", String.valueOf(hauteurTailleGenou)));\n\t\tarr.add(new MensurationRow(\"Hauteur genou-cheville\", String.valueOf(hauteurGenouCheville)));\n\t\tarr.add(new MensurationRow(\"Hauteur entrejambe-cheville\", String.valueOf(hauteurEntrejambeCheville)));\n\t\tarr.add(new MensurationRow(\"Hauteur cheville-sol\", String.valueOf(hauteurChevilleSol)));\n\t\t\n\t\treturn arr;\n\t}",
"private void srediTabelu() {\n\n mtu = (ModelTabeleUlica) jtblUlica.getModel();\n ArrayList<Ulica> ulice = kontrolor.Kontroler.getInstanca().vratiUlice();\n mtu.setLista(ulice);\n\n }",
"public List<Integer> convert (List<int[]> list) {\r\n\r\n List<Integer> result = new ArrayList<>();\r\n for(int[] array : list) {\r\n for (int i = 0; i < array.length; i++) {\r\n result.add(array[i]);\r\n }\r\n }\r\n return result;\r\n }",
"public SystemRecord[][] List(ArrayList<SystemRecord> list){\n\t\tif(list == null){\n\t\t\treturn null;\n\t\t}\n\t\telse{\n\t\t\tSystemRecord[][] nlist = new SystemRecord[(int)Math.ceil((double)list.size()/(double)5)][5];\n\t\t\tint i;\n\t\t\tint j = 0;\n\t\t\tint count = 0;\n\t\t\tSystem.out.println(\"length: \" + list.size());\n\t\t\tfor(i = 0 ; i < list.size() ; i++){\n\t\t\t\tif( i < 5 ){\n\t\t\t\t\tnlist[j][i] = (SystemRecord)list.get(i);\n\t\t\t\t\tif(i == 4){\n\t\t\t\t\t\tj++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tnlist[j][i % 5] = list.get(i);\n\t\t\t\t\tcount++;\n\t\t\t\t\tif( count == 5){\n\t\t\t\t\t\tj++;\n\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn nlist;\t\n\t\t}\n\t\n\t}",
"UnpivotTable createUnpivotTable();",
"private void intListToArrayList(int[] list, ArrayList<Integer> arrayList){\n for(int integer: list){\n arrayList.add(integer);\n }\n }",
"@Test public void getArrayShouldReturnCorrectArray() throws SQLException {\n\t\tList<String> list = new ArrayList<>();\n\t\tArray array = new ListArray(list, Types.VARCHAR);\n\t\tassertTrue(array.getArray() instanceof String[]);\n\t\tlist.add(\"test\");\n\t\tarray = new ListArray(list, Types.VARCHAR);\n\t\tassertEquals(\"test\", ((String[])array.getArray())[0]);\n\t\tlist.add(\"test2\");\n\t\tarray = new ListArray(list, Types.VARCHAR);\n\t\tassertEquals(\"test2\", ((String[])array.getArray())[1]);\n\t}",
"private ArrayList<String> dataConvertForFromArray(ArrayList<Response.Messages> message_array_list){\n\t\tArrayList<String> all_returned_data = new ArrayList<String>();\n\n\t\tString str1 = \"\";\n\n\t\ttry{\n\t\t\tfrom_data = mf.fFrom(message_array_list);\n\t\t} catch (NullPointerException e){\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t//For loop to combine all data into readable format for message preview list\n\t\tfor (int i = 0; i<message_array_list.size(); i++){\n\t\t\tstr1 = from_data.get(i);\n\t\t\tall_returned_data.add(str1);\n\t\t}\n\t\treturn all_returned_data;\n\t}",
"public void AddToArrayTable(Balanza mimaterial) {\n this.list.add(mimaterial);\n\n // cargo el objeto\n this.AddtoTable(mimaterial);\n\n }",
"public interface MultiValueTableAdapter {\n\t//public void setComplexTable( ComplexTable table );\n\tpublic Object[] extract( Object o );\n\tpublic Object extractEvenNoValueExist( Object o );\n\tpublic void combine( Object o, Object[] extractValues );\n\tpublic ObjectNewer getObjectNewer();\n}",
"@Test\r\n\tpublic void testToArrayType() {\r\n\t\tMunitions[] sample1 = new Munitions[5];\r\n\t\tsample1 = list.toArray(sample1);\r\n\t\tAssert.assertEquals(15, sample1.length);\r\n\t\tfor (int i = 0; i < sample1.length; i++) {\r\n\t\t\tAssert.assertNotNull(sample1[i]);\r\n\t\t}\r\n\t\tMunitions[] sample2 = new Munitions[20];\r\n\t\tsample2 = list.toArray(sample2);\r\n\t\tAssert.assertEquals(20, sample2.length);\r\n\t\tfor (int i = 0; i < sample2.length - list.size(); i++) {\r\n\t\t\tAssert.assertNotNull(sample1[i]);\r\n\t\t}\r\n\t}",
"public ArrayList<MensurationRow> toRow() {\n\t\tArrayList<MensurationRow> arr = new ArrayList<MensurationRow>();\n\t\t\n\t\tarr.addAll(getGenerale().toRow());\n\t\tarr.addAll(getHaut().toRow());\n\t\tarr.addAll(getBas().toRow());\n\t\tarr.addAll(getMain().toRow());\n\t\t\n\t\treturn arr;\n\t}",
"private void enlazarListadoTabla() {\n tblCursos.setItems(listaCursos);\n\n //Enlazar columnas con atributos\n clmNombre.setCellValueFactory(new PropertyValueFactory<Curso, String>(\"nombre\"));\n clmAmbito.setCellValueFactory(new PropertyValueFactory<Curso, String>(\"familiaProfesional\"));\n clmDuracion.setCellValueFactory(new PropertyValueFactory<Curso, Integer>(\"duracion\"));\n }",
"public void tacoArray() {\n\n\n ArrayList<String> tacos = new ArrayList<>();\n tacos.add(\"blah\");\n tacos.add(\"blah2\");\n tacos.add(\"blah3\");\n tacos.add(\"blah4\");\n tacos.add(\"blah5\");\n }",
"public int[][] convertPairsToIntTable(List<PairOfInts> pairList) {\n\t\tint tableSize = 0;\n\t\tif(pairList != null) tableSize = pairList.size();\n\t\t\n\t\tint[][] tableOfPairs = new int[tableSize][MAX_RANGE_SIZE];\n\t\tint count = 0;\n\t\t\n\t\tfor(PairOfInts pair : pairList) {\n\t\t\tif(pair != null) {\n\t\t\t\ttableOfPairs[count][0] = pair.getNumber1();\n\t\t\t\ttableOfPairs[count][1] = pair.getNumber2();\n\t\t\t}\n\t\t\tcount++;\n\t\t}\n\t\treturn tableOfPairs;\n\t}",
"public static List<AlumnoVO> transformarListaVO() throws SQLException, ClassNotFoundException {\n\n\t\tList<AlumnoVO> alumnos = new ArrayList<AlumnoVO>();\n\t\tConnection con = Constante.getConexion();\n\t\tStatement sentencia = con.createStatement();\n\t\tResultSet result = sentencia.executeQuery(\n\t\t\t\t\"SELECT dni,nombre,apellido1,apellido2,telefono,fechanacimiento FROM alumno ORDER BY nombre\");\n\t\twhile (result.next()) {\n\t\t\tAlumnoVO alumno = new AlumnoVO();\n\n\t\t\talumno.setDni(result.getString(\"dni\"));\n\t\t\talumno.setNombre(result.getString(\"nombre\"));\n\t\t\talumno.setApellido1(result.getString(\"apellido1\"));\n\t\t\talumno.setApellido2(result.getString(\"apellido2\"));\n\t\t\talumno.setTelefono(result.getInt(\"telefono\"));\n\t\t\talumno.setFechaNacimiento(result.getDate(\"fechanacimiento\"));\n\t\t\talumnos.add(alumno);\n\t\t}\n\t\tsentencia.close();\n\t\tcon.close();\n\n\t\treturn alumnos;\n\t}",
"private void listarDadosNaTelaEditora(ArrayList<Editora> lista) {\n DefaultTableModel modelEditoras = (DefaultTableModel) jTable_tabelaEditoras.getModel();\n jTable_tabelaEditoras.setRowSorter(new TableRowSorter(modelEditoras));\n //Limpando a tela\n modelEditoras.setNumRows(0);\n //Correr o ArrayList\n for (int pos = 0; pos < lista.size(); pos++) {\n String[] linha = new String[2];\n Editora aux = lista.get(pos);\n linha[0] = \"\"+aux.getId();\n linha[1] = aux.getNome();\n modelEditoras.addRow(linha);\n }\n }",
"public void llenar2(ArrayList<String> values1,ArrayList<String[]> values,String txt){\n this.txt.setText(txt);\n DefaultTableModel t=new DefaultTableModel();\n for (int i = 0; i < values1.size(); i++) {\n t.addColumn(values1.get(i));\n }\n this.tv.setModel(t);\n for (int i = 0; i < values.size(); i++) {\n String array[]=values.get(i);\n t.addRow(array);\n \n }\n this.tv.setModel(t);\n \n \n \n }",
"public ArrayBackedList(IList list) {\n while (list.size() > stringArray.length) {\n reallocArray();\n }\n for (int i = 0; i < list.size(); i++) {\n stringArray[i] = list.get(i);\n }\n }",
"public void AddToArrayTable_1(Balanza mimaterial) {\n this.list.add(mimaterial);\n\n // cargo el objeto\n this.AddtoTable_1(mimaterial);\n\n }",
"public void preencherTabela(){\n imagemEnunciado.setImage(imageDefault);\n pergunta.setImagemEnunciado(caminho);\n imagemResposta.setImage(imageDefault);\n pergunta.setImagemResposta(caminho);\n ///////////////////////////////\n perguntas = dao.read();\n if(perguntas != null){\n perguntasFormatadas = FXCollections.observableList(perguntas);\n\n tablePerguntas.setItems(perguntasFormatadas);\n }\n \n }",
"public Database createTableFromArray(int [][] dataDbn){\r\n \tDatabase db = new Database();\r\n \tTable table = null;\r\n \tToken t = null, t2 = null;\r\n \tAttribute attr = null;\r\n \tList ll;\r\n \tLinkedList attributeValues = new LinkedList();\r\n \tLinkedList sampleValueList;\r\n \tint numGenesTotal;\r\n \tint samples;\r\n \tString atrNode = \"node\";\r\n \t\r\n \ttry {\r\n \t\ttable = new Table(); \r\n \t\ttable.setName(\"name\");\r\n \t}catch(Exception e){\r\n \t\t\r\n\t\t\te.printStackTrace();\r\n \t}\r\n \t\r\n \t\r\n \tnumGenesTotal = dataDbn[0].length;\r\n \tsamples = dataDbn.length;\r\n \t\r\n \t// each gene has 3 levels (3 attributes). they are represent by 0,1,2\r\n \tattributeValues.add(new Integer(0));\r\n \tattributeValues.add(new Integer(1));\r\n \tattributeValues.add(new Integer(2));\r\n \t\r\n \t// set attributes for each gene\r\n \tfor(int k=0;k<numGenesTotal;k++){\r\n \t\tString name = atrNode + k;\r\n \t\tattr = new Attribute(name);\r\n \t\tattr.setValues(attributeValues);\r\n \t\ttable.addAttribute(attr);\r\n \t}\r\n \t\r\n \t// read dbnData and load gene's value of each sample in to List and then add this List in to the table\r\n \tfor(int i =0;i<samples;i++){\r\n \t\tsampleValueList = new LinkedList();\r\n \t\tfor(int j=0; j<numGenesTotal;j++){\r\n \t\t\tInteger val = new Integer(dataDbn[i][j]);\r\n \t\t\tsampleValueList.add(val);\r\n \t\t}\r\n \t\ttable.addTuple(new Tuple(sampleValueList));\r\n \t}\r\n \t\r\n \tdb.addTable(table);\r\n \t/*\r\n \tString filePath = \"C:\\\\Users\\\\devamuni\\\\Documents\\\\D_Result\\\\Input.out\";\r\n File f1 = new File(filePath);\r\n try {\r\n\t\t\tOutputStream os = new FileOutputStream(f1);\r\n\t\t\tsave(os, db);\r\n } catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\t\r\n\t\t\te.printStackTrace();\r\n } */\r\n \treturn db;\r\n }",
"private Object[][] getTableData() {\n Object[][] lclArray = null;\n\n if (articles.size() == 0) {\n lclArray = new Object[1][NUM_COLS];\n lclArray[0][0] = \"\";\n lclArray[0][1] = \"\";\n lclArray[0][2] = \"\";\n return lclArray;\n } // no articles yet !!!!\n if (articles != null) {\n lclArray = new Object[articles.size()][NUM_COLS];\n }\n for (int i = 0; i < articles.size(); i++) {\n NewsArticle article = (NewsArticle) articles.elementAt(i);\n\n lclArray[i][0] = article.getSubject();\n lclArray[i][1] = String.valueOf(article.getScore(filterType));\n lclArray[i][2] = article.getUserRating();\n }\n return lclArray;\n }",
"void listarDadosNaTelaAutor(ArrayList<Autor> lista, DefaultTableModel model) {\n model.setNumRows(0);\n //Correr o ArrayList\n for (int pos = 0; pos < lista.size(); pos++) {\n String[] linha = new String[2];\n Autor aux = lista.get(pos);\n linha[0] = \"\"+aux.getId();\n linha[1] = aux.getNome();\n model.addRow(linha);\n }\n }",
"public void updateTable(List<OccorrenzeDisco> elements);",
"private void fillBaselineTableFromArrayLists(ArrayList<String> station1,ArrayList<String> station2) {\n baselineStationsTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n \n },\n new String [] {\n \"Station 1\", \"Station 2\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.String.class\n };\n \n @Override\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n });\n DefaultTableModel bsltm = (DefaultTableModel)baselineStationsTable.getModel();\n \n if(station1.size() == station2.size()){\n for(int i = 0; i<station1.size();i++){\n ArrayList<String> newRow = new ArrayList<>();\n newRow.add(station1.get(i));\n newRow.add(station2.get(i));\n bsltm.addRow(newRow.toArray());\n }\n }\n }",
"private void actualizaTabla(ArrayList<Object []> dataLista, DefaultTableModel modeloTabla)\n\t{\n\t\t\n\t\tObject [][] data1 = new Object [dataLista.size()][];\n\t\tdataLista.toArray(data1);\n\t\tmodeloTabla.setDataVector(data1 , nombresColum);\n\t\t\n\t\t//Set width of a column \n\t\ttblSistemaEspecifico.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\n\t\ttblSistemaEspecifico.getColumnModel().getColumn(0).setPreferredWidth(130);\n\t\ttblSistemaEspecifico.getColumnModel().getColumn(1).setPreferredWidth(100);\n\t\ttblSistemaEspecifico.getColumnModel().getColumn(2).setPreferredWidth(100);\n\t\ttblSistemaEspecifico.getColumnModel().getColumn(3).setPreferredWidth(100);\n\t\ttblSistemaEspecifico.getColumnModel().getColumn(4).setPreferredWidth(140);\n\t\ttblSistemaEspecifico.getColumnModel().getColumn(5).setPreferredWidth(240);\n\t }",
"public void reloadTable() {\n\n this.removeAllData();// borramos toda la data \n for (int i = 0; i < (list.size()); i++) { // este for va de la primera casilla hast ael largo del arreglo \n Balanza object = list.get(i);\n this.AddtoTable(object);\n }\n\n }",
"private JSArray convertToJSArray(ArrayList<Object> row) {\n JSArray jsArray = new JSArray();\n for (int i = 0; i < row.size(); i++) {\n jsArray.put(row.get(i));\n }\n return jsArray;\n }",
"public abstract ArrayList<Object> calculateTransform(ArrayList<Integer> arr);",
"@SuppressWarnings( \"rawtypes\" )\n private XmlElement toXmlArray(List list)\n {\n XmlElement array = new XmlElement(\"array\");\n for (Object o : list)\n {\n array.add(objectToXml(o));\n }\n return array;\n }",
"private void fillTable(){\n tblModel.setRowCount(0);// xoa cac hang trong bang\n \n for(Student st: list){\n tblModel.addRow(new String[]{st.getStudentId(), st.getName(), st.getMajor(),\"\"\n + st.getMark(), st.getCapacity(), \"\" + st.isBonnus()});\n // them (\"\" + )de chuyen doi kieu float va boolean sang string\n \n }\n tblModel.fireTableDataChanged();\n }",
"private void putDataIntoTable(List<Book> books)\n {\n for(int i = 0; i<books.size(); i++)\n {\n bookTable.addItem(new Object[]{books.get(i).getId(), books.get(i).getBookName(), books.get(i).getAuthorName(), books.get(i).getDescription(), books.get(i).getBookGenreString()}, i+1);\n }\n }",
"private ArrayList<Entidad> GetArrayItems(){\n // ArrayList<Entidad> listItems = new ArrayList<>();\n listItems.add(new Entidad(\"Agree\", \"Disagree\", \"Level: \", \"Bajo\", 0,0,0,0, 0,0,0, \" Spotify\",\"\", 0, false, false, false, null, \"\", 1,0,0,0,0,\"\"));\n listItems.add(new Entidad(\"Agree\", \"Disagree\", \"Level: \", \"Bajo\", 0,0,0,0, 0,0,0, \" Spotify\",\"\", 0, false, false, false, null, \"\", 1,0,0,0,0,\"\"));\n listItems.add(new Entidad(\"Agree\", \"Disagree\", \"Level: \", \"Bajo\", 0,0,0,0, 0,0,0, \" Spotify\",\"\", 0, false, false, false, null, \"\", 1,0,0,0,0,\"\"));\n listItems.add(new Entidad(\"Agree\", \"Disagree\", \"Level: \", \"Bajo\", 0,0,0,0, 0,0,0, \" Spotify\",\"\", 0, false, false, false, null, \"\", 1,0,0,0,0,\"\"));\n listItems.add(new Entidad(\"Agree\", \"Disagree\", \"Level: \", \"Bajo\", 0,0,0,0, 0,0,0, \" Spotify\",\"\", 0, false, false, false, null, \"\", 1,0,0,0,0,\"\"));\n\n return listItems;\n }",
"public abstract String [] listTables();",
"@SuppressWarnings(\"unchecked\")\r\n\tpublic String toString()\r\n\t{\r\n\t\tString result =\"Table:\\n\";\r\n\t\tfor (int i =0; i< this.tableSize; i++)\r\n\t\t{ \r\n\t\t\tLinkedArrays<T> L = (LinkedArrays<T>) table[i]; \r\n\t\t\tresult+= i+\": \";\r\n\t\t\tresult+= L.toString() ;\r\n\t\t\tif(i<this.tableSize-1)\r\n\t\t\t{ result +=\"\\n\"; }\r\n\t\t\t\r\n\t\t}\r\n\t\r\n\t\treturn result;\r\n\t}",
"private List<Comment> toColumns(List<Comment> list) {\r\n List<Comment> res = new ArrayList<>();\r\n int colLen = (list.size()+ N_COLUMNS -1)/3;\r\n for(int i=0; i<colLen; i++) {\r\n for(int n=0; n< N_COLUMNS; n++) {\r\n int idx = n*colLen + i;\r\n if (idx < list.size()) {\r\n res.add(list.get(idx));\r\n }\r\n }\r\n }\r\n\r\n return res;\r\n }",
"private static List<List<List<Ansi>>> mapLMToAnsi(SquareLM[][] mapLM){\n\n List<List<List<Ansi>>> mapAnsi = new ArrayList<>();\n\n for(int row = 0; row < mapLM.length; row++) {\n List<List<Ansi>> rowMapAnsi = new ArrayList<>();\n for (int col = 0; col < mapLM[0].length; col++) {\n List<Ansi> squareAnsi = squareLMToAnsi(row, col, mapLM);\n rowMapAnsi.add(squareAnsi);\n }\n mapAnsi.add(rowMapAnsi);\n }\n return mapAnsi;\n }",
"public abstract List<T> convertToEntities(List<D> dtos);",
"public ArrayList<TheDataModel> getDataTabulated(ArrayList<String[]> records){\n\t\t\n\t\t\tArrayList<TheDataModel> tabulatedData=new ArrayList<TheDataModel>();\n\t\t\tString[] firstLine=records.get(0);\n\t\t\tint noOfRows=Integer.parseInt(firstLine[0]);\n\t\t\tint noOfCols=Integer.parseInt(firstLine[1]);\n\t\t\n\t\t\tfor(int i=1;i<(noOfRows+1);i++){\n\t\t\t\tString[] row=records.get(i);\n\t\t\t\tfor(int j=0;j<noOfCols;j++){\n\t\t\t\t\n\t\t\t\t\ttabulatedData.add(new TheDataModel(j, i-1, row[j]));\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\treturn tabulatedData;\n\t\t\n\t}",
"private void carregaTable(List<Carro> listaCarros) {\n if (listaCarros == null) {\n return;\n }\n DefaultTableModel model = (DefaultTableModel) tabela.getModel();\n model.setRowCount(0);\n for (Carro f : listaCarros) {\n model.addRow(new Object[]{f.getCodigo(), f.getModelo(), f.getCor(), f.getValor()});\n }\n }",
"@SuppressWarnings(\"unchecked\")\n public void testListToArray() throws Exception\n {\n List<PSKeyword> sourceList = new ArrayList<PSKeyword>();\n sourceList.add(createKeyword(\"1\"));\n sourceList.add(createKeyword(\"2\"));\n \n List<PSKeyword> targetList = roundTripListConversion(\n com.percussion.webservices.content.PSKeyword[].class, \n sourceList);\n\n assertTrue(sourceList.equals(targetList));\n }",
"@Override\n\tpublic List<Exam> toEntity(List<ExamDTO> dtoList) {\n\t\treturn null;\n\t}",
"ArrayList<ArrayList<Integer>> convert2DArrayToList(int[][] image) {\n ArrayList<ArrayList<Integer>> list = new ArrayList<ArrayList<Integer>>();\n for(int i=0;i < image.length;i++) {\n list.add(new ArrayList<Integer>());\n for(int j=0; j< image[0].length;j++) {\n list.get(i).add(image[i][j]);\n }\n }\n return list;\n }",
"DataSet toDataSet(Object adaptee);",
"@Override\r\n\tprotected JSONArray getTablero() {\n\t\tJSONArray jsa = new JSONArray();\r\n\t\tfor (int i = 0; i < this.tableroDomino.size(); i++) {\r\n\t\t\tjsa.put(this.tableroDomino.get(i).toJSON());\r\n\t\t}\r\n\t\treturn jsa;\r\n\t}",
"void listarDadosNaTelaLivro(ArrayList<Livro> lista,DefaultTableModel model ) throws Exception {\n \n model.setNumRows(0);\n //Correr o ArrayList\n for (int pos = 0; pos < lista.size(); pos++) {\n String[] linha = new String[7];\n Livro aux = lista.get(pos);\n linha[0] = \"\"+aux.getId();\n linha[1] = \"\"+editora.recuperar(aux.getIdEditora());\n linha[2] = \"\"+autor.recuperar(aux.getIdAutor());\n linha[3] = \"\"+areaDeConhecimento.recuperar(aux.getIdAreaDeConhecimento());\n linha[4] = aux.getTituloDoLivro();\n linha[5] = \"\"+aux.getIsbn();\n model.addRow(linha);\n }\n }",
"public void transferPlaylist(ArrayList<Song> list) {\r\n\t\t//ObservableList<Song> = \r\n\t\ttableView.setItems(FXCollections.observableArrayList(list));\r\n\t}",
"private void loadAllToTable() {\n try {\n ArrayList<ItemDTO> allItems=ip.getAllItems();\n DefaultTableModel dtm=(DefaultTableModel) tblItems.getModel();\n dtm.setRowCount(0);\n \n if(allItems!=null){\n for(ItemDTO item:allItems){\n \n Object[] rowdata={\n item.getiId(),\n item.getDescription(),\n item.getQtyOnHand(),\n item.getUnitPrice()\n \n };\n dtm.addRow(rowdata);\n \n }\n }\n } catch (Exception ex) {\n Logger.getLogger(AddItem.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n \n }",
"@Override\n\tpublic ArrayList<Object[]> tousEmplo() {\n\t\tfor (Employe emplo : treeMap.values()) {\n\t\t\tObject[] aux = { emplo.getId(), emplo.getNom(), emplo.getPrenom(),\n\t\t\t\t\templo.getDate_N(), emplo.getSexe(), emplo.getRue(),\n\t\t\t\t\templo.getNumero(), emplo.getVille(), emplo.getPay(),\n\t\t\t\t\templo.getTelef(), emplo.getClass().getName().substring(13) };\n\t\t\tarray.add(aux);\n\t\t}\n\t\treturn array;\n\t}",
"private int[] arrayListToIntList(ArrayList<Integer> arrayList){\n int[] list=new int[arrayList.size()];\n for(Integer integer:arrayList){\n list[arrayList.indexOf(integer)]=integer;\n }\n return list;\n }",
"public void addDatatoArrayList(ArrayList<Object> ar1) {\n\t\tar1.add(1);\n\t\tar1.add(\"anu\");\n\t\tar1.add(1.3);\n\t\tar1.add(true);\n\t\tar1.add('&');\n\t\tar1.add(false);\n\t\tSystem.out.println(\"Data aaded to ArrayList\");\n\t}",
"public JSONArray transforme(ArrayList<String> liste){\n\n JSONArray jliste = new JSONArray();\n for (int i = 0; i < liste.size(); i++) {\n Log.i(\"QUESTION \"+i,liste.get(i));\n jliste.put(liste.get(i));\n }\n Log.i(\"JLISTE\",jliste.toString());\n return jliste;\n }",
"public void setTableData(List<Usermodel> UserList) {\n UserData = FXCollections.observableArrayList();\n\n // add the student objects to an observable list object for use with the GUI table\n UserList.forEach(s -> {\n UserData.add(s);\n });\n\n // set the the table items to the data in studentData; refresh the table\n UserTable.setItems(UserData);\n UserTable.refresh();\n }",
"private void inicializarTablero() {\n for (int i = 0; i < casillas.length; i++) {\n for (int j = 0; j < casillas[i].length; j++) {\n casillas[i][j] = new Casilla();\n }\n }\n }",
"public String SerializeColToString(ArrayList<String> list){ \n if(!list.isEmpty()){\n return String.join(\", \", list); \n }\n return null; \n }",
"@Override\n public void displayListTraineeInClass(ArrayList<TraineeDto> list) {\n DefaultTableModel _dm = (DefaultTableModel) tbTrainee.getModel();\n\n if (_dm.getRowCount() != 0) {\n _dm.getDataVector().removeAllElements();\n _dm.fireTableDataChanged();\n }\n Object rowData[] = new Object[4];\n for (int i = 0; i < list.size(); i++) {\n rowData[0] = list.get(i).getId();\n rowData[1] = list.get(i).getName();\n rowData[2] = list.get(i).getStartedDate();\n rowData[3] = list.get(i).getCourseMark();\n\n _dm.addRow(rowData);\n\n }\n }",
"public Object[] list() {\r\n ArrayList<Object> obj = new ArrayList<>();\r\n obj.add(row);\r\n obj.add(table);\r\n obj.add(variable);\r\n obj.add(name);\r\n obj.add(equEquipement);\r\n obj.add(equDesignation);\r\n obj.add(orgOrgane);\r\n obj.add(orgDesignation);\r\n obj.add(unite);\r\n obj.add(comment);\r\n obj.add(datemod);\r\n obj.add(state);\r\n\r\n return obj.toArray();\r\n }",
"public void setArrayList(ArrayList<Chalet> arrayList) {\n this.arrayList.addAll(arrayList);\n notifyDataSetChanged();// to update the sutats\n }",
"public void mostrarTablero(){\n for(int fila = 0; fila < FILAS; fila++){\n for(int columna : tablero[fila]){\n System.out.printf(\"%2d \", columna);\n }\n System.out.println();\n }\n }",
"public void displayLoanToJTable()\n {\n DefaultTableModel model = (DefaultTableModel) loan_results_jTable.getModel();\n Object rowData[] = new Object[7];\n for(int i = 0; i < _list.size(); i++)\n {\n rowData[0] = _list.get(i)._Bname;\n rowData[1] = _list.get(i)._LoanId;\n rowData[2] = _list.get(i)._ISBN;\n rowData[3] = _list.get(i)._CardId;\n rowData[4] = _list.get(i)._DateOut;\n rowData[5] = _list.get(i)._DueDate;\n rowData[6] = _list.get(i)._DateIn; \n model.addRow(rowData);\n } \n }",
"private void cargar(List<Personas> listaP) {\n int total= listaP.size();\n Object [][] tab = new Object [total][10];\n int i=0;\n Iterator iter = listaP.iterator();\n while (iter.hasNext()){\n Object objeto = iter.next();\n Personas pro = (Personas) objeto;\n\n tab[i][0]=pro.getLocalidadesid().getProvinciasId();\n tab[i][1]=pro.getLocalidadesid();\n tab[i][2]=pro.getCuilcuit();\n tab[i][3]=pro.getApellido();\n tab[i][4]=pro.getNombres();\n tab[i][5]=pro.getCalle();\n tab[i][6]=pro.getAltura();\n tab[i][7]=pro.getPiso();\n tab[i][8]=pro.getEmail();\n// if(pro.getEmpleados().equals(\"\")){\n tab[i][9]=\"Cliente\";\n // }else{\n // tab[i][7]=\"Empleado\";\n // }\n i++;\n }\njTable1 = new javax.swing.JTable();\n\njTable1.setModel(new javax.swing.table.DefaultTableModel(\ntab,\nnew String [] {\n \"Provincia\", \"Localidad\", \"DNI/Cuit\", \"Apellido\", \"Nombres\", \"Calle\", \"Altura\", \"Piso\", \"Email\", \"Tipo\"\n}\n));\n jScrollPane1.setViewportView(jTable1);\n }",
"public static void shufleArray(ArrayList<Number> list) {\r\n\t\tfor (int i = 0; i < list.size(); i++) {\r\n\t\t\t// generisemo prvi indeks.\r\n\t\t\tint indx1 = (int) (Math.random() * list.size());\r\n\t\t\t// generisemo drugi index.\r\n\t\t\tint indx2 = (int) (Math.random() * list.size());\r\n\t\t\t// cuvamo elemenat sa prvog indeksa.\r\n\t\t\tNumber temp = list.get(indx1);\r\n\t\t\t// Kopiramo elemenat sa drugog indeksa preko prvog elementa.\r\n\t\t\tlist.set(indx1, list.get(indx2));\r\n\t\t\t// Kopiramo temp (prvi elemenat) preko drugog elementa.\r\n\t\t\tlist.set(indx2, temp);\r\n\t\t}\r\n\t}",
"public Object[][] getTableData(){\r\n if (ufeRunner == null || renders == null || htmlObjLang == null) {\r\n return null;\r\n }\r\n final ArrayList<Object[]> lista = new ArrayList<>();\r\n Object[] fila = new Object[2];\r\n fila[0] = \"CssHelper\";\r\n if (ufeRunner.cssHelper == null) {\r\n fila[1] = \"null\";\r\n }else{\r\n fila[1] = ufeRunner.cssHelper.getPath();\r\n }\r\n lista.add(fila);\r\n fila = new Object[2];\r\n fila[0] = \"\";\r\n fila[1] = \"\";\r\n lista.add(fila);\r\n for (ImportedInstance ufeImport : ufeRunner.imports) {\r\n fila = new Object[2];\r\n fila[0] = \"UfeImport\";\r\n fila[1] = ufeImport.path;\r\n lista.add(fila);\r\n }\r\n if (ufeRunner.imports.size() < 1) {\r\n fila = new Object[2];\r\n fila[0] = \"Sin ufe imports\";\r\n fila[1] = \"Sin ufe imports\";\r\n lista.add(fila);\r\n }\r\n fila = new Object[2];\r\n fila[0] = \"\";\r\n fila[1] = \"\";\r\n lista.add(fila);\r\n ufeRunner.scope.symbolTable.forEach((key, val)->{\r\n Object[] f = new Object[2];\r\n f[0] = key;\r\n if (val.isPresent()) {\r\n Object obj = val.get();\r\n if (obj instanceof Object[]) {\r\n StringBuilder sb = new StringBuilder();\r\n sb.append(\"{ \");\r\n for (Object o : (Object[])obj) {\r\n sb.append(o.toString()).append(\",\");\r\n }\r\n sb.setLength(sb.length() - 1);\r\n sb.append(\" }\");\r\n f[1] = sb.toString();\r\n }else{\r\n f[1] = obj.toString();\r\n }\r\n }else{\r\n f[1] = \"null\";\r\n }\r\n lista.add(f);\r\n });\r\n Object[][] result = new Object[lista.size()][2];\r\n for (int i = 0; i < lista.size(); i++) {\r\n fila = lista.get(i);\r\n for (int j = 0; j < 2; j++) {\r\n result[i][j] = fila[j];\r\n }\r\n }\r\n return result;\r\n }",
"public <Q> Q[] asDataArray(Q[] a);",
"public static void createTable() {\n Scanner input = new Scanner(System.in);\n System.out.print(\"How many rows in array: \");\n int rows = input.nextInt();\n System.out.print(\"How many columns in array: \");\n int columns = input.nextInt();\n System.out.println(\"Enter numbers: \");\n table = new Integer[rows][columns];\n for (int i = 0; i < table.length; i++) {\n for (int j = 0; j < table[i].length; j++) {\n table[i][j] = input.nextInt();\n }\n }\n System.out.println();\n System.out.println(\"Initial table: \");\n\n for (int i = 0; i < table.length; i++) {\n System.out.println();\n for (int j = 0; j < table[i].length; j++) {\n System.out.print(table[i][j] + \" \");\n }\n }\n System.out.println();\n\n //Create temporary one-dimensions array\n int[] newTable = new int[table.length * table[0].length];\n ArrayList<Integer> list = new ArrayList<>(0);\n for (int i = 0; i < table.length; i++) {\n for (int j = 0; j < table[i].length; j++) {\n list.add(table[i][j]);\n }\n }\n\n for (int i = 0; i < table.length * table[0].length; i++) {\n newTable[i] = list.get(i);\n }\n System.out.println();\n System.out.println(\"Sorted array: \");\n int k = 0;\n for (int i = 0; i < table.length; i++) {\n for (int j = 0; j < table[0].length; j++) {\n table[i][j] = bubbleSort(newTable)[k];\n k++;\n }\n }\n\n for (Integer[] integers : table) {\n System.out.println();\n for (Integer integer : integers) {\n System.out.print(integer + \" \");\n }\n }\n System.out.println();\n\n }",
"private void cargarLista(ArrayList<CarritoDTO> arrayList)\n {\n DefaultListModel modelo = new DefaultListModel();\n //Recorrer el contenido del ArrayList\n for(int i=0; i<arrayList.size(); i++) \n {\n CarritoDTO item =(CarritoDTO) arrayList.get(i);\n //Añadir cada elemento del ArrayList en el modelo de la lista\n modelo.add(i, item.toString());\n }\n //Asociar el modelo de lista al JList\n jList1.setModel(modelo);\n }",
"@SuppressWarnings(\"unchecked\")\n private void createTable(ArrayList<Object> objects){\n log.setText(\"\");\n if(!objects.isEmpty()) {\n ArrayList<String> list = new ArrayList<String>();\n int index = 0, row = 0, column = 0;\n for (Field field : objects.get(0).getClass().getDeclaredFields()) {\n list.add(field.getName());\n }\n String[] columnName = new String[list.size()];\n for(String s:list) {\n columnName[index] = s;\n index++;\n }\n Object data[][] = getData(objects, index);\n if(data.length != 0) {\n tableMode = new DefaultTableModel(data, columnName);\n }\n else {\n tableMode = null;\n }\n }\n else {\n tableMode = null;\n }\n }",
"public ArrayList<Vector<Object>> recuperaTablaFacturas(String filtro) {\r\n\t\tArrayList<Vector<Object>> tableData = null;\r\n\t\tArrayList<Factura> lista = recuperaFacturaParaTabla(filtro);\r\n\t\ttableData = new ArrayList<>();\r\n\t\tfor (Factura factura : lista) {\r\n\t\t\tVector<Object> filaData = new Vector<>();\r\n\t\t\tfilaData.add(factura);\r\n\t\t\tfilaData.add(factura.getFecha());\r\n\t\t\tfilaData.add(factura.getCliente().toString());\r\n\t\t\tfilaData.add(factura.getImpTotal());\r\n\t\t\tfilaData.add(factura.isCobrada());\r\n\t\t\ttableData.add(filaData);\r\n\t\t}\r\n\t\treturn tableData;\r\n\t}",
"void buildTable(){\n HashMap<String, Integer> map = new HashMap<String, Integer>();\n while (first.hasNext()){\n String s = first.next();\n for(String key: s.split(SPLIT)) {\n int val = map.getOrDefault(key, 0);\n map.put(key, val + 1);\n }\n }\n ArrayList<Tuple> arr = new ArrayList<>();\n for (String key: map.keySet()){\n int num = map.get(key);\n //filter the unusual items\n if (num >= this.support){\n arr.add(new Tuple(key, num));\n }\n }\n //descending sort\n arr.sort((Tuple t1, Tuple t2)->{\n if (t1.num <= t2.num)\n return 1;\n else\n return -1;\n });\n\n int idx = 0;\n for(Tuple t: arr){\n this.table.add(new TableEntry(t.item, t.num));\n this.keyToNum.put(t.item, t.num);\n this.keyToIdx.put(t.item, idx);\n idx += 1;\n }\n /*\n for(TableEntry e: table){\n System.out.println(e.getItem()+ \" \"+ e.getNum());\n }*/\n }",
"private void preencheTable(){\n\t\t\n\t\tlistaArquivos.setItemCount(0);\n\t\t\n\t\tfor(File f : arquivos){\n\t\t\tTableItem it = new TableItem(listaArquivos, SWT.NONE);\n\t\t\tit.setText(0, f.getName());\n\t\t\tit.setText(1, formataDouble(f.length()));\n\t\t\tit.setText(2, formataData(f.lastModified()));\n\t\t}\n\t\t\n\t}",
"void listarDadosNaTelaColaborador(ArrayList<Colaborador> lista,DefaultTableModel model ) {\n model.setNumRows(0);\n //Correr o ArrayList\n for (int pos = 0; pos < lista.size(); pos++) {\n String[] linha = new String[9];\n Colaborador aux = lista.get(pos);\n linha[0] = \"\"+aux.getId();\n linha[1] = \"\"+aux.getMatricula();\n linha[2] = aux.getNome();\n linha[3] = \"\"+aux.getNumeroOAB();\n linha[4] = \"\"+aux.getCpf();\n linha[5] = aux.getEmail();\n linha[6] = \"\"+aux.getTelefone();\n linha[7] = aux.getTipo().toString();\n linha[8] = aux.getStatus().toString();\n model.addRow(linha);\n }\n }",
"private void loadTableBill(TableView <Fxp_Archguid> tb_view, Fxp_Archguid[] archguid){ \r\n if(archguid != null){\r\n ObservableList<Fxp_Archguid> data = FXCollections.observableArrayList(); \r\n data.addAll(Arrays.asList(archguid)); \r\n tb_view.setItems(data); \r\n }\r\n }",
"void outPut(ArrayList<SanPham> list);",
"@SuppressWarnings(\"unchecked\")\n private void createTable() {\n table = (LinkedList<Item<V>>[])new LinkedList[capacity];\n for(int i = 0; i < table.length; i++) {\n table[i] = new LinkedList<>();\n }\n }",
"public void listarQuartos(JTable table) {\r\n\t\ttry {\r\n\t\t\tStatement st = conexao.createStatement();\r\n\t\t\tResultSet rs = st.executeQuery(\"SELECT idQuartos,tipo FROM quartos\");\r\n\t\t\ttable.setModel(DbUtils.resultSetToTableModel(rs));\r\n\t\t}\r\n\t\tcatch (SQLException e) {}\r\n\t}"
] | [
"0.6260973",
"0.62323624",
"0.6028144",
"0.589833",
"0.57042474",
"0.5700289",
"0.5633204",
"0.56269723",
"0.5594219",
"0.5585003",
"0.5540574",
"0.54778075",
"0.5437371",
"0.5394386",
"0.537974",
"0.53667396",
"0.5341885",
"0.53396684",
"0.5333257",
"0.53194463",
"0.52948487",
"0.52854395",
"0.5262419",
"0.5256233",
"0.523754",
"0.52322817",
"0.52241284",
"0.52120626",
"0.5209609",
"0.5206685",
"0.52040917",
"0.52035505",
"0.51952577",
"0.51906264",
"0.5187432",
"0.51832026",
"0.5179836",
"0.51685613",
"0.5165221",
"0.51651984",
"0.51640105",
"0.51495856",
"0.5145704",
"0.5140913",
"0.51353264",
"0.5126926",
"0.5126367",
"0.51261926",
"0.51240146",
"0.51158684",
"0.5115339",
"0.5109819",
"0.50951487",
"0.50947237",
"0.5082787",
"0.5074299",
"0.5073678",
"0.50723493",
"0.5072031",
"0.50716877",
"0.50710195",
"0.50657314",
"0.50603664",
"0.50553954",
"0.5051599",
"0.5037673",
"0.50305015",
"0.5028227",
"0.5019138",
"0.50147486",
"0.50015134",
"0.4990898",
"0.49903047",
"0.49855092",
"0.49826944",
"0.4980836",
"0.49754825",
"0.49614805",
"0.49587893",
"0.4958102",
"0.4956394",
"0.49502882",
"0.4946006",
"0.4944797",
"0.49439546",
"0.49392614",
"0.4939226",
"0.49361867",
"0.49344948",
"0.49312526",
"0.49296293",
"0.49288312",
"0.49269828",
"0.4926495",
"0.4921352",
"0.49191627",
"0.49122584",
"0.49118465",
"0.49113107",
"0.49098527"
] | 0.6141697 | 2 |
Creer une loi Discrete Puis simule la loi en simulant nbRep valeurs | public static Double[][] simulerDiscrete(ArrayList<Double> listValeurs, ArrayList<Double> listProbabilite,Double nbRep) {
Discrete loi = new Discrete(listValeurs,listProbabilite);
return loi.simuler(nbRep);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int initialiser()\n\t{\n\n\t\tint nombreE;\n\t\tint k = 0;\n\t\t//int max = randInt(2,10);\n\t\ttableauPeres_ = new Case[longueur_][longueur_];\n\t\tint i, j = 0;\n\t\tfor(i=0; i<longueur_; ++i)\n\t\t{\n\t\t\tfor(j=0; j<longueur_; ++j)\n\t\t\t{\n\t\t\t\ttableauPeres_[i][j] = new Case(i, j, 0);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Combien d'étoiles souhaitez vous pour chaque joueur ?\");\n\t\tnombreE = clavier.nextInt();\n\t\twhile (k < nombreE)\n\t\t{\n\t\t\taddEtoile(\"bleu\");\n\t\t\taddEtoile(\"rouge\");\n\t\t\t++k;\n\t\t}\n\t\treturn nombreE;\n\t}",
"public Plateau(int largeur, int hauteur) {\r\n\t\tplateau = new Cellule[hauteur][largeur];\r\n\t\tint equipe = 1;\r\n\t\tfor (int i=0; i<hauteur; i++) {\r\n\t\t\tfor (int j=0; j<largeur; j++) {\r\n\t\t\t\tif ((i == 0 && j == 0) || (i == hauteur-1 && j == largeur -1))\r\n\t\t\t\t\tplateau[i][j] = new Base(j,i,equipe++);\r\n\t\t\t\telse\r\n\t\t\t\t\tplateau[i][j] = new Case(j,i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.hauteur = hauteur;\r\n\t\tthis.largeur = largeur;\r\n\t}",
"public void agregarVidaLogica(){\n int numvida = tam * tam;\n numvida*=0.05;\n System.out.println(numvida);\n for(int i=0;i<numvida;i++){\n int x= (int)(Math.random()*tam);\n int y= (int)(Math.random()*tam);\n if(matriz[y][x]!=2 && matriz[y][x]!=1){\n matriz[y][x]=4;\n }\n }\n }",
"public void insertar2(){\n for (int i = 0; i < tamano; i++) {\n vectorpila2[i]=(int) (Math.random() *100+1);\n \n cima++;\n }\n }",
"Multiplication createRandomMultiplication();",
"Multiplication createRandomMultiplication();",
"private void generisiPolje() {\r\n\t\tint polje = rnd.nextInt(broj_slobodnih);\r\n\t\tint vrijednost = rnd.nextInt(4);\r\n\t\tif(vrijednost == 0)\r\n\t\t\tvrijednost = 4;\r\n\t\telse\r\n\t\t\tvrijednost = 2;\r\n\t\t\r\n\t\tint brojac = 0;\r\n\t\tfor(int i = 0 ; i < 4 ; i++)\r\n\t\t\tfor(int j = 0 ; j < 4 ; j++) {\r\n\t\t\t\tif(tabela[i][j] == 0) {\r\n\t\t\t\t\tif(brojac == polje)\r\n\t\t\t\t\t\ttabela[i][j] = vrijednost;\r\n\t\t\t\t\tbrojac++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tbroj_slobodnih--;\r\n\t}",
"public Igra2048() {\r\n\t\ttabela = new int[4][4];\r\n\t\tbroj_slobodnih = 16;\r\n\t\trnd = new Random();\r\n\t\tpobjeda = false;\r\n\t\tigrajPoslijePobjede = false;\r\n\t\t\r\n\t\tgenerisiPolje();\r\n\t\tgenerisiPolje();\r\n\t}",
"public void generete() {\n int minQuantFig = 1,\r\n maxQuantFig = 10,\r\n minNum = 1,\r\n maxNum = 100,\r\n minColor = 0,\r\n maxColor = (int)colors.length - 1,\r\n\r\n // Initialize figures property for random calculations\r\n randomColor = 0,\r\n randomFigure = 0,\r\n\r\n // Squere property\r\n randomSideLength = 0,\r\n\r\n // Circle property\r\n randomRadius = 0,\r\n \r\n // IsoscelesRightTriangle property \r\n randomHypotenus = 0,\r\n \r\n // Trapizoid properties\r\n randomBaseA = 0,\r\n randomBaseB = 0,\r\n randomAltitude = 0;\r\n\r\n // Generate random number to set figueres's quantaty\r\n setFigureQuantaty( generateWholoeNumInRange(minQuantFig, maxQuantFig) );\r\n\r\n for( int i = 0; i < getFigureQuantaty(); i++ ) {\r\n\r\n // Convert double random value to int and close it in range from 1 to number of elements in array\r\n randomFigure = (int)( Math.random() * figures.length );\r\n \r\n randomColor = generateWholoeNumInRange( minColor, maxColor ); // Get random color's index from colors array\r\n\r\n // Create new figure depending on randomFigure \r\n switch (figures[randomFigure]) {\r\n\r\n case \"Circle\":\r\n\r\n randomRadius = generateWholoeNumInRange( minNum, maxNum ); // Get random value of circle's radius;\r\n\r\n Circle newCircle = new Circle( colors[randomColor], randomRadius ); // Initialize Circle with random parameters\r\n\r\n newCircle.drawFigure();\r\n \r\n break;\r\n\r\n case \"Squere\":\r\n\r\n randomSideLength = generateWholoeNumInRange( minNum, maxNum ); // Get random value of side length;\r\n\r\n Squere newSquere = new Squere( colors[randomColor], randomSideLength ); // Initialize Circle with random parameters\r\n\r\n newSquere.drawFigure();\r\n\r\n break;\r\n\r\n case \"Triangle\":\r\n\r\n randomSideLength = generateWholoeNumInRange( minNum, maxNum ); // Get random value of side length;\r\n\r\n randomHypotenus = generateWholoeNumInRange( minNum, maxNum ); // Get random value of hypotenus;\r\n\r\n IsoscelesRightTriangle newTriangle = new IsoscelesRightTriangle( colors[randomColor], randomSideLength, randomHypotenus ); // Initialize Circle with random parameters\r\n\r\n newTriangle.drawFigure();\r\n\r\n break;\r\n\r\n case \"Trapezoid\":\r\n\r\n randomBaseA = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's side A;\r\n\r\n randomBaseB = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's side B;\r\n\r\n randomAltitude = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's altitude;\r\n\r\n Trapezoid newTrapezoid = new Trapezoid( colors[randomColor], randomBaseA, randomBaseB, randomAltitude ); // Create new Trapezoid with random parameters\r\n\r\n newTrapezoid.drawFigure();\r\n\r\n break;\r\n\r\n };\r\n };\r\n }",
"public void creationPlateau() {\n for (int i = 0; i < 10; i++) {\n int X = rand.nextInt(14);\n int Y = rand.nextInt(14);\n if (plateau[X][Y] == null && espacementMonstre(X,Y,plateau)) {\n int monstreAleatoire = 1 + (int)(Math.random() * ((3 - 1) + 1));\n switch (monstreAleatoire) {\n case 1:\n Personnage monstreD = new Dragonnet(X,Y);\n plateau[X][Y] = monstreD;\n this.monstre.add(monstreD);\n System.out.println(\"Dragonnet ajouté en position : \"+X+\" \"+Y);\n break;\n case 2:\n Personnage monstreL = new Loup(X,Y);\n plateau[X][Y] = monstreL;\n this.monstre.add(monstreL);\n System.out.println(\"Loup ajouté en position : \"+X+\" \"+Y);\n\n break;\n case 3:\n Personnage monstreO = new Orque(X,Y);\n plateau[X][Y] = monstreO;\n this.monstre.add(monstreO);\n System.out.println(\"Orque ajouté en position : \"+X+\" \"+Y);\n break;\n }\n } else {\n i --;\n }\n }\n }",
"private int newFigure(Random rnd) {\r\n\t\t/** while the figure exists or = 0, find a new figure */\r\n\r\n\t\tbyte hulp = 0;\r\n\t\tdo {\r\n\t\t\thulp = (byte) (1 + rnd.nextInt(Constants.DIMENSION * Constants.DIMENSION));\r\n\t\t} while (exists(hulp) || (hulp < Constants.MIN));\r\n\t\tConstants.logger.debug(hulp);\r\n\t\treturn hulp;\r\n\t}",
"public void insertar(){\n /*este for lo que hace es que se va a repetir\n dependiendo el tamaņo de la variable \"tamano\"\n */\n for (int i = 0; i < tamano; i++) {\n //Este metodo lo que hace es generar numeros aleatorios del 1 al 100\n vectorpila[i]=(int) (Math.random() *100+1);\n //Aqui aumenta el valor de cima\n cima++;\n }\n System.out.println(\"Pila llena\");\n }",
"public Chromosone() {\n Random rand = new Random();\n for(int i=0;i<=75;i++)\n {\n int rnd = rand.nextInt(2);// [1,0...]\n\n Val.add(rnd);\n }\n }",
"public void creation(){\n\t for(int i=0; i<N;i++) {\r\n\t\t for(int j=0; j<N;j++) {\r\n\t\t\t tab[i][j]=0;\r\n\t\t }\r\n\t }\r\n\t resDiagonale(); \r\n \r\n\t //On remplit le reste \r\n\t conclusionRes(0, nCarre); \r\n \t\t\r\n\t \r\n\t isDone=true;\r\n }",
"public IntegerGenotype create() \r\n\t{\n\t\tIntegerGenotype genotype = new IntegerGenotype(1,3);\r\n\t\tgenotype.init(new Random(), Data.numeroCuardillas); \r\n\t\t\r\n\t\treturn genotype;\r\n\t}",
"public void novaIgra() {\r\n\t\tbroj_slobodnih = 16;\r\n\t\tfor(int i = 0 ; i < 4 ; i++)\r\n\t\t\tfor(int j = 0 ; j < 4 ; j++)\r\n\t\t\t\ttabela[i][j] = 0;\r\n\t\tpobjeda = false;\r\n\t\tigrajPoslijePobjede = false;\r\n\t\tgenerisiPolje();\r\n\t\tgenerisiPolje();\r\n\t}",
"public GrapheIndicateursProjet (Projet p) {\n seuils = p.getSeuilFixes() ;\n \n // pour l'echelle, on determine les mesures max de toutes les iterations\n \n \n iterations = p.getListeIt() ; \n nbIt = iterations.size() ;\n \n // calcul des maximums\n Iteration tempIt = null ;\n IndicateursIteration tempIndIt = null ;\n for (int i = 0 ; i < nbIt ; i++)\n {\n if (iterations.get(i) instanceof Iteration)\n {\n tempIt = (Iteration)iterations.get(i) ;\n tempIndIt = tempIt.getIndicateursIteration() ;\n // charges\n if (tempIndIt.getTotalCharges() > chargesMax) { chargesMax = tempIndIt.getTotalCharges() ; }\n\t\tif (tempIndIt.getChargeMoyenneParticipants() > moyenneChargesMax) { moyenneChargesMax = tempIndIt.getChargeMoyenneParticipants() ; }\n\t\tif (tempIndIt.getNombreParticipants() > participantsMax) { participantsMax = tempIndIt.getNombreParticipants() ; }\n\t\tif (tempIndIt.getNombreTachesTerminees() > tachesTermineesMax) { tachesTermineesMax = tempIndIt.getNombreTachesTerminees() ; }\n\t\tif (tempIndIt.getNombreMoyenTachesParticipants() > tachesParticipantsMax) { tachesParticipantsMax = tempIndIt.getNombreMoyenTachesParticipants() ; }\n\t\tif (tempIndIt.getDureeMoyenneTaches() > dureeMoyenneTacheMax) { dureeMoyenneTacheMax = tempIndIt.getDureeMoyenneTaches() ; }\n }\n }\n setPreferredSize(new Dimension(ITERATION_WIDTH * nbIt,440));\n\t//setBorder(new TitledBorder(new EtchedBorder(), \"toto\", 5, TitledBorder.ABOVE_TOP)) ;\n }",
"Dimension_longueur createDimension_longueur();",
"private void posicionInicial(int ancho){\r\n posicionX = ancho;\r\n Random aleatroio = new Random();\r\n int desplazamiento = aleatroio.nextInt(150)+100;\r\n \r\n \r\n cazaTie = new Rectangle2D.Double(posicionX, desplazamiento, anchoEnemigo, alturaEnemigo);\r\n }",
"public void generaBuits() {\r\n\r\n //FIX PARA EL OUT OF BOUNDS DE la columna 9 \r\n //int cellId = randomGenerator(N*N) - 1;\r\n //QUITAR \r\n //if (j != 0)\r\n //j = j - 1;\r\n int count = K;\r\n while (count != 0) {\r\n int cellId = generadorAleatoris(N * N) - 1;\r\n\r\n //System.out.println(cellId); \r\n // extract coordinates i and j \r\n int i = (cellId / N);\r\n int j = cellId % 9;\r\n\r\n // System.out.println(i+\" \"+j); \r\n if (mat[i][j] != 0) {\r\n count--;\r\n mat[i][j] = 0;\r\n }\r\n }\r\n }",
"MagLegendre( int nt ) \n {\n nTerms = nt;\n Pcup = new double[ nTerms + 1 ];\n dPcup = new double[ nTerms + 1 ];\n }",
"public Clorus replicate() {\n Clorus p2 = new Clorus(energy/2.0);\n energy /= 2;\n return p2;\n }",
"public void gagne()\r\n\t{\r\n\t\tthis.nbVictoires++;\r\n\t}",
"private void crearDimensionContable()\r\n/* 201: */ {\r\n/* 202:249 */ this.dimensionContable = new DimensionContable();\r\n/* 203:250 */ this.dimensionContable.setIdOrganizacion(AppUtil.getOrganizacion().getId());\r\n/* 204:251 */ this.dimensionContable.setIdSucursal(AppUtil.getSucursal().getId());\r\n/* 205:252 */ this.dimensionContable.setNumero(getDimension());\r\n/* 206:253 */ verificaDimension();\r\n/* 207: */ }",
"@Override\n\tpublic void crearNuevaPoblacion() {\n\t\t/* Nos quedamos con los mejores individuos. Del resto, cruzamos la mitad, los mejores,\n\t\t * y el resto los borramos.*/\n\t\tList<IIndividuo> poblacion2 = new ArrayList<>();\n\t\tint numFijos = (int) (poblacion.size()/2);\n\t\t/* Incluimos el 50%, los mejores */\n\t\tpoblacion2.addAll(this.poblacion.subList(0, numFijos));\n\t\t\n\t\t/* De los mejores, mezclamos la primera mitad \n\t\t * con todos, juntandolos de forma aleatoria */\n\t\tList<IIndividuo> temp = poblacion.subList(0, numFijos+1);\n\t\tfor(int i = 0; i < temp.size()/2; i++) {\n\t\t\tint j;\n\t\t\tdo {\n\t\t\t\tj = Individuo.aleatNum(0, temp.size()-1);\n\t\t\t}while(j != i);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tpoblacion2.addAll(cruce(temp.get(i), temp.get(j)));\n\t\t\t} catch (CruceNuloException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//this.poblacion.clear();\n\t\tthis.poblacion = poblacion2;\n\t}",
"public Nid(String matiere, int capacite)\n {\n // initialisation des variables d'instance\n this.matiere = matiere;\n this.capacite = capacite;\n }",
"public static void main(String[] args) {\n\t\t\r\n\t\tFap<Couple<Double, Integer>> sT = new FapTableau<>();\r\n\t\tFap<Couple<Double, Integer>> sL = new FapListe<>();\r\n\t\t\r\n\t\tRandom r = new Random();\r\n\t\tfor (int i=0 ; i<100 ; i++) {\r\n\t\t\ttry {\r\n\t\t\t\tSystem.out.println(\"sequenceL vide :\" + sL.estVide());\r\n\t\t\t\tSystem.out.println(\"sequenceT vide :\" + sT.estVide());\r\n\t\t\t\tassert(sL.estVide() == sT.estVide());\r\n\t\t\t\t\r\n\t\t\t\tif (r.nextBoolean()) {\r\n\t\t\t\t\tCouple<Double, Integer> a = new Couple<Double, Integer>(r.nextDouble(), r.nextInt(10));\r\n\t\t\t\t\t\tSystem.out.println(\"insertion de :\" + a);\r\n\t\t\t\t\t\tsL.insere(a);\r\n\t\t\t\t\t\tsT.insere(a);\r\n\t\t\t\t\t\r\n\t\t\t\t} else if (!sL.estVide()){\r\n\t\t\t\t\tCouple<Double, Integer> k1 = sL.extraire();\r\n\t\t\t\t\tCouple<Double, Integer> k2 = sT.extraire();\r\n\t\t\t\t\tassert(k1.equals(k2));\r\n\t\t\t\t\tSystem.out.println(\"suppression de :\" + k1);\r\n\t\t\t\t\tSystem.out.println(\"suppression de :\" + k2);\t\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}catch (Exception e) {\r\n\t\t\t\tSystem.out.println(e);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}",
"public void rellenaImagen()\n {\n rellenaDatos(\"1\",\"Samsung\", \"cv3\", \"blanco\" , \"50\", 1200,2);\n rellenaDatos(\"2\",\"Samsung\", \"cv5\", \"negro\" , \"30\", 600,5);\n }",
"public Dipendente() {\r\n\t\tsetnMat();\r\n\t}",
"SpaceInvaderTest_test_unNouveauVaisseauAvecDimensionEstCorrectementPositionneDansEspaceJeu createSpaceInvaderTest_test_unNouveauVaisseauAvecDimensionEstCorrectementPositionneDansEspaceJeu();",
"public void MakeRep(int type, int min, int max)\n\t{\n\t\t_type += (type - One);\n\t\t_m = min;\n\t\t_n = max;\n\t}",
"public static int[] f_fill_vector_age_people(int N){\n int[] v_vector_age= new int[N];\n for(int i=0; i<N; i++){\n\n v_vector_age[i]= (int) (Math.random()*100)+1;\n\n }\n return v_vector_age;\n }",
"public Perso designerCible(){\r\n\t\tRandom rand = new Random();\r\n\t\tint x = rand.nextInt((int)provocGlob);\r\n\t\tboolean trouve =false;\r\n\t\tdouble cpt=0;\r\n\t\tPerso res=groupe.get(0);\r\n\t\tfor(Perso pers : groupeAble){\r\n\t\t\tcpt+=pers.getProvoc();\r\n\t\t\tif(cpt>x && !trouve){\r\n\t\t\t\tres=pers;\r\n\t\t\t\ttrouve=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t}",
"private ChartPanel makeRandomizedDistrPanel(IELSAIterator it, double maxDist){\n \ttry{\n \n TreeMap<Double,Double> distrValues = RandomMinimalProperRecurrenceDistances.extractDistributionMap(it);\n final XYSeries series = new XYSeries(\"\");\n for(Map.Entry<Double,Double> entry : distrValues.entrySet()){\n if(entry.getKey() > maxDist)\n break;\n series.add(entry.getKey(), entry.getValue());\n }\n ChartPanel chart = makeRawChart(series, \"Distance\", \"Frequency\");\n chart.getChart().setTitle(\"Randomized\");\n return chart;\n }catch(Exception e){\n e.printStackTrace();\n System.out.println(e);\n }\n return null;\n }",
"Pinochle(){\n createDeck();\n createDeck();\n this.originalSizeOfDeck = this.deckOfCards.size();\n }",
"public Pilas(int cap) { // el constructor, de parametro la capacidad de la pila\r\n capacidad = cap; // le asignamos a capacidad lo que se pase por parametro\r\n array = new int[capacidad]; // al arreglo le decimos (asignamos) su longitud\r\n top = -1; // inicializamos la cima (como no hay aun nada, la cima es -1)\r\n }",
"public void resolution() {\n\t\tLigneProposition essai = new LigneProposition(p.getNbTrou());\n\t\t\n\t\tfor(int i = 0; i < p.getNbTrou(); i++) {\n\t\t\tessai.setAt(i, 1 + (int)(Math.random() * ((p.getNbCouleur() -1))));\n\t\t}\n\t\t\n\t\tp.ajouterEssai(essai);\n\t}",
"public void crearAutomovil(){\r\n automovil = new Vehiculo();\r\n automovil.setMarca(\"BMW\");\r\n automovil.setModelo(2010);\r\n automovil.setPlaca(\"TWS435\");\r\n }",
"@Override\n\tpublic Double generarGenRandom(int longitud) {\n\t\treturn null;\n\t}",
"@Override\n public Vehicule creer(String immatriculation, String marque, String modele, Client client) {\n return new Voiture(immatriculation,marque,modele,client);\n }",
"public static Casilla[][] crearCasillaInicial(int cantidadCasillasX, int cantidadCasillasY){\n Casilla tableroAux;\n Casilla[][] tablero = new Casilla[cantidadCasillasX][cantidadCasillasY];\n for (int i = 0; i < cantidadCasillasX; i++) {\n for (int j = 0; j < cantidadCasillasY; j++) {\n int random = (int)(Math.random()*100);\n \n if(random>=50 && random<=60){\n SuperficieJLabel jlabel = new SuperficieJLabel(i+1, j+1,String.valueOf(TipoDeCasilla.RETROCESO));\n Image img= new ImageIcon(\"imagenes/cuadrado.png\").getImage();\n ImageIcon img2=new ImageIcon(img.getScaledInstance(20, 40, Image.SCALE_SMOOTH));\n jlabel.setIcon(img2);\n\n tableroAux = new Casilla(TipoDeCasilla.VACIA, jlabel,false);\n tablero[i][j] = tableroAux;\n \n }\n else if(random>60 && random<=70){\n SuperficieJLabel jlabel = new SuperficieJLabel(i+1, j+1,String.valueOf(TipoDeCasilla.ADELANTO));\n Image img= new ImageIcon(\"imagenes/cuadrado.png\").getImage();\n ImageIcon img2=new ImageIcon(img.getScaledInstance(20, 40, Image.SCALE_SMOOTH));\n jlabel.setIcon(img2);\n tableroAux = new Casilla(TipoDeCasilla.VACIA, jlabel,false);\n tablero[i][j] = tableroAux;\n \n }\n else if(random>70 && random<=80){\n SuperficieJLabel jlabel = new SuperficieJLabel(i+1, j+1,String.valueOf(TipoDeCasilla.ESCALERA));\n Image img= new ImageIcon(\"imagenes/cuadrado.png\").getImage();\n ImageIcon img2=new ImageIcon(img.getScaledInstance(20, 40, Image.SCALE_SMOOTH));\n jlabel.setIcon(img2);\n tableroAux = new Casilla(TipoDeCasilla.VACIA, jlabel,false);\n tablero[i][j] = tableroAux;\n }\n else if(random>80 && random<=90){\n SuperficieJLabel jlabel = new SuperficieJLabel(i+1, j+1,String.valueOf(TipoDeCasilla.SERPIENTE));\n Image img= new ImageIcon(\"imagenes/cuadrado.png\").getImage();\n ImageIcon img2=new ImageIcon(img.getScaledInstance(20, 40, Image.SCALE_SMOOTH));\n jlabel.setIcon(img2);\n tableroAux = new Casilla(TipoDeCasilla.VACIA, jlabel,false);\n tablero[i][j] = tableroAux;\n }\n else if(random>=0 && random<50){\n SuperficieJLabel jlabel = new SuperficieJLabel(i+1, j+1,String.valueOf(TipoDeCasilla.VACIA));\n Image img= new ImageIcon(\"imagenes/cuadrado.png\").getImage();\n ImageIcon img2=new ImageIcon(img.getScaledInstance(20, 40, Image.SCALE_SMOOTH));\n jlabel.setIcon(img2);\n tableroAux = new Casilla(TipoDeCasilla.VACIA, jlabel,false);\n tablero[i][j] = tableroAux;\n }\n else if(random>90 && random<=100){\n SuperficieJLabel jlabel = new SuperficieJLabel(i+1, j+1,String.valueOf(TipoDeCasilla.PIERDE_TURNO)+\" \");\n Image img= new ImageIcon(\"imagenes/cuadrado.png\").getImage();\n ImageIcon img2=new ImageIcon(img.getScaledInstance(20, 40, Image.SCALE_SMOOTH));\n jlabel.setIcon(img2);\n tableroAux = new Casilla(TipoDeCasilla.VACIA, jlabel,false);\n tablero[i][j] = tableroAux;\n }\n \n }\n \n }\n return tablero;\n }",
"private Productos(int codigo, String descripcion, double precio) {\n this.codigo = codigo;\n this.descripcion = descripcion;\n this.precio = precio;\n }",
"@Test(timeout = 4000)\n public void test09() throws Throwable {\n Discretize discretize0 = new Discretize(\"*W5D<hSCW|8@I\");\n int[] intArray0 = new int[9];\n intArray0[0] = (-1405);\n intArray0[1] = (-2938);\n intArray0[2] = (-1954);\n intArray0[3] = 9;\n intArray0[4] = 66;\n intArray0[5] = 573;\n intArray0[6] = 0;\n intArray0[7] = (-71);\n intArray0[8] = 99;\n discretize0.setAttributeIndicesArray(intArray0);\n assertFalse(discretize0.getFindNumBins());\n assertFalse(discretize0.getUseEqualFrequency());\n assertFalse(discretize0.getUseBinNumbers());\n assertEquals(10, discretize0.getBins());\n assertFalse(discretize0.getMakeBinary());\n assertEquals((-1.0), discretize0.getDesiredWeightOfInstancesPerInterval(), 0.01);\n }",
"@Test(timeout = 4000)\n public void test07() throws Throwable {\n Discretize discretize0 = new Discretize();\n String[] stringArray0 = new String[3];\n stringArray0[0] = \"-R\";\n stringArray0[1] = \"-R\";\n stringArray0[2] = \"Xw\";\n discretize0.setOptions(stringArray0);\n discretize0.setAttributeIndices(\"\");\n assertEquals((-1.0), discretize0.getDesiredWeightOfInstancesPerInterval(), 0.01);\n assertFalse(discretize0.getUseBinNumbers());\n assertEquals(10, discretize0.getBins());\n assertFalse(discretize0.getMakeBinary());\n assertFalse(discretize0.getUseEqualFrequency());\n assertFalse(discretize0.getFindNumBins());\n }",
"@Override\n public Vehicule creer(String immatriculation, String marque, String modele, Client client, int tonnage, int hauteur) {\n return new Camion(immatriculation,marque,modele,client,tonnage,hauteur);\n }",
"public void nouvelleQuestion() {\n getAll();\n Random random = new Random();\n do {\n questionObjet = listeQuestions.get(random.nextInt(listeQuestions.size()));\n niveauUtil = questionObjet.getNiveau();\n }\n while (niveauUtil != niveau);\n questionUtil = questionObjet.getQuestion();\n reponseUtil = questionObjet.getReponse();\n }",
"public void creaAziendaAgricola(){\n\t\tCantina nipozzano = creaCantina(\"Nipozzano\");\t\n\t\tBotte[] bottiNipozzano = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiNipozzano.length; i++){\n\t\t\tbottiNipozzano[i] = creaBotte(nipozzano, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\t\t\n\t\tVigna mormoreto = creaVigna(\"Mormoreto\", 330, 25, EsposizioneVigna.sud, \"Terreni ricchi di sabbia, ben drenati. Discreta presenza di calcio. pH neutro o leggermente alcalino\");\n\t\tFilare[] filariMormoreto = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMormoreto.length;i++){\n\t\t\tfilariMormoreto[i] = creaFilare(mormoreto, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\t\n\t\tVigna montesodi = creaVigna(\"Montesodi\", 400, 20, EsposizioneVigna.sud_ovest, \"Arido e sassoso, di alberese, argilloso e calcareo, ben drenato, poco ricco di sostanza organica\");\n\t\tFilare[] filariMontesodi = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMontesodi.length;i++){\n\t\t\tfilariMontesodi[i] = creaFilare(montesodi, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t/*\n\t\t * CANTINA: POMINO - VIGNETO BENEFIZIO\n\t\t */\n\t\t\n\t\tCantina pomino = creaCantina(\"Pomino\");\n\t\tBotte[] bottiPomino = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiPomino.length; i++){\n\t\t\tbottiPomino[i] = creaBotte(pomino, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\n\t\tVigna benefizio = creaVigna(\"Benefizio\", 700, 9, EsposizioneVigna.sud_ovest, \"Terreni ricchi di sabbia, forte presenza di scheletro. Molto drenanti. Ricchi in elementi minerali. PH acido o leggermente acido.\");\n\t\tFilare[] filariBenefizio = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariBenefizio.length;i++){\n\t\t\tfilariBenefizio[i] = creaFilare(benefizio, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(nipozzano);\n\t\taziendaAgricolaDAO.saveLuogo(mormoreto);\n\t\taziendaAgricolaDAO.saveLuogo(montesodi);\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(pomino);\n\t\taziendaAgricolaDAO.saveLuogo(benefizio);\n\t\t\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Giulio d'Afflitto\"));\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Francesco Ermini\"));\n\n\t\t\n\t}",
"public abstract double getGen(int i);",
"synchronized public void reponerPapel() {\n\t\tRandom r = new Random();\n\t\tint hojas_repuestas = r.nextInt(20) + 10;\n\t\t\n\t\t// SE REPONEN LAS HOJAS\n\t\thojas_disponibles += hojas_repuestas;\n\t\tSystem.out.println(\"La impresora tenía \"+\n\t\t\t\thojas_disponibles + \" hojas y he repuesto \" + \n\t\t\t\thojas_repuestas + \". Ahora tiene \" +\n\t\t\t\t(hojas_disponibles + hojas_repuestas));\n\t\tnotify();\n\t}",
"private void genProb() {\n\t\tint row;\n\t\tint column;\n\t\tint removed1;\n\t\tint removed2;\n\n\t\tfor (int i = 0; i < DIFFICULTY / 2;) {\n\t\t\trow = rand.nextInt(9);\n\t\t\tcolumn = rand.nextInt(9);\n\t\t\twhile (problem[row][column] == 0 || (row == 4 && column == 4)) {\n\t\t\t\trow = rand.nextInt(9);\n\t\t\t\tcolumn = rand.nextInt(9);\n\t\t\t}\n\n\t\t\t// Clearing random boxes.\n\t\t\tremoved1 = problem[row][column];\n\t\t\tremoved2 = problem[8 - row][8 - column];\n\t\t\tproblem[row][column] = 0;\n\t\t\tproblem[8 - row][8 - column] = 0;\n\n\t\t\tcopy(problem, comp);\n\n\t\t\tif (!solve(0, 0, 0, comp)) { // Case of unsolvable.\n\t\t\t\t// Putting back original values.\n\t\t\t\tproblem[row][column] = removed1;\n\t\t\t\tproblem[8 - row][8 - column] = removed2;\n\t\t\t} else {\n\t\t\t\tif (unique()) { // Case of solution is unique.\n\t\t\t\t\ti++;\n\t\t\t\t} else { // Case of solution is not unique.\n\t\t\t\t\t// Putting back original values.\n\t\t\t\t\tproblem[row][column] = removed1;\n\t\t\t\t\tproblem[8 - row][8 - column] = removed2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private void createOriginalCSP (int[][] variables){\n\t\t\n\t\tnumberOfVariables = variables[0].length;\n\t\tchocoModel = new Model(\"OriginalCSP\");\n\t\tnumberOfProducts = variables.length;\n\t\tcreateNewVar(); // FIRST VAR is PRODUCT ID , varID = 0\n\t\t\n\t\tint varID =0;\n\t\t\n\t\tfor(int i=0;i<variables[0].length;i++){\n\t\t\tcreateNewVar(); // ADD FEATURE SET OF CAMERAS\n\t\t}\n\t\tallVarsAreCreated = true;\n\t\t\n\t\taddProductConstraints(variables);\n\t\t\n\t\t\n\t}",
"private static ArrayImg< UnsignedByteType, ByteArray > createLargeRectangularImage() {\n\t\tArrayImg< UnsignedByteType, ByteArray > img = ArrayImgs.unsignedBytes( 1024, 512 );\n\t\tfor ( int i = 0; i < 3; i++ ) {\n\t\t\tlong[] xmin = new long[] { 199 + i * 200, 0 };\n\t\t\tlong[] xmax = new long[] { 299 + i * 200, 511 };\n\t\t\tIntervalView< UnsignedByteType > iview = Views.interval( img, xmin, xmax );\n\t\t\tiview.forEach( pixel -> pixel.set( ( byte ) 255 ) );\n\t\t}\n\t\treturn img;\n\t}",
"PlateauGauffre(int largeur, int hauteur)\n {\n this(new Boolean[largeur][hauteur]);\n for (int x = 0; x < getLargeur(); x++)\n {\n for (int y = 0; y < getHauteur(); y++)\n {\n setAt(x, y, true);\n }\n }\n }",
"public void afficherLru() {\n\t\tint nbrCols = listEtape.size();\n\t\tint nbrRows = 0;\n\t\tfor(ArrayList<Processus> list: listEtape) {\n\t\t\tif(list.size() > nbrRows) nbrRows = list.size(); \n\t\t}\n\t\t\n\t\taddColsRows(resultPane, nbrCols+1, nbrRows);\n\t\taddPanelForResult(resultPane);\n\t\n\n\t\tresultPane.setStyle(\"-fx-background-color: #23CFDC\");\n\n\t\t// Affichage du résultat\n\t\tfor(int i=0; i< listEtape.size();i++) {\n\t\t\tArrayList<Processus> list = listEtape.get(i); \n\t\t\tfor(int j=0; j<list.size(); j++) {\n\t\t\t\tProcessus p = list.get(j); \n\t\t\t\tLabel label = new Label(\"\" + p.getValue());\n\n\t\t\t\tresultPane.add(label, i+1, j);\n\t\t\t\tGridPane.setHalignment(label, HPos.CENTER);\n\n\t\t\t}\n\t\t}\n\t\tresultPane.setVisible(true);\n\t\tgenere = true;\n\t}",
"public void generaClaves()\n {\n n = p.multiply(q);\n // ed = (p-1)*(q-1)\n ed = p.subtract(BigInteger.valueOf(1));\n ed = ed.multiply(q.subtract(BigInteger.valueOf(1)));\n // Elegimos un numero primo entre 1 menor que ed\n do e = new BigInteger(2 * tamPrimo, new Random());\n while((e.compareTo(ed) != -1) ||\n\t\t (e.gcd(ed).compareTo(BigInteger.valueOf(1)) != 0));\n // d = e^1 mod ed\n d = e.modInverse(ed);\n }",
"public ArrayList<Integer> obtenerYi(){\n ArrayList<Integer> res = new ArrayList<Integer>();\n int cont;\n \n for (float p:probabilidades){\n cont=0;\n while (Math.pow(base, cont)<1/p)\n cont++;\n res.add(cont);\n }\n return res;\n }",
"public void affichageLabyrinthe () {\n\t\t//Affiche le nombre de coups actuel sur la console et sur la fenetre graphique\n\t\tSystem.out.println(\"Nombre de coups : \" + this.laby.getNbCoups() + \"\\n\");\t\t\n\t\tthis.enTete.setText(\"Nombre de coups : \" + this.laby.getNbCoups());\n\n\t\t//Affichage dans la fenêtre et dans la console du labyrinthe case par case, et quand la case est celle ou se trouve le mineur, affiche ce dernier\n\t\tfor (int i = 0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tString ligne = new String();\n\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (i != this.laby.getMineur().getY() || j != this.laby.getMineur().getX()) {\n\t\t\t\t\tligne = ligne + this.laby.getLabyrinthe()[i][j].graphismeCase();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.laby.getLabyrinthe()[i][j]=new Case();\n\t\t\t\t\tligne = ligne + this.laby.getMineur().graphismeMineur();\n\t\t\t\t}\t\t\t\t\n\t\t\t\tif (grille.getComponentCount() < this.laby.getLargeur()*this.laby.getHauteur()) {\n\t\t\t\t\tgrille.add(new JLabel());\n\t\t\t\t\t((JLabel)grille.getComponents()[i*this.laby.getLargeur()+j]).setIcon(this.laby.getLabyrinthe()[i][j].imageCase(themeJeu));\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(ligne);\n\t\t}\n\t\t((JLabel)grille.getComponents()[this.laby.getMineur().getY()*this.laby.getLargeur()+this.laby.getMineur().getX()]).setIcon(this.laby.getMineur().imageCase(themeJeu));\n\t}",
"Lab create();",
"public Grille creationGrille() {\n\t\tList<Mot> listeMots = new ArrayList<Mot>();\r\n\r\n\t\t// Init de la liste de cases\r\n\t\tList<Case> cases = new ArrayList<Case>();\r\n\r\n\t\t// Init de la grille\r\n\t\tGrille grille = new Grille();\r\n\t\tgrille.setDifficulte(Difficulte.moyen);\r\n\r\n\t\t// Creation de la liste de mots\r\n\t\tlisteMots = creerListeMots(grille);\r\n\r\n\t\t// Creation de la liste de cases avec les mots/couleurs\r\n\t\tcases = creerListeCase(listeMots, grille);\r\n\r\n\t\t// affection de la liste de cases a la grille et inverse\r\n\t\tgrille.setCases(cases);\r\n\t\tdaoGrille.save(grille);\r\n\t\tfor (Case c : cases) {\r\n\t\t\tc.setGrille(grille);\r\n\t\t\tdaoCase.save(c);\r\n\t\t}\r\n\r\n\t\treturn grille;\r\n\r\n\t}",
"public Sort1LoopCloneProblem(int numReps){\n\t\tsetString(numReps);\n\t}",
"public int[][] MatrisKuralaUygun(int[][] girdi) {\n\t\tint Kontrol = 0; // cali hucreler kontrol etmek icin\r\n\t\tint[][] output = new int[girdi.length][girdi[0].length]; // [row][colum]\r\n\t\tfor (int i = 0; i < girdi.length; i++) {\r\n\t\t\tfor (int j = 0; j < girdi[0].length; j++) {\r\n\t\t\t\tfor (int k = 1; k < output[0].length - 1; k++) {// bu dongu tek seferlik calisir bir eklemek veya\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// cikarmak icin\r\n\t\t\t\t\tif (j < 3 && i == 0) {// burda 0'inci satir icin // [0][0] saginda ve altiginda bakildi\r\n\t\t\t\t\t\tif (j != 2) {// hepsi Kontrola toplaniyor\r\n\t\t\t\t\t\t\tKontrol += girdi[i][j + k];\r\n\t\t\t\t\t\t} // [0][1] saginda ve solunda ve altinda hucrelere bakildi\r\n\t\t\t\t\t\tKontrol += girdi[i + k][j];//\r\n\t\t\t\t\t\tif (j != 0) { // [0][2] sol ve alt hucrelere\r\n\t\t\t\t\t\t\tKontrol += girdi[i][j - k];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (i == 1 && j == 0) {// birinci satir sifirinci dikey\r\n\t\t\t\t\t\tKontrol += girdi[i][j + k];\r\n\t\t\t\t\t\tKontrol += girdi[i + k][j]; // [1][0] ust ve alt ve sag hucrelere bakildi\r\n\t\t\t\t\t\tKontrol += girdi[i - k][j];\r\n\t\t\t\t\t} else if ((i == 1 || i == 2) && (j == 2 || j == 1)) {\r\n\t\t\t\t\t\tKontrol += girdi[i][j - k];\r\n\t\t\t\t\t\tKontrol += girdi[i + k][j];// [1][1] hem ust ve alt ve sag ve sol hucrelere bakildi\r\n\t\t\t\t\t\tif (j != 2) {\r\n\t\t\t\t\t\t\tKontrol += girdi[i][j + k];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tKontrol += girdi[i - k][j];\r\n\r\n\t\t\t\t\t} else if (i == 3 && (j < 3)) {// 2'inci satir icin\r\n\t\t\t\t\t\tif (j != 0) {\r\n\t\t\t\t\t\t\tKontrol += girdi[i][j - k];\r\n\t\t\t\t\t\t} // [2][1] hem ust ve sag ve sol hucrelere bakildi\r\n\t\t\t\t\t\tKontrol += girdi[i - k][j];\r\n\r\n\t\t\t\t\t\tif (j != 2) {\r\n\t\t\t\t\t\t\tKontrol += girdi[i][j + k];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (girdi[i][j] == 1 && Kontrol < 2) { // canli ise ve kontrol 2 den az ise\r\n\t\t\t\t\toutput[i][j] = 0;// sifir yazdir\r\n\t\t\t\t\tKontrol = 0;// Kontrol sifirlamamiz cok onemli yoksa kontrol hem artar\r\n\t\t\t\t} else if (girdi[i][j] == 1 && (Kontrol == 2 || Kontrol == 3)) { // canli ise ve kontrol 2 ve 3 ise\r\n\t\t\t\t\toutput[i][j] = 1;\r\n\t\t\t\t\tKontrol = 0;// burda onemli\r\n\t\t\t\t} else if (girdi[i][j] == 1 && Kontrol > 3) { // canli ise ve kontrol 3 den cok ise\r\n\t\t\t\t\toutput[i][j] = 0;\r\n\t\t\t\t\tKontrol = 0;\r\n\t\t\t\t} else if (girdi[i][j] == 0 && Kontrol == 3) { // canli ise ve kontrol 3 ise\r\n\t\t\t\t\toutput[i][j] = 1;\r\n\t\t\t\t\tKontrol = 0;\r\n\t\t\t\t} else {\r\n\t\t\t\t\toutput[i][j] = girdi[i][j];// eger yukardaki kosulari girilmedi ise aynisi yazdir\r\n\r\n\t\t\t\t\tKontrol = 0;// ve yine Kontrol sifir\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn output;// dizi donduruyor\r\n\r\n\t}",
"private void creaModuloMem() {\n /* variabili e costanti locali di lavoro */\n ArrayList<Campo> campi = new ArrayList<Campo>();\n ModuloRisultati modulo;\n Campo campo;\n\n try { // prova ad eseguire il codice\n\n campo = CampoFactory.intero(Campi.Ris.codicePiatto.getNome());\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.nomePiatto.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"piatto\");\n campo.setToolTipLista(\"nome del piatto\");\n campo.decora()\n .etichetta(\"nome del piatto\"); // le etichette servono per il dialogo ricerca\n campo.setLarghezza(250);\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.categoria.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"categoria\");\n campo.setToolTipLista(\"categoria del piatto\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteVolte.getNome());\n campo.setVisibileVistaDefault();\n campo.setLarghezza(80);\n campo.setTitoloColonna(\"quante volte\");\n campo.setToolTipLista(\n \"quante volte questo piatto è stato offerto nel periodo analizzato\");\n campo.decora().etichetta(\"quante volte\");\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quantiCoperti.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"coperti\");\n campo.setToolTipLista(\"numero di coperti che avrebbero potuto ordinare\");\n campo.decora().etichetta(\"n. coperti\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteComande.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"comande\");\n campo.setToolTipLista(\"numero di comande effettive\");\n campo.decora().etichetta(\"n. comande\");\n campo.setLarghezza(80);\n campo.setTotalizzabile(true);\n campi.add(campo);\n\n campo = CampoFactory.percentuale(Campi.Ris.gradimento.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"gradimento\");\n campo.setToolTipLista(\n \"percentuale di gradimento (è il 100% se tutti i coperti potenziali lo hanno ordinato)\");\n campo.decora().etichetta(\"% gradimento\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n modulo = new ModuloRisultati(campi);\n setModuloRisultati(modulo);\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n }",
"public void testLiangFigure6() {\n int[] a = {0, 0, 0, 0, 1, 1, 1, 1};\n int[] b = {0, 0, 1, 1, 0, 0, 1, 1};\n int[] c = {0, 1, 0, 1, 0, 1, 0, 1};\n int[] ap = {0, 0, 1, 1, 0, 0, 1, 1};\n int[] bp = {0, 1, 0, 1, 1, 1, 1, 1};\n int[] cp = {0, 0, 0, 1, 0, 1, 1, 1};\n\n for (int i = 0; i < ntimes - 1; i++) {\n cases[i][0] = a[i];\n cases[i][1] = b[i];\n cases[i][2] = c[i];\n cases[i + 1][3] = ap[i];\n cases[i + 1][4] = bp[i];\n cases[i + 1][5] = cp[i];\n }\n cases[8][0] = 0;\n cases[8][1] = 0;\n cases[8][2] = 0;\n cases[0][3] = 0;\n cases[0][4] = 0;\n cases[0][5] = 0;\n\n RevealEvaluator re = new RevealEvaluator(cases);\n\n double rea = re.entropy(a);\n assertEquals(1.0, rea, TOLERANCE);\n System.out.println(\"H(a) = \" + rea); //Should be 1.0\n\n double reb = re.entropy(b);\n assertEquals(1.0, reb, TOLERANCE);\n System.out.println(\"H(b) = \" + reb); //Should be 1.0\n\n double rec = re.entropy(c);\n assertEquals(1.0, rec, TOLERANCE);\n System.out.println(\"H(c) = \" + rec); //Should be 1.0\n\n double reab = re.jointEntropy(a, b);\n assertEquals(2.0, reab, TOLERANCE);\n System.out.println(\"H(a,b) = \" + reab); //Should be 2.0\n\n double reap = re.entropy(ap);\n assertEquals(1.0, reap, TOLERANCE);\n System.out.println(\"H(ap) = \" + reap); //Should be 1.0\n\n double rebp = re.entropy(bp);\n assertEquals(0.8112781244591328, rebp, TOLERANCE);\n System.out.println(\"H(bp) = \" + rebp); //Should be 0.8112781244591328\n\n double recp = re.entropy(cp);\n assertEquals(1.0, recp, TOLERANCE);\n System.out.println(\"H(cp) = \" + recp); //Should be 1.0\n\n double reapa = re.jointEntropy(ap, a);\n assertEquals(2.0, reapa, TOLERANCE);\n System.out.println(\"H(ap, a) = \" + reapa); //Should be 2.0\n\n double rebpb = re.jointEntropy(bp, b);\n assertEquals(1.8112781244591327, rebpb, TOLERANCE);\n System.out.println(\n \"H(bp, b) = \" + rebpb); //Should be 1.8112781244591327\n\n double recpb = re.jointEntropy(cp, b);\n assertEquals(1.8112781244591327, recpb, TOLERANCE);\n System.out.println(\n \"H(cp, b) = \" + recpb); //Should be 1.8112781244591327\n\n int[][] ab = new int[2][8];\n for (int i = 0; i < 8; i++) {\n ab[0][i] = a[i];\n ab[1][i] = b[i];\n }\n\n double rebpab = re.jointEntropy(bp, ab);\n assertEquals(2.5, rebpab, TOLERANCE);\n System.out.println(\"H(bp, a, b) = \" + rebpab); //Should be 2.5\n\n double recpab = re.jointEntropy(cp, ab);\n assertEquals(2.5, recpab, TOLERANCE);\n System.out.println(\"H(cp, a, b) = \" + recpab); //Should be 2.5\n\n int[][] abc = new int[3][8];\n for (int i = 0; i < 8; i++) {\n abc[0][i] = a[i];\n abc[1][i] = b[i];\n abc[2][i] = c[i];\n }\n\n double recpabc = re.jointEntropy(cp, abc);\n assertEquals(3.0, recpabc, TOLERANCE);\n System.out.println(\"H(cp, a, b, c) = \" + recpabc); //Should be 3.0\n\n //Setup array cases and test mutualInformation\n int[] p = new int[1];\n p[0] = 0;\n\n double rembpa = re.mutualInformation(4, p, 1);\n assertEquals(0.31127812445913294, rembpa, TOLERANCE);\n System.out.println(\n \"M(Bp, A) = \" + rembpa); //Should be 0.31127812445913294\n\n int[] pp = new int[2];\n pp[0] = 0;\n pp[1] = 1;\n\n double rmcpab = re.mutualInformation(5, pp, 1);\n assertEquals(0.5, rmcpab, TOLERANCE);\n System.out.println(\"M(Cp, [A,B]) = \" + rmcpab); //Should be 0.5\n\n int[] ppp = new int[3];\n ppp[0] = 0;\n ppp[1] = 1;\n ppp[2] = 2;\n\n double rmcpabc = re.mutualInformation(5, ppp, 1);\n assertEquals(1.0, rmcpabc, TOLERANCE);\n System.out.println(\"M(Cp, [A,B,C]) = \" + rmcpabc); //Should be 1.0\n\n }",
"@Override\n\tpublic void addRep(ImgRep ir) {\n\t\tdao.insert(ir);\n\t}",
"private int aleatorizarNaipe() {\n\t\tint aux;\n\t\taux = r.getIntRand(4);\n\t\treturn aux;\n\t}",
"public void rellenarTerreno() {\n Random rnd = new Random();\r\n int restante = V;\r\n int[][] aux = terreno;\r\n do {\r\n for (int i = 0; i < Filas; i++) {\r\n for (int j = 0; j < Columnas; j++) {\r\n if (restante > max) {\r\n int peso = rnd.nextInt(max);\r\n if (aux[i][j] + peso <= max) {\r\n aux[i][j] += peso;\r\n restante -= peso;\r\n }\r\n } else {\r\n if (aux[i][j] + restante <= max) {\r\n aux[i][j] += restante;\r\n restante = 0;\r\n }\r\n }\r\n }\r\n }\r\n } while (restante != 0);\r\n }",
"public Retangulo(double[] pLados) {\n super(pLados);\n /* invoca o construtor da classe Pai passando pLados como parametros. */\n }",
"public Tribute()\n {\n vectOfCoef = new Vector<Double>(numOfCoef);\n for(int x =0; x < numOfCoef; x++)\n {\n vectOfCoef.addElement((Math.random() * 2) - 1);\n }\n }",
"public VOIVector(int initialsize) {\r\n super(initialsize);\r\n }",
"public int[] ejecSimulador(){\n\t\t\n\t\tint ruedas[] = new int[2]; //Izda-Dcha\n\t\t\n\t\t/* Por defecto, giro a la izquierda */\n\t\tswitch(factor){\n\t\tcase 1: //Giro muy debil\n\t\t\truedas[0] = 0;\n\t\t\truedas[1] = 10;\n\t\t\tbreak;\n\t\tcase 2: //Giro debil\n\t\t\truedas[0] = 0;\n\t\t\truedas[1] = 20;\n\t\t\tbreak;\n\t\tcase 3: //Giro normal\n\t\t\truedas[0] = 0;\n\t\t\truedas[1] = 30;\n\t\t\tbreak;\n\t\tcase 4: //Giro fuerte\n\t\t\truedas[0] = 0;\n\t\t\truedas[1] = 40;\n\t\t\tbreak;\n\t\tcase 5: //Giro muy fuerte\n\t\t\truedas[0] = 0;\n\t\t\truedas[1] = 50;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\truedas[0] = 0;\n\t\t\truedas[1] = 0;\n\t\t}\n\t\t\n\t\tif(!izquierda){ //Si giro a la derecha, cambio de ruedas\n\t\t\tint aux = ruedas[0];\n\t\t\truedas[0] = ruedas[1];\n\t\t\truedas[1] = aux;\n\t\t}\n\t\t\n\t\treturn ruedas;\n\t}",
"@Override\n\tpublic Spielfeld clone() {\n\t\tint[] mulden = new int[this.getMulden().length];\n\t\t\n\t\tfor(int i = 0; i < this.getMulden().length; i++) {\n\t\t\tmulden[i] = this.getMulden()[i];\n\t\t}\n\t\t\n\t\treturn new Spielfeld(mulden);\n\t}",
"LengthDistinct createLengthDistinct();",
"public static Ally getRandomRep () {\n return republican[(int) (Math.random() * republican.length)];\n }",
"@Override\n protected int getNumRepetitions() {\n return 1;\n }",
"private String creaElenco() {\n String testoTabella ;\n String riga = CostBio.VUOTO;\n ArrayList listaPagine = new ArrayList();\n ArrayList listaRiga;\n HashMap mappaTavola = new HashMap();\n String cognomeText;\n int num;\n int taglioPagine = Pref.getInt(CostBio.TAGLIO_COGNOMI_PAGINA);\n String tag = \"Persone di cognome \";\n ArrayList titoli = new ArrayList();\n titoli.add(LibWiki.setBold(\"Cognome\"));\n titoli.add(LibWiki.setBold(\"Voci\"));\n\n for (Map.Entry<String, Integer> mappa: mappaCognomi.entrySet()) {\n\n cognomeText = mappa.getKey();\n num = mappa.getValue();\n if (num >= taglioPagine) {\n cognomeText = tag + cognomeText + CostBio.PIPE + cognomeText;\n cognomeText = LibWiki.setQuadre(cognomeText);\n cognomeText = LibWiki.setBold(cognomeText);\n }// end of if cycle\n\n listaRiga = new ArrayList();\n listaRiga.add(cognomeText);\n listaRiga.add(num);\n listaPagine.add(listaRiga);\n\n }// end of for cycle\n mappaTavola.put(Cost.KEY_MAPPA_SORTABLE_BOOLEAN, true);\n mappaTavola.put(Cost.KEY_MAPPA_TITOLI, titoli);\n mappaTavola.put(Cost.KEY_MAPPA_RIGHE_LISTA, listaPagine);\n testoTabella = LibWiki.creaTable(mappaTavola);\n\n return testoTabella;\n }",
"public java.util.Vector getVecReplicateData() {\r\n return vecReplicateData;\r\n }",
"@Override\n public void setSuitNum(int total, int normal, int taobao, int imgs) {\n }",
"@Override\n public Proposal propose(Random rand)\n {\n \n savedValue = variable.getIntegerValue();\n double [] incrementIdx = Multinomial.generate(rand, 1, \n uniformDiscreteProbs(NUM_STATES));\n double [] stepsVector = steps(NUM_STATES);\n \n int increment = 0; \n \n for(int i = 0; i < (2 * NUM_STATES); i++)\n increment += (int) incrementIdx[i] * stepsVector[i];\n \n final int newValue = savedValue + increment;\n variable.setValue(newValue);\n return new ProposalRealization();\n }",
"public void createListData()\n {\n List<SinhVien> listSinhvien=new ArrayList<>();\n for(int i=0;i<10;i++){\n SinhVien sv=new SinhVien(i+\"\",\"123\",\"0123\",i+1.0f);\n listSinhvien.add(sv);\n }\n PresenterImplDangXuat.onLoadSucess(listSinhvien);\n }",
"@Test(timeout = 4000)\n public void test01() throws Throwable {\n Discretize discretize0 = new Discretize(\"c9^n/\");\n discretize0.getCapabilities();\n assertFalse(discretize0.getFindNumBins());\n assertFalse(discretize0.getUseBinNumbers());\n assertFalse(discretize0.getUseEqualFrequency());\n assertEquals((-1.0), discretize0.getDesiredWeightOfInstancesPerInterval(), 0.01);\n assertEquals(10, discretize0.getBins());\n assertFalse(discretize0.getMakeBinary());\n }",
"@Test(timeout = 4000)\n public void test12() throws Throwable {\n Discretize discretize0 = new Discretize();\n String string0 = discretize0.getRevision();\n assertEquals(\"8964\", string0);\n assertFalse(discretize0.getUseEqualFrequency());\n assertFalse(discretize0.getUseBinNumbers());\n assertFalse(discretize0.getFindNumBins());\n assertEquals(10, discretize0.getBins());\n assertFalse(discretize0.getMakeBinary());\n assertEquals((-1.0), discretize0.getDesiredWeightOfInstancesPerInterval(), 0.01);\n }",
"public Regras()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1100, 457, 1); \n prepare();\n if(MenuPrincipal.mundo == 1) //se o mundo anterior tiver sido MenuPrincipal\n som1 = MenuPrincipal.som2; //a música ficar com a mesma opção do mundo Menu Principal (a tocar ou sem som)}\n else if(MenuPrincipal.mundo == 3) //se o mundo anterior tiver sido MundoJogo\n som1 = MundoJogo.som3; //a música ficar com a mesma opção do mundo MundoJogo (a tocar ou sem som)\n imgsom2 = MenuPrincipal.imgsom1; //atualiza a imagem da coluna para ser igual à do mundo MenuPrincipal (mute/unmute)\n MenuPrincipal.mundo = 2; //atualizar 'mundo' para indicar que o mundo atual é o mundo Regras\n }",
"SintagmaPreposicional createSintagmaPreposicional();",
"public static Double[] simulerBinomiale(Double nbRep, Double proba, Double repetition) {\n\t\tBinomiale loi = new Binomiale(proba, nbRep, repetition);\n\t\treturn loi.simuler();\n\t}",
"private void creaPannelli() {\n /* variabili e costanti locali di lavoro */\n Pannello pan;\n\n try { // prova ad eseguire il codice\n\n /* pannello date */\n pan = this.creaPanDate();\n this.addPannello(pan);\n\n /* pannello coperti */\n PanCoperti panCoperti = new PanCoperti();\n this.setPanCoperti(panCoperti);\n this.addPannello(panCoperti);\n\n\n /* pannello placeholder per il Navigatore risultati */\n /* il navigatore vi viene inserito in fase di inizializzazione */\n pan = new PannelloFlusso(Layout.ORIENTAMENTO_ORIZZONTALE);\n this.setPanNavigatore(pan);\n this.addPannello(pan);\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n }",
"@Test(timeout = 4000)\n public void test26() throws Throwable {\n Discretize discretize0 = new Discretize();\n discretize0.m_FindNumBins = true;\n int[] intArray0 = new int[6];\n intArray0[0] = (-388);\n intArray0[1] = (-2121610348);\n intArray0[2] = 11;\n intArray0[3] = (-1);\n intArray0[4] = 1062;\n intArray0[5] = 70;\n discretize0.setAttributeIndicesArray(intArray0);\n discretize0.setDesiredWeightOfInstancesPerInterval((-1149.15832593));\n discretize0.getOptions();\n assertEquals((-1149.15832593), discretize0.getDesiredWeightOfInstancesPerInterval(), 0.01);\n }",
"public DDCountInversion(){\n\t\tnumeros = new ArrayList<Integer>();\n\t}",
"@Test(timeout = 4000)\n public void test08() throws Throwable {\n Discretize discretize0 = new Discretize(\"Incorrect Multi-Instance format, must be 'NOMINAL att, RELATIONAL att, CLASS att'!\");\n discretize0.m_UseBinNumbers = false;\n discretize0.m_IgnoreClass = true;\n discretize0.getCutPoints(0);\n discretize0.desiredWeightOfInstancesPerIntervalTipText();\n assertFalse(discretize0.getFindNumBins());\n \n discretize0.setFindNumBins(true);\n assertTrue(discretize0.getFindNumBins());\n }",
"public final void mo23206tL(int i) {\n AppMethodBeat.m2504i(18979);\n C11486d.this.kIr = false;\n C9638aw.m17190ZK();\n C7580z Ry = C18628c.m29072Ry();\n C11486d.this.kIv = System.currentTimeMillis();\n if (i == 0) {\n Ry.setLong(237569, C11486d.this.kIv);\n if (z) {\n C11486d.this.kIw = C11486d.this.kIw + 1;\n } else {\n C11486d.this.kIw = 0;\n }\n Ry.setInt(237570, C11486d.this.kIw);\n } else {\n if (i != 1) {\n Ry.setLong(237569, C11486d.this.kIv);\n if (z) {\n C11486d.this.kIw = 10;\n Ry.setInt(237570, C11486d.this.kIw);\n }\n }\n AppMethodBeat.m2505o(18979);\n }\n Ry.dsb();\n AppMethodBeat.m2505o(18979);\n }",
"@Test(timeout = 4000)\n public void test05() throws Throwable {\n Discretize discretize0 = new Discretize(\"^yH*RVC#\\\"|tm,k2XpGN\");\n String[] stringArray0 = new String[2];\n discretize0.m_ClassIndex = 906;\n discretize0.m_IgnoreClass = true;\n stringArray0[0] = \"^yH*RVC#\\\"|tm,k2XpGN\";\n stringArray0[1] = \"^yH*RVC#\\\"|tm,k2XpGN\";\n discretize0.setOptions(stringArray0);\n discretize0.setAttributeIndices(\"^yH*RVC#\\\"|tm,k2XpGN\");\n assertFalse(discretize0.getMakeBinary());\n assertFalse(discretize0.getUseEqualFrequency());\n assertFalse(discretize0.getUseBinNumbers());\n assertEquals(10, discretize0.getBins());\n assertEquals((-1.0), discretize0.getDesiredWeightOfInstancesPerInterval(), 0.01);\n assertFalse(discretize0.getFindNumBins());\n }",
"public Nodo_m_ario(Nodo_m_ario padre, int val, int m) {\n\t\tchiave = val;\n\t\tgrado = m;\n\t\tthis.padre = padre;\n\t\tfigli = new Nodo_m_ario[grado];\n\t\tradice = false;\n\t}",
"Dimension_hauteur createDimension_hauteur();",
"private void resampleAbdomenVOI() {\r\n VOIVector vois = abdomenImage.getVOIs();\r\n VOI theVOI = vois.get(0);\r\n\r\n VOIContour curve = ((VOIContour)theVOI.getCurves().get(0));\r\n \r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM();\r\n int xcm = centerOfMass[0];\r\n int ycm = centerOfMass[1];\r\n// ViewUserInterface.getReference().getMessageFrame().append(\"Xcm: \" +xcm +\" Ycm: \" +ycm);\r\n \r\n\r\n ArrayList<Integer> xValsAbdomenVOI = new ArrayList<Integer>();\r\n ArrayList<Integer> yValsAbdomenVOI = new ArrayList<Integer>();\r\n\r\n // angle in radians\r\n double angleRad;\r\n \r\n for (int angle = 0; angle < 360; angle += angularResolution) {\r\n int x = xcm;\r\n int y = ycm;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n // increment x each step\r\n scaleFactor = Math.tan(angleRad);\r\n while (x < xDim && curve.contains(x, y)) {\r\n \r\n // walk out in x and compute the value of y for the given radial line\r\n x++;\r\n y = ycm - (int)((x - xcm) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n // decrement y each step\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n while (y > 0 && curve.contains(x, y)) {\r\n\r\n // walk to the top of the image and compute values of x for the given radial line\r\n y--;\r\n x = xcm + (int)((ycm - y) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n // decrement x each step\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n while (x > 0 && curve.contains(x, y)) {\r\n \r\n x--;\r\n y = ycm - (int)((xcm - x) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n\r\n } else if (angle > 225 && angle <= 315) {\r\n // increment y each step\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n while (y < yDim && curve.contains(x, y)) {\r\n \r\n y++;\r\n x = xcm - (int)((y - ycm) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n }\r\n } // end for (angle = 0; ...\r\n \r\n// ViewUserInterface.getReference().getMessageFrame().append(\"resample VOI number of points: \" +xValsAbdomenVOI.size());\r\n curve.clear();\r\n for(int idx = 0; idx < xValsAbdomenVOI.size(); idx++) {\r\n curve.add( new Vector3f( xValsAbdomenVOI.get(idx), yValsAbdomenVOI.get(idx), 0 ) );\r\n }\r\n }",
"@DataProvider(name = \"factorial\")\n private Object[][] factorialProvider() {\n return new Object[][]{\n {0, 1},\n {1, 1},\n {2, 2},\n {5, 120},\n {10, 3628800}\n };\n }",
"public void generaNumeros() {\n\n\n int number =0;\n int numeroSeleccionado=gameMemoriaUno.getNumberaleatorio();\n //se agrega numero a las lista de numeros\n\n if(numeroSeleccionado == -1){\n llamaResultado(super.getActividad(), tFinal, tInicio, Num3_5_1Activity.class,gameMemoriaUno.getNumeros(),gameMemoriaUno.getAciertosTotales(),gameMemoriaUno.getFallosTotales(),gameMemoriaUno.getNumEcxluidosList(),gameMemoriaUno.getNumeroPregunta());\n\n }else {\n\n\n gameMemoriaUno.addNumerosSet(numeroSeleccionado);\n for (int i = 1; i < 6; i++) {\n //obtiene numeros del costalito menos el numero seleccionado\n number = gameMemoriaUno.getNumeroArreglo();\n //agrego numeros\n gameMemoriaUno.addNumerosSet(number);\n }\n\n Iterator<Integer> iter = gameMemoriaUno.getNumerosSet().iterator();\n\n int contadorNumeros=0;\n while (iter.hasNext()) {\n int valor=iter.next().intValue();\n lista.add(valor);\n if(gameMemoriaUno.getDificultad()==contadorNumeros){\n gameMemoriaUno.setNumerosElejidos(new int[valor]);\n }\n\n contadorNumeros+=1;\n }\n Collections.shuffle(lista, new Random());\n Collections.shuffle(lista, new Random());\n\n\n\n }\n\n\n }",
"public static Double[][] simulerUniforme(ArrayList<Double> listValeurs, Double repetition) {\n\t\tDouble[] tab = convertirTableau(listValeurs);\n\t\tUniforme loi = new Uniforme(tab);\n\t\treturn loi.simuler(repetition);\n\t}",
"public Mueble(String nombre_mueble_ensamble, Double precio) {\n this.nombre_mueble_ensamble = nombre_mueble_ensamble;\n this.precio = precio;\n }",
"SpaceInvaderTest_test_VaisseauAvancePartiellement_DeplacerVaisseauVersLaDroite createSpaceInvaderTest_test_VaisseauAvancePartiellement_DeplacerVaisseauVersLaDroite();",
"public void create () {\n // TODO random generation of a ~100 x 100 x 100 world\n }",
"public Jugador(int dorsal)\n {\n Random rmd = new Random();\n edad = rmd.nextInt(23)+18 ;\n estadoForma = rmd.nextInt(11);\n int nom = rmd.nextInt(33);\n Nombres nomb = new Nombres();\n nombre = nomb.getNombre(nom);\n this.dorsal = dorsal;\n this.nombre = nombre;\n }"
] | [
"0.5794331",
"0.5591754",
"0.5453389",
"0.53690535",
"0.53578687",
"0.53578687",
"0.5355831",
"0.5352239",
"0.53099424",
"0.5289072",
"0.5275177",
"0.52490765",
"0.5214281",
"0.52093893",
"0.5204569",
"0.51649696",
"0.51370996",
"0.5091277",
"0.509043",
"0.50812835",
"0.5079305",
"0.50706047",
"0.5069941",
"0.50651705",
"0.50551814",
"0.5048806",
"0.50422806",
"0.5036154",
"0.50162035",
"0.5009461",
"0.50069964",
"0.4993379",
"0.4987009",
"0.4986279",
"0.49665958",
"0.49646425",
"0.49641517",
"0.4959674",
"0.49578628",
"0.49559504",
"0.4954555",
"0.4953886",
"0.4952487",
"0.494633",
"0.4945718",
"0.49389142",
"0.49335355",
"0.49332684",
"0.4915492",
"0.49092633",
"0.49082136",
"0.49080166",
"0.49035025",
"0.49020815",
"0.4900119",
"0.48940226",
"0.48913467",
"0.4890448",
"0.48856252",
"0.4881169",
"0.48768315",
"0.48734355",
"0.48608857",
"0.48608643",
"0.48553696",
"0.48235348",
"0.48225215",
"0.48221856",
"0.48220187",
"0.48195338",
"0.48173088",
"0.48104164",
"0.4803123",
"0.47986713",
"0.47956133",
"0.47936547",
"0.47932076",
"0.47906512",
"0.47873762",
"0.47870028",
"0.4785049",
"0.47840992",
"0.4779184",
"0.4775752",
"0.4774813",
"0.4773649",
"0.47727466",
"0.47680804",
"0.47670305",
"0.4763761",
"0.47614563",
"0.47591764",
"0.4756696",
"0.4755271",
"0.47519135",
"0.47508863",
"0.47411487",
"0.47408524",
"0.4739369",
"0.47355026"
] | 0.58779514 | 0 |
Creer une loi Normale Puis simule la loi en simulant nbRep valeurs | public static Double[] simulerNormale(Double esperance, Double variance, Double repetition) {
Normale loi = new Normale(esperance, variance);
return loi.simuler(repetition);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int initialiser()\n\t{\n\n\t\tint nombreE;\n\t\tint k = 0;\n\t\t//int max = randInt(2,10);\n\t\ttableauPeres_ = new Case[longueur_][longueur_];\n\t\tint i, j = 0;\n\t\tfor(i=0; i<longueur_; ++i)\n\t\t{\n\t\t\tfor(j=0; j<longueur_; ++j)\n\t\t\t{\n\t\t\t\ttableauPeres_[i][j] = new Case(i, j, 0);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Combien d'étoiles souhaitez vous pour chaque joueur ?\");\n\t\tnombreE = clavier.nextInt();\n\t\twhile (k < nombreE)\n\t\t{\n\t\t\taddEtoile(\"bleu\");\n\t\t\taddEtoile(\"rouge\");\n\t\t\t++k;\n\t\t}\n\t\treturn nombreE;\n\t}",
"public Plateau(int largeur, int hauteur) {\r\n\t\tplateau = new Cellule[hauteur][largeur];\r\n\t\tint equipe = 1;\r\n\t\tfor (int i=0; i<hauteur; i++) {\r\n\t\t\tfor (int j=0; j<largeur; j++) {\r\n\t\t\t\tif ((i == 0 && j == 0) || (i == hauteur-1 && j == largeur -1))\r\n\t\t\t\t\tplateau[i][j] = new Base(j,i,equipe++);\r\n\t\t\t\telse\r\n\t\t\t\t\tplateau[i][j] = new Case(j,i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.hauteur = hauteur;\r\n\t\tthis.largeur = largeur;\r\n\t}",
"public void Nouvelleligne() {\n int maxEleve = retourneMaxNumber() + 1;\n try {\n Connector1.statement.executeUpdate(\"Insert INTO eleve(id_el) VALUES (\" + maxEleve + \")\");\n Object[] val = {maxEleve, \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"};\n effaceTable(jTable2, mode);\n mode.addRow(val);\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"ERROR \\n\" + e.getMessage());\n\n }\n\n }",
"public void afficherLru() {\n\t\tint nbrCols = listEtape.size();\n\t\tint nbrRows = 0;\n\t\tfor(ArrayList<Processus> list: listEtape) {\n\t\t\tif(list.size() > nbrRows) nbrRows = list.size(); \n\t\t}\n\t\t\n\t\taddColsRows(resultPane, nbrCols+1, nbrRows);\n\t\taddPanelForResult(resultPane);\n\t\n\n\t\tresultPane.setStyle(\"-fx-background-color: #23CFDC\");\n\n\t\t// Affichage du résultat\n\t\tfor(int i=0; i< listEtape.size();i++) {\n\t\t\tArrayList<Processus> list = listEtape.get(i); \n\t\t\tfor(int j=0; j<list.size(); j++) {\n\t\t\t\tProcessus p = list.get(j); \n\t\t\t\tLabel label = new Label(\"\" + p.getValue());\n\n\t\t\t\tresultPane.add(label, i+1, j);\n\t\t\t\tGridPane.setHalignment(label, HPos.CENTER);\n\n\t\t\t}\n\t\t}\n\t\tresultPane.setVisible(true);\n\t\tgenere = true;\n\t}",
"@Test(timeout = 4000)\n public void test42() throws Throwable {\n NaiveBayesMultinomialText naiveBayesMultinomialText0 = new NaiveBayesMultinomialText();\n naiveBayesMultinomialText0.setLNorm(551.149718887);\n assertEquals(551.149718887, naiveBayesMultinomialText0.getLNorm(), 0.01);\n }",
"@Test(timeout = 4000)\n public void test13() throws Throwable {\n NaiveBayesMultinomialText naiveBayesMultinomialText0 = new NaiveBayesMultinomialText();\n assertEquals(2.0, naiveBayesMultinomialText0.getLNorm(), 0.01);\n \n naiveBayesMultinomialText0.setLNorm(0);\n double double0 = naiveBayesMultinomialText0.getLNorm();\n assertEquals(0.0, double0, 0.01);\n }",
"@Test(timeout = 4000)\n public void test14() throws Throwable {\n NaiveBayesMultinomialText naiveBayesMultinomialText0 = new NaiveBayesMultinomialText();\n naiveBayesMultinomialText0.m_lnorm = (double) (-2);\n double double0 = naiveBayesMultinomialText0.getLNorm();\n assertEquals((-2.0), double0, 0.01);\n }",
"Vaisseau_ordonneeLaPlusBasse createVaisseau_ordonneeLaPlusBasse();",
"private void generisiPolje() {\r\n\t\tint polje = rnd.nextInt(broj_slobodnih);\r\n\t\tint vrijednost = rnd.nextInt(4);\r\n\t\tif(vrijednost == 0)\r\n\t\t\tvrijednost = 4;\r\n\t\telse\r\n\t\t\tvrijednost = 2;\r\n\t\t\r\n\t\tint brojac = 0;\r\n\t\tfor(int i = 0 ; i < 4 ; i++)\r\n\t\t\tfor(int j = 0 ; j < 4 ; j++) {\r\n\t\t\t\tif(tabela[i][j] == 0) {\r\n\t\t\t\t\tif(brojac == polje)\r\n\t\t\t\t\t\ttabela[i][j] = vrijednost;\r\n\t\t\t\t\tbrojac++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tbroj_slobodnih--;\r\n\t}",
"public void MakeRep(int type, int min, int max)\n\t{\n\t\t_type += (type - One);\n\t\t_m = min;\n\t\t_n = max;\n\t}",
"Vaisseau_longueur createVaisseau_longueur();",
"@Override\n public Vehicule creer(String immatriculation, String marque, String modele, Client client, int tonnage, int hauteur) {\n return new Camion(immatriculation,marque,modele,client,tonnage,hauteur);\n }",
"public void creation(){\n\t for(int i=0; i<N;i++) {\r\n\t\t for(int j=0; j<N;j++) {\r\n\t\t\t tab[i][j]=0;\r\n\t\t }\r\n\t }\r\n\t resDiagonale(); \r\n \r\n\t //On remplit le reste \r\n\t conclusionRes(0, nCarre); \r\n \t\t\r\n\t \r\n\t isDone=true;\r\n }",
"public MVCModelo(int capacidad)\n\t{\n\t\tllave = \"\";\n\t\tvalue = 0.0;\n\t}",
"@Test(timeout = 4000)\n public void test10() throws Throwable {\n NaiveBayesMultinomialText naiveBayesMultinomialText0 = new NaiveBayesMultinomialText();\n assertEquals(1.0, naiveBayesMultinomialText0.getNorm(), 0.01);\n \n naiveBayesMultinomialText0.setNorm(0.0);\n double double0 = naiveBayesMultinomialText0.getNorm();\n assertEquals(0.0, double0, 0.01);\n }",
"public DeuxiemeFenetreLucrative() {\n initComponents();\n }",
"public Voluntario() {\n super();\n this.livre = true;\n this.raio = 0;\n this.avaliacao = 0;\n this.numreviews = 0;\n\n //this.historico = new ArrayList<>() ;\n }",
"public nhanvien() {\n initComponents();\n laysodong();\n if(count % 5 ==0 )\n {\n sotrang = count/5;\n }\n else\n {\n sotrang=count/5 + 1;\n }\n DAO_NV.dolentable(tblnhanvien,1);\n lbltrang.setText(\"1\");\n lblsotrang.setText(\"1/\"+sotrang);\n jButton3.setEnabled(false);\n jButton1.setEnabled(false);\n \n \n \n \n\n }",
"Vaisseau_ordonneeLaPlusHaute createVaisseau_ordonneeLaPlusHaute();",
"public void creationPlateau() {\n for (int i = 0; i < 10; i++) {\n int X = rand.nextInt(14);\n int Y = rand.nextInt(14);\n if (plateau[X][Y] == null && espacementMonstre(X,Y,plateau)) {\n int monstreAleatoire = 1 + (int)(Math.random() * ((3 - 1) + 1));\n switch (monstreAleatoire) {\n case 1:\n Personnage monstreD = new Dragonnet(X,Y);\n plateau[X][Y] = monstreD;\n this.monstre.add(monstreD);\n System.out.println(\"Dragonnet ajouté en position : \"+X+\" \"+Y);\n break;\n case 2:\n Personnage monstreL = new Loup(X,Y);\n plateau[X][Y] = monstreL;\n this.monstre.add(monstreL);\n System.out.println(\"Loup ajouté en position : \"+X+\" \"+Y);\n\n break;\n case 3:\n Personnage monstreO = new Orque(X,Y);\n plateau[X][Y] = monstreO;\n this.monstre.add(monstreO);\n System.out.println(\"Orque ajouté en position : \"+X+\" \"+Y);\n break;\n }\n } else {\n i --;\n }\n }\n }",
"public Sort1LoopCloneProblem(int numReps){\n\t\tsetString(numReps);\n\t}",
"public void affichageLabyrinthe () {\n\t\t//Affiche le nombre de coups actuel sur la console et sur la fenetre graphique\n\t\tSystem.out.println(\"Nombre de coups : \" + this.laby.getNbCoups() + \"\\n\");\t\t\n\t\tthis.enTete.setText(\"Nombre de coups : \" + this.laby.getNbCoups());\n\n\t\t//Affichage dans la fenêtre et dans la console du labyrinthe case par case, et quand la case est celle ou se trouve le mineur, affiche ce dernier\n\t\tfor (int i = 0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tString ligne = new String();\n\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (i != this.laby.getMineur().getY() || j != this.laby.getMineur().getX()) {\n\t\t\t\t\tligne = ligne + this.laby.getLabyrinthe()[i][j].graphismeCase();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.laby.getLabyrinthe()[i][j]=new Case();\n\t\t\t\t\tligne = ligne + this.laby.getMineur().graphismeMineur();\n\t\t\t\t}\t\t\t\t\n\t\t\t\tif (grille.getComponentCount() < this.laby.getLargeur()*this.laby.getHauteur()) {\n\t\t\t\t\tgrille.add(new JLabel());\n\t\t\t\t\t((JLabel)grille.getComponents()[i*this.laby.getLargeur()+j]).setIcon(this.laby.getLabyrinthe()[i][j].imageCase(themeJeu));\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(ligne);\n\t\t}\n\t\t((JLabel)grille.getComponents()[this.laby.getMineur().getY()*this.laby.getLargeur()+this.laby.getMineur().getX()]).setIcon(this.laby.getMineur().imageCase(themeJeu));\n\t}",
"public void crearAutomovil(){\r\n automovil = new Vehiculo();\r\n automovil.setMarca(\"BMW\");\r\n automovil.setModelo(2010);\r\n automovil.setPlaca(\"TWS435\");\r\n }",
"private void creaModuloMem() {\n /* variabili e costanti locali di lavoro */\n ArrayList<Campo> campi = new ArrayList<Campo>();\n ModuloRisultati modulo;\n Campo campo;\n\n try { // prova ad eseguire il codice\n\n campo = CampoFactory.intero(Campi.Ris.codicePiatto.getNome());\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.nomePiatto.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"piatto\");\n campo.setToolTipLista(\"nome del piatto\");\n campo.decora()\n .etichetta(\"nome del piatto\"); // le etichette servono per il dialogo ricerca\n campo.setLarghezza(250);\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.categoria.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"categoria\");\n campo.setToolTipLista(\"categoria del piatto\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteVolte.getNome());\n campo.setVisibileVistaDefault();\n campo.setLarghezza(80);\n campo.setTitoloColonna(\"quante volte\");\n campo.setToolTipLista(\n \"quante volte questo piatto è stato offerto nel periodo analizzato\");\n campo.decora().etichetta(\"quante volte\");\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quantiCoperti.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"coperti\");\n campo.setToolTipLista(\"numero di coperti che avrebbero potuto ordinare\");\n campo.decora().etichetta(\"n. coperti\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteComande.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"comande\");\n campo.setToolTipLista(\"numero di comande effettive\");\n campo.decora().etichetta(\"n. comande\");\n campo.setLarghezza(80);\n campo.setTotalizzabile(true);\n campi.add(campo);\n\n campo = CampoFactory.percentuale(Campi.Ris.gradimento.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"gradimento\");\n campo.setToolTipLista(\n \"percentuale di gradimento (è il 100% se tutti i coperti potenziali lo hanno ordinato)\");\n campo.decora().etichetta(\"% gradimento\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n modulo = new ModuloRisultati(campi);\n setModuloRisultati(modulo);\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n }",
"private String creaElenco() {\n String testoTabella ;\n String riga = CostBio.VUOTO;\n ArrayList listaPagine = new ArrayList();\n ArrayList listaRiga;\n HashMap mappaTavola = new HashMap();\n String cognomeText;\n int num;\n int taglioPagine = Pref.getInt(CostBio.TAGLIO_COGNOMI_PAGINA);\n String tag = \"Persone di cognome \";\n ArrayList titoli = new ArrayList();\n titoli.add(LibWiki.setBold(\"Cognome\"));\n titoli.add(LibWiki.setBold(\"Voci\"));\n\n for (Map.Entry<String, Integer> mappa: mappaCognomi.entrySet()) {\n\n cognomeText = mappa.getKey();\n num = mappa.getValue();\n if (num >= taglioPagine) {\n cognomeText = tag + cognomeText + CostBio.PIPE + cognomeText;\n cognomeText = LibWiki.setQuadre(cognomeText);\n cognomeText = LibWiki.setBold(cognomeText);\n }// end of if cycle\n\n listaRiga = new ArrayList();\n listaRiga.add(cognomeText);\n listaRiga.add(num);\n listaPagine.add(listaRiga);\n\n }// end of for cycle\n mappaTavola.put(Cost.KEY_MAPPA_SORTABLE_BOOLEAN, true);\n mappaTavola.put(Cost.KEY_MAPPA_TITOLI, titoli);\n mappaTavola.put(Cost.KEY_MAPPA_RIGHE_LISTA, listaPagine);\n testoTabella = LibWiki.creaTable(mappaTavola);\n\n return testoTabella;\n }",
"public Nid(String matiere, int capacite)\n {\n // initialisation des variables d'instance\n this.matiere = matiere;\n this.capacite = capacite;\n }",
"public void inicializa ()\n {\n LinkedList linhas = GestorFicheiros.getLinhasFicheiro ();\n for (int i = 0; i < linhas.size (); i++)\n {\n String aux = (String) linhas.get (i);\n polinomiosLidos.add (aux);\n Polinomio polinomio = new Polinomio (aux);\n if (polinomio.isPolinomio ())\n {\n polinomio.simplificaPolinomio ();\n polinomio.ordenaPolinomio ();\n }\n else\n {\n polinomiosLidos.remove (aux);\n Operacao operacao = new Operacao (aux);\n if (!(operacao.isOperacao ())) \n {\n operacoesLidas.remove (aux);\n JOptionPane.showMessageDialog (null, \"O programa não consegue identificar nenhum polinomio/operacão escrito correctamente na linha \" + (i + 1), \"Erro na conversao das linhas do ficheiro\", JOptionPane.ERROR_MESSAGE);\n }\n else operacoesLidas.add (aux);\n }\n }\n polinomios = GestorPolinomios.getPolinomios ();\n operacoes = GestorOperacoes.getOperacoes ();\n \n //Panel dos Polinomios\n jPanelPolinomios.setEnabled (false);\n jPanelPolinomios.setLayout (new GridBagLayout ());\n jPanelPolinomios.setSize (FRAME_WIDTH, FRAME_HEIGTH);\n \n jLabelPolinomios.setEnabled (true);\n jLabelPolinomios.setText (\"Polinomios\");\n jPanelPolinomios.add (jLabelPolinomios);\n \n numPolinomios = polinomios.size ();\n Vector columnsPolinomiosNames = new Vector ();\n columnsPolinomiosNames.add (\"Nome\");\n columnsPolinomiosNames.add (\"Valor lido\");\n columnsPolinomiosNames.add (\"Valor Final\");\n Vector rowsPolinomios = new Vector ();\n rowsPolinomios.add (columnsPolinomiosNames);\n \n String maxLido = \"Valor Lido\";\n String maxFinal = \"Valor final\";\n \n for (int i = 0; i < numPolinomios; i++)\n {\n Vector linhasPolinomios = new Vector ();\n Polinomio polinomio = (Polinomio) polinomios.get (i);\n linhasPolinomios.add (polinomio.getNome ());\n String valorLido = (String) polinomiosLidos.get (i);\n \n if(valorLido.substring (4, valorLido.length ()).length() > maxLido.length())\n maxLido = valorLido;\n \n String str = polinomio.getResto ();\n \n if(str.length() > maxFinal.length())\n maxFinal = str;\n \n linhasPolinomios.add (valorLido.substring (4, valorLido.length ()));\n if (str.equals (\"\")) linhasPolinomios.add (\"0\");\n else linhasPolinomios.add (str); \n rowsPolinomios.add (linhasPolinomios);\n }\n \n jTablePolinomios = new JTable (rowsPolinomios, columnsPolinomiosNames);\n jTablePolinomios.setEnabled (false);\n \n TableColumnModel tableColumnModelPolinomios = jTablePolinomios.getColumnModel ();\n TableColumn tableColumnPolinomios;\n\n (tableColumnPolinomios = tableColumnModelPolinomios.getColumn (0)).setPreferredWidth (75);\n (tableColumnPolinomios = tableColumnModelPolinomios.getColumn (1)).setPreferredWidth (maxLido.length () * 8);\n (tableColumnPolinomios = tableColumnModelPolinomios.getColumn (2)).setPreferredWidth (maxFinal.length () * 8);\n\n jPanelPolinomios.add (jTablePolinomios, gridBagConstraints);\n \n //Panel das Operacoes\n jPanelOperacoes.setEnabled (false);\n jPanelOperacoes.setLayout (new GridBagLayout ());\n jPanelOperacoes.setSize (FRAME_WIDTH, FRAME_HEIGTH);\n \n jLabelOperacoes.setEnabled (true);\n jLabelOperacoes.setText (\"Operacoes\");\n jPanelOperacoes.add (jLabelOperacoes);\n \n numOperacoes = operacoes.size ();\n Vector columnsOperacoesNames = new Vector ();\n columnsOperacoesNames.add (\"Nome\");\n columnsOperacoesNames.add (\"Expressao\");\n columnsOperacoesNames.add (\"Resultado\");\n Vector rowsOperacoes = new Vector ();\n rowsOperacoes.add (columnsOperacoesNames);\n \n String maxExp = \"Expressao\";\n String maxRes = \"Resultado\";\n \n for (int i = 0; i < numOperacoes; i++)\n {\n Vector linhasOperacoes = new Vector ();\n Operacao operacao = (Operacao) operacoes.get (i);\n linhasOperacoes.add (operacao.getNome ());\n String valorLido = (String) operacoesLidas.get (i);\n \n if(valorLido.substring (4, valorLido.length ()).length() > maxExp.length())\n maxExp = valorLido;\n \n String str = Calculadora.calcula (Calculadora.infixaPosFixa (operacao));\n \n String op = operacao.toString ();\n char opAux[] = op.toCharArray ();\n for (int j = 0; j < op.length (); j++)\n {\n if (str.equals (\"0\")) if (opAux[j] == '/') JOptionPane.showMessageDialog (null, \"A expressão aritmética \" + operacao.getNome () + \" inclui operações de divisão não exacta\", \"Erro na divisão de polinomios\", JOptionPane.ERROR_MESSAGE);\n }\n \n if(str.length() > maxRes.length())\n maxRes = str;\n \n linhasOperacoes.add (valorLido.substring (4, valorLido.length ()));\n linhasOperacoes.add (str);\n rowsOperacoes.add (linhasOperacoes);\n }\n \n jTableOperacoes = new JTable (rowsOperacoes, columnsOperacoesNames);\n jTableOperacoes.setEnabled (false);\n \n TableColumnModel tableColumnModelOperacoes = jTableOperacoes.getColumnModel ();\n TableColumn tableColumnOperacoes;\n\n (tableColumnOperacoes = tableColumnModelOperacoes.getColumn (0)).setPreferredWidth (75);\n (tableColumnOperacoes = tableColumnModelOperacoes.getColumn (1)).setPreferredWidth (maxExp.length () * 8);\n (tableColumnOperacoes = tableColumnModelOperacoes.getColumn (2)).setPreferredWidth (maxRes.length () * 8);\n \n jPanelOperacoes.add (jTableOperacoes, gridBagConstraints);\n \n if (polinomios.size () != 0) jItemVerPolinomios.setEnabled (true);\n if (operacoes.size () != 0) jItemVerOperacoes.setEnabled (true);\n }",
"@Override\n\tpublic void crearNuevaPoblacion() {\n\t\t/* Nos quedamos con los mejores individuos. Del resto, cruzamos la mitad, los mejores,\n\t\t * y el resto los borramos.*/\n\t\tList<IIndividuo> poblacion2 = new ArrayList<>();\n\t\tint numFijos = (int) (poblacion.size()/2);\n\t\t/* Incluimos el 50%, los mejores */\n\t\tpoblacion2.addAll(this.poblacion.subList(0, numFijos));\n\t\t\n\t\t/* De los mejores, mezclamos la primera mitad \n\t\t * con todos, juntandolos de forma aleatoria */\n\t\tList<IIndividuo> temp = poblacion.subList(0, numFijos+1);\n\t\tfor(int i = 0; i < temp.size()/2; i++) {\n\t\t\tint j;\n\t\t\tdo {\n\t\t\t\tj = Individuo.aleatNum(0, temp.size()-1);\n\t\t\t}while(j != i);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tpoblacion2.addAll(cruce(temp.get(i), temp.get(j)));\n\t\t\t} catch (CruceNuloException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//this.poblacion.clear();\n\t\tthis.poblacion = poblacion2;\n\t}",
"public Grille creationGrille() {\n\t\tList<Mot> listeMots = new ArrayList<Mot>();\r\n\r\n\t\t// Init de la liste de cases\r\n\t\tList<Case> cases = new ArrayList<Case>();\r\n\r\n\t\t// Init de la grille\r\n\t\tGrille grille = new Grille();\r\n\t\tgrille.setDifficulte(Difficulte.moyen);\r\n\r\n\t\t// Creation de la liste de mots\r\n\t\tlisteMots = creerListeMots(grille);\r\n\r\n\t\t// Creation de la liste de cases avec les mots/couleurs\r\n\t\tcases = creerListeCase(listeMots, grille);\r\n\r\n\t\t// affection de la liste de cases a la grille et inverse\r\n\t\tgrille.setCases(cases);\r\n\t\tdaoGrille.save(grille);\r\n\t\tfor (Case c : cases) {\r\n\t\t\tc.setGrille(grille);\r\n\t\t\tdaoCase.save(c);\r\n\t\t}\r\n\r\n\t\treturn grille;\r\n\r\n\t}",
"public void nouvelleQuestion() {\n getAll();\n Random random = new Random();\n do {\n questionObjet = listeQuestions.get(random.nextInt(listeQuestions.size()));\n niveauUtil = questionObjet.getNiveau();\n }\n while (niveauUtil != niveau);\n questionUtil = questionObjet.getQuestion();\n reponseUtil = questionObjet.getReponse();\n }",
"private void initNoti() {\n lblNoti = new JLabel(\"\");\n\n springLayout.putConstraint(SpringLayout.WEST, lblNoti, 335, SpringLayout.WEST, estimationGame.getContentPane());\n springLayout.putConstraint(SpringLayout.SOUTH, lblNoti, -10, SpringLayout.NORTH, btnAvatarA);\n lblNoti.setForeground(new Color(224, 255, 255));\n lblNoti.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\n\n estimationGame.getContentPane().add(lblNoti);\n\t}",
"Lab create();",
"public Nombre() {\n char v[] = { 'a', 'e', 'i', 'o', 'u' };\n char c[] = { 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'ñ', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x',\n 'y', 'z' };\n vocales = new Letras(v);\n consonantes = new Letras(c);\n r = new Random();\n }",
"public void newGameJBJ() {\n newGame();\n min = 0; max = 1000;\n myctr.setMinMaxLabel();\n myctr.setLabels();\n }",
"public void novaIgra() {\r\n\t\tbroj_slobodnih = 16;\r\n\t\tfor(int i = 0 ; i < 4 ; i++)\r\n\t\t\tfor(int j = 0 ; j < 4 ; j++)\r\n\t\t\t\ttabela[i][j] = 0;\r\n\t\tpobjeda = false;\r\n\t\tigrajPoslijePobjede = false;\r\n\t\tgenerisiPolje();\r\n\t\tgenerisiPolje();\r\n\t}",
"@Override\n protected String elaboraBody() {\n String text = CostBio.VUOTO;\n int numCognomi = mappaCognomi.size();\n int numVoci = Bio.count();\n int taglioVoci = Pref.getInt(CostBio.TAGLIO_NOMI_ELENCO);\n\n text += A_CAPO;\n text += \"==Cognomi==\";\n text += A_CAPO;\n text += \"Elenco dei \";\n text += LibWiki.setBold(LibNum.format(numCognomi));\n text += \" cognomi '''differenti''' utilizzati nelle \";\n text += LibWiki.setBold(LibNum.format(numVoci));\n text += \" voci biografiche con occorrenze maggiori di \";\n text += LibWiki.setBold(taglioVoci);\n text += A_CAPO;\n text += creaElenco();\n text += A_CAPO;\n\n return text;\n }",
"private void recolteNourriture() {\r\n\t\t\t//1pop recolte toute la case\r\n\t\t\tint tempNourr = 0;\r\n\t\t\tint totalPop = population + populationColoniale;\r\n\t\t\tint limite = (totalPop < caseOwned.size()) ? totalPop : caseOwned.size();\r\n\t\t\tfor(int id = 0; id < limite; id++) {\r\n\t\t\t\ttempNourr += caseOwned.get(id).getFood();\r\n\t\t\t}\r\n\t\t\t//animaux\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Bétail) * 10; //Ca mange de l'herbe, ça se tente.\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Cervidés) * 7.5; //CARIBOUUUUUUUUU !!\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Crabe) * 2; //ca pique les pied, a mort!!\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Elephants) * 30; //polution sonore\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Moutons) * 5; //kébab landais\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Poissons) * 5; //croustibat\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Chevaux) * 7; //lasagnes\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Baleines) * 50; //*bruit de baleine virile*\r\n\t\t\t//aplication des bonus\r\n\t\t\ttempNourr *= (1 + (0.15 * scienceLvl) + (0.05 * (bonheur - baseBonheur))); // +15% par scienceLvl +5% par bonheur excedentaire, -5% par bonheur négatif\r\n\t\t\t\r\n\t\t\tnourriture += tempNourr;\r\n\t\t\t//bonus de conservation grâce au sel\r\n\t\t\tif(howManyRessource(StrategicRessource.Sel) > 0 && nourriture > 0) nourriture *= 1.10;\r\n\t\t\t//limitation de stockage\r\n\t\t\tint stockageMax = caseOwned.size() * 100 * scienceLvl;\r\n\t\t\tif(nourriture > stockageMax) nourriture = stockageMax;\r\n\t\t}",
"public IntegerGenotype create() \r\n\t{\n\t\tIntegerGenotype genotype = new IntegerGenotype(1,3);\r\n\t\tgenotype.init(new Random(), Data.numeroCuardillas); \r\n\t\t\r\n\t\treturn genotype;\r\n\t}",
"void mo21050ml(int i);",
"public NormExpression(int minimum, int maximum, int numSteps){\n \n // Set caching values\n this.minimum = minimum;\n this.maximum = maximum;\n this.numSteps = numSteps;\n \n // Allocate space for caching\n values = new double[numSteps];\n }",
"private void buildLanguageModel() {\n int total = 0;\n Map<Integer, Integer> wordCount = new HashMap<>();\n for (List<Integer> story : corpus.getStories()) {\n for (Integer word : story) {\n total++;\n if (wordCount.get(word) == null) wordCount.put(word, 0);\n wordCount.put(word, wordCount.get(word) + 1);\n }\n }\n wordValues = new HashMap<>();\n for (Map.Entry<Integer, Integer> entry : wordCount.entrySet()) {\n wordValues.put(entry.getKey(), total * 1.0 / entry.getValue());\n }\n }",
"public void majAffichage() {\n this.grid.getChildren().clear(); // vide tout le gridpane\n for (int i = 0; i < this.matrice.getNbLigne(); i++) {\n for (int j = 0; j < this.matrice.getNbColonne(); j++) {\n Node n = this.matrice.getCell(i, j); // recupère les imgViews de la matrice\n this.grid.setHalignment(n, HPos.CENTER); // place les labels au centre des cases\n this.grid.add(this.matrice.getCell(i, j), j, i);\n }\n }\n }",
"public void gagne()\r\n\t{\r\n\t\tthis.nbVictoires++;\r\n\t}",
"@Override\n public void init()\n {\n out = mul(num(100.0/Math.log10(length)), log10(div(sum(truerange(), length), diff(highest(length), lowest(length)))));\n }",
"public void agregarVidaLogica(){\n int numvida = tam * tam;\n numvida*=0.05;\n System.out.println(numvida);\n for(int i=0;i<numvida;i++){\n int x= (int)(Math.random()*tam);\n int y= (int)(Math.random()*tam);\n if(matriz[y][x]!=2 && matriz[y][x]!=1){\n matriz[y][x]=4;\n }\n }\n }",
"private void obsluga_bonusu()\n {\n if(bonusy_poziomu>0)\n {\n boolean numer= los.nextBoolean();\n if(numer){\n bon.add(new Bonus(w.getPolozenie_x(),w.getPolozenie_y(),getWidth(),getHeight()));\n bonusy_poziomu--;\n }\n }\n }",
"private int aleatorizarNaipe() {\n\t\tint aux;\n\t\taux = r.getIntRand(4);\n\t\treturn aux;\n\t}",
"public Repertoire(String nom) throws mesExceptions {\r\n super(nom);\r\n nbElem = 0;\r\n }",
"public QLVatTu() {\n initComponents();\n VatTu.doc();\n VatTu.setIndex( VatTu.lenth() - 1);\n hienThi();\n labHienThi.setText(( VatTu.getIndex() + 1) + \"/\" + VatTu.lenth());\n }",
"public Matriu() {\n \t/** <p><b>Pre:</b></p> <Ul>Cert.</Ul>\n\t\t * <p><b>Post:</b></p> <Ul> S'inicialitza una matriu esparsa buida. </Ul>\n\t\t * \n\t\t*/\n this.M = new HashMap<>(0);\n this.MatriuTF_IDF = new HashMap<>(0);\n this.IDFJ = new TreeMap<>();\n }",
"public void buscar_um_no(Norms norma_local){\n\t\tbuscar_no(this.raiz, norma_local);\n\t}",
"@Override\n public Vehicule creer(String immatriculation, String marque, String modele, Client client) {\n return new Voiture(immatriculation,marque,modele,client);\n }",
"public Labyrinthe (int h, int l) {\n\thauteur = h;\n\tlargeur = l;\n\ttailleRoute = 0;\n\tGenererLab (h, l);\n }",
"public Modele(String nomPays) {\r\n\t\tthis.nomPays = nomPays;\r\n\t\t\r\n\t\t//Ces communes sont ajoutees uniquement pour le bien de la demo dans le but de faire des essais plus rapidement\r\n\t\tthis.ajouterCommune(75001, 75, \"IDF\");\r\n\t\tthis.ajouterCommune(75002, 75, \"IDF\");\r\n\t\tthis.ajouterCommune(75003, 75, \"IDF\");\r\n\t\tthis.ajouterCommune(75004, 75, \"IDF\");\r\n\t\tthis.ajouterCommune(75005, 75, \"IDF\");\r\n\t\tthis.ajouterCommune(75006, 75, \"IDF\");\r\n\t}",
"int nbLignes();",
"public void insertar(){\n /*este for lo que hace es que se va a repetir\n dependiendo el tamaņo de la variable \"tamano\"\n */\n for (int i = 0; i < tamano; i++) {\n //Este metodo lo que hace es generar numeros aleatorios del 1 al 100\n vectorpila[i]=(int) (Math.random() *100+1);\n //Aqui aumenta el valor de cima\n cima++;\n }\n System.out.println(\"Pila llena\");\n }",
"SpaceInvaderTest_test_unNouveauVaisseauAvecDimensionEstCorrectementPositionneDansEspaceJeu createSpaceInvaderTest_test_unNouveauVaisseauAvecDimensionEstCorrectementPositionneDansEspaceJeu();",
"public void resolution() {\n\t\tLigneProposition essai = new LigneProposition(p.getNbTrou());\n\t\t\n\t\tfor(int i = 0; i < p.getNbTrou(); i++) {\n\t\t\tessai.setAt(i, 1 + (int)(Math.random() * ((p.getNbCouleur() -1))));\n\t\t}\n\t\t\n\t\tp.ajouterEssai(essai);\n\t}",
"public String getNormalizedN(int i) {\n\tint nb = getNb(i);\n\tif (nb == 1) return \"1\";\n\tint maxN = getMaxNb();\n\tif (maxN <= 5) return Integer.toString(nb);\n\tmaxN--;\n\tnb--;\n\tif (maxN < 21) {\n\t\tif (4*nb <= maxN) return \"1\";\n\t\tif (3*nb <= maxN) return \"2\";\n\t\tif (2*nb <= maxN) return \"3\";\n\t\tif (3*nb <= 2*maxN) return \"4\";\n\t\treturn \"5\";\n\t} else if (maxN < 100) {\n\t\tif (10*nb <= maxN) return \"1\";\n\t\tif (5*nb <= maxN) return \"2\";\n\t\tif (4*nb <= maxN) return \"3\";\n\t\tif (3*nb <= maxN) return \"4\";\n\t\tif (2*nb <= 1*maxN) return \"5\";\n\t\tif (3*nb <= 2*maxN) return \"6\";\n\t\treturn \"7\";\n\t} else {\n\t\tif (20*nb <= maxN) return \"1\";\n\t\tif (10*nb <= maxN) return \"2\";\n\t\tif (5*nb <= maxN) return \"3\";\n\t\tif (4*nb <= maxN) return \"4\";\n\t\tif (3*nb <= 1*maxN) return \"5\";\n\t\tif (2*nb <= 1*maxN) return \"6\";\n\t\treturn \"7\";\n\t}\n}",
"public void afficherLfu() {\n\t\tint nbrCols = listEtapeLfu.size();\n\t\tint nbrRows = 0;\n\t\tfor(ArrayList<ProcessusLfu> list: listEtapeLfu) {\n\t\t\tif(list.size() > nbrRows) nbrRows = list.size(); \n\t\t}\n\t\taddColsRows(resultPane, nbrCols+1, nbrRows);\n\t\taddPanelForResult(resultPane);\n\t\t\n\t\tresultPane.setStyle(\"-fx-background-color: #23CFDC\");\n\n\t\t// Affichage du résultat\n\t\tfor(int i=0; i< listEtapeLfu.size();i++) {\n\t\t\tArrayList<ProcessusLfu> list = listEtapeLfu.get(i); \n\t\t\tfor(int j=0; j<list.size(); j++) {\n\t\t\t\tProcessusLfu p = list.get(j); \n\t\t\t\tLabel label = new Label(\"\" + p.getValue());\n\n\t\t\t\tresultPane.add(label, i+1, j);\n\t\t\t\tGridPane.setHalignment(label, HPos.CENTER);\n\n\t\t\t}\n\t\t}\n\t\tresultPane.setVisible(true);\n\t\tgenere = true;\n\t}",
"public Chromosone() {\n Random rand = new Random();\n for(int i=0;i<=75;i++)\n {\n int rnd = rand.nextInt(2);// [1,0...]\n\n Val.add(rnd);\n }\n }",
"public pic() {\n MAX=10;\n initComponents();\n jLabel3.setText(MAX-approved+\"\");\n \n pctcollection=new ArrayList();\n \n }",
"public static Livro criarLivro() {\n\n\t\tLivro livro = new Livro();\n\n\t\tString codigo = Console.recuperaTexto(\"Informe o código:\");\n\t\tlivro.setCodigo(codigo);\n\t\tString titulo = Console.recuperaTexto(\"Informe o título:\");\n\t\tlivro.setTitulo(titulo);\n\n\t\tArrayList<String> autores = new ArrayList<>();\n\t\tInteger quantidade = Console.recuperaInteiro(\"Quantos autores?\");\n\t\tfor (int i = 0; i < quantidade; i++) {\n\t\t\tString autor = Console.recuperaTexto(\"Informe o autor \" + (i + 1) + \":\");\n\t\t\tautores.add(autor);\n\t\t}\n\t\tlivro.setAutores(autores);\n\n\t\tString isbn = Console.recuperaTexto(\"Informe o ISBN:\");\n\t\tlivro.setIsbn(isbn);\n\t\tInteger ano = Console.recuperaInteiro(\"Informe o ano:\");\n\t\tlivro.setAno(ano);\n\n\t\treturn livro;\n\n\t}",
"Multiplication createRandomMultiplication();",
"Multiplication createRandomMultiplication();",
"public void naplnVrcholy() {\r\n System.out.println(\"Zadajte pocet vrcholov: \");\r\n pocetVrcholov = skener.nextInt();\r\n for (int i=0; i < pocetVrcholov; i++) {\r\n nekonecno = (int)(Double.POSITIVE_INFINITY);\r\n if(i==0) { //pre prvy vrchol potrebujeme nastavit vzdialenost 0 \r\n String menoVrcholu = Character.toString((char)(i+65)); //pretipovanie int na String, z i=0 dostanem A\r\n Vrchol vrchol = new Vrchol(menoVrcholu, 0, \"\"); //vrcholu nastavim vzdialenost a vrcholPrichodu \r\n vrcholy.add(vrchol);\r\n } else { //ostatne budu mat nekonecno alebo v tomto pripade 9999 (lebo tuto hodnotu v mensich grafoch nepresiahnem)\r\n String menoVrcholu = Character.toString((char)(i+65)); //pretipovanie int na String, z i=0 dostanem A\r\n Vrchol vrchol = new Vrchol(menoVrcholu,nekonecno, \"\"); //vrcholu nastavim vzdialenost a vrcholPrichodu \r\n vrcholy.add(vrchol);\r\n }\r\n }\r\n }",
"public VOIVector(int initialsize) {\r\n super(initialsize);\r\n }",
"public Mueble(String nombre_mueble_ensamble, Double precio) {\n this.nombre_mueble_ensamble = nombre_mueble_ensamble;\n this.precio = precio;\n }",
"public Curso() {\n\t\tthis.alumnos = new ArrayList<Alumno>();\n\t\tcupo = 0;\n\t\tcreditos = 0;\n\t}",
"public void rellenarTerreno() {\n Random rnd = new Random();\r\n int restante = V;\r\n int[][] aux = terreno;\r\n do {\r\n for (int i = 0; i < Filas; i++) {\r\n for (int j = 0; j < Columnas; j++) {\r\n if (restante > max) {\r\n int peso = rnd.nextInt(max);\r\n if (aux[i][j] + peso <= max) {\r\n aux[i][j] += peso;\r\n restante -= peso;\r\n }\r\n } else {\r\n if (aux[i][j] + restante <= max) {\r\n aux[i][j] += restante;\r\n restante = 0;\r\n }\r\n }\r\n }\r\n }\r\n } while (restante != 0);\r\n }",
"private static ArrayList<String> construireMatriceCalcul() throws Exception_AbsenceExperienceBiomass, Exception_ParseException,IOException, Exception_SparqlConnexion {\n\n /*Pour chaque objetc : Object_TIEG de vDocExp construire le vecteur d'entrée au calul*/\n /*Le vecteur résultant sera placé sur : vVecteurCalculGlobal*/\n /*En cas de valeurs manquantes, le vecteur sera null, un message indiquant l'emplacement du manque ser transmis à la servlet*/\n \n Object_RapportCalculVecteur rapport;\n \n ArrayList<String> message= new ArrayList<>();\n \n if(vDocExp.size() > 0)\n {\n \n for(Object_TIEG obj : vDocExp)\n {\n try { \n\n if((rapport=InterrogationDataRDF.getVecteurCalcul(vPathRacine, obj, vTopicOperations, vRelationParametres)).getVecteurCalcul()!=null)\n {\n vVecteurCalculGlobal.add(rapport.getVecteurCalcul());\n }\n else\n {\n if(rapport.getMessage()!=null)\n {\n message.add(rapport.getMessage());\n }\n \n }\n \n } catch (Exception_ParseException ex) {\n \n throw ex;\n }\n }\n }\n else\n {\n throw new Exception_AbsenceExperienceBiomass();\n }\n \n return message;\n \n }",
"public String getPremierNumeroLibre() {\n\t\tString requete_s = \"SELECT id from LIVRES\";\n\t\tint i = 0;\n\t\tboolean egalite = true;\n\t\t\n\t\ttry{\n\t\t\trequete.execute(requete_s);\n\t\t\t\n\t\t\tResultSet rs = requete.getResultSet();\n\t\t\t\n\t\t\tdo{\n\t\t\t\ti++;\n\t\t\t\trs.next();\n\t\t\t\tegalite = (i ==((Integer) rs.getObject(1)));\n\t\t\t}while(egalite);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tString s = \"\" + i;\n\t\t\n\t\treturn s;\n\t}",
"@Override\n\tpublic void addRep(ImgRep ir) {\n\t\tdao.insert(ir);\n\t}",
"@SuppressWarnings(\"Duplicates\")\n public static Solver makeGolombRuler(int m){\n Solver solver = new Solver();\n IntVar[] ticks = VariableFactory.enumeratedArray(\"a\", m, 0, ((m < 31) ? (1 << (m + 1)) - 1 : 9999), solver);\n solver.addHook(\"ticks\", ticks);\n solver.post(IntConstraintFactory.arithm(ticks[0], \"=\", 0));\n\n for (int i = 0; i < m - 1; i++) {\n solver.post(IntConstraintFactory.arithm(ticks[i + 1], \">\", ticks[i]));\n }\n\n IntVar[] diffs = VariableFactory.enumeratedArray(\"d\", (m * m - m) / 2, 0, ((m < 31) ? (1 << (m + 1)) - 1 : 9999), solver);\n solver.addHook(\"diffs\", diffs);\n IntVar[][] m_diffs = new IntVar[m][m];\n for (int k = 0, i = 0; i < m - 1; i++) {\n for (int j = i + 1; j < m; j++, k++) {\n // d[k] is m[j]-m[i] and must be at least sum of first j-i integers\n // <cpru 04/03/12> it is worth adding a constraint instead of a view\n solver.post(IntConstraintFactory.scalar(new IntVar[]{ticks[j], ticks[i]}, new int[]{1, -1}, diffs[k]));\n solver.post(IntConstraintFactory.arithm(diffs[k], \">=\", (j - i) * (j - i + 1) / 2));\n solver.post(IntConstraintFactory.arithm(diffs[k], \"-\", ticks[m - 1], \"<=\", -((m - 1 - j + i) * (m - j + i)) / 2));\n solver.post(IntConstraintFactory.arithm(diffs[k], \"<=\", ticks[m - 1], \"-\", ((m - 1 - j + i) * (m - j + i)) / 2));\n m_diffs[i][j] = diffs[k];\n }\n }\n solver.post(IntConstraintFactory.alldifferent(diffs, \"BC\"));\n // break symetries\n if (m > 2) {\n solver.post(IntConstraintFactory.arithm(diffs[0], \"<\", diffs[diffs.length - 1]));\n }\n solver.setObjectives(ticks[m-1]);\n return solver;\n }",
"public Noeud(ArrayList<Objets> ListObjet, float poids_maximal) {\n\t\tthis.ListObjet = ListObjet;\n\t\tthis.poidsActuelle = 0;\n\t\tthis.profondeur = 0;\n\t\tthis.borneInf = 0;\n\t\tthis.borneSup = 0;\n\t\tthis.poids_maximal = poids_maximal;\n\t\tthis.ListObjetParNoeud = new ArrayList<Objets>();\n\t}",
"private double calculaz(double v) { //funcion de densidad de probabilidad normal\n double N = Math.exp(-Math.pow(v, 2) / 2) / Math.sqrt(2 * Math.PI);\n return N;\n }",
"private void addNerves(){\n Vector items = new Vector();\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_MEDIAN_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_MEDIAN_LEFT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_CUBITAL_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_CUBITAL_LEFT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_SQIATIQUE_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_SQIATIQUE_LEFT\");\n\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_MEDIAN_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_MEDIAN_LEFT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_CUBITAL_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_CUBITAL_LEFT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_SQIATIQUE_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_SQIATIQUE_LEFT\");\n\n if(verifyList(items)){\n contentTable = new PdfPTable(1);\n table = new PdfPTable(5);\n\n // title\n table.addCell(createItemNameCell(getTran(\"leprosy\",\"nerves\"),2));\n\n // dedicated table\n PdfPTable nervesTable = new PdfPTable(8);\n\n // header\n nervesTable.addCell(emptyCell(2));\n nervesTable.addCell(createHeaderCell(getTran(\"leprosy\",\"median\"),2));\n nervesTable.addCell(createHeaderCell(getTran(\"leprosy\",\"cubital\"),2));\n nervesTable.addCell(createHeaderCell(getTran(\"leprosy\",\"sciatiquepopliteexterne\"),2));\n\n // sub header\n nervesTable.addCell(emptyCell(2));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"right\"),1));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"left\"),1));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"right\"),1));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"left\"),1));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"right\"),1));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"left\"),1));\n\n //***** row 1 : epaissis *****\n cell = createHeaderCell(getTran(\"leprosy\",\"epaissis\"),2);\n cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT);\n nervesTable.addCell(cell);\n\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_MEDIAN_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_MEDIAN_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_CUBITAL_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_CUBITAL_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_SQIATIQUE_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_SQIATIQUE_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n\n //***** row 2 : douloureux *****\n cell = createHeaderCell(getTran(\"leprosy\",\"douloureux\"),2);\n cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT);\n nervesTable.addCell(cell);\n\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_MEDIAN_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_MEDIAN_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_CUBITAL_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_CUBITAL_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_SQIATIQUE_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_SQIATIQUE_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n\n // add nervesTable\n cell = createCell(new PdfPCell(nervesTable),3,PdfPCell.ALIGN_CENTER,PdfPCell.BOX);\n cell.setColspan(5);\n cell.setPadding(3);\n table.addCell(cell);\n\n // add table to transaction\n if(table.size() > 0){\n if(contentTable.size() > 0) contentTable.addCell(emptyCell());\n contentTable.addCell(createCell(new PdfPCell(table),1,PdfPCell.ALIGN_CENTER,PdfPCell.NO_BORDER));\n tranTable.addCell(new PdfPCell(contentTable));\n addTransactionToDoc();\n }\n }\n }",
"public Regras()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1100, 457, 1); \n prepare();\n if(MenuPrincipal.mundo == 1) //se o mundo anterior tiver sido MenuPrincipal\n som1 = MenuPrincipal.som2; //a música ficar com a mesma opção do mundo Menu Principal (a tocar ou sem som)}\n else if(MenuPrincipal.mundo == 3) //se o mundo anterior tiver sido MundoJogo\n som1 = MundoJogo.som3; //a música ficar com a mesma opção do mundo MundoJogo (a tocar ou sem som)\n imgsom2 = MenuPrincipal.imgsom1; //atualiza a imagem da coluna para ser igual à do mundo MenuPrincipal (mute/unmute)\n MenuPrincipal.mundo = 2; //atualizar 'mundo' para indicar que o mundo atual é o mundo Regras\n }",
"public NiveauEtudeHolder(pRectorat.NiveauEtude initial)\r\n {\r\n value = initial;\r\n }",
"public GrapheIndicateursProjet (Projet p) {\n seuils = p.getSeuilFixes() ;\n \n // pour l'echelle, on determine les mesures max de toutes les iterations\n \n \n iterations = p.getListeIt() ; \n nbIt = iterations.size() ;\n \n // calcul des maximums\n Iteration tempIt = null ;\n IndicateursIteration tempIndIt = null ;\n for (int i = 0 ; i < nbIt ; i++)\n {\n if (iterations.get(i) instanceof Iteration)\n {\n tempIt = (Iteration)iterations.get(i) ;\n tempIndIt = tempIt.getIndicateursIteration() ;\n // charges\n if (tempIndIt.getTotalCharges() > chargesMax) { chargesMax = tempIndIt.getTotalCharges() ; }\n\t\tif (tempIndIt.getChargeMoyenneParticipants() > moyenneChargesMax) { moyenneChargesMax = tempIndIt.getChargeMoyenneParticipants() ; }\n\t\tif (tempIndIt.getNombreParticipants() > participantsMax) { participantsMax = tempIndIt.getNombreParticipants() ; }\n\t\tif (tempIndIt.getNombreTachesTerminees() > tachesTermineesMax) { tachesTermineesMax = tempIndIt.getNombreTachesTerminees() ; }\n\t\tif (tempIndIt.getNombreMoyenTachesParticipants() > tachesParticipantsMax) { tachesParticipantsMax = tempIndIt.getNombreMoyenTachesParticipants() ; }\n\t\tif (tempIndIt.getDureeMoyenneTaches() > dureeMoyenneTacheMax) { dureeMoyenneTacheMax = tempIndIt.getDureeMoyenneTaches() ; }\n }\n }\n setPreferredSize(new Dimension(ITERATION_WIDTH * nbIt,440));\n\t//setBorder(new TitledBorder(new EtchedBorder(), \"toto\", 5, TitledBorder.ABOVE_TOP)) ;\n }",
"Dimension_longueur createDimension_longueur();",
"private void inicializarJuego() {\n\t\tList<VerboIrregular> lista = utilService.getVerbosIrregulares(faciles, normales, dificiles);\n\n\t\trealmService.cambiarMostrarRespuestasVerbosIrregulares(lista, false);\n\n\t\tverbosIrregularesDesordenadas.clear();\n\n\t\tfor (VerboIrregular x : lista) {\n\t\t\tverbosIrregularesDesordenadas.add(x);\n\t\t}\n\n\t\tCollections.shuffle(verbosIrregularesDesordenadas);\n\t\t// --------------------------------------------------------------\n\n\t\t//------- Esto es por si el usuario quita una palabra problematica y se resetea el juego\n\t\tif (cantidadItems > verbosIrregularesDesordenadas.size()) {\n\t\t\tcantidadItems = verbosIrregularesDesordenadas.size();\n\t\t}\n\t\t// ---------------------------------------------------------------------------------\n\n\t\tverbosIrregularesDesordenadas = verbosIrregularesDesordenadas.subList(0, cantidadItems);\n\n\t\tindice = 0;\n\t\tsetearTitulo();\n\n\t\tbtRestart.setVisibility(View.INVISIBLE);\n\t\tivCongratulations.setVisibility(View.INVISIBLE);\n\t\tmbNext.setVisibility(View.VISIBLE);\n\t\tbtPrevious.setVisibility(View.INVISIBLE);\n\t\ttvJuegoCantidadPalabras.setVisibility(View.VISIBLE);\n\t\tbtMostrarRespuestaJuego.setVisibility(View.VISIBLE);\n\t\ttvInfinitivo.setVisibility(View.VISIBLE);\n\t\tbtDificultad.setVisibility(View.VISIBLE);\n\t\tlyRespuestaJuego.setVisibility(View.INVISIBLE);\n\t\tbtVolver.setVisibility(View.INVISIBLE);\n\n\t\tsetearTextoArribaYColorDeBoton();\n\t}",
"public PantallaVictoria()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(400, 600, 1); \n prepare();\n }",
"public void create () {\n // TODO random generation of a ~100 x 100 x 100 world\n }",
"public Model() {\n operation = new DecimalOperation();\n base = 10;\n newnum = true;\n memory = new Stack<>();\n }",
"public SalaculturalController() {\n jpa = new SalaculturalJpaController(PersistenceUtil.getEntityManagerFactory());\n salacultural = new Salacultural();\n lista = jpa.findSalaculturalEntities();\n jpa2 = new EdificioJpaController(PersistenceUtil.getEntityManagerFactory());\n edificios = jpa2.findEdificioEntities();\n edificio = new Edificio();\n tmpid = 0;\n }",
"public void defaultMutate() {\n int mutationIndex = RNG.randomInt(0, this.m_GenotypeLength);\n //if (mutationIndex > 28) System.out.println(\"Mutate: \" + this.getSolutionRepresentationFor());\n if (this.m_Genotype.get(mutationIndex)) this.m_Genotype.clear(mutationIndex);\n else this.m_Genotype.set(mutationIndex);\n //if (mutationIndex > 28) System.out.println(this.getSolutionRepresentationFor());\n }",
"public Clorus replicate() {\n Clorus p2 = new Clorus(energy/2.0);\n energy /= 2;\n return p2;\n }",
"public void generaBuits() {\r\n\r\n //FIX PARA EL OUT OF BOUNDS DE la columna 9 \r\n //int cellId = randomGenerator(N*N) - 1;\r\n //QUITAR \r\n //if (j != 0)\r\n //j = j - 1;\r\n int count = K;\r\n while (count != 0) {\r\n int cellId = generadorAleatoris(N * N) - 1;\r\n\r\n //System.out.println(cellId); \r\n // extract coordinates i and j \r\n int i = (cellId / N);\r\n int j = cellId % 9;\r\n\r\n // System.out.println(i+\" \"+j); \r\n if (mat[i][j] != 0) {\r\n count--;\r\n mat[i][j] = 0;\r\n }\r\n }\r\n }",
"public void insertar2(){\n for (int i = 0; i < tamano; i++) {\n vectorpila2[i]=(int) (Math.random() *100+1);\n \n cima++;\n }\n }",
"public DDCountInversion(){\n\t\tnumeros = new ArrayList<Integer>();\n\t}",
"AliciaLab createAliciaLab();",
"private void generarNombre() {\r\n\t\tthis.nombre = NOMBRES[(int) (Math.random() * NOMBRES.length)];\r\n\t}",
"public void initialiserLesCasesDuPlateau()\n\t{\n\t\tthis.unTableau.removeAll();\n\t\t\n\t\tfor(int nombreDeCasesParLigne = 1 ; nombreDeCasesParLigne < 4 ; nombreDeCasesParLigne++)\n\t\t\tfor(int nombreDeCasesParColonne = 1 ; nombreDeCasesParColonne < 4 ; nombreDeCasesParColonne++)\n\t\t\t\tthis.unTableau.add(new BoutonCase(\"\",nombreDeCasesParLigne,nombreDeCasesParColonne, this.unControleur, this));\n\t\t\n\t\tthis.unTableau.updateUI();\n\t}",
"public void newGameRPS() {\n newGame();\n myctr.setLabels();\n }",
"private int newFigure(Random rnd) {\r\n\t\t/** while the figure exists or = 0, find a new figure */\r\n\r\n\t\tbyte hulp = 0;\r\n\t\tdo {\r\n\t\t\thulp = (byte) (1 + rnd.nextInt(Constants.DIMENSION * Constants.DIMENSION));\r\n\t\t} while (exists(hulp) || (hulp < Constants.MIN));\r\n\t\tConstants.logger.debug(hulp);\r\n\t\treturn hulp;\r\n\t}",
"@Test(timeout = 4000)\n public void test23() throws Throwable {\n ExpressionMatrixImpl expressionMatrixImpl0 = new ExpressionMatrixImpl();\n expressionMatrixImpl0.creatMatrix((-693));\n expressionMatrixImpl0.toString();\n assertEquals((-693), expressionMatrixImpl0.getNumberOfElements());\n }",
"public void generateLabyrinth() {\n\n /**\n * Generate some randoms Monsters for rooms\n */\n Monsters[] monster = new Monsters[countRooms];\n for (int i = 0; i < countRooms; i++) {\n monster[i] = new Monsters(\n rnd.nextDouble() * 10 + 1,\n rnd.nextDouble() * 10 + 1,\n rnd.nextDouble() * 10 + 1\n );\n }\n\n /**\n * Genetare random rooms with monsters\n */\n Rooms[] room = new Rooms[countRooms];\n for (int i = 0; i < countRooms; i++) {\n room[i] = new Rooms(\"unknownRoom\" + i);\n room[i].setMonster(monster[i]);\n if (rnd.nextInt(100) < 50) {\n room[i].setItem(shop.getRandomItem());\n }\n }\n\n /**\n * Connecting rooms with each other\n * North to South\n * East to West\n */\n\n //init and connect first room with labyrinth\n currentRoom = new Rooms(\"startRoom\");\n currentRoom.setNorth(room[0]);\n room[0].setSouth(currentRoom);\n\n for (int i = 0; i < countRooms - 1; i++) {\n int rint;\n //North to South\n rint = rnd.nextInt(countRooms);\n if (room[i].getNorth() == null) {\n while (room[rint].getSouth() != null) {\n rint = rnd.nextInt(countRooms);\n }\n room[i].setNorth(room[rint]);\n room[rint].setSouth(room[i]);\n }\n //East to West\n rint = rnd.nextInt(countRooms);\n if (room[i].getEast() == null) {\n while (room[rint].getWest() != null) {\n rint = rnd.nextInt(countRooms);\n }\n room[i].setEast(room[rint]);\n room[rint].setWest(room[i]);\n }\n\n }\n\n\n }",
"public QuanLyMay() {\n\n initComponents();\n may=new May();\n mayService=new MayService();\n defaultTableModel=new DefaultTableModel();\n jTable1.setModel(defaultTableModel);\n defaultTableModel.addColumn(\"ma may\");\n defaultTableModel.addColumn(\"cau hinh\");\n defaultTableModel.addColumn(\"Tinh trang\");\n defaultTableModel.addColumn(\"phan mem\");\n List<May> li= mayService.getAll();\n for (May i : li) {\n defaultTableModel.addRow(new Object[]{i.getMaMay(), i.getCauHinh(), i.getTinhTrang(), i.getPhanMem()});\n }\n }",
"public static Double[] simulerBinomiale(Double nbRep, Double proba, Double repetition) {\n\t\tBinomiale loi = new Binomiale(proba, nbRep, repetition);\n\t\treturn loi.simuler();\n\t}",
"@Test\n @Tag(\"bm1000\")\n public void testRECIPELP() {\n CuteNetlibCase.doTest(\"RECIPELP.SIF\", \"-266.616\", \"-104.818\", NumberContext.of(7, 4));\n }"
] | [
"0.5726197",
"0.52564657",
"0.524757",
"0.51862377",
"0.51821995",
"0.5157162",
"0.51447374",
"0.51139736",
"0.5111177",
"0.50859547",
"0.50760937",
"0.5031611",
"0.5016253",
"0.50070304",
"0.4996899",
"0.49965236",
"0.49821636",
"0.49700522",
"0.4967513",
"0.49602336",
"0.49586034",
"0.49568725",
"0.49350226",
"0.49197194",
"0.49118116",
"0.49100006",
"0.48977083",
"0.48970875",
"0.4891812",
"0.4888533",
"0.48598066",
"0.4859064",
"0.48581854",
"0.4846047",
"0.4840716",
"0.48384807",
"0.48376244",
"0.48368463",
"0.48339993",
"0.48317614",
"0.4831363",
"0.48228696",
"0.481431",
"0.48084787",
"0.4806906",
"0.48005897",
"0.4798469",
"0.47980833",
"0.47850895",
"0.4781817",
"0.47712117",
"0.4763881",
"0.47514734",
"0.4746966",
"0.474167",
"0.47345012",
"0.4734157",
"0.47335684",
"0.47295058",
"0.47253558",
"0.47184852",
"0.47161758",
"0.47060803",
"0.46985808",
"0.46985808",
"0.46940202",
"0.46898258",
"0.46868926",
"0.4685128",
"0.4677137",
"0.4668845",
"0.4665355",
"0.46625066",
"0.4661238",
"0.46604842",
"0.4654586",
"0.46478584",
"0.4645276",
"0.46441206",
"0.4642565",
"0.46325848",
"0.46321988",
"0.46317682",
"0.46294308",
"0.46232763",
"0.4621439",
"0.46200192",
"0.4617207",
"0.46154135",
"0.46134353",
"0.46076563",
"0.46050888",
"0.46039596",
"0.46002918",
"0.45971605",
"0.4594006",
"0.45905966",
"0.45901054",
"0.45873362",
"0.45871386",
"0.45821744"
] | 0.0 | -1 |
Creer une loi Exponentielle Puis simule la loi en simulant nbRep valeurs | public static Double[] simulerExponentielle(Double lambda, Double repetition) {
Exponentielle loi = new Exponentielle(lambda);
return loi.simuler(repetition);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String get_exponent_part();",
"int getMaxEXP();",
"int getMaxEXP();",
"public abstract String getExponent();",
"public final void power (int expo) throws ArithmeticException {\n\t\tdouble error = 0;\n\t\tint i = expo; \n\t\tdouble r = 1;\n\t\tdouble v = 1; \n\t\tlong u = underScore;\n\t\tif ((mksa&(_log|_mag)) != 0) throw new ArithmeticException\n\t\t(\"****Unit: can't power log[unit]: \" + symbol );\n\t\twhile (i > 0) { \n\t\t\tr *= factor; v *= value; \n\t\t\tu += mksa; u -= underScore; \n\t\t\tif ((u&0x8480808080808080L) != 0) error++;\n\t\t\ti--; \n\t\t}\n\t\twhile (i < 0) { \n\t\t\tr /= factor; v /= value; \n\t\t\tu += underScore; u -= mksa;\n\t\t\tif ((u&0x8480808080808080L) != 0) error++;\n\t\t\ti++; \n\t\t}\n\t\tif (error > 0) throw new ArithmeticException\n\t\t(\"****Unit: power too large: (\" + \")^\" + expo) ;\n\t\tfactor = r;\n\t\tvalue = v;\n\t\tmksa = u;\n\t\t/* Decision for the new symbol */\n\t\tif ((expo != 1) && (symbol != null)) {\n\t\t\tif (expo == 0) symbol = \"\";\n\t\t\telse if (symbol.length()>0) {\n\t\t\t\tParsing t = new Parsing(symbol);\n\t\t\t\tint pow;\n\t\t\t\tpow = getPower(t);\n\t\t\t\tif (pow == 0) symbol = toExpr(symbol) + expo;\n\t\t\t\telse {\t\t\t// Combine exponents\n\t\t\t\t\ti=0;\n\t\t\t\t\tpow *= expo;\n\t\t\t\t\tif (t.a[0] == '(') { i = 1; t.advance(-1); }\n\t\t\t\t\tif (expo == 1) symbol = symbol.substring(i,t.pos);\n\t\t\t\t\telse symbol = toExpr(symbol.substring(i,t.pos)) + pow;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public int getExponent();",
"public static double genExp(double a) {\r\n\t\tdouble x = 1 - generator.nextDouble();\r\n\t\tdouble exp = -1 * Math.log(x) * a;\r\n\t\treturn exp;\r\n\r\n\t}",
"Multiply createMultiply();",
"@Test\n public void testMultiplic() {\n System.out.println(\"multiplic\");\n float num1 = 0.0F;\n float num2 = 0.0F;\n float expResult = 0.0F;\n float result = Calculadora_teste.multiplic(num1, num2);\n assertEquals(expResult, result, 0.0);\n \n }",
"public Integer getExponent();",
"int getCurEXP();",
"int getCurEXP();",
"public void setExp(int exp) {\r\n\t\tthis.exp = exp;\r\n\t}",
"public void setExp(int exp) {\n \t\tthis.exp = exp;\n \t}",
"public AncientEgyptianMultiplication( ) {\r\n }",
"public int getExp() {\n \t\treturn exp;\n \t}",
"Vaisseau_ordonneeLaPlusHaute createVaisseau_ordonneeLaPlusHaute();",
"public Mueble(String nombre_mueble_ensamble, Double precio) {\n this.nombre_mueble_ensamble = nombre_mueble_ensamble;\n this.precio = precio;\n }",
"static void mostrarInstrucciones(){\r\n\t\tSystem.out.println(\"Introduzca la base y el exponente para calcular el resultado.\");\r\n\t}",
"@Test\n public void testCalculerValeurLot() {\n double superficie = 456.0;\n double prixMin = 4.32;\n double expResult = 1969.95;\n double result = CalculAgricole.calculerValeurLot(superficie, prixMin);\n assertEquals(\"Montant pour la Valeur du Lot n'était pas correct.\", expResult, result, 0);\n }",
"@Test\n public void test_ScientificNotation_0130() {\n ScientificNotation x = new ScientificNotation(BigDecimal.ZERO);\n assertEquals(0, x.significand().doubleValue(), 0);\n assertEquals(0, x.exponent());\n }",
"@Test\n\tpublic void testExponentiation() {\n\t\tdouble tmpRndVal = 0.0;\n\t\tdouble tmpRndVal2 = 0.0;\n\t\tdouble expResult = 0.0;\n\t\t\n\t\t//testing with negative numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = doubleRandomNegativeNumbers();\n\t\t\ttmpRndVal2 = doubleRandomNegativeNumbers();\n\t\t\texpResult = Math.pow(tmpRndVal, tmpRndVal2);\n\t\t\tassertEquals(ac.exponentiation(tmpRndVal, tmpRndVal2), expResult, 0);\n\t\t}\n\t\t\n\t\t//testing with positive numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = doubleRandomPositiveNumbers();\n\t\t\ttmpRndVal2 = doubleRandomPositiveNumbers();\n\t\t\texpResult = Math.pow(tmpRndVal, tmpRndVal2);\n\t\t\tassertEquals(ac.exponentiation(tmpRndVal, tmpRndVal2), expResult, 0);\n\t\t}\n\t\t\n\t\t//testing with zero\n\t\tdouble zero = 0.0;\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\texpResult = Math.pow(zero, zero);\n\t\t\tassertEquals(ac.exponentiation(zero, zero), expResult, 0);\n\t\t}\n\t\t\n\t}",
"@Test\n @Tag(\"bm1000\")\n public void testRECIPELP() {\n CuteNetlibCase.doTest(\"RECIPELP.SIF\", \"-266.616\", \"-104.818\", NumberContext.of(7, 4));\n }",
"private double procesarOperadorExponente() throws Exception {\r\n double resultado = procesarCoeficientesFuncionesParentesis();\r\n while (!colaDeTokens.isEmpty()) {\r\n switch (colaDeTokens.element().tipoToken) {\r\n case EXPONENTE:\r\n \r\n colaDeTokens.remove();\r\n resultado = Math.pow(resultado, procesarCoeficientesFuncionesParentesis());\r\n continue;\r\n }\r\n break;\r\n }\r\n return resultado;\r\n }",
"public FactorPol factorLogExpHead(FactorPol factPl , int enteringFactorInLogExp, Ring ring){\n ArrayList<Integer> numbers = new ArrayList<Integer>();\n for (int i = 0; i < factPl.multin.length; i++) {\n if( (factPl.multin[i].isItNumber()) &&\n (factPl.multin[i].Re(ring).isZero(ring) == false) &&\n (factPl.multin[i].Im(ring).isZero(ring) == false) ) {\n numbers.add(i);\n }\n }\n \n \n for (int k = 0; k < factPl.multin.length; k++) {\n Polynom poll=factPl.multin[k]; if (poll.coeffs.length==0) return FactorPol.ZERO;\n int epVar=poll.powers.length / poll.coeffs.length;\n if (epVar<ring.varNames.length) continue;\n if(poll.isItNumber())continue;\n \n \n\n// if((ring.algebra[0]&(~Ring.Complex))==Ring.Q){\n// for (int i = 0; i < poll.coeffs.length; i++) {\n// if(poll.coeffs[i] instanceof Fraction)\n// }\n// }\n boolean bool = false;\n Element poll2 = null;\n \n do {\n poll =factorL(poll, enteringFactorInLogExp, ring); \n \n \n poll= factorExpFunction(poll, enteringFactorInLogExp, ring); \n \n \n \n if(poll2 != null) {\n if(poll.subtract(poll2.multiply(factPl.multin[numbers.get(0)], ring), ring).isZero(ring)) {\n factPl.multin[k] = (Polynom) poll2;\n } else {\n factPl.multin[k]=poll;\n factPl.multin[numbers.get(0)] = new Polynom(new int[]{}, new Element[]{ring.numberONE});\n numbers.remove(0);\n }\n bool = false;\n } else if( (numbers.size() > 0) &&\n (poll.Im(ring).isZero(ring) == false) &&\n (poll.Re(ring).isZero(ring) == false) ) {\n \n poll2 = poll;\n poll = poll.multiply(factPl.multin[numbers.get(0)], ring);\n bool = true;\n } else {\n factPl.multin[k]=poll;\n bool = false;\n }\n } while(bool);\n poll2 = null;\n }\n return factPl; \n }",
"public void setExponent(Integer exponent);",
"LetExp createLetExp();",
"public long priceExponent() {\n\t\treturn message.getBasePriceExponent();\n\t}",
"private int calcularPrecio(Repuesto repuesto, boolean formateo, boolean limpieza) {\n int precio = 0;\n if (repuesto != null) {\n precio += repuesto.getPrecio();\n }\n \n if (formateo) {\n precio += 10000;\n }\n \n if (limpieza) {\n precio += 7500;\n }\n return precio;\n }",
"public void calcular()\r\n/* 530: */ {\r\n/* 531:556 */ this.facturaProveedorSRI.setMontoIva(this.facturaProveedorSRI.getBaseImponibleDiferenteCero().multiply(\r\n/* 532:557 */ ParametrosSistema.getPorcentajeIva().divide(BigDecimal.valueOf(100L))));\r\n/* 533: */ }",
"static void multiplier() throws IOException {\n\t\tScanner clavier = new Scanner(System.in);\n\t\tint nb1, nb2, resultat;\n\t\tnb1 = lireNombreEntier();\n\t\tnb2 = lireNombreEntier();\n\t\tresultat = nb1 * nb2;\n\t\tSystem.out.println(\"\\n\\t\" + nb1 + \" * \" + nb2 + \" = \" + resultat);\n\t}",
"public void appendExp(int value) throws Exception\n\t{\n\t\t\n\t}",
"public static double cubicMetreToMillilitres(double num) { return (num*Math.exp(6)); }",
"public void increaseExp(int exp){\r\n\t\tthis.exp = this.exp + exp;\r\n\t}",
"public static double exp() {\r\n System.out.println(\"What is your base?\");\r\n int b = Main.sc.nextInt();\r\n System.out.println(\"What is your power?\");\r\n int p = Main.sc.nextInt();\r\n double answer = Math.pow((double) b, (double) p);\r\n return answer;\r\n }",
"public double getExp() {\n return exp;\n }",
"static int exp(int base, long n) {\n\n // 2^3=8 , 2^x=8 -> x = ln8/ln2 , otherwise x=Math.log(8)/Math/log(2)\n\n return (int) ( Math.log(n)/Math.log(base) );\n }",
"public abstract double mo9740e();",
"@Test\n @Tag(\"bm1000\")\n public void testGROW22() {\n CuteNetlibCase.doTest(\"GROW22.SIF\", \"-1.608343364825636E8\", \"0.0\", NumberContext.of(7, 4));\n }",
"@Override\r\n public void ingresarCapacidad(){\r\n double capacidad = Math.pow(alto, 3);\r\n int capacidadInt = Double.valueOf(capacidad).intValue();\r\n super.capacidad = capacidadInt;\r\n super.cantidadRestante = capacidadInt;\r\n System.out.println(capacidadInt);\r\n }",
"@Test\n @Tag(\"bm1000\")\n public void testGROW15() {\n CuteNetlibCase.doTest(\"GROW15.SIF\", \"-1.068709412935753E8\", \"0.0\", NumberContext.of(7, 4));\n }",
"public int initialiser()\n\t{\n\n\t\tint nombreE;\n\t\tint k = 0;\n\t\t//int max = randInt(2,10);\n\t\ttableauPeres_ = new Case[longueur_][longueur_];\n\t\tint i, j = 0;\n\t\tfor(i=0; i<longueur_; ++i)\n\t\t{\n\t\t\tfor(j=0; j<longueur_; ++j)\n\t\t\t{\n\t\t\t\ttableauPeres_[i][j] = new Case(i, j, 0);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Combien d'étoiles souhaitez vous pour chaque joueur ?\");\n\t\tnombreE = clavier.nextInt();\n\t\twhile (k < nombreE)\n\t\t{\n\t\t\taddEtoile(\"bleu\");\n\t\t\taddEtoile(\"rouge\");\n\t\t\t++k;\n\t\t}\n\t\treturn nombreE;\n\t}",
"@Test\n @Tag(\"bm1000\")\n public void testGROW7() {\n CuteNetlibCase.doTest(\"GROW7.SIF\", \"-4.7787811814711526E7\", \"0.0\", NumberContext.of(7, 4));\n }",
"Period mo20733e();",
"public FuncionMultiplicacion(String operador, int hijos) {\n super(operador, hijos);\n }",
"public Builder setMaxEXP(int value) {\n bitField0_ |= 0x00020000;\n maxEXP_ = value;\n onChanged();\n return this;\n }",
"public int getPower(String genEle);",
"public final EObject ruleExponentialFunction() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_1=null;\r\n Token otherlv_3=null;\r\n Token otherlv_5=null;\r\n EObject lv_operator_0_0 = null;\r\n\r\n EObject lv_base_2_0 = null;\r\n\r\n EObject lv_exponent_4_0 = null;\r\n\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:3442:28: ( ( ( (lv_operator_0_0= ruleExponentialOperator ) ) otherlv_1= '(' ( (lv_base_2_0= ruleNumberExpression ) ) otherlv_3= ',' ( (lv_exponent_4_0= ruleNumberExpression ) ) otherlv_5= ')' ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:3443:1: ( ( (lv_operator_0_0= ruleExponentialOperator ) ) otherlv_1= '(' ( (lv_base_2_0= ruleNumberExpression ) ) otherlv_3= ',' ( (lv_exponent_4_0= ruleNumberExpression ) ) otherlv_5= ')' )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:3443:1: ( ( (lv_operator_0_0= ruleExponentialOperator ) ) otherlv_1= '(' ( (lv_base_2_0= ruleNumberExpression ) ) otherlv_3= ',' ( (lv_exponent_4_0= ruleNumberExpression ) ) otherlv_5= ')' )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:3443:2: ( (lv_operator_0_0= ruleExponentialOperator ) ) otherlv_1= '(' ( (lv_base_2_0= ruleNumberExpression ) ) otherlv_3= ',' ( (lv_exponent_4_0= ruleNumberExpression ) ) otherlv_5= ')'\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:3443:2: ( (lv_operator_0_0= ruleExponentialOperator ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:3444:1: (lv_operator_0_0= ruleExponentialOperator )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:3444:1: (lv_operator_0_0= ruleExponentialOperator )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:3445:3: lv_operator_0_0= ruleExponentialOperator\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n \t newCompositeNode(grammarAccess.getExponentialFunctionAccess().getOperatorExponentialOperatorParserRuleCall_0_0()); \r\n \t \r\n }\r\n pushFollow(FOLLOW_ruleExponentialOperator_in_ruleExponentialFunction7346);\r\n lv_operator_0_0=ruleExponentialOperator();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \t if (current==null) {\r\n \t current = createModelElementForParent(grammarAccess.getExponentialFunctionRule());\r\n \t }\r\n \t\tset(\r\n \t\t\tcurrent, \r\n \t\t\t\"operator\",\r\n \t\tlv_operator_0_0, \r\n \t\t\"ExponentialOperator\");\r\n \t afterParserOrEnumRuleCall();\r\n \t \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n otherlv_1=(Token)match(input,43,FOLLOW_43_in_ruleExponentialFunction7358); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_1, grammarAccess.getExponentialFunctionAccess().getLeftParenthesisKeyword_1());\r\n \r\n }\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:3465:1: ( (lv_base_2_0= ruleNumberExpression ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:3466:1: (lv_base_2_0= ruleNumberExpression )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:3466:1: (lv_base_2_0= ruleNumberExpression )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:3467:3: lv_base_2_0= ruleNumberExpression\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n \t newCompositeNode(grammarAccess.getExponentialFunctionAccess().getBaseNumberExpressionParserRuleCall_2_0()); \r\n \t \r\n }\r\n pushFollow(FOLLOW_ruleNumberExpression_in_ruleExponentialFunction7379);\r\n lv_base_2_0=ruleNumberExpression();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \t if (current==null) {\r\n \t current = createModelElementForParent(grammarAccess.getExponentialFunctionRule());\r\n \t }\r\n \t\tset(\r\n \t\t\tcurrent, \r\n \t\t\t\"base\",\r\n \t\tlv_base_2_0, \r\n \t\t\"NumberExpression\");\r\n \t afterParserOrEnumRuleCall();\r\n \t \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n otherlv_3=(Token)match(input,20,FOLLOW_20_in_ruleExponentialFunction7391); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_3, grammarAccess.getExponentialFunctionAccess().getCommaKeyword_3());\r\n \r\n }\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:3487:1: ( (lv_exponent_4_0= ruleNumberExpression ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:3488:1: (lv_exponent_4_0= ruleNumberExpression )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:3488:1: (lv_exponent_4_0= ruleNumberExpression )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:3489:3: lv_exponent_4_0= ruleNumberExpression\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n \t newCompositeNode(grammarAccess.getExponentialFunctionAccess().getExponentNumberExpressionParserRuleCall_4_0()); \r\n \t \r\n }\r\n pushFollow(FOLLOW_ruleNumberExpression_in_ruleExponentialFunction7412);\r\n lv_exponent_4_0=ruleNumberExpression();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \t if (current==null) {\r\n \t current = createModelElementForParent(grammarAccess.getExponentialFunctionRule());\r\n \t }\r\n \t\tset(\r\n \t\t\tcurrent, \r\n \t\t\t\"exponent\",\r\n \t\tlv_exponent_4_0, \r\n \t\t\"NumberExpression\");\r\n \t afterParserOrEnumRuleCall();\r\n \t \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n otherlv_5=(Token)match(input,44,FOLLOW_44_in_ruleExponentialFunction7424); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_5, grammarAccess.getExponentialFunctionAccess().getRightParenthesisKeyword_5());\r\n \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }",
"@Override\r\n\tpublic RandomGenerator_Exponential clone() {\r\n\t\tRandomGenerator_Exponential rg = new RandomGenerator_Exponential();\r\n\t\trg.lambda=lambda;\r\n\t\treturn rg;\r\n\t}",
"public int getMaxEXP() {\n return maxEXP_;\n }",
"public int getMaxEXP() {\n return maxEXP_;\n }",
"public long getNumerator();",
"private static String IlllllllIl(double IllIlIIlIlllIIl, String IIlIlIIlIlllIIl) {\n }",
"@Test\n\tpublic void testMultiplica2Reales0() {\n\t\tdouble resultado= Producto.multiplica2reales(7.2, 0);\n\t\tdouble esperado= 0;\n\t\t\n\t\tassertEquals(esperado, resultado);\n\t}",
"private double calc_e_order_n(int il) {\n\t\tint j;\n\t\tdouble dr2,newe,store_cut,pot;\n\t\t\n\t\tstore_cut = pot_cut_off;\n\t\tpot_cut_off = 1.0e20;\n\t\tpot_cut_off2 = pot_cut_off*pot_cut_off;\n\t\tnewe = 0.0;\n\t\tfor(j=0; j<n; j++) {\n\t\t\tif ( j != 0 ) {\n\t\t\t\tdr2 = ij_sep2(0,j,il,CUR_POS);\n\t\t\t\tpot = ij_inter_act(dr2,0,j,il);\n\t\t\t\tnewe += pot;\n\t\t\t}\n\t\t}\n\t\tpot_cut_off = store_cut;\n\t\tpot_cut_off2 = pot_cut_off*pot_cut_off;\n\t\t\n\t\treturn(newe);\n\t}",
"public Builder setMaxEXP(int value) {\n bitField0_ |= 0x00000004;\n maxEXP_ = value;\n onChanged();\n return this;\n }",
"public void Nouvelleligne() {\n int maxEleve = retourneMaxNumber() + 1;\n try {\n Connector1.statement.executeUpdate(\"Insert INTO eleve(id_el) VALUES (\" + maxEleve + \")\");\n Object[] val = {maxEleve, \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"};\n effaceTable(jTable2, mode);\n mode.addRow(val);\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"ERROR \\n\" + e.getMessage());\n\n }\n\n }",
"private double genMultiplier() {\n return (random.nextInt(81) + 60)/100.0;\n }",
"public abstract void setMaxExponentSize(byte maxExponentSize);",
"public void cal_AdjustedFuelMoist(){\r\n\tADFM=0.9*FFM+0.5+9.5*Math.exp(-BUO/50);\r\n}",
"@Test\n\tpublic void testMultiplica2Reales() {\n\t\tdouble resultado= Producto.multiplica2reales(7.2, 8.2);\n\t\tdouble esperado= 59.04;\n\t\t\n\t\tassertEquals(esperado, resultado);\n\t}",
"Multiplication createRandomMultiplication();",
"Multiplication createRandomMultiplication();",
"VariableAmount getExtremeSpikeIncrease();",
"public PghModulo() {\r\n }",
"float mo106363e();",
"public void calcularEntropia(){\n //Verificamos si será con la misma probabilida o con probabilidad\n //especifica\n if(contadorEstados == 0){\n //Significa que será con la misma probabilidad por lo que nosotros\n //calcularemos las probabilidades individuales\n for(int i = 0; i < numEstados; i++){\n probabilidadEstados[i] = 1.0 / numEstados;\n }\n }\n for(int i = 0; i < numEstados; i++){\n double logEstado = Math.log10(probabilidadEstados[i]);\n logEstado = logEstado * (-1);\n double logDos = Math.log10(2);\n double divisionLog = logEstado / logDos;\n double entropiaTmp = probabilidadEstados[i] * divisionLog;\n resultado += entropiaTmp;\n }\n }",
"public final EObject ruleExponentialOperator() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_1=null;\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:5046:28: ( ( () otherlv_1= 'exp' ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:5047:1: ( () otherlv_1= 'exp' )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:5047:1: ( () otherlv_1= 'exp' )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:5047:2: () otherlv_1= 'exp'\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:5047:2: ()\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:5048:5: \r\n {\r\n if ( state.backtracking==0 ) {\r\n\r\n current = forceCreateModelElement(\r\n grammarAccess.getExponentialOperatorAccess().getExponentialOperatorAction_0(),\r\n current);\r\n \r\n }\r\n\r\n }\r\n\r\n otherlv_1=(Token)match(input,72,FOLLOW_72_in_ruleExponentialOperator11485); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_1, grammarAccess.getExponentialOperatorAccess().getExpKeyword_1());\r\n \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }",
"BigDecimal Spigot()\n\t{\n\t\t\n\t\tint increment \t= 20000;\n\t\tint max \t\t= 1000000;\n\t\t\n\t\tBigDecimal totResult = new BigDecimal(0.0);\n\t\t\n\t\tsumPart++;\n\t\t\n\t\tBigDecimal result1 = new BigDecimal(0.0);\n\t\t\n\t\tBigDecimal sixTeenPowStartVal = new BigDecimal(1.0);\n\t\tBigDecimal sixTeenPowIncrement = new BigDecimal(16).pow(increment);\n\t\t\n\t\tlong startTime = System.currentTimeMillis();\n\t\t\n\t\tfor(int i=0; i<max; i+=increment)\n\t\t{\n\t\t\tresult1 = result1.add( Spigot_Level_3(i, increment/5, 5, max, sixTeenPowStartVal) );\n\t\t\t\n\t\t\tlong timeTaken = System.currentTimeMillis() - startTime;\n\t\t\t\n\t\t\tSystem.out.println(\"Iteration : \"+(i+increment)+\" time : \"+timeTaken);\n\t\t\t\n\t\t\tsixTeenPowStartVal = sixTeenPowStartVal.multiply( sixTeenPowIncrement );\n\t\t}\n\t\tresult1 = result1.multiply( new BigDecimal(4) );\n\t\t\n\t\t\n\t\t\n\t\tsumPart++;\n\t\t\n\t\tBigDecimal result2 = new BigDecimal(0.0);\n\t\t\n\t\tsixTeenPowStartVal = new BigDecimal(1.0);\n\t\tsixTeenPowIncrement = new BigDecimal(16).pow(increment);\n\t\t\n\t\tfor(int i=0; i<max; i+=increment)\n\t\t{\n\t\t\tresult2 = result2.add( Spigot_Level_3(i, increment/5, 5, max, sixTeenPowStartVal) );\n\t\t\t\n\t\t\tlong timeTaken = System.currentTimeMillis() - startTime;\n\t\t\t\n\t\t\tSystem.out.println(\"Iteration : \"+(i+increment)+\" time : \"+timeTaken);\n\t\t\t\n\t\t\tsixTeenPowStartVal = sixTeenPowStartVal.multiply( sixTeenPowIncrement );\n\t\t}\t\t\n\t\t\n\t\tresult2 = result2.multiply( new BigDecimal(2) );\n\t\t\n\t\t\n\t\t\n\t\tsumPart++;\n\t\t\n\t\tBigDecimal result3 = new BigDecimal(0.0);\n\t\t\n\t\tsixTeenPowStartVal = new BigDecimal(1.0);\n\t\tsixTeenPowIncrement = new BigDecimal(16).pow(increment);\n\t\t\n\t\tfor(int i=0; i<max; i+=increment)\n\t\t{\n\t\t\tresult3 = result3.add( Spigot_Level_3(i, increment/5, 5, max, sixTeenPowStartVal) );\n\t\t\t\n\t\t\tlong timeTaken = System.currentTimeMillis() - startTime;\n\t\t\t\n\t\t\tSystem.out.println(\"Iteration : \"+(i+increment)+\" time : \"+timeTaken);\n\t\t\t\n\t\t\tsixTeenPowStartVal = sixTeenPowStartVal.multiply( sixTeenPowIncrement );\n\t\t}\t\t\n\t\t\n\t\t\n\t\t\n\t\tsumPart++;\n\t\t\n\t\tBigDecimal result4 = new BigDecimal(0.0);\n\t\t\n\t\tsixTeenPowStartVal = new BigDecimal(1.0);\n\t\tsixTeenPowIncrement = new BigDecimal(16).pow(increment);\n\t\t\n\t\tfor(int i=0; i<max; i+=increment)\n\t\t{\n\t\t\tresult4 = result4.add( Spigot_Level_3(i, increment/5, 5, max, sixTeenPowStartVal) );\n\t\t\t\n\t\t\tlong timeTaken = System.currentTimeMillis() - startTime;\n\t\t\t\n\t\t\tSystem.out.println(\"Iteration : \"+(i+increment)+\" time : \"+timeTaken);\n\t\t\t\n\t\t\tsixTeenPowStartVal = sixTeenPowStartVal.multiply( sixTeenPowIncrement );\n\t\t}\t\t\n\t\t\n\t\ttotResult = result1.subtract( result2.add( result3 ).add( result4 ) );\n\t\t\n\t\treturn totResult;\n\t}",
"public double getExpModifier()\r\n\t{\treturn this.expModifier;\t}",
"public int getMaxEXP() {\n return maxEXP_;\n }",
"public int getMaxEXP() {\n return maxEXP_;\n }",
"public BigInteger[] multiply_G(BigInteger factor) \r\n{\r\n\tBigInteger[] voher = EXPList.nullVektor;\r\n\tBigInteger[] erg = new BigInteger[2];\r\n\tfor(int i=0;i<=255;i++)\r\n\t{\r\n\t\tif(factor.testBit(i)==true) \r\n\t\t{\r\n\t\t erg = addition(voher,EXPList.list[i]); \r\n\t\t voher = erg;\r\n\t\t} \r\n\t}\r\n\treturn erg; \r\n}",
"long getExpirations();",
"private void displayExp(int disp_nr){\r\n\t\tswitch (disp_nr){\r\n\t\t\tcase 0 :\r\n\t\t\t\texpl = lang.newSourceCode(new Coordinates(200,100), \"\", null, expl_props);\r\n\t\t\t\texpl.addCodeLine(\"Bei 'Fletcher's Checksum' handelt es sich, wie beim Namen ersichtlich,\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"um einen Pruefsummen-Algorithmus zur Erkennung von Datenuebertragungsfehlern.\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"Er ist aehnlich stark wie das CRC-Verfahren,\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"hat aber einen teils wesentlich geringeren Rechenaufwand.\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"Wir sehen uns den Algorithmus in 2 Faellen an:\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"- Korrekte uebertragung der Daten\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"- Fehlerhafte uebertragung der Daten\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"Doch zuerst muessen die Pruefsummen selbst berechnet werden.\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"In der urspruenglichen Variante des Algorithmus wird hierfuer der Datenstream\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"in Bytes (8-Bit Bloecke) zerlegt...\", null, 0, null);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 1 :\r\n\t\t\t\texpl = lang.newSourceCode(new Coordinates(300,150), \"\", null, expl_props);\r\n\t\t\t\texpl.addCodeLine(\"Nun stehen die zwei Pruefsummen fest.\",null,0,null);\r\n\t\t\t\texpl.addCodeLine(\"Damit aber die Qualitaet von CRC in Sachen Fehlererkennung erreicht wird,\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"muessen diese noch einmal verarbeitet werden und zwar wie folgt:\", null, 0, null);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2 :\r\n\t\t\t\texpl = lang.newSourceCode(new Coordinates(300,150), \"\", null, expl_props);\r\n\t\t\t\texpl.addCodeLine(\"Diese 2 Werte werden nun an die zu versendende Nachricht drangehaengt\", null, 0, null);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 3 :\r\n\t\t\t\texpl = lang.newSourceCode(new Coordinates(300,150), \"\", null, expl_props);\r\n\t\t\t\texpl.addCodeLine(\"Zur Fehlerpruefung muss der Empfaenger nun den Algorithmus erneut\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"auf die empfangene Nachricht, samt Prueffeldern, andwenden\", null, 0, null);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 4 :\r\n\t\t\t\texpl = lang.newSourceCode(new Coordinates(300,150), \"\", null, expl_props);\r\n\t\t\t\texpl.addCodeLine(\"Die Pruefsumme (sum1 + sum2) ist 0! Somit kann von einer\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"korrekten uebertragung der Daten ausgegangen werden!\", null, 0, null);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 5 :\r\n\t\t\t\texpl = lang.newSourceCode(new Coordinates(300,150), \"\", null, expl_props);\r\n\t\t\t\texpl.addCodeLine(\"Nun ein anderes Szenario: Bei der uebertragung ist ein Fehler \", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"aufgetreten - hier : in Byte #\" + error_position, null, 0, null);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 6 :\r\n\t\t\t\texpl = lang.newSourceCode(new Coordinates(300,150), \"\", null, expl_props);\r\n\t\t\t\texpl.addCodeLine(\"Wir pruefen erneut wie vorher...\", null, 0, null);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 7 :\r\n\t\t\t\texpl = lang.newSourceCode(new Coordinates(300,150), \"\", null, expl_props);\r\n\t\t\t\texpl.addCodeLine(\"Die Pruefsumme ist NICHT 0. Somit weiss der Empfaenger,\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"dass ein Fehler aufgetreten ist\", null, 0, null);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 9 :\r\n\t\t\t\texpl = lang.newSourceCode(new Coordinates(300,150), \"\", null, expl_props);\r\n\t\t\t\texpl.addCodeLine(\"Es wurden\",null,0,null);\r\n\t\t\t\texpl.addCodeLine(\"\",null,0,null);\r\n\t\t\t\texpl.addCodeLine(\"- Beim ersten Errechnen von sum1 und sum2 \"+op_counts[0]+\" Operationen\",null,0,null);\r\n\t\t\t\texpl.addCodeLine(\"- Beim Pruefen der Nachricht jeweils \"+op_counts[2]+\" Operationen\",null,0,null);\r\n\t\t\t\texpl.addCodeLine(\"... durchgefuehrt\",null,0,null);\r\n\t\t\t\texpl.addCodeLine(\"\",null,0,null);\r\n\t\t\t\texpl.addCodeLine(\"Man erkennt, dass die Zeitkomplexitaet ( der Hauptschleife ) bei n*4 liegt\",null,0,null);\r\n\t\t\t\texpl.addCodeLine(\"wobei n die Laenge der Nachricht ( die zu erweitern oder zu pruefen ist ) in Bytes ist.\",null,0,null);\r\n\t\t\t\texpl.addCodeLine(\"Dies steht im Gegensatz zu - zB. - dem CRC-Verfahren, welches (im schlimmsten Fall) von der Anzahl der einzelnen Bits abhaengt.\",null,0,null);\r\n\t\t\t\texpl.addCodeLine(\"\",null,0,null);\r\n\t\t\t\texpl.addCodeLine(\"Fazit: Ein einfacher, aber effektiver Algorithmus zur Erkennung\" +\r\n\t\t\t\t\t\t\" von uebertragungsfehlern. Hoffentlich war diese Animation aufschlussreich!\", null, 0, null);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 10 : \r\n\t\t\t\texpl = lang.newSourceCode(new Coordinates(300,150), \"\", null, expl_props);\r\n\t\t\t\texpl.addCodeLine(\"Die Schwaeche dieses Verfahrens liegt darin, dass es nicht zwischen den Bytes 11111111 und 00000000,\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"bzw. 255 und 0 ( in Dezimal ) unterscheiden kann, weswegen sich die Pruefsummen nicht geaendert und folgich der Fehler\", null, 0, null);\r\n\t\t\t\texpl.addCodeLine(\"leider nicht entdeckt wurde\", null, 0, null);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault : break;\r\n\t\t}\r\n\t\tlang.nextStep();\r\n\t}",
"private void calculateSensitivityExponent() {\n this.sensitivityExponent = Math.exp(-1.88 * percentageSensitivity);\n }",
"public double dblSueldoLider(){\n dblSueldoLider = super.getDblSalario() + ((super.getDblSalario() * 0.10) * intNum);\n return dblSueldoLider;\n }",
"int nbLignes();",
"NumericExpression createNumericExpression();",
"@Override\n\tprotected double calcularImpuestoVehiculo() {\n\t\treturn this.getValor() * 0.003;\n\t}",
"@Test\n public void test_ScientificNotation_0120() {\n ScientificNotation x = new ScientificNotation(BigInteger.ZERO);\n assertEquals(0, x.significand().doubleValue(), 0);\n assertEquals(0, x.exponent());\n }",
"public int getMultiplier() {\n return multiplier;\n }",
"public Polynom inputPow(Polynom polynom, CanonicForms g) {F newF;\n if ( (polynom.coeffs[0].numbElementType() < Ring.Polynom) && (polynom.coeffs[0].Im(g.newRing).isZero(g.newRing)) ) {// т.е. у него числовой коэффициент\n for (int p = polynom.powers.length - 1; p > g.RING.varNames.length - 1; p--) {\n if (polynom.powers[p] != 0) {\n if (polynom.powers[p] == 1) {Element simb=g.List_of_Change.get(p - g.RING.varNames.length);\n if (simb instanceof F ) {\n F func = (F) simb;\n if (func.name == F.LN || func.name == F.LG) {\n newF= new F(func.name, func.X[0].pow(polynom.coeffs[0].abs(g.newRing), g.newRing));\n } else if (func.name == F.LOG) {\n newF= new F(func.name, func.X[0], func.X[1].pow(polynom.coeffs[0].abs(g.newRing), g.newRing));\n } else continue;\n Polynom newPol=(Polynom)g.addNewElement(newF, 1);\n newPol.coeffs[0]= (polynom.coeffs[0].isNegative())? NumberZ.MINUS_ONE: NumberZ.ONE;\n for (int i = 0; i < polynom.powers.length; i++) newPol.powers[i]+=polynom.powers[i]; \n newPol.powers[p]=0;\n return newPol;\n }} \n }\n }\n }\n return polynom;\n }",
"public Inatnum multiply(Inatnum a) {\n Inatnum zero = new zeronatnum(); // we need a new zero natural number for our res\n Inatnum res = zero;// this is our res value where we store our information, it needs to start at 0\n //INV: i>0 && i-1 <= this.getval() && res = a^(i) ==> i=this.getval()-(this.getval()z-1)\n for(int i = this.getVal(); i>0;i--) {// setting our i value to our this and if its greater than zero decrement by 1\n //INV: i>0 && i <= this.getval() && res = a^i ==> i=this.getval()-(this.getval()\n\t\t\tres = res.add(a);//now we save our res value as the previous res value plus a. we do this as many times as we are multiplying by. So if it is 3 times\n //INV: i>0 && i <= this.getval() && res = a^i ==> i=this.getval()-(this.getval()-1) \n \t\t\t//i-- => i = this.getval()-(this.getval()-1-1)\n \t\t\t //INV: i>0 && i-1 <= this.getval() && res = a^(i) ==> i=this.getval()-(this.getval()-1-1)\n \t\t\t //INV: i>0 && i-1 <= this.getval() && res = a^(i) ==> i=this.getval()-(this.getval()z-1) \n\t\t\t // 4 then we are adding 4 3 times\n }\n\t\t\t //INV: i<0 && i-1 < this.getval() ==> i ==0 && res = a^i ==> i=this.getval()\n //Termination Argument: i starts at this.getval(), i decrements each time through the loop\n\t\t\t\t\t\t return res;// we need to return our res value that holds our current value.\n }",
"public float getUserExponent() {\n/* 195 */ return this.userExponent;\n/* */ }",
"public Exp transIntExp(int value){\r\n\t\treturn new Ex(new CONST(value));\r\n\t}",
"public double exponent()\n\t{\n\t\treturn _dblExponent;\n\t}",
"Double getMultiplier();",
"private double evaluarExp4() throws Excepciones{\n double resultado;\n double resultadoParcial;\n double ex;\n int t;\n resultado = evaluarExp5();\n if(token.equals(\"^\")){\n obtieneToken();\n resultadoParcial = evaluarExp4();\n ex = resultado;\n if(resultadoParcial == 0.0) {\n resultado = 1.0;\n }else{\n for(t=(int)resultadoParcial-1; t > 0; t--){\n resultado = resultado * ex;\n }\n }\n }\n return resultado;\n}",
"public void setPower(int i)\n {\n this.powerOfIi = i;\n }",
"private String peso(long peso,int i)\n {\n DecimalFormat df=new DecimalFormat(\"#.##\");\n //aux para calcular el peso\n float aux=peso;\n //string para guardar el formato\n String auxPeso;\n //verificamos si el peso se puede seguir dividiendo\n if(aux/1024>1024)\n {\n //variable para decidir que tipo es \n i=i+1;\n //si aun se puede seguir dividiendo lo mandamos al mismo metodo\n auxPeso=peso(peso/1024,i);\n }\n else\n {\n //si no se puede dividir devolvemos el formato\n auxPeso=df.format(aux/1024)+\" \"+pesos[i];\n }\n return auxPeso;\n }",
"@Test\n public void testLargeA() {\n assertEquals(18, PiGenerator.powerMod(123456, 2, 23));\n }",
"public void setPrecio(int precio) {\r\n\t\tthis.precio = precio;\r\n\t}",
"@Test\n public void testMultiplicar() {\n\tSystem.out.println(\"multiplicar\");\n\tdouble valor1 = 0.0;\n\tdouble valor2 = 0.0;\n\tCalculadora instance = new Calculadora();\n\tdouble expResult = 0.0;\n\tdouble result = instance.multiplicar(valor1, valor2);\n\tassertEquals(expResult, result, 0.0);\n\t// TODO review the generated test code and remove the default call to fail.\n\tfail(\"The test case is a prototype.\");\n }",
"@Override\n public int howManyXp() {\n return 2;\n }",
"public Builder setCurEXP(int value) {\n bitField0_ |= 0x00040000;\n curEXP_ = value;\n onChanged();\n return this;\n }",
"private static double lnInternal(double x){\n double a = 1 - x;\n double s = -a;\n double t = a;\n \n for (int i = 2; i < 25; i++){\n t = t*a;\n s -= t/i;\n }\n return s;\n }",
"@Override\r\n public double obtenerVolumen() {\n return Math.pow(getA(), 3);//eleva al cubo\r\n }",
"public static double foodCaloriesToElectronVolts(double num) { return (num*2.6*Math.exp(22)); }",
"public int getPower()\n {\n return this.powerOfIi;\n }",
"public static String powName(double base) {\n\t\tif (base == Math.E)\n\t\t\treturn \"exp\";\n\t\telse\n\t\t\treturn \"\" + MathUtil.format(base) + \"^\";\n\t}"
] | [
"0.59109473",
"0.5784483",
"0.5784483",
"0.57158154",
"0.56696373",
"0.56569684",
"0.5639356",
"0.55722034",
"0.55238694",
"0.5521597",
"0.54991597",
"0.54991597",
"0.54967695",
"0.54331857",
"0.5419188",
"0.5376576",
"0.53722763",
"0.53655136",
"0.5357465",
"0.5346934",
"0.5344983",
"0.5343615",
"0.53307563",
"0.53275794",
"0.5326473",
"0.53195167",
"0.531617",
"0.52909976",
"0.52892166",
"0.528808",
"0.5275918",
"0.5261583",
"0.52555776",
"0.5253922",
"0.52510023",
"0.52097476",
"0.52075535",
"0.51884055",
"0.5177878",
"0.51592803",
"0.5158028",
"0.51556396",
"0.5152051",
"0.5150376",
"0.51484334",
"0.51468265",
"0.51445323",
"0.5143572",
"0.5142579",
"0.51418746",
"0.5141511",
"0.51192296",
"0.5116379",
"0.5112762",
"0.5110886",
"0.51071334",
"0.51018196",
"0.5101623",
"0.50986266",
"0.50951135",
"0.5080908",
"0.50780624",
"0.50780624",
"0.5074347",
"0.50704503",
"0.5062952",
"0.50621194",
"0.50616",
"0.50597525",
"0.50560796",
"0.5052794",
"0.5052604",
"0.50494885",
"0.50486654",
"0.50440264",
"0.50386274",
"0.5036535",
"0.5034463",
"0.5029156",
"0.50208026",
"0.5018849",
"0.5014794",
"0.50056577",
"0.5004956",
"0.5002688",
"0.5001946",
"0.5000217",
"0.49959406",
"0.49959308",
"0.4983739",
"0.49833313",
"0.4981533",
"0.49811882",
"0.49777922",
"0.49773476",
"0.49655607",
"0.49625263",
"0.49610335",
"0.4960022",
"0.4957465",
"0.49490672"
] | 0.0 | -1 |
Creer une loi Binomiale Puis simule la loi en simulant nbRep valeurs | public static Double[] simulerBinomiale(Double nbRep, Double proba, Double repetition) {
Binomiale loi = new Binomiale(proba, nbRep, repetition);
return loi.simuler();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String creaElenco() {\n String testoTabella ;\n String riga = CostBio.VUOTO;\n ArrayList listaPagine = new ArrayList();\n ArrayList listaRiga;\n HashMap mappaTavola = new HashMap();\n String cognomeText;\n int num;\n int taglioPagine = Pref.getInt(CostBio.TAGLIO_COGNOMI_PAGINA);\n String tag = \"Persone di cognome \";\n ArrayList titoli = new ArrayList();\n titoli.add(LibWiki.setBold(\"Cognome\"));\n titoli.add(LibWiki.setBold(\"Voci\"));\n\n for (Map.Entry<String, Integer> mappa: mappaCognomi.entrySet()) {\n\n cognomeText = mappa.getKey();\n num = mappa.getValue();\n if (num >= taglioPagine) {\n cognomeText = tag + cognomeText + CostBio.PIPE + cognomeText;\n cognomeText = LibWiki.setQuadre(cognomeText);\n cognomeText = LibWiki.setBold(cognomeText);\n }// end of if cycle\n\n listaRiga = new ArrayList();\n listaRiga.add(cognomeText);\n listaRiga.add(num);\n listaPagine.add(listaRiga);\n\n }// end of for cycle\n mappaTavola.put(Cost.KEY_MAPPA_SORTABLE_BOOLEAN, true);\n mappaTavola.put(Cost.KEY_MAPPA_TITOLI, titoli);\n mappaTavola.put(Cost.KEY_MAPPA_RIGHE_LISTA, listaPagine);\n testoTabella = LibWiki.creaTable(mappaTavola);\n\n return testoTabella;\n }",
"private void generisiPolje() {\r\n\t\tint polje = rnd.nextInt(broj_slobodnih);\r\n\t\tint vrijednost = rnd.nextInt(4);\r\n\t\tif(vrijednost == 0)\r\n\t\t\tvrijednost = 4;\r\n\t\telse\r\n\t\t\tvrijednost = 2;\r\n\t\t\r\n\t\tint brojac = 0;\r\n\t\tfor(int i = 0 ; i < 4 ; i++)\r\n\t\t\tfor(int j = 0 ; j < 4 ; j++) {\r\n\t\t\t\tif(tabela[i][j] == 0) {\r\n\t\t\t\t\tif(brojac == polje)\r\n\t\t\t\t\t\ttabela[i][j] = vrijednost;\r\n\t\t\t\t\tbrojac++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tbroj_slobodnih--;\r\n\t}",
"public void affichageLabyrinthe () {\n\t\t//Affiche le nombre de coups actuel sur la console et sur la fenetre graphique\n\t\tSystem.out.println(\"Nombre de coups : \" + this.laby.getNbCoups() + \"\\n\");\t\t\n\t\tthis.enTete.setText(\"Nombre de coups : \" + this.laby.getNbCoups());\n\n\t\t//Affichage dans la fenêtre et dans la console du labyrinthe case par case, et quand la case est celle ou se trouve le mineur, affiche ce dernier\n\t\tfor (int i = 0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tString ligne = new String();\n\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (i != this.laby.getMineur().getY() || j != this.laby.getMineur().getX()) {\n\t\t\t\t\tligne = ligne + this.laby.getLabyrinthe()[i][j].graphismeCase();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.laby.getLabyrinthe()[i][j]=new Case();\n\t\t\t\t\tligne = ligne + this.laby.getMineur().graphismeMineur();\n\t\t\t\t}\t\t\t\t\n\t\t\t\tif (grille.getComponentCount() < this.laby.getLargeur()*this.laby.getHauteur()) {\n\t\t\t\t\tgrille.add(new JLabel());\n\t\t\t\t\t((JLabel)grille.getComponents()[i*this.laby.getLargeur()+j]).setIcon(this.laby.getLabyrinthe()[i][j].imageCase(themeJeu));\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(ligne);\n\t\t}\n\t\t((JLabel)grille.getComponents()[this.laby.getMineur().getY()*this.laby.getLargeur()+this.laby.getMineur().getX()]).setIcon(this.laby.getMineur().imageCase(themeJeu));\n\t}",
"public void afficherLru() {\n\t\tint nbrCols = listEtape.size();\n\t\tint nbrRows = 0;\n\t\tfor(ArrayList<Processus> list: listEtape) {\n\t\t\tif(list.size() > nbrRows) nbrRows = list.size(); \n\t\t}\n\t\t\n\t\taddColsRows(resultPane, nbrCols+1, nbrRows);\n\t\taddPanelForResult(resultPane);\n\t\n\n\t\tresultPane.setStyle(\"-fx-background-color: #23CFDC\");\n\n\t\t// Affichage du résultat\n\t\tfor(int i=0; i< listEtape.size();i++) {\n\t\t\tArrayList<Processus> list = listEtape.get(i); \n\t\t\tfor(int j=0; j<list.size(); j++) {\n\t\t\t\tProcessus p = list.get(j); \n\t\t\t\tLabel label = new Label(\"\" + p.getValue());\n\n\t\t\t\tresultPane.add(label, i+1, j);\n\t\t\t\tGridPane.setHalignment(label, HPos.CENTER);\n\n\t\t\t}\n\t\t}\n\t\tresultPane.setVisible(true);\n\t\tgenere = true;\n\t}",
"Batiment choixBatiment(Partie partie, int nbDoublon, Plateau plateau);",
"private void obsluga_bonusu()\n {\n if(bonusy_poziomu>0)\n {\n boolean numer= los.nextBoolean();\n if(numer){\n bon.add(new Bonus(w.getPolozenie_x(),w.getPolozenie_y(),getWidth(),getHeight()));\n bonusy_poziomu--;\n }\n }\n }",
"public void Nouvelleligne() {\n int maxEleve = retourneMaxNumber() + 1;\n try {\n Connector1.statement.executeUpdate(\"Insert INTO eleve(id_el) VALUES (\" + maxEleve + \")\");\n Object[] val = {maxEleve, \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"};\n effaceTable(jTable2, mode);\n mode.addRow(val);\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"ERROR \\n\" + e.getMessage());\n\n }\n\n }",
"public int initialiser()\n\t{\n\n\t\tint nombreE;\n\t\tint k = 0;\n\t\t//int max = randInt(2,10);\n\t\ttableauPeres_ = new Case[longueur_][longueur_];\n\t\tint i, j = 0;\n\t\tfor(i=0; i<longueur_; ++i)\n\t\t{\n\t\t\tfor(j=0; j<longueur_; ++j)\n\t\t\t{\n\t\t\t\ttableauPeres_[i][j] = new Case(i, j, 0);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Combien d'étoiles souhaitez vous pour chaque joueur ?\");\n\t\tnombreE = clavier.nextInt();\n\t\twhile (k < nombreE)\n\t\t{\n\t\t\taddEtoile(\"bleu\");\n\t\t\taddEtoile(\"rouge\");\n\t\t\t++k;\n\t\t}\n\t\treturn nombreE;\n\t}",
"Vaisseau_ordonneeLaPlusBasse createVaisseau_ordonneeLaPlusBasse();",
"@Override\n protected String elaboraBody() {\n String text = CostBio.VUOTO;\n int numCognomi = mappaCognomi.size();\n int numVoci = Bio.count();\n int taglioVoci = Pref.getInt(CostBio.TAGLIO_NOMI_ELENCO);\n\n text += A_CAPO;\n text += \"==Cognomi==\";\n text += A_CAPO;\n text += \"Elenco dei \";\n text += LibWiki.setBold(LibNum.format(numCognomi));\n text += \" cognomi '''differenti''' utilizzati nelle \";\n text += LibWiki.setBold(LibNum.format(numVoci));\n text += \" voci biografiche con occorrenze maggiori di \";\n text += LibWiki.setBold(taglioVoci);\n text += A_CAPO;\n text += creaElenco();\n text += A_CAPO;\n\n return text;\n }",
"Vaisseau_longueur createVaisseau_longueur();",
"public Plateau(int largeur, int hauteur) {\r\n\t\tplateau = new Cellule[hauteur][largeur];\r\n\t\tint equipe = 1;\r\n\t\tfor (int i=0; i<hauteur; i++) {\r\n\t\t\tfor (int j=0; j<largeur; j++) {\r\n\t\t\t\tif ((i == 0 && j == 0) || (i == hauteur-1 && j == largeur -1))\r\n\t\t\t\t\tplateau[i][j] = new Base(j,i,equipe++);\r\n\t\t\t\telse\r\n\t\t\t\t\tplateau[i][j] = new Case(j,i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.hauteur = hauteur;\r\n\t\tthis.largeur = largeur;\r\n\t}",
"public String getPremierNumeroLibre() {\n\t\tString requete_s = \"SELECT id from LIVRES\";\n\t\tint i = 0;\n\t\tboolean egalite = true;\n\t\t\n\t\ttry{\n\t\t\trequete.execute(requete_s);\n\t\t\t\n\t\t\tResultSet rs = requete.getResultSet();\n\t\t\t\n\t\t\tdo{\n\t\t\t\ti++;\n\t\t\t\trs.next();\n\t\t\t\tegalite = (i ==((Integer) rs.getObject(1)));\n\t\t\t}while(egalite);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tString s = \"\" + i;\n\t\t\n\t\treturn s;\n\t}",
"public void naplnVrcholy() {\r\n System.out.println(\"Zadajte pocet vrcholov: \");\r\n pocetVrcholov = skener.nextInt();\r\n for (int i=0; i < pocetVrcholov; i++) {\r\n nekonecno = (int)(Double.POSITIVE_INFINITY);\r\n if(i==0) { //pre prvy vrchol potrebujeme nastavit vzdialenost 0 \r\n String menoVrcholu = Character.toString((char)(i+65)); //pretipovanie int na String, z i=0 dostanem A\r\n Vrchol vrchol = new Vrchol(menoVrcholu, 0, \"\"); //vrcholu nastavim vzdialenost a vrcholPrichodu \r\n vrcholy.add(vrchol);\r\n } else { //ostatne budu mat nekonecno alebo v tomto pripade 9999 (lebo tuto hodnotu v mensich grafoch nepresiahnem)\r\n String menoVrcholu = Character.toString((char)(i+65)); //pretipovanie int na String, z i=0 dostanem A\r\n Vrchol vrchol = new Vrchol(menoVrcholu,nekonecno, \"\"); //vrcholu nastavim vzdialenost a vrcholPrichodu \r\n vrcholy.add(vrchol);\r\n }\r\n }\r\n }",
"private void creaModuloMem() {\n /* variabili e costanti locali di lavoro */\n ArrayList<Campo> campi = new ArrayList<Campo>();\n ModuloRisultati modulo;\n Campo campo;\n\n try { // prova ad eseguire il codice\n\n campo = CampoFactory.intero(Campi.Ris.codicePiatto.getNome());\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.nomePiatto.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"piatto\");\n campo.setToolTipLista(\"nome del piatto\");\n campo.decora()\n .etichetta(\"nome del piatto\"); // le etichette servono per il dialogo ricerca\n campo.setLarghezza(250);\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.categoria.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"categoria\");\n campo.setToolTipLista(\"categoria del piatto\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteVolte.getNome());\n campo.setVisibileVistaDefault();\n campo.setLarghezza(80);\n campo.setTitoloColonna(\"quante volte\");\n campo.setToolTipLista(\n \"quante volte questo piatto è stato offerto nel periodo analizzato\");\n campo.decora().etichetta(\"quante volte\");\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quantiCoperti.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"coperti\");\n campo.setToolTipLista(\"numero di coperti che avrebbero potuto ordinare\");\n campo.decora().etichetta(\"n. coperti\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteComande.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"comande\");\n campo.setToolTipLista(\"numero di comande effettive\");\n campo.decora().etichetta(\"n. comande\");\n campo.setLarghezza(80);\n campo.setTotalizzabile(true);\n campi.add(campo);\n\n campo = CampoFactory.percentuale(Campi.Ris.gradimento.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"gradimento\");\n campo.setToolTipLista(\n \"percentuale di gradimento (è il 100% se tutti i coperti potenziali lo hanno ordinato)\");\n campo.decora().etichetta(\"% gradimento\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n modulo = new ModuloRisultati(campi);\n setModuloRisultati(modulo);\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n }",
"public nhanvien() {\n initComponents();\n laysodong();\n if(count % 5 ==0 )\n {\n sotrang = count/5;\n }\n else\n {\n sotrang=count/5 + 1;\n }\n DAO_NV.dolentable(tblnhanvien,1);\n lbltrang.setText(\"1\");\n lblsotrang.setText(\"1/\"+sotrang);\n jButton3.setEnabled(false);\n jButton1.setEnabled(false);\n \n \n \n \n\n }",
"@Override\n\tpublic void crearNuevaPoblacion() {\n\t\t/* Nos quedamos con los mejores individuos. Del resto, cruzamos la mitad, los mejores,\n\t\t * y el resto los borramos.*/\n\t\tList<IIndividuo> poblacion2 = new ArrayList<>();\n\t\tint numFijos = (int) (poblacion.size()/2);\n\t\t/* Incluimos el 50%, los mejores */\n\t\tpoblacion2.addAll(this.poblacion.subList(0, numFijos));\n\t\t\n\t\t/* De los mejores, mezclamos la primera mitad \n\t\t * con todos, juntandolos de forma aleatoria */\n\t\tList<IIndividuo> temp = poblacion.subList(0, numFijos+1);\n\t\tfor(int i = 0; i < temp.size()/2; i++) {\n\t\t\tint j;\n\t\t\tdo {\n\t\t\t\tj = Individuo.aleatNum(0, temp.size()-1);\n\t\t\t}while(j != i);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tpoblacion2.addAll(cruce(temp.get(i), temp.get(j)));\n\t\t\t} catch (CruceNuloException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//this.poblacion.clear();\n\t\tthis.poblacion = poblacion2;\n\t}",
"public void balayer()\r\n {\r\n int tot=0;\r\n for (int i=0;i<LONGUEUR;i++ )\r\n {\r\n for (int j=0; j<LARGEUR; j++ )\r\n {\r\n tot=0;\r\n Haut = lignesHor[i][j];\r\n Droite = lignesVert[i+1][j];\r\n Bas = lignesHor[i][j+1];\r\n Gauche = lignesVert[i][j];\r\n\r\n if (Haut)\r\n {\r\n tot++;\r\n Vision[i][j][1]=1;\r\n }\r\n\r\n if (Droite)\r\n {\r\n tot++;\r\n Vision[i][j][2]=1;\r\n }\r\n\r\n if (Bas)\r\n {\r\n tot++;\r\n Vision[i][j][3]=1;\r\n }\r\n\r\n\r\n if (Gauche)\r\n {\r\n tot++;\r\n Vision[i][j][4]=1;\r\n }\r\n\r\n Vision[i][j][0]=Vision[i][j][1]+Vision[i][j][2]+Vision[i][j][3]+Vision[i][j][4];\r\n }\r\n }\r\n }",
"@Override\n public Vehicule creer(String immatriculation, String marque, String modele, Client client) {\n return new Voiture(immatriculation,marque,modele,client);\n }",
"private void addNerves(){\n Vector items = new Vector();\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_MEDIAN_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_MEDIAN_LEFT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_CUBITAL_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_CUBITAL_LEFT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_SQIATIQUE_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_SQIATIQUE_LEFT\");\n\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_MEDIAN_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_MEDIAN_LEFT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_CUBITAL_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_CUBITAL_LEFT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_SQIATIQUE_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_SQIATIQUE_LEFT\");\n\n if(verifyList(items)){\n contentTable = new PdfPTable(1);\n table = new PdfPTable(5);\n\n // title\n table.addCell(createItemNameCell(getTran(\"leprosy\",\"nerves\"),2));\n\n // dedicated table\n PdfPTable nervesTable = new PdfPTable(8);\n\n // header\n nervesTable.addCell(emptyCell(2));\n nervesTable.addCell(createHeaderCell(getTran(\"leprosy\",\"median\"),2));\n nervesTable.addCell(createHeaderCell(getTran(\"leprosy\",\"cubital\"),2));\n nervesTable.addCell(createHeaderCell(getTran(\"leprosy\",\"sciatiquepopliteexterne\"),2));\n\n // sub header\n nervesTable.addCell(emptyCell(2));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"right\"),1));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"left\"),1));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"right\"),1));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"left\"),1));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"right\"),1));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"left\"),1));\n\n //***** row 1 : epaissis *****\n cell = createHeaderCell(getTran(\"leprosy\",\"epaissis\"),2);\n cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT);\n nervesTable.addCell(cell);\n\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_MEDIAN_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_MEDIAN_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_CUBITAL_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_CUBITAL_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_SQIATIQUE_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_SQIATIQUE_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n\n //***** row 2 : douloureux *****\n cell = createHeaderCell(getTran(\"leprosy\",\"douloureux\"),2);\n cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT);\n nervesTable.addCell(cell);\n\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_MEDIAN_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_MEDIAN_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_CUBITAL_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_CUBITAL_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_SQIATIQUE_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_SQIATIQUE_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n\n // add nervesTable\n cell = createCell(new PdfPCell(nervesTable),3,PdfPCell.ALIGN_CENTER,PdfPCell.BOX);\n cell.setColspan(5);\n cell.setPadding(3);\n table.addCell(cell);\n\n // add table to transaction\n if(table.size() > 0){\n if(contentTable.size() > 0) contentTable.addCell(emptyCell());\n contentTable.addCell(createCell(new PdfPCell(table),1,PdfPCell.ALIGN_CENTER,PdfPCell.NO_BORDER));\n tranTable.addCell(new PdfPCell(contentTable));\n addTransactionToDoc();\n }\n }\n }",
"@Override\r\n\tpublic Bloco0 criarBloco(MovimentoMensalIcmsIpi movimentoMensalIcmsIpi) {\n\t\tLOG.log(Level.INFO, \"Montando o BLOCO 0, com INICIO em: {0} e TERMINO: {1} \", movimentoMensalIcmsIpi.getDataInicio());\r\n\t\tBloco0 bloco0 = new Bloco0();\r\n\t\t\r\n\t\t/**\r\n\t\t * TODO (Para ver/pensar melhor)\r\n\t\t * Ver se eu tenho que fazer alguma validação aqui. Ex.: irá preecher registro X para aquele Mês?\r\n\t\t * Tentar capturar possiveis erros.: Ex o famosão -> @NullPointerException\r\n\t\t */\r\n\t\t\r\n\t\tbloco0.setReg0000(reg0000Service.montarGrupoDeRegistroSimples(movimentoMensalIcmsIpi));\r\n\t\tbloco0.setReg0001(reg0001Service.montarGrupoDeRegistroSimples(movimentoMensalIcmsIpi));\r\n\t\tbloco0.setReg0005(reg0005Service.montarGrupoDeRegistroSimples(movimentoMensalIcmsIpi));\r\n\t\tbloco0.setReg0100(reg0100Service.montarGrupoDeRegistroSimples(movimentoMensalIcmsIpi));\r\n\t\tbloco0.setReg0150(reg0150Service.montarGrupoDeRegistro(movimentoMensalIcmsIpi));\r\n\t\tbloco0.setReg0190(reg0190Service.montarGrupoDeRegistro(movimentoMensalIcmsIpi));\r\n\t\tbloco0.setReg0200(reg0200Service.montarGrupoDeRegistro(movimentoMensalIcmsIpi));\r\n\t\tbloco0.setReg0400(reg0400Service.montarGrupoDeRegistro(movimentoMensalIcmsIpi));\r\n\t\tbloco0.setReg0450(reg0450Service.montarGrupoDeRegistro(movimentoMensalIcmsIpi));\r\n//\t\tbloco0.setReg0460(reg0460Service.montarGrupoDeRegistro(movimentoMensalIcmsIpi));\r\n//\t\tbloco0.setReg0990(montarEncerramentoDoBloco0(bloco0));\r\n\t\t\r\n\t\tLOG.log(Level.INFO, \"Montagem do BLOCO 0, TEMINADA! {0} \" ,bloco0);\r\n\t\treturn bloco0;\r\n\t}",
"public Voluntario() {\n super();\n this.livre = true;\n this.raio = 0;\n this.avaliacao = 0;\n this.numreviews = 0;\n\n //this.historico = new ArrayList<>() ;\n }",
"public void novaIgra() {\r\n\t\tbroj_slobodnih = 16;\r\n\t\tfor(int i = 0 ; i < 4 ; i++)\r\n\t\t\tfor(int j = 0 ; j < 4 ; j++)\r\n\t\t\t\ttabela[i][j] = 0;\r\n\t\tpobjeda = false;\r\n\t\tigrajPoslijePobjede = false;\r\n\t\tgenerisiPolje();\r\n\t\tgenerisiPolje();\r\n\t}",
"public Botella(int contenido_neto) {\n this.contenido_neto = contenido_neto;\n }",
"@Test\n @Tag(\"bm1000\")\n public void testRECIPELP() {\n CuteNetlibCase.doTest(\"RECIPELP.SIF\", \"-266.616\", \"-104.818\", NumberContext.of(7, 4));\n }",
"public void newComponent(byte i ){\n\t\tif(nbTabs > 2)\n\t\t\tJOptionPane.showMessageDialog(null, \"Nombre maximal d'onglets atteint\");\n\t\telse {\n\t\t\tnbTabs++;\n\t\t\tswitch(i){\n\t\t\t\tcase 1:\n\t\t\t\t\ttabs.addTab(\"Génération\" + nbTabs,new Tab(this));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0:\n\t\t\t\t\ttabs.addTab(\"Exemples\" ,new Example(this));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"@Test\n\tpublic void testCreateNewRoi() {\n\n\t\tproc = new ByteProcessor(1,3,new byte[] {7,5,3},null);\n\t\tip = new ImagePlus(\"America's Hardware Store\",proc);\n\n\t\t// this is the best that can be done ...\n\t\tip.createNewRoi(5,10);\n\t\tassertNotNull(ip.getRoi());\n\t}",
"public void crearAutomovil(){\r\n automovil = new Vehiculo();\r\n automovil.setMarca(\"BMW\");\r\n automovil.setModelo(2010);\r\n automovil.setPlaca(\"TWS435\");\r\n }",
"public CodeBook getCodificacion(){\n CodeBook res=new CodeBook();\n \n //Se obtiene los valores ni\n ArrayList<Integer> n=obtenerNi(obtenerYi());\n \n //Se asigna a cada carácter un código\n ArrayList<String> candidatos;\n int i=0;\n int cont_alfa=0;\n int nd=0;\n \n // Se comprueba para cada ni si es mayor que 0, en cuyo caso, se generan\n // los posibles códigos de longitud i que quedan libres y se asignan.\n while (i<n.size()){\n nd=nd*base;\n int cont=n.get(i);\n if (cont>0){\n candidatos=generaCod(i+1,nd);\n int cod=0;\n while (cont>0){\n res.add(alfabeto.getN(cont_alfa), candidatos.get(cod));\n nd++;\n cont_alfa++;\n cod++;\n cont--;\n }\n }\n i++;\n } \n return res;\n }",
"public IntegerGenotype create() \r\n\t{\n\t\tIntegerGenotype genotype = new IntegerGenotype(1,3);\r\n\t\tgenotype.init(new Random(), Data.numeroCuardillas); \r\n\t\t\r\n\t\treturn genotype;\r\n\t}",
"public final void setNbVie(final int nbV) {\n this.nbVie = nbV;\n }",
"public void afficherLfu() {\n\t\tint nbrCols = listEtapeLfu.size();\n\t\tint nbrRows = 0;\n\t\tfor(ArrayList<ProcessusLfu> list: listEtapeLfu) {\n\t\t\tif(list.size() > nbrRows) nbrRows = list.size(); \n\t\t}\n\t\taddColsRows(resultPane, nbrCols+1, nbrRows);\n\t\taddPanelForResult(resultPane);\n\t\t\n\t\tresultPane.setStyle(\"-fx-background-color: #23CFDC\");\n\n\t\t// Affichage du résultat\n\t\tfor(int i=0; i< listEtapeLfu.size();i++) {\n\t\t\tArrayList<ProcessusLfu> list = listEtapeLfu.get(i); \n\t\t\tfor(int j=0; j<list.size(); j++) {\n\t\t\t\tProcessusLfu p = list.get(j); \n\t\t\t\tLabel label = new Label(\"\" + p.getValue());\n\n\t\t\t\tresultPane.add(label, i+1, j);\n\t\t\t\tGridPane.setHalignment(label, HPos.CENTER);\n\n\t\t\t}\n\t\t}\n\t\tresultPane.setVisible(true);\n\t\tgenere = true;\n\t}",
"public int nbLibres() {\n\t\tint libre = 0;\n\t\tfor(Borne b : bornes) {\n\t\t\tlibre += b.getEtatBorne();\n\t\t}\n\t\treturn libre;\n\t}",
"Vaisseau_ordonneeLaPlusHaute createVaisseau_ordonneeLaPlusHaute();",
"private void montarLabelNumeros() {\n\r\n\t\tlblNumeros = new JLabel[this.dificuldade.getValor()][this.dificuldade.getValor()];\r\n\r\n\t\tBorder borda = BorderFactory.createLineBorder(Color.BLACK, 2);\r\n\r\n\t\tfor (int i = 0; i < lblNumeros.length; i++) {\r\n\t\t\tfor (int j = 0; j < lblNumeros.length; j++) {\r\n\t\t\t\tlblNumeros[i][j] = new JLabel(\"\", SwingConstants.CENTER);\r\n\t\t\t\tlblNumeros[i][j].setVisible(true);\r\n\r\n\t\t\t\tconfiguraFonteNumeros(lblNumeros[i][j]);//CHAMA PRA CONFIGURAR A FONTE BASEADO NA DIFICULDADE\r\n\r\n\t\t\t\tthis.painelJogo2.add(lblNumeros[i][j]);//ADICIONA NO PAINEL\r\n\t\t\t\tif (this.mapa.getCelula(i, j).isBomba() == false) {//\r\n\t\t\t\t\tif (this.mapa.getCelula(i, j).isEmBranco() == false) {//SE NAO FOR BOMBA NEM EM BRANCO CONFIGURA OS NUMEROS DAQUELE LABEL\r\n\t\t\t\t\t\tconfigurarNumeros(i, j);\r\n\t\t\t\t\t} \r\n\t\t\t\t} else {//SE FOR BOMBA, DEIXA OPACO, DEIXA O BACKGROUND VERMELHO E COLOCA O ICONE\r\n\t\t\t\t\tlblNumeros[i][j].setOpaque(true);\r\n\t\t\t\t\tlblNumeros[i][j].setBackground(Color.RED);\r\n\t\t\t\t\tlblNumeros[i][j].setIcon(iconBomba);\r\n\t\t\t\t}\r\n\t\t\t\tlblNumeros[i][j].setBorder(borda);//COLOCA UMA BORDA NO LABEL\r\n\t\t\t\tlblNumeros[i][j].setVisible(false);//DEIXA INVISIVEL, SO FICA VISIVEL QND O BOTAO DA MESMA POSICAO EH ABERTO\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void ucitajTestPodatke() {\n\t\tList<Integer> l1 = new ArrayList<Integer>();\n\n\t\tRestoran r1 = new Restoran(\"Palazzo Bianco\", \"Bulevar Cara Dušana 21\", KategorijeRestorana.PICERIJA, l1, l1);\n\t\tRestoran r2 = new Restoran(\"Ananda\", \"Petra Drapšina 51\", KategorijeRestorana.DOMACA, l1, l1);\n\t\tRestoran r3 = new Restoran(\"Dizni\", \"Bulevar cara Lazara 92\", KategorijeRestorana.POSLASTICARNICA, l1, l1);\n\n\t\tdodajRestoran(r1);\n\t\tdodajRestoran(r2);\n\t\tdodajRestoran(r3);\n\t}",
"@Override\n public ArrayList<String> Crear(){\n setVida(3500);\n Creado.add(0, Integer.toString(getVida()));\n Creado.add(1,\"150\");\n Creado.add(2,\"100\");\n Creado.add(3,\"70\");\n return Creado;\n }",
"public String createIban()\n {\n String iban = \"\";\n Random r = new Random();\n\n iban += \"NL\";\n for(int i = 1; i <=2; i++)\n {\n iban += Integer.toString(r.nextInt(10));\n }\n\n iban += \"INHO0\";\n for(int i = 1; i <=9; i++)\n {\n iban += Integer.toString(r.nextInt(10));\n }\n if(accountRepository.existsById(iban))\n {\n return createIban();\n }\n return iban;\n }",
"protected void creaPagine() {\n Pagina pag;\n Pannello pan;\n\n try { // prova ad eseguire il codice\n\n /* crea la pagina e aggiunge campi e pannelli */\n pag = this.addPagina(\"generale\");\n\n pan = PannelloFactory.orizzontale(this);\n pan.add(Cam.data);\n pan.add(Cam.importo.get());\n pan.add(Cam.note.get());\n pag.add(pan);\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }",
"private static void crearPedidoGenerandoOPPyOrdenInsumo() throws RemoteException {\n\t\tlong[] idVariedades = { 34, 49 };\n\t\tint[] cantidades = { 4, 2 };\n\t\tPedidoClienteDTO pedido = crearPedido(\"20362134596\", \"test 4\", idVariedades, cantidades);\n\n\t\tpedido = PedidoController.getInstance().crearPedido(pedido).toDTO();\n\n\t\tPedidoController.getInstance().cambiarEstadoPedidoCliente(pedido.getNroPedido(), EstadoPedidoCliente.ACEPTADO);\n\n\t}",
"public void createListData()\n {\n List<SinhVien> listSinhvien=new ArrayList<>();\n for(int i=0;i<10;i++){\n SinhVien sv=new SinhVien(i+\"\",\"123\",\"0123\",i+1.0f);\n listSinhvien.add(sv);\n }\n PresenterImplDangXuat.onLoadSucess(listSinhvien);\n }",
"public Billete(Usuario usuario, LocalDate fechaIda, LocalDate fechaVuelta, float precio_billete) {\r\n\t\t\r\n\t\tthis.nombrePasajero=usuario.getNombre();\r\n\t\tthis.apellido1_pasajero=usuario.getApellido1();\r\n\t\tthis.apellido2_pasajero=usuario.getApellido2();\r\n\t\tthis.pasaporte= usuario.getPasaporte();\r\n\t\tthis.idPasajero= usuario.getIdUsuario();\r\n\t\tthis.numeroBillete= idBillete++;\r\n\t\tthis.fechaIda = fechaIda;\r\n\t\tthis.fechaVuelta= fechaVuelta;\r\n\t\tthis.precioBillete = precio_billete;\r\n\t}",
"private void recolteNourriture() {\r\n\t\t\t//1pop recolte toute la case\r\n\t\t\tint tempNourr = 0;\r\n\t\t\tint totalPop = population + populationColoniale;\r\n\t\t\tint limite = (totalPop < caseOwned.size()) ? totalPop : caseOwned.size();\r\n\t\t\tfor(int id = 0; id < limite; id++) {\r\n\t\t\t\ttempNourr += caseOwned.get(id).getFood();\r\n\t\t\t}\r\n\t\t\t//animaux\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Bétail) * 10; //Ca mange de l'herbe, ça se tente.\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Cervidés) * 7.5; //CARIBOUUUUUUUUU !!\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Crabe) * 2; //ca pique les pied, a mort!!\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Elephants) * 30; //polution sonore\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Moutons) * 5; //kébab landais\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Poissons) * 5; //croustibat\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Chevaux) * 7; //lasagnes\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Baleines) * 50; //*bruit de baleine virile*\r\n\t\t\t//aplication des bonus\r\n\t\t\ttempNourr *= (1 + (0.15 * scienceLvl) + (0.05 * (bonheur - baseBonheur))); // +15% par scienceLvl +5% par bonheur excedentaire, -5% par bonheur négatif\r\n\t\t\t\r\n\t\t\tnourriture += tempNourr;\r\n\t\t\t//bonus de conservation grâce au sel\r\n\t\t\tif(howManyRessource(StrategicRessource.Sel) > 0 && nourriture > 0) nourriture *= 1.10;\r\n\t\t\t//limitation de stockage\r\n\t\t\tint stockageMax = caseOwned.size() * 100 * scienceLvl;\r\n\t\t\tif(nourriture > stockageMax) nourriture = stockageMax;\r\n\t\t}",
"static void makeROI(){\n\t\tfloat x1,y1;\n\t\tint N = pop.N;\n\n\t\tfor (int i=0;i<N;i++)\n\t\t{\n\t\t\tBalloon bal;\n\t\t\tbal = (Balloon)(pop.BallList.get(i));\n\t\t\tint n = bal.XX.length;\n\n\t\t\t// filtering (for testing purposes)\n\t\t\tboolean isToDraw = true;\n\t\t\tBalloon B0 = ((Balloon)(pop.BallList.get(i)));\n\t\t\tB0.mass_geometry();\n\t\t\tif (pop.contacts != null)\n\t\t\t{\n\t\t\t\tfor (int k=0;k<B0.n0;k++)\n\t\t\t\t{\n\t\t\t\t\tif (pop.contacts[i][k] == -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tisToDraw = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// draw\n\t\t\tshape.setWindingRule(0);\n\t\t\tif (isToDraw)\n\t\t\t{\n\t\t\t\tPolygonRoi Proi = B0.Proi;\n\t\t\t MROI.add(i1,Proi,i);\n\n\t\t\t // stuff to keep from old name\n/*\t\t\t int nROI = MROI.getCount()-1;\n\t\t\t String ROIName_old = MROI.getName(\"\"+nROI);\n\t\t\t String ROIName_new_sup = \"\";//ROIName_old.substring(4,14);\n\n\t\t\t // part of the name that change due to match the slice number\n\t\t\t String ROIName_new_sub = \"\";\n\t\t\t if (currentSlice<10)\n\t\t\t {\n\t\t\t\tROIName_new_sub = \"000\" + currentSlice;\n\t\t\t }\n\t\t\t else if (currentSlice<100)\n\t\t\t {\n\t\t\t\tROIName_new_sub = \"00\" + currentSlice;\n\t\t\t }\n\t\t\t else if (currentSlice<1000)\n\t\t\t {\n\t\t\t\tROIName_new_sub = \"0\" + currentSlice;\n\t\t\t }\n\t\t\t else if (currentSlice<10000)\n\t\t\t {\n\t\t\t\tROIName_new_sub = \"\" + currentSlice;\n\t\t\t }\n\t\t\t String ROIName_new = ROIName_old;//ROIName_new_sub + ROIName_new_sup;\n\t\t\t // Change names in the ROI manager\n\t\t\t IJ.runMacro(\"roiManager(\\\"Select\\\",\" + nROI + \") \",null);\n\t\t\t IJ.runMacro(\"roiManager(\\\"Rename\\\", \\\"\" + ROIName_new + \"\\\") \",null);\n*/\n\t\t\t}\n\t\t}\n\n\t}",
"private static void crearPedidoGenerandoOPPyOPCyOrdenInsumo() throws RemoteException {\n\t\tlong[] idVariedades = { 63, 34 };\n\t\tint[] cantidades = { 3, 3 };\n\t\tPedidoClienteDTO pedido = crearPedido(\"20362134596\", \"Pedido nuevo de cliente desde test\", idVariedades,\n\t\t\t\tcantidades);\n\n\t\tpedido = PedidoController.getInstance().crearPedido(pedido).toDTO();\n\n\t\tPedidoController.getInstance().cambiarEstadoPedidoCliente(pedido.getNroPedido(), EstadoPedidoCliente.ACEPTADO);\n\n\t}",
"private int generujViacZvierat(int pocet){\r\n int poc = 0;\r\n for (int i = 0; i < pocet; i++) {\r\n if (zoo.pridajZivocicha(vytvorZivocicha())) poc++;\r\n }\r\n return poc;\r\n }",
"public static void jouerAuJustePrix() {\n\t\tint nbVies=Tools.inputInt(\"Combien de tentatives voulez-vous ? \");\n\t\tint limite=Tools.inputInt(\"Quel est le nombre maximum à prendre en compte?\");\n\t\tint nbATrouver=Tools.randomint(limite);\n\t\tint nbPropose;\n\t\t\n\t\twhile (nbVies>0){\n\t\t\tnbPropose=Tools.inputInt(\"Saisissez un nombre : \");\n\t\t\tif (afficherResultatProposition(nbPropose, nbATrouver)) {\n\t\t\t\tbreak;\n\t\t\t};\n\t\t\tnbVies=nbVies-1;\n\t\t}\n\t\t\n\t\tif (nbVies==0) {\n\t\t\tSystem.out.println(\"Game Over\");\n\t\t}\n\t}",
"public void faiBagnetto() {\n System.out.println(\"Scrivere 1 per Bagno lungo, al costo di 150 Tam\\nSeleziona 2 per Bagno corto, al costo di 70 Tam\\nSeleziona 3 per Bide', al costo di 40 Tam\");\n\n switch (creaturaIn.nextInt()) {\n case 1 -> {\n puntiVita += 50;\n puntiFelicita -= 30;\n soldiTam -= 150;\n }\n case 2 -> {\n puntiVita += 30;\n puntiFelicita -= 15;\n soldiTam -= 70;\n }\n case 3 -> {\n puntiVita += 10;\n puntiFelicita -= 5;\n soldiTam -= 40;\n }\n }\n checkStato();\n }",
"public Nid(String matiere, int capacite)\n {\n // initialisation des variables d'instance\n this.matiere = matiere;\n this.capacite = capacite;\n }",
"public void popular(){\n DAO dao = new DAO();\n modelo.setNumRows(0);\n\n for(Manuais m: dao.selecTudoManuaisVenda()){\n modelo.addRow(new Object[]{m.getId(),m.getNome(),m.getClasse(),m.getEditora(),m.getPreco()+\".00 MZN\"});\n \n }\n }",
"public Bonus (){\n\t\tsuper (); \n\t\t//TODO [CORRECCION] Tiene una clase Config, utilizarla para estos valores fijos.\n\t\tthis.tiempoDeVida = Config.BONUS_VIDA; // cantidad de turnos\n\t\tPosicion posicion = new Posicion(randX.nextInt(), randY.nextInt());\n\t\tTamanio tamanio = new Tamanio(Config.BONUS_ANCHO, Config.BONUS_ALTO);\n\t\tthis.setPosicion(posicion);\n\t\tthis.setTamanio(tamanio);\n\t}",
"@Override\n public Libro createLibro(long isbn) {\n return libroPersistence.create(isbn);\n }",
"private JLabel getLblEkipeMorajuBiti() {\r\n\t\tif (lblEkipeMorajuBiti == null) {\r\n\t\t\tlblEkipeMorajuBiti = new JLabel(\"Ekipe moraju biti razlicite!\");\r\n\t\t\tlblEkipeMorajuBiti.setPreferredSize(new Dimension(150, 14));\r\n\t\t\tlblEkipeMorajuBiti.setVisible(false);\r\n\t\t}\r\n\t\treturn lblEkipeMorajuBiti;\r\n\t}",
"public void inicializa ()\n {\n LinkedList linhas = GestorFicheiros.getLinhasFicheiro ();\n for (int i = 0; i < linhas.size (); i++)\n {\n String aux = (String) linhas.get (i);\n polinomiosLidos.add (aux);\n Polinomio polinomio = new Polinomio (aux);\n if (polinomio.isPolinomio ())\n {\n polinomio.simplificaPolinomio ();\n polinomio.ordenaPolinomio ();\n }\n else\n {\n polinomiosLidos.remove (aux);\n Operacao operacao = new Operacao (aux);\n if (!(operacao.isOperacao ())) \n {\n operacoesLidas.remove (aux);\n JOptionPane.showMessageDialog (null, \"O programa não consegue identificar nenhum polinomio/operacão escrito correctamente na linha \" + (i + 1), \"Erro na conversao das linhas do ficheiro\", JOptionPane.ERROR_MESSAGE);\n }\n else operacoesLidas.add (aux);\n }\n }\n polinomios = GestorPolinomios.getPolinomios ();\n operacoes = GestorOperacoes.getOperacoes ();\n \n //Panel dos Polinomios\n jPanelPolinomios.setEnabled (false);\n jPanelPolinomios.setLayout (new GridBagLayout ());\n jPanelPolinomios.setSize (FRAME_WIDTH, FRAME_HEIGTH);\n \n jLabelPolinomios.setEnabled (true);\n jLabelPolinomios.setText (\"Polinomios\");\n jPanelPolinomios.add (jLabelPolinomios);\n \n numPolinomios = polinomios.size ();\n Vector columnsPolinomiosNames = new Vector ();\n columnsPolinomiosNames.add (\"Nome\");\n columnsPolinomiosNames.add (\"Valor lido\");\n columnsPolinomiosNames.add (\"Valor Final\");\n Vector rowsPolinomios = new Vector ();\n rowsPolinomios.add (columnsPolinomiosNames);\n \n String maxLido = \"Valor Lido\";\n String maxFinal = \"Valor final\";\n \n for (int i = 0; i < numPolinomios; i++)\n {\n Vector linhasPolinomios = new Vector ();\n Polinomio polinomio = (Polinomio) polinomios.get (i);\n linhasPolinomios.add (polinomio.getNome ());\n String valorLido = (String) polinomiosLidos.get (i);\n \n if(valorLido.substring (4, valorLido.length ()).length() > maxLido.length())\n maxLido = valorLido;\n \n String str = polinomio.getResto ();\n \n if(str.length() > maxFinal.length())\n maxFinal = str;\n \n linhasPolinomios.add (valorLido.substring (4, valorLido.length ()));\n if (str.equals (\"\")) linhasPolinomios.add (\"0\");\n else linhasPolinomios.add (str); \n rowsPolinomios.add (linhasPolinomios);\n }\n \n jTablePolinomios = new JTable (rowsPolinomios, columnsPolinomiosNames);\n jTablePolinomios.setEnabled (false);\n \n TableColumnModel tableColumnModelPolinomios = jTablePolinomios.getColumnModel ();\n TableColumn tableColumnPolinomios;\n\n (tableColumnPolinomios = tableColumnModelPolinomios.getColumn (0)).setPreferredWidth (75);\n (tableColumnPolinomios = tableColumnModelPolinomios.getColumn (1)).setPreferredWidth (maxLido.length () * 8);\n (tableColumnPolinomios = tableColumnModelPolinomios.getColumn (2)).setPreferredWidth (maxFinal.length () * 8);\n\n jPanelPolinomios.add (jTablePolinomios, gridBagConstraints);\n \n //Panel das Operacoes\n jPanelOperacoes.setEnabled (false);\n jPanelOperacoes.setLayout (new GridBagLayout ());\n jPanelOperacoes.setSize (FRAME_WIDTH, FRAME_HEIGTH);\n \n jLabelOperacoes.setEnabled (true);\n jLabelOperacoes.setText (\"Operacoes\");\n jPanelOperacoes.add (jLabelOperacoes);\n \n numOperacoes = operacoes.size ();\n Vector columnsOperacoesNames = new Vector ();\n columnsOperacoesNames.add (\"Nome\");\n columnsOperacoesNames.add (\"Expressao\");\n columnsOperacoesNames.add (\"Resultado\");\n Vector rowsOperacoes = new Vector ();\n rowsOperacoes.add (columnsOperacoesNames);\n \n String maxExp = \"Expressao\";\n String maxRes = \"Resultado\";\n \n for (int i = 0; i < numOperacoes; i++)\n {\n Vector linhasOperacoes = new Vector ();\n Operacao operacao = (Operacao) operacoes.get (i);\n linhasOperacoes.add (operacao.getNome ());\n String valorLido = (String) operacoesLidas.get (i);\n \n if(valorLido.substring (4, valorLido.length ()).length() > maxExp.length())\n maxExp = valorLido;\n \n String str = Calculadora.calcula (Calculadora.infixaPosFixa (operacao));\n \n String op = operacao.toString ();\n char opAux[] = op.toCharArray ();\n for (int j = 0; j < op.length (); j++)\n {\n if (str.equals (\"0\")) if (opAux[j] == '/') JOptionPane.showMessageDialog (null, \"A expressão aritmética \" + operacao.getNome () + \" inclui operações de divisão não exacta\", \"Erro na divisão de polinomios\", JOptionPane.ERROR_MESSAGE);\n }\n \n if(str.length() > maxRes.length())\n maxRes = str;\n \n linhasOperacoes.add (valorLido.substring (4, valorLido.length ()));\n linhasOperacoes.add (str);\n rowsOperacoes.add (linhasOperacoes);\n }\n \n jTableOperacoes = new JTable (rowsOperacoes, columnsOperacoesNames);\n jTableOperacoes.setEnabled (false);\n \n TableColumnModel tableColumnModelOperacoes = jTableOperacoes.getColumnModel ();\n TableColumn tableColumnOperacoes;\n\n (tableColumnOperacoes = tableColumnModelOperacoes.getColumn (0)).setPreferredWidth (75);\n (tableColumnOperacoes = tableColumnModelOperacoes.getColumn (1)).setPreferredWidth (maxExp.length () * 8);\n (tableColumnOperacoes = tableColumnModelOperacoes.getColumn (2)).setPreferredWidth (maxRes.length () * 8);\n \n jPanelOperacoes.add (jTableOperacoes, gridBagConstraints);\n \n if (polinomios.size () != 0) jItemVerPolinomios.setEnabled (true);\n if (operacoes.size () != 0) jItemVerOperacoes.setEnabled (true);\n }",
"int nbLignes();",
"public GrapheIndicateursProjet (Projet p) {\n seuils = p.getSeuilFixes() ;\n \n // pour l'echelle, on determine les mesures max de toutes les iterations\n \n \n iterations = p.getListeIt() ; \n nbIt = iterations.size() ;\n \n // calcul des maximums\n Iteration tempIt = null ;\n IndicateursIteration tempIndIt = null ;\n for (int i = 0 ; i < nbIt ; i++)\n {\n if (iterations.get(i) instanceof Iteration)\n {\n tempIt = (Iteration)iterations.get(i) ;\n tempIndIt = tempIt.getIndicateursIteration() ;\n // charges\n if (tempIndIt.getTotalCharges() > chargesMax) { chargesMax = tempIndIt.getTotalCharges() ; }\n\t\tif (tempIndIt.getChargeMoyenneParticipants() > moyenneChargesMax) { moyenneChargesMax = tempIndIt.getChargeMoyenneParticipants() ; }\n\t\tif (tempIndIt.getNombreParticipants() > participantsMax) { participantsMax = tempIndIt.getNombreParticipants() ; }\n\t\tif (tempIndIt.getNombreTachesTerminees() > tachesTermineesMax) { tachesTermineesMax = tempIndIt.getNombreTachesTerminees() ; }\n\t\tif (tempIndIt.getNombreMoyenTachesParticipants() > tachesParticipantsMax) { tachesParticipantsMax = tempIndIt.getNombreMoyenTachesParticipants() ; }\n\t\tif (tempIndIt.getDureeMoyenneTaches() > dureeMoyenneTacheMax) { dureeMoyenneTacheMax = tempIndIt.getDureeMoyenneTaches() ; }\n }\n }\n setPreferredSize(new Dimension(ITERATION_WIDTH * nbIt,440));\n\t//setBorder(new TitledBorder(new EtchedBorder(), \"toto\", 5, TitledBorder.ABOVE_TOP)) ;\n }",
"public void gagne()\r\n\t{\r\n\t\tthis.nbVictoires++;\r\n\t}",
"int generarNumeroNota();",
"public Coup coupIA() {\n\n int propriete = TypeCoup.CONT.getValue();\n int bloque = Bloque.NONBLOQUE.getValue();\n Term A = intArrayToList(plateau1);\n Term B = intArrayToList(plateau2);\n Term C = intArrayToList(piecesDispos);\n Variable D = new Variable(\"D\");\n Variable E = new Variable(\"E\");\n Variable F = new Variable(\"F\");\n Variable G = new Variable(\"G\");\n Variable H = new Variable(\"H\");\n org.jpl7.Integer I = new org.jpl7.Integer(co.getValue());\n q1 = new Query(\"choixCoupEtJoue\", new Term[] {A, B, C, D, E, F, G, H, I});\n\n\n if (q1.hasSolution()) {\n Map<String, Term> solution = q1.oneSolution();\n int caseJ = solution.get(\"D\").intValue();\n int pion = solution.get(\"E\").intValue();\n Term[] plateau1 = listToTermArray(solution.get(\"F\"));\n Term[] plateau2 = listToTermArray(solution.get(\"G\"));\n Term[] piecesDispos = listToTermArray(solution.get(\"H\"));\n for (int i = 0; i < 16; i++) {\n if (i < 8) {\n this.piecesDispos[i] = piecesDispos[i].intValue();\n }\n this.plateau1[i] = plateau1[i].intValue();\n this.plateau2[i] = plateau2[i].intValue();\n }\n\n int ligne = caseJ / 4;\n int colonne = caseJ % 4;\n\n if (pion == 1 || pion == 5) {\n pion = 1;\n }\n if (pion == 2 || pion == 6) {\n pion = 0;\n }\n if (pion == 3 || pion == 7) {\n pion = 2;\n }\n if (pion == 4 || pion == 8) {\n pion = 3;\n }\n\n\n Term J = intArrayToList(this.plateau1);\n q1 = new Query(\"gagne\", new Term[] {J});\n System.out.println(q1.hasSolution() ? \"Gagné\" : \"\");\n if (q1.hasSolution()) {\n propriete = 1;\n }\n return new Coup(bloque,ligne, colonne, pion, propriete);\n }\n System.out.println(\"Bloqué\");\n return new Coup(1,0, 0, 0, 3);\n }",
"public Mueble(String nombre_mueble_ensamble, Double precio) {\n this.nombre_mueble_ensamble = nombre_mueble_ensamble;\n this.precio = precio;\n }",
"@Override\n public Vehicule creer(String immatriculation, String marque, String modele, Client client, int tonnage, int hauteur) {\n return new Camion(immatriculation,marque,modele,client,tonnage,hauteur);\n }",
"private void populaAluno()\n {\n Calendar nasc = Calendar.getInstance();\n nasc.set(Calendar.DAY_OF_MONTH, 24);\n nasc.set(Calendar.MONTH, 03);\n nasc.set(Calendar.YEAR, 1989);\n Aluno c = new Aluno();\n c.setNome(\"Christian \");\n c.setEmail(\"c@gmail.com\");\n c.setCpf(\"33342523501\");\n c.setAltura(1.76);\n c.setPeso(70);\n c.setSenha(CriptografiaLogic.encriptar(\"r\"));\n c.setRg(\"22233344401\");\n c.setDataNascimento(nasc);\n c.setNumSolicitacao(0);\n alunoDAO.insert(c);\n\n for (int i = 1; i < 500; i++)\n {\n nasc.set(Calendar.DAY_OF_MONTH, NumberLogic.randomInteger(1, 28));\n nasc.set(Calendar.MONTH, NumberLogic.randomInteger(1, 12));\n nasc.set(Calendar.YEAR, NumberLogic.randomInteger(1940, 1995));\n Aluno a = new Aluno();\n a.setNome(\"Aluno \" + i);\n a.setEmail(\"aluno\" + i + \"@gmail.com\");\n a.setCpf(String.valueOf(NumberLogic.randomInteger(100000000, 999999999)));\n a.setAltura(NumberLogic.randomDouble(1.60d, 1.99d));\n a.setPeso(NumberLogic.randomInteger(60, 100));\n a.setSenha(CriptografiaLogic.encriptar(\"123\"));\n a.setRg(String.valueOf(NumberLogic.randomInteger(100000000, 999999999)));\n a.setDataNascimento(nasc);\n a.setNumSolicitacao(0);\n alunoDAO.insert(a);\n }\n }",
"public void creaAddebitiGiornalieri(AddebitoFissoPannello pannello,\n int codConto,\n Date dataInizio,\n Date dataFine) {\n /* variabili e costanti locali di lavoro */\n boolean continua = true;\n Modulo modAddFisso;\n ArrayList<CampoValore> campiFissi;\n Campo campoQuery;\n CampoValore campoVal;\n ArrayList<WrapListino> lista;\n ArrayList<AddebitoFissoPannello.Riga> righeDialogo = null;\n int quantita;\n\n try { // prova ad eseguire il codice\n\n modAddFisso = this.getModulo();\n campiFissi = new ArrayList<CampoValore>();\n\n /* recupera dal dialogo il valore obbligatorio del conto */\n if (continua) {\n campoQuery = modAddFisso.getCampo(Addebito.Cam.conto.get());\n campoVal = new CampoValore(campoQuery, codConto);\n campiFissi.add(campoVal);\n }// fine del blocco if\n\n /* recupera dal dialogo il pacchetto di righe selezionate */\n if (continua) {\n righeDialogo = pannello.getRigheSelezionate();\n }// fine del blocco if\n\n /* crea il pacchetto delle righe di addebito fisso da creare */\n if (continua) {\n\n /* traverso tutta la collezione delle righe selezionate nel pannello */\n for (AddebitoFissoPannello.Riga riga : righeDialogo) {\n lista = ListinoModulo.getPrezzi(riga.getCodListino(),\n dataInizio,\n dataFine,\n true,\n false);\n quantita = riga.getQuantita();\n for (WrapListino wrapper : lista) {\n this.creaAddebitoFisso(codConto, dataInizio, wrapper, quantita);\n }\n } // fine del ciclo for-each\n }// fine del blocco if\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }",
"@Override\r\n\tpublic void crearVehiculo() {\n\t\t\r\n\t}",
"public Sort1LoopCloneProblem(int numReps){\n\t\tsetString(numReps);\n\t}",
"private void inicializarJuego() {\n\t\tList<VerboIrregular> lista = utilService.getVerbosIrregulares(faciles, normales, dificiles);\n\n\t\trealmService.cambiarMostrarRespuestasVerbosIrregulares(lista, false);\n\n\t\tverbosIrregularesDesordenadas.clear();\n\n\t\tfor (VerboIrregular x : lista) {\n\t\t\tverbosIrregularesDesordenadas.add(x);\n\t\t}\n\n\t\tCollections.shuffle(verbosIrregularesDesordenadas);\n\t\t// --------------------------------------------------------------\n\n\t\t//------- Esto es por si el usuario quita una palabra problematica y se resetea el juego\n\t\tif (cantidadItems > verbosIrregularesDesordenadas.size()) {\n\t\t\tcantidadItems = verbosIrregularesDesordenadas.size();\n\t\t}\n\t\t// ---------------------------------------------------------------------------------\n\n\t\tverbosIrregularesDesordenadas = verbosIrregularesDesordenadas.subList(0, cantidadItems);\n\n\t\tindice = 0;\n\t\tsetearTitulo();\n\n\t\tbtRestart.setVisibility(View.INVISIBLE);\n\t\tivCongratulations.setVisibility(View.INVISIBLE);\n\t\tmbNext.setVisibility(View.VISIBLE);\n\t\tbtPrevious.setVisibility(View.INVISIBLE);\n\t\ttvJuegoCantidadPalabras.setVisibility(View.VISIBLE);\n\t\tbtMostrarRespuestaJuego.setVisibility(View.VISIBLE);\n\t\ttvInfinitivo.setVisibility(View.VISIBLE);\n\t\tbtDificultad.setVisibility(View.VISIBLE);\n\t\tlyRespuestaJuego.setVisibility(View.INVISIBLE);\n\t\tbtVolver.setVisibility(View.INVISIBLE);\n\n\t\tsetearTextoArribaYColorDeBoton();\n\t}",
"public void creationPlateau() {\n for (int i = 0; i < 10; i++) {\n int X = rand.nextInt(14);\n int Y = rand.nextInt(14);\n if (plateau[X][Y] == null && espacementMonstre(X,Y,plateau)) {\n int monstreAleatoire = 1 + (int)(Math.random() * ((3 - 1) + 1));\n switch (monstreAleatoire) {\n case 1:\n Personnage monstreD = new Dragonnet(X,Y);\n plateau[X][Y] = monstreD;\n this.monstre.add(monstreD);\n System.out.println(\"Dragonnet ajouté en position : \"+X+\" \"+Y);\n break;\n case 2:\n Personnage monstreL = new Loup(X,Y);\n plateau[X][Y] = monstreL;\n this.monstre.add(monstreL);\n System.out.println(\"Loup ajouté en position : \"+X+\" \"+Y);\n\n break;\n case 3:\n Personnage monstreO = new Orque(X,Y);\n plateau[X][Y] = monstreO;\n this.monstre.add(monstreO);\n System.out.println(\"Orque ajouté en position : \"+X+\" \"+Y);\n break;\n }\n } else {\n i --;\n }\n }\n }",
"public void retournerLesPilesParcelles() {\n int compteur = 0;\n //pour chacune des 4 piles , retourner la parcelle au sommet de la pile\n for (JLabel jLabel : pileParcellesGUI) {\n JLabel thumb = jLabel;\n retournerParcelles(thumb, compteur);\n compteur++;\n }\n }",
"private void creaPannelli() {\n /* variabili e costanti locali di lavoro */\n Pannello pan;\n\n try { // prova ad eseguire il codice\n\n /* pannello date */\n pan = this.creaPanDate();\n this.addPannello(pan);\n\n /* pannello coperti */\n PanCoperti panCoperti = new PanCoperti();\n this.setPanCoperti(panCoperti);\n this.addPannello(panCoperti);\n\n\n /* pannello placeholder per il Navigatore risultati */\n /* il navigatore vi viene inserito in fase di inizializzazione */\n pan = new PannelloFlusso(Layout.ORIENTAMENTO_ORIZZONTALE);\n this.setPanNavigatore(pan);\n this.addPannello(pan);\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n }",
"public void initialiserLesCasesDuPlateau()\n\t{\n\t\tthis.unTableau.removeAll();\n\t\t\n\t\tfor(int nombreDeCasesParLigne = 1 ; nombreDeCasesParLigne < 4 ; nombreDeCasesParLigne++)\n\t\t\tfor(int nombreDeCasesParColonne = 1 ; nombreDeCasesParColonne < 4 ; nombreDeCasesParColonne++)\n\t\t\t\tthis.unTableau.add(new BoutonCase(\"\",nombreDeCasesParLigne,nombreDeCasesParColonne, this.unControleur, this));\n\t\t\n\t\tthis.unTableau.updateUI();\n\t}",
"@Test\n public void obtenerTipoRespuesta_NB(){\n NumberBoxRecrea nbRecrea=new NumberBoxRecrea();\n String texto=Util.RESPUESTA_TIPO_NUMERO;\n assertEquals(texto,contCons.ObtenerTipoRespuesta(nbRecrea));\n }",
"private static void statistique(){\n\t\tfor(int i = 0; i<7; i++){\n\t\t\tfor(int j = 0; j<7; j++){\n\t\t\t\tfor(int l=0; l<jeu.getJoueurs().length; l++){\n\t\t\t\t\tif(jeu.cases[i][j].getCouleurTapis() == jeu.getJoueurs()[l].getNumJoueur()){\n\t\t\t\t\t\tjeu.getJoueurs()[l].setTapis(jeu.getJoueurs()[l].getTapisRest()+1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tJoueur j;\n\t\tSystem.out.println(\"// Fin de la partie //\");\n\t\tfor(int i=0; i<jeu.getJoueurs().length; i++) {\n\t\t\tj =jeu.getJoueurs()[i];\n\t\t\tSystem.out.println(\"Joueur \"+ (j.getNumJoueur()+1) + \" a obtenue \"+j.getTapisRest()+j.getMonnaie()+\" points\" );\n\t\t}\n\t}",
"public void crearIndiceInvertido() throws IOException {\n BufferedReader archivoVocabulario = new BufferedReader(new InputStreamReader(new FileInputStream(this.rutaVocabulario), \"utf-8\"));\n String lineaVocabularioActual = archivoVocabulario.readLine();\n\n while(lineaVocabularioActual != null){\n String[] entradaVocabulario = lineaVocabularioActual.split(\"\\\\s\");\n this.archivoIndice.escribirEnArchivo(entradaVocabulario[0] + \" \" + this.posicionActual + \" \" + entradaVocabulario[1], true);\n this.posicionActual += Integer.parseInt(entradaVocabulario[1]);\n\n System.out.println(\"Palabra: \" + entradaVocabulario[0] + \" agregada al índice\\n\");\n\n Integer archivosEncontrados = 0;\n Integer archivoFrecuenciaActual = 0;\n while(archivoFrecuenciaActual < this.cantidadDocumentos){\n System.out.println(\"Archivo \" + archivoFrecuenciaActual + \"\\n\");\n if(archivosEncontrados < Integer.parseInt(entradaVocabulario[1])){\n /** Carga el archivo de frecuencia */\n BufferedReader archivoFrecuencia = new BufferedReader(new InputStreamReader(new FileInputStream(this.rutaFrecuencias + \"/\" + archivoFrecuenciaActual + \".freq\"), \"utf-8\"));\n String lineaFrecuenciaActual = archivoFrecuencia.readLine();\n\n while(lineaFrecuenciaActual != null){\n String[] entradaFrecuencia = lineaFrecuenciaActual.split(\"\\\\s\");\n\n if(entradaFrecuencia[0].equals(entradaVocabulario[0])){\n Double tf = 1 + log(Double.parseDouble(entradaFrecuencia[1]));\n Double idf = log(1 + (cantidadDocumentos/Integer.parseInt(entradaVocabulario[1])));\n Double peso = tf*idf;\n\n this.archivoPostings.escribirEnArchivo(archivoFrecuenciaActual + \" \" + peso, true);\n archivosEncontrados++;\n System.out.println(\"posting agregado\\n\");\n break;\n }\n\n lineaFrecuenciaActual = archivoFrecuencia.readLine();\n }\n\n archivoFrecuencia.close();\n }\n else{\n System.out.println(\"no más postings\\n\");\n break;\n }\n archivoFrecuenciaActual++;\n }\n lineaVocabularioActual = archivoVocabulario.readLine();\n }\n\n archivoVocabulario.close();\n }",
"public void bilan_zone() {\n\n JLabel lbl_Bilan = new JLabel(\"BILAN :\");\n lbl_Bilan.setBounds(40, 170, 119, 16);\n add(lbl_Bilan);\n\n bilan_content = new JTextArea();\n bilan_content.setBounds(100, 170, 200, 150);\n bilan_content.setText(rapport_visite.elementAt(DAO_Rapport.indice)[3]);\n bilan_content.setLineWrap(true);\n bilan_content.setWrapStyleWord(true);\n bilan_content.setEditable(false);\n add(bilan_content);\n\n\n }",
"public void creaAziendaAgricola(){\n\t\tCantina nipozzano = creaCantina(\"Nipozzano\");\t\n\t\tBotte[] bottiNipozzano = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiNipozzano.length; i++){\n\t\t\tbottiNipozzano[i] = creaBotte(nipozzano, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\t\t\n\t\tVigna mormoreto = creaVigna(\"Mormoreto\", 330, 25, EsposizioneVigna.sud, \"Terreni ricchi di sabbia, ben drenati. Discreta presenza di calcio. pH neutro o leggermente alcalino\");\n\t\tFilare[] filariMormoreto = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMormoreto.length;i++){\n\t\t\tfilariMormoreto[i] = creaFilare(mormoreto, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\t\n\t\tVigna montesodi = creaVigna(\"Montesodi\", 400, 20, EsposizioneVigna.sud_ovest, \"Arido e sassoso, di alberese, argilloso e calcareo, ben drenato, poco ricco di sostanza organica\");\n\t\tFilare[] filariMontesodi = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMontesodi.length;i++){\n\t\t\tfilariMontesodi[i] = creaFilare(montesodi, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t/*\n\t\t * CANTINA: POMINO - VIGNETO BENEFIZIO\n\t\t */\n\t\t\n\t\tCantina pomino = creaCantina(\"Pomino\");\n\t\tBotte[] bottiPomino = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiPomino.length; i++){\n\t\t\tbottiPomino[i] = creaBotte(pomino, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\n\t\tVigna benefizio = creaVigna(\"Benefizio\", 700, 9, EsposizioneVigna.sud_ovest, \"Terreni ricchi di sabbia, forte presenza di scheletro. Molto drenanti. Ricchi in elementi minerali. PH acido o leggermente acido.\");\n\t\tFilare[] filariBenefizio = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariBenefizio.length;i++){\n\t\t\tfilariBenefizio[i] = creaFilare(benefizio, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(nipozzano);\n\t\taziendaAgricolaDAO.saveLuogo(mormoreto);\n\t\taziendaAgricolaDAO.saveLuogo(montesodi);\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(pomino);\n\t\taziendaAgricolaDAO.saveLuogo(benefizio);\n\t\t\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Giulio d'Afflitto\"));\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Francesco Ermini\"));\n\n\t\t\n\t}",
"public Labyrinthe (int h, int l) {\n\thauteur = h;\n\tlargeur = l;\n\ttailleRoute = 0;\n\tGenererLab (h, l);\n }",
"public abstract int getCntPoa();",
"public static void IngresoDatos(){\n int IFila=0,ICol=0;\n int INota;\n for(IFila=0;IFila<10;IFila++)\n {\n StrNotas[IFila][0]=JOptionPane.showInputDialog(null, \"Ingrse nombre del alumno:\");\n INota=LlenadoRandom(0,100);\n StrNotas[IFila][1]=Integer.toString(INota);\n if(INota<61)\n StrNotas[IFila][2]=\"Perdio\";\n else\n StrNotas[IFila][2]=\"gano\";\n }\n }",
"private void MembentukListHuruf(){\n for(int i = 0; i < Panjang; i ++){\n Huruf Hrf = new Huruf();\n Hrf.CurrHrf = Kata.charAt(i);\n if(!IsVertikal){\n //horizontal\n Hrf.IdX = StartIdxX;\n Hrf.IdY = StartIdxY+i;\n }else{\n Hrf.IdX = StartIdxX+i;\n Hrf.IdY = StartIdxY;\n }\n // System.out.println(\"iniii \"+Hrf.IdX+\" \"+Hrf.IdY+\" \"+Hrf.CurrHrf+\" \"+NoSoal);\n TTS.Kolom[Hrf.IdX][Hrf.IdY].AddNoSoal(NoSoal);\n TTS.Kolom[Hrf.IdX][Hrf.IdY].Huruf=Hrf.CurrHrf;\n \n }\n }",
"public bEvaluacionOrientacionAresultados(int i, int c) {\n this.id_evaluacion = i;\n this.codigo = c;\n initComponents();\n jLabel1.setText(\"<html><b>Define prioridades y orienta a su equipo a lograr los objetivos</b></html>\");\n jLabel2.setText(\"<html><b>Acuerda con sus compañeros la entrega de los resultados en el tiempo\\n\" +\n\"establecido</b></html>\");\n jLabel3.setText(\"<html><b>Promueve con sus compañeros la utilización adecuada de los recursos para,\\n\" +\n\"realizar su trabajo</b></html>\");\n jLabel4.setText(\"<html><b>Investiga y busca conocimiento sobre temas relacionados con su\\n\" +\n\"trabajo</b></html>\");\n jLabel5.setText(\"<html><b>Incorpora mejoras en los procesos bajo su responsabilidad</b></html>\");\n \n jLabel6.setText(\"<html><b>2.Orientación a resultados: realizar las funciones y cumplir los compromisos organizacionales con eficacia y calidad.</b></html>\");\n l1.setText(\"<html><b><center> por debajo de lo esperado <br> 0 - 50 </center></b></html>\");\n l2.setText(\"<html><b><center> A mejorar <br> 51 - 65 </center></b></html>\");\n l3.setText(\"<html><b><center> Aceptable <br> 66 - 84 </center></b></html>\");\n l4.setText(\"<html><b><center> Destacado <br> 85 - 100 </center></b></html>\");\n foto();\n \n }",
"public Grille creationGrille() {\n\t\tList<Mot> listeMots = new ArrayList<Mot>();\r\n\r\n\t\t// Init de la liste de cases\r\n\t\tList<Case> cases = new ArrayList<Case>();\r\n\r\n\t\t// Init de la grille\r\n\t\tGrille grille = new Grille();\r\n\t\tgrille.setDifficulte(Difficulte.moyen);\r\n\r\n\t\t// Creation de la liste de mots\r\n\t\tlisteMots = creerListeMots(grille);\r\n\r\n\t\t// Creation de la liste de cases avec les mots/couleurs\r\n\t\tcases = creerListeCase(listeMots, grille);\r\n\r\n\t\t// affection de la liste de cases a la grille et inverse\r\n\t\tgrille.setCases(cases);\r\n\t\tdaoGrille.save(grille);\r\n\t\tfor (Case c : cases) {\r\n\t\t\tc.setGrille(grille);\r\n\t\t\tdaoCase.save(c);\r\n\t\t}\r\n\r\n\t\treturn grille;\r\n\r\n\t}",
"Vaisseau_abscisseLaPlusADroite createVaisseau_abscisseLaPlusADroite();",
"private static Bala tipoBala(int idPj, Vector2 posicionRelativaRecibido, int tamanoBala) {\n Bala bala;\n Array<TextureRegion> arrayTexturas = Util.ficherosEnDirectorio(Gdx.files.internal(\"Balas/\" + idPj));\n switch (idPj) {\n //Balas con forma rectangular\n case 1:\n case 4:\n case 7:\n bala = new BalaRect(posicionRelativaRecibido, velocidadBalas, arrayTexturas, idPj, tamanoBala);\n break;\n //Balas con forma circular\n case 2:\n bala = new BalaCirc(posicionRelativaRecibido, velocidadBalas, arrayTexturas, idPj, tamanoBala);\n break;\n //Balas con forma poligonal\n case 3:\n case 5:\n case 6:\n case 8:\n case 9:\n case 10:\n bala = new BalaPol(posicionRelativaRecibido, velocidadBalas, arrayTexturas, idPj, tamanoBala);\n break;\n default:\n arrayTexturas = Util.ficherosEnDirectorio(Gdx.files.internal(\"Balas/1\"));\n bala = new BalaRect(posicionRelativaRecibido, velocidadBalas, arrayTexturas, idPj, tamanoBala);\n break;\n }\n return bala;\n }",
"private void initNoti() {\n lblNoti = new JLabel(\"\");\n\n springLayout.putConstraint(SpringLayout.WEST, lblNoti, 335, SpringLayout.WEST, estimationGame.getContentPane());\n springLayout.putConstraint(SpringLayout.SOUTH, lblNoti, -10, SpringLayout.NORTH, btnAvatarA);\n lblNoti.setForeground(new Color(224, 255, 255));\n lblNoti.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\n\n estimationGame.getContentPane().add(lblNoti);\n\t}",
"private void pojedi (int i, int j) {\n\t\trezultat++;\n\t\tthis.zmija.add(0, new Cvor(i,j));\n\t\tthis.dodajZmiju();\n\t\tthis.dodajHranu();\n\t}",
"Integer getNLNDreu();",
"public static Livro criarLivro() {\n\n\t\tLivro livro = new Livro();\n\n\t\tString codigo = Console.recuperaTexto(\"Informe o código:\");\n\t\tlivro.setCodigo(codigo);\n\t\tString titulo = Console.recuperaTexto(\"Informe o título:\");\n\t\tlivro.setTitulo(titulo);\n\n\t\tArrayList<String> autores = new ArrayList<>();\n\t\tInteger quantidade = Console.recuperaInteiro(\"Quantos autores?\");\n\t\tfor (int i = 0; i < quantidade; i++) {\n\t\t\tString autor = Console.recuperaTexto(\"Informe o autor \" + (i + 1) + \":\");\n\t\t\tautores.add(autor);\n\t\t}\n\t\tlivro.setAutores(autores);\n\n\t\tString isbn = Console.recuperaTexto(\"Informe o ISBN:\");\n\t\tlivro.setIsbn(isbn);\n\t\tInteger ano = Console.recuperaInteiro(\"Informe o ano:\");\n\t\tlivro.setAno(ano);\n\n\t\treturn livro;\n\n\t}",
"public Billete(Usuario usuario, LocalDate fechaIda, float precio_billete) {\r\n\t\t\r\n\t\tthis.nombrePasajero=usuario.getNombre();\r\n\t\tthis.apellido1_pasajero=usuario.getApellido1();\r\n\t\tthis.apellido2_pasajero=usuario.getApellido2();\r\n\t\tthis.pasaporte= usuario.getPasaporte();\r\n\t\tthis.idPasajero= usuario.getIdUsuario();\r\n\t\tthis.numeroBillete= idBillete++;\r\n\t\tthis.fechaIda = fechaIda;\r\n\t\tthis.precioBillete = precio_billete;\r\n\t}",
"public int VerifierPlagesHorairesUneLiv(Livraison liv) {\r\n\t\t// juste checker si l'horaire d'arrivee fait partie de la ph\r\n\t\t// valeur 0 : pas d'attente et pas tendu --> bleu\r\n\t\t// valeur 1 : pas d'attente et tendu --> orange\r\n\t\t// valeur 2 : attente --> PURPLE\r\n\t\t// valeur 3 : plage horaire violee --> rouge\r\n\r\n\t\tint valeurPH = 0;\r\n\r\n\t\tfor (Livraison l : getListeLivraison()) {\r\n\t\t\tif (l.toString().equals(liv.toString())) {\r\n\t\t\t\tliv = l;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tDate[] tempsPassage = getTempsPassage()[getListeLivraison().indexOf(liv)];\r\n\r\n\t\tboolean attente = true;\r\n\t\tDate horaireArr = tempsPassage[0];\r\n\r\n\t\tif (liv.getDebutPlageHoraire() != null && liv.getFinPlageHoraire() != null) {\r\n\t\t\tDate debutPH = liv.getDebutPlageHoraire();\r\n\t\t\tDate finPH = liv.getFinPlageHoraire();\r\n\t\t\tDate tempsRestantAvantFinPHdate = new Date(finPH.getTime() - horaireArr.getTime());\r\n\t\t\tlong tempsRestantAvantFinPH = tempsRestantAvantFinPHdate.getTime();\r\n\r\n\t\t\t// arrive apres DPH et avant FPH donc n'attend pas\r\n\t\t\tif (horaireArr.getTime() >= debutPH.getTime() && horaireArr.getTime() < finPH.getTime()) {\r\n\t\t\t\tattente = false;\r\n\t\t\t}\r\n\r\n\t\t\tif (attente == false && tempsRestantAvantFinPH > 30 * 60000 + liv.getDuree() * 1000) { // pas\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\t// d'attente\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\t// et\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\t// pas\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\t// tendu\r\n\t\t\t\tvaleurPH = 0;\r\n\t\t\t}\r\n\r\n\t\t\tif (attente == false && tempsRestantAvantFinPH <= 30 * 60000 + liv.getDuree() * 1000) { // pas\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\t// d'attente\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\t// et\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\t// tendu\r\n\t\t\t\tvaleurPH = 1;\r\n\t\t\t}\r\n\r\n\t\t\tif (attente == true && tempsRestantAvantFinPH >= liv.getDuree() * 1000) { // attente\r\n\t\t\t\tvaleurPH = 2;\r\n\t\t\t}\r\n\r\n\t\t\tif (tempsRestantAvantFinPH < liv.getDuree() * 1000) {// plage violee\r\n\t\t\t\tvaleurPH = 3;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvaleurPH = 0;\r\n\t\t}\r\n\r\n\t\treturn valeurPH;\r\n\r\n\t}",
"public static void dodavanjeBicikl() {\n\t\tString vrstaVozila = \"Bicikl\";\n\t\tString regBr = UtillMethod.unosRegBroj();\n\t\tGorivo gorivo = Main.nista;\n\t\tint brServisa = 1;\n\t\tdouble potrosnja100 = 0;\n\t\tSystem.out.println(\"Unesite broj km koje je vozilo preslo:\");\n\t\tdouble predjeno = UtillMethod.unesiteBroj();\n\t\tdouble preServisa = 700;\n\t\tdouble cenaServisa = 5000;\n\t\tSystem.out.println(\"Unesite cenu vozila za jedan dan:\");\n\t\tdouble cenaDan = UtillMethod.unesiteBroj();\n\t\tint brSedist = 1;\n\t\tint brVrata = 0;\n\t\tboolean vozObrisano = false;\n\t\tArrayList<Gorivo> gorivaVozila = new ArrayList<Gorivo>();\n\t\tgorivaVozila.add(gorivo);\n\t\tArrayList<Servis> servisiNadVozilom = new ArrayList<Servis>();\n\t\tBicikl vozilo = new Bicikl(vrstaVozila, regBr, gorivaVozila, brServisa, potrosnja100, predjeno, preServisa,\n\t\t\t\tcenaServisa, cenaDan, brSedist, brVrata, vozObrisano, servisiNadVozilom);\n\t\tUtillMethod.prviServis(vozilo, predjeno);\n\t\tMain.getVozilaAll().add(vozilo);\n\t\tSystem.out.println(\"Novo vozilo je uspesno dodato u sistem!\");\n\t\tSystem.out.println(\"--------------------------------------\");\n\t}",
"synchronized public void reponerPapel() {\n\t\tRandom r = new Random();\n\t\tint hojas_repuestas = r.nextInt(20) + 10;\n\t\t\n\t\t// SE REPONEN LAS HOJAS\n\t\thojas_disponibles += hojas_repuestas;\n\t\tSystem.out.println(\"La impresora tenía \"+\n\t\t\t\thojas_disponibles + \" hojas y he repuesto \" + \n\t\t\t\thojas_repuestas + \". Ahora tiene \" +\n\t\t\t\t(hojas_disponibles + hojas_repuestas));\n\t\tnotify();\n\t}",
"public static ArrayList<ArrayList<String>> generateMatrixBRI()\r\n {\r\n\tArrayList<ArrayList<String>> binomialRapInterval = new ArrayList<>();\r\n\tArrayList<String> r = null;\r\n\t\r\n\tfor(int i=0; i<12; i++)\r\n\t{\r\n r = new ArrayList<>();\r\n if(i == 0)\r\n { \r\n r.add(0, \"P1\");\r\n r.add(1, \"d2\");\r\n r.add(2, \"3d3\");\r\n r.add(3, \"5d4\");\r\n r.add(4, \"5A5\");\r\n r.add(5, \"3A6\");\r\n r.add(6, \"A7\");\r\n }\r\n\r\n if(i == 1)\r\n {\r\n r.add(0, \"A1\");\r\n r.add(1, \"m2\");\r\n r.add(2, \"2d3\");\r\n r.add(3, \"4d4\");\r\n r.add(4, \"6A5\");\r\n r.add(5, \"4A6\");\r\n r.add(6, \"2A7\");\r\n }\r\n\r\n if(i == 2)\r\n {\r\n r.add(0, \"2A1\");\r\n r.add(1, \"M2\");\r\n r.add(2, \"d3\");\r\n r.add(3, \"3d4\");\r\n r.add(4, \"5d5\");\r\n r.add(5, \"5A6\");\r\n r.add(6, \"3A7\");\r\n }\r\n\r\n if(i == 3)\r\n {\r\n r.add(0, \"3A1\");\r\n r.add(1, \"A2\");\r\n r.add(2, \"m3\");\r\n r.add(3, \"2d4\");\r\n r.add(4, \"4d5\");\r\n r.add(5, \"5d6\");\r\n r.add(6, \"4A7\");\r\n }\r\n\r\n if(i == 4)\r\n {\r\n r.add(0, \"4A1\");\r\n r.add(1, \"2A2\");\r\n r.add(2, \"M3\");\r\n r.add(3, \"d4\");\r\n r.add(4, \"3d5\");\r\n r.add(5, \"4d6\");\r\n r.add(6, \"5A7\");\r\n }\r\n\r\n if(i == 5)\r\n {\r\n r.add(0, \"5A1\");\r\n r.add(1, \"3A2\");\r\n r.add(2, \"A3\");\r\n r.add(3, \"P4\");\r\n r.add(4, \"2d5\");\r\n r.add(5, \"3d6\");\r\n r.add(6, \"5d7\");\r\n }\r\n\r\n if(i == 6)\r\n {\r\n r.add(0, \"6A1\");\r\n r.add(1, \"4A2\");\r\n r.add(2, \"2A3\");\r\n r.add(3, \"A4\");\r\n r.add(4, \"d5\");\r\n r.add(5, \"2d6\");\r\n r.add(6, \"4d7\");\r\n }\r\n\r\n if(i == 7)\r\n {\r\n r.add(0, \"5d1\");\r\n r.add(1, \"5A2\");\r\n r.add(2, \"3A3\");\r\n r.add(3, \"2A4\");\r\n r.add(4, \"P5\");\r\n r.add(5, \"d6\");\r\n r.add(6, \"3d7\");\r\n }\r\n\r\n if(i == 8)\r\n {\r\n r.add(0, \"4d1\");\r\n r.add(1, \"5d2\");\r\n r.add(2, \"4A3\");\r\n r.add(3, \"3A4\");\r\n r.add(4, \"A5\");\r\n r.add(5, \"m6\");\r\n r.add(6, \"2d7\");\r\n }\r\n\r\n if(i == 9)\r\n {\r\n r.add(0, \"3d1\");\r\n r.add(1, \"4d2\");\r\n r.add(2, \"5A3\");\r\n r.add(3, \"4A4\");\r\n r.add(4, \"2A5\");\r\n r.add(5, \"M6\");\r\n r.add(6, \"d7\");\r\n }\r\n\r\n if(i == 10)\r\n {\r\n r.add(0, \"2d1\");\r\n r.add(1, \"3d2\");\r\n r.add(2, \"5d3\");\r\n r.add(3, \"5A4\");\r\n r.add(4, \"3A5\");\r\n r.add(5, \"A6\");\r\n r.add(6, \"m7\");\r\n }\r\n\r\n if(i == 11)\r\n {\r\n r.add(0, \"d1\");\r\n r.add(1, \"2d2\");\r\n r.add(2, \"4d3\");\r\n r.add(3, \"6A4\");\r\n r.add(4, \"4A5\");\r\n r.add(5, \"2A6\");\r\n r.add(6, \"M7\");\r\n }\r\n binomialRapInterval.add(r);\r\n\t}\r\n\treturn binomialRapInterval;\r\n }",
"public int generateRoshambo(){\n ;]\n\n }",
"public Biglietto(double prezzo, CodeEnum classe, boolean checkIn, boolean imbarcato, String numeroVolo, Cliente cliente) {\n this.prezzo = prezzo;\n this.posto = posto;\n this.classe = classe;\n this.checkIn = checkIn;\n this.imbarcato = imbarcato;\n this.numeroVolo = numeroVolo;\n this.cliente = cliente;\n }",
"public void newGameJBJ() {\n newGame();\n min = 0; max = 1000;\n myctr.setMinMaxLabel();\n myctr.setLabels();\n }",
"public void insertar(){\n /*este for lo que hace es que se va a repetir\n dependiendo el tamaņo de la variable \"tamano\"\n */\n for (int i = 0; i < tamano; i++) {\n //Este metodo lo que hace es generar numeros aleatorios del 1 al 100\n vectorpila[i]=(int) (Math.random() *100+1);\n //Aqui aumenta el valor de cima\n cima++;\n }\n System.out.println(\"Pila llena\");\n }",
"public boolean create(Info_laboral il){\n ConexionBD con = new ConexionBD();\n Connection c = con.conOracle();\n boolean var;\n try{\n CallableStatement cs = c.prepareCall(\"{call P_INSINFO(?,?,?,?,?,?,?,?,?)}\");\n \n cs.setString(1, il.getJefe());\n cs.setString(2, il.getCargo());\n cs.setString(3, il.getFuncion());\n cs.setDate(4, il.getFecha_ini());\n cs.setDate(5, il.getFecha_fin());\n cs.setString(6, il.getMotivo_retiro());\n cs.setLong(7, il.getId_egresado().getId());\n cs.setString(8, il.getPerfil());\n cs.registerOutParameter(9, Types.VARCHAR);\n var = cs.execute();\n System.out.println(cs.getString(9));\n \n }catch(SQLException e){\n System.out.println(\"Error\"+ e);\n var = false;\n }\n con.CerrarCon();\n return var;\n }",
"public static void brisanjeVozila() {\n\t\tint i = 0;\n\t\tfor (Vozilo v : Main.getVozilaAll()) {\n\t\t\tSystem.out.println(i + \"-Vrsta Vozila|\" + v.getVrstaVozila() + \" Registarski broj|\" + v.getRegBR()\n\t\t\t\t\t+ \" Status izbrisanosti vozila|\" + v.isVozObrisano());\n\t\t\ti++;\n\t\t}\n\t\tSystem.out.println(\"----------------------------------------\");\n\t\tSystem.out.println(\"Unesite redni broj vozila koje zelite da izbrisete ili vratite u neobrisano stanje\");\n\t\tint redniBroj = UtillMethod.unesiteInt();\n\t\tif (redniBroj < Main.getVozilaAll().size()) {\n\t\t\tVozilo temp = Main.getVozilaAll().get(redniBroj);\n\t\t\tif (UtillMethod.voziloImaRezervacije(temp)) {\n\t\t\t\tSystem.out.println(\"Ovo vozilo ima aktivne rezervacije i ne moze biti obrisano!\");\n\t\t\t} else {\n\t\t\t\tif (temp.isVozObrisano()) {\n\t\t\t\t\ttemp.setVozObrisano(false);\n\t\t\t\t\tSystem.out.println(\"Vozilo je vraceno u sistem(neobrisano stanje)\");\n\t\t\t\t} else {\n\t\t\t\t\ttemp.setVozObrisano(true);\n\t\t\t\t\tSystem.out.println(\"Vozilo je uspesno izbrisano!\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"Ne postoji vozilo sa tim brojem!\");\n\t\t}\n\t}",
"public QLVatTu() {\n initComponents();\n VatTu.doc();\n VatTu.setIndex( VatTu.lenth() - 1);\n hienThi();\n labHienThi.setText(( VatTu.getIndex() + 1) + \"/\" + VatTu.lenth());\n }",
"public abstract void actualiserNbErreur(int nbErreur) throws RemoteException;"
] | [
"0.58865434",
"0.5757478",
"0.568894",
"0.56657994",
"0.56283617",
"0.56272006",
"0.5602276",
"0.55839694",
"0.5583072",
"0.5507503",
"0.5470186",
"0.546567",
"0.5434809",
"0.5401641",
"0.5387855",
"0.5372848",
"0.5351111",
"0.53146744",
"0.5303909",
"0.5300265",
"0.5292569",
"0.52662706",
"0.52622277",
"0.5242242",
"0.5240093",
"0.521742",
"0.5208536",
"0.52077293",
"0.5205421",
"0.51843506",
"0.51827806",
"0.5180419",
"0.51749134",
"0.5173281",
"0.51704115",
"0.51693213",
"0.51555467",
"0.5131042",
"0.5130273",
"0.51274633",
"0.5127255",
"0.5124463",
"0.5083982",
"0.50776845",
"0.5073712",
"0.50696903",
"0.5065329",
"0.5057608",
"0.50511825",
"0.5050876",
"0.50500524",
"0.504559",
"0.50431764",
"0.5038091",
"0.5036015",
"0.50347084",
"0.50344527",
"0.5033192",
"0.50314105",
"0.50313324",
"0.50292814",
"0.50289893",
"0.5019592",
"0.5015948",
"0.5015321",
"0.50118554",
"0.50082976",
"0.4999927",
"0.49925742",
"0.49919",
"0.4982308",
"0.49805412",
"0.49683625",
"0.49653983",
"0.49596697",
"0.49594298",
"0.4958556",
"0.49568385",
"0.4952921",
"0.4949841",
"0.4947879",
"0.4947851",
"0.49443045",
"0.49417672",
"0.49408558",
"0.494079",
"0.49372518",
"0.49245596",
"0.49229026",
"0.49214464",
"0.4918683",
"0.49124107",
"0.49120066",
"0.49111107",
"0.49100795",
"0.4906956",
"0.4898497",
"0.48899093",
"0.48885345",
"0.48857835"
] | 0.5573396 | 9 |
Creer une loi Uniforme Puis simule la loi en simulant nbRep valeurs | public static Double[][] simulerUniforme(ArrayList<Double> listValeurs, Double repetition) {
Double[] tab = convertirTableau(listValeurs);
Uniforme loi = new Uniforme(tab);
return loi.simuler(repetition);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private int aleatorizarNaipe() {\n\t\tint aux;\n\t\taux = r.getIntRand(4);\n\t\treturn aux;\n\t}",
"private void generisiPolje() {\r\n\t\tint polje = rnd.nextInt(broj_slobodnih);\r\n\t\tint vrijednost = rnd.nextInt(4);\r\n\t\tif(vrijednost == 0)\r\n\t\t\tvrijednost = 4;\r\n\t\telse\r\n\t\t\tvrijednost = 2;\r\n\t\t\r\n\t\tint brojac = 0;\r\n\t\tfor(int i = 0 ; i < 4 ; i++)\r\n\t\t\tfor(int j = 0 ; j < 4 ; j++) {\r\n\t\t\t\tif(tabela[i][j] == 0) {\r\n\t\t\t\t\tif(brojac == polje)\r\n\t\t\t\t\t\ttabela[i][j] = vrijednost;\r\n\t\t\t\t\tbrojac++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tbroj_slobodnih--;\r\n\t}",
"public int initialiser()\n\t{\n\n\t\tint nombreE;\n\t\tint k = 0;\n\t\t//int max = randInt(2,10);\n\t\ttableauPeres_ = new Case[longueur_][longueur_];\n\t\tint i, j = 0;\n\t\tfor(i=0; i<longueur_; ++i)\n\t\t{\n\t\t\tfor(j=0; j<longueur_; ++j)\n\t\t\t{\n\t\t\t\ttableauPeres_[i][j] = new Case(i, j, 0);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Combien d'étoiles souhaitez vous pour chaque joueur ?\");\n\t\tnombreE = clavier.nextInt();\n\t\twhile (k < nombreE)\n\t\t{\n\t\t\taddEtoile(\"bleu\");\n\t\t\taddEtoile(\"rouge\");\n\t\t\t++k;\n\t\t}\n\t\treturn nombreE;\n\t}",
"public static int generarNumeroAleatorio(int limite){ //Entre 0 y limite - 1\n return (int) (Math.random()*limite);\n }",
"Multiplication createRandomMultiplication();",
"Multiplication createRandomMultiplication();",
"public static Double[] simulerBinomiale(Double nbRep, Double proba, Double repetition) {\n\t\tBinomiale loi = new Binomiale(proba, nbRep, repetition);\n\t\treturn loi.simuler();\n\t}",
"public void MakeRep(int type, int min, int max)\n\t{\n\t\t_type += (type - One);\n\t\t_m = min;\n\t\t_n = max;\n\t}",
"private int newFigure(Random rnd) {\r\n\t\t/** while the figure exists or = 0, find a new figure */\r\n\r\n\t\tbyte hulp = 0;\r\n\t\tdo {\r\n\t\t\thulp = (byte) (1 + rnd.nextInt(Constants.DIMENSION * Constants.DIMENSION));\r\n\t\t} while (exists(hulp) || (hulp < Constants.MIN));\r\n\t\tConstants.logger.debug(hulp);\r\n\t\treturn hulp;\r\n\t}",
"public void insertar(){\n /*este for lo que hace es que se va a repetir\n dependiendo el tamaņo de la variable \"tamano\"\n */\n for (int i = 0; i < tamano; i++) {\n //Este metodo lo que hace es generar numeros aleatorios del 1 al 100\n vectorpila[i]=(int) (Math.random() *100+1);\n //Aqui aumenta el valor de cima\n cima++;\n }\n System.out.println(\"Pila llena\");\n }",
"public void rellenarTerreno() {\n Random rnd = new Random();\r\n int restante = V;\r\n int[][] aux = terreno;\r\n do {\r\n for (int i = 0; i < Filas; i++) {\r\n for (int j = 0; j < Columnas; j++) {\r\n if (restante > max) {\r\n int peso = rnd.nextInt(max);\r\n if (aux[i][j] + peso <= max) {\r\n aux[i][j] += peso;\r\n restante -= peso;\r\n }\r\n } else {\r\n if (aux[i][j] + restante <= max) {\r\n aux[i][j] += restante;\r\n restante = 0;\r\n }\r\n }\r\n }\r\n }\r\n } while (restante != 0);\r\n }",
"public int generateRoshambo(){\n ;]\n\n }",
"private void recolteNourriture() {\r\n\t\t\t//1pop recolte toute la case\r\n\t\t\tint tempNourr = 0;\r\n\t\t\tint totalPop = population + populationColoniale;\r\n\t\t\tint limite = (totalPop < caseOwned.size()) ? totalPop : caseOwned.size();\r\n\t\t\tfor(int id = 0; id < limite; id++) {\r\n\t\t\t\ttempNourr += caseOwned.get(id).getFood();\r\n\t\t\t}\r\n\t\t\t//animaux\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Bétail) * 10; //Ca mange de l'herbe, ça se tente.\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Cervidés) * 7.5; //CARIBOUUUUUUUUU !!\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Crabe) * 2; //ca pique les pied, a mort!!\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Elephants) * 30; //polution sonore\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Moutons) * 5; //kébab landais\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Poissons) * 5; //croustibat\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Chevaux) * 7; //lasagnes\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Baleines) * 50; //*bruit de baleine virile*\r\n\t\t\t//aplication des bonus\r\n\t\t\ttempNourr *= (1 + (0.15 * scienceLvl) + (0.05 * (bonheur - baseBonheur))); // +15% par scienceLvl +5% par bonheur excedentaire, -5% par bonheur négatif\r\n\t\t\t\r\n\t\t\tnourriture += tempNourr;\r\n\t\t\t//bonus de conservation grâce au sel\r\n\t\t\tif(howManyRessource(StrategicRessource.Sel) > 0 && nourriture > 0) nourriture *= 1.10;\r\n\t\t\t//limitation de stockage\r\n\t\t\tint stockageMax = caseOwned.size() * 100 * scienceLvl;\r\n\t\t\tif(nourriture > stockageMax) nourriture = stockageMax;\r\n\t\t}",
"private void obsluga_bonusu()\n {\n if(bonusy_poziomu>0)\n {\n boolean numer= los.nextBoolean();\n if(numer){\n bon.add(new Bonus(w.getPolozenie_x(),w.getPolozenie_y(),getWidth(),getHeight()));\n bonusy_poziomu--;\n }\n }\n }",
"public final void mo23206tL(int i) {\n AppMethodBeat.m2504i(18979);\n C11486d.this.kIr = false;\n C9638aw.m17190ZK();\n C7580z Ry = C18628c.m29072Ry();\n C11486d.this.kIv = System.currentTimeMillis();\n if (i == 0) {\n Ry.setLong(237569, C11486d.this.kIv);\n if (z) {\n C11486d.this.kIw = C11486d.this.kIw + 1;\n } else {\n C11486d.this.kIw = 0;\n }\n Ry.setInt(237570, C11486d.this.kIw);\n } else {\n if (i != 1) {\n Ry.setLong(237569, C11486d.this.kIv);\n if (z) {\n C11486d.this.kIw = 10;\n Ry.setInt(237570, C11486d.this.kIw);\n }\n }\n AppMethodBeat.m2505o(18979);\n }\n Ry.dsb();\n AppMethodBeat.m2505o(18979);\n }",
"int generarNumeroNota();",
"public void agregarVidaLogica(){\n int numvida = tam * tam;\n numvida*=0.05;\n System.out.println(numvida);\n for(int i=0;i<numvida;i++){\n int x= (int)(Math.random()*tam);\n int y= (int)(Math.random()*tam);\n if(matriz[y][x]!=2 && matriz[y][x]!=1){\n matriz[y][x]=4;\n }\n }\n }",
"public void insertar2(){\n for (int i = 0; i < tamano; i++) {\n vectorpila2[i]=(int) (Math.random() *100+1);\n \n cima++;\n }\n }",
"public nhanvien() {\n initComponents();\n laysodong();\n if(count % 5 ==0 )\n {\n sotrang = count/5;\n }\n else\n {\n sotrang=count/5 + 1;\n }\n DAO_NV.dolentable(tblnhanvien,1);\n lbltrang.setText(\"1\");\n lblsotrang.setText(\"1/\"+sotrang);\n jButton3.setEnabled(false);\n jButton1.setEnabled(false);\n \n \n \n \n\n }",
"public void Nouvelleligne() {\n int maxEleve = retourneMaxNumber() + 1;\n try {\n Connector1.statement.executeUpdate(\"Insert INTO eleve(id_el) VALUES (\" + maxEleve + \")\");\n Object[] val = {maxEleve, \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"};\n effaceTable(jTable2, mode);\n mode.addRow(val);\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"ERROR \\n\" + e.getMessage());\n\n }\n\n }",
"public void generaBuits() {\r\n\r\n //FIX PARA EL OUT OF BOUNDS DE la columna 9 \r\n //int cellId = randomGenerator(N*N) - 1;\r\n //QUITAR \r\n //if (j != 0)\r\n //j = j - 1;\r\n int count = K;\r\n while (count != 0) {\r\n int cellId = generadorAleatoris(N * N) - 1;\r\n\r\n //System.out.println(cellId); \r\n // extract coordinates i and j \r\n int i = (cellId / N);\r\n int j = cellId % 9;\r\n\r\n // System.out.println(i+\" \"+j); \r\n if (mat[i][j] != 0) {\r\n count--;\r\n mat[i][j] = 0;\r\n }\r\n }\r\n }",
"private double genMultiplier() {\n return (random.nextInt(81) + 60)/100.0;\n }",
"public void gagne()\r\n\t{\r\n\t\tthis.nbVictoires++;\r\n\t}",
"public static void jouerAuJustePrix() {\n\t\tint nbVies=Tools.inputInt(\"Combien de tentatives voulez-vous ? \");\n\t\tint limite=Tools.inputInt(\"Quel est le nombre maximum à prendre en compte?\");\n\t\tint nbATrouver=Tools.randomint(limite);\n\t\tint nbPropose;\n\t\t\n\t\twhile (nbVies>0){\n\t\t\tnbPropose=Tools.inputInt(\"Saisissez un nombre : \");\n\t\t\tif (afficherResultatProposition(nbPropose, nbATrouver)) {\n\t\t\t\tbreak;\n\t\t\t};\n\t\t\tnbVies=nbVies-1;\n\t\t}\n\t\t\n\t\tif (nbVies==0) {\n\t\t\tSystem.out.println(\"Game Over\");\n\t\t}\n\t}",
"static int [] GerarAleatorio()\n {\n Random gerar = new Random();\n int [] Aleatorio = new int [pergu]; // Cria um Vetor com o tamanho de quantidade de perguntas\n \n \n int pos1, pos2, auxilio; \n \n for (int i = 0; i < Aleatorio.length; i++) \n {\n Aleatorio[i] = i ; // preenche o vetor\n }\n \n for (int i = 0; i < 1000; i++) //Quantidade de vezes que as perguntas serão embaralhadas \n {\n pos1 = gerar.nextInt(Aleatorio.length);\n pos2 = gerar.nextInt(Aleatorio.length);\n //troca \n auxilio = Aleatorio[pos1]; //guarda o valor da posição 1\n \n Aleatorio [pos1] = Aleatorio[pos2]; //troca o valor de 1 para 2\n Aleatorio[pos2] = auxilio; //troca o valor de 2 para o valor que estava na 1\n }\n \n \n return Aleatorio; \n }",
"public Chromosone() {\n Random rand = new Random();\n for(int i=0;i<=75;i++)\n {\n int rnd = rand.nextInt(2);// [1,0...]\n\n Val.add(rnd);\n }\n }",
"public int geraNumeroUnico()\r\n {\r\n Random numero = new Random();\r\n numUnico = numero.nextInt(99999);\r\n numUnico = numUnico + 1000;\r\n \r\n if(conjNumeros.contains(numUnico) == true)\r\n isUnico = false;\r\n else \r\n isUnico = true;\r\n \r\n while(isUnico == false)\r\n { \r\n numUnico = numero.nextInt(99999);\r\n numUnico = numUnico + 1000;\r\n \r\n if(conjNumeros.contains(numUnico) == true)\r\n isUnico = false;\r\n else\r\n isUnico = true;\r\n } \r\n conjNumeros.add(numUnico);\r\n \r\n return numUnico;\r\n }",
"@Override\n\tpublic void crearNuevaPoblacion() {\n\t\t/* Nos quedamos con los mejores individuos. Del resto, cruzamos la mitad, los mejores,\n\t\t * y el resto los borramos.*/\n\t\tList<IIndividuo> poblacion2 = new ArrayList<>();\n\t\tint numFijos = (int) (poblacion.size()/2);\n\t\t/* Incluimos el 50%, los mejores */\n\t\tpoblacion2.addAll(this.poblacion.subList(0, numFijos));\n\t\t\n\t\t/* De los mejores, mezclamos la primera mitad \n\t\t * con todos, juntandolos de forma aleatoria */\n\t\tList<IIndividuo> temp = poblacion.subList(0, numFijos+1);\n\t\tfor(int i = 0; i < temp.size()/2; i++) {\n\t\t\tint j;\n\t\t\tdo {\n\t\t\t\tj = Individuo.aleatNum(0, temp.size()-1);\n\t\t\t}while(j != i);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tpoblacion2.addAll(cruce(temp.get(i), temp.get(j)));\n\t\t\t} catch (CruceNuloException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//this.poblacion.clear();\n\t\tthis.poblacion = poblacion2;\n\t}",
"public Plateau(int largeur, int hauteur) {\r\n\t\tplateau = new Cellule[hauteur][largeur];\r\n\t\tint equipe = 1;\r\n\t\tfor (int i=0; i<hauteur; i++) {\r\n\t\t\tfor (int j=0; j<largeur; j++) {\r\n\t\t\t\tif ((i == 0 && j == 0) || (i == hauteur-1 && j == largeur -1))\r\n\t\t\t\t\tplateau[i][j] = new Base(j,i,equipe++);\r\n\t\t\t\telse\r\n\t\t\t\t\tplateau[i][j] = new Case(j,i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.hauteur = hauteur;\r\n\t\tthis.largeur = largeur;\r\n\t}",
"synchronized public void reponerPapel() {\n\t\tRandom r = new Random();\n\t\tint hojas_repuestas = r.nextInt(20) + 10;\n\t\t\n\t\t// SE REPONEN LAS HOJAS\n\t\thojas_disponibles += hojas_repuestas;\n\t\tSystem.out.println(\"La impresora tenía \"+\n\t\t\t\thojas_disponibles + \" hojas y he repuesto \" + \n\t\t\t\thojas_repuestas + \". Ahora tiene \" +\n\t\t\t\t(hojas_disponibles + hojas_repuestas));\n\t\tnotify();\n\t}",
"@Override\n public void init()\n {\n out = mul(num(100.0/Math.log10(length)), log10(div(sum(truerange(), length), diff(highest(length), lowest(length)))));\n }",
"public int generarNombreAleatori() {\n\t\tRandom random = new Random();\n\t\treturn random.nextInt((9) - 1) + 1;\n\t}",
"@Test\n @Tag(\"bm1000\")\n public void testRECIPELP() {\n CuteNetlibCase.doTest(\"RECIPELP.SIF\", \"-266.616\", \"-104.818\", NumberContext.of(7, 4));\n }",
"public void generaNumeros() {\n\n\n int number =0;\n int numeroSeleccionado=gameMemoriaUno.getNumberaleatorio();\n //se agrega numero a las lista de numeros\n\n if(numeroSeleccionado == -1){\n llamaResultado(super.getActividad(), tFinal, tInicio, Num3_5_1Activity.class,gameMemoriaUno.getNumeros(),gameMemoriaUno.getAciertosTotales(),gameMemoriaUno.getFallosTotales(),gameMemoriaUno.getNumEcxluidosList(),gameMemoriaUno.getNumeroPregunta());\n\n }else {\n\n\n gameMemoriaUno.addNumerosSet(numeroSeleccionado);\n for (int i = 1; i < 6; i++) {\n //obtiene numeros del costalito menos el numero seleccionado\n number = gameMemoriaUno.getNumeroArreglo();\n //agrego numeros\n gameMemoriaUno.addNumerosSet(number);\n }\n\n Iterator<Integer> iter = gameMemoriaUno.getNumerosSet().iterator();\n\n int contadorNumeros=0;\n while (iter.hasNext()) {\n int valor=iter.next().intValue();\n lista.add(valor);\n if(gameMemoriaUno.getDificultad()==contadorNumeros){\n gameMemoriaUno.setNumerosElejidos(new int[valor]);\n }\n\n contadorNumeros+=1;\n }\n Collections.shuffle(lista, new Random());\n Collections.shuffle(lista, new Random());\n\n\n\n }\n\n\n }",
"@Override\n public void setSuitNum(int total, int normal, int taobao, int imgs) {\n }",
"int reps() {\n\tint b[] = new int[64];\n\tint c = 0; /*\n\t* count of squares that are different from the current\n\t* position\n\t*/\n\tint r = 0; /* number of repetitions */\n\n\t/* is a repetition impossible? */\n\tif (fifty <= 3)\n\treturn 0;\n\n\t/* loop through the reversible moves */\n\tfor (int i = hply - 1; i >= hply - fifty - 1; --i) {\n\tif (++b[histDat[i].m.getFrom()] == 0)\n\t--c;\n\telse\n\t++c;\n\tif (--b[histDat[i].m.getTo()] == 0)\n\t--c;\n\telse\n\t++c;\n\tif (c == 0)\n\t++r;\n\t}\n\n\treturn r;\n\t}",
"public static int LlenadoRandom(int IMinimo, int IMaximo){\n return((int)Math.floor(Math.random()*(IMaximo-IMinimo+1)+IMinimo));//regresa el valor random\n }",
"public final int arvoRivinAihe() {\r\n return super.getRandom().nextInt(super.aiheetPerusmuoto().length);\r\n }",
"private int getPoisson() {\n\t\treturn (int) (-INCOMING_MY * Math.log(Math.random()));\n\t}",
"private Integer randomBilirrubina(){\n\t\t\tint Min = 0, Max = 14;\n\t\t\treturn Min + (int)(Math.random() * ((Max - Min) + 1));\n\t\t}",
"public int aleatorioSeis(){\n\t\t\n\t\treturn (int)(Math.random() * 6) + 1;\n\t}",
"public IntegerGenotype create() \r\n\t{\n\t\tIntegerGenotype genotype = new IntegerGenotype(1,3);\r\n\t\tgenotype.init(new Random(), Data.numeroCuardillas); \r\n\t\t\r\n\t\treturn genotype;\r\n\t}",
"public int[][] MatrisKuralaUygun(int[][] girdi) {\n\t\tint Kontrol = 0; // cali hucreler kontrol etmek icin\r\n\t\tint[][] output = new int[girdi.length][girdi[0].length]; // [row][colum]\r\n\t\tfor (int i = 0; i < girdi.length; i++) {\r\n\t\t\tfor (int j = 0; j < girdi[0].length; j++) {\r\n\t\t\t\tfor (int k = 1; k < output[0].length - 1; k++) {// bu dongu tek seferlik calisir bir eklemek veya\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// cikarmak icin\r\n\t\t\t\t\tif (j < 3 && i == 0) {// burda 0'inci satir icin // [0][0] saginda ve altiginda bakildi\r\n\t\t\t\t\t\tif (j != 2) {// hepsi Kontrola toplaniyor\r\n\t\t\t\t\t\t\tKontrol += girdi[i][j + k];\r\n\t\t\t\t\t\t} // [0][1] saginda ve solunda ve altinda hucrelere bakildi\r\n\t\t\t\t\t\tKontrol += girdi[i + k][j];//\r\n\t\t\t\t\t\tif (j != 0) { // [0][2] sol ve alt hucrelere\r\n\t\t\t\t\t\t\tKontrol += girdi[i][j - k];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (i == 1 && j == 0) {// birinci satir sifirinci dikey\r\n\t\t\t\t\t\tKontrol += girdi[i][j + k];\r\n\t\t\t\t\t\tKontrol += girdi[i + k][j]; // [1][0] ust ve alt ve sag hucrelere bakildi\r\n\t\t\t\t\t\tKontrol += girdi[i - k][j];\r\n\t\t\t\t\t} else if ((i == 1 || i == 2) && (j == 2 || j == 1)) {\r\n\t\t\t\t\t\tKontrol += girdi[i][j - k];\r\n\t\t\t\t\t\tKontrol += girdi[i + k][j];// [1][1] hem ust ve alt ve sag ve sol hucrelere bakildi\r\n\t\t\t\t\t\tif (j != 2) {\r\n\t\t\t\t\t\t\tKontrol += girdi[i][j + k];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tKontrol += girdi[i - k][j];\r\n\r\n\t\t\t\t\t} else if (i == 3 && (j < 3)) {// 2'inci satir icin\r\n\t\t\t\t\t\tif (j != 0) {\r\n\t\t\t\t\t\t\tKontrol += girdi[i][j - k];\r\n\t\t\t\t\t\t} // [2][1] hem ust ve sag ve sol hucrelere bakildi\r\n\t\t\t\t\t\tKontrol += girdi[i - k][j];\r\n\r\n\t\t\t\t\t\tif (j != 2) {\r\n\t\t\t\t\t\t\tKontrol += girdi[i][j + k];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (girdi[i][j] == 1 && Kontrol < 2) { // canli ise ve kontrol 2 den az ise\r\n\t\t\t\t\toutput[i][j] = 0;// sifir yazdir\r\n\t\t\t\t\tKontrol = 0;// Kontrol sifirlamamiz cok onemli yoksa kontrol hem artar\r\n\t\t\t\t} else if (girdi[i][j] == 1 && (Kontrol == 2 || Kontrol == 3)) { // canli ise ve kontrol 2 ve 3 ise\r\n\t\t\t\t\toutput[i][j] = 1;\r\n\t\t\t\t\tKontrol = 0;// burda onemli\r\n\t\t\t\t} else if (girdi[i][j] == 1 && Kontrol > 3) { // canli ise ve kontrol 3 den cok ise\r\n\t\t\t\t\toutput[i][j] = 0;\r\n\t\t\t\t\tKontrol = 0;\r\n\t\t\t\t} else if (girdi[i][j] == 0 && Kontrol == 3) { // canli ise ve kontrol 3 ise\r\n\t\t\t\t\toutput[i][j] = 1;\r\n\t\t\t\t\tKontrol = 0;\r\n\t\t\t\t} else {\r\n\t\t\t\t\toutput[i][j] = girdi[i][j];// eger yukardaki kosulari girilmedi ise aynisi yazdir\r\n\r\n\t\t\t\t\tKontrol = 0;// ve yine Kontrol sifir\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn output;// dizi donduruyor\r\n\r\n\t}",
"public String getNormalizedN(int i) {\n\tint nb = getNb(i);\n\tif (nb == 1) return \"1\";\n\tint maxN = getMaxNb();\n\tif (maxN <= 5) return Integer.toString(nb);\n\tmaxN--;\n\tnb--;\n\tif (maxN < 21) {\n\t\tif (4*nb <= maxN) return \"1\";\n\t\tif (3*nb <= maxN) return \"2\";\n\t\tif (2*nb <= maxN) return \"3\";\n\t\tif (3*nb <= 2*maxN) return \"4\";\n\t\treturn \"5\";\n\t} else if (maxN < 100) {\n\t\tif (10*nb <= maxN) return \"1\";\n\t\tif (5*nb <= maxN) return \"2\";\n\t\tif (4*nb <= maxN) return \"3\";\n\t\tif (3*nb <= maxN) return \"4\";\n\t\tif (2*nb <= 1*maxN) return \"5\";\n\t\tif (3*nb <= 2*maxN) return \"6\";\n\t\treturn \"7\";\n\t} else {\n\t\tif (20*nb <= maxN) return \"1\";\n\t\tif (10*nb <= maxN) return \"2\";\n\t\tif (5*nb <= maxN) return \"3\";\n\t\tif (4*nb <= maxN) return \"4\";\n\t\tif (3*nb <= 1*maxN) return \"5\";\n\t\tif (2*nb <= 1*maxN) return \"6\";\n\t\treturn \"7\";\n\t}\n}",
"private int aleatorizarNumero() {\n\t\tint aux;\n\t\taux = r.getIntRand(13) + 1;\n\t\treturn aux;\n\t}",
"void mo21050ml(int i);",
"int nbLignes();",
"public void novaIgra() {\r\n\t\tbroj_slobodnih = 16;\r\n\t\tfor(int i = 0 ; i < 4 ; i++)\r\n\t\t\tfor(int j = 0 ; j < 4 ; j++)\r\n\t\t\t\ttabela[i][j] = 0;\r\n\t\tpobjeda = false;\r\n\t\tigrajPoslijePobjede = false;\r\n\t\tgenerisiPolje();\r\n\t\tgenerisiPolje();\r\n\t}",
"private void genProb() {\n\t\tint row;\n\t\tint column;\n\t\tint removed1;\n\t\tint removed2;\n\n\t\tfor (int i = 0; i < DIFFICULTY / 2;) {\n\t\t\trow = rand.nextInt(9);\n\t\t\tcolumn = rand.nextInt(9);\n\t\t\twhile (problem[row][column] == 0 || (row == 4 && column == 4)) {\n\t\t\t\trow = rand.nextInt(9);\n\t\t\t\tcolumn = rand.nextInt(9);\n\t\t\t}\n\n\t\t\t// Clearing random boxes.\n\t\t\tremoved1 = problem[row][column];\n\t\t\tremoved2 = problem[8 - row][8 - column];\n\t\t\tproblem[row][column] = 0;\n\t\t\tproblem[8 - row][8 - column] = 0;\n\n\t\t\tcopy(problem, comp);\n\n\t\t\tif (!solve(0, 0, 0, comp)) { // Case of unsolvable.\n\t\t\t\t// Putting back original values.\n\t\t\t\tproblem[row][column] = removed1;\n\t\t\t\tproblem[8 - row][8 - column] = removed2;\n\t\t\t} else {\n\t\t\t\tif (unique()) { // Case of solution is unique.\n\t\t\t\t\ti++;\n\t\t\t\t} else { // Case of solution is not unique.\n\t\t\t\t\t// Putting back original values.\n\t\t\t\t\tproblem[row][column] = removed1;\n\t\t\t\t\tproblem[8 - row][8 - column] = removed2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public int R_M(){\n\t\tBigInteger nminus1=n.subtract(BigInteger.ONE);\n\t\tdo{\n\t\t\tif(nminus1.mod(two.pow(a)).equals(BigInteger.ZERO)){\n\t\t\t\ttable.add(a);\n\t\t\t}\n\t\t\titerator++;\n\t\t\ta++;\n\t\t}while(!(two.pow(a).compareTo(n)>0));\n\t\t\n\t\ta=table.get(table.size()-1);\n\t\tBigInteger m=nminus1.divide(two.pow(a));\n\t\tint wlen=n.bitLength();\n\t\tBigInteger b;\n\t\tBigInteger z;\n\t\tfor(int i=0;i<iterations;i++){\n\t\t\tint straznik=0;\n\t\t\tint straznik1=0;\n\t\t\tdo{\n\t\t\t b=new BigInteger(wlen,new Random());\n\t\t\t}while(!(b.compareTo(BigInteger.ONE)>0) && !(b.compareTo(nminus1)<0));\n\t\t\tz=b.modPow(m, n);\n\t\t\tif(z.equals(BigInteger.ONE) || z.equals(nminus1)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfor(int j=0;j<a-1;j++){\n\t\t\t\t\tz=z.pow(2).mod(n);\n\t\t\t\t\tif(z.equals(nminus1)){\n\t\t\t\t\t\tstraznik++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif(z.equals(BigInteger.ONE)){\n\t\t\t\t\t\tstraznik1++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(straznik==1){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(straznik1==1){\n\t\t\t\t\tgetComposite();\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\t}\n\t\t\tgetComposite();\n\t\t\treturn 0;\n\t\t}\n\t\tgetProbablyPrime();\n\t\treturn 1;\n\t\t}",
"public String generaNumPatente() {\n String numeroPatente = \"\";\r\n try {\r\n int valorRetornado = patenteActual.getPatCodigo();\r\n StringBuffer numSecuencial = new StringBuffer(valorRetornado + \"\");\r\n int valRequerido = 6;\r\n int valRetorno = numSecuencial.length();\r\n int valNecesita = valRequerido - valRetorno;\r\n StringBuffer sb = new StringBuffer(valNecesita);\r\n for (int i = 0; i < valNecesita; i++) {\r\n sb.append(\"0\");\r\n }\r\n numeroPatente = \"AE-MPM-\" + sb.toString() + valorRetornado;\r\n } catch (Exception ex) {\r\n LOGGER.log(Level.SEVERE, null, ex);\r\n }\r\n return numeroPatente;\r\n }",
"int getRepeatCount();",
"public static void miedo(){\n int aleatorio; //variables locales a utilizar\n Random numeroAleatorio = new Random(); //declarando variables tipo random para aleatoriedad\n aleatorio = (numeroAleatorio.nextInt(10-5+1)+5);\n \n if(oro>aleatorio){//condicion de finalizar battalla y sus acciones\n oroPerdido= (nivel*2)+aleatorio;\n oro= oro-oroPerdido;\n System.out.println(\"Huiste de la batalla!!!\");\n\t\t System.out.println(\"oro perdido:\"+oroPerdido);\n opcionMiedo=1; //finalizando battalla por huida del jugador \n }\n else{\n System.out.println(\"No pudes huir de la batalla\");\n } \n }",
"@Override\n protected int getNumRepetitions() {\n return 1;\n }",
"public String getPremierNumeroLibre() {\n\t\tString requete_s = \"SELECT id from LIVRES\";\n\t\tint i = 0;\n\t\tboolean egalite = true;\n\t\t\n\t\ttry{\n\t\t\trequete.execute(requete_s);\n\t\t\t\n\t\t\tResultSet rs = requete.getResultSet();\n\t\t\t\n\t\t\tdo{\n\t\t\t\ti++;\n\t\t\t\trs.next();\n\t\t\t\tegalite = (i ==((Integer) rs.getObject(1)));\n\t\t\t}while(egalite);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tString s = \"\" + i;\n\t\t\n\t\treturn s;\n\t}",
"public static void atacar(){\n int aleatorio; //variables locales a utilizar\n Random numeroAleatorio = new Random(); //declarando variables tipo random para aleatoriedad\n int ataqueJugador;\n //acciones de la funcion atacar sobre vida del enemigo\n aleatorio = (numeroAleatorio.nextInt(20-10+1)+10);\n ataqueJugador= ((nivel+1)*10)+aleatorio;\n puntosDeVidaEnemigo= puntosDeVidaEnemigo-ataqueJugador;\n \n }",
"private int generatePiece()\n\t{\n\t\tint toReturn = 0;\n\t\tint max = 1;\n\t\tint min = -1;\n\t\t\n\t\twhile(toReturn == 0)\n\t\t{\n\t\t\ttoReturn = r.nextInt((max - min) + 1) + min;\n\t\t}\n\t\tSystem.out.println(toReturn);\n\t\treturn toReturn;\n\t}",
"private void nourrireLePeuple() {\n\t\t\tint totalDepense = (int)((population * 1) + (populationColoniale * 0.8) + ((armee + armeeDeployee()) * nourritureParArmee));\r\n\t\t\tnourriture -= totalDepense;\r\n\t\t\tenFamine = (nourriture > 0) ? false : true;\r\n\t\t}",
"public static int[] f_fill_vector_age_people(int N){\n int[] v_vector_age= new int[N];\n for(int i=0; i<N; i++){\n\n v_vector_age[i]= (int) (Math.random()*100)+1;\n\n }\n return v_vector_age;\n }",
"public Long numeroRegistrosFactura();",
"public static void IngresoDatos(){\n int IFila=0,ICol=0;\n int INota;\n for(IFila=0;IFila<10;IFila++)\n {\n StrNotas[IFila][0]=JOptionPane.showInputDialog(null, \"Ingrse nombre del alumno:\");\n INota=LlenadoRandom(0,100);\n StrNotas[IFila][1]=Integer.toString(INota);\n if(INota<61)\n StrNotas[IFila][2]=\"Perdio\";\n else\n StrNotas[IFila][2]=\"gano\";\n }\n }",
"private int h1(int p){\n\t\t return p % table.length;\n\t}",
"public static byte[] genIndividuo(int nB){\n byte nInd[] = new byte[nB];\n Random r = new Random();\n float aux;\n for(int i=0;i<nB;i++){\n aux = r.nextFloat();\n if(aux < 0.5)\n nInd[i] = 0;\n else\n nInd[i] = 1;\n }\n return nInd;\n }",
"public void calcularEntropia(){\n //Verificamos si será con la misma probabilida o con probabilidad\n //especifica\n if(contadorEstados == 0){\n //Significa que será con la misma probabilidad por lo que nosotros\n //calcularemos las probabilidades individuales\n for(int i = 0; i < numEstados; i++){\n probabilidadEstados[i] = 1.0 / numEstados;\n }\n }\n for(int i = 0; i < numEstados; i++){\n double logEstado = Math.log10(probabilidadEstados[i]);\n logEstado = logEstado * (-1);\n double logDos = Math.log10(2);\n double divisionLog = logEstado / logDos;\n double entropiaTmp = probabilidadEstados[i] * divisionLog;\n resultado += entropiaTmp;\n }\n }",
"public abstract int mo12574RN(int i);",
"private static void countRiddle(int[][] a, int m) {\n for (int i=0; i<9; ++i) {\n for (int j=0; j<9; ++j) {\n a[i][j] = ( a[i][j] * m ) % 9 + 1;\n }\n }\n }",
"public ArrayList<Integer> obtenerYi(){\n ArrayList<Integer> res = new ArrayList<Integer>();\n int cont;\n \n for (float p:probabilidades){\n cont=0;\n while (Math.pow(base, cont)<1/p)\n cont++;\n res.add(cont);\n }\n return res;\n }",
"int lanzar(int n){\n int result = (int) (Math.random()* 6) + 1;\r\n if(result !=n ) result = (int) (Math.random()* 6) + 1;\r\n return result;\r\n \r\n /*\r\n * int result = (int) (Math.random()*9)+1;\r\n * if (result > 0 && result < 7) return result;\r\n * else if(result > 6 && result < 9) return n;\r\n * else return (int) (Math.random()*6)+1;\r\n *\r\n *\r\n */\r\n }",
"public Clorus replicate() {\n Clorus p2 = new Clorus(energy/2.0);\n energy /= 2;\n return p2;\n }",
"public abstract int mo12573RM(int i);",
"public void afficherLru() {\n\t\tint nbrCols = listEtape.size();\n\t\tint nbrRows = 0;\n\t\tfor(ArrayList<Processus> list: listEtape) {\n\t\t\tif(list.size() > nbrRows) nbrRows = list.size(); \n\t\t}\n\t\t\n\t\taddColsRows(resultPane, nbrCols+1, nbrRows);\n\t\taddPanelForResult(resultPane);\n\t\n\n\t\tresultPane.setStyle(\"-fx-background-color: #23CFDC\");\n\n\t\t// Affichage du résultat\n\t\tfor(int i=0; i< listEtape.size();i++) {\n\t\t\tArrayList<Processus> list = listEtape.get(i); \n\t\t\tfor(int j=0; j<list.size(); j++) {\n\t\t\t\tProcessus p = list.get(j); \n\t\t\t\tLabel label = new Label(\"\" + p.getValue());\n\n\t\t\t\tresultPane.add(label, i+1, j);\n\t\t\t\tGridPane.setHalignment(label, HPos.CENTER);\n\n\t\t\t}\n\t\t}\n\t\tresultPane.setVisible(true);\n\t\tgenere = true;\n\t}",
"public void generateR(){\n\t\t\tdo{\n\t\t\t\tr = new BigInteger(80, new Random());\n\t\t\t}while(!(q.gcd(r).equals(BigInteger.ONE)&&r.compareTo(q)<0&&r.compareTo(BigInteger.ONE)>=0));\n\t}",
"void writeRepetitionCount(int count);",
"public void genererchemin() {\r\n\t\tRandom hauteur1 = new Random();\r\n\t\tRandom longueur2 = new Random();\r\n\t\tRandom choix = new Random();\r\n\t\tArrayList chemin = new ArrayList();\r\n\t\tSystem.out.println(this.getHauteur());\r\n\t\tSystem.out.println(this.getLargeur());\r\n\t\tint milieu = getLargeur() / 2;\r\n\t\t//System.out.println(milieu);\r\n\t\tCoordonnees c = new Coordonnees(milieu, hauteur1.nextInt(\r\n\t\t\t\tgetLargeur()));\r\n\t\tchemin.add(c);\r\n\t\tchemin.add(new Coordonnees(0, 0));\r\n\t\tchemin.add(new Coordonnees(getLargeur() - 1, getHauteur() - 1));\r\n\t\tCoordonnees droite = new Coordonnees(milieu + 1, c.getHauteur());\r\n\t\tchemin.add(droite);\r\n\t\tCoordonnees gauche = new Coordonnees(milieu - 1, c.getHauteur());\r\n\t\tchemin.add(gauche);\r\n\t\tCoordonnees base1 = new Coordonnees(0, 0);\r\n\t\tCoordonnees base2 =new Coordonnees(getLargeur() - 1, getHauteur() - 1);\r\n\r\n\t\twhile (!gauche.equals(base1)) {\r\n\t\t\tif (gauche.getLargeur() == 0) {\r\n\t\t\t\tgauche = new Coordonnees(0, gauche.getHauteur() - 1);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t} else if (gauche.getHauteur() == 0) {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur() - 1, 0);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t}\r\n\t\t\telse if (choix.nextInt(2) == 0) {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur() - 1, \r\n\t\t\t\t\t\tgauche.getHauteur());\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t} else {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur(), \r\n\t\t\t\t\t\tgauche.getHauteur() - 1);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twhile (!droite.equals(base2)) {\r\n\t\t\tif (droite.getLargeur() == (this.largeur -1)) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur(), \r\n\t\t\t\t\t\tdroite.getHauteur() + 1);\r\n\t\t\t\tchemin.add(droite);\r\n\r\n\t\t\t} else if (droite.getHauteur() == (this.hauteur -1)) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur() + 1, \r\n\t\t\t\t\t\tdroite.getHauteur());\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t\t//System.out.println(\"fais chier\");\r\n\t\t\t}\r\n\t\t\telse if (choix.nextInt(2) == 0) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur() + 1, \r\n\t\t\t\t\t\tdroite.getHauteur());\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t} else {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur(), \r\n\t\t\t\t\t\tdroite.getHauteur() + 1);\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t}\r\n\t\t}\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Quel est le pourcentage d'obstacle souhaite :\");\r\n\t\tint pourcentage = sc.nextInt();\r\n\t\tint ctp = getHauteur() * getLargeur() * pourcentage / 100;\r\n\t\twhile(ctp >0){\r\n\t\t\tCoordonnees obstacle = new Coordonnees(longueur2.nextInt(getLargeur()), \r\n\t\t\t\t\thauteur1.nextInt(getHauteur()));\r\n\t\t\t//System.out.println(!chemin.contains(obstacle));\r\n\t\t\tif (!chemin.contains(obstacle)) {\r\n\t\t\t\tthis.plateau[obstacle.getHauteur()][obstacle.getLargeur()] = new Obstacle(\r\n\t\t\t\t\t\tobstacle.getHauteur(), obstacle.getLargeur());\r\n\t\t\t\tctp--;\r\n\t\t\t} else {\r\n\t\t\t\t//System.out.println(obstacle + \"est sur le chemin\");\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"void random(){\r\n Random dice = new Random ();\r\n int number;\r\n \r\n for (int counter=1; counter<=10;counter++);\r\n number = 10000+dice.nextInt(100000);\r\n \r\n String hasil = TF3.getText();\r\n isi4.setText(number + \" \");\r\n }",
"public void creationPlateau() {\n for (int i = 0; i < 10; i++) {\n int X = rand.nextInt(14);\n int Y = rand.nextInt(14);\n if (plateau[X][Y] == null && espacementMonstre(X,Y,plateau)) {\n int monstreAleatoire = 1 + (int)(Math.random() * ((3 - 1) + 1));\n switch (monstreAleatoire) {\n case 1:\n Personnage monstreD = new Dragonnet(X,Y);\n plateau[X][Y] = monstreD;\n this.monstre.add(monstreD);\n System.out.println(\"Dragonnet ajouté en position : \"+X+\" \"+Y);\n break;\n case 2:\n Personnage monstreL = new Loup(X,Y);\n plateau[X][Y] = monstreL;\n this.monstre.add(monstreL);\n System.out.println(\"Loup ajouté en position : \"+X+\" \"+Y);\n\n break;\n case 3:\n Personnage monstreO = new Orque(X,Y);\n plateau[X][Y] = monstreO;\n this.monstre.add(monstreO);\n System.out.println(\"Orque ajouté en position : \"+X+\" \"+Y);\n break;\n }\n } else {\n i --;\n }\n }\n }",
"private static int newNumber()\n\t{\n\t\tdouble initial = Math.random();\n\t\tdouble rangeAdjusted = initial * (10000 - 1001) + 1000;\n\t\tint rounded = (int)Math.round(rangeAdjusted);\n\t\treturn rounded;\n\t}",
"public static void Number(){\n for(int c=1000;c<=1000000;c++)\n {\n VampireNumber(c);\n }\n }",
"public static void main(String[] args) {\n\r\n\t\tSystem.out.println(\"1..........Numeros del 1 al 15\");\r\n\t\tSystem.out.println(\"2..........Numeros del 20 al 2\");\r\n\t\tSystem.out.println(\"3..........Tabla del 5\");\r\n\t\tSystem.out.println(\"4..........Multiplos de 6 rango 1-100\");\r\n\t\tSystem.out.println(\"5..........Multiplos de 3 y 7 entre rango introducido\");\r\n\t\tSystem.out.println(\"6..........Rectángulo\");\r\n\t\tSystem.out.println(\"7..........Rectángulo hueco\");\r\n\t\tSystem.out.println(\"8..........Muestra los divisores\");\r\n\t\tSystem.out.println(\"9..........¿Es primo?\");\r\n\t\tSystem.out.println(\"10.........¿Cuantos primos hay entre dos numeros?\");\r\n\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tint opcion = scan.nextInt();\r\n\r\n\t\tswitch (opcion) {\r\n\t\tcase 1:\r\n\t\t\tfor (int i = 1; i <= 15; i++) {\r\n\t\t\t\tSystem.out.println(i);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase 2:\r\n\t\t\tfor (int i = 20; i >= 2; i -= 2) {\r\n\t\t\t\tSystem.out.println(i);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase 3:\r\n\t\t\tfor (int i = 1; i <= 10; i++) {\r\n\t\t\t\tint prod;\r\n\t\t\t\tprod = 5 * i;\r\n\t\t\t\tSystem.out.println(\"5 * \" + i + \" = \" + prod);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase 4:\r\n\t\t\tfor (int i = 0; i <= 100; i++) {\r\n\t\t\t\tif (i % 6 == 0) {\r\n\t\t\t\t\tSystem.out.println(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase 5:\r\n\t\t\tSystem.out.println(\"introduce un numero\");\r\n\t\t\tint usub = scan.nextInt();\r\n\t\t\tfor (int i = 1; i <= usub; i++) {\r\n\t\t\t\tif (i % 3 == 0 && i % 7 == 0) {\r\n\t\t\t\t\tSystem.out.println(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase 6:\r\n\t\t\tSystem.out.println(\"escribe un numero\");\r\n\t\t\tint usubo = scan.nextInt();\r\n\t\t\tSystem.out.println(\"escribe otro numero\");\r\n\t\t\tint usuboc = scan.nextInt();\r\n\t\t\tfor (int i = 1; i <= usubo; i++) {\r\n\t\t\t\tfor (int j = 1; j <= usuboc; j++) {\r\n\t\t\t\t\tSystem.out.print(\"*\");\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase 7:\r\n\t\t\tSystem.out.println(\"escribe un numero\");\r\n\t\t\tint usubb = scan.nextInt();\r\n\t\t\tfor (int a = 1; a <= usubb; a++) {\r\n\t\t\t\tSystem.out.print(\"*\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t\tint usu = usubb - 2;\r\n\t\t\tfor (int i = 1; i <= usu; i++) {\r\n\t\t\t\tSystem.out.print(\"*\");\r\n\t\t\t\tfor (int j = 1; j <= usu; j++) {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.print(\"*\");\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t}\r\n\t\t\tfor (int b = 1; b <= usubb; b++) {\r\n\t\t\t\tSystem.out.print(\"*\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t\tbreak;\r\n\r\n\t\tcase 8:\r\n\t\t\tSystem.out.println(\"introduce un numero\");\r\n\t\t\tint max = scan.nextInt();\r\n\t\t\tfor (int i = 1; i <= max; i++) {\r\n\t\t\t\tif (max % i == 0) {\r\n\t\t\t\t\tSystem.out.println(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase 9:\r\n\t\t\tint cont = 0;\r\n\t\t\tSystem.out.println(\"introduce un numero\");\r\n\t\t\tint prim = scan.nextInt();\r\n\t\t\tfor (int i = 1; i <= prim; i++) {\r\n\t\t\t\tif (prim % i == 0) {\r\n\t\t\t\t\tcont++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (cont <= 2) {\r\n\t\t\t\tSystem.out.println(\"es primo\");\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"no es primo\");\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase 10:\r\n\r\n\t\t\tint inicio = scan.nextInt();\r\n\t\t\tint fin = scan.nextInt();\r\n\t\t\tint contb = 0;\r\n\t\t\tif (inicio == 1 || fin == 1) {\r\n\t\t\t\tSystem.out.println(\"Staaaaaph, el 1 da error!!\");\r\n\t\t\t} else {\r\n\t\t\t\tfor (int x = inicio; x <= fin; x++) {\r\n\t\t\t\t\tif (esPrimo(x)) {\r\n\t\t\t\t\t\tcontb++;\r\n\t\t\t\t\t\tSystem.out.print(x + \" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\tSystem.out.print(\"en total hay \" + contb + \" numeros primos entre \" + inicio + \" y \" + fin);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase 11:\r\n\t\t\t\r\n\t System.out.println( \"Empezamos...\" );\r\n\t for (int i=1 ; i<=20 ; i++ ) {\r\n\t System.out.println( \"Comenzada la vuelta\" );\r\n\t System.out.println( i );\r\n\t if (i==15) \r\n\t continue;\r\n\t System.out.println( \"Terminada esta vuelta\" );\r\n\t }\r\n\t System.out.println( \"Terminado\" );\r\n\t break;\r\n\t\tcase 12:\r\n\t\t\t\r\n\t System.out.println( \"Empezamos...\" );\r\n\t for (int i=1 ; i<=20 ; i++ ) {\r\n\t System.out.println( \"Comenzada la vuelta\" );\r\n\t System.out.println( i );\r\n\t if (i==11) \r\n\t break;\r\n\t System.out.println( \"Terminada esta vuelta\" );\r\n\t }\r\n\t System.out.println( \"Terminado\" );\r\n\t break;\r\n\t\t}\r\n\t}",
"public RegexNode ReduceRep()\n\t{\n\t\tRegexNode u;\n\t\tRegexNode child;\n\t\tint type;\n\t\tint min;\n\t\tint max;\n\n\t\tu = this;\n\t\ttype = Type();\n\t\tmin = _m;\n\t\tmax = _n;\n\n\t\tfor (;;)\n\t\t{\n\t\t\tif (u.ChildCount() == 0)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tchild = u.Child(0);\n\n\t\t\t// multiply reps of the same type only\n\t\t\tif (child.Type() != type)\n\t\t\t{\n\t\t\t\tint childType = child.Type();\n\n\t\t\t\tif (!(childType >= Oneloop && childType <= Setloop && type == Loop || childType >= Onelazy && childType <= Setlazy && type == Lazyloop))\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// child can be too lumpy to blur, e.g., (a {100,105}) {3} or (a {2,})?\n\t\t\t// [but things like (a {2,})+ are not too lumpy...]\n\t\t\tif (u._m == 0 && child._m > 1 || child._n < child._m * 2)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tu = child;\n\t\t\tif (u._m > 0)\n\t\t\t{\n\t\t\t\tu._m = min = ((Integer.MAX_VALUE - 1) / u._m < min) ? Integer.MAX_VALUE : u._m * min;\n\t\t\t}\n\t\t\tif (u._n > 0)\n\t\t\t{\n\t\t\t\tu._n = max = ((Integer.MAX_VALUE - 1) / u._n < max) ? Integer.MAX_VALUE : u._n * max;\n\t\t\t}\n\t\t}\n\n\t\treturn min == Integer.MAX_VALUE ? new RegexNode(Nothing, _options) : u;\n\t}",
"public void nouvelleQuestion() {\n getAll();\n Random random = new Random();\n do {\n questionObjet = listeQuestions.get(random.nextInt(listeQuestions.size()));\n niveauUtil = questionObjet.getNiveau();\n }\n while (niveauUtil != niveau);\n questionUtil = questionObjet.getQuestion();\n reponseUtil = questionObjet.getReponse();\n }",
"private Integer randomHemoglobina(){\n\t\t\tint Min = 9, Max = 23;\n\t\t\treturn Min + (int)(Math.random() * ((Max - Min) + 1));\n\t\t}",
"private void posicionInicial(int ancho){\r\n posicionX = ancho;\r\n Random aleatroio = new Random();\r\n int desplazamiento = aleatroio.nextInt(150)+100;\r\n \r\n \r\n cazaTie = new Rectangle2D.Double(posicionX, desplazamiento, anchoEnemigo, alturaEnemigo);\r\n }",
"private static void statistique(){\n\t\tfor(int i = 0; i<7; i++){\n\t\t\tfor(int j = 0; j<7; j++){\n\t\t\t\tfor(int l=0; l<jeu.getJoueurs().length; l++){\n\t\t\t\t\tif(jeu.cases[i][j].getCouleurTapis() == jeu.getJoueurs()[l].getNumJoueur()){\n\t\t\t\t\t\tjeu.getJoueurs()[l].setTapis(jeu.getJoueurs()[l].getTapisRest()+1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tJoueur j;\n\t\tSystem.out.println(\"// Fin de la partie //\");\n\t\tfor(int i=0; i<jeu.getJoueurs().length; i++) {\n\t\t\tj =jeu.getJoueurs()[i];\n\t\t\tSystem.out.println(\"Joueur \"+ (j.getNumJoueur()+1) + \" a obtenue \"+j.getTapisRest()+j.getMonnaie()+\" points\" );\n\t\t}\n\t}",
"public abstract int mo12576RP(int i);",
"public static ArrayList<ArrayList<String>> generateMatrixBRI()\r\n {\r\n\tArrayList<ArrayList<String>> binomialRapInterval = new ArrayList<>();\r\n\tArrayList<String> r = null;\r\n\t\r\n\tfor(int i=0; i<12; i++)\r\n\t{\r\n r = new ArrayList<>();\r\n if(i == 0)\r\n { \r\n r.add(0, \"P1\");\r\n r.add(1, \"d2\");\r\n r.add(2, \"3d3\");\r\n r.add(3, \"5d4\");\r\n r.add(4, \"5A5\");\r\n r.add(5, \"3A6\");\r\n r.add(6, \"A7\");\r\n }\r\n\r\n if(i == 1)\r\n {\r\n r.add(0, \"A1\");\r\n r.add(1, \"m2\");\r\n r.add(2, \"2d3\");\r\n r.add(3, \"4d4\");\r\n r.add(4, \"6A5\");\r\n r.add(5, \"4A6\");\r\n r.add(6, \"2A7\");\r\n }\r\n\r\n if(i == 2)\r\n {\r\n r.add(0, \"2A1\");\r\n r.add(1, \"M2\");\r\n r.add(2, \"d3\");\r\n r.add(3, \"3d4\");\r\n r.add(4, \"5d5\");\r\n r.add(5, \"5A6\");\r\n r.add(6, \"3A7\");\r\n }\r\n\r\n if(i == 3)\r\n {\r\n r.add(0, \"3A1\");\r\n r.add(1, \"A2\");\r\n r.add(2, \"m3\");\r\n r.add(3, \"2d4\");\r\n r.add(4, \"4d5\");\r\n r.add(5, \"5d6\");\r\n r.add(6, \"4A7\");\r\n }\r\n\r\n if(i == 4)\r\n {\r\n r.add(0, \"4A1\");\r\n r.add(1, \"2A2\");\r\n r.add(2, \"M3\");\r\n r.add(3, \"d4\");\r\n r.add(4, \"3d5\");\r\n r.add(5, \"4d6\");\r\n r.add(6, \"5A7\");\r\n }\r\n\r\n if(i == 5)\r\n {\r\n r.add(0, \"5A1\");\r\n r.add(1, \"3A2\");\r\n r.add(2, \"A3\");\r\n r.add(3, \"P4\");\r\n r.add(4, \"2d5\");\r\n r.add(5, \"3d6\");\r\n r.add(6, \"5d7\");\r\n }\r\n\r\n if(i == 6)\r\n {\r\n r.add(0, \"6A1\");\r\n r.add(1, \"4A2\");\r\n r.add(2, \"2A3\");\r\n r.add(3, \"A4\");\r\n r.add(4, \"d5\");\r\n r.add(5, \"2d6\");\r\n r.add(6, \"4d7\");\r\n }\r\n\r\n if(i == 7)\r\n {\r\n r.add(0, \"5d1\");\r\n r.add(1, \"5A2\");\r\n r.add(2, \"3A3\");\r\n r.add(3, \"2A4\");\r\n r.add(4, \"P5\");\r\n r.add(5, \"d6\");\r\n r.add(6, \"3d7\");\r\n }\r\n\r\n if(i == 8)\r\n {\r\n r.add(0, \"4d1\");\r\n r.add(1, \"5d2\");\r\n r.add(2, \"4A3\");\r\n r.add(3, \"3A4\");\r\n r.add(4, \"A5\");\r\n r.add(5, \"m6\");\r\n r.add(6, \"2d7\");\r\n }\r\n\r\n if(i == 9)\r\n {\r\n r.add(0, \"3d1\");\r\n r.add(1, \"4d2\");\r\n r.add(2, \"5A3\");\r\n r.add(3, \"4A4\");\r\n r.add(4, \"2A5\");\r\n r.add(5, \"M6\");\r\n r.add(6, \"d7\");\r\n }\r\n\r\n if(i == 10)\r\n {\r\n r.add(0, \"2d1\");\r\n r.add(1, \"3d2\");\r\n r.add(2, \"5d3\");\r\n r.add(3, \"5A4\");\r\n r.add(4, \"3A5\");\r\n r.add(5, \"A6\");\r\n r.add(6, \"m7\");\r\n }\r\n\r\n if(i == 11)\r\n {\r\n r.add(0, \"d1\");\r\n r.add(1, \"2d2\");\r\n r.add(2, \"4d3\");\r\n r.add(3, \"6A4\");\r\n r.add(4, \"4A5\");\r\n r.add(5, \"2A6\");\r\n r.add(6, \"M7\");\r\n }\r\n binomialRapInterval.add(r);\r\n\t}\r\n\treturn binomialRapInterval;\r\n }",
"private void creaModuloMem() {\n /* variabili e costanti locali di lavoro */\n ArrayList<Campo> campi = new ArrayList<Campo>();\n ModuloRisultati modulo;\n Campo campo;\n\n try { // prova ad eseguire il codice\n\n campo = CampoFactory.intero(Campi.Ris.codicePiatto.getNome());\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.nomePiatto.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"piatto\");\n campo.setToolTipLista(\"nome del piatto\");\n campo.decora()\n .etichetta(\"nome del piatto\"); // le etichette servono per il dialogo ricerca\n campo.setLarghezza(250);\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.categoria.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"categoria\");\n campo.setToolTipLista(\"categoria del piatto\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteVolte.getNome());\n campo.setVisibileVistaDefault();\n campo.setLarghezza(80);\n campo.setTitoloColonna(\"quante volte\");\n campo.setToolTipLista(\n \"quante volte questo piatto è stato offerto nel periodo analizzato\");\n campo.decora().etichetta(\"quante volte\");\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quantiCoperti.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"coperti\");\n campo.setToolTipLista(\"numero di coperti che avrebbero potuto ordinare\");\n campo.decora().etichetta(\"n. coperti\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteComande.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"comande\");\n campo.setToolTipLista(\"numero di comande effettive\");\n campo.decora().etichetta(\"n. comande\");\n campo.setLarghezza(80);\n campo.setTotalizzabile(true);\n campi.add(campo);\n\n campo = CampoFactory.percentuale(Campi.Ris.gradimento.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"gradimento\");\n campo.setToolTipLista(\n \"percentuale di gradimento (è il 100% se tutti i coperti potenziali lo hanno ordinato)\");\n campo.decora().etichetta(\"% gradimento\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n modulo = new ModuloRisultati(campi);\n setModuloRisultati(modulo);\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n }",
"private static int aleatorio(int minimo, int maximo) {\n int aleatorio = (int) Math.floor(Math.random() * (maximo - minimo + 1) + minimo);\n return aleatorio;\n }",
"@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(500, 800);\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}",
"public PghModulo() {\r\n }",
"public static int RepetidorFor(int numero){\n\t\tint suma=0;\n\t\tint resultado=0;\n\t\tfor(int i=1;i<numero;i++){\n\t\t\tresultado=(numero%i);\n\t\t\tif(resultado==0){\n\t\t\t\tsuma=suma+i;\n\t\t\t}\n\t\t}\n\t\treturn suma;\n\t}",
"public ST insertSubstanceLotNumber(int rep) throws HL7Exception { \r\n return (ST) super.insertRepetition(15, rep);\r\n }",
"public void affichageLabyrinthe () {\n\t\t//Affiche le nombre de coups actuel sur la console et sur la fenetre graphique\n\t\tSystem.out.println(\"Nombre de coups : \" + this.laby.getNbCoups() + \"\\n\");\t\t\n\t\tthis.enTete.setText(\"Nombre de coups : \" + this.laby.getNbCoups());\n\n\t\t//Affichage dans la fenêtre et dans la console du labyrinthe case par case, et quand la case est celle ou se trouve le mineur, affiche ce dernier\n\t\tfor (int i = 0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tString ligne = new String();\n\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (i != this.laby.getMineur().getY() || j != this.laby.getMineur().getX()) {\n\t\t\t\t\tligne = ligne + this.laby.getLabyrinthe()[i][j].graphismeCase();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.laby.getLabyrinthe()[i][j]=new Case();\n\t\t\t\t\tligne = ligne + this.laby.getMineur().graphismeMineur();\n\t\t\t\t}\t\t\t\t\n\t\t\t\tif (grille.getComponentCount() < this.laby.getLargeur()*this.laby.getHauteur()) {\n\t\t\t\t\tgrille.add(new JLabel());\n\t\t\t\t\t((JLabel)grille.getComponents()[i*this.laby.getLargeur()+j]).setIcon(this.laby.getLabyrinthe()[i][j].imageCase(themeJeu));\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(ligne);\n\t\t}\n\t\t((JLabel)grille.getComponents()[this.laby.getMineur().getY()*this.laby.getLargeur()+this.laby.getMineur().getX()]).setIcon(this.laby.getMineur().imageCase(themeJeu));\n\t}",
"public void numeros() {\r\n \tint[] lista= new int[3001];\r\n\r\n\t\tFile crear = new File (\"Numerosaleatorios.txt\");\r\n \r\n\t\tFileWriter escribir = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tescribir = new FileWriter (crear);\r\n\t\t\tBufferedWriter escribir1 = new BufferedWriter (escribir);\r\n\t\t\tint linea;\r\n\t\t\tRandom aleatorios = new Random();\r\n\t\t\tfor (int i =0; i<3000; i++) {\r\n\t\t\t\tlinea = aleatorios.nextInt(1000);\r\n\t\t\t\tlista[i]= aleatorios.nextInt(1000);\r\n\t\t\t\tescribir1.write(linea + \"\\n\");\r\n\t\t}\r\n\t\t\r\n\t\tescribir.close();\r\n\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.exit(0);\r\n\t}\r\n\t}",
"public Sort1LoopCloneProblem(int numReps){\n\t\tsetString(numReps);\n\t}",
"void solve() {\n num = new ArrayList<>();\n num.add(BigInteger.valueOf(4));\n for (int len = 2; len <= 100; len++)\n generate(\"4\", 1, len, false);\n Collections.sort(num);\n for (int tc = ii(); tc > 0; tc--) {\n long x = il();\n BigInteger X = BigInteger.valueOf(x);\n for (int i = 0; i < num.size(); i++) {\n if (num.get(i).mod(X).equals(BigInteger.ZERO)) {\n String z = num.get(i).toString();\n int end = z.lastIndexOf('4');\n int len = z.length();\n int a = 2 * (end+1);\n int b = len - end;\n out.println(a + b);\n break;\n }\n }\n }\n }",
"public static void multipleReplacement() {\r\n\t\tfor (int i = 1; i <= 100; i++) {\r\n\t\t\tif (i % 3 == 0) {\r\n\t\t\t\tSystem.out.println(i + \" is a multiple of 3\");\r\n\t\t\t} else if (i % 7 == 0) {\r\n\t\t\t\tSystem.out.println(i + \" is a multiple of 7\");\r\n\t\t\t} else\r\n\t\t\t\tSystem.out.println(i);\r\n\t\t}\r\n\t}",
"void setRandomNo() {\n\t\tno = 10000000 + (int) (Math.random() * 90000000);\n\t}",
"public static int createnumOfMutationss(){\n\t\tint totalMut = 0;\n\t\t\n\t\tint[] gen0 = new int[(int) Math.pow(2,0)]; //size of numOfMutations is based on exponential growth by generation number\n\t\t\tmutate(gen0); //function to mutate\n\t\t\ttotalMut = totalMut + totalMutations(gen0);\n\t\tint[] gen1 = new int[(int) Math.pow(2,1)];\n\t\t\tcheckMutations(gen0, gen1); //checks for previous generation mutations\n\t\t\tmutate(gen1);\n\t\t\ttotalMut = totalMut + totalMutations(gen1);\n\t\tint[] gen2 = new int[(int) Math.pow(2,2)];\n\t\t\tcheckMutations(gen1, gen2);\n\t\t\tmutate(gen2);\n\t\t\ttotalMut = totalMut + totalMutations(gen2);\n\t\tint[] gen3 = new int[(int) Math.pow(2,3)];\n\t\t\tcheckMutations(gen2, gen3);\n\t\t\tmutate(gen3);\n\t\t\ttotalMut = totalMut + totalMutations(gen3);\n\t\tint[] gen4 = new int[(int) Math.pow(2,4)];\n\t\t\tcheckMutations(gen3, gen4);\n\t\t\tmutate(gen4);\n\t\t\ttotalMut = totalMut + totalMutations(gen4);\n\t\tint[] gen5 = new int[(int) Math.pow(2,5)];\n\t\t\tcheckMutations(gen4, gen5);\n\t\t\tmutate(gen5);\n\t\t\ttotalMut = totalMut + totalMutations(gen5);\n\t\tint[] gen6 = new int[(int) Math.pow(2,6)];\n\t\t\tcheckMutations(gen5, gen6);\n\t\t\tmutate(gen6);\n\t\t\ttotalMut = totalMut + totalMutations(gen6);\n\t\tint[] gen7 = new int[(int) Math.pow(2,7)];\n\t\t\tcheckMutations(gen6, gen7);\n\t\t\tmutate(gen7);\n\t\t\ttotalMut = totalMut + totalMutations(gen7);\n\t\tint[] gen8 = new int[(int) Math.pow(2,8)];\n\t\t\tcheckMutations(gen7, gen8);\n\t\t\tmutate(gen8);\n\t\t\ttotalMut = totalMut + totalMutations(gen8);\n\t\tint[] gen9 = new int[(int) Math.pow(2,9)];\n\t\t\tcheckMutations(gen8, gen9);\n\t\t\tmutate(gen9);\n\t\t\ttotalMut = totalMut + totalMutations(gen9);\n\t\tint[] gen10 = new int[(int) Math.pow(2,10)];\n\t\t\tcheckMutations(gen9, gen10);\n\t\t\tmutate(gen10);\n\t\t\ttotalMut = totalMut + totalMutations(gen10);\n\t\t\t\n\t\t\treturn totalMut;\n\t\n\t}",
"private String creaElenco() {\n String testoTabella ;\n String riga = CostBio.VUOTO;\n ArrayList listaPagine = new ArrayList();\n ArrayList listaRiga;\n HashMap mappaTavola = new HashMap();\n String cognomeText;\n int num;\n int taglioPagine = Pref.getInt(CostBio.TAGLIO_COGNOMI_PAGINA);\n String tag = \"Persone di cognome \";\n ArrayList titoli = new ArrayList();\n titoli.add(LibWiki.setBold(\"Cognome\"));\n titoli.add(LibWiki.setBold(\"Voci\"));\n\n for (Map.Entry<String, Integer> mappa: mappaCognomi.entrySet()) {\n\n cognomeText = mappa.getKey();\n num = mappa.getValue();\n if (num >= taglioPagine) {\n cognomeText = tag + cognomeText + CostBio.PIPE + cognomeText;\n cognomeText = LibWiki.setQuadre(cognomeText);\n cognomeText = LibWiki.setBold(cognomeText);\n }// end of if cycle\n\n listaRiga = new ArrayList();\n listaRiga.add(cognomeText);\n listaRiga.add(num);\n listaPagine.add(listaRiga);\n\n }// end of for cycle\n mappaTavola.put(Cost.KEY_MAPPA_SORTABLE_BOOLEAN, true);\n mappaTavola.put(Cost.KEY_MAPPA_TITOLI, titoli);\n mappaTavola.put(Cost.KEY_MAPPA_RIGHE_LISTA, listaPagine);\n testoTabella = LibWiki.creaTable(mappaTavola);\n\n return testoTabella;\n }"
] | [
"0.6163645",
"0.5937941",
"0.58299106",
"0.5772563",
"0.56061286",
"0.56061286",
"0.5536639",
"0.5477792",
"0.544807",
"0.540739",
"0.5387757",
"0.5376241",
"0.5361514",
"0.5326067",
"0.5289786",
"0.5283267",
"0.52777404",
"0.5269993",
"0.52583873",
"0.5258071",
"0.5257858",
"0.52508295",
"0.5238815",
"0.52335507",
"0.52229315",
"0.52193505",
"0.52172923",
"0.52112526",
"0.5179191",
"0.5174445",
"0.51557994",
"0.5137491",
"0.5136925",
"0.51307386",
"0.5121263",
"0.5110578",
"0.5100014",
"0.5097099",
"0.50926214",
"0.50905377",
"0.50901717",
"0.5089321",
"0.50836253",
"0.5076071",
"0.50718755",
"0.5069843",
"0.50682163",
"0.5034787",
"0.50272876",
"0.50205463",
"0.50198966",
"0.5018336",
"0.50033605",
"0.49994335",
"0.4998245",
"0.49910733",
"0.49907228",
"0.49870658",
"0.49802718",
"0.4976427",
"0.49711475",
"0.49688122",
"0.49662542",
"0.4951581",
"0.49509937",
"0.49508917",
"0.4946494",
"0.4940586",
"0.49365506",
"0.4912303",
"0.49108067",
"0.49090388",
"0.4908198",
"0.4904383",
"0.49001232",
"0.49001127",
"0.48982006",
"0.48917416",
"0.4891109",
"0.48810196",
"0.48775935",
"0.48773733",
"0.48773208",
"0.48750198",
"0.48713437",
"0.4868513",
"0.48666215",
"0.48651814",
"0.4864739",
"0.48646477",
"0.48613617",
"0.48601618",
"0.4859372",
"0.48577577",
"0.4856688",
"0.48563984",
"0.48545137",
"0.484998",
"0.4849258",
"0.4846803"
] | 0.49607593 | 63 |
Class only provides static methods, therefore should not be instantiated. | private TLVUtility() {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Util() { }",
"private Utils() {}",
"private Utils() {}",
"private Utils() {}",
"private Utils() {}",
"public static void staticMethod() {\n Log.e(\"LOG_TAG\", \"Company: STATIC Instance method\");\n }",
"private ClassUtil() {}",
"private Utility() {\n throw new IllegalAccessError();\n }",
"private Util() {\n }",
"private S3Utils() {\n throw new UnsupportedOperationException(\"This class cannot be instantiated\");\n }",
"private CommonMethods() {\n }",
"private PluginUtils() {\n\t\t//\t\tthrow new IllegalAccessError(\"Don't instantiate me. I'm a utility class!\");\n\t}",
"private Quantify()\n {\n throw new UnsupportedOperationException(\"Instantiation of utility classes is not supported.\");\n }",
"private AppUtils() {\n throw new UnsupportedOperationException(\"cannot be instantiated\");\n }",
"private MigrationInstantiationUtil() {\n\t\tthrow new IllegalAccessError();\n\t}",
"private Util() {\n }",
"private Util() {\n }",
"private ClassifierUtils() {\n throw new AssertionError();\n }",
"private RendererUtils() {\n throw new AssertionError(R.string.assertion_utility_class_never_instantiated);\n }",
"private Utils()\n {\n // Private constructor to prevent instantiation\n }",
"private InstanceUtil() {\n }",
"private Utils() {\n\t}",
"private Utils() {\n\t}",
"private SparkseeUtils()\n {\n /*\n * Intentionally left empty.\n */\n }",
"@Override\n\t/**\n\t * returns a false because a class cannot be static\n\t * \n\t * @return false\n\t */\n\tpublic boolean getStatic() {\n\t\treturn false;\n\t}",
"private Util()\n {\n // Empty default ctor, defined to override access scope.\n }",
"private Helper() {\r\n // empty\r\n }",
"private OSUtil()\n {\n throw new UnsupportedOperationException(\"Instantiation of utility classes is not permitted.\");\n }",
"private SelfShieldingCalc()\n {\n // This class should just contain static methods. Don't let anyone\n // instantiate it.\n }",
"private stendhal() {\n\t}",
"private SerializationUtils() {\n\t\tthrow new AssertionError();\n\t}",
"private ExplorerFileSystemUtils() {\n // no op\n }",
"private CollectionUtils() {\n\n\t}",
"private CollectionUtils() {\n\t\tthrow new UnsupportedOperationException();\n\t}",
"private CheckUtil(){ }",
"private SnapshotUtils() {\r\n\t}",
"private StringUtilities() {\n // nothing to do\n }",
"private MetallicityUtils() {\n\t\t\n\t}",
"private Topography()\n\t{\n\t\tthrow new IllegalStateException(\"This is an utility class, it can not be instantiated\");\n\t}",
"private static void staticFun()\n {\n }",
"private RunUtils() {\n }",
"public Utils() {}",
"private Utility() {\n\t}",
"private StaticData() {\n\n }",
"private Helper() {\r\n // do nothing\r\n }",
"private J2EEUtils() {\n }",
"private ReportGenerationUtil() {\n\t\t\n\t}",
"@Override\n\tpublic boolean isStatic() {\n\t\treturn false;\n\t}",
"private ContentUtil() {\n // do nothing\n }",
"private JacobUtils() {}",
"private Utils() {\n }",
"private Utils() {\n }",
"private Utils() {\n }",
"private Utils() {\n }",
"private Utils() {\n }",
"private RpcRawTransactionsMethodsConstants() {\n throw new AssertionError();\n }",
"private BuilderUtils() {}",
"private void someUtilityMethod() {\n }",
"private void someUtilityMethod() {\n }",
"private WolUtil() {\n }",
"private HabitTrackerUtils() {\n // Required empty private constructor (to prevent instantiation).\n }",
"private DrillCalciteWrapperUtility() {\n }",
"private PermissionUtil() {\n throw new IllegalStateException(\"you can't instantiate PermissionUtil!\");\n }",
"private FunctionUtils() {\n }",
"@SuppressWarnings(\"UnusedDeclaration\")\n public static void __staticInitializer__() {\n }",
"static void init() {}",
"private DataProviderUtils() {\n }",
"private Constantes() {\r\n\t\t// No way\r\n\t}",
"private PortletRequestUtils() {\r\n\t\tthrow new UnsupportedOperationException();\r\n\t}",
"private WAPIHelper() { }",
"private SupplierLoaderUtil() {\n\t}",
"private EclipsePrefUtils() {\n // Exists only to defeat instantiation.\n }",
"private VlcUtils()\n {\n \n }",
"private GwtUtils() {\n }",
"static void sm() {\n }",
"static void staticShow() {\n System.out.println(\"In a static class static method\");\n }",
"private ComparableEntitySpanUtils() {\n // Singleton\n }",
"private OMUtil() { }",
"private UtilsCache() {\n\t\tsuper();\n\t}",
"private MatrixMultiplication() {\n throw new UnsupportedOperationException(\n \"Error @ new MatrixMultiplication() :: MatrixMultiplication is noninstantiable static class\");\n }",
"private ApplicationConstants(){\n\t\t//not do anything \n\t}",
"private FSUtils() {\n }",
"private static void LessonInstanceVsStatic() {\n System.out.println(MathHelper.E);\n System.out.println(MathHelper.PI);\n System.out.println(MathHelper.square(5));\n //Three helper methods for StringHelper\n System.out.println(StringHelper.removeLeadingAndTrailingSpaces(\" Hello \"));\n System.out.println(StringHelper.removeAllSpace(\" He ll o !\"));\n System.out.println(StringHelper.yelling(\"hello\"));\n //Three helper methods for MathHelper\n System.out.println(MathHelper.cubed(5));\n System.out.println(MathHelper.areaOfRectangle(2,3));\n System.out.println(MathHelper.perimeterOfRectangle(4, 5));\n\n }",
"private WinRateHelper() {\n throw new AssertionError();\n }",
"private NettyHttpUtil() {\n\t\t// do nothing.\n\t}",
"private ThreadUtil() {\n throw new UnsupportedOperationException(\"This class is non-instantiable\"); //$NON-NLS-1$\n }",
"private PathUtils() {\n }",
"private NumberUtil()\n {\n\tLog.getInstance().error(\"This Class is utility class cannot be instantiated\");\n }",
"private JsonUtils()\r\n {\r\n // Private constructor to prevent instantiation\r\n }",
"private IOUtilities() {\n }",
"private CheckingTools() {\r\n super();\r\n }",
"private AcceleoLibrariesEclipseUtil() {\n \t\t// hides constructor\n \t}",
"private JsonUtils() {\n\t\tsuper();\n\t}",
"protected VboUtil() {\n }",
"private ProcessorUtils() { }",
"private ModuleSyncHelper() {\n //Private constructor to avoid instances for this helper.\n }",
"private TriggerUtils() {\n }",
"private RestUtil() {\n\t}",
"private Example() {\n\t\tthrow new Error(\"no instantiation is permitted\");\n\t}",
"private WeblogicMojoUtilities()\n {\n super();\n }",
"private Rekenhulp()\n\t{\n\t}"
] | [
"0.70851475",
"0.6905173",
"0.6905173",
"0.6905173",
"0.6905173",
"0.68702126",
"0.6869905",
"0.6856626",
"0.6820496",
"0.68133247",
"0.6801287",
"0.67075783",
"0.6705465",
"0.66829467",
"0.6674004",
"0.6667071",
"0.6667071",
"0.6638341",
"0.66367245",
"0.6625526",
"0.6591784",
"0.6546533",
"0.6546533",
"0.6520415",
"0.6514894",
"0.6507775",
"0.64701545",
"0.64440143",
"0.64383966",
"0.6436808",
"0.64277065",
"0.6382115",
"0.63785976",
"0.63776535",
"0.6373973",
"0.63665056",
"0.63635445",
"0.63611794",
"0.63494235",
"0.6346234",
"0.63262737",
"0.63130766",
"0.63053066",
"0.6301444",
"0.6291962",
"0.6289276",
"0.62843394",
"0.6277954",
"0.62775904",
"0.6274815",
"0.6268035",
"0.6268035",
"0.6268035",
"0.6268035",
"0.6268035",
"0.62628543",
"0.62491816",
"0.6244676",
"0.6244676",
"0.6235673",
"0.62207174",
"0.6217022",
"0.6214665",
"0.6209145",
"0.6179174",
"0.61766535",
"0.6159721",
"0.6148795",
"0.61485183",
"0.6137795",
"0.61294717",
"0.61218923",
"0.6109424",
"0.61078686",
"0.6104403",
"0.60976815",
"0.6094336",
"0.60923356",
"0.6083073",
"0.6080867",
"0.6070127",
"0.6066623",
"0.6064312",
"0.6057639",
"0.60527736",
"0.60448676",
"0.60432494",
"0.60288346",
"0.6026038",
"0.6024786",
"0.60207164",
"0.60207146",
"0.6018622",
"0.60176414",
"0.60100335",
"0.6008729",
"0.60058016",
"0.59995884",
"0.5993039",
"0.597831",
"0.59739465"
] | 0.0 | -1 |
TO STRING UTILITY Converts the content of a byte array to a String in hexadecimal form. | public static String byteArrayToString(byte[] array) {
StringBuilder str = new StringBuilder();
//iterate through whole array, convert each element from the array to hexadecimal string form, put a space between elements
for(byte b : array) {
str.append(String.format("%02X", b));
str.append(" ");
}
return str.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String toHexString(byte[] array) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"0x\").append(DatatypeConverter.printHexBinary(array));\n return sb.toString();\n }",
"@NotNull\n public static String convertBytesToHex(@NotNull byte[] value) {\n checkNotNull(value);\n int len = value.length;\n char[] buff = new char[len + len];\n char[] hex = HEX;\n for (int i = 0; i < len; i++) {\n int c = value[i] & 0xff;\n buff[i + i] = hex[c >> 4];\n buff[i + i + 1] = hex[c & 0xf];\n }\n return new String(buff);\n }",
"public static String toHexString(byte[] array) {\n return DatatypeConverter.printHexBinary(array).toUpperCase();\n }",
"private String ByteArrayToHexString(byte [] inarray) {\n int i, j, in;\n String [] hex = {\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\"};\n String out= \"\";\n\n for(j = 0 ; j < inarray.length ; ++j)\n {\n in = (int) inarray[j] & 0xff;\n i = (in >> 4) & 0x0f;\n out += hex[i];\n i = in & 0x0f;\n out += hex[i];\n }\n return out;\n }",
"public static final String toHexString(byte[] b) {\n return toHexString(b, 0, b.length);\n }",
"public static String bytesToHex(byte[] array) {\n StringBuffer hexString = new StringBuffer();\n for (int i = 0; i < array.length; i++) {\n String hex = Integer.toHexString(0xff & array[i]);\n if(hex.length() == 1) hexString.append('0');\n hexString.append(hex);\n }\n return hexString.toString();\n }",
"public static String byteArrayToHexString(byte[] value) {\r\n String ret = \"\";\r\n\r\n for (int i = value.length - 1; i >= 0; i--) {\r\n ret = ret.concat(Integer.toHexString((value[i] & 0xFF) | 0x100).substring(1, 3));\r\n }\r\n\r\n return ret;\r\n }",
"static String createString(byte b[]) {\n\treturn StringConverter.byteToHex(b);\n }",
"public static String bytetohex(byte[] bytearray) {\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor (byte b : bytearray) {\n\t\t\tString x = Integer.toHexString((int) (b & 0xFF));\n\t\t\tif (x.length() == 1) {\n\t\t\t\tsb.append(String.valueOf(0));\n\t\t\t}\n\t\t\tsb.append(x);\n\t\t}\n\t\tif (sb.length() % 2 != 0) {\n\t\t\tsb.insert(0, 0);\n\t\t}\n\t\treturn sb.toString();\n\t}",
"private static String byteArrayToHexString(byte[] byteArray) {\n\t\t\n\t\t//Initialize the string buffer\n\t\tStringBuffer stringBuffer = new StringBuffer(byteArray.length * 2);\n\t\t\n\t\t//Start constructing the byte array\n\t\tstringBuffer.append(\"[ \");\n\t\t\n\t\t//For all the bytes in the array\n\t\tfor (int i = 0; i < byteArray.length; i++) {\n\t\t\t\n\t\t\t//Convert the byte to an integer\n\t\t\tint v = byteArray[i] & 0xff;\n\t\t\t\n\t\t\t//Left shift\n\t\t\tif (v < 16) {\n\t\t\t\tstringBuffer.append('0');\n\t\t\t}\n\t\t\t\n\t\t\t//Add the hex string representation of the byte \n\t\t\tstringBuffer.append(\"0x\" + Integer.toHexString(v).toUpperCase() + \" \");\n\t\t}\n\t\t\n\t\t//Close the byte array string\n\t\tstringBuffer.append(\"]\");\n\t\t\n\t\t//Convert the string buffer to a string a return it\n\t\treturn stringBuffer.toString();\n\t}",
"public static String byteArrayToHexStr(byte[] data)\r\n {\r\n\tString output = new String();\r\n\tString tempStr = new String();\r\n\tint tempInt = 0;\r\n\r\n\tfor(int a = 0; a < data.length; a++)\r\n\t {\r\n\t\ttempInt = data[a]&0xFF;\r\n\t\ttempStr = Integer.toHexString(tempInt);\r\n\r\n\t\tif(tempStr.length() == 1)\r\n\t\t tempStr = \"0\" + tempStr;\r\n\r\n\t\toutput += tempStr;\r\n\t }\r\n\treturn output;\r\n }",
"public static String ByteArrayToHexString(byte[] bytes) {\n final char[] hexArray = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};\n char[] hexChars = new char[bytes.length * 2];\n int v;\n for ( int j = 0; j < bytes.length; j++ ) {\n v = bytes[j] & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n return new String(hexChars);\n }",
"public static String hex(final byte[] data) {\n return hex(data, 0, data.length);\n }",
"public static final String bytesToHexString(byte[] bArray, int begin, int end) {\n StringBuffer sb = new StringBuffer(bArray.length);\n String sTemp;\n for (int i = begin; i < end; i++) {\n sTemp = Integer.toHexString(0xFF & bArray[i]);\n if (sTemp.length() < 2)\n sb.append(0);\n sb.append(sTemp.toUpperCase());\n sb.append(\" \");\n }\n return sb.toString();\n }",
"public static String bytesToString(byte[] txtInByte){\n \treturn hexToString(bytesToHex(txtInByte));\n }",
"public static String bytesToHexString(byte[] b) {\n\t\treturn bytesToHexString(b,b.length);\n\t}",
"public static String byteArrayToHexString(byte[] a) \r\n{\r\n\tStringBuilder sb = new StringBuilder(a.length * 2);\r\n\tfor(byte b: a)\r\n\tsb.append(String.format(\"%02x\", b));\r\n\treturn sb.toString();\r\n}",
"public static String byteArrayToHexString(byte[] in) {\n\t\tint ch = 0x00;\n\t\tString pseudo[] = {\"0\", \"1\", \"2\",\n\t\t\t\t\"3\", \"4\", \"5\", \"6\", \"7\", \"8\",\n\t\t\t\t\"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\"};\n\n\t\tStringBuffer out = new StringBuffer(in.length*2);\n\t\tfor (int i = 0; i < in.length; i++) {\n\t\t\tch = ((in[i] & 0xF0) >> 4);\n\t\t\tch = (ch & 0x0F);\n\t\t\tout.append(pseudo[ch]);\n\t\t\tch = (in[i] & 0x0F);\n\t\t\tout.append(pseudo[ch]);\n\t\t}\n\t\treturn new String(out);\n\t}",
"public static String byteArrayToHex(byte[] a) {\n StringBuilder sb = new StringBuilder(a.length * 2);\n for(byte b: a)\n sb.append(String.format(\"%02x\", b & 0xff));\n return sb.toString();\n }",
"public static String byteArrayToHexString(byte[] b) {\n StringBuffer buf = new StringBuffer();\n for (int i = 0; i < b.length; i++) {\n buf.append(byteToHexString(b[i]));\n }\n return buf.toString();\n }",
"public static String toHexString(byte[] b)\r\n {\r\n if (b == null)\r\n return null;\r\n \r\n StringBuffer buf = new StringBuffer(b.length * 2);\r\n for (int n = 0; n < b.length; n++)\r\n {\r\n buf.append(m_hex[(b[n] & 0xf0) >>> 4]);\r\n buf.append(m_hex[b[n] & 0x0f]);\r\n }\r\n return buf.toString();\r\n }",
"public static String bytetohex(byte[] bytearray) {\n\t\tStringBuilder build = new StringBuilder();\n\t\tfor (var bte : bytearray) {\n\t\t\tbuild.append(nibbleToChar((byte) ((bte & 240) >>> 4)));\n\t\t\tbuild.append(nibbleToChar((byte) (bte & 15)));\n\t\t}\n\t\treturn build.toString();\n\t}",
"public static String bytes2HexString(byte[] b)\n\t{\n\t byte[] buff = new byte[2 * b.length];\n\t for (int i = 0; i < b.length; i++)\n\t {\n\t\tbuff[2 * i] = hex[(b[i] >> 4) & 0x0f];\n\t\tbuff[2 * i + 1] = hex[b[i] & 0x0f];\n\t }\n\t return new String(buff);\n\t}",
"public static String toHex(byte[] b) {\r\n\tStringBuffer buf;\r\n\tint i;\r\n\r\n\tbuf = new StringBuffer(b.length * 2);\r\n\r\n\tfor (i = 0; i < b.length; i++) {\r\n\t buf.append(HEX.charAt((b[i] >> 4) & 15));\r\n\t buf.append(HEX.charAt(b[i] & 15));\r\n\t}\r\n\treturn buf.toString();\r\n }",
"public static String byteArrayToHexString(byte[] b) {\n if (b == null)\n return null;\n\n StringBuffer sb = new StringBuffer(b.length * 2);\n for (int i = 0; i < b.length; i++) {\n int v = b[i] & 0xff;\n if (v < 16) {\n sb.append('0');\n }\n sb.append(Integer.toHexString(v));\n }\n return sb.toString().toUpperCase();\n }",
"private String toHex(byte[] data) {\r\n char[] chars = new char[data.length * 2];\r\n for (int i = 0; i < data.length; i++) {\r\n chars[i * 2] = HEX_DIGITS[(data[i] >> 4) & 0xf];\r\n chars[i * 2 + 1] = HEX_DIGITS[data[i] & 0xf];\r\n }\r\n return new String(chars);\r\n}",
"private static String toHex(byte[] array)\n\t {\n\t BigInteger bi = new BigInteger(1, array);\n\t String hex = bi.toString(16);\n\t int paddingLength = (array.length * 2) - hex.length();\n\t if(paddingLength > 0)\n\t return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n\t else\n\t return hex;\n\t }",
"public static String toHex(byte[] array) {\n BigInteger bi = new BigInteger(1, array);\n String hex = bi.toString(16);\n int paddingLength = (array.length * 2) - hex.length();\n if (paddingLength > 0)\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n else\n return hex;\n }",
"private static String toHex(final byte[] array) {\n final BigInteger bi = new BigInteger(1, array);\n final String hex = bi.toString(16);\n final int paddingLength = (array.length * 2) - hex.length();\n if (paddingLength > 0) {\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n } else {\n return hex;\n }\n }",
"public static String byteArrayToHexString(byte[] bytes) {\n // Solution copied from https://stackoverflow.com/questions/9655181\n char[] hexChars = new char[bytes.length * 2];\n for (int j = 0; j < bytes.length; j++) {\n int v = bytes[j] & 0xFF;\n hexChars[j * 2] = Normal.DIGITS_16_UPPER[v >>> 4];\n hexChars[j * 2 + 1] = Normal.DIGITS_16_UPPER[v & 0x0F];\n }\n return new String(hexChars);\n }",
"public static String toHexString(byte[] b) {\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\tfor (int i = 0; i < b.length; i++) {\r\n\t\t\tsb.append(hexCharsLowerCase[ (int)(((int)b[i] >> 4) & 0x0f)]);\r\n\t\t\tsb.append(hexCharsLowerCase[ (int)(((int)b[i]) & 0x0f)]);\r\n\t\t}\r\n\t return sb.toString(); \r\n\t}",
"public static String asString(byte[] in) {\n final StringBuilder builder = new StringBuilder();\n for(byte b : in) {\n builder.append(String.format(\"%02x\", b));\n }\n return builder.toString();\n }",
"private static String byteArrayToHexString(byte[] b) {\n StringBuffer sb = new StringBuffer(b.length * 2);\n for (byte element : b) {\n int v = element & 0xff;\n if(v < 16) {\n sb.append('0');\n }\n sb.append(Integer.toHexString(v));\n }\n return sb.toString().toUpperCase();\n }",
"public static String byteArrayToHex(final byte[] arr) {\n final StringBuilder sb = new StringBuilder();\n if (arr != null) {\n for (final byte b : arr) {\n sb.append(byteToHex(b));\n sb.append(\" \");\n }\n }\n return sb.toString().replaceAll(\" $\", \"\");\n }",
"public static String toHexString(byte b[]) {\n int pos = 0;\n char[] c = new char[b.length * 2];\n for (int i = 0; i < b.length; i++) {\n c[pos++] = toHex[(b[i] >> 4) & 0x0F];\n c[pos++] = toHex[b[i] & 0x0f];\n }\n return new String(c);\n }",
"static public String byteArrayToHexString(byte[] bytes) {\n\t\tStringBuilder sb = new StringBuilder(bytes.length * 2);\n\t\tfor (byte element : bytes) {\n\t\t\tint v = element & 0xff;\n\t\t\tif (v < 16) {\n\t\t\t\tsb.append('0');\n\t\t\t}\n\t\t\tsb.append(Integer.toHexString(v));\n\t\t}\n\t\treturn sb.toString().toUpperCase(Locale.US);\n\t}",
"public static String bytesToHex(byte[] bytes){\n if(bytes == null)\n throw new NullPointerException();\n String result = \"\";\n for(byte b: bytes){\n String tmp = Integer.toHexString(b & 0xFF);\n if(tmp.length() == 1)\n result += \"0\";\n result += tmp;\n }\n return result;\n }",
"public String toString() {\n return Util.bytesToHex(getByteArray());\n }",
"private static String bytesToHex(byte[] bytes) {\n final char[] hexArray = {'0', '1', '2', '3', '4', '5', '6', '7', '8',\n '9', 'A', 'B', 'C', 'D', 'E', 'F'};\n char[] hexChars = new char[bytes.length * 2];\n int v;\n for (int j = 0; j < bytes.length; j++) {\n v = bytes[j] & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n return new String(hexChars);\n }",
"public static String toHex(byte[] array) {\n\t\tBigInteger bi = new BigInteger(1, array);\n\t\tString hex = bi.toString(16);\n\t\tint paddingLength = (array.length * 2) - hex.length();\n\t\tif (paddingLength > 0) {\n\t\t\tString format = \"%0\" + paddingLength + \"d\";\n\t\t\treturn String.format(format, 0) + hex;\n\t\t} else {\n\t\t\treturn hex;\n\t\t}\n\t}",
"public static String toHexString(byte[] byteArray) {\n final StringBuilder hexString = new StringBuilder(\"\");\n if (byteArray == null || byteArray.length <= 0)\n return null;\n for (int i = 0; i < byteArray.length; i++) {\n int v = byteArray[i] & 0xFF;\n String hv = Integer.toHexString(v);\n if (hv.length() < 2) {\n hexString.append(0);\n }\n hexString.append(hv);\n }\n return hexString.toString().toLowerCase();\n }",
"private static String bytesToHex(byte[] bytes) {\n char[] hexChars = new char[bytes.length * 2];\n for (int j = 0; j < bytes.length; j++) {\n int v = bytes[j] & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n return new String(hexChars);\n }",
"public static String toHexString(byte[] bytes) {\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\tfor (byte b : bytes) {\n\t\t\tstringBuilder.append(HEX_ALPHABET[b>>4]);\n\t\t\tstringBuilder.append(HEX_ALPHABET[b]);\n\t\t}\n\t\treturn stringBuilder.toString();\n\t}",
"public static String hexToString(byte[] bytes) {\n StringBuffer buff = new StringBuffer();\n for (int i=0; i<bytes.length; i++) {\n int val = bytes[i];\n val = val & 0xff; // remove higher bits, sign\n if (val<16) buff.append('0'); // leading 0\n buff.append(Integer.toString(val, 16));\n }\n return buff.toString();\n }",
"private static String toHex(byte[] array) {\r\n\t\tBigInteger bi = new BigInteger(1, array);\r\n\t\tString hex = bi.toString(16);\r\n\t\tint paddingLength = (array.length * 2) - hex.length();\r\n\t\tif (paddingLength > 0)\r\n\t\t\treturn String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\r\n\t\telse\r\n\t\t\treturn hex;\r\n\t}",
"public static String hex(final byte[] data, final int offset, final int length) {\n Validate.notInBounds(data, offset, length);\n if (length == 0) {\n return \"\";\n }\n int endIndex = offset + length;\n char[] buf = new char[length << 1];\n\n int srcIdx = offset;\n int dstIdx = 0;\n for (; srcIdx < endIndex; srcIdx++, dstIdx += 2) {\n System.arraycopy(Hexs.HEXDUMP_TABLE, (data[srcIdx] & 0xFF) << 1, buf, dstIdx, 2);\n }\n return new String(buf);\n }",
"private static String toHex(byte[] array) {\r\n BigInteger bi = new BigInteger(1, array);\r\n String hex = bi.toString(16);\r\n int paddingLength = (array.length * 2) - hex.length();\r\n if (paddingLength > 0) {\r\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\r\n } else {\r\n return hex;\r\n }\r\n }",
"private static String toHex(byte[] array) throws NoSuchAlgorithmException {\n\n BigInteger bi = new BigInteger(1, array);\n String hex = bi.toString(16);\n int paddingLength = (array.length * 2) - hex.length();\n if (paddingLength > 0) {\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n } else {\n return hex;\n }\n }",
"private String toHexString(byte[] bytes) {\n StringBuilder hexString = new StringBuilder();\n for (int i = 0; i < bytes.length; i++) {\n String hex = Integer.toHexString(0xFF & bytes[i]);\n if (hex.length() == 1) {\n hexString.append('0');\n }\n hexString.append(hex);\n }\n\n return hexString.toString().toUpperCase();\n }",
"private String toHex(byte[] array)\n {\n BigInteger bi = new BigInteger(1, array);\n String hex = bi.toString(16);\n int paddingLength = (array.length * 2) - hex.length();\n if(paddingLength > 0) \n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n else\n return hex;\n }",
"public String toHexString()\n\t{\n\t\t// holds the string builder object to return\n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\t// for every byte\n\t\tfor (int i = 0; i < bytes.length; i++)\n\t\t{\n\t\t\tint intCurrent = bytes[i] & 0xFF;\n\t\t\t\n\t\t\t// check to see if a leading 0 is needed\n\t\t\tif (intCurrent < 0x10)\n\t\t\t{\n\t\t\t\t// append a 0\n\t\t\t\tsb.append(0);\n\t\t\t}\n\t\t\t\n\t\t\tString s = Integer.toHexString(intCurrent).toUpperCase();\n\t\t\t\n\t\t\t// append the character\n\t\t\tsb.append(s);\n\t\t}\n\t\t\n\t\t// return the string\n\t\treturn sb.toString();\n\t}",
"public static String toHexString(byte[] b, int offset, int len)\r\n {\r\n if (b == null || b.length <= offset || offset < 0 || len <= 0)\r\n return null;\r\n\r\n StringBuffer buf = new StringBuffer(len * 2);\r\n int limit = Math.min(b.length, len + offset);\r\n for (int n = offset; n < limit; n++)\r\n {\r\n buf.append(m_hex[(b[n] & 0xf0) >>> 4]);\r\n buf.append(m_hex[b[n] & 0x0f]);\r\n }\r\n return buf.toString();\r\n \r\n }",
"public static String binToHexString(byte[] data) {\r\n return binToHexString(data, data.length);\r\n }",
"public static String rawHexDump(byte[] b)\r\n\t{\r\n\t\tif (b == null)\r\n\t\t\treturn \"\";\r\n\t\t\r\n\t\tint size = b.length;\r\n\t\tif (size == 0)\r\n\t\t\treturn \"\";\r\n\t\t\r\n\t\tStringBuffer buf = new StringBuffer();\r\n\t\tfor (int i=0; i < size; i++)\r\n\t\t{\r\n\t\t\t\tbuf.append(zeropad(Integer.toHexString(byteToUInt(b[i])).toUpperCase(),2));\r\n\t\t\t\tbuf.append(\" \");\r\n\t\t}\r\n\t\tbuf.delete(buf.length()-1,buf.length());\r\n\t\treturn buf.toString();\r\n\t}",
"public static String toHexadecimal(final byte[] bytes) {\n\t\treturn new String(toHexadecimalChars(bytes));\n\t}",
"private static String convertToHex(byte[] data) throws IOException {\n //create new instance of string buffer\n StringBuffer stringBuffer = new StringBuffer();\n String hex = \"\";\n\n //encode byte data with base64\n hex = Base64.getEncoder().encodeToString(data);\n stringBuffer.append(hex);\n\n //return string\n return stringBuffer.toString();\n }",
"public static String toHex(byte[] bytes){\r\n\t\treturn hexEncode(bytes);\r\n\t}",
"public static String byteArrayToHex(byte[] bytes) {\n if (bytes == null) {\n throw new IllegalArgumentException((\"'bytes' must not be null\"));\n }\n\n StringBuilder sb = new StringBuilder(bytes.length * 2);\n for (byte b : bytes) {\n sb.append(format(\"%02x\", b));\n }\n return sb.toString();\n }",
"public static String bytetohex(byte[] byteArray) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i < byteArray.length; i++) {\n\t\t\tsb.append(String.format(\"%02x\", 0xFF & (int) byteArray[i]));\n\t\t}\n\t\treturn sb.toString().toLowerCase();\n\t}",
"public static String toHex(byte[] data) {\n\t\tStringBuilder builder = new StringBuilder(data.length * 3);\n\t\tfor (byte b : data) {\n\t\t\tint v = b & 0xFF;\n\t\t\t// Get the first then second character\n\t\t\tbuilder.append(HEX_ARRAY[v >>> 4]);\n\t\t\tbuilder.append(HEX_ARRAY[v & 0x0F]);\n\t\t\tbuilder.append(' ');\n\t\t}\n\t\treturn builder.toString().trim();\n\t}",
"private static String hexify(byte bytes[]) {\n\n char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};\n\n StringBuilder buf = new StringBuilder(bytes.length * 2);\n for (byte aByte : bytes) {\n buf.append(hexDigits[(aByte & 0xf0) >> 4]);\n buf.append(hexDigits[aByte & 0x0f]);\n }\n return buf.toString();\n }",
"public static String\n bytesToHexString(byte[] bytes) {\n if (bytes == null) return null;\n\n StringBuilder ret = new StringBuilder(2*bytes.length);\n\n for (int i = 0 ; i < bytes.length ; i++) {\n int b;\n\n b = 0x0f & (bytes[i] >> 4);\n\n ret.append(HEX_CHARS[b]);\n\n b = 0x0f & bytes[i];\n\n ret.append(HEX_CHARS[b]);\n }\n\n return ret.toString();\n }",
"public static String byteToHex(byte[] bytes) {\n\t\tchar[] hexChars = new char[bytes.length * 2];\n\t\tfor (int i = 0; i < bytes.length; i++) {\n\t\t\tint j = bytes[i] & 0xFF;\n\t\t\thexChars[i * 2] = hexLookup[j >>> 4];\n\t\t\thexChars[i * 2 + 1] = hexLookup[j & 0x0F];\n\t\t}\n\t\treturn new String(hexChars);\n\t}",
"public static String bytesToHexString(byte[] bytes) {\n char[] hexChars = new char[bytes.length * 2];\n int v;\n for (int j = 0; j < bytes.length; j++) {\n v = bytes[j] & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n return new String(hexChars).toUpperCase(Locale.US);\n }",
"private String toHex(byte[] bytes) {\n StringBuilder s = new StringBuilder(bytes.length * 2);\n for (byte b : bytes) {\n s.append(String.format(\"%02x\", b));\n }\n return s.toString();\n }",
"public static String encodeHexString(byte[] byteArray) {\n StringBuffer hexStringBuffer = new StringBuffer();\n for (byte b : byteArray) {\n hexStringBuffer.append(byteToHex(b));\n }\n return hexStringBuffer.toString();\n }",
"public static String convertToHex(byte[] otp) {\n return ByteIterator.ofBytes(otp).hexEncode().drainToString();\n }",
"public String byte2hex(byte[] b) {\n String hs = \"\";\n String stmp = \"\";\n for (int n = 0; n < b.length; n++) {\n stmp = (java.lang.Integer.toHexString(b[n] & 0XFF));\n if (stmp.length() == 1) {\n hs = hs + \"0\" + stmp;\n } else {\n hs = hs + stmp;\n }\n\n if (n < b.length - 1) {\n hs = hs + \"\";\n }\n }\n\n return hs;\n }",
"public static String byte2hex(byte[] b) {\n String hs = \"\";\n String stmp = \"\";\n\n for (int n = 0; n < b.length; n++) {\n stmp = Integer.toHexString(b[n] & 0xFF);\n if (stmp.length() == 1)\n hs += (\"0\" + stmp);\n else\n hs += stmp;\n }\n return hs.toUpperCase();\n }",
"@NonNull\n public static String byteToString(byte[] byteArray) throws UnsupportedEncodingException\n {\n return new String(byteArray, \"UTF-8\");\n }",
"public static String getHexString (byte[] bytes) {\r\n\t \r\n\t\tStringBuffer sb = new StringBuffer();\r\n\r\n\t for (int i = 0; i < bytes.length; i++) {\r\n\t sb.append(String.format(\"%02x\", bytes[i]).toUpperCase());\r\n\t if (i < (bytes.length - 1))\r\n\t \tsb.append(\"-\");\r\n\t }\r\n\r\n\t return sb.toString();\r\n\t}",
"private static String bytesToHex(byte[] bytes) {\n StringBuilder result = new StringBuilder();\n\n for (byte byt : bytes) {\n result.append(Integer.toString((byt & 0xff) + 0x100, 16).substring(1));\n }\n\n return result.toString();\n }",
"public String toHexString() {\n\treturn ByteUtils.toHexString(toByteArray());\n }",
"public static String bytesToHex(byte[] bytes) {\n Formatter f = new Formatter();\n for (byte b : bytes) {\n f.format(\"%02x\", b);\n }\n return f.toString();\n }",
"public static String bytesToHex(byte[] bytes) {\n StringBuffer result = new StringBuffer();\n for (byte byt : bytes) {\n result.append(Integer.toString((byt & 0xff) + 0x100, 16).substring(1));\n }\n return result.toString();\n }",
"private static String bytes2String(byte[] bytes) {\n StringBuffer stringBuffer = new StringBuffer();\n for (int i = 0; i < bytes.length; i++) {\n stringBuffer.append((char) bytes[i]);\n }\n return stringBuffer.toString();\n }",
"private String hexify(byte bytes[]) {\n\n char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};\n\n StringBuilder buf = new StringBuilder(bytes.length * 2);\n\n for (byte aByte : bytes) {\n buf.append(hexDigits[(aByte & 0xf0) >> 4]);\n buf.append(hexDigits[aByte & 0x0f]);\n }\n\n return buf.toString();\n }",
"public static String convert(byte[] bytes) {\n/* 34 */ StringBuffer sb = new StringBuffer(bytes.length * 2);\n/* 35 */ for (int i = 0; i < bytes.length; i++) {\n/* 36 */ sb.append(hexs[bytes[i] >> 4 & 0xF]);\n/* 37 */ sb.append(hexs[bytes[i] & 0xF]);\n/* */ } \n/* 39 */ return sb.toString();\n/* */ }",
"public static String prettyHex(final byte[] data) {\n return prettyHex(data, 0, data.length);\n }",
"public static String bytesToHex(byte[] txtInByte) {\n\t\t StringBuilder sb = new StringBuilder(txtInByte.length * 2);\n\t\t for(byte b: txtInByte)\n\t\t sb.append(String.format(\"%02x\", b & 0xff));\n\t\t return sb.toString();\n\t\t}",
"public static String bytesToHexString(byte[] b, int len) {\n\t\tString s=new String();\n\t\tfor (int i=0; i<len; i++) {\n\t\t\ts+=Integer.toHexString((((b[i]+256)%256)/16)%16);\n\t\t\ts+=Integer.toHexString(((b[i]+256)%256)%16);\n\t\t}\n\t\treturn s;\n\t}",
"public static String byteToHex(final byte[] hash) {\n if (Objects.isNull(hash)) {\n return null;\n }\n\n Formatter formatter = new Formatter();\n for (byte b : hash) {\n formatter.format(\"%02x\", b);\n }\n String result = formatter.toString();\n formatter.close();\n return result;\n }",
"public static String toHexString( byte[] ba ) {\n int length = ba.length;\n char[] buf = new char[length * 3];\n for (int i = 0, j = 0, k; i < length; ) {\n k = ba[i++];\n buf[j++] = HEX_DIGITS[(k >> 4) & 0x0F];\n buf[j++] = HEX_DIGITS[ k & 0x0F];\n buf[j++] = ' ';\n }\n return new String(buf, 0, buf.length-1);\n }",
"public static String bytesToHex(byte[] in) {\n final StringBuilder builder = new StringBuilder();\n for (byte b : in) {\n builder.append(String.format(\"%02x\", b));\n }\n return builder.toString();\n }",
"public static String toHex(byte[] bytes)\n {\n\n if (bytes == null)\n {\n return null;\n }\n\n StringBuilder builder = new StringBuilder();\n for (int i = 0; i < bytes.length; i++)\n {\n int value = (int) bytes[i];\n\n builder.append(HEX_CHARS.charAt((value >> 4) & 0x0F));\n builder.append(HEX_CHARS.charAt(value & 0x0F));\n }\n\n return builder.toString();\n }",
"private static String toString (byte[] ba) {\r\n return toString(ba, 0, ba.length);\r\n }",
"private static String _bytesToHex( ByteBuffer buf )\n {\n final int offset = buf.position();\n final int size = buf.remaining();\n final char[] hexChars = new char[size * 2];\n\n for (int j = 0; j < size; j++) {\n int v = buf.get(j + offset) & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n\n return new String(hexChars);\n }",
"public static String byteArrayToHexString(final byte[] hash) {\n\t\tString rval = \"\";\n\t\tfor (byte aHash : hash) {\n\t\t\trval += FileHashingUtils.byteToHexString(aHash);\n\t\t}\n\n\t\treturn rval;\n\t}",
"public static String getHexString(byte[] raw, int len) {\r\n\t\tbyte[] hex = new byte[2 * len];\r\n\t\tint index = 0;\r\n\t\tint pos = 0;\r\n\r\n\t\tfor (byte b : raw) {\r\n\t\t\tif (pos >= len)\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tpos++;\r\n\t\t\tint v = b & 0xFF;\r\n\t\t\thex[index++] = HEX_CHAR_TABLE[v >>> 4];\r\n\t\t\thex[index++] = HEX_CHAR_TABLE[v & 0xF];\r\n\t\t}\r\n\r\n\t\treturn new String(hex);\r\n\t}",
"public static String bytesToHexFun2(byte[] bytes) {\r\n\t\tchar[] buf = new char[bytes.length * 2];\r\n\t\tint index = 0;\r\n\t\tfor (byte b : bytes) { // 利用位运算进行转换\r\n\t\t\tbuf[index++] = HEX_CHAR[b >>> 4 & 0xf];\r\n\t\t\tbuf[index++] = HEX_CHAR[b & 0xf];\r\n\t\t}\r\n\r\n\t\treturn new String(buf);\r\n\t}",
"public static String bytesToString(byte[] b) {\n\t\tString s=new String(b);\n\t\treturn s.trim();\n\t}",
"private String byteToString(byte[] bytes) {\n String bytesInStringForm = \"\";\n for (int byteChecked = 0; byteChecked < bytes.length; byteChecked++) {\n bytesInStringForm += (Integer.toString(bytes[byteChecked]));\n bytesInStringForm += (\",\");\n }\n return bytesInStringForm;\n }",
"static public String byteToHex(byte b) {\n\t\tchar hexDigit[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A',\n\t\t\t\t'B', 'C', 'D', 'E', 'F' };\n\t\tchar[] array = { hexDigit[(b >> 4) & 0x0f], hexDigit[b & 0x0f] };\n\t\treturn new String(array);\n\t}",
"public static String bytesToHex(byte[] raw) {\n if (raw == null) {\n return null;\n }\n final StringBuilder hex = new StringBuilder(2 * raw.length);\n for (final byte b : raw) {\n hex.append(Character.forDigit((b & 0xF0) >> 4, 16))\n .append(Character.forDigit((b & 0x0F), 16));\n }\n return hex.toString();\n }",
"static public String byteToHex(byte b) {\n\t\tchar hexDigit[] = {\n\t\t\t\t'0', '1', '2', '3', '4', '5', '6', '7',\n\t\t\t\t'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'\n\t\t};\n\t\tchar[] array = { hexDigit[(b >> 4) & 0x0f], hexDigit[b & 0x0f] };\n\t\treturn new String(array);\n\t}",
"private static String byteToHex(byte b) {\n\t\tchar hexDigit[] = {\n\t\t\t\t'0', '1', '2', '3', '4', '5', '6', '7',\n\t\t\t\t'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'\n\t\t};\n\t\tchar[] array = {hexDigit[(b >> 4) & 0x0f], hexDigit[b & 0x0f]};\n\t\treturn new String(array);\n\t}",
"public String bytesToHex(byte[] bytes) {\n\t StringBuilder sbuf = new StringBuilder();\n\t for(int idx=0; idx < bytes.length; idx++) {\n\t int intVal = bytes[idx] & 0xff;\n\t if (intVal < 0x10) sbuf.append(\"0\");\n\t sbuf.append(Integer.toHexString(intVal).toUpperCase());\n\t }\n\t return sbuf.toString();\n\t }",
"public static String byteToHex(byte b) {\n return new String(new char[] {HEX_CHARS[(b & 0xFF) >>> 4], HEX_CHARS[b & 0xF]});\n }",
"public static String hex(final byte value) {\n char[] buf = new char[2];\n System.arraycopy(Hexs.HEXDUMP_TABLE, (value & 0xFF) << 1, buf, 0, 2);\n return new String(buf);\n }",
"private static String convertToHex(byte[] data) {\r\n StringBuffer buf = new StringBuffer();\r\n for (int i = 0; i < data.length; i++) {\r\n int halfbyte = (data[i] >>> 4) & 0x0F;\r\n int two_halfs = 0;\r\n do {\r\n if ((0 <= halfbyte) && (halfbyte <= 9)) {\r\n buf.append((char) ('0' + halfbyte));\r\n }\r\n else {\r\n buf.append((char) ('a' + (halfbyte - 10)));\r\n }\r\n halfbyte = data[i] & 0x0F;\r\n } while(two_halfs++ < 1);\r\n }\r\n return buf.toString();\r\n }"
] | [
"0.8027708",
"0.79676944",
"0.78991175",
"0.78667116",
"0.77375644",
"0.76695645",
"0.7606129",
"0.7604511",
"0.7567418",
"0.7551914",
"0.7529716",
"0.75030375",
"0.746503",
"0.74534",
"0.7447939",
"0.7447004",
"0.7417886",
"0.74028236",
"0.7395845",
"0.7379873",
"0.736951",
"0.73506683",
"0.73475814",
"0.734167",
"0.7341524",
"0.7314807",
"0.73121464",
"0.7306595",
"0.72969174",
"0.7295238",
"0.7275213",
"0.7260413",
"0.7256936",
"0.72526586",
"0.72363037",
"0.72322065",
"0.7229503",
"0.72209305",
"0.7219132",
"0.7218898",
"0.7205272",
"0.72038835",
"0.7191275",
"0.7188787",
"0.71876836",
"0.7172925",
"0.71676624",
"0.7159732",
"0.7155082",
"0.7154909",
"0.7140474",
"0.7132615",
"0.7123054",
"0.71063566",
"0.7088225",
"0.70879275",
"0.70865756",
"0.70759606",
"0.7060967",
"0.7057324",
"0.70542043",
"0.7053963",
"0.7053663",
"0.70342565",
"0.70333904",
"0.70273155",
"0.7026252",
"0.7025154",
"0.70189947",
"0.7018751",
"0.7011573",
"0.7001231",
"0.6997718",
"0.69929266",
"0.69807196",
"0.6975171",
"0.6960989",
"0.6942091",
"0.6936462",
"0.693385",
"0.6925875",
"0.6916058",
"0.6895601",
"0.6874052",
"0.6867648",
"0.6832971",
"0.6831118",
"0.68259084",
"0.68133277",
"0.679495",
"0.6784464",
"0.67775816",
"0.67725754",
"0.6760652",
"0.67550164",
"0.67541283",
"0.6738217",
"0.668036",
"0.6673421",
"0.6653476"
] | 0.77081966 | 5 |
Converts the contents of a byte array to a String in binary form, leaving the leading zeroes intact. | public static String byteArrayToBinaryString(byte[] array) {
StringBuilder str = new StringBuilder();
for(byte b : array) {
str.append(("00000000"+Integer.toBinaryString(b)).substring(Integer.toBinaryString(b).length()));
str.append(" ");
}
return str.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String arrayToBinaryString(final byte[] bytes)\n\t{\n\t\tfinal StringBuilder builder = new StringBuilder();\n\t\tbuilder.append(Long.toBinaryString((char)bytes[0]));\n\t\tfor(int i = 1; i < bytes.length; i ++)\n\t\t\tbuilder.append(BYTE_DELIMITER+Long.toBinaryString((char)bytes[i]));\n\t\treturn builder.toString();\n\t}",
"public static String bytesToString(byte[] b) {\n\t\tString s=new String(b);\n\t\treturn s.trim();\n\t}",
"private String toBinary( byte[] bytes )\n\t{\n \t\tStringBuilder sb = new StringBuilder(bytes.length * Byte.SIZE);\n\t\tfor( int i = 0; i < Byte.SIZE * bytes.length; i++ )\n\t\t\tsb.append((bytes[i / Byte.SIZE] << i % Byte.SIZE & 0x80) == 0 ? '0' : '1');\n\t\treturn sb.toString();\n\t}",
"public static String byteArrayToString(byte[] array) {\n\t\tStringBuilder str = new StringBuilder();\n\t\t\n\t\t//iterate through whole array, convert each element from the array to hexadecimal string form, put a space between elements\n\t\tfor(byte b : array) {\n\t\t\tstr.append(String.format(\"%02X\", b));\n\t\t\tstr.append(\" \");\n\t\t}\n\t\treturn str.toString();\n\t}",
"public static String asString(byte[] in) {\n final StringBuilder builder = new StringBuilder();\n for(byte b : in) {\n builder.append(String.format(\"%02x\", b));\n }\n return builder.toString();\n }",
"public static String toByteString(byte[] array) {\n StringBuilder sb = new StringBuilder(\"{\");\n for (int i = 0; i < array.length; i++) {\n if (i > 0)\n sb.append(\" \");\n sb.append(toByteString(array[i]));\n }\n return sb.append(\"}\").toString();\n }",
"public static String bytesToString(byte[] bytes) {\n if (bytes == null) {\n return \"\";\n }\n return new String(bytes, ENCODING);\n }",
"private static String bytes2String(byte[] bytes) {\n StringBuffer stringBuffer = new StringBuffer();\n for (int i = 0; i < bytes.length; i++) {\n stringBuffer.append((char) bytes[i]);\n }\n return stringBuffer.toString();\n }",
"public static String binValue(byte[] bytes) {\n StringBuilder sb = new StringBuilder(8*bytes.length);\n for (int j = 0; j< bytes.length; j++){\n sb.append(binValue(bytes[j]));\n }\n return sb.toString();\n }",
"private String byteToString(byte[] bytes) {\n String bytesInStringForm = \"\";\n for (int byteChecked = 0; byteChecked < bytes.length; byteChecked++) {\n bytesInStringForm += (Integer.toString(bytes[byteChecked]));\n bytesInStringForm += (\",\");\n }\n return bytesInStringForm;\n }",
"@NonNull\n public static String byteToString(byte[] byteArray) throws UnsupportedEncodingException\n {\n return new String(byteArray, \"UTF-8\");\n }",
"public static String bytesToString(byte[] txtInByte){\n \treturn hexToString(bytesToHex(txtInByte));\n }",
"private static String toString (byte[] ba) {\r\n return toString(ba, 0, ba.length);\r\n }",
"public static String byteArrayToString(byte[] value) {\r\n String ret = \"\";\r\n\r\n for (int i = 0; i < value.length; i++) {\r\n if (value[i] >= 32 && value[i] <= 126) ret = ret + ((char) value[i]);\r\n else ret = ret.concat(\".\");\r\n }\r\n\r\n return ret;\r\n }",
"public static String byteArrayToString(byte[] ba, int offset, int length) {\n return new String(Arrays.copyOfRange(ba, offset, offset + length), Charset.forName(CommonDefs.CHARSET)).trim();\n\n }",
"public static String binToHexString(byte[] data) {\r\n return binToHexString(data, data.length);\r\n }",
"public static String decodeBytesToString(byte[] byteArray) {\n byte[] tempArray = new byte[byteArray.length];\n byte[] outputArray = new byte[byteArray.length];\n for (int i = byteArray.length - 1; i >= 0; i--)\n tempArray[i] = byteArray[i];\n\n for (int i = byteArray.length - 1; i >= 0; i--) {\n tempArray[i] = rotateRightByte(byteArray[i], 7);\n if (i == tempArray.length - 1)\n outputArray[i] = (byte) (tempArray[i] ^ tempArray[0] ^ 0x71);\n else\n outputArray[i] = (byte) (tempArray[i] ^ outputArray[i + 1] ^ 0x71);\n }\n return new String(outputArray);\n }",
"private String bytesToString(byte[] someBytes) {\n String retStr = \"\";\n\n for (int i = 0; i < someBytes.length; ++i) {\n retStr += \" \" + someBytes[i];\n }\n\n return retStr;\n }",
"public static String encodeToString(byte[] bytes){\n\t\treturn encodeToString(bytes, false);\n\t}",
"public static String b2s(byte b[]) {\n\t\tint len = 0;\n\t\t\n\t\twhile (b[len] != 0) {\n\t\t\tlen += 1;\n\t\t}\n\n\t\treturn new String(b, 0, len);\n\t}",
"public static String toHexString(byte[] array) {\n return DatatypeConverter.printHexBinary(array).toUpperCase();\n }",
"public static String data(byte[] a)\n {\n if (a == null)\n return null;\n StringBuilder ret = new StringBuilder();\n int i = 0;\n while (a[i] != 0)\n {\n ret.append((char) a[i]);\n i++;\n }\n return ret.toString();\n }",
"public static String toString(byte[] buf) {\r\n if (buf == null) {\r\n return \"null\";\r\n }\r\n return toString(buf, 0, buf.length);\r\n }",
"public static String byteArrayToString(byte[] ba) {\n return new String(ba, Charset.forName(CommonDefs.CHARSET)).trim();\n }",
"public static String toByteString(byte value) {\n String str = String.format(\"%x\", value);\n if (str.length() == 1)\n str = \"0\" + str;\n return str;\n }",
"static String createString(byte b[]) {\n\treturn StringConverter.byteToHex(b);\n }",
"public static String convert(byte[] bytes) {\n/* 34 */ StringBuffer sb = new StringBuffer(bytes.length * 2);\n/* 35 */ for (int i = 0; i < bytes.length; i++) {\n/* 36 */ sb.append(hexs[bytes[i] >> 4 & 0xF]);\n/* 37 */ sb.append(hexs[bytes[i] & 0xF]);\n/* */ } \n/* 39 */ return sb.toString();\n/* */ }",
"public static String byte2str(byte b) {\r\n String s = String.format(\"%8s\", Integer.toBinaryString(b & 0xFF)).replace(\r\n ' ', '0');\r\n return s;\r\n }",
"public static String byteArrayToHexStr(byte[] data)\r\n {\r\n\tString output = new String();\r\n\tString tempStr = new String();\r\n\tint tempInt = 0;\r\n\r\n\tfor(int a = 0; a < data.length; a++)\r\n\t {\r\n\t\ttempInt = data[a]&0xFF;\r\n\t\ttempStr = Integer.toHexString(tempInt);\r\n\r\n\t\tif(tempStr.length() == 1)\r\n\t\t tempStr = \"0\" + tempStr;\r\n\r\n\t\toutput += tempStr;\r\n\t }\r\n\treturn output;\r\n }",
"public static String\n bchToString(byte[] data, int offset, int length) {\n StringBuilder ret = new StringBuilder(length*2);\n\n for (int i = offset ; i < offset + length ; i++) {\n int v;\n\n v = data[i] & 0xf;\n ret.append(HEX_CHARS[v]);\n\n v = (data[i] >> 4) & 0xf;\n ret.append(HEX_CHARS[v]);\n }\n\n return ret.toString();\n }",
"public static String bytesToString(byte[] bytes) {\n return Base64.encodeBase64String(bytes);\n }",
"public static String toHexString(byte[] array) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"0x\").append(DatatypeConverter.printHexBinary(array));\n return sb.toString();\n }",
"public static String toBinaryString(BigInteger data) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"0b\").append(data.toString(2));\n return sb.toString();\n }",
"public static String rawHexDump(byte[] b)\r\n\t{\r\n\t\tif (b == null)\r\n\t\t\treturn \"\";\r\n\t\t\r\n\t\tint size = b.length;\r\n\t\tif (size == 0)\r\n\t\t\treturn \"\";\r\n\t\t\r\n\t\tStringBuffer buf = new StringBuffer();\r\n\t\tfor (int i=0; i < size; i++)\r\n\t\t{\r\n\t\t\t\tbuf.append(zeropad(Integer.toHexString(byteToUInt(b[i])).toUpperCase(),2));\r\n\t\t\t\tbuf.append(\" \");\r\n\t\t}\r\n\t\tbuf.delete(buf.length()-1,buf.length());\r\n\t\treturn buf.toString();\r\n\t}",
"public static String toString(final byte[] input, final String encoding) throws IOException {\n return new String(input, Charset.forName(encoding));\n }",
"@NotNull\n public static String convertBytesToHex(@NotNull byte[] value) {\n checkNotNull(value);\n int len = value.length;\n char[] buff = new char[len + len];\n char[] hex = HEX;\n for (int i = 0; i < len; i++) {\n int c = value[i] & 0xff;\n buff[i + i] = hex[c >> 4];\n buff[i + i + 1] = hex[c & 0xf];\n }\n return new String(buff);\n }",
"static public String encode(byte[] binaryData) {\n if (binaryData == null)\n return null;\n int lengthData = binaryData.length;\n int lengthEncode = lengthData * 2;\n char[] encodedData = new char[lengthEncode];\n int temp;\n for (int i = 0; i < lengthData; i++) {\n temp = binaryData[i];\n if (temp < 0)\n temp += 256;\n encodedData[i*2] = lookUpHexAlphabet[temp >> 4];\n encodedData[i*2+1] = lookUpHexAlphabet[temp & 0xf];\n }\n return new String(encodedData);\n }",
"public static final String toHexString(byte[] b) {\n return toHexString(b, 0, b.length);\n }",
"public static String bytesToHexString(byte[] b) {\n\t\treturn bytesToHexString(b,b.length);\n\t}",
"@Test\n public void stringFromBytesArray() {\n byte[] input = new byte[]{\n 12,\n -68,\n 102,\n 17,\n -11,\n 84,\n 11,\n -48,\n -128,\n -102,\n 56,\n -115,\n -55,\n 90,\n 97,\n 91\n };\n\n assertEquals(\n \"0cbc6611f5540bd0809a388dc95a615b\",\n JdkHashTools.getStringFromByteArray(input)\n );\n }",
"public static String decodeToString(byte[] bytes){\n\t\treturn new String(decode(bytes));\n\t}",
"public static String bytesToHex(byte[] array) {\n StringBuffer hexString = new StringBuffer();\n for (int i = 0; i < array.length; i++) {\n String hex = Integer.toHexString(0xff & array[i]);\n if(hex.length() == 1) hexString.append('0');\n hexString.append(hex);\n }\n return hexString.toString();\n }",
"public static String bcdToString(byte[] data) {\n return bcdToString(data, 0, data.length);\n }",
"static StringBuilder convert_to_binary(String msg) {\n byte[] bytes = msg.getBytes();\r\n StringBuilder binary = new StringBuilder();\r\n for (byte b : bytes) {\r\n int val = b;\r\n for (int i = 0; i < 8; i++) {\r\n binary.append((val & 128) == 0 ? 0 : 1);\r\n val <<= 1;\r\n }\r\n binary.append(\"\");\r\n }\r\n return binary;\r\n }",
"public static String byteArrayToHex(final byte[] arr) {\n final StringBuilder sb = new StringBuilder();\n if (arr != null) {\n for (final byte b : arr) {\n sb.append(byteToHex(b));\n sb.append(\" \");\n }\n }\n return sb.toString().replaceAll(\" $\", \"\");\n }",
"public static String byteArrayToDataString(byte[] inBytes)\n\t{\n\t\tStringBuffer playerDataString = new StringBuffer();\n\t\t\n\t\tfor (int byteIndex = 0; byteIndex < inBytes.length; byteIndex++)\n\t\t{\n\t\t\tplayerDataString.append(\" \");\n\n\t\t\tif (inBytes[byteIndex] >= 0)\n\t\t\t{\n\t\t\t\tplayerDataString.append(Integer.toHexString(inBytes[byteIndex]).toUpperCase());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tplayerDataString.append(Integer.toHexString(inBytes[byteIndex]).toUpperCase().substring(6));\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn playerDataString.toString();\n\t}",
"private static String byteArrayToHexString(byte[] byteArray) {\n\t\t\n\t\t//Initialize the string buffer\n\t\tStringBuffer stringBuffer = new StringBuffer(byteArray.length * 2);\n\t\t\n\t\t//Start constructing the byte array\n\t\tstringBuffer.append(\"[ \");\n\t\t\n\t\t//For all the bytes in the array\n\t\tfor (int i = 0; i < byteArray.length; i++) {\n\t\t\t\n\t\t\t//Convert the byte to an integer\n\t\t\tint v = byteArray[i] & 0xff;\n\t\t\t\n\t\t\t//Left shift\n\t\t\tif (v < 16) {\n\t\t\t\tstringBuffer.append('0');\n\t\t\t}\n\t\t\t\n\t\t\t//Add the hex string representation of the byte \n\t\t\tstringBuffer.append(\"0x\" + Integer.toHexString(v).toUpperCase() + \" \");\n\t\t}\n\t\t\n\t\t//Close the byte array string\n\t\tstringBuffer.append(\"]\");\n\t\t\n\t\t//Convert the string buffer to a string a return it\n\t\treturn stringBuffer.toString();\n\t}",
"public static String bytetohex(byte[] bytearray) {\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor (byte b : bytearray) {\n\t\t\tString x = Integer.toHexString((int) (b & 0xFF));\n\t\t\tif (x.length() == 1) {\n\t\t\t\tsb.append(String.valueOf(0));\n\t\t\t}\n\t\t\tsb.append(x);\n\t\t}\n\t\tif (sb.length() % 2 != 0) {\n\t\t\tsb.insert(0, 0);\n\t\t}\n\t\treturn sb.toString();\n\t}",
"public String bytesToString(byte[] input) {\r\n StringBuilder buildString = new StringBuilder();\r\n for (int i = 0; i < input.length * 4; i++) {\r\n // Begin at the start of byte minus 2, then subtract\r\n // the number of bits into the byte we are\r\n int bytePos = 6 - (i % 4) * 2;\r\n // Only need 2 bits, so and with 3\r\n int currChar = 0x3 & input[i / 4] >> bytePos;\r\n\r\n if (currChar == 0) {\r\n buildString.append('A');\r\n }\r\n else if (currChar == 1) {\r\n buildString.append('C');\r\n }\r\n else if (currChar == 2) {\r\n buildString.append('G');\r\n }\r\n else if (currChar == 3) {\r\n buildString.append('T');\r\n }\r\n }\r\n\r\n String seqString = buildString.toString();\r\n return seqString;\r\n }",
"public static String byteArrayToHexString(byte[] b) {\n if (b == null)\n return null;\n\n StringBuffer sb = new StringBuffer(b.length * 2);\n for (int i = 0; i < b.length; i++) {\n int v = b[i] & 0xff;\n if (v < 16) {\n sb.append('0');\n }\n sb.append(Integer.toHexString(v));\n }\n return sb.toString().toUpperCase();\n }",
"public static String byteArrayToHexString(byte[] value) {\r\n String ret = \"\";\r\n\r\n for (int i = value.length - 1; i >= 0; i--) {\r\n ret = ret.concat(Integer.toHexString((value[i] & 0xFF) | 0x100).substring(1, 3));\r\n }\r\n\r\n return ret;\r\n }",
"private String m34494b(byte[] bArr) {\n return String.format(\"%032x\", new Object[]{new BigInteger(1, bArr)});\n }",
"@Benchmark\n public String bytesToStringOkio() {\n return BenchmarkUtils.decodeUtf8(decodeArray);\n }",
"public static String bytes2HexString(byte[] b)\n\t{\n\t byte[] buff = new byte[2 * b.length];\n\t for (int i = 0; i < b.length; i++)\n\t {\n\t\tbuff[2 * i] = hex[(b[i] >> 4) & 0x0f];\n\t\tbuff[2 * i + 1] = hex[b[i] & 0x0f];\n\t }\n\t return new String(buff);\n\t}",
"private static String m5291a(byte[] bArr) {\n StringBuffer stringBuffer = new StringBuffer();\n for (byte b : bArr) {\n String hexString = Integer.toHexString(b & 255);\n if (hexString.length() == 1) {\n stringBuffer.append('0');\n }\n stringBuffer.append(hexString);\n }\n return stringBuffer.toString();\n }",
"public static String byteArrayToHexString(byte[] b) {\n StringBuffer buf = new StringBuffer();\n for (int i = 0; i < b.length; i++) {\n buf.append(byteToHexString(b[i]));\n }\n return buf.toString();\n }",
"public static String toBase64String(final byte[] bytes) {\n Objects.requireNonNull(bytes);\n return (DatatypeConverter.printBase64Binary(bytes));\n }",
"private String ByteArrayToHexString(byte [] inarray) {\n int i, j, in;\n String [] hex = {\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\"};\n String out= \"\";\n\n for(j = 0 ; j < inarray.length ; ++j)\n {\n in = (int) inarray[j] & 0xff;\n i = (in >> 4) & 0x0f;\n out += hex[i];\n i = in & 0x0f;\n out += hex[i];\n }\n return out;\n }",
"public String byteToChar(byte b[], String encoding);",
"public static String toHexString(byte[] b)\r\n {\r\n if (b == null)\r\n return null;\r\n \r\n StringBuffer buf = new StringBuffer(b.length * 2);\r\n for (int n = 0; n < b.length; n++)\r\n {\r\n buf.append(m_hex[(b[n] & 0xf0) >>> 4]);\r\n buf.append(m_hex[b[n] & 0x0f]);\r\n }\r\n return buf.toString();\r\n }",
"public static String hexToString(byte[] bytes) {\n StringBuffer buff = new StringBuffer();\n for (int i=0; i<bytes.length; i++) {\n int val = bytes[i];\n val = val & 0xff; // remove higher bits, sign\n if (val<16) buff.append('0'); // leading 0\n buff.append(Integer.toString(val, 16));\n }\n return buff.toString();\n }",
"public static final String bytesToHexStr(byte[] bcd) {\n\t\tStringBuffer s = new StringBuffer(bcd.length * 2);\n\n\t\tfor (int i = 0; i < bcd.length; i++) {\n\t\t\ts.append(bcdLookup[(bcd[i] >>> 4) & 0x0f]);\n\t\t\ts.append(bcdLookup[bcd[i] & 0x0f]);\n\t\t}\n\n\t\treturn s.toString();\n\t}",
"private static String byteArrayToHexString(byte[] b) {\n StringBuffer sb = new StringBuffer(b.length * 2);\n for (byte element : b) {\n int v = element & 0xff;\n if(v < 16) {\n sb.append('0');\n }\n sb.append(Integer.toHexString(v));\n }\n return sb.toString().toUpperCase();\n }",
"public static String bytesToHex(byte[] bytes){\n if(bytes == null)\n throw new NullPointerException();\n String result = \"\";\n for(byte b: bytes){\n String tmp = Integer.toHexString(b & 0xFF);\n if(tmp.length() == 1)\n result += \"0\";\n result += tmp;\n }\n return result;\n }",
"public static String toHexString(byte[] b) {\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\tfor (int i = 0; i < b.length; i++) {\r\n\t\t\tsb.append(hexCharsLowerCase[ (int)(((int)b[i] >> 4) & 0x0f)]);\r\n\t\t\tsb.append(hexCharsLowerCase[ (int)(((int)b[i]) & 0x0f)]);\r\n\t\t}\r\n\t return sb.toString(); \r\n\t}",
"public static String bytetohex(byte[] bytearray) {\n\t\tStringBuilder build = new StringBuilder();\n\t\tfor (var bte : bytearray) {\n\t\t\tbuild.append(nibbleToChar((byte) ((bte & 240) >>> 4)));\n\t\t\tbuild.append(nibbleToChar((byte) (bte & 15)));\n\t\t}\n\t\treturn build.toString();\n\t}",
"public static String\n bcdToString(byte[] data, int offset, int length) {\n StringBuilder ret = new StringBuilder(length*2);\n\n for (int i = offset ; i < offset + length ; i++) {\n int v;\n\n v = data[i] & 0xf;\n if (v > 9) break;\n ret.append((char)('0' + v));\n\n v = (data[i] >> 4) & 0xf;\n // Some PLMNs have 'f' as high nibble, ignore it\n if (v == 0xf) continue;\n if (v > 9) break;\n ret.append((char)('0' + v));\n }\n\n return ret.toString();\n }",
"String bsToStr(BitSet bs){\n String s = \"\";\n for(int i=0; i<bitsetLen; i++){\n if(bs.get(i) == true)\n s += '1';\n else\n s += '0';\n }\n \n return new StringBuilder(s).reverse().toString();\n }",
"public static String hashToString(byte[] hashBytes) {\n String returnVal = \"\";\n for (int i = 0; i < hashBytes.length; i++) {\n returnVal += Integer.toString((hashBytes[i] & 0xff) + 0x100, 16).substring(1);\n }\n return returnVal.toLowerCase();\n }",
"public /*byte[]*/String BinaryCaster(Object item){\n String Sitem = Integer.toBinaryString((int)item);\n //byte[] b = new byte[Sitem.length()];\n //for(int i=0;i<Sitem.length();i++){\n // b[i] = (byte)Sitem.charAt(i);\n //}\n //return b;\n return Sitem;\n }",
"private String byteToBase64(final byte[] bytes) {\n String str = DatatypeConverter.printBase64Binary(bytes);\n return str;\n }",
"public static String encryptSHA1ToString(final byte[] data) {\n return bytes2HexString(encryptSHA1(data));\n }",
"public static String toBase64( byte[] b ) {\n StringBuffer sb = new StringBuffer();\n for ( int ptr = 0; ptr < b.length; ptr += 3 ) {\n sb.append( base64[ ( b[ ptr ] >> 2 ) & 0x3F ] );\n if ( ptr + 1 < b.length ) {\n sb.append( base64[ ( ( b[ ptr ] << 4 ) & 0x30 ) | ( ( b[ ptr + 1 ] >> 4 ) & 0x0F ) ] );\n if ( ptr + 2 < b.length ) {\n sb.append( base64[ ( ( b[ ptr + 1 ] << 2 ) & 0x3C ) | ( ( b[ ptr + 2 ] >> 6 ) & 0x03 ) ] );\n sb.append( base64[ b[ ptr + 2 ] & 0x3F ] );\n } else {\n sb.append( base64[ ( b[ ptr + 1 ] << 2 ) & 0x3C ] );\n sb.append( pad );\n }\n } else {\n sb.append( base64[ ( ( b[ ptr ] << 4 ) & 0x30 ) ] );\n sb.append( pad );\n sb.append( pad );\n }\n }\n return sb.toString();\n }",
"public static String toHexString(byte[] byteArray) {\n final StringBuilder hexString = new StringBuilder(\"\");\n if (byteArray == null || byteArray.length <= 0)\n return null;\n for (int i = 0; i < byteArray.length; i++) {\n int v = byteArray[i] & 0xFF;\n String hv = Integer.toHexString(v);\n if (hv.length() < 2) {\n hexString.append(0);\n }\n hexString.append(hv);\n }\n return hexString.toString().toLowerCase();\n }",
"public static String encode(byte[] data) {\n\t\treturn Base64.getEncoder().encodeToString(data);\n\t}",
"private String toHexString(byte[] bytes) {\n StringBuilder hexString = new StringBuilder();\n for (int i = 0; i < bytes.length; i++) {\n String hex = Integer.toHexString(0xFF & bytes[i]);\n if (hex.length() == 1) {\n hexString.append('0');\n }\n hexString.append(hex);\n }\n\n return hexString.toString().toUpperCase();\n }",
"public static String toBase64(byte[] data)\n {\n return Base64.encodeToString(data, Base64.NO_WRAP);\n }",
"public static String byteArrayToHex(byte[] a) {\n StringBuilder sb = new StringBuilder(a.length * 2);\n for(byte b: a)\n sb.append(String.format(\"%02x\", b & 0xff));\n return sb.toString();\n }",
"public static String toHexString(byte b[]) {\n int pos = 0;\n char[] c = new char[b.length * 2];\n for (int i = 0; i < b.length; i++) {\n c[pos++] = toHex[(b[i] >> 4) & 0x0F];\n c[pos++] = toHex[b[i] & 0x0f];\n }\n return new String(c);\n }",
"public static String encode(byte[] input)\r\n {\r\n return (input == null ? null : Base64.encode(input, 0, input.length));\r\n }",
"public static String byteArrayToHexString(byte[] bytes) {\n // Solution copied from https://stackoverflow.com/questions/9655181\n char[] hexChars = new char[bytes.length * 2];\n for (int j = 0; j < bytes.length; j++) {\n int v = bytes[j] & 0xFF;\n hexChars[j * 2] = Normal.DIGITS_16_UPPER[v >>> 4];\n hexChars[j * 2 + 1] = Normal.DIGITS_16_UPPER[v & 0x0F];\n }\n return new String(hexChars);\n }",
"public static String writeBytes(byte[] bytes) {\n\n StringBuffer stringBuffer = new StringBuffer();\n\n for (int i = 0; i < bytes.length; i++) {\n\n // New line every 4 bytes\n if (i % 4 == 0) {\n\n stringBuffer.append(\"\\n\");\n }\n\n stringBuffer.append(writeBits(bytes[i]) + \" \");\n }\n\n return stringBuffer.toString();\n\n }",
"private String toBinary(byte caracter){\n byte byteDeCaracter = (byte)caracter;\n String binario=\"\";\n for( int i = 7; i>=0; i--){\n binario += ( ( ( byteDeCaracter & ( 1<<i ) ) > 0 ) ? \"1\" : \"0\" ) ;\n }\n return binario;\n }",
"public static String ByteArrayToHexString(byte[] bytes) {\n final char[] hexArray = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};\n char[] hexChars = new char[bytes.length * 2];\n int v;\n for ( int j = 0; j < bytes.length; j++ ) {\n v = bytes[j] & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n return new String(hexChars);\n }",
"public static String byteArrayToHexString(byte[] a) \r\n{\r\n\tStringBuilder sb = new StringBuilder(a.length * 2);\r\n\tfor(byte b: a)\r\n\tsb.append(String.format(\"%02x\", b));\r\n\treturn sb.toString();\r\n}",
"public static final String bytesToHexString(byte[] bArray, int begin, int end) {\n StringBuffer sb = new StringBuffer(bArray.length);\n String sTemp;\n for (int i = begin; i < end; i++) {\n sTemp = Integer.toHexString(0xFF & bArray[i]);\n if (sTemp.length() < 2)\n sb.append(0);\n sb.append(sTemp.toUpperCase());\n sb.append(\" \");\n }\n return sb.toString();\n }",
"public static String byteArrayToHexString(byte[] in) {\n\t\tint ch = 0x00;\n\t\tString pseudo[] = {\"0\", \"1\", \"2\",\n\t\t\t\t\"3\", \"4\", \"5\", \"6\", \"7\", \"8\",\n\t\t\t\t\"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\"};\n\n\t\tStringBuffer out = new StringBuffer(in.length*2);\n\t\tfor (int i = 0; i < in.length; i++) {\n\t\t\tch = ((in[i] & 0xF0) >> 4);\n\t\t\tch = (ch & 0x0F);\n\t\t\tout.append(pseudo[ch]);\n\t\t\tch = (in[i] & 0x0F);\n\t\t\tout.append(pseudo[ch]);\n\t\t}\n\t\treturn new String(out);\n\t}",
"public String toString() {\n if (this.data.isEmpty()) {\n return super.toString();\n }\n return BytesUtil.bytes2HexString(toBinary());\n }",
"public com.google.protobuf.ByteString\n getToBytes() {\n Object ref = to_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n to_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public static String toFormattedBinaryString(BigInteger data, int numBits) {\n //BigInteger.toString(radix) does not pad to full word sizes.\n String tmpStr = UnsignedBigIntUtils.toPaddedBinaryString(data, numBits);\n tmpStr = RegExp.replaceFirst(\"0b\", tmpStr, \"\");\n\n StringBuilder formattedBinaryString = new StringBuilder();\n\n if (RegExp.isMatch(\"^0b\", tmpStr) == false) {\n formattedBinaryString.append(\"0b\");\n }\n\n // If you modify anything in this loop, then you must modify tests.\n for (int ii = 0; ii < tmpStr.length(); ii++) {\n if (ii % 16 == 0 && ii != 0) {\n formattedBinaryString.append(\" | \");\n } else if (ii % 4 == 0 && ii != 0) {\n formattedBinaryString.append(\" \");\n }\n formattedBinaryString.append(tmpStr.charAt(ii));\n }\n\n tmpStr = formattedBinaryString.toString();\n\n return (tmpStr);\n }",
"static public String byteArrayToHexString(byte[] bytes) {\n\t\tStringBuilder sb = new StringBuilder(bytes.length * 2);\n\t\tfor (byte element : bytes) {\n\t\t\tint v = element & 0xff;\n\t\t\tif (v < 16) {\n\t\t\t\tsb.append('0');\n\t\t\t}\n\t\t\tsb.append(Integer.toHexString(v));\n\t\t}\n\t\treturn sb.toString().toUpperCase(Locale.US);\n\t}",
"private static String toHex(byte[] array)\n\t {\n\t BigInteger bi = new BigInteger(1, array);\n\t String hex = bi.toString(16);\n\t int paddingLength = (array.length * 2) - hex.length();\n\t if(paddingLength > 0)\n\t return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n\t else\n\t return hex;\n\t }",
"public static String byteToBase64(byte[] data){\n BASE64Encoder endecoder = new BASE64Encoder();\n return endecoder.encode(data);\n }",
"public static String toHex(byte[] b) {\r\n\tStringBuffer buf;\r\n\tint i;\r\n\r\n\tbuf = new StringBuffer(b.length * 2);\r\n\r\n\tfor (i = 0; i < b.length; i++) {\r\n\t buf.append(HEX.charAt((b[i] >> 4) & 15));\r\n\t buf.append(HEX.charAt(b[i] & 15));\r\n\t}\r\n\treturn buf.toString();\r\n }",
"private static String toHex(final byte[] array) {\n final BigInteger bi = new BigInteger(1, array);\n final String hex = bi.toString(16);\n final int paddingLength = (array.length * 2) - hex.length();\n if (paddingLength > 0) {\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n } else {\n return hex;\n }\n }",
"public static String intToBinaryString(int value) {\r\n String bin = \"00000000000000000000000000000000\" + Integer.toBinaryString(value);\r\n\r\n return bin.substring(bin.length() - 32, bin.length() - 24)\r\n + \" \"\r\n + bin.substring(bin.length() - 24, bin.length() - 16)\r\n + \" \"\r\n + bin.substring(bin.length() - 16, bin.length() - 8)\r\n + \" \"\r\n + bin.substring(bin.length() - 8, bin.length());\r\n }",
"public static String toPaddedBinaryString(BigInteger data, int numBits) {\n String binStr = UnsignedBigIntUtils.toBinaryString(data);\n binStr = RegExp.replaceFirst(\"0b\", binStr, \"\");\n StringBuilder sb = new StringBuilder();\n\n if (RegExp.isMatch(\"^0b\", binStr) == false) {\n sb.append(\"0b\");\n }\n\n if (numBits > binStr.length()) {\n for (int ii = numBits - binStr.length(); ii > 0; ii--) {\n sb.append('0');\n }\n }\n sb.append(binStr);\n return (sb.toString());\n }",
"private static String bytesToHex(byte[] bytes) {\n char[] hexChars = new char[bytes.length * 2];\n for (int j = 0; j < bytes.length; j++) {\n int v = bytes[j] & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n return new String(hexChars);\n }",
"public String toString() {\n return Util.bytesToHex(getByteArray());\n }",
"public static String toHex(byte[] array) {\n BigInteger bi = new BigInteger(1, array);\n String hex = bi.toString(16);\n int paddingLength = (array.length * 2) - hex.length();\n if (paddingLength > 0)\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n else\n return hex;\n }"
] | [
"0.76470655",
"0.7551382",
"0.7334118",
"0.7196851",
"0.7188815",
"0.71874136",
"0.7179622",
"0.7129762",
"0.7046813",
"0.70369375",
"0.6984137",
"0.6950197",
"0.6766348",
"0.6751871",
"0.6746382",
"0.67447",
"0.6720338",
"0.6676033",
"0.6589845",
"0.65529394",
"0.65422904",
"0.65316594",
"0.65141696",
"0.6500406",
"0.6498573",
"0.64967227",
"0.64772",
"0.6472867",
"0.63847834",
"0.6381368",
"0.6367854",
"0.63639176",
"0.63372797",
"0.6307879",
"0.6283996",
"0.62757456",
"0.6266884",
"0.6256899",
"0.6249356",
"0.6230518",
"0.6192213",
"0.618206",
"0.6165272",
"0.61623657",
"0.6153877",
"0.6135352",
"0.61350095",
"0.61271334",
"0.6114455",
"0.6072822",
"0.60522497",
"0.6044093",
"0.6031473",
"0.60293317",
"0.6027148",
"0.59893304",
"0.59699583",
"0.5938467",
"0.58976954",
"0.58816415",
"0.5878845",
"0.58721673",
"0.5870784",
"0.5867231",
"0.58495665",
"0.5845321",
"0.58403146",
"0.58340555",
"0.5831815",
"0.5821231",
"0.5808342",
"0.58046037",
"0.5791048",
"0.57775056",
"0.5773249",
"0.5768132",
"0.5760043",
"0.5756912",
"0.5754922",
"0.5747839",
"0.5744305",
"0.5724256",
"0.5721719",
"0.57044077",
"0.56978273",
"0.5689701",
"0.56881994",
"0.5671634",
"0.5664294",
"0.5663336",
"0.566325",
"0.56625795",
"0.56490034",
"0.5647205",
"0.56364715",
"0.56286156",
"0.5627011",
"0.56233096",
"0.56230134",
"0.5618302"
] | 0.8200195 | 0 |
INTEGER & LONG TO ASN1 BYTE ARRAY Converts a value which is given as an Integer into a byte array according to the ASN1 DER standard. | public static byte[] integerToByteArray_ASN1_Value(int toBeConverted) {
//create the temporary version of what will be returned
byte[] tempToBeReturned = {
(byte)(toBeConverted >> 24),
(byte)(toBeConverted >> 16),
(byte)(toBeConverted >> 8),
(byte)toBeConverted};
//converting positive integers
if(toBeConverted >= 0) {
//0 to 127: return only one octet
if(toBeConverted<=127) {
byte[] toBeReturned = new byte[1];
toBeReturned[0] = tempToBeReturned[3];
return toBeReturned;
}
//128 to 32768-1 return two octets
else if(toBeConverted<=32767) {
byte[] toBeReturned = new byte[2];
toBeReturned[0] = tempToBeReturned[2];
toBeReturned[1] = tempToBeReturned[3];
return toBeReturned;
}
//32767 to 8388607 return three octets
else if(toBeConverted<=8388607) {
byte[] toBeReturned = new byte[3];
toBeReturned[0] = tempToBeReturned[1];
toBeReturned[1] = tempToBeReturned[2];
toBeReturned[2] = tempToBeReturned[3];
return toBeReturned;
}
//above that: return four octets
else {
return tempToBeReturned;
}
}
//converting negative integers
else if(toBeConverted<0) {
//-1 to -128: return one octet
if(toBeConverted>=-128) {
byte[] toBeReturned = new byte[1];
toBeReturned[0] = tempToBeReturned[3];
return toBeReturned;
}
//-129 to -32768 return two octets
else if(toBeConverted>=-32768) {
byte[] toBeReturned = new byte[2];
toBeReturned[0] = tempToBeReturned[2];
toBeReturned[1] = tempToBeReturned[3];
return toBeReturned;
}
//-32769 to -8388608 return three octets
else if(toBeConverted>=-8388608) {
byte[] toBeReturned = new byte[3];
toBeReturned[0] = tempToBeReturned[1];
toBeReturned[1] = tempToBeReturned[2];
toBeReturned[2] = tempToBeReturned[3];
return toBeReturned;
}
//above that: return four octets
else {
return tempToBeReturned;
}
}
//if method fails for any reason, it returns null
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static byte[] intToBytes(Integer integer) {\n\t\treturn BigInteger.valueOf(integer).toByteArray();\n\t}",
"static byte[] toArray(int value) {\n return new byte[] {\n (byte) (value >> 24),\n (byte) (value >> 16),\n (byte) (value >> 8),\n (byte) value };\n }",
"public static byte[] intToBytes(int i) {\n\n ByteBuffer byteBuffer = ByteBuffer.allocate(NUM_BYTES_IN_INT);\n byteBuffer.putInt(i);\n return byteBuffer.array();\n\n }",
"public static byte[] longToByteArray_ASN1_Value(long toBeConverted) {\n\t\t\t\n\t\t\t//create the temporary version of what will be returned\n\t\t\tbyte[] tempToBeReturned = {\n\t\t\t\t\t(byte)(toBeConverted >> 56),\n\t\t\t\t\t(byte)(toBeConverted >> 48),\n\t\t\t\t\t(byte)(toBeConverted >> 40),\n\t\t\t\t\t(byte)(toBeConverted >> 32),\n\t\t\t\t\t(byte)(toBeConverted >> 24),\n\t\t\t\t\t(byte)(toBeConverted >> 16),\n\t\t\t\t\t(byte)(toBeConverted >> 8),\n\t\t\t\t\t(byte)toBeConverted};\n\t\t\t\n\t\t\t\n\t\t\t//converting positive long values\n\t\t\tif(toBeConverted >= 0) {\n\t\t\t\t//0 to 127: return only one octet\n\t\t\t\tif(toBeConverted<=127) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[1];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[7];\t\t\t\t\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//128 to 32768-1 return two octets\n\t\t\t\telse if(toBeConverted<=32767) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[2];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[6];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//32767 to 8388607 return three octets\n\t\t\t\telse if(toBeConverted<=8388607) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[3];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[5];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//8388608 to 2147483647 return four octets\n\t\t\t\telse if(toBeConverted<=2147483647) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[4];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[4];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//the value 0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y\n\t\t\t\t//2147483648 to 549755813887 return five octets\n\t\t\t\telse if((Long.compare(toBeConverted, 549755813888L))<0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[5];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[3];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//549755813888 to 140737488355327 return six octets\n\t\t\t\telse if((Long.compare(toBeConverted, 140737488355328L))<0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[6];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[2];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[3];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[5] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//140737488355328 to 36028797018963967 return seven octets\n\t\t\t\telse if((Long.compare(toBeConverted, 36028797018963967L))<0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[7];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[1];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[2];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[3];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[5] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[6] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//above: return eight octets\n\t\t\t\telse {\n\t\t\t\t\treturn tempToBeReturned;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//converting negative long values\n\t\t\telse if(toBeConverted<0) {\n\t\t\t\t//-1 to -128 1 octet \n\t\t\t\tif(toBeConverted>=-128) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[1];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[7];\t\t\t\t\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-129 to -32768 2 octets\n\t\t\t\telse if(toBeConverted>=-32768) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[2];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[6];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-32769 to -8388608 3 octets\n\t\t\t\telse if(toBeConverted>=-8388608) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[3];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[5];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//-8388609 to -2147483648 4 octets\n\t\t\t\telse if(toBeConverted>=-2147483648) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[4];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[4];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//the value 0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y\n\t\t\t\t//-2147483649 to -549755813888 5 octets \n\t\t\t\telse if((Long.compare(toBeConverted, -549755813889L))>0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[5];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[3];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-549755813889 to -140737488355328 6 octets\n\t\t\t\telse if((Long.compare(toBeConverted, -140737488355329L))>0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[6];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[2];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[3];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[5] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-140737488355329 to 36028797018963968 7 octets\n\t\t\t\telse if((Long.compare(toBeConverted, -36028797018963969L))>0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[7];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[1];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[2];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[3];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[5] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[6] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//below that: 8 octets\n\t\t\t\telse {\n\t\t\t\t\treturn tempToBeReturned;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//if method fails for any reason, it returns null\n\t\t\treturn null;\n\t\t}",
"public byte[] getByteArray() {\n long val = getValue();\n return new byte[] {\n (byte)((val>>24) & 0xff),\n (byte)((val>>16) & 0xff),\n (byte)((val>>8) & 0xff),\n (byte)(val & 0xff) };\n }",
"public byte[] l2b(long value) {\n byte[] data = new byte[8];\n data[0] = (byte) ((value >> 56) & 0xFF);\n data[1] = (byte) ((value >> 48) & 0xFF);\n data[2] = (byte) ((value >> 40) & 0xFF);\n data[3] = (byte) ((value >> 32) & 0xFF);\n data[4] = (byte) ((value >> 24) & 0xFF);\n data[5] = (byte) ((value >> 16) & 0xFF);\n data[6] = (byte) ((value >> 8) & 0xFF);\n data[7] = (byte) (value & 0xFF);\n return data;\n }",
"private byte[] intToByteArray(int i) {\n ByteBuffer bbf = ByteBuffer.allocate(4)\n .order(ByteOrder.LITTLE_ENDIAN)\n .putInt(i);\n return bbf.array();\n }",
"public native byte[] __byteArrayMethod( long __swiftObject, byte[] arg );",
"public static byte[] getBytes(long value) {\r\n\t\treturn ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(value).array();\r\n\t}",
"public byte[] intToBytes(int x) {\n\t\tByteBuffer buffer = ByteBuffer.allocate(Integer.BYTES);\n\t\tbuffer.putInt(x);\n\t\treturn buffer.array();\n\t}",
"public static byte[] intToBytes(int value) {\n ByteBuffer bb = ByteBuffer.allocate(4);\n bb.putInt(value);\n return bb.array();\n }",
"public byte[] getEncoded() {\n return toByteArray(Integer.valueOf(this.intValue));\n }",
"public static byte[] b(int... array) {\n if (array == null) {\n return null;\n }\n byte[] ret = new byte[array.length];\n for (int i = 0; i < ret.length; i++) {\n ret[i] = (byte) array[i];\n }\n return ret;\n }",
"private byte[] intToBytes(int i) {\n\t\tb.clear();\n\t\treturn b.order(ByteOrder.LITTLE_ENDIAN).putInt(i).array();\n\t}",
"public static byte[] intToBinary(int value)\n {\n String tmp = Integer.toBinaryString(value);\n int len = tmp.length();\n int change = 8 - (len % 8);\n\n if(change != 0) len += change;\n\n byte[] res = new byte[len];\n for(int i = 0; i < len; i++) {\n if(i < change){\n // Tag on leading zeroes if needed\n res[i] = 0x00;\n }else{\n char c = tmp.charAt(i - change);\n res[i] = (byte) (c == '0' ? 0x00 : 0x01);\n }\n }\n\n return res;\n }",
"public static byte[] toBytes(long val) {\n byte [] b = new byte[8];\n for (int i = 7; i > 0; i--) {\n b[i] = (byte) val;\n val >>>= 8;\n }\n b[0] = (byte) val;\n return b;\n }",
"public static byte[] longToBytes(long x) {\n\t ByteBuffer buffer = ByteBuffer.allocate(Long.BYTES);\n\t buffer.putLong(x);\n\t return buffer.array();\n\t}",
"private static byte[] toByteArray(int[] array) {\n final byte[] res = new byte[array.length];\n for (int i = 0; i < array.length; ++i) {\n final int value = array[i];\n res[i] = (byte) value;\n }\n return res;\n }",
"static byte[] toBEBytes(int i) {\n\t\treturn ByteBuffer.allocate(4).order(ByteOrder.BIG_ENDIAN).putInt(i).array();\n\t}",
"public byte[] marshall();",
"public static byte[] toBytes(final long number) {\n\t\treturn new byte[] {\n\t\t\t(byte) (number >>> 56),\n\t\t\t(byte) (number >>> 48),\n\t\t\t(byte) (number >>> 40),\n\t\t\t(byte) (number >>> 32),\n\t\t\t(byte) (number >>> 24),\n\t\t\t(byte) (number >>> 16),\n\t\t\t(byte) (number >>> 8),\n\t\t\t(byte) (number)\n\t\t};\n\t}",
"byte[] IntToByte(int i)\r\n {\r\n return Integer.toString(i).getBytes();\r\n }",
"static byte[] long2byteArray(long number, int length, boolean swapHalfWord) {\n }",
"public static byte[] getBytes(int value) {\r\n\t\treturn ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putInt(value).array();\r\n\t}",
"public static byte[] longToBytes(long l) {\n\n ByteBuffer byteBuffer = ByteBuffer.allocate(NUM_BYTES_IN_LONG);\n byteBuffer.putLong(l);\n return byteBuffer.array();\n\n }",
"public static byte[] toByteArray(int value) {\n INT_BUFFER.clear();\n return INT_BUFFER.order(ByteOrder.LITTLE_ENDIAN).putInt(value).array();\n }",
"public byte[] int2byteArray(int[] ints){\n ByteBuffer buf = ByteBuffer.allocate(ints.length * Integer.BYTES);\n for (int i = 0; i < ints.length; i++) {\n buf.putInt(ints[i]);\n }\n\n return buf.array();\n }",
"private static final byte[] longToByteArray(long l) {\n\t\tbyte[] retVal = new byte[8];\n\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tretVal[i] = (byte) l;\n\t\t\tl >>= 8;\n\t\t}\n\n\t\treturn retVal;\n\t}",
"public static byte[] toLEBytes(int i) {\n\t\treturn ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putInt(i).array();\n\t}",
"public byte[] i2b(int value) {\n byte[] data = new byte[4];\n data[0] = (byte) ((value >> 24) & 0xFF);\n data[1] = (byte) ((value >> 16) & 0xFF);\n data[2] = (byte) ((value >> 8) & 0xFF);\n data[3] = (byte) (value & 0xFF);\n return data;\n }",
"public static byte[] getEncodeIntervalNumberByteArray(long intervalNumber) {\n return intToByteLittleEndian((int)getUint32(intervalNumber));\n }",
"public static byte[] convertInt8(int v)\r\n {\r\n byte[] bytes = new byte[1];\r\n bytes[0] = (byte) v;\r\n return bytes;\r\n }",
"public static byte[] getLongAsBytes(long l) {\n\t\treturn new byte[] {\n\t\t\t\t(byte) (l >> 56),\n\t\t\t\t(byte) (l >> 48),\n\t\t\t\t(byte) (l >> 40),\n\t\t\t\t(byte) (l >> 32),\n\t\t\t\t(byte) (l >> 24),\n\t\t\t\t(byte) (l >> 16),\n\t\t\t\t(byte) (l >> 8),\n\t\t\t\t(byte) l\n\t\t\t};\n\t}",
"public Asn1Object( int tag, int length, byte[] value ) {\n this.tag = tag;\n this.type = tag & 0x1F;\n this.length = length;\n this.value = value;\n }",
"static private byte[] toBytes(\n ASN1OctetString[] octs)\n {\n ByteArrayOutputStream bOut = new ByteArrayOutputStream();\n\n for (int i = 0; i != octs.length; i++)\n {\n try\n {\n bOut.write(octs[i].getOctets());\n }\n catch (IOException e)\n {\n throw new IllegalArgumentException(\"exception converting octets \" + e.toString());\n }\n }\n\n return bOut.toByteArray();\n }",
"private static byte[] getBytes(int val) {\n log.log(Level.FINEST, String.format(\"%d\", val));\n byte[] ret = new byte[NekoIOConstants.INT_LENGTH];\n for (int i = 0; i < NekoIOConstants.INT_LENGTH; i++) {\n if (NekoIOConstants.BIG_ENDIAN) {\n ret[NekoIOConstants.INT_LENGTH - 1 - i] = (byte) val;\n } else {\n ret[i] = (byte) val;\n }\n val >>= 8;\n }\n return ret;\n }",
"@ZenCodeType.Caster\n @ZenCodeType.Method\n default byte[] asByteArray() {\n //TODO this is actually sbyte[], but @Unsigned doesn't work on arrays right now\n return notSupportedCast(\"byte[]\");\n }",
"public static byte[] intToBytes(int in) {\n byte[] bytes = new byte[4];\n for (int i = 0; i < 4; i++) {\n bytes[i] = (byte) ((in >>> i * 8) & 0xFF);\n }\n return bytes;\n }",
"public native static long getConvertBytes();",
"Asn1Object(int tag, int length, byte[] value) {\n\t\t\tthis.tag = tag;\n\t\t\tthis.type = tag & 0x1F;\n\t\t\tthis.length = length;\n\t\t\tthis.value = value;\n\t\t}",
"public static byte[] intToByte(int i) {\n return new byte[] {(byte)(i>>24), (byte)(i>>16), (byte)(i>>8), (byte)i};\n }",
"public byte[] convertIntToByte(int[] intArr) throws IOException {\r\n byte[] byteArr = new byte[intArr.length];\r\n for(int i = 0; i < intArr.length; i++) {\r\n Integer tempInt = intArr[i];\r\n byte tempByte = tempInt.byteValue();\r\n byteArr[i] = tempByte;\r\n }\r\n return byteArr;\r\n }",
"public static byte[] intToBytesArray(int num) {\r\n\t\tbyte[] byteArr = new byte[4];\r\n\t\t// big endian, low to high\r\n\t\tfor (int i = 0; i < byteArr.length; i++) {\r\n\t\t\tbyteArr[byteArr.length - 1 - i] = (byte) (num & 0xff);\r\n\t\t\tnum >>= 8;\r\n\t\t}\r\n\t\treturn byteArr;\r\n\t}",
"public static byte[] longToByteArray(long value, int valueSize, int length) {\n long val = value;\n // Convert the long to 8-byte BE representation\n byte[] b = new byte[8];\n for (int i = 7; i >= 0 && val != 0L; i--) {\n b[i] = (byte) val;\n val >>>= 8;\n }\n // Then copy the rightmost valueSize bytes\n // e.g., for an integer we want rightmost 4 bytes\n return Arrays.copyOfRange(b, 8 - valueSize, 8 + length - valueSize);\n }",
"@Override\n public byte[] getBytes() {\n int len = 0;\n List<byte[]> chunks = new ArrayList<>();\n for (RvtAoiMetadataKey tag : getTags()) {\n chunks.add(new byte[] {(byte) tag.getIdentifier()});\n len += 1;\n IRvtPoiAoiMetadataValue value = getField(tag);\n byte[] bytes = value.getBytes();\n byte[] lengthBytes = BerEncoder.encode(bytes.length);\n chunks.add(lengthBytes);\n len += lengthBytes.length;\n chunks.add(bytes);\n len += bytes.length;\n }\n return ArrayUtils.arrayFromChunks(chunks, len);\n }",
"private static byte[] intArray2ByteArray (int[] src)\n\t{\n\t\tbyte[] dst = new byte [src.length];\n\t\tfor (int i = 0; i < src.length; ++ i)\n\t\t\tdst[i] = (byte) src[i];\n\t\treturn dst;\n\t}",
"private static final void encodeBEInt(int paramInt1, byte[] paramArrayOfByte, int paramInt2)\r\n/* 137: */ {\r\n/* 138:209 */ paramArrayOfByte[(paramInt2 + 0)] = ((byte)(paramInt1 >>> 24));\r\n/* 139:210 */ paramArrayOfByte[(paramInt2 + 1)] = ((byte)(paramInt1 >>> 16));\r\n/* 140:211 */ paramArrayOfByte[(paramInt2 + 2)] = ((byte)(paramInt1 >>> 8));\r\n/* 141:212 */ paramArrayOfByte[(paramInt2 + 3)] = ((byte)paramInt1);\r\n/* 142: */ }",
"public static byte[] toBigEndianByteArray(Number number) throws ScriptException\n {\n long n = number.longValue();\n for (int i = 1; i <= 8; i++)\n {\n long maxNum = 1L << (i * 8 - 1);\n if (n <= maxNum && n >= -maxNum)\n {\n byte[] res = new byte[i];\n boolean changeSign = false;\n if (n < 0)\n {\n changeSign = true;\n n = -n;\n }\n for (int j = 0; j < i; j++)\n {\n res[j] = (byte) ((n >> j * 8) & 0xFF);\n }\n // Bitcoin scripts use 1-complement for negative numbers\n if (changeSign)\n {\n res[i - 1] |= 0x80;\n }\n return res;\n }\n }\n throw new ScriptException(\"Number to large to convert to binary: \" + number);\n }",
"public abstract byte[] toByteArray();",
"public abstract byte[] toByteArray();",
"public static byte[] convertIntegersToBytes(int[] nums) {\n if (nums != null) {\n byte[] outputBytes = new byte[nums.length * 4];\n for(int i = 0, k = 0; i < nums.length; i++) {\n int integerTemp = nums[i];\n for(int j = 0; j < 4; j++, k++) {\n outputBytes[k] = (byte)((integerTemp >> (8 * j)) & 0xFF);\n }\n }\n return outputBytes;\n } else {\n return null;\n }\n }",
"byte[] toByteArray(ORecordVersion version);",
"public static byte[] toBytes(final long... numbers) {\n\t\tbyte[] bytes = new byte[numbers.length * 8];\n\t\tfor (int i = 0, j = 0; i < numbers.length; i++, j += 8) {\n\t\t\tSystem.arraycopy(toBytes(numbers[i]), 0, bytes, j, 8);\n\t\t}\n\t\treturn bytes;\n\t}",
"public /*byte[]*/String BinaryCaster(Object item){\n String Sitem = Integer.toBinaryString((int)item);\n //byte[] b = new byte[Sitem.length()];\n //for(int i=0;i<Sitem.length();i++){\n // b[i] = (byte)Sitem.charAt(i);\n //}\n //return b;\n return Sitem;\n }",
"public static byte[] initBytes(byte[] b, int value) {\n\t\tfor (int i=0; i<b.length; i++) b[i]=(byte)value;\n\t\treturn b;\n\t}",
"public byte[] toBytes () {\n return toTuple().toBytes();\n }",
"byte[] mo12209b(int i);",
"public static byte[] encode(ArrayList<Integer> nums)\n {\n //ArrayList<Byte> byteStream = new ArrayList<Byte>();\n int totalSize = 0;\n for(int i=0;i<nums.size();i++)\n {\n int n = nums.get(i);\n int sizeReq = 1;\n if(n < Math.pow(2, 7))\n sizeReq = 1;\n else if(n < Math.pow(2, 14))\n sizeReq = 2;\n else if(n < Math.pow(2, 21))\n sizeReq = 3;\n else if(n < Math.pow(2, 28))\n sizeReq = 4;\n totalSize += sizeReq;\n }\n byte totalArray[] = new byte[totalSize];\n int c = 0;\n for(int i=0;i<nums.size();i++)\n {\n byte array[] = encode(nums.get(i));\n //byteStream.addAll(array);\n for(int j=0;j<array.length;j++)\n totalArray[c++] = array[j];\n }\n return totalArray;\n }",
"private byte[] bit_conversion(int i) {\n // originally integers (ints) cast into bytes\n // byte byte7 = (byte)((i & 0xFF00000000000000L) >>> 56);\n // byte byte6 = (byte)((i & 0x00FF000000000000L) >>> 48);\n // byte byte5 = (byte)((i & 0x0000FF0000000000L) >>> 40);\n // byte byte4 = (byte)((i & 0x000000FF00000000L) >>> 32);\n\n // only using 4 bytes\n byte byte3 = (byte) ((i & 0xFF000000) >>> 24); // 0\n byte byte2 = (byte) ((i & 0x00FF0000) >>> 16); // 0\n byte byte1 = (byte) ((i & 0x0000FF00) >>> 8); // 0\n byte byte0 = (byte) ((i & 0x000000FF));\n // {0,0,0,byte0} is equivalent, since all shifts >=8 will be 0\n return (new byte[] { byte3, byte2, byte1, byte0 });\n }",
"public static void intToByteArray(int value, byte[] buffer, int offset) {\n buffer[offset] = (byte) (value >> 24 & 0xFF);\n buffer[offset + 1] = (byte) (value >> 16 & 0xFF);\n buffer[offset + 2] = (byte) (value >> 8 & 0xFF);\n buffer[offset + 3] = (byte) (value & 0xFF);\n }",
"public static byte[] toBytes(int val) {\n byte [] b = new byte[4];\n for(int i = 3; i > 0; i--) {\n b[i] = (byte) val;\n val >>>= 8;\n }\n b[0] = (byte) val;\n return b;\n }",
"public ByteArray(final long value)\n\t{\n\t\t// create the array\n\t\tthis.bytes = new byte[8];\n\t\t\n\t\t// for every byte\n\t\tfor (int i = 0; i < 8; i++)\n\t\t{\n\t\t\t// assign the array of bytes\n\t\t\tthis.bytes[i] = (byte) (value >> ((7 - i) * 8));\n\t\t}\n\t}",
"List<Byte> getAsBytes();",
"private byte[] integerToOctetString(BigInteger r, BigInteger modulus) throws IOException {\n byte[] modulusBytes = modulus.toByteArray();\n int modulusLen = modulusBytes.length;\n byte[] rBytes = r.toByteArray();\n int rLen = rBytes.length;\n int rMSB = rBytes[0] & 0xFF;\n\n if (modulusBytes[0] == 0x00) {\n modulusLen -= 1;\n }\n\n // for arrays that are more than one byte longer\n if ((rLen == modulusLen + 1 && rMSB != 0x00) || rLen > modulusLen + 1) {\n throw new IOException(\"Integer value is larger than modulus\");\n }\n\n byte[] rUnsigned = new byte[modulusLen];\n System.arraycopy(rBytes, (rLen > modulusLen) ? (rLen - modulusLen) : 0, rUnsigned,\n (modulusLen > rLen) ? (modulusLen - rLen) : 0, (modulusLen > rLen) ? rLen : modulusLen);\n\n return rUnsigned;\n }",
"public final byte[] mo18193a(int i) {\n return new byte[i];\n }",
"public static byte[] valueToBytes(Object value) throws JSONException, IOException {\n if (value == null || value.equals(null)) {\n return Constants.NullByteMarker;\n }\n \t// return raw bytes is value is byte[] - else use normal json string conversion\n if (value instanceof byte[]) {\n \treturn (byte[])value;\n }\n \n if (value instanceof long[]) {\n \treturn Util.UTF8(longArrayString((long[])value));\n }\n \n if (value instanceof JSONString) {\n Object o;\n try {\n o = ((JSONString)value).toJSONString();\n } catch (Exception e) {\n throw new JSONException(e);\n }\n if (o instanceof String) {\n return Util.UTF8(o);\n }\n throw new JSONException(\"Bad value from toJSONString: \" + o);\n }\n if (value instanceof Number) {\n return Util.UTF8(JSONObject.numberToString((Number) value));\n }\n if (value instanceof Boolean || value instanceof JSONObject ||\n value instanceof JSONArray) {\n return Util.UTF8(value);\n }\n if (value instanceof Map) {\n return Util.UTF8(new JSONObject((Map)value));\n }\n if (value instanceof JSONList) {\n return ((JSONList)value).getBytes().makeExact().bytes();\n }\n if (value instanceof List) {\n return new JSONList((List)value).getBytes().makeExact().bytes();\n }\n if (value instanceof Collection) {\n return Util.UTF8(new JSONArray((Collection)value));\n }\n if (value.getClass().isArray()) {\n return Util.UTF8(new JSONArray(value));\n }\n return Util.UTF8(JSONObject.quote(value.toString()));\n }",
"public synchronized static byte [] LongToBytes ( long ldata, int n )\n {\n byte buff[] = new byte [ n ];\n\n for ( int i=n-1; i>=0; i--)\n {\n // Keep assigning the right most 8 bits to the\n // byte arrays while shift 8 bits during each iteration\n buff [ i ] = (byte) ldata;\n ldata = ldata >> 8;\n }\n return buff;\n }",
"private byte[] ionBytes(IonValue val)\n {\n IonDatagram dg = system().newDatagram(val);\n return dg.getBytes();\n }",
"public static void longToByteArray(long value, byte[] buffer, int offset) {\n buffer[offset] = (byte) (value >> 56 & 0xFF);\n buffer[offset + 1] = (byte) (value >> 48 & 0xFF);\n buffer[offset + 2] = (byte) (value >> 40 & 0xFF);\n buffer[offset + 3] = (byte) (value >> 32 & 0xFF);\n buffer[offset + 4] = (byte) (value >> 24 & 0xFF);\n buffer[offset + 5] = (byte) (value >> 16 & 0xFF);\n buffer[offset + 6] = (byte) (value >> 8 & 0xFF);\n buffer[offset + 7] = (byte) (value & 0xFF);\n }",
"static byte[] encode(BigInteger n) {\n\t\tbyte[] encodedN;\n\t\tif (n.signum() == 0) {\n\t\t\t// If n is zero, return an zero-length byte array\n\t\t\tencodedN = new byte[0];\n\t\t} else {\n\t\t\t// No need to reverse as C# original does at this point, as Java is always Big Endian.\n\t\t\tbyte[] nAsByteArray = n.toByteArray();\n\t\t\tint firstNonZeroIndex = 0;\n\t\t\twhile ((nAsByteArray[firstNonZeroIndex] == 0) && (firstNonZeroIndex < nAsByteArray.length)) {\n\t\t\t\tfirstNonZeroIndex++;\n\t\t\t}\n\t\t\t// Finally copy the non-zero bytes in to a new array\n\t\t\tencodedN = new byte[nAsByteArray.length - firstNonZeroIndex];\n\t\t\tSystem.arraycopy(nAsByteArray, firstNonZeroIndex, encodedN, 0, nAsByteArray.length - firstNonZeroIndex);\n\t\t}\n\n\t\treturn encodedN;\n\t}",
"private byte[] shortToByteArray(short i) {\n ByteBuffer bbf = ByteBuffer.allocate(2)\n .order(ByteOrder.LITTLE_ENDIAN)\n .putShort(i);\n return bbf.array();\n }",
"public char[] decimalToBinary(int value) {\n\t\t// TODO: Implement this method.\n\t\treturn null;\n\t}",
"public static byte[] ToBytes(AsonValue obj,byte flag) throws java.io.IOException {\n return new AsonSerializer(flag).serialize(obj);\n }",
"private byte[] intToBits(int number, int n) {\n\t\tbyte[] bits = new byte[n];\n\t\t\n\t\tString bitString = Integer.toBinaryString(number);\n\t\twhile (bitString.length() < n) {\n\t\t\tbitString = \"0\" + bitString;\n\t\t}\n\t\t\n\t\tfor(int i = 0, maxLen = bits.length; i < maxLen; i++) {\n\t\t\tbits[i] = (byte) (bitString.charAt(i) == 1 ? 1 : 0);\n\t\t}\n\t\t\n\t\treturn bits;\n\t}",
"@Override\n\tpublic byte[] toByteArray() {\n\t\tComparatorProtos.ByteArrayComparable.Builder builder = ComparatorProtos.ByteArrayComparable.newBuilder();\n\t\tbuilder.setValue(ByteString.copyFrom(getValue()));\n\t\treturn builder.build().toByteArray();\n\t}",
"public static byte[] createByteForIdList(List<String> idList) {\r\n\t\tif(idList == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\tint count = 0;\r\n\t\tfor(String id: idList){\r\n\t\t\tif(count >0){\r\n\t\t\t\tbuilder.append(COLUMN_ID_DELIMITER);\r\n\t\t\t}\r\n\t\t\t// the value must be a long\r\n\t\t\tlong value = KeyFactory.stringToKey(id);\r\n\t\t\tbuilder.append(value);\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\treturn builder.toString().getBytes(\"UTF-8\");\r\n\t\t} catch (UnsupportedEncodingException e) {\r\n\t\t\tthrow new RuntimeException(e);\r\n\t\t}\r\n\t}",
"byte[] getBytes();",
"byte[] getBytes();",
"public static byte[] integerAsConsecutiveBytes(int num) {\r\n\t\tbyte[] bytes = new byte[4];\r\n\t\tfor(int i=0; i < bytes.length; i++) {\r\n\t\t\tint shiftFactor = 8 * (bytes.length - (i + 1));\r\n\t\t\tint value = num >> shiftFactor;\r\n\t\t\tbytes[i] = (byte) value;\r\n\t\t}\r\n\t\treturn bytes;\r\n\t}",
"public byte[] toByteArray() {\n/* 510 */ ByteBuffer buff = ByteBuffer.allocate(40).order(ByteOrder.LITTLE_ENDIAN);\n/* 511 */ writeTo(buff);\n/* 512 */ return buff.array();\n/* */ }",
"public abstract byte[] toBytes() throws Exception;",
"public static byte[] intToFourBytes(int val) {\n if (val < 0) throw new IllegalArgumentException(\"Value may not be signed.\");\n byte[] bytes = new byte[4];\n\n for (int i = 3; i >= 0; --i) {\n // unpack a byte\n byte b = (byte)(val & 0xff);\n // shift by 8 bits\n val >>= 8;\n // store the unpacked byte, moving from LSB to MSB (so the MSB ends up in bytes[0])\n bytes[i] = b;\n }\n\n return bytes;\n }",
"public static byte[] convertLong(long v, boolean isLE)\r\n {\r\n byte[] bytes = new byte[8];\r\n if (isLE)\r\n {\r\n bytes[0] = (byte) (v >>> 0);\r\n bytes[1] = (byte) (v >>> 8);\r\n bytes[2] = (byte) (v >>> 16);\r\n bytes[3] = (byte) (v >>> 24);\r\n bytes[4] = (byte) (v >>> 32);\r\n bytes[5] = (byte) (v >>> 40);\r\n bytes[6] = (byte) (v >>> 48);\r\n bytes[7] = (byte) (v >>> 56);\r\n }\r\n else\r\n {\r\n bytes[0] = (byte) (v >>> 56);\r\n bytes[1] = (byte) (v >>> 48);\r\n bytes[2] = (byte) (v >>> 40);\r\n bytes[3] = (byte) (v >>> 32);\r\n bytes[4] = (byte) (v >>> 24);\r\n bytes[5] = (byte) (v >>> 16);\r\n bytes[6] = (byte) (v >>> 8);\r\n bytes[7] = (byte) (v >>> 0);\r\n }\r\n return bytes;\r\n }",
"public static byte[] LongToOpaque(long number) { \n long temp = number; \n byte[] b = new byte[16]; //0-7 time stamp, 8-15 customized \n for (int i = 0; i < 8; i++) { \n b[i] = new Long(temp & 0xff).byteValue();\n temp = temp >> 8; // right shift 8\n } \n return b; \n }",
"public static byte[] arrayBigIntegerToByte(BigInteger... a) {\n if(a.length == 0) {\n throw new IllegalArgumentException(\"You must supply at least one BigInteger\");\n }\n\n int[] bigIntLengths = new int[a.length];\n byte[][] bigInts = new byte[a.length][];\n int len = 0; // length of the array of numbers\n for(int i = 0; i < a.length; i++) {\n // first INT_LENGTH_IN_BYTES bytes = number length\n bigInts[i] = a[i].toByteArray();\n bigIntLengths[i] = bigInts[i].length;\n len += INT_LENGTH_IN_BYTES + bigIntLengths[i]; // INT_LENGTH_IN_BYTES to save the length of the number\n }\n\n if(len > Integer.MAX_VALUE) {\n // TODO: ....\n throw new OutOfMemoryError(\"Could not send the array of BigIntegers\");\n }\n byte[] res = new byte[INT_LENGTH_IN_BYTES + (int)len];\n System.arraycopy(intToByte(a.length), 0, res, 0, INT_LENGTH_IN_BYTES);\n for(int i = 0, offset = INT_LENGTH_IN_BYTES; i < a.length; i++) {\n // append BigInteger length\n System.arraycopy(intToByte(bigIntLengths[i]), 0, res, offset, INT_LENGTH_IN_BYTES);\n // append BigInteger\n System.arraycopy(bigInts[i], 0, res, offset + INT_LENGTH_IN_BYTES, bigIntLengths[i]);\n offset += bigIntLengths[i] + INT_LENGTH_IN_BYTES;\n }\n\n return res;\n }",
"public static byte[] createBytes()\n\t{\n\t\tbyte[]\t\trc = new byte[16];\n\t\tint\t\tid;\n\n\t\tsynchronized(itsLock)\n\t\t{\n\t\t\tid = itsCounter++;\n\n\t\t\tif(itsCounter == 0)\n\t\t\t{\n\t\t\t\t// We've wrapped around: regenerate a new base array\n\t\t\t\t_getBase();\n\t\t\t}\n\t\t}\n\n\t\tSystem.arraycopy(itsBase, 0, rc, 0, 12);\n\t\trc[12] = (byte)(id & 0xff);\n\t\trc[13] = (byte)((id >> 8) & 0xff);\n\t\trc[14] = (byte)((id >> 16) & 0xff);\n\t\trc[15] = (byte)((id >> 24) & 0xff);\n\n\t\treturn rc;\n\t}",
"public byte[] toBytes() {\n return toProtobuf().toByteArray();\n }",
"private byte[] toByteArray() {\n\n byte[] validUntilBytes = ByteBuffer.allocate(Long.BYTES).putLong(validUntil).array();\n return Tools.concatAllBytes(pseudoniem, validUntilBytes);\n }",
"public byte[] getByteArray(){\r\n\r\n byte[] b = new byte[0x54];\r\n\r\n System.arraycopy(PID_pointer, 0, b, 0, 4);\r\n System.arraycopy(MPID_pointer, 0, b, 4, 4);\r\n System.arraycopy(Null_pointer, 0, b, 8, 4);\r\n System.arraycopy(Portrait_pointer, 0, b, 12, 4);\r\n System.arraycopy(Class_pointer, 0, b, 16, 4);\r\n System.arraycopy(Affiliation_pointer, 0, b, 20, 4);\r\n System.arraycopy(Weaponlevel_pointer, 0, b, 24, 4);\r\n System.arraycopy(Skill1_pointer, 0, b, 28, 4);\r\n System.arraycopy(Skill2_pointer, 0, b, 32, 4);\r\n System.arraycopy(Skill3_pointer, 0, b, 36, 4);\r\n System.arraycopy(Animation1_pointer, 0, b, 40, 4);\r\n System.arraycopy(Animation2_pointer, 0, b, 44, 4);\r\n b[48] = unknownbyte1;\r\n b[49] = unknownbyte2;\r\n b[50] = unknownbyte3;\r\n b[51] = unknownbyte4;\r\n b[52] = unknownbyte5;\r\n b[53] = unknownbyte6;\r\n b[54] = level;\r\n b[55] = build;\r\n b[56] = weight;\r\n System.arraycopy(bases, 0, b, 57, 8);\r\n System.arraycopy(growths, 0, b, 65, 8);\r\n System.arraycopy(supportgrowth, 0, b, 73, 8);\r\n b[81] = unknownbyte9;\r\n b[82] = unknownbyte10;\r\n b[83] = unknownbyte11;\r\n\r\n return b;\r\n }",
"void writeBytes(byte[] value);",
"public static byte[] intToHex(long value){\n\t\tint count=7;\n\t\tshort[] bytes = new short[8];\n\t\tcal(value,count,bytes);\n\t\treturn shorts2bytes(bytes);\n\t}",
"public static long asn1Value_ByteArrayToLong(byte[] asn1LongValue) throws ValueNullException, ValueTooBigException {\n\t\t//check if the array is null\n\t\tif(asn1LongValue == null) {\n\t\t\tthrow new ValueNullException(\"The input is null, not an encoded long\");\n\t\t}\n\t\t//check if the value 0 has been encoded\n\t\tif((asn1LongValue[0] == 0) && (asn1LongValue.length == 1) ) {\n\t\t\treturn 0L;\n\t\t}\n\t\t//check if the value is too long to be converted to a long\n\t\tif((asn1LongValue.length>8)) {\n\t\t\tthrow new ValueTooBigException(\"Java long can only hold 64 bits or 8 octets. The passed value is bigger than that\");\n\t\t}\n\t\t\n\t\tBigInteger tmpLong = new BigInteger(asn1LongValue);\n\t\treturn tmpLong.longValue();\n\t}",
"void mo4520a(byte[] bArr);",
"byte[] byteValue() {\n\treturn data;\n }",
"public static String binValue(byte[] bytes) {\n StringBuilder sb = new StringBuilder(8*bytes.length);\n for (int j = 0; j< bytes.length; j++){\n sb.append(binValue(bytes[j]));\n }\n return sb.toString();\n }",
"byte[] getEByteArray();",
"public abstract long[] toLongArray();",
"public static byte[] NumStringToBytes(String in) {\n BigInteger num = new BigInteger(in);\n byte[] bytes = num.toByteArray();\n if (bytes.length > 0) {\n if (bytes[0] == 0) {\n byte[] cuttedByte = new byte[bytes.length - 1];\n System.arraycopy(bytes, 1, cuttedByte, 0, bytes.length - 1);\n return cuttedByte;\n }\n\n }\n return num.toByteArray();\n }",
"public static <O> byte[] toBytes(O object) {\n try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n ObjectOutputStream objOutputStream = new ObjectOutputStream(byteArrayOutputStream);) {\n objOutputStream.writeObject(object);\n return byteArrayOutputStream.toByteArray();\n\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n }",
"private byte[] gapEncode (List<Integer> list) {\n\t if (list == null || list.size() == 0) {\n\t return null;\n }\n\t\tIterator<Integer> p = list.iterator();\n\t\tInteger docId = popNextOrNull(p);\n\t\tbyte[] firDocId = vBNumber(docId);\n\t\tbyte[] bytes = new byte[VBNUM_SIZE * list.size()];\n int index;\n for (index = 0; index < firDocId.length; index++) {\n bytes[index] = firDocId[index];\n }\n\n\t while (docId != null) {\n\t Integer nextDocId = popNextOrNull(p);\n\t if (nextDocId == null) {\n\t break;\n }\n\t byte[] gap = vBNumber(nextDocId - docId);\n\t for (int i = 0; i < gap.length; i++) {\n\t bytes[index] = gap[i];\n\t index++;\n }\n\t docId = nextDocId;\n }\n\n byte[] result = new byte[index];\n for (int i = 0; i < index; i++) {\n result[i] = bytes[i];\n }\n\n\n\n /*System.out.println(\"......gap encode inside......\");\n\n for (byte t : result) {\n for (int i = 0; i < Byte.SIZE; i++) {\n int n = t & (1 << (7 - i));\n n = n >> (7 - i);\n System.out.print(n);\n }\n System.out.println();\n }*/\n\n return result;\n\t}"
] | [
"0.668338",
"0.6629583",
"0.6498645",
"0.6471525",
"0.63896906",
"0.6376781",
"0.63698393",
"0.62879705",
"0.62751585",
"0.62503785",
"0.62398475",
"0.6171354",
"0.61668277",
"0.6157947",
"0.6137694",
"0.6108349",
"0.6102016",
"0.6082847",
"0.6080885",
"0.60790986",
"0.6077143",
"0.60616696",
"0.60540044",
"0.60324043",
"0.60231376",
"0.601947",
"0.60133034",
"0.600662",
"0.5999431",
"0.5967549",
"0.5928084",
"0.5909961",
"0.590772",
"0.59027",
"0.58983815",
"0.58635896",
"0.5823215",
"0.5814471",
"0.57923245",
"0.57767886",
"0.57624316",
"0.57438433",
"0.5722677",
"0.5720661",
"0.5716463",
"0.57039624",
"0.56852317",
"0.56835157",
"0.567894",
"0.567894",
"0.5671048",
"0.56681865",
"0.5654635",
"0.56485814",
"0.5642465",
"0.56419003",
"0.5622179",
"0.56201655",
"0.5620115",
"0.5615962",
"0.5613634",
"0.56127906",
"0.55862087",
"0.55612653",
"0.5556014",
"0.5556002",
"0.5554063",
"0.55528873",
"0.5549588",
"0.55448914",
"0.55436736",
"0.5529217",
"0.5518112",
"0.55102694",
"0.5509215",
"0.54933095",
"0.548391",
"0.548391",
"0.54743016",
"0.546958",
"0.5453516",
"0.5450221",
"0.5442464",
"0.5441494",
"0.54152626",
"0.54004765",
"0.53916824",
"0.53875804",
"0.53816336",
"0.53672236",
"0.53649646",
"0.532654",
"0.53250706",
"0.5318556",
"0.53056055",
"0.5302961",
"0.5297439",
"0.5288055",
"0.5283079",
"0.5259874"
] | 0.63608956 | 7 |
Converts a value which is given as a long into a byte array according to the ASN1 DER standard. | public static byte[] longToByteArray_ASN1_Value(long toBeConverted) {
//create the temporary version of what will be returned
byte[] tempToBeReturned = {
(byte)(toBeConverted >> 56),
(byte)(toBeConverted >> 48),
(byte)(toBeConverted >> 40),
(byte)(toBeConverted >> 32),
(byte)(toBeConverted >> 24),
(byte)(toBeConverted >> 16),
(byte)(toBeConverted >> 8),
(byte)toBeConverted};
//converting positive long values
if(toBeConverted >= 0) {
//0 to 127: return only one octet
if(toBeConverted<=127) {
byte[] toBeReturned = new byte[1];
toBeReturned[0] = tempToBeReturned[7];
return toBeReturned;
}
//128 to 32768-1 return two octets
else if(toBeConverted<=32767) {
byte[] toBeReturned = new byte[2];
toBeReturned[0] = tempToBeReturned[6];
toBeReturned[1] = tempToBeReturned[7];
return toBeReturned;
}
//32767 to 8388607 return three octets
else if(toBeConverted<=8388607) {
byte[] toBeReturned = new byte[3];
toBeReturned[0] = tempToBeReturned[5];
toBeReturned[1] = tempToBeReturned[6];
toBeReturned[2] = tempToBeReturned[7];
return toBeReturned;
}
//8388608 to 2147483647 return four octets
else if(toBeConverted<=2147483647) {
byte[] toBeReturned = new byte[4];
toBeReturned[0] = tempToBeReturned[4];
toBeReturned[1] = tempToBeReturned[5];
toBeReturned[2] = tempToBeReturned[6];
toBeReturned[3] = tempToBeReturned[7];
return toBeReturned;
}
//the value 0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y
//2147483648 to 549755813887 return five octets
else if((Long.compare(toBeConverted, 549755813888L))<0) {
byte[] toBeReturned = new byte[5];
toBeReturned[0] = tempToBeReturned[3];
toBeReturned[1] = tempToBeReturned[4];
toBeReturned[2] = tempToBeReturned[5];
toBeReturned[3] = tempToBeReturned[6];
toBeReturned[4] = tempToBeReturned[7];
return toBeReturned;
}
//549755813888 to 140737488355327 return six octets
else if((Long.compare(toBeConverted, 140737488355328L))<0) {
byte[] toBeReturned = new byte[6];
toBeReturned[0] = tempToBeReturned[2];
toBeReturned[1] = tempToBeReturned[3];
toBeReturned[2] = tempToBeReturned[4];
toBeReturned[3] = tempToBeReturned[5];
toBeReturned[4] = tempToBeReturned[6];
toBeReturned[5] = tempToBeReturned[7];
return toBeReturned;
}
//140737488355328 to 36028797018963967 return seven octets
else if((Long.compare(toBeConverted, 36028797018963967L))<0) {
byte[] toBeReturned = new byte[7];
toBeReturned[0] = tempToBeReturned[1];
toBeReturned[1] = tempToBeReturned[2];
toBeReturned[2] = tempToBeReturned[3];
toBeReturned[3] = tempToBeReturned[4];
toBeReturned[4] = tempToBeReturned[5];
toBeReturned[5] = tempToBeReturned[6];
toBeReturned[6] = tempToBeReturned[7];
return toBeReturned;
}
//above: return eight octets
else {
return tempToBeReturned;
}
}
//converting negative long values
else if(toBeConverted<0) {
//-1 to -128 1 octet
if(toBeConverted>=-128) {
byte[] toBeReturned = new byte[1];
toBeReturned[0] = tempToBeReturned[7];
return toBeReturned;
}
//-129 to -32768 2 octets
else if(toBeConverted>=-32768) {
byte[] toBeReturned = new byte[2];
toBeReturned[0] = tempToBeReturned[6];
toBeReturned[1] = tempToBeReturned[7];
return toBeReturned;
}
//-32769 to -8388608 3 octets
else if(toBeConverted>=-8388608) {
byte[] toBeReturned = new byte[3];
toBeReturned[0] = tempToBeReturned[5];
toBeReturned[1] = tempToBeReturned[6];
toBeReturned[2] = tempToBeReturned[7];
return toBeReturned;
}
//-8388609 to -2147483648 4 octets
else if(toBeConverted>=-2147483648) {
byte[] toBeReturned = new byte[4];
toBeReturned[0] = tempToBeReturned[4];
toBeReturned[1] = tempToBeReturned[5];
toBeReturned[2] = tempToBeReturned[6];
toBeReturned[3] = tempToBeReturned[7];
return toBeReturned;
}
//the value 0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y
//-2147483649 to -549755813888 5 octets
else if((Long.compare(toBeConverted, -549755813889L))>0) {
byte[] toBeReturned = new byte[5];
toBeReturned[0] = tempToBeReturned[3];
toBeReturned[1] = tempToBeReturned[4];
toBeReturned[2] = tempToBeReturned[5];
toBeReturned[3] = tempToBeReturned[6];
toBeReturned[4] = tempToBeReturned[7];
return toBeReturned;
}
//-549755813889 to -140737488355328 6 octets
else if((Long.compare(toBeConverted, -140737488355329L))>0) {
byte[] toBeReturned = new byte[6];
toBeReturned[0] = tempToBeReturned[2];
toBeReturned[1] = tempToBeReturned[3];
toBeReturned[2] = tempToBeReturned[4];
toBeReturned[3] = tempToBeReturned[5];
toBeReturned[4] = tempToBeReturned[6];
toBeReturned[5] = tempToBeReturned[7];
return toBeReturned;
}
//-140737488355329 to 36028797018963968 7 octets
else if((Long.compare(toBeConverted, -36028797018963969L))>0) {
byte[] toBeReturned = new byte[7];
toBeReturned[0] = tempToBeReturned[1];
toBeReturned[1] = tempToBeReturned[2];
toBeReturned[2] = tempToBeReturned[3];
toBeReturned[3] = tempToBeReturned[4];
toBeReturned[4] = tempToBeReturned[5];
toBeReturned[5] = tempToBeReturned[6];
toBeReturned[6] = tempToBeReturned[7];
return toBeReturned;
}
//below that: 8 octets
else {
return tempToBeReturned;
}
}
//if method fails for any reason, it returns null
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public byte[] l2b(long value) {\n byte[] data = new byte[8];\n data[0] = (byte) ((value >> 56) & 0xFF);\n data[1] = (byte) ((value >> 48) & 0xFF);\n data[2] = (byte) ((value >> 40) & 0xFF);\n data[3] = (byte) ((value >> 32) & 0xFF);\n data[4] = (byte) ((value >> 24) & 0xFF);\n data[5] = (byte) ((value >> 16) & 0xFF);\n data[6] = (byte) ((value >> 8) & 0xFF);\n data[7] = (byte) (value & 0xFF);\n return data;\n }",
"public static byte[] getBytes(long value) {\r\n\t\treturn ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(value).array();\r\n\t}",
"public static byte[] longToBytes(long x) {\n\t ByteBuffer buffer = ByteBuffer.allocate(Long.BYTES);\n\t buffer.putLong(x);\n\t return buffer.array();\n\t}",
"public static byte[] toBytes(long val) {\n byte [] b = new byte[8];\n for (int i = 7; i > 0; i--) {\n b[i] = (byte) val;\n val >>>= 8;\n }\n b[0] = (byte) val;\n return b;\n }",
"public static void longToByteArray(long value, byte[] buffer, int offset) {\n buffer[offset] = (byte) (value >> 56 & 0xFF);\n buffer[offset + 1] = (byte) (value >> 48 & 0xFF);\n buffer[offset + 2] = (byte) (value >> 40 & 0xFF);\n buffer[offset + 3] = (byte) (value >> 32 & 0xFF);\n buffer[offset + 4] = (byte) (value >> 24 & 0xFF);\n buffer[offset + 5] = (byte) (value >> 16 & 0xFF);\n buffer[offset + 6] = (byte) (value >> 8 & 0xFF);\n buffer[offset + 7] = (byte) (value & 0xFF);\n }",
"public static byte[] longToBytes(long l) {\n\n ByteBuffer byteBuffer = ByteBuffer.allocate(NUM_BYTES_IN_LONG);\n byteBuffer.putLong(l);\n return byteBuffer.array();\n\n }",
"public static byte[] getLongAsBytes(long l) {\n\t\treturn new byte[] {\n\t\t\t\t(byte) (l >> 56),\n\t\t\t\t(byte) (l >> 48),\n\t\t\t\t(byte) (l >> 40),\n\t\t\t\t(byte) (l >> 32),\n\t\t\t\t(byte) (l >> 24),\n\t\t\t\t(byte) (l >> 16),\n\t\t\t\t(byte) (l >> 8),\n\t\t\t\t(byte) l\n\t\t\t};\n\t}",
"private static final byte[] longToByteArray(long l) {\n\t\tbyte[] retVal = new byte[8];\n\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tretVal[i] = (byte) l;\n\t\t\tl >>= 8;\n\t\t}\n\n\t\treturn retVal;\n\t}",
"public static byte[] longToByteArray(long value, int valueSize, int length) {\n long val = value;\n // Convert the long to 8-byte BE representation\n byte[] b = new byte[8];\n for (int i = 7; i >= 0 && val != 0L; i--) {\n b[i] = (byte) val;\n val >>>= 8;\n }\n // Then copy the rightmost valueSize bytes\n // e.g., for an integer we want rightmost 4 bytes\n return Arrays.copyOfRange(b, 8 - valueSize, 8 + length - valueSize);\n }",
"public static byte[] toBytes(final long number) {\n\t\treturn new byte[] {\n\t\t\t(byte) (number >>> 56),\n\t\t\t(byte) (number >>> 48),\n\t\t\t(byte) (number >>> 40),\n\t\t\t(byte) (number >>> 32),\n\t\t\t(byte) (number >>> 24),\n\t\t\t(byte) (number >>> 16),\n\t\t\t(byte) (number >>> 8),\n\t\t\t(byte) (number)\n\t\t};\n\t}",
"static byte[] long2byteArray(long number, int length, boolean swapHalfWord) {\n }",
"public byte[] getByteArray() {\n long val = getValue();\n return new byte[] {\n (byte)((val>>24) & 0xff),\n (byte)((val>>16) & 0xff),\n (byte)((val>>8) & 0xff),\n (byte)(val & 0xff) };\n }",
"public static byte[] convertLong(long v, boolean isLE)\r\n {\r\n byte[] bytes = new byte[8];\r\n if (isLE)\r\n {\r\n bytes[0] = (byte) (v >>> 0);\r\n bytes[1] = (byte) (v >>> 8);\r\n bytes[2] = (byte) (v >>> 16);\r\n bytes[3] = (byte) (v >>> 24);\r\n bytes[4] = (byte) (v >>> 32);\r\n bytes[5] = (byte) (v >>> 40);\r\n bytes[6] = (byte) (v >>> 48);\r\n bytes[7] = (byte) (v >>> 56);\r\n }\r\n else\r\n {\r\n bytes[0] = (byte) (v >>> 56);\r\n bytes[1] = (byte) (v >>> 48);\r\n bytes[2] = (byte) (v >>> 40);\r\n bytes[3] = (byte) (v >>> 32);\r\n bytes[4] = (byte) (v >>> 24);\r\n bytes[5] = (byte) (v >>> 16);\r\n bytes[6] = (byte) (v >>> 8);\r\n bytes[7] = (byte) (v >>> 0);\r\n }\r\n return bytes;\r\n }",
"public ByteArray(final long value)\n\t{\n\t\t// create the array\n\t\tthis.bytes = new byte[8];\n\t\t\n\t\t// for every byte\n\t\tfor (int i = 0; i < 8; i++)\n\t\t{\n\t\t\t// assign the array of bytes\n\t\t\tthis.bytes[i] = (byte) (value >> ((7 - i) * 8));\n\t\t}\n\t}",
"public static long asn1Value_ByteArrayToLong(byte[] asn1LongValue) throws ValueNullException, ValueTooBigException {\n\t\t//check if the array is null\n\t\tif(asn1LongValue == null) {\n\t\t\tthrow new ValueNullException(\"The input is null, not an encoded long\");\n\t\t}\n\t\t//check if the value 0 has been encoded\n\t\tif((asn1LongValue[0] == 0) && (asn1LongValue.length == 1) ) {\n\t\t\treturn 0L;\n\t\t}\n\t\t//check if the value is too long to be converted to a long\n\t\tif((asn1LongValue.length>8)) {\n\t\t\tthrow new ValueTooBigException(\"Java long can only hold 64 bits or 8 octets. The passed value is bigger than that\");\n\t\t}\n\t\t\n\t\tBigInteger tmpLong = new BigInteger(asn1LongValue);\n\t\treturn tmpLong.longValue();\n\t}",
"private byte[] toByte(long address) {\n byte[] addressInBytes = new byte[]{\n (byte) (address >> 40 & 0xff),\n (byte) (address >> 32 & 0xff),\n (byte) (address >> 24 & 0xff),\n (byte) (address >> 16 & 0xff),\n (byte) (address >> 8 & 0xff),\n (byte) (address >> 0 & 0xff)\n };\n return addressInBytes;\n }",
"public static byte[] LongToOpaque(long number) { \n long temp = number; \n byte[] b = new byte[16]; //0-7 time stamp, 8-15 customized \n for (int i = 0; i < 8; i++) { \n b[i] = new Long(temp & 0xff).byteValue();\n temp = temp >> 8; // right shift 8\n } \n return b; \n }",
"public synchronized static byte [] LongToBytes ( long ldata, int n )\n {\n byte buff[] = new byte [ n ];\n\n for ( int i=n-1; i>=0; i--)\n {\n // Keep assigning the right most 8 bits to the\n // byte arrays while shift 8 bits during each iteration\n buff [ i ] = (byte) ldata;\n ldata = ldata >> 8;\n }\n return buff;\n }",
"public static long toInt64(byte[] value) {\r\n\t\treturn toInt16(value, 0);\r\n\t}",
"public abstract long[] toLongArray();",
"public native static long getConvertBytes();",
"public static byte[] toBytes(final long... numbers) {\n\t\tbyte[] bytes = new byte[numbers.length * 8];\n\t\tfor (int i = 0, j = 0; i < numbers.length; i++, j += 8) {\n\t\t\tSystem.arraycopy(toBytes(numbers[i]), 0, bytes, j, 8);\n\t\t}\n\t\treturn bytes;\n\t}",
"long decodeLong();",
"public static byte [] toBytes(final double d) {\n // Encode it as a long\n return Bytes.toBytes(Double.doubleToRawLongBits(d));\n }",
"public abstract void read_longlong_array(long[] value, int offset, int\nlength);",
"public static byte[] intToHex(long value){\n\t\tint count=7;\n\t\tshort[] bytes = new short[8];\n\t\tcal(value,count,bytes);\n\t\treturn shorts2bytes(bytes);\n\t}",
"static byte[] toArray(int value) {\n return new byte[] {\n (byte) (value >> 24),\n (byte) (value >> 16),\n (byte) (value >> 8),\n (byte) value };\n }",
"public byte[] readRawLong() throws IOException {\n byte[] bytes = new byte[9];\n bytes[0] = (byte) Type.LONG.code;\n in.readFully(bytes, 1, 8);\n return bytes;\n }",
"public static int[] getBytesFromQuadByte(final long longValue) {\n int[] intArray = new int[4];\n\n intArray[0] = (int) ((longValue >>> 3 * BYTE_LENGTH) & BYTE_MASK);\n intArray[1] = (int) ((longValue >>> 2 * BYTE_LENGTH) & BYTE_MASK);\n intArray[2] = (int) ((longValue >>> BYTE_LENGTH) & BYTE_MASK);\n intArray[3] = (int) (longValue & BYTE_MASK);\n\n return intArray;\n }",
"public static byte[] longToBytes(float x) {\n int bits = Float.floatToIntBits(x);\n byte[] buffer = new byte[4];\n buffer[0] = (byte)(bits & 0xff);\n buffer[1] = (byte)((bits >> 8) & 0xff);\n buffer[2] = (byte)((bits >> 16) & 0xff);\n buffer[3] = (byte)((bits >> 24) & 0xff);\n\n return buffer;\n }",
"public static byte[] toBigEndianByteArray(Number number) throws ScriptException\n {\n long n = number.longValue();\n for (int i = 1; i <= 8; i++)\n {\n long maxNum = 1L << (i * 8 - 1);\n if (n <= maxNum && n >= -maxNum)\n {\n byte[] res = new byte[i];\n boolean changeSign = false;\n if (n < 0)\n {\n changeSign = true;\n n = -n;\n }\n for (int j = 0; j < i; j++)\n {\n res[j] = (byte) ((n >> j * 8) & 0xFF);\n }\n // Bitcoin scripts use 1-complement for negative numbers\n if (changeSign)\n {\n res[i - 1] |= 0x80;\n }\n return res;\n }\n }\n throw new ScriptException(\"Number to large to convert to binary: \" + number);\n }",
"private byte[] toByteArray() {\n\n byte[] validUntilBytes = ByteBuffer.allocate(Long.BYTES).putLong(validUntil).array();\n return Tools.concatAllBytes(pseudoniem, validUntilBytes);\n }",
"public static byte[] getEncodeIntervalNumberByteArray(long intervalNumber) {\n return intToByteLittleEndian((int)getUint32(intervalNumber));\n }",
"public native byte[] __byteArrayMethod( long __swiftObject, byte[] arg );",
"public byte[] marshall();",
"public static String longToBigEndianHex(long value, int length) {\n\n String format = \"%0\" + length + \"X\";\n\n return String.format(format, value);\n }",
"public String FormatarValor(long value){\n return FormatUtil.formatBytes(value);\n }",
"private byte[] ionBytes(IonValue val)\n {\n IonDatagram dg = system().newDatagram(val);\n return dg.getBytes();\n }",
"public abstract void read_ulonglong_array(long[] value, int offset, int\nlength);",
"@Override\n public byte[] serialize(Date value) {\n return LONG_SERIALIZER.serialize(value.getTime());\n }",
"public native long[] __longArrayMethod( long __swiftObject, long[] arg );",
"public static byte[] toByteArray(long macAddress) {\n return MACAddress.valueOf(macAddress).toBytes();\n }",
"public static void write(byte[] buffer, long offset, long length , long value) {\n while(length-- > 0){\n buffer[(int) offset++] = (byte) (value & 0xFF);\n value >>=8;\n }\n }",
"public static long getBytesAsLong(byte[] b) {\n\t\treturn ((long) (b[0] & 0xff) << 56)\n\t\t\t\t| ((long) (b[1] & 0xFF) << 48)\n\t\t\t\t| ((long) (b[2] & 0xFF) << 40)\n\t\t\t\t| ((long) (b[3] & 0xFF) << 32)\n\t\t\t\t| ((long) (b[4] & 0xFF) << 24)\n\t\t\t\t| ((long) (b[5] & 0xFF) << 16)\n\t\t\t\t| ((long) (b[6] & 0xFF) << 8)\n\t\t\t\t| ((long) (b[7] & 0xFF));\n\t}",
"@Override\n\t\tprotected byte[] encode(OffsetSnap value) {\n\t\t\tByteBuffer buf = ByteBuffer.allocate(16);\n\t\t\tbuf.putLong(value.offset);\n\t\t\tbuf.putLong(value.snap ^ Long.MIN_VALUE);\n\t\t\treturn buf.array();\n\t\t}",
"public Asn1Object( int tag, int length, byte[] value ) {\n this.tag = tag;\n this.type = tag & 0x1F;\n this.length = length;\n this.value = value;\n }",
"public byte[] toByteArray() {\n/* 510 */ ByteBuffer buff = ByteBuffer.allocate(40).order(ByteOrder.LITTLE_ENDIAN);\n/* 511 */ writeTo(buff);\n/* 512 */ return buff.array();\n/* */ }",
"void writeLongs(long[] l, int off, int len) throws IOException;",
"public static int writeLong(byte[] target, int offset, long value) {\n target[offset] = (byte) (value >>> 56);\n target[offset + 1] = (byte) (value >>> 48);\n target[offset + 2] = (byte) (value >>> 40);\n target[offset + 3] = (byte) (value >>> 32);\n target[offset + 4] = (byte) (value >>> 24);\n target[offset + 5] = (byte) (value >>> 16);\n target[offset + 6] = (byte) (value >>> 8);\n target[offset + 7] = (byte) value;\n return Long.BYTES;\n }",
"void writeLong(long value);",
"public static byte[] ToBytes(AsonValue obj,byte flag) throws java.io.IOException {\n return new AsonSerializer(flag).serialize(obj);\n }",
"public ByteBuffer toValue(Date value) throws Exception {\n\t\treturn longTypeConverter.toValue(value.getTime());\n\t}",
"@ZenCodeType.Caster\n @ZenCodeType.Method\n default long[] asLongArray() {\n \n return notSupportedCast(\"long[]\");\n }",
"public static byte[] getBytes(int value) {\r\n\t\treturn ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putInt(value).array();\r\n\t}",
"public long[] toLongArray()\r\n {\r\n long[] a = new long[count];\r\n \r\n VectorItem<O> vi = first;\r\n \r\n for (int i=0;i<=count-1;i++)\r\n {\r\n a[i] = (Long) vi.getObject();\r\n vi = vi.getNext();\r\n }\r\n\r\n return a; \r\n }",
"public static Bytes bytes(final long bytes)\n\t{\n\t\treturn new Bytes(bytes);\n\t}",
"private long convertByteValueToLong(byte[] b) {\n long m = 0;\n for (int i = 0; i < b.length; i++) {\n m = m * 256 + (b[i] < 0 ? (256 + (long) b[i]) : b[i]);\n }\n return m;\n }",
"@Override\n\tpublic byte[] toByteArray() {\n\t\tComparatorProtos.ByteArrayComparable.Builder builder = ComparatorProtos.ByteArrayComparable.newBuilder();\n\t\tbuilder.setValue(ByteString.copyFrom(getValue()));\n\t\treturn builder.build().toByteArray();\n\t}",
"public byte[] getEncoded() {\n return toByteArray(Integer.valueOf(this.intValue));\n }",
"public final long bytes()\n\t{\n\t\treturn value;\n\t}",
"public long[] read();",
"public ByteBuf writeLong(long value)\r\n/* 557: */ {\r\n/* 558:568 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 559:569 */ return super.writeLong(value);\r\n/* 560: */ }",
"public static byte[] intToBytes(int value) {\n ByteBuffer bb = ByteBuffer.allocate(4);\n bb.putInt(value);\n return bb.array();\n }",
"private static BIG byte_to_BIG(byte [] array){\n BIG result = new BIG();\n long[] long_ = new long[4];\n for(int i=long_.length; i > 0;i--){\n long_[i-1] =\n ((array[i*7-3] & 0xFFL) << 48) |\n ((array[i*7-2] & 0xFFL) << 40) |\n ((array[i*7-1] & 0xFFL) << 32) |\n ((array[i*7] & 0xFFL) << 24) | \n ((array[i*7+1] & 0xFFL) << 16) | \n ((array[i*7+2] & 0xFFL) << 8) | \n ((array[i*7+3] & 0xFFL) << 0) ; \n }\n int int_ = \n (int) (((array[0] & 0xFFL) << 24) |\n\t\t ((array[1] & 0xFFL) << 16) |\n\t\t ((array[2] & 0xFFL) << 8) |\n\t\t ((array[3] & 0xFFL) << 0)) ;\n \n long[] temp = {long_[3],long_[2],long_[1],long_[0],int_};\n\n result = new BIG(temp);\n return result;\n }",
"private static byte[] shortToBytes(short value) {\n ByteBuffer bb = ByteBuffer.allocate(2);\n bb.putShort(value);\n return bb.array();\n }",
"public long toLong()\n\t{\n\t\t// holds the int to return\n\t\tlong result = 0;\n\t\t\n\t\t// for every byte value\n\t\tfor (int i = 0; i < bytes.length; i++)\n\t\t{\n\t\t\t// Extract the bits out of the array by \"and\"ing them with the\n\t\t\t// maximum value of\n\t\t\t// a byte. This is done because java does not support unsigned\n\t\t\t// types. Now that the\n\t\t\t// unsigned byte has been extracted, shift it to the right as far as\n\t\t\t// it is needed.\n\t\t\t// Examples:\n\t\t\t// byte array int\n\t\t\t// {0x01, 0x00} = 256\n\t\t\t//\n\t\t\t// byte array int\n\t\t\t// {0x01, 0x8C 0xF0} = 0x018CF0\n\t\t\tresult += (byteToLong(bytes[i]) << (Byte.SIZE * (bytes.length - i - 1)));\n\t\t}\n\t\t\n\t\t// return the int\n\t\treturn result;\n\t}",
"private static byte[] getBytes(int val) {\n log.log(Level.FINEST, String.format(\"%d\", val));\n byte[] ret = new byte[NekoIOConstants.INT_LENGTH];\n for (int i = 0; i < NekoIOConstants.INT_LENGTH; i++) {\n if (NekoIOConstants.BIG_ENDIAN) {\n ret[NekoIOConstants.INT_LENGTH - 1 - i] = (byte) val;\n } else {\n ret[i] = (byte) val;\n }\n val >>= 8;\n }\n return ret;\n }",
"com.google.protobuf.ByteString\n getLongTokenBytes();",
"com.google.protobuf.ByteString\n getLongTokenBytes();",
"public static long toInt64(byte[] value, int startIndex) {\r\n\t\treturn ByteBuffer.wrap(value, startIndex, 8).order(ByteOrder.LITTLE_ENDIAN).getLong();\r\n\t}",
"public static byte[] toByteArray(int value) {\n INT_BUFFER.clear();\n return INT_BUFFER.order(ByteOrder.LITTLE_ENDIAN).putInt(value).array();\n }",
"public void testValueOfLong()\n {\n // let's test that creating a EthernetAddress from an zero long\n // gives a null EthernetAddress (definition of a null EthernetAddress)\n EthernetAddress ethernet_address =\n EthernetAddress.valueOf(0x0000000000000000L);\n assertEquals(\n \"EthernetAddress.valueOf did not create expected EthernetAddress\",\n NULL_ETHERNET_ADDRESS_LONG,\n ethernet_address.toLong());\n \n // let's test creating an array from a good long\n ethernet_address =\n EthernetAddress.valueOf(VALID_ETHERNET_ADDRESS_LONG);\n assertEquals(\n \"EthernetAddress.valueOf did not create expected EthernetAddress\",\n VALID_ETHERNET_ADDRESS_LONG,\n ethernet_address.toLong());\n }",
"public static byte[] valueToBytes(Object value) throws JSONException, IOException {\n if (value == null || value.equals(null)) {\n return Constants.NullByteMarker;\n }\n \t// return raw bytes is value is byte[] - else use normal json string conversion\n if (value instanceof byte[]) {\n \treturn (byte[])value;\n }\n \n if (value instanceof long[]) {\n \treturn Util.UTF8(longArrayString((long[])value));\n }\n \n if (value instanceof JSONString) {\n Object o;\n try {\n o = ((JSONString)value).toJSONString();\n } catch (Exception e) {\n throw new JSONException(e);\n }\n if (o instanceof String) {\n return Util.UTF8(o);\n }\n throw new JSONException(\"Bad value from toJSONString: \" + o);\n }\n if (value instanceof Number) {\n return Util.UTF8(JSONObject.numberToString((Number) value));\n }\n if (value instanceof Boolean || value instanceof JSONObject ||\n value instanceof JSONArray) {\n return Util.UTF8(value);\n }\n if (value instanceof Map) {\n return Util.UTF8(new JSONObject((Map)value));\n }\n if (value instanceof JSONList) {\n return ((JSONList)value).getBytes().makeExact().bytes();\n }\n if (value instanceof List) {\n return new JSONList((List)value).getBytes().makeExact().bytes();\n }\n if (value instanceof Collection) {\n return Util.UTF8(new JSONArray((Collection)value));\n }\n if (value.getClass().isArray()) {\n return Util.UTF8(new JSONArray(value));\n }\n return Util.UTF8(JSONObject.quote(value.toString()));\n }",
"public static String toByteString(byte value) {\n String str = String.format(\"%x\", value);\n if (str.length() == 1)\n str = \"0\" + str;\n return str;\n }",
"public ByteBuf writeLongLE(long value)\r\n/* 877: */ {\r\n/* 878:886 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 879:887 */ return super.writeLongLE(value);\r\n/* 880: */ }",
"public static LongArrayBitVector wrap( final long[] array ) {\n\t\treturn wrap( array, (long)array.length * Long.SIZE );\n\t}",
"public byte[] intToBytes(int x) {\n\t\tByteBuffer buffer = ByteBuffer.allocate(Integer.BYTES);\n\t\tbuffer.putInt(x);\n\t\treturn buffer.array();\n\t}",
"public long[] getAsLongs() {\n return (long[])data;\n }",
"private static byte[] intToBytes(Integer integer) {\n\t\treturn BigInteger.valueOf(integer).toByteArray();\n\t}",
"@ZenCodeType.Caster\n @ZenCodeType.Method\n default byte[] asByteArray() {\n //TODO this is actually sbyte[], but @Unsigned doesn't work on arrays right now\n return notSupportedCast(\"byte[]\");\n }",
"public abstract byte[] toByteArray();",
"public abstract byte[] toByteArray();",
"byte[] toByteArray(ORecordVersion version);",
"Asn1Object(int tag, int length, byte[] value) {\n\t\t\tthis.tag = tag;\n\t\t\tthis.type = tag & 0x1F;\n\t\t\tthis.length = length;\n\t\t\tthis.value = value;\n\t\t}",
"public abstract void read_long_array(int[] value, int offset, int\nlength);",
"private static byte[] toByteArray(int[] array) {\n final byte[] res = new byte[array.length];\n for (int i = 0; i < array.length; ++i) {\n final int value = array[i];\n res[i] = (byte) value;\n }\n return res;\n }",
"public byte[] getByteArray(){\r\n\r\n byte[] b = new byte[0x54];\r\n\r\n System.arraycopy(PID_pointer, 0, b, 0, 4);\r\n System.arraycopy(MPID_pointer, 0, b, 4, 4);\r\n System.arraycopy(Null_pointer, 0, b, 8, 4);\r\n System.arraycopy(Portrait_pointer, 0, b, 12, 4);\r\n System.arraycopy(Class_pointer, 0, b, 16, 4);\r\n System.arraycopy(Affiliation_pointer, 0, b, 20, 4);\r\n System.arraycopy(Weaponlevel_pointer, 0, b, 24, 4);\r\n System.arraycopy(Skill1_pointer, 0, b, 28, 4);\r\n System.arraycopy(Skill2_pointer, 0, b, 32, 4);\r\n System.arraycopy(Skill3_pointer, 0, b, 36, 4);\r\n System.arraycopy(Animation1_pointer, 0, b, 40, 4);\r\n System.arraycopy(Animation2_pointer, 0, b, 44, 4);\r\n b[48] = unknownbyte1;\r\n b[49] = unknownbyte2;\r\n b[50] = unknownbyte3;\r\n b[51] = unknownbyte4;\r\n b[52] = unknownbyte5;\r\n b[53] = unknownbyte6;\r\n b[54] = level;\r\n b[55] = build;\r\n b[56] = weight;\r\n System.arraycopy(bases, 0, b, 57, 8);\r\n System.arraycopy(growths, 0, b, 65, 8);\r\n System.arraycopy(supportgrowth, 0, b, 73, 8);\r\n b[81] = unknownbyte9;\r\n b[82] = unknownbyte10;\r\n b[83] = unknownbyte11;\r\n\r\n return b;\r\n }",
"String longWrite();",
"public static long convertToLong(byte[] longBuffer)\r\n {\r\n if (longBuffer.length >= 8)\r\n {\r\n return (((long) longBuffer[0] << 56)\r\n + ((long) (longBuffer[1] & 255) << 48)\r\n + ((long) (longBuffer[2] & 255) << 40)\r\n + ((long) (longBuffer[3] & 255) << 32)\r\n + ((long) (longBuffer[4] & 255) << 24)\r\n + ((longBuffer[5] & 255) << 16)\r\n + ((longBuffer[6] & 255) << 8) + ((longBuffer[7] & 255) << 0));\r\n }\r\n return 0;\r\n }",
"static byte[] encode(BigInteger n) {\n\t\tbyte[] encodedN;\n\t\tif (n.signum() == 0) {\n\t\t\t// If n is zero, return an zero-length byte array\n\t\t\tencodedN = new byte[0];\n\t\t} else {\n\t\t\t// No need to reverse as C# original does at this point, as Java is always Big Endian.\n\t\t\tbyte[] nAsByteArray = n.toByteArray();\n\t\t\tint firstNonZeroIndex = 0;\n\t\t\twhile ((nAsByteArray[firstNonZeroIndex] == 0) && (firstNonZeroIndex < nAsByteArray.length)) {\n\t\t\t\tfirstNonZeroIndex++;\n\t\t\t}\n\t\t\t// Finally copy the non-zero bytes in to a new array\n\t\t\tencodedN = new byte[nAsByteArray.length - firstNonZeroIndex];\n\t\t\tSystem.arraycopy(nAsByteArray, firstNonZeroIndex, encodedN, 0, nAsByteArray.length - firstNonZeroIndex);\n\t\t}\n\n\t\treturn encodedN;\n\t}",
"void writeBytes(byte[] value);",
"public static byte[] arrayBigIntegerToByte(BigInteger... a) {\n if(a.length == 0) {\n throw new IllegalArgumentException(\"You must supply at least one BigInteger\");\n }\n\n int[] bigIntLengths = new int[a.length];\n byte[][] bigInts = new byte[a.length][];\n int len = 0; // length of the array of numbers\n for(int i = 0; i < a.length; i++) {\n // first INT_LENGTH_IN_BYTES bytes = number length\n bigInts[i] = a[i].toByteArray();\n bigIntLengths[i] = bigInts[i].length;\n len += INT_LENGTH_IN_BYTES + bigIntLengths[i]; // INT_LENGTH_IN_BYTES to save the length of the number\n }\n\n if(len > Integer.MAX_VALUE) {\n // TODO: ....\n throw new OutOfMemoryError(\"Could not send the array of BigIntegers\");\n }\n byte[] res = new byte[INT_LENGTH_IN_BYTES + (int)len];\n System.arraycopy(intToByte(a.length), 0, res, 0, INT_LENGTH_IN_BYTES);\n for(int i = 0, offset = INT_LENGTH_IN_BYTES; i < a.length; i++) {\n // append BigInteger length\n System.arraycopy(intToByte(bigIntLengths[i]), 0, res, offset, INT_LENGTH_IN_BYTES);\n // append BigInteger\n System.arraycopy(bigInts[i], 0, res, offset + INT_LENGTH_IN_BYTES, bigIntLengths[i]);\n offset += bigIntLengths[i] + INT_LENGTH_IN_BYTES;\n }\n\n return res;\n }",
"public static byte[] getBytes(short value) {\r\n\t\treturn ByteBuffer.allocate(2).order(ByteOrder.LITTLE_ENDIAN).putShort(value).array();\r\n\t}",
"public ArrayBub(long[] a) {\n\t\tsuper();\n\t\tthis.a = a;\n\t}",
"private String m34494b(byte[] bArr) {\n return String.format(\"%032x\", new Object[]{new BigInteger(1, bArr)});\n }",
"private byte[] integerToOctetString(BigInteger r, BigInteger modulus) throws IOException {\n byte[] modulusBytes = modulus.toByteArray();\n int modulusLen = modulusBytes.length;\n byte[] rBytes = r.toByteArray();\n int rLen = rBytes.length;\n int rMSB = rBytes[0] & 0xFF;\n\n if (modulusBytes[0] == 0x00) {\n modulusLen -= 1;\n }\n\n // for arrays that are more than one byte longer\n if ((rLen == modulusLen + 1 && rMSB != 0x00) || rLen > modulusLen + 1) {\n throw new IOException(\"Integer value is larger than modulus\");\n }\n\n byte[] rUnsigned = new byte[modulusLen];\n System.arraycopy(rBytes, (rLen > modulusLen) ? (rLen - modulusLen) : 0, rUnsigned,\n (modulusLen > rLen) ? (modulusLen - rLen) : 0, (modulusLen > rLen) ? rLen : modulusLen);\n\n return rUnsigned;\n }",
"public long toLong() {\n return this.toLongArray()[0];\n }",
"public static byte[] toBytes(int val) {\n byte [] b = new byte[4];\n for(int i = 3; i > 0; i--) {\n b[i] = (byte) val;\n val >>>= 8;\n }\n b[0] = (byte) val;\n return b;\n }",
"private void formatUnsignedOctalString(final long value, byte[] buffer, final int offset, final int length) {\n int remaining = length;\n remaining--;\n if (value == 0) {\n buffer[offset + remaining--] = (byte) '0';\n } else {\n long val = value;\n for (; remaining >= 0 && val != 0; --remaining) {\n buffer[offset + remaining] = (byte) ((byte) '0' + (byte) (val & 7));\n val = val >>> 3;\n }\n if (val != 0) {\n throw new IllegalArgumentException(value + \"=\" + Long.toOctalString(value) + \" will not fit in octal number buffer of length \" + length);\n }\n }\n\n for (; remaining >= 0; --remaining) { // leading zeros\n buffer[offset + remaining] = (byte) '0';\n }\n }",
"public static byte[] convertDoubleToByteArray(double toConvert) {\n return ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putDouble(toConvert).array();\n }"
] | [
"0.7374723",
"0.7259702",
"0.72002375",
"0.717501",
"0.715309",
"0.7136059",
"0.698312",
"0.69594276",
"0.6917769",
"0.6670402",
"0.66443074",
"0.659353",
"0.650873",
"0.6469305",
"0.6462546",
"0.6326285",
"0.6092378",
"0.606558",
"0.6032709",
"0.59262866",
"0.59213406",
"0.5903456",
"0.57503283",
"0.57391596",
"0.5730272",
"0.5725503",
"0.5701548",
"0.56892145",
"0.5671715",
"0.5669886",
"0.56205153",
"0.5613481",
"0.5572274",
"0.5498229",
"0.5469337",
"0.5465135",
"0.5453819",
"0.544576",
"0.54375356",
"0.5403125",
"0.53999597",
"0.5398052",
"0.5313983",
"0.53108466",
"0.53021747",
"0.53007895",
"0.5282658",
"0.52757674",
"0.5269943",
"0.5247721",
"0.52454096",
"0.5241244",
"0.5239932",
"0.5214225",
"0.52102554",
"0.5180088",
"0.5173109",
"0.51728725",
"0.51595217",
"0.51589763",
"0.5156604",
"0.5150005",
"0.51339895",
"0.5128137",
"0.51176536",
"0.5112268",
"0.5111978",
"0.51081014",
"0.51081014",
"0.5106269",
"0.5104766",
"0.5103088",
"0.51015055",
"0.51000917",
"0.50869274",
"0.5086798",
"0.507905",
"0.50751776",
"0.50605494",
"0.5057822",
"0.50577414",
"0.50577414",
"0.5053052",
"0.50509906",
"0.50417006",
"0.50235766",
"0.5019642",
"0.5012304",
"0.50011915",
"0.49984458",
"0.49906987",
"0.49850297",
"0.49795002",
"0.4976177",
"0.4971371",
"0.49670193",
"0.49553",
"0.49456728",
"0.49408397",
"0.4936954"
] | 0.6988447 | 6 |
ASN1 BYTE ARRAY TO VALUE INFO: for asn1 byte array to oid string please look at ObjectIdentifier class INFO: for asn1 byte array to String please use the Java String xyz = new String(bytearray) method Converts an asn1 encoded value part of a TLV back to an integer, if possible. This is done via the java BigInteger class, through a temporary BigInteger object which is constructed from the content of the input array. | public static int asn1Value_ByteArrayToInteger(byte[] asn1IntValue) throws ValueNullException, ValueTooBigException {
//check if the array is null
if(asn1IntValue == null) {
throw new ValueNullException("The input is null, not an encoded integer");
}
//check if the value 0 has been encoded
if((asn1IntValue[0] == 0) && (asn1IntValue.length == 1) ) {
return 0;
}
//check if the value is too long to be converted to an integer
if((asn1IntValue.length>4)) {
throw new ValueTooBigException("Java integer can only hold 32 bits or 4 octets. The passed value is bigger than that");
}
BigInteger tmpInt = new BigInteger(asn1IntValue);
return tmpInt.intValue();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static byte[] integerToByteArray_ASN1_Value(int toBeConverted) {\n\t\t\n\t\t//create the temporary version of what will be returned\n\t\tbyte[] tempToBeReturned = {\n\t (byte)(toBeConverted >> 24),\n\t (byte)(toBeConverted >> 16),\n\t (byte)(toBeConverted >> 8),\n\t (byte)toBeConverted};\n\t\t\n\t\t\n\t\t//converting positive integers\n\t\tif(toBeConverted >= 0) {\n\t\t\t//0 to 127: return only one octet\n\t\t\tif(toBeConverted<=127) {\n\t\t\t\tbyte[] toBeReturned = new byte[1];\n\t\t\t\ttoBeReturned[0] = tempToBeReturned[3];\t\t\t\t\n\t\t\t\treturn toBeReturned;\n\t\t\t}\n\t\t\t\n\t\t\t//128 to 32768-1 return two octets\n\t\t\telse if(toBeConverted<=32767) {\n\t\t\t\tbyte[] toBeReturned = new byte[2];\n\t\t\t\ttoBeReturned[0] = tempToBeReturned[2];\t\t\t\t\n\t\t\t\ttoBeReturned[1] = tempToBeReturned[3];\n\t\t\t\treturn toBeReturned;\n\t\t\t}\n\t\t\t\n\t\t\t//32767 to 8388607 return three octets\n\t\t\telse if(toBeConverted<=8388607) {\n\t\t\t\tbyte[] toBeReturned = new byte[3];\n\t\t\t\ttoBeReturned[0] = tempToBeReturned[1];\t\t\t\t\n\t\t\t\ttoBeReturned[1] = tempToBeReturned[2];\n\t\t\t\ttoBeReturned[2] = tempToBeReturned[3];\n\t\t\t\treturn toBeReturned;\n\t\t\t}\n\t\t\t\n\t\t\t//above that: return four octets\n\t\t\telse {\n\t\t\t\treturn tempToBeReturned;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//converting negative integers\n\t\telse if(toBeConverted<0) {\n\t\t\t//-1 to -128: return one octet\n\t\t\tif(toBeConverted>=-128) {\n\t\t\t\tbyte[] toBeReturned = new byte[1];\n\t\t\t\ttoBeReturned[0] = tempToBeReturned[3];\t\t\t\t\n\t\t\t\treturn toBeReturned;\n\t\t\t}\n\t\t\t\n\t\t\t//-129 to -32768 return two octets\n\t\t\telse if(toBeConverted>=-32768) {\n\t\t\t\tbyte[] toBeReturned = new byte[2];\n\t\t\t\ttoBeReturned[0] = tempToBeReturned[2];\t\t\t\t\n\t\t\t\ttoBeReturned[1] = tempToBeReturned[3];\n\t\t\t\treturn toBeReturned;\n\t\t\t}\n\t\t\t\n\t\t\t//-32769 to -8388608 return three octets\n\t\t\telse if(toBeConverted>=-8388608) {\n\t\t\t\tbyte[] toBeReturned = new byte[3];\n\t\t\t\ttoBeReturned[0] = tempToBeReturned[1];\t\t\t\t\n\t\t\t\ttoBeReturned[1] = tempToBeReturned[2];\n\t\t\t\ttoBeReturned[2] = tempToBeReturned[3];\n\t\t\t\treturn toBeReturned;\n\t\t\t}\n\t\t\t\n\t\t\t//above that: return four octets\n\t\t\telse {\n\t\t\t\treturn tempToBeReturned;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t//if method fails for any reason, it returns null\n\t\treturn null;\n\t}",
"@Test\n public void testByteArray2Integer() {\n System.out.println(\"byteArray2Integer\");\n SntParser instance = new SntParser();\n byte[] array = {0x20, 0x00, 0x30, 0x34};\n int start = 0;\n int length = 3;\n int expResult = 0x200030;\n int result = byteArray2Integer(array, start, length);\n assertEquals(expResult, result);\n }",
"public static long asn1Value_ByteArrayToLong(byte[] asn1LongValue) throws ValueNullException, ValueTooBigException {\n\t\t//check if the array is null\n\t\tif(asn1LongValue == null) {\n\t\t\tthrow new ValueNullException(\"The input is null, not an encoded long\");\n\t\t}\n\t\t//check if the value 0 has been encoded\n\t\tif((asn1LongValue[0] == 0) && (asn1LongValue.length == 1) ) {\n\t\t\treturn 0L;\n\t\t}\n\t\t//check if the value is too long to be converted to a long\n\t\tif((asn1LongValue.length>8)) {\n\t\t\tthrow new ValueTooBigException(\"Java long can only hold 64 bits or 8 octets. The passed value is bigger than that\");\n\t\t}\n\t\t\n\t\tBigInteger tmpLong = new BigInteger(asn1LongValue);\n\t\treturn tmpLong.longValue();\n\t}",
"@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:13.509 -0500\", hash_original_method = \"F3F9FDCE1484676B88E382A49EC8877F\", hash_generated_method = \"E98CBD85708A9D853A0E84BBC5FA6CF1\")\n \npublic static ASN1Object fromByteArray(byte[] data)\n throws IOException\n {\n ASN1InputStream aIn = new ASN1InputStream(data);\n\n try\n {\n return (ASN1Object)aIn.readObject();\n }\n catch (ClassCastException e)\n {\n throw new IOException(\"cannot recognise object in stream\"); \n }\n }",
"public static byte[] longToByteArray_ASN1_Value(long toBeConverted) {\n\t\t\t\n\t\t\t//create the temporary version of what will be returned\n\t\t\tbyte[] tempToBeReturned = {\n\t\t\t\t\t(byte)(toBeConverted >> 56),\n\t\t\t\t\t(byte)(toBeConverted >> 48),\n\t\t\t\t\t(byte)(toBeConverted >> 40),\n\t\t\t\t\t(byte)(toBeConverted >> 32),\n\t\t\t\t\t(byte)(toBeConverted >> 24),\n\t\t\t\t\t(byte)(toBeConverted >> 16),\n\t\t\t\t\t(byte)(toBeConverted >> 8),\n\t\t\t\t\t(byte)toBeConverted};\n\t\t\t\n\t\t\t\n\t\t\t//converting positive long values\n\t\t\tif(toBeConverted >= 0) {\n\t\t\t\t//0 to 127: return only one octet\n\t\t\t\tif(toBeConverted<=127) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[1];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[7];\t\t\t\t\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//128 to 32768-1 return two octets\n\t\t\t\telse if(toBeConverted<=32767) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[2];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[6];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//32767 to 8388607 return three octets\n\t\t\t\telse if(toBeConverted<=8388607) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[3];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[5];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//8388608 to 2147483647 return four octets\n\t\t\t\telse if(toBeConverted<=2147483647) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[4];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[4];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//the value 0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y\n\t\t\t\t//2147483648 to 549755813887 return five octets\n\t\t\t\telse if((Long.compare(toBeConverted, 549755813888L))<0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[5];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[3];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//549755813888 to 140737488355327 return six octets\n\t\t\t\telse if((Long.compare(toBeConverted, 140737488355328L))<0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[6];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[2];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[3];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[5] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//140737488355328 to 36028797018963967 return seven octets\n\t\t\t\telse if((Long.compare(toBeConverted, 36028797018963967L))<0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[7];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[1];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[2];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[3];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[5] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[6] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//above: return eight octets\n\t\t\t\telse {\n\t\t\t\t\treturn tempToBeReturned;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//converting negative long values\n\t\t\telse if(toBeConverted<0) {\n\t\t\t\t//-1 to -128 1 octet \n\t\t\t\tif(toBeConverted>=-128) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[1];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[7];\t\t\t\t\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-129 to -32768 2 octets\n\t\t\t\telse if(toBeConverted>=-32768) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[2];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[6];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-32769 to -8388608 3 octets\n\t\t\t\telse if(toBeConverted>=-8388608) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[3];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[5];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//-8388609 to -2147483648 4 octets\n\t\t\t\telse if(toBeConverted>=-2147483648) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[4];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[4];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//the value 0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y\n\t\t\t\t//-2147483649 to -549755813888 5 octets \n\t\t\t\telse if((Long.compare(toBeConverted, -549755813889L))>0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[5];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[3];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-549755813889 to -140737488355328 6 octets\n\t\t\t\telse if((Long.compare(toBeConverted, -140737488355329L))>0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[6];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[2];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[3];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[5] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-140737488355329 to 36028797018963968 7 octets\n\t\t\t\telse if((Long.compare(toBeConverted, -36028797018963969L))>0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[7];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[1];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[2];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[3];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[5] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[6] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//below that: 8 octets\n\t\t\t\telse {\n\t\t\t\t\treturn tempToBeReturned;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//if method fails for any reason, it returns null\n\t\t\treturn null;\n\t\t}",
"public static BigInteger toBI(byte[] byteArray) {\n // The \"1\" sets unsigned bit. \n return (new BigInteger(1, byteArray));\n }",
"Asn1Object(int tag, int length, byte[] value) {\n\t\t\tthis.tag = tag;\n\t\t\tthis.type = tag & 0x1F;\n\t\t\tthis.length = length;\n\t\t\tthis.value = value;\n\t\t}",
"BigInteger decodeBigInteger();",
"public Asn1Object( int tag, int length, byte[] value ) {\n this.tag = tag;\n this.type = tag & 0x1F;\n this.length = length;\n this.value = value;\n }",
"public static int OpaqueToType(byte[] b) { \n int type = b[8];\n return type; \n }",
"public static BigInteger[] byteToArrayBigInteger(byte[] a) {\n byte lenByte[] = new byte[INT_LENGTH_IN_BYTES];\n System.arraycopy(a, 0, lenByte, 0, INT_LENGTH_IN_BYTES);\n int len = byteToInt(lenByte);\n BigInteger[] res = new BigInteger[len];\n int offset = INT_LENGTH_IN_BYTES;\n\n for(int i = 0; i < len; i++) {\n byte[] lenBigIntegerByte = new byte[INT_LENGTH_IN_BYTES];\n System.arraycopy(a, offset, lenBigIntegerByte, 0, INT_LENGTH_IN_BYTES);\n int lenBigInteger = byteToInt(lenBigIntegerByte);\n byte[] bigInteger = new byte[lenBigInteger];\n System.arraycopy(a, offset+INT_LENGTH_IN_BYTES, bigInteger, 0, lenBigInteger);\n\n res[i] = new BigInteger(bigInteger);\n\n offset += INT_LENGTH_IN_BYTES + lenBigInteger;\n }\n\n return res;\n }",
"com.google.protobuf.ByteString\n getField1321Bytes();",
"private byte[] integerToOctetString(BigInteger r, BigInteger modulus) throws IOException {\n byte[] modulusBytes = modulus.toByteArray();\n int modulusLen = modulusBytes.length;\n byte[] rBytes = r.toByteArray();\n int rLen = rBytes.length;\n int rMSB = rBytes[0] & 0xFF;\n\n if (modulusBytes[0] == 0x00) {\n modulusLen -= 1;\n }\n\n // for arrays that are more than one byte longer\n if ((rLen == modulusLen + 1 && rMSB != 0x00) || rLen > modulusLen + 1) {\n throw new IOException(\"Integer value is larger than modulus\");\n }\n\n byte[] rUnsigned = new byte[modulusLen];\n System.arraycopy(rBytes, (rLen > modulusLen) ? (rLen - modulusLen) : 0, rUnsigned,\n (modulusLen > rLen) ? (modulusLen - rLen) : 0, (modulusLen > rLen) ? rLen : modulusLen);\n\n return rUnsigned;\n }",
"public ArrayValue( Object array )\n\t{\n\t\tthis( array, (byte) 0, null, 0 );\n\t}",
"public interface ASN1TaggedObjectParser\n extends ASN1Encodable, InMemoryRepresentable\n{\n /**\n * Return the tag class associated with this object.\n *\n * @return the tag class.\n */\n int getTagClass();\n\n /**\n * Return the tag number associated with this object.\n *\n * @return the tag number.\n */\n int getTagNo();\n\n boolean hasContextTag(int tagNo);\n\n boolean hasTag(int tagClass, int tagNo);\n\n /**\n * \n * Return a parser for the actual object tagged.\n *\n * @param tag the primitive tag value for the object tagged originally.\n * @param isExplicit true if the tagging was done explicitly.\n * @return a parser for the tagged object.\n * @throws IOException if a parser cannot be constructed.\n * \n * @deprecated This parser now includes the {@link #getTagClass() tag class}.\n * This method will raise an exception if it is not\n * {@link BERTags#CONTEXT_SPECIFIC}. Use\n * {@link ASN1Util#parseContextBaseUniversal(ASN1TaggedObjectParser, int, int, boolean, int)}\n * as a direct replacement, or use\n * {@link #parseBaseUniversal(boolean, int)} only after confirming\n * the expected tag class (e.g.\n * {@link ASN1Util#tryParseContextBaseUniversal(ASN1TaggedObjectParser, int, boolean, int)}.\n */\n ASN1Encodable getObjectParser(int tag, boolean isExplicit)\n throws IOException;\n\n// ASN1Encodable parseBaseObject(boolean declaredExplicit, int baseTagClass, int baseTagNo,\n// boolean baseDeclaredExplicit) throws IOException;\n\n ASN1Encodable parseBaseUniversal(boolean declaredExplicit, int baseTagNo) throws IOException;\n}",
"public /*byte[]*/String BinaryCaster(Object item){\n String Sitem = Integer.toBinaryString((int)item);\n //byte[] b = new byte[Sitem.length()];\n //for(int i=0;i<Sitem.length();i++){\n // b[i] = (byte)Sitem.charAt(i);\n //}\n //return b;\n return Sitem;\n }",
"com.google.protobuf.ByteString\n getNum1Bytes();",
"private static Object extractIdValue(BsonObjectId value, Class<?> valueType) {\n if (String.class.equals(valueType)) {\n return value.asObjectId().getValue().toHexString();\n } else if (ObjectId.class.equals(valueType)) {\n return value.asObjectId().getValue();\n } else if (byte[].class.equals(valueType)) {\n return value.asObjectId().getValue().toByteArray();\n } else if (Byte[].class.equals(valueType)) {\n final byte[] inputArray = value.asObjectId().getValue().toByteArray();\n Byte[] outputArray = new Byte[inputArray.length];\n for (int i = 0; i < inputArray.length; i++) {\n outputArray[i] = inputArray[i];\n }\n return outputArray;\n }\n throw new IllegalArgumentException(\"Unsupported ID type: \" + value.getClass());\n }",
"@Override\n\tpublic ASN1Primitive toASN1Primitive() {\n\t\tASN1Encodable[] asn1EncodableArr = new ASN1Encodable[3];\n\t\tasn1EncodableArr[0] = asn1EncodableArr[1] = asn1EncodableArr[2] = null;\n\t\tif(majorVersion != null) {\n\t\t\tasn1EncodableArr[0] = new ASN1Integer(majorVersion.longValue());\n\t\t}\n\t\tif(minorVersion != null) {\n\t\t\tasn1EncodableArr[1] = new ASN1Integer(minorVersion.longValue());\n\t\t}\n\t\tif(revision != null) {\n\t\t\tasn1EncodableArr[2] = new ASN1Integer(revision.longValue());\n\t\t}\n\t\tDLSequence dlSequence = new DLSequence(asn1EncodableArr);\n\t\tasn1EncodableArr = new ASN1Encodable[2];\n\t\tasn1EncodableArr[0] = dlSequence;\n\t\tif(platformClass != null) {\n\t\t\t// remove 0x from start of hex string of it is there\n\t\t\tString platClass = platformClass.replaceFirst(\"0[xX]\", \"\"); \n\t\t\tbyte[] sigbytes = new BigInteger(platClass, 16).toByteArray();\n\t\t\tint numsigbytes = sigbytes.length;\n\t\t\tbyte[] bytes;\n\t\t\tif(numsigbytes >= 4)\n\t\t\t{\n\t\t\t\tbytes = sigbytes;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbytes = new byte[4];\n\t\t\t\tint sigb_idx = numsigbytes-1;\n\t\t\t\tfor(int i=3; i >=0; i--)\n\t\t\t\t{\n\t\t\t\t\tif(sigb_idx >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tbytes[i] = sigbytes[sigb_idx--];\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tbytes[i] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\tasn1EncodableArr[1] = new DEROctetString(bytes);\n\t\t}\n\t\telse {\n\t\t\tasn1EncodableArr[1] = null;\n\t\t}\n\t\tDLSequence asn1_platformSpec = new DLSequence(asn1EncodableArr);\n\n\t\treturn asn1_platformSpec;\n\t}",
"private static String toHex(byte[] array)\n\t {\n\t BigInteger bi = new BigInteger(1, array);\n\t String hex = bi.toString(16);\n\t int paddingLength = (array.length * 2) - hex.length();\n\t if(paddingLength > 0)\n\t return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n\t else\n\t return hex;\n\t }",
"java.math.BigInteger getNcbi8Aa();",
"private String toHex(byte[] array)\n {\n BigInteger bi = new BigInteger(1, array);\n String hex = bi.toString(16);\n int paddingLength = (array.length * 2) - hex.length();\n if(paddingLength > 0) \n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n else\n return hex;\n }",
"com.google.protobuf.ByteString\n getField1121Bytes();",
"public com.android.org.bouncycastle.asn1.ASN1Primitive toASN1Primitive() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.toASN1Primitive():com.android.org.bouncycastle.asn1.ASN1Primitive, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.toASN1Primitive():com.android.org.bouncycastle.asn1.ASN1Primitive\");\n }",
"public static String toIso88591String(final int[] array) {\n byte[] byteArray = new byte[array.length];\n for (int pos = 0; pos < byteArray.length; pos++) {\n byteArray[pos] = toSignedByte(array[pos]);\n }\n return new String(byteArray, Charset.forName(\"ISO-8859-1\"));\n }",
"@DSSafe(DSCat.SAFE_OTHERS)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:53.096 -0500\", hash_original_method = \"AD601F3532730C1588B10C0B2F4700C0\", hash_generated_method = \"7CF3579665197E3D9616E88D35150E2D\")\n \npublic ASN1BitString() {\n super(TAG_BITSTRING);\n }",
"public native byte[] __byteArrayMethod( long __swiftObject, byte[] arg );",
"static int fromArray(byte[] payload) {\n return payload[0] << 24 | (payload[1] & 0xFF) << 16 | (payload[2] & 0xFF) << 8 | (payload[3] & 0xFF);\n }",
"public static String m3123b(byte[] bArr) {\n if (bArr == null) {\n return null;\n }\n BigInteger bigInteger = new BigInteger(1, bArr);\n return String.format(Locale.US, \"%0\" + (bArr.length << 1) + \"x\", new Object[]{bigInteger});\n }",
"BigInteger getInteger() {\n\n\t\t\tif (this.type != DerParser.INTEGER) {\n\t\t\t\tthrow new IllegalStateException(String.format(\"Invalid DER: object (%d) is not integer.\", this.type));\n\t\t\t}\n\n\t\t\treturn new BigInteger(this.value);\n\t\t}",
"public Variable castOidType(OIDType type, String value) {\n Variable oidValue = null;\n switch (type) {\n case INTEGER32:\n oidValue = new Integer32(Integer.parseInt(value));\n break;\n case UNSIGNED32:\n oidValue = new UnsignedInteger32(Integer.parseInt(value));\n break;\n case COUNTER32:\n oidValue = new Counter32(Long.parseLong(value));\n break;\n case GAUGE32:\n oidValue = new Gauge32(Long.parseLong(value));\n break;\n case OCTETSTRING:\n oidValue = new OctetString(value);\n break;\n case BITSTRING:\n int val = Integer.parseInt(value);\n int arrayIndex = val / 8;\n byte[] buf = new byte[] { 0x00, 0x00, 0x00, 0x00 };\n buf[arrayIndex] |= 1 << (8 - (val % 8));\n OctetString oct = new OctetString();\n oct.append(buf);\n oidValue = new OctetString(oct);\n break;\n default:\n break;\n }\n return oidValue;\n }",
"public SignerInfo toASN1Structure()\n {\n return info;\n }",
"private static Object valueFromBytes(ByteBuffer bytes) throws JSONException{\n\t\tbyte type = bytes.get();\n\t\t//System.out.println(\"From value: \" + new Integer(type).toString());\n\t\tswitch(type){\n\t\tcase MAP_INDICATOR:\n\t\t\t//System.out.println(\"MAP!\");\n\t\t\treturn mapFromBytes(bytes);\n\t\tcase ARRAY_INDICATOR:\n\t\t\treturn arrayFromBytes(bytes);\n\t\tcase STRING_INDICATOR:\n\t\t\t//System.out.println(\"STRING!\");\n\t\t\tint length = bytes.getInt();\n\t\t\tbyte[] stringBytes = new byte[length];\n\t\t\tbytes.get(stringBytes, 0, length);\n\t\t\treturn new String(stringBytes);\n\t\tcase INTEGER_INDICATOR:\n\t\t\treturn bytes.getInt();\n\t\tcase LONG_INDICATOR:\n\t\t\treturn bytes.getLong();\n\t\tcase DOUBLE_INDICATOR:\n\t\t\treturn bytes.getDouble();\n\t\tcase FLOAT_INDICATOR:\n\t\t\treturn bytes.getFloat();\n\t\tcase BOOLEAN_INDICATOR:\n\t\t\treturn bytes.get() == 1 ? 1: 0;\n\t\tdefault:\n\t\t\tthrow new JSONException(\"Tried to decode unknown type from byte array!\");\n\t\t}\n\t\t\n\t\t\t\n\t\t\t\n\t}",
"@DSSource({DSSourceKind.SENSITIVE_UNCATEGORIZED})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:53.099 -0500\", hash_original_method = \"66B1F67B2E4924691687068C01957881\", hash_generated_method = \"09FC42AAA2010F0F571B2693B7BFC711\")\n \npublic static ASN1BitString getInstance() {\n return ASN1;\n }",
"public E decode(ArrayList<Integer> individual);",
"private void createValue()\n\t{\n\t\ttry\n\t\t{\n\t\t\tm_usage = ((DERBitString)new ASN1InputStream(\n\t\t\t\t\t new ByteArrayInputStream(getDEROctets())).readObject()).intValue();\n\t\t} catch (Exception a_e)\n\t\t{\n\t\t\tthrow new RuntimeException(\"Could not read key usage from byte array!\");\n\t\t}\n\t}",
"private static String toHex(byte[] array) {\r\n\t\tBigInteger bi = new BigInteger(1, array);\r\n\t\tString hex = bi.toString(16);\r\n\t\tint paddingLength = (array.length * 2) - hex.length();\r\n\t\tif (paddingLength > 0)\r\n\t\t\treturn String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\r\n\t\telse\r\n\t\t\treturn hex;\r\n\t}",
"public DERObject toASN1Object() {\n\t\treturn new DEROctetString(p.getEncoded());\n\t}",
"private static int getValue(final byte [] byteArray) { \n int value = 0; \n final int byteArrayLength = byteArray.length; \n \n for (int i = 0; i < byteArrayLength; i++) { \n final int shift = (byteArrayLength - 1 - i) * 8; \n value += (byteArray[i] & 0x000000FF) << shift; \n } \n \n return value; \n }",
"public java.math.BigInteger[] decode(byte[] r1) throws java.io.IOException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.StdDSAEncoder.decode(byte[]):java.math.BigInteger[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.StdDSAEncoder.decode(byte[]):java.math.BigInteger[]\");\n }",
"private String BtaOneConversion() {\n int reading = (raw[25] & 0xFF) + ((raw[26] & 0x03) << 8);\n\n Map<String, BigDecimal> variables = new HashMap<String, BigDecimal>();\n variables.put(\"x\", new BigDecimal(reading));\n BigDecimal result = b1Conv.eval(variables);\n return result.setScale(3, RoundingMode.UP) + \"\";\n }",
"public int getInt1() {\n\t\tfinal byte b1 = payload.get();\n\t\tfinal byte b2 = payload.get();\n\t\tfinal byte b3 = payload.get();\n\t\tfinal byte b4 = payload.get();\n\t\treturn b3 << 24 & 0xFF | b4 << 16 & 0xFF | b1 << 8 & 0xFF | b2 & 0xFF;\n\t}",
"private void icombo(Tlv tlv, int b, String a){ \n //uint16 value\n uint16(tlv, b);\n //then sstring (keywords)\n sstring(tlv, a); \n }",
"public static void main(String args[]) throws IOException {\n\t\t\n\t\tString v=\"1001100000010001\";\n\t\t\t\n\t\tString value=Base64.encodeBase64String(v.getBytes());\n\t\tSystem.out.println(\"hiiiiii===\"+value);\n\t\t\n\t\tString v1=v.substring(0,3);\n\t\tSystem.out.println(\"hiiiiii\"+value);\n\n //System.out.println(\"hiiiiii\"+da);\n //encoding byte array into base 64\n //byte[] encoded = Base64.encodeBase64(orig.getBytes()); \n //byte[] data = SerializationUtils.serialize(yourObject);\n //System.out.println(\"Original String: \" + orig );\n // System.out.println(\"Base64 Encoded String : \" + new String(encoded));\n \n //decoding byte array into base64\n //byte[] decoded = Base64.decodeBase64(encoded);\n\t\ttry{\n byte[] decoded=Base64.decodeBase64(\"AAUMBAAAAP8AAAEAAAABAQAAAQIAAAEDAAABBAAAAQUAAAEGAAABBwAAAQgAAAEJAAABCg==\");\n //System.out.println(\"decoded val : \" +decoded[0]);\n \n //System.out.println(\"Base 64 Decoded String : \" + new String(decoded));\n for(Byte b: decoded){\n \tSystem.out.println(\"decoded val : \" + b);\n }\n // byte[] bb=new byte[decoded.length];\n \tif(decoded!=null && decoded.length>0){\n \t\t//System.out.println(\"decoded val 2: \" +String.valueOf(decoded[3]));\n \t\t//System.arraycopy(decoded, 10, bb, 4 , 4);\n \t\t//System.out.println(\"decoded val 2: \" +String.valueOf(decoded[3]));\n \t\t\n \t\t//String hex = \"ff\"\n \t\t//int value = Integer.parseInt(hex, 16);\n \t\t\n \t\t//String hex = hexToString(decoded[10]);\n \t\t //BigInteger bi = new BigInteger(hex, 16);\n \t\t//bi.intValue();\n \t\t//(String.format(\"%.7f\", f));\n \t\t\n \t\t//String hex = Integer.toHexString(decoded[10]);\n \t\t// Integer.parseInt(hex);\n \t\t\n \t\t//System.out.println(\"Lora \" +hex);\n \t\tint n=0;\n \t\ttry{\n \t\t\t//n=Byte.valueOf(hex);\n \t\t\t//System.out.println(\"Loraa \" +n);\n \t\t}catch(Exception e){\n \t\t\te.printStackTrace();\n \t\t}\n \t\tSystem.out.println(\"Lora1 \" +n);\n \t\t\n \t\tSystem.out.println(\"decoded 10 \" +decoded[10]);\n \t\tSystem.out.println(\"decoded 11 \" +decoded[11]);\n \t\tSystem.out.println(\"decoded 12 \" +decoded[12]);\t\n \t\tSystem.out.println(\"decoded 13 \" +decoded[13]);\n \t\t\n \t\t/*ByteBuffer bb = ByteBuffer.wrap(d);\n bb.order(ByteOrder.LITTLE_ENDIAN);\n System.out.println( bb.getInt());*/\n \t\t\n\t\t //int b=(int) Integer.toUnsignedLong((int)decoded[10]);\n\t\t// String b=String.format(\"%x\", decoded[10]);\n\t\t //int p1=Integer.valueOf(b);\n\t\t //System.out.println(\"Pppppp \" +b);\n\t\t// n=Integer.parseInt(hex);\n\t\t//long h=(long) (decoded[10] & 0x00000000ffffffffL);\n\t\t// System.out.println(\"nnnn \" +Integer.toHexString(decoded[10]));\n\t\t// System.out.println(b);\n\t\t int w=112;\n\t\t// Integer.toBinaryString(w)\n\t\t System.out.println(\"dfdfdfdf\"+Integer.toBinaryString(w));\n\t\t \n\t\t String p=Integer.toBinaryString(w);\n\t\t System.out.println(\"hiiddddd\"+p);\n\t\t int p1=decoded[10] & 0xFF;\n \t\t//int c=decoded[11];\n\t\t int c=0x5f;\n \t\tSystem.out.println(\"p1\"+p1);\n \t\tSystem.out.println(c);\n \t\tint d=decoded[12];\n \t\tSystem.out.println(d);\n \t\tint e=decoded[13] & 0xFF ;\n \t\t int a= (p1 | (c << 8) | (d << 16) | (e << 24));\n \t\t\n \t\t\n \t\tSystem.out.println(a);\n \t\t\n \t}\n \t\n \t//System.out.println(\"bb : \" + bb[4]);\n \n //char character = '2'; \n // int ascii = (int) character;\n // String a= new String(decoded);\n //.out.println(String.format(\"0x%08X\", a));\n //String str=String.format(\"0x%08X\", a);\n //String str = String.format(\"0x\", args)\n //System.out.println(\"String : \" + str);\n /* \n \tSystem.out.println(\"Base 64 Decoded String : \" + Integer.toHexString(50));*/\n }catch(Exception e){\n \te.printStackTrace();\n }\n }",
"public static String bytesToSignedNumString(byte[] in) {\n BigInteger num = new BigInteger(in);\n return num.toString();\n }",
"private static String toHex(final byte[] array) {\n final BigInteger bi = new BigInteger(1, array);\n final String hex = bi.toString(16);\n final int paddingLength = (array.length * 2) - hex.length();\n if (paddingLength > 0) {\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n } else {\n return hex;\n }\n }",
"private static String toHex(byte[] array) {\r\n BigInteger bi = new BigInteger(1, array);\r\n String hex = bi.toString(16);\r\n int paddingLength = (array.length * 2) - hex.length();\r\n if (paddingLength > 0) {\r\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\r\n } else {\r\n return hex;\r\n }\r\n }",
"long extractI2b2QueryId(byte[] bytes);",
"public BigInteger toBigInteger() {\n return new BigInteger(1, bytes);\n }",
"IntegerValue getValueObject();",
"public native static long getConvertBytes();",
"void decodeObjectArray();",
"public java.lang.String getField1121() {\n java.lang.Object ref = field1121_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n field1121_ = s;\n return s;\n }\n }",
"public java.lang.String getField1321() {\n java.lang.Object ref = field1321_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n field1321_ = s;\n return s;\n }\n }",
"private String arrayToString(TOP fsIn, int arrayType) throws SAXException {\n if (fsIn == null) {\n return null;\n }\n\n StringBuilder buf = new StringBuilder();\n CommonArrayFS fs = (CommonArrayFS) fsIn;\n String elemStr = null;\n\n // FS arrays: handle shared data items\n if (fs instanceof FSArray) {\n List<XmiArrayElement> ootsArrayElementsList = cds.sharedData == null ? null\n : cds.sharedData.getOutOfTypeSystemArrayElements((FSArray) fs);\n int ootsIndex = 0;\n\n int j = -1;\n for (TOP elemFS : ((FSArray) fs)._getTheArray()) {\n j++;\n if (elemFS == null) { // null case\n // special NULL object with xmi:id=0 is used to represent\n // a null in an FSArray\n elemStr = \"0\";\n // However, this null array element might have been a reference to an\n // out-of-typesystem FS, so check the ootsArrayElementsList\n if (ootsArrayElementsList != null) {\n\n while (ootsIndex < ootsArrayElementsList.size()) {\n XmiArrayElement arel = ootsArrayElementsList.get(ootsIndex++);\n if (arel.index == j) {\n elemStr = arel.xmiId;\n break;\n }\n }\n }\n\n } else { // not null\n String xmiId = cds.getXmiId(elemFS);\n if (cds.isFiltering) { // return as null any references to types not in target TS\n String typeName = elemFS._getTypeImpl().getName();\n if (cds.filterTypeSystem_inner.getType(typeName) == null) {\n xmiId = \"0\";\n }\n }\n elemStr = xmiId;\n }\n\n if (buf.length() > 0) {\n buf.append(' ');\n }\n buf.append(elemStr);\n } // end of loop over FS Array elements\n\n return buf.toString();\n\n } else if (fs instanceof ByteArray) {\n\n // special case for byte arrays: serialize as hex digits\n byte[] ba = ((ByteArray) fs)._getTheArray();\n\n char[] r = new char[ba.length * 2];\n\n int i = 0;\n for (byte b : ba) {\n r[i++] = INT_TO_HEX[(b & 0xF0) >>> 4];\n r[i++] = INT_TO_HEX[b & 0x0F];\n }\n return new String(r);\n } else {\n // is not FSarray, is not ByteArray, is not String Array\n // CommonArrayFS fs;\n // String[] fsvalues;\n //\n // switch (arrayType) {\n // case LowLevelCAS.TYPE_CLASS_INTARRAY:\n // fs = new IntArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_FLOATARRAY:\n // fs = new FloatArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_BOOLEANARRAY:\n // fs = new BooleanArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_SHORTARRAY:\n // fs = new ShortArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_LONGARRAY:\n // fs = new LongArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_DOUBLEARRAY:\n // fs = new DoubleArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_BYTEARRAY:\n // fs = new ByteArrayFSImpl(addr, cds.cas);\n // break;\n // default: {\n // return \"\";\n // }\n // }\n\n // if (arrayType == LowLevelCAS.TYPE_CLASS_STRINGARRAY) { // this method never called for\n // StringArrays\n // StringArrayFS strFS = new StringArrayFSImpl(addr, cds.cas);\n // fsvalues = strFS.toArray();\n // } else {\n String[] fsvalues = fs.toStringArray();\n // }\n\n for (String s : fsvalues) {\n if (buf.length() > 0) {\n buf.append(' ');\n }\n buf.append(s);\n }\n return buf.toString();\n }\n }",
"public static int byteArrayToInt(byte[] b) {\n\n\t\tint aux = 0;\n\t\tif ((b!=null) && (b.length !=0)) {\n\t\t\tif (b.length>2 ) {\n\t\t\t\tthrow new NumberFormatException(\"To Much Digits to convert (max 2): \"+b.length);\n\t\t\t} else if (b.length==2){\n\t\t\t\tshort aux1 = (short) (b[1] & 0xff);\n\t\t\t\tshort aux2 = (short) (b[0] & 0xff);\n\t\t\t\taux = (int) ((aux2 << 8) | aux1);\n\t\t\t} else if (b.length==1) {\n\t\t\t\tshort aux1 = (short) (b[0] & 0xff);\n\t\t\t\tshort aux2 = (short) (0x00 & 0xff);\n\t\t\t\taux = (int) ((aux2 << 8) | aux1);\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new NumberFormatException(\"No Bytes to convert.\");\n\t\t}\n\n\t\treturn aux;\n\t}",
"com.google.protobuf.ByteString\n getField1161Bytes();",
"public abstract void read_octet_array(byte[] value, int offset, int\nlength);",
"com.google.protobuf.ByteString\n getField1322Bytes();",
"private static String toHex(byte[] array) throws NoSuchAlgorithmException {\n\n BigInteger bi = new BigInteger(1, array);\n String hex = bi.toString(16);\n int paddingLength = (array.length * 2) - hex.length();\n if (paddingLength > 0) {\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n } else {\n return hex;\n }\n }",
"int decodeInt();",
"public static String byteArrayToBinaryString(byte[] array) {\n\t\tStringBuilder str = new StringBuilder();\n\t\tfor(byte b : array) {\n\t\t\tstr.append((\"00000000\"+Integer.toBinaryString(b)).substring(Integer.toBinaryString(b).length()));\n\t\t\tstr.append(\" \");\n\t\t}\n\t\treturn str.toString();\n\t}",
"private static final int decodeBEInt(byte[] paramArrayOfByte, int paramInt)\r\n/* 145: */ {\r\n/* 146:225 */ return (paramArrayOfByte[paramInt] & 0xFF) << 24 | (paramArrayOfByte[(paramInt + 1)] & 0xFF) << 16 | (paramArrayOfByte[(paramInt + 2)] & 0xFF) << 8 | paramArrayOfByte[(paramInt + 3)] & 0xFF;\r\n/* 147: */ }",
"Integer getDataStrt();",
"com.google.protobuf.ByteString\n getField1164Bytes();",
"public int[] utf8ToInt(byte[] bval) {\n return utf8ToInt(bval, bval.length);\n }",
"public abstract int parse(byte bc[], int index);",
"static String OIDtoString(byte[] buffer, int offset, int length) {\n StringBuffer result;\n int end;\n int t;\n int x;\n int y;\n\n if (length == 0) {\n return \"\";\n }\n\n result = new StringBuffer(40);\n\n end = offset + length;\n\n /*\n * first byte (t) always represents the first 2 values (x, y).\n * t = (x * 40) + y;\n */\n t = buffer[offset++] & 0xff;\n x = t / 40;\n y = t - (x * 40);\n\n result.append(x);\n result.append('.');\n result.append(y);\n\n x = 0;\n while (offset < end) {\n // 7 bit per byte, bit 8 = 0 means the end of a value\n x = x << 7;\n\n t = buffer[offset++];\n if (t >= 0) {\n x += t;\n result.append('.');\n result.append(x);\n x = 0;\n } else {\n x += t & 0x7f;\n }\n }\n\n return result.toString();\n }",
"public java.lang.String getField1121() {\n java.lang.Object ref = field1121_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n field1121_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"@Test\n public void encodeAsIntArray()\n {\n int value = 5;\n BinaryEncoder encoder = new BinaryEncoder(16);\n int[] result = encoder.encodeAsIntArray(value);\n if (IS_VERBOSE)\n {\n System.out.println(\"result = \" + Arrays.toString(result));\n }\n assertNotNull(result);\n assertEquals(4, result.length);\n assertEquals(0, result[0]);\n assertEquals(1, result[1]);\n assertEquals(0, result[2]);\n assertEquals(1, result[3]);\n\n value = 5;\n encoder = new BinaryEncoder(0, 16, 2);\n result = encoder.encodeAsIntArray(value);\n if (IS_VERBOSE)\n {\n System.out.println(\"result = \" + Arrays.toString(result));\n }\n assertNotNull(result);\n assertEquals(3, result.length);\n assertEquals(0, result[0]);\n assertEquals(1, result[1]);\n assertEquals(0, result[2]);\n\n value = 5;\n encoder = new BinaryEncoder(0, 8, 0.1);\n result = encoder.encodeAsIntArray(value);\n if (IS_VERBOSE)\n {\n System.out.println(\"result = \" + Arrays.toString(result));\n }\n assertNotNull(result);\n assertEquals(7, result.length);\n assertEquals(0, result[0]);\n assertEquals(1, result[1]);\n assertEquals(1, result[2]);\n assertEquals(0, result[3]);\n assertEquals(0, result[4]);\n assertEquals(1, result[5]);\n assertEquals(0, result[6]);\n }",
"String getIntegerEncoding();",
"public static long toInt64(byte[] value) {\r\n\t\treturn toInt16(value, 0);\r\n\t}",
"public int byteArrayToInt(byte[] byteArray) {\n\t\t// http://snippets.dzone.com/posts/show/93\n\t\treturn (byteArray[0] << 24) + ((byteArray[1] & 0xFF) << 16)\n\t\t\t\t+ ((byteArray[2] & 0xFF) << 8) + (byteArray[3] & 0xFF);\n\t}",
"private static int[] getArrayFromInteger(int i1) {\n\t\tString str = String.valueOf(i1);\r\n\t\tint length = str.length();\r\n\t\tint digits[] = new int[length];\r\n\t\tfor (int i = 0; i < length; i++) {\r\n\t\t\t// Converting char to int.\r\n\t\t\tdigits[i] = str.charAt(i) - 48;\r\n\t\t}\r\n\t\treturn digits;\r\n\t}",
"public int convertValues(int[] valueArray, int[][] matrixCID){\n\t\tint value = cidToLength(valueArray[0], matrixCID);\n\t\tfor(int i = 1; i < valueArray.length; i++){\n\t\t\tif(valueArray[i] != 0){\n\t\t\t\tvalue -= cidToLength(valueArray[i], matrixCID); //removes the CID lengths the code clone contains\n\t\t\t}\n\t\t}\n\t\treturn value;\n\t}",
"public static String bytesToPositiveNumString(byte[] in) {\n BigInteger num = new BigInteger(1, in);\n return num.toString();\n }",
"public java.lang.String getField1321() {\n java.lang.Object ref = field1321_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n field1321_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"org.apache.xmlbeans.XmlInteger xgetNcbi8Aa();",
"ASN1Encodable parseBaseUniversal(boolean declaredExplicit, int baseTagNo) throws IOException;",
"public static AsonValue CreateFrom(byte data[]) throws java.io.IOException {\n if((data[0]&0x80)!=0) return new AsonParser().parse(new ByteArrayInputStream(data));\n return new JsonParser().parse(new String(data,\"UTF-8\"));\n }",
"com.google.protobuf.ByteString\n getNum2Bytes();",
"@Override\n public int getValue(byte[] value, int offset) {\n return 0;\n }",
"protected static int[] convert(byte[] packet) {\n\t\tint[] p = new int[packet.length - 3];\n\t\t\n\t\t// would arrayscopy work here?\n\t\tfor(int i = 2; i < packet.length - 1; i++) {\n\t\t\tp[i - 2] = packet[i] & 0xFF;\n\t\t}\n\t\t\n\t\treturn p;\n\t}",
"@Test\n public void testDecodeETypeInfoEntry()\n {\n\n ByteBuffer stream = ByteBuffer.allocate( 0x0F );\n\n stream.put( new byte[]\n {\n 0x30, 0x0D,\n ( byte ) 0xA0, 0x03, // etype\n 0x02,\n 0x01,\n 0x05,\n ( byte ) 0xA1,\n 0x06, // salt\n 0x04,\n 0x04,\n 0x31,\n 0x32,\n 0x33,\n 0x34\n } );\n\n String decodedPdu = Strings.dumpBytes( stream.array() );\n stream.flip();\n\n ETypeInfoEntryContainer container = new ETypeInfoEntryContainer();\n\n try\n {\n Asn1Decoder.decode( stream, container );\n }\n catch ( DecoderException de )\n {\n de.printStackTrace();\n\n fail( de.getMessage() );\n }\n\n ETypeInfoEntry etypeInforEntry = container.getETypeInfoEntry();\n\n assertEquals( EncryptionType.DES3_CBC_MD5, etypeInforEntry.getEType() );\n assertTrue( Arrays.equals( Strings.getBytesUtf8( \"1234\" ), etypeInforEntry.getSalt() ) );\n\n ByteBuffer bb = ByteBuffer.allocate( etypeInforEntry.computeLength() );\n\n try\n {\n bb = etypeInforEntry.encode( bb );\n\n // Check the length\n assertEquals( 0x0F, bb.limit() );\n\n String encodedPdu = Strings.dumpBytes( bb.array() );\n\n assertEquals( encodedPdu, decodedPdu );\n }\n catch ( EncoderException ee )\n {\n fail();\n }\n }",
"public int encodeValue(BerCoder coder, EncoderOutput sink)\n\t throws EncoderException\n {\n\tint len0 = 0;\n\tRTCMPackage temp0 = this;\n\n\tif (temp0.msg1032 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1032.byteArrayValue()), 0x9F1F);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1032\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1031 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1031.byteArrayValue()), 0x9E);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1031\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1030 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1030.byteArrayValue()), 0x9D);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1030\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1029 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1029.byteArrayValue()), 0x9C);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1029\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1027 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1027.byteArrayValue()), 0x9B);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1027\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1026 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1026.byteArrayValue()), 0x9A);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1026\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1025 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1025.byteArrayValue()), 0x99);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1025\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1024 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1024.byteArrayValue()), 0x98);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1024\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1023 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1023.byteArrayValue()), 0x97);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1023\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1022 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1022.byteArrayValue()), 0x96);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1022\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1021 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1021.byteArrayValue()), 0x95);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1021\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1020 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1020.byteArrayValue()), 0x94);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1020\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1019 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1019.byteArrayValue()), 0x93);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1019\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1017 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1017.byteArrayValue()), 0x92);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1017\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1016 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1016.byteArrayValue()), 0x91);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1016\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1015 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1015.byteArrayValue()), 0x90);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1015\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1014 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1014.byteArrayValue()), 0x8F);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1014\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1013 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1013.byteArrayValue()), 0x8E);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1013\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1012 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1012.byteArrayValue()), 0x8D);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1012\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1011 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1011.byteArrayValue()), 0x8C);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1011\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1010 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1010.byteArrayValue()), 0x8B);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1010\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1009 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1009.byteArrayValue()), 0x8A);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1009\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1008 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1008.byteArrayValue()), 0x89);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1008\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1007 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1007.byteArrayValue()), 0x88);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1007\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1006 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1006.byteArrayValue()), 0x87);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1006\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1005 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1005.byteArrayValue()), 0x86);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1005\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1004 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1004.byteArrayValue()), 0x85);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1004\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1003 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1003.byteArrayValue()), 0x84);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1003\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1002 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1002.byteArrayValue()), 0x83);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1002\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1001 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1001.byteArrayValue()), 0x82);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1001\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\ttry {\n\t len0 += sink.encodeLengthTag(sink.write(temp0.rtcmHeader.byteArrayValue()), 0x81);\n\t} catch (Exception e) {\n\t EncoderException ee = EncoderException.wrapException(e);\n\t ee.appendFieldContext(\"rtcmHeader\", \"RTCMHeader\");\n\t throw ee;\n\t}\n\tif (temp0.anchorPoint != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(temp0.anchorPoint.encodeValue(coder, sink), 0xA0);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"anchorPoint\", \"FullPositionVector\");\n\t\tthrow ee;\n\t }\n\t}\n\n\treturn len0;\n }",
"@Override\n public int read(byte[] b) throws IOException {\n int len = ((int) Math.ceil((b.length-24) / 32.0))*4+24;\n byte[] comp = new byte[len];\n in.read(comp);\n in.close();\n\n //copy the first 24 cells to b\n for (int i=0; i<24; i++)\n {\n b[i] = comp[i];\n }\n\n //4 cells represents byte --> int --> binary\n byte[] temp = new byte[4];\n int resInt;\n String resStr;\n int dif = b.length-24;\n int index = 0;\n for (int i=24; i<comp.length; i=i+4)\n {\n //byte --> int\n temp[0] = comp[i];\n temp[1] = comp[i+1];\n temp[2] = comp[i+2];\n temp[3] = comp[i+3];\n ByteBuffer byteBuffer = ByteBuffer.wrap(temp);\n resInt = byteBuffer.getInt();\n //int --> binary (string)\n resStr = Integer.toBinaryString(resInt);\n //checks the length of the string\n if (dif >=32 ) {\n dif = dif - 32;\n if (resStr.length()<32)\n resStr = addZero (resStr, 32-resStr.length());\n }\n else\n {\n if (resStr.length()<dif)\n resStr = addZero (resStr, dif-resStr.length());\n }\n //more converts\n for (int j=0; j<resStr.length(); j++)\n {\n String tempStr = \"\"+resStr.charAt(j); //each char --> string\n int digit = Integer.parseInt(tempStr); //string (with one char) --> int\n b[index+24] = (byte) digit; //int --> byte\n index++;\n }\n }\n return 0;\n }",
"private String m34494b(byte[] bArr) {\n return String.format(\"%032x\", new Object[]{new BigInteger(1, bArr)});\n }",
"public BigInteger getInteger() throws IOException {\n if ( type != DerParser.INTEGER ) {\n throw new IOException(\n BaseMessages.getString( MQTTPublisherMeta.PKG, \"MQTTClientSSL.Error.InvalidDERObjectIsNotAnInteger\" ) );\n }\n\n return new BigInteger( value );\n }",
"public static SimpleMessageObject createMessageObject(byte[] data) {\n SimpleMessageObject retVal = new SimpleMessageObject();\n \n // data is of the form:\n // byte(data type)|int(length of name)|name|int(length of value)|value\n boolean keepGoing = true;\n int currentPointer = 0;\n while(keepGoing) {\n int type = data[currentPointer];\n int bytesToRead = 0;\n String name;\n currentPointer++;\n switch(type) {\n //String\n case 0x73:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n String stringValue = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addString(name, stringValue);\n break;\n \n //int\n case 0x69:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n int intValue = DataConversions.getInt(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addInt(name, intValue); \n break;\n \n //long\n case 0x6c:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n long longValue = DataConversions.getLong(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addLong(name, longValue);\n break;\n \n //double\n case 0x64:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n double doubleValue = DataConversions.getDouble(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addDouble(name, doubleValue); \n break;\n \n //float\n case 0x66:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n float floatValue = DataConversions.getFloat(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addFloat(name, floatValue); \n break;\n \n //char\n case 0x63:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n char charValue = DataConversions.getChar(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addChar(name, charValue);\n break;\n \n //byte array\n case 0x62:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n byte[] byteValue = DataConversions.getByteArray(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addByteArray(name, byteValue);\n break;\n }\n \n if(currentPointer == data.length) {\n keepGoing = false;\n }\n }\n \n return retVal;\n }",
"private static String m5291a(byte[] bArr) {\n StringBuffer stringBuffer = new StringBuffer();\n for (byte b : bArr) {\n String hexString = Integer.toHexString(b & 255);\n if (hexString.length() == 1) {\n stringBuffer.append('0');\n }\n stringBuffer.append(hexString);\n }\n return stringBuffer.toString();\n }",
"public static int[] byteArr2IntArr(byte[] b, int length, int bytesPerInt)\r\n\t\t\tthrows DataLenUnproperException {\r\n\t\tif (length % bytesPerInt != 0) {\r\n\t\t\tthrow new DataLenUnproperException();\r\n\t\t}\r\n\r\n\t\tint[] intArr = new int[length / bytesPerInt];\r\n\t\tint value = 0;\r\n\t\tfor (int i = 0, j = 0; i < length; i++) {\r\n\t\t\tvalue <<= 8; // 低地址byte在高位,大端格式\r\n\t\t\tvalue |= (b[i] & 0xff); // 运算时会对b[i]进行自动转型,导致b[i]的符号位扩展\r\n\r\n\t\t\tif (i % bytesPerInt == bytesPerInt - 1) {\r\n\t\t\t\t// System.out.println(\"bin:\" +\r\n\t\t\t\t// Integer.toBinaryString(Integer.MIN_VALUE >>\r\n\t\t\t\t// (4-bytesPerInt)*8));\r\n\t\t\t\t// System.out.println(\"bin:\" +\r\n\t\t\t\t// Integer.toBinaryString(Integer.MIN_VALUE)); //符号位为1,其余为0\r\n\t\t\t\t// System.out.println(\"0x80 & (1<<7): \" + (0x80 & (1<<7)));\r\n\t\t\t\t// //结果为0x80(128),不为1\r\n\t\t\t\tif ((b[i + 1 - bytesPerInt] & (1 << 7)) != 0) { // 是一个负数,当不足32位时进行符号扩展(不能利用等于1判断,只有1不移位时与的结果才为1)\r\n\t\t\t\t\tif ((bytesPerInt * 8) < 32) // 移位的次数为指定次数对32取模,因此若为32时,实际上不移位,不符合需要\r\n\t\t\t\t\t\tvalue |= Integer.MIN_VALUE >> (4 - bytesPerInt) * 8; // 将int剩余位进行符号扩展,\r\n\t\t\t\t}\r\n\t\t\t\tintArr[j++] = value;\r\n\t\t\t\tvalue = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn intArr;\r\n\r\n\t}",
"public com.google.protobuf.ByteString\n getField1321Bytes() {\n java.lang.Object ref = field1321_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n field1321_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public static ECKey fromASN1(byte[] asn1privkey) {\n return extractKeyFromASN1(asn1privkey);\n }",
"public static boolean isASN1_Integer(Object supposedInteger) {\n\t\t//null is no Integer\n\t\tif(supposedInteger == null) {\n\t\t\treturn false;\n\t\t}\n\t\t//Integer, Long, and BigInteger are considered Integers\n\t\tif(supposedInteger instanceof Integer) {\n\t\t\treturn true;\n\t\t}\n\t\telse if(supposedInteger instanceof Long) {\n\t\t\treturn true;\n\t\t}\n\t\telse if(supposedInteger instanceof BigInteger) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public static String toHex(byte[] array) {\n BigInteger bi = new BigInteger(1, array);\n String hex = bi.toString(16);\n int paddingLength = (array.length * 2) - hex.length();\n if (paddingLength > 0)\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n else\n return hex;\n }",
"public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }",
"public int encodeValue(DerCoder coder, EncoderOutput sink)\n\t throws EncoderException\n {\n\tint len0 = 0;\n\tRTCMPackage temp0 = this;\n\n\tif (temp0.msg1032 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1032.byteArrayValue()), 0x9F1F);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1032\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1031 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1031.byteArrayValue()), 0x9E);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1031\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1030 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1030.byteArrayValue()), 0x9D);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1030\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1029 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1029.byteArrayValue()), 0x9C);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1029\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1027 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1027.byteArrayValue()), 0x9B);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1027\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1026 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1026.byteArrayValue()), 0x9A);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1026\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1025 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1025.byteArrayValue()), 0x99);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1025\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1024 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1024.byteArrayValue()), 0x98);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1024\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1023 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1023.byteArrayValue()), 0x97);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1023\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1022 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1022.byteArrayValue()), 0x96);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1022\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1021 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1021.byteArrayValue()), 0x95);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1021\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1020 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1020.byteArrayValue()), 0x94);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1020\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1019 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1019.byteArrayValue()), 0x93);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1019\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1017 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1017.byteArrayValue()), 0x92);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1017\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1016 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1016.byteArrayValue()), 0x91);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1016\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1015 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1015.byteArrayValue()), 0x90);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1015\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1014 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1014.byteArrayValue()), 0x8F);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1014\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1013 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1013.byteArrayValue()), 0x8E);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1013\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1012 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1012.byteArrayValue()), 0x8D);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1012\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1011 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1011.byteArrayValue()), 0x8C);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1011\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1010 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1010.byteArrayValue()), 0x8B);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1010\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1009 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1009.byteArrayValue()), 0x8A);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1009\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1008 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1008.byteArrayValue()), 0x89);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1008\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1007 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1007.byteArrayValue()), 0x88);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1007\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1006 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1006.byteArrayValue()), 0x87);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1006\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1005 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1005.byteArrayValue()), 0x86);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1005\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1004 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1004.byteArrayValue()), 0x85);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1004\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1003 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1003.byteArrayValue()), 0x84);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1003\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1002 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1002.byteArrayValue()), 0x83);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1002\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\tif (temp0.msg1001 != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(sink.write(temp0.msg1001.byteArrayValue()), 0x82);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"msg1001\", \"OCTET STRING\");\n\t\tthrow ee;\n\t }\n\t}\n\ttry {\n\t len0 += sink.encodeLengthTag(sink.write(temp0.rtcmHeader.byteArrayValue()), 0x81);\n\t} catch (Exception e) {\n\t EncoderException ee = EncoderException.wrapException(e);\n\t ee.appendFieldContext(\"rtcmHeader\", \"RTCMHeader\");\n\t throw ee;\n\t}\n\tif (temp0.anchorPoint != null) {\n\t try {\n\t\tlen0 += sink.encodeLengthTag(temp0.anchorPoint.encodeValue(coder, sink), 0xA0);\n\t } catch (Exception e) {\n\t\tEncoderException ee = EncoderException.wrapException(e);\n\t\tee.appendFieldContext(\"anchorPoint\", \"FullPositionVector\");\n\t\tthrow ee;\n\t }\n\t}\n\n\treturn len0;\n }",
"public synchronized void mo12187a(C3075c1 c1Var, byte[] bArr) {\n mo12185a(c1Var, ByteBuffer.wrap(bArr));\n }",
"@Test\n public void testConvertAnotherBinarySidToString() throws Exception {\n byte[] sid = {(byte) 0x01, (byte) 0x05, (byte) 0x00, (byte) 0x00,\n (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x05,\n (byte) 0x15, (byte) 0x00, (byte) 0x00, (byte) 0x00,\n (byte) 0xa0, (byte) 0x65, (byte) 0xcf, (byte) 0x7e,\n (byte) 0x78, (byte) 0x4b, (byte) 0x9b, (byte) 0x5f,\n (byte) 0xe7, (byte) 0x7c, (byte) 0x87, (byte) 0x70,\n (byte) 0x09, (byte) 0x1c, (byte) 0x01, (byte) 0x00};\n String result = LdapUtils.convertBinarySidToString(sid);\n assertEquals(\"S-1-5-21-2127521184-1604012920-1887927527-72713\", result);\n }",
"EciesSharedInfo1(String sharedInfo1) {\n this.value = sharedInfo1.getBytes(StandardCharsets.UTF_8);\n }"
] | [
"0.5924822",
"0.5841943",
"0.584131",
"0.5813741",
"0.57809323",
"0.5740313",
"0.5530833",
"0.5495136",
"0.5433634",
"0.5321068",
"0.52061504",
"0.519374",
"0.5138493",
"0.51188844",
"0.51093626",
"0.5081928",
"0.50708175",
"0.5060619",
"0.5039772",
"0.5039573",
"0.5023361",
"0.5015237",
"0.50029695",
"0.4982709",
"0.4967841",
"0.49581546",
"0.4957302",
"0.49447504",
"0.49164188",
"0.4912331",
"0.48969364",
"0.48835388",
"0.48819017",
"0.4866778",
"0.4864551",
"0.4862911",
"0.48625296",
"0.48582023",
"0.48564535",
"0.4847081",
"0.4846738",
"0.48238662",
"0.48198208",
"0.4817364",
"0.4809307",
"0.4787349",
"0.47786218",
"0.47784394",
"0.4776128",
"0.47660688",
"0.47630417",
"0.47561786",
"0.4749979",
"0.47432333",
"0.47341344",
"0.47247043",
"0.4723497",
"0.47226685",
"0.47170368",
"0.4712172",
"0.46979183",
"0.46817452",
"0.46720758",
"0.4669598",
"0.46679783",
"0.46624786",
"0.46614185",
"0.4657976",
"0.46533927",
"0.4648587",
"0.46460947",
"0.464594",
"0.46419182",
"0.46374136",
"0.46332204",
"0.46321478",
"0.4625888",
"0.4625146",
"0.46199825",
"0.46174568",
"0.4615927",
"0.46154618",
"0.46035114",
"0.46007922",
"0.45942506",
"0.45940873",
"0.45920885",
"0.4589783",
"0.4587822",
"0.45674753",
"0.45618707",
"0.45615909",
"0.45608854",
"0.45599103",
"0.45596263",
"0.45593864",
"0.45588678",
"0.45576194",
"0.4556204",
"0.4546582"
] | 0.6468646 | 0 |
Converts an asn1 encoded value part of a TLV back to a long, if possible. This is done via the java BigInteger class, through a temporary BigInteger object which is constructed from the content of the input array. | public static long asn1Value_ByteArrayToLong(byte[] asn1LongValue) throws ValueNullException, ValueTooBigException {
//check if the array is null
if(asn1LongValue == null) {
throw new ValueNullException("The input is null, not an encoded long");
}
//check if the value 0 has been encoded
if((asn1LongValue[0] == 0) && (asn1LongValue.length == 1) ) {
return 0L;
}
//check if the value is too long to be converted to a long
if((asn1LongValue.length>8)) {
throw new ValueTooBigException("Java long can only hold 64 bits or 8 octets. The passed value is bigger than that");
}
BigInteger tmpLong = new BigInteger(asn1LongValue);
return tmpLong.longValue();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public long toLong()\n\t{\n\t\t// holds the int to return\n\t\tlong result = 0;\n\t\t\n\t\t// for every byte value\n\t\tfor (int i = 0; i < bytes.length; i++)\n\t\t{\n\t\t\t// Extract the bits out of the array by \"and\"ing them with the\n\t\t\t// maximum value of\n\t\t\t// a byte. This is done because java does not support unsigned\n\t\t\t// types. Now that the\n\t\t\t// unsigned byte has been extracted, shift it to the right as far as\n\t\t\t// it is needed.\n\t\t\t// Examples:\n\t\t\t// byte array int\n\t\t\t// {0x01, 0x00} = 256\n\t\t\t//\n\t\t\t// byte array int\n\t\t\t// {0x01, 0x8C 0xF0} = 0x018CF0\n\t\t\tresult += (byteToLong(bytes[i]) << (Byte.SIZE * (bytes.length - i - 1)));\n\t\t}\n\t\t\n\t\t// return the int\n\t\treturn result;\n\t}",
"public static long toInt64(byte[] value) {\r\n\t\treturn toInt16(value, 0);\r\n\t}",
"long decodeLong();",
"public static long toInt64(byte[] value, int startIndex) {\r\n\t\treturn ByteBuffer.wrap(value, startIndex, 8).order(ByteOrder.LITTLE_ENDIAN).getLong();\r\n\t}",
"public static long byteArrayToLong(byte[] ba, int offset) {\n long value = 0;\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n return value;\n }",
"public static long toLong(byte[] macAddress) {\n return MACAddress.valueOf(macAddress).toLong();\n }",
"private long convertByteValueToLong(byte[] b) {\n long m = 0;\n for (int i = 0; i < b.length; i++) {\n m = m * 256 + (b[i] < 0 ? (256 + (long) b[i]) : b[i]);\n }\n return m;\n }",
"public static long byteArrayToUnsignedLong(byte @NotNull [] data) {\n return byteArrayToUnsignedLong(data, 0, Endian.BIG, LONG_WIDTH);\n }",
"public static long convertToLong(byte[] longBuffer)\r\n {\r\n if (longBuffer.length >= 8)\r\n {\r\n return (((long) longBuffer[0] << 56)\r\n + ((long) (longBuffer[1] & 255) << 48)\r\n + ((long) (longBuffer[2] & 255) << 40)\r\n + ((long) (longBuffer[3] & 255) << 32)\r\n + ((long) (longBuffer[4] & 255) << 24)\r\n + ((longBuffer[5] & 255) << 16)\r\n + ((longBuffer[6] & 255) << 8) + ((longBuffer[7] & 255) << 0));\r\n }\r\n return 0;\r\n }",
"public abstract void read_longlong_array(long[] value, int offset, int\nlength);",
"public long toLong() {\n return this.toLongArray()[0];\n }",
"public static long getLong(final byte[] buffer, final int index, final int len) {\n switch (len) {\n case 0: return 0xFFFFFFFF_FFFFFFFFL;\n case 1: return 0xFFFFFFFF_FFFFFF00L | _getByte(buffer, index, 1);\n case 2: return 0xFFFFFFFF_FFFF0000L | _getShort(buffer, index, 2);\n case 3: return 0xFFFFFFFF_FF000000L | _getInt(buffer, index, 3);\n case 4: return 0xFFFFFFFF_00000000L | _getInt(buffer, index, 4);\n case 5: return 0xFFFFFF00_00000000L | _getLong(buffer, index, 5);\n case 6: return 0xFFFF0000_00000000L | _getLong(buffer, index, 6);\n case 7: return 0xFF000000_00000000L | _getLong(buffer, index, 7);\n case 8: return _getLong(buffer, index, 8);\n default: throw new IllegalArgumentException(\"len is out of range: \" + len);\n }\n }",
"public static long extractLongValue(Object object) {\n\t\tClass<?> c = object.getClass();\n\t\ttry {\n\t\t\tif (c.isArray()) {\n\t\t\t\tfinal Object[] objects = (Object[]) object;\n\t\t\t\tif (LOG.isDebugEnabled()) {\n\t\t\t\t\tfor (Object o : objects) {\n\t\t\t\t\t\tLOG.debug(o.getClass().getName() + \" isPrimitive=\" + o.getClass().isPrimitive() + \" toString=\" + o.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (objects[0].getClass().equals(BigInteger.class)) {\n\t\t\t\t\tobject = objects[objects.length-1];\n\t\t\t\t} else if (objects[objects.length-1].getClass().equals(BigDecimal.class)) {\n\t\t\t\t\tobject = objects[0];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new RuntimeException(\"Unsupported object type to cenvert to long.\");\n\t\t\t\t}\n\t\t\t\tc = object.getClass();\n\t\t\t}\n\t\t\treturn ((Long) c.getMethod(\"longValue\").invoke(object)).longValue();\n\t\t} catch (Exception e) {\n\t\t\tLOG.error(c.getName() + \", isPrimitive=\" + c.isPrimitive(), e);\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}",
"public static long getBytesAsLong(byte[] b) {\n\t\treturn ((long) (b[0] & 0xff) << 56)\n\t\t\t\t| ((long) (b[1] & 0xFF) << 48)\n\t\t\t\t| ((long) (b[2] & 0xFF) << 40)\n\t\t\t\t| ((long) (b[3] & 0xFF) << 32)\n\t\t\t\t| ((long) (b[4] & 0xFF) << 24)\n\t\t\t\t| ((long) (b[5] & 0xFF) << 16)\n\t\t\t\t| ((long) (b[6] & 0xFF) << 8)\n\t\t\t\t| ((long) (b[7] & 0xFF));\n\t}",
"public static long readLong(byte[] source, int position) {\n return makeLong(source[position], source[position + 1], source[position + 2], source[position + 3],\n source[position + 4], source[position + 5], source[position + 6], source[position + 7]);\n }",
"public void testValueOfLong()\n {\n // let's test that creating a EthernetAddress from an zero long\n // gives a null EthernetAddress (definition of a null EthernetAddress)\n EthernetAddress ethernet_address =\n EthernetAddress.valueOf(0x0000000000000000L);\n assertEquals(\n \"EthernetAddress.valueOf did not create expected EthernetAddress\",\n NULL_ETHERNET_ADDRESS_LONG,\n ethernet_address.toLong());\n \n // let's test creating an array from a good long\n ethernet_address =\n EthernetAddress.valueOf(VALID_ETHERNET_ADDRESS_LONG);\n assertEquals(\n \"EthernetAddress.valueOf did not create expected EthernetAddress\",\n VALID_ETHERNET_ADDRESS_LONG,\n ethernet_address.toLong());\n }",
"public static long bytesToLong(byte[] bytes) {\n\n ByteBuffer byteBuffer = ByteBuffer.wrap(bytes);\n return byteBuffer.getLong();\n\n }",
"public static byte[] longToByteArray_ASN1_Value(long toBeConverted) {\n\t\t\t\n\t\t\t//create the temporary version of what will be returned\n\t\t\tbyte[] tempToBeReturned = {\n\t\t\t\t\t(byte)(toBeConverted >> 56),\n\t\t\t\t\t(byte)(toBeConverted >> 48),\n\t\t\t\t\t(byte)(toBeConverted >> 40),\n\t\t\t\t\t(byte)(toBeConverted >> 32),\n\t\t\t\t\t(byte)(toBeConverted >> 24),\n\t\t\t\t\t(byte)(toBeConverted >> 16),\n\t\t\t\t\t(byte)(toBeConverted >> 8),\n\t\t\t\t\t(byte)toBeConverted};\n\t\t\t\n\t\t\t\n\t\t\t//converting positive long values\n\t\t\tif(toBeConverted >= 0) {\n\t\t\t\t//0 to 127: return only one octet\n\t\t\t\tif(toBeConverted<=127) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[1];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[7];\t\t\t\t\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//128 to 32768-1 return two octets\n\t\t\t\telse if(toBeConverted<=32767) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[2];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[6];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//32767 to 8388607 return three octets\n\t\t\t\telse if(toBeConverted<=8388607) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[3];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[5];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//8388608 to 2147483647 return four octets\n\t\t\t\telse if(toBeConverted<=2147483647) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[4];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[4];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//the value 0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y\n\t\t\t\t//2147483648 to 549755813887 return five octets\n\t\t\t\telse if((Long.compare(toBeConverted, 549755813888L))<0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[5];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[3];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//549755813888 to 140737488355327 return six octets\n\t\t\t\telse if((Long.compare(toBeConverted, 140737488355328L))<0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[6];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[2];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[3];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[5] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//140737488355328 to 36028797018963967 return seven octets\n\t\t\t\telse if((Long.compare(toBeConverted, 36028797018963967L))<0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[7];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[1];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[2];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[3];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[5] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[6] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//above: return eight octets\n\t\t\t\telse {\n\t\t\t\t\treturn tempToBeReturned;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//converting negative long values\n\t\t\telse if(toBeConverted<0) {\n\t\t\t\t//-1 to -128 1 octet \n\t\t\t\tif(toBeConverted>=-128) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[1];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[7];\t\t\t\t\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-129 to -32768 2 octets\n\t\t\t\telse if(toBeConverted>=-32768) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[2];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[6];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-32769 to -8388608 3 octets\n\t\t\t\telse if(toBeConverted>=-8388608) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[3];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[5];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//-8388609 to -2147483648 4 octets\n\t\t\t\telse if(toBeConverted>=-2147483648) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[4];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[4];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//the value 0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y\n\t\t\t\t//-2147483649 to -549755813888 5 octets \n\t\t\t\telse if((Long.compare(toBeConverted, -549755813889L))>0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[5];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[3];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-549755813889 to -140737488355328 6 octets\n\t\t\t\telse if((Long.compare(toBeConverted, -140737488355329L))>0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[6];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[2];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[3];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[5] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-140737488355329 to 36028797018963968 7 octets\n\t\t\t\telse if((Long.compare(toBeConverted, -36028797018963969L))>0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[7];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[1];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[2];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[3];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[5] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[6] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//below that: 8 octets\n\t\t\t\telse {\n\t\t\t\t\treturn tempToBeReturned;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//if method fails for any reason, it returns null\n\t\t\treturn null;\n\t\t}",
"public static Long toLong(Object o,byte type) throws ExecException {\n try {\n switch (type) {\n case BOOLEAN:\n if (((Boolean)o) == true) {\n return Long.valueOf(1);\n } else {\n return Long.valueOf(0);\n }\n\n case BYTE:\n return Long.valueOf(((Byte)o).longValue());\n\n case INTEGER:\n return Long.valueOf(((Integer)o).longValue());\n\n case LONG:\n return (Long)o;\n\n case FLOAT:\n return Long.valueOf(((Float)o).longValue());\n\n case DOUBLE:\n return Long.valueOf(((Double)o).longValue());\n\n case BYTEARRAY:\n return Long.valueOf(((DataByteArray)o).toString());\n\n case CHARARRAY:\n return Long.valueOf((String)o);\n\n case BIGINTEGER:\n return Long.valueOf(((BigInteger)o).longValue());\n\n case BIGDECIMAL:\n return Long.valueOf(((BigDecimal)o).longValue());\n\n case NULL:\n return null;\n\n case DATETIME:\n return Long.valueOf(((DateTime)o).getMillis());\n case MAP:\n case INTERNALMAP:\n case TUPLE:\n case BAG:\n case UNKNOWN:\n default:\n int errCode = 1071;\n String msg = \"Cannot convert a \" + findTypeName(o) +\n \" to a Long\";\n throw new ExecException(msg, errCode, PigException.INPUT);\n }\n } catch (ClassCastException cce) {\n throw cce;\n } catch (ExecException ee) {\n throw ee;\n } catch (NumberFormatException nfe) {\n int errCode = 1074;\n String msg = \"Problem with formatting. Could not convert \" + o + \" to Long.\";\n throw new ExecException(msg, errCode, PigException.INPUT, nfe);\n } catch (Exception e) {\n int errCode = 2054;\n String msg = \"Internal error. Could not convert \" + o + \" to Long.\";\n throw new ExecException(msg, errCode, PigException.BUG);\n }\n\n }",
"public final Long _parseLong(JsonParser jVar, DeserializationContext gVar) throws IOException {\n int m = jVar.mo29329m();\n if (m == 3) {\n return (Long) _deserializeFromArray(jVar, gVar);\n }\n if (m == 11) {\n return (Long) _coerceNullToken(gVar, this._primitive);\n }\n switch (m) {\n case 6:\n String trim = jVar.mo29334t().trim();\n if (trim.length() == 0) {\n return (Long) _coerceEmptyString(gVar, this._primitive);\n }\n if (_hasTextualNull(trim)) {\n return (Long) _coerceTextualNull(gVar, this._primitive);\n }\n _verifyStringForScalarCoercion(gVar, trim);\n try {\n return Long.valueOf(NumberInput.m23786b(trim));\n } catch (IllegalArgumentException unused) {\n return (Long) gVar.mo31517b(this._valueClass, trim, \"not a valid Long value\", new Object[0]);\n }\n case 7:\n return Long.valueOf(jVar.mo29248D());\n case 8:\n if (!gVar.mo31509a(DeserializationFeature.ACCEPT_FLOAT_AS_INT)) {\n _failDoubleToIntCoercion(jVar, gVar, \"Long\");\n }\n return Long.valueOf(jVar.mo29297L());\n default:\n return (Long) gVar.mo31493a(this._valueClass, jVar);\n }\n }",
"private long getLongValue(Element element, String tagName)\n {\n try\n {\n return Long.parseLong(getValue(element,tagName));\n }\n catch (NumberFormatException exception)\n {\n return 0L;\n }\n }",
"public abstract void read_ulonglong_array(long[] value, int offset, int\nlength);",
"public long getAsLong(int index) {\n switch (type) {\n case TIFFTag.TIFF_BYTE: case TIFFTag.TIFF_UNDEFINED:\n return ((byte[])data)[index] & 0xff;\n case TIFFTag.TIFF_SBYTE:\n return ((byte[])data)[index];\n case TIFFTag.TIFF_SHORT:\n return ((char[])data)[index] & 0xffff;\n case TIFFTag.TIFF_SSHORT:\n return ((short[])data)[index];\n case TIFFTag.TIFF_SLONG:\n return ((int[])data)[index];\n case TIFFTag.TIFF_LONG: case TIFFTag.TIFF_IFD_POINTER:\n return ((long[])data)[index];\n case TIFFTag.TIFF_SRATIONAL:\n int[] ivalue = getAsSRational(index);\n return (long)((double)ivalue[0]/ivalue[1]);\n case TIFFTag.TIFF_RATIONAL:\n long[] lvalue = getAsRational(index);\n return (long)((double)lvalue[0]/lvalue[1]);\n case TIFFTag.TIFF_ASCII:\n String s = ((String[])data)[index];\n return (long)Double.parseDouble(s);\n default:\n throw new ClassCastException();\n }\n }",
"private long getNumberBufAsLong(ByteOrder byteOrder, int nrReadBytes,\n int firstBytePos) {\n\n long result = 0L;\n long bytePortion = 0L;\n for (int i = 0; i < nrReadBytes; i++) {\n bytePortion = 0xFF & (byteBuffer.get(firstBytePos++));\n\n if (byteOrder == ByteOrder.LittleEndian)\n // reshift bytes\n result = result | bytePortion << (i << 3);\n else\n result = bytePortion << ((nrReadBytes - i - 1) << 3) | result;\n }\n\n return result;\n }",
"public long longValue() {\n if (originalValue instanceof Long) {\n return (Long) originalValue;\n } else if (originalValue instanceof Number) {\n return ((Number) originalValue).longValue();\n } else if (originalValue instanceof String) {\n final String originalString = (String) this.originalValue;\n\n try {\n return Long.parseLong(originalString);\n } catch (NumberFormatException e1) {\n try {\n return (long) Double.parseDouble(originalString);\n } catch (NumberFormatException e2) {\n // it will be more reasonable to throw an exception which\n // indicates that the conversion to long has failed\n e1.addSuppressed(e2);\n throw new CellValueCastException(e1);\n }\n }\n } else {\n throw new CellValueCastException();\n }\n }",
"@Override\n\tpublic int decode(byte[] buffer, int offset) throws IOException {\n\t\tlong value = NeuronReader.readRawInt64(buffer, offset);\n\t\tunionCache.setLong(fieldIndex, value);\n\n\t\treturn NeuronReader.LONG_SIZE;\n\t}",
"public static Long getLong1(final Envelop envelop) {\n return In.request(envelop, 1, Long.class);\n }",
"public abstract void read_long_array(int[] value, int offset, int\nlength);",
"public static long byteArrayToUnsignedLong(byte @NotNull [] data, int offset) {\n return byteArrayToUnsignedLong(data, offset, Endian.BIG, LONG_WIDTH);\n }",
"public long longValue(final int i) {\n if (isInteger(i)) {\n return values[i];\n }\n throw new ClassCastException(\"value #\" + i + \" is not a long in \" + this);\n }",
"public static Long toLong(Object value) {\n if (value instanceof Integer)\n return (long)(int)(Integer)value;\n else if (value instanceof Long)\n return (Long)value;\n else if (value instanceof Double)\n return (long)(double)(Double)value;\n else if (value == null)\n return null;\n else\n throw new RuntimeException(\"Can't convert [\" + value + \"] to Long\");\n }",
"public static final long Integer(final Object o) {\n\t\t\n\t\treturn Convert.Any.toLong(o, 0);\n\t}",
"public static long byteArrayToLong(byte[] bytes, int size) {\n return byteArrayToLong(bytes, size, true);\n }",
"public static long byteArrayToLong(byte[] bytes, int size, boolean bigEndian) {\n if (size > 8) {\n throw new IllegalArgumentException(\"Can't convert more than 8 bytes.\");\n }\n if (size > bytes.length) {\n throw new IllegalArgumentException(\"Size can't be larger than array length.\");\n }\n long total = 0L;\n for (int i = 0; i < size; i++) {\n if (bigEndian) {\n total = total << 8 | bytes[i] & 0xff;\n } else {\n total = total << 8 | bytes[size - i - 1] & 0xff;\n }\n }\n return total;\n }",
"public long b2l(byte[] b, int offset) {\n return (b[offset + 7] & 0xFF)\n | ((b[offset + 6] & 0xFF) << 8)\n | ((b[offset + 5] & 0xFF) << 16)\n | ((b[offset + 4] & 0xFF) << 24)\n | ((b[offset + 3] & 0xFF) << 32)\n | ((b[offset + 2] & 0xFF) << 40)\n | ((b[offset + 1] & 0xFF) << 48)\n | ((b[offset] & 0xFF) << 56);\n }",
"public long getFieldAsLong(int tag) {\n return getFieldAsLong(tag, 0);\n }",
"public static long toNumber(final byte[] bytes) {\n\t\treturn toNumber(bytes, 0, bytes.length);\n\t}",
"public static long consecutiveBytesAsLong(byte... bytes) {\r\n\t\tlong result = 0;\r\n\t\tfor(int i=0; i<bytes.length; i++) {\r\n\t\t\tint shiftFactor = 8 * (bytes.length - (i + 1));\r\n\t\t\tresult += bytes[i] << shiftFactor;\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"public long decode(long value) {\n\n if (value == 0 || value == 1)\n return value;\n\n long mask = Long.highestOneBit(value);\n\n long bit = mask >> 1;\n\n long result = value;\n\n while (mask != 0) {\n\n result ^= bit;\n\n mask >>= 1;\n\n bit = (result & mask) >> 1;\n\n }\n\n return result;\n }",
"public abstract long[] toLongArray();",
"public final Long mo28864a(Object obj) {\n if (obj instanceof Long) {\n return (Long) obj;\n }\n if (obj instanceof String) {\n try {\n return Long.valueOf(Long.parseLong((String) obj));\n } catch (NumberFormatException unused) {\n }\n }\n String b = super.mo28865b();\n String valueOf = String.valueOf(obj);\n StringBuilder sb = new StringBuilder(String.valueOf(b).length() + 25 + String.valueOf(valueOf).length());\n sb.append(\"Invalid long value for \");\n sb.append(b);\n sb.append(\": \");\n sb.append(valueOf);\n Log.e(\"PhenotypeFlag\", sb.toString());\n return null;\n }",
"@Test\n public void testToLong() throws Exception {\n assertEquals(0, undertest2.toLong(\"1 a\"));\n // \"2\"->1->0b10, \"a\"->0->0b0 => 0b100->1l\n assertEquals(1, undertest2.toLong(\"2 a\"));\n // \"3\"->2->0b01, \"a\"->0->0b0 => 0b010->2l\n assertEquals(2, undertest2.toLong(\"3 a\"));\n // \"4\"->3->0b11, \"a\"->0->0b0 => 0b110->3l\n assertEquals(3, undertest2.toLong(\"4 a\"));\n // \"1\"->0->0b00, \"b\"->1->0b1 => 0b001->4l\n assertEquals(4, undertest2.toLong(\"1 b\"));\n // \"2\"->1->0b10, \"b\"->1->0b1 => 0b101->5l\n assertEquals(5, undertest2.toLong(\"2 b\"));\n // \"3\"->2->0b01, \"b\"->1->0b1 => 0b011->6l\n assertEquals(6, undertest2.toLong(\"3 b\"));\n // \"4\"->3->0b11, \"b\"->1->0b1 => 0b111->7l\n assertEquals(7, undertest2.toLong(\"4 b\"));\n }",
"private final long get_BIGINT(int column) {\n // @AGG force Little Endian\n if (metadata.isZos())\n return dataBuffer_.getLong(columnDataPosition_[column - 1]);\n else\n return dataBuffer_.getLongLE(columnDataPosition_[column - 1]);\n// return SignedBinary.getLong(dataBuffer_,\n// columnDataPosition_[column - 1]);\n }",
"public long getValueAsLongValue() throws DataFieldException {\n\t\ttry {\n\t\t\treturn Long.parseLong(this.value);\n\t\t} catch (NumberFormatException nfe) {\n\t\t\tthrow new DataFieldException(\n\t\t\t\t\t\"Couldn't parse value into a long. Value: \" + this.value,\n\t\t\t\t\tnfe);\n\t\t}\n\t}",
"public static LongArrayBitVector wrap( final long[] array ) {\n\t\treturn wrap( array, (long)array.length * Long.SIZE );\n\t}",
"BigInteger decodeBigInteger();",
"public long getFieldAsLong(int tag, int index) {\n Integer i = (Integer)fieldIndex.get(tag);\n return (fields[i]).getAsLong(index);\n }",
"long getLongValue();",
"long getLongValue();",
"public long getLongValue() {\n if (typeCase_ == 3) {\n return (java.lang.Long) type_;\n }\n return 0L;\n }",
"private long getLong() {\n longBuffer.rewind();\n archive.read(longBuffer);\n longBuffer.flip();\n return longBuffer.getLong();\n }",
"public static long parseLong(CharSequence seq) {\n long result = 0;\n int max = seq.length() - 1;\n long position = 1;\n boolean negative = false;\n for (int i = max; i >= 0; i--) {\n char c = seq.charAt(i);\n switch (c) {\n case '-':\n if (i == 0) {\n negative = true;\n continue;\n }\n throw new NumberFormatException(\"- encountered not at start of '\" + seq + \"'\");\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n long prev = result;\n result += position * (c - '0');\n if (prev > result) {\n throw new NumberFormatException(\"Number too large for long: '\" + seq + \"' - \"\n + \" \" + prev + \" + \" + (position * (c - '0')) + \" = \" + result);\n }\n position *= 10;\n continue;\n default:\n throw new NumberFormatException(\"Illegal character '\" + c + \"' in number '\" + seq + \"'\");\n }\n }\n return negative ? -result : result;\n }",
"public long getLong(String name) {\n Enumeration enumer = LONGS.elements();\n while(enumer.hasMoreElements()) {\n SimpleMessageObjectLongItem item = (SimpleMessageObjectLongItem) enumer.nextElement();\n if(item.getName().compareTo(name) == 0) {\n return item.getValue();\n }\n }\n return -1L;\n }",
"public long longValue();",
"private long parseLong(int start, int end, int radix) {\n long result = 0;\n long digit;\n\n for (int i = start; i < end; i++) {\n digit = Character.digit(yycharat(i),radix);\n result*= radix;\n result+= digit;\n }\n\n return result;\n }",
"public long getLong(String key) {\n long result;\n Object value = get(key);\n if (value instanceof Long) {\n result = (Long)value;\n } else if (value instanceof String) {\n try {\n String valueString = (String)value;\n if (valueString.length() == 0) {\n result = 0;\n } else if (valueString.charAt(0) == '-') {\n result = Long.parseLong(valueString);\n } else {\n result = Long.parseUnsignedLong((String)value);\n }\n } catch (NumberFormatException exc) {\n result = 0;\n }\n } else {\n result = 0;\n }\n return result;\n }",
"public Object unpickle (String value) {\n\treturn Long.valueOf(value);\n }",
"private long byteToLong(byte b)\n\t{\n\t\treturn (b & 0xFF);\n\t}",
"private long getLongFromDECIMAL(int column, String targetType) {\n try {\n return Decimal.getLong(dataBuffer_,\n columnDataPosition_[column - 1],\n getColumnPrecision(column - 1),\n getColumnScale(column - 1));\n } catch (ArithmeticException | IllegalArgumentException e) {\n throw new IllegalArgumentException(\"SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE \" + targetType, e);\n }\n }",
"public static long parseLong(String val) {\n\t\tval = val.toUpperCase();\n\t\tint indx = val.indexOf(\"M\");\n\n\t\tint plus = 10000;\n\t\tif (indx < 0) {\n\t\t\tindx = val.indexOf(\"K\");\n\t\t\tplus = 1000;\n\t\t}\n\t\tif (indx > 0) {\n\t\t\tString longVal = val.substring(0, indx);\n\n\t\t\tlong theVale = Long.parseLong(longVal) * plus;\n\t\t\tString remain = val.substring(indx + 1);\n\t\t\tif (remain.length() > 0) {\n\t\t\t\ttheVale += Integer.parseInt(remain);\n\t\t\t}\n\t\t\treturn theVale;\n\t\t} else {\n\t\t\treturn Long.parseLong(val);\n\t\t}\n\n\t}",
"public static long parseHexLong(CharSequence seq) {\n long result = 0;\n int last = seq.length() - 1;\n if (last > 15) {\n throw new NumberFormatException(\"Too many characters (> 16) for a \"\n + \"long in '\" + seq + \"'\");\n }\n if (Strings.startsWith(seq, \"0x\")) {\n seq = seq.subSequence(2, seq.length());\n }\n for (int i = last, j = 0; i >= 0; i--, j += 4) {\n long val = charToNybbl(seq.charAt(i));\n val <<= j;\n result |= val;\n }\n return result;\n }",
"public native long[] __longArrayMethod( long __swiftObject, long[] arg );",
"public static long toNumber(final char[] hexadecimal) {\n\t\treturn toNumber(toBytes(hexadecimal));\n\t}",
"public long[] toLongArray()\r\n {\r\n long[] a = new long[count];\r\n \r\n VectorItem<O> vi = first;\r\n \r\n for (int i=0;i<=count-1;i++)\r\n {\r\n a[i] = (Long) vi.getObject();\r\n vi = vi.getNext();\r\n }\r\n\r\n return a; \r\n }",
"public static UnsignedLong parse(\n javax.xml.stream.XMLStreamReader reader)\n throws java.lang.Exception {\n UnsignedLong object = new UnsignedLong();\n\n int event;\n javax.xml.namespace.QName currentQName = null;\n java.lang.String nillableValue = null;\n java.lang.String prefix = \"\";\n java.lang.String namespaceuri = \"\";\n\n try {\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n currentQName = reader.getName();\n\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n // Skip the element and report the null value. It cannot have subelements.\n while (!reader.isEndElement())\n reader.next();\n\n return object;\n }\n\n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n\n while (!reader.isEndElement()) {\n if (reader.isStartElement()) {\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.microsoft.com/2003/10/Serialization/\",\n \"unsignedLong\").equals(reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (!\"true\".equals(nillableValue) &&\n !\"1\".equals(nillableValue)) {\n java.lang.String content = reader.getElementText();\n\n object.setUnsignedLong(org.apache.axis2.databinding.utils.ConverterUtil.convertToUnsignedLong(\n content));\n } else {\n reader.getElementText(); // throw away text nodes if any.\n }\n } // End of if for expected property start element\n\n else {\n // 3 - A start element we are not expecting indicates an invalid parameter was passed\n throw new org.apache.axis2.databinding.ADBException(\n \"Unexpected subelement \" +\n reader.getName());\n }\n } else {\n reader.next();\n }\n } // end of while loop\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }",
"public long getLongValue() {\n if (getValueIndex() <= 0)\n return 0L;\n return ((LongEntry) getPool().getEntry(getValueIndex())).getValue();\n }",
"public static long parseLong(final CharSequence s)\n {\n // no string\n if (s == null)\n {\n throw new NumberFormatException(\"null\");\n }\n\n // determine length\n final int length = s.length();\n\n if (length == 0)\n {\n throw new NumberFormatException(\"length = 0\");\n }\n\n // that is safe, we already know that we are > 0\n final int digit = s.charAt(0);\n\n // turn the compare around to allow the compiler and cpu\n // to run the next code most of the time\n if (digit < '0' || digit > '9')\n {\n return Long.parseLong(s.toString());\n }\n\n long value = digit - DIGITOFFSET;\n\n for (int i = 1; i < length; i++)\n {\n final int d = s.charAt(i);\n if (d < '0' || d > '9')\n {\n throw new NumberFormatException(\"Not a long \" + s.toString());\n }\n\n value = ((value << 3) + (value << 1));\n value += (d - DIGITOFFSET);\n }\n\n return value;\n }",
"protected final long parseUnsignedInt(ByteArrayInputStream stream) throws EOFException\n {\n long value = 0;\n for (int i = 0; i < 4; ++i)\n {\n value = (value << 8) | EASMessage.parseUnsignedByte(stream);\n }\n return value;\n }",
"public static long toLong(IRubyObject irb) {\n\t\treturn Long.valueOf(irb.toString());\n\t}",
"public void testToLong()\n {\n // test making a couple EthernetAddresss and then check that the toLong\n // gives back the same value in long form that was used to create it\n \n // test the null EthernetAddress\n EthernetAddress ethernet_address = new EthernetAddress(0L);\n assertEquals(\"null EthernetAddress long and toLong did not match\",\n NULL_ETHERNET_ADDRESS_LONG,\n ethernet_address.toLong());\n \n // test a non-null EthernetAddress\n ethernet_address =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertEquals(\"EthernetAddress long and toLong results did not match\",\n VALID_ETHERNET_ADDRESS_LONG,\n ethernet_address.toLong());\n }",
"public long longValue() {\n return (long) m_value;\n }",
"public UnsignedInteger32(long a) {\r\n if ( (a < MIN_VALUE) || (a > MAX_VALUE)) {\r\n throw new NumberFormatException();\r\n }\r\n\r\n value = new Long(a);\r\n }",
"public long getLong(String name) {\n\t\tfinal Object val = values.get(name);\n\t\tif (val == null) {\n\t\t\tthrow new IllegalArgumentException(\"Integer value required, but not specified\");\n\t\t}\n\t\tif (val instanceof Number) {\n\t\t\treturn ((Number) val).longValue();\n\t\t}\n\t\ttry {\n\t\t\treturn Long.parseLong((String) val);\n\t\t} catch (Exception e) {\n\t\t\tthrow new IllegalArgumentException(\"Integer value required, but found: \" + val);\n\t\t}\n\t}",
"public long readVarLong() throws IOException {\n final int type = (int) this.read(2).toLong();\n return this.read(BitOutputStream.varLongDepths[type]).toLong();\n }",
"public long readAsLong(int nrBits) {\n return readAsLong(bitPos, nrBits, ByteOrder.BigEndian);\n }",
"private static long parseValue(String param2String) throws IllegalArgumentException {\n/* 593 */ long l = Long.parseLong(param2String);\n/* 594 */ if (l < 0L) {\n/* 595 */ throw new IllegalArgumentException(\"negative limit: \" + param2String);\n/* */ }\n/* 597 */ return l;\n/* */ }",
"public final long getLong(final String tagToGet) {\n try {\n return Long.parseLong(getStr(tagToGet));\n } catch (final Exception t) {\n return 0;\n }\n }",
"@Test(expected = IOException.class)\n\tpublic void testToolargeUnsigned() throws IOException {\n\t\tInputStream is = is(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02);\n\n\t\tlong value = LEB128.read(is, false);\n\t\tAssert.fail(\n\t\t\t\"Should not be able to read a LEB128 that is larger than what can fit in java 64bit long int: \" +\n\t\t\t\tvalue);\n\t}",
"@Override\n public long applyAsLong(BytesStore bytes) {\n return applyAsLong(bytes, bytes.readRemaining());\n }",
"private static long parseValue(String param2String) throws IllegalArgumentException {\n/* 591 */ long l = Long.parseLong(param2String);\n/* 592 */ if (l < 0L) {\n/* 593 */ throw new IllegalArgumentException(\"negative limit: \" + param2String);\n/* */ }\n/* 595 */ return l;\n/* */ }",
"public long longValue() {\n return value;\n }",
"public final long getLong(final boolean endianess) throws IOException {\r\n b1 = (tagBuffer[bPtr] & 0xff);\r\n b2 = (tagBuffer[bPtr + 1] & 0xff);\r\n b3 = (tagBuffer[bPtr + 2] & 0xff);\r\n b4 = (tagBuffer[bPtr + 3] & 0xff);\r\n b5 = (tagBuffer[bPtr + 4] & 0xff);\r\n b6 = (tagBuffer[bPtr + 5] & 0xff);\r\n b7 = (tagBuffer[bPtr + 6] & 0xff);\r\n b8 = (tagBuffer[bPtr + 7] & 0xff);\r\n\r\n long tmpLong;\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n tmpLong = ( ((long) b1 << 56) | ((long) b2 << 48) | ((long) b3 << 40) | ((long) b4 << 32)\r\n | ((long) b5 << 24) | ((long) b6 << 16) | ((long) b7 << 8) | b8);\r\n } else {\r\n tmpLong = ( ((long) b8 << 56) | ((long) b7 << 48) | ((long) b6 << 40) | ((long) b5 << 32)\r\n | ((long) b4 << 24) | ((long) b3 << 16) | ((long) b2 << 8) | b1);\r\n }\r\n\r\n bPtr += 8;\r\n\r\n return (tmpLong);\r\n }",
"public long getLong() throws NoSuchElementException,\n\t NumberFormatException\n {\n\tString s = tokenizer.nextToken();\n\treturn Long.parseLong(s);\n }",
"public static int asn1Value_ByteArrayToInteger(byte[] asn1IntValue) throws ValueNullException, ValueTooBigException {\n\t\t//check if the array is null\n\t\tif(asn1IntValue == null) {\n\t\t\tthrow new ValueNullException(\"The input is null, not an encoded integer\");\n\t\t}\n\t\t//check if the value 0 has been encoded\n\t\tif((asn1IntValue[0] == 0) && (asn1IntValue.length == 1) ) {\n\t\t\treturn 0;\n\t\t}\n\t\t//check if the value is too long to be converted to an integer\n\t\tif((asn1IntValue.length>4)) {\n\t\t\tthrow new ValueTooBigException(\"Java integer can only hold 32 bits or 4 octets. The passed value is bigger than that\");\n\t\t}\n\t\t\n\t\tBigInteger tmpInt = new BigInteger(asn1IntValue);\n\t\treturn tmpInt.intValue();\n\t}",
"public static Long getLong2(final Envelop envelop) {\n return In.request(envelop, 2, Long.class);\n }",
"public abstract long read_longlong();",
"public final long fixed_64bit_literal() throws RecognitionException {\n long value = 0;\n\n\n int integer_literal47 = 0;\n long long_literal48 = 0;\n short short_literal49 = 0;\n byte byte_literal50 = 0;\n float float_literal51 = 0.0f;\n double double_literal52 = 0.0;\n char char_literal53 = 0;\n boolean bool_literal54 = false;\n\n try {\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:301:3: ( integer_literal | long_literal | short_literal | byte_literal | float_literal | double_literal | char_literal | bool_literal )\n int alt11 = 8;\n switch (input.LA(1)) {\n case INTEGER_LITERAL: {\n alt11 = 1;\n }\n break;\n case LONG_LITERAL: {\n alt11 = 2;\n }\n break;\n case SHORT_LITERAL: {\n alt11 = 3;\n }\n break;\n case BYTE_LITERAL: {\n alt11 = 4;\n }\n break;\n case FLOAT_LITERAL: {\n alt11 = 5;\n }\n break;\n case DOUBLE_LITERAL: {\n alt11 = 6;\n }\n break;\n case CHAR_LITERAL: {\n alt11 = 7;\n }\n break;\n case BOOL_LITERAL: {\n alt11 = 8;\n }\n break;\n default:\n NoViableAltException nvae =\n new NoViableAltException(\"\", 11, 0, input);\n throw nvae;\n }\n switch (alt11) {\n case 1:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:301:5: integer_literal\n {\n pushFollow(FOLLOW_integer_literal_in_fixed_64bit_literal649);\n integer_literal47 = integer_literal();\n state._fsp--;\n\n value = integer_literal47;\n }\n break;\n case 2:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:302:5: long_literal\n {\n pushFollow(FOLLOW_long_literal_in_fixed_64bit_literal657);\n long_literal48 = long_literal();\n state._fsp--;\n\n value = long_literal48;\n }\n break;\n case 3:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:303:5: short_literal\n {\n pushFollow(FOLLOW_short_literal_in_fixed_64bit_literal665);\n short_literal49 = short_literal();\n state._fsp--;\n\n value = short_literal49;\n }\n break;\n case 4:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:304:5: byte_literal\n {\n pushFollow(FOLLOW_byte_literal_in_fixed_64bit_literal673);\n byte_literal50 = byte_literal();\n state._fsp--;\n\n value = byte_literal50;\n }\n break;\n case 5:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:305:5: float_literal\n {\n pushFollow(FOLLOW_float_literal_in_fixed_64bit_literal681);\n float_literal51 = float_literal();\n state._fsp--;\n\n value = Float.floatToRawIntBits(float_literal51);\n }\n break;\n case 6:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:306:5: double_literal\n {\n pushFollow(FOLLOW_double_literal_in_fixed_64bit_literal689);\n double_literal52 = double_literal();\n state._fsp--;\n\n value = Double.doubleToRawLongBits(double_literal52);\n }\n break;\n case 7:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:307:5: char_literal\n {\n pushFollow(FOLLOW_char_literal_in_fixed_64bit_literal697);\n char_literal53 = char_literal();\n state._fsp--;\n\n value = char_literal53;\n }\n break;\n case 8:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:308:5: bool_literal\n {\n pushFollow(FOLLOW_bool_literal_in_fixed_64bit_literal705);\n bool_literal54 = bool_literal();\n state._fsp--;\n\n value = bool_literal54 ? 1 : 0;\n }\n break;\n\n }\n } catch (RecognitionException re) {\n reportError(re);\n recover(input, re);\n } finally {\n // do for sure before leaving\n }\n return value;\n }",
"private static BigInteger BigIntToBigNbr(int[] GD, int NumberLength) {\r\n\t\tbyte[] Result;\r\n\t\tlong[] Temp;\r\n\t\tint i, NL;\r\n\t\tlong digit;\r\n\r\n\t\tTemp = new long[NumberLength];\r\n\t\tConvert31To32Bits(GD, Temp, NumberLength);\r\n\t\tNL = NumberLength * 4;\r\n\t\tResult = new byte[NL];\r\n\t\tfor (i = 0; i < NumberLength; i++) {\r\n\t\t\tdigit = Temp[i];\r\n\t\t\tResult[NL - 1 - 4 * i] = (byte) (digit & 0xFF);\r\n\t\t\tResult[NL - 2 - 4 * i] = (byte) (digit / 0x100 & 0xFF);\r\n\t\t\tResult[NL - 3 - 4 * i] = (byte) (digit / 0x10000 & 0xFF);\r\n\t\t\tResult[NL - 4 - 4 * i] = (byte) (digit / 0x1000000 & 0xFF);\r\n\t\t}\r\n\t\treturn (new BigInteger(Result));\r\n\t}",
"@Test\n public void testFromLong() throws Exception {\n assertEquals(\"1 a\", undertest2.fromLong(0));\n // 0b100 => 0b10->1->\"2\", 0b0->0->\"a\"\n assertEquals(\"2 a\", undertest2.fromLong(1));\n // 0b010 => 0b01->2->\"3\", 0b0->0->\"a\"\n assertEquals(\"3 a\", undertest2.fromLong(2));\n // 0b110 => 0b11->3->\"4\", 0b0->0->\"a\"\n assertEquals(\"4 a\", undertest2.fromLong(3));\n // 0b001 => 0b00->0->\"1\", 0b1->1->\"b\"\n assertEquals(\"1 b\", undertest2.fromLong(4));\n // 0b101 => 0b10->1->\"2\", 0b1->1->\"b\"\n assertEquals(\"2 b\", undertest2.fromLong(5));\n // 0b011 => 0b01->2->\"3\", 0b1->1->\"b\"\n assertEquals(\"3 b\", undertest2.fromLong(6));\n // 0b111 => 0b11->3->\"4\", 0b1->1->\"b\"\n assertEquals(\"4 b\", undertest2.fromLong(7));\n // 255l->0b11111111->0b111 => 0b11->3->\"4\", 0b1->1->\"b\"\n assertEquals(\"4 b\", undertest2.fromLong(255));\n }",
"@SuppressWarnings(\"cast\")\n public static long makeLong(int b1, int b2, int b3, int b4, int b5, int b6, int b7, int b8) {\n return ((long) b1 << 56) +\n ((long) (b2 & 255) << 48) +\n ((long) (b3 & 255) << 40) +\n ((long) (b4 & 255) << 32) +\n ((long) (b5 & 255) << 24) +\n (long) ((b6 & 255) << 16) +\n (long) ((b7 & 255) << 8) +\n (long) ((b8 & 255));\n }",
"public Long getLong(String key)\n\t{\n\t\tverifyParseState();\n\t\t\n\t\tValue value = values.get(key);\n\t\tif(value == null || value.value == null)\n\t\t\treturn null;\n\t\tif(value.type != ValueType.LONG)\n\t\t\tthrow new JsonTypeException(value.value.getClass(), Long.class);\n\t\treturn (Long)value.value;\n\t}",
"long readLong();",
"@ZenCodeType.Caster\n @ZenCodeType.Method\n default long[] asLongArray() {\n \n return notSupportedCast(\"long[]\");\n }",
"@java.lang.Override\n public long getLongValue() {\n if (typeCase_ == 3) {\n return (java.lang.Long) type_;\n }\n return 0L;\n }",
"public long longValue() {\r\n return intValue();\r\n }",
"public static void main(String[] args) {\n int i = 1;\n int n = 100;\n for(;i<=n;i++){\n System.out.println(\"i:\" + i);\n }\n\n BigInteger bigInteger = BigInteger.valueOf(111L);\n bigInteger.longValue();\n }",
"static Value<Long> parseLong(String value) {\n try {\n if (value == null || value.isEmpty()) return empty();\n return of(Long.parseLong(value));\n } catch (NumberFormatException error) {\n return empty();\n }\n }",
"@Test\n\tpublic void test_TCM__long_getLongValue() {\n final Attribute attribute = new Attribute(\"test\", \"\");\n long summand = 3;\n\t for(int i = 0; i < 60; i++) {\n summand <<= 1;\n final long value = Long.MIN_VALUE + summand;\n\n attribute.setValue(\"\" + value);\n \t\ttry {\n \t\t\tassertEquals(\"incorrect long conversion\", attribute.getLongValue(), value);\n \t\t} catch (final DataConversionException e) {\n \t\t\tfail(\"couldn't convert to long\");\n \t\t}\n }\n\n\t\t//test an invalid long\n attribute.setValue(\"100000000000000000000000000\");\n\t\ttry {\n attribute.getLongValue();\n\t\t\tfail(\"incorrect long conversion from non long\");\n\t\t} catch (final DataConversionException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n\t\t}\n\t}",
"@ZenCodeType.Caster\n @ZenCodeType.Method\n default long asLong() {\n \n return notSupportedCast(BasicTypeID.LONG);\n }",
"public static BigInteger[] byteToArrayBigInteger(byte[] a) {\n byte lenByte[] = new byte[INT_LENGTH_IN_BYTES];\n System.arraycopy(a, 0, lenByte, 0, INT_LENGTH_IN_BYTES);\n int len = byteToInt(lenByte);\n BigInteger[] res = new BigInteger[len];\n int offset = INT_LENGTH_IN_BYTES;\n\n for(int i = 0; i < len; i++) {\n byte[] lenBigIntegerByte = new byte[INT_LENGTH_IN_BYTES];\n System.arraycopy(a, offset, lenBigIntegerByte, 0, INT_LENGTH_IN_BYTES);\n int lenBigInteger = byteToInt(lenBigIntegerByte);\n byte[] bigInteger = new byte[lenBigInteger];\n System.arraycopy(a, offset+INT_LENGTH_IN_BYTES, bigInteger, 0, lenBigInteger);\n\n res[i] = new BigInteger(bigInteger);\n\n offset += INT_LENGTH_IN_BYTES + lenBigInteger;\n }\n\n return res;\n }"
] | [
"0.6880412",
"0.6575132",
"0.6490324",
"0.6284591",
"0.6230391",
"0.6075364",
"0.6045698",
"0.5995755",
"0.5956821",
"0.5910145",
"0.5855995",
"0.58483845",
"0.5837495",
"0.5836835",
"0.5816473",
"0.57841814",
"0.5745407",
"0.57222885",
"0.5683169",
"0.5660502",
"0.56318504",
"0.56147105",
"0.56139326",
"0.5598718",
"0.5578628",
"0.55614316",
"0.55593306",
"0.5558262",
"0.55560184",
"0.5552064",
"0.5540598",
"0.5527139",
"0.5526868",
"0.55155003",
"0.5492713",
"0.5464811",
"0.54416126",
"0.54292405",
"0.5426564",
"0.54184806",
"0.5409437",
"0.5380556",
"0.5379998",
"0.5358771",
"0.53586364",
"0.5358532",
"0.5358252",
"0.5358039",
"0.5358039",
"0.5354044",
"0.5352223",
"0.5339939",
"0.5291117",
"0.528335",
"0.52829635",
"0.5273936",
"0.5264685",
"0.52515656",
"0.5251471",
"0.5247966",
"0.52451664",
"0.5225799",
"0.52204645",
"0.52199423",
"0.52179253",
"0.52123225",
"0.51921606",
"0.5191998",
"0.51859224",
"0.5185672",
"0.5181827",
"0.5175577",
"0.516728",
"0.5163974",
"0.51639414",
"0.51629955",
"0.51424056",
"0.5137718",
"0.5135537",
"0.5121555",
"0.5113559",
"0.5107566",
"0.5106085",
"0.51032925",
"0.50988126",
"0.5098512",
"0.5088815",
"0.5086302",
"0.5085966",
"0.5079997",
"0.5078968",
"0.5077682",
"0.507554",
"0.50698316",
"0.506931",
"0.5067157",
"0.50572777",
"0.5055728",
"0.50462526",
"0.50447166"
] | 0.78293747 | 0 |
Checks whether or not an Object is an ASN1 OctetString. To be used to check all supposed octetc strings that are inputs from outside the TSE. | public static boolean isASN1_OctetString(Object supposedOctetString) {
if((supposedOctetString != null) &&(supposedOctetString.getClass().isArray())) {
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isEncodedObject (final Object value) {\n\n if ( value == null || !(value instanceof String) ) {\n\n return false;\n }\n\n final String valueString = (String) value;\n\n return valueString.startsWith(ObjectStringConverter.MARK_PREFIX) &&\n valueString.endsWith(ObjectStringConverter.MARK_SUFFIX);\n }",
"@Test public void testToString() {\n final OctaveObject string = new OctaveString(\"tekst\");\n assertEquals(\"# name: ans\\n\" + \n\t\t \"# type: string\\n\" + \n\t\t \"# elements: 1\\n\" + \n\t\t \"# length: 5\\ntekst\\n\", \n\t\t OctaveIO.toText(string));\n }",
"public static boolean isASN1_Integer(Object supposedInteger) {\n\t\t//null is no Integer\n\t\tif(supposedInteger == null) {\n\t\t\treturn false;\n\t\t}\n\t\t//Integer, Long, and BigInteger are considered Integers\n\t\tif(supposedInteger instanceof Integer) {\n\t\t\treturn true;\n\t\t}\n\t\telse if(supposedInteger instanceof Long) {\n\t\t\treturn true;\n\t\t}\n\t\telse if(supposedInteger instanceof BigInteger) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"@Test public void testToOctave() {\n final OctaveObject string = new OctaveString(\"mytekst\");\n assertEquals(\"# name: tre\\n\" + \n\t\t \"# type: string\\n\" + \n\t\t \"# elements: 1\\n\" + \n\t\t \"# length: 7\\nmytekst\\n\", \n\t\t OctaveIO.toText(\"tre\", string));\n }",
"boolean isText(Object object);",
"public void checkSafeString(IRubyObject object) {\n if (getSafeLevel() > 0 && object.isTaint()) {\n ThreadContext tc = getCurrentContext();\n if (tc.getFrameName() != null) {\n throw newSecurityError(\"Insecure operation - \" + tc.getFrameName());\n }\n throw newSecurityError(\"Insecure operation: -r\");\n }\n secure(4);\n if (!(object instanceof RubyString)) {\n throw newTypeError(\n \"wrong argument type \" + object.getMetaClass().getName() + \" (expected String)\");\n }\n }",
"boolean isSetString();",
"private static boolean isPrimitive(String value) {\n boolean status = true;\n value = value.trim();\n if (value.length() < 1) {\n return false;\n }\n for (int i = 0; i < value.length(); i++) {\n char c = value.charAt(i);\n if (!Character.isDigit(c)) {\n status = false;\n break;\n }\n }\n\n return status;\n }",
"@Override\n public boolean isMaybeStrJSON() {\n checkNotPolymorphicOrUnknown();\n return (flags & STR_JSON) != 0;\n }",
"@Test\r\n\tpublic void testIsOBGYN() {\r\n\t\tAssert.assertFalse(oic.isOBGYN(\"a\"));\r\n\t\t\r\n\t\tAssert.assertFalse(oic.isOBGYN(\"123\"));\r\n\t\t\r\n\t\tAssert.assertFalse(oic.isOBGYN(\"9000000003\"));\r\n\t\t\r\n\t\tAssert.assertFalse(oic.isOBGYN(\"9900000000\"));\r\n\t\t\r\n\t\tAssert.assertTrue(oic.isOBGYN(\"9000000012\"));\r\n\t}",
"public boolean equals(Object other) {\r\n \tthrow new ClassCastException(\"equals on StringValue is not allowed\");\r\n }",
"public boolean canConvert(String s);",
"private boolean checkNonce(BasicOCSPResp basicResponse) throws OCSPException\n {\n Extension nonceExt = basicResponse.getExtension(OCSPObjectIdentifiers.id_pkix_ocsp_nonce);\n if (nonceExt != null)\n {\n DEROctetString responseNonceString = (DEROctetString) nonceExt.getExtnValue();\n if (!responseNonceString.equals(encodedNonce))\n {\n throw new OCSPException(\"Different nonce found in response!\");\n }\n else\n {\n LOG.info(\"Nonce is good\");\n return true;\n }\n }\n // https://tools.ietf.org/html/rfc5019\n // Clients that opt to include a nonce in the\n // request SHOULD NOT reject a corresponding OCSPResponse solely on the\n // basis of the nonexistent expected nonce, but MUST fall back to\n // validating the OCSPResponse based on time.\n return false;\n }",
"private static boolean isJSONValid(String jsonInString){\n\n\t\ttry {\n\t\t\tfinal ObjectMapper mapper = new ObjectMapper();\n\t\t\tmapper.readTree(jsonInString);\n\t\t\treturn true;\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"INVALID JSON-LD SYNTAX\");\n\t\t\treturn false;\n\t\t}\n\n\t}",
"@Test\n public void testAtomString_7() {\n LOGGER.info(\"testAtomString_7\");\n final String s = \"Hello\";\n final byte[] b = s.getBytes(US_ASCII);\n AtomString atomString1 = new AtomString(b);\n AtomString atomString2 = new AtomString(s);\n assertEquals(atomString1, atomString2);\n }",
"public boolean isString();",
"@Test(timeout = 4000)\n public void test047() throws Throwable {\n JSONObject jSONObject0 = new JSONObject();\n JSONObject jSONObject1 = jSONObject0.put(\"MnMG\", (Object) \"MnMG\");\n jSONObject1.put(\"MnMG\", false);\n assertEquals(1, jSONObject0.length());\n \n jSONObject1.getBoolean(\"MnMG\");\n String string0 = JSONObject.valueToString(jSONObject0);\n String string1 = JSONObject.quote(\"wheel.json.JSONObject@0000000001\");\n assertFalse(string1.equals((Object)string0));\n }",
"public boolean equals(XMLString anObject) {\n/* 186 */ return this.m_str.equals(anObject.toString());\n/* */ }",
"public static boolean m24502n(JSONObject jSONObject) {\n return \"8\".equals(m24503o(jSONObject));\n }",
"static private byte[] toBytes(\n ASN1OctetString[] octs)\n {\n ByteArrayOutputStream bOut = new ByteArrayOutputStream();\n\n for (int i = 0; i != octs.length; i++)\n {\n try\n {\n bOut.write(octs[i].getOctets());\n }\n catch (IOException e)\n {\n throw new IllegalArgumentException(\"exception converting octets \" + e.toString());\n }\n }\n\n return bOut.toByteArray();\n }",
"@Test(timeout = 4000)\n public void test099() throws Throwable {\n JSONObject jSONObject0 = new JSONObject();\n JSONObject jSONObject1 = new JSONObject(jSONObject0);\n JSONObject jSONObject2 = jSONObject1.putOpt(\"\", jSONObject0);\n Byte.compare((byte)42, (byte)42);\n JSONObject.quote(\"\");\n Byte.toUnsignedInt((byte)42);\n JSONObject.valueToString(jSONObject2, (-1394), (-1394));\n JSONObject jSONObject3 = new JSONObject(\"{\\n\\\"java.lang.String@0000000003\\\": {},\\n\\\"java.lang.String@0000000004\\\": \\\"java.lang.Class@0000000005\\\"\\n}\");\n String string0 = \"&<uWyN63)KiOjjs&n3\";\n JSONObject jSONObject4 = null;\n try {\n jSONObject4 = new JSONObject(\"&<uWyN63)KiOjjs&n3\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // A JSONObject text must begin with '{' at character 1 of &<uWyN63)KiOjjs&n3\n //\n verifyException(\"wheel.json.JSONTokener\", e);\n }\n }",
"public static boolean m1035a(String str, Object... objArr) {\n return C0148u.m1034a(0, str, objArr);\n }",
"public boolean isValidISBN10(String sISBN) throws java.rmi.RemoteException;",
"@Test\n public void identifyOctLiteral() throws IOException {\n identifyIntLiteral(\"0o101_2044_1504\", IntToken.Format.OCT);\n identifyIntLiteral(\"0O101_2044_1504\", IntToken.Format.OCT);\n }",
"public interface ASN1TaggedObjectParser\n extends ASN1Encodable, InMemoryRepresentable\n{\n /**\n * Return the tag class associated with this object.\n *\n * @return the tag class.\n */\n int getTagClass();\n\n /**\n * Return the tag number associated with this object.\n *\n * @return the tag number.\n */\n int getTagNo();\n\n boolean hasContextTag(int tagNo);\n\n boolean hasTag(int tagClass, int tagNo);\n\n /**\n * \n * Return a parser for the actual object tagged.\n *\n * @param tag the primitive tag value for the object tagged originally.\n * @param isExplicit true if the tagging was done explicitly.\n * @return a parser for the tagged object.\n * @throws IOException if a parser cannot be constructed.\n * \n * @deprecated This parser now includes the {@link #getTagClass() tag class}.\n * This method will raise an exception if it is not\n * {@link BERTags#CONTEXT_SPECIFIC}. Use\n * {@link ASN1Util#parseContextBaseUniversal(ASN1TaggedObjectParser, int, int, boolean, int)}\n * as a direct replacement, or use\n * {@link #parseBaseUniversal(boolean, int)} only after confirming\n * the expected tag class (e.g.\n * {@link ASN1Util#tryParseContextBaseUniversal(ASN1TaggedObjectParser, int, boolean, int)}.\n */\n ASN1Encodable getObjectParser(int tag, boolean isExplicit)\n throws IOException;\n\n// ASN1Encodable parseBaseObject(boolean declaredExplicit, int baseTagClass, int baseTagNo,\n// boolean baseDeclaredExplicit) throws IOException;\n\n ASN1Encodable parseBaseUniversal(boolean declaredExplicit, int baseTagNo) throws IOException;\n}",
"@Test\n public void testRequireAtomString_GenericType_1() {\n LOGGER.info(\"requireAtomString\");\n final AtomString actual = new AtomString();\n final AtomString expected = requireAtomString(actual);\n assertEquals(expected, actual);\n }",
"public boolean looksLikeISO8601(String str) {\n if (str.length() < 5 || !Character.isDigit(str.charAt(0)) || !Character.isDigit(str.charAt(3)) || str.charAt(4) != '-') {\n return false;\n }\n return true;\n }",
"public final boolean isObjectNameEqual(final String objectName)\n {\n return (getObjectName().equals(objectName.trim()));\n }",
"public boolean FromString(String string) {\n if (string.length() >= 38 && string.charAt(0) == '{' && string.charAt(37) == '}') {\n string = string.substring(1, 37);\n } else if (string.length() > 36) {\n string = string.substring(0, 36);\n }\n if (string.length() == 36) {\n string = string.substring(0, 36).replaceAll(\"-\", \"\");\n }\n if (string.length() != 32) {\n string = string.substring(0, 32);\n }\n data = new byte[16];\n for (int i = 0; i < 16; ++i) {\n data[i] = (byte) Integer.parseInt(string.substring(i * 2, (i * 2) + 2), 16);\n }\n return true;\n }",
"@Test\n public void testAtomString_8() {\n LOGGER.info(\"testAtomString_8\");\n final CharSequence s = \"Hello\";\n AtomString atomString1 = new AtomString(\"Hello\");\n AtomString atomString2 = new AtomString(s);\n assertEquals(atomString1, atomString2);\n }",
"@Override\n\tpublic void setPrimitiveAsString(boolean arg0) {\n\n\t}",
"public boolean hasStringValue() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }",
"private boolean isBinaryMessage(Object anObject) {\n\t\tif(anObject.getClass() == this.getClass()) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"public void testClone()\n {\n // as lifted from the JDK Object JavaDoc for clone:\n // x.clone() Creates and returns a copy of x.\n // The precise meaning of \"copy\" may depend on\n // the class of the object. The general intent\n // is that, for any object x, the expression: \n // x.clone() != x \n // will be true, and that the expression: \n // x.clone().getClass() == x.getClass()\n // will be true, but these are not absolute requirements.\n // While it is typically the case that:\n // x.clone().equals(x)\n // will be true, this is not an absolute requirement.\n // For EthernetAddress, this test will check that all the above\n // ARE true in the case of EthernetAddress clone() because it is\n // the desired behavior.\n EthernetAddress x = new EthernetAddress(VALID_ETHERNET_ADDRESS_STRING);\n assertTrue(\"x.clone() != x did not return true\",\n x.clone() != x);\n assertTrue(\"x.clone().getClass() == x.getClass() did not return true\",\n x.clone().getClass() == x.getClass());\n assertTrue(\"x.clone().equals(x) did not return true\",\n x.clone().equals(x));\n }",
"public boolean hasStringValue() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }",
"static boolean isArrayByteHex( byte[] arrayOctect ) {\n if (arrayOctect == null)\n return false;\n int length = arrayOctect.length;\n if (length % 2 != 0)\n return false;\n for( int i=0; i < length; i++ ){\n if( HexBin.isHex( arrayOctect[i] ) == false)\n return false;\n }\n return true;\n }",
"public static boolean isMinecraftObject(@Nonnull final Object obj) {\n \t\tif (obj == null) {\n \t\t\tthrow new IllegalArgumentException(\n \t\t\t\t\t\"Cannot determine the type of a null object.\");\n \t\t}\n \n \t\t// Doesn't matter if we don't check for the version here\n \t\treturn obj.getClass().getName().startsWith(MINECRAFT_PREFIX_PACKAGE);\n \t}",
"public void validateObject(Object object) throws AppointmentInvalidInputException {\r\n\t\ttry {\r\n\t\t\tobject.toString();\r\n\t\t}catch(NullPointerException exception) {\r\n\t\t\tthrow new AppointmentNotFoundException(String.format(AppointmentConstants.INVALID_INPUT, object), exception);\r\n\t\t}\r\n\t}",
"public boolean isString() {\n return this.data instanceof String;\n }",
"public boolean doesNotMatch(NakedObject nakedObject);",
"public boolean equals(XObject obj2) {\n/* */ try {\n/* 262 */ if (4 == obj2.getType())\n/* */ {\n/* */ \n/* */ \n/* */ \n/* */ \n/* 268 */ return obj2.equals(this);\n/* */ }\n/* 270 */ if (1 == obj2.getType())\n/* */ {\n/* 272 */ return (bool() == obj2.bool());\n/* */ }\n/* 274 */ if (2 == obj2.getType())\n/* */ {\n/* 276 */ return (num() == obj2.num());\n/* */ }\n/* 278 */ if (4 == obj2.getType())\n/* */ {\n/* 280 */ return xstr().equals(obj2.xstr());\n/* */ }\n/* 282 */ if (3 == obj2.getType())\n/* */ {\n/* 284 */ return xstr().equals(obj2.xstr());\n/* */ }\n/* 286 */ if (5 == obj2.getType())\n/* */ {\n/* */ \n/* */ \n/* 290 */ return xstr().equals(obj2.xstr());\n/* */ }\n/* */ \n/* */ \n/* 294 */ return super.equals(obj2);\n/* */ \n/* */ }\n/* 297 */ catch (TransformerException te) {\n/* */ \n/* 299 */ throw new WrappedRuntimeException(te);\n/* */ } \n/* */ }",
"@Test\n public void readSystemObjectClassAppointmentRequest() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"AppointmentRequest\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return AppointmentRequest properly\", object.getClass(), actual.getClass());\n }",
"public static boolean isCycLObject(Object obj) {\n return (obj instanceof CycObject ||\n obj instanceof InferenceParameters ||\n obj instanceof Boolean ||\n obj instanceof String ||\n obj instanceof Integer ||\n obj instanceof Long ||\n obj instanceof BigInteger ||\n obj instanceof Guid || //@hack this is wrong GUIDs are not CycL objects --APB\n obj instanceof Float ||\n obj instanceof Double);\n }",
"public void testEqualsObject()\n {\n // Null check\n assertFalse(b1.equals(null));\n // Type mismatch\n assertFalse(b1.equals(\"a\"));\n\n // Reflexive\n assertTrue(b1.equals(b1));\n\n // In general, two empty boards\n assertTrue(b1.equals(b2));\n\n // Different contents\n b1.setCell(0, 0, Cell.RED1);\n assertFalse(b1.equals(b2));\n\n // Same Contents\n b2.setCell(0, 0, Cell.RED1);\n assertTrue(b1.equals(b2));\n\n // Some more complex cases\n b1.fromString(\"RRRBEEBBE\");\n assertFalse(b1.equals(b2));\n b2.fromString(\"RRRBEEBBE\");\n assertTrue(b1.equals(b2));\n\n }",
"private boolean isBasicType(Object javaObject) {\n return javaObject == null\n || javaObject instanceof Number\n || javaObject instanceof Boolean\n || javaObject instanceof Character\n || javaObject instanceof Enum;\n }",
"@Test\n public void testEquals_1() {\n LOGGER.info(\"testEquals_1\");\n final AtomString atomString = new AtomString(\"Hello\");\n final Atom atom = new AtomString(\"Hello\");\n final boolean actual = atomString.equals(atom);\n assertTrue(actual);\n }",
"private static boolean isValidTypeString(String string)\r\n {\r\n return VALID_TYPE_STRINGS.contains(string);\r\n }",
"@Test\n public void equals() {\n Command commandCopy = new McqInputCommand(\"a\", mcqTest);\n assertTrue(G_MCQ_COMMAND.equals(commandCopy));\n\n // same object -> returns true\n assertTrue(commandCopy.equals(commandCopy));\n\n assertFalse(commandCopy.equals(null));\n\n // different type -> returns false\n assertFalse(commandCopy.equals(10));\n assertFalse(commandCopy.equals(\"TestString\"));\n }",
"static boolean isHex( byte octect ) {\n return( hexNumberTable[octect] != -1 );\n }",
"@Override\n\tpublic boolean supports(Object value) {\n\t\treturn value != null && (value instanceof String);\n\t}",
"@Test\n public void testRequireAtomString_GenericType() {\n LOGGER.info(\"requireAtomString\");\n Atom actual = null;\n final Atom expected = null;\n boolean caught = false;\n try {\n actual = requireAtomString(null);\n } catch (final ClassCastException ex) {\n caught = true;\n assertEquals(\"\", ex.getMessage());\n }\n assertTrue(caught);\n assertEquals(expected, actual);\n }",
"@DSSafe(DSCat.SAFE_OTHERS)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:53.096 -0500\", hash_original_method = \"AD601F3532730C1588B10C0B2F4700C0\", hash_generated_method = \"7CF3579665197E3D9616E88D35150E2D\")\n \npublic ASN1BitString() {\n super(TAG_BITSTRING);\n }",
"@Test\n public void testRequireAtomString_GenericType_String_2() {\n LOGGER.info(\"requireAtomString\");\n final AtomString actual = new AtomString();\n final AtomString expected = requireAtomString(actual, \"Message\");\n assertEquals(expected, actual);\n }",
"public synchronized boolean validate(Object data) {\n if (!(data instanceof String)) {\n return false;\n }\n\n String dataString = (String) data;\n dataString = dataString.replaceAll(\"\\\\s\", \"\").replaceAll(\"-\", \"\");\n if (dataString.length() != 6) {\n return false;\n }\n\n for (Character c : dataString.substring(0, 2).toCharArray()) {\n if (!Character.isLetter(c)) {\n return false;\n }\n }\n for (Character c : dataString.substring(3, 5).toCharArray()) {\n if (!Character.isDigit(c)) {\n return false;\n }\n }\n return true;\n }",
"@Test\n public void testAtomString_1() {\n LOGGER.info(\"testAtomString_1\");\n AtomString atomString1 = new AtomString();\n AtomString atomString2 = new AtomString();\n assertEquals(atomString1, atomString2);\n }",
"public static boolean plainText(Comparable value) {\r\n return value != null && value.toString().matches(REGEX_PLAINTEXT);\r\n }",
"@Test(timeout = 4000)\n public void test063() throws Throwable {\n String string0 = JSONObject.quote(\"=H ^/$6YUz29)n\");\n JSONObject jSONObject0 = new JSONObject();\n String string1 = JSONObject.valueToString(jSONObject0);\n assertFalse(string1.equals((Object)string0));\n }",
"boolean hasStringValue();",
"public void testToString()\n {\n // test making a few EthernetAddresss and check that the toString\n // gives back the same value in string form that was used to create it\n \n // test the null EthernetAddress\n EthernetAddress ethernet_address = new EthernetAddress(0L);\n assertEquals(\"null EthernetAddress string and toString did not match\",\n NULL_ETHERNET_ADDRESS_STRING.toLowerCase(),\n ethernet_address.toString().toLowerCase());\n \n // test a non-null EthernetAddress\n ethernet_address =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertEquals(\n \"EthernetAddress string and toString results did not match\",\n MIXED_CASE_VALID_ETHERNET_ADDRESS_STRING.toLowerCase(),\n ethernet_address.toString().toLowerCase());\n \n // EthernetAddress implementation returns strings all lowercase.\n // Although relying on this behavior in code is not recommended,\n // here is a unit test which will break if this assumption\n // becomes bad. This will act as an early warning to anyone\n // who relies on this particular behavior.\n ethernet_address =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"mixed case EthernetAddress string and toString \" +\n \"matched (expected toString to be all lower case)\",\n MIXED_CASE_VALID_ETHERNET_ADDRESS_STRING.equals(\n ethernet_address.toString()));\n assertEquals(\"mixed case string toLowerCase and \" +\n \"toString results did not match (expected toString to \" +\n \"be all lower case)\",\n MIXED_CASE_VALID_ETHERNET_ADDRESS_STRING.toLowerCase(),\n ethernet_address.toString());\n }",
"@Test\n public void testAtomString_9() {\n LOGGER.info(\"testAtomString_9\");\n final StringBuilder s = new StringBuilder(\"Hello\");\n AtomString atomString1 = new AtomString(\"Hello\");\n AtomString atomString2 = new AtomString(s);\n assertEquals(atomString1, atomString2);\n final StringBuilder ss = new StringBuilder(atomString1);\n assertEquals(s.toString(), ss.toString());\n }",
"@Test\n @Ignore\n public void testConvert() {\n System.out.println(\"convert\");\n Object object = null;\n SntParser instance = new SntParser();\n byte[] expResult = null;\n byte[] result = instance.convert(object);\n assertArrayEquals(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 static Boolean isEquals(String object1, String object2) {\n if (object1.equalsIgnoreCase(object2)) {\n return true;\n } else if (object1.equalsIgnoreCase(null) && object2.equalsIgnoreCase(null)) {\n return true;\n } else if (object1 == null && object2.equalsIgnoreCase(\"1\")) {\n return false;\n } else if (object1.equalsIgnoreCase(null) && !(object2.equalsIgnoreCase(null))){\n return false;\n }\n return false;\n\n }",
"protected boolean isJSONValid(String callReoprtResponse2) {\n try {\n new JSONObject(callReoprtResponse2);\n } catch (JSONException ex) {\n // edited, to include @Arthur's comment\n // e.g. in case JSONArray is valid as well...\n try {\n new JSONArray(callReoprtResponse2);\n } catch (JSONException ex1) {\n return false;\n }\n }\n return true;\n }",
"public boolean isPrimitiveOrString(String fieldType) {\n return fieldType.equals(\"int\") || fieldType.equals(\"short\") || fieldType.equals(\"long\") ||\n fieldType.equals(\"byte\") || fieldType.equals(\"char\") || fieldType.equals(\"float\") ||\n fieldType.equals(\"double\") || fieldType.equals(\"boolean\") || fieldType.equals(\"String\");\n }",
"@Test(timeout = 4000)\n public void test090() throws Throwable {\n JSONObject jSONObject0 = new JSONObject();\n JSONObject jSONObject1 = new JSONObject();\n jSONObject1.putOpt(\"\", jSONObject0);\n Byte.compare((byte)47, (byte)47);\n JSONObject.quote(\"\");\n JSONObject jSONObject2 = jSONObject1.optJSONObject(\"\");\n assertNotSame(jSONObject1, jSONObject2);\n }",
"@Test\n public void testEncode() {\n LOGGER.info(\"testEncode\");\n final String actual = new AtomString().encode();\n final String expected = \"0:\";\n assertEquals(expected, actual);\n }",
"public boolean isString() {\n return false;\n }",
"@Test\n\tpublic void TestR1NonIntegerParseableChars() {\n\t\tString invalid_solution = \"a74132865635897241812645793126489357598713624743526189259378416467251938381964572\";\n\t\tassertEquals(-1, sv.verify(invalid_solution));\n\t}",
"protected boolean isPrimitiveObject(Object object) {\r\n return PropertyType.PRIMITIVE.equals(determinePropertyType(object));\r\n }",
"@Test\n public void testAtomString_4() {\n LOGGER.info(\"testAtomString_4\");\n AtomString atomString1 = new AtomString(\"Hello\");\n AtomString atomString2 = new AtomString(\"Hej\");\n assertNotEquals(atomString1, atomString2);\n }",
"public static synchronized boolean isPrimitive(String value){\n\t\treturn ClassRegistry.xmlprimitives.containsKey(value);\n\t}",
"private boolean m16125a(Object obj) {\n return obj == null || obj.toString().equals(\"\") || obj.toString().trim().equals(\"null\");\n }",
"@Test\n public void testAtomString_2() {\n LOGGER.info(\"testAtomString_2\");\n AtomString atomString1 = new AtomString();\n Atom atom = new AtomString();\n assertEquals(atomString1, atom);\n }",
"@Test\n public void testAtomString_5() {\n LOGGER.info(\"testAtomString_5\");\n final AtomString hej = new AtomString(\"Hej\");\n final AtomString actual = new AtomString(hej);\n final AtomString expected = new AtomString(\"Hej\");\n assertEquals(expected, actual);\n }",
"public DERObject toASN1Object() {\n\t\treturn new DEROctetString(p.getEncoded());\n\t}",
"public static boolean isString(Object value) {\n\t\treturn value instanceof String;\n\t}",
"public boolean canProvideString();",
"public boolean isMaybeObjectOrSymbol() {\n checkNotPolymorphicOrUnknown();\n return object_labels != null;\n }",
"static public boolean isSavable(Object obj) {\n\tboolean rc = false;\n\n\tif ((obj instanceof Short) ||\n\t (obj instanceof Integer) ||\n\t (obj instanceof Long) ||\n\t (obj instanceof Float) ||\n\t (obj instanceof Double) ||\n\t (obj instanceof Boolean) ||\n\t (obj instanceof String) ||\n\t (obj instanceof Byte) ||\n\t (obj instanceof Color) ||\n\t (obj instanceof Font) ||\n\t (obj instanceof Rectangle2D) ||\n\t (obj instanceof AffineTransform) ||\n\t (obj instanceof Image) ||\n\t (obj instanceof ZSerializable)) {\n\t rc = true;\n\t}\n\n\treturn rc;\n }",
"public static boolean isEmptyString(Object o) {\n \tif (o instanceof java.lang.String) {\n \t\treturn isEmptyString((String)o);\n \t}\n \treturn false;\n \t\n }",
"public boolean equals(Object anObject) {\n/* 205 */ return this.m_str.equals(anObject);\n/* */ }",
"public static boolean isPrimitiveSchemaTypeStr(String typeStr) {\n boolean isPrimitive = false;\n\n // Use \"BYTES\" as the default type if the type string is not explicitly specified\n if (StringUtils.isBlank(typeStr)) {\n typeStr = \"BYTES\";\n }\n\n if (typeStr.equalsIgnoreCase(\"BOOLEAN\") || typeStr.equalsIgnoreCase(\"INT8\") ||\n typeStr.equalsIgnoreCase(\"INT16\") || typeStr.equalsIgnoreCase(\"INT32\") ||\n typeStr.equalsIgnoreCase(\"INT64\") || typeStr.equalsIgnoreCase(\"FLOAT\") ||\n typeStr.equalsIgnoreCase(\"DOUBLE\") || typeStr.equalsIgnoreCase(\"BYTES\") ||\n typeStr.equalsIgnoreCase(\"DATE\") || typeStr.equalsIgnoreCase(\"TIME\") ||\n typeStr.equalsIgnoreCase(\"TIMESTAMP\") || typeStr.equalsIgnoreCase(\"INSTANT\") ||\n typeStr.equalsIgnoreCase(\"LOCAL_DATE\") || typeStr.equalsIgnoreCase(\"LOCAL_TIME\") ||\n typeStr.equalsIgnoreCase(\"LOCAL_DATE_TIME\")) {\n isPrimitive = true;\n }\n\n return isPrimitive;\n }",
"@Test\n public void readSystemObjectClassAppointment() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"Appointment\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return Appointment properly\", object.getClass(), actual.getClass());\n }",
"public boolean isString()\n {\n return true;\n }",
"@Nonnull\n @Override\n public Boolean canCreate(@Nonnull Class<?> classObject) {\n return String.class.equals(classObject) || classObject.isEnum();\n }",
"@Test\n public void readSystemObjectClassAccCrRequest() throws UnsupportedEncodingException, IOException {\n ISystemObject object = Factory.createObject(\"AccountCreationRequest\");\n testJson = gson.toJson(object);\n\n //convert string to input stream\n InputStream inputStream = new ByteArrayInputStream(testJson.getBytes(Charset.forName(\"UTF-8\")));\n //convert inputstream to jsonReader\n JsonReader reader = new JsonReader(new InputStreamReader(inputStream, \"UTF-8\"));\n\n //read json string into resultant\n ISystemObject actual = DataHandler.readSystemObjectClass(reader);\n\n //compare results \n assertEquals(\"Fails to return AccountCreationRequest properly\", object.getClass(), actual.getClass());\n }",
"boolean _is_equivalent(org.omg.CORBA.Object other);",
"@Test\n public void testSerializeSimpleObject() throws Exception {\n schemaLoader = spy(RpcSchemaLoader.class);\n\n JsonNode responseSchema = om.readTree(\n \"{\\\"$ref\\\" : \\\"derived.json#/definitions/SomeStruct\\\"} \");\n // make the schema loader act as if there is a method called 'testMethod'\n // that has response schema\n doReturn(responseSchema).when(\n schemaLoader).loadResponseSchema(\"testMethod\");\n\n // make the schema loader act as if there is an Aion RPC type defined\n // at reference \"derived.json#/definitions/SomeStruct\" with the\n // JsonSchema of someStructTypeDef.\n JsonSchemaRef someStructTypeDef = new JsonSchemaRef(\n \"derived.json#/definitions/SomeStruct\");\n doReturn(someStructJsonSchema).when(\n schemaLoader).loadType(someStructTypeDef);\n\n ResponseSerializer unit = new ResponseSerializer(\n new JsonSchemaTypeResolver(schemaLoader),\n schemaLoader, om);\n String result = unit.serialize(\n new JsonRpcResponse(new SomeStruct(\n SerializationUtils.hexStringToByteArray(\"0x68d1d3bffe8672cf1e9e85fbdb9f62744ccf7d7ac5848e7d46441169db99112a\"),\n BigInteger.valueOf(1337)\n ), \"1.0\"),\n \"testMethod\");\n\n // can't just compare the whole string because ordering\n // of object fields aren't fixed\n JsonNode resultJson = om.readTree(result);\n assertThat(resultJson.get(\"myQuantity\").asText(), is(\"0x539\"));\n assertThat(resultJson.get(\"myData\").asText(),\n is(\"0x68d1d3bffe8672cf1e9e85fbdb9f62744ccf7d7ac5848e7d46441169db99112a\"));\n\n }",
"public static void main(String[] args) {\n AnObject anObject;\n \n assertEquals(\n \"AnObject [aString=string, anInteger=123, aCharacter=c]\",\n anObject.toString());\n }",
"public boolean hasUnicodeRepresentation();",
"public boolean hasScStr() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }",
"protected boolean isPrimitiveOrString(Class<?> clazz) {\n return clazz.isPrimitive() || clazz.isAssignableFrom(String.class);\n }",
"private static boolean isParsable(String input) {\n try {\n Integer.parseInt(input);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }",
"public boolean hasScStr() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }",
"protected boolean isObjectDataBinding(String text)\n\t{\n\t\tif (text!= null && RegexpPatterns.REGEXP_CRUX_OBJECT_DATA_BINDING.matcher(text).matches())\n\t\t{\n\t\t\tString[] parts = ViewFactoryCreator.getDataObjectParts(text);\n\t\t\treturn (DataObjects.getDataObject(parts[0]) != null);\n\t\t}\n\t\treturn false;\n\t}",
"@Test\n public void testWithNonEmptyJsonObjectAsString() throws org.nfunk.jep.ParseException\n {\n Stack<Object> parameters = CollectionsUtils.newParametersStack(\"{\\\"test\\\":1}\");\n function.run(parameters);\n assertEquals(FALSE, parameters.pop());\n }",
"public boolean isValidISBN13(String sISBN) throws java.rmi.RemoteException;",
"private boolean isType(String type, Object value) {\n boolean ret = false;\n String val = String.valueOf(value).toUpperCase();\n if (val.equals(\"NULL\")) {\n ret = true;\n } else if (val.contains(\"BASE64\")) {\n ret = true;\n } else {\n if (type.equals(\"NULL\") && value instanceof JSONObject) ret = true;\n if (type.equals(\"TEXT\") && value instanceof String) ret = true;\n if (type.equals(\"INTEGER\") && value instanceof Integer) ret = true;\n if (type.equals(\"INTEGER\") && value instanceof Long) ret = true;\n if (type.equals(\"REAL\") && value instanceof Float) ret = true;\n if (type.equals(\"BLOB\") && value instanceof Blob) ret = true;\n }\n return ret;\n }",
"public abstract boolean canDecodeInput(Object source) throws IOException;",
"@Test\r\n\tpublic void toStringValid() {\r\n\t\ttestObj.addNativeField(0);\r\n\t\ttestObj.addNativeField(1);\r\n\t\ttestObj.addRelatedTable(0);\r\n\t\ttestObj.addRelatedTable(1);\r\n\t\ttestObj.makeArrays();\r\n\t\ttestObj.toString();\r\n\t\tassertEquals(\"Output string should have valid data\", \"Table: 1\\r\\n{\\r\\nTableName: test\\r\\nNativeFields: 0|1\\r\\nRelatedTables: 0|1\\r\\nRelatedFields: 0|0\\r\\n}\\r\\n\", testObj.toString());\r\n\t}"
] | [
"0.56612587",
"0.5270918",
"0.52390164",
"0.52016884",
"0.5168638",
"0.5113443",
"0.49898762",
"0.49348146",
"0.49207422",
"0.48661286",
"0.48444068",
"0.4841599",
"0.4838968",
"0.48376948",
"0.48323286",
"0.48195854",
"0.48054126",
"0.4796904",
"0.47966436",
"0.47611868",
"0.47556645",
"0.4751214",
"0.47503",
"0.4700157",
"0.46935642",
"0.46793362",
"0.46745372",
"0.4641532",
"0.46400043",
"0.4621829",
"0.4616182",
"0.4613485",
"0.46030965",
"0.45904413",
"0.45857605",
"0.45850536",
"0.4584293",
"0.45799255",
"0.4579358",
"0.45608556",
"0.45497286",
"0.45485306",
"0.45464095",
"0.45414144",
"0.45255905",
"0.44890016",
"0.44871628",
"0.44735017",
"0.44700536",
"0.44548056",
"0.44514126",
"0.4445561",
"0.44426164",
"0.4441078",
"0.44388375",
"0.44323063",
"0.4428335",
"0.44256023",
"0.44229543",
"0.4410939",
"0.4408909",
"0.44077814",
"0.44076744",
"0.44057792",
"0.44053903",
"0.44001377",
"0.4396204",
"0.43949485",
"0.4393626",
"0.4383643",
"0.4382265",
"0.43808296",
"0.4373124",
"0.4370264",
"0.43681616",
"0.4363126",
"0.43630418",
"0.43476635",
"0.43366337",
"0.433657",
"0.4332812",
"0.43247628",
"0.43246922",
"0.4320806",
"0.43184897",
"0.43158874",
"0.43143746",
"0.43141773",
"0.43137076",
"0.43115726",
"0.4309378",
"0.43069983",
"0.42947027",
"0.4285787",
"0.4284239",
"0.428209",
"0.42695865",
"0.42678055",
"0.42673424",
"0.4259435"
] | 0.71583 | 0 |
Checks whether or not an Object is an ASN1 Integer. To be used to check all supposed integers that are inputs from outside the TSE. Does currently only accept Objects that can be boxed to Integer, Long, and BigInteger. | public static boolean isASN1_Integer(Object supposedInteger) {
//null is no Integer
if(supposedInteger == null) {
return false;
}
//Integer, Long, and BigInteger are considered Integers
if(supposedInteger instanceof Integer) {
return true;
}
else if(supposedInteger instanceof Long) {
return true;
}
else if(supposedInteger instanceof BigInteger) {
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isInteger();",
"public static boolean isInt(Object value) {\n\t\treturn value instanceof BigInteger;\n\t}",
"public boolean isInt() {\n return this.data instanceof Integer;\n }",
"public boolean isInteger() {\n return false;\n }",
"public boolean hasOwnProperty(final Object obj) {\n if (Objects.isAssignableOrBox(obj, Integer.TYPE)) {\n final Integer i = (Integer) JavaScript.getInstance().getJavaObject(obj, Integer.TYPE);\n return i < getLength();\n } else {\n return false;\n }\n }",
"BigInteger getInteger() {\n\n\t\t\tif (this.type != DerParser.INTEGER) {\n\t\t\t\tthrow new IllegalStateException(String.format(\"Invalid DER: object (%d) is not integer.\", this.type));\n\t\t\t}\n\n\t\t\treturn new BigInteger(this.value);\n\t\t}",
"public static Integer toInteger(Object value) {\n if (value instanceof Integer)\n return (Integer)value;\n else if (value instanceof Long)\n return (int)(long)(Long)value;\n else if (value instanceof Double)\n return (int)(double)(Double)value;\n else if (value == null)\n return null;\n else\n throw new RuntimeException(\"Can't convert [\" + value + \"] to Integer\");\n }",
"public boolean hasIntValue() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }",
"public boolean hasIntValue() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }",
"static boolean isInteger(char c) {\n\t\t\tswitch (c) {\n\t\t\t\tcase DECIMAL_INTEGER:\n\t\t\t\tcase OCTAL_INTEGER:\n\t\t\t\tcase HEXADECIMAL_INTEGER:\n\t\t\t\tcase HEXADECIMAL_INTEGER_UPPER:\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"boolean hasInt();",
"boolean isInt(TextField input);",
"public BigInteger getInteger() throws IOException {\n if ( type != DerParser.INTEGER ) {\n throw new IOException(\n BaseMessages.getString( MQTTPublisherMeta.PKG, \"MQTTClientSSL.Error.InvalidDERObjectIsNotAnInteger\" ) );\n }\n\n return new BigInteger( value );\n }",
"IntegerValue getValueObject();",
"public T caseIntegerValue(IntegerValue object) {\n\t\treturn null;\n\t}",
"boolean hasIntValue();",
"public boolean isInteger() {\n try {\n Integer.parseInt(txt.getText());\n return true;\n } catch (Exception e) {\n return error(\"El valor debe ser un numero entero!\");\n }\n }",
"public static boolean isInteger(Symbol symbol) {\n return (symbol != null && isInteger(symbol.getTypeSpecifiers()));\n }",
"public static boolean isInteger(String s) {\n\t try { Integer.parseInt(s); }\n\t catch(NumberFormatException e) { return false; }\n\t catch(NullPointerException e) { return false; }\n\t // only gets here if the entered String is Integer:\n\t return true;\n\t}",
"public static Integer toInteger(Object o,byte type) throws ExecException {\n try {\n switch (type) {\n case BOOLEAN:\n if (((Boolean)o) == true) {\n return Integer.valueOf(1);\n } else {\n return Integer.valueOf(0);\n }\n\n case BYTE:\n return Integer.valueOf(((Byte)o).intValue());\n\n case INTEGER:\n return (Integer)o;\n\n case LONG:\n return Integer.valueOf(((Long)o).intValue());\n\n case FLOAT:\n return Integer.valueOf(((Float)o).intValue());\n\n case DOUBLE:\n return Integer.valueOf(((Double)o).intValue());\n\n case BYTEARRAY:\n return Integer.valueOf(((DataByteArray)o).toString());\n\n case CHARARRAY:\n return Integer.valueOf((String)o);\n\n case BIGINTEGER:\n return Integer.valueOf(((BigInteger)o).intValue());\n\n case BIGDECIMAL:\n return Integer.valueOf(((BigDecimal)o).intValue());\n\n case NULL:\n return null;\n\n case DATETIME:\n return Integer.valueOf(Long.valueOf(((DateTime)o).getMillis()).intValue());\n\n case MAP:\n case INTERNALMAP:\n case TUPLE:\n case BAG:\n case UNKNOWN:\n default:\n int errCode = 1071;\n String msg = \"Cannot convert a \" + findTypeName(o) +\n \" to an Integer\";\n throw new ExecException(msg, errCode, PigException.INPUT);\n }\n } catch (ClassCastException cce) {\n throw cce;\n } catch (ExecException ee) {\n throw ee;\n } catch (NumberFormatException nfe) {\n int errCode = 1074;\n String msg = \"Problem with formatting. Could not convert \" + o + \" to Integer.\";\n throw new ExecException(msg, errCode, PigException.INPUT, nfe);\n } catch (Exception e) {\n int errCode = 2054;\n String msg = \"Internal error. Could not convert \" + o + \" to Integer.\";\n throw new ExecException(msg, errCode, PigException.BUG);\n }\n }",
"boolean hasIntSize();",
"public T caseInteger(sensorDeploymentLanguage.Integer object) {\n\t\treturn null;\n\t}",
"private int isInteger(String s) {\r\n\t\t\tint retInt;\r\n\t\t try { \r\n\t\t \tretInt = Integer.parseInt(s); \r\n\t\t } catch(NumberFormatException e) { \r\n\t\t return -1; \r\n\t\t } catch(NullPointerException e) {\r\n\t\t return -1;\r\n\t\t }\r\n\t\t // only got here if we didn't return false\r\n\t\t return retInt;\r\n\t\t}",
"public boolean hasIntSize() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }",
"public boolean hasInteger32() {\n return result.hasInteger32();\n }",
"public boolean hasIntSize() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }",
"public void visitINEG(INEG o){\n\t\tif (stack().peek() != Type.INT){\n\t\t\tconstraintViolated(o, \"The value at the stack top is not of type 'int', but of type '\"+stack().peek()+\"'.\");\n\t\t}\n\t}",
"public static int toInt(java.lang.Object o)\n {\n if(o == null)\n {\n return 0;\n }\n else if(o.toString().equals(\"\"))\n {\n return 0;\n }\n else\n {\n return Integer.parseInt(o.toString());\n }\n }",
"public static boolean isInteger(String s) {\n\t try { \n\t Integer.parseInt(s); \n\t } catch(NumberFormatException e) { \n\t return false; \n\t }\n\t return true;\n\t}",
"public final boolean isIntegral() {\n return this.equals(BYTE)\n || this.equals(CODE)\n || this.equals(SHORT)\n || this.equals(INT)\n || this.equals(LONG)\n || this.equals(UBYTE)\n || this.equals(UINT)\n || this.equals(ULONG)\n || this.equals(USHORT);\n }",
"public boolean isInteger(String input){\r\n try{\r\n Integer.parseInt(input);\r\n } catch (NumberFormatException e){\r\n return false;\r\n } catch (NullPointerException e){\r\n return false;\r\n }\r\n return true;\r\n }",
"public boolean isInt(String value) {\n try {\n Integer.parseInt(value);\n return true;\n } catch (Exception e) {\n return false;\n }\n }",
"public static final long Integer(final Object o) {\n\t\t\n\t\treturn Convert.Any.toLong(o, 0);\n\t}",
"private boolean isInt (String s) {\n\t\ttry {\n\t\t\tif(Integer.parseInt(s) < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tcatch(NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\tcatch(NullPointerException e) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"private static boolean isInteger(String s) {\r\n try {\r\n Integer.parseInt(s);\r\n return true;\r\n } catch (Exception ex) {\r\n return false;\r\n }\r\n }",
"public static boolean isInteger(String value) {\n\t\ttry {\n\t\t\tInteger.parseInt(value);\n\t\t}\n\t\t \n\t\tcatch(NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public static boolean isInteger(String s) {\n\t\ttry { \n\t\t\tInteger.parseInt(s); \n\t\t} catch(NumberFormatException e) { \n\t\t\treturn false; \n\t\t} catch(NullPointerException e) {\n\t\t\treturn false;\n\t\t}\n\t\t// only got here if we didn't return false\n\t\treturn true;\n\t}",
"public final Integer _parseInteger(JsonParser jVar, DeserializationContext gVar) throws IOException {\n int m = jVar.mo29329m();\n if (m == 3) {\n return (Integer) _deserializeFromArray(jVar, gVar);\n }\n if (m == 11) {\n return (Integer) _coerceNullToken(gVar, this._primitive);\n }\n switch (m) {\n case 6:\n String trim = jVar.mo29334t().trim();\n int length = trim.length();\n if (length == 0) {\n return (Integer) _coerceEmptyString(gVar, this._primitive);\n }\n if (_hasTextualNull(trim)) {\n return (Integer) _coerceTextualNull(gVar, this._primitive);\n }\n _verifyStringForScalarCoercion(gVar, trim);\n if (length <= 9) {\n return Integer.valueOf(NumberInput.m23779a(trim));\n }\n try {\n long parseLong = Long.parseLong(trim);\n if (!_intOverflow(parseLong)) {\n return Integer.valueOf((int) parseLong);\n }\n return (Integer) gVar.mo31517b(this._valueClass, trim, String.format(\"Overflow: numeric value (%s) out of range of Integer (%d - %d)\", trim, Integer.MIN_VALUE, Integer.MAX_VALUE), new Object[0]);\n } catch (IllegalArgumentException unused) {\n return (Integer) gVar.mo31517b(this._valueClass, trim, \"not a valid Integer value\", new Object[0]);\n }\n case 7:\n return Integer.valueOf(jVar.mo29247C());\n case 8:\n if (!gVar.mo31509a(DeserializationFeature.ACCEPT_FLOAT_AS_INT)) {\n _failDoubleToIntCoercion(jVar, gVar, \"Integer\");\n }\n return Integer.valueOf(jVar.mo29296K());\n default:\n return (Integer) gVar.mo31493a(this._valueClass, jVar);\n }\n }",
"private static boolean validateInteger(String intString) {\n try {\n Integer.parseInt(intString);\n } catch (NumberFormatException e) {\n // Not a valid integer\n return false;\n }\n return true;\n }",
"private void valueOfInt(Instruction o, Type value){\n\t\tif (! value.equals(Type.INT))\n\t\t\t\tconstraintViolated(o, \"The 'value' is not of type int but of type \"+value+\".\");\n\t}",
"public boolean isInteger(String x){\n try{\n Integer.parseInt(x);\n \n }\n catch(NumberFormatException e){\n return false;\n }\n return true;\n }",
"public static boolean isInteger(String s) {\r\n\t\ttry {\r\n\t\t\tInteger.parseInt(s);\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\treturn false;\r\n\t\t} catch (NullPointerException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public T caseIntegerLiteral(IntegerLiteral object)\n {\n return null;\n }",
"public static Integer toInteger(java.lang.Object o)\n {\n\t if(o == null)\n\t {\n\t return 0;\n\t }\n\t else if(o.toString().equals(\"\"))\n\t {\n\t return 0;\n\t }\n\telse\n\t{\n\t return Integer.valueOf(o.toString());\n\t}\n }",
"public boolean isAnInt(String str) {\r\n \ttry {\r\n \t\tInteger.parseInt(str);\r\n \t} catch (NumberFormatException e) {\r\n \t\treturn false;\r\n \t}\r\n \treturn true;\r\n }",
"public static boolean integerType(FileInputStream f){\n if(observer != null){\n observer.parser.setCurrentRule(\"integerType\", true);\n }\n CToken t = new CToken();\n\n t = getUsePeek(f);\n \n String[] types = {\"char\",\"short\",\"int\",\"long\"};\n \n //unsigned (optional)\n if(t.token.equals(\"unsigned\")){\n CScanner.needToUsePeekedToken = false; //consumed token\n t = CScanner.getNextToken(f); //get and check next token\n if(observer != null){\n observer.parser.setCurrentToken(t);\n }\n if(!Arrays.asList(types).contains(t.token)){\n System.err.format(\"Syntax Error: In rule IntegerType unexpected token \\\"%s\\\" of type %s on line %d.\\n\", t.token, t.type, t.lineNum);\n System.exit(0);\n }\n }\n else if(!Arrays.asList(types).contains(t.token)){\n if(observer != null){\n observer.parser.setCurrentRule(\"integerType\", false);\n }\n return false;\n } // char | short | int | long\n \n CScanner.needToUsePeekedToken = false;\n if(observer != null){\n observer.parser.setCurrentRule(\"integerType\", false);\n }\n return true;\n }",
"public static int asn1Value_ByteArrayToInteger(byte[] asn1IntValue) throws ValueNullException, ValueTooBigException {\n\t\t//check if the array is null\n\t\tif(asn1IntValue == null) {\n\t\t\tthrow new ValueNullException(\"The input is null, not an encoded integer\");\n\t\t}\n\t\t//check if the value 0 has been encoded\n\t\tif((asn1IntValue[0] == 0) && (asn1IntValue.length == 1) ) {\n\t\t\treturn 0;\n\t\t}\n\t\t//check if the value is too long to be converted to an integer\n\t\tif((asn1IntValue.length>4)) {\n\t\t\tthrow new ValueTooBigException(\"Java integer can only hold 32 bits or 4 octets. The passed value is bigger than that\");\n\t\t}\n\t\t\n\t\tBigInteger tmpInt = new BigInteger(asn1IntValue);\n\t\treturn tmpInt.intValue();\n\t}",
"public static boolean isIntegral(Object number) {\n\t\treturn isIntegralClass(number.getClass());\n\t}",
"public void visitIDIV(IDIV o){\n\t\tif (stack().peek() != Type.INT){\n\t\t\tconstraintViolated(o, \"The value at the stack top is not of type 'int', but of type '\"+stack().peek()+\"'.\");\n\t\t}\n\t\tif (stack().peek(1) != Type.INT){\n\t\t\tconstraintViolated(o, \"The value at the stack next-to-top is not of type 'int', but of type '\"+stack().peek(1)+\"'.\");\n\t\t}\n\t}",
"@Override\n\t\t\tpublic boolean test(Integer t) {\n\t\t\t\treturn false;\n\t\t\t}",
"public void testInt2bi()\n {\n assertEquals( Util.int2bi(15), new BigInteger(\"15\") );\n assertEquals( Util.int2bi(new Integer(15)), new BigInteger(\"15\") );\n }",
"public boolean isInt(String text)\r\n {\r\n try\r\n {\r\n int ans = Integer.parseInt(text);\r\n return true;\r\n }\r\n catch(NumberFormatException e)\r\n {\r\n return false;\r\n }\r\n }",
"public boolean equals(Object obj) {\n if (obj instanceof MutableInteger) {\n return m_value == ((MutableInteger) obj).intValue();\n }\n return false;\n }",
"private boolean isInteger(String a) {\n try \n {\n Integer.parseInt(a);\n return true;\n }\n catch(Exception e) {\n return false;\n }\n }",
"private boolean isInteger(String element) {\r\n try {\r\n Integer.valueOf(element);\r\n } catch (NumberFormatException e) {\r\n return false;\r\n }\r\n return true;\r\n }",
"public static boolean isInteger(String s)\r\n {\r\n if (s == null || s.length() == 0)\r\n return false;\r\n \r\n //integer regular expression\r\n String regex = \"[-|+]?\\\\d+\";\r\n if (!s.matches(regex))\r\n return false;\r\n \r\n if (s.startsWith(\"+\"))\r\n s = s.substring(1);\r\n \r\n //try convert the string to an int\r\n //if it can not be converted, then return false\r\n try\r\n {\r\n Integer.parseInt(s);\r\n }catch(Exception e)\r\n {\r\n return false;\r\n }\r\n \r\n return true;\r\n }",
"@Test\n public void intInvalidType() throws Exception {\n String retVal = new SynapseHelper().serializeToSynapseType(MOCK_TEMP_DIR, TEST_PROJECT_ID, TEST_RECORD_ID,\n TEST_FIELD_NAME, UploadFieldTypes.INT, new TextNode(\"-13\"));\n assertNull(retVal);\n }",
"public static boolean isInteger(String s) {\n\t\ttry {\n\t\t\tInteger.parseInt(s);\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public static boolean is_int(String s) {\n try {\n Integer.parseInt(s);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }",
"public boolean isInteger(String sIntString) {\n int i = 0;\n try {\n i = Integer.parseInt(sIntString);\n return true;\n } catch (Exception e) {\n return false;\n }\n }",
"public static boolean isInteger(String s) {\n\t return isInteger(s,10);\n\t}",
"public int getIntegerValue() {\n throw new OurBadException(\" Item '\" + this.serialize() + \"' is not an integer.\");\n }",
"public static boolean isInteger(String s) {\n try {\n Integer.parseInt(s);\n } catch(NumberFormatException e) {\n return false;\n } catch(NullPointerException e) {\n return false;\n }\n return true;\n }",
"public void visitISUB(ISUB o){\n\t\tif (stack().peek() != Type.INT){\n\t\t\tconstraintViolated(o, \"The value at the stack top is not of type 'int', but of type '\"+stack().peek()+\"'.\");\n\t\t}\n\t\tif (stack().peek(1) != Type.INT){\n\t\t\tconstraintViolated(o, \"The value at the stack next-to-top is not of type 'int', but of type '\"+stack().peek(1)+\"'.\");\n\t\t}\n\t}",
"public GdbIntValue parseInteger() throws GdbParseError {\n\t\ttry {\n\t\t\tString match = match(INT_HEX, true, \"hex\");\n\t\t\treturn GdbIntValue.valueOf(new BigInteger(match, 16));\n\t\t}\n\t\tcatch (GdbParseError e) {\n\t\t\t// Just try next match\n\t\t}\n\t\ttry {\n\t\t\tString match = match(INT_OCT, true, \"oct\");\n\t\t\treturn GdbIntValue.valueOf(new BigInteger(match, 8));\n\t\t}\n\t\tcatch (GdbParseError e) {\n\t\t\t// Just try next match\n\t\t}\n\t\ttry {\n\t\t\tString match = match(INT_DEC, true, \"dec\");\n\t\t\treturn GdbIntValue.valueOf(new BigInteger(match, 10));\n\t\t}\n\t\tcatch (GdbParseError e) {\n\t\t\t// Fall through to error report\n\t\t}\n\n\t\tthrow new GdbParseError(\"0x[hex], 0[oct], or [dec]\", buf);\n\t}",
"@Test\n\tpublic void testInt2() {\n\t\tTextField intText = new TextField(\"-23\");\n\t\tboolean checkIntText = initTest.checkIntValues(intText);\n\t\tassertFalse(checkIntText);\n\t}",
"public static boolean isInteger(String input) {\n try {\n Integer.parseInt(input);\n return true;\n } catch (Exception e) {\n return false;\n }\n\n }",
"private static int unbox(Integer i) {\n\t\treturn (i == null) ? 0 : i;\n\t}",
"private boolean isInteger(String userInput){\n if (userInput.matches(\"[0-9]+\")) {\n return true;\n }\n return false;\n }",
"public static boolean isInt(String val){\n\t try\n\t {\n\t Integer.parseInt(val);\n\t return true;\n\t } catch (NumberFormatException ex)\n\t {\n\t \tSystem.out.println(\"Please enter integer\");\n\t return false;\n\t }\n\t \n\t}",
"public T caseIntegerExpression(IntegerExpression object) {\n\t\treturn null;\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tInteger obj= new Integer(10);\n\t\t\n\t\tint value=obj.intValue();\n\t\t\n\t\tint data=obj; //auto unboxing\n\t\t//int data=obj.intValue();\n\t\t\n\t\tobj=200; //autoboxing\n\t\t//obj=new Integer(200);\n\n\t}",
"public T caseIntegerComparisonExpression(IntegerComparisonExpression object) {\n\t\treturn null;\n\t}",
"public static Integer castInt(Object o) {\n\t\tif (o instanceof Number) {\n\t\t\treturn ((Number) o).intValue();\n\t\t}\n\n\t\treturn null;\n\t}",
"public static boolean isInteger(String string) {\r\n\t try {\r\n\t Integer.valueOf(string);\r\n\t return true;\r\n\t } catch (NumberFormatException e) {\r\n\t return false;\r\n\t }\r\n\t}",
"public void visitIFLE(IFLE o){\n\t\tif (stack().peek() != Type.INT){\n\t\t\tconstraintViolated(o, \"The value at the stack top is not of type 'int', but of type '\"+stack().peek()+\"'.\");\n\t\t}\n\t}",
"private boolean isInteger(String s)\n{\n\t boolean isNumber = true;\n\ttry{\n\t\t\tint n = Integer.parseInt(s);\n\t }catch(NumberFormatException n)\n\t {\n\t\t isNumber = false;\n\t }\n\n\treturn isNumber;\n}",
"boolean isNumericPubmed(String id){\n\t\t \n\t\t try{\n\t\t\t Integer.parseInt(id);\n\t\t }catch (Exception e){\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }",
"public static boolean IS_INTEGER(String t) {\n\n return (t.equals(Feature.INTEGER));\n }",
"public static boolean isInteger(String value) {\n boolean valid = false;\n try {\n Integer.parseInt(value);\n valid = true;\n } catch (RuntimeException exc) {\n // could not parse into int, false will be returned\n }\n return valid;\n }",
"private boolean isInt(String str) { \n\t try { \n\t int d = Integer.parseInt(str); \n\t } catch(NumberFormatException nfe) { \n\t return false; \n\t } \n\t return true; \n\t}",
"public void visitIF_ICMPGE(IF_ICMPGE o){\n\t\tif (stack().peek() != Type.INT){\n\t\t\tconstraintViolated(o, \"The value at the stack top is not of type 'int', but of type '\"+stack().peek()+\"'.\");\n\t\t}\n\t\tif (stack().peek(1) != Type.INT){\n\t\t\tconstraintViolated(o, \"The value at the stack next-to-top is not of type 'int', but of type '\"+stack().peek(1)+\"'.\");\n\t\t}\n\t}",
"public static Integer parseInt(Object s) {\n\t\tif (s == null)\n\t\t\treturn 0;\n\t\tif (s != null && s.toString().isEmpty())\n\t\t\t;\n\t\treturn Integer.parseInt(s.toString());\n\t}",
"@ZenCodeType.Caster\n @ZenCodeType.Method\n default int asInt() {\n \n return notSupportedCast(BasicTypeID.INT);\n }",
"public static boolean checkInt(Scanner scan) {\n\n if (scan.hasNextInt()) {//if the input is an integer\n return (true);\n }\n else {\n System.out.print(\"You did not enter an int; try again: \");\n return (false);\n \n }\n\n }",
"public static boolean isInt(String pram)\r\n {\r\n try{\r\n Integer.parseInt(pram);\r\n return true;\r\n }catch(NumberFormatException e){\r\n return false;\r\n }\r\n }",
"public static void main(String[] args) { \r\n MyInteger n1 = new MyInteger(5); \r\n System.out.println(\"n1 is even? \" + n1.isEven());\r\n System.out.println(\"n1 is prime? \" + n1.isPrime());\r\n System.out.println(\"15 is prime? \" + MyInteger.isPrime(15));\r\n char[] chars = {'3', '5', '3', '9'};\r\n System.out.println(MyInteger.parseInt(chars));\r\n String s = \"3539\";\r\n System.out.println(MyInteger.parseInt(s));\r\n MyInteger n2 = new MyInteger(24); \r\n System.out.println(\"n2 is odd? \" + n2.isOdd());\r\n System.out.println(\"45 is odd? \" + MyInteger.isOdd(45));\r\n System.out.println(\"n1 is equal to n2? \" + n1.equals(n2));\r\n System.out.println(\"n1 is equal to 5? \" + n1.equals(5));\r\n }",
"private boolean isStringAnInt(String s) {\n // false if string is null\n if (s == null) {\n return false;\n }\n // if scanner get parse string for int then return true\n try {\n Scanner sc = new Scanner(s);\n int num = sc.nextInt();\n }\n // return false if it throws an exception\n catch (Exception e) {\n return false;\n }\n return true;\n }",
"public static int getNumObj() //Gets the number of objects \r\n {\r\n int numObj = -1;\r\n try {\r\n if (numObj <= 0) {\r\n numObj = Integer.parseInt((JOptionPane.showInputDialog(\"Please enter (POSITIVE) INTEGER for NUMBER-OF-OJECTS: \")));\r\n if (numObj <= 0) {\r\n throw new NumberFormatException();\r\n }\r\n }\r\n } catch (Exception NumberFormatException) {\r\n JOptionPane.showMessageDialog(null, \"ERROR!!!\\n - NUMBER OF OBJECTS MUST BE A (POSITIVE) INTEGER - \\n Please try again! \\n \", null, JOptionPane.ERROR_MESSAGE);\r\n numObj = getNumObj(); //recursion\r\n }\r\n\r\n return numObj;\r\n }",
"@Override\n public boolean equals(Object obj) {\n if (obj == null) {\n return false;\n }\n\n if (TkRefexIntRevision.class.isAssignableFrom(obj.getClass())) {\n TkRefexIntRevision another = (TkRefexIntRevision) obj;\n\n // =========================================================\n // Compare properties of 'this' class to the 'another' class\n // =========================================================\n // Compare intValue\n if (this.intValue != another.intValue) {\n return false;\n }\n\n // Compare their parents\n return super.equals(obj);\n }\n\n return false;\n }",
"public boolean accepts(Object value) {\n if(value instanceof Number) {\n short s = ((Number) value).shortValue();\n try {\n assertValidUnsignedByte(s);\n } catch (AxionException e) {\n return false;\n }\n return true;\n } else {\n return super.accepts(value);\n }\n }",
"public T caseIntegerVariable(IntegerVariable object) {\n\t\treturn null;\n\t}",
"public T caseExpression_Integer(Expression_Integer object)\r\n {\r\n return null;\r\n }",
"public static int toInt(IRubyObject irb) {\n\t\treturn Integer.valueOf(irb.toString());\n\t}",
"@Override\n public Type evaluateType() throws Exception {\n return new IntegerType();\n }",
"public boolean isKnownPrimitive() {\r\n return id > 0 && type != null;\r\n }",
"@Override\r\n public boolean checkElements(SequenceConstructionExpression owner) {\r\n SequenceRange self = this.getSelf();\r\n Expression rangeLower = self.getRangeLower();\r\n Expression rangeUpper = self.getRangeUpper();\r\n ElementReference rangeLowerType = rangeLower == null? null: rangeLower.getType();\r\n ElementReference rangeUpperType = rangeUpper == null? null: rangeUpper.getType();\r\n return (rangeLowerType == null || rangeLowerType.getImpl().isInteger()) && \r\n (rangeUpperType == null || rangeUpperType.getImpl().isInteger());\r\n }",
"public static void main(String[] args) {\n\r\n\t\tInteger obj = new Integer(10);\r\n\t\t\r\n\t\t//Converting Wrapper object to primitive data type\r\n\t\t\r\n\t\tint num = obj.intValue();\r\n\t\t\r\n\t\tSystem.out.println(num+ \" \"+ obj);\r\n\r\n\t}",
"public static boolean isInteger(String s) {\n return isInteger(s,10);\n }",
"private static boolean isPositiveInteger(String s){\n\t\ttry{\n\t\t\t//If the token is an integer less than 0 return false\n\t\t\tif(Integer.parseInt(s) < 0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//If an exception occurs return false\n\t\tcatch(NumberFormatException e){\n\t\t\treturn false;\n\t\t}\n\t\t//otherwise return true\n\t\treturn true;\n\t}"
] | [
"0.70471764",
"0.67913496",
"0.6642677",
"0.63678664",
"0.59079665",
"0.5901326",
"0.5850096",
"0.58098304",
"0.58030486",
"0.5782513",
"0.5777051",
"0.5713227",
"0.5693955",
"0.56537527",
"0.5629114",
"0.5609913",
"0.55727893",
"0.55614495",
"0.5538149",
"0.5531026",
"0.5526244",
"0.55208373",
"0.5509086",
"0.55043536",
"0.5498121",
"0.5494031",
"0.54875255",
"0.54708034",
"0.54654276",
"0.54553884",
"0.54423356",
"0.5438312",
"0.5438018",
"0.54306",
"0.5426264",
"0.54220694",
"0.5417684",
"0.5408705",
"0.539319",
"0.5385392",
"0.5378309",
"0.5353034",
"0.5343294",
"0.5324129",
"0.53230476",
"0.5313547",
"0.53108585",
"0.53099585",
"0.5305786",
"0.5281001",
"0.5279697",
"0.5275477",
"0.52744657",
"0.52704203",
"0.5266031",
"0.525193",
"0.5246765",
"0.5231647",
"0.5225178",
"0.5223678",
"0.52086145",
"0.52075547",
"0.5202939",
"0.5202821",
"0.519626",
"0.5187185",
"0.5185765",
"0.5185565",
"0.51855606",
"0.5184172",
"0.51743937",
"0.51652616",
"0.5164553",
"0.5162395",
"0.51486206",
"0.5147967",
"0.51433736",
"0.5128191",
"0.5121828",
"0.51162577",
"0.5108482",
"0.5094547",
"0.5092761",
"0.5091894",
"0.50903326",
"0.5087821",
"0.50747705",
"0.50746113",
"0.5071258",
"0.5070487",
"0.5066319",
"0.5064077",
"0.5053878",
"0.5048553",
"0.5048138",
"0.50408304",
"0.50387645",
"0.5032813",
"0.5030026",
"0.5023289"
] | 0.75244224 | 0 |
runs the spring boot application | public static void main(String[] args) {
SpringApplication.run(HimalayanKitchenBackendStarter.class, args);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n \tlogger.info(\"Start application spring boot\");\n SpringApplication.run(ApplicationConfiguration.class, args);\n }",
"public static void main(String[] args){\n // app.run(args);\r\n new SpringApplicationBuilder(MainApplication.class).web(true).run(args);\r\n }",
"public static void main(String[] args) {\n\t\tApplicationContext context = SpringApplication.run(SpringbootIn10StepsApplication.class, args);\n\t\t//**SpringApplication.run(...)**\n\t\t//Used to run a Spring Context. Also, \"run\" returns an ApplicationContext.\n\n\n\t\tfor (String name : context.getBeanDefinitionNames()) {\n\t\t\tSystem.out.println(name);\n\t\t}\t// We can see from this that the auto-configuration wires in 120+ beans!!\n\t}",
"public static void main(String[] args) {\n\t\tlogger.info(\"Initializing Spring boot\");\r\n\t\tSpringApplication.run(TesterMain.class, args);\r\n\t\tlogger.info(\"Spring boot initialized\");\r\n\r\n\t}",
"public static void main(String[] args) {\n\n SpringApplication app = new SpringApplication(Main.class);\n app.run(args);\n// SpringApplication.run(Main.class);\n }",
"public static void main(String[] args){\n// ApplicationContext ctx = new SpringApplicationBuilder()\n// .sources(SpringBootApplication.class)\n// .web(false) // 没错,把项目设置成web环境\n// .run(args);\n SpringApplication.run(SpringBootApplication.class, args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(ManolitoBackApplication.class, args);\n\t\t//SpringApplication.run(ManolitoBackApplication.class, \"--debug\");\n\t\n\t}",
"public static void main(String[] args) {\n ConfigurableApplicationContext ctx = SpringApplication\n .run(ApplicationStart.class, args);\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(SpringbootApplication.class, args);\n\t}",
"public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }",
"public static void main(String[] args) {\n\n\t\t\n\t\t/* CommandLineRunner and ApplicationRunner, to run specific pieces of code when an application is fully started.\n\t\t These interfaces get called just before run() once SpringApplication completes.\n\t\t \n\t\t CommandLineRunner - provides access to application arguments as string array.\n\t\t \n\t\t ApplicationRunner wraps the raw application arguments and exposes the ApplicationArguments interface,\n\t\t which has many convinent methods to work with arguments,*/\n\t\t \n\t\t //You just need to register them as Beans in the application context. Then, Spring will automatically pick them up.\n\t\t\n\n\t\tSpringApplication.run(Demo3JpaApplication.class, args);\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(Application.class, args);\n\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(StwwmakerApplication.class, args);\n\t}",
"public static void main(String[] args) {\n\t\tnew SpringApplicationBuilder(Application.class).web(true).run(args);\n\t}",
"public static void main(String[] args) {\n\n SpringApplication.run(Application.class, args);\n // AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();\n }",
"public static void main(String[] args) throws Exception {\n\t\tConfigurableApplicationContext c = SpringApplication.run(WebParserRestApplication.class, args); \n\t}",
"public static void main(String[] args) {\n\n SpringApplication.run(SpringBootApplicationBootStrap.class);\n }",
"public static void main(String[] args) {\n SpringApplication.run(SpringBootGiftApplication.class, args);\n }",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"*** START MAIN() ***\");\n\t\tSpringApplication.run(BeshstoreApplication.class, args);\n\t\tSystem.out.println(\"*** END MAIN() ***\");\n\t}",
"public static void main(String[] args) {\n SpringApplication.run(DriverClass.class, args);\n }",
"public static void main(String[] args) {\n AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();\n ctx.register(ApplicationConfig.class);\n ctx.register(ApplicationContext.class);\n ctx.register(PersistenceContext.class);\n ctx.register(ProductionContext.class);\n ctx.register(SwaggerConfig.class);\n\n SpringApplication.run(Application.class);\n }",
"public static void main(String[] args) throws Exception {\n SpringApplication.run(Application.class, args);\n }",
"public static void main(String[] args) throws Exception {\n SpringApplication.run(Application.class, args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(SensorDataStorageMicroservice.class, args);\n }",
"public static void main(String[] args) {\n new SpringApplicationBuilder().sources(BaseApplication.class, CrondApplication.class).run(args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(MyLotoApplication.class, args);\n }",
"public static void main(String[] args) {\n LOGGER.info(Application.STARTUP.message());\n SpringApplication.run(RoleServiceApplication.class, args);\n }",
"public static void main(String[] args) {\n new SpringApplicationBuilder(Bootstrap.class).web(false).run(args);\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(BankSystemJavaApplication.class, args);\n\t}",
"public static void main(String[] args) {\n SpringApplication.run(BaseLoginApplication.class, args);\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(ResturantAppApplication.class, args);\n\t}",
"public static void main(String[] args) {\n SpringApplication.run(PayeemanagementApplication.class, args);\n }",
"public static void main(String[] args) {\n \n SpringApplication.run(App.class, args);\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(StudentManagementSystemApplication.class, args);\n\t}",
"public static void main(String[] args) {\r\n\r\n\t \tSystem.setProperty(\"spring.config.name\", \"sandun-personal-project\");\r\n\t\tSpringApplication.run(ApplicationServer.class, args);\r\n\t}",
"public static void main(String[] args) {\n SpringApplication.run(TechprudentApplication.class, args);\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(Application.class, args);\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(Application.class, args);\n\t}",
"public static void main(String[] args) {\n\n SpringApplication.run(main.class, args);\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(CodeCrawlerServiceApplication.class, args);\n\t}",
"public static void main(String[] args){\n System.setProperty(\"spring.jackson.serialization.INDENT_OUTPUT\", \"true\");\n\n SpringApplication application = new SpringApplication(Application.class);\n application.addListeners(new ApplicationPidFileWriter(\"ms-recommendation.pid\"));\n application.run(args);\n }",
"public static void main(String[] args) { \n\t\t//we are calling a static method and passing it the name of the class where we have our Main method.\t\t\n\t\tSpringApplication.run(CourseApiApp.class, args);\n\t}",
"public static void main(String[] args) throws Exception {\n\t\tSpringApplication.run(new Class[]{HelloSpringBootApplication.class, InitializeData.class}, args);\n\t\t//initializeData.run(args);\n\t}",
"public static void main(String[] args) {\n\t\tSystem.setProperty(\"spring.config.name\", \"registration-server\");\n\t\t//SpringApplication.run(RegistrationServer.class, args);\n\t\t\n\t\t new SpringApplicationBuilder(RegistrationServer.class)\n .properties(\"spring.config.name:registration-server\").build().run(args);\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(userManagementStart.class, args);\r\n\t}",
"public static void main(String[] args) throws Exception {\n\t\tApplicationContext ctx = new AnnotationConfigApplicationContext(AppConfig.class);\r\n\t\tPerformer performer = (Performer)ctx.getBean(\"singer\");\r\n\t\tperformer.perform();\r\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(SpringSocialApplication.class, args);\n\t}",
"public static void main(String[] args) {\n /* Find the Application Class */\n SpringApplication.run(HelloWorldDemoApplication.class, args);\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(ApiApplication.class, args);\n\t}",
"public static void main(String[] args) {\n SpringApplication.run(ArtworkApplication.class, args);\n }",
"public static void main(String[] args) {\n new SpringApplicationBuilder().sources(CustomGcmEncryptorDemoApplication.class).run(args);\n }",
"public static void main(String[] args) {\n\n\t\t//Start Elasticsearch\n\t\tstartConnect();\n\n\t\tSpringApplication.run(KnowledgeHubApplication.class, args);\n\n\t}",
"public static void main(String[] args) {\n SpringApplication.run(TicketServiceApplication.class, args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(App2.class, args);\r\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(PatyalApplication.class, args);\n\t}",
"public static void main(String[] args) {\n SpringApplication.run(TacoCloudApplication.class, args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(WebclientApplication.class, args);\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(FinderApplication.class, args);\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(FilesystemApplication.class, args);\n\t}",
"public static void main(String[] args) {\n\r\n\t\tSpringApplication.run(EmployerRest.class, args);\r\n\r\n\t}",
"public static void main(String[] args) {\n\t\t SpringApplication.run(YueHeMain.class, args);\r\n\t}",
"public static void main(String[] args){\n\n \tApplicationContext appContext = new AnnotationConfigApplicationContext(AppConfig.class);\n AnimalStoreService aService = appContext.getBean(\"animalStoreService\", AnimalStoreService.class);\n aService.execute();\n\n\n }",
"public static void main(String[] args) {\n\n SpringApplication.run(CoronavirusAPIApplication.class, args);\n }",
"public static void main(String[] args) {\n\t\tLog.info(\"Starting the plagiarism detection application\");\n\t\tSpringApplication.run(PlagarismDetectorApplication.class, args);\n\t\tLog.info(\"Done starting the plagiarism detection application\");\n\t}",
"public static void main(String[] args){\n\t\tAnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MyConfig.class);\n\t\t//applicationContext.addApplicationListener(new MyApplicationStartListener());\n\t\tapplicationContext.setParent(new ClassPathXmlApplicationContext(\"WEB-INF/application-context.xml\"));\n\t\tapplicationContext.start();\n\t\t\n\t\tHelloWorld helloWorld = (HelloWorld) applicationContext.getBean(\"helloWorld\");\n\t\thelloWorld.sayHello();\n\t\t\n\t\t/*BookJdbcTemplate bookJdbcTemplate = new BookJdbcTemplate();\n\t\tJdbcTemplate jdbcTemplate = (JdbcTemplate) applicationContext.getBean(\"jdbcTemplate\");\n\t\tbookJdbcTemplate.setJdbcTemplate(jdbcTemplate);\n\t\tSystem.out.println(\"Total pages are: \" + bookJdbcTemplate.getTotalPages((long)11));\n\t\tlogger.debug(\"Total pages are: \" + bookJdbcTemplate.getTotalPages((long)11));*/\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\t\n\t\tApplicationContext factory = new AnnotationConfigApplicationContext(AppConfig.class);\n\t\tSamsung s8 = factory.getBean(Samsung.class);\n\t\ts8.config();\n\n\t}",
"public static void main(String[] args) {\n\n\t\tGenericLogger.debug(ModuleName.LOGGER, BlogAppApplication.class,\n\t\t\t\t\"Blog App Load has been started: new Terminal\");\n\t\tSpringApplication.run(BlogAppApplication.class, args);\n\t\tGenericLogger.debug(ModuleName.LOGGER, BlogAppApplication.class, \"Blog App load is completed: old one\");\n\t}",
"public static void main(String [] args) {\n context = new AnnotationConfigApplicationContext(Config.class);\n // For the destroy method to work.\n context.registerShutdownHook();\n\n\n //TestService service = (TestService) context.getBean(\"test_service\");\n //PollingConsumer consumer = (PollingConsumer) context.getBean(\"test_consumer\");\n\n // Start tcp and flash servers\n Map<String, Initializer> initializers = context.getBeansOfType(Initializer.class);\n if (initializers != null) {\n for(Initializer initializer : initializers.values()) {\n initializer.initialize();\n }\n }\n\n NettyManager manager = context.getBean(NettyManager.class);\n try\n {\n manager.startServer();\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }",
"public static void main(final String[] args) {\n\n SpringApplication.run(TestdataAdminApplication.class, args);\n }",
"public static void main(String[] args) {\n startApplication();\n }",
"public static void main(String[] args) {\n CustomSystemPropertiesConfiguration.INSTANCE\n .configApplicationShortName(APP_SHORT_NAME);\n checkConfigPathPrefix();\n checkClusterName();\n SpringBootApplicationRunner.run(EurekaServerApplication.class, BannerPrinter.create(), args);\n }",
"public static void main(final String[] args) {\n SpringApplication.run(ResTfulPhotoGalleryApplication.class, args);\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(CursomcApplication.class, args);\n\t}",
"public static void main(String[] args) {\n SpringApplication.run(PalvelinprojektiApplication.class, args);\n }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(JokesApplication.class, args);\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(AnzEngineeringApplication.class, args);\n\t}",
"public static void main(String[] args) {\n\t\tApplicationContext context = new AnnotationConfigApplicationContext(Config.class);\n\t\t\n\t\tStudentService studentService = (StudentService) context.getBean(\"concreteStudentService\");\n\t\tstudentService.viewStudent();\n\t\t\n\t\tstudentService = (StudentService) context.getBean(\"concreteStudentService\");\n\t\tstudentService.viewStudent();\n\t\t\n\t\tstudentService = (StudentService) context.getBean(\"consoleStudentService\");\n\t\tstudentService.viewStudent();\n\t\t\n\n\t\t((ConfigurableApplicationContext)context).close();\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(PaasMainApp.class, args);\n\t}",
"@Override\n\t public void run(ApplicationArguments args) throws Exception {\n\n\t }",
"public static void main(String[] args) {\n\t\tSpringApplication.run(JwtAuthenticationApplication.class, args);\n\t\t\n\t}",
"public static void main(String[] args) {\n SpringApplication.run(OrdersFoodMain.class, args);\n }",
"public static void main(String[] args) {\n SpringApplication.run(MonoTestApplication.class, args);\n }",
"public static void main(String[] args) {\n\n\t\tConfigurableApplicationContext context =new SpringApplicationBuilder(\n\t\t\t\tApplication.class).headless(false).run(args);\n\n\t\tnew Simple2();\n\t}",
"public static void main(String[] args) {\n\t\trunApplication();\n\t}",
"public static void main(String[] args) throws Exception {\n\t\tSpringApplication.run(BatchApplication.class, args);\n\t}",
"public static void main(String[] args) {\n\t\tApplicationContext ctx = SpringApplication.run(App.class, args);\r\n\t\t\r\n\t\t// Read fare calculation bean\r\n\t\tFareCalucation farecalculation = ctx.getBean(FareCalucation.class);\r\n\r\n\t\ttry {\r\n\t\t\t// Read journeys file and loop through it\r\n\t\t\tInputStream journeys = App.class.getClassLoader().getResourceAsStream(\"journeys.txt\");\r\n\t\t\tBufferedReader journeysbr = new BufferedReader(new InputStreamReader(journeys));\r\n\t\t\tString line;\r\n\t\t\twhile ((line = journeysbr.readLine()) != null) {\r\n\t\t\t\tSystem.out.println(\"Inpput Journey : \" + line);\r\n\t\t\t\tStringTokenizer token = new StringTokenizer(line);\r\n\t\t\t\twhile (token.hasMoreElements()) {\r\n\t\t\t\t\tString cdate = token.nextToken();\r\n\t\t\t\t\tString time = token.nextToken();\r\n\t\t\t\t\tint fromzone = Integer.parseInt(token.nextToken());\r\n\t\t\t\t\tint tozone = Integer.parseInt(token.nextToken());\r\n\t\t\t\t\t\r\n\t\t\t\t\t// will process fare calculation of journey at a time.\r\n\t\t\t\t\tfarecalculation.caculateFare(new CommuterJourney(cdate, time, new Zone(fromzone, tozone)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException exp) {\r\n\t\t\tSystem.out.println(\"Error while processing in reading file\"+exp.getMessage());\r\n\t\t} catch (Exception exp) {\r\n\t\t\tSystem.out.println(\"Error while processing in fare calcutaion see below stacktrace\");\r\n\t\t\texp.printStackTrace();\r\n\t\t} \r\n\r\n\t\tSystem.out.println(\"TOTAL FARE:\" + farecalculation.getTotalFare());\r\n\t}",
"public static void main(String[] args) {\n\t\tSpringApplication.run(SpringCloudConfigServerApplication.class, args);\n\t}",
"@Override\n protected SpringApplicationBuilder configure(SpringApplicationBuilder application){\n return application.sources(StartUpApplication.class);\n }",
"public static void main(String[] args) {\n // Tell server to look for accounts-server.properties or\n // accounts-server.yml\n System.setProperty(\"spring.config.name\", \"weather-server\");\n\n SpringApplication.run(WeatherServer.class, args);\n }",
"public static void main(final String[] args) throws UnknownHostException {\n final SpringApplication app = new SpringApplication(BizfuseWebApplication.class);\n\n // 手动添加默认profiles\n final Map<String, Object> defProperties = new HashMap<>();\n defProperties.put(BizfuseWebApplication.SPRING_PROFILE_ACTIVE, BizfuseWebApplication.BIZFUSE_WEB_PROFILE);\n app.setDefaultProperties(defProperties);\n\n final Environment env = app.run(args).getEnvironment();\n BizfuseWebApplication.log.info(\"\\n----------------------------------------------------------\\n\\t\" +\n \"Application '{}' is running! Access URLs:\\n\\t\" +\n \"Local: \\t\\thttp://127.0.0.1:{}\\n\\t\" +\n \"External: \\thttp://{}:{}\\n----------------------------------------------------------\",\n env.getProperty(\"spring.application.name\"),\n env.getProperty(\"server.port\"),\n InetAddress.getLocalHost().getHostAddress(),\n env.getProperty(\"server.port\"));\n\n final String configServerStatus = env.getProperty(\"configserver.status\");\n BizfuseWebApplication.log.info(\"\\n----------------------------------------------------------\\n\\t\" +\n \"Config Server: \\t{}\\n----------------------------------------------------------\",\n configServerStatus == null ? \"Not found or not setup for this application\" : configServerStatus);\n }",
"public void run() {\n final Server server = new Server(8081);\n\n // Setup the basic RestApplication \"context\" at \"/\".\n // This is also known as the handler tree (in Jetty speak).\n final ServletContextHandler context = new ServletContextHandler(\n server, CONTEXT_ROOT);\n final ServletHolder restEasyServlet = new ServletHolder(\n new HttpServletDispatcher());\n restEasyServlet.setInitParameter(\"resteasy.servlet.mapping.prefix\",\n APPLICATION_PATH);\n restEasyServlet.setInitParameter(\"javax.ws.rs.Application\",\n \"de.kad.intech4.djservice.RestApplication\");\n context.addServlet(restEasyServlet, CONTEXT_ROOT);\n\n\n try {\n server.start();\n server.join();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }",
"public static void main(String[] args) throws Exception {\n\t\tApplicationContext factory = new AnnotationConfigApplicationContext(AppConfig.class);\n\t\t\n\t\t\n\t\tProductService service = (ProductServiceImpl) factory.getBean(ProductServiceImpl.class);\n\t\tSystem.out.println(\"Scanning Items.... \");\n\t\t\n\t\tservice.scanProductId(\"Item_1\");\n\t\tservice.scanProductId(\"Item_2\");\n\t\tservice.scanProductId(\"Item_3\");\n\t\tservice.scanProductId(\"Item_4\");\n\t\tservice.scanProductId(\"Item_5\");\n\t\tservice.scanProductId(\"Item_6\");\n\t\tservice.scanProductId(\"Item_7\");\n\t\t\n\t\tSystem.out.println(\"Calculating order amount....\");\n\t\tservice.calculateBill();\n\n\t\t//SpringApplication.run(OrderApplication.class, args);\n\t}",
"public static void main(String[] args) {\n\t\tAnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();\n ctx.register(Config.class);\n ctx.refresh();\n \n AnimalFactory a = ctx.getBean(AnimalFactory.class);\n a.getAnimal(\"Amphibian\").sleep();\n\t}",
"public static void main(String[] args) {\n\t\tlogger.debug(\"Welcome to Spring concept demo\");\n\t\tApplicationContext context=SpringApplication.run(NewHelloWorldApplication.class, args);\n\t\tDemoBean demoBean=context.getBean(DemoBean.class);\n\t\t//System.out.println(\"Demo Bean= \"+demoBean.toString());\n\t\t//System.out.println(context.getBean(HelloRestController.class));\n\t\tlogger.debug(\"Demo Bean= \"+demoBean.toString());\n\t\t\n\t\tEmployeeBean employeeBean=context.getBean(EmployeeBean.class);\n\t\temployeeBean.setEid(104);\n\t\temployeeBean.setEname(\"Spring Framework Guru\");\n\t\temployeeBean.showEmployeeDetails();\n\t}",
"public static void main(String[] args) {\n\t\tApplicationContext context = new ClassPathXmlApplicationContext(\"beans.xml\");\n\t\tSystem.out.println(\"context loaded\");\n\t\t// Sim sim = (Sim) context.getBean(\"sim\");\n\t\t/**\n\t\t * Avoid above type casting\n\t\t */\n\t\tSim sim = context.getBean(\"sim\", Sim.class);\n\t\tsim.calling();\n\t\tsim.data();\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\t/**\n\t\t * static method that bootstraps the application, and\n\t\t * creates the Spring context\n\t\t * Param1: the configuration class\n\t\t * Param2: command-line arguments\n\t\t */\n\t\tSpringApplication.run(TacoCloudApplication.class, args);\n\t}"
] | [
"0.7513717",
"0.74570745",
"0.7117384",
"0.70688766",
"0.7060072",
"0.70484495",
"0.6897387",
"0.68689543",
"0.68570006",
"0.68563956",
"0.68272066",
"0.68272066",
"0.68272066",
"0.68272066",
"0.6817276",
"0.67867935",
"0.67800575",
"0.67784494",
"0.6744407",
"0.67310935",
"0.67308515",
"0.6730682",
"0.67294925",
"0.66892743",
"0.6684372",
"0.6684189",
"0.6684189",
"0.66831565",
"0.6669542",
"0.6660295",
"0.663205",
"0.6627243",
"0.6619426",
"0.661818",
"0.6603248",
"0.65976876",
"0.65969455",
"0.65943736",
"0.6576574",
"0.65753776",
"0.6561685",
"0.6561685",
"0.6549716",
"0.65339375",
"0.65169054",
"0.6514836",
"0.64996356",
"0.6498242",
"0.645192",
"0.64515674",
"0.6449572",
"0.6445697",
"0.6440824",
"0.64128834",
"0.6411004",
"0.6410856",
"0.64091617",
"0.6397413",
"0.639731",
"0.63968027",
"0.63819176",
"0.63748705",
"0.63676023",
"0.6355988",
"0.63327813",
"0.6325074",
"0.63104534",
"0.6286178",
"0.62835985",
"0.6256131",
"0.6254328",
"0.62444043",
"0.62273026",
"0.6216388",
"0.62077564",
"0.6194605",
"0.619451",
"0.6189542",
"0.61758566",
"0.61727333",
"0.6157986",
"0.6152791",
"0.6152285",
"0.614866",
"0.6124483",
"0.61084026",
"0.6104697",
"0.61043084",
"0.61021507",
"0.60946673",
"0.60915697",
"0.6084866",
"0.60824835",
"0.6063307",
"0.6060713",
"0.60520554",
"0.6046119",
"0.60380244",
"0.60330474",
"0.602685"
] | 0.68057555 | 15 |
Constructor to construct a database. | public SetupDatabase(String dataset, Collection<Subject> values) {
this.dataset = dataset;
this.splist = values;
connect();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Database()\r\n\t{\r\n\t\tinitializeDatabase();\r\n\t\t\r\n\t}",
"private Db() {\n super(Ke.getDatabase(), null);\n }",
"public Database() {\n size = 0;\n tables = new HashMap();\n p = new Parse(this);\n }",
"public DB() {\r\n\t\r\n\t}",
"public Database(Context context) { \n\t\tsuper( context, database_MEF, null, 2); \n\t}",
"public sqlDatabase() {\n }",
"public Database(Context context) {\n super(context, DB_NAME, null, DB_VER);\n }",
"public Database() {\n if (init) {\n\n //creating Transaction data\n Transaction transactionOne\n = new Transaction(1, \"Debit\", \"Spar Grocery\", 54.68,1);\n\n transactionDB.add(transactionOne);\n\n // Creating an Account data\n Account accountOne = new Account(1, 445, 111111111, \"Savings\",\n 1250.24, transactionDB);\n\n accountDB.add(accountOne);\n\n //creating withdrawal data\n Withdrawal withdrawalOne = new Withdrawal(1, 64422545, 600.89);\n withdrawalDB.add(withdrawalOne);\n\n //creating transfer data\n Transfer transferOne = new Transfer(1, 25252525, 521.23);\n transferDB.add(transferOne);\n\n //creating lodgement data\n Lodgement lodgementOne = new Lodgement(1, 67766666, 521.23);\n lodgementDB.add(lodgementOne);\n\n //add Customer data \n Customer customerOne\n = new Customer(1, \"Darth Vader\", \"DarthVader@deathStar.com\",\n \"Level 5, Suit Dark\", \"darkSideIsGoodStuff\",\n accountDB, withdrawalDB, transferDB, lodgementDB);\n\n customerDB.add(customerOne);\n\n init = false;\n }\n }",
"public Database() {\n\t\tconn = null;\n\t}",
"public Database() {\r\n\t\ttry {\t\r\n\t\t\tSystem.out.println(\"Database: Connected\");\r\n\t\t\tconn = DriverManager.getConnection(DB_URL,USER,PASS);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(\"Unable to connect to database\");\r\n\t\t}\r\n\t}",
"public Database(Context context) {\n super(context, nome_db, null, versao_db);\n }",
"public DatabaseAdaptor() {\n\t\ttry {\n\t\t\tdatabase = new MyDatabase(DB_NAME);\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public Database(Context context)\n\t{\n\t\t/* Instanciation de l'openHelper */\n\t\tDBOpenHelper helper = new DBOpenHelper(context);\n\t\t\n\t\t/* Load de la database */\n\t\t//TODO passer en asynchrone pour les perfs\n\t\tmainDatabase = helper.getWritableDatabase();\n\t\t\n\t\t/* DEBUG PRINT */\n\t\tLog.i(\"info\", \"Database Loading Suceeded\");\n\t}",
"protected abstract ODatabaseInternal<?> newDatabase();",
"public Database(String dbName) {\n this.dbName = dbName;\n }",
"Database createDatabase();",
"public Database() {\n //Assign instance variables.\n this.movies = new ArrayList<>();\n this.users = new ArrayList<>();\n }",
"public DBConnection() {\n this(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST, DB_PORT);\n }",
"public Database() throws SQLException {\n conn = DriverManager.getConnection(dbURL, username, password);\n }",
"public Database(){\n ItemBox.getLogger().info(\"[Database] protocol version \" + net.mckitsu.itembox.protocol.ItemBoxProtocol.getVersion());\n }",
"public Database (String pw) {\n password = pw;\n dbConnection = null;\n if (DBExists()) dbConnect(true); else dbCreate();\n }",
"private Database() throws SQLException, ClassNotFoundException {\r\n Class.forName(\"org.postgresql.Driver\");\r\n con = DriverManager.getConnection(\"jdbc:postgresql://localhost:5432/postgres\", \"postgres\", \"kuka\");\r\n }",
"public static DatabaseConnection create(String... args) {\n\t\treturn new DatabaseConnection(args);\n\t}",
"public DatabaseTable() { }",
"public DbBasic1( String _dbName ) {\n\t\tdbName = _dbName;\n\n\t\tif ( debug )\n\t\t\tSystem.out.println(\n\t\t\t\t \"Db.constructor [\"\n\t\t\t\t+ dbName\n\t\t\t\t+ \"]\");\n\n\t\topen();\n\t\treadMetaData();\n\t\tprintData();\n\t}",
"private TexeraDb() {\n super(\"texera_db\", null);\n }",
"private DatabaseRepository() {\n try {\n // connect to database\n\n DB_URL = \"jdbc:sqlite:\"\n + this.getClass().getProtectionDomain()\n .getCodeSource()\n .getLocation()\n .toURI()\n .getPath().replaceAll(\"[/\\\\\\\\]\\\\w*\\\\.jar\", \"/\")\n + \"lib/GM-SIS.db\";\n connection = DriverManager.getConnection(DB_URL);\n mapper = ObjectRelationalMapper.getInstance();\n mapper.initialize(this);\n }\n catch (SQLException | URISyntaxException e) {\n System.out.println(e.toString());\n }\n }",
"public DatabaseManager() {\n try {\n con = DriverManager.getConnection(DB_URL, \"root\", \"marko\");\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"public FakeDatabase() {\n\t\t\n\t\t// Add initial data\n\t\t\n//\t\tSystem.out.println(authorList.size() + \" authors\");\n//\t\tSystem.out.println(bookList.size() + \" books\");\n\t}",
"public SQLite(String dbLocation) {\n this.dbLocation = dbLocation;\n }",
"public Database(String url) {\n this.url = url;\n\n File f = new File(url);\n\n if (f.exists()) {\n try {\n f.mkdirs();\n f.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //create table relationship\n LinkedList<String> relationship_attributes = new LinkedList<>();\n relationship_attributes.add(\"id_entity1\");\n relationship_attributes.add(\"id_entity2\");\n relationship_attributes.add(\"description\");\n this.create_table(\"relationship\", relationship_attributes);\n }",
"public DbUtil() {}",
"private Database() throws SQLException {\n con = DriverManager.getConnection(\"jdbc:oracle:thin:@localhost:1521:MusicAlbums\", \"c##dba\", \"sql\");\n }",
"public DB(String db) throws ClassNotFoundException, SQLException {\n // Set up a connection and store it in a field\n Class.forName(\"org.sqlite.JDBC\");\n String url = \"jdbc:sqlite:\" + db;\n\n // stop conn from creating a file if does not exists\n SQLiteConfig config = new SQLiteConfig();\n config.resetOpenMode(SQLiteOpenMode.CREATE);\n\n //connect to the file\n conn = DriverManager.getConnection(url, config.toProperties());\n try (Statement stat = conn.createStatement();) {\n stat.executeUpdate(\"PRAGMA foreign_keys = ON;\");\n }\n }",
"public KVDatabase() {\n //private constructor to prevent instantiation.\n }",
"private DatabaseContext() {\r\n datastore = createDatastore();\r\n init();\r\n }",
"public Database(String name) {\r\n\t\tthis.name = name;\r\n\t\tDatabaseUniverse.getAllDatabases().add(this);\r\n\t\tDatabaseUniverse.setDatabaseNumber(1);\r\n\t\tCommandLineMenu.setActiveDatabase(this);\r\n\t}",
"public DBManager() {\n\t\t\n\t}",
"private DatabaseManager() {}",
"public DBConnection()\n {\n\n }",
"public DatabaseParameter() {\n super(\"database\", \"Database\");\n }",
"public SetupDatabase() {\n }",
"public DatabaseHandler(Context context) {\n super(context, DATABASE_NAME, null, DATABASE_VERSION);\n }",
"private DatabaseManager() {\n // Default constructor\n }",
"private AttendantDatabase() {}",
"public DatabaseHandler(Context context){\n super(context, \"tienda.db\", null, 1);\n }",
"public SQLDataBase(Context context){ // is this supposed to be public?\n super(context, DATABASE_NAME, null, 1);\n }",
"public DatabaseBackend(Context context) {\n super(context, Db_name, null, Db_version);\n }",
"public PostDatabase() {\r\n\ttry {\r\n\t Class.forName(DRIVER);\r\n\t db = DriverManager.getConnection(URI);\r\n\t Statement create = db.createStatement();\r\n\t create.execute(\"CREATE TABLE IF NOT EXISTS posts ( id INTEGER PRIMARY KEY, author TEXT, date INTEGER, isPublic INTEGER, content TEXT );\");\r\n\t} catch (ClassNotFoundException e) {\r\n\t System.err.println(\"Caught exception while attempting to use database driver: \" + e.getMessage());\r\n\t} catch (SQLException e) {\r\n\t System.err.println(\"Caught exception while doing something to the database: \" + e.getMessage());\r\n\t}\r\n }",
"private DatabaseManager() {\r\n }",
"public DBMS(Context context) {\n super(context, DBName, null, DBVersion);\n Log.e(\"DBMS=>\", \"yes Db bna d ha\");\n }",
"public DatabaseHandler(Context context) {\r\n super(context, DATABASE_NAME, null, DATABASE_VERSION);\r\n }",
"public Persistence() {\n\t\tconn = dbConnection();\n\t}",
"private DatabaseContract() {}",
"DataBase createDataBase();",
"public RepoSQL() { // constructor implicit\r\n\t\t super();\r\n\t }",
"public DatabaseOperations(){\n\n }",
"public DataConnection() {\n\t\ttry {\n\t\t\tString dbClass = \"com.mysql.jdbc.Driver\";\n\t\t\tClass.forName(dbClass).newInstance();\n\t\t\tConnection con = DriverManager.getConnection(DIR_DB, USER_DB, PASS_DB);\n\t\t\tstatement = con.createStatement();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public MyBudgetDatabase(String databaseName) throws SQLException {\n this.dbName = databaseName;\n }",
"private createSingletonDatabase()\n\t{\n\t\tConnection conn = createDatabase();\n\t\tcreateTable();\n\t\tString filename = \"Summer expereince survey 2016 for oliver.csv\"; \n\t\timportData(conn, filename);\n\t}",
"private void setupDatabase() {\r\n\t\tDatabaseHelperFactory.init(this);\r\n\t\tdatabase = DatabaseHelperFactory.getInstance();\r\n\t}",
"private DbConnection() {\n }",
"public ServiceCacheDB()\n\t{\n\t\tthis(0);\n\t}",
"public DBCreator(DBConnection connection) {\n this.dbConnection = connection;\n }",
"public Database(final String u) {\n this.url = u;\n }",
"@Override\r\n protected CassandraEmbDatabase createDatabaseInternal(final String theDB) {\r\n return new CassandraEmbDatabase(this, theDB);\r\n }",
"public DBHandler(Context context) {\n super(context, DB_NAME, null, DB_VERSION);\n }",
"public ArtistDb(Connection connection) {\r\n super(connection);\r\n }",
"public CoreDatabase(String dbName) throws SQLException {\n\n this.conn = DriverManager.getConnection(\n SQLITE_URL + dbName + EXTENSION\n );\n\n }",
"public DatabaseManager(Context context) {\n super(context, DATABASE_NAME, null, DATABASE_VERSION);\n }",
"private DatabaseOperations() {\n }",
"public MySQLDatabase(String _uri, String _user, String _password){\n uri = _uri;\n user = _user;\n password = _password;\n }",
"public ValuesDAO(Database db) \n\t{\n\t\tthis.db = db;\n\t}",
"public Database(final String dbName, final String dbHost, final String dbPort, final String dbUsername, final String dbPassword, final String uniqueId) {\n this.dbName = dbName;\n this.dbHost = dbHost;\n this.dbPort = dbPort;\n this.dbUsername = dbUsername;\n this.dbPassword = dbPassword;\n this.uniqueId = uniqueId;\n }",
"private void initDb() {\n\t\tif (dbHelper == null) {\n\t\t\tdbHelper = new DatabaseOpenHelper(this);\n\t\t}\n\t\tif (dbAccess == null) {\n\t\t\tdbAccess = new DatabaseAccess(dbHelper.getWritableDatabase());\n\t\t}\n\t}",
"public static Database getInstance() {\n if (database == null) database = new Database();\n return database;\n }",
"public DBHelper(Context c) {\n\t\tsuper(c, DB_NAME, null, version);\n\t}",
"public MoviesDatabase()\n {\n file = new FileOperation();\n menu = new Menu();\n validation = new Validation();\n }",
"public Database(final String databaseName) {\n\t\tConnection connection = null;\n\t\ttry {\n\t\t\tfinal String userName = \"root\";\n\t\t\tfinal String password = \"\";\n\t\t\tfinal String url = \"jdbc:mysql://localhost/\" + databaseName;\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\").newInstance();\n\t\t\tconnection = DriverManager.getConnection(url, userName, password);\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Cannot connect to database server.\");\n\t\t\te.printStackTrace();\n\t\t\tdisconnect();\n\t\t}\n\t\t_connection = connection;\n\n\t\ttry {\n\t\t\tassert !_connection.isClosed();\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(\"Not connected to database server.\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public CachedDatabase(Database database) {\n if (database == null) {\n throw new IllegalArgumentException();\n }\n\n this.database = database;\n this.cache = new HashMap<>();\n }",
"public DataManager() {\n\t\tthis(PUnit == null ? \"eElectionsDB\" : PUnit);\n\t}",
"private static void initializeDatabase() {\n\t\tArrayList<String> data = DatabaseHandler.readDatabase(DATABASE_NAME);\n\t\tAbstractSerializer serializer = new CineplexSerializer();\n\t\trecords = serializer.deserialize(data);\n\t}",
"private DBConnection() \n {\n initConnection();\n }",
"public DatabaseSeeder() {\n // initialSeed properties...\n super();\n\n // retrieve a database connection instance...\n this.connector = new DatabaseConnector();\n this.connection = this.connector.connect();\n }",
"private DatabaseContract()\n {\n }",
"public SRWDatabasePool() {\n }",
"public DBManager(String databaseName) {\n\t\tdbName = databaseName;\n\t}",
"public DatabaseController()\n\t{\n\t\tconnectionString = \"jdbc:mysql://localhost/?user=root\";\n\t\tcheckDriver();\n\t\tsetupConnection();\n\t}",
"public MyDBHandler(Context context) {\n super(context, DATABASE_NAME, null, DATABASE_VERSION);\n }",
"private DatabaseHandler(){\n createConnection();\n }",
"protected static Database getInstance() {\n if (instance == null) {\n instance = new Database();\n }\n return instance;\n }",
"@Override\n\tpublic void construct() {\n\t\tSystem.out.println(\"Getting a MySQL Database Connection\");\n\n\t}",
"private PurchaseDB() {}",
"public DaoConnection() {\n\t\t\n\t}",
"public DataWriter(String dbPath) {\n databasePath = dbPath;\n }",
"public SQLHandler(Context context) {\n \t\tsuper(context, DATABASE_NAME, null, DATABASE_VERSION);\n \t}",
"public FileDatabase(String filename) throws IOException {\n\t\tdatabase = new File(filename);\n\t\tread();\n\t}",
"public MovieDB()\n\t{\n\t\t//Create an empty list\n\t\tlist_of_movies = new ArrayList<Movie>();\n\t}",
"public DBPoolImpl()\n {\n }",
"@Override\n\tpublic Database createDatabase(Type type) throws FSException {\n\t\treturn new DummyDatabase();\n\t}",
"public interface DatabaseFactory {\r\n\r\n Database makeDatabase();\r\n}"
] | [
"0.8180679",
"0.8014788",
"0.79101956",
"0.78689736",
"0.77068704",
"0.76053905",
"0.75891846",
"0.7570083",
"0.7501949",
"0.73988634",
"0.7371229",
"0.7336329",
"0.73274547",
"0.7314316",
"0.72932583",
"0.72904384",
"0.72103226",
"0.7184502",
"0.71697396",
"0.71621823",
"0.71407366",
"0.71175045",
"0.70953166",
"0.7060881",
"0.7042401",
"0.70261586",
"0.6973982",
"0.6973109",
"0.69167733",
"0.69127434",
"0.6905381",
"0.68908596",
"0.68768525",
"0.68766665",
"0.68244076",
"0.6799879",
"0.67996943",
"0.67881036",
"0.67858654",
"0.6785761",
"0.6782985",
"0.6754498",
"0.6740209",
"0.6736508",
"0.67295575",
"0.6694473",
"0.66902804",
"0.6685958",
"0.6681219",
"0.66720235",
"0.66645354",
"0.66550153",
"0.6654121",
"0.6639226",
"0.6638043",
"0.6628051",
"0.662246",
"0.6612576",
"0.6607985",
"0.6571981",
"0.65595657",
"0.65574867",
"0.6552764",
"0.65510625",
"0.65451604",
"0.65425336",
"0.6542263",
"0.65417886",
"0.65307724",
"0.6518004",
"0.65133923",
"0.650944",
"0.65082943",
"0.6501075",
"0.64978266",
"0.6495172",
"0.6481497",
"0.6476655",
"0.6465385",
"0.64619637",
"0.64582324",
"0.64557004",
"0.64510846",
"0.64406186",
"0.6432323",
"0.6413395",
"0.64059275",
"0.6379966",
"0.6376742",
"0.6369751",
"0.6363424",
"0.63606924",
"0.634955",
"0.6340915",
"0.634085",
"0.6337761",
"0.6333573",
"0.63291436",
"0.63282496",
"0.6322639",
"0.6316082"
] | 0.0 | -1 |
Default Constructor to construct a database. | public SetupDatabase() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Db() {\n super(Ke.getDatabase(), null);\n }",
"public Database()\r\n\t{\r\n\t\tinitializeDatabase();\r\n\t\t\r\n\t}",
"public DB() {\r\n\t\r\n\t}",
"public Database() {\n size = 0;\n tables = new HashMap();\n p = new Parse(this);\n }",
"public Database(Context context) { \n\t\tsuper( context, database_MEF, null, 2); \n\t}",
"public sqlDatabase() {\n }",
"public Database(Context context) {\n super(context, DB_NAME, null, DB_VER);\n }",
"public Database() {\n\t\tconn = null;\n\t}",
"public Database(Context context) {\n super(context, nome_db, null, versao_db);\n }",
"public DatabaseAdaptor() {\n\t\ttry {\n\t\t\tdatabase = new MyDatabase(DB_NAME);\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public Database() {\r\n\t\ttry {\t\r\n\t\t\tSystem.out.println(\"Database: Connected\");\r\n\t\t\tconn = DriverManager.getConnection(DB_URL,USER,PASS);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(\"Unable to connect to database\");\r\n\t\t}\r\n\t}",
"public Database() {\n if (init) {\n\n //creating Transaction data\n Transaction transactionOne\n = new Transaction(1, \"Debit\", \"Spar Grocery\", 54.68,1);\n\n transactionDB.add(transactionOne);\n\n // Creating an Account data\n Account accountOne = new Account(1, 445, 111111111, \"Savings\",\n 1250.24, transactionDB);\n\n accountDB.add(accountOne);\n\n //creating withdrawal data\n Withdrawal withdrawalOne = new Withdrawal(1, 64422545, 600.89);\n withdrawalDB.add(withdrawalOne);\n\n //creating transfer data\n Transfer transferOne = new Transfer(1, 25252525, 521.23);\n transferDB.add(transferOne);\n\n //creating lodgement data\n Lodgement lodgementOne = new Lodgement(1, 67766666, 521.23);\n lodgementDB.add(lodgementOne);\n\n //add Customer data \n Customer customerOne\n = new Customer(1, \"Darth Vader\", \"DarthVader@deathStar.com\",\n \"Level 5, Suit Dark\", \"darkSideIsGoodStuff\",\n accountDB, withdrawalDB, transferDB, lodgementDB);\n\n customerDB.add(customerOne);\n\n init = false;\n }\n }",
"protected abstract ODatabaseInternal<?> newDatabase();",
"public DatabaseTable() { }",
"public DBConnection() {\n this(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST, DB_PORT);\n }",
"public Database() {\n //Assign instance variables.\n this.movies = new ArrayList<>();\n this.users = new ArrayList<>();\n }",
"public Database(Context context)\n\t{\n\t\t/* Instanciation de l'openHelper */\n\t\tDBOpenHelper helper = new DBOpenHelper(context);\n\t\t\n\t\t/* Load de la database */\n\t\t//TODO passer en asynchrone pour les perfs\n\t\tmainDatabase = helper.getWritableDatabase();\n\t\t\n\t\t/* DEBUG PRINT */\n\t\tLog.i(\"info\", \"Database Loading Suceeded\");\n\t}",
"private TexeraDb() {\n super(\"texera_db\", null);\n }",
"public Database(String dbName) {\n this.dbName = dbName;\n }",
"Database createDatabase();",
"public Database(){\n ItemBox.getLogger().info(\"[Database] protocol version \" + net.mckitsu.itembox.protocol.ItemBoxProtocol.getVersion());\n }",
"private DatabaseManager() {\n // Default constructor\n }",
"public Database (String pw) {\n password = pw;\n dbConnection = null;\n if (DBExists()) dbConnect(true); else dbCreate();\n }",
"public DbUtil() {}",
"public DbBasic1( String _dbName ) {\n\t\tdbName = _dbName;\n\n\t\tif ( debug )\n\t\t\tSystem.out.println(\n\t\t\t\t \"Db.constructor [\"\n\t\t\t\t+ dbName\n\t\t\t\t+ \"]\");\n\n\t\topen();\n\t\treadMetaData();\n\t\tprintData();\n\t}",
"public RepoSQL() { // constructor implicit\r\n\t\t super();\r\n\t }",
"private Database() throws SQLException, ClassNotFoundException {\r\n Class.forName(\"org.postgresql.Driver\");\r\n con = DriverManager.getConnection(\"jdbc:postgresql://localhost:5432/postgres\", \"postgres\", \"kuka\");\r\n }",
"public DBConnection()\n {\n\n }",
"public Database() throws SQLException {\n conn = DriverManager.getConnection(dbURL, username, password);\n }",
"public SQLDataBase(Context context){ // is this supposed to be public?\n super(context, DATABASE_NAME, null, 1);\n }",
"public FakeDatabase() {\n\t\t\n\t\t// Add initial data\n\t\t\n//\t\tSystem.out.println(authorList.size() + \" authors\");\n//\t\tSystem.out.println(bookList.size() + \" books\");\n\t}",
"public static DatabaseConnection create(String... args) {\n\t\treturn new DatabaseConnection(args);\n\t}",
"public KVDatabase() {\n //private constructor to prevent instantiation.\n }",
"private DatabaseManager() {}",
"public DBManager() {\n\t\t\n\t}",
"public DatabaseHandler(Context context) {\n super(context, DATABASE_NAME, null, DATABASE_VERSION);\n }",
"public DatabaseParameter() {\n super(\"database\", \"Database\");\n }",
"public ServiceCacheDB()\n\t{\n\t\tthis(0);\n\t}",
"public DatabaseManager() {\n try {\n con = DriverManager.getConnection(DB_URL, \"root\", \"marko\");\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"public DBMS(Context context) {\n super(context, DBName, null, DBVersion);\n Log.e(\"DBMS=>\", \"yes Db bna d ha\");\n }",
"public DatabaseBackend(Context context) {\n super(context, Db_name, null, Db_version);\n }",
"private AttendantDatabase() {}",
"public SQLite(String dbLocation) {\n this.dbLocation = dbLocation;\n }",
"public DatabaseHandler(Context context) {\r\n super(context, DATABASE_NAME, null, DATABASE_VERSION);\r\n }",
"public DatabaseHandler(Context context){\n super(context, \"tienda.db\", null, 1);\n }",
"private DbConnection() {\n }",
"public DatabaseOperations(){\n\n }",
"private DatabaseManager() {\r\n }",
"private DatabaseRepository() {\n try {\n // connect to database\n\n DB_URL = \"jdbc:sqlite:\"\n + this.getClass().getProtectionDomain()\n .getCodeSource()\n .getLocation()\n .toURI()\n .getPath().replaceAll(\"[/\\\\\\\\]\\\\w*\\\\.jar\", \"/\")\n + \"lib/GM-SIS.db\";\n connection = DriverManager.getConnection(DB_URL);\n mapper = ObjectRelationalMapper.getInstance();\n mapper.initialize(this);\n }\n catch (SQLException | URISyntaxException e) {\n System.out.println(e.toString());\n }\n }",
"private DatabaseOperations() {\n }",
"private DatabaseContract() {}",
"public DBHandler(Context context) {\n super(context, DB_NAME, null, DB_VERSION);\n }",
"private DatabaseContext() {\r\n datastore = createDatastore();\r\n init();\r\n }",
"public DBHelper(Context c) {\n\t\tsuper(c, DB_NAME, null, version);\n\t}",
"public Database(String name) {\r\n\t\tthis.name = name;\r\n\t\tDatabaseUniverse.getAllDatabases().add(this);\r\n\t\tDatabaseUniverse.setDatabaseNumber(1);\r\n\t\tCommandLineMenu.setActiveDatabase(this);\r\n\t}",
"private Database() throws SQLException {\n con = DriverManager.getConnection(\"jdbc:oracle:thin:@localhost:1521:MusicAlbums\", \"c##dba\", \"sql\");\n }",
"public Persistence() {\n\t\tconn = dbConnection();\n\t}",
"private DBConnection() \n {\n initConnection();\n }",
"public MyDBHandler(Context context) {\n super(context, DATABASE_NAME, null, DATABASE_VERSION);\n }",
"public DaoConnection() {\n\t\t\n\t}",
"public DatabaseManager(Context context) {\n super(context, DATABASE_NAME, null, DATABASE_VERSION);\n }",
"public DBPoolImpl()\n {\n }",
"public DatabaseSeeder() {\n // initialSeed properties...\n super();\n\n // retrieve a database connection instance...\n this.connector = new DatabaseConnector();\n this.connection = this.connector.connect();\n }",
"public SQLHandler(Context context) {\n \t\tsuper(context, DATABASE_NAME, null, DATABASE_VERSION);\n \t}",
"public DbUtils() {\r\n // do nothing\r\n }",
"public ArtistDb(Connection connection) {\r\n super(connection);\r\n }",
"private DatabaseHelper(Context cont) {\n super(cont, DB_NAME, null, DB_VERSION);\n this.context = cont;\n }",
"public DataManager() {\n\t\tthis(PUnit == null ? \"eElectionsDB\" : PUnit);\n\t}",
"public PostDatabase() {\r\n\ttry {\r\n\t Class.forName(DRIVER);\r\n\t db = DriverManager.getConnection(URI);\r\n\t Statement create = db.createStatement();\r\n\t create.execute(\"CREATE TABLE IF NOT EXISTS posts ( id INTEGER PRIMARY KEY, author TEXT, date INTEGER, isPublic INTEGER, content TEXT );\");\r\n\t} catch (ClassNotFoundException e) {\r\n\t System.err.println(\"Caught exception while attempting to use database driver: \" + e.getMessage());\r\n\t} catch (SQLException e) {\r\n\t System.err.println(\"Caught exception while doing something to the database: \" + e.getMessage());\r\n\t}\r\n }",
"public MoviesDatabase()\n {\n file = new FileOperation();\n menu = new Menu();\n validation = new Validation();\n }",
"public DataConnection() {\n\t\ttry {\n\t\t\tString dbClass = \"com.mysql.jdbc.Driver\";\n\t\t\tClass.forName(dbClass).newInstance();\n\t\t\tConnection con = DriverManager.getConnection(DIR_DB, USER_DB, PASS_DB);\n\t\t\tstatement = con.createStatement();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private PurchaseDB() {}",
"DataBase createDataBase();",
"public DB(String db) throws ClassNotFoundException, SQLException {\n // Set up a connection and store it in a field\n Class.forName(\"org.sqlite.JDBC\");\n String url = \"jdbc:sqlite:\" + db;\n\n // stop conn from creating a file if does not exists\n SQLiteConfig config = new SQLiteConfig();\n config.resetOpenMode(SQLiteOpenMode.CREATE);\n\n //connect to the file\n conn = DriverManager.getConnection(url, config.toProperties());\n try (Statement stat = conn.createStatement();) {\n stat.executeUpdate(\"PRAGMA foreign_keys = ON;\");\n }\n }",
"public SqliteModelFactoryImpl()\n {\n super();\n }",
"public DBHelper(Context context) {\n super(context, Database_Name, null, 1);\n\n }",
"private DatabaseContract()\n {\n }",
"public MyBudgetDatabase(String databaseName) throws SQLException {\n this.dbName = databaseName;\n }",
"public DatabaseHelper(Context context) {\n super(context, DATABASE_NAME, null, 1);\n }",
"public DatabaseController()\n\t{\n\t\tconnectionString = \"jdbc:mysql://localhost/?user=root\";\n\t\tcheckDriver();\n\t\tsetupConnection();\n\t}",
"public Database(String url) {\n this.url = url;\n\n File f = new File(url);\n\n if (f.exists()) {\n try {\n f.mkdirs();\n f.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //create table relationship\n LinkedList<String> relationship_attributes = new LinkedList<>();\n relationship_attributes.add(\"id_entity1\");\n relationship_attributes.add(\"id_entity2\");\n relationship_attributes.add(\"description\");\n this.create_table(\"relationship\", relationship_attributes);\n }",
"private DBContract() {}",
"private DBContract() {}",
"public CoreDatabase(String dbName) throws SQLException {\n\n this.conn = DriverManager.getConnection(\n SQLITE_URL + dbName + EXTENSION\n );\n\n }",
"public SQLHandler(Context context) {\n super(context, DB_NAME, null, DB_VERSION);\n }",
"public static Database getInstance() {\n if (database == null) database = new Database();\n return database;\n }",
"public SRWDatabasePool() {\n }",
"public Driver() throws SQLException {\n // Required for Class.forName().newInstance()\n }",
"public CreateJavaDBDatabaseOperator() {\n super(Bundle.getStringTrimmed(\"org.netbeans.modules.derby.Bundle\", \"LBL_CreateDatabaseTitle\"));\n }",
"@Override\r\n protected CassandraEmbDatabase createDatabaseInternal(final String theDB) {\r\n return new CassandraEmbDatabase(this, theDB);\r\n }",
"public Database(final String u) {\n this.url = u;\n }",
"private DatabaseHandler(){\n createConnection();\n }",
"public MovieDB()\n\t{\n\t\t//Create an empty list\n\t\tlist_of_movies = new ArrayList<Movie>();\n\t}",
"private createSingletonDatabase()\n\t{\n\t\tConnection conn = createDatabase();\n\t\tcreateTable();\n\t\tString filename = \"Summer expereince survey 2016 for oliver.csv\"; \n\t\timportData(conn, filename);\n\t}",
"protected DBMaintainer() {\n }",
"public ConexionDB() {\n\n\t\tconn = null;\n\n\t}",
"@Override\n\tpublic void construct() {\n\t\tSystem.out.println(\"Getting a MySQL Database Connection\");\n\n\t}",
"protected static Database getInstance() {\n if (instance == null) {\n instance = new Database();\n }\n return instance;\n }",
"private void initDb() {\n\t\tif (dbHelper == null) {\n\t\t\tdbHelper = new DatabaseOpenHelper(this);\n\t\t}\n\t\tif (dbAccess == null) {\n\t\t\tdbAccess = new DatabaseAccess(dbHelper.getWritableDatabase());\n\t\t}\n\t}",
"private SSLCipherSuiteDatabase() {\n }"
] | [
"0.8382653",
"0.8324404",
"0.8174212",
"0.79242915",
"0.784005",
"0.78371614",
"0.7786069",
"0.7669622",
"0.75165385",
"0.7440686",
"0.7434525",
"0.7367227",
"0.73556316",
"0.7348452",
"0.734385",
"0.7258313",
"0.72555006",
"0.723524",
"0.72173977",
"0.7214744",
"0.72089255",
"0.7204856",
"0.71870375",
"0.7176327",
"0.7116059",
"0.70981824",
"0.7088595",
"0.70835245",
"0.7054254",
"0.70406485",
"0.7040177",
"0.7030405",
"0.7024535",
"0.7009895",
"0.6998896",
"0.6970742",
"0.69560456",
"0.6955267",
"0.69232094",
"0.69146204",
"0.6905805",
"0.68987924",
"0.68967116",
"0.6890079",
"0.6888139",
"0.68824744",
"0.6861843",
"0.68593603",
"0.6853279",
"0.6841501",
"0.68290836",
"0.6808822",
"0.6796129",
"0.67913395",
"0.67896795",
"0.6755878",
"0.6732713",
"0.6715789",
"0.66992503",
"0.66932774",
"0.66663265",
"0.6662324",
"0.6659725",
"0.6653102",
"0.66383445",
"0.66295195",
"0.6614809",
"0.66128063",
"0.66109324",
"0.6599384",
"0.6590582",
"0.65816134",
"0.65740174",
"0.65717983",
"0.65646964",
"0.65598387",
"0.65557927",
"0.655362",
"0.65502787",
"0.6524925",
"0.65168434",
"0.6515329",
"0.6515329",
"0.6514065",
"0.65130776",
"0.65050656",
"0.65002537",
"0.6500168",
"0.6480005",
"0.64793557",
"0.6478486",
"0.6478048",
"0.6475483",
"0.6474617",
"0.6463915",
"0.6463827",
"0.64457524",
"0.64344627",
"0.6429603",
"0.64229274"
] | 0.6927501 | 38 |
Write a collection of nodes into the database | @SuppressWarnings("checkstyle:magicnumber")
private void writeNodes(NodeCollection nodes, int threshold) throws SQLException {
PreparedStatement stmt = null;
String query = "INSERT INTO " + NODES_TABLE + "(id, data, x, y, isbubble, containersize, segmentsize) VALUES" + "(?,?,?,?,"
+ "" + "" + "?,?,?) ON CONFLICT DO NOTHING";
try {
stmt = connection.prepareStatement(query);
for (Node node : nodes.values()) {
stmt.setInt(1, node.getId());
if (node.getStartNode().getId() == node.getEndNode().getId() && !node.getStartNode().isBubble()) {
stmt.setString(2, node.getStartNode().getData());
stmt.setBoolean(FIVE, false);
} else {
stmt.setString(2, node.getData());
stmt.setBoolean(FIVE, node.isBubble());
}
stmt.setInt(THREE, node.getX());
stmt.setInt(FOUR, node.getY());
stmt.setInt(6, node.getContainerSize());
stmt.setInt(7, node.mutationSize());
stmt.addBatch();
}
stmt.executeBatch();
} catch (SQLException e) {
e.printStackTrace();
} finally {
if (stmt != null) {
stmt.close();
}
}
writeLinks(nodes, threshold);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void saveToDB() {\n \twipeDB();\n\t\tSQLiteDatabase db = nodeData.getReadableDatabase();\n\t\tContentValues values = new ContentValues();\n\t\tfor (int i = 0; i < wallpapers.size(); i++) {\n\t\t\tvalues.put(EventDataSQLHelper.NODE, nodeToString(wallpapers.get(i)));\n\t\t\ttry {\t\t\t\t\n\t\t\t\tdb.insertOrThrow(EventDataSQLHelper.TABLE, null, values);\n\t\t\t\tLog.d(\"AddToDB\", nodeToString(wallpapers.get(i)));\n\t\t\t} catch (SQLException e) {\n\t\t\t\tLog.d(\"AddToDB\", \"\" + e.getMessage());\n\t\t\t}\n\t\t}\n\t\tdb.close();\n }",
"private void addArbitraryDataToDatabase() {\n\n try (Transaction tx = graphDatabaseService.beginTx()) {\n Node arbitraryNode = graphDatabaseService.createNode(DynamicLabel.label(\"NotAClass\"));\n arbitraryNode.setProperty(\"name\", \"Colin\");\n Node otherNode = graphDatabaseService.createNode(DynamicLabel.label(\"NotAClass\"));\n otherNode.setProperty(\"age\", 39);\n arbitraryNode.createRelationshipTo(otherNode, DynamicRelationshipType.withName(\"TEST\"));\n\n tx.success();\n }\n }",
"public DummyIO(List<Node> nodes){\n\t\tthis.nodes = nodes;\n\t\tfor (Node node : nodes){\n\t\t\tnodeToDbs.put(node, new ArrayList<Database>());\n\t\t\tnodeByName.put(node.getName(), node);\n\t\t}\n\t}",
"public static void writeFile(List<Task> database) {\r\n assert database != null: \"Storage.writeFile(): database cannot be null\";\r\n File dir = new File(\"./tmp/data\");\r\n try {\r\n FileWriter fw = new FileWriter(new File(dir, \"storage.txt\"));\r\n for (Task task : database) {\r\n assert task != null: \"Storage.writeFile(): task to be added cannot be null\";\r\n fw.write(task.serialize() + \"\\n\");\r\n }\r\n fw.close();\r\n } catch (IOException e) {\r\n throw new Error(\"Something went wrong: \" + e.getMessage());\r\n }\r\n }",
"public void writeDatabase();",
"void addNodes(List<CyNode> nodes);",
"private void actuallyWriteData() {\r\n\t\t// Get rid of old data. Getting rid of trips, trip patterns, and blocks\r\n\t\t// is a bit complicated. Need to delete them in proper order because\r\n\t\t// of the foreign keys. Because appear to need to use plain SQL\r\n\t\t// to do so successfully (without reading in objects and then\r\n\t\t// deleting them, which takes too much time and memory). Therefore\r\n\t\t// deleting of this data is done here before writing the data.\r\n\t\tlogger.info(\"Deleting old blocks and associated trips from database...\");\r\n\t\tBlock.deleteFromSandboxRev(session);\r\n\r\n\t\tlogger.info(\"Deleting old trips from database...\");\r\n\t\tTrip.deleteFromSandboxRev(session);\r\n\r\n\t\tlogger.info(\"Deleting old trip patterns from database...\");\r\n\t\tTripPattern.deleteFromSandboxRev(session);\r\n\t\t\r\n\t\t// Now write the data to the database.\r\n\t\t// First write the Blocks. This will also write the Trips, TripPatterns,\r\n\t\t// Paths, and TravelTimes since those all have been configured to be\r\n\t\t// cascade=CascadeType.ALL .\r\n\t\tlogger.info(\"Saving {} blocks (plus associated trips) to database...\", \r\n\t\t\t\tgtfsData.getBlocks().size());\r\n\t\tint c = 0;\r\n\t\tfor (Block block : gtfsData.getBlocks()) {\r\n\t\t\tlogger.debug(\"Saving block #{} with blockId={} serviceId={} blockId={}\",\r\n\t\t\t\t\t++c, block.getId(), block.getServiceId(), block.getId());\r\n\t\t\twriteObject(block);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving routes to database...\");\r\n\t\tRoute.deleteFromSandboxRev(session);\r\n\t\tfor (Route route : gtfsData.getRoutes()) {\r\n\t\t\twriteObject(route);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving stops to database...\");\r\n\t\tStop.deleteFromSandboxRev(session);\r\n\t\tfor (Stop stop : gtfsData.getStops()) {\r\n\t\t\twriteObject(stop);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving agencies to database...\");\r\n\t\tAgency.deleteFromSandboxRev(session);\r\n\t\tfor (Agency agency : gtfsData.getAgencies()) {\r\n\t\t\twriteObject(agency);\r\n\t\t}\r\n\r\n\t\tlogger.info(\"Saving calendars to database...\");\r\n\t\tCalendar.deleteFromSandboxRev(session);\r\n\t\tfor (Calendar calendar : gtfsData.getCalendars()) {\r\n\t\t\twriteObject(calendar);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving calendar dates to database...\");\r\n\t\tCalendarDate.deleteFromSandboxRev(session);\r\n\t\tfor (CalendarDate calendarDate : gtfsData.getCalendarDates()) {\r\n\t\t\twriteObject(calendarDate);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving fare rules to database...\");\r\n\t\tFareRule.deleteFromSandboxRev(session);\r\n\t\tfor (FareRule fareRule : gtfsData.getFareRules()) {\r\n\t\t\twriteObject(fareRule);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving fare attributes to database...\");\r\n\t\tFareAttribute.deleteFromSandboxRev(session);\r\n\t\tfor (FareAttribute fareAttribute : gtfsData.getFareAttributes()) {\r\n\t\t\twriteObject(fareAttribute);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving frequencies to database...\");\r\n\t\tFrequency.deleteFromSandboxRev(session);\r\n\t\tfor (Frequency frequency : gtfsData.getFrequencies()) {\r\n\t\t\twriteObject(frequency);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving transfers to database...\");\r\n\t\tTransfer.deleteFromSandboxRev(session);\r\n\t\tfor (Transfer transfer : gtfsData.getTransfers()) {\r\n\t\t\twriteObject(transfer);\r\n\t\t}\r\n\t}",
"@Override\n public void writeToDb(List<String> data) {\n\n try {\n openConnection();\n if (validateData((ArrayList<String>) data)) {\n for (String datum : data) {\n bufferedWriter.write(getDate() + \" - \" + datum);\n bufferedWriter.newLine();\n }\n bufferedWriter.write(\"==================\\n\");\n System.out.println(\"All data is written to MS SQL DB\");\n closeConnection();\n }\n } catch (IOException e) {\n System.err.println(\"ERROR!!!\");\n e.printStackTrace();\n }\n\n }",
"WriteRequest insert(Iterable<? extends PiEntity> entities);",
"@Override\n\t@CoreTransactional\n\tpublic void write(List<? extends WrappedGenericEntityRelationship> items) throws Exception {\n\n\t\tList<CandidateWorkRequest> candidateWorkRequests = new LinkedList<>();\n\n\t\tfor (WrappedGenericEntityRelationship wrappedGenericEntityRelationship : items) {\n\t\t\tthis.recordCount++;\n\t\t\tString message = String.format(\"record=[%d],message=[%s]\",\n\t\t\t\t\t\tthis.recordCount, wrappedGenericEntityRelationship.getMessage());\n\n\t\t\tcandidateWorkRequests.add(this.earleyUploadUtils.candidateWorkRequestFrom(this.transactionId,\n\t\t\t\t\tmessage, wrappedGenericEntityRelationship.getSuccess(), this.userId));\n\n\t\t\tthis.candidateWorkRequestRepository.save(candidateWorkRequests);\n\t\t}\n\t}",
"void write(List<?> columns) throws IOException;",
"public void writeNode() throws IOException {\n // seek to end of file\n file.seek(offset);\n // write offset data\n file.writeLong(offset);\n // write numKeys data\n file.writeLong(numKeys);\n // write children offset\n for (int i = 0; i < children.length; i++){\n file.writeLong(children[i]);\n }\n // write key data\n for (int i = 0; i < keys.length; i++){\n if (keys[i] == null){\n file.writeLong(-1);\n file.writeInt(0);\n }\n else{\n file.writeLong(keys[i].getKey());\n file.writeInt(keys[i].getFrequency());\n }\n }\n\n //The node has been updated -- move it to the front of the cache\n if (cache != null){\n cache.addObject(this);\n }\n\n\n }",
"private void insertToFile (PQNode node) throws Exception{\n int fileId = (node.getPqIndex()-1)/ENTRY_BLOCK_SIZE;\n File file = new File(DIRECTORY + getMapFileName(NAME_PATTERN, fileId));\n\n List<PQNode> nodes = retrieveWholeFile(node.getPqIndex());\n nodes.add(node);\n\n storeToFile(file,nodes, false);\n }",
"public synchronized void getAllFromDbAndWriteIntoTempFiles() throws IOWrapperException, IOIteratorException{\r\n\r\n readFromDB = true;\r\n iow=new IOWrapper();\r\n iow.setupOutput(this.dbname,this.username,this.password,this.hostname,this.port);\r\n iow.setupInput(this.dbname,this.username,this.password,this.hostname,this.port);\r\n \r\n iter = iow.sendInputQuery(\"SELECT COUNT(*) FROM \"+nodetable);\r\n try {\r\n maxProgerss+=Integer.parseInt(((String[])iter.next())[0]); \r\n } catch (NullPointerException e) {maxProgerss+=100;}\r\n iter = iow.sendInputQuery(\"SELECT COUNT(*) FROM \"+edgetable);\r\n try {\r\n maxProgerss+=Integer.parseInt(((String[])iter.next())[0]);\r\n } catch (NullPointerException e) {maxProgerss+=100;}\r\n //iow.closeOutput();\r\n \r\n\r\n \r\n //nodelist\r\n iter = iow.select(nodetable,nodeCols);\r\n iow.setupOutput(Controller.NODES_TMP_FILENAME);\r\n while (iter.hasNext()) {\r\n singleProgress+=1;\r\n String[] data = (String[])iter.next();\r\n iow.writeLine(data[0]+\"\\t\"+data[1]);\r\n }\r\n iow.closeOutput();\r\n\t\r\n //edgelist\r\n iter=iow.select(edgetable,edgeCols);\r\n iow.setupOutput(Controller.EDGES_TMP_FILENAME);\r\n while (iter.hasNext()) {\r\n\t singleProgress+=1;\r\n String[] data = (String[])iter.next();\r\n iow.writeLine(data[0]+\"\\t\"+data[1]+\"\\t\"+data[2]);\r\n //System.out.println(\"wwsl: \"+data[0]+\"\\t\"+data[1]+\"\\t\"+data[2]);\r\n }\r\n iow.closeOutput();\r\n readFromDB=false;\r\n this.stillWorks=false;\r\n }",
"private static void readAndWriteNodes(String name) throws IOException {\n System.out.println(name);\n Map<Long, Long> nodeMap = new HashMap<>();\n boolean firstLine = true;\n fileReader = new BufferedReader(new FileReader(PATH + name));\n fileWriter = new BufferedWriter(new FileWriter(PATH + \"/uid/\" + name));\n String line;\n while ((line = fileReader.readLine()) != null) {\n if (!firstLine) {\n long globalId = getGlobalId();\n String[] lineTokens = LINE_TOKEN_SEPARATOR.split(line);\n long ID = Long.parseLong(lineTokens[0]);\n nodeMap.put(ID, globalId);\n String writeLine = \"\";\n for (int i = 0; i < lineTokens.length; i++) {\n if (i == 0) {\n writeLine += globalId;\n } else {\n writeLine += lineTokens[i];\n }\n writeLine += \"|\";\n }\n fileWriter.write(writeLine);\n fileWriter.newLine();\n vertexCount++;\n globalVertexCount++;\n } else {\n fileWriter.write(line);\n fileWriter.newLine();\n firstLine = false;\n }\n }\n fileWriter.close();\n fileReader.close();\n counterMapNodes.put(name, vertexCount);\n vertexCount = 0;\n vertexList.add(nodeMap);\n }",
"private void saveDhtEntries(final Container<UInt32, NodeEntry> entries) {\n if (entries != null) {\n FileOutputStream stream = null;\n FileChannel channel = null;\n try {\n stream = openFileOutput(DHT_NODES_FILENAME, 0);\n channel = stream.getChannel();\n ByteBuffer buffer = ByteBuffer.allocate(entries.bytesCount());\n buffer.order(ByteOrder.LITTLE_ENDIAN);\n entries.put(buffer);\n buffer.flip();\n channel.write(buffer);\n log.info(\"[edk2 service] save dht entries {}\", entries.size());\n } catch(FileNotFoundException e) {\n log.error(\"[ed2k service] unable to open output stream for dht nodes {}\", e);\n } catch(JED2KException e) {\n log.error(\"[ed2k service] internal error on save dht nodes {}\", e);\n } catch(IOException e) {\n log.error(\"[ed2k service] i/o error {}\", e);\n } catch(Exception e) {\n log.error(\"[ed2k service] unexpected error {}\", e);\n }\n finally {\n if (channel != null) {\n try {\n channel.close();\n } catch(IOException e) {\n //just ignore it\n }\n }\n\n if (stream != null) {\n try {\n stream.close();\n } catch(IOException e) {\n // just ignore it\n }\n }\n }\n }\n }",
"public void saveConnections(){\n\t\tXMLMemento memento = XMLMemento.createWriteRoot(TAG_CONNECTIONS);\r\n\t\tsaveConnections(memento);\r\n\t\tFileWriter writer =null;\r\n\t\ttry {\r\n\t\t\twriter=new FileWriter(getStroreFile());\r\n\t\t\tmemento.save(writer);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tlog(e.getMessage(), IStatus.ERROR, e);\r\n\t\t}\r\n\t\t\tfinally {\r\n\t\t\t\t\r\n\t\t\t\tif(writer !=null){\r\n\t\t\t\t\t\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\twriter.close();\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\tlog(e.getMessage(), IStatus.ERROR, e);\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\r\n\t\t\r\n\t}",
"public void writeDataToDatabase(List<Company> cl){\n\t\tjdbcTemplate.update(\"CREATE TABLE IF NOT EXISTS \" + table + \" (date varchar(40), security varchar(100), weighting float(53));\");\n\t\tfor(Company c : cl){\n\t\t\tthis.writeCompany(c.getDate(), c.getSecurity() ,c.getWeighting());\n\t\t}\n\t}",
"public void persistDataSourcesNode() {\n repository.persist(node.getDataSourcesNodeFullRootPath(), \"\");\n }",
"void saveAll(Collection<?> entities);",
"public void saveData(){\n try{\n DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();\n Document document = documentBuilder.newDocument();\n\n Element rootElement = document.createElement(\"departments\");\n document.appendChild(rootElement);\n for (Department department : entities){\n Element dep = document.createElement(\"department\");\n rootElement.appendChild(dep);\n\n dep.setAttribute(\"id\", department.getId().toString());\n dep.appendChild(createElementFromDepartment(\n document, \"name\", department.getName()));\n dep.appendChild(createElementFromDepartment(\n document, \"numberOfPlaces\", department.getNumberOfPlaces().toString()));\n }\n\n DOMSource domSource = new DOMSource(document);\n StreamResult streamResult = new StreamResult(fileName);\n TransformerFactory transformerFactory = TransformerFactory.newInstance();\n Transformer transformer = transformerFactory.newTransformer();\n transformer.transform(domSource, streamResult);\n\n } catch (ParserConfigurationException | TransformerException e) {\n e.printStackTrace();\n }\n }",
"private void fiveNodesTopo() {\n ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();\n n(tx, true, \"n1\", Stream.of(pI(\"n1:1\"), pB(\"n1:2\"), pI(\"n1:3\"), pO(\"n1:4\")));\n n(tx, true, \"n2\", Stream.of(pI(\"n2:1\"), pB(\"n2:2\"), pO(\"n2:3\"), pI(\"n2:4\")));\n n(tx, true, \"n3\", Stream.of(pO(\"n3:1\"), pB(\"n3:2\"), pO(\"n3:3\"), pI(\"n3:4\")));\n n(tx, true, \"n4\", Stream.of(pO(\"n4:1\"), pI(\"n4:2\"), pB(\"n4:3\"), pB(\"n4:4\")));\n n(tx, true, \"n5\", Stream.of(pI(\"n5:1\"), pB(\"n5:2\"), pB(\"n5:3\"), pO(\"n5:4\")));\n l(tx, \"n2\", \"n2:3\", \"n3\", \"n3:4\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n3\", \"n3:1\", \"n1\", \"n1:1\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n3\", \"n3:3\", \"n5\", \"n5:1\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n4\", \"n4:1\", \"n1\", \"n1:3\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n1\", \"n1:4\", \"n2\", \"n2:4\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n5\", \"n5:4\", \"n4\", \"n4:2\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n try {\n tx.submit().checkedGet();\n } catch (TransactionCommitFailedException e) {\n e.printStackTrace();\n }\n }",
"public void saveAll(){\n // Store postings\n for (Map.Entry<String, PostingsList> entry : this.index.entrySet()) {\n saveJSON(\"postings/t\"+hash(entry.getKey())+\".json\", entry.getValue());\n System.err.println(\"postings/t\"+hash(entry.getKey())+\".json\");\n count++;\n if (count%1000==0)\n System.err.println(\"storing \"+ count);\n }\n // Store mapping ID<->document names mapping\n this.saveJSON(\"postings/docIDs.json\", this.docIDs);\n this.saveJSON(\"postings/docLengths.json\", this.docLengths);\n }",
"private static void writeDataBase() throws IOException{\n \t\n \t// Write variables and class labels\n \tFileSystem fs = FileSystem.get(Mediator.getConfiguration());\n\t ObjectOutputStream objectOutputStream = new ObjectOutputStream(fs.create(new Path(Mediator.getHDFSLocation()+\"/\"+Mediator.getLearnerDatabasePath())));\n\t objectOutputStream.writeObject(Mediator.getVariables());\n\t objectOutputStream.writeObject(Mediator.getClassLabels());\n\t objectOutputStream.close();\n\t fs.close();\n \t\n }",
"private void addNode(String name)\n {\n try (Session session = driver.session())\n {\n // Wrapping Cypher in an explicit transaction provides atomicity\n // and makes handling errors much easier.\n try (Transaction tx = session.beginTransaction())\n {\n tx.run(\"MERGE (a:Node {value: {x}})\", parameters(\"x\", name));\n tx.success(); // Mark this write as successful.\n }\n }\n }",
"public void setNodes( Nodes nodes )\n {\n this.nodes = nodes;\n }",
"void write(List<Object> values) throws TransportException;",
"public abstract void setNodes();",
"public static void saveGraph(ArrayList<Graph> graphs) throws SQLException, ClassNotFoundException\n\t{ \n Class.forName(JDBC_DRIVER);\n ArrayList<Graph> gr = graphs;\n connect = DriverManager.getConnection(DB_URL2,username,pwd);\n statement = connect.createStatement();\n\t\t\n\t int i =0;\n\t Graph graph1;\n\t CrimeCase crime;\n\t \n\t dropTables(statement);\n\t \n\t while (i < gr.size())\n\t {\n Graph cluster = gr.get(i);\n\t \tString graphName = \"graph\"+i;\n\t \tString sql = \"CREATE TABLE \"+graphName+\n\t \"( reportID INT(10), \" +\n\t \" crimeID VARCHAR(10), \" + \n\t \" userID VARCHAR(10), \" + \n\t \" date VARCHAR(20), \" + \n\t \" location VARCHAR(30), \" + \n\t \" time VARCHAR(10), \" + \n\t \" crimeType VARCHAR(100), \" + \n\t \" status VARCHAR(10) ) \" ; \n\t \t \n\t \t //Assuming that a graph is an arraylist\n\t \t \n\t \t //For each CrimeCase in the graph;\n\t \t \t//System.out.println(statement.executeUpdate(sql));\n\t \t \n\t \tstatement.executeUpdate(sql);\n\t \t \t\n\t \tArrayList<CrimeCase> ClusterCrimes = cluster.getCrimeCases();\n\t \t \t\n\t \tsQl = \"SELECT * FROM \"+graphName;\n\t \t \t\n //System.out.println(statement.executeQuery(sQl));\n\t \tstatement.executeQuery(sQl);\n\t \t \n\t \tgraphTable =statement.executeQuery(sQl);\n\t \t \t\n\t \t \tfor (int j=0; j< ClusterCrimes.size(); j++)\n\t \t \t{\n CrimeCase crime1 = ClusterCrimes.get(j);\n\t\t \t \t\n\t\t \t String data = \"INSERT INTO \"+graphName+\"( reportID ,crimeID ,userID,\" +\n \" date , location ,time ,\" +\n \"crimeType ,status ) VALUES ( '\"+crime1.reportID+\"', '\"+\n crime1.crimeID+\"', '\"+\n\t\t\t crime1.userID+\"', '\"+ \n\t\t\t crime1.date+\"', '\"+ \n\t\t\t crime1.location+\"', '\"+ \n\t\t\t crime1.time+\"', '\"+ \n\t\t\t crime1.crimeType+\"', '\"+ \n\t\t\t crime1.status+\"' )\"; \n\t\t \t //System.out.println(data);\n\t\t \t \n\t\t \t //System.out.println(statement.executeUpdate(data));\n\t\t \t statement.executeUpdate(data);\n\t \t \t}\n\t \t \ti++;\n\t }\n\t \n\t\t//takes an arraylist of HCS graphs\n\t\t//For each graph, get the Arraylist of CrimeCases and create tables\n\t\t//Save tables on remote database\n\t}",
"public void setNodes(final List<Nodes> nds) {\n this.nodes = nds;\n }",
"public static void Node(\n\t\tFileWriter nodeData,\n\t\tList<Node> nodes,\n\t\tdouble t\n\t) throws IOException{\n\n\n\t\t\n\t\t// Write the time and node quantities\n\t\tfor ( int i = 0; i < Constants.num_nodes; ++i ) {\n\n\n\t\t\tnodeData.append( String.valueOf(t) );\n\t\t\tnodeData.append(',');\n\t\t\tnodeData.append( String.valueOf(nodes.get(i).xpos) );\n\t\t\tnodeData.append( ',' );\n\t\t\tnodeData.append( String.valueOf(nodes.get(i).stress) );\n\t\t\tnodeData.append( ',' );\n\t\t\tnodeData.append( String.valueOf(nodes.get(i).pres) );\n\t\t\tnodeData.append( ',' );\n\t\t\tnodeData.append( String.valueOf(nodes.get(i).dens) );\n\t\t\tnodeData.append( ',' );\n\t\t\tnodeData.append( String.valueOf(nodes.get(i).xvel) );\n\t\t\tnodeData.append( '\\n' );\n\n\n\t\t}//end for\n\n\t\t// Then leave for later\n\n\t}",
"protected void save(T[] items) {\n\t\tSession session = null;\n\t\ttry {\n\t\t\tsession = mDbHelper.beginTransaction();\n\n\t\t\tfor (T item : items) {\n\t\t\t\tsession.save(item);\n\t\t\t}\n\n\t\t\tmDbHelper.endTransaction(session);\n\t\t} catch (Exception e) {\n\t\t\tmDbHelper.cancelTransaction(session);\n\t\t\tAppLogger.error(e, \"Failed to execute save\");\n\t\t}\n\t}",
"public void createGraphDB() throws SQLException {\n \t\tString nodes = \"insert into nodes(id,label,url,sex,single) select fbid,name,'http://www.facebook.com/profile.php?id='||fbid,sex,single from users;\";\n \t\tString edges = \"insert into edges select distinct users.fbid as source, friends.friendfbid as target, '5' as weight, 'knows' as name from users join friends where friends.userid=users.id\";\n \t\tpreparedStatement = connect.prepareStatement(nodes);\n \t\tpreparedStatement.execute();\n \t\tpreparedStatement = connect.prepareStatement(edges);\n \t\tpreparedStatement.execute();\n \t\tpreparedStatement.close();\n \t}",
"@Override\n\tpublic void writeFile(String hashname) {\n\t\tfor(CircosNode node : nodes){\n\t\t\tString useThisLabel = \"\";\n\t\t\tif(node.getLabel().length() > maxLabelLenght){\n\t\t\t\tuseThisLabel = node.getLabel().substring(0, maxLabelLenght) + \"...\";\n\t\t\t}else{\n\t\t\t\tuseThisLabel = node.getLabel();\n\t\t\t}\n\t\t\toutput += \"chr\" + Settings.CIRCOS_DELIMITER + \"-\" + Settings.CIRCOS_DELIMITER + node.getID() + Settings.CIRCOS_DELIMITER + useThisLabel + \n\t\t\t\t\tSettings.CIRCOS_DELIMITER + \"0\" + Settings.CIRCOS_DELIMITER + Math.round(node.getSzMetricValue()) + \n\t\t\t\t\tSettings.CIRCOS_DELIMITER + node.getID() + \"\\n\";\n\t\t}\n\t\tTools.createFile(Settings.CIRCOS_DATA_PREFIX+\"node\"+hashname+\".txt\", output);\n\t}",
"public void set(List<QueryNode> children);",
"@Override\n public void saveChildrenData() {\n boats.forEach(boatDAO::save);\n }",
"public void writeClusters(List<Cluster> clusters)\n {\n deleteAllFileFolders();\n \n \n // root elements\n Document doc = docBuilder.newDocument();\n Element rootElement = doc.createElement(\"ClusterInfo\");\n doc.appendChild(rootElement);\n Element numClusters=doc.createElement(\"NumOfClusters\");\n numClusters.appendChild(doc.createTextNode(clusters.size()+\"\"));\n rootElement.appendChild(numClusters); \n// Element clusterelem=doc.createElement(\"cluster\");\n int attribCnt=1;\n \n String writeText = \"\";\n for (Cluster cluster : clusters) {\n \n Element clusterelem=doc.createElement(\"cluster\");\n rootElement.appendChild(clusterelem);\n// Attr attr=doc.createAttribute(\"id\");\n// attr.setValue(\"\"+attribCnt++);\n// clusterelem.setAttributeNode(attr);\n clusterelem.setAttribute(\"id\", \"\"+attribCnt++);\n \n Index Firstindex = cluster.getFirstIndex();\n List<Index> indexes = cluster.getIndexLists();\n double rSpec = ((Double) Firstindex.getMeanRGB().get(0)).doubleValue();\n double gSpec = ((Double) Firstindex.getMeanRGB().get(1)).doubleValue();\n double bSpec = ((Double) Firstindex.getMeanRGB().get(2)).doubleValue();\n \n Element rspec=doc.createElement(\"rspec\");\n rspec.appendChild(doc.createTextNode(rSpec+\"\"));\n clusterelem.appendChild(rspec);\n \n Element gspec=doc.createElement(\"gspec\");\n gspec.appendChild(doc.createTextNode(gSpec+\"\"));\n clusterelem.appendChild(gspec);\n \n Element bspec=doc.createElement(\"bspec\");\n bspec.appendChild(doc.createTextNode(bSpec+\"\"));\n clusterelem.appendChild(bspec);\n \n \n String fileNames = \"\\n\\t\\t\";\n for (Index index : indexes) {\n fileNames += index.getFilePath() + \";\\n\\t\\t\";\n }\n// String record = \"@\" + rSpec + \":\" + gspec + \":\" + bspec + \":\" + fileNames + \"#\";\n// writeText += record;\n \n Element imgSrc=doc.createElement(\"ImageSrc\");\n imgSrc.appendChild(doc.createTextNode(fileNames+\"\"));\n clusterelem.appendChild(imgSrc);\n \n }\n \n WriteXML(doc);\n }",
"public void saveAll(Collection<Product> products);",
"public boolean saveNodeList(String fileLocation)\n\t{\n\t\treturn fileManager.saveXMLFile(nodeManager.getNodeList(), fileLocation);\n\t}",
"public void storeData() {\n try {\n ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(\"DB/Guest.ser\"));\n out.writeInt(guestList.size());\n out.writeInt(Guest.getMaxID());\n for (Guest guest : guestList)\n out.writeObject(guest);\n //System.out.printf(\"GuestController: %,d Entries Saved.\\n\", guestList.size());\n out.close();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }",
"void insertDocuments(Collection<Category> categoryList){\n mongoCollection.drop();\n for(Category category : categoryList){\n String json = gson.toJson(category);\n Document document = Document.parse(json);\n mongoCollection.insertOne(document);\n System.out.println(json);\n }\n }",
"Collection<E> save(Iterable<E> entities);",
"public static void storeCluster(Collection<DocumentCluster> clusters, String date_end, int days) throws SQLException, ClassNotFoundException, ParseException, IOException, JSONException {\n\t\tshort cluster_count = 0;\n\t\tDate start;\n\t\tc.setTime(formatter.parse(date_end));\n\t\tc.add(Calendar.DAY_OF_MONTH, -(--days));\n\t\tstart = c.getTime();\n\t\tString date_start = formatter.format(start);\n\t\tdays++;\n\t\t\n\t\t//prendo i dati di configurazione per somer dal file config.json\n\t\tString user, pass, dbname, host;\n\t\tint port;\n\t\t\n\t\t//FileReader reader = new FileReader(\"/home/tomcat/keygraph/config.json\");\n\t\tFileReader reader = new FileReader(\"./config.json\");\n\t\tString fileContents = \"\";\n\t\tint j;\n\t\twhile ((j = reader.read()) != -1) {\n\t\t\tchar ch = (char) j;\n\t\t\tfileContents = fileContents + ch;\n\t\t}\n\t\t\n\t\tJSONObject jsonObject;\n\t\tJSONObject cluster = null;\n\t\ttry {\n\t\t\t//Parsing del file Json\n\t\t\tjsonObject = new JSONObject(fileContents);\n\t\t\tcluster = new JSONObject(jsonObject.get(\"cluster\").toString());\n\t\t} catch (JSONException e) {\n\t\t\tnew WriteConsole(e, \"error in parsing config.json\\n\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\t\n\t\t/* Configuration constants */\n\t\thost = cluster.getString(\"host\").toString();\n\t\tuser = cluster.getString(\"user\").toString();\n\t\tpass = cluster.getString(\"pass\").toString();\n\t\tdbname = cluster.getString(\"dbname\").toString();\n\t\tport = cluster.getInt(\"port\");\n\n\t\treader.close();\n\t\t//fine lettura file di configurazione\n\t\t\t\t\n\t\tDB conn = new DB(host, user, pass, dbname, port);\t\t\n\t\tString temp = \"\";\n\t\tconn.connect();\n\t\t\n\t\t//inserimento cluster container\n\t\t\n\t\t//per ogni document cluster creo una entry di un vettore contenente il numero di notizie per ogni canale e per ogni autore\n\t\tVector<HashMap<String, Integer>> counter = new Vector<HashMap<String, Integer>>();\n\t\tInteger count_channel, count_author;\n\t\t\n\t\tfor (DocumentCluster dc : clusters){\n\t\t\tHashMap<String, Integer> temp_map = new HashMap<String, Integer>();\n\t\t\tfor (Document doc : dc.docs.values()){\n\t\t\t\t//controllo il canale, se č giņ presente nella mappa incremento di uno il valore altrimento lo pongo a 1\n\t\t\t\tcount_channel = temp_map.get(doc.channel);\n\t\t\t\ttemp_map.put(doc.channel, (count_channel==null) ? 1 : count_channel+1);\n\t\t\t\t//controllo l'autore, se č giņ presente nella mappa incremento di uno il valore altrimento lo pongo a 1\n\t\t\t\tcount_author = temp_map.get(doc.author);\n\t\t\t\ttemp_map.put(doc.author, (count_author==null) ? 1 : count_author+1);\n\t\t\t}\n\t\t\tcounter.add(temp_map);\n\t\t}\n\n\t\t//conterrano il nome dell'autore che ha pubblicato, rispettivamente, il numero maggiore e minore di notizie\n\t\tString top_publisher = \"\", worst_publisher = \"\";\n\t\t//conterrano il numero totale delle notizie pubblicate dai canali\n\t\tInteger FacebookCount = 0, TwitterCount = 0, SiteCount = 0, count = 0;\n\t\tHashMap<String, Integer> temp_map_author = new HashMap<String, Integer>();\n\n\t\tfor (HashMap<String, Integer> map : counter){\n\t\t\tFacebookCount += (map.get(\"facebook\") != null ? map.get(\"facebook\") : 0);\n\t\t\tTwitterCount += (map.get(\"twitter\") != null ? map.get(\"twitter\") : 0);\n\t\t\tSiteCount += (map.get(\"sito\") != null ? map.get(\"sito\") : 0);\n\t\t\t\n\t\t\t//per controllare max e min mi server una mappa che aggreghi il cotenuto di tutte le mappe del vettore\n\t\t\tfor (Entry<String, Integer> entry : map.entrySet()) {\n\t\t\t\tif (!(entry.getKey().equals(\"facebook\") || entry.getKey().equals(\"twitter\") || entry.getKey().equals(\"sito\"))){\n\t\t\t\t\tcount = map.get(entry.getKey());\n\t\t\t\t\ttemp_map_author.put(entry.getKey(), (count == null ? entry.getValue() : count + entry.getValue()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//controllo max e min per determinare top e worst publisher\n\t\tint max = 0, min = 9999;\n\t\tfor (Entry<String, Integer> entry : temp_map_author.entrySet()) {\n\t\t\tif (entry.getValue() >= max){\n\t\t\t\tmax = entry.getValue();\n\t\t\t\ttop_publisher = entry.getKey();\n\t\t\t}\n\t\t\tif (entry.getValue() <= min){\n\t\t\t\tmin = entry.getValue();\n\t\t\t\tworst_publisher = entry.getKey();\n\t\t\t}\n\t\t}\n\t\t\n\t\tconn.Query = \"insert into cluster (Name, Start, End, Days, Type, TopPublisher, WorstPublisher, FacebookCount, TwitterCount, SiteCount, ID_container) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\tconn.prstm = conn.con.prepareStatement(conn.Query);\n\t\tconn.prstm.setString(1, date_start + (days==1 ? \" giornaliero\" : days==7 ? \" settimanale\" : \" custom\"));\n\t\tconn.prstm.setString(2, date_start);\n\t\tconn.prstm.setString(3, date_end);\n\t\tconn.prstm.setInt(4, days);\n\t\tconn.prstm.setString(5, \"root\");\n\t\tconn.prstm.setString(6, top_publisher);\n\t\tconn.prstm.setString(7, worst_publisher);\n\t\tconn.prstm.setShort(8, FacebookCount.shortValue());\n\t\tconn.prstm.setShort(9, TwitterCount.shortValue());\n\t\tconn.prstm.setShort(10, SiteCount.shortValue());\n\t\tconn.prstm.setInt(11, 0);\n\t\t\t\t\n\t\tconn.prstm.executeUpdate();\n\t\tcluster_count++;\n\t\t\n\t\t//ottenimento id cluster container\n\t\tconn.Query = \"Select max(ID_cluster) as max from cluster\";\n\t\tconn.rs = conn.stm.executeQuery(conn.Query);\n\t\tInteger id_container = 0;\n\t\twhile (conn.rs.next()){\n\t\t\tid_container = conn.rs.getInt(\"max\");\n\t\t}\n\t\tInteger id_cur = id_container;\n\t\t\n\t\tshort flag;\n\t\tInteger count_for_vector = 0, check_null;\n\t\tfor (DocumentCluster dc : clusters){\n\t\t\tid_cur++;\n\t\t\t\n\t\t\t//cerco un nome del il document cluster\n\t\t\tString name = \"\";\n\t\t\ttemp = \"select name from somer.hashtag where id_post in (\";\n\t\t\tfor (Document d : dc.docs.values()){\n\t\t\t\ttemp += (d.id + \",\");\n\t\t\t}\n\t\t\ttemp = temp.substring(0, temp.length()-1) + \")\";\n\t\t\tconn.Query = temp;\n\t\t\tconn.rs = conn.stm.executeQuery(temp);\n\t\t\tHashMap<String, Integer> hashtag = new HashMap<String, Integer>();\n\t\t\twhile (conn.rs.next()){\n\t\t\t\tInteger count_for_name = hashtag.get(conn.rs.getString(\"name\"));\n\t\t\t\thashtag.put(conn.rs.getString(\"name\"), (count_for_name==null) ? 1 : count_for_name+1);\n\t\t\t}\n\t\t\tdouble max_for_name = 0;\n\t\t\t\n\t\t\tif (hashtag.size() != 0){\n\t\t\t\t//se ci sono hashtag cerco il nome in mezzo a questi\n\t\t\t\tfor (Entry<String, Integer> entry : hashtag.entrySet()) {\n\t\t\t\t if (entry.getValue() >= max_for_name){\n\t\t\t\t \tmax_for_name = entry.getValue();\n\t\t\t\t \tname = entry.getKey();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//se non ci sono hastag lo devo cercare dai node del cluster\n\t\t\t\tfor (Node n : dc.keyGraph.values()){\n\t\t\t\t\tif (n.keyword.tf > max_for_name){\n\t\t\t\t\t\tmax_for_name = n.keyword.tf;\n\t\t\t\t\t\tname = n.keyword.getWord();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//cerco top e worst publisher di questo cluster\n\t\t\tmax = 0;\n\t\t\tmin = 9999;\n\t\t\ttop_publisher = \"\";\n\t\t\tworst_publisher = \"\";\n\t\t\tfor (Entry<String, Integer> entry : counter.elementAt(count_for_vector).entrySet()){\n\t\t\t\tif (!(entry.getKey().equals(\"facebook\") || entry.getKey().equals(\"twitter\") || entry.getKey().equals(\"sito\"))){\n\t\t\t\t\tif (entry.getValue() >= max){\n\t\t\t\t\t\tmax = entry.getValue();\n\t\t\t\t\t\ttop_publisher = entry.getKey();\n\t\t\t\t\t}\n\t\t\t\t\tif (entry.getValue() <= min){\n\t\t\t\t\t\tmin = entry.getValue();\n\t\t\t\t\t\tworst_publisher = entry.getKey();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tconn.Query = \"insert into cluster (Name, Start, End, Days, Type, TopPublisher, WorstPublisher, FacebookCount, TwitterCount, SiteCount, ID_container) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t\tconn.prstm = conn.con.prepareStatement(conn.Query);\n\t\t\tconn.prstm.setString(1, name);\n\t\t\tconn.prstm.setString(2, date_start);\n\t\t\tconn.prstm.setString(3, date_end);\n\t\t\tconn.prstm.setInt(4, days);\n\t\t\tconn.prstm.setString(5, \"leaf\");\n\t\t\tconn.prstm.setString(6, top_publisher);\n\t\t\tconn.prstm.setString(7, worst_publisher);\n\t\t\tcheck_null = counter.elementAt(count_for_vector).get(\"facebook\");\n\t\t\tconn.prstm.setShort(8, (check_null != null ? check_null.shortValue() : 0));\n\t\t\tcheck_null = counter.elementAt(count_for_vector).get(\"twitter\");\n\t\t\tconn.prstm.setShort(9, (check_null != null ? check_null.shortValue() : 0));\n\t\t\tcheck_null = counter.elementAt(count_for_vector).get(\"sito\");\n\t\t\tconn.prstm.setShort(10, (check_null != null ? check_null.shortValue() : 0));\n\t\t\tconn.prstm.setInt(11, id_container);\n\t\t\t\t\t\t\n\t\t\tconn.prstm.executeUpdate();\n\t\t\tcluster_count++;\n\t\t\t\n\t\t\tflag = 0;\n\t\t\ttemp = \"insert into node values \";\n\t\t\tfor (Node n : dc.keyGraph.values()){\n\t\t\t\tif (flag != 0)\n\t\t\t\t\ttemp += ',';\n\t\t\t\telse\n\t\t\t\t\tflag = 1;\n\t\t\t\ttemp += \"(\" + id_cur + \", \\\"\" + n.keyword.getWord().replaceAll(\"[,'\\\"]\", \" \") + \"\\\", \" + n.keyword.tf + \")\";\n\t\t\t}\n\t\t\tconn.Query = temp;\n\t\t\tconn.stm.executeUpdate(conn.Query);\n\t\t\t\n\t\t\tflag = 0;\n\t\t\ttemp = \"insert into edge values \";\n\t\t\tfor (Node n : dc.keyGraph.values()){\n\t\t\t\tfor (Edge e : n.edges.values()) {\n\t\t\t\t\tif (e.n1.equals(n)){\n\t\t\t\t\t\tif (flag != 0)\n\t\t\t\t\t\t\ttemp += ',';\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tflag = 1;\n\t\t\t\t\t\ttemp += \"(\" + id_cur + \", \\\"\" + e.n1.keyword.getWord().replaceAll(\"[,'\\\"]\", \" \") + \"\\\", \\\"\" + e.n2.keyword.getWord().replaceAll(\"[,'\\\"]\", \" \") + \"\\\")\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tconn.Query = temp;\n\t\t\tconn.stm.executeUpdate(conn.Query);\n\t\t\t\n\t\t\tflag = 0;\n\t\t\ttemp = \"insert into news values \";\n\t\t\tfor (Document d : dc.docs.values()){\n\t\t\t\tif (flag != 0)\n\t\t\t\t\ttemp += ',';\n\t\t\t\telse\n\t\t\t\t\tflag = 1;\n\t\t\t\ttemp += \"(\" + id_cur + \", \" + d.id + \")\";\n\t\t\t}\n\t\t\tconn.Query = temp;\n\t\t\tconn.stm.executeUpdate(conn.Query);\n\t\t\t\n\t\t\tcount_for_vector++;\n\t\t}\n\t\t\n\t\tconn.close();\n\t\tnew WriteConsole(\"Cluster aggiunti \" + cluster_count + \"\\n\");\n\t}",
"@Override\n public void write(DataOutput out) throws IOException {\n out.writeInt(namenodes.size());\n for(long nn : namenodes.keySet()) {\n out.writeLong(nn);\n String hostname = namenodes.get(nn).getAddress().getHostAddress()+\":\"+namenodes.get(nn).getPort();\n Text.writeString(out,hostname);\n }\n }",
"@Override\n\tpublic void write(List<? extends User> usersManal) throws Exception {\n\t\t\n\t\t System.out.println(\"new thread before\"+Thread.currentThread().getName() + \" \"+Thread.activeCount() +\" \"+Thread.currentThread().getPriority());\n\t\t userRepository.saveAll(usersManal);\n//\t}\n\t\n System.out.println(\"Data Saved for Users: \" + usersManal.toString());\n System.out.println(\"new thread after\"+Thread.currentThread().getName() + \" \"+Thread.activeCount() +\" \"+Thread.currentThread().getPriority());\n \n //userRepository.save(users);\n}",
"public abstract void write(int rowCount) throws IOException;",
"private void writeAll(){\n try (BufferedWriter ignored = new BufferedWriter(new FileWriter(this.fileName))) {\n Iterable<E> values=entities.values();\n values.forEach(this::writeToFile);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"@Override\n public int bathSave(List<T> entitys) throws Exception {\n return mapper.insertList(entitys);\n }",
"public MongoWriter() {\n\t\tmongoClient = new MongoClient(\"localhost\");\n\t\tMongoDatabase database = mongoClient.getDatabase(\"ai\");\n\t\tminPathsCollection = database.getCollection(\"min_paths\");\n\t\tedgesCollection = database.getCollection(\"edges\");\n\t\t// clear before starting\n\t\tminPathsCollection.drop();\n\t\tedgesCollection.drop();\n\t}",
"private static void saveEntity(TaskViewModel node, StorableFactory<Task> taskFactory) throws DatabaseException {\n Task dto = Infrastructure.getInstance().getTaskMapper().toDto(node);\n taskFactory.create(dto);\n // after creation in db id will be set\n node.setId(dto.getId());\n for (TaskViewModel child : node.getChildren()) {\n saveEntity(child, taskFactory);\n }\n }",
"public static void saveContacts(Tree<Contact, String> tree)\n\t{\n\t\tArrayList<Node<Contact, String>> queueNode = new ArrayList<Node<Contact, String>>();\n\t\tArrayList<Node<Contact, String>> lstNode = new ArrayList<Node<Contact, String>>();\n\t\t\n\t\t// Add root\n\t\tqueueNode.add(tree.getRoot());\n\t\t\n\t\t// While queue is not empty\n\t\twhile(!queueNode.isEmpty())\n\t\t{\n\t\t\tNode<Contact, String> node = queueNode.get(0);\n\t\t\tlstNode.add(node);\n\t\t\tqueueNode.remove(node);\n\t\t\t\n\t\t\t// Add left child\n\t\t\tif (node.getLeftNode() != null)\n\t\t\t{\n\t\t\t\tqueueNode.add(node.getLeftNode());\n\t\t\t}\n\t\t\t\n\t\t\t// Add right child\n\t\t\tif (node.getRightNode() != null)\n\t\t\t{\n\t\t\t\tqueueNode.add(node.getRightNode());\n\t\t\t}\n\t\t}\n\t\t\n\t\tWriter writer = null;\n\t\ttry\n\t\t{\n\t\t\t// Write the file\n\t\t\twriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(\"contacts.txt\"), \"utf-8\"));\n\t\t\t\n\t\t\tfor (Node<Contact, String> item : lstNode)\n\t\t\t{\n\t\t\t\twriter.write(item.getValue().getName() + \"##\" + item.getValue().getPhone() + \"\\n\");\n\t\t\t}\n\t\t}\n\t\tcatch (IOException ex) {}\n\t\tfinally \n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\twriter.close();\n\t\t\t}\n\t\t\tcatch (IOException e) {}\n\t\t}\n\t}",
"public void writeGraphToFile (String fileName) throws IOException {\r\n int[][] childs = new int[getNumV()*getNumV()][getNumV()];\r\n for(int i =0; i< getNumV(); i++)\r\n for(int j =0; j< getNumV(); j++)\r\n childs[i][j] = -1;\r\n\r\n boolean[] visited = new boolean[getNumV()];\r\n for (int i=0; i<getNumV(); i++)\r\n visited[i] = false;\r\n\r\n for(int vertex = 0; vertex<getNumV(); vertex++) {\r\n Queue<Integer> theQueue = new LinkedList<Integer>();\r\n theQueue.offer(vertex);\r\n while (!theQueue.isEmpty()) {\r\n int current = theQueue.remove();\r\n visited[current] = true;\r\n Iterator<Edge> itr = edgeIterator(current);\r\n while (itr.hasNext()) {\r\n Edge edge = itr.next();\r\n int neighbor = edge.getDest();\r\n\r\n if(!visited[neighbor])\r\n theQueue.offer(neighbor);\r\n\r\n childs[current][neighbor] = 1;\r\n }\r\n }\r\n }\r\n\r\n File file = new File(fileName);\r\n FileWriter fW = new FileWriter(file);\r\n BufferedWriter bW = new BufferedWriter(fW);\r\n String s = \"\";\r\n s += getNumV();\r\n bW.write(s.toString());\r\n bW.write(\"\\n\");\r\n\r\n for(int i= 0; i<getNumV(); i++){\r\n for(int j = 0; j < getNumV(); j++){\r\n if(childs[i][j] == 1){\r\n s = \"\";\r\n s += i;\r\n s += \" \";\r\n s += j;\r\n s += \"\\n\";\r\n bW.write(s.toString());\r\n }\r\n }\r\n }\r\n bW.close();\r\n }",
"public void writeIDs() {\n try {\n FileOutputStream fileOut = new FileOutputStream(\"temp/ids.ser\");\n ObjectOutputStream out = new ObjectOutputStream(fileOut);\n out.writeObject(ids);\n out.close();\n fileOut.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"public void insertData(byte[] bytes, String tablename) throws IOException{\n String sql = \"INSERT INTO \" + tablename + \" (tree)\";\n sql += \" VALUES ( \" + bytes + \" )\";\n session.execute(sql);\n }",
"public void saveAll(List list);",
"protected void persist(T[] items) {\n\t\tSession session = null;\n\t\ttry {\n\t\t\tsession = mDbHelper.beginTransaction();\n\n\t\t\tfor (T item : items) {\n\t\t\t\tsession.persist(item);\n\t\t\t}\n\n\t\t\tmDbHelper.endTransaction(session);\n\t\t} catch (Exception e) {\n\t\t\tmDbHelper.cancelTransaction(session);\n\t\t\tAppLogger.error(e, \"Failed to execute persist\");\n\t\t}\n\t}",
"private void fourNodesTopo() {\n ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();\n n(tx, true, \"n1\", Stream.of(pB(\"n1:1\"), pB(\"n1:2\"), pI(\"n1:3\"), pO(\"n1:4\"), pO(\"n1:5\")));\n n(tx, true, \"n2\", Stream.of(pB(\"n2:1\"), pB(\"n2:2\"), pO(\"n2:3\"), pI(\"n2:4\"), pI(\"n2:5\")));\n n(tx, true, \"n3\", Stream.of(pB(\"n3:1\"), pB(\"n3:2\"), pO(\"n3:3\"), pO(\"n3:4\"), pI(\"n3:5\")));\n n(tx, true, \"n4\", Stream.of(pB(\"n4:1\"), pB(\"n4:2\"), pI(\"n4:3\"), pI(\"n4:4\"), pO(\"n4:5\")));\n l(tx, \"n1\", \"n1:5\", \"n2\", \"n2:5\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n1\", \"n1:4\", \"n4\", \"n4:4\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n2\", \"n2:3\", \"n4\", \"n4:3\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n3\", \"n3:4\", \"n2\", \"n2:4\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n4\", \"n4:5\", \"n3\", \"n3:5\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n try {\n tx.submit().checkedGet();\n } catch (TransactionCommitFailedException e) {\n e.printStackTrace();\n }\n }",
"public void save() throws DBAppException, IOException{\n\t\tint numberOfPages = pages_loaded.size();\n\t\tfor (int i = 1; i <= numberOfPages; i++) {\n\t\t\tsavePage(i);\n\t\t}\n\t}",
"public void writeUsers() {\n try {\n FileOutputStream fileOut = new FileOutputStream(\"temp/users.ser\");\n ObjectOutputStream out = new ObjectOutputStream(fileOut);\n out.writeObject(users);\n out.close();\n fileOut.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"private void updateDatabase() {\n\t\tAbstractSerializer serializer = new CineplexSerializer();\n\t\tArrayList<String> updatedRecords = serializer.serialize(records);\n\t\tDatabaseHandler.writeToDatabase(DATABASE_NAME, updatedRecords);\n\t}",
"public void sendDataToDB() throws JSONException, InstantiationException, IllegalAccessException, ClassNotFoundException, UnirestException, ParseException {\r\n\t\t\r\n\t\tArrayList<HashMap<String, String>> dataSet = new ArrayList<>();\r\n\t\t\r\n\t\tfor (int i = 0; i < dataArray.length(); i++) {\r\n\t\t\tHashMap<String, String> jsonObject = new HashMap<String, String>();\r\n\t\t\tjsonObject.put(\"id\" ,dataArray.getJSONObject(i).get(\"id\").toString());\r\n\t\t\tjsonObject.put(\"name\", dataArray.getJSONObject(i).get(\"name\").toString());\r\n\t\t\tjsonObject.put(\"free_bikes\", dataArray.getJSONObject(i).get(\"free_bikes\").toString());\r\n\t\t\tjsonObject.put(\"timestamp\", changeTimeStamptoUnixTimeString(dataArray.getJSONObject(i).get(\"timestamp\").toString()));\r\n\t\t\tjsonObject.put(\"latitude\", dataArray.getJSONObject(i).get(\"latitude\").toString());\r\n\t\t\tjsonObject.put(\"longitude\", dataArray.getJSONObject(i).get(\"longitude\").toString());\r\n\r\n\t\t\tdataSet.add(jsonObject);\r\n\t\t}\r\n\t\t\r\n\t\t// Send whole data to DBService\r\n\t\tUnirest.post(\"http://stadtraddbservice:6000/newData\")\r\n\t\t//Unirest.post(\"http://localhost:6000/newData\") // Fuer lokalen Test\r\n\t\t .body(new Gson().toJson(dataSet))\r\n\t\t .asString();\r\n\t}",
"public void writeToDatabase(List<Page> pageList) {\n\t\tDbConnector db = null;\n\t\ttry {\n\t\t\tdb = new DbConnector();\n\t\t} catch (ClassNotFoundException | SQLException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tfor (Page page : pageList) {\n\t\t\ttry {\n\t\t\t\tdb.executeUpdate(SqlConstants.PAGE_INSERT, Arrays.asList(String.valueOf(page.getPageId()),\n\t\t\t\t\t\tpage.getTitle(), String.valueOf(page.getNs()), \"EN\"));\n\t\t\t\tdb.executeUpdate(SqlConstants.PAGE_CONTENT_INSERT,\n\t\t\t\t\t\tArrays.asList(String.valueOf(page.getPageId()), page.getExtract()));\n\t\t\t\tint position = 0;\n\t\t\t\tfor (String key : page.getExtractMap().keySet()) {\n\t\t\t\t\tString fullText = \"\";\n\t\t\t\t\tLinkedHashMap<String, String> textMap = page.getExtractMap().get(key);\n\t\t\t\t\tfor (String textMapKey : textMap.keySet()) {\n\t\t\t\t\t\tfullText += textMap.get(textMapKey);\n\t\t\t\t\t}\n\t\t\t\t\tdb.executeUpdate(SqlConstants.PAGE_EXTRACT_INSERT,\n\t\t\t\t\t\t\tArrays.asList(String.valueOf(page.getPageId()), key, fullText, String.valueOf(position)));\n\t\t\t\t\tposition++;\n\t\t\t\t}\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tdb.close();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"void writeMap(Collection<?> array);",
"private void save_items(Connection connection, String table_name, String[] columns,\r\n int url_id, LinkedList<String> values) throws SQLException{\r\n \r\n PreparedStatement prep_state = create_prepared_insert(connection, table_name, columns);\r\n Iterator values_it = values.iterator();\r\n \r\n int counter = 1;\r\n while(values_it.hasNext()){\r\n String word = (String) values_it.next();\r\n String[] storing_values = {Integer.toString(url_id), word};\r\n set_strings(prep_state, storing_values);\r\n \r\n prep_state.addBatch();\r\n \r\n if(counter % batch_limit == 0){\r\n prep_state.executeBatch();\r\n }\r\n }\r\n \r\n prep_state.executeBatch();\r\n \r\n close_prepared_statement(prep_state);\r\n }",
"public void writeXML(String xml){\n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\tDocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance(); \n\t\t\tDocumentBuilder documentBuilder = documentFactory.newDocumentBuilder(); \n\t\t\t// define root elements \n\t\t\tDocument document = documentBuilder.newDocument(); \n\t\t\tElement rootElement = document.createElement(\"graph\"); \n\t\t\tdocument.appendChild(rootElement);\n\t\t\t\n\t\t\tfor(int i=0;i<Rel.getChildCount();i++){\n\t\t\t\tif(Rel.getChildAt(i).getTag() != null){\n\t\t\t\t\tif(Rel.getChildAt(i).getTag().toString().compareTo(\"node\") == 0){\n\t\t\t\t\t\tArtifact artifact = (Artifact) Rel.getChildAt(i);\n\t\t\t\t\t\tElement node = addElement(rootElement, \"node\", document);\n\t\t\t\t\t\tElement id = addAttribute(\"id\",artifact.getId()+\"\", document); //we create an attribute for a node\n\t\t\t\t\t\tnode.appendChild(id);//and then we attach it to the node\n\t\t\t\t\t\t\n\t\t\t\t\t\tArrayList <Artifact> fathers = artifact.getFathers();\n\t\t\t\t\t\tif(fathers != null){\n\t\t\t\t\t\t\taddElement(node, \"fathers\", document);//for complex attribute like array of fathers we add an element to the node\n\t\t\t\t\t\t\tfor(int j=0;j<fathers.size();j++){\n\t\t\t\t\t\t\t\tElement father = addAttribute(\"father\",fathers.get(j).getId()+\"\", document);//inside this element created in the node we add all its fathers as attributes\n\t\t\t\t\t\t\t\tnode.appendChild(father);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tArrayList <Artifact> sons = artifact.getSons();\n\t\t\t\t\t\tif(sons != null){\n\t\t\t\t\t\t\taddElement(node, \"sons\", document);//for complex attribute like array of sons we add an element to the node\n\t\t\t\t\t\t\tfor(int j=0;j<sons.size();j++){\n\t\t\t\t\t\t\t\tElement son = addAttribute(\"son\",sons.get(j).getId()+\"\", document);//inside this element created in the node we add all its sons as attributes\n\t\t\t\t\t\t\t\tnode.appendChild(son);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tElement label = addAttribute(\"label\", artifact.getText()+\"\", document);\n\t\t\t\t\t\tnode.appendChild(label);\n\t\t\t\t\t\t\n\t\t\t\t\t\tElement age = addAttribute(\"age\", artifact.getAge()+\"\", document);\n\t\t\t\t\t\tnode.appendChild(age);\n\t\t\t\t\t\t\n\t\t\t\t\t\tElement type = addAttribute(\"type\", artifact.getType()+\"\", document);\n\t\t\t\t\t\tnode.appendChild(type);\n\t\t\t\t\t\t\n\t\t\t\t\t\tElement information = addAttribute(\"information\", artifact.getInformation()+\"\", document);\n\t\t\t\t\t\tnode.appendChild(information);\n\t\t\t\t\t\t\n\t\t\t\t\t\tElement position = addAttribute(\"position\", artifact.getPosition()+\"\", document);\n\t\t\t\t\t\tnode.appendChild(position);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// creating and writing to xml file \n\t\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance(); \n\t\t\tTransformer transformer = transformerFactory.newTransformer(); \n\t\t\tDOMSource domSource = new DOMSource(document); \n\t\t\tStreamResult streamResult = new StreamResult(new File(xml)); \n\t\t\ttransformer.transform(domSource, streamResult);\n \n \n }catch(Exception e){\n \tLog.v(\"error writing xml\",e.toString());\n }\n\t\t\n\t\t\n\t}",
"public void commit() {\n\t\ttry {\n\t\t\tTransformer transformer = TransformerFactory.newInstance().newTransformer();\n\t\t\tDOMSource domSource = new DOMSource(document);\n\t\t\tStreamResult streamResult = new StreamResult(new File(fileName));\n\t\t\ttransformer.transform(domSource, streamResult);\n\t\t\t//Reload nodes list\n\t\t\tnodes = document.getDocumentElement().getChildNodes();\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private void writeToFile(){\n try(BufferedWriter br = new BufferedWriter(new FileWriter(filename))){\n for(Teme x:getAll())\n br.write(x.toString()+\"\\n\");\n br.close();\n }catch (IOException e){\n e.printStackTrace();\n }\n }",
"private void saveToDb(long subcategoryId) {\n\n for (NewsClass item : newsList)\n item.save();\n\n }",
"@Override\n\tpublic boolean save(String file) {\n\t\n\t\tGson gson = new GsonBuilder().create();\n\t\tJsonArray arrEdges = new JsonArray();\n\t\tJsonArray arrNodes = new JsonArray();\n\t\tCollection<node_data> arrV = this.dwg.getV();\n\t\tfor(node_data vertex : arrV) {\n\t\t\tJsonObject nodesObj = new JsonObject();\n\t\t\tgeo_location gl = vertex.getLocation();\n\t\t\tnodesObj.addProperty(\"pos\",String.valueOf(gl.x())+\",\"+String.valueOf(gl.y())+\",\"+String.valueOf(gl.z()));\n\t\t\tnodesObj.addProperty(\"id\",vertex.getKey());\n\t\t\tarrNodes.add(nodesObj);\n\t\t\tCollection<edge_data> arrE = this.dwg.getE(vertex.getKey());\n\t\t\tfor(edge_data edge : arrE) {\n\t\t\t\tJsonObject edgesObj = new JsonObject();\n\t\t\t\tedgesObj.addProperty(\"src\",edge.getSrc());\n\t\t\t\tedgesObj.addProperty(\"w\",edge.getWeight());\n\t\t\t\tedgesObj.addProperty(\"dest\",edge.getDest());\n\t\t\t\tarrEdges.add(edgesObj);\n\t\t\t}\n\t\t}\n\t\tJsonObject graphObj = new JsonObject();\n\t\tgraphObj.add(\"Edges\",arrEdges);\n\t\tgraphObj.add(\"Nodes\",arrNodes);\n\t\tString ans = gson.toJson(graphObj);\n\n\t\ttry{\n\t\t\tPrintWriter pw = new PrintWriter(new File(file));\n\t\t\tpw.write(ans);\n\t\t\tpw.close();\n\t\t}\n\t\tcatch (FileNotFoundException e){\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public void store(final Collection<HPListGraph<NodeType, EdgeType>> set) {\n\t\tset.add(getHPlistGraph());\n\t}",
"public <T> Collection<T> saveAll(Collection<T> entities);",
"public void create(int x, int y, int parentx, int parenty, String description, String status) throws SQLException {\n var statement = connection.prepareStatement(\"INSERT INTO nodes (x, y, parentx, parenty, status, owner, description) VALUES (?, ?, ?, ?, ?, ?, ?)\");\n statement.setInt(1, x);\n statement.setInt(2, y);\n statement.setInt(3, parentx);\n statement.setInt(4, parenty);\n statement.setString(5, status);\n statement.setString(6, \"temp\");\n description=swearFilter(description); //METHOD TAKES IN THE DESCRIPTION AND FILTERS FOR SWEAR WORDS\n statement.setString(7, description);\n statement.execute();\n statement.close();\n }",
"void writeItem(String outDir, List<T> items);",
"void bindNodes() {\n for (Exp exp : getExpList()) {\n exp.setNodeList(exp.getNodes());\n }\n }",
"private void writeDataToDatabase(InfluxDB influxDB, Target target, Point[] data) {\n for (Point p : data) {\n influxDB.write(target.getDatabase(), \"default\", p);\n }\n }",
"public void salvaElezione(ArrayList<Elezione> elezioni) {\n\t\t\t\n\t\t\tDB db = getDB();\n\t\t\tMap<Integer, Elezione> map = db.getTreeMap(\"elezione\");\n\t\t\tmap.clear();\n\t\t\tint contatore = 0;\n\t\t\tfor (Elezione lista : elezioni) {\n\t\t\t\tmap.put(contatore++, lista);\n\t\t\t}\n\t\t\t\n\t\t\tdb.commit(); // commit dopo le modifiche\n\t\t\t\n\t\t}",
"public void writeData(TaskList tasks) throws IOException {\n FileWriter fw = new FileWriter(file);\n String tmpTxt = \"\";\n\n if (tasks.getSize() > 0) {\n for (int i = 0; i < tasks.getSize() - 1; i++) {\n tmpTxt = tmpTxt + tasks.getDukeList().get(i).format() + \"\\n\";\n }\n tmpTxt = tmpTxt + tasks.getDukeList().get(tasks.getSize() - 1).format();\n }\n\n fw.write(tmpTxt);\n fw.close();\n }",
"@Override\n\tpublic void append(Object data) throws IOException {\n\n\t\tNode newNode = new Node(data);\n\t\tif (head == null) {\n\t\t\thead = newNode;\n\t\t} else {\n\t\t\tNode currentNode = head;\n\t\t\t\n\t\t\twhile (currentNode.getNext() != null) {\n\t\t\t\tcurrentNode = currentNode.getNext();\t\n\t\t\t}\n\t\t\t\n\n\t\t\tFileOutputStream fos = new FileOutputStream(\"res/test.dat\");\n\t\t\tObjectOutputStream oos = new ObjectOutputStream(fos);\n\t\t\t\n\t\t\toos.writeObject(currentNode.getElement()); \n\t\t\t\n\t\t\toos.reset();\n\n\t\t\toos.close();\n\t\t\tfos.close();\n\t\t\t\n\t\t\tcurrentNode.setNext(newNode);\n\n\t\t}\n\t\tthis.size++;\t\n\t\n\n\t}",
"void setNode(int nodeId, double lat, double lon, double ele);",
"void write(List<?> columns, CellProcessor[] processors) throws IOException;",
"@Transactional\n public abstract void updateNode(OnmsNode node);",
"public void writeToFile(TaskList tasks) {\n try {\n FileWriter fw = new FileWriter(filePath);\n for (Task t : tasks.getListOfTasks()) {\n fw.write(t.getRecordString() + \"\\n\");\n }\n fw.close();\n } catch (IOException e) {\n System.out.println(\"Error writing to data file.\");\n }\n }",
"public void save(){\n\t\t\n\t\ttry {\n\t\t\t\t \n\t\t\t// Open Streams\n\t\t\tFileOutputStream outFile = new FileOutputStream(\"user.ser\");\n\t\t\tObjectOutputStream outObj = new ObjectOutputStream(outFile);\n\t\t\t\t \n\t\t\t// Serializing the head will save the whole list\n\t\t\toutObj.writeObject(this.head);\n\t\t\t\t \n\t\t\t// Close Streams \n\t\t\toutObj.close();\n\t\t\toutFile.close();\n\t\t}\n\n\t\tcatch(Exception e) {\n\t\t\tSystem.out.println(\"Error saving\");\n\t\t}\n\t\t\t\n\t}",
"public void writeTo(File file) throws IOException, ClassNotFoundException, CollectionManagerNotExist {\n /**\n if(file.exists()){\n throw new CollectionManagerNotExist();\n }\n **/\n ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file));\n out.writeInt(collections.size());\n collections.entrySet().stream().forEachOrdered(entry->{\n String key = entry.getKey();\n Collection collection = entry.getValue();\n try {\n out.writeUTF(key);\n out.writeObject(collection);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n });\n out.flush();\n out.close();\n }",
"void setNode(int nodeId, double lat, double lon);",
"public long wsadd_node(NodeWS node)\r\n\t\t\t\t{ \r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tlong id = 0; //id de la tabla user (único) \r\n\t\t\t\t Node nodeC = new Node(node.getNode_name(),node.getMAC_address(),node.getPort_number());\r\n\t\t\t\t \r\n\t\t\t\t //User cliente1 = new User(\"luis.ortega@gmail.com\", \"gutie33\", 1, \"Luis\",\"677899876\", \"Informatica\"); \r\n\t\t\t\t \r\n\t\t\t\t try \r\n\t\t\t\t { \r\n\t\t\t\t iniciaOperacion(); \r\n\t\t\t\t \r\n\t\t\t\t id= (Long) sesion.createQuery(\"SELECT u.id_company FROM Company u WHERE u.company_name ='\"+node.getName_company()+\"'\").uniqueResult();\r\n\t\t\t\t Company x = (Company) sesion.load(Company.class, id);\r\n\t\t\t\t x.addNodo(nodeC);\r\n\t\t\t\t \r\n\t\t\t\t\t nodeC.setCompany(x);\r\n\t\t\t\t \r\n\t\t\t\t //sesion.update(compx);\r\n\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t\t //metodo para guardar cliente (del objeto hibernate.sesion) \r\n\t\t\t\t tx.commit(); \r\n\t\t\t\t }catch(HibernateException he) \r\n\t\t\t\t { \r\n\t\t\t\t manejaExcepcion(he);\r\n\t\t\t\t throw he; \r\n\t\t\t\t }finally \r\n\t\t\t\t { \r\n\t\t\t\t \t//Busqueda del id con qu elo ha introducido a la BBDD\r\n\t\t\t\t \tid= (Long) sesion.createQuery(\"SELECT u.id_node FROM Node u WHERE u.node_name ='\"+node.getNode_name()+\"'\").uniqueResult();\r\n\t\t\t\t sesion.close(); \r\n\t\t\t\t } \r\n\t\t\t\t return id; \r\n\t\t\t\t}",
"@Override\n\tpublic void put(Collection<SinkRecord> sinkRecords) throws ConnectException {\n \n\t\tfor (SinkRecord fuelrecord : sinkRecords) {\n\t\t\tSystem.out.print(\"Put message: \" + (String)fuelrecord.value() + \"\\n\"); \n\t\t\t\n\t\t\tSystem.out.println(\"FUEL PARSING\");;\n\t\t\tJsonReader jsonReader1 = Json.createReader(new StringReader((String) fuelrecord.value())); \n\t\t\tJsonObject jsonObj = jsonReader1.readObject();\n\t\t\tString fuelId = jsonObj.getString(\"fuelId\");\n\t\t\tSystem.out.println(\"Fuel ID and Name\" + fuelId);\n\t\t\t \t \n\t\t\tdouble lat = jsonObj.getJsonNumber(\"lat\").doubleValue();\n\t\t\tdouble lon = jsonObj.getJsonNumber(\"lon\").doubleValue();\n\t\t\t\t \t\n\t\t\tSystem.out.printf(\"fuel id: %s lat: %f lon: %f\\n\", fuelId, lat, lon);\t\n\t\t\t \n\t\t\tString fuelSql = \"INSERT INTO fuelTable (fuelId, lat, lon, geom) \"\n\t\t\t \t\t + \"VALUES (\" \n\t\t\t \t\t + \"'\" + fuelId + \"'\" + \",\"\n\t\t\t \t\t + lat + \",\" \n\t\t\t \t\t + lon + \",\"\n\t\t\t \t\t + \"'POINT(\"+ lat + \" \" + lon + \")'\" + \");\";\n\t\t\t \n\t\t\tSystem.out.println(fuelSql);\n\t\t\tfuelList.add(fuelSql);\n\t\t}\n\t}",
"@Override\r\n\t\t\tpublic void run() {\n\t\t\t\tfor(int i = 0; i < 1000; i++) {\r\n\t\t\t\t\tfinal BasicDBObject doc = new BasicDBObject(\"_id\", i);\r\n\t\t\t\t\tdoc.put(\"ts\", new Date());\r\n\t\t\t\t\tcoll.insert(doc);\r\n\t\t\t\t}\r\n\t\t\t}",
"void write(Object... columns) throws IOException;",
"public void write(DataOutput out) throws IOException {\n this.count.write(out);\n this.week.write(out);\n out.writeInt(hashTagList.size());\n\n for(int index=0;index<hashTagList.size();index++){\n // Serializing every values in list to send to next machine\n hashTagList.get(index).write(out); //write all the value of list\n }\n }",
"private void createDbRecords() throws IOException, JAXBException {\n }",
"public void writeNode(BTreeNode node) throws IOException {\n\t\tif (useCache) {\n\t\t\tif (cache.indexOf(node) == -1) {\n\t\t\t\tcache.add(node);\n\t\t\t}\n\t\t} else {\n\t\t\tfile.write(node);\n\t\t}\n\t}",
"public void write(OutputStream o) throws SlickException {\r\n try {\r\n DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();\r\n DocumentBuilder docBuilder = dbfac.newDocumentBuilder();\r\n Document doc = docBuilder.newDocument();\r\n \r\n Element map = doc.createElement(\"map\");\r\n map.setAttribute(\"version\", \"1.0\");\r\n if (this.orientation == TiledMap.ORTHOGONAL)\r\n map.setAttribute(\"orientation\", \"orthogonal\");\r\n else if (this.orientation == TiledMap.ISOMETRIC)\r\n map.setAttribute(\"orientation\", \"isometric\");\r\n map.setAttribute(\"tilewidth\", \"\" + this.tileWidth);\r\n map.setAttribute(\"tileheight\", \"\" + this.tileHeight);\r\n map.setAttribute(\"width\", \"\" + this.width);\r\n map.setAttribute(\"height\", \"\" + this.height);\r\n doc.appendChild(map);\r\n for (int i = 0; i < this.tileSets.size(); i++) { // Loop through all tilesets\r\n TileSet tilesetData = this.tileSets.get(i);\r\n Element tileset = doc.createElement(\"tileset\");\r\n tileset.setAttribute(\"firstgid\", \"\" + tilesetData.firstGID);\r\n tileset.setAttribute(\"name\", tilesetData.name);\r\n tileset.setAttribute(\"tilewidth\", \"\" + tilesetData.tileWidth);\r\n tileset.setAttribute(\"tileheight\", \"\" + tilesetData.tileHeight);\r\n tileset.setAttribute(\"spacing\", \"\" + tilesetData.tileSpacing);\r\n tileset.setAttribute(\"margin\", \"\" + tilesetData.tileMargin);\r\n Element image = doc.createElement(\"image\");\r\n String imagePath = tilesetData.imageref.replaceFirst(this.getTilesLocation() + \"/\", \"\");\r\n image.setAttribute(\"source\", imagePath);\r\n image.setAttribute(\"width\", \"\" + tilesetData.tiles.getWidth());\r\n image.setAttribute(\"height\", \"\" + tilesetData.tiles.getHeight());\r\n tileset.appendChild(image);\r\n int tileCount = tilesetData.tiles.getHorizontalCount() * tilesetData.tiles.getVerticalCount();\r\n Element tilesetProperties = doc.createElement(\"properties\");\r\n Properties tilesetPropertiesData = tilesetData.tilesetProperties;\r\n if (tilesetProperties != null) {\r\n Enumeration propertyEnum = tilesetPropertiesData.propertyNames();\r\n while (propertyEnum.hasMoreElements()) {\r\n String key = (String) propertyEnum.nextElement();\r\n Element tileProperty = doc.createElement(\"property\");\r\n tileProperty.setAttribute(\"name\", key);\r\n tileProperty.setAttribute(\"value\", tilesetPropertiesData.getProperty(key));\r\n tilesetProperties.appendChild(tileProperty);\r\n }\r\n tileset.appendChild(tilesetProperties);\r\n }\r\n if (tileCount == 1) {\r\n tileCount++;\r\n }\r\n for (int tileI = 0; tileI < tileCount; tileI++) {\r\n Properties tileProperties = tilesetData.getProperties(tileI);\r\n if (tileProperties != null) {\r\n Element tile = doc.createElement(\"tile\");\r\n int tileID = tileI - tilesetData.firstGID;\r\n tile.setAttribute(\"id\", \"\" + tileID);\r\n Element tileProps = doc.createElement(\"properties\");\r\n \r\n Enumeration propertyEnum = tilesetData.getProperties(tileI).propertyNames();\r\n while (propertyEnum.hasMoreElements()) {\r\n String key = (String) propertyEnum.nextElement();\r\n Element tileProperty = doc.createElement(\"property\");\r\n tileProperty.setAttribute(\"name\", key);\r\n tileProperty.setAttribute(\"value\", tileProperties.getProperty(key));\r\n tileProps.appendChild(tileProperty);\r\n }\r\n tile.appendChild(tileProps);\r\n tileset.appendChild(tile);\r\n }\r\n }\r\n map.appendChild(tileset);\r\n }\r\n \r\n for (int i = 0; i < this.layers.size(); i++) {\r\n Element layer = doc.createElement(\"layer\");\r\n Layer layerData = layers.get(i);\r\n layer.setAttribute(\"name\", layerData.name);\r\n layer.setAttribute(\"width\", \"\" + layerData.width);\r\n layer.setAttribute(\"height\", \"\" + layerData.height);\r\n layer.setAttribute(\"opacity\", \"\" + layerData.opacity);\r\n if (layerData.visible)\r\n layer.setAttribute(\"visible\", \"1\");\r\n else\r\n layer.setAttribute(\"visible\", \"0\");\r\n Element data = doc.createElement(\"data\");\r\n \r\n ByteArrayOutputStream os = new ByteArrayOutputStream();\r\n for (int tileY = 0; tileY < layerData.height; tileY++) {\r\n for (int tileX = 0; tileX < layerData.width; tileX++) {\r\n int tileGID = layerData.data[tileX][tileY][2];\r\n os.write(tileGID);\r\n os.write(tileGID << 8);\r\n os.write(tileGID << 16);\r\n os.write(tileGID << 24);\r\n }\r\n }\r\n os.flush();\r\n String compressedData = Base64.encodeBytes(os.toByteArray(), Base64.DONT_BREAK_LINES | Base64.GZIP | Base64.ENCODE);\r\n data.appendChild(doc.createTextNode(compressedData));\r\n data.setAttribute(\"encoding\", \"base64\");\r\n data.setAttribute(\"compression\", \"gzip\");\r\n \r\n layer.appendChild(data);\r\n map.appendChild(layer);\r\n }\r\n for (int objectGroupI = 0; objectGroupI < this.objectGroups.size(); objectGroupI++) {\r\n Element objectGroup = doc.createElement(\"objectgroup\");\r\n ObjectGroup objectGroupData = objectGroups.get(objectGroupI);\r\n objectGroup.setAttribute(\"color\", \"white\");\r\n // It doesn't appear we use a color value,\r\n // but its in the format so...\r\n objectGroup.setAttribute(\"name\", objectGroupData.name);\r\n objectGroup.setAttribute(\"width\", \"\" + objectGroupData.width);\r\n objectGroup.setAttribute(\"height\", \"\" + objectGroupData.height);\r\n objectGroup.setAttribute(\"opacity\", \"\" + objectGroupData.opacity);\r\n if (objectGroupData.visible)\r\n objectGroup.setAttribute(\"visible\", \"1\");\r\n else\r\n objectGroup.setAttribute(\"visible\", \"0\");\r\n objectGroup.setAttribute(\r\n \"color\",\r\n \"#\" + Float.toHexString(objectGroupData.color.r) + Float.toHexString(objectGroupData.color.g) + Float\r\n .toHexString(objectGroupData.color.b));\r\n \r\n for (int groupObjectI = 0; groupObjectI < objectGroupData.objects.size(); groupObjectI++) {\r\n Element object = doc.createElement(\"object\");\r\n GroupObject groupObject = objectGroupData.objects.get(groupObjectI);\r\n object.setAttribute(\"x\", \"\" + groupObject.x);\r\n object.setAttribute(\"y\", \"\" + groupObject.y);\r\n switch (groupObject.objectType) {\r\n case IMAGE:\r\n object.setAttribute(\"gid\", \"\" + groupObject.gid);\r\n break;\r\n case RECTANGLE:\r\n object.setAttribute(\"name\", groupObject.name);\r\n object.setAttribute(\"type\", groupObject.type);\r\n object.setAttribute(\"width\", \"\" + groupObject.width);\r\n object.setAttribute(\"height\", \"\" + groupObject.height);\r\n break;\r\n case POLYGON:\r\n Element polygon = doc.createElement(\"polygon\");\r\n String polygonPoints = \"\";\r\n for (int polygonPointIndex = 0; polygonPointIndex < groupObject.points.getPointCount() - 1; polygonPointIndex++) {\r\n polygonPoints += groupObject.points.getPoint(polygonPointIndex)[0] + \",\" + groupObject.points\r\n .getPoint(polygonPointIndex)[1] + \" \";\r\n }\r\n polygonPoints.trim();\r\n polygon.setAttribute(\"points\", polygonPoints);\r\n break;\r\n case POLYLINE:\r\n Element polyline = doc.createElement(\"polyline\");\r\n String polylinePoints = \"\";\r\n for (int polyLinePointIndex = 0; polyLinePointIndex < groupObject.points.getPointCount() - 1; polyLinePointIndex++) {\r\n polylinePoints += groupObject.points.getPoint(polyLinePointIndex)[0] + \",\" + groupObject.points\r\n .getPoint(polyLinePointIndex)[1] + \" \";\r\n }\r\n polylinePoints.trim();\r\n polyline.setAttribute(\"points\", polylinePoints);\r\n break;\r\n }\r\n \r\n if (groupObject.props != null) {\r\n Element objectProps = doc.createElement(\"properties\");\r\n Enumeration propertyEnum = groupObject.props.propertyNames();\r\n while (propertyEnum.hasMoreElements()) {\r\n String key = (String) propertyEnum.nextElement();\r\n Element objectProperty = doc.createElement(\"property\");\r\n objectProperty.setAttribute(\"name\", key);\r\n objectProperty.setAttribute(\"value\", groupObject.props.getProperty(key));\r\n objectProps.appendChild(objectProperty);\r\n }\r\n object.appendChild(objectProps);\r\n }\r\n objectGroup.appendChild(object);\r\n \r\n }\r\n \r\n map.appendChild(objectGroup);\r\n }\r\n TransformerFactory transformerFactory = TransformerFactory.newInstance();\r\n Transformer transformer = transformerFactory.newTransformer();\r\n DOMSource source = new DOMSource(doc);\r\n StreamResult result = new StreamResult(o);\r\n transformer.transform(source, result);\r\n \r\n } catch (Exception e) {\r\n Log.error(e);\r\n throw new SlickException(\"Failed to write tiledmap\", e);\r\n }\r\n }",
"@Override\n public void storeToGraph(Set<GraphContext> graphContext) {\n\n graphContext.forEach(entry -> {\n try {\n LineageEntity fromEntity = entry.getFromVertex();\n LineageEntity toEntity = entry.getToVertex();\n\n upsertToGraph(fromEntity, toEntity, entry.getRelationshipType(), entry.getRelationshipGuid());\n } catch (Exception e) {\n log.error(VERTICES_AND_RELATIONSHIP_CREATION_EXCEPTION, e);\n }\n });\n }",
"@Override\r\n\tpublic boolean saveAll(List<Transaction> transactions) {\n\t\ttry {\r\n\t\t\tCollection<Transaction> trans = mongoTemplate.insertAll(transactions);\r\n\t\t\tif (null == trans) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t} catch(Exception e){\r\n\t\t\tlogger.error(this.getClass()+\":\"+ Constants.SOMETHING_IS_NOT_RIGHT+\":\"+ Arrays.toString(e.getStackTrace()));\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public void saveMapping() {\n String userHome = System.getProperty(\"user.home\");\n String filePath = userHome + \"/\"+ System.currentTimeMillis() +\"-mapping.xml\";\n XMLExporter exporter = XMLExporter.getInstance();\n File file = new File(filePath);\n try {\n exporter.save(mappings, file);\n Logger.getLogger(MappingAppState.class.getName()).log(Level.INFO, \"Mapping saved as {0}\", filePath);\n } catch (IOException ex) {\n Logger.getLogger(MappingAppState.class.getName()).log(Level.SEVERE, \"Failed to save node!\", ex);\n }\n }",
"@Override\n public boolean save(String file) {\n /*\n Create a builder for the specific JSON format\n */\n GsonBuilder gsonBuilder = new GsonBuilder();\n gsonBuilder.setPrettyPrinting();\n JsonSerializer<DWGraph_DS> serializer = new JsonSerializer<DWGraph_DS>() {\n @Override\n public JsonElement serialize(DWGraph_DS dwGraph_ds, Type type, JsonSerializationContext jsonSerializationContext) {\n JsonObject jsonGraph = new JsonObject();\n jsonGraph.add(\"Nodes\", new JsonArray());\n jsonGraph.add(\"Edges\", new JsonArray());\n\n for (node_data node : G.getV()) {\n JsonObject jsonNodeObject = new JsonObject();\n\n StringBuilder pos = new StringBuilder();\n pos.append(node.getLocation().x());\n pos.append(',');\n pos.append(node.getLocation().y());\n pos.append(',');\n pos.append(node.getLocation().z());\n jsonNodeObject.addProperty(\"pos\", pos.toString());\n jsonNodeObject.addProperty(\"id\", node.getKey());\n jsonNodeObject.addProperty(\"info\", node.getInfo());\n jsonNodeObject.addProperty(\"tag\", node.getTag());\n jsonGraph.get(\"Nodes\").getAsJsonArray().add(jsonNodeObject);\n for (edge_data e : G.getE(node.getKey())) {\n JsonObject jsonEdgeObject = new JsonObject();\n jsonEdgeObject.addProperty(\"src\", e.getSrc());\n jsonEdgeObject.addProperty(\"w\", e.getWeight());\n jsonEdgeObject.addProperty(\"dest\", e.getDest());\n jsonEdgeObject.addProperty(\"info\", e.getInfo());\n jsonEdgeObject.addProperty(\"tag\", e.getTag());\n jsonGraph.get(\"Edges\").getAsJsonArray().add(jsonEdgeObject);\n }\n }\n return jsonGraph;\n }\n };\n gsonBuilder.registerTypeAdapter(DWGraph_DS.class, serializer);\n Gson graphGson = gsonBuilder.create();\n try {\n PrintWriter writer = new PrintWriter(new FileWriter(file));\n writer.write(graphGson.toJson(G));\n writer.flush();\n writer.close();\n return true;\n } catch (IOException e) {\n e.printStackTrace();\n return false;\n }\n }",
"public void store(DBConnection db) throws IOException;",
"private void writeToFile(ArrayList<Task> tasks) throws IOException {\r\n FileWriter fileWriter = new FileWriter(filePath);\r\n for (Task task : tasks) {\r\n Parser fileFormatter = new ParseToFileFormat(task);\r\n String taskData = fileFormatter.getFileFormat();\r\n fileWriter.write(taskData);\r\n }\r\n fileWriter.close();\r\n }",
"void save(storage_server_connections connection);"
] | [
"0.62067",
"0.5752049",
"0.56859446",
"0.5685149",
"0.5631163",
"0.56168264",
"0.5472325",
"0.5468049",
"0.5384581",
"0.5363837",
"0.53499097",
"0.53160036",
"0.52892965",
"0.5277015",
"0.52651376",
"0.5203908",
"0.5203135",
"0.51915693",
"0.5189183",
"0.5185799",
"0.5148513",
"0.5148352",
"0.51297754",
"0.51289934",
"0.51283747",
"0.5126371",
"0.5125581",
"0.51165265",
"0.51109964",
"0.5102537",
"0.5068501",
"0.5062662",
"0.5061813",
"0.5061558",
"0.5054334",
"0.50462633",
"0.50438446",
"0.50405526",
"0.5040487",
"0.5032128",
"0.50277394",
"0.5022524",
"0.50214154",
"0.50170314",
"0.50117975",
"0.5007057",
"0.4994731",
"0.49883193",
"0.49798498",
"0.49786204",
"0.49758014",
"0.49671775",
"0.49617168",
"0.4922332",
"0.49199778",
"0.49162343",
"0.4905029",
"0.48949093",
"0.48774257",
"0.487081",
"0.48626947",
"0.48590615",
"0.48544535",
"0.4852128",
"0.48490006",
"0.48472822",
"0.4834352",
"0.4827208",
"0.48201162",
"0.48199075",
"0.47988883",
"0.47874653",
"0.4782748",
"0.47811386",
"0.47808895",
"0.4751188",
"0.47383377",
"0.47277075",
"0.47259918",
"0.47239286",
"0.47229812",
"0.47219262",
"0.47201934",
"0.47178397",
"0.47174343",
"0.47115347",
"0.47099462",
"0.4698641",
"0.469785",
"0.46916318",
"0.469033",
"0.46863595",
"0.4683657",
"0.46818623",
"0.466833",
"0.46582747",
"0.4655102",
"0.4651755",
"0.4646354",
"0.4645558"
] | 0.74104327 | 0 |
Constructs a Peaks object (collection of valleys and peaks). | private Peaks(List<Point> valleys, List<Point> peaks) {
this.valleys = valleys;
this.peaks = peaks;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setPeakList(Vector<Peak> peakList)\n {\n \tthis.peakList = peakList;\n }",
"public int[] getPeaks() {\n return this.midpoints;\n }",
"private static List<PeakLoc> findPeaks(long[] sums) {\r\n\t\treturn findPeaks(sums, 3);\r\n\t}",
"public static PeakList duplicate(PeakList peaklist) {\n\t\tGenericPeakList gpl = null;\n\t\t// if tandem dupe tandem\n\t\tif (peaklist instanceof TandemPeakList){\n\t\t\tgpl = new GenericTandemPeakList();\n\t\t\tTandemPeakList tpl = (TandemPeakList)peaklist;\n\t\t\tGenericTandemPeakList gtpl = (GenericTandemPeakList)gpl;\n\t\t\tgtpl.setParent(tpl.getParent());\n\t\t\tgtpl.setTandemCount(tpl.getTandemCount());\n\t\t}\n\t\t// else use normal\n\t\telse {\n\t\t\tgpl = new GenericPeakList();\n\t\t}\n\t\t// copy the peaks\n\t\tgpl.setPeaks(peaklist.getPeaks());\n\t\treturn gpl;\n\t}",
"public static Peaks extract(double[] points, double[] x, double delta) {\n\t\tList<Point> maxtab = new ArrayList<Point>();\n\t\tList<Point> mintab = new ArrayList<Point>();\n\t\tPeaks res = new Peaks(mintab, maxtab);\n\t\t\n\t\tif (x == null) {\n\t\t\tx = new double[points.length];\n\t\t\tfor (int i = 0; i < x.length; i++) {\n\t\t\t\tx[i] = i+1;\n\t\t\t}\n\t\t}\n\t\t\n\t\tassert points.length == x.length : \"Input arguments points and x must have the same length\";\n\t\tassert delta > 0 : \"Input argument delta must be positive\";\n\t\t\n\t\tdouble mn = Double.POSITIVE_INFINITY;\n\t\tdouble mx = Double.NEGATIVE_INFINITY;\n\t\tdouble mnpos = Double.NaN;\n\t\tdouble mxpos = Double.NaN;\n\t\t\n\t\tboolean lookformax = true;\n\t\t\n\t\tfor (int i = 0; i < points.length; i++) {\n\t\t\tdouble cur = points[i];\n\t\t\tif (cur > mx) {\n\t\t\t\tmx = cur;\n\t\t\t\tmxpos = x[i];\n\t\t\t}\n\t\t\tif (cur < mn) {\n\t\t\t\tmn = cur;\n\t\t\t\tmnpos = x[i];\n\t\t\t}\n\t\t\t\n\t\t\tif (lookformax) {\n\t\t\t\tif (cur < mx-delta) {\n\t\t\t\t\tmaxtab.add(new Point(mxpos, mx));\n\t\t\t\t\tmn = cur;\n\t\t\t\t\tmnpos = x[i];\n\t\t\t\t\tlookformax = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (cur > mn+delta) {\n\t\t\t\t\tmintab.add(new Point(mnpos, mn));\n\t\t\t\t\tmx = cur;\n\t\t\t\t\tmxpos = x[i];\n\t\t\t\t\tlookformax = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\treturn res;\n\t}",
"private static List<PeakLoc> findPeaks(long[] sums,long minWidth) {\r\n\t\tlong maxVal = Arrays.stream(sums).max().getAsLong();\r\n\t\tArrayList<PeakLoc> ret = new ArrayList<PeakLoc>();\r\n\t\tboolean looking = true;\r\n\t\tlong start = 0;\r\n\t\tlong maxPeakValue = 0;\r\n\t\t\r\n\t\tfor (int k=0; k < sums.length;k++) {\r\n\t\t\tif (looking){\r\n\t\t\t\tif ((sums[k]) > (maxVal/2)){\r\n\t\t\t\t\tlooking = false;\r\n\t\t\t\t\tstart = k;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif (maxPeakValue < sums[k])\r\n\t\t\t\t{\r\n\t\t\t\t\tmaxPeakValue = sums[k];\r\n\t\t\t\t}\r\n\t\t\t\tif ((sums[k]) < (maxVal/4)){\r\n\t\t\t\t\tlooking = true;\r\n\t\t\t\t\tlong width = (k-1)-start;\r\n\t\t\t\t\tif (width >= minWidth) {\r\n\t\t\t\t\t ret.add(new PeakLoc(start, k-1, start == 0, maxPeakValue / maxVal));\r\n\t\t\t\t\t maxPeakValue = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tif (looking == false){\r\n\t\t\tret.add(new PeakLoc(start, sums.length - 1, false, maxPeakValue / maxVal));\r\n\t\t}\r\n\t\t\r\n\t\treturn ret;\r\n\t}",
"private int countPeaks(double[] values, double epsilon) {\n\t\t\n\t\tint nPeaks = 0;\n\t\tboolean previouslyIncreased = false;\n\t\tdouble previousValue = values[0]; // we can't have this count as previouslyIncreased\n\t\tfor (double value : values) {\n\t\t\tif (previouslyIncreased && value < previousValue) {\n\t\t\t\tnPeaks++;\n\t\t\t}\n\t\t\tif (value > previousValue) {\n\t\t\t\tpreviouslyIncreased = true;\n\t\t\t} else {\n\t\t\t\tpreviouslyIncreased = false;\n\t\t\t}\n\t\t\tpreviousValue = value;\n\t\t}\n\t\t\n\t\treturn nPeaks;\n\n\t}",
"public double[][] findPeakProminence(int[] peaks) {\n double[] prominence = new double[peaks.length];\n double[] left_base = new double[peaks.length];\n double[] right_base = new double[peaks.length];\n for (int i=0; i<peaks.length; i++) {\n double leftProm = 0;\n double rightProm = 0;\n double threshold = this.signal[peaks[i]];\n\n ArrayList<Double> temp = new ArrayList<Double>();\n // Calculate left prominence\n double[] partSignal = new double[0];\n for (int j=peaks[i]-1; j>=0; j--) {\n temp.add(this.signal[j]);\n if (this.signal[j] > threshold) {\n break;\n }\n partSignal = UtilMethods.reverse(UtilMethods.convertToPrimitiveDouble(temp));\n }\n leftProm = threshold - StatUtils.min(partSignal);\n left_base[i] = peaks[i] - (partSignal.length - UtilMethods.argmin(partSignal, true));\n\n temp.clear();\n // Calculate right prominence\n for (int j=peaks[i]+1; j<this.signal.length; j++) {\n temp.add(this.signal[j]);\n if (this.signal[j] > threshold) {\n break;\n }\n partSignal = UtilMethods.convertToPrimitiveDouble(temp);\n }\n rightProm = threshold - StatUtils.min(partSignal);\n right_base[i] = peaks[i] + UtilMethods.argmin(partSignal, false) + 1;\n prominence[i] = Math.min(leftProm, rightProm);\n }\n\n double[][] promData = new double[3][peaks.length];\n promData[0] = prominence;\n promData[1] = left_base;\n promData[2] = right_base;\n return promData;\n }",
"public findDetectorPeaks(){\n super(\"findDetectorPeaks\");\n }",
"public PeakAlysis(float f[], float x[])\r\n {\r\n }",
"public AdjustPeaksForPixelSensitivity_2(){\n super(\"AdjustPeaksForPixelSensitivity_2\");\n }",
"public double[] findPeakHeights(int[] peaks) {\n double[] newHeight = new double[peaks.length];\n for (int i=0; i<peaks.length; i++) {\n newHeight[i] = this.signal[peaks[i]];\n }\n return newHeight;\n }",
"public List<Peak> filterNoise(List<Peak> peaks, double threshold, double experimentalPrecursorMzRatio);",
"public Peak(double aMass, double aIntensity) {\n iMass = aMass;\n iIntensity = aIntensity;\n }",
"public void peakAnalysis(Results picks){\n\n \tInteger OrgSize = picks.trueCounter(picks.getHitOrg()); //ilosc wszystkich pickow\n \tInteger h60TrueCount = picks.trueCounter(picks.getHit60()); //ilosc trafien filtr-60\n \tInteger h80TrueCount = picks.trueCounter(picks.getHit80()); //ilosc trafien filtr-80\n\n \tFloat lostPercent60;// = 2.0f;\n \tFloat lostPercent80;\n\n \tif (h60TrueCount>0)\t{\n \t\tlostPercent60 = 100-(((float)h60TrueCount*100)/(float)OrgSize); //wersja pokazujaca, ile procent utracono\n \t\t//lostPercent60 = 100*((float)OrgSize/((float)h60TrueCount)); //wersja procentow z zapisem\n \t} else {\n \t\tlostPercent60 = (float) 0.0;\n \t}\n\n \tif (h80TrueCount>0)\t{\n\t\tlostPercent80 = 100-(((float)h80TrueCount*100)/(float)OrgSize); //analogicznie, j.w.\n \t\t//lostPercent80 = 100*((float)OrgSize/((float)h80TrueCount));\n\n \t} else {\n \t\tlostPercent80 = (float) 0.0;\n \t}\n\n \tString endScore = \"\";\n \t//endScore +=\"Zbiorczy wynik koncowy dla wszystkich pick'ow:\\nDane oryginalne: \"+OrgSize+\", filtr 60: \"+h60TrueCount+\", filtr 80: \"+h80TrueCount;\n \t//endScore +=\"\\nProcent utraconych pik'ow: filtr 60: \"+lostPercent60+\", filtr 80: \"+lostPercent80;\n\n \tendScore +=\"Sumaryczna_liczba_peakow:\\n\";\n \tendScore +=\"Peak_prawdziwy:\"+\" filtr60:\"+\" filtr80:\\n\";\n \tendScore += OrgSize+\" \"+h60TrueCount+\" \"+h80TrueCount;\n \tendScore +=\"\\nProcent_utraconych_pik'ow:\\n\";\n \tendScore +=\"filtr60:\"+\" filtr_80:\\n\";\n \tendScore +=lostPercent60+\" \"+lostPercent80;\n \t//System.out.println(endScore); //finished score\n \n try {\n \tFileWriter fileWriter = new FileWriter(\"GrupProj/electron/Result.csv\");\n\t\t\tfileWriter.write(endScore);\n\t\t\tfileWriter.flush();\n\t fileWriter.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error save\");\n\t\t\te.printStackTrace();\n\t\t}\n\n }",
"public int getMatchedPeaks() {\r\n return numMatchedPeaks;\r\n }",
"public int[] getPeakDistance() {\n return this.distance;\n }",
"protected ISpectrum buildHighestPeaks(int numberRequested) {\n List<IPeak> byIntensity = new ArrayList<IPeak>(getPeaks());\n Collections.sort(byIntensity, PeakIntensityComparator.getInstance()); // sort by intensity\n List<IPeak> holder = new ArrayList<IPeak>();\n for (IPeak iPeak : byIntensity) {\n holder.add(iPeak);\n if (holder.size() >= numberRequested)\n break;\n }\n PeptideSpectrumMatch ret = new PeptideSpectrumMatch(this, holder);\n return ret;\n }",
"public static int[][] findPeaks(float[] data, int radius, boolean spanGaps) {\n Extrema minima = new Extrema(data, /* isMax = */false);\n Extrema maxima = new Extrema(data, /* isMax = */true);\n for (int r = 1; r <= radius; r++) {\n minima.dilate();\n maxima.dilate();\n }\n\n int[] maxIdxs = new int[data.length], minIdxs = new int[data.length];\n int numMaxIdxs = 0, numMinIdxs = 0;\n int idxMin = 0, idxMax = 0;\n int prevExtremumType = -1, prevDataIdx = 0;\n while (idxMin < minima.numLiveExtrema || idxMax < maxima.numLiveExtrema) {\n int dataIdxMin = idxMin < minima.numLiveExtrema ? minima.liveExtremumDataIdx[idxMin] : data.length;\n int dataIdxMax = idxMax < maxima.numLiveExtrema ? maxima.liveExtremumDataIdx[idxMax] : data.length;\n int currDataIdx, extremumType;\n if (dataIdxMax < dataIdxMin) {\n // Next extremum is a local maximum\n currDataIdx = dataIdxMax;\n idxMax++;\n extremumType = 1;\n } else {\n // Next extremum is a local minimum\n currDataIdx = dataIdxMin;\n idxMin++;\n extremumType = 0;\n }\n\n if (spanGaps && prevExtremumType != -1 && extremumType == prevExtremumType) {\n // Found two adjacent extrema of same type --\n // find the extremum of opposite type between the two with the maximum dilation radius.\n // Search outwards so ties are broken by picking the more central extremum.\n // TODO: test simply picking the largest/smallest value over the range between the pair of adjacent\n // extrema.\n // TODO: the difference is picking the widest extremum (dominant over the widest range) vs. the tallest.\n Extrema otherTypeExtrema = extremumType == 1 ? minima : maxima;\n int maxRadiusX = otherTypeExtrema.findMostDominantExtremumBetween(prevDataIdx, currDataIdx);\n // Add the opposite-type extremum into the output\n if (extremumType == 1) {\n minIdxs[numMinIdxs++] = maxRadiusX;\n } else {\n maxIdxs[numMaxIdxs++] = maxRadiusX;\n }\n }\n\n if (extremumType == 1) {\n maxIdxs[numMaxIdxs++] = currDataIdx;\n } else {\n minIdxs[numMinIdxs++] = currDataIdx;\n }\n\n prevExtremumType = extremumType;\n prevDataIdx = currDataIdx;\n }\n return new int[][] { Arrays.copyOf(minIdxs, numMinIdxs), Arrays.copyOf(maxIdxs, numMaxIdxs) };\n }",
"public BagOfPatterns() {\r\n\t\tthis.PAA_intervalsPerWindow = -1;\r\n\t\tthis.SAX_alphabetSize = -1;\r\n\t\tthis.windowSize = -1;\r\n\r\n\t\t\r\n\t\tknn = new kNN(); // defaults to 1NN, Euclidean distance\r\n\t\tuseParamSearch = true;\r\n\t}",
"public PeptideSpectrumMatch(ISpectrum spectrum, List<IPeak> inpeaks) {\n super(spectrum, inpeaks);\n\n if (spectrum instanceof IPeptideSpectrumMatch) {\n peptide = ((IPeptideSpectrumMatch) spectrum).getPeptide();\n annotation = ((IPeptideSpectrumMatch) spectrum).getAnnotation();\n } else {\n peptide = null;\n annotation = null;\n }\n makeAdvancedCalculations();\n }",
"private void getPeakValue(float value) {\r\n if (Math.abs(value) > peakValue) {\r\n peakValue = value;\r\n }\r\n }",
"public int[] findPeakDistance(int[] peaks) {\n Arrays.sort(peaks);\n return UtilMethods.diff(peaks);\n }",
"public static ArrayList<Float> extractPeakIdxsList(float[] profile1, double[] start1, double[] finish1)\n\t{\n\n\t\tint profileLength = profile1.length;\n\n//\t\tfor (int k=0; k<nrPoints; k++) {\n//\t\t\tstart11[k] = ((float) k / nrPoints) * profileLength;\n//\t\t}\n\n\t\tTools.runMaxShift(start1, profile1, maxIter, epsilon, h, finish1);\n\n\t\tVector<float[]> cls = Tools.extractClusters1(finish1, minD, M, profileLength);\n\n\t\tif (cls.size()==0) return new ArrayList<Float>();\n\n\t\telse if (cls.size()==1) {\n\t\t\tArrayList<Float> out = new ArrayList<Float>(1);\n\t\t\tout.add(0, cls.get(0)[0]);\n\t\t\treturn out;\n\t\t}\n\n\t\telse if (cls.size()==2) {\n ArrayList<Float> out = new ArrayList<Float>(2);\n out.add(0, cls.get(0)[0]);\n out.add(1, cls.get(1)[0]);\n return out;\n }\n\n\t\telse if (cls.size()==3) {\n ArrayList<Float> out = new ArrayList<Float>(3);\n out.add(0, cls.get(0)[0]);\n out.add(1, cls.get(1)[0]);\n out.add(2, cls.get(2)[0]);\n return out;\n }\n\n\t\telse if (cls.size()==4) {\n ArrayList<Float> out = new ArrayList<Float>(4);\n out.add(0, cls.get(0)[0]);\n out.add(1, cls.get(1)[0]);\n out.add(2, cls.get(2)[0]);\n out.add(3, cls.get(3)[0]);\n return out;\n }\n\n\t\telse {\n return bestNList(cls, 4);\n }\n\n\t}",
"public Object peak(){\n \t if(top==null) System.out.println(\"stack is empty\");\n \t return top.value;\n }",
"public BarPoints(int amplitude) {\n this.amplitude = amplitude;\n }",
"Mixer(int probes)\n\t{\n\t\tsuper();\n\t\t//this.probes\n\t\tprobe = new Probe[probes]; \n\n\t\tint i;\n\t\tfor(i=0;i<probes;i++)\n\t\t\tprobe[i] = new Probe(\"Source\"+i);\n\t}",
"public ChartPointerOptions() {\n\t\tthis(null, null);\n\t}",
"public static ArrayList<Peak> findLocalMaxima(final double[] image,\n int[] taken,\n final double threshold,\n final double radius,\n final double background,\n final double sigma,\n final int imageSizeX,\n final int imageSizeY,\n final int margin)\n {\n ArrayList<Peak> newPeaks = new ArrayList<Peak>();\n\n int r = (int) Math.ceil(radius);\n double radiusSq = radius * radius;\n for (int i=margin; i < (imageSizeY - margin); i++) {\n for (int j=margin; j < (imageSizeX - margin); j++) {\n int idx = i * imageSizeX + j;\n double pixel = image[idx];\n boolean isMax = false;\n if (pixel > threshold) {\n isMax = true;\n int k = -r;\n while ((k <= r) && isMax) {\n int idx2 = idx + k * imageSizeX;\n for (int l=-r; l <= r; l++) {\n if ((k*k + l*l) < radiusSq) {\n if ((k <= 0) && (l <= 0)) {\n if (pixel < image[idx2 + l]) {\n isMax = false;\n }\n } else {\n if (pixel <= image[idx2 + l]) {\n isMax = false;\n }\n }\n }\n }\n k++;\n }\n if (isMax) {\n if (taken[idx] < 2) {\n // TODO: Should we center the inital peaks in the middle of the pixel? +0.5\n Peak newPeak = new Peak(\n pixel - background, // height\n background, // background\n j, // x center\n i, // y center\n sigma, // width x\n sigma); // width y\n newPeaks.add(newPeak);\n taken[idx] += 1;\n }\n }\n }\n }\n }\n return newPeaks;\n }",
"public void run(){\n\n for (int locIdx = begN; locIdx < endN; locIdx++) {\n\n // do mean-shift for profiles at these locations\n\n for (int profileIdx=0; profileIdx<profiles.get(locIdx).size(); profileIdx++) {\n\n // access the detection\n// int profileLength = profiles.get(locIdx).get(profileIdx).length;\n\n // calculate peaks for the ring 'profileIdx'\n ArrayList<Float> currPeaks = extractPeakIdxsList(profiles.get(locIdx).get(profileIdx), startIdx.get(profileIdx), finishIdx.get(locIdx).get(profileIdx));\n\n //if (currPeaks.size()<3) {\n // // it is not a bifurcation according to MS for this ring, don't calculate further, leave empty fields of peakIdx at this location\n // break;\n //}\n //else {\n // add those points\n for (int pp=0; pp<currPeaks.size(); pp++){\n peakIdx.get(locIdx).get(profileIdx).add(pp, currPeaks.get(pp));\n }\n //}\n\n/*\n\t\t\t\tfor (int k=0; k<nrPoints; k++) {\n start[k] = ((float) k / nrPoints) * profileLength;\n }\n\n\t\t\t\tTools.runMS( \tstart,\n \tprofiles.get(locIdx).get(profileIdx),\n \tmaxIter,\n \tepsilon,\n \th,\n\t\t\t\t\t\t\t\tmsFinish);\n*/\n\n /*\n for (int i1=0; i1<nrPoints; i1++) {\n convIdx.get(locIdx).get(profileIdx)[i1] = (float) msFinish[i1];\n }\n*/\n/*\n int inputProfileLength = profiles.get(locIdx).get(profileIdx).length;\n Vector<float[]> cls = Tools.extractClusters1(msFinish, minD, M, inputProfileLength);\n\t\t\t\textractPeakIdx(cls, locIdx, profileIdx); // to extract 3 major ones (if there are three)\n*/\n\n }\n\n }\n\n }",
"public SummaryRanges() {\n S.add(new MyPair(-INF, -INF)); S.add(new MyPair(INF, INF));\n }",
"public WaterMeter(List<Alarm> alarmParam)\r\n\t{\r\n\t\tthis();\r\n\t\tsetAlarms(alarmParam);\r\n\t}",
"public PriorityQueue() {\n\t\theap = new ArrayList<Pair<Integer, Integer>>();\n\t\tlocation = new HashMap<Integer, Integer>();\n\t}",
"public double[][] findPeakSharpness(int[] peaks) {\n double[][] sharpness = new double[2][peaks.length];\n for (int i=0; i<peaks.length; i++) {\n sharpness[0][i] = this.signal[peaks[i]] - this.signal[peaks[i]-1];\n sharpness[1][i] = this.signal[peaks[i]] - this.signal[peaks[i]+1];\n }\n return sharpness;\n }",
"public void setPeakVolume(int peakVolume)\n {\n this.peakVolume = peakVolume;\n }",
"private TIntObjectMap<TIntIntMap> initializeMnrDirectFareOverrides (List<FareOverride> fareOverrides, boolean peak) {\n TIntObjectMap<TIntIntMap> fares = new TIntObjectHashMap<>();\n if (fareOverrides != null) {\n for (FareOverride fo : fareOverrides) {\n // find the stops in the transit layer\n if (fo.viaStopId != null)\n throw new IllegalArgumentException(\"MNR override fare cannot have via stop!\");\n\n if (!transitLayer.indexForStopId.containsKey(fo.fromStopId) ||\n !transitLayer.indexForStopId.containsKey(fo.toStopId)) {\n throw new IllegalArgumentException(\"from or to stop not found!\");\n }\n\n int fromStop = transitLayer.indexForStopId.get(fo.fromStopId);\n int toStop = transitLayer.indexForStopId.get(fo.toStopId);\n int fare = peak ? fo.peakFare : fo.offPeakFare;\n if (!fares.containsKey(fromStop))\n fares.put(fromStop, new TIntIntHashMap());\n fares.get(fromStop).put(toStop, fare);\n }\n }\n return fares;\n }",
"public LowDataSource() {\n super(generateStacks(calculateStackCount(5, 60, 10), 15, 30,\n new double[]{100, 50, 45, 40, 35, 30, 15, 10, 5}, 5));\n }",
"private static List<Point> createConvergingDataset() {\r\n List<Point> data = new ArrayList<Point>();\r\n add(data, 1, 400);\r\n add(data, 5, 700);\r\n add(data, 10, 900);\r\n add(data, 15, 1000);\r\n add(data, 20, 1050);\r\n add(data, 25, 1060);\r\n add(data, 30, 1062);\r\n return data;\r\n }",
"public PeakSpeedFragment() {\n }",
"@Override\n public IPeaksSpectrum getHighestNPeaks(int numberRequested) {\n IPeaksSpectrum ret = highestPeaks.get(numberRequested);\n if (ret == null) {\n ret = buildHighestPeaks(numberRequested);\n int numberPeaks = ret.getPeaksCount();\n // remember the result and if less than requested remember for all\n // requests above or equal to the size\n for (int i = numberRequested; i >= numberPeaks; i--) {\n highestPeaks.put(i, ret); // todo fix\n }\n }\n return ret;\n }",
"public PulseTransitTime() {\n currPTT = 0.0;\n hmPeakTimes = new ArrayList<>();\n //maf = new MovingAverage(WINDOW_SIZE);\n }",
"public PollutedVarsPointsToAnalysis(DirectedGraph<Unit> graph) {\n super(graph);\n emptyMap = new HashMap<>();\n initialMap = new HashMap<>();\n\n }",
"public int[] findPlateauSize(int[] peaks) {\n int[] newPS = new int[peaks.length];\n for (int i=0; i<peaks.length; i++) {\n newPS[i] = this.plateau_size[peaks[i]];\n }\n return newPS;\n }",
"public static float waveDataGetPeakToPeakValue(ArrayList<Float> wave){\r\n return Collections.max(wave)-Collections.min(wave);\r\n }",
"public MaxAndMin(){\n this.list=new ListOfData().getData();\n }",
"public MemoryPool(String id, Configuration config, ThresholdValues thresholdValues) {\n super(id, COMPONENT, config);\n setThresholdValues(thresholdValues);\n monitor = createMeasurableMonitor(id);\n setView(VIEW);\n if(monitor==null) {\n setEnabled(false);\n StringBuilder poolNames = new StringBuilder();\n for(MemoryPoolMXBean mBean : ManagementFactory.getMemoryPoolMXBeans()) {\n if(poolNames.length()>0)\n poolNames.append(\", \");\n poolNames.append(mBean.getName());\n }\n logger.warn(\"Unable to obtain a monitor for {}, available memory pools are [{}]. \" +\n \"Cannot monitor the requested memory pool\", id, poolNames);\n }\n try {\n sampleSize = Config.getIntEntry(config,\n COMPONENT,\n \"sampleSize\",\n 1, /* default */\n 1, /* min */\n 10); /* max */\n setSampleSize(sampleSize);\n } catch (ConfigurationException e) {\n logger.warn(\"Unable to obtain {}.sampleSize from configuration, use default and continue\", COMPONENT);\n }\n\n try {\n long reportRate = Config.getLongEntry(config,\n COMPONENT,\n \"reportRate\",\n DEFAULT_PERIOD, /* default */\n 5000, /* min */\n Integer.MAX_VALUE); /* max */\n setPeriod(reportRate);\n } catch (ConfigurationException e) {\n logger.warn(\"Unable to obtain {}.reportRate from configuration, use default and continue\", COMPONENT);\n }\n }",
"@Override\n public void open(Configuration parameters) {\n this.minAmplitude = Double.parseDouble(parameters.getString(TweetPeaks.MIN_AMPLITUDE, \"0.2\"));\n this.minSlope = Double.parseDouble(parameters.getString(TweetPeaks.MIN_SLOPE, \"0.2\"));\n this.minSamples = Integer.parseInt(parameters.getString(TweetPeaks.MIN_SAMPLES, \"1\"));\n this.smoothing = Double.parseDouble(parameters.getString(TweetPeaks.SMOOTHING, \"0.2\"));\n //LOG.fatal(\"Peaks parameters:\" + \" minAmp \" + this.minAmplitude + \" minSlope \" + this.minSlope + \" minSamples \" + this.minSamples + \" smoothing \" + this.smoothing);\n }",
"public Intervals() {\n }",
"public FourPeaksEvaluationFunction(int t) {\n this.t = t;\n }",
"public Fragmenter(Vector<Peak> peakList, IMolecularFormulaSet sumFormulas, double mzabs, double mzppm, int positiveMode, boolean breakAromaticRings, boolean molecularFormulaRedundancyCheck, boolean neutralLossCheck, boolean isOnlyBreakSelectedBonds)\n {\n \tthis.peakList = peakList;\n \tthis.mzabs = mzabs;\n \tthis.mzppm = mzppm;\n \tthis.breakAromaticRings = breakAromaticRings;\n \tthis.mode = positiveMode;\n \tthis.sumFormulas = sumFormulas;\n \tthis.sumformulaToFragMap = new HashMap<String, List<IAtomContainer>>();\n \tthis.nround = 0;\n \tthis.molecularFormulaRedundancyCheck = molecularFormulaRedundancyCheck;\n \tthis.neutralLossAdd = neutralLossCheck;\n \t\n \t//process the peaks sum formulas\n \tparseFormula();\n \t//set the minimum weight...the \"leightest\" peak\n \tsetMinWeight();\n \tReadInNeutralLosses();\n \t//graphviz output\n \tgv = new GraphViz();\n gv.addln(gv.start_graph());\n }",
"public Fragmenter(Vector<Peak> peakList, double mzabs, double mzppm, int positiveMode, boolean breakAromaticRings, boolean molecularFormulaRedundancyCheck, boolean neutralLossCheck, boolean isOnlyBreakSelectedBonds)\n {\n \tthis.peakList = peakList;\n \tthis.mzabs = mzabs;\n \tthis.mzppm = mzppm;\n \tthis.breakAromaticRings = breakAromaticRings;\n \tthis.mode = positiveMode;\n \tthis.sumformulaToFragMap = new HashMap<String, List<IAtomContainer>>();\n \tthis.nround = 0;\n \tthis.molecularFormulaRedundancyCheck = molecularFormulaRedundancyCheck;\n \tthis.neutralLossAdd = neutralLossCheck;\n \t\n \t//set the minimum weight...the \"leightest\" peak\n \tsetMinWeight();\n \tReadInNeutralLosses();\n \t//graphviz output\n \tgv = new GraphViz();\n gv.addln(gv.start_graph());\n }",
"public Fragmenter(Vector<Peak> peakList, double mzabs, double mzppm, int positiveMode, boolean breakAromaticRings, boolean removePeaks, boolean molecularFormulaRedundancyCheck, boolean neutralLossCheck, boolean isOnlyBreakSelectedBonds)\n {\n \tthis.peakList = peakList;\n \tthis.mzabs = mzabs;\n \tthis.mzppm = mzppm;\n \tthis.breakAromaticRings = breakAromaticRings;\n \tthis.mode = positiveMode;\n \tthis.sumformulaToFragMap = new HashMap<String, List<IAtomContainer>>();\n \tthis.nround = 0;\n \tthis.molecularFormulaRedundancyCheck = molecularFormulaRedundancyCheck;\n \tthis.neutralLossAdd = neutralLossCheck;\n \t\n \t//set the minimum weight...the \"leightest\" peak\n \tsetMinWeight();\n \tthis.removePeak = removePeaks;\n \tReadInNeutralLosses();\n \t//graphviz output\n \tgv = new GraphViz();\n gv.addln(gv.start_graph());\n }",
"public DataSet() {\n labels = new HashMap<>();\n locations = new HashMap<>();\n counter= new AtomicInteger(0);\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}",
"@SuppressWarnings(\"unchecked\")\r\n private void makeIntensityProfiles() {\r\n\r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM();\r\n int xcm = centerOfMass[0];\r\n int ycm = centerOfMass[1];\r\n \r\n // There should be only one VOI\r\n VOIVector vois = abdomenImage.getVOIs();\r\n VOI theVOI = vois.get(0);\r\n\r\n // there should be only one curve corresponding to the external abdomen boundary\r\n VOIContour curve = ((VOIContour)theVOI.getCurves().get(0));\r\n int[] xVals;\r\n int[] yVals;\r\n int[] zVals;\r\n try {\r\n xVals = new int [curve.size()];\r\n yVals = new int [curve.size()];\r\n zVals = new int [curve.size()];\r\n } catch (OutOfMemoryError error) {\r\n System.gc();\r\n MipavUtil.displayError(\"makeIntensityProfiles(): Can NOT allocate the abdomen VOI arrays\");\r\n return;\r\n }\r\n curve.exportArrays(xVals, yVals, zVals);\r\n \r\n // one intensity profile for each radial line. Each radial line is 3 degrees and\r\n // there are 360 degrees in a circle\r\n try {\r\n intensityProfiles = new ArrayList[360 /angularResolution];\r\n xProfileLocs = new ArrayList[360 / angularResolution];\r\n yProfileLocs = new ArrayList[360 / angularResolution];\r\n } catch (OutOfMemoryError error) {\r\n System.gc();\r\n MipavUtil.displayError(\"makeIntensityProfiles(): Can NOT allocate profile arrays\");\r\n return;\r\n }\r\n \r\n // load the srcImage into the slice buffer (it has the segmented abdomen image in it now)\r\n try {\r\n srcImage.exportData(0, sliceSize, sliceBuffer);\r\n } catch (IOException ex) {\r\n System.err.println(\"JCATsegmentAbdomen2D(): Error exporting data\");\r\n return;\r\n }\r\n\r\n double angleRad;\r\n int count;\r\n int contourPointIdx = 0;\r\n for (int angle = 0; angle < 360; angle += angularResolution) {\r\n count = 0;\r\n int x = xcm;\r\n int y = ycm;\r\n int yOffset = y * xDim;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n // allocate the ArrayLists for each radial line\r\n try {\r\n intensityProfiles[contourPointIdx] = new ArrayList<Short>();\r\n xProfileLocs[contourPointIdx] = new ArrayList<Integer>();\r\n yProfileLocs[contourPointIdx] = new ArrayList<Integer>();\r\n } catch (OutOfMemoryError error) {\r\n System.gc();\r\n MipavUtil.displayError(\"makeIntensityProfiles(): Can NOT allocate profile list: \" +contourPointIdx);\r\n return;\r\n }\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n // increment x each step\r\n scaleFactor = Math.tan(angleRad);\r\n while (x < xVals[contourPointIdx]) {\r\n // store the intensity and location of each point along the radial line\r\n intensityProfiles[contourPointIdx].add((short)sliceBuffer[yOffset + x]);\r\n xProfileLocs[contourPointIdx].add(x);\r\n yProfileLocs[contourPointIdx].add(y);\r\n count++;\r\n \r\n // walk out in x and compute the value of y for the given radial line\r\n x++;\r\n y = ycm - (int)((x - xcm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n // decrement y each step\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n while (y > yVals[contourPointIdx]) {\r\n // store the intensity and location of each point along the radial line\r\n intensityProfiles[contourPointIdx].add((short)sliceBuffer[yOffset + x]);\r\n xProfileLocs[contourPointIdx].add(x);\r\n yProfileLocs[contourPointIdx].add(y);\r\n count++;\r\n \r\n // walk to the top of the image and compute values of x for the given radial line\r\n y--;\r\n x = xcm + (int)((ycm - y) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n // decrement x each step\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n while (x > xVals[contourPointIdx]) {\r\n // store the intensity and location of each point along the radial line\r\n intensityProfiles[contourPointIdx].add((short)sliceBuffer[yOffset + x]);\r\n xProfileLocs[contourPointIdx].add(x);\r\n yProfileLocs[contourPointIdx].add(y);\r\n count++;\r\n \r\n x--;\r\n y = ycm - (int)((xcm - x) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n\r\n } else if (angle > 225 && angle <= 315) {\r\n // increment y each step\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n while (y < yVals[contourPointIdx]) {\r\n // store the intensity and location of each point along the radial line\r\n intensityProfiles[contourPointIdx].add((short)sliceBuffer[yOffset + x]);\r\n xProfileLocs[contourPointIdx].add(x);\r\n yProfileLocs[contourPointIdx].add(y);\r\n count++;\r\n \r\n y++;\r\n x = xcm - (int)((y - ycm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n }\r\n \r\n contourPointIdx++;\r\n } // end for (angle = 0; ...\r\n\r\n // intensityProfiles, xProfileLocs, and yProfileLocs are set, we can find the \r\n // internal boundary of the subcutaneous fat now\r\n }",
"public ChartData() {\n this.labels = new ArrayList<>();\n this.labelsDataMap = new HashMap<>();\n this.legend = new ArrayList<>();\n }",
"public AllOOneDataStructure() {\n map = new HashMap<>();\n vals = new HashMap<>();\n maxKey = minKey = \"\";\n max = min = 0;\n }",
"private Map<LIRRStop, Map<LIRRStop, TObjectIntMap<LIRRStop>>> initializeLirrViaFareOverrides (List<FareOverride> fareOverrides, boolean peak, NYCFareDataCache fareData) {\n Map<LIRRStop, Map<LIRRStop, TObjectIntMap<LIRRStop>>> fares = new HashMap<>();\n if (fareOverrides != null) {\n for (FareOverride fo : fareOverrides) {\n if (fo.viaStopId == null) continue;\n\n if (!transitLayer.indexForStopId.containsKey(fo.fromStopId) ||\n !transitLayer.indexForStopId.containsKey(fo.toStopId) ||\n !transitLayer.indexForStopId.containsKey(fo.viaStopId)) {\n throw new IllegalArgumentException(\"from or to stop not found!\");\n }\n\n int fromStop = transitLayer.indexForStopId.get(fo.fromStopId);\n int toStop = transitLayer.indexForStopId.get(fo.toStopId);\n int viaStop = transitLayer.indexForStopId.get(fo.viaStopId);\n int fare = peak ? fo.peakFare : fo.offPeakFare;\n LIRRStop fromLirrStop = fareData.lirrStopForTransitLayerStop.get(fromStop);\n LIRRStop toLirrStop = fareData.lirrStopForTransitLayerStop.get(toStop);\n LIRRStop viaLirrStop = fareData.lirrStopForTransitLayerStop.get(viaStop);\n\n\n fares.computeIfAbsent(fromLirrStop, k -> new HashMap<>())\n .computeIfAbsent(toLirrStop, k -> new TObjectIntHashMap<>())\n .put(viaLirrStop, fare);\n }\n }\n return fares;\n }",
"public ShareHighestPeaksClusterPredicate(int nHighestPeaks) {\n this.highestPeaksPredicate = new ShareHighestPeaksPredicate(nHighestPeaks);\n }",
"private static void fixSpikes(int[] array){\r\n\t\t\r\n\t\tfor(int i=1; i<array.length-1; i++){\r\n\t\t\tlong a=Tools.max(1, array[i-1]);\r\n\t\t\tint b=array[i];\r\n\t\t\tlong c=Tools.max(1, array[i+1]);\r\n\t\t\tif(b>1 && b>a && b>c){\r\n\t\t\t\t//peak\r\n\t\t\t\tif((b>=2*a || b>a+2) && (b>=2*c || b>c+2)){\r\n\t\t\t\t\t//spike\r\n\t\t\t\t\tarray[i]=(int)Tools.max(a, c);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public PegArray(int n) {\r\n\t\tpegs = new Peg[n];\r\n\t\tfor(int i=0; i<n; i++)\r\n\t\t\tpegs[i] = new Peg();\r\n\t\texactMatch = partialMatch = -1;\r\n\t}",
"public ProfileQueue(RadarContent[] arrProfiles) {\n this.arrProfiles = arrProfiles;\n this.length = arrProfiles.length;\n }",
"public TravelMap() {\n\t\tfor (int i = 0; i < 100; i++) {\n\t\t\tadjacencyList.add(new ArrayList<>());\n\t\t}\n\t}",
"Polo(ArrayList<Integer> valoresConfig)\n {\n flagsDesastres = new ArrayList();\n for (int d = 0; d < numCatastrofes; d++) //< Modificar al añadir desastres\n {\n flagsDesastres.add(false);\n }\n dia = 1;\n animales = new ArrayList();\n extintos = new ArrayList();\n for (int i = 0; i < 6; i++) //ID 0 reservado para el krill, no son objetos, pero si objetivos de comida\n {\n animales.add(new ArrayList());\n extintos.add(false);\n }\n SerVivo.IniciaCantidad();\n int randNum = Utilidades.rand(valoresConfig.get(0), valoresConfig.get(1));\n krill = randNum;\n randNum = Utilidades.rand(valoresConfig.get(2), valoresConfig.get(3));\n for (int i = 0; i < randNum; i++) {\n animales.get(1).add(new Pez(0, dia, 0));\n }\n randNum = Utilidades.rand(valoresConfig.get(4), valoresConfig.get(5));\n for (int i = 0; i < randNum; i++) {\n animales.get(2).add(new Foca(0, dia));\n }\n randNum = Utilidades.rand(valoresConfig.get(8), valoresConfig.get(9));\n for (int i = 0; i < randNum; i++) {\n animales.get(3).add(new Oso(0, dia));\n }\n randNum = Utilidades.rand(valoresConfig.get(6), valoresConfig.get(7));\n for (int i = 0; i < randNum; i++) {\n animales.get(4).add(new Morsa(0, dia));\n }\n\n randNum = Utilidades.rand(valoresConfig.get(10), valoresConfig.get(11));\n for (int i = 0; i < randNum; i++) {\n animales.get(5).add(new Esquimal(0, dia));\n }\n temperatura = valoresConfig.get(12);\n\n for (int i = 1; i < 6; i++) {\n animales.set(i, Utilidades.RadixSortIMC(animales.get(i)));\n }\n System.out.println(krill + \",\" + animales.get(1).size() + \",\" + animales.get(2).size() + \",\" + animales.get(3).size() + \",\" + animales.get(4).size() + \",\" + animales.get(5).size());\n }",
"public WaterReport() {\n virusPPM = -1;\n contaminantPPM = -1;\n }",
"public static void main(String[] args) {\n Fakultet faks = new Fakultet();\n\n }",
"private void alloc_marginal () {\n\t\n\t\tpeak_probability = -Double.MAX_VALUE;\n\n\t\tpeak_indexes = new int[n_vars];\n\t\tfor (int n = 0; n < n_vars; ++n) {\n\t\t\tpeak_indexes[n] = -1;\n\t\t}\n\n\t\ttotal_probability = 0.0;\n\n\t\tmarginal_probability = new double[n_vars][];\n\t\tfor (int n = 0; n < n_vars; ++n) {\n\t\t\tmarginal_probability[n] = new double[n_values[n]];\n\t\t\tfor (int i = 0; i < n_values[n]; ++i) {\n\t\t\t\tmarginal_probability[n][i] = 0.0;\n\t\t\t}\n\t\t}\n\n\t\tmarginal_mode_index = new int[n_vars];\n\t\tfor (int n = 0; n < n_vars; ++n) {\n\t\t\tmarginal_mode_index[n] = -1;\n\t\t}\n\n\t\tmarginal_peak_probability = new double[n_vars][];\n\t\tfor (int n = 0; n < n_vars; ++n) {\n\t\t\tmarginal_peak_probability[n] = new double[n_values[n]];\n\t\t\tfor (int i = 0; i < n_values[n]; ++i) {\n\t\t\t\tmarginal_peak_probability[n][i] = -Double.MAX_VALUE;\n\t\t\t}\n\t\t}\n\n\t\tmarginal_peak_indexes = new int[n_vars][][];\n\t\tfor (int n = 0; n < n_vars; ++n) {\n\t\t\tmarginal_peak_indexes[n] = new int[n_values[n]][];\n\t\t\tfor (int i = 0; i < n_values[n]; ++i) {\n\t\t\t\tmarginal_peak_indexes[n][i] = new int[n_vars];\n\t\t\t\tfor (int n2 = 0; n2 < n_vars; ++n2) {\n\t\t\t\t\tmarginal_peak_indexes[n][i][n2] = -1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tmarginal_2d_probability = new double[n_vars][][][];\n\t\tfor (int n1 = 0; n1 < n_vars; ++n1) {\n\t\t\tmarginal_2d_probability[n1] = new double[n_vars][][];\n\t\t\tfor (int n2 = 0; n2 < n_vars; ++n2) {\n\t\t\t\tif (n1 < n2) {\n\t\t\t\t\tmarginal_2d_probability[n1][n2] = new double[n_values[n1]][];\n\t\t\t\t\tfor (int i1 = 0; i1 < n_values[n1]; ++i1) {\n\t\t\t\t\t\tmarginal_2d_probability[n1][n2][i1] = new double[n_values[n2]];\n\t\t\t\t\t\tfor (int i2 = 0; i2 < n_values[n2]; ++i2) {\n\t\t\t\t\t\t\tmarginal_2d_probability[n1][n2][i1][i2] = 0.0;\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\tmarginal_2d_probability[n1][n2] = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tmarginal_2d_mode_index = new int[n_vars][][];\n\t\tfor (int n1 = 0; n1 < n_vars; ++n1) {\n\t\t\tmarginal_2d_mode_index[n1] = new int[n_vars][];\n\t\t\tfor (int n2 = 0; n2 < n_vars; ++n2) {\n\t\t\t\tif (n1 < n2) {\n\t\t\t\t\tmarginal_2d_mode_index[n1][n2] = new int[2];\n\t\t\t\t\tfor (int i = 0; i < 2; ++i) {\n\t\t\t\t\t\tmarginal_2d_mode_index[n1][n2][i] = -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmarginal_2d_mode_index[n1][n2] = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn;\n\t}",
"public Spectrum(int nfrags) {\n\t\tpeakMZ = new float[nfrags];\n\t\tpeakInt = new float[nfrags];\n\t\tnorm = -1;\n\t\tif(fact == null) {\n\t\t\tfact = new float[128];\n\t\t\tfact[0] = 0;\n\t\t\tfor(int i = 1; i < 128; i++)\n\t\t\t\tfact[i] = (float)(fact[i-1] + Math.log(i));\n\t\t}\n\t\tbasePeakInt = findBasePeakInt();\n\t}",
"private void instantiateProbes() {\n\t\tString probe_str = this.config.getProperty(\"probes.include\", \"all\");\n\t\tString probe_exclude_str = this.config.getProperty(\"probes.exclude\", \"\");\n\t\tString probe_external = this.config.getProperty(\"probes.external\", \"\");\n\t\t\t\t\n\t\ttry {\n\t\t\tArrayList<String> availableProbeList = this.listAvailableProbeClasses();\n\t\t\t//user wants to instantiate all available probes with default params\n\t\t\t//TODO - allow user to parameterize probes when selecting to add all probes\n\t\t\tif (probe_str.equals(\"all\")) {\n\t\t\t\tfor(String s : availableProbeList) \n\t\t\t\t\tthis.probes.put(s, null);\n\t\t\t\t\n\t\t\t\t//user wants to instantiate all available probes except the ones specified for exclusion\n\t\t\t\tif (!probe_exclude_str.equals(\"\")) {\n\t\t\t\t\tString[] probe_list = probe_exclude_str.split(\";\");\n\t\t\t\t\tfor(String s:probe_list)\n\t\t\t\t\t\tthis.probes.remove(s.split(\",\")[0]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//instantiate\n\t\t\t\tfor(Entry<String,IProbe> p:this.probes.entrySet()){\n\t\t\t\t\ttry{\n\t\t\t\t\t\tIProbe tempProbe = JCProbeFactory.newInstance(PROBE_LIB_PATH, p.getKey());\n\t\t\t\t\t\ttempProbe.attachQueue(this.queue);\n\t\t\t\t\t\ttempProbe.attachLogger(this.logger);\n\t\t\t\t\t\tp.setValue(tempProbe);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (CatascopiaException e) {\n\t\t\t\t\t\tthis.writeToLog(Level.SEVERE, e);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t//user wants to instantiate specific probes (and may set custom params)\n\t\t\telse{\n\t\t\t\tString[] probe_list = probe_str.split(\";\");\n\t\t\t\tfor(String s:probe_list) {\n\t\t\t\t\ttry{\n\t\t\t\t\t\tString[] params = s.split(\",\");\n\t\t\t\t\t\tIProbe tempProbe = JCProbeFactory.newInstance(PROBE_LIB_PATH,params[0]);\n\t\t\t\t\t\ttempProbe.attachQueue(this.queue);\n\t\t\t\t\t\ttempProbe.attachLogger(this.logger);\n\t\t\t\t\t\tif(params.length > 1) //user wants to define custom collecting period\n\t\t\t\t\t\t\ttempProbe.setCollectPeriod(Integer.parseInt(params[1]));\n\t\t\t\t\t\tthis.probes.put(params[0], tempProbe);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (CatascopiaException e) {\n\t\t\t\t\t\tthis.writeToLog(Level.SEVERE, e);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t//activate Agent probes\n\t\t\tthis.activateAllProbes();\n\t\t\t\n\t\t\t//deploy external probes located in a custom user-defined path\n\t\t\tif (!probe_external.equals(\"\")) {\n\t\t\t\tString[] probe_list = probe_external.split(\";\");\n\t\t\t\tfor(String s:probe_list){\n\t\t\t\t\ttry{\n\t\t\t\t\t\tString[] params = s.split(\",\");\n\t\t\t\t\t\tString pclass = params[0];\n\t\t\t\t\t\tString ppath = params[1];\n\t\t\t\t\t\tthis.deployProbeAtRuntime(ppath, pclass);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (ArrayIndexOutOfBoundsException e){\n\t\t\t\t\t\tthis.writeToLog(Level.SEVERE, \"External Probe deployment error. Either the probe class name of classpath are not correctly provided\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\t\t\n\t\t\t\n\t\t\t//log probe list added to Agent\n\t\t\tString l = \" \";\n\t\t\tfor(Entry<String,IProbe> entry:this.probes.entrySet())\n\t\t\t\tl += entry.getKey() + \",\";\n\t\t\tthis.writeToLog(Level.INFO,\"Probes Activated: \"+l.substring(0, l.length()-1));\n\t\t}\n\t\tcatch (CatascopiaException e){\n\t\t\tthis.writeToLog(Level.SEVERE, e);\n\t\t}\n\t}",
"Point(int dimensionPass, int clusters){\n\tthis.dimension = dimensionPass;\n\tthis.data = new double[dimension];\n\tthis.clusterDist = new double[clusters];\n\t\n}",
"public static IsotopePattern getPeakInfo(String fileName) {\n\t\t\n\t\ttry {\n\n\t\t\tIsotopePattern result = new IsotopePattern();\n\t\t\t\n\t\t\tFileInputStream fstream = new FileInputStream(fileName);\n\t\t\tDataInputStream din = new DataInputStream(fstream);\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(din));\n\t\t\twhile (in.ready()) {\n\t\t\t\tString str = in.readLine();\n\t\t\t\tif (!str.trim().equals(\"\")) {\n\t\t\t\t\tString[] split = str.split(\"\\t\");\n\t\t\t\t\tdouble mass = new Double(split[0]);\n\t\t\t\t\tdouble intensity = new Double(split[1]);\n\t\t\t\t\tresult.addIsotope(new IsotopeContainer(mass, intensity));\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//System.out.println`(mass + \"\\t\" + intensity);\n\t\t\t\t}\n\t\t\t}\n\t\t\tin.close();\n\t\t\t\n\t\t\treturn result;\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"public void setPeakVolumeSize(PeakVolumeSize peakVolumeSize)\n {\n this.peakVolumeSize = peakVolumeSize;\n }",
"public PrometheusTempModify(PrometheusTempModify source) {\n if (source.Name != null) {\n this.Name = new String(source.Name);\n }\n if (source.Describe != null) {\n this.Describe = new String(source.Describe);\n }\n if (source.ServiceMonitors != null) {\n this.ServiceMonitors = new PrometheusConfigItem[source.ServiceMonitors.length];\n for (int i = 0; i < source.ServiceMonitors.length; i++) {\n this.ServiceMonitors[i] = new PrometheusConfigItem(source.ServiceMonitors[i]);\n }\n }\n if (source.PodMonitors != null) {\n this.PodMonitors = new PrometheusConfigItem[source.PodMonitors.length];\n for (int i = 0; i < source.PodMonitors.length; i++) {\n this.PodMonitors[i] = new PrometheusConfigItem(source.PodMonitors[i]);\n }\n }\n if (source.RawJobs != null) {\n this.RawJobs = new PrometheusConfigItem[source.RawJobs.length];\n for (int i = 0; i < source.RawJobs.length; i++) {\n this.RawJobs[i] = new PrometheusConfigItem(source.RawJobs[i]);\n }\n }\n if (source.RecordRules != null) {\n this.RecordRules = new PrometheusConfigItem[source.RecordRules.length];\n for (int i = 0; i < source.RecordRules.length; i++) {\n this.RecordRules[i] = new PrometheusConfigItem(source.RecordRules[i]);\n }\n }\n if (source.AlertDetailRules != null) {\n this.AlertDetailRules = new PrometheusAlertPolicyItem[source.AlertDetailRules.length];\n for (int i = 0; i < source.AlertDetailRules.length; i++) {\n this.AlertDetailRules[i] = new PrometheusAlertPolicyItem(source.AlertDetailRules[i]);\n }\n }\n }",
"private XYDataset createDataset() {\n\t\tfinal XYSeriesCollection dataset = new XYSeriesCollection( ); \n\t\tdataset.addSeries(trainErrors); \n\t\tdataset.addSeries(testErrors);\n\t\treturn dataset;\n\t}",
"public int getNumSpectrumPeaks() {\r\n return numSpectrumPeaks;\r\n }",
"private Map<LIRRStop, TObjectIntMap<LIRRStop>> initializeLirrDirectFareOverrides (List<FareOverride> fareOverrides, boolean peak, NYCFareDataCache fareData) {\n Map<LIRRStop, TObjectIntMap<LIRRStop>> fares = new HashMap<>();\n if (fareOverrides != null) {\n for (FareOverride fo : fareOverrides) {\n if (fo.viaStopId != null) continue;\n\n if (!transitLayer.indexForStopId.containsKey(fo.fromStopId) ||\n !transitLayer.indexForStopId.containsKey(fo.toStopId)) {\n throw new IllegalArgumentException(\"from or to stop not found!\");\n }\n\n int fromStop = transitLayer.indexForStopId.get(fo.fromStopId);\n int toStop = transitLayer.indexForStopId.get(fo.toStopId);\n int fare = peak ? fo.peakFare : fo.offPeakFare;\n LIRRStop fromLirrStop = fareData.lirrStopForTransitLayerStop.get(fromStop);\n LIRRStop toLirrStop = fareData.lirrStopForTransitLayerStop.get(toStop);\n\n fares.computeIfAbsent(fromLirrStop, k -> new TObjectIntHashMap<>()).put(toLirrStop, fare);\n }\n }\n return fares;\n }",
"public double[][] getPeakSharpness() {\n return this.sharpness;\n }",
"public FireflyOptimization(){\n this(25, 1000);\n }",
"private PerformanceEntry() {\n this.configuration = new HashSet<>();\n this.regionsToPerf = new HashMap<>();\n this.regionsToMin = new HashMap<>();\n this.regionsToMax = new HashMap<>();\n this.regionsToDiff = new HashMap<>();\n this.regionsToSampleVariance = new HashMap<>();\n this.regionsToConfidenceInterval = new HashMap<>();\n this.regionsToCoefficientsOfVariation = new HashMap<>();\n this.regionsToPerfHumanReadable = new HashMap<>();\n this.regionsToMinHumanReadable = new HashMap<>();\n this.regionsToMaxHumanReadable = new HashMap<>();\n this.regionsToDiffHumanReadable = new HashMap<>();\n this.regionsToSampleVarianceHumanReadable = new HashMap<>();\n this.regionsToConfidenceIntervalsHumanReadable = new HashMap<>();\n this.regionsToCoefficientsOfVariationHumanReadable = new HashMap<>();\n }",
"private static int peakOneD(int i, int[] nums) {\n if (i > 0 && nums[i] < nums[i - 1])\n return -1;\n if (i < nums.length - 1 && nums[i] < nums[i + 1])\n return 1;\n return 0;\n }",
"@Override\n public void construct() {\n Metric metric =\n new CPU_Utilization(1) {\n @Override\n public MetricFlowUnit gather(Queryable queryable) {\n return MetricFlowUnit.generic();\n }\n };\n Symptom earthSymptom =\n new Symptom(1) {\n @Override\n public SymptomFlowUnit operate() {\n return SymptomFlowUnit.generic();\n }\n\n @Override\n public String name() {\n return EARTH_KEY;\n }\n };\n Symptom moonSymptom =\n new Symptom(1) {\n @Override\n public SymptomFlowUnit operate() {\n return SymptomFlowUnit.generic();\n }\n\n public String name() {\n return MOON_KEY;\n }\n };\n\n Metric skyLabCpu =\n new CPU_Utilization(1) {\n @Override\n public MetricFlowUnit gather(Queryable queryable) {\n return MetricFlowUnit.generic();\n }\n };\n Symptom skyLabsSymptom =\n new Symptom(1) {\n @Override\n public SymptomFlowUnit operate() {\n return SymptomFlowUnit.generic();\n }\n\n public String name() {\n return SKY_LABS_KEY;\n }\n };\n\n addLeaf(metric);\n addLeaf(skyLabCpu);\n earthSymptom.addAllUpstreams(Collections.singletonList(metric));\n moonSymptom.addAllUpstreams(Collections.singletonList(earthSymptom));\n skyLabsSymptom.addAllUpstreams(\n new ArrayList<Node<?>>() {\n {\n add(earthSymptom);\n add(moonSymptom);\n add(skyLabCpu);\n }\n });\n\n metric.addTag(LOCUS_KEY, EARTH_KEY);\n earthSymptom.addTag(LOCUS_KEY, EARTH_KEY);\n moonSymptom.addTag(LOCUS_KEY, MOON_KEY);\n skyLabCpu.addTag(LOCUS_KEY, SKY_LABS_KEY);\n skyLabsSymptom.addTag(LOCUS_KEY, SKY_LABS_KEY);\n }",
"public SelectivityCalculator()\n\t{\n\t\tvalue = new ArrayList<Integer>();\n\t}",
"public AnchorPoints(Name alias) {\n this(alias, ANCHOR_POINTS);\n }",
"private void ini_MapPaks()\r\n\t{\r\n\r\n\t}",
"public OperandStack() {\r\n\t\t\r\n\t\tthis.num = new ArrayList<>(); \r\n\t\tthis.observers = new ArrayList<>(); \r\n\t}",
"@Override\n\tprotected void createInitial()\n\t{\n\t\tLoop<Bar> loop = new Loop();\n\t\tedges.add( loop );\n\n\t\tfor ( Pair<Point2d, Point2d> pair : new ConsecutivePairs<Point2d>( Arrays.asList(\n\t\t\t\tnew Point2d( 250, 100 ),\n\t\t\t\tnew Point2d( 350, 100 ),\n\t\t\t\tnew Point2d( 350, 250 ),\n\t\t\t\tnew Point2d( 500, 250 ),\n\t\t\t\tnew Point2d( 500, 350 ),\n\t\t\t\tnew Point2d( 350, 350 ),\n\t\t\t\tnew Point2d( 350, 500 ),\n\t\t\t\tnew Point2d( 250, 500 ),\n\t\t\t\tnew Point2d( 250, 350 ),\n\t\t\t\tnew Point2d( 100, 350 ),\n\t\t\t\tnew Point2d( 100, 250 ),\n\t\t\t\tnew Point2d( 250, 250 ) ), true ) )\n\t\t{\n\t\t\tBar b = new Bar( pair.first(), pair.second() );\n\t\t\tloop.append( b );\n\t\t\tsetup(b, 0.7);\n\t\t}\n\n\t\tLoop<Bar> loop2 = new Loop();\n\t\tedges.add( loop2 );\n\n\t\tfor ( Pair<Point2d, Point2d> pair : new ConsecutivePairs<Point2d>( Arrays.asList(\n\t\t\t\tnew Point2d( 330, 330),\n\t\t\t\tnew Point2d( 330, 270 ),\n\t\t\t\tnew Point2d( 270, 270 ),\n\t\t\t\tnew Point2d( 270, 330 )\n\t\t), true ) )\n\t\t{\n\t\t\tBar b = new Bar( pair.first(), pair.second() );\n\t\t\tloop2.append( b );\n\t\t\tsetup(b, 0.7);\n\t\t}\n\t}",
"public DataStructure() {\n\t\tthis.minx = null;\n\t\tthis.maxx = null;\n\t\tthis.miny = null;\n\t\tthis.maxy = null;\n\t\tthis.current = null;\n\t\tsize = 0;\n\t}",
"protected void setValues() {\n values = new double[size];\n int pi = 0; // pixelIndex\n int siz = size - nanW - negW - posW;\n int biw = min < max ? negW : posW;\n int tiw = min < max ? posW : negW;\n double bv = min < max ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;\n double tv = min < max ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY;\n double f = siz > 1 ? (max - min) / (siz - 1.) : 0.;\n for (int i = 0; i < biw && pi < size; i++,pi++) {\n values[pi] = bv;\n }\n for (int i = 0; i < siz && pi < size; i++,pi++) {\n double v = min + i * f;\n values[pi] = v;\n }\n for (int i = 0; i < tiw && pi < size; i++,pi++) {\n values[pi] = tv;\n }\n for (int i = 0; i < nanW && pi < size; i++,pi++) {\n values[pi] = Double.NaN;\n }\n }",
"public SummaryRanges() {\n this.intervals = new ArrayList<>();\n }",
"public MinValueStack(){\r\n stack1 = new Stack<T>();\r\n stack2 = new Stack<T>();\r\n size = 0;\r\n }",
"public MedianFinderElegant() {\n minHeap = new PriorityQueue<>();\n maxHeap = new PriorityQueue<>((v1, v2) -> v2 - v1);\n }",
"public MaxStack() {\n stack = new Stack();\n maxes = new MaxList();\n }",
"private Parameters createCheckpoint() {\n Parameters checkpoint = Parameters.create();\n checkpoint.set(\"lastDoc/identifier\", this.lastAddedDocumentIdentifier);\n checkpoint.set(\"lastDoc/number\", this.lastAddedDocumentNumber);\n checkpoint.set(\"indexBlockCount\", this.indexBlockCount);\n Parameters shards = Parameters.create();\n for (Bin b : this.geometricParts.radixBins.values()) {\n for (String indexPath : b.getBinPaths()) {\n shards.set(indexPath, b.size);\n }\n }\n checkpoint.set(\"shards\", shards);\n return checkpoint;\n }",
"public Thresholding(ThresholdsState ts) { // Sets the constants for thresholding for each pitch \n\t\tredBallThresh[0][0] = 130;\n\t\tredBallThresh[0][1] = 90;\n\t\tredBallThresh[0][2] = 90;\n\t\tredBallThresh[1][0] = 170;\n\t\tredBallThresh[1][1] = 170;\n\t\tredBallThresh[1][2] = 170;\n\t\tyellowRobotThresh[0][0] = 140;\n\t\tyellowRobotThresh[0][1] = 140;\n\t\tyellowRobotThresh[0][2] = 170;\n\t\tyellowRobotThresh[1][0] = 150;\n\t\tyellowRobotThresh[1][1] = 190;\n\t\tyellowRobotThresh[1][2] = 140;\n\t\tblueRobotThresh[0][0] = 120;\n\t\tblueRobotThresh[0][1] = 170;\n\t\tblueRobotThresh[0][2] = 90;\n\t\tblueRobotThresh[1][0] = 160;\n\t\tblueRobotThresh[1][1] = 230;\n\t\tblueRobotThresh[1][2] = 215;\n\n\n\t\tgreenPlatesThresh[0][0] = 120;\n\t\tgreenPlatesThresh[1][0] = 205;\n\n\n\t\tthis.ts = ts;\n\n\t}",
"public HighDatasource() {\n super(generateStacks(calculateStackCount(5, 2 * 60, 2000), 15, 40,\n new double[]{30, 27, 25, 20, 17, 15, 10, 7, 5, 2, 1}, 1));\n }",
"int findMax(List<double[]> x){\n List<double[]> maxInfo = new ArrayList<>();\n boolean increasing = false;\n double maxNum = x.get(0)[0];\n double maxFrame = 1;\n double slope = 0;\n for(int i = 0; i<x.size()-1;i++){\n System.out.println(x.get(i)[0]);\n if(x.get(i+1)[0] < x.get(i)[0]){\n increasing = true;\n slope = x.get(i+1)[0] - x.get(i)[0];\n maxNum = x.get(i+1)[0];\n maxFrame = x.get(i+1)[1];\n }\n else if(x.get(i+1)[0] > x.get(i)[0] && increasing && maxNum<150){\n System.out.println(\"PEAK: \" + maxNum + \",\" + maxFrame);\n increasing = false;\n maxInfo.add(new double[]{maxNum, maxFrame});\n maxNum = 0;\n maxFrame = 0;\n }\n }\n //removes false peaks with close frame tag near each other\n for(int i = 0; i < maxInfo.size()-1;i++){\n if(maxInfo.get(i+1)[1] - maxInfo.get(i)[1] <=10){\n System.out.println(\"REMOVED \" + maxInfo.get(i+1)[0]);\n maxInfo.remove(i+1);\n }\n }\n return maxInfo.size();\n }",
"public LeastNumPossValues()\r\n\t{\r\n\t\tthis.size = UNINITIALIZEDLENGTH;\r\n\t\t\r\n\t\tthis.poss_values = new ArrayList<Integer>();\r\n\t\t\r\n\t\tthis.position = new int[2];\r\n\t\t\r\n\t\tthis.position[0] = UNINITIALIZEDINT;\r\n\t\tthis.position[1] = UNINITIALIZEDINT;\r\n\t\t\r\n\t}",
"public static Map<Integer, Double> InitializeMark() {\n\t\tMap<Integer, Double> mark = new HashMap<Integer, Double>();\r\n\t\tfinal Double giantConstant = 1.0E+45;\r\n\t\tfor (Entry<Integer, Vertex> currentVertex : vertexes.entrySet())\r\n\t\t\tmark.put(currentVertex.getKey(), giantConstant);\r\n\t\treturn mark;\r\n\t}",
"@Override\r\n\tpublic PatternSet minePattern(Instances data, double minSupp) {\n\t\tPatternSet ps = new PatternSet();\r\n\t\tint numAttribute = data.numAttributes();\r\n\t\tcalExtreme(data);\r\n\t\tfor(int i = 0; i < numAttribute; i++){\r\n\t\t\tif (i==data.classIndex()){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tString attrName = data.attribute(i).name();\r\n\t\t\tif (data.attribute(i).isNumeric()){\r\n//\t\t\t\tdouble lower = data.attribute(i).getLowerNumericBound();\r\n//\t\t\t\tdouble upper = data.attribute(i).getUpperNumericBound();\r\n\t\t\t\tdouble lower = mins.get(i);\r\n\t\t\t\tdouble upper = maxs.get(i);\r\n\t\t\t\tdouble width = (upper-lower)/NUMERIC_BIN_WIDTH;\r\n\t\t\t\tdouble left = Double.MIN_VALUE;\r\n\t\t\t\tdouble right = lower + width;\r\n\t\t\t\tfor (int bin = 0; bin < NUMERIC_BIN_WIDTH; bin++){\r\n\t\t\t\t\tif(bin == NUMERIC_BIN_WIDTH-1){\r\n\t\t\t\t\t\tright = Double.MAX_VALUE;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tIPattern pattern = new Pattern(new NumericCondition(attrName,i, left, right));\r\n\t\t\t\t\tif (pattern.support(data)>= minSupp){\r\n\t\t\t\t\t\tps.add(pattern);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tleft = right;\r\n\t\t\t\t\tright = right + width;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tEnumeration<Object> values = data.attribute(i).enumerateValues();\r\n\t\t\t\twhile(values.hasMoreElements()){\r\n\t\t\t\t\tString value = values.nextElement().toString();\r\n\t\t\t\t\tIPattern pattern = new Pattern(new NominalCondition(attrName,i, value));\r\n\t\t\t\t\tif (pattern.support(data)>= minSupp){\r\n\t\t\t\t\t\tps.add(pattern);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn ps;\r\n\t}",
"public Intervals(Interval<T>... intervals) {\n add(intervals);\n }"
] | [
"0.59626395",
"0.56798893",
"0.5474335",
"0.541962",
"0.53448576",
"0.5325212",
"0.52925557",
"0.5229987",
"0.5176929",
"0.5158611",
"0.5149587",
"0.5095873",
"0.5082066",
"0.49688682",
"0.49477178",
"0.49035233",
"0.48975903",
"0.4841",
"0.4820766",
"0.48059425",
"0.47887057",
"0.47299325",
"0.46987683",
"0.46786708",
"0.46264938",
"0.46201017",
"0.45681918",
"0.45677152",
"0.4562348",
"0.45565578",
"0.45448697",
"0.45394456",
"0.45082062",
"0.4504716",
"0.4479345",
"0.44780135",
"0.44434637",
"0.44381666",
"0.44345778",
"0.44064984",
"0.43798083",
"0.43689492",
"0.43555996",
"0.43506873",
"0.43464282",
"0.43241665",
"0.43225095",
"0.43184343",
"0.4308835",
"0.43041533",
"0.4300187",
"0.42915055",
"0.42752445",
"0.42637652",
"0.42609057",
"0.42565763",
"0.42559972",
"0.4253962",
"0.42403015",
"0.42402482",
"0.42327243",
"0.42243892",
"0.42231053",
"0.42109862",
"0.42093652",
"0.42029026",
"0.4200538",
"0.41989672",
"0.41903815",
"0.4182637",
"0.41818005",
"0.41792357",
"0.4174061",
"0.4168349",
"0.41618684",
"0.41586936",
"0.41585323",
"0.41583595",
"0.4156174",
"0.415174",
"0.41502532",
"0.41464847",
"0.4130116",
"0.41299817",
"0.41206247",
"0.41189232",
"0.4118559",
"0.4117245",
"0.41126892",
"0.41103703",
"0.4107701",
"0.41070834",
"0.41005343",
"0.40942866",
"0.4089296",
"0.40871927",
"0.40798357",
"0.40739593",
"0.40731913",
"0.40714392"
] | 0.832246 | 0 |
Extract peaks from an array of points. Adapted from <a href=" | public static Peaks extract(double[] points, double[] x, double delta) {
List<Point> maxtab = new ArrayList<Point>();
List<Point> mintab = new ArrayList<Point>();
Peaks res = new Peaks(mintab, maxtab);
if (x == null) {
x = new double[points.length];
for (int i = 0; i < x.length; i++) {
x[i] = i+1;
}
}
assert points.length == x.length : "Input arguments points and x must have the same length";
assert delta > 0 : "Input argument delta must be positive";
double mn = Double.POSITIVE_INFINITY;
double mx = Double.NEGATIVE_INFINITY;
double mnpos = Double.NaN;
double mxpos = Double.NaN;
boolean lookformax = true;
for (int i = 0; i < points.length; i++) {
double cur = points[i];
if (cur > mx) {
mx = cur;
mxpos = x[i];
}
if (cur < mn) {
mn = cur;
mnpos = x[i];
}
if (lookformax) {
if (cur < mx-delta) {
maxtab.add(new Point(mxpos, mx));
mn = cur;
mnpos = x[i];
lookformax = false;
}
}
else {
if (cur > mn+delta) {
mintab.add(new Point(mnpos, mn));
mx = cur;
mxpos = x[i];
lookformax = true;
}
}
}
return res;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int[] getPeaks() {\n return this.midpoints;\n }",
"public int[] findPeakDistance(int[] peaks) {\n Arrays.sort(peaks);\n return UtilMethods.diff(peaks);\n }",
"private static List<PeakLoc> findPeaks(long[] sums) {\r\n\t\treturn findPeaks(sums, 3);\r\n\t}",
"public double[] findPeakHeights(int[] peaks) {\n double[] newHeight = new double[peaks.length];\n for (int i=0; i<peaks.length; i++) {\n newHeight[i] = this.signal[peaks[i]];\n }\n return newHeight;\n }",
"private Peaks(List<Point> valleys, List<Point> peaks) {\n\t\tthis.valleys = valleys;\n\t\tthis.peaks = peaks;\n\t}",
"private static List<PeakLoc> findPeaks(long[] sums,long minWidth) {\r\n\t\tlong maxVal = Arrays.stream(sums).max().getAsLong();\r\n\t\tArrayList<PeakLoc> ret = new ArrayList<PeakLoc>();\r\n\t\tboolean looking = true;\r\n\t\tlong start = 0;\r\n\t\tlong maxPeakValue = 0;\r\n\t\t\r\n\t\tfor (int k=0; k < sums.length;k++) {\r\n\t\t\tif (looking){\r\n\t\t\t\tif ((sums[k]) > (maxVal/2)){\r\n\t\t\t\t\tlooking = false;\r\n\t\t\t\t\tstart = k;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif (maxPeakValue < sums[k])\r\n\t\t\t\t{\r\n\t\t\t\t\tmaxPeakValue = sums[k];\r\n\t\t\t\t}\r\n\t\t\t\tif ((sums[k]) < (maxVal/4)){\r\n\t\t\t\t\tlooking = true;\r\n\t\t\t\t\tlong width = (k-1)-start;\r\n\t\t\t\t\tif (width >= minWidth) {\r\n\t\t\t\t\t ret.add(new PeakLoc(start, k-1, start == 0, maxPeakValue / maxVal));\r\n\t\t\t\t\t maxPeakValue = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tif (looking == false){\r\n\t\t\tret.add(new PeakLoc(start, sums.length - 1, false, maxPeakValue / maxVal));\r\n\t\t}\r\n\t\t\r\n\t\treturn ret;\r\n\t}",
"public List<Peak> filterNoise(List<Peak> peaks, double threshold, double experimentalPrecursorMzRatio);",
"public double[][] findPeakProminence(int[] peaks) {\n double[] prominence = new double[peaks.length];\n double[] left_base = new double[peaks.length];\n double[] right_base = new double[peaks.length];\n for (int i=0; i<peaks.length; i++) {\n double leftProm = 0;\n double rightProm = 0;\n double threshold = this.signal[peaks[i]];\n\n ArrayList<Double> temp = new ArrayList<Double>();\n // Calculate left prominence\n double[] partSignal = new double[0];\n for (int j=peaks[i]-1; j>=0; j--) {\n temp.add(this.signal[j]);\n if (this.signal[j] > threshold) {\n break;\n }\n partSignal = UtilMethods.reverse(UtilMethods.convertToPrimitiveDouble(temp));\n }\n leftProm = threshold - StatUtils.min(partSignal);\n left_base[i] = peaks[i] - (partSignal.length - UtilMethods.argmin(partSignal, true));\n\n temp.clear();\n // Calculate right prominence\n for (int j=peaks[i]+1; j<this.signal.length; j++) {\n temp.add(this.signal[j]);\n if (this.signal[j] > threshold) {\n break;\n }\n partSignal = UtilMethods.convertToPrimitiveDouble(temp);\n }\n rightProm = threshold - StatUtils.min(partSignal);\n right_base[i] = peaks[i] + UtilMethods.argmin(partSignal, false) + 1;\n prominence[i] = Math.min(leftProm, rightProm);\n }\n\n double[][] promData = new double[3][peaks.length];\n promData[0] = prominence;\n promData[1] = left_base;\n promData[2] = right_base;\n return promData;\n }",
"public double[][] findPeakSharpness(int[] peaks) {\n double[][] sharpness = new double[2][peaks.length];\n for (int i=0; i<peaks.length; i++) {\n sharpness[0][i] = this.signal[peaks[i]] - this.signal[peaks[i]-1];\n sharpness[1][i] = this.signal[peaks[i]] - this.signal[peaks[i]+1];\n }\n return sharpness;\n }",
"public static int[][] findPeaks(float[] data, int radius, boolean spanGaps) {\n Extrema minima = new Extrema(data, /* isMax = */false);\n Extrema maxima = new Extrema(data, /* isMax = */true);\n for (int r = 1; r <= radius; r++) {\n minima.dilate();\n maxima.dilate();\n }\n\n int[] maxIdxs = new int[data.length], minIdxs = new int[data.length];\n int numMaxIdxs = 0, numMinIdxs = 0;\n int idxMin = 0, idxMax = 0;\n int prevExtremumType = -1, prevDataIdx = 0;\n while (idxMin < minima.numLiveExtrema || idxMax < maxima.numLiveExtrema) {\n int dataIdxMin = idxMin < minima.numLiveExtrema ? minima.liveExtremumDataIdx[idxMin] : data.length;\n int dataIdxMax = idxMax < maxima.numLiveExtrema ? maxima.liveExtremumDataIdx[idxMax] : data.length;\n int currDataIdx, extremumType;\n if (dataIdxMax < dataIdxMin) {\n // Next extremum is a local maximum\n currDataIdx = dataIdxMax;\n idxMax++;\n extremumType = 1;\n } else {\n // Next extremum is a local minimum\n currDataIdx = dataIdxMin;\n idxMin++;\n extremumType = 0;\n }\n\n if (spanGaps && prevExtremumType != -1 && extremumType == prevExtremumType) {\n // Found two adjacent extrema of same type --\n // find the extremum of opposite type between the two with the maximum dilation radius.\n // Search outwards so ties are broken by picking the more central extremum.\n // TODO: test simply picking the largest/smallest value over the range between the pair of adjacent\n // extrema.\n // TODO: the difference is picking the widest extremum (dominant over the widest range) vs. the tallest.\n Extrema otherTypeExtrema = extremumType == 1 ? minima : maxima;\n int maxRadiusX = otherTypeExtrema.findMostDominantExtremumBetween(prevDataIdx, currDataIdx);\n // Add the opposite-type extremum into the output\n if (extremumType == 1) {\n minIdxs[numMinIdxs++] = maxRadiusX;\n } else {\n maxIdxs[numMaxIdxs++] = maxRadiusX;\n }\n }\n\n if (extremumType == 1) {\n maxIdxs[numMaxIdxs++] = currDataIdx;\n } else {\n minIdxs[numMinIdxs++] = currDataIdx;\n }\n\n prevExtremumType = extremumType;\n prevDataIdx = currDataIdx;\n }\n return new int[][] { Arrays.copyOf(minIdxs, numMinIdxs), Arrays.copyOf(maxIdxs, numMaxIdxs) };\n }",
"public int[] filterByPeakDistance(int distance) {\n int[] peaks = this.midpoints;\n int[] keep = new int[peaks.length];\n Arrays.fill(keep, 1);\n double[] heights = this.getHeights();\n int[] priority = UtilMethods.argsort(heights, true);\n for (int i=peaks.length-1; i>=0; i--) {\n int j = priority[i];\n if (keep[j] == 0) {\n continue;\n }\n\n int k = j - 1;\n while (0 <= k && peaks[j] - peaks[k] < distance) {\n keep[k] = 0;\n k--;\n }\n\n k = j + 1;\n while (k < peaks.length && peaks[k] - peaks[j] < distance) {\n keep[k] = 0;\n k++;\n }\n }\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n for (int i=0; i<keep.length; i++) {\n if(keep[i] == 1) {\n newPeaks.add(peaks[i]);\n }\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }",
"public int[] getPeakDistance() {\n return this.distance;\n }",
"private int countPeaks(double[] values, double epsilon) {\n\t\t\n\t\tint nPeaks = 0;\n\t\tboolean previouslyIncreased = false;\n\t\tdouble previousValue = values[0]; // we can't have this count as previouslyIncreased\n\t\tfor (double value : values) {\n\t\t\tif (previouslyIncreased && value < previousValue) {\n\t\t\t\tnPeaks++;\n\t\t\t}\n\t\t\tif (value > previousValue) {\n\t\t\t\tpreviouslyIncreased = true;\n\t\t\t} else {\n\t\t\t\tpreviouslyIncreased = false;\n\t\t\t}\n\t\t\tpreviousValue = value;\n\t\t}\n\t\t\n\t\treturn nPeaks;\n\n\t}",
"public static ArrayList<Peak> findLocalMaxima(final double[] image,\n int[] taken,\n final double threshold,\n final double radius,\n final double background,\n final double sigma,\n final int imageSizeX,\n final int imageSizeY,\n final int margin)\n {\n ArrayList<Peak> newPeaks = new ArrayList<Peak>();\n\n int r = (int) Math.ceil(radius);\n double radiusSq = radius * radius;\n for (int i=margin; i < (imageSizeY - margin); i++) {\n for (int j=margin; j < (imageSizeX - margin); j++) {\n int idx = i * imageSizeX + j;\n double pixel = image[idx];\n boolean isMax = false;\n if (pixel > threshold) {\n isMax = true;\n int k = -r;\n while ((k <= r) && isMax) {\n int idx2 = idx + k * imageSizeX;\n for (int l=-r; l <= r; l++) {\n if ((k*k + l*l) < radiusSq) {\n if ((k <= 0) && (l <= 0)) {\n if (pixel < image[idx2 + l]) {\n isMax = false;\n }\n } else {\n if (pixel <= image[idx2 + l]) {\n isMax = false;\n }\n }\n }\n }\n k++;\n }\n if (isMax) {\n if (taken[idx] < 2) {\n // TODO: Should we center the inital peaks in the middle of the pixel? +0.5\n Peak newPeak = new Peak(\n pixel - background, // height\n background, // background\n j, // x center\n i, // y center\n sigma, // width x\n sigma); // width y\n newPeaks.add(newPeak);\n taken[idx] += 1;\n }\n }\n }\n }\n }\n return newPeaks;\n }",
"int findMax(List<double[]> x){\n List<double[]> maxInfo = new ArrayList<>();\n boolean increasing = false;\n double maxNum = x.get(0)[0];\n double maxFrame = 1;\n double slope = 0;\n for(int i = 0; i<x.size()-1;i++){\n System.out.println(x.get(i)[0]);\n if(x.get(i+1)[0] < x.get(i)[0]){\n increasing = true;\n slope = x.get(i+1)[0] - x.get(i)[0];\n maxNum = x.get(i+1)[0];\n maxFrame = x.get(i+1)[1];\n }\n else if(x.get(i+1)[0] > x.get(i)[0] && increasing && maxNum<150){\n System.out.println(\"PEAK: \" + maxNum + \",\" + maxFrame);\n increasing = false;\n maxInfo.add(new double[]{maxNum, maxFrame});\n maxNum = 0;\n maxFrame = 0;\n }\n }\n //removes false peaks with close frame tag near each other\n for(int i = 0; i < maxInfo.size()-1;i++){\n if(maxInfo.get(i+1)[1] - maxInfo.get(i)[1] <=10){\n System.out.println(\"REMOVED \" + maxInfo.get(i+1)[0]);\n maxInfo.remove(i+1);\n }\n }\n return maxInfo.size();\n }",
"public PeakAlysis(float f[], float x[])\r\n {\r\n }",
"public static float waveDataGetPeakToPeakValue(ArrayList<Float> wave){\r\n return Collections.max(wave)-Collections.min(wave);\r\n }",
"public static ArrayList<Float> extractPeakIdxsList(float[] profile1, double[] start1, double[] finish1)\n\t{\n\n\t\tint profileLength = profile1.length;\n\n//\t\tfor (int k=0; k<nrPoints; k++) {\n//\t\t\tstart11[k] = ((float) k / nrPoints) * profileLength;\n//\t\t}\n\n\t\tTools.runMaxShift(start1, profile1, maxIter, epsilon, h, finish1);\n\n\t\tVector<float[]> cls = Tools.extractClusters1(finish1, minD, M, profileLength);\n\n\t\tif (cls.size()==0) return new ArrayList<Float>();\n\n\t\telse if (cls.size()==1) {\n\t\t\tArrayList<Float> out = new ArrayList<Float>(1);\n\t\t\tout.add(0, cls.get(0)[0]);\n\t\t\treturn out;\n\t\t}\n\n\t\telse if (cls.size()==2) {\n ArrayList<Float> out = new ArrayList<Float>(2);\n out.add(0, cls.get(0)[0]);\n out.add(1, cls.get(1)[0]);\n return out;\n }\n\n\t\telse if (cls.size()==3) {\n ArrayList<Float> out = new ArrayList<Float>(3);\n out.add(0, cls.get(0)[0]);\n out.add(1, cls.get(1)[0]);\n out.add(2, cls.get(2)[0]);\n return out;\n }\n\n\t\telse if (cls.size()==4) {\n ArrayList<Float> out = new ArrayList<Float>(4);\n out.add(0, cls.get(0)[0]);\n out.add(1, cls.get(1)[0]);\n out.add(2, cls.get(2)[0]);\n out.add(3, cls.get(3)[0]);\n return out;\n }\n\n\t\telse {\n return bestNList(cls, 4);\n }\n\n\t}",
"static int findPeakWithDuplicates(int[] a) {\n int start = 0, end = a.length - 1;\n\n while (start <= end) {\n int mid = start + (end - start) / 2;\n\n if (mid < end && a[mid] > a[mid + 1])\n return mid;\n if (mid > start && a[mid] < a[mid - 1])\n return mid - 1;\n\n // if elements at start and end are duplicates then just skip them\n if (a[mid] == a[start] && a[mid] == a[start]) {\n if (a[start] > a[start + 1])\n return start;\n start++;\n\n if (a[end] < a[end - 1])\n return end - 1;\n end--;\n } else if (a[start] < a[mid] || a[start] == a[mid] && a[mid] > a[start])\n start = mid + 1;\n else\n end = mid - 1;\n\n }\n\n return -1;\n }",
"private static int peakOneD(int i, int[] nums) {\n if (i > 0 && nums[i] < nums[i - 1])\n return -1;\n if (i < nums.length - 1 && nums[i] < nums[i + 1])\n return 1;\n return 0;\n }",
"public int findPeak(int[] A) {\n // write your code here\n int start = 0, end = A.length - 1;\n while (start + 1 < end) {\n int mid = start + (end - start) / 2;\n if (A[mid] < A[mid + 1]) {\n start = mid;\n }\n else {\n end = mid;\n }\n }\n return A[start] > A[end] ? start : end;\n }",
"private static void fixSpikes(int[] array){\r\n\t\t\r\n\t\tfor(int i=1; i<array.length-1; i++){\r\n\t\t\tlong a=Tools.max(1, array[i-1]);\r\n\t\t\tint b=array[i];\r\n\t\t\tlong c=Tools.max(1, array[i+1]);\r\n\t\t\tif(b>1 && b>a && b>c){\r\n\t\t\t\t//peak\r\n\t\t\t\tif((b>=2*a || b>a+2) && (b>=2*c || b>c+2)){\r\n\t\t\t\t\t//spike\r\n\t\t\t\t\tarray[i]=(int)Tools.max(a, c);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void peakAnalysis(Results picks){\n\n \tInteger OrgSize = picks.trueCounter(picks.getHitOrg()); //ilosc wszystkich pickow\n \tInteger h60TrueCount = picks.trueCounter(picks.getHit60()); //ilosc trafien filtr-60\n \tInteger h80TrueCount = picks.trueCounter(picks.getHit80()); //ilosc trafien filtr-80\n\n \tFloat lostPercent60;// = 2.0f;\n \tFloat lostPercent80;\n\n \tif (h60TrueCount>0)\t{\n \t\tlostPercent60 = 100-(((float)h60TrueCount*100)/(float)OrgSize); //wersja pokazujaca, ile procent utracono\n \t\t//lostPercent60 = 100*((float)OrgSize/((float)h60TrueCount)); //wersja procentow z zapisem\n \t} else {\n \t\tlostPercent60 = (float) 0.0;\n \t}\n\n \tif (h80TrueCount>0)\t{\n\t\tlostPercent80 = 100-(((float)h80TrueCount*100)/(float)OrgSize); //analogicznie, j.w.\n \t\t//lostPercent80 = 100*((float)OrgSize/((float)h80TrueCount));\n\n \t} else {\n \t\tlostPercent80 = (float) 0.0;\n \t}\n\n \tString endScore = \"\";\n \t//endScore +=\"Zbiorczy wynik koncowy dla wszystkich pick'ow:\\nDane oryginalne: \"+OrgSize+\", filtr 60: \"+h60TrueCount+\", filtr 80: \"+h80TrueCount;\n \t//endScore +=\"\\nProcent utraconych pik'ow: filtr 60: \"+lostPercent60+\", filtr 80: \"+lostPercent80;\n\n \tendScore +=\"Sumaryczna_liczba_peakow:\\n\";\n \tendScore +=\"Peak_prawdziwy:\"+\" filtr60:\"+\" filtr80:\\n\";\n \tendScore += OrgSize+\" \"+h60TrueCount+\" \"+h80TrueCount;\n \tendScore +=\"\\nProcent_utraconych_pik'ow:\\n\";\n \tendScore +=\"filtr60:\"+\" filtr_80:\\n\";\n \tendScore +=lostPercent60+\" \"+lostPercent80;\n \t//System.out.println(endScore); //finished score\n \n try {\n \tFileWriter fileWriter = new FileWriter(\"GrupProj/electron/Result.csv\");\n\t\t\tfileWriter.write(endScore);\n\t\t\tfileWriter.flush();\n\t fileWriter.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error save\");\n\t\t\te.printStackTrace();\n\t\t}\n\n }",
"public static int peakIndexInMountainArray(int[] a) {\n return peakIndexInMountainArray(a, 0, a.length);\n }",
"public static int findPeakElement(int[] nums) {\n int l = 0, r = nums.length - 1;\n while (l < r) {\n int mid = l + (r - l) / 2;\n if (nums[mid] > nums[mid + 1])\n r = mid;\n else\n l = mid + 1;\n }\n return l;\n }",
"@Override\n public int[] asMajorPeakMZs() {\n guaranteeMajorPeaks();\n final Integer[] peaks = majorPeakMZ.toArray(new Integer[majorPeakMZ.size()]);\n Arrays.sort(peaks);\n int[] ret = new int[peaks.length];\n for (int i = 0; i < ret.length; i++) {\n ret[i] = peaks[i];\n\n }\n return ret;\n }",
"public int getMatchedPeaks() {\r\n return numMatchedPeaks;\r\n }",
"public void parseMZArray(SampleSpectrum spec) throws CustomException\n\t{\n\t\tdouble[] values;\n\t\tbyte[] decoded = Base64.getDecoder().decode(mzArray);\n\t\tByteBuffer byteBuffer = ByteBuffer.wrap(decoded);\n\t\tbyteBuffer.order(ByteOrder.BIG_ENDIAN);\n\t\t\n\n\t\tvalues = new double[byteBuffer.asDoubleBuffer().capacity()];\n\t\tbyteBuffer.asDoubleBuffer().get(values);\n\t\t\n\t\tif (values.length % 2 > 0)\n\t\t\tthrow new CustomException(\"Different number of m/z and intensity values encountered in peak list.\", null);\n\t\t\n\t\tfor (int peakIndex = 0; peakIndex < values.length - 1; peakIndex += 2)\n\t\t{\n\t\t\tDouble mz = values[peakIndex];\n\t\t\tDouble intensity = values[peakIndex + 1];\n\t\t\tspec.addFrag(mz, intensity);\n\t\t}\n\t}",
"com.bagnet.nettracer.ws.core.pojo.xsd.WSScanPoints getScansArray(int i);",
"private static int peakX(int x, int y, int[][] nums) {\n if (x > 0 && nums[y][x] < nums[y][x - 1])\n return -1;\n if (x < nums[0].length - 1 && nums[y][x] < nums[y][x + 1])\n return 1;\n return 0;\n }",
"public AdjustPeaksForPixelSensitivity_2(){\n super(\"AdjustPeaksForPixelSensitivity_2\");\n }",
"public void setPeakList(Vector<Peak> peakList)\n {\n \tthis.peakList = peakList;\n }",
"public abstract double[] roughOffsets();",
"public int[] findPlateauSize(int[] peaks) {\n int[] newPS = new int[peaks.length];\n for (int i=0; i<peaks.length; i++) {\n newPS[i] = this.plateau_size[peaks[i]];\n }\n return newPS;\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 void getPeakValue(float value) {\r\n if (Math.abs(value) > peakValue) {\r\n peakValue = value;\r\n }\r\n }",
"public static double[] getLastVisiblePointData( List<ProfilePoint> profile ) {\n if (profile.size() < 2) {\n throw new IllegalArgumentException(\"A profile needs to have at least 2 points.\");\n }\n ProfilePoint first = profile.get(0);\n double baseElev = first.getElevation();\n Coordinate baseCoord = new Coordinate(0, 0);\n\n double minAzimuthAngle = Double.POSITIVE_INFINITY;\n double maxAzimuthAngle = Double.NEGATIVE_INFINITY;\n ProfilePoint minAzimuthPoint = null;\n ProfilePoint maxAzimuthPoint = null;\n for( int i = 1; i < profile.size(); i++ ) {\n ProfilePoint currentPoint = profile.get(i);\n double currentElev = currentPoint.getElevation();\n if (JGTConstants.isNovalue(currentElev)) {\n continue;\n }\n currentElev = currentElev - baseElev;\n double currentProg = currentPoint.getProgressive();\n Coordinate currentCoord = new Coordinate(currentProg, currentElev);\n\n double azimuth = GeometryUtilities.azimuth(baseCoord, currentCoord);\n if (azimuth <= minAzimuthAngle) {\n minAzimuthAngle = azimuth;\n minAzimuthPoint = currentPoint;\n }\n if (azimuth >= maxAzimuthAngle) {\n maxAzimuthAngle = azimuth;\n maxAzimuthPoint = currentPoint;\n }\n }\n\n if (minAzimuthPoint == null || maxAzimuthPoint == null) {\n return null;\n }\n\n return new double[]{//\n /* */minAzimuthPoint.elevation, //\n minAzimuthPoint.position.x, //\n minAzimuthPoint.position.y, //\n minAzimuthPoint.progressive, //\n minAzimuthAngle, //\n maxAzimuthPoint.elevation, //\n maxAzimuthPoint.position.x, //\n maxAzimuthPoint.position.y, //\n maxAzimuthPoint.progressive, //\n maxAzimuthAngle, //\n };\n\n }",
"public int findPeakElement(int[] nums) {\n int left = 0, right = nums.length - 1;\n while (left + 1 < right) {\n int mid = left + (right - left) / 2;\n if (nums[mid] < nums[mid + 1]) {\n left = mid;\n }\n else {\n right = mid;\n }\n }\n return nums[left] > nums[right] ? left : right;\n }",
"com.bagnet.nettracer.ws.core.pojo.xsd.WSScanPoints[] getScansArray();",
"PlotPoints(double[] xdata, double[] ydata,\n double xMn, double xMx, double yMn, double yMx) {\n nPts = xdata.length;\n x = new double[nPts];\n y = new double[nPts];\n err = new double[nPts];\n for(int i=0; i<nPts; i++){\n x[i] = xdata[i];\n y[i] = ydata[i];\n }\n xMin = xMn;\n xMax = xMx;\n yMin = yMn;\n yMax = yMx;\n }",
"@SuppressWarnings(\"unused\")\r\n private double[] getSeedPoint(double[] center) {\r\n double lowIntensity = -50;\r\n double highIntensity = 50;\r\n \r\n int originalX = (int)center[0], currentX = (int)center[0];\r\n int originalY = (int)center[1], currentY = (int)center[1];\r\n \r\n boolean pointFound = false;\r\n \r\n while(!pointFound && currentX < xDim) {\r\n if(srcImage.get(currentX, currentY, (int)center[2]).doubleValue() < highIntensity &&\r\n srcImage.get(currentX, currentY, (int)center[2]).doubleValue() > lowIntensity) {\r\n pointFound = true;\r\n break;\r\n }\r\n if(currentX - originalX > currentY - originalY)\r\n currentY++;\r\n else\r\n currentX++;\r\n }\r\n \r\n if(pointFound) {\r\n center[0] = currentX;\r\n center[1] = currentY;\r\n }\r\n \r\n return center;\r\n \r\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 int getNumSpectrumPeaks() {\r\n return numSpectrumPeaks;\r\n }",
"public static void calculatePeakActivity(String path) {\n List<String> visits = CsvParser.parseCsv(path);\n\n Map<Integer, Integer> minuteFrames = fillInFrames(visits);\n\n Map<Integer, Integer> peakFrames = maxValueEntries(minuteFrames);\n\n displayResult(peakFrames);\n }",
"public static Point minmax (int[] a) {\n int n = a.length;\n Point mm = new Point (a[0], a[0]);\n\n for (int i=1; i<n; i++) {\n if (a[i] > mm.x) mm.x = a[i];\n if (a[i] < mm.y) mm.y = a[i];\n }\n return mm;\n }",
"public double[][] findPeakWidth(int[] peaks, double rel_height) throws IllegalArgumentException {\n if (rel_height > 1.0 || rel_height < 0.0) {\n throw new IllegalArgumentException(\"rel_height can be between 0.0 and 1.0\");\n }\n double[] width = new double[peaks.length];\n double[][] promData = this.findPeakProminence(peaks);\n double[] prominence = promData[0];\n double[] left_bases = promData[1];\n double[] right_bases = promData[2];\n\n double[] widthHeight = new double[peaks.length];\n double[] leftIntersectPoint = new double[peaks.length];\n double[] rightIntersectPoint = new double[peaks.length];\n\n for (int i=0; i<peaks.length; i++) {\n widthHeight[i] = this.signal[peaks[i]] - prominence[i]*rel_height;\n\n // Calculate left intersection point of half width\n int j = peaks[i];\n while (left_bases[i] < j && widthHeight[i] < this.signal[j]) {\n j--;\n }\n leftIntersectPoint[i] = j;\n if (this.signal[j] < widthHeight[i]) {\n leftIntersectPoint[i] += (widthHeight[i] - this.signal[j])/(this.signal[j+1] - this.signal[j]);\n }\n\n // Calculate right point of half width\n j = peaks[i];\n while (j < right_bases[i] && widthHeight[i] < this.signal[j]) {\n j++;\n }\n rightIntersectPoint[i] = j;\n if (this.signal[j] < widthHeight[i]) {\n rightIntersectPoint[i] -= (widthHeight[i] - this.signal[j])/(this.signal[j-1] - this.signal[j]);\n }\n\n width[i] = rightIntersectPoint[i] - leftIntersectPoint[i];\n }\n\n double[][] wData = new double[4][peaks.length];\n wData[0] = width;\n wData[1] = widthHeight;\n wData[2] = leftIntersectPoint;\n wData[3] = rightIntersectPoint;\n\n return wData;\n }",
"public findDetectorPeaks(){\n super(\"findDetectorPeaks\");\n }",
"public java.util.List[] getPointArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n java.util.List targetList = new java.util.ArrayList();\n get_store().find_all_element_users(POINT$0, targetList);\n java.util.List[] result = new java.util.List[targetList.size()];\n for (int i = 0, len = targetList.size() ; i < len ; i++)\n result[i] = ((org.apache.xmlbeans.SimpleValue)targetList.get(i)).getListValue();\n return result;\n }\n }",
"private List<Integer> getStartPoints( List<IAminoAcid> aas, int startIndex,\r\n int chosenIndex )\r\n {\r\n List<Integer> points = new ArrayList<Integer>();\r\n\r\n for( int i = startIndex + 1; i < chosenIndex; i++ )\r\n {\r\n IAminoAcid aa = aas.get( i );\r\n IAminoAcid lastAa = aas.get( i - 1 );\r\n\r\n if( aa.getPeak() == null && lastAa.getPeak() != null )\r\n {\r\n points.add( i + 1 );\r\n }\r\n }\r\n\r\n return points;\r\n }",
"public int[] filterByWidth(double lower_threshold, double upper_threshold) {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n for (int i=0; i<this.width.length; i++) {\n if (this.width[i] >= lower_threshold && this.width[i] <= upper_threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }",
"public AveragePoint getCenterPoint(float[] sampleValues){\n\t\tfloat avgDirection = 0;\n\t\tfloat avgDistance = 0;\n\t\tint count = 0;\n\t\t\n\t\tfor (int i = 0; i < sampleValues.length/2; ++i) {\n\t\t\t\n\t\t\t//TODO: Add checks for when values are out of range\n \tfloat direction = sampleValues[i*2];\n \tfloat distance = sampleValues[(i*2)+1];\n \t \t\n \tif (distance > 0 && distance < 100) {\n \t\tavgDistance += distance;\n \tavgDirection += direction;\n \tcount ++;\n \t}\n\t\t}\n\t\t\n\t\tavgDirection /= count;\n\t\tavgDistance /= count;\n\t\t\n\t\t\n\t\treturn new AveragePoint(avgDistance, avgDirection);\n\t}",
"@Override\n public IPeaksSpectrum asMajorPeaks() {\n return getHighestNPeaks(MAJOR_PEAK_NUMBER);\n }",
"public int[] filterByWidth(double threshold, String mode) throws IllegalArgumentException {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n if (mode.equals(\"upper\")) {\n for (int i=0; i<this.width.length; i++) {\n if (this.width[i] <= threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n }\n else if (mode.equals(\"lower\")) {\n for (int i=0; i<this.width.length; i++) {\n if (this.width[i] >= threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n }\n else {\n throw new IllegalArgumentException(\"Mode must either be lower or upper\");\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }",
"static double[][] getSpectrum(MSRun run, int scan)\r\n {\r\n MSScan s = run.getScan(scan);\r\n float[][] t1 = s.getSpectrum();\r\n double[][] peaks = new double[2][t1[0].length];\r\n for (int j = 0; j < t1[0].length; j++)\r\n {\r\n peaks[0][j] = t1[0][j];\r\n peaks[1][j] = t1[1][j];\r\n }\r\n return peaks;\r\n }",
"public static ArrayList<Peak> removeClosePeaks(final ArrayList<Peak> inPeaks,\n final double radius,\n final double neighborhood)\n {\n ArrayList<Peak> outPeaks = new ArrayList<Peak>();\n final int numInPeaks = inPeaks.size();\n final double radiusSq = radius * radius;\n final double neighborhoodSq = neighborhood * neighborhood;\n\n // 1. flag peaks to be removed\n for (int i=0; i < numInPeaks; i++) {\n final Peak p1 = inPeaks.get(i);\n boolean bad = false;\n int j = 0;\n while ((j < numInPeaks) && (!bad)) {\n if (j != i) {\n final Peak p2 = inPeaks.get(j);\n if ((p1.sqDist2D(p2) < radiusSq) &&\n (p2.getHeight() > p1.getHeight()))\n bad = true;\n }\n }\n if (bad) p1.setStatus(PeakStatus.BADPEAK);\n }\n\n // 2. flag non-bad neighbors of bad peaks as running\n for (final Peak p1 : inPeaks) {\n if (p1.getStatus() == PeakStatus.BADPEAK) {\n for (Peak p2 : inPeaks) {\n if (!p1.equals(p2)) {\n if (p1.dist2D(p2) < neighborhoodSq &&\n p2.getStatus() != PeakStatus.BADPEAK) {\n p2.setStatus(PeakStatus.RUNNING);\n }\n }\n }\n }\n }\n\n // 3. create a new list with the bad peaks removed\n for (final Peak p : inPeaks)\n if (p.getStatus() != PeakStatus.BADPEAK)\n outPeaks.add(p);\n\n return outPeaks;\n }",
"public ChipAveragedResult[] getChipAveragedThresholdFromThresholdFile(String fileName, int rows, int columns,\n\t\t\tboolean chipPresent[]) throws Exception {\n\t\tHdf5Helper hdf = Hdf5Helper.getInstance();\n\n\n\n\t\tChipSet chipset = new ChipSet(rows, columns, chipPresent);\n\t\tChipAveragedResult[] aPeaks = new ChipAveragedResult[chipset.numChips];\n\t\tArrays.fill(aPeaks, null);\n\n\t\tfor (Chip chip : chipset.getChips()) {\n\t\t\tChipAveragedResult chipAveragedResult = new ChipAveragedResult();\n\n\t\t\tHdf5HelperData xValsHfd= hdf.readDataSetAll(fileName, getEqualisationLocation()\n\t\t\t\t\t.getLocationForOpen(), getPopXvalName(chip), true);\n\n\t\t\tchipAveragedResult.xvals=(double[]) xValsHfd.data;\n\n\t\t\tHdf5HelperData yValsHfd= hdf.readDataSetAll(fileName, getEqualisationLocation()\n\t\t\t\t\t.getLocationForOpen(), getPopYvalName(chip), true);\n\n\t\t\tchipAveragedResult.yvals=(double[]) yValsHfd.data;\n\t\t\tchipAveragedResult.function = fitGaussianToBinnedPopulation(chipAveragedResult.xvals, chipAveragedResult.yvals);\n\t\t\taPeaks[chip.index] = chipAveragedResult;\n\t\t}\n\t\treturn aPeaks;\n\t}",
"public static IPoint2[] calcHotPixels(Segment[] s, BlackBox blackBox,\n DArray hpList) {\n Map m = new HashMap();\n\n final boolean db = false;\n\n if (db && T.update())\n T.msg(\"calcHotPixels for \" + s.length + \" segments\");\n blackBox.setOrientation(0);\n\n if (hpList != null) {\n hpList.clear();\n for (int i0 = 0; i0 < s.length; i0++)\n hpList.add(new DArray());\n }\n\n for (int i0 = 0; i0 < s.length; i0++) {\n\n Segment a = s[i0];\n\n IPoint2 e0 = a.pt(0), e1 = a.pt(1);\n\n m.put(e0, Boolean.TRUE);\n m.put(e1, Boolean.TRUE);\n\n DArray lst = null;\n if (hpList != null) {\n lst = hpList.getDArray(i0);\n lst.add(e0);\n lst.add(e1);\n }\n\n if (db && T.update())\n T.msg(\" adding endpoints \" + e0 + \", \" + e1);\n\n for (int i1 = i0 + 1; i1 < s.length; i1++) {\n Segment b = s[i1];\n IPoint2 pt;\n\n BlackBox bb = blackBox.construct(a, b);\n if (db && T.update())\n T.msg(\"\" + bb);\n if (!bb.abWithinSegments())\n continue;\n if (db && T.update())\n T.msg(\" adding intersection pixel \" + bb.getIntersectionPixel(false));\n pt = bb.getIntersectionPixel(false);\n m.put(pt, Boolean.TRUE);\n\n if (hpList != null) {\n hpList.getDArray(i1).add(pt);\n lst.add(pt);\n }\n }\n }\n\n // sort hot pixels for segments into order, and remove duplicates\n if (hpList != null) {\n for (int i = 0; i < s.length; i++) {\n DArray a = hpList.getDArray(i);\n a.sort(IPoint2.comparator);\n IPoint2 prev = null;\n for (int j = a.size() - 1; j >= 0; j--) {\n IPoint2 th = (IPoint2) a.get(j);\n if (prev != null && prev.equals(th)) {\n a.remove(j);\n }\n prev = th;\n }\n }\n }\n\n DArray jpts = new DArray();\n jpts.addAll(m.keySet());\n jpts.sort(IPoint2.comparator);\n return (IPoint2[]) jpts.toArray(IPoint2.class);\n }",
"public int[] filterBySharpness(double lower_threshold, double upper_threshold) {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n int[] keep = new int[this.midpoints.length];\n Arrays.fill(keep, 1);\n\n for (int i=0; i<this.sharpness[0].length; i++) {\n double minVal = Math.min(this.sharpness[0][i], this.sharpness[1][i]);\n if (minVal < lower_threshold) {\n keep[i] = 0;\n }\n }\n for (int i=0; i<this.sharpness[0].length; i++) {\n double maxVal = Math.max(this.sharpness[0][i], this.sharpness[1][i]);\n if (maxVal > upper_threshold) {\n keep[i] = 0;\n }\n }\n for (int i=0; i<keep.length; i++) {\n if(keep[i] == 1) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }",
"private static int peakY(int x, int y, int[][] nums) {\n if (y > 0 && nums[y][x] < nums[y - 1][x])\n return -1;\n if (y < nums.length - 1 && nums[y][x] < nums[y + 1][x])\n return 1;\n return 0;\n }",
"public double[][] getPeakSharpness() {\n return this.sharpness;\n }",
"public String getCommand(){\n return \"findDetectorPeaks\";\n }",
"private Point[] nearestPair3Points(Point[] range) {\n\t\t\tif (range.length < 2)\treturn null; \n\t\t\tif (range.length == 2)\treturn range; \n\t\t\t//else - its mean that we have 3 points in the array\n\t\t\tPoint[] Answer = new Point[2];\n\t\t\tdouble currentMinDistance = Distance(range[0], range[1]);\n\t\t\tAnswer[0]= range[0];\n\t\t\tAnswer[1]= range[1];\n\t\t\tif (Distance(range[0], range[2]) < currentMinDistance){\n\t\t\t\tcurrentMinDistance = Distance(range[0], range[2]);\n\t\t\t\tAnswer[0]= range[0];\n\t\t\t\tAnswer[1]= range[2];\n\t\t\t}\n\t\t\tif (Distance(range[1], range[2]) < currentMinDistance){\n\t\t\t\tAnswer[0]= range[1];\n\t\t\t\tAnswer[1]= range[2];\n\t\t\t}\n\t\t\treturn Answer;\n\t\t}",
"public static IsotopePattern getPeakInfo(String fileName) {\n\t\t\n\t\ttry {\n\n\t\t\tIsotopePattern result = new IsotopePattern();\n\t\t\t\n\t\t\tFileInputStream fstream = new FileInputStream(fileName);\n\t\t\tDataInputStream din = new DataInputStream(fstream);\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(din));\n\t\t\twhile (in.ready()) {\n\t\t\t\tString str = in.readLine();\n\t\t\t\tif (!str.trim().equals(\"\")) {\n\t\t\t\t\tString[] split = str.split(\"\\t\");\n\t\t\t\t\tdouble mass = new Double(split[0]);\n\t\t\t\t\tdouble intensity = new Double(split[1]);\n\t\t\t\t\tresult.addIsotope(new IsotopeContainer(mass, intensity));\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//System.out.println`(mass + \"\\t\" + intensity);\n\t\t\t\t}\n\t\t\t}\n\t\t\tin.close();\n\t\t\t\n\t\t\treturn result;\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"public static double getMeanSlope( List<ProfilePoint> points ) {\n double meanSlope = 0;\n\n int num = 0;\n for( int i = 0; i < points.size() - 1; i++ ) {\n ProfilePoint p1 = points.get(i);\n ProfilePoint p2 = points.get(i + 1);\n\n double dx = p2.progressive - p1.progressive;\n double dy = p2.elevation - p1.elevation;\n double tmpSlope = dy / dx;\n meanSlope = meanSlope + tmpSlope;\n num++;\n }\n meanSlope = meanSlope / num;\n return meanSlope;\n }",
"public int[] filterByPlateauSize(double lower_threshold, double upper_threshold) {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n for (int i=0; i<this.plateau_size.length; i++) {\n if (this.plateau_size[i] >= lower_threshold && this.plateau_size[i] <= upper_threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }",
"private Point[] nearestPairRec(Point[] range, boolean axis) {\n\t\t\tPoint[] Answer = new Point[2];\n\t\t\tif (range.length < 4) return nearestPair3Points(range);\n\t\t\tPoint[] MinPointsLeft = new Point[2];\n\t\t\tPoint[] MinPointsRight = new Point[2];\n\t\t\tPoint[] MinPointsInStrip = new Point[2];\n\t\t\tdouble MinDistance = -1; //it will be change for sure, because we pass the array only if it containes 4 points and above.\n\t\t\tdouble MinDistanceInStrip;\n\t\t\t//step 4\n\t\t\tif (axis){\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(range[0].getX(), range[(range.length)/2].getX(), axis), axis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(range[((range.length)/2)+1].getX(), range[range.length-1].getX() ,axis), axis);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(range[0].getY(), range[(range.length)/2].getY(), axis), axis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(range[((range.length)/2)+1].getY(), range[range.length-1].getY() ,axis), axis);\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}else if (MinPointsLeft!=null && MinPointsRight==null) {\n\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t}else if (MinPointsRight!=null && MinPointsLeft==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 find the nearest point around the median\n\t\t\tint upper;\n\t\t\tint lower;\n\t\t\tif (MinDistance==-1) MinDistance = 0;\n\t\t\tif (axis){\n\t\t\t\tupper = (int) (range[(range.length)/2].getX()+MinDistance);\n\t\t\t\tlower = (int) (range[(range.length)/2].getX()-MinDistance);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tupper = (int) (range[(range.length)/2].getY()+MinDistance);\n\t\t\t\tlower = (int) (range[(range.length)/2].getY()-MinDistance);\n\t\t\t}\n\t\t\trange = getPointsInRangeOppAxis(lower, upper, axis);\n\t\t\tif (range.length>=2) MinPointsInStrip = nearestPointInArray(range);\n\t\t\tif (MinPointsInStrip[0]!=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}",
"void setScansArray(com.bagnet.nettracer.ws.core.pojo.xsd.WSScanPoints[] scansArray);",
"public double[] GetPointArray() {\n return PointArray;\n }",
"public java.util.List getPointArray(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(POINT$0, i);\n if (target == null)\n {\n throw new IndexOutOfBoundsException();\n }\n return target.getListValue();\n }\n }",
"private Point[] getPointArray()\n\t{\n\t\treturn this.pointArray; // This should probably be a copy, to maintain security (?)\n\t}",
"public void run(){\n\n for (int locIdx = begN; locIdx < endN; locIdx++) {\n\n // do mean-shift for profiles at these locations\n\n for (int profileIdx=0; profileIdx<profiles.get(locIdx).size(); profileIdx++) {\n\n // access the detection\n// int profileLength = profiles.get(locIdx).get(profileIdx).length;\n\n // calculate peaks for the ring 'profileIdx'\n ArrayList<Float> currPeaks = extractPeakIdxsList(profiles.get(locIdx).get(profileIdx), startIdx.get(profileIdx), finishIdx.get(locIdx).get(profileIdx));\n\n //if (currPeaks.size()<3) {\n // // it is not a bifurcation according to MS for this ring, don't calculate further, leave empty fields of peakIdx at this location\n // break;\n //}\n //else {\n // add those points\n for (int pp=0; pp<currPeaks.size(); pp++){\n peakIdx.get(locIdx).get(profileIdx).add(pp, currPeaks.get(pp));\n }\n //}\n\n/*\n\t\t\t\tfor (int k=0; k<nrPoints; k++) {\n start[k] = ((float) k / nrPoints) * profileLength;\n }\n\n\t\t\t\tTools.runMS( \tstart,\n \tprofiles.get(locIdx).get(profileIdx),\n \tmaxIter,\n \tepsilon,\n \th,\n\t\t\t\t\t\t\t\tmsFinish);\n*/\n\n /*\n for (int i1=0; i1<nrPoints; i1++) {\n convIdx.get(locIdx).get(profileIdx)[i1] = (float) msFinish[i1];\n }\n*/\n/*\n int inputProfileLength = profiles.get(locIdx).get(profileIdx).length;\n Vector<float[]> cls = Tools.extractClusters1(msFinish, minD, M, inputProfileLength);\n\t\t\t\textractPeakIdx(cls, locIdx, profileIdx); // to extract 3 major ones (if there are three)\n*/\n\n }\n\n }\n\n }",
"public int[] filterByHeight(double threshold, String mode) throws IllegalArgumentException {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n if (mode.equals(\"upper\")) {\n for (int i=0; i<this.height.length; i++) {\n if (this.height[i] <= threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n }\n else if (mode.equals(\"lower\")) {\n for (int i=0; i<this.height.length; i++) {\n if (this.height[i] >= threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n }\n else {\n throw new IllegalArgumentException(\"Mode must either be lower or upper\");\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }",
"public int[] filterByProminence(double threshold, String mode) throws IllegalArgumentException{\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n if (mode.equals(\"upper\")) {\n for (int i=0; i<this.prominence.length; i++) {\n if (this.prominence[i] <= threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n }\n else if (mode.equals(\"lower\")) {\n for (int i=0; i<this.prominence.length; i++) {\n if (this.prominence[i] >= threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n }\n else {\n throw new IllegalArgumentException(\"Mode must either be lower or upper\");\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }",
"public int[] filterByPlateauSize(double threshold, String mode) throws IllegalArgumentException {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n if (mode.equals(\"upper\")) {\n for (int i=0; i<this.plateau_size.length; i++) {\n if (this.plateau_size[i] <= threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n }\n else if (mode.equals(\"lower\")) {\n for (int i=0; i<this.plateau_size.length; i++) {\n if (this.plateau_size[i] >= threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n }\n else {\n throw new IllegalArgumentException(\"Mode must either be lower or upper\");\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }",
"public int[] filterByProminence(double lower_threshold, double upper_threshold) {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n for (int i=0; i<this.prominence.length; i++) {\n if (this.prominence[i] >= lower_threshold && this.prominence[i] <= upper_threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }",
"int[][] Naive(int m, Pointd[] points){\n int[][] tours = new int[m][];\n for(int i=0; i<m; i++){\n if(i<points.length%m) tours[i] = new int[points.length/m+1];\n else tours[i] = new int[points.length/m];\n }\n\n //Select the first point, find the next closest point, find the next closest point to that etc\n boolean[] alreadyInTour = new boolean[points.length];\n double minDistance;\n double distance;\n Pointd pointA;\n Pointd pointB;\n int index = 0;\n int n;\n\n for(int k=0; k<m; k++){\n //Each row of tours, first find a node that isn't in a tour\n n = 0;\n while(alreadyInTour[n]) n++;\n pointA = points[n];\n tours[k][0] = n;\n alreadyInTour[n] = true;\n\n int iterate = 0;\n int j=1;\n while(j<tours[k].length){\n if(!alreadyInTour[iterate]){\n minDistance = Double.MAX_VALUE;\n //Find next closest point to pointA\n for(int i=0; i<points.length; i++){\n pointB = points[i];\n if(!alreadyInTour[i]){\n distance = Math.sqrt( Math.pow(pointA.x - pointB.x, 2) + Math.pow(pointA.y - pointB.y, 2) );\n if(distance < minDistance){\n minDistance = distance;\n index = i;\n }\n }\n }\n //System.out.println(index);\n tours[k][j] = index;\n alreadyInTour[index] = true;\n j++;\n }\n iterate++;\n if(iterate >= points.length) iterate = 0;\n }\n }\n for(int i=0; i<tours.length; i++){\n //System.out.println(Arrays.toString(tours[i]));\n }\n return tours;\n }",
"private static final int[] getPoint(int point) {\n int[] ret = new int[2];\n if (point >= firstPoint && point <= endPoint) {\n ret = getPoint(ruteData[point + 2]);//ruteData[point + 2]);\n }\n return ret;\n }",
"@Test\n public void getPointsTest() {\n final double[] expectedResult = new double[3];\n final double[] envelope = new double[]{-3, 2, 0, 1, 4, 0};\n\n //lower corner\n System.arraycopy(envelope, 0, expectedResult, 0, 3);\n assertTrue(Arrays.equals(expectedResult, getLowerCorner(envelope)));\n\n //upper corner\n System.arraycopy(envelope, 3, expectedResult, 0, 3);\n assertTrue(Arrays.equals(expectedResult, getUpperCorner(envelope)));\n\n //median\n expectedResult[0] = -1;\n expectedResult[1] = 3;\n expectedResult[2] = 0;\n assertTrue(Arrays.equals(expectedResult, getMedian(envelope)));\n }",
"public PointScanner(Point[] pts, Algorithm algo) throws IllegalArgumentException\n\t{\n\t\tif (pts == null || pts.length == 0) throw new IllegalArgumentException();\n\t\tpoints = new Point[pts.length];\n\t\tint i;\n\t\tfor (i = 0; i < pts.length; i++) {\n\t\t\tpoints[i] = new Point(pts[i]);\n\t\t}\n\t\tsortingAlgorithm = algo;\n\t}",
"public int[] filterByHeight(double lower_threshold, double upper_threshold) {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n for (int i=0; i<this.height.length; i++) {\n if (this.height[i] >= lower_threshold && this.height[i] <= upper_threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }",
"public float[][] calcImmoniumPeaks(int min, int max, String seq, float[] mods, String filterIonTypes, int maxCharge, float dmass, float tol) {\n\t\tArrayList<Float> knownPeaks = calculatePeptideFragments(seq, mods, filterIonTypes, maxCharge, dmass);\n\t\t//ArrayList<Float> shiftedPeaks = new ArrayList<>();\n\t\t//for (Float peak : knownPeaks) //todo test?\n\t\t//\tshiftedPeaks.add(peak + dmass);\n\t\t//knownPeaks.addAll(shiftedPeaks);\n\n\t\tthis.averageIonMass = 0;\n\t\tArrayList<Peak> ps = new ArrayList<>();\n\t\tfor (int i = 0; i < peakMZ.length; i++) {\n\t\t\tif (peakMZ[i] > max) //todo remove min max\n\t\t\t\tbreak;\n\t\t\tif (peakMZ[i] > min) { //todo remove min max\n\t\t\t\tdouble absTol = peakMZ[i] * tol / 1000000;\n\t\t\t\tboolean skipFlag = false;\n\t\t\t\tfor (Float peak : knownPeaks) {\n\t\t\t\t\tif (Math.abs(peak - peakMZ[i]) < absTol) { //todo ppm tol\n\t\t\t\t\t\tskipFlag = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (skipFlag == false) {\n\t\t\t\t\tps.add(new Peak(peakMZ[i], peakInt[i], (float)absTol));\n\t\t\t\t\tthis.averageIonMass += peakMZ[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfloat[][] peaks = new float[ps.size()][3];\n\t\tfor (int i = 0; i < ps.size(); i++) {\n\t\t\tpeaks[i][0] = ps.get(i).MZ;\n\t\t\tpeaks[i][1] = ps.get(i).Int;\n\t\t\tpeaks[i][2] = ps.get(i).Tol;\n\t\t}\n\t\treturn peaks;\n\t}",
"private ArrayList<XYValue> sortArray(ArrayList<XYValue> array){\n /*\n //Sorts the xyValues in Ascending order to prepare them for the PointsGraphSeries<DataSet>\n */\n int factor = Integer.parseInt(String.valueOf(Math.round(Math.pow(array.size(),2))));\n int m = array.size()-1;\n int count = 0;\n Log.d(TAG, \"sortArray: Sorting the XYArray.\");\n\n while(true){\n m--;\n if(m <= 0){\n m = array.size() - 1;\n }\n Log.d(TAG, \"sortArray: m = \" + m);\n try{\n //print out the y entrys so we know what the order looks like\n //Log.d(TAG, \"sortArray: Order:\");\n //for(int n = 0;n < array.size();n++){\n //Log.d(TAG, \"sortArray: \" + array.get(n).getY());\n //}\n double tempY = array.get(m-1).getY();\n double tempX = array.get(m-1).getX();\n if(tempX > array.get(m).getX() ){\n array.get(m-1).setY(array.get(m).getY());\n array.get(m).setY(tempY);\n array.get(m-1).setX(array.get(m).getX());\n array.get(m).setX(tempX);\n }\n else if(tempY == array.get(m).getY()){\n count++;\n Log.d(TAG, \"sortArray: count = \" + count);\n }\n\n else if(array.get(m).getX() > array.get(m-1).getX()){\n count++;\n Log.d(TAG, \"sortArray: count = \" + count);\n }\n //break when factorial is done\n if(count == factor ){\n break;\n }\n }catch(ArrayIndexOutOfBoundsException e){\n Log.e(TAG, \"sortArray: ArrayIndexOutOfBoundsException. Need more than 1 data point to create Plot.\" +\n e.getMessage());\n break;\n }\n }\n return array;\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}",
"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 List<Point> neighboursFiltering(List<Point> points) {\n Point nearest = points.get(0);\n HeartDistance calculator = new HeartDistance();\n return points.stream().filter(p -> calculator.calculate(p,nearest) < NEIGHBOURS_THRESHOLD).collect(Collectors.toList());\n }",
"public List<Neighbor> getNearNeighborsInSample(double[] point) {\n return getNearNeighborsInSample(point, Double.POSITIVE_INFINITY);\n }",
"private TargetInformation findPeg(Mat image) {\r\n\t\tTargetInformation ret = new TargetInformation();\r\n\t\tret.targetingPeg = true;\r\n\t\t\r\n\t long[] xsums = sums(image, true);\r\n\t long[] ysums = sums(image, false);\r\n\t \r\n\t List<PeakLoc> ypeaks = findPeaks(ysums);\r\n\t List<PeakLoc> xpeaks = findPeaks(xsums);\r\n\t\t\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//vvvvvvvvvvvvvvvvvvv FUTURE YEARS LOOK HERE, THIS IS WHAT YOU WILL WANT TO REPLACE vvvvvvvvvvvvvvvvvvv//\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t \r\n\t // Target is only found if we have exactly 2 x peaks, representing both of the pieces of tape\r\n\t if ((xpeaks.size() == 2) && (ypeaks.size() > 0)){\r\n\t \tret.targetFound = true;\r\n\t \tret.x = (xpeaks.get(1).getStart() + xpeaks.get(0).getStop()) / 2;\r\n\t \tret.gap = xpeaks.get(1).getStart() - xpeaks.get(0).getStop();\r\n\t \tret.width = xpeaks.get(1).getStop() - xpeaks.get(0).getStart();\r\n\t \tret.height = ypeaks.get(0).getStop() - ypeaks.get(0).getStart();\r\n\t \tret.y = ypeaks.get(0).getStart() + ret.height/2;\r\n\t \tret.rightOfTarget = xpeaks.get(0).maxValue < xpeaks.get(1).maxValue;\r\n\t \t\r\n \t\tret.pixelsPerInch = ret.height / pegHeightInches;\r\n \t\t\r\n\t \tret.aimX = ret.x + cameraOffsetInches * ret.pixelsPerInch;\r\n\t \t\r\n\t \tret.correctionAngle = (double)((ret.aimX - image.cols() / 2)) / pixelsPerXDegree;\r\n\t }\r\n\t else\r\n\t {\r\n\t \tret.targetFound = false;\r\n\t }\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//^^^^^^^^^^^^^^^^^^^ FUTURE YEARS LOOK HERE, THIS IS WHAT YOU WILL WANT TO REPLACE ^^^^^^^^^^^^^^^^^^^//\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t \r\n\t return ret;\r\n\t}",
"public void getSeriesForPoints(){\n\n int lenght = cluster_polygon_coordinates.length;\n\n x_latitude = new Number[lenght];\n y_longitude = new Number[lenght];\n\n //x_latitude[lenght-1] = cluster_polygon_coordinates[0].x;\n //y_longitude[lenght-1] = cluster_polygon_coordinates[0].y;\n for (int i=0;i<lenght;i++) {\n\n x_latitude[i] = cluster_polygon_coordinates[i].x;\n y_longitude[i] = cluster_polygon_coordinates[i].y;\n// Log.d(TAG, Double.toString(cluster_polygon_coordinates[i].x));\n// Log.d(TAG, Double.toString(cluster_polygon_coordinates[i].y));\n// Log.d(TAG, Double.toString(cluster_polygon_coordinates[i].z));\n }\n\n }",
"public short[] getThresholdFromSliceofScanData(short[] data, int[] shape, int[] activePixels, int thresholdVal,\n\t\t\tint dimensionToTraverse, boolean isForward, short[] lookupTable) throws Exception {\n\t\t// assume dimensionToTraverse ==2\n\t\tif (shape.length != 3)\n\t\t\tthrow new Exception(\"Invalid shape\");\n\t\tshort[] res = null;\n\t\tif (dimensionToTraverse == 2) {\n\t\t\tif (shape[2] != lookupTable.length)\n\t\t\t\tthrow new Exception(\"shape[2] != lookupTable.length\");\n\t\t\tint sizeOfResult = shape[0] * shape[1];\n\t\t\tres = new short[sizeOfResult];\n\t\t\tArrays.fill(res, EDGE_POSITION_IF_PIXEL_MASKED_OUT);\n\t\t\tfor (int pixelInMask = 0; pixelInMask < sizeOfResult; pixelInMask++) {\n\t\t\t\tif (activePixels == null || activePixels[pixelInMask] == 1) {\n\t\t\t\t\tres[pixelInMask] = EDGE_POSITION_IF_ALL_BELOW_THRESHOLD;\n\t\t\t\t\tint numberPointsPerPixel = shape[dimensionToTraverse];\n\t\t\t\t\tfor (int iy = 0; iy < numberPointsPerPixel; iy++) {\n\t\t\t\t\t\tint pixel = isForward ? iy : numberPointsPerPixel - iy - 1;\n\t\t\t\t\t\tint val = data[pixel * sizeOfResult + pixelInMask];\n\t\t\t\t\t\tif (val >= thresholdVal) {\n\t\t\t\t\t\t\tif (iy == 0) {\n\t\t\t\t\t\t\t\t// all above\n\t\t\t\t\t\t\t\tres[pixelInMask] = EDGE_POSITION_IF_ALL_ABOVE_THRESHOLD;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tres[pixelInMask] = lookupTable[pixel];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (dimensionToTraverse == 0) {\n\t\t\tif (shape[0] != lookupTable.length)\n\t\t\t\tthrow new Exception(\"shape[0] != lookupTable.length\");\n\t\t\tint sizeOfResult = shape[1] * shape[2];\n\t\t\tres = new short[sizeOfResult];\n\t\t\tArrays.fill(res, EDGE_POSITION_IF_PIXEL_MASKED_OUT);\n\t\t\tint numberPointsPerPixel = shape[dimensionToTraverse];\n\t\t\t/*\n\t\t\t * for (int i = 0; i < shape[1]; i++) { for (int j = 0; j < shape[2]; j++) { int pixelInMask = i * shape[2]\n\t\t\t * + j;\n\t\t\t */for (int pixelInMask = 0; pixelInMask < sizeOfResult; pixelInMask++) {\n\n\t\t\t\tif (activePixels == null || activePixels[pixelInMask] == 1) {\n\t\t\t\t\tres[pixelInMask] = EDGE_POSITION_IF_ALL_BELOW_THRESHOLD;\n\t\t\t\t\tfor (int iy = 0; iy < numberPointsPerPixel; iy++) {\n\t\t\t\t\t\tint pixel = isForward ? iy : numberPointsPerPixel - iy - 1;\n\t\t\t\t\t\tint index = pixelInMask + pixel * sizeOfResult;\n\n\t\t\t\t\t\tint val = data[index];\n\t\t\t\t\t\tif (val >= thresholdVal) {\n\t\t\t\t\t\t\tif (iy == 0) {\n\t\t\t\t\t\t\t\t// all above\n\t\t\t\t\t\t\t\tres[pixelInMask] = EDGE_POSITION_IF_ALL_ABOVE_THRESHOLD;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tres[pixelInMask] = lookupTable[pixel];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t// }\n\t\t}\n\t\treturn res;\n\t}",
"public Point2D[] getPoint2DArray() { \n \n double x1=0; \n double y1=0; \n double x2=0; \n double y2=0; \n \n double x0; \n double y0; \n double x3; \n double y3; \n \n int samples_interval = Math.round(samples / (points.length-1)); \n Point2D[] points_return = new Point2D[samples]; \n int pos_return = 0; //we'll store the pointer in the points_return array here. \n //We iterate between the different given points, \n //calculating the Bezier curves between them \n for(int i=0; i < points.length-1; i++){ \n //the last period may have a different number of samples in order to fit the sample value \n if(i == points.length-2){ \n samples_interval = samples - (samples_interval*(points.length-2)); \n } \n x1=points[i].getX(); \n x2=points[i+1].getX(); \n y1=points[i].getY(); \n y2=points[i+1].getY(); \n if(i>0){ \n x0=points[i-1].getX(); \n y0=points[i-1].getY(); \n }else { \n x0 = x1 - Math.abs(x2 - x1); \n y0 = y1; \n } \n if(i < points.length -2){ \n x3=points[i+2].getX(); \n y3=points[i+2].getY(); \n } else { \n x3 = x1 + 2*Math.abs(x1 - x0); \n y3 = y1; \n } \n Point2D[] points_bezier = CalculateBezierCurve(x0,y0,x1,y1,x2,y2,x3,y3, samples_interval); \n //Fill the return array \n for(int j = 0 ; j < points_bezier.length; j++){ \n points_return[pos_return] = new Point2D.Double(points_bezier[j].getX(),points_bezier[j].getY()); \n pos_return++; \n } \n \n } \n \n\n return points_return; \n}",
"public int[] filterBySharpness(double threshold, String mode) throws IllegalArgumentException {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n int[] keep = new int[this.midpoints.length];\n Arrays.fill(keep, 1);\n\n if (mode.equals(\"upper\")) {\n for (int i=0; i<this.sharpness[0].length; i++) {\n double maxVal = Math.max(this.sharpness[0][i], this.sharpness[1][i]);\n if (maxVal > threshold) {\n keep[i] = 0;\n }\n }\n }\n else if (mode.equals(\"lower\")) {\n for (int i=0; i<this.sharpness[0].length; i++) {\n double minVal = Math.min(this.sharpness[0][i], this.sharpness[1][i]);\n if (minVal < threshold) {\n keep[i] = 0;\n }\n }\n }\n else {\n throw new IllegalArgumentException(\"Mode must either be lower or upper\");\n }\n for (int i=0; i<keep.length; i++) {\n if(keep[i] == 1) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }",
"private static final boolean isArrayValueAtIndexInsideOrInsideAdjacent(DataSet aDataSet, int i, int pointCount, double aMin, double aMax)\n {\n // If val at index in range, return true\n double val = aDataSet.getX(i);\n if (val >= aMin && val <= aMax)\n return true;\n\n // If val at next index in range, return true\n if (i+1 < pointCount)\n {\n double nextVal = aDataSet.getX(i + 1);\n if (val < aMin && nextVal >= aMin || val > aMax && nextVal <= aMax)\n return true;\n }\n\n // If val at previous index in range, return true\n if (i > 0)\n {\n double prevVal = aDataSet.getX(i - 1);\n if ( val < aMin && prevVal >= aMin || val > aMax && prevVal <= aMax)\n return true;\n }\n\n // Return false since nothing in range\n return false;\n }",
"private static List<Point> genererPointsAlea(int nbPoints) {\n /*List<Point> points = new ArrayList<>();\n Random rand = new Random(0);\n for(int i=0; i<nbPoints; i++) {\n Point p = new Point(rand.nextDouble(), rand.nextDouble());\n points.add(p);\n }\n return points;*/\n return null;\n }",
"private static List<Point> createConvergingDataset() {\r\n List<Point> data = new ArrayList<Point>();\r\n add(data, 1, 400);\r\n add(data, 5, 700);\r\n add(data, 10, 900);\r\n add(data, 15, 1000);\r\n add(data, 20, 1050);\r\n add(data, 25, 1060);\r\n add(data, 30, 1062);\r\n return data;\r\n }",
"private Point[] getPointsForAlignment(Gesture gesture)\n {\n Point[] points = gesture.Points;\n return PointSet.translateOffset(points, PointSet.centroid(points));\n }",
"public int maxPoints(Point[] points) {\n if (points.length == 1) return 1;\n int max = 0;\n for (int i = 0; i < points.length; i++) {\n Map<Double, Integer> counts = new HashMap<Double, Integer>();\n int result = 0;\n int same = 1;\n for (int j = i+1; j < points.length; j++) {\n int x = points[i].x - points[j].x;\n int y = points[i].y - points[j].y;\n\n if (x == 0 && y == 0) {\n same++;\n continue;\n }\n\n // 1.0 * 0 / -1 = -0.0, so need to convert it by + 0.0\n double slope = x == 0 ? Double.POSITIVE_INFINITY : 1.0 * y/x + 0.0;\n\n if (counts.containsKey(slope)) {\n counts.put(slope, counts.get(slope) + 1);\n } else {\n counts.put(slope, 1);\n }\n\n result = Math.max(result, counts.get(slope));\n }\n max = Math.max(result + same, max);\n }\n return max;\n }",
"private static int arrayDpHopper(int[] array) {\n\t\tint[] jumps = new int[array.length];\n\t\tif(array[0]==0||array.length==0){\n\t\t\treturn Integer.MAX_VALUE;\n\t\t}\n\t\tjumps[0]=0;\n\t\tfor(int i=1;i<array.length;i++){\n\t\t\tjumps[i]=Integer.MAX_VALUE;\n\t\t\tfor(int j=0;j<i;j++){\n\t\t\t\tif(i<=j + array[j] && jumps[j]!=Integer.MAX_VALUE){\n\t\t\t\t\tjumps[i] = arrayHopper.getMin(jumps[i],jumps[j]+1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn jumps[array.length-1];\n\t}",
"protected ISpectrum buildHighestPeaks(int numberRequested) {\n List<IPeak> byIntensity = new ArrayList<IPeak>(getPeaks());\n Collections.sort(byIntensity, PeakIntensityComparator.getInstance()); // sort by intensity\n List<IPeak> holder = new ArrayList<IPeak>();\n for (IPeak iPeak : byIntensity) {\n holder.add(iPeak);\n if (holder.size() >= numberRequested)\n break;\n }\n PeptideSpectrumMatch ret = new PeptideSpectrumMatch(this, holder);\n return ret;\n }",
"public static void findClosestPair(XYPoint points[], boolean print)\n\t{\n\t\tif(points.length==1){\n\t\t\treturn;\n\t\t}\n\t\tdouble mindist = INF;\n\t\tdouble dist = 0.0;\n\t\tint npoints=points.length;\n\t\tXYPoint point1 = new XYPoint();\n\t\tXYPoint point2 = new XYPoint();\n\t\tint i=0;\n\t\twhile(i<npoints-1){ //XYPoint[i]\n\t\t\t\tint k = i+1;\n\t\t\t\twhile (k<npoints){ //XYPoint[j]\n\t\t\t\t\tdist=points[i].dist(points[k]);\n\t\t\t\t\tif(dist<mindist){\n\t\t\t\t\t\tmindist=dist;\n\t\t\t\t\t\tpoint1=points[i];\n\t\t\t\t\t\tpoint2=points[k];\n\t\t\t\t\t}\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t}\n\t\tif (print){\n\t\t\tSystem.out.println(\"NAIVE \" + point1+\" \"+point2+\" \"+mindist);\n\t\t}\n\n\t}",
"public int[] getPCARefIndeces(float[][][] classRef) {\n\t\t\n\t\t// Assuming 30 points for now:\n\t\t// Reshape the input array so that we have all examples for each of the 30 points\n\t\t// in one array\n\t\tfloat[][][] temp = new float[30][classRef.length][3];\n\t\tfor(int i = 0; i < classRef.length; i++) { // For each writer\n\t\t\tfor(int j = 0; j < classRef[i].length; j++) { // For all of their points\n\t\t\t\ttemp[j][i][0] = classRef[i][j][0];\n\t\t\t\ttemp[j][i][1] = classRef[i][j][1];\n\t\t\t\ttemp[j][i][2] = classRef[i][j][2];\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Find the eigenvalues of each set of points (hardcoded again)\n\t\tdouble[] maxEVals = new double[30];\n\t\tfor(int i = 0; i < temp.length; i++) {\n\t\t\tEigenvalueDecomposition eig = getPCs(temp[i]);\n\t\t\tdouble[] tempEVals = eig.getRealEigenvalues();\n\t\t\tdouble variance = Math.abs(tempEVals[0]) + Math.abs(tempEVals[1]);\n\t\t\tmaxEVals[i] = variance;\n\t\t}\n\n\t\t// Sort the array and take the 20 first points = the ones with the lowest combined eigenvalues\n\t\tdouble[] sortMaxVals = maxEVals.clone();\n\t\tArrays.sort(sortMaxVals);\n\t\tdouble[] importantEigVals = Arrays.copyOfRange(sortMaxVals, 0, 20);\n\t\t\n\t\t// Find the 20 points in the original array so that we know which indices to return\n\t\tint[] importantIndeces = new int[importantEigVals.length];\n\t\tfor(int j = 0; j < importantEigVals.length; j++) {\n\t\t\tfor(int i = 0; i < maxEVals.length; i++) {\n\t\t\t\tif(importantEigVals[j] == maxEVals[i]) {\n\t\t\t\t\timportantIndeces[j] = i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Sort the indices again to be able to use them properly\n\t\tArrays.sort(importantIndeces);\n\n\t\treturn importantIndeces;\n\t}"
] | [
"0.67366964",
"0.66213226",
"0.6564027",
"0.6445502",
"0.6407722",
"0.6400137",
"0.629662",
"0.6270991",
"0.62595904",
"0.62043685",
"0.5853016",
"0.5768182",
"0.56308573",
"0.55531245",
"0.54965454",
"0.54868305",
"0.5478318",
"0.54316294",
"0.540876",
"0.5399176",
"0.53442514",
"0.53142256",
"0.5276462",
"0.524291",
"0.5239132",
"0.5237035",
"0.5169638",
"0.5159724",
"0.5150196",
"0.51023877",
"0.5089235",
"0.5034233",
"0.5014939",
"0.5014551",
"0.4965022",
"0.49594095",
"0.49475968",
"0.49441928",
"0.49330515",
"0.49258548",
"0.49233553",
"0.4912844",
"0.49118495",
"0.4897712",
"0.48600096",
"0.48565394",
"0.4837449",
"0.4821705",
"0.48123306",
"0.48106822",
"0.4806245",
"0.47918913",
"0.4772562",
"0.4771384",
"0.47562766",
"0.46785447",
"0.46736422",
"0.46696818",
"0.4665016",
"0.46630824",
"0.46621534",
"0.46417022",
"0.46382755",
"0.46328336",
"0.4623558",
"0.46187726",
"0.46139228",
"0.45988545",
"0.45959887",
"0.45894235",
"0.4580057",
"0.4576744",
"0.45745355",
"0.4567348",
"0.45525885",
"0.4543326",
"0.45322815",
"0.45152766",
"0.4515218",
"0.45117617",
"0.45047396",
"0.4490295",
"0.4487437",
"0.44854033",
"0.44811076",
"0.4479619",
"0.4475316",
"0.44721848",
"0.44677925",
"0.4452031",
"0.44468638",
"0.44398397",
"0.44372657",
"0.44273868",
"0.44273287",
"0.44136345",
"0.43968812",
"0.43889362",
"0.4387157",
"0.43796438"
] | 0.7029885 | 0 |
Constructs a Point object. | public Point(double x, double y) {
this.x = x;
this.y = y;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Point createPoint();",
"public Point()\n\t{ \n\t\t// Instantiate default properties\n\t\tx = 0;\n\t\ty = 0;\n\t}",
"public Point(Point point) {\n this.x = point.x;\n this.y = point.y;\n }",
"public Point() {\n }",
"public Point() {\n }",
"public Point(Point point) {\n super(point.getReferenceX(), point.getReferenceY());\n this.x = point.x;\n this.y = point.y;\n this.setHeight(point.getHeight());\n }",
"public Point(){\n this.x = 0;\n this.y = 0;\n }",
"public Point(Point p)\r\n\t{\r\n\t\tx = p.x;\r\n\t\ty = p.y;\r\n\t}",
"Point(int x_, int y_){\n x = x_;\n y = y_;\n }",
"public Point(Point obj)\n\t{\n\t\t// Instantiate properties with parameter values \n\t\tthis.x = obj.x;\t\t\t\t\t\t\t\t\t\t\t\t// Shallow copy point's x-coordinate\t\n\t\tthis.y = obj.y;\t\t\t\t\t\t\t\t\t\t\t\t// Shallow copy point's y-coordinate\n\t}",
"public Point(Vector position) {\n\t\tthis(position, 5.0);\n\t}",
"Point() {\n this.x = 0;\n this.y = 0;\n }",
"public Point(int x, int y)\n\t{\n\t\t// Instantiate properties with parameter values \n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}",
"public Point(double x, double y){\n this.x = x;\n this.y = y;\n }",
"public MyPoint1 (double x, double y) {}",
"public Point(double x, double y) {\r\n this.x = x;\r\n this.y = y;\r\n }",
"public Point() {\n this.x = Math.random();\n this.y = Math.random();\n }",
"public Point(double x, double y) {\r\n\t\t//Constructors\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}",
"public Point(double x, double y) {\n this.x = x;\n this.y = y;\n }",
"public Point(double x, double y) {\n this.x = x;\n this.y = y;\n }",
"public Point(double x, double y) {\n this.x = x;\n this.y = y;\n }",
"public Point(double x, double y) {\n this.x = x;\n this.y = y;\n }",
"public Point(double x, double y) {\n this.x = x;\n this.y = y;\n }",
"Point() {\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t}",
"public Point() {\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t}",
"public Point(int x, int y){\n this.x = x;\n this.y = y;\n }",
"public Point(double x, double y) {\n this.xPosition = x;\n this.yPosition = y;\n }",
"public Point(int x, int y) {\r\n this.x = x;\r\n this.y = y;\r\n }",
"public Point(int x, int y) {\n this.x = x;\n this.y = y;\n }",
"public Point(double x, double y){\n\t\tsuper();\n\t\tthis.x = x; \n\t\tthis.y = y;\n\t}",
"Point()\n\t{\n\t\t//default point\n\t\t//this = properties of this object we are working with\n\t\tthis.x=0;\n\t\tthis.y=0;\n\t\tcountOfPoints++;\n\t}",
"public Point(int x, int y)\r\n\t{\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}",
"public Point(int x, int y) {\n /* DO NOT MODIFY */\n this.x = x;\n this.y = y;\n }",
"public Point(int x, int y) {\n /* DO NOT MODIFY */\n this.x = x;\n this.y = y;\n }",
"public Point(int x, int y) {\n /* DO NOT MODIFY */\n this.x = x;\n this.y = y;\n }",
"public Point()\r\n\t{\r\n\t\tx = y = 0;\r\n\t}",
"public Point(double a, double b) {\n this.x = a;\n this.y = b;\n }",
"public Point(int x, int y) {\r\n\t\tthis.x = x;\tthis.y = y;\r\n\t}",
"public Point(float x, float y)\n {\n this.x = x;\n this.y = y;\n }",
"public static Point createPoint(double x, double y) {\n Point point = new Point();\n point.setX(x);\n point.setY(y);\n\n return point;\n }",
"public Point(int x, int y){\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}",
"public Point(String name, int x, int y) {\n setName(name);\n setX(x);\n setY(y);\n }",
"public Point(int x, int y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}",
"public Point(int x, int y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}",
"public Point(int x, int y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}",
"public Point(int x, int y) {\n\t\tsuper();\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}",
"public Point(int x, int y) {\n /* DO NOT MODIFY */\n this.x = x;\n this.y = y;\n SLOPE_ORDER = new SlopeOrder();\n }",
"public Point(int x, int y){\n\t\tthis.x=x; this.y=y;\n\t}",
"Point(Double x, Double y) {\n\t\tthis.setX(x);\n\t\tthis.setY(y);\n\t}",
"public Point(int y, int x)\n\t\t{\n\t\t\tthis.y = y;\n\t\t\tthis.x = x;\n\t\t}",
"public Point(int x,int y){\r\n\t\tthis.pos = x;\r\n\t\tthis.id = y;\r\n\t}",
"private GoodPoint(double x, double y) {\n this.x = x;\n this.y = y;\n }",
"public Point(double x, double y) {\r\n this.x = x;\r\n this.y = y;\r\n this.c = Color.COLORLESS;\r\n }",
"public Point(double xCoordinate, double yCoordinate){\r\n\t\tthis.xCoordinate = xCoordinate;\r\n\t\tthis.yCoordinate = yCoordinate;\r\n\t}",
"public MyPoint1(double x, int y) {\n this.x = x;\n this.y = y;\n }",
"private Point(int param, double value) {\r\n this(param, value, false);\r\n }",
"protected Point(double x, double y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}",
"public GeoPoint(Geometry geometry, Point3D point) {\n\tsuper();\n\tthis.geometry = geometry;\n\tthis.point = point;\n}",
"private Point(Point p) {\n\t\tthis.name = p.name;\n\t\tthis.position = p.position.copy();\n\t\tthis.collisionRadius = p.collisionRadius;\n\t}",
"public Point(int x, int y, Color color) {\r\n this.x = x;\r\n this.y = y;\r\n this.color = color;\r\n }",
"public PrecisePoint() {\n }",
"public Point(int x, int y) {\r\n /* DO NOT MODIFY */\r\n this.x = x;\r\n this.y = y;\r\n\t\tSLOPE_ORDER = new SlopeOrderComparator(this);\r\n }",
"public Point(int xcoord, int ycoord)\n\t{\n\t\tthis.x= xcoord;\n\t\tthis.y= ycoord;\n\t\tcountOfPoints++;\n\t}",
"public PrecisePoint(double x, double y) {\n this.x = x;\n this.y = y;\n }",
"private void CreaCoordinate(){\n \n this.punto = new Point(80, 80);\n \n }",
"PointDouble() {\n x = y = 0.0;\n }",
"public Vector(Point point) {\n\t\tthis(point.x, point.y);\n\t}",
"public PointImpl( CoordinateSystem crs ) {\n super( crs );\n position = new PositionImpl();\n empty = true;\n centroid = this;\n }",
"public Point( Double x, Double y, Double z ) {\n this.x = x;\n this.y = y;\n this.z = z;\n\n keepExtent();\n }",
"public Point(Point other) {\n super(other);\n this.x = other.x;\n this.y = other.y;\n this.activity = other.activity;\n this.frame = other.frame;\n this.trajectoryid = other.trajectoryid;\n }",
"public PointC(double x, double y) {\n this.x = x;\n this.y = y;\n }",
"public Point(float x, float y, int id) {\r\n super(x, y, 0);\r\n this.xf = x;\r\n this.yf = y;\r\n this.x = x;\r\n this.y = y;\r\n this.z = 0;\r\n this.id = id;\r\n }",
"protected Point(final Number xCoordinate, final Number yCoordinate) {\n this.xCoordinate = xCoordinate;\n this.yCoordinate = yCoordinate;\n }",
"public GeoPoint(double lat, double lon){\n this(lat, lon, -1d);\n }",
"public T setPoint(float x, float y) {\n this.startX = x;\n this.startY = y;\n return self();\n }",
"public Short2DPoint() {\n this(0,0);\n }",
"public Point2d() {\r\n\t // Call two-argument constructor and specify the origin.\r\n\t\t this(0, 0);\r\n\t\t System.out.println(\"Point2d default initiializing\");\r\n\t }",
"public PointImpl( double x, double y, CoordinateSystem crs ) {\n super( crs );\n position = new PositionImpl( x, y );\n empty = false;\n centroid = this;\n }",
"public Point2D(Point2D point){\n \n //on peut faire point.x et point.y puisqu'on est dans la classe\n this.x = point.x;\n this.y = point.y;\n }",
"public static Points createEntity() {\n Points points = new Points()\n .date(DEFAULT_DATE)\n .exercise(DEFAULT_EXERCISE)\n .meals(DEFAULT_MEALS)\n .alcohol(DEFAULT_ALCOHOL)\n .notes(DEFAULT_NOTES);\n return points;\n }",
"public XYPointFloat()\r\n\t{\r\n\t\tthis(0, 0);\r\n\t}",
"private Point(int param, double value, boolean measured) {\r\n this.param = param;\r\n this.value = value;\r\n this.measured = measured;\r\n }",
"public FieldPoint(double x, double y) {\n setX(x);\n setY(y);\n }",
"public Point() {\n\t\tthis.hasSrsName = false;\n\t}",
"public static Point randomPoint() {\r\n\t\tString n = \"\" + (char) (65 + rand.nextInt(26));\r\n\t\tint x = rand.nextInt(11);\r\n\t\tint y = rand.nextInt(11);\r\n\t\treturn new Point(n, x, y);\r\n\t}",
"public point(int a, int b, int c) {\n\t\t\t\tx = a;\n\t\t\t\ty = b;\n\t\t\t\tz = c;\n\t\t\t}",
"public PointRecord(){\n \n }",
"public PointImpl( double x, double y, double z, CoordinateSystem crs ) {\n super( crs );\n position = new PositionImpl( x, y, z );\n empty = false;\n centroid = this;\n }",
"public PointItem(int x, int y) {\r\n\r\n\t\tthis.x = (int) x;\r\n\t\tthis.y = (int) y;\r\n\t\t\r\n\r\n\t}",
"public Ponto(int x, int y){\n this.x = x;\n this.y = y;\n }",
"public static GeoPoint create(double latitude, double longitude) {\n return new GeoPoint().setCoordinates(Arrays.asList(longitude, latitude));\n }",
"public GeoPoint(int latitude, int longitude) {\n this.latitude = latitude;\n this.longitude = longitude;\n checkRep();\n }",
"public StsPoint2D()\n\t{\n\t}",
"public Point(String str) {\n String[] parsed = str.substring(1,-1).split(\" \");\n setName(parsed[0]);\n setX(Integer.parseInt(parsed[1]));\n setY(Integer.parseInt(parsed[2]));\n }",
"public Position(Position p_p)\n {\n this.x = p_p.x;\n this.y = p_p.y;\n }",
"public static Point at(Coordinate latitude, Coordinate longitude) {\n return new Point(latitude, longitude);\n }",
"public FieldPoint() {\n setX( DEFAULT_VALUE );\n setY( DEFAULT_VALUE );\n }",
"public FieldPoint(FieldPoint fieldPoint) {\n setX( fieldPoint.getX() );\n setY( fieldPoint.getY() );\n }",
"Point clone ();",
"public Point(float x, float y, float z, int id) {\r\n super(x, y, z);\r\n this.xf = Float.POSITIVE_INFINITY;\r\n this.yf = Float.POSITIVE_INFINITY;\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n this.id = id;\r\n }"
] | [
"0.79463273",
"0.7942856",
"0.79105014",
"0.7857765",
"0.7857765",
"0.7773004",
"0.7714799",
"0.77133447",
"0.7651761",
"0.75923944",
"0.7570238",
"0.7560362",
"0.7554064",
"0.7498351",
"0.74981534",
"0.7481047",
"0.74668914",
"0.74614036",
"0.7461048",
"0.7461048",
"0.7461048",
"0.7461048",
"0.7461048",
"0.7418088",
"0.73964006",
"0.73821497",
"0.73753184",
"0.737238",
"0.73625684",
"0.73595244",
"0.73484683",
"0.73100954",
"0.72985595",
"0.72985595",
"0.72985595",
"0.72768766",
"0.72387254",
"0.72345334",
"0.7228942",
"0.7207612",
"0.7187891",
"0.71872383",
"0.71806484",
"0.71806484",
"0.71806484",
"0.7176552",
"0.71764344",
"0.7164618",
"0.71482664",
"0.71355313",
"0.7063603",
"0.7027061",
"0.69419056",
"0.6935543",
"0.6929655",
"0.6921965",
"0.6921726",
"0.68812907",
"0.68782324",
"0.68708354",
"0.68642503",
"0.6802525",
"0.66583955",
"0.6642108",
"0.6607903",
"0.66063833",
"0.66060317",
"0.660349",
"0.6589763",
"0.6583239",
"0.65508157",
"0.65381044",
"0.65313834",
"0.6508895",
"0.650301",
"0.64935553",
"0.6493125",
"0.64855486",
"0.647904",
"0.64715964",
"0.64580214",
"0.6431631",
"0.64294916",
"0.6429261",
"0.64283574",
"0.64053655",
"0.6404278",
"0.6403915",
"0.6391217",
"0.63781226",
"0.6369724",
"0.6362236",
"0.6355141",
"0.63249487",
"0.63067925",
"0.628938",
"0.62728155",
"0.62432414",
"0.6235642",
"0.62222475"
] | 0.7188986 | 40 |
m_newHistoryView = System.currentTimeMillis(); searchEventList(m_origHistoryView, m_newHistoryView, AVAPIs.AVIOCTRL_EVENT_ALL); | private void initEventList() {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.add(Calendar.MINUTE, -1 * 60 * 12);
startTime = calendar.getTimeInMillis();
stopTime = System.currentTimeMillis();
mSearchType = 0;
eventType = AVIOCTRLDEFs.AVIOCTRL_EVENT_ALL;
searchEventList(startTime, stopTime, eventType, mCameraChannel);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"com.google.speech.logs.timeline.InputEvent.Event getEvent();",
"@DISPID(7) //= 0x7. The runtime will prefer the VTID if present\r\n @VTID(14)\r\n visiotool.IVEventList eventList();",
"public void openHistory() {\n usingHistoryScreen = true;\n myActivity.setContentView(R.layout.history);\n Button historyButtonToGame = myActivity.findViewById(R.id.button8);\n TextView historyText = myActivity.findViewById(R.id.textView46);\n historyText.setText(state.getHistory());\n historyText.setMovementMethod(new ScrollingMovementMethod());\n gui.invalidate();\n historyButtonToGame.setOnClickListener(\n new View.OnClickListener() {\n public void onClick(View v) {\n ShogiHumanPlayer.this.setAsGui(myActivity);\n usingHistoryScreen = false;\n if (state != null) {\n receiveInfo(state);\n }\n }\n });\n }",
"public void viewPerfHistory(View view) {\n \tPerformanceResults history = new PerformanceResults(PerfMeasure.imei);\n \talertbox(\"Performance History\", history.printList(history.getHistory()));\n }",
"protected abstract void createHistoryEvents();",
"private void viewEvents() {\n ReferenceFrame frame = selectFrame(\"What frame would you like to view the events from?\");\n List<Event> transformedEvents = new ArrayList<>();\n for (Event event: world.getEvents()) {\n transformedEvents.add(event.lorentzTransform(frame));\n }\n for (Event event: transformedEvents) {\n System.out.println(event.getName() + \" occurs at t = \" + event.getTime() + \" and x = \" + event.getX());\n }\n }",
"void showPreviousEventsLoadingWheel();",
"public void onVideoStarted () {}",
"private void findViews() {\n tv_loading_netspeed = findViewById(R.id.tv_loading_netspeed);\n ll_loading = findViewById(R.id.ll_loading);\n media_controller = findViewById(R.id.media_controller);\n llTop = (LinearLayout) findViewById(R.id.ll_top);\n tvName = (TextView) findViewById(R.id.tv_name);\n ivBattery = (ImageView) findViewById(R.id.iv_battery);\n tvSystemItem = (TextView) findViewById(R.id.tv_system_item);\n btnVoice = (Button) findViewById(R.id.btn_voice);\n btnSwichPlayer = (Button) findViewById(R.id.btn_swich_player);\n llBottom = (LinearLayout) findViewById(R.id.ll_bottom);\n tvCurrentItem = (TextView) findViewById(R.id.tv_current_item);\n tvDuration = (TextView) findViewById(R.id.tv_duration);\n btnExit = (Button) findViewById(R.id.btn_exit);\n btnPre = (Button) findViewById(R.id.btn_pre);\n btnVideoStartPause = (Button) findViewById(R.id.btn_video_start_pause);\n btnVideoNext = (Button) findViewById(R.id.btn_video_next);\n btnVideoVideoSwitchScree = (Button) findViewById(R.id.btn_video_video_switch_scree);\n seekbarVideo = findViewById(R.id.seekbarVideo);\n seekbarAudio = findViewById(R.id.seekbarAudio);\n ll_buffer = findViewById(R.id.ll_buffer);\n tv_netspeed = findViewById(R.id.tv_netspeed);\n btnVoice.setOnClickListener(this);\n btnSwichPlayer.setOnClickListener(this);\n btnExit.setOnClickListener(this);\n btnPre.setOnClickListener(this);\n btnVideoStartPause.setOnClickListener(this);\n btnVideoNext.setOnClickListener(this);\n btnVideoVideoSwitchScree.setOnClickListener(this);\n seekbarVideo.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n @Override\n public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n if (fromUser) {\n videoView.seekTo(progress);\n }\n }\n\n @Override\n public void onStartTrackingTouch(SeekBar seekBar) {\n handler.removeMessages(HIDE_MEDIACONTROLLER);\n }\n\n @Override\n public void onStopTrackingTouch(SeekBar seekBar) {\n handler.sendEmptyMessageDelayed(HIDE_MEDIACONTROLLER, 5000);\n }\n\n\n });\n\n\n }",
"public void onUpdatedPlaylist() {\n setCurrentTrack();\n //this was implemented so this device could have a view of the playlist\n }",
"private void updateHistory() {\n if(isHistoryUpdated == false) {\n preloader.launch();\n final Timer networkTimeoutTimer = new Timer();\n networkTimeoutTimer.schedule(new TimerTask() {\n @Override\n public void run() {\n ChatActivity.this.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n preloader.done();\n showNetWorkAlertDialog();\n }\n });\n }\n }, 15000);\n textViewTop.setText(currDialogObject.name);\n ImageLoader.getInstance().displayImage(currDialogObject.avatarUrl, imageAvatar);\n int dialogId = currDialogObject.dialogId;\n SocketWorker.getInstance().getDialogHistory(dialogId, new IOAcknowledge() {\n @Override\n public void ack(Object... args) {\n networkTimeoutTimer.cancel();\n final JSONObject ackJson = (JSONObject) args[0];\n ChatActivity.this.runOnUiThread(new Runnable() {\n public void run() {\n if (GlobalHelper.successStatusFromJson(ackJson, true, null)) {\n parseHistory(ackJson);\n\n } else {\n networkTimeoutTimer.cancel();\n preloader.cancel(getString(R.string.error), getString(R.string.message_network_error));\n }\n }\n });\n }\n });\n }\n\t}",
"void onGetMobileHistoryCursor(Cursor cursor);",
"@Override\r\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tmVideoContrl.seekTo((int) now);\r\n\t\t\t\t\t\tUtils.printLog(TAG, \"mVideoContrl.seekTo now =\"+now);//nicy\r\n\t\t\t\t\t}",
"@Override\n public void onVideoStarted() {\n }",
"protected void mo5608a() {\n super.mo5608a();\n if (getVideoView() != null) {\n getVideoView().getEventBus().m5029a(this.f5897d, this.f5895b, this.f5896c);\n }\n }",
"@Override\n protected void initializeEventList()\n {\n }",
"@Override\n public void timeChanged(MediaPlayer mp, long l) {\n }",
"void track();",
"@UiHandler(\"history\")\n public void showHistory (ClickEvent event){\n \tshowHistory();\n }",
"public void beforeNotifyScenesActiveVideoChanged(long j) {\n }",
"public void showHistorySwitchAction() {\n\t\tanimalsListPanel.switchToPast();\n\t}",
"@Override\n protected void initParams() {\n mVideoList.clear();\n mVideoList.addAll((Collection<? extends GetPlaybackCameraListResult.VideoEntity>) getArguments().getSerializable(\"videoList\"));\n mWorkoutId = getArguments().getInt(\"workoutid\");\n mOwnerId = getArguments().getInt(\"userid\");\n if (mVideoList.size() > 0) {\n mVideoNoneLl.setVisibility(View.GONE);\n }\n //初始化列表\n mAdapter = new HistoryVideoAdapter(mContext, mVideoList);\n mVideoRV.setAdapter(mAdapter);\n LinearLayoutManager manager = new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false);\n mVideoRV.setLayoutManager(manager);\n mVideoRV.addOnScrollListener(new RecyclerView.OnScrollListener() {\n @Override\n public void onScrollStateChanged(RecyclerView recyclerView, int newState) {\n super.onScrollStateChanged(recyclerView, newState);\n if (newState == RecyclerView.SCROLL_STATE_IDLE) {\n mAdapter.highlightItem(getMiddlePosition());\n mCurrPos = getMiddlePosition() - 2;\n EventBus.getDefault().post(new EventUpdateVideoPos(mCurrPos));\n //将位置移动到中间位置\n ((LinearLayoutManager) recyclerView.getLayoutManager()).scrollToPositionWithOffset(getScrollPosition(), 0);\n mSelectV.setBackgroundResource(R.drawable.bg_history_video_selection);\n } else {\n mSelectV.setBackgroundResource(R.drawable.bg_history_video_selection_scroll);\n }\n }\n\n @Override\n public void onScrolled(RecyclerView recyclerView, int dx, int dy) {\n// mCurrPos = (int) (getScrollPosition()/mAdapter.getItemWidth()) - 2;\n }\n });\n mAdapter.setOnItemClickListener(new HistoryVideoAdapter.MyItemClickListener() {\n @Override\n public void onItemClick(int postion) {\n mAdapter.highlightItem(getMiddlePosition());\n updateHighlightPos(postion);\n mCurrPos = postion - 2;\n EventBus.getDefault().post(new EventUpdateVideoPos(postion - 2));\n }\n });\n// updateHighlightPos((mVideoList.size() / 2 + 2));\n }",
"public void reloadVideoDevices();",
"@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tUtils.printLog(TAG, \"onCreate start 20160621\");\r\n\t\tresolver = getContentResolver();\r\n\t\tsetContentView(R.layout.video_player);\r\n\t\t\r\n\t\tmAmanager = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);\r\n\t\tsoundManager = TTvSoundManager.getInstance(this);\r\n\t\tmPicmanager = TTvPictureManager.getInstance(this);\r\n\t\tmTvmanager = TvManager.getInstance(this);\r\n\t\tmTTvmanager = TTvManager.getInstance(this);\r\n\t\tapplication = (MediaPlayerApplication) getApplication();\r\n\t\t\r\n\t\t\r\n\t\tmTTvmanager.addHandler(setSourceHandler, TTvUtils.TV_HANDLER_INDEX_TV_SET_SOURCE);\r\n\t\t\r\n\t\t// 切信源\r\n\t\tEnTCLInputSource curSource = TTvCommonManager.getInstance(this).getCurrentInputSource();\r\n\r\n\t\tUtils.printLog(TAG, \"onCreate curSource==\" + curSource);\r\n\t\tif (curSource != EnTCLInputSource.EN_TCL_STORAGE) {\r\n//\t\t\tTTvCommonManager.getInstance(this).setInputSource(EnTCLInputSource.EN_TCL_STORAGE);\r\n\t\t\tTTvCommonManager.getInstance(this).setInputSource(EnTCLInputSource.EN_TCL_STORAGE,true);\r\n\t\t\tUtils.printLog(TAG, \"setInputSource EN_TCL_STORAGE 1\");\r\n\t\t}else{\r\n\t\t\tisSourceChanged = true;\r\n\t\t\tUtils.printLog(TAG, \"InputSource EN_TCL_STORAGE 2\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\r\n\t\tTDeviceInfo devinfo = TDeviceInfo.getInstance();\r\n\t\tclienttype = devinfo.getClientType(devinfo.getProjectID());\r\n\t\tUtils.printLog(TAG, \"clienttype is \" + clienttype);\r\n\t\tif (clienttype != null) {\r\n\t\t\tsplitArrayStrings = clienttype.split(\"-\");\r\n\t\t}\r\n\r\n\t\tif (!getPlayList(getIntent())) {\r\n\t\t\texitPlayforNoPlayList();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t/***先获取参数,确认是否启动极简播放器后,再show loading**/\r\n//\t\tshowWatingDialog(isSimple);\r\n\t\tif (mCurrIndex < 0) {\r\n\t\t\tmCurrIndex = 0;\r\n\t\t}\r\n\t\tUtils.printPlayList(mList);\r\n\t\tseekBarPopWindow = new SeekBarPopWindow(this, mMediaHanler);\r\n\t\tpopWindow = new NotePopupWindow(this, mMediaHanler);\r\n\t\tfindView();\r\n\t\tmVideoContrl = new IVideoPlayControlHandler(this);\r\n\t\tmVideoContrl.registerCallback(mCallback);\r\n\t\tapplication.setVideoContrl(mVideoContrl);\r\n\t\tmBookMark = new BookMarkDB(this);\r\n\t\tmSurfaceView = (SurfaceView) this.findViewById(R.id.surfaceView);\r\n\t\tholder = mSurfaceView.getHolder();\r\n\t\tholder.addCallback(mVideoContrl);\r\n\t\tholder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);\r\n\t\tmTime = new Timer();\r\n\t\tmTime.schedule(mTimerTask, 0, 1000);\r\n\t\t//startPlayEventTimer();\r\n\t\tIntentFilter intentFilter2 = new IntentFilter();\r\n\t\tintentFilter2.addAction(ConnectivityManager.CONNECTIVITY_ACTION);\r\n\t\tthis.registerReceiver(mConnectionChangeReceiver, intentFilter2);\r\n\r\n\t\tIntentFilter intentFilter3 = new IntentFilter();\r\n//\t\tintentFilter3.addAction(VideoPlayerUIConst.COLLECTION_OPERATE_DONE);\r\n\t\tintentFilter3.addAction(VideoPlayerUIConst.ATV_OSD_OPEN);\r\n\t\tintentFilter3.addAction(CommonConst.CLOSE_VIDEO_PLAY);\r\n\t\tintentFilter3.addAction(CommonConst.HOME_PRESSED);\r\n\t\tintentFilter3.addAction(CommonConst.STR_PORWER_CHANGE);\r\n\t\tintentFilter3.addAction(CommonConst.TV_PRESSED);\r\n\t\tintentFilter3.addAction(CommonConst.CHANGE_SOURCE_PRESSED);\r\n\t\tintentFilter3.addAction(Intent.ACTION_SHUTDOWN); \r\n\t\tintentFilter3.addAction(CommonConst.EXIT_3D);\r\n\t\tintentFilter3.addAction(CommonConst.HISTORYRECORD);\r\n\t\tintentFilter3.addAction(CommonConst.SOURCE_CHANGEandVOICEASS);\r\n\t\tintentFilter3.addAction(CommonConst.LanuageChange);\r\n\t\tintentFilter3.addAction(CommonConst.VIDEO_HDR_HLG_BROADCAST);\r\n\t\tthis.registerReceiver(myCollectionBroadcastReceiver, intentFilter3);\r\n\r\n\t\tIntentFilter intentFilter4 = new IntentFilter();\r\n\t\tintentFilter4.addAction(CommonConst.VOICE_CONTROL);\r\n\t\tthis.registerReceiver(mVoiceReceiver, intentFilter4);\r\n\t\tsendStopWidgetMusicBroadcast();\r\n\r\n\t\tif (isDMR) {\r\n\t\t\tmVideoContrl.setPlayType(VideoPlayerContrlConsts.MEDIA_SEQUENCE_PLAY);\r\n\t\t} else {\r\n\t\t\tmVideoContrl.setPlayType(getSavedPlayerType());\r\n\t\t}\r\n\r\n\t\tlistDialog = new VideoFileListDialog(this, mList, application);\r\n\t\tlistDialog.setCallback(this);\r\n\r\n\t\tmenuDialog = new VideoMenuSettingDialog(this, application);\r\n\t\tmenuDialog.setCallback(this);\r\n\t\t//设置屏幕保持唤醒\r\n\t\tPowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);\r\n\t\twakeLock = powerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, \"VideoPlayer\");\r\n\t\t//退出屏保 \r\n\t\tint sysVersion = VERSION.SDK_INT; \r\n\t\tLog.v(TAG, \"onCreate sysVersion= \"+sysVersion);\r\n\t\tif (sysVersion>=17) {\r\n\t\t\t//退出屏保 minSdkVersion=\"17\"\r\n\t\t\tpowerManager.wakeUp(SystemClock.uptimeMillis());\r\n\t\t\tUtils.printLog(TAG, \"powerManager.wakeUp\");\r\n\t\t}\r\n\t\t\r\n\t\tint versionCode = Utils.getVersionCodeFromAPP(this);\r\n\t\tUtils.printLog(TAG, \"onCreate end ,versionCode=\"+versionCode);\r\n\t}",
"@Override\n public boolean onQueryTextChange(String newText) {\n currentSearchData = new ArrayList<String>();\n getCurrentSearchData(newText);\n RelativeLayout searchDataRelativeView = (RelativeLayout) findViewById(R.id.search_relative_view);\n searchDataRelativeView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n\n }\n });\n showCurrentData();\n System.out.println(\"\");\n return false;\n }",
"EventChannel refresh();",
"public void handleRecButtonOnPressed() {\n ((AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE)).setStreamMute(AudioManager.STREAM_SYSTEM, true);\n ((AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE)).setStreamMute(AudioManager.STREAM_MUSIC, true);\n ((AudioManager) AppDelegate.getAppContext().getSystemService(Context.AUDIO_SERVICE)).setStreamMute(AudioManager.STREAM_RING, true);\n AudioManager audioMgr = ((AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE));\n\n cameraView.setVisibility(View.VISIBLE);\n mapView.getView().setVisibility(View.GONE);\n //updateMessage();\n if (timerCounter != null) {\n timerCounter.cancel();\n timerCounter = null;\n }\n\n if (isCameraRecording) {\n\n isCameraRecording = false;\n mStartRecordingButton.setChecked(false);\n mTextViewInfoAboutVideoStreaming.setVisibility(View.GONE);\n disableAuthorityAlertedText();\n\n cameraView.stopRecording();\n\n // Control view group\n cameraView.setVisibility(View.VISIBLE);\n mapView.getView().setVisibility(View.GONE);\n\n toolBarTitle.setText(dateFormat.format(new Date(userPreferences.recordTime() * 1000)));\n handler.removeCallbacksAndMessages(null);\n handler.removeCallbacks(counterMessage);\n counterMessage = null;\n\n //VIDEO FINISHING ALERT\n CommonAlertDialog dialog = new CommonAlertDialog(getActivity(), mAlertDialogButtonClickListerer); // Setting dialogview\n dialog.show();\n\n } else {\n\n userPreferences.setEventId(UUID.randomUUID().toString());\n isCameraRecording = true;\n\n mStartRecordingButton.setChecked(true);\n mTextViewInfoAboutVideoStreaming.setVisibility(View.VISIBLE);\n cameraView.setVisibility(View.VISIBLE);\n\n if (cacheFolder == null) {\n cacheFolder = new FwiCacheFolder(AppDelegate.getAppContext(), String.format(\"%s/%s\", userPreferences.currentProfileId(), userPreferences.eventId()));\n cameraView.setDelegate(this);\n cameraView.setCacheFolder(cacheFolder);\n }\n\n this.startRecording();\n\n }\n if (userPreferences.enableTorch()) {\n isenableTourch = true;\n cameraView.torchOn();\n }\n\n }",
"public void onLoadMenuTop10Selected(List<Track> topTenMediaItems);",
"private void listEvents() {\n System.out.println(\"\\nEvents:\");\n for (Event event: world.getEvents()) {\n String name = event.getName();\n String coords = \" with x = \" + event.getX() + \" light seconds and t = \" + event.getTime() + \" seconds \";\n String frame = \"in \" + event.getFrame().getName() + \".\";\n System.out.println(name + coords + frame);\n }\n }",
"public void recordNativeNewTabPageShown() {\n RecordUserAction.record(\"Android.ChromeHome.NativeNTPShown\");\n }",
"Track(){\n\t}",
"public void onTouchEvent(MotionEvent event) {\n\t\t// history\n\t\t// pointers\n\t\tmDurationLogger.start();\n\t\tevent.getPointerCount();\n\t\tevent.getAction();\n\t\tif (event.getHistorySize() > 0){\n\t\t\tLog.i(\"TouchLogger\",\n\t\t\t\t\t\" x:\" + event.getX() +\n\t\t\t\t\t\"Touch duration:\"\n\t\t\t\t\t+ (event.getEventTime() - event\n\t\t\t\t\t\t\t.getHistoricalEventTime(0)) + \" size:\"\n\t\t\t\t\t\t\t+ event.getHistorySize()\n\t\t\t\t\t\t\t+ \"action:\"\n\t\t\t\t\t\t\t+ event.getAction());\n\t\t\tfor (int h = 0 ; h < event.getHistorySize() ; h ++){\n\n\t\t\t\tfor (int i = 0 ; i < event.getPointerCount() ; i++){\n\n\t\t\t\t\tLog.i(\"TouchLogger\",\n\t\t\t\t\t\t\t\" h \" \n\t\t\t\t\t\t\t+ h\n\t\t\t\t\t\t\t+ \" \"\n\t\t\t\t\t\t\t+ i\n\t\t\t\t\t\t\t+ \" \"\n\t\t\t\t\t\t\t+ event.getHistoricalEventTime(h)\n\t\t\t\t\t\t\t+ \" \"\n\t\t\t\t\t\t\t+ event.getHistoricalX(i,h)\n\t\t\t\t\t\t\t+ \" \"\n\t\t\t\t\t\t\t+ event.getHistoricalY(i,h)\n\t\t\t\t\t\t\t+ \" \"\n\t\t\t\t\t\t\t+ event.getHistoricalPressure(i,h)\n\t\t\t\t\t\t\t+ \" \"\n\t\t\t\t\t\t\t+ event.getHistoricalSize(i,h));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0 ; i < event.getPointerCount() ; i++){\n\t\t\tLog.i(\"TouchLogger\",\n\t\t\t\t\t\" current \" \n\t\t\t\t\t+ getActionName(event.getAction() & MotionEvent.ACTION_MASK)\n\t\t\t\t\t+ \" \"\n\t\t\t\t\t+ (event.getAction() & MotionEvent.ACTION_POINTER_ID_MASK)\n\t\t\t\t\t+ \" \"\n\t\t\t\t\t+ event.getEventTime()\n\t\t\t\t\t+ \" \"\n\t\t\t\t\t+ i\n\t\t\t\t\t+ \" \"\n\t\t\t\t\t+ event.getX(i)\n\t\t\t\t\t+ \" \"\n\t\t\t\t\t+ event.getY(i)\n\t\t\t\t\t+ \" \"\n\t\t\t\t\t+ event.getPressure(i)\n\t\t\t\t\t+ \" \"\n\t\t\t\t\t+ event.getSize(i));\n\t\t}\n\n\t\tmDurationLogger.end();\n\t}",
"public static void m5833i() {\n if (f4669a != null) {\n f4669a.m12578a(\"Recent_Search_clicked\", null);\n }\n Answers.getInstance().logCustom(new CustomEvent(\"Recent Search clicked\"));\n }",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\t// TODO Think about how to use the key in robots hashtable\n\t \t \tSystem.out.println(x.getName() + \" \" + Robot.getRobotInUse());\n\t \t \tRobot.setRobotInUse(x.getRobotKey());\n\t \t \tSystem.out.println(x.getName() + \" \" + Robot.getRobotInUse());\n\t \t \tjl.setText(x.getName());\n\t \t \t\n\t \t \tvi.showVideo(x);\n\t \t \t\n\t \t \t\n\t\t\t\t\t}",
"void onHistoryButtonClicked();",
"public static void pollEvents() {\n\t\tglfwPollEvents();\n\t}",
"default void onVideoStarted() {\n }",
"@Override\r\n\t\tpublic void dmr_seek(long time) throws RemoteException {\n\t\t\tUtils.printLog(TAG, \"dmr_seek time=\"+time);//nicy\r\n\t\t\tif (sEndTime > 0) {\r\n\t\t\t\tfinal long now = time;\r\n\t\t\t\tnew Thread(new Runnable() {\r\n\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\tmVideoContrl.seekTo((int) now);\r\n\t\t\t\t\t\tUtils.printLog(TAG, \"mVideoContrl.seekTo now =\"+now);//nicy\r\n\t\t\t\t\t}\r\n\t\t\t\t}).start();\r\n\t\t\t} else {\r\n\t\t\t\tmPlayerSeekar.setProgress(0);\r\n\t\t\t}\r\n\t\t}",
"@Override\r\n public void onItemClick(AdapterView<?> arg0, View arg1, int nSelectIndex, long arg3) {\n\r\n LocalDefines.B_INTENT_ACTIVITY = true; // add by mai 2015-5-15\r\n if (arg0.getId() == R.id.lvPlayer_back) {\r\n\r\n if (nSelectIndex >= 0 && nSelectIndex < LocalDefines._severInfoListData.size()) {\r\n\r\n LocalDefines._PlaybackListviewSelectedPosition = nSelectIndex;\r\n DeviceInfo info = LocalDefines._severInfoListData.get(LocalDefines._PlaybackListviewSelectedPosition);\r\n if (info != null && textViewDevice != null) {\r\n boolean isZh = LocalDefines.isZh(getActivity());\r\n if (isZh) {\r\n// if (HomePageActivity.AppMode == 1) {\r\n//\r\n// if (info.getnProductId() > 0) {\r\n// } else if (info.getnProductId() == 0) {\r\n// isSearchCloudRec = false;\r\n// tvTFVideo.setTextColor(getResources().getColor(R.color.font_color_sky_blue2));\r\n// tvCloudVideo.setTextColor(getResources().getColor(R.color.font_color_gray));\r\n// } else {\r\n// isSearchCloudRec = false;\r\n// tvTFVideo.setTextColor(getResources().getColor(R.color.font_color_sky_blue2));\r\n// tvCloudVideo.setTextColor(getResources().getColor(R.color.font_color_gray));\r\n// }\r\n//\r\n// } else {\r\n// }\r\n }\r\n if (Functions.isNVRDevice(\"\" + info.getnDevID())) {\r\n llChannel.setVisibility(View.VISIBLE);\r\n } else {\r\n llChannel.setVisibility(View.GONE);\r\n }\r\n deviceInfo = info;\r\n if (info.getStrName() != null && info.getStrName().length() > 0) {\r\n textViewDevice.setText(info.getStrName());\r\n } else {\r\n textViewDevice.setText(\"\" + info.getnDevID());\r\n }\r\n bSearchType = true;\r\n ivPlayerBackType.setImageResource(R.drawable.play_back_video_back_2);\r\n\r\n btnListVisible.setVisibility(View.VISIBLE);\r\n\r\n popupListView.dismiss();\r\n }\r\n\r\n }\r\n\r\n } else if (arg0.getId() == R.id.recfile_list) {\r\n if (nSelectIndex >= 0 && nSelectIndex < fileList.size()) {\r\n\r\n if (mRecFileDownloader != null && mRecFileDownloader.isDownloading()) {\r\n // 锟斤拷锟斤拷锟斤拷锟斤拷锟截碉拷录锟斤拷锟侥硷拷\r\n Toast.makeText(getActivity(), getString(R.string.str_rec_file_cancle2), Toast.LENGTH_SHORT).show();\r\n return;\r\n }\r\n\r\n if (!isCloudFileList) {\r\n // Log.i(\"TAG\", \"本地录像\");\r\n if (fileList != null && fileList.size() > 0) {\r\n SaveRecFileListToDatabase();\r\n }\r\n LocalDefines.listMapPlayerBackFile = fileList;\r\n StartPlayFile(nSelectIndex);\r\n\r\n } else {\r\n // Log.i(\"TAG\", \"云录像\");\r\n if (fileList != null && fileList.size() > 0) {\r\n SaveRecFileListToDatabase();\r\n }\r\n LocalDefines.cloudRecordFileList = fileList;\r\n if (mRecFileDownloader != null && mRecFileDownloader.isDownloading()) {\r\n // 锟斤拷锟斤拷锟斤拷锟斤拷锟截碉拷录锟斤拷锟侥硷拷\r\n Toast.makeText(getActivity(), getString(R.string.str_rec_file_cancle2), Toast.LENGTH_SHORT).show();\r\n return;\r\n }\r\n startPlayCloudRecordFile(nSelectIndex);\r\n }\r\n\r\n }\r\n }\r\n\r\n }",
"@Override\r\n\t\tpublic void onVideoPlayBufferingUpdate(int percent) {\n\r\n\t\t}",
"void mo23491a(MediaSourceEventListener mediaSourceEventListener);",
"public interface OnSearchRecDataListener {\n\n public void OnSearchRecData(int startTime, int endTime, int recType, int index, int end);\n}",
"public native String nativeGetNVHistory();",
"@Override\r\n\t\tpublic void onVideoPlayComplete() {\n\t\t\tLog.d(TAG, \"onVideoPlayComplete===========\");\r\n\t\t\tLog.d(TAG, \"mPlayBeginTime is \" + mPlayBeginTime.getText().toString() + \"===\" + \"mPlayEndTime is :\" + mPlayEndTime.getText().toString());\r\n\r\n\t\t\tmVideoPlayerHander.sendEmptyMessage(REFRESH_SEEKBAR_OP);\r\n\t\t\tsendPlayEventBroadCast(mCurrIndex, COMPLETE);\r\n\t\t}",
"public void botaohistory(View v) {\n startActivity(new Intent(this, com.example.appstore.history.class));\n }",
"@Override\n public void onVideoEnd() {\n super.onVideoEnd();\n }",
"static public void logEventInfo( MotionEvent oEvent )\n {\n final int iHistorySize = oEvent.getHistorySize();\n final int iPointerCount = oEvent.getPointerCount();\n String strMessage = String.format(\n \"Entering handleTouchEvent() with a event history of depth %d and %d pointers\",\n iHistorySize,\n iPointerCount );\n Logger.v( strMessage );\n\n // Look for up/down events in history\n for ( int h = 0; h < iHistorySize; h++ )\n {\n strMessage = String.format( \"Event history %d\", h );\n Logger.v( strMessage );\n\n for ( int p = 0; p < iPointerCount; p++ )\n {\n strMessage = String.format(\n \" pointer %d: (%f, %f)\",\n oEvent.findPointerIndex( p ),\n oEvent.getHistoricalX( p, h ),\n oEvent.getHistoricalY( p, h ) );\n Logger.v( strMessage );\n }\n }\n\n strMessage = String.format( \"Main event of type %d\", oEvent.getAction() );\n Logger.v( strMessage );\n\n for ( int p = 0; p < iPointerCount; p++ )\n {\n strMessage = String.format(\n \" pointer %d: (%f, %f)\",\n oEvent.findPointerIndex( p ),\n oEvent.getX( p ),\n oEvent.getY( p ) );\n Logger.v( strMessage );\n }\n }",
"public void invokeEvents() {\n\t\tIntent i = alertMe.createIntentFromSession();\n\t\ti.setClass(this, AlertMeEventHistory.class);\n\t\ti.putExtra(AlertMeConstants.INTENT_REQUEST_KEY, AlertMeConstants.INVOKE_HISTORY);\n startActivityForResult(i, AlertMeConstants.INVOKE_HISTORY);\n }",
"com.walgreens.rxit.ch.cda.EIVLEvent getEvent();",
"@Override\n public void eventsChanged() {\n }",
"public void lookForLiveItems(){\n\t\ttools.findWithScroll(\"com.fic.foxsports:id/HomeViewPager\", \"com.fic.foxsports:id/live_video_title\"); //Texto\r\n\t\ttools.findWithScroll(\"com.fic.foxsports:id/HomeViewPager\", \"com.fic.foxsports:id/overthumb_channelLogo\"); //Logo\r\n\t\ttools.findWithScroll(\"com.fic.foxsports:id/HomeViewPager\", \"com.fic.foxsports:id/clipItemImage\"); //Background\r\n\t}",
"@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\n\t\t\t\t\tType = \"History\";\n\t\t\t\t\tTV_History.setTextColor(Color.parseColor(\"#FFCC00\"));\n\t\t\t\t\tTV_All.setTextColor(Color.parseColor(\"#FFFFFF\"));\n\t\t\t\t\tTV_Collect.setTextColor(Color.parseColor(\"#FFFFFF\"));\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\trefresh(getDate());\n\t\t\t\t\tmAdapter.notifyDataSetChanged();\n\t\t\t\t\t\n\t\t\t\t\tLog.i(\"---------------\", \"点击了历史\");\n\t\t\t\t}",
"public void onFrameRefresh(ym iba) {}",
"@Override\n protected void showChangePosition(long duration, int newPositionProgress) {\n }",
"private /* varargs */ void onViewFinderStateChanged(StateMachine.CaptureState captureState, Object ... arrobject) {\n switch (.$SwitchMap$com$sonyericsson$android$camera$fastcapturing$StateMachine$CaptureState[captureState.ordinal()]) {\n default: {\n return;\n }\n case 3: {\n super.resumeView();\n this.mSurfaceView.setVisibility(0);\n return;\n }\n case 4: {\n this.mCurrentDisplayingUiComponent = null;\n super.changeToPhotoIdleView(false);\n if (arrobject != null && arrobject.length != 0) {\n if ((BaseFastViewFinder.UiComponentKind)arrobject[0] == BaseFastViewFinder.UiComponentKind.ZOOM_BAR) return;\n this.requestToDimSystemUi();\n return;\n }\n this.requestToDimSystemUi();\n return;\n }\n case 5: {\n super.changeToPhotoSelftimerView();\n return;\n }\n case 6: \n case 7: {\n super.changeToPhotoZoomingView();\n return;\n }\n case 8: {\n this.mCurrentDisplayingUiComponent = (BaseFastViewFinder.UiComponentKind)arrobject[0];\n super.changeToPhotoDialogView(this.mCurrentDisplayingUiComponent);\n this.requestToRecoverSystemUi();\n return;\n }\n case 9: \n case 10: {\n this.requestToRemoveSystemUi();\n super.changeToPhotoFocusSearchView();\n return;\n }\n case 11: {\n super.changeToPhotoFocusSearchView();\n return;\n }\n case 12: \n case 13: {\n super.changeToPhotoFocusDoneView((Boolean)arrobject[0]);\n return;\n }\n case 14: {\n super.changeToPhotoCaptureWaitForAfDoneView();\n return;\n }\n case 15: {\n super.changeToPhotoCaptureView();\n return;\n }\n case 16: \n case 17: {\n super.changeToPhotoBurstView((Boolean)arrobject[0]);\n return;\n }\n case 18: {\n if (this.mFocusRectangles != null) {\n this.mFocusRectangles.clearExceptTouchFocus();\n }\n this.getBaseLayout().showContentsViewController();\n return;\n }\n case 19: {\n super.changeToVideoRecordingView();\n this.requestToDimSystemUi();\n return;\n }\n case 20: {\n super.changeToVideoRecordingView();\n if (arrobject != null && arrobject.length != 0) {\n if ((BaseFastViewFinder.UiComponentKind)arrobject[0] == BaseFastViewFinder.UiComponentKind.ZOOM_BAR) return;\n this.requestToDimSystemUi();\n return;\n }\n this.requestToDimSystemUi();\n return;\n }\n case 24: \n case 25: {\n super.changeToVideoZoomingWhileRecordingView();\n return;\n }\n case 26: {\n super.hideTakePictureFeedbackView();\n this.mSurfaceView.setVisibility(8);\n super.pauseView();\n super.changeToPauseView();\n return;\n }\n case 27: {\n if (this.mFocusRectangles != null) {\n this.mFocusRectangles.clearAllFocus();\n }\n super.changeToPhotoIdleView(false);\n this.requestToDimSystemUi();\n return;\n }\n case 28: {\n this.mSurfaceView.getHolder().removeCallback((SurfaceHolder.Callback)this);\n this.mSurfaceView = null;\n super.hideTakePictureFeedbackView();\n this.mSurfaceBlinderView = null;\n this.mKeyEventTranslator = null;\n this.release();\n super.getDownHeadUpDisplay();\n return;\n }\n case 29: {\n super.changeToVideoRecordingPauseView();\n return;\n }\n case 30: {\n this.mVideoAutoReviewSetting = null;\n return;\n }\n case 31: \n }\n this.requestToRemoveSystemUi();\n super.changeToReadyForRecordView();\n }",
"private void videoVisible() {\n }",
"public void getHistory() {\n List<Map<String, String>> HistoryList = null;\n HistoryList = getData();\n String[] fromwhere = {\"Line\", \"Station\", \"Repair_Time_Start\", \"Repair_Time_Finish\", \"Repair_Duration\"};\n int[] viewwhere = {R.id.Line, R.id.Station, R.id.RepairTimeStart, R.id.RepairTimeFinish, R.id.Duration};\n ABH = new SimpleAdapter(BreakdownHistory.this, HistoryList, R.layout.list_history, fromwhere, viewwhere);\n BreakdownHistory.setAdapter(ABH);\n }",
"public void onSearchStarted();",
"public void mo1334a() {\n m18899a(enumSet.contains(CacheFlag.VIDEO));\n }",
"public void stateChanged(ChangeEvent evt){player.seek(slider.getValue());}",
"public void m() {\n if (this.t != null) {\n q a2 = ia.a().a(this.g.getUrl());\n a2.f4579a = this.t.getPlayWhenReady();\n a2.f4580b = this.t.getCurrentWindowIndex();\n a2.f4581c = this.t.isCurrentWindowSeekable() ? Math.max(0, this.t.getCurrentPosition()) : C.TIME_UNSET;\n ia.a().a(this.g.getUrl(), a2);\n }\n }",
"void onVideoInputSelected(int type);",
"public void afterClickHistory(View view) {\n }",
"private void refreshListView() {\n model.updateAllFilteredLists(history.getPrevKeywords(), history.getPrevStartDate(),\n history.getPrevEndDate(), history.getPrevState(),\n history.getPrevSearches());\n }",
"@Override\n\tpublic void videoStart() {\n\t\t\n\t}",
"public void startVideoRecording() {\n this.mActivity.getCameraAppUI().switchShutterSlidingAbility(false);\n if (this.mCameraState == 1) {\n setCameraState(2);\n Tag tag = TAG;\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"startVideoRecording: \");\n stringBuilder.append(Thread.currentThread());\n Log.i(tag, stringBuilder.toString());\n ToastUtil.showToast(this.mActivity, this.mActivity.getString(R.string.video_recording_start_toast), 0);\n this.mAppController.onVideoRecordingStarted();\n if (this.mModeSelectionLockToken == null) {\n this.mModeSelectionLockToken = this.mAppController.lockModuleSelection();\n }\n this.mUI.showVideoRecordingHints(false);\n this.mUI.cancelAnimations();\n this.mUI.setSwipingEnabled(false);\n this.mUI.showFocusUI(false);\n this.mAppController.getCameraAppUI().hideRotateButton();\n this.mAppController.getButtonManager().hideEffectsContainerWrapper();\n final long updateStorageSpaceTime = System.currentTimeMillis();\n this.mActivity.updateStorageSpaceAndHint(new OnStorageUpdateDoneListener() {\n public void onStorageUpdateDone(long bytes) {\n Tag access$100 = VideoModule.TAG;\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"updateStorageSpaceAndHint cost time :\");\n stringBuilder.append(System.currentTimeMillis() - updateStorageSpaceTime);\n stringBuilder.append(\"ms.\");\n Log.d(access$100, stringBuilder.toString());\n if (VideoModule.this.mCameraState != 2) {\n VideoModule.this.pendingRecordFailed();\n return;\n }\n if (bytes <= Storage.LOW_STORAGE_THRESHOLD_BYTES) {\n Log.w(VideoModule.TAG, \"Storage issue, ignore the start request\");\n VideoModule.this.pendingRecordFailed();\n } else if (VideoModule.this.mCameraDevice == null) {\n Log.v(VideoModule.TAG, \"in storage callback after camera closed\");\n VideoModule.this.pendingRecordFailed();\n } else if (VideoModule.this.mPaused) {\n Log.v(VideoModule.TAG, \"in storage callback after module paused\");\n VideoModule.this.pendingRecordFailed();\n } else if (VideoModule.this.mMediaRecorderRecording) {\n Log.v(VideoModule.TAG, \"in storage callback after recording started\");\n } else if (VideoModule.this.isSupported(VideoModule.this.mProfile.videoFrameWidth, VideoModule.this.mProfile.videoFrameHeight)) {\n VideoModule.this.mCurrentVideoUri = null;\n VideoModule.this.mCameraDevice.enableShutterSound(false);\n if (VideoModule.this.mNeedGLRender && VideoModule.this.isSupportEffects()) {\n VideoModule.this.playVideoSound();\n VideoModule.this.initGlRecorder();\n VideoModule.this.pauseAudioPlayback();\n VideoModule.this.mActivity.getCameraAppUI().startVideoRecorder();\n } else {\n VideoModule.this.initializeRecorder();\n if (VideoModule.this.mMediaRecorder == null) {\n Log.e(VideoModule.TAG, \"Fail to initialize media recorder\");\n VideoModule.this.pendingRecordFailed();\n return;\n }\n VideoModule.this.pauseAudioPlayback();\n try {\n long mediarecorderStart = System.currentTimeMillis();\n VideoModule.this.mMediaRecorder.start();\n access$100 = VideoModule.TAG;\n StringBuilder stringBuilder2 = new StringBuilder();\n stringBuilder2.append(\"mMediaRecorder.start() cost time : \");\n stringBuilder2.append(System.currentTimeMillis() - mediarecorderStart);\n Log.d(access$100, stringBuilder2.toString());\n VideoModule.this.playVideoSound();\n VideoModule.this.mCameraDevice.refreshSettings();\n VideoModule.this.mCameraSettings = VideoModule.this.mCameraDevice.getSettings();\n VideoModule.this.setFocusParameters();\n } catch (RuntimeException e) {\n Log.e(VideoModule.TAG, \"Could not start media recorder. \", e);\n VideoModule.this.releaseMediaRecorder();\n VideoModule.this.mCameraDevice.lock();\n VideoModule.this.releaseAudioFocus();\n if (VideoModule.this.mModeSelectionLockToken != null) {\n VideoModule.this.mAppController.unlockModuleSelection(VideoModule.this.mModeSelectionLockToken);\n }\n VideoModule.this.setCameraState(1);\n if (VideoModule.this.shouldHoldRecorderForSecond()) {\n VideoModule.this.mAppController.setShutterEnabled(true);\n }\n VideoModule.this.mAppController.getCameraAppUI().showModeOptions();\n if (VideoModule.this.updateModeSwitchUIinModule()) {\n VideoModule.this.mAppController.getCameraAppUI().setModeSwitchUIVisibility(true);\n }\n if (VideoModule.this.isNeedStartRecordingOnSwitching()) {\n VideoModule.this.mAppController.onVideoRecordingStop();\n }\n ToastUtil.showToast(VideoModule.this.mActivity.getApplicationContext(), (int) R.string.video_record_start_failed, 0);\n return;\n }\n }\n VideoModule.this.mAppController.getCameraAppUI().setSwipeEnabled(false);\n VideoModule.this.setCameraState(3);\n VideoModule.this.tryLockFocus();\n VideoModule.this.mMediaRecorderRecording = true;\n VideoModule.this.mActivity.lockOrientation();\n VideoModule.this.mRecordingStartTime = SystemClock.uptimeMillis() + 600;\n VideoModule.this.mAppController.getCameraAppUI().getCameraGLSurfaceView().setAngle(VideoModule.this.mOrientation);\n VideoModule.this.mAppController.getCameraAppUI().hideModeOptions();\n if (VideoModule.this.updateModeSwitchUIinModule()) {\n VideoModule.this.mAppController.getCameraAppUI().setModeSwitchUIVisibility(false);\n }\n if (VideoModule.this.isVideoShutterAnimationEnssential()) {\n VideoModule.this.mAppController.getCameraAppUI().animateBottomBarToVideoStop(R.drawable.ic_stop);\n }\n if (VideoModule.this.isNeedStartRecordingOnSwitching()) {\n VideoModule.this.mAppController.getCameraAppUI().showVideoCaptureButton(true);\n }\n if (VideoModule.this.mAppController.getCameraAppUI().getCurrentModeIndex() == VideoModule.this.mActivity.getResources().getInteger(R.integer.camera_mode_video)) {\n VideoModule.this.mAppController.getCameraAppUI().showVideoPauseButton(false);\n }\n VideoModule.this.mUI.showRecordingUI(true);\n if (VideoModule.this.mAppController.getCameraAppUI().getCameraGLSurfaceView().getVisibility() == 0) {\n VideoModule.this.mUI.hideCapButton();\n }\n VideoModule.this.showBoomKeyTip();\n VideoModule.this.updateRecordingTime();\n access$100 = VideoModule.TAG;\n StringBuilder stringBuilder3 = new StringBuilder();\n stringBuilder3.append(\"startVideoRecording cost time 1 : \");\n stringBuilder3.append(System.currentTimeMillis() - VideoModule.this.mShutterButtonClickTime);\n Log.d(access$100, stringBuilder3.toString());\n if (VideoModule.this.isSendMsgEnableShutterButton()) {\n VideoModule.this.mHandler.sendEmptyMessageDelayed(6, VideoModule.MIN_VIDEO_RECODER_DURATION);\n }\n VideoModule.this.mActivity.enableKeepScreenOn(true);\n VideoModule.this.mActivity.startInnerStorageChecking(new OnInnerStorageLowListener() {\n public void onInnerStorageLow(long bytes) {\n VideoModule.this.mActivity.stopInnerStorageChecking();\n if (VideoModule.this.mCameraState == 3) {\n VideoModule.this.showQuitDialog(R.string.quit_dialog_title_storage_low, R.string.quit_dialog_msg, VideoModule.this.saveAndQuit);\n }\n }\n });\n VideoModule.this.mActivity.startBatteryInfoChecking(new OnBatteryLowListener() {\n public void onBatteryLow(int level) {\n VideoModule.this.mActivity.stopBatteryInfoChecking();\n if (VideoModule.this.mCameraState == 3) {\n VideoModule.this.showQuitDialog(R.string.quit_dialog_title_battery_low, R.string.quit_dialog_msg, VideoModule.this.saveAndQuit);\n }\n }\n });\n } else {\n Log.e(VideoModule.TAG, \"Unsupported parameters\");\n VideoModule.this.pendingRecordFailed();\n }\n }\n });\n }\n }",
"@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tfinal WebHistory history=engine.getHistory();\r\n\t\t ObservableList<WebHistory.Entry> entryList=history.getEntries();\r\n\t\t int currentIndex=history.getCurrentIndex();\r\n//\t\t Out(\"currentIndex = \"+currentIndex);\r\n//\t\t Out(entryList.toString().replace(\"],\",\"]\\n\"));\r\n\t\t\t if(history.getCurrentIndex()<entryList.size()-1){\r\n\t\t\t \r\n\t\t Platform.runLater(new Runnable() { public void run() { history.go(1); } });\r\n\t\t System.out.println(entryList.get(currentIndex<entryList.size()-1?currentIndex+1:currentIndex).getUrl());\r\n\t\t\t}\r\n\t\t}",
"private void retrieveRemoteEventData(){\n\n //This returns a JSON object with a {\"eventIndex\": int, \"event\": int} pattern.\n String data = getJSON(hostUrl + \"retrieve_remote_event.php?matchId=\" + matchId\n + \"&player=\" + oppositePlayer, 2000);\n\n // Parse the JSON information into an EventIndexPair object.\n Event e = new Gson().fromJson(data, Event.class);\n\n // Set event and eventIndex variables retrieved from JSON to the remoteActiveEvent and\n // remoteEventIndex global variables.\n // These variables will be used to process events locally on the next frame.\n if (e != null){\n if (e.getIndex() > remoteEventIndex){\n\n remoteActiveEvent = e;\n remoteEventIndex = e.getIndex();\n\n }\n }\n\n }",
"static HistoryEvent[] getHistoryEvents() {\n/* 73 */ HISTORY_RW_LOCK.readLock().lock();\n/* */ \n/* */ try {\n/* 76 */ return HISTORY.<HistoryEvent>toArray(new HistoryEvent[HISTORY.size()]);\n/* */ }\n/* */ finally {\n/* */ \n/* 80 */ HISTORY_RW_LOCK.readLock().unlock();\n/* */ } \n/* */ }",
"public void onLogFPS() {\n }",
"void eventChanged();",
"@Override\n public void onSeekComplete(MediaPlayer mp) {\n }",
"@Override\n public void onSeekComplete(MediaPlayer mp) {\n }",
"public void startOldEvent() {\n // JCuda.cudaEventRecord(oldEvent, oldStream);\n }",
"private void onUpdate(FrameTime frameTime) {\n Frame frame = arFragment.getArSceneView().getArFrame();\n Collection<AugmentedImage> images = frame.getUpdatedTrackables(AugmentedImage.class);\n //Iterate through the image database\n for (AugmentedImage image : images) {\n // Check if scanned image existed in the image database\n if (image.getTrackingMethod() == AugmentedImage.TrackingMethod.FULL_TRACKING) {\n //Set the scene\n RelativeLayout gallery = findViewById(R.id.gallery);\n ArFragment arFragment = (ArFragment) getSupportFragmentManager().findFragmentById(R.id.arFragment);\n String name = image.getName();\n //check which image was scanned\n switch (name) {\n case \"argon.png\":\n //Set string\n string = \"argon.sfb\";\n //Set the text that appears to the student\n text=getString(R.string.argon2);\n //call the 3D object\n callAR();\n break;\n case \"bromine.png\":\n string = \"bariumatom.sfb\";\n text=getString(R.string.bromine2);\n callAR();\n break;\n case \"calcium.png\":\n string = \"calcium.sfb\";\n text=getString(R.string.calcium2);\n callAR();\n break;\n case \"chlorine.png\":\n string = \"chlorineatom.sfb\";\n text=getString(R.string.chlorine2);\n callAR();\n break;\n case \"fluorine.png\":\n string = \"fluorineatom.sfb\";\n text=getString(R.string.fluorine2);\n callAR();\n break;\n case \"helium.png\":\n string = \"heliumatom.sfb\";\n text=getString(R.string.helium2);\n callAR();\n break;\n case \"hydrogen.png\":\n string = \"hydrogen.sfb\";\n text=getString(R.string.hydrogen2);\n callAR();\n break;\n case \"lithium.png\":\n string = \"Lithiumatom.sfb\";\n text=getString(R.string.lithium2);\n callAR();\n break;\n case \"magnesium.png\":\n string = \"magnesiumatomm.sfb\";\n text=getString(R.string.magnesium2);\n callAR();\n break;\n case \"neon.png\":\n string = \"neonn.sfb\";\n text=getString(R.string.neon2);\n callAR();\n break;\n case \"sodium.png\":\n string = \"sodium.sfb\";\n text=getString(R.string.sodium2);\n callAR();\n break;\n }\n\n\n }\n }\n }",
"private void historyButtonListener() {\n JButton historyButton = gui.getHistory_Button();\n\n ActionListener actionListener = (ActionEvent actionEvent) -> {\n gui.getHistory_TextArea().setText(\"\");\n gui.getFrame_History().setVisible(true);\n gui.getFrame_History().setSize(415, 250);\n gui.getHistory_TextArea().setEditable(false);\n for (int key : requestsAnswered.keySet()) {\n gui.getHistory_TextArea().append(requestsAnswered.get(key).getFormattedRequest());\n }\n for (int key : processingRequests.keySet()) {\n gui.getHistory_TextArea().append(processingRequests.get(key).getFormattedRequest());\n }\n };\n historyButton.addActionListener(actionListener);\n }",
"@Override\n public void onTrackChange(final RadioStream.TrackInfo trackInfo) {\n }",
"com.google.wireless.android.sdk.stats.FilterMetadata.View getActiveView();",
"@Override\n public void onPlayListEdited(PlayList playList) {\n }",
"public void playbackStarted(PlaybackEvent evt){\n\t\tgui.notifyGUI(true);\n\t\tSystem.out.println(evt.getFrame());\n\t}",
"@Override\r\n\tpublic void mediaChanged(MediaPlayer arg0, libvlc_media_t arg1, String arg2)\r\n\t{\n\t\t\r\n\t}",
"public /* varargs */ void sendViewUpdateEvent(BaseFastViewFinder.ViewUpdateEvent viewUpdateEvent, Object ... arrobject) {\n switch (.$SwitchMap$com$sonyericsson$android$camera$fastcapturing$view$BaseFastViewFinder$ViewUpdateEvent[viewUpdateEvent.ordinal()]) {\n default: {\n return;\n }\n case 1: {\n super.setupHeadUpDisplay((BaseFastViewFinder.HeadUpDisplaySetupState)arrobject[0]);\n return;\n }\n case 2: {\n if (this.mActivity == null) return;\n if (this.mCameraDevice == null) return;\n if (this.mCameraDevice.getPreviewRect() == null) return;\n Rect rect = LayoutDependencyResolver.getSurfaceRect((Activity)this.mActivity, (float)this.mCameraDevice.getPreviewRect().width() / (float)this.mCameraDevice.getPreviewRect().height());\n int n = rect.width();\n int n2 = rect.height();\n Rect rect2 = new Rect(0, 0, this.mSurfaceView.getWidth(), this.mSurfaceView.getHeight());\n if (FastViewFinder.isNearSameSize(rect, rect2)) return;\n super.resizeEvfScope(n, n2);\n return;\n }\n case 3: {\n if (this.mSurfaceBlinderView == null) return;\n if (this.mSurfaceBlinderView.getVisibility() == 0) return;\n this.getBaseLayout().getPreviewOverlayContainer().addView(this.mSurfaceBlinderView);\n this.mSurfaceBlinderView.setVisibility(0);\n return;\n }\n case 4: {\n if (this.mSurfaceBlinderView == null) return;\n if (this.mSurfaceBlinderView.getVisibility() != 0) return;\n this.mSurfaceBlinderView.setVisibility(4);\n this.getBaseLayout().getPreviewOverlayContainer().removeView(this.mSurfaceBlinderView);\n return;\n }\n case 5: {\n if (this.getBaseLayout().getLowMemoryIndicator() == null) return;\n this.getBaseLayout().getLowMemoryIndicator().set(false);\n return;\n }\n case 6: {\n if (this.getBaseLayout().getLowMemoryIndicator() == null) return;\n this.getBaseLayout().getLowMemoryIndicator().set(true);\n return;\n }\n case 7: {\n if (this.getBaseLayout().getRecordingIndicator() == null) return;\n if (!((Boolean)arrobject[1]).booleanValue()) {\n this.getBaseLayout().getRecordingIndicator().setSequenceMode(true);\n }\n this.getBaseLayout().getRecordingIndicator().setConstraint((Boolean)arrobject[1]);\n this.getBaseLayout().getRecordingIndicator().prepareBeforeRecording((Integer)arrobject[0], (Boolean)arrobject[2]);\n return;\n }\n case 8: {\n super.onCameraModeChangedTo((Integer)arrobject[0]);\n return;\n }\n case 9: {\n super.onSceneModeChanged((CameraExtension.SceneRecognitionResult)arrobject[0]);\n return;\n }\n case 10: {\n this.mFocusRectangles.startFaceDetection();\n return;\n }\n case 11: {\n CameraExtension.FaceDetectionResult faceDetectionResult = (CameraExtension.FaceDetectionResult)arrobject[0];\n if (this.mIsFaceDetectionIdSupported == null) {\n if (!faceDetectionResult.extFaceList.isEmpty()) {\n this.mIsFaceDetectionIdSupported = FaceDetectUtil.hasValidFaceId(faceDetectionResult);\n }\n } else if (!this.mIsFaceDetectionIdSupported.booleanValue()) {\n FaceDetectUtil.setUuidFaceDetectionResult(faceDetectionResult);\n }\n super.onFaceDetected(faceDetectionResult);\n return;\n }\n case 12: {\n super.onFaceNameDetected((List)arrobject[0]);\n return;\n }\n case 13: {\n this.mFocusRectangles.startObjectTracking();\n return;\n }\n case 14: {\n super.onTrackedObjectStateUpdated((CameraExtension.ObjectTrackingResult)arrobject[0]);\n return;\n }\n case 15: {\n Camera.Parameters parameters = this.mStateMachine.getCurrentCameraParameters(false);\n int n = parameters == null ? 0 : parameters.getMaxZoom();\n int n3 = (Integer)arrobject[0];\n int n4 = this.mCameraDevice.getMaxSuperResolutionZoom();\n boolean bl = PlatformDependencyResolver.isSuperResolutionZoomSupported(parameters);\n Zoombar zoombar = this.getBaseLayout().getZoomBar();\n if (zoombar == null) return;\n if (bl && !this.mStateMachine.isInModeLessRecording()) {\n zoombar.updateZoombarType(Zoombar.Type.PARTIAL_SUPER_RESOLUTION);\n } else {\n zoombar.updateZoombarType(Zoombar.Type.NORMAL);\n }\n this.onZoomChanged(n3, n, n4);\n return;\n }\n case 16: {\n super.cancelSelfTimerCountDownView();\n return;\n }\n case 17: {\n super.setCount((Integer)arrobject[0]);\n return;\n }\n case 18: {\n Point point = (Point)arrobject[0];\n FocusRectangles.FocusSetType focusSetType = (FocusRectangles.FocusSetType)arrobject[1];\n this.mFocusRectangles.setFocusPosition(point, focusSetType);\n if (focusSetType != FocusRectangles.FocusSetType.FIRST) return;\n if (this.mCapturingMode.isFront()) return;\n this.mFocusRectangles.onAutoFocusStarted();\n return;\n }\n case 19: {\n this.mFocusRectangles.clearAllFocus();\n return;\n }\n case 20: {\n this.mFocusRectangles.clearAllFocusExceptFace();\n return;\n }\n case 21: {\n if (this.getBaseLayout().getRecordingIndicator() == null) return;\n this.getBaseLayout().getRecordingIndicator().updateRecordingTime((Integer)arrobject[0]);\n this.getBaseLayout().getOnScreenButtonGroup().restartAnimation();\n return;\n }\n case 22: {\n this.setOrientation((Integer)arrobject[0]);\n return;\n }\n case 23: {\n if (this.mCapturingMode.isFront()) return;\n this.mFocusRectangles.onAutoFocusCanceled();\n return;\n }\n case 24: {\n super.updateUiComponent(BaseFastViewFinder.UiComponentKind.SETTING_DIALOG);\n return;\n }\n case 25: {\n super.closeCurrentDisplayingUiComponent();\n return;\n }\n case 26: {\n StoreDataResult storeDataResult = (StoreDataResult)arrobject[0];\n this.openReviewWindow(storeDataResult.uri, storeDataResult.savingRequest);\n return;\n }\n case 27: {\n SavingRequest savingRequest = (SavingRequest)arrobject[1];\n String string = savingRequest.common.mimeType;\n AutoReviewWindow autoReviewWindow = this.mAutoReview;\n Uri uri = null;\n if (autoReviewWindow != null && (uri = this.mAutoReview.getUri()) != null) {\n AutoReviewWindow.launchAlbum((Activity)this.mActivity, uri, string);\n return;\n }\n if (string != \"video/mp4\" && string != \"video/3gpp\") {\n super.openInstantViewer((byte[])arrobject[0], null, savingRequest);\n return;\n }\n super.openInstantViewer(null, (String)arrobject[0], savingRequest);\n return;\n }\n case 28: {\n if (this.mAutoReview != null && this.mAutoReview.getUri() == null) {\n this.mAutoReview.setUri((Uri)arrobject[0]);\n }\n if (this.mAutoReview == null) return;\n if (!this.mIsInstantViewerOpened) return;\n this.mAutoReview.showRightIcons(Boolean.valueOf((boolean)true));\n return;\n }\n case 29: {\n this.startCaptureFeedbackAnimation();\n return;\n }\n case 30: {\n super.setEarlyThumbnailView((View)arrobject[0]);\n return;\n }\n case 31: {\n this.removeEarlyThumbnailView();\n return;\n }\n case 32: {\n int n = (Integer)arrobject[0];\n if (arrobject.length > 1) {\n this.startEarlyThumbnailInsertAnimation(n, (Animation.AnimationListener)arrobject[1]);\n return;\n }\n super.startEarlyThumbnailInsertAnimation(n);\n return;\n }\n case 33: {\n super.addCountUpView((Integer)arrobject[0]);\n return;\n }\n case 34: {\n super.removeCountUpView((Integer)arrobject[0]);\n return;\n }\n case 35: {\n super.onLazyInitializationTaskRun();\n return;\n }\n case 36: {\n super.addVideoChapter((ChapterThumbnail)arrobject[0]);\n return;\n }\n case 37: {\n this.onNotifyThermalStatus(false);\n return;\n }\n case 38: \n }\n this.onNotifyThermalStatus(true);\n }",
"public void showHistory(){\n \tif (historyExample==null) historyExample = new HistoryExample();\n setWidgetAsExample(historyExample);\n }",
"private void seekChange(View v){\n \t//if(mediaPlayer.isPlaying()){\n\t \tSeekBar sb = (SeekBar)v;\n\t\t\tmediaPlayer.seekTo(sb.getProgress());\n\t\t//}\n }",
"private void loadMoreHistoryChat(){\n loadChatHistory(CHAT_LIMIT,headIndex,0);\n }",
"@Override\r\n\tprotected void userDefinedViewUpdate() {\r\n\t\tvideoUtil.captureVideoImage();\r\n\t\tgetModel()._readFromViewAfterUpdate();\r\n\t}",
"private void populatePreviousODOReading() {\n\n fuelViewModel.getAllFuel()\n .observe(getActivity(), new Observer<List<Fuel>>() {\n @Override\n public void onChanged(List<Fuel> fuels) {\n\n // if list is not empty\n if (!fuels.isEmpty()){\n\n Log.d(TAG, \"onChanged: fuels.size() = \" + fuels.size());\n\n // fuels.size()-1 displayed last item in the list, so I tested and found that 0 item is the first item\n Fuel mostRecentFuel = fuels.get(0); // most recent item is zero item on the list means first item\n Log.d(TAG, \"onChanged: mostRecentFuel.getFuelID() = \" + mostRecentFuel.getFuelID());\n\n lastODOreading = mostRecentFuel.getCurrentKm();\n tin_startingKm.setText(String.valueOf(lastODOreading));\n\n }\n\n\n }\n });\n\n }",
"public void testViewHistory() throws Exception {\n System.out.print(\".. Testing history information of a file ..\");\n String filesystem = \"VSS \" + workingDirectory + File.separator + \"Work\";\n Node filesystemNode = new Node(new ExplorerOperator().repositoryTab().getRootNode(), filesystem);\n Node A_FileNode = new Node( filesystemNode, \"A_File [Current]\");\n new Action(VERSIONING_MENU + \"|\" + HISTORY, HISTORY).perform(A_FileNode);\n MainWindowOperator.getDefault().waitStatusText(\"Command History finished.\");\n VCSCommandsOutputOperator outputWindow = new VCSCommandsOutputOperator(\"History\");\n outputWindow.btClose();\n Thread.sleep(5000);\n String currentContents = outputWindow.txtStandardOutput().getText();\n outputWindow.close();\n String goldenContents = \"History of $/A_File.java ...\\n\\n***************** Version 2 *****************\\nUser: \" + userName + \" Date:\";\n if (currentContents.indexOf(goldenContents) < 0) captureScreen(\"Error: Incorrect history contents. Golden: |\" + goldenContents + \"|\" + currentContents + \"|\");\n goldenContents = \"Checked in $/\\nComment: Three lines have changed.\\n\\n***************** Version 1 *****************\\nUser: \" + userName + \" Date\";\n if (currentContents.indexOf(goldenContents) < 0) captureScreen(\"Error: Incorrect history contents. Golden: |\" + goldenContents + \"|\" + currentContents + \"|\");\n goldenContents = \"Created\\nComment: Generated A_File class.\\n\";\n if (currentContents.indexOf(goldenContents) < 0) captureScreen(\"Error: Incorrect history contents. Golden: |\" + goldenContents + \"|\" + currentContents + \"|\");\n new Action(VERSIONING_MENU + \"|\" + PROPERTIES, PROPERTIES).perform(A_FileNode);\n MainWindowOperator.getDefault().waitStatusText(\"Command Properties finished.\");\n outputWindow = new VCSCommandsOutputOperator(\"Properties\");\n outputWindow.btClose();\n Thread.sleep(5000);\n currentContents = outputWindow.txtStandardOutput().getText();\n outputWindow.close();\n goldenContents = \"File: $/A_File.java\\nType: Text\\nSize: 91 bytes 5 lines\\nStore only latest version: No\\nLatest: \\n Version: 2 \\n Date:\";\n if (currentContents.indexOf(goldenContents) < 0) captureScreen(\"Error: Incorrect properties contents. Golden: |\" + goldenContents + \"|\" + currentContents + \"|\");\n goldenContents = \"Comment: Generated A_File class.\";\n if (currentContents.indexOf(goldenContents) < 0) captureScreen(\"Error: Incorrect properties contents. Golden: |\" + goldenContents + \"|\" + currentContents + \"|\");\n System.out.println(\". done !\");\n }",
"public interface ActivityRecognitionListener {\n void updateDetectedActivitiesList(ArrayList<DetectedActivity> updatedActivities);\n}",
"private List<String> getDataFromApi() throws IOException {\n // List the next 10 events from the primary calendar.\n DateTime now = new DateTime(System.currentTimeMillis());\n Date nowToday = new Date(System.currentTimeMillis());\n Date now2 = new Date();\n Log.d(\"TIME\", now2.toString()); // Fri Apr 14 11:45:53 GMT-04:00 2017\n String show = DateFormat.getTimeInstance().format(nowToday); // 오후 4:22:40\n String show2 = DateFormat.getDateInstance().format(nowToday); // 2017. 4. 7.\n String show3 = DateFormat.getDateTimeInstance().format(nowToday); // 2017. 4. 7. 오후 4:22:40\n // String show4 = DateFormat.getDateInstance().format(now); 이건 안됌 에러\n Log.d(\"@@@@@LOOK HERE TIME@@\", show);\n Log.d(\"@@@@@LOOK HERE DATE@@\", show2);\n Log.d(\"@@@@@LOOK HERE DATETIME\", show3);\n List<String> eventStrings = new ArrayList<String>();\n Events events = mService.events().list(\"primary\")\n .setMaxResults(10)\n .setTimeMin(now)\n .setOrderBy(\"startTime\")\n .setSingleEvents(true)\n .execute();\n\n\n List<Event> items = events.getItems();\n // List<Map<String, String>> pairList = new ArrayList<Map<String, String>>();\n String nowDay = now.toString().substring(0, now.toString().indexOf(\"T\"));\n\n\n for (Event event : items) {\n DateTime start = event.getStart().getDateTime();\n if (start == null) {\n // All-day events don't have start times, so just use\n // the start date.\n start = event.getStart().getDate();\n }\n\n eventStrings.add(\n String.format(\"%s (%s)\", event.getSummary(), start));\n }\n List<String> realStrings = new ArrayList<String>();\n for (String a:eventStrings\n ) {\n // Log.d(\"@@@@\", a);\n String day;\n String korTimeSpeech = null;\n String newSpeech = null;\n day = a.substring(a.indexOf(\"(\"), a.indexOf(\")\"));\n day = day.substring(1);\n\n if(day.length() > 16) {\n int hour = Integer.parseInt(day.substring(11, 13));\n if(hour < 12) {\n korTimeSpeech = \"오전 \";\n } else{\n korTimeSpeech = \"오후 \";\n hour = hour - 12;\n }\n korTimeSpeech = korTimeSpeech + hour + \"시 \" + day.substring(14, 16) + \"분에 \";\n newSpeech = a.substring(0, a.indexOf(\"(\"));\n newSpeech = korTimeSpeech + newSpeech;\n //Make it in day format\n day = day.substring(0, day.indexOf(\"T\"));\n }else {\n // korTimeSpeech = day.substring(11, 13) + \"시 \" + day.substring(14, 16) + \"분에 \";\n newSpeech = a.substring(0, a.indexOf(\"(\"));\n newSpeech = newSpeech;\n }\n\n if (day.equals(nowDay)) {\n realStrings.add(newSpeech);\n }\n }\n\n return realStrings;\n }",
"@Override\n public void updateHistory(Command c) {\n }",
"@Test\n public void testViewClientHistory() {\n for (int i = 0; i < 10; i++) {\n presenter.onViewClientHistory();\n }\n Assert.assertEquals(10, view.getManageViewClientHistoryClicks());\n }",
"private void readHistoricalData() {\n /*\n r4 = this;\n r1 = r4.mInstanceLock;\n monitor-enter(r1);\n r0 = r4.mCanReadHistoricalData;\t Catch:{ all -> 0x0028 }\n if (r0 == 0) goto L_0x000b;\n L_0x0007:\n r0 = r4.mHistoricalRecordsChanged;\t Catch:{ all -> 0x0028 }\n if (r0 != 0) goto L_0x000d;\n L_0x000b:\n monitor-exit(r1);\t Catch:{ all -> 0x0028 }\n L_0x000c:\n return;\n L_0x000d:\n r0 = 0;\n r4.mCanReadHistoricalData = r0;\t Catch:{ all -> 0x0028 }\n r0 = 1;\n r4.mReadShareHistoryCalled = r0;\t Catch:{ all -> 0x0028 }\n r0 = r4.mHistoryFileName;\t Catch:{ all -> 0x0028 }\n r0 = android.text.TextUtils.isEmpty(r0);\t Catch:{ all -> 0x0028 }\n if (r0 != 0) goto L_0x0026;\n L_0x001b:\n r0 = SERIAL_EXECUTOR;\t Catch:{ all -> 0x0028 }\n r2 = new com.actionbarsherlock.widget.ActivityChooserModel$HistoryLoader;\t Catch:{ all -> 0x0028 }\n r3 = 0;\n r2.<init>();\t Catch:{ all -> 0x0028 }\n r0.execute(r2);\t Catch:{ all -> 0x0028 }\n L_0x0026:\n monitor-exit(r1);\t Catch:{ all -> 0x0028 }\n goto L_0x000c;\n L_0x0028:\n r0 = move-exception;\n monitor-exit(r1);\t Catch:{ all -> 0x0028 }\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.actionbarsherlock.widget.ActivityChooserModel.readHistoricalData():void\");\n }",
"void showNextEventsLoadingWheel();",
"@Override\n public void onRewardedVideoAdLeftApplication() {\n\n }",
"@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tmVideoContrl.seekTo((int) time);\r\n\r\n\t\t\t\t\t\t}",
"public void movieEvent(Movie m) {\n m.read();\n}",
"@Override\n public void onBufferingUpdate(MediaPlayer mp, int percent) {\n }",
"@Override\n public void onBufferingUpdate(MediaPlayer mp, int percent) {\n }",
"public void listReceivedEvents() {\r\n for (Event event : receivedEvents) {\r\n System.out.print(event);\r\n }\r\n }"
] | [
"0.5642389",
"0.5618701",
"0.5612206",
"0.5558926",
"0.5558639",
"0.54350454",
"0.54342395",
"0.5433629",
"0.5410951",
"0.54028964",
"0.53566957",
"0.53508973",
"0.53502405",
"0.5296737",
"0.52803683",
"0.5275967",
"0.5252548",
"0.5248639",
"0.5230489",
"0.5218568",
"0.52105355",
"0.5197837",
"0.5197609",
"0.517503",
"0.51663786",
"0.516421",
"0.5161772",
"0.515347",
"0.5146894",
"0.5138214",
"0.51310045",
"0.5130865",
"0.51117426",
"0.5108436",
"0.51033795",
"0.50983196",
"0.5094641",
"0.5094129",
"0.5088654",
"0.50824267",
"0.5080175",
"0.5078965",
"0.5078959",
"0.5078526",
"0.50747985",
"0.5073473",
"0.50685257",
"0.50672925",
"0.5067017",
"0.5066921",
"0.5053527",
"0.5046264",
"0.5045783",
"0.5045708",
"0.50422347",
"0.502969",
"0.5009042",
"0.500433",
"0.50040877",
"0.50006545",
"0.4999113",
"0.49970913",
"0.499543",
"0.49894065",
"0.49877295",
"0.4985161",
"0.4983825",
"0.4983793",
"0.49812153",
"0.49809197",
"0.49809083",
"0.4975426",
"0.4975426",
"0.497282",
"0.4970808",
"0.4968898",
"0.4967207",
"0.49655986",
"0.4964582",
"0.49639264",
"0.49622244",
"0.4947744",
"0.49448127",
"0.4939865",
"0.4934621",
"0.493259",
"0.49268854",
"0.4925186",
"0.49247345",
"0.49242026",
"0.49239874",
"0.49183404",
"0.4914593",
"0.49140304",
"0.49136004",
"0.49015072",
"0.48970953",
"0.48938692",
"0.48938692",
"0.48757085"
] | 0.6825567 | 0 |
todo: let tmp = after set stop time if tmp time < start time, do nothing. | @Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { todo:
// let tmp = after set stop time
// if tmp time < start time, do nothing.
//
Calendar tmp = Calendar.getInstance();
tmp.set(year, monthOfYear, dayOfMonth, EventListFragment.this.mStopSearchCalendar.get(Calendar.HOUR_OF_DAY), EventListFragment.this
.mStopSearchCalendar.get(Calendar.MINUTE), 0);
if (tmp.after(EventListFragment.this.mStartSearchCalendar) || tmp.equals(EventListFragment.this.mStartSearchCalendar)) {
EventListFragment.this.mStopSearchCalendar.set(year, monthOfYear, dayOfMonth, EventListFragment.this.mStopSearchCalendar.get
(Calendar.HOUR_OF_DAY), EventListFragment.this.mStopSearchCalendar.get(Calendar.MINUTE), 0);
btnStopDate.setText(dateFormat.format(EventListFragment.this.mStopSearchCalendar.getTime()));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double getStopTime();",
"private boolean stop(int iter, int lastImprovement, long start) {\n if (USE_TIME)\n return System.currentTimeMillis() - start >= MAX_TIME;\n else\n return iter >= MAX_ITERATION || lastImprovement >= MAX_ITERATION / 5;\n }",
"public void setStopTime(int time) {\n\t\t\tmStopTime = time;\n\t\t}",
"@Override\n public void onTimeSet(TimePicker view, int hourOfDay, int minute) { todo:\n // let tmp = after set stop time\n // if tmp time < start time, do nothing.\n //\n Calendar tmp = Calendar.getInstance();\n tmp.set(EventListFragment.this.mStopSearchCalendar.get(Calendar.YEAR), EventListFragment.this.mStopSearchCalendar.get(Calendar\n .MONTH), EventListFragment.this.mStopSearchCalendar.get(Calendar.DAY_OF_MONTH), hourOfDay, minute, 0);\n\n if (tmp.after(EventListFragment.this.mStartSearchCalendar) || tmp.equals(EventListFragment.this.mStartSearchCalendar)) {\n\n EventListFragment.this.mStopSearchCalendar.set(EventListFragment.this.mStopSearchCalendar.get(Calendar.YEAR), EventListFragment\n .this.mStopSearchCalendar.get(Calendar.MONTH), EventListFragment.this.mStopSearchCalendar.get(Calendar.DAY_OF_MONTH),\n hourOfDay, minute);\n\n btnStopTime.setText(timeFormat.format(EventListFragment.this.mStopSearchCalendar.getTime()));\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 void pauseClock(boolean stop)\n {\n\tlong now = System.currentTimeMillis();\n\n\tif (stop) {\n\t pauseTime = now;\n\t} else {\n\t startTime += now - pauseTime;\n\t}\n }",
"boolean hasDesiredTime();",
"@Override\n public synchronized void stop() {\n final double temp = get();\n m_accumulatedTime = temp;\n m_running = false;\n }",
"public void setTimeEnd(long te)\n {\n this.timeEnd = (te > 0L)? te : -1L;\n }",
"public void addTime(Time t) {\n\t\tif (t.isStart()) {\n\t\t\tif (startTimes.isEmpty()) {\n\t\t\t\tfor (Time m : meanTimes) {\n\t\t\t\t\tif (Time.diff(m, t).getTimeAsInt() > stipulatedTime) {\n\t\t\t\t\t\tfinishTimes.add(m);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (Time f : finishTimes) {\n\t\t\t\t\tmeanTimes.remove(f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tstartTimes.add(t);\n\t\t} else {\n\t\t\tif (!startTimes.isEmpty() && Time.diff(t, startTimes.getFirst()).getTimeAsInt() > stipulatedTime) {\n\t\t\t\tfinishTimes.add(t);\n\t\t\t} else {\n\t\t\t\tmeanTimes.add(t);\n\t\t\t}\n\t\t}\n\t}",
"public void removeOverTime(){\r\n\t\tlong latest = timeQueue.getLast();\r\n\t\twhile( !timeQueue.isEmpty() && overlapRatioQueue.isEmpty() ){\r\n\t\t\tlong temp = timeQueue.getFirst();\r\n\t\t\tif( latest - temp > SMOOTING_INTERVAL ){\r\n\t\t\t\ttimeQueue.removeFirst();\r\n\t\t\t\toverlapRatioQueue.removeFirst();\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void updateWindow(long time) {\n for (long nextSecond = secondStart + NANO_IN_SECOND; end != null\n && nextSecond < time; nextSecond += NANO_IN_SECOND) {\n int count = 0;\n while (start != null && start.time < nextSecond) {\n count++;\n start = start.next;\n }\n lastSecondCount -= count;\n secondStart = nextSecond;\n updateLastSecond(count);\n if (start == null)\n end = null;\n }\n }",
"@Override\n\tboolean allow() {\n\t\tlong curTime = System.currentTimeMillis()/1000 * 1000;\n\t\tlong boundary = curTime - 1000;\n\t\tsynchronized (log) {\n\t\t\t//1. Remove old ones before the lower boundary\n\t\t\twhile (!log.isEmpty() && log.element() <= boundary) {\n\t\t\t\tlog.poll();\n\t\t\t}\n\t\t\t//2. Add / log the new time\n\t\t\tlog.add(curTime);\n\t\t\tboolean allow = log.size() <= maxReqPerUnitTime;\n\t\t\tSystem.out.println(curTime + \", log size = \" + log.size()+\", allow=\"+allow);\n\t\t\treturn allow;\n\t\t}\n\t}",
"public void durata(long start, long stop){\n\t\tlong durata = stop - start;\n\t\tlong secondi = durata % 60;\n\t\tlong minuti = durata / 60;\n\t\t\n\t\tSystem.out.println(\"Durata: \" + minuti + \"m \" + secondi + \"s\");\n\t}",
"abstract Long getStopTimestamp();",
"void setStopTimeout(int stopTimeout);",
"private void findStop(Airport departAPT, double distanceNeed, double maxRange){\n\t\t\tint stopIndex=-1;\r\n\t\t\tdouble stopDist=0;\r\n\t\t\tdouble stopToDestnDistance=999999999; //distance from depart to destination\r\n\t\t\tdouble startToStopDistance; //depart to stop distance\r\n\t\t\tdouble testDistance;\r\n\t\t\tString id;\r\n\r\n\t\t\tfor(int i=0; i<apt.size();++i){ //test every airport\r\n\t\t\t\t//cannot be destination or departing airport or dead end airport;\r\n\t\t\t\tid=apt.get(i).getID();\r\n\t\t\t\tif(id!=departAPT.getID() && id!=destnAPT.getID() && !deadEnd.contains(id)){\r\n\t\t\t\t\t//test avaliable fuel for this airplane type\r\n\t\t\t\t\tif(apt.get(i).getFuelType().contains(usePlane.getMatchType())){\r\n\t\t\t\t\t\tstartToStopDistance=findDistance(departAPT.getLat(),departAPT.getLon(),apt.get(i).getLat(),apt.get(i).getLon());\r\n\t\t\t\t\t\t//test if distance between depart and stop is in airplane's max travel range and if not same range as previous stop\r\n\t\t\t\t\t\tif(startToStopDistance<=maxRange && !stopAPTDist.contains(startToStopDistance)){\r\n\t\t\t\t\t\t\ttestDistance=findDistance(apt.get(i).getLat(),apt.get(i).getLon(),destnAPT.getLat(),destnAPT.getLon());\r\n\t\t\t\t\t\t\tif(testDistance<stopToDestnDistance){\r\n\t\t\t\t\t\t\t\tstopDist=startToStopDistance;\r\n\t\t\t\t\t\t\t\tstopIndex=i;\r\n\t\t\t\t\t\t\t\tstopToDestnDistance=testDistance;\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\t\t\tif(stopIndex!=-1){ //when stop is avaliable add this stop to info list\r\n\t\t\t\tstopAPT.add(apt.get(stopIndex));\r\n\t\t\t\tstopAPTDist.add(stopDist);\r\n\t\t\t\tif(stopToDestnDistance<=usePlane.getMaxRange()){ //if stop can reach destination, add final round and return to plan method\r\n\t\t\t\t\tstopAPT.add(destnAPT);\r\n\t\t\t\t\tstopAPTDist.add(findDistance(apt.get(stopIndex).getLat(),apt.get(stopIndex).getLon(),destnAPT.getLat(),destnAPT.getLon()));\r\n\t\t\t\t\tdeadEnd.clear();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse findStop(apt.get(stopIndex),stopToDestnDistance, usePlane.getMaxRange());\r\n\t\t\t}\r\n\t\t\telse { //when no stop is find, break the plan and clear everything\r\n\t\t\t\tif(stopAPT.isEmpty() || deadEnd.size()>5){\r\n\t\t\t\t\tstopAPT.clear();\r\n\t\t\t\t\tstopAPTDist.clear();\r\n\t\t\t\t\tdeadEnd.clear();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse{ //when stops routine cannot reach destination, clear all and start another path\r\n\t\t\t\tdeadEnd.add(departAPT.getID());\r\n\t\t\t\tstopAPT.clear();\r\n\t\t\t\tstopAPTDist.clear();\r\n\t\t\t\tif(startAPT.getFuelType().contains(usePlane.getMatchType())){\r\n\t\t\t\t\tfindStop(startAPT,dist,usePlane.getMaxRange());\r\n\t\t\t\t}else findStop(startAPT,dist,((fuelTank/usePlane.getFuelTank())*usePlane.getMaxRange()));\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t\t}",
"private int beforeNowAfter(Date lectureDate, int start, int end){\n Date now = new Date();\n if(lectureDate.getYear()<now.getYear()){\n return 0;\n }else if(lectureDate.getYear()>now.getYear()){\n return 2;\n }else{\n if(lectureDate.getMonth()<now.getMonth()){\n return 0;\n }else if(lectureDate.getMonth()>now.getMonth()){\n return 2;\n }else{\n if(lectureDate.getDate()<now.getDate()){\n return 0;\n }else if(lectureDate.getDate()>now.getDate()){\n return 2;\n }else{\n if(end==now.getHours()&&now.getMinutes()>15){ //Lectures end officially after 15min past the end hour.\n return 0;\n }else if(end<now.getHours()){\n return 0;\n }else if(start>now.getHours()){\n return 2;\n }else{\n return 1;\n }\n }\n }\n }\n }",
"private void degrade(int startTime, int stopTime, int lengthTime) {\n long fileStartPoint, fileStopPoint;\n float percent;\n\n percent = (float)startTime / (float)lengthTime;\n fileStartPoint = (long)(percent * fileLength);\n\n percent = (float)stopTime / (float)lengthTime;\n fileStopPoint = (long)(percent * fileLength);\n\n // Pause the thread for a sec to let movie stop playing properly...\n try {\n Thread.currentThread().sleep(3000);\n }\n catch(Exception e) {}\n\n // Now we know our start and stop times in the file, we can drop bits\n // out of that portion...\n try {\n RandomAccessFile rFile = new RandomAccessFile(file, \"rw\");\n boolean stillGoing = true;\n long nextPos = fileStartPoint;\n int byteRead, byteWrite;\n\n while(stillGoing) {\n // Check position does not clash with header or end of file...\n if ((nextPos > HEADER_SIZE) && (nextPos < fileLength)) {\n\n // Seek to the next position in the file and read the byte.\n rFile.seek(nextPos);\n byteRead = rFile.read();\n\n // If the byte read is already 0, we ignore it...\n if (byteRead > 0) {\n // 'Drop' a bit...\n byteWrite = byteRead - 1;\n\n // Re-write byte...\n rFile.seek(nextPos);\n rFile.write(byteWrite);\n }\n }\n // Increment to next position. Uses a randomly changed value so\n // we don't rot the same bit's repeatedly.\n nextPos += (INCREMENTOR + (java.lang.Math.random() * DEVIANCE));\n\n // If incremented beyond stop point, quit the loop...\n if (nextPos > fileStopPoint) {\n stillGoing = false;\n }\n }\n\n rFile.close();\n }\n catch(IOException e) {\n e.printStackTrace();\n }\n }",
"public void testTime()\n {\n SudokuTimer test = new SudokuTimer();\n\n mTimer.start();\n test.start();\n\n for (int i = 0; i < 1000000000; i++)\n {\n }\n\n assertTrue(mTimer.toString().equals(test.toString()));\n\n mTimer.stop();\n\n for (int i = 0; i < 1000000000; i++)\n {\n }\n\n assertFalse(mTimer.toString().equals(test.toString()));\n\n test.stop();\n mTimer.start();\n\n for (int i = 0; i < 1000000000; i++)\n {\n }\n\n mTimer.stop();\n\n //checks to the nearest second\n assertEquals(mTimer.getElapsedTime() / 1000,\n test.getElapsedTime() / 1000);\n }",
"void takeBefore(){\n beforeTimeNs=System.nanoTime();\n }",
"public long getSortTime(){ \n return endTime - startTime;\n }",
"public void setTime(int time)\n {\n this.time = time;\n start = time;\n end = time;\n }",
"final void minEvent() {\n minTime = Double.MAX_VALUE;\n if (timeOut.size() > 0) {\n for (int i = 0; i < timeOut.size(); i++) {\n if (timeOut.get(i) < minTime) {\n minTime = timeOut.get(i);\n num = i;\n }\n }\n }\n\n }",
"static void setTiming(){\n killTime=(Pars.txType!=0) ? Pars.txSt+Pars.txDur+60 : Pars.collectTimesB[2]+Pars.dataTime[1]+60;//time to kill simulation\n tracksTime=(Pars.tracks && Pars.txType==0) ? Pars.collectTimesI[1]:(Pars.tracks)? Pars.collectTimesBTx[1]:100*24*60;//time to record tracks\n }",
"public boolean setStartTime(int newStart)\n\t{\n\t\tif (newStart >= 0 && newStart < fileLength)\n\t\t{\n\t\t\tstartTime = newStart;\n\t\t\tif (startTime + playbackLength > fileLength)\n\t\t\t{\n\t\t\t\tplaybackLength = fileLength - startTime;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"private static float tock(){\n\t\treturn (System.currentTimeMillis() - startTime);\n\t}",
"public long stop() {\n long t = System.currentTimeMillis() - lastStart;\n if(count == 0)\n firstTime = t;\n totalTime += t;\n count++;\n updateHist(t);\n if(printIterval > 0 && count % printIterval == 0)\n System.out.println(this);\n return t;\n }",
"void beforeStop();",
"public void setStopTimestamp(long value) {\n this.stopTimestamp = value;\n }",
"public void testGetStartTime() {\n assertTrue(mb.getStartTime() > -1);\n }",
"@Override\n public boolean isFinished() {\n \n boolean thereYet = false;\n\n double time = timer.get();\n\n \n if (Math.abs(targetDistance - distanceTraveled) <= 4){\n\n thereYet = true;\n\n // else if(Math.abs(targetDistance - distanceTraveled) <= 24){\n\n //shifter.shiftDown();\n \n //}\n\n \n\n } else if (stopTime <= time - startTime){\n\n thereYet = true;\n }\n SmartDashboard.putNumber(\"Distance Traveled\", distanceTraveled);\n\n return thereYet;\n\n }",
"private boolean hfun(Time currentTime,POI last,POI poi,Plan mPlan,boolean skip){\n Time arriveAt=new Time(currentTime.hour,currentTime.min);\n if(last!=null){\n if(arriveAt.add(last.getShortestPath(poi.getId()))){\n if(poi.getOpenTime().compare(arriveAt)||skip){\n return true;\n }\n }\n }\n else{\n \n if(mPlan!=null){\n POI mLast = mPlan.getLastPOI();\n if(mLast!=null)\n arriveAt.add(mPlan.getLastPOI().getShortestPath(poi.getId()));\n }\n if(poi.getOpenTime().compare(arriveAt)||skip){\n return true;\n }\n }\n return false;\n }",
"@Override\n\tpublic long getTimeLapsed(long start, long end) {\n\t\tlong difference=(end - start);\n\t\treturn difference;\t}",
"public void stop() {\n endTime = System.currentTimeMillis();\n }",
"public boolean remainsTime() {\n current = System.currentTimeMillis();\n int timeSpent;\n timeSpent = (int) ((current-this.begin)/1000.0);\n return (timeSpent<=this.limite);\n }",
"public void setMaxTime(int aMaxTime)\n{\n // Set max time\n _maxTime = aMaxTime;\n \n // If time is greater than max-time, reset time to max time\n if(getTime()>_maxTime)\n setTime(_maxTime);\n}",
"public void setStartTime (long x)\r\n {\r\n startTime = x;\r\n }",
"boolean hasSolverTimeLimitSeconds();",
"public void setResetTimeOnStop(boolean aFlag) { _resetTimeOnStop = aFlag; }",
"boolean hasStartTime();",
"boolean shouldStop();",
"void removeBefore(double when,DystoreField fld)\n{\n if (fld == time_field && next_time >= when || tuple_data.size() == 0) return;\n\n if (tuple_data.size() > 1000000) {\n System.err.println(\"TUPLE SET SIZE = \" + tuple_data.size() + \" \" + when + \" \" + next_time +\n\t\t\t \" \" + last_check);\n for (DystoreTuple dt : tuple_data) {\n\t System.err.println(\"\\t\" + dt);\n }\n }\n\n time_field = fld;\n next_time = -1;\n for (Iterator<DystoreTuple> it = tuple_data.iterator(); it.hasNext(); ) {\n DystoreTuple dt = it.next();\n double t0 = dt.getTimeValue(fld);\n if (t0 < when) {\n\t // System.err.println(\"DYSTORE: REMOVE \" + t0 + \" \" + when + \" \" + dt);\n\t it.remove();\n }\n else if (next_time < 0 || t0 < next_time) next_time = t0;\n }\n\n last_check = when;\n}",
"private boolean validateArrivingTime(StopPoint currentSP) {\n\t\ttry {\n\t\t\tint time = Integer.valueOf(hourComboBox.getValue()) * 60;\n\t\t\ttime += Integer.valueOf(minuteComboBox.getValue());\n\t\t\ttime += timeIndicatorComboBox.getValue().equals(\"PM\") ? 12 * 60 : 0;\n\t\t\tfor (StopPoint stopPoint : stopPoints) {\n\t\t\t\tif (stopPoint.getTime() != null && !stopPoint.getTime().equals(\"\") && stopPoint != currentSP) {\n\t\t\t\t\tString[] spTimeString = stopPoint.getTime().split(\"[ :]+\");\n\t\t\t\t\tint spTime = Integer.valueOf(spTimeString[0]) * 60;\n\t\t\t\t\tspTime += Integer.valueOf(spTimeString[1]);\n\t\t\t\t\tspTime += spTimeString[2].equals(\"PM\") ? 12 * 60 : 0;\n\n\t\t\t\t\tif (time <= spTime + 5 && time >= spTime - 5) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\t}",
"@Override\n\tpublic void setStartTime(float t) \n\t{\n\t\t_tbeg = t;\n\t}",
"public void stop(){\n\t\tthis.timer.stop();\n\t\t//whenever we stop the entire game, also calculate the endTime\n\t\tthis.endTime = System.nanoTime();\n\t\tthis.time = this.startTime - this.endTime;\t//calculate the time difference\n\t\t\n\t\tthis.stop = true;\n\t}",
"public void xsetStopTime(org.landxml.schema.landXML11.GPSTime stopTime)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.landxml.schema.landXML11.GPSTime target = null;\r\n target = (org.landxml.schema.landXML11.GPSTime)get_store().find_attribute_user(STOPTIME$24);\r\n if (target == null)\r\n {\r\n target = (org.landxml.schema.landXML11.GPSTime)get_store().add_attribute_user(STOPTIME$24);\r\n }\r\n target.set(stopTime);\r\n }\r\n }",
"private void startStop()\n\t\t{\n\t\tif(currentAlgo!=null)\n\t\t\t{\n\t\t\tif(isRunning())\n\t\t\t\t{\n\t\t\t\tbStartStop.setText(\"Stopping\");\n\t\t\t\tthread.toStop=true;\n\t\t\t\tcurrentAlgo.setStopping(true);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tthread=new SteppingThread();\n\t\t\t\tbStartStop.setText(\"Stop\");\n\t\t\t\tthread.toStop=false;\n\t\t\t\tcurrentAlgo.setStopping(false);\n\t\t\t\tthread.start();\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"@Override\n public boolean isMayorAt(UnitTime ut) {\n return ((LongUnitTime)ut).getValue()<this.getValue();\n }",
"@Override\n\t\tpublic boolean isStopNode(TraversalPosition tp) {\n\t\t\t// System.out.println( \"\\nVisited nodes: \" + count++);\n\t\t\tStop currentStop = cache.get(tp.currentNode());\n\t\t\tif (currentStop.getStation().equals(dest)) {\n\t\t\t\treturn true;\n\t\t\t} else if ((currentStop.getTime() > stopTime))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}",
"public void timeToRunDec()\n\t{\n\t\tthis.time_to_run -- ;\n\t}",
"private void suspendCacheTimeMillis(boolean stw) {\n // Increment stop time at each call of this method.\n if (stw) {\n long oldSt;\n long newSt;\n do {\n oldSt = suspendedTime.get();\n if (oldSt == 0) {\n newSt = System.currentTimeMillis();\n } else {\n newSt = oldSt + 1;\n }\n } while (!suspendedTime.compareAndSet(oldSt, newSt));\n } else {\n suspendedTime.set(0);\n }\n }",
"private void maybeScheduleSlice(double when) {\n if (nextSliceRunTime > when) {\n timer.schedule(when);\n nextSliceRunTime = when;\n }\n }",
"public void setTimeStart(long ts)\n {\n this.timeStart = (ts > 0L)? ts : -1L;\n }",
"private static int compareEndTimes(TaskItem task1, TaskItem task2) {\n\t\tif (task1 instanceof FloatingTask) {\n\t\t\tif (task2 instanceof FloatingTask) {\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t} else if (task1 instanceof DeadlinedTask) {\n\t\t\tif (task2 instanceof FloatingTask) {\n\t\t\t\treturn 1;\n\t\t\t} else if (task2 instanceof DeadlinedTask) {\n\t\t\t\tDate endTime1 = ((DeadlinedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((DeadlinedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t} else {\n\t\t\t\tDate endTime1 = ((DeadlinedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((TimedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t}\n\t\t} else {\n\t\t\tif (task2 instanceof FloatingTask) {\n\t\t\t\treturn 1;\n\t\t\t} else if (task2 instanceof DeadlinedTask) {\n\t\t\t\tDate endTime1 = ((TimedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((DeadlinedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t} else {\n\t\t\t\tDate endTime1 = ((TimedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((TimedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t}\n\t\t}\n\t}",
"static final void park(boolean isAbsolute, long time)\n {\n VMThread vt = currentThread().vmThread;\n if (vt != null)\n {\n long ms;\n int ns = 0;\n if (isAbsolute ? (ms = time - VMSystem.currentTimeMillis()) > 0L :\n (ms = time / (1000L * 1000L)) >= 0L &&\n (ns = (int) (time % (1000L * 1000L))) >= 0)\n vt.parkInner(ms, ns);\n else\n {\n synchronized (vt)\n {\n vt.parkFlags = 0;\n }\n }\n }\n }",
"OffsetDateTime stopDateTime();",
"LocalDateTime calculateNextPossibleStartTime(LocalDateTime startTime);",
"private boolean checkStartTimeBeforeEndTime(String startTime, String endTime) {\n int startHour = Integer.parseInt(startTime.substring(0,2));\n int startMinute = Integer.parseInt(startTime.substring(2,4));\n int endHour = Integer.parseInt(endTime.substring(0,2));\n int endMinute = Integer.parseInt(endTime.substring(2,4));\n \n if (startHour < endHour) {\n return true;\n } else if (startHour > endHour) {\n return false;\n } else {\n if (startMinute < endMinute) {\n return true;\n } else {\n return false;\n }\n }\n }",
"static int logTime(int[] n, int start, int end, int val) {\n if(n == null || n.length == 0) return -1;\n int mid = (start + end) / 2;\n if(val < n[mid]) logTime(n, 0, mid, val);\n if(val > n[mid]) logTime(n, mid + 1, n.length, val);\n return n[mid];\n }",
"private long calculateTimeToWait(int min, int max, long totalRunningTime)\n {\n double randomNumber = Math.random();\n\n if (randomNumber < 0.003)\n return Random.nextInt(60523, 127443);\n\n if (randomNumber < 0.05)\n return Random.nextInt(2519, 28111);\n\n long waitTime = (long) Random.nextInt(min, max);\n return (long) Math.floor(waitTime * (1 / (1 - (totalRunningTime / FIVE_HOURS_MILLIS))));\n }",
"boolean isStop();",
"void timeCheck() throws Exception{\n\t\tif(arrival<time_check)\n\t\tthrow new Exception(\"Arrival time should be non-descending\");\n\t}",
"public void checkTimeRangeSettingsAccordingToTimeModelBeforeJadeStart() {\r\n\t\t\r\n\t\t// --- Get global ScheduleTimeRange --------------- \r\n\t\tScheduleTimeRange strGlobal = ScheduleTimeRangeController.getScheduleTimeRange();\r\n\t\tif (strGlobal==null) return;\r\n\t\t\r\n\t\t// --- Get Project instance -----------------------\r\n\t\tProject project = this.graphController.getProject();\r\n\t\tif (project==null) return; // (will not happen, but see 'save' call below)\r\n\t\t\r\n\t\t// --- Get date based time model ------------------\r\n\t\tTimeModel timeModel = this.graphController.getTimeModel();\r\n\t\tif (! (timeModel instanceof TimeModelDateBased)) return;\r\n\t\t\t\t\r\n\t\t// --- Get start and end time of the execution ---- \t\r\n\t\tTimeModelDateBased tmDataBased = (TimeModelDateBased) timeModel;\r\n\t\tlong startTime = tmDataBased.getTimeStart();\r\n\t\t\r\n\t\tif (strGlobal.getTimeFrom()!=startTime) {\r\n\t\t\t// --- ScheduleTimeRange needs to adjusted! --- \r\n\t\t\tlong shift = strGlobal.getTimeFrom() - startTime; \r\n\t\t\tScheduleTimeRange strGlobalNew = strGlobal.getCopy();\r\n\t\t\tstrGlobalNew.setTimeFrom(strGlobal.getTimeFrom() - shift);\r\n\t\t\tif (strGlobal.getRangeType()==RangeType.TimeRange) {\r\n\t\t\t\tstrGlobalNew.setTimeTo(strGlobal.getTimeTo() - shift);\r\n\t\t\t}\r\n\t\t\t// --- Set as new global ScheduleTimeRange ----\r\n\t\t\tScheduleTimeRangeController.setScheduleTimeRange(strGlobalNew , EVENT_CONFIGURED_IN_AWB_MAIN_WINDOW);\r\n\t\t\t\r\n\t\t\t// --- Save the project again -----------------\r\n\t\t\tproject.save();\r\n\t\t}\r\n\t\t\r\n\t}",
"TimeInstrument stop();",
"private void stopTime()\n {\n timer.stop();\n }",
"@Override\n\tprotected boolean isStoppingConditionReached() {\n\t\t\n\t\tboolean flag = iteration > maxIteration || \n\t\t\t\tlocalSearchTime > maxLocalSearchTime || \n\t\t\t\t!isUpdate;\n\t\tisUpdate = false ;\n\t\treturn flag ;\n\t}",
"@Test(timeout = 4000)\n public void test045() throws Throwable {\n Range range0 = Range.of((-32768L));\n Range range1 = Range.of((-32768L));\n boolean boolean0 = range0.endsBefore(range1);\n assertFalse(boolean0);\n \n long long0 = range0.getEnd();\n assertEquals((-32768L), long0);\n assertSame(range0, range1);\n }",
"public void setStart(long start) { this.start = start; }",
"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 stop() {\n assert (timeEnd == null);\n timeEnd = System.currentTimeMillis();\n if (recordAt != null) {\n recordAt.record(this);\n }\n }",
"private boolean checkTime(ActiveTimeSpans active, TimeSpan span, Object constraintKey)\n {\n if (span.isTimeless())\n {\n return true;\n }\n else if (constraintKey == null)\n {\n final AnimationPlan animationPlan = myAnimationPlan;\n final AnimationState currentAnimationState = myCurrentAnimationState;\n if (animationPlan == null || currentAnimationState == null)\n {\n return active != null && active.getPrimary().intersects(span);\n }\n final AnimationState state = animationPlan.findState(span, currentAnimationState.getDirection());\n if (state == null)\n {\n return false;\n }\n boolean result = false;\n try\n {\n result = animationPlan.calculateDistance(currentAnimationState, state) == 0;\n }\n catch (final RuntimeException e)\n {\n // If this test fails just fail the in range test as\n // this always happens during a plan change where the\n // distributor has yet to receive the updated plan and\n // ends up in a race condition with the animation\n // manager adjusting to the new plan.\n result = false;\n }\n return result;\n }\n else\n {\n final Collection<? extends TimeSpan> secondary = active == null ? null : active.getSecondary().get(constraintKey);\n boolean overlaps = false;\n if (secondary != null)\n {\n for (final TimeSpan ts : secondary)\n {\n if (ts.overlaps(span))\n {\n overlaps = true;\n break;\n }\n }\n }\n return overlaps;\n }\n }",
"boolean hasEndTime();",
"public Double waitTimeCalculatior(long start) {\n\t\t\t\tdouble difference = (System.currentTimeMillis() - start);\n\t\t\t\treturn difference;\n\t\t\t}",
"boolean hasUseTime();",
"boolean hasUseTime();",
"boolean hasCollectEndTime();",
"public long constrainStartTime(long proposed, long length) {\n Alloc pred = getPredecessor();\n Alloc succ = getSuccessor();\n if (pred != null) proposed = Math.max(pred.getEnd(), proposed);\n if (succ != null) proposed = Math.min(proposed, succ.getStart() - length);\n return proposed;\n }",
"public void setStart_time(long start_time) {\n this.start_time = start_time;\n }",
"@Override\n public long getTimeBucket(long time)\n {\n if (time < start) {\n return -1;\n }\n long diffFromStart = time - fixedStart;\n long key = diffFromStart / bucketSpanMillis;\n if (time >= end) {\n long diffInBuckets = (time - end) / bucketSpanMillis;\n long move = (diffInBuckets + 1) * bucketSpanMillis;\n start += move;\n end += move;\n // trigger purge when lower bound changes\n triggerPurge = (move > 0);\n if (triggerPurge) {\n lowestPurgeableTimeBucket = ((start - fixedStart) / bucketSpanMillis) - 2;\n }\n }\n return key;\n\n }",
"@Override\n protected boolean isFinished() {\n return Timer.getFPGATimestamp()-startT >= 1.5;\n }",
"public void setStopTime(double stopTime)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STOPTIME$24);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(STOPTIME$24);\r\n }\r\n target.setDoubleValue(stopTime);\r\n }\r\n }",
"public boolean stop(int floor);",
"@Override\n\tpublic void setStartTime(int t) {\n\t\t\n\t}",
"private long getTimeEnd(ArrayList<Point> r, ArrayList<Point> s){\n\t\t// Get the trajectory with earliest last point\n\t\tlong tn = s.get(s.size()-1).timeLong < r.get(r.size()-1).timeLong ? \n\t\t\t\ts.get(s.size()-1).timeLong : r.get(r.size()-1).timeLong;\n\t\treturn tn;\n\t}",
"private boolean canInsertLast(Plan plan,POI poi,Trip trip,Time currentTime,Plan mPlan,boolean skip){\n // if poi cost and time addtion to plan full cost and time satisify the constrains: \n // 1- full cost <= budget\n // 2- fulltime-poiTime >=poi.startTime if skip is false only\n // 3- fulltime <= trip.endTime\n // 4- fulltime <= poi.colseTime\n // insert and make Calculations and change last\n\n // Check 1\n if((plan.getFullCost()+poi.getCost())<=trip.getBudget()){\n // Check 2\n POI last=plan.getLastPOI();\n \n if(hfun(currentTime, last, poi, mPlan, skip)){\n // Check3\n // cal poi duration\n int fullduration=poi.getDuration();\n //cal waste time\n if(skip){\n Time currTime = new Time(currentTime.hour,currentTime.min);\n if(last!=null)\n currTime.add(last.getShortestPath(poi.getId()));\n else if(mPlan!=null&&mPlan.getLastPOI()!=null)\n currTime.add(mPlan.getLastPOI().getShortestPath(poi.getId()));\n int x = Time.substract(currTime, poi.getOpenTime());\n fullduration+=(x==-1)?0:x;\n }\n //cal travel time\n if(last!=null)\n fullduration+=last.getShortestPath(poi.getId());\n else if(mPlan!=null){\n POI mLast=mPlan.getLastPOI();\n if(mLast!=null)\n fullduration+= mLast.getShortestPath(poi.getId());\n }\n if(Time.isIn(currentTime, fullduration, trip.getEndTime())){\n // Check4\n if(Time.isIn(currentTime, fullduration, poi.getCloseTime())){\n return true;\n }\n }\n }\n }\n return false;\n }",
"public void setTimeRange(long timeStart, long timeEnd)\n {\n this.timeStart = timeStart;\n this.timeEnd = timeEnd;\n }",
"public void setFastestTime(long time)\r\n {\r\n //Check if the new fastest time is less than 0 before setting the new fastest time \r\n if(time < 0)\r\n {\r\n //Outouts a warning message\r\n System.out.println(\"WARNING:You cannot assign a negative time\");\r\n }\r\n else \r\n {\r\n this.fastestTime = time; \r\n }//end if\r\n }",
"boolean hasStopped()\n {\n if (running && ! isAlive())\n {\n nextStartTime = System.currentTimeMillis() + minDurationInMillis;\n running = false;\n return true;\n }\n return false;\n }",
"protected void isUserInStartZone() {\n\n //Checks to see if the user is in the specified radius near the start / end point\n if (mDistanceFromWaypoint < mZoneSize) {\n //The user is in the zone\n mIsInZone = true;\n\n //Calculates the bearings of the user's current location relative to the start point\n mWaypointBearing = mCurrentLocation.bearingTo(mWaypoint);\n mPreviousWaypointBearing = mPreviousLocation.bearingTo(mWaypoint);\n //When the timer is not running, start the timer. This will only trigger on the first lap\n if (!t.getRunning() && isUserPastStartPoint()) {\n //Calculates the time between the current location which triggered the timer to start\n //and the approximate time the user would have crossed the start line\n/* mStartTimeMod = t.getTimeBetweenGpsPing(mCurrentLocation, mPreviousLocation)\n - t.finishTimeEstimate(mCurrentLocation, mPreviousLocation);*/\n t.start();\n handler.postDelayed(updater, 30);\n }\n //When the timer is running the timer will be stopped if and only if the user has\n //already left the start zone and returned to it. This keeps the timer from stopping\n //if the GPS coordinates of the user are in the start zone for two GPS pings\n //Also checks to see if the user has crossed the start point via bearings delta\n if (t.getRunning() && mHasLeftZone && isUserPastStartPoint()) {\n //Calculates the time between the current location which triggered the timer to stop\n //and the approximate time the user would have crossed the finish line\n/* long finishTimeMod = t.getTimeBetweenGpsPing(mCurrentLocation, mPreviousLocation)\n - t.finishTimeEstimate(mCurrentLocation, mPreviousLocation);*/\n //stops the timer for this lap\n t.stop();\n //Resets the logic that the user has left the zone\n mHasLeftZone = false;\n\n //Modifies the lap time to subtract both the modifiers from the lap start\n //and lap finish\n mySession.addLap(t.getLaptime() /*- mStartTimeMod - finishTimeMod*/);\n\n //update laptimes textview with a list of the session's laptimes\n mPreviousLapTimeText.setText(mySession.formatLaptime(mySession.getLastLapLong()));\n mBestLapTimeText.setText(mySession.formatLaptime(mySession.getBestLapLong()));\n\n //Sets the modifier for the lap start to the previous lap's lap finish modifier\n /* mStartTimeMod = finishTimeMod;*/\n\n //Restarts the timer for the next lap\n t.start();\n handler.postDelayed(updater, 30);\n }\n } else {\n mIsInZone = false;\n //The user has left the zone while the timer is running\n if (t.getRunning()) {\n mHasLeftZone = true;\n }\n }\n }",
"public void start(){\n\n stopWatchStartTimeNanoSecs = magicBean.getCurrentThreadCpuTime();\n\n }",
"public void stopStopwatch() {\n timeCount = currentNanoTime.getAsLong();\n currentNanoTime = () -> timeCount;\n }",
"public void stop() {\n stopTime = Calendar.getInstance().getTime();\n long diff = stopTime.getTime() - startTime.getTime();\n\n writeln();\n writeln(\"# --------------------------------------------------------------------\");\n writeln(\"# << END OF LOGFILE >> \");\n writeln(\"# --------------------------------------------------------------------\");\n writeln(\"# STOP TIME : \" + stopTime);\n writeln(\"# ELAPSED TIME : \" + (diff / (1000L)) + \" seconds.\");\n writeln(\"# --------------------------------------------------------------------\");\n pw.close();\n }",
"public boolean shouldStop() {\n boolean isToStop = stop; // check if needs to stop\n stop = false; // update the flag for future use not to stop\n return isToStop;\n }",
"public void timeLogic(int time){\n //Add logic to decide time increments at which tickets will be granted\n }",
"public static void calTime() {\n time = new Date().getTime() - start;\n }",
"public void resetTimeLimit();",
"private boolean isTimeOverlap(Item t) {\n\t\treturn t.getEndDate().equals(event.getEndDate());\n\t}",
"public void unsetStopTime()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(STOPTIME$24);\r\n }\r\n }",
"public void fixStartEnd() {\n\t\tif (sstart > send) {\n\t\t\tint t = send;\n\t\t\tsend = sstart;\n\t\t\tsstart = t;\n\t\t}\n\n\t\tif (qstart > qend) {\n\t\t\tint t = qend;\n\t\t\tqend = qstart;\n\t\t\tqstart = t;\n\t\t}\n\t}",
"public void setStartTime(long value) {\r\n this.startTime = value;\r\n }"
] | [
"0.6132782",
"0.6050484",
"0.60462177",
"0.596304",
"0.5777072",
"0.5712613",
"0.5699096",
"0.56686944",
"0.5611078",
"0.55731755",
"0.5556696",
"0.55466634",
"0.5515741",
"0.5497797",
"0.5463952",
"0.54320985",
"0.5429607",
"0.540718",
"0.5395896",
"0.5381399",
"0.5375342",
"0.53719974",
"0.53564143",
"0.5341154",
"0.53384244",
"0.5330818",
"0.5322754",
"0.5315487",
"0.5312594",
"0.53120905",
"0.530847",
"0.5307388",
"0.53018457",
"0.5300241",
"0.52899355",
"0.52803606",
"0.5261932",
"0.526065",
"0.525315",
"0.5235656",
"0.5233654",
"0.5227806",
"0.52264464",
"0.5225438",
"0.52220845",
"0.5216064",
"0.5210805",
"0.5209517",
"0.5199535",
"0.51930314",
"0.5176136",
"0.5174453",
"0.5174227",
"0.5174086",
"0.51727796",
"0.51654595",
"0.5158728",
"0.5156087",
"0.5153738",
"0.5148894",
"0.5144369",
"0.5132133",
"0.51316875",
"0.51276374",
"0.5123898",
"0.51197505",
"0.51088506",
"0.51064223",
"0.50967944",
"0.50914866",
"0.508897",
"0.5080504",
"0.5070464",
"0.50687426",
"0.5065603",
"0.5065603",
"0.5063069",
"0.5057149",
"0.5056597",
"0.5046278",
"0.5042628",
"0.5041698",
"0.50366604",
"0.5032162",
"0.5031326",
"0.50129706",
"0.5012714",
"0.501255",
"0.5002502",
"0.49981293",
"0.49957758",
"0.49957198",
"0.4995664",
"0.4995467",
"0.49872535",
"0.49857372",
"0.4984308",
"0.49819124",
"0.4981274",
"0.49797493",
"0.49699342"
] | 0.0 | -1 |
todo: let tmp = after set stop time if tmp time < start time, do nothing. | @Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) { todo:
// let tmp = after set stop time
// if tmp time < start time, do nothing.
//
Calendar tmp = Calendar.getInstance();
tmp.set(EventListFragment.this.mStopSearchCalendar.get(Calendar.YEAR), EventListFragment.this.mStopSearchCalendar.get(Calendar
.MONTH), EventListFragment.this.mStopSearchCalendar.get(Calendar.DAY_OF_MONTH), hourOfDay, minute, 0);
if (tmp.after(EventListFragment.this.mStartSearchCalendar) || tmp.equals(EventListFragment.this.mStartSearchCalendar)) {
EventListFragment.this.mStopSearchCalendar.set(EventListFragment.this.mStopSearchCalendar.get(Calendar.YEAR), EventListFragment
.this.mStopSearchCalendar.get(Calendar.MONTH), EventListFragment.this.mStopSearchCalendar.get(Calendar.DAY_OF_MONTH),
hourOfDay, minute);
btnStopTime.setText(timeFormat.format(EventListFragment.this.mStopSearchCalendar.getTime()));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double getStopTime();",
"private boolean stop(int iter, int lastImprovement, long start) {\n if (USE_TIME)\n return System.currentTimeMillis() - start >= MAX_TIME;\n else\n return iter >= MAX_ITERATION || lastImprovement >= MAX_ITERATION / 5;\n }",
"public void setStopTime(int time) {\n\t\t\tmStopTime = time;\n\t\t}",
"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 void pauseClock(boolean stop)\n {\n\tlong now = System.currentTimeMillis();\n\n\tif (stop) {\n\t pauseTime = now;\n\t} else {\n\t startTime += now - pauseTime;\n\t}\n }",
"boolean hasDesiredTime();",
"@Override\n public synchronized void stop() {\n final double temp = get();\n m_accumulatedTime = temp;\n m_running = false;\n }",
"public void setTimeEnd(long te)\n {\n this.timeEnd = (te > 0L)? te : -1L;\n }",
"public void addTime(Time t) {\n\t\tif (t.isStart()) {\n\t\t\tif (startTimes.isEmpty()) {\n\t\t\t\tfor (Time m : meanTimes) {\n\t\t\t\t\tif (Time.diff(m, t).getTimeAsInt() > stipulatedTime) {\n\t\t\t\t\t\tfinishTimes.add(m);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (Time f : finishTimes) {\n\t\t\t\t\tmeanTimes.remove(f);\n\t\t\t\t}\n\t\t\t}\n\t\t\tstartTimes.add(t);\n\t\t} else {\n\t\t\tif (!startTimes.isEmpty() && Time.diff(t, startTimes.getFirst()).getTimeAsInt() > stipulatedTime) {\n\t\t\t\tfinishTimes.add(t);\n\t\t\t} else {\n\t\t\t\tmeanTimes.add(t);\n\t\t\t}\n\t\t}\n\t}",
"public void removeOverTime(){\r\n\t\tlong latest = timeQueue.getLast();\r\n\t\twhile( !timeQueue.isEmpty() && overlapRatioQueue.isEmpty() ){\r\n\t\t\tlong temp = timeQueue.getFirst();\r\n\t\t\tif( latest - temp > SMOOTING_INTERVAL ){\r\n\t\t\t\ttimeQueue.removeFirst();\r\n\t\t\t\toverlapRatioQueue.removeFirst();\r\n\t\t\t}else{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void updateWindow(long time) {\n for (long nextSecond = secondStart + NANO_IN_SECOND; end != null\n && nextSecond < time; nextSecond += NANO_IN_SECOND) {\n int count = 0;\n while (start != null && start.time < nextSecond) {\n count++;\n start = start.next;\n }\n lastSecondCount -= count;\n secondStart = nextSecond;\n updateLastSecond(count);\n if (start == null)\n end = null;\n }\n }",
"@Override\n\tboolean allow() {\n\t\tlong curTime = System.currentTimeMillis()/1000 * 1000;\n\t\tlong boundary = curTime - 1000;\n\t\tsynchronized (log) {\n\t\t\t//1. Remove old ones before the lower boundary\n\t\t\twhile (!log.isEmpty() && log.element() <= boundary) {\n\t\t\t\tlog.poll();\n\t\t\t}\n\t\t\t//2. Add / log the new time\n\t\t\tlog.add(curTime);\n\t\t\tboolean allow = log.size() <= maxReqPerUnitTime;\n\t\t\tSystem.out.println(curTime + \", log size = \" + log.size()+\", allow=\"+allow);\n\t\t\treturn allow;\n\t\t}\n\t}",
"public void durata(long start, long stop){\n\t\tlong durata = stop - start;\n\t\tlong secondi = durata % 60;\n\t\tlong minuti = durata / 60;\n\t\t\n\t\tSystem.out.println(\"Durata: \" + minuti + \"m \" + secondi + \"s\");\n\t}",
"abstract Long getStopTimestamp();",
"void setStopTimeout(int stopTimeout);",
"private void findStop(Airport departAPT, double distanceNeed, double maxRange){\n\t\t\tint stopIndex=-1;\r\n\t\t\tdouble stopDist=0;\r\n\t\t\tdouble stopToDestnDistance=999999999; //distance from depart to destination\r\n\t\t\tdouble startToStopDistance; //depart to stop distance\r\n\t\t\tdouble testDistance;\r\n\t\t\tString id;\r\n\r\n\t\t\tfor(int i=0; i<apt.size();++i){ //test every airport\r\n\t\t\t\t//cannot be destination or departing airport or dead end airport;\r\n\t\t\t\tid=apt.get(i).getID();\r\n\t\t\t\tif(id!=departAPT.getID() && id!=destnAPT.getID() && !deadEnd.contains(id)){\r\n\t\t\t\t\t//test avaliable fuel for this airplane type\r\n\t\t\t\t\tif(apt.get(i).getFuelType().contains(usePlane.getMatchType())){\r\n\t\t\t\t\t\tstartToStopDistance=findDistance(departAPT.getLat(),departAPT.getLon(),apt.get(i).getLat(),apt.get(i).getLon());\r\n\t\t\t\t\t\t//test if distance between depart and stop is in airplane's max travel range and if not same range as previous stop\r\n\t\t\t\t\t\tif(startToStopDistance<=maxRange && !stopAPTDist.contains(startToStopDistance)){\r\n\t\t\t\t\t\t\ttestDistance=findDistance(apt.get(i).getLat(),apt.get(i).getLon(),destnAPT.getLat(),destnAPT.getLon());\r\n\t\t\t\t\t\t\tif(testDistance<stopToDestnDistance){\r\n\t\t\t\t\t\t\t\tstopDist=startToStopDistance;\r\n\t\t\t\t\t\t\t\tstopIndex=i;\r\n\t\t\t\t\t\t\t\tstopToDestnDistance=testDistance;\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\t\t\tif(stopIndex!=-1){ //when stop is avaliable add this stop to info list\r\n\t\t\t\tstopAPT.add(apt.get(stopIndex));\r\n\t\t\t\tstopAPTDist.add(stopDist);\r\n\t\t\t\tif(stopToDestnDistance<=usePlane.getMaxRange()){ //if stop can reach destination, add final round and return to plan method\r\n\t\t\t\t\tstopAPT.add(destnAPT);\r\n\t\t\t\t\tstopAPTDist.add(findDistance(apt.get(stopIndex).getLat(),apt.get(stopIndex).getLon(),destnAPT.getLat(),destnAPT.getLon()));\r\n\t\t\t\t\tdeadEnd.clear();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse findStop(apt.get(stopIndex),stopToDestnDistance, usePlane.getMaxRange());\r\n\t\t\t}\r\n\t\t\telse { //when no stop is find, break the plan and clear everything\r\n\t\t\t\tif(stopAPT.isEmpty() || deadEnd.size()>5){\r\n\t\t\t\t\tstopAPT.clear();\r\n\t\t\t\t\tstopAPTDist.clear();\r\n\t\t\t\t\tdeadEnd.clear();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse{ //when stops routine cannot reach destination, clear all and start another path\r\n\t\t\t\tdeadEnd.add(departAPT.getID());\r\n\t\t\t\tstopAPT.clear();\r\n\t\t\t\tstopAPTDist.clear();\r\n\t\t\t\tif(startAPT.getFuelType().contains(usePlane.getMatchType())){\r\n\t\t\t\t\tfindStop(startAPT,dist,usePlane.getMaxRange());\r\n\t\t\t\t}else findStop(startAPT,dist,((fuelTank/usePlane.getFuelTank())*usePlane.getMaxRange()));\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t\t}",
"private int beforeNowAfter(Date lectureDate, int start, int end){\n Date now = new Date();\n if(lectureDate.getYear()<now.getYear()){\n return 0;\n }else if(lectureDate.getYear()>now.getYear()){\n return 2;\n }else{\n if(lectureDate.getMonth()<now.getMonth()){\n return 0;\n }else if(lectureDate.getMonth()>now.getMonth()){\n return 2;\n }else{\n if(lectureDate.getDate()<now.getDate()){\n return 0;\n }else if(lectureDate.getDate()>now.getDate()){\n return 2;\n }else{\n if(end==now.getHours()&&now.getMinutes()>15){ //Lectures end officially after 15min past the end hour.\n return 0;\n }else if(end<now.getHours()){\n return 0;\n }else if(start>now.getHours()){\n return 2;\n }else{\n return 1;\n }\n }\n }\n }\n }",
"private void degrade(int startTime, int stopTime, int lengthTime) {\n long fileStartPoint, fileStopPoint;\n float percent;\n\n percent = (float)startTime / (float)lengthTime;\n fileStartPoint = (long)(percent * fileLength);\n\n percent = (float)stopTime / (float)lengthTime;\n fileStopPoint = (long)(percent * fileLength);\n\n // Pause the thread for a sec to let movie stop playing properly...\n try {\n Thread.currentThread().sleep(3000);\n }\n catch(Exception e) {}\n\n // Now we know our start and stop times in the file, we can drop bits\n // out of that portion...\n try {\n RandomAccessFile rFile = new RandomAccessFile(file, \"rw\");\n boolean stillGoing = true;\n long nextPos = fileStartPoint;\n int byteRead, byteWrite;\n\n while(stillGoing) {\n // Check position does not clash with header or end of file...\n if ((nextPos > HEADER_SIZE) && (nextPos < fileLength)) {\n\n // Seek to the next position in the file and read the byte.\n rFile.seek(nextPos);\n byteRead = rFile.read();\n\n // If the byte read is already 0, we ignore it...\n if (byteRead > 0) {\n // 'Drop' a bit...\n byteWrite = byteRead - 1;\n\n // Re-write byte...\n rFile.seek(nextPos);\n rFile.write(byteWrite);\n }\n }\n // Increment to next position. Uses a randomly changed value so\n // we don't rot the same bit's repeatedly.\n nextPos += (INCREMENTOR + (java.lang.Math.random() * DEVIANCE));\n\n // If incremented beyond stop point, quit the loop...\n if (nextPos > fileStopPoint) {\n stillGoing = false;\n }\n }\n\n rFile.close();\n }\n catch(IOException e) {\n e.printStackTrace();\n }\n }",
"public void testTime()\n {\n SudokuTimer test = new SudokuTimer();\n\n mTimer.start();\n test.start();\n\n for (int i = 0; i < 1000000000; i++)\n {\n }\n\n assertTrue(mTimer.toString().equals(test.toString()));\n\n mTimer.stop();\n\n for (int i = 0; i < 1000000000; i++)\n {\n }\n\n assertFalse(mTimer.toString().equals(test.toString()));\n\n test.stop();\n mTimer.start();\n\n for (int i = 0; i < 1000000000; i++)\n {\n }\n\n mTimer.stop();\n\n //checks to the nearest second\n assertEquals(mTimer.getElapsedTime() / 1000,\n test.getElapsedTime() / 1000);\n }",
"void takeBefore(){\n beforeTimeNs=System.nanoTime();\n }",
"public long getSortTime(){ \n return endTime - startTime;\n }",
"public void setTime(int time)\n {\n this.time = time;\n start = time;\n end = time;\n }",
"final void minEvent() {\n minTime = Double.MAX_VALUE;\n if (timeOut.size() > 0) {\n for (int i = 0; i < timeOut.size(); i++) {\n if (timeOut.get(i) < minTime) {\n minTime = timeOut.get(i);\n num = i;\n }\n }\n }\n\n }",
"static void setTiming(){\n killTime=(Pars.txType!=0) ? Pars.txSt+Pars.txDur+60 : Pars.collectTimesB[2]+Pars.dataTime[1]+60;//time to kill simulation\n tracksTime=(Pars.tracks && Pars.txType==0) ? Pars.collectTimesI[1]:(Pars.tracks)? Pars.collectTimesBTx[1]:100*24*60;//time to record tracks\n }",
"public boolean setStartTime(int newStart)\n\t{\n\t\tif (newStart >= 0 && newStart < fileLength)\n\t\t{\n\t\t\tstartTime = newStart;\n\t\t\tif (startTime + playbackLength > fileLength)\n\t\t\t{\n\t\t\t\tplaybackLength = fileLength - startTime;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"private static float tock(){\n\t\treturn (System.currentTimeMillis() - startTime);\n\t}",
"public long stop() {\n long t = System.currentTimeMillis() - lastStart;\n if(count == 0)\n firstTime = t;\n totalTime += t;\n count++;\n updateHist(t);\n if(printIterval > 0 && count % printIterval == 0)\n System.out.println(this);\n return t;\n }",
"void beforeStop();",
"public void setStopTimestamp(long value) {\n this.stopTimestamp = value;\n }",
"@Override\n public boolean isFinished() {\n \n boolean thereYet = false;\n\n double time = timer.get();\n\n \n if (Math.abs(targetDistance - distanceTraveled) <= 4){\n\n thereYet = true;\n\n // else if(Math.abs(targetDistance - distanceTraveled) <= 24){\n\n //shifter.shiftDown();\n \n //}\n\n \n\n } else if (stopTime <= time - startTime){\n\n thereYet = true;\n }\n SmartDashboard.putNumber(\"Distance Traveled\", distanceTraveled);\n\n return thereYet;\n\n }",
"public void testGetStartTime() {\n assertTrue(mb.getStartTime() > -1);\n }",
"private boolean hfun(Time currentTime,POI last,POI poi,Plan mPlan,boolean skip){\n Time arriveAt=new Time(currentTime.hour,currentTime.min);\n if(last!=null){\n if(arriveAt.add(last.getShortestPath(poi.getId()))){\n if(poi.getOpenTime().compare(arriveAt)||skip){\n return true;\n }\n }\n }\n else{\n \n if(mPlan!=null){\n POI mLast = mPlan.getLastPOI();\n if(mLast!=null)\n arriveAt.add(mPlan.getLastPOI().getShortestPath(poi.getId()));\n }\n if(poi.getOpenTime().compare(arriveAt)||skip){\n return true;\n }\n }\n return false;\n }",
"@Override\n\tpublic long getTimeLapsed(long start, long end) {\n\t\tlong difference=(end - start);\n\t\treturn difference;\t}",
"public void stop() {\n endTime = System.currentTimeMillis();\n }",
"public boolean remainsTime() {\n current = System.currentTimeMillis();\n int timeSpent;\n timeSpent = (int) ((current-this.begin)/1000.0);\n return (timeSpent<=this.limite);\n }",
"public void setMaxTime(int aMaxTime)\n{\n // Set max time\n _maxTime = aMaxTime;\n \n // If time is greater than max-time, reset time to max time\n if(getTime()>_maxTime)\n setTime(_maxTime);\n}",
"public void setStartTime (long x)\r\n {\r\n startTime = x;\r\n }",
"boolean hasSolverTimeLimitSeconds();",
"public void setResetTimeOnStop(boolean aFlag) { _resetTimeOnStop = aFlag; }",
"boolean hasStartTime();",
"boolean shouldStop();",
"void removeBefore(double when,DystoreField fld)\n{\n if (fld == time_field && next_time >= when || tuple_data.size() == 0) return;\n\n if (tuple_data.size() > 1000000) {\n System.err.println(\"TUPLE SET SIZE = \" + tuple_data.size() + \" \" + when + \" \" + next_time +\n\t\t\t \" \" + last_check);\n for (DystoreTuple dt : tuple_data) {\n\t System.err.println(\"\\t\" + dt);\n }\n }\n\n time_field = fld;\n next_time = -1;\n for (Iterator<DystoreTuple> it = tuple_data.iterator(); it.hasNext(); ) {\n DystoreTuple dt = it.next();\n double t0 = dt.getTimeValue(fld);\n if (t0 < when) {\n\t // System.err.println(\"DYSTORE: REMOVE \" + t0 + \" \" + when + \" \" + dt);\n\t it.remove();\n }\n else if (next_time < 0 || t0 < next_time) next_time = t0;\n }\n\n last_check = when;\n}",
"private boolean validateArrivingTime(StopPoint currentSP) {\n\t\ttry {\n\t\t\tint time = Integer.valueOf(hourComboBox.getValue()) * 60;\n\t\t\ttime += Integer.valueOf(minuteComboBox.getValue());\n\t\t\ttime += timeIndicatorComboBox.getValue().equals(\"PM\") ? 12 * 60 : 0;\n\t\t\tfor (StopPoint stopPoint : stopPoints) {\n\t\t\t\tif (stopPoint.getTime() != null && !stopPoint.getTime().equals(\"\") && stopPoint != currentSP) {\n\t\t\t\t\tString[] spTimeString = stopPoint.getTime().split(\"[ :]+\");\n\t\t\t\t\tint spTime = Integer.valueOf(spTimeString[0]) * 60;\n\t\t\t\t\tspTime += Integer.valueOf(spTimeString[1]);\n\t\t\t\t\tspTime += spTimeString[2].equals(\"PM\") ? 12 * 60 : 0;\n\n\t\t\t\t\tif (time <= spTime + 5 && time >= spTime - 5) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\t}",
"@Override\n\tpublic void setStartTime(float t) \n\t{\n\t\t_tbeg = t;\n\t}",
"public void stop(){\n\t\tthis.timer.stop();\n\t\t//whenever we stop the entire game, also calculate the endTime\n\t\tthis.endTime = System.nanoTime();\n\t\tthis.time = this.startTime - this.endTime;\t//calculate the time difference\n\t\t\n\t\tthis.stop = true;\n\t}",
"public void xsetStopTime(org.landxml.schema.landXML11.GPSTime stopTime)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.landxml.schema.landXML11.GPSTime target = null;\r\n target = (org.landxml.schema.landXML11.GPSTime)get_store().find_attribute_user(STOPTIME$24);\r\n if (target == null)\r\n {\r\n target = (org.landxml.schema.landXML11.GPSTime)get_store().add_attribute_user(STOPTIME$24);\r\n }\r\n target.set(stopTime);\r\n }\r\n }",
"private void startStop()\n\t\t{\n\t\tif(currentAlgo!=null)\n\t\t\t{\n\t\t\tif(isRunning())\n\t\t\t\t{\n\t\t\t\tbStartStop.setText(\"Stopping\");\n\t\t\t\tthread.toStop=true;\n\t\t\t\tcurrentAlgo.setStopping(true);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tthread=new SteppingThread();\n\t\t\t\tbStartStop.setText(\"Stop\");\n\t\t\t\tthread.toStop=false;\n\t\t\t\tcurrentAlgo.setStopping(false);\n\t\t\t\tthread.start();\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"@Override\n public boolean isMayorAt(UnitTime ut) {\n return ((LongUnitTime)ut).getValue()<this.getValue();\n }",
"@Override\n\t\tpublic boolean isStopNode(TraversalPosition tp) {\n\t\t\t// System.out.println( \"\\nVisited nodes: \" + count++);\n\t\t\tStop currentStop = cache.get(tp.currentNode());\n\t\t\tif (currentStop.getStation().equals(dest)) {\n\t\t\t\treturn true;\n\t\t\t} else if ((currentStop.getTime() > stopTime))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}",
"public void timeToRunDec()\n\t{\n\t\tthis.time_to_run -- ;\n\t}",
"private void maybeScheduleSlice(double when) {\n if (nextSliceRunTime > when) {\n timer.schedule(when);\n nextSliceRunTime = when;\n }\n }",
"private void suspendCacheTimeMillis(boolean stw) {\n // Increment stop time at each call of this method.\n if (stw) {\n long oldSt;\n long newSt;\n do {\n oldSt = suspendedTime.get();\n if (oldSt == 0) {\n newSt = System.currentTimeMillis();\n } else {\n newSt = oldSt + 1;\n }\n } while (!suspendedTime.compareAndSet(oldSt, newSt));\n } else {\n suspendedTime.set(0);\n }\n }",
"private static int compareEndTimes(TaskItem task1, TaskItem task2) {\n\t\tif (task1 instanceof FloatingTask) {\n\t\t\tif (task2 instanceof FloatingTask) {\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t} else if (task1 instanceof DeadlinedTask) {\n\t\t\tif (task2 instanceof FloatingTask) {\n\t\t\t\treturn 1;\n\t\t\t} else if (task2 instanceof DeadlinedTask) {\n\t\t\t\tDate endTime1 = ((DeadlinedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((DeadlinedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t} else {\n\t\t\t\tDate endTime1 = ((DeadlinedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((TimedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t}\n\t\t} else {\n\t\t\tif (task2 instanceof FloatingTask) {\n\t\t\t\treturn 1;\n\t\t\t} else if (task2 instanceof DeadlinedTask) {\n\t\t\t\tDate endTime1 = ((TimedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((DeadlinedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t} else {\n\t\t\t\tDate endTime1 = ((TimedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((TimedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t}\n\t\t}\n\t}",
"public void setTimeStart(long ts)\n {\n this.timeStart = (ts > 0L)? ts : -1L;\n }",
"static final void park(boolean isAbsolute, long time)\n {\n VMThread vt = currentThread().vmThread;\n if (vt != null)\n {\n long ms;\n int ns = 0;\n if (isAbsolute ? (ms = time - VMSystem.currentTimeMillis()) > 0L :\n (ms = time / (1000L * 1000L)) >= 0L &&\n (ns = (int) (time % (1000L * 1000L))) >= 0)\n vt.parkInner(ms, ns);\n else\n {\n synchronized (vt)\n {\n vt.parkFlags = 0;\n }\n }\n }\n }",
"OffsetDateTime stopDateTime();",
"LocalDateTime calculateNextPossibleStartTime(LocalDateTime startTime);",
"private boolean checkStartTimeBeforeEndTime(String startTime, String endTime) {\n int startHour = Integer.parseInt(startTime.substring(0,2));\n int startMinute = Integer.parseInt(startTime.substring(2,4));\n int endHour = Integer.parseInt(endTime.substring(0,2));\n int endMinute = Integer.parseInt(endTime.substring(2,4));\n \n if (startHour < endHour) {\n return true;\n } else if (startHour > endHour) {\n return false;\n } else {\n if (startMinute < endMinute) {\n return true;\n } else {\n return false;\n }\n }\n }",
"static int logTime(int[] n, int start, int end, int val) {\n if(n == null || n.length == 0) return -1;\n int mid = (start + end) / 2;\n if(val < n[mid]) logTime(n, 0, mid, val);\n if(val > n[mid]) logTime(n, mid + 1, n.length, val);\n return n[mid];\n }",
"private long calculateTimeToWait(int min, int max, long totalRunningTime)\n {\n double randomNumber = Math.random();\n\n if (randomNumber < 0.003)\n return Random.nextInt(60523, 127443);\n\n if (randomNumber < 0.05)\n return Random.nextInt(2519, 28111);\n\n long waitTime = (long) Random.nextInt(min, max);\n return (long) Math.floor(waitTime * (1 / (1 - (totalRunningTime / FIVE_HOURS_MILLIS))));\n }",
"boolean isStop();",
"void timeCheck() throws Exception{\n\t\tif(arrival<time_check)\n\t\tthrow new Exception(\"Arrival time should be non-descending\");\n\t}",
"public void checkTimeRangeSettingsAccordingToTimeModelBeforeJadeStart() {\r\n\t\t\r\n\t\t// --- Get global ScheduleTimeRange --------------- \r\n\t\tScheduleTimeRange strGlobal = ScheduleTimeRangeController.getScheduleTimeRange();\r\n\t\tif (strGlobal==null) return;\r\n\t\t\r\n\t\t// --- Get Project instance -----------------------\r\n\t\tProject project = this.graphController.getProject();\r\n\t\tif (project==null) return; // (will not happen, but see 'save' call below)\r\n\t\t\r\n\t\t// --- Get date based time model ------------------\r\n\t\tTimeModel timeModel = this.graphController.getTimeModel();\r\n\t\tif (! (timeModel instanceof TimeModelDateBased)) return;\r\n\t\t\t\t\r\n\t\t// --- Get start and end time of the execution ---- \t\r\n\t\tTimeModelDateBased tmDataBased = (TimeModelDateBased) timeModel;\r\n\t\tlong startTime = tmDataBased.getTimeStart();\r\n\t\t\r\n\t\tif (strGlobal.getTimeFrom()!=startTime) {\r\n\t\t\t// --- ScheduleTimeRange needs to adjusted! --- \r\n\t\t\tlong shift = strGlobal.getTimeFrom() - startTime; \r\n\t\t\tScheduleTimeRange strGlobalNew = strGlobal.getCopy();\r\n\t\t\tstrGlobalNew.setTimeFrom(strGlobal.getTimeFrom() - shift);\r\n\t\t\tif (strGlobal.getRangeType()==RangeType.TimeRange) {\r\n\t\t\t\tstrGlobalNew.setTimeTo(strGlobal.getTimeTo() - shift);\r\n\t\t\t}\r\n\t\t\t// --- Set as new global ScheduleTimeRange ----\r\n\t\t\tScheduleTimeRangeController.setScheduleTimeRange(strGlobalNew , EVENT_CONFIGURED_IN_AWB_MAIN_WINDOW);\r\n\t\t\t\r\n\t\t\t// --- Save the project again -----------------\r\n\t\t\tproject.save();\r\n\t\t}\r\n\t\t\r\n\t}",
"TimeInstrument stop();",
"private void stopTime()\n {\n timer.stop();\n }",
"@Override\n\tprotected boolean isStoppingConditionReached() {\n\t\t\n\t\tboolean flag = iteration > maxIteration || \n\t\t\t\tlocalSearchTime > maxLocalSearchTime || \n\t\t\t\t!isUpdate;\n\t\tisUpdate = false ;\n\t\treturn flag ;\n\t}",
"@Test(timeout = 4000)\n public void test045() throws Throwable {\n Range range0 = Range.of((-32768L));\n Range range1 = Range.of((-32768L));\n boolean boolean0 = range0.endsBefore(range1);\n assertFalse(boolean0);\n \n long long0 = range0.getEnd();\n assertEquals((-32768L), long0);\n assertSame(range0, range1);\n }",
"public void setStart(long start) { this.start = start; }",
"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 stop() {\n assert (timeEnd == null);\n timeEnd = System.currentTimeMillis();\n if (recordAt != null) {\n recordAt.record(this);\n }\n }",
"private boolean checkTime(ActiveTimeSpans active, TimeSpan span, Object constraintKey)\n {\n if (span.isTimeless())\n {\n return true;\n }\n else if (constraintKey == null)\n {\n final AnimationPlan animationPlan = myAnimationPlan;\n final AnimationState currentAnimationState = myCurrentAnimationState;\n if (animationPlan == null || currentAnimationState == null)\n {\n return active != null && active.getPrimary().intersects(span);\n }\n final AnimationState state = animationPlan.findState(span, currentAnimationState.getDirection());\n if (state == null)\n {\n return false;\n }\n boolean result = false;\n try\n {\n result = animationPlan.calculateDistance(currentAnimationState, state) == 0;\n }\n catch (final RuntimeException e)\n {\n // If this test fails just fail the in range test as\n // this always happens during a plan change where the\n // distributor has yet to receive the updated plan and\n // ends up in a race condition with the animation\n // manager adjusting to the new plan.\n result = false;\n }\n return result;\n }\n else\n {\n final Collection<? extends TimeSpan> secondary = active == null ? null : active.getSecondary().get(constraintKey);\n boolean overlaps = false;\n if (secondary != null)\n {\n for (final TimeSpan ts : secondary)\n {\n if (ts.overlaps(span))\n {\n overlaps = true;\n break;\n }\n }\n }\n return overlaps;\n }\n }",
"boolean hasEndTime();",
"public Double waitTimeCalculatior(long start) {\n\t\t\t\tdouble difference = (System.currentTimeMillis() - start);\n\t\t\t\treturn difference;\n\t\t\t}",
"boolean hasUseTime();",
"boolean hasUseTime();",
"boolean hasCollectEndTime();",
"public long constrainStartTime(long proposed, long length) {\n Alloc pred = getPredecessor();\n Alloc succ = getSuccessor();\n if (pred != null) proposed = Math.max(pred.getEnd(), proposed);\n if (succ != null) proposed = Math.min(proposed, succ.getStart() - length);\n return proposed;\n }",
"public void setStart_time(long start_time) {\n this.start_time = start_time;\n }",
"@Override\n public long getTimeBucket(long time)\n {\n if (time < start) {\n return -1;\n }\n long diffFromStart = time - fixedStart;\n long key = diffFromStart / bucketSpanMillis;\n if (time >= end) {\n long diffInBuckets = (time - end) / bucketSpanMillis;\n long move = (diffInBuckets + 1) * bucketSpanMillis;\n start += move;\n end += move;\n // trigger purge when lower bound changes\n triggerPurge = (move > 0);\n if (triggerPurge) {\n lowestPurgeableTimeBucket = ((start - fixedStart) / bucketSpanMillis) - 2;\n }\n }\n return key;\n\n }",
"@Override\n protected boolean isFinished() {\n return Timer.getFPGATimestamp()-startT >= 1.5;\n }",
"public void setStopTime(double stopTime)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STOPTIME$24);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(STOPTIME$24);\r\n }\r\n target.setDoubleValue(stopTime);\r\n }\r\n }",
"public boolean stop(int floor);",
"@Override\n\tpublic void setStartTime(int t) {\n\t\t\n\t}",
"private long getTimeEnd(ArrayList<Point> r, ArrayList<Point> s){\n\t\t// Get the trajectory with earliest last point\n\t\tlong tn = s.get(s.size()-1).timeLong < r.get(r.size()-1).timeLong ? \n\t\t\t\ts.get(s.size()-1).timeLong : r.get(r.size()-1).timeLong;\n\t\treturn tn;\n\t}",
"private boolean canInsertLast(Plan plan,POI poi,Trip trip,Time currentTime,Plan mPlan,boolean skip){\n // if poi cost and time addtion to plan full cost and time satisify the constrains: \n // 1- full cost <= budget\n // 2- fulltime-poiTime >=poi.startTime if skip is false only\n // 3- fulltime <= trip.endTime\n // 4- fulltime <= poi.colseTime\n // insert and make Calculations and change last\n\n // Check 1\n if((plan.getFullCost()+poi.getCost())<=trip.getBudget()){\n // Check 2\n POI last=plan.getLastPOI();\n \n if(hfun(currentTime, last, poi, mPlan, skip)){\n // Check3\n // cal poi duration\n int fullduration=poi.getDuration();\n //cal waste time\n if(skip){\n Time currTime = new Time(currentTime.hour,currentTime.min);\n if(last!=null)\n currTime.add(last.getShortestPath(poi.getId()));\n else if(mPlan!=null&&mPlan.getLastPOI()!=null)\n currTime.add(mPlan.getLastPOI().getShortestPath(poi.getId()));\n int x = Time.substract(currTime, poi.getOpenTime());\n fullduration+=(x==-1)?0:x;\n }\n //cal travel time\n if(last!=null)\n fullduration+=last.getShortestPath(poi.getId());\n else if(mPlan!=null){\n POI mLast=mPlan.getLastPOI();\n if(mLast!=null)\n fullduration+= mLast.getShortestPath(poi.getId());\n }\n if(Time.isIn(currentTime, fullduration, trip.getEndTime())){\n // Check4\n if(Time.isIn(currentTime, fullduration, poi.getCloseTime())){\n return true;\n }\n }\n }\n }\n return false;\n }",
"public void setTimeRange(long timeStart, long timeEnd)\n {\n this.timeStart = timeStart;\n this.timeEnd = timeEnd;\n }",
"public void setFastestTime(long time)\r\n {\r\n //Check if the new fastest time is less than 0 before setting the new fastest time \r\n if(time < 0)\r\n {\r\n //Outouts a warning message\r\n System.out.println(\"WARNING:You cannot assign a negative time\");\r\n }\r\n else \r\n {\r\n this.fastestTime = time; \r\n }//end if\r\n }",
"boolean hasStopped()\n {\n if (running && ! isAlive())\n {\n nextStartTime = System.currentTimeMillis() + minDurationInMillis;\n running = false;\n return true;\n }\n return false;\n }",
"protected void isUserInStartZone() {\n\n //Checks to see if the user is in the specified radius near the start / end point\n if (mDistanceFromWaypoint < mZoneSize) {\n //The user is in the zone\n mIsInZone = true;\n\n //Calculates the bearings of the user's current location relative to the start point\n mWaypointBearing = mCurrentLocation.bearingTo(mWaypoint);\n mPreviousWaypointBearing = mPreviousLocation.bearingTo(mWaypoint);\n //When the timer is not running, start the timer. This will only trigger on the first lap\n if (!t.getRunning() && isUserPastStartPoint()) {\n //Calculates the time between the current location which triggered the timer to start\n //and the approximate time the user would have crossed the start line\n/* mStartTimeMod = t.getTimeBetweenGpsPing(mCurrentLocation, mPreviousLocation)\n - t.finishTimeEstimate(mCurrentLocation, mPreviousLocation);*/\n t.start();\n handler.postDelayed(updater, 30);\n }\n //When the timer is running the timer will be stopped if and only if the user has\n //already left the start zone and returned to it. This keeps the timer from stopping\n //if the GPS coordinates of the user are in the start zone for two GPS pings\n //Also checks to see if the user has crossed the start point via bearings delta\n if (t.getRunning() && mHasLeftZone && isUserPastStartPoint()) {\n //Calculates the time between the current location which triggered the timer to stop\n //and the approximate time the user would have crossed the finish line\n/* long finishTimeMod = t.getTimeBetweenGpsPing(mCurrentLocation, mPreviousLocation)\n - t.finishTimeEstimate(mCurrentLocation, mPreviousLocation);*/\n //stops the timer for this lap\n t.stop();\n //Resets the logic that the user has left the zone\n mHasLeftZone = false;\n\n //Modifies the lap time to subtract both the modifiers from the lap start\n //and lap finish\n mySession.addLap(t.getLaptime() /*- mStartTimeMod - finishTimeMod*/);\n\n //update laptimes textview with a list of the session's laptimes\n mPreviousLapTimeText.setText(mySession.formatLaptime(mySession.getLastLapLong()));\n mBestLapTimeText.setText(mySession.formatLaptime(mySession.getBestLapLong()));\n\n //Sets the modifier for the lap start to the previous lap's lap finish modifier\n /* mStartTimeMod = finishTimeMod;*/\n\n //Restarts the timer for the next lap\n t.start();\n handler.postDelayed(updater, 30);\n }\n } else {\n mIsInZone = false;\n //The user has left the zone while the timer is running\n if (t.getRunning()) {\n mHasLeftZone = true;\n }\n }\n }",
"public void stop() {\n stopTime = Calendar.getInstance().getTime();\n long diff = stopTime.getTime() - startTime.getTime();\n\n writeln();\n writeln(\"# --------------------------------------------------------------------\");\n writeln(\"# << END OF LOGFILE >> \");\n writeln(\"# --------------------------------------------------------------------\");\n writeln(\"# STOP TIME : \" + stopTime);\n writeln(\"# ELAPSED TIME : \" + (diff / (1000L)) + \" seconds.\");\n writeln(\"# --------------------------------------------------------------------\");\n pw.close();\n }",
"public boolean shouldStop() {\n boolean isToStop = stop; // check if needs to stop\n stop = false; // update the flag for future use not to stop\n return isToStop;\n }",
"public void stopStopwatch() {\n timeCount = currentNanoTime.getAsLong();\n currentNanoTime = () -> timeCount;\n }",
"public void start(){\n\n stopWatchStartTimeNanoSecs = magicBean.getCurrentThreadCpuTime();\n\n }",
"public void timeLogic(int time){\n //Add logic to decide time increments at which tickets will be granted\n }",
"public void resetTimeLimit();",
"public static void calTime() {\n time = new Date().getTime() - start;\n }",
"public void unsetStopTime()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(STOPTIME$24);\r\n }\r\n }",
"public void fixStartEnd() {\n\t\tif (sstart > send) {\n\t\t\tint t = send;\n\t\t\tsend = sstart;\n\t\t\tsstart = t;\n\t\t}\n\n\t\tif (qstart > qend) {\n\t\t\tint t = qend;\n\t\t\tqend = qstart;\n\t\t\tqstart = t;\n\t\t}\n\t}",
"private boolean isTimeOverlap(Item t) {\n\t\treturn t.getEndDate().equals(event.getEndDate());\n\t}",
"public void setStartTime(long value) {\r\n this.startTime = value;\r\n }"
] | [
"0.6131366",
"0.6051465",
"0.6044961",
"0.5778424",
"0.5714066",
"0.5696992",
"0.5668619",
"0.5611259",
"0.55725205",
"0.55554557",
"0.554551",
"0.55165696",
"0.54980636",
"0.5462453",
"0.5432828",
"0.54313034",
"0.5407344",
"0.53962505",
"0.5378559",
"0.53745395",
"0.53716385",
"0.53552574",
"0.5339522",
"0.5338024",
"0.53304565",
"0.53214556",
"0.5315052",
"0.53131384",
"0.53107214",
"0.53080595",
"0.5306863",
"0.53019285",
"0.53000724",
"0.52898866",
"0.5279049",
"0.52618116",
"0.5259268",
"0.52522874",
"0.52353793",
"0.5231043",
"0.5227994",
"0.5227477",
"0.5225259",
"0.5220955",
"0.52146727",
"0.5210567",
"0.5209688",
"0.5198908",
"0.5192622",
"0.5177081",
"0.51745915",
"0.5173684",
"0.5172527",
"0.5172184",
"0.51653254",
"0.5158955",
"0.51551414",
"0.5152502",
"0.51481086",
"0.5143865",
"0.5132095",
"0.51314074",
"0.51269275",
"0.51239973",
"0.51183105",
"0.51088387",
"0.5107421",
"0.5096372",
"0.50907624",
"0.50890523",
"0.5079244",
"0.5068826",
"0.5067708",
"0.5063256",
"0.5063256",
"0.5062158",
"0.50568557",
"0.50553584",
"0.5045276",
"0.50420856",
"0.50416076",
"0.5037566",
"0.50307024",
"0.50301576",
"0.50146",
"0.5012157",
"0.5011775",
"0.5001441",
"0.49976733",
"0.4996264",
"0.49957275",
"0.49950045",
"0.49941984",
"0.49868503",
"0.49847552",
"0.49841422",
"0.49806878",
"0.498068",
"0.49803406",
"0.49682173"
] | 0.5961426 | 3 |
TODO Autogenerated method stub | @Override
public void receiveFrameDataForMediaCodec(Camera camera, int avChannel, byte[] buf, int length, int pFrmNo, byte[] pFrmInfoBuf, boolean
isIframe, int codecId) {
} | {
"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 |
because granted info remain there so this will trigger an infnite loop pf notifications sendNotification(notificationDetail.user.name, "granted " + notificationDetail.provider.name + " information"); | @Override
public void addGrantedNotification(NotificationDetail notificationDetail) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void sendNotification() {\n }",
"public void sendAlert(String notificationInfo, ILabMember personInCharge) {\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}",
"private void sendNotification(String notificationDetails)\r\n {\n NotificationManager notificationManager =\r\n (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);\r\n\r\n // 2. Create a PendingIntent for AllGeofencesActivity\r\n Intent intent = new Intent(this, MainActivity.class);\r\n intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n PendingIntent pendingNotificationIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);\r\n\r\n // 3. Create and send a notification\r\n Notification notification = new NotificationCompat.Builder(this)\r\n .setSmallIcon(R.mipmap.ic_launcher)\r\n .setContentTitle(\"notification,\")\r\n .setContentText(notificationDetails)\r\n .setContentIntent(pendingNotificationIntent)\r\n .setStyle(new NotificationCompat.BigTextStyle().bigText(notificationDetails))\r\n .setPriority(NotificationCompat.PRIORITY_HIGH)\r\n .setAutoCancel(true)\r\n .build();\r\n notificationManager.notify(0, notification);\r\n\r\n\r\n\r\n\r\n }",
"@Override\r\n\tpublic void sendNotifications() {\n\r\n\t}",
"private void sendNotification(Map<String, String> data) {\n int num = ++NOTIFICATION_ID;\n Bundle msg = new Bundle();\n for (String key : data.keySet()) {\n Log.e(key, data.get(key));\n msg.putString(key, data.get(key));\n }\n\n\n pref = getSharedPreferences(\"UPDATE_INSTANCE\", MODE_PRIVATE);\n edit = pref.edit();\n Intent backIntent;\n Intent intent = null;\n PendingIntent pendingIntent = null;\n backIntent = new Intent(getApplicationContext(), LoginActivity.class);\n backIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n SharedPreferences sp;\n SharedPreferences.Editor editor;\n\n\n if (!is_noty) {\n mNotificationManager = (NotificationManager) this\n .getSystemService(Context.NOTIFICATION_SERVICE);\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(\n this);\n\n mBuilder.setSmallIcon(R.drawable.ic_launcher)\n .setContentTitle(msg.getString(\"title\"))\n .setStyle(\n new NotificationCompat.BigTextStyle().bigText(msg\n .getString(\"msg\").toString()))\n .setAutoCancel(true)\n .setContentText(msg.getString(\"msg\"));\n\n if (Integer.parseInt(msg.getString(\"type\")) != 1) {\n mBuilder.setContentIntent(pendingIntent);\n }\n\n mBuilder.setDefaults(Notification.DEFAULT_ALL);\n\n mNotificationManager.notify(++NOTIFICATION_ID, mBuilder.build());\n }\n }",
"private void sendNotificationSample() {\n Intent notificationIntent = new Intent(GCMIntentService.this, AlertActivity.class);\n\n // Get a PendingIntent containing the entire back stack.\n int i = new Random().nextInt(100);\n PendingIntent notificationPendingIntent = PendingIntent.getActivity(GCMIntentService.this, i, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // Get a notification builder that's compatible with platform versions >= 4\n NotificationCompat.Builder builder = new NotificationCompat.Builder(GCMIntentService.this);\n\n // Define the notification settings.\n builder.setSmallIcon(R.drawable.icon_v2)\n // In a real app, you may want to use a library like Volley\n // to decode the Bitmap.\n //.setLargeIcon(BitmapFactory.decodeResource(ctx.getResources(), R.drawable.ic_launcher)).\n .setContentTitle(\"Shang\").setContentText(i + \". This is test mesage from notification\").setContentIntent(notificationPendingIntent);\n\n // Dismiss notification once the user touches it.\n builder.setAutoCancel(true);\n\n Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n builder.setSound(alarmSound);\n\n builder.setVibrate(new long[]{0, 2000});\n\n builder.setContentIntent(notificationPendingIntent);\n\n // Get an instance of the Notification manager\n NotificationManager mNotificationManager = (NotificationManager) GCMIntentService.this.getSystemService(Context.NOTIFICATION_SERVICE);\n\n // Issue the notification\n mNotificationManager.notify(i, builder.build());\n }",
"@Override\r\n\tpublic void sendGeneralNotification() {\n\t\t\r\n\t}",
"private void sendNotification(NotificationCompat.Builder notification){\n NotificationManager notifier = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);\n NotificationChannel channel = new NotificationChannel(\"default\", \"notification\", NotificationManager.IMPORTANCE_DEFAULT);\n notifier.createNotificationChannel(channel);\n NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);\n\n notificationManager.notify(0, notification.build());\n }",
"private void sendNotification(String notificationTitle, String notificationBody){//, String dataTitle, String dataMessage) {\n Intent intent = new Intent(this, Login.class);\n// intent.putExtra(\"title\", dataTitle);\n// intent.putExtra(\"message\", dataMessage);\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\n Notification notification = new NotificationCompat.Builder(this,getString(R.string.notificationChannelId))\n .setSmallIcon(R.drawable.notification_icon)\n .setContentTitle(notificationTitle)\n .setContentText(notificationBody)\n .setStyle(new NotificationCompat.BigTextStyle()\n .bigText(notificationBody))\n .setContentIntent(pendingIntent)\n .setAutoCancel(true)\n .setSound(defaultSoundUri)\n .build();\n\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n int randomNotificationId=new Random().nextInt(100)+1;\n notificationManager.notify(randomNotificationId, notification);\n\n\n\n// notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());\n }",
"protected void notifyUser()\n {\n }",
"private void sendNotifications() {\n this.sendNotifications(null);\n }",
"private void sendNotification() {\n int mNotificationId = 001;\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ic_action_camera)\n .setContentTitle(\"Daily Selfie\")\n .setContentText(\"Time for another selfie\");\n Intent resultIntent = new Intent(this, MainActivity.class);\n PendingIntent resultPendingIntent =\n PendingIntent.getActivity(\n this,\n 0,\n resultIntent,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n mBuilder.setContentIntent(resultPendingIntent);\n // Gets an instance of the NotificationManager service\n NotificationManager mNotifyMgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n // Builds the notification and issues it.\n mNotifyMgr.notify(mNotificationId, mBuilder.build());\n }",
"public void oreo(String t, String d){\n String id = \"messange\";\n\n NotificationManager nm = (NotificationManager) getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);\n NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext(),id);\n Uri soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);\n Intent intent = new Intent(getApplicationContext(), Menu_principla_Activity.class);\n\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){\n NotificationChannel nc = new NotificationChannel(id,\"nuevo\",NotificationManager.IMPORTANCE_HIGH);\n nc.setDescription(\"Notification FCM\");\n nc.setShowBadge(true);\n assert nm != null;\n System.out.println(\"Bandera 1\");\n nm.createNotificationChannel(nc);\n }\n/*\n\n\n // intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(),1,intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n builder.setAutoCancel(true)\n .setWhen(System.currentTimeMillis())\n .setContentTitle(t).setCategory(Notification.CATEGORY_SERVICE)\n .setDefaults(Notification.DEFAULT_ALL)\n .setSound(soundUri)\n .setTicker(\"Nueva notification\")\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentText(d)\n .setContentIntent(pendingIntent)\n .setContentInfo(\"nuevo\")\n .setVibrate(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});\n\n Random random = new Random();\n int idNotify = random.nextInt(8000);\n\n assert nm != null;\n nm.notify(idNotify,builder.build());\n\n */\n PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(),1,intent, PendingIntent.FLAG_UPDATE_CURRENT);\n notification = new NotificationCompat.Builder(getApplicationContext())\n .setContentIntent(pendingIntent)\n .setSmallIcon(R.drawable.ic_medical_services_black_24dp)\n .setSound(soundUri)\n .setAutoCancel(true)\n .setContentTitle(t).setCategory(Notification.CATEGORY_SERVICE)\n .setContentText(d).build();\n nm.notify(1,notification);\n\n System.out.println(\"Bandera 2\");\n }",
"public void notifyUserInfo(String userInfo);",
"@Override\n public void notificationReceived(OSNotification notification) {\n Log.e(\"oneSignal\",\"new Notification\");\n\n }",
"@Override\n public int checkNotificationPermission() throws android.os.RemoteException {\n return 0;\n }",
"public void checkIfWeShouldSendANotification() {\n \t// Determine which zone we are in\n \t//\n \t\n String zoneWeAreIn=null;\n \n double spartyLat = 42.731138;\n double spartyLong = -84.487508;\n \n double beaumontLat = 42.732829;\n double beaumontLong = -84.482467;\n \n double bresLat = 42.7284;\n double bresLong = -84.492033;\n\n \tfloat[] spartyDist = new float[1];\n \tLocation.distanceBetween(latitude,longitude, spartyLat, spartyLong, spartyDist);\n\n \tfloat[] beaumontDist = new float[1];\n \tLocation.distanceBetween(latitude,longitude, beaumontLat, beaumontLong, beaumontDist);\n \t\n \tfloat[] bresDist = new float[1];\n \tLocation.distanceBetween(latitude,longitude, bresLat, bresLong, bresDist);\n \t\n \tif(spartyDist[0]<20) zoneWeAreIn = \"Sparty\";\n \telse if (beaumontDist[0]<20) zoneWeAreIn = \"Beaumont Tower\";\n \telse if (bresDist[0]<20) zoneWeAreIn = \"the Breslin Center\";\n \n \t\n \t\n // Create an artificial back stack\n // This is so when we open the notification, back takes us to MainActivity\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n \n \n if(zoneWeAreIn!=null)\n {\n\t Intent newIntent = new Intent(); \n\t if(zoneWeAreIn==\"Sparty\")\n\t {\n\t \t // Set parent in artificial back stack\n\t\t stackBuilder.addParentStack(SpartyInfoActivity.class);\n\t\t \n\t\t // Make it start up SpartyInfoActivity\n\t \t newIntent.setClassName(this, \"edu.msu.cse.belmont.msuproximity.SpartyInfoActivity\"); \t\n\t }\n\t else if(zoneWeAreIn==\"Beaumont Tower\")\n\t {\n\t\t stackBuilder.addParentStack(BeaumontInfoActivity.class);\n\t \t newIntent.setClassName(this, \"edu.msu.cse.belmont.msuproximity.BeaumontInfoActivity\");\n\t }\n\t else if(zoneWeAreIn==\"the Breslin Center\")\n\t {\n\t\t stackBuilder.addParentStack(BreslinInfoActivity.class);\n\t \t newIntent.setClassName(this, \"edu.msu.cse.belmont.msuproximity.BreslinInfoActivity\");\n\t }\n\t else \n\t {\n\t \t // Default, if zoneWeAreIn is not one of the above\n\t\t Toast.makeText(this, \"Wrong zone string name\", Toast.LENGTH_LONG).show();\n\t\t newIntent.setClassName(this, \"edu.msu.cse.belmont.msuproximity.MainActivity\");\n\t }\n\t newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t \n\t \n\t // Finish setting up artifical back stack\n\t stackBuilder.addNextIntent(newIntent);\n\t \n\t // Create a pending intent so it's only launched if clicked\n\t PendingIntent pendingIntent =\n\t stackBuilder.getPendingIntent(\n\t 0,\n\t PendingIntent.FLAG_UPDATE_CURRENT\n\t );\n\t \t\n\t // Create the android notification\n\t NotificationCompat.Builder builder = new NotificationCompat.Builder(this);\n\t builder.setSmallIcon(R.drawable.ic_launcher);\n\t builder.setContentTitle(this.getString(R.string.app_name));\n\t builder.setContentText(this.getString(R.string.youre_at) + \" \"+zoneWeAreIn);\n\t builder.setAutoCancel(true);\n\t builder.setContentIntent(pendingIntent);\n\t NotificationManager mNotificationManager =\n\t (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);\n\t \n\t // Launch the android notification\n\t mNotificationManager.notify(0, builder.build());\n }\n else\n {\n \tLog.i(\"not in any zone. \"+spartyDist[0]+\" \"+beaumontDist[0]+\" \"+bresDist[0], \"Not in any zone right now.\");\n\t //Toast.makeText(this, \"Alarm went off but we are not in a zone\", Toast.LENGTH_LONG).show();\n }\n }",
"private void showNotificationCourse(Bundle data) {\n\n/* try {\n int unreadNotificationCount = Integer.valueOf(data.getString(\"total_unread_notification\"));\n NotificationCountEventBus.Event event = new NotificationCountEventBus.Event(unreadNotificationCount);\n NotificationCountEventBus.getInstance().post(event);\n } catch (Exception ignored) {\n\n }*/\n\n // check the type_push from data and navigate to activity\n Intent intent = navigateNotification(data);\n\n PendingIntent pendingIntent = PendingIntent.getActivity(this, notificationId, intent,\n PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT);\n\n\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(getNotificationIcon())\n .setContentTitle(data.getString(\"title\"))\n .setContentText(data.getString(\"body\"))\n .setAutoCancel(true)\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n notificationManager.notify(notificationId++, notificationBuilder.build());\n }",
"private void sendNotificationLocalToUser() {\n\n Intent notificationIntent = new Intent(this, GameScreenActivity.class);\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);\n Notification.Builder builder = new Notification.Builder(this);\n builder.setAutoCancel(false);\n\n if ((currentPlay + 1)<= Utility.game.getLength()) {\n// notification.setLatestEventInfo(GameScreenActivity.this, \"Game in progress\", \"Play \" + (currentPlay + 1) + \" started get your guess in.\", pendingIntent);\n\n// builder.setTicker(\"this is ticker text\");\n builder.setContentTitle(\"Game in progress\");\n builder.setContentText(\"Play \" + (currentPlay + 1) + \" started get your guess in.\");\n builder.setSmallIcon(R.drawable.ic_launcher);\n builder.setContentIntent(pendingIntent);\n builder.setOngoing(true);\n// builder.setSubText(\"This is subtext...\"); //API level 16\n builder.setNumber(100);\n builder.build();\n\n }else{\n notificationIntent = new Intent(this,FinalLeaderBoardActivity.class);\n pendingIntent = PendingIntent.getActivity(this,0,notificationIntent,0);\n// notification.setLatestEventInfo(GameScreenActivity.this, \"Game completed\", \"Your game is complete. Check the final leaderboard.\", pendingIntent);\n\n// builder.setTicker(\"this is ticker text\");\n builder.setContentTitle(\"Game completed\");\n builder.setContentText(\"Your game is complete. Check the final leaderboard.\");\n builder.setSmallIcon(R.drawable.ic_launcher);\n builder.setContentIntent(pendingIntent);\n builder.setOngoing(true);\n// builder.setSubText(\"This is subtext...\"); //API level 16\n builder.setNumber(100);\n builder.build();\n\n }\n\n notification = builder.getNotification();\n notification.defaults = Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE | Notification.DEFAULT_SOUND;\n\n notificationManager.notify(9999, notification);\n }",
"public void sendNotification(View view) {\n\n NotificationManager nm= (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.O){\n\n //We have to create a notification channel\n NotificationChannel nc = new NotificationChannel(\"srminterns\",\"SRM NOTIFICATIONS\",NotificationManager.IMPORTANCE_HIGH);\n nm.createNotificationChannel(nc);\n\n }\n\n // we have to normally write notification code.\n\n NotificationCompat.Builder builder=new NotificationCompat.Builder(this,\"srminterns\");\n builder.setSmallIcon(R.drawable.umbrella);\n builder.setContentTitle(\"Sample Notification\");\n builder.setContentText(\"This is the description of the notification\");\n builder.setAutoCancel(true);\n\n /* Pending Intent\n * - It is the description of the operation to be performed\n * - can be created using the following methods\n * -getActivity() - if you want to open an activity with pending Intent\n * -getService() - if you want to strat a service with Pending Intent\n * -getBroadcast() - if you want to send a broadcast with Pending Intent\n *\n * Requires 4 Arguments\n * -context\n * -Pending Intent ID (Can be any Integer)\n * -Intent(Action that you want to perform)\n * - FLAG (This flag will tell the existing pending Intent about what to do if there\n * is a new Pending Intent (Arrival) */\n\n PendingIntent pi = PendingIntent.getActivity(this,12,new Intent(this, MainActivity.class)\n ,PendingIntent.FLAG_UPDATE_CURRENT);\n\n builder.setContentIntent(pi);\n\n /*\n * Step1: is to convert any image format that you want to display into a Bitmap image format\n * Step2: is to create bigPicture style before you issue the notification.\n *\n *\n *\n *\n * */\n\n Bitmap bitmap= BitmapFactory.decodeResource(getResources(),R.drawable.kathmandu);\n builder.setStyle(new NotificationCompat.BigPictureStyle().bigPicture(bitmap));\n nm.notify(42,builder.build());\n }",
"private void sendNotification(Map<String, String> serverData) {\n Intent intent = new Intent(serverData.get(\"click_action\"));\n String title = serverData.get(\"title\");\n String body = serverData.get(\"body\");\n intent.putExtra(\"title\",title);\n intent.putExtra(\"body\",body);\n intent.putExtra(\"order\" , serverData.get(\"order\"));\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(this,0 /* request code */, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n long[] pattern = {500,500,500,500,500};\n\n Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\n NotificationCompat.Builder notificationBuilder = (NotificationCompat.Builder) new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ok)\n .setContentTitle(serverData.get(\"title\"))\n .setContentText(serverData.get(\"body\"))\n .setAutoCancel(true)\n .setVibrate(pattern)\n .setLights(Color.BLUE,1,1)\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.notify(0 , notificationBuilder.build());\n }",
"private void send_notfaction(final String username) {\r\n FirebaseDatabase.getInstance().getReference().child(\"Token\")\r\n .addValueEventListener(new ValueEventListener() {\r\n @Override\r\n public void onDataChange(DataSnapshot dataSnapshot) {\r\n if (dataSnapshot.exists()) {\r\n\r\n for (DataSnapshot ds : dataSnapshot.getChildren()) {\r\n\r\n Token token = ds.getValue(Token.class);\r\n String sendermessage = username;\r\n String title = messagetext;\r\n\r\n Notifaction notifaction = new Notifaction(title, sendermessage);\r\n Sender sender = new Sender(token.getToken(), notifaction);\r\n\r\n mservices.sendNotification(sender).enqueue(new Callback<Myresponse>() {\r\n @Override\r\n public void onResponse(Call<Myresponse> call, Response<Myresponse> response) {\r\n\r\n }\r\n\r\n @Override\r\n public void onFailure(Call<Myresponse> call, Throwable t) {\r\n Log.i(\"ERROR\", \"MESSAGE\");\r\n\r\n }\r\n });\r\n }\r\n\r\n\r\n }\r\n }\r\n\r\n @Override\r\n public void onCancelled(DatabaseError databaseError) {\r\n\r\n }\r\n });\r\n\r\n\r\n }",
"private void ShowNotification()\n {\n Notification n = new Notification.Builder(this)\n .setContentTitle(\"Message from Himanshu\")\n .setContentText(\"Thank you Sir. Enjoyed Your Class!\")\n .setSmallIcon(R.drawable.cloud)\n //.setContentIntent(pIntent)\n .setAutoCancel(true)\n //.addAction(R.drawable.icon, \"Call\", pIntent)\n //.addAction(R.drawable.icon, \"More\", pIntent)\n //.addAction(R.drawable.icon, \"And more\", pIntent)\n .getNotification();\n\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n try {\n notificationManager.notify(0, n);\n }catch (Exception ex) {\n Log.d(\"MyApp\", \"Exception Occured!\");\n }\n }",
"private static void createNotification(Activity a, CustomFBProfile prof) {\n NotificationCompat.Builder mBuilder =\n new NotificationCompat.Builder(a)\n .setSmallIcon(R.drawable.acba)\n .setContentTitle(\"New Message\")\n .setTicker(\"New Message!!\");\n NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();\n mBuilder.setStyle(inboxStyle);\n mBuilder.setVibrate(new long[]{2000, 500, 500, 250});\n mBuilder.setLights(Color.YELLOW, 3000, 3000);\n mBuilder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));\n mBuilder.setAutoCancel(true);\n\n// Creates an explicit intent for an Activity in your app\n Intent resultIntent = new Intent(a, LoginActivity.class);\n\n// The stack builder object will contain an artificial back stack for the\n// started Activity.\n// This ensures that navigating backward from the Activity leads out of\n// your application to the Home screen.\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(a);\n// Adds the back stack for the Intent (but not the Intent itself)\n stackBuilder.addParentStack(LoginActivity.class);\n// Adds the Intent that starts the Activity to the top of the stack\n stackBuilder.addNextIntent(resultIntent);\n PendingIntent resultPendingIntent =\n stackBuilder.getPendingIntent(\n 0,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n mBuilder.setContentIntent(resultPendingIntent);\n NotificationManager mNotificationManager =\n (NotificationManager) a.getSystemService(Context.NOTIFICATION_SERVICE);\n// mId allows you to update the notification later on.\n mNotificationManager.notify(1, mBuilder.build());\n }",
"@Override\n public boolean notificationPermissionEnabled() throws android.os.RemoteException {\n return false;\n }",
"public int checkNotificationPermission() throws android.os.RemoteException;",
"private void sendNotifications() {\n for (long sid : self.getCurrentAndNextConfigVoters()) {\n QuorumVerifier qv = self.getQuorumVerifier();\n ToSend notmsg = new ToSend(\n ToSend.mType.notification,\n proposedLeader,\n proposedZxid,\n logicalclock.get(),\n QuorumPeer.ServerState.LOOKING,\n sid,\n proposedEpoch,\n qv.toString().getBytes(UTF_8));\n\n LOG.debug(\n \"Sending Notification: {} (n.leader), 0x{} (n.zxid), 0x{} (n.round), {} (recipient),\"\n + \" {} (myid), 0x{} (n.peerEpoch) \",\n proposedLeader,\n Long.toHexString(proposedZxid),\n Long.toHexString(logicalclock.get()),\n sid,\n self.getMyId(),\n Long.toHexString(proposedEpoch));\n\n sendqueue.offer(notmsg);\n }\n }",
"private void sendNotification(final String notificationDetails) {\n Intent notificationIntent = new Intent(getApplicationContext(), MainActivity.class);\n\n // Construct a task stack.\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n\n // Add the main Activity to the task stack as the parent.\n stackBuilder.addParentStack(MainActivity.class);\n\n // Push the content Intent onto the stack.\n stackBuilder.addNextIntent(notificationIntent);\n\n // Get a PendingIntent containing the entire back stack.\n PendingIntent notificationPendingIntent =\n stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // Get a notification builder that's compatible with platform versions >= 4\n NotificationCompat.Builder builder = new NotificationCompat.Builder(this);\n\n // Define the notification settings.\n builder.setSmallIcon(R.mipmap.ic_launcher)\n .setLargeIcon(BitmapFactory.decodeResource(getResources(),\n R.mipmap.ic_launcher))\n .setColor(Color.RED)\n .setContentTitle(title)\n// .setContentText(title)\n .setContentIntent(notificationPendingIntent);\n\n // Dismiss notification once the user touches it.\n builder.setAutoCancel(true);\n\n // Get an instance of the Notification manager\n NotificationManager mNotificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n // Issue the notification\n mNotificationManager.notify(0, builder.build());\n }",
"static void sendNotifications() {\n\t\testablishConnection();\n\t\tSystem.out.println(\"sending multiple notificatiosn\");\n\t}",
"private void sendNotification(PanicIncidentDTO simpleMessage) {\n// Intent intent = new Intent(this, SimpleMessagingActivity.class);\n// intent.putExtra(\"simpleMessage\",simpleMessage);\n// intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n// PendingIntent pendingIntent = PendingIntent.getActivity(this,\n// LOCATION_REQUEST_CODE, intent,\n// PendingIntent.FLAG_ONE_SHOT);\n\n\n Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ic_favorite)\n .setContentTitle(\"Message received\")\n .setContentText(simpleMessage.getPanicType().getName())\n .setAutoCancel(true)\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 static void aviUsers() {\n\t\tsendNotification();\r\n\t}",
"public static void createNotification(MainActivity a, CustomFBProfile profile, IMessagingMetaData meta, HashMap<String, String> loc) {\n NotificationCompat.Builder mBuilder =\n new NotificationCompat.Builder(a)\n .setSmallIcon(R.drawable.acba)\n .setContentTitle(\"New Message\")\n .setContentText(meta.getName().toUpperCase()).setTicker(\"New Message!!\");\n NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();\n mBuilder.setStyle(inboxStyle);\n mBuilder.setVibrate(new long[]{2000, 2000, 1000});\n mBuilder.setLights(Color.RED, 3000, 3000);\n mBuilder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));\n mBuilder.setAutoCancel(true);\n\n// Creates an explicit intent for an Activity in your app\n Intent resultIntent = a.startMessagingActivityFromAnywhereInApp(profile, meta, loc);\n\n// The stack builder object will contain an artificial back stack for the\n// started Activity.\n// This ensures that navigating backward from the Activity leads out of\n// your application to the Home screen.\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(a);\n// Adds the back stack for the Intent (but not the Intent itself)\n stackBuilder.addParentStack(MainActivity.class);\n// Adds the Intent that starts the Activity to the top of the stack\n stackBuilder.addNextIntent(resultIntent);\n PendingIntent resultPendingIntent =\n stackBuilder.getPendingIntent(\n 0,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n mBuilder.setContentIntent(resultPendingIntent);\n NotificationManager mNotificationManager =\n (NotificationManager) a.getSystemService(Context.NOTIFICATION_SERVICE);\n// mId allows you to update the notification later on.\n mNotificationManager.notify(1, mBuilder.build());\n }",
"private void sendNotification(String notificationDetails) {\n // Create an explicit content Intent that starts the main Activity.\n Intent notificationIntent = new Intent(getApplicationContext(), MainActivity.class);\n\n // Construct a task stack.\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n\n // Add the main Activity to the task stack as the parent.\n stackBuilder.addParentStack(MainActivity.class);\n\n // Push the content Intent onto the stack.\n stackBuilder.addNextIntent(notificationIntent);\n\n // Get a PendingIntent containing the entire back stack.\n PendingIntent notificationPendingIntent =\n stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // Get a notification builder that's compatible with platform versions >= 4\n NotificationCompat.Builder builder = new NotificationCompat.Builder(this);\n\n // Define the notification settings.\n builder.setSmallIcon(R.drawable.ic_action_likeable)\n // In a real app, you may want to use a library like Volley\n // to decode the Bitmap.\n .setLargeIcon(BitmapFactory.decodeResource(getResources(),\n R.drawable.ic_action_likeable))\n .setColor(Color.RED)\n .setContentTitle(\"Uncertainties\")\n .setContentText(notificationDetails)\n .setStyle(new NotificationCompat.BigTextStyle().bigText(notificationDetails))\n .setContentIntent(notificationPendingIntent);\n\n // Dismiss notification once the user touches it.\n builder.setAutoCancel(true);\n\n // Get an instance of the Notification manager\n NotificationManager mNotificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n // Issue the notification\n mNotificationManager.notify(0, builder.build());\n }",
"private void sendNotify(JSONObject notification, String staffID) {\r\n JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(FCM_API, notification,\r\n new Response.Listener<JSONObject>() {\r\n @Override\r\n public void onResponse(JSONObject response) {\r\n Toast.makeText(BookingListDetails.this, \"\"+ staffID + \" has been Notified!\", Toast.LENGTH_SHORT).show();\r\n Log.i(TAG, \"onResponse: \" + response);\r\n startActivity(new Intent(getApplicationContext(), AdminBookingList.class));\r\n finish();\r\n }\r\n },\r\n new Response.ErrorListener() {\r\n @Override\r\n public void onErrorResponse(VolleyError error) {\r\n Toast.makeText(BookingListDetails.this, \"Request error\", Toast.LENGTH_LONG).show();\r\n Log.i(TAG, \"onErrorResponse: Didn't work\");\r\n }\r\n }) {\r\n @Override\r\n public Map<String, String> getHeaders() throws AuthFailureError {\r\n Map<String, String> params = new HashMap<>();\r\n params.put(\"Authorization\", serverKey);\r\n params.put(\"Content-Type\", contentType);\r\n return params;\r\n }\r\n };\r\n MySingleton.getInstance(getApplicationContext()).addToRequestQueue(jsonObjectRequest);\r\n }",
"@Override\r\n\tpublic void sendNotification(String notificationType) {\n\t\t\r\n\t}",
"private void notifyUser() {\r\n //Start add into notification fragment process\r\n notify = new Notify();\r\n DatabaseReference NotRef = FirebaseDatabase.getInstance().getReference().child(\"Notify\");\r\n notify.setBookID(getBookID.getText().toString());\r\n notify.setUserID(getUID.getText().toString());\r\n String key = NotRef.push().getKey();\r\n notify.setNotifyID(key);\r\n NotRef.child(key).setValue(notify);\r\n\r\n //Update notify status\r\n DatabaseReference dbNotify = FirebaseDatabase.getInstance().getReference(\"Booking\").child(getUID.getText().toString()).child(getBookID.getText().toString());\r\n HashMap<String, Object> hashMap = new HashMap<>();\r\n hashMap.put(\"notifyStatus\", \"Approved\");\r\n dbNotify.updateChildren(hashMap);\r\n\r\n //Send push notification\r\n String StaffID = id.getText().toString();\r\n TOPIC = \"/topics/\" + StaffID.toLowerCase(); //topic must match with what the receiver subscribed to\r\n Log.v(TAG,StaffID);\r\n NOTIFICATION_TITLE = \"FKOM Car Booking\";\r\n NOTIFICATION_MESSAGE = \"Dear \" + name.getText().toString() + \", Your Booking \" + getBookID.getText().toString() + \" has been approved!\";\r\n\r\n JSONObject notification = new JSONObject();\r\n JSONObject notificationBody = new JSONObject();\r\n try {\r\n notificationBody.put(\"title\", NOTIFICATION_TITLE);\r\n notificationBody.put(\"message\", NOTIFICATION_MESSAGE);\r\n\r\n notification.put(\"to\", TOPIC);\r\n notification.put(\"data\", notificationBody);\r\n } catch (JSONException e) {\r\n Log.e(TAG, \"onCreate: \" + e.getMessage());\r\n }\r\n sendNotification(notification, StaffID);\r\n }",
"public void sendNotification(String str, String str2, String str3, String str4) {\n this.apiService.sendNotification(new Sender(new Data(FirebaseAuth.getInstance().getCurrentUser().getUid(), str3 + \":\" + str4, \"New \" + getIntent().getStringExtra(\"noti\"), str2), str)).enqueue(new Callback<MyResponse>() {\n public void onFailure(Call<MyResponse> call, Throwable th) {\n }\n\n public void onResponse(Call<MyResponse> call, Response<MyResponse> response) {\n if (response.code() == 200) {\n int i = response.body().success;\n }\n }\n });\n }",
"private void handleActionNotification() {\n String result = getQuote(stringsArray);\n// Notification myNotification = new Notification.Builder(this)\n// .setAutoCancel(true)\n// .setDefaults(Notification.DEFAULT_ALL)\n// .setWhen(System.currentTimeMillis())\n// .setSmallIcon(R.mipmap.ic_launcher)\n// .setContentText(result)\n// .build();\n//\n// NotificationManagerCompat manager = NotificationManagerCompat.from(this);\n// manager.notify(0, myNotification);\n\n\n NotificationCompat.Builder builder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(\"My notification\")\n .setContentText(result);\n\n NotificationManager notificationManager = (NotificationManager)this\n .getSystemService(Context.NOTIFICATION_SERVICE);\n int id = 1;\n notificationManager.notify(id, builder.build());\n }",
"private void askForPermission(){\n if (ContextCompat.checkSelfPermission(MainActivity.this,\n Manifest.permission.ACCESS_NOTIFICATION_POLICY)\n != PackageManager.PERMISSION_GRANTED) {\n Log.i(TAG,\"don't have permission\");\n // Permission is not granted\n // Should we show an explanation?\n if (ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this,\n Manifest.permission.ACCESS_NOTIFICATION_POLICY)) {\n Log.i(TAG,\"Asking for permission with explanation\");\n // Show an explanation to the user *asynchronously* -- don't block\n // this thread waiting for the user's response! After the user\n // sees the explanation, try again to request the permission.\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_NOTIFICATION_POLICY},\n MY_PERMISSIONS_MODIFY_AUDIO_SETTINGS);\n\n } else {\n Log.i(TAG,\"Asking for permission without explanation\");\n // No explanation needed; request the permission\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_NOTIFICATION_POLICY},\n MY_PERMISSIONS_MODIFY_AUDIO_SETTINGS);\n\n // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an\n // app-defined int constant. The callback method gets the\n // result of the request.\n }\n } else {\n // Permission has already been granted\n Log.i(TAG,\"Already had permission\");\n }\n\n }",
"@Override\n\tpublic void sendNotification(User notifier, User guest, Notification notification) {\n\t\tnotifier.getRequetes().add(notification);\n\t\tguest.getInvitations().add(notification);\n\t\tnotifier=userRepository.save(notifier);\n\t\tguest=userRepository.save(guest);\n\t\tNotificationWebSocketToken token=new NotificationWebSocketToken(1,notifier.getId(),2);\n\t\ttoken.setUser(notifier);\n\t\tnotify(token,guest.getUsername());\n\t}",
"private void showNotification() {\n }",
"private void showNotification() {\n\n NotificationCompat.Builder mBuilder =\n new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.food_icon2)\n .setContentTitle(\"Let's eat\")\n .setContentText(\"Good morning, It's time to take your Breakfast :)\");\n\n int mNotificationId = 001;\n\n\n Intent contentIntent = new Intent(this, RecommendationActivity.class);\n contentIntent.putExtra(\"dePagi\", \"pagigan\");\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n stackBuilder.addParentStack(RecommendationActivity.class);\n stackBuilder.addNextIntent(contentIntent);\n\n PendingIntent resultPendingIntent =\n stackBuilder.getPendingIntent(\n 0,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n mBuilder.setContentIntent(resultPendingIntent);\n\n mBuilder.setVibrate(new long[] { 1000, 1000, 1000, 1000, 1000 });\n mBuilder.setLights(Color.YELLOW, 3000, 3000);\n\n mBuilder.setAutoCancel(true);\n\n mNM =(NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n mNM.notify(mNotificationId, mBuilder.build());\n\n stopSelf();\n\n }",
"private void handleNotification() {\r\n\r\n Intent intent = getIntent();\r\n\r\n if (intent == null)\r\n return;\r\n\r\n fromNotification = intent.getBooleanExtra(Constants.FROM_NOTIFICATION, false);\r\n\r\n if (isFromNotification())\r\n sendNotificationAnalytics(feedId);\r\n\r\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n Log.i(\"BASH\", \"Notification sent\");\n\n Log.i(\"BASH\", \"RECIEVED\");\n\n createNotification(context, \"Times up\", \"5 sec\", \"as\");\n\n }",
"@Override\n public void onGranted() {\n }",
"@Override\n public void onGranted() {\n }",
"@Override\n public void onPermissionGranted() {\n }",
"@Override\n public void onGranted() {\n }",
"private void sendNotification(String msg) {\n\n mNotificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);\n\n PendingIntent contentIntent = PendingIntent.getActivity(this, 0,new Intent(this, ServiceListActivity.class), 0);\n\n NotificationCompat.Builder mBuilder =new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ic_launcher)\n .setContentTitle(\"Ruta Plus\")\n .setStyle(new NotificationCompat.BigTextStyle()\n .bigText(msg))\n .setContentText(msg);\n\n mBuilder.setContentIntent(contentIntent);\n mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());\n }",
"@Override\n public void onClick(View view) {\n\n sharedPrefManager.addNotificationCount(1);\n Log.d(TAG, \"shared pref count: \" + sharedPrefManager.getNotificationCount());\n\n\n if (userMemberType == 1 || userMemberType == 2) {\n showMyWillQuestionDialog();\n\n } else if (userMemberType == 3) {\n goToMyWill();\n\n } else {\n showAccessDeniedDialog();\n }\n /*testNoWill();*/\n }",
"public boolean notificationPermissionEnabled() throws android.os.RemoteException;",
"private void showNotification() {\n\n }",
"private void sendNotification() {\n ParsePush parsePush = new ParsePush();\n String id = ParseInstallation.getCurrentInstallation().getInstallationId();\n Log.d(\"Debug_id\", id);\n Log.d(\"Debug_UserName\", event.getHost().getUsername()); // host = event.getHost().getUsername();\n ParseQuery pQuery = ParseInstallation.getQuery(); // <-- Installation query\n Log.d(\"Debug_pQuery\", pQuery.toString());\n pQuery.whereEqualTo(\"username\", event.getHost().getUsername());// <-- you'll probably want to target someone that's not the current user, so modify accordingly\n parsePush.sendMessageInBackground(\"Hey your Event: \" + event.getTitle() + \" has a subscriber\", pQuery);\n\n }",
"private void alertDialogeForAskingPermissions() {\n builder.setMessage(getResources().getString(R.string.app_name) + \" needs access to \" + permissions[0] + \", \" + permissions[1]).setTitle(R.string.permissions_required);\n\n //Setting message manually and performing action on button click\n //builder.setMessage(\"Do you want to close this application ?\")\n builder.setCancelable(false)\n .setPositiveButton(R.string.later, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n\n // Action for 'Later'\n //Saving later boolean value as true, also saving time of pressed later\n Date dateObj = new Date();\n long timeNow = dateObj.getTime();\n editor.putLong(getResources().getString(R.string.later_pressed_time), timeNow);\n editor.putBoolean(getResources().getString(R.string.later), true);\n editor.commit();\n dialog.cancel();\n }\n })\n .setNegativeButton(R.string.give_permissions, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n requestPermission();\n }\n });\n //Creating dialog box\n AlertDialog alert = builder.create();\n alert.show();\n }",
"@Override\n public void onMessageReceived(RemoteMessage remoteMessage) {\n super.onMessageReceived(remoteMessage);\n //Log.d(TAG, \"From: \" + remoteMessage.getFrom());\n Log.d(TAG, \"Notification Message Body: \" + remoteMessage.getData());\n\n long[] pattern = {500,500,500,500,500};\n\n Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\n if (remoteMessage.getData() != null) {\n\n Intent intent;\n intent = new Intent(this, MainActivity.class);\n\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* request code */, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n //NotificationManager notificationManager = new NotificationUtils(this).getManager();\n Notification notification = new Notification();\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n notification = new NotificationCompat.Builder(this)\n .setDefaults(Notification.DEFAULT_ALL)\n .setContentTitle(remoteMessage.getData().get(\"title\"))\n .setContentText(remoteMessage.getData().get(\"body\"))\n .setChannelId(\"com.example.fakenews.ANDROID\")\n .setSmallIcon(com.google.firebase.R.drawable.notify_panel_notification_icon_bg)\n .setAutoCancel(true)\n .setVibrate(pattern)\n .setLights(Color.BLUE, 1, 1)\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent)\n .setVisibility(NotificationCompat.VISIBILITY_PUBLIC)\n .build();\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n //Log.d(TAG, String.valueOf(notificationManager.getImportance()));\n\n //Log.d(TAG, \"notificacion: \" + notificationManager.getActiveNotifications().toString());\n }\n }\n\n NotificationManagerCompat manager = NotificationManagerCompat.from(getApplicationContext());\n manager.notify(new Random().nextInt(), notification);\n //manager.notify(0, notification);\n\n Log.d(TAG,notification.toString());\n Log.d(TAG, String.valueOf(manager.areNotificationsEnabled()));\n Log.d(TAG, String.valueOf(manager.getImportance()));\n\n\n\n }\n }",
"private void sendNotification(String title, String messageBody, Map<String, String> extra) {\n Intent intent = new Intent(this, MainActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent;\n if (extra != null) {\n String type = extra.get(\"type\") != null ? extra.get(\"type\") : \"\";\n switch (type) {\n case \"page\":\n // for background, foreground can get this message directly without intent.putExtra()\n intent.putExtra(\"type\", type);\n if (extra.get(\"page\") != null) {\n intent.putExtra(\"page\", extra.get(\"page\"));\n }\n if (extra.get(\"id\") != null) {\n Log.i(TAG, \"sendNotification: payload page id \" + extra.get(\"id\"));\n intent.putExtra(\"id\", extra.get(\"id\"));\n }\n pendingIntent = PendingIntent.getActivity(this, 0, intent,\n PendingIntent.FLAG_ONE_SHOT);\n break;\n case \"link\":\n // only for foreground, without sending extra\n if (extra.get(\"link\") != null) {\n Uri uri = Uri.parse(LauUtil.getLegalURL(extra.get(\"link\")));\n intent = new Intent(Intent.ACTION_VIEW, uri);\n intent.putExtra(\"link\", extra.get(\"link\"));\n }\n pendingIntent = PendingIntent.getActivity(this, 2, intent,\n PendingIntent.FLAG_ONE_SHOT);\n break;\n case \"alarm_alert\":\n pendingIntent = getPendingIntentForAlertSystem(this, 0, 0, 0);\n break;\n default:\n pendingIntent = PendingIntent.getActivity(this, 0, intent,\n PendingIntent.FLAG_ONE_SHOT);\n break;\n }\n } else {\n pendingIntent = PendingIntent.getActivity(this, 0, intent,\n PendingIntent.FLAG_ONE_SHOT);\n }\n\n String channelId = getString(R.string.default_notification_channel_id);\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\n NotificationCompat.BigTextStyle bigTextStyle = new NotificationCompat.BigTextStyle();\n bigTextStyle.setBigContentTitle(title).bigText(messageBody);\n\n NotificationCompat.Builder notificationBuilder =\n new NotificationCompat.Builder(this, channelId)\n .setSmallIcon(R.drawable.young_icon_192x192)\n .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.young_icon_192x192))\n .setContentTitle(title)\n .setContentText(messageBody)\n .setStyle(bigTextStyle)\n .setAutoCancel(true)\n .setPriority(Notification.PRIORITY_HIGH)\n .setDefaults(Notification.DEFAULT_ALL)\n// .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n // Since android Oreo notification channel is needed.\n if (notificationManager != null) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n NotificationChannel channel = new NotificationChannel(channelId,\n channelId,\n NotificationManager.IMPORTANCE_DEFAULT);\n channel.setDescription(\"Young+推送\");\n notificationManager.createNotificationChannel(channel);\n }\n notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());\n }\n }",
"@JavascriptInterface\n\tpublic void sendNotification(int notifications) {\n\t\tLog.d(TAG_NAME, \"NotificationWebInterface::sendNotification\");\n\t\tif (notifications > 0)\n\t\t\tToast.makeText(context, \"You have \" + notifications + \" new message(s)\", Toast.LENGTH_SHORT).show();\n\t}",
"void enableNotifications();",
"private void sendNotification(String title,String date)\n {\n\n NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n Intent intent = new Intent(getApplicationContext(), MainActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n intent.putExtra(\"msg\", title);\n\n PendingIntent contentIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this).setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(title)\n .setStyle(new NotificationCompat.BigTextStyle().bigText(title))\n .setContentText(date)\n .setAutoCancel(true)\n .setVibrate(new long[]{0, 500});\n\n mBuilder.setContentIntent(contentIntent);\n mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());\n\n }",
"public void sendGeofenceNotification(String message){\n if (!allowNotification) {\n Log.d(TAG, \"sendGeofenceNotification notification off\");\n return;\n }\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n\n NotificationChannel notificationChannel;\n\n Intent intent = new Intent(getActivity().getApplicationContext(), HomeFragment.class);\n\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\n PendingIntent resultPendingIntent = PendingIntent.getActivity(getActivity().getApplicationContext(),\n 0 /* Request code */, intent,\n PendingIntent.FLAG_UPDATE_CURRENT);\n\n NotificationCompat.Builder builder = new NotificationCompat.Builder(getActivity().getApplicationContext(), NOTIFICATION_CHANNEL_ID)\n .setSmallIcon(R.drawable.ic_notifications_black_24dp)\n .setContentTitle(\"Geofence NOTIFICATION\")\n .setContentText(message)\n .setPriority(NotificationCompat.PRIORITY_DEFAULT)\n .setContentIntent(resultPendingIntent)\n .setAutoCancel(true);\n\n if (useCustomizeSound){\n builder.setSound(sound);\n }\n\n if (useCustomizeSound){\n notificationChannel = new NotificationChannel(NOTIFICATION_CHANNEL_ID_CUSTOMIZED_SOUND, \"NOTIFICATION_CHANNEL_CUSTOMIZED_SOUND_NAME\", importance);\n notificationChannel.enableLights(true);\n notificationChannel.setLightColor(Color.RED);\n notificationChannel.enableVibration(true);\n notificationChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});\n\n // Set Channel Sound\n AudioAttributes audioAttributes = new AudioAttributes.Builder()\n .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)\n .setUsage(AudioAttributes.USAGE_NOTIFICATION)\n .build();\n notificationChannel.setSound(sound, audioAttributes);\n\n Log.d(TAG, \"sendGeofenceNotification(): using customized sound\");\n builder.setChannelId(NOTIFICATION_CHANNEL_ID_CUSTOMIZED_SOUND);\n } else{\n notificationChannel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, \"NOTIFICATION_CHANNEL_NAME\", importance);\n notificationChannel.enableLights(true);\n notificationChannel.setLightColor(Color.RED);\n notificationChannel.enableVibration(true);\n notificationChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});\n builder.setChannelId(NOTIFICATION_CHANNEL_ID);\n }\n NotificationManager notificationManager = getActivity().getApplicationContext().getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(notificationChannel);\n\n // NotificationManagerCompat notificationManager = NotificationManagerCompat.from(getContext());\n // notificationId is a unique int for each notification that you must define\n notificationManager.notify(42, builder.build());\n }",
"@RequiresApi(api = Build.VERSION_CODES.O)\nvoid configureNotificationChannel(){\n String CHANNEL_ID = TORNADO_WARNING_CHANNEL;\n NotificationChannel channel = new NotificationChannel(\n CHANNEL_ID,\n \"tornado warning\",\n NotificationManager.IMPORTANCE_DEFAULT);\n channel.enableLights(true);\n channel.enableVibration(true);\n channel.setDescription(\"warnings about tornados\");\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }",
"public void notify(String userId);",
"@Override\n public void onPermissionGranted() {\n }",
"public void lambda$handleCloseControls$3$NotificationInfo() {\n String packageName = this.mSbn.getPackageName();\n NotificationSettingsHelper.setNotificationsEnabledForPackage(this.mContext, packageName, this.mChannelEnabledSwitch.isChecked());\n if (!this.mChannelEnabledSwitch.isChecked()) {\n Intent intent = new Intent(\"com.miui.app.ExtraStatusBarManager.action_refresh_notification\");\n intent.setPackage(\"com.android.systemui\");\n intent.putExtra(\"com.miui.app.ExtraStatusBarManager.extra_forbid_notification\", !this.mChannelEnabledSwitch.isChecked());\n intent.putExtra(\"app_packageName\", packageName);\n String messageId = NotificationUtil.getMessageId(this.mSbn);\n if (!TextUtils.isEmpty(messageId)) {\n intent.putExtra(\"messageId\", messageId);\n }\n this.mContext.sendBroadcast(intent);\n ((NotificationStat) Dependency.get(NotificationStat.class)).onBlock(this.mSbn, (NotificationChannelCompat) null, this.mIndex);\n }\n }",
"public void sendTestNotification() {\n\n Log.d(TAG, \"version: \" + Build.VERSION.SDK_INT);\n // Create an explicit intent for an Activity in your app\n Intent intent = new Intent(context, MainActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);\n\n final int NOTIFICATION_ID = 1;\n final String NOTIFICATION_CHANNEL_ID = \"my_notification_channel\";\n\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, channelId)\n .setSmallIcon(R.drawable.alarm_sound_icon) // icon must be right size for all supported APIs. Icon is changeable\n .setContentTitle(\"IDO\") // changeable\n .setContentText(\"Become A Better Spouse Today!\") // changeable\n .setPriority(NotificationCompat.PRIORITY_DEFAULT) // changeable\n .setContentIntent(pendingIntent)\n .setVisibility(Notification.VISIBILITY_PUBLIC) // changeable\n .setAutoCancel(true);\n\n NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);\n\n // notificationId is a unique int for each notification that you must define\n notificationManager.notify(NOTIFICATION_ID, mBuilder.build());\n\n }",
"public void showNotification(String title,String message)\n {\n\n Bitmap icon = BitmapFactory.decodeResource(this.getResources(),\n R.drawable.girl);\n// NotificationCompat.Builder builder = new NotificationCompat.Builder(this,\"Notify\")\n// .setContentTitle(title).setSmallIcon(R.drawable.common_google_signin_btn_icon_dark)\n\n// // .addAction(R.drawable.user,\"Pay\",payInent)\n// //.addAction(R.drawable.user,\"Pay Later\",payLaterInent)\n// .setDefaults(Notification.DEFAULT_ALL)\n// .setPriority(NotificationManager.IMPORTANCE_HIGH)\n// .setAutoCancel(true).setContentText(message).setLargeIcon(icon)\n// .setStyle(new NotificationCompat.BigPictureStyle()\n// .bigPicture(icon).bigLargeIcon(null));\n\n// NotificationCompat.Builder builder;\n// builder = new NotificationCompat.Builder(this, \"Notify\");\n// builder.setContentTitle(title) // required\n// .setSmallIcon(R.drawable.user) // required\n// .setContentText(message) // required\n// .setStyle(new NotificationCompat.BigPictureStyle()\n// .bigPicture(icon).setSummaryText(\"\"))\n// .setAutoCancel(true)\n// .setVibrate(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400})\n// .setSound(Settings.System.DEFAULT_NOTIFICATION_URI)\n// .setPriority(NotificationCompat.PRIORITY_HIGH)\n// ;\n\n Notification notification = null;\n if( message.charAt(0) == 'C' )\n {\n// Intent intent = new Intent(this, PayLater.class);\n Intent intent = new Intent(this, PayLaterTest.class);\n PendingIntent payInent = PendingIntent.getActivity(MyMessagingService.this, 0, intent, 0);\n notification = new NotificationCompat.Builder(this, \"Notify\")\n .setSmallIcon(android.R.drawable.ic_dialog_info)\n .setContentTitle(title)\n .setContentText(message)\n .setDefaults(Notification.DEFAULT_ALL)\n .setPriority(NotificationCompat.PRIORITY_DEFAULT)\n .setVibrate(new long[0])// heads-up\n .addAction(R.drawable.user,\"Pay\",payInent)\n .setAutoCancel(true)\n .build();\n }\n else if( message.charAt(0) == 'G' )\n {\n //start activity go in\n Intent intent = new Intent(this, PayActivity.class);\n PendingIntent payInent = PendingIntent.getActivity(MyMessagingService.this, 0, intent, 0);\n notification = new NotificationCompat.Builder(this, \"Notify\")\n .setSmallIcon(android.R.drawable.ic_dialog_info)\n .setContentTitle(title)\n .setContentText(message)\n .setDefaults(Notification.DEFAULT_ALL)\n .setPriority(NotificationCompat.PRIORITY_DEFAULT)\n .setVibrate(new long[0])// heads-up\n .addAction(R.drawable.user,\"Verify\",payInent)\n .setAutoCancel(true)\n .build();\n }\n else if( message.charAt(0) == 'I' )\n {\n //start activity invalid slot\n// Intent intent = new Intent(this, PayActivity.class);\n\n// PendingIntent payInent = PendingIntent.getActivity(MyMessagingService.this, 0, intent, 0);\n notification = new NotificationCompat.Builder(this, \"Notify\")\n .setSmallIcon(android.R.drawable.ic_dialog_info)\n .setContentTitle(title)\n .setContentText(message)\n .setDefaults(Notification.DEFAULT_ALL)\n .setPriority(NotificationCompat.PRIORITY_DEFAULT)\n .setAutoCancel(true)\n .setVibrate(new long[0])// heads-up\n // .addAction(R.drawable.user,\"Verify\",payInent)\n .build();\n }\n\n m = (NotificationManager) getSystemService(getApplicationContext().NOTIFICATION_SERVICE);;\n m.notify(999,notification);\n // m.cancel(999);\n }",
"@Override\r\n\t\t\tpublic void notificationClicked(Notification paramNotification) {\n\r\n\t\t\t\tMobclickAgent.onEvent(getActivity(),\r\n\t\t\t\t\t\tUMengEventID.NOTIFICATION_LIST_CLICK);\r\n\t\t\t\t// 没有读过这条Notification\r\n\t\t\t\tif (paramNotification.readState == 0) {\r\n\t\t\t\t\tparamNotification.readState = 1;\r\n\r\n\t\t\t\t\t// 更新数据库\r\n\t\t\t\t\tDDBOpenHelper mDdbOpenHelper = DDBOpenHelper\r\n\t\t\t\t\t\t\t.getInstance(getActivity());\r\n\t\t\t\t\t//\r\n\t\t\t\t\tmDdbOpenHelper\r\n\t\t\t\t\t\t\t.updateReadState(paramNotification.activityId);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tswitch (paramNotification.type) {\r\n\t\t\t\tcase NotificationType.ANSWER:\r\n\t\t\t\t\t// ask someone's question be same with\r\n\t\t\t\t\t// other_answer_the_question_your_starrred\r\n\t\t\t\t\tNotificationFragment.this.bus\r\n\t\t\t\t\t\t\t.post(new AnswerNotificationSelected(\r\n\t\t\t\t\t\t\t\t\tparamNotification));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase NotificationType.ASK:\r\n\t\t\t\t\t// the same interface with starred\r\n\t\t\t\t\tNotificationFragment.this.bus\r\n\t\t\t\t\t\t\t.post(new StarredNotificationSelected(\r\n\t\t\t\t\t\t\t\t\tparamNotification));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase NotificationType.LIKED_ANSWER:\r\n\t\t\t\t\t// the same interface with starred\r\n\t\t\t\t\tNotificationFragment.this.bus\r\n\t\t\t\t\t\t\t.post(new AnswerNotificationSelected(\r\n\t\t\t\t\t\t\t\t\tparamNotification));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase NotificationType.LIKED_QUESTION:\r\n\t\t\t\t\t// the same interface with starred\r\n\t\t\t\t\tNotificationFragment.this.bus\r\n\t\t\t\t\t\t\t.post(new StarredNotificationSelected(\r\n\t\t\t\t\t\t\t\t\tparamNotification));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase NotificationType.OTHER_ANSWER_THE_QUESTION_YOUR_STARRED:\r\n\t\t\t\t\t// the same interface with answer\r\n\t\t\t\t\tNotificationFragment.this.bus\r\n\t\t\t\t\t\t\t.post(new AnswerNotificationSelected(\r\n\t\t\t\t\t\t\t\t\tparamNotification));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase NotificationType.OTHER_FORWARD_YOU_QUESTION:\r\n\t\t\t\t\t// the same interface with starred\r\n\t\t\t\t\tNotificationFragment.this.bus\r\n\t\t\t\t\t\t\t.post(new StarredNotificationSelected(\r\n\t\t\t\t\t\t\t\t\tparamNotification));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase NotificationType.STARRED:\r\n\t\t\t\t\tNotificationFragment.this.bus\r\n\t\t\t\t\t\t\t.post(new StarredNotificationSelected(\r\n\t\t\t\t\t\t\t\t\tparamNotification));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase NotificationType.THANKS_CARD:\r\n\t\t\t\t\tNotificationFragment.this.bus\r\n\t\t\t\t\t\t\t.post(new ThankYouNotificationSelected(\r\n\t\t\t\t\t\t\t\t\tparamNotification));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}",
"@Override\n public void onReceive(Context context, Intent intent) {\n System.out.println(\"notification!\");\n\n NotificationManager notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);\n Notification.Builder notificationBuilder = new Notification.Builder(context);\n notificationBuilder.setContentText(intent.getStringExtra(\"Content\"))\n .setContentTitle(intent.getStringExtra(\"Title\"))\n .setSmallIcon(R.mipmap.ic_launcher);\n Notification notification = notificationBuilder.build();\n //setContentText(\"hello world\").build();\n Random rand = new Random();\n int x = Integer.parseInt(intent.getStringExtra(\"code\"));\n\n notificationManager.notify(x,notification);\n Intent intent1 = new Intent(context, notificationService.class);\n }",
"protected void sendNotification(Bundle messageInfo) {\n mNotificationManager = (NotificationManager)\n this.getSystemService(Context.NOTIFICATION_SERVICE);\n\n Class targetActivity = TCSAppInstance.getInstance().getTargetNotificationClass();\n Intent notificationIntent;\n\n if (targetActivity != null)\n notificationIntent = new Intent(this, targetActivity);\n else\n notificationIntent = getPackageManager().getLaunchIntentForPackage(getApplication().getPackageName());\n\n\n // set intent so it does not start a new activity\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);\n\n PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);\n\n NotificationCompat.Builder mBuilder =\n new NotificationCompat.Builder(getApplicationContext())\n .setContentTitle(TCSAppInstance.getInstance().getApplication().getString(R.string.app_name))\n .setContentText(messageInfo.getString(\"message\"))\n .setWhen(System.currentTimeMillis())\n .setStyle(new NotificationCompat.BigTextStyle().bigText(messageInfo.getString(\"message\")))\n .setAutoCancel(true);\n\n if (icon > 0) {\n mBuilder.setSmallIcon(icon);\n }\n\n if (messageInfo.getString(\"alertSound\") != null && messageInfo.getString(\"alertSound\").equals(\"true\")) {\n mBuilder.setDefaults(Notification.DEFAULT_SOUND);\n }\n\n mBuilder.setContentIntent(contentIntent);\n\n int notificationId = TCSUtilities.generateRandomNumber();\n mNotificationManager.notify(notificationId, mBuilder.build());\n\n broadcastMessageIntent.putExtra(MESSAGE_STRING, messageInfo.getString(\"message\"));\n sendBroadcast(broadcastMessageIntent);\n }",
"@Override\n public void run() {\n FirebaseDatabase.getInstance().getReference().child(\"Tokens\").child(targetID).child(\"token\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot snapshot) {\n String usertoken=snapshot.getValue(String.class);\n sendNotifications(usertoken, \"Appointment completed\",\"Open your app to leave a review\");\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n\n }\n });\n\n updateDialog.dismiss();\n\n finish();\n overridePendingTransition(0, 0);\n startActivity(getIntent());\n overridePendingTransition(0, 0);\n\n }",
"protected void pushNotification(String userID, String message){\n }",
"public void sendNotification(JSONObject notification) {\n\t\tLog.d(TAG, \"sendNotification\");\n\t\tif (notification != null) {\n\t\t\tsendSuccessResult(CALLBACK_TYPE_NOTIFICATION, notification);\n\t\t}\n\t}",
"public void sendNotification(View view) {\n\t\t Intent intent = new Intent(this, MainActivity.class);\r\n\t\t PendingIntent pIntent = PendingIntent.getActivity(this, 0, intent, 0);\r\n\r\n\t\t // Build notification\r\n\t\t // Actions are just fake\r\n\t\t Notification noti = new Notification.Builder(this)\r\n\t\t .setContentTitle(\"TodoList Item\")\r\n\t\t .setContentText(\"A New Item was Added\").setSmallIcon(R.drawable.ic_launcher)\r\n\t\t .setContentIntent(pIntent).build();\r\n\t\t //.addAction(R.drawable.ic_launcher, \"Call\", pIntent);\r\n\t\t //.addAction(R.drawable.ic_launcher, \"More\", pIntent)\r\n\t\t //.addAction(R.drawable.ic_launcher, \"And more\", pIntent).build();\r\n\t\t NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\r\n\t\t // hide the notification after its selected\r\n\t\t noti.flags |= Notification.FLAG_AUTO_CANCEL;\r\n\r\n\t\t notificationManager.notify(0, noti);\r\n\r\n\t\t }",
"void notificationReceived(Notification notification);",
"private void sendNotifications(String userMessage) {\n if (this.notifications == null) {\n this.notifications = new ConcurrentLinkedQueue<Notification>();\n }\n \n // not sure if the synchronize is needed here, let's see ...\n // synchronized (notifications) {\n if (!this.notifications.isEmpty()) {\n ObjectName source = getObjectName();\n Notification n = new Notification(NotificationType.setOfNotifications, source, counter++,\n userMessage);\n n.setUserData(this.notifications);\n super.sendNotification(n);\n this.notifications.clear();\n // }\n }\n }",
"private void sendNotification(JSONObject notification, final String staffID) {\r\n JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(FCM_API, notification,\r\n new Response.Listener<JSONObject>() {\r\n @Override\r\n public void onResponse(JSONObject response) {\r\n Toast.makeText(BookingListDetails.this, \"\"+ staffID + \" has been Notified!\", Toast.LENGTH_SHORT).show();\r\n Log.i(TAG, \"onResponse: \" + response);\r\n }\r\n },\r\n new Response.ErrorListener() {\r\n @Override\r\n public void onErrorResponse(VolleyError error) {\r\n Toast.makeText(BookingListDetails.this, \"Request error\", Toast.LENGTH_LONG).show();\r\n Log.i(TAG, \"onErrorResponse: Didn't work\");\r\n }\r\n }) {\r\n @Override\r\n public Map<String, String> getHeaders() throws AuthFailureError {\r\n Map<String, String> params = new HashMap<>();\r\n params.put(\"Authorization\", serverKey);\r\n params.put(\"Content-Type\", contentType);\r\n return params;\r\n }\r\n };\r\n MySingleton.getInstance(getApplicationContext()).addToRequestQueue(jsonObjectRequest);\r\n }",
"public abstract void sendNotification(String sendFrom, List<Object> sendTo, String sendToProperty, NoticeTemplate noticeTemplate, Object noticeData);",
"@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 static void enableRegNotifications() {\n\t\t\n\t}",
"private void sendNotification() {\n //Log.e(\"sendNotification: \", \"\" + message);\n\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\n Intent intent = new Intent(this, ClubNewsActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,\n 0);\n\n notificationBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher))\n .setContentTitle(getResources().getString(R.string.app_name))\n .setContentText(getUnexpandedContentText(strArrList.size()))\n .setAutoCancel(true)\n /*.setNumber(strArrList.size())*/\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent)\n .setPriority(Notification.PRIORITY_HIGH)\n .setStyle(getExpandedNotificationStyle(strArrList));\n\n NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();\n // Moves events into the expanded layout\n for (int iCount = 0; iCount < strArrList.size(); iCount++) {\n inboxStyle.addLine(strArrList.get(iCount));\n }\n NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.notify(0, notificationBuilder.build());\n }",
"@SuppressLint(\"WrongConstant\")\n private Notification prepareNotification() {\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O &&\n mNotificationManager.getNotificationChannel(FOREGROUND_CHANNEL_ID) == null) {\n CharSequence name = getString(R.string.text_name_notification);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(FOREGROUND_CHANNEL_ID, name, importance);\n channel.enableVibration(false);\n mNotificationManager.createNotificationChannel(channel);\n }\n\n Intent notificationIntent = new Intent(this, Principal.class);\n notificationIntent.setAction(Constants.ACTION.MAIN_ACTION);\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n\n // if min sdk goes below honeycomb\n /*if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n } else {\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n }*/\n\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // make a stop intent\n Intent stopIntent = new Intent(this, Servicio_cargar_punto_google.class);\n stopIntent.setAction(Constants.ACTION.STOP_ACTION);\n PendingIntent pendingStopIntent = PendingIntent.getService(this, 0, stopIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.notification);\n //remoteViews.setOnClickPendingIntent(R.id.btn_stop, pendingStopIntent);\n remoteViews.setTextViewText(R.id.tv_fecha, fecha);\n\n // if it is connected\n switch (stateService) {\n case Constants.STATE_SERVICE.NOT_CONNECTED:\n remoteViews.setTextViewText(R.id.tv_estado, \"Sin conexión a internet . . .\");\n remoteViews.setImageViewResource(R.id.im_estado, R.drawable.ic_advertencia);\n break;\n case Constants.STATE_SERVICE.CONNECTED:\n remoteViews.setTextViewText(R.id.tv_estado, \"Traigo en camino\");\n remoteViews.setImageViewResource(R.id.im_estado, R.drawable.ic_carrito_verde);\n break;\n case Constants.STATE_SERVICE.GPS_INACTIVO:\n remoteViews.setTextViewText(R.id.tv_estado, \"GPS inactivo\");\n remoteViews.setImageViewResource(R.id.im_estado, R.drawable.ic_advertencia);\n break;\n case Constants.STATE_SERVICE.SIN_INTERNET:\n remoteViews.setTextViewText(R.id.tv_estado, \"Sin conexión a internet . .\");\n remoteViews.setImageViewResource(R.id.im_estado, R.drawable.ic_advertencia);\n break;\n }\n\n // notification builder\n NotificationCompat.Builder notificationBuilder;\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {\n notificationBuilder = new NotificationCompat.Builder(this, FOREGROUND_CHANNEL_ID);\n } else {\n notificationBuilder = new NotificationCompat.Builder(this);\n }\n notificationBuilder\n .setContent(remoteViews)\n .setSmallIcon(R.drawable.ic_carrito_verde)\n .setCategory(NotificationCompat.CATEGORY_SERVICE)\n .setOnlyAlertOnce(true)\n .setOngoing(true)\n .setAutoCancel(true)\n .setContentIntent(pendingIntent);\n\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {\n notificationBuilder.setVisibility(Notification.VISIBILITY_PUBLIC);\n }\n\n return notificationBuilder.build();\n }",
"private void sendMyNotification(String title, String message, String type, String Branch_Id) {\n\n\n Intent intent = new Intent(this, ActivityWithNavigationMenuPatient.class);\n intent.putExtra(\"push\", \"1\");\n intent.putExtra(\"Branch_Id\", Branch_Id);\n\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);\n\n Uri soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(title)\n .setContentText(message)\n .setAutoCancel(true)\n .setSound(soundUri)\n .setChannelId(\"my_channel_id_00011\") // set channel id\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n notificationManager.notify(1224, notificationBuilder.build());\n }",
"private void showNotification() {\n\n Intent intent = new Intent(this, DashboardActivity.class);\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n stackBuilder.addParentStack(DashboardActivity.class);\n stackBuilder.addNextIntent(intent);\n\n final NotificationCompat.Builder builder = new NotificationCompat.Builder(this);\n\n builder.setSmallIcon(R.drawable.ic_gps);\n builder.setContentText(getText(R.string.local_service_started));\n builder.setContentTitle(getText(R.string.local_service_label));\n builder.setOngoing(true);\n builder.setContentIntent(stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT));\n\n final Notification notification = builder.build();\n\n // Send the notification.\n mNotificationManager.notify(NOTIFICATION, notification);\n }",
"private static void notifyUser(ArrayList<Map> res) {\n\t\t\r\n\t\tFile htmlFile = new File(NOTIFICATION_FILE_PATH);\r\n\t\t\r\n\t\ttry {\r\n\t\t\tDesktop.getDesktop().browse(htmlFile.toURI());\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}",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = MyShardPrefernces.myNotificationChannelName;\n\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(MyShardPrefernces.myNoficataionChannelID, name, importance);\n channel.setDescription(\"Notifications for alert Messenging\");\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void notifyUser(List<String> result) {\r\n\t\t\tif(Util.getProperty(getApplicationContext(),\"notificationTimeChanged\",\"\").equals(\"true\") \r\n\t\t\t\t\t|| !notifiedToday())\r\n\t\t\t{\r\n\t\t\t\tUtil.setProperty(getApplicationContext(), \"notificationTimeChanged\", \"false\");\r\n\t\t\t\tif(result.size() > 0){\r\n\t\t\t\t\tint itemsDue = result.size();\r\n\t\t\t\t\tStringBuffer notificationText = new StringBuffer();\r\n\t\t\t\t\tfor(int i=0; i<itemsDue; i++){\r\n\t\t\t\t\t\tif(i!=0)\r\n\t\t\t\t\t\t\tnotificationText.append(\", \");\r\n\t\t\t\t\t\tnotificationText.append(result.get(i));\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tContext context = getApplicationContext();\r\n\t\t\t\t\tNotificationManager nm = (NotificationManager)context.getSystemService(NOTIFICATION_SERVICE);\r\n\t\t\t\t\tIntent notificationIntent = new Intent(context,ReminderActivity.class);\r\n\t\t\t\t\tPendingIntent pi = PendingIntent.getActivity(context, 0, notificationIntent,PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT);\r\n\t\t\t\t\tNotification n = new Notification.Builder(context)\r\n\t\t\t\t\t.setContentTitle(String.valueOf(itemsDue) + \" Items Due\")\r\n\t\t\t\t\t.setContentText(notificationText.toString())\r\n\t\t\t\t\t.setSmallIcon(R.drawable.ic_launcher)\r\n\t\t\t\t\t//.setLargeIcon(R.drawable.ic_basket)\r\n\t\t\t\t\t.setContentIntent(pi)\r\n\t\t\t\t\t.build();\t \r\n\t\t\t\t\tnm.notify(1, n);\r\n\t\t\t\t}\r\n\t\t\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"dd-MMM-yyyy\",Locale.US);\r\n\t\t\t\tUtil.setProperty(getApplicationContext(), \"ServiceLastRanOn\",formatter.format(new Date()));\r\n\t\t\t}\r\n\t\t}",
"private void notifyUser(Context context, String message) {\n\n Uri soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\n Intent intent = new Intent(context, MovieActivity.class);\n PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent,\n PendingIntent.FLAG_UPDATE_CURRENT);\n\n NotificationManager manager = (NotificationManager)\n context.getSystemService(Context.NOTIFICATION_SERVICE);\n\n android.support.v4.app.NotificationCompat.Builder builder = new NotificationCompat.Builder(context)\n .setContentTitle(\"device is now \" + message + \".\")\n .setOngoing(true)\n .setVibrate(new long[]{0, 500, 500, 500, 500, 500, 500})\n .setSound(soundUri)\n .setContentIntent(pendingIntent)\n .setSmallIcon(android.R.drawable.sym_def_app_icon)\n .setAutoCancel(true);\n\n manager.notify(1001, builder.build());\n\n }",
"public void sendNotification(GAIANotification notification) {\n final String message = notification.getRule()+\",\"+notification.getDescription();\n rabbitTemplate.send(rabbitQueueSend, rabbitQueueSend, new Message(message.getBytes(), new MessageProperties()));\n }",
"public void onNotification(JsonObject body) {\r\n\t\tlogger.debug(\"HANDLING\" + body.toString());\r\n\t\tString from = body.getString(\"from\");\r\n\t\tString guid = body.getJsonObject(\"identity\").getJsonObject(\"userProfile\").getString(\"guid\");\r\n\r\n\t\tif (body.containsKey(\"external\") && body.getBoolean(\"external\")) {\r\n\t\t\tlogger.debug(\"EXTERNAL INVITE\");\r\n\t\t\tString streamID = body.getString(\"streamID\");\r\n\t\t\tString objURL = from.split(\"/subscription\")[0];\r\n\t\t\tFuture<String> CheckURL = findDataObjectStream(objURL, guid);\r\n\t\t\tCheckURL.setHandler(asyncResult -> {\r\n\t\t\t\tif (asyncResult.succeeded()) {\r\n\r\n\t\t\t\t\tif (asyncResult.result() == null) {\r\n\t\t\t\t\t\tFuture<Boolean> persisted = persistDataObjUserURL(streamID, guid, objURL, \"reporter\");\r\n\t\t\t\t\t\tpersisted.setHandler(res -> {\r\n\t\t\t\t\t\t\tif (res.succeeded()) {\r\n\t\t\t\t\t\t\t\tif (persisted.result()) {\r\n\t\t\t\t\t\t\t\t\tonChanges(objURL);\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\t// oh ! we have a problem...\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t//\tonChanges(objURL);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// oh ! we have a problem...\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t} else {\r\n\t\t\tsubscribe(from, guid);\r\n\t\t}\r\n\t}",
"public abstract void sendNotification(T notification) throws NotificationException;",
"public void sendNotification(Bundle bundle) {\n int numberNotifications = AppPrefers.getInstance().getNumberNotifications();\n AppPrefers.getInstance().saveNumberNotifications(numberNotifications + 1);\n sendNotificationNumber();\n }",
"private void handleNow(RemoteMessage remoteMessage) {\n NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n String CHANNEL_ID_CHAT = \"myapp-01\";\n String CHANNEL_ID_GENERAL = \"myapp-02\";\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n\n // Channel 1\n CharSequence chatChannel = \"Chat\";\n String chatChannelDesc = \"Notifications from chat app\";\n int chatImportance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel mChatChannel = new NotificationChannel(CHANNEL_ID_CHAT, chatChannel, chatImportance);\n mChatChannel.setDescription(chatChannelDesc);\n mChatChannel.enableLights(true);\n mChatChannel.setLightColor(Color.BLUE);\n notificationManager.createNotificationChannel(mChatChannel);\n\n // Channel 2\n CharSequence generalChannel = \"General\";\n String generalChannelDesc = \"General notifications\";\n int generalImportance = NotificationManager.IMPORTANCE_HIGH;\n NotificationChannel mGeneralChannel = new NotificationChannel(CHANNEL_ID_GENERAL, generalChannel, generalImportance);\n mGeneralChannel.setDescription(generalChannelDesc);\n mGeneralChannel.enableLights(true);\n mGeneralChannel.setLightColor(Color.BLUE);\n notificationManager.createNotificationChannel(mGeneralChannel);\n\n }\n\n // Sending push notification to spesific channel\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n Intent intent1 = new Intent(getApplicationContext(), MainActivity.class);\n PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(), 123, intent1, PendingIntent.FLAG_UPDATE_CURRENT);\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(getApplicationContext(), CHANNEL_ID_CHAT)\n .setSmallIcon(R.drawable.xmen)\n .setBadgeIconType(R.drawable.xmen)\n .setChannelId(CHANNEL_ID_CHAT)\n .setAutoCancel(true)\n .setContentIntent(pendingIntent)\n .setNumber(1)\n .setSound(defaultSoundUri)\n .setColor(ContextCompat.getColor(this, R.color.white))\n .setWhen(System.currentTimeMillis());\n\n if (remoteMessage.getData().size() > 0) {\n notificationBuilder.setContentTitle(remoteMessage.getData().get(\"title\"));\n notificationBuilder.setContentText(remoteMessage.getData().get(\"message\"));\n }\n\n notificationManager.notify(getID(), notificationBuilder.build());\n }",
"@RequiresApi(api = Build.VERSION_CODES.O)\n private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.notification);\n String description =getString(R.string.notification);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"lemubitA\", name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void sendNotification(String msg) {\n mNotificationManager = (NotificationManager)\n ctx.getSystemService(Context.NOTIFICATION_SERVICE);\n\n PendingIntent contentIntent = PendingIntent.getActivity(ctx, 0,\n new Intent(ctx, LLActivity.class), 0);\n\n NotificationCompat.Builder mBuilder =\n new NotificationCompat.Builder(ctx)\n .setSmallIcon(R.drawable.ic_stat_gcm)\n .setContentTitle(\"GCM Notification\")\n .setStyle(new NotificationCompat.BigTextStyle()\n .bigText(msg))\n .setContentText(msg);\n\n mBuilder.setContentIntent(contentIntent);\n mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());\n }",
"@Override\n public int checkNotificationPermission() throws android.os.RemoteException {\n android.os.Parcel _data = android.os.Parcel.obtain();\n android.os.Parcel _reply = android.os.Parcel.obtain();\n int _result;\n try {\n _data.writeInterfaceToken(DESCRIPTOR);\n boolean _status = mRemote.transact(\n Stub.TRANSACTION_checkNotificationPermission, _data, _reply, 0);\n _reply.readException();\n _result = _reply.readInt();\n } finally {\n _reply.recycle();\n _data.recycle();\n }\n return _result;\n }",
"public static void sendNotificationTransactionDetail(Context ctx, String message, long type_id, int notifyId) {\n Intent notificationIntent = new Intent(ctx.getApplicationContext(), TransactionDetailActivity.class);\n notificationIntent.setAction(\"shang_\" + System.currentTimeMillis());\n notificationIntent.putExtra(\"entity_id\", type_id);\n\n// // Construct a task stack.\n// TaskStackBuilder stackBuilder = TaskStackBuilder.create(ctx);\n//\n// // Add the main Activity to the task stack as the parent.\n// stackBuilder.addParentStack(DealDetailActivity.class);\n//\n// // Push the content Intent onto the stack.\n// stackBuilder.addNextIntent(notificationIntent);\n//\n// // Get a PendingIntent containing the entire back stack.\n// PendingIntent notificationPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);\n\n PendingIntent notificationPendingIntent = PendingIntent.getActivity(ctx.getApplicationContext(), notifyId, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n // Get a notification builder that's compatible with platform versions >= 4\n NotificationCompat.Builder builder = new NotificationCompat.Builder(ctx);\n\n // Define the notification settings.\n builder.setContentTitle(\"Shang\").setContentText(message).setContentIntent(notificationPendingIntent);\n\n // Dismiss notification once the user touches it.\n builder.setAutoCancel(true);\n\n builder.setPriority(NotificationCompat.PRIORITY_HIGH);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n builder.setSmallIcon(R.drawable.icon_noti);\n builder.setLargeIcon(BitmapFactory.decodeResource(ctx.getResources(), R.drawable.icon_v2));\n } else {\n builder.setSmallIcon(R.drawable.icon_v2);\n }\n\n builder.setVibrate(new long[]{1000, 500});\n\n\n // Get an instance of the Notification manager\n NotificationManager mNotificationManager = (NotificationManager) ctx.getSystemService(Context.NOTIFICATION_SERVICE);\n\n // Issue the notification\n mNotificationManager.notify(notifyId, builder.build());\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\r\n CharSequence name = \"Picture upload\";\r\n String description =\"PRIKACENA SLIKA\";\r\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\r\n NotificationChannel channel = new NotificationChannel(\"slika1\", name, importance);\r\n channel.setDescription(description);\r\n // Register the channel with the system; you can't change the importance\r\n // or other notification behaviors after this\r\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\r\n notificationManager.createNotificationChannel(channel);\r\n }\r\n }",
"private void sendNotificationNewDevice(String messageBody) {\n Log.i(TAG, \"new 알림 메시지\"+ messageBody);\n\n\n Intent intentR = new Intent(this, RegisterActivity.class);\n intentR.putExtra(\"newDevice\",messageBody);\n intentR.addFlags(intentR.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntentR = PendingIntent.getActivity(this, 0 /* Request code */, intentR,\n PendingIntent.FLAG_ONE_SHOT);\n\n\n String channelId = getString(R.string.default_notification_channel_id);\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\n\n NotificationCompat.Builder notificationBuilder =\n new NotificationCompat.Builder(this, channelId)\n .setSmallIcon(R.drawable.ic_stat_ic_notification)\n .setContentTitle(getString(R.string.fcm_message))\n .setContentText(messageBody)\n .setAutoCancel(true)\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntentR);\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n // Since android Oreo notification channel is needed.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n NotificationChannel channel = new NotificationChannel(channelId,\n \"Channel human readable title\",\n NotificationManager.IMPORTANCE_HIGH);\n notificationManager.createNotificationChannel(channel);\n }\n\n notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());\n }",
"@Override\n public void execute(DelegateExecution execution) throws Exception {\n\tlogger.info(\"NotificationActivity Task Started\");\n\tLoanApplicationReqeust sc = (LoanApplicationReqeust) execution.getVariable(ProcessConstants.VAR_CTX);\n\tMessageRequest messageRequest = new MessageRequest();\n\t\n\tmessageRequest.setServiceName(ProcessConstants.SERVICE_NAME_NOTIFICATION);\n\tlogger.info(\"NotificationActivity Task completed\\n\\n\");\n }"
] | [
"0.6996522",
"0.6759857",
"0.660966",
"0.6567518",
"0.6483461",
"0.6417788",
"0.6403692",
"0.6375477",
"0.6353214",
"0.6348331",
"0.63388854",
"0.63253343",
"0.62528694",
"0.6250541",
"0.6226346",
"0.6218193",
"0.6217474",
"0.6210298",
"0.6186676",
"0.616774",
"0.6137834",
"0.6115713",
"0.6075623",
"0.6051566",
"0.60457075",
"0.6037009",
"0.60195076",
"0.6012118",
"0.60083216",
"0.60036767",
"0.59945333",
"0.5982423",
"0.597741",
"0.59623975",
"0.5950496",
"0.59361756",
"0.59305185",
"0.5910973",
"0.5909123",
"0.5906153",
"0.5898526",
"0.58973527",
"0.5891337",
"0.58906794",
"0.5890227",
"0.5882164",
"0.5882164",
"0.58814394",
"0.58805454",
"0.58761203",
"0.5873643",
"0.58703953",
"0.58656406",
"0.58638954",
"0.5859199",
"0.5853223",
"0.58464277",
"0.58453",
"0.5842523",
"0.5842064",
"0.5839186",
"0.583613",
"0.5830529",
"0.58302206",
"0.582681",
"0.5807962",
"0.5803484",
"0.58028364",
"0.58002114",
"0.5796713",
"0.57924336",
"0.5785904",
"0.57810545",
"0.5778103",
"0.5777853",
"0.5768973",
"0.57642096",
"0.5762188",
"0.5758337",
"0.5754299",
"0.5747924",
"0.57443625",
"0.57413983",
"0.5740322",
"0.5738711",
"0.57311356",
"0.57284003",
"0.5726752",
"0.5725355",
"0.57186204",
"0.57141733",
"0.5708649",
"0.5706741",
"0.56999624",
"0.56972843",
"0.56899107",
"0.5685438",
"0.5681563",
"0.56788635",
"0.56754"
] | 0.7388993 | 0 |
Returns whether this checker makes any determination about whether the given tree's return value should be used or not. Most checkers either determine that an expression is CRV or make no determination. | public boolean isCovered(ExpressionTree tree, VisitorState state) {
return isCheckReturnValue(tree, state);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final boolean isCheckReturnValue(ExpressionTree tree, VisitorState state) {\n // TODO(cgdecker): Just replace specializedMatcher with this?\n return specializedMatcher().matches(tree, state);\n }",
"Boolean conditionResult();",
"public Boolean validate (final Number res) throws CGException {\n sentinel.entering(((ATOutputSentinel)sentinel).validate);\n try {\n Boolean cond_2 = null;\n if (!(cond_2 = Boolean.valueOf(res.doubleValue() < 0)).booleanValue()) \n cond_2 = Boolean.valueOf(res.doubleValue() > 1000);\n if (cond_2.booleanValue()) \n return Boolean.FALSE;\n else \n return Boolean.TRUE;\n }\n finally {\n sentinel.leaving(((ATOutputSentinel)sentinel).validate);\n }\n }",
"boolean hasEresult();",
"public static boolean testTree(Case c, Node tree) {\n\t\tif (tree.isLeaf) {\n\t\t\t// If this is a result node, return whether the tree result matches the true classification\n\t\t\treturn c.isHealthy == tree.isHealthy;\n\t\t}\n\t\telse {\n\t\t\t// Else, we find the appropriate value, and then compare that to the threshold to recurse on the correct subtree\n\t\t\tdouble value = 0;\n\t\t\tswitch (tree.attribute) {\n\t\t\tcase K:\n\t\t\t\tvalue = c.k;\n\t\t\t\tbreak;\n\t\t\tcase Na:\n\t\t\t\tvalue = c.na;\n\t\t\t\tbreak;\n\t\t\tcase CL:\n\t\t\t\tvalue = c.cl;\n\t\t\t\tbreak;\n\t\t\tcase HCO3:\n\t\t\t\tvalue = c.hco3;\n\t\t\t\tbreak;\n\t\t\tcase Endotoxin:\n\t\t\t\tvalue = c.endotoxin;\n\t\t\t\tbreak;\n\t\t\tcase Aniongap:\n\t\t\t\tvalue = c.aniongap;\n\t\t\t\tbreak;\n\t\t\tcase PLA2:\n\t\t\t\tvalue = c.pla2;\n\t\t\t\tbreak;\n\t\t\tcase SDH:\n\t\t\t\tvalue = c.sdh;\n\t\t\t\tbreak;\n\t\t\tcase GLDH:\n\t\t\t\tvalue = c.gldh;\n\t\t\t\tbreak;\n\t\t\tcase TPP:\n\t\t\t\tvalue = c.tpp;\n\t\t\t\tbreak;\n\t\t\tcase BreathRate:\n\t\t\t\tvalue = c.breathRate;\n\t\t\t\tbreak;\n\t\t\tcase PCV:\n\t\t\t\tvalue = c.pcv;\n\t\t\t\tbreak;\n\t\t\tcase PulseRate:\n\t\t\t\tvalue = c.pulseRate;\n\t\t\t\tbreak;\n\t\t\tcase Fibrinogen:\n\t\t\t\tvalue = c.fibrinogen;\n\t\t\t\tbreak;\n\t\t\tcase Dimer:\n\t\t\t\tvalue = c.dimer;\n\t\t\t\tbreak;\n\t\t\tcase FibPerDim:\n\t\t\t\tvalue = c.fibPerDim;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Recursion\n\t\t\tif (value < tree.threshold) {\n\t\t\t\treturn testTree(c, tree.lessThanChildren);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn testTree(c, tree.greaterThanChildren);\n\t\t\t}\n\t\t}\n\t}",
"private boolean isReturnStatement()\n\t{\n\t\tboolean isValid = false;\n\t\t\n\t\tif(theCurrentToken.TokenType == TokenType.RETURN)\n\t\t{\n\t\t\tisValid = true;\n\t\t\tSystem.out.println(\"Return!\");\n\t\t}\t\n\t\t\n\t\treturn isValid;\n\t}",
"public boolean evaluate();",
"protected boolean checkRuleReturn(Node node, String compareToNodeToken) {\n\t\twhile (node != null && !(node.getConcreteNodeType().equals(\"keyword\") && node.getToken().startsWith(\"with\")))\n\t\t\tnode = node.getNextCSTNode();\n\t\tif (node == null)\n\t\t\treturn true;\n\t\tString ruleDeclarationName;\n\t\tfor (ASTNode astn : AspectWeaver.getInstance().getAstNodes().get(\"RuleDeclaration\")) {\n\t\t\truleDeclarationName = astn.getFirst().getFirst().getToken();\n\t\t\t//check if the current rule declaration is the one with the name of the searching one\n\t\t\tif (Pattern.matches(compareToNodeToken, ruleDeclarationName))\n\t\t\t{\n\t\t\t\t//collect all nodes inside the rule definition which have the same token as the returnOrResult node\n\t\t\t\tLinkedList<Node> children = AspectTools.getNodesWithName(astn, node.getNextCSTNode().getToken());\n\t\t\t\t//return xor of returnRequired and children.isEmpty()\n\t\t\t\treturn node.getToken().equals(\"with\") ^ children.isEmpty();\n\t\t\t}\n\t\t}\n\t\t//no rule declaration found - should not occur, because its has already been tested if compareToNodeToken exists inside the matches(..) method\n\t\treturn false;\n\t}",
"Boolean getCompletelyCorrect();",
"boolean result_is_boolean(DiagnosticChain diagnostics, Map<Object, Object> context);",
"public boolean getReturn();",
"public boolean evaluate() {\r\n\t\t\tif (this.isKnownValue()) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// handle the case when this.getValue() is null\r\n\t\t\tif (this.getValue() == null) {\r\n\t\t\t\t// if the value is null, then we just need to see if expected evaluation is also null\r\n\t\t\t\treturn this.getCurrentEvaluation() == null;\r\n\t\t\t}\r\n\t\t\t// if entities have the same name, they are equals.\r\n\t\t\tif (this.getCurrentEvaluation().getName().equalsIgnoreCase(this.getValue().getName())) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}",
"boolean isEvaluable();",
"@Override\n public Object evaluateNode(Interpretation interpretation) {\n InternalBoolean internalBoolean = term.verifyAndReturnBoolean(interpretation);\n return internalBoolean;\n }",
"public boolean isReturn() {\n return (isReturn);\n }",
"public boolean isReturnVals() {\n return mReturnVals;\n }",
"public boolean hasResult()\n/* */ {\n/* 119 */ return this.result != RESULT_NONE;\n/* */ }",
"boolean getResult();",
"boolean getResult();",
"boolean getResult();",
"boolean getResult();",
"private boolean returnStatementAfterTypeCheckCodeFragment() {\n\t\tStatementExtractor statementExtractor = new StatementExtractor();\r\n\t\tList<Statement> allReturnStatementsWithinTypeCheckCodeFragment = statementExtractor.getReturnStatements(typeCheckCodeFragment);\r\n\t\tList<ReturnStatement> returnStatementsHavingExpressionWithinTypeCheckCodeFragment = new ArrayList<ReturnStatement>();\r\n\t\tfor(Statement statement : allReturnStatementsWithinTypeCheckCodeFragment) {\r\n\t\t\tReturnStatement returnStatement = (ReturnStatement)statement;\r\n\t\t\tif(returnStatement.getExpression() != null)\r\n\t\t\t\treturnStatementsHavingExpressionWithinTypeCheckCodeFragment.add(returnStatement);\r\n\t\t}\r\n\t\tif(returnStatementsHavingExpressionWithinTypeCheckCodeFragment.isEmpty())\r\n\t\t\treturn false;\r\n\t\t//get all return statements having an expression within method body\r\n\t\tList<Statement> allReturnStatementsWithinTypeCheckMethod = statementExtractor.getReturnStatements(typeCheckMethod.getBody());\r\n\t\tList<ReturnStatement> returnStatementsHavingExpressionWithinTypeCheckMethod = new ArrayList<ReturnStatement>();\r\n\t\tfor(Statement statement : allReturnStatementsWithinTypeCheckMethod) {\r\n\t\t\tReturnStatement returnStatement = (ReturnStatement)statement;\r\n\t\t\tif(returnStatement.getExpression() != null)\r\n\t\t\t\treturnStatementsHavingExpressionWithinTypeCheckMethod.add(returnStatement);\r\n\t\t}\r\n\t\tList<ReturnStatement> returnStatementsHavingExpressionOutsideTypeCheckMethod = new ArrayList<ReturnStatement>();\r\n\t\treturnStatementsHavingExpressionOutsideTypeCheckMethod.addAll(returnStatementsHavingExpressionWithinTypeCheckMethod);\r\n\t\treturnStatementsHavingExpressionOutsideTypeCheckMethod.removeAll(returnStatementsHavingExpressionWithinTypeCheckCodeFragment);\r\n\t\tfor(ReturnStatement returnStatement : returnStatementsHavingExpressionOutsideTypeCheckMethod) {\r\n\t\t\tif(returnStatement.getStartPosition() > typeCheckCodeFragment.getStartPosition()+typeCheckCodeFragment.getLength())\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"@Override\n public boolean hasValenceError() {\n String valenceCheck = atom.checkBadValence();\n//\n// System.out.println(\"valenceCheckBad \" + valenceCheck);\n// System.out.println(\"calling actual checkValence \" + atom.checkValence());\n// System.out.println(\"valenceCheckBad again \" + atom.checkBadValence());\n return !valenceCheck.isEmpty();\n }",
"boolean getVarReturn();",
"boolean isValue();",
"@Override\n public boolean isDone() {\n // boolean result = true;\n // try {\n // result = !evaluateCondition();\n // } catch (Exception e) {\n // logger.error(e.getMessage(), e);\n // }\n // setDone(true);\n // return result;\n // setDone(false);\n return false;\n }",
"public boolean isCValueValid();",
"public boolean hasEresult() {\n return ((bitField0_ & 0x00000040) == 0x00000040);\n }",
"public final AliaChecker.boolean_expr_return boolean_expr() throws RecognitionException {\n\t\tAliaChecker.boolean_expr_return retval = new AliaChecker.boolean_expr_return();\n\t\tretval.start = input.LT(1);\n\n\t\tCommonTree root_0 = null;\n\n\t\tCommonTree _first_0 = null;\n\t\tCommonTree _last = null;\n\n\n\t\tCommonTree set26=null;\n\n\t\tCommonTree set26_tree=null;\n\n\t\ttry {\n\t\t\t// src\\\\alia\\\\AliaChecker.g:295:14: ( TRUE | FALSE )\n\t\t\t// src\\\\alia\\\\AliaChecker.g:\n\t\t\t{\n\t\t\troot_0 = (CommonTree)adaptor.nil();\n\n\n\t\t\t_last = (CommonTree)input.LT(1);\n\t\t\tset26=(CommonTree)input.LT(1);\n\t\t\tif ( input.LA(1)==FALSE||input.LA(1)==TRUE ) {\n\t\t\t\tinput.consume();\n\t\t\t\tset26_tree = (CommonTree)adaptor.dupNode(set26);\n\n\n\t\t\t\tadaptor.addChild(root_0, set26_tree);\n\n\t\t\t\tstate.errorRecovery=false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tMismatchedSetException mse = new MismatchedSetException(null,input);\n\t\t\t\tthrow mse;\n\t\t\t}\n\n\t\t\t \n\n\t\t\t}\n\n\t\t\tretval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n\n\t\t}\n\t\t \n\t\t catch (RecognitionException e) { \n\t\t \tif(!e.getMessage().equals(\"\")) {\n\t\t\t\t\tSystem.err.println(\"Exception!:\"+e.getMessage());\n\t\t\t\t}\n\t\t\t\tthrow (new AliaException(\"\"));\n\t\t } \n\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t\treturn retval;\n\t}",
"public boolean hasEresult() {\n return ((bitField0_ & 0x00000040) == 0x00000040);\n }",
"boolean hasVal();",
"boolean hasVal();",
"boolean hasDecision();",
"boolean hasDecision();",
"public static boolean doTestsPass() {\r\n // todo: implement more tests, please\r\n // feel free to make testing more elegant\r\n boolean testsPass = true;\r\n double result = power(2,-2);\r\n return testsPass && result==0.25;\r\n }",
"public boolean walkReturns(){\n int count = 1;\n move();\n \n while((x!=0)||(y!=0)){\n move();\n count++;\n if(count>=safeguard){\n return false;\n }\n }\n return true;\n }",
"Boolean getPartiallyCorrect();",
"private boolean check() {\n if (!isBST()) System.out.println(\"Not in symmetric order\");\n if (!isSizeConsistent()) System.out.println(\"Subtree counts not consistent\");\n if (!isRankConsistent()) System.out.println(\"Ranks not consistent\");\n return isBST() && isSizeConsistent() && isRankConsistent();\n }",
"public Boolean evaluatePP (int fnr) throws CGException {\n return new Boolean(true);\n }",
"public BooleanTypedValue getValueInternal(ExpressionState state)\r\n/* 18: */ throws EvaluationException\r\n/* 19: */ {\r\n/* 20:37 */ Object left = getLeftOperand().getValueInternal(state).getValue();\r\n/* 21:38 */ Object right = getRightOperand().getValueInternal(state).getValue();\r\n/* 22:39 */ if (((left instanceof Number)) && ((right instanceof Number)))\r\n/* 23: */ {\r\n/* 24:40 */ Number leftNumber = (Number)left;\r\n/* 25:41 */ Number rightNumber = (Number)right;\r\n/* 26:42 */ if (((leftNumber instanceof Double)) || ((rightNumber instanceof Double))) {\r\n/* 27:43 */ return BooleanTypedValue.forValue(leftNumber.doubleValue() <= rightNumber.doubleValue());\r\n/* 28: */ }\r\n/* 29:44 */ if (((leftNumber instanceof Long)) || ((rightNumber instanceof Long))) {\r\n/* 30:45 */ return BooleanTypedValue.forValue(leftNumber.longValue() <= rightNumber.longValue());\r\n/* 31: */ }\r\n/* 32:47 */ return BooleanTypedValue.forValue(leftNumber.intValue() <= rightNumber.intValue());\r\n/* 33: */ }\r\n/* 34:50 */ return BooleanTypedValue.forValue(state.getTypeComparator().compare(left, right) <= 0);\r\n/* 35: */ }",
"@Override\n protected void runReturnAnnotationHandler() {\n checkContainsAny(MSG_RETURN_VALUE_WITH_NONNULL_BY_DEFAULT,\n NullnessAnnotation.RETURN_VALUES_ARE_NONNULL_BY_DEFAULT);\n checkContainsAny(MSG_RETURN_VALUE_WITH_NULLABLE,\n NullnessAnnotation.NULLABLE);\n checkContainsAll(MSG_CONTRADICTING_RETURN_VALUE_ANNOTATIONS, NullnessAnnotation.NONNULL,\n NullnessAnnotation.CHECK_FOR_NULL);\n checkContainsAll(MSG_OVERRIDDEN_METHOD_WITH_CHECK_RETURN_VALUE,\n NullnessAnnotation.CHECK_RETURN_VALUE, NullnessAnnotation.OVERRIDE);\n checkRedundancyDueToClassLevelAnnotation(MSG_REDUNDANT_NONNULL_BY_DEFAULT_ANNOTATION,\n NullnessAnnotation.PARAMETERS_ARE_NONNULL_BY_DEFAULT);\n checkRedundancyDueToClassLevelAnnotation(MSG_REDUNDANT_NULLABLE_BY_DEFAULT_ANNOTATION,\n NullnessAnnotation.PARAMETERS_ARE_NULLABLE_BY_DEFAULT);\n\n final DetailAST ast = getAst();\n if (isVoid(ast)) {\n checkContainsAny(MSG_VOID_WITH_CHECK_RETURN_VALUE_ANNOTATION,\n NullnessAnnotation.CHECK_RETURN_VALUE);\n }\n if (isPrimitiveType(ast)) {\n checkContainsAny(MSG_PRIMITIVES_WITH_NULLNESS_ANNOTATION,\n NullnessAnnotation.CHECK_FOR_NULL, NullnessAnnotation.NONNULL,\n NullnessAnnotation.NULLABLE);\n }\n else {\n final NullnessAnnotation annotation = getParentMethodOrClassAnnotation(\n NullnessAnnotation.RETURN_VALUES_ARE_NONNULL_BY_DEFAULT);\n final boolean returnValuesAreNonnullByDefault = annotation\n == NullnessAnnotation.RETURN_VALUES_ARE_NONNULL_BY_DEFAULT;\n final boolean isMethodOverridden = isMethodOverridden();\n\n if (returnValuesAreNonnullByDefault) {\n if (!isMethodOverridden) {\n checkContainsAny(MSG_REDUNDANT_NONNULL_RETURN_ANNOTATION,\n NullnessAnnotation.NONNULL);\n }\n }\n else {\n checkContainsNone(MSG_RETURN_WITHOUT_NULLNESS_ANNOTATION,\n NullnessAnnotation.CHECK_FOR_NULL, NullnessAnnotation.NONNULL,\n NullnessAnnotation.OVERRIDE);\n }\n\n if (isMethodOverridden && !allowOverridingReturnValue) {\n checkContainsAny(MSG_OVERRIDDEN_METHODS_ALLOW_ONLY_NONNULL,\n NullnessAnnotation.CHECK_FOR_NULL, NullnessAnnotation.NULLABLE);\n }\n\n if (isMethodOverridden) {\n checkContainsAny(MSG_NEED_TO_INHERIT_PARAM_ANNOTATIONS,\n NullnessAnnotation.PARAMETERS_ARE_NONNULL_BY_DEFAULT);\n }\n }\n }",
"public boolean okReveiced () {\n\t\t\treturn resultDetected[RESULT_INDEX_OK];\n\t\t}",
"public boolean matchResult() {\n return !pathMatchDependencies.isEmpty();\n }",
"Boolean getIsValid();",
"public boolean check_condition(User u) {\n\tboolean result = false;\n\t// if the recursion has not reached to the leaf level, then continue to\n\t// check the condition\n\tif (operatr_int < 10) // not a leaf node\n\t{\n\t boolean apply_result = cond.check_condition(u);\n\t boolean apply2_result = cond2.check_condition(u);\n\t switch (operatr_int) {\n\t case 1:\n\t\tresult = (apply_result && apply2_result);\n\t\tbreak;\n\t case 2:\n\t\tresult = (apply_result || apply2_result);\n\t\tbreak;\n\t }\n\t}\n\t// recursion has reached a leaf node -\n\telse {\n\t // attempt lookup of value for field name(s) from user\n\t Integer fieldVal1 = u.get_field_value(pre_field);\n\t // check whether a 2-field compare vs. field-constant compare\n\t // uses pre_field_second to signal since pre_cn can't hold null as\n\t // an int\n\t if (pre_field_second.equals(\"\"))\n\t\tresult = compare(fieldVal1, operatr_int, int_constant);\n\t else\n\t\tresult = compare(fieldVal1, operatr_int,\n\t\t\tu.get_field_value(pre_field_second));\n\t}\n\treturn result;\n }",
"boolean isSetComplianceCheckResult();",
"public boolean isReturning(){\n\t\treturn returning;\n\t}",
"@Override\n\tpublic boolean test(Object[] args, Object res) {\n\t\treturn maxDepth((TreeNode)args[0]) == (Integer)res;\n\t}",
"public ResultType isBalancedWithResultTypeHelper(TreeNode root){\n if(root == null){\n return new ResultType(true, 0);\n }\n ResultType left_rst = isBalancedWithResultTypeHelper(root.left);\n ResultType right_rst = isBalancedWithResultTypeHelper(root.right);\n if(!left_rst.isBalanced || !right_rst.isBalanced || Math.abs(left_rst.depth - right_rst.depth) >=2\n ){\n return new ResultType(false, 0);\n }\n return new ResultType(true, 1 + Math.max(left_rst.depth, right_rst.depth));\n\n }",
"private boolean canCondenseTf()\n {\n if (!this.isRedstonePowered()) return false;\n\n TfCondenserRecipe recipe = this.getCurrentRecipe();\n if (recipe == null) return false;\n\n // Has enough ingredients?\n if (recipe.ingredient != null && ingredientTank.getFluidAmount() < recipe.ingredient.amount\n || nigariTank.getFluidAmount() < NIGARI_COST_MB) return false;\n\n // Check if an output item can be stacked to the output slot\n if (this.itemStacks[SLOT_TOFU_OUTPUT] == null) return true;\n\n if (!this.itemStacks[SLOT_TOFU_OUTPUT].isItemEqual(recipe.result)) return false;\n\n // Check if the stack will overflow\n int resultStacks = itemStacks[SLOT_TOFU_OUTPUT].stackSize + recipe.result.stackSize;\n return (resultStacks <= getInventoryStackLimit() && resultStacks <= recipe.result.getMaxStackSize());\n }",
"boolean getPossiblyBad();",
"public boolean hasValue() {\n return result.hasValue();\n }",
"public boolean hasValue() {\n return result.hasValue();\n }",
"public boolean isCorrigeDatosRetencion()\r\n/* 623: */ {\r\n/* 624:696 */ return this.corrigeDatosRetencion;\r\n/* 625: */ }",
"protected boolean testCC(String cc) {\n\t\tswitch (cc) {\n\t\t\tcase \"O\":\n\t\t\t\treturn dataspace.fOverflow;\n\t\t\tcase \"NO\":\n\t\t\t\treturn !dataspace.fOverflow;\n\t\t\tcase \"C\":\n\t\t\tcase \"B\":\n\t\t\tcase \"NAE\":\n\t\t\t\treturn dataspace.fCarry;\n\t\t\tcase \"NC\":\n\t\t\tcase \"NB\":\n\t\t\tcase \"AE\":\n\t\t\t\treturn !dataspace.fCarry;\n\t\t\tcase \"E\":\n\t\t\tcase \"Z\":\n\t\t\t\treturn dataspace.fZero;\n\t\t\tcase \"NE\":\n\t\t\tcase \"NZ\":\n\t\t\t\treturn !dataspace.fZero;\n\t\t\tcase \"BE\":\n\t\t\tcase \"NA\":\n\t\t\t\treturn (dataspace.fCarry || dataspace.fZero);\n\t\t\tcase \"NBE\":\n\t\t\tcase \"A\":\n\t\t\t\treturn !(dataspace.fCarry || dataspace.fZero);\n\t\t\tcase \"S\":\n\t\t\t\treturn dataspace.fSign;\n\t\t\tcase \"NS\":\n\t\t\t\treturn !dataspace.fSign;\n\t\t\tcase \"P\":\n\t\t\tcase \"PE\":\n\t\t\t\treturn dataspace.fParity;\n\t\t\tcase \"NP\":\n\t\t\tcase \"PO\":\n\t\t\t\treturn !dataspace.fParity;\n\t\t\tcase \"L\":\n\t\t\tcase \"NGE\":\n\t\t\t\t// \"^\" = \"xor\" ( \"!=\" would work as well)\n\t\t\t\treturn (dataspace.fSign ^ dataspace.fOverflow);\n\t\t\tcase \"NL\":\n\t\t\tcase \"GE\":\n\t\t\t\treturn dataspace.fSign == dataspace.fOverflow;\n\t\t\tcase \"LE\":\n\t\t\tcase \"NG\":\n\t\t\t\treturn ((dataspace.fSign ^ dataspace.fOverflow) || dataspace.fZero);\n\t\t\tcase \"NLE\":\n\t\t\tcase \"G\":\n\t\t\t\treturn !((dataspace.fSign ^ dataspace.fOverflow) || dataspace.fZero);\n\t\t\tcase \"CXZ\":\n\t\t\t\treturn (dataspace.CX.getShortcut() == 0);\n\t\t\tcase \"ECXZ\":\n\t\t\t\treturn (dataspace.ECX.getShortcut() == 0);\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}",
"public boolean isValidated()\n {\n if (noRadio.isSelected())\n {\n parent.exit();\n return false;\n }\n return (yesRadio.isSelected());\n }",
"public EtatDuJeu verifierCondition() {\r\n for (Objet obj : this.objets) {\r\n if (!this.vivant.possede(obj)) {\r\n return EtatDuJeu.ENCOURS;\r\n }\r\n }\r\n return this.getEtatConditionVerifiee();\r\n }",
"ReturnedValueEvaluationCondition getReturnedValue();",
"@ScriptyCommand(name = \"dbg-result?\", description =\n \"(dbg-result?)\\n\" +\n \"Verify if the current debugging session has already reached a result.\\n\" +\n \"See also: dbg-expr, dbg-result.\")\n @ScriptyRefArgList(ref = \"no arguments\")\n public boolean hasResult()\n throws CommandException {\n checkTrace();\n return trace.hasResult();\n }",
"public boolean isValid ( ) {\n\t\treturn extract ( handle -> handle.isValid ( ) );\n\t}",
"boolean getValue();",
"Boolean isPassed();",
"boolean evaluate(T target);",
"private boolean isRemovableDecInValueNode(Node decision, Node valueNode) {\n NodeList functionalPredOfSV = null;\n NodeList diff;\n NodeList predOfDec;\n\n\n //Informational predecessors of the decision\n predOfDec = decision.getParentNodes();\n predOfDec.insertNode(decision);\n\n //Conditional predecessors of the value node must be informational\n //predecessors of the decision\n functionalPredOfSV = ((IDWithSVNodes) diag).getChanceAndDecisionPredecessors(valueNode);\n diff = functionalPredOfSV.difference(decision.getParentNodes());\n diff.removeNode(decision);\n return (diff.size() == 0);\n\n }",
"public boolean reducible() {\n\treturn \n\t operator . equals( \"\\\\\") &&\n\t (argument.reducible() || argument instanceof BoolConstant);\n }",
"public boolean isSuccessAsPrimitive(final SessionContext ctx)\n\t{\n\t\tBoolean value = isSuccess( ctx );\n\t\treturn value != null ? value.booleanValue() : false;\n\t}",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"private boolean evaluateBooleanExpression(String expression)\n {\n CoreInstance value = (CoreInstance) evaluateExpression(expression, M3Paths.Boolean, true);\n if (value instanceof BooleanCoreInstance)\n {\n return ((BooleanCoreInstance) value).getValue();\n }\n\n String valueName = value.getName();\n if (ModelRepository.BOOLEAN_TRUE.equals(valueName))\n {\n return true;\n }\n if (ModelRepository.BOOLEAN_FALSE.equals(valueName))\n {\n return false;\n }\n\n throw new RuntimeException(\"Expected boolean value, got: \" + valueName);\n }",
"private boolean shouldCheck(final DetailAST ast) {\n boolean result = false;\n if (!ScopeUtil.isInCodeBlock(ast) && !isIgnored(ast)) {\n Scope customScope = Scope.PUBLIC;\n if (ast.getType() != TokenTypes.ENUM_CONSTANT_DEF\n && !ScopeUtil.isInInterfaceOrAnnotationBlock(ast)) {\n final DetailAST mods = ast.findFirstToken(TokenTypes.MODIFIERS);\n customScope = ScopeUtil.getScopeFromMods(mods);\n }\n\n final Scope surroundingScope = ScopeUtil.getSurroundingScope(ast);\n result = customScope.isIn(scope) && surroundingScope.isIn(scope)\n && (excludeScope == null\n || !customScope.isIn(excludeScope)\n || !surroundingScope.isIn(excludeScope));\n }\n return result;\n }",
"public boolean getResult() {\n\t\tif (stack.size() != 1) {\n\t\t\tthrow new IllegalStateException(\"Stack size mismatch\");\n\t\t}\n\t\t\n\t\treturn stack.peek();\n\t}",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean isEstConditionne();",
"boolean hasHas_certainty();",
"private boolean hasReturn(Parameter[] parameters) {\n boolean hasReturn = false;\n if (parameters.length != 0) {\n Parameter lastParam = parameters[parameters.length - 1];\n DataType type = lastParam.getType();\n hasReturn = (lastParam.getDirection() == Direction.OUT\n && (type == DataType.OBJECT_T || type == DataType.PSCO_T || type == DataType.EXTERNAL_OBJECT_T));\n }\n\n return hasReturn;\n }",
"boolean hasCelExpression();",
"public boolean evaluate(Object feature) {\n \tif (nullCheck == null) {\n return false;\n } else {\n return (nullCheck.evaluate(feature) == null);\n }\n }"
] | [
"0.7098673",
"0.58797264",
"0.57424396",
"0.5714564",
"0.56984544",
"0.5674099",
"0.5643846",
"0.5630073",
"0.5626991",
"0.55517226",
"0.5542634",
"0.5472243",
"0.54530007",
"0.5410673",
"0.53954715",
"0.538322",
"0.5338264",
"0.5336058",
"0.5336058",
"0.5336058",
"0.5336058",
"0.53315616",
"0.53101885",
"0.5304144",
"0.5303192",
"0.5270585",
"0.5259157",
"0.5239225",
"0.5239196",
"0.52247506",
"0.5217999",
"0.5217999",
"0.5212201",
"0.5212201",
"0.52046657",
"0.518967",
"0.518909",
"0.51878494",
"0.5159572",
"0.51298803",
"0.51156163",
"0.51104957",
"0.5095253",
"0.5092778",
"0.50908333",
"0.5089495",
"0.50834095",
"0.5078348",
"0.5073551",
"0.5058153",
"0.5050716",
"0.5049469",
"0.5049469",
"0.5048389",
"0.50457144",
"0.50361234",
"0.5033845",
"0.50272",
"0.5005536",
"0.5002896",
"0.49974275",
"0.49939334",
"0.49711716",
"0.49673104",
"0.4965874",
"0.495629",
"0.49522775",
"0.49522775",
"0.49522775",
"0.49522775",
"0.49522775",
"0.49522775",
"0.49522775",
"0.49522775",
"0.49522775",
"0.49522775",
"0.49522775",
"0.49522775",
"0.49522775",
"0.49522775",
"0.49479365",
"0.49459404",
"0.49444234",
"0.49375814",
"0.49375814",
"0.49375814",
"0.49375814",
"0.49375814",
"0.49375814",
"0.49375814",
"0.49375814",
"0.49375814",
"0.49375814",
"0.49375814",
"0.49375814",
"0.49328357",
"0.4930497",
"0.4922422",
"0.49176872",
"0.49152946"
] | 0.6934602 | 1 |
Returns whether the given tree's return value should be used according to this checker, regardless of whether or not the return value is actually used. | public final boolean isCheckReturnValue(ExpressionTree tree, VisitorState state) {
// TODO(cgdecker): Just replace specializedMatcher with this?
return specializedMatcher().matches(tree, state);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isCovered(ExpressionTree tree, VisitorState state) {\n return isCheckReturnValue(tree, state);\n }",
"public boolean getReturn();",
"protected boolean checkRuleReturn(Node node, String compareToNodeToken) {\n\t\twhile (node != null && !(node.getConcreteNodeType().equals(\"keyword\") && node.getToken().startsWith(\"with\")))\n\t\t\tnode = node.getNextCSTNode();\n\t\tif (node == null)\n\t\t\treturn true;\n\t\tString ruleDeclarationName;\n\t\tfor (ASTNode astn : AspectWeaver.getInstance().getAstNodes().get(\"RuleDeclaration\")) {\n\t\t\truleDeclarationName = astn.getFirst().getFirst().getToken();\n\t\t\t//check if the current rule declaration is the one with the name of the searching one\n\t\t\tif (Pattern.matches(compareToNodeToken, ruleDeclarationName))\n\t\t\t{\n\t\t\t\t//collect all nodes inside the rule definition which have the same token as the returnOrResult node\n\t\t\t\tLinkedList<Node> children = AspectTools.getNodesWithName(astn, node.getNextCSTNode().getToken());\n\t\t\t\t//return xor of returnRequired and children.isEmpty()\n\t\t\t\treturn node.getToken().equals(\"with\") ^ children.isEmpty();\n\t\t\t}\n\t\t}\n\t\t//no rule declaration found - should not occur, because its has already been tested if compareToNodeToken exists inside the matches(..) method\n\t\treturn false;\n\t}",
"public boolean isReturn() {\n return (isReturn);\n }",
"private boolean isReturnStatement()\n\t{\n\t\tboolean isValid = false;\n\t\t\n\t\tif(theCurrentToken.TokenType == TokenType.RETURN)\n\t\t{\n\t\t\tisValid = true;\n\t\t\tSystem.out.println(\"Return!\");\n\t\t}\t\n\t\t\n\t\treturn isValid;\n\t}",
"protected boolean acceptForReturn(Atom atom)\r\n {\r\n return true;\r\n }",
"public void returningToTrue(){\n Closure enclosingFunction = findEnclosingFunction();\n if (enclosingFunction != null){\n Closure currentClosure = this;\n while (currentClosure != enclosingFunction){\n if (!currentClosure.isReturning()){\n currentClosure.returning = true;\n }\n currentClosure = currentClosure.getParent();\n }\n enclosingFunction.returning = true;\n }\n }",
"Boolean conditionResult();",
"public boolean isReturning(){\n\t\treturn returning;\n\t}",
"@Override\n public boolean isReturn() {\n return true;\n }",
"@Override\n\tpublic boolean javaMethodBaseWithBooleanRet() {\n\t\treturn false;\n\t}",
"boolean getResult();",
"boolean getResult();",
"boolean getResult();",
"boolean getResult();",
"boolean getVarReturn();",
"@Override\n\tpublic boolean test(Object[] args, Object res) {\n\t\treturn maxDepth((TreeNode)args[0]) == (Integer)res;\n\t}",
"public static boolean testTree(Case c, Node tree) {\n\t\tif (tree.isLeaf) {\n\t\t\t// If this is a result node, return whether the tree result matches the true classification\n\t\t\treturn c.isHealthy == tree.isHealthy;\n\t\t}\n\t\telse {\n\t\t\t// Else, we find the appropriate value, and then compare that to the threshold to recurse on the correct subtree\n\t\t\tdouble value = 0;\n\t\t\tswitch (tree.attribute) {\n\t\t\tcase K:\n\t\t\t\tvalue = c.k;\n\t\t\t\tbreak;\n\t\t\tcase Na:\n\t\t\t\tvalue = c.na;\n\t\t\t\tbreak;\n\t\t\tcase CL:\n\t\t\t\tvalue = c.cl;\n\t\t\t\tbreak;\n\t\t\tcase HCO3:\n\t\t\t\tvalue = c.hco3;\n\t\t\t\tbreak;\n\t\t\tcase Endotoxin:\n\t\t\t\tvalue = c.endotoxin;\n\t\t\t\tbreak;\n\t\t\tcase Aniongap:\n\t\t\t\tvalue = c.aniongap;\n\t\t\t\tbreak;\n\t\t\tcase PLA2:\n\t\t\t\tvalue = c.pla2;\n\t\t\t\tbreak;\n\t\t\tcase SDH:\n\t\t\t\tvalue = c.sdh;\n\t\t\t\tbreak;\n\t\t\tcase GLDH:\n\t\t\t\tvalue = c.gldh;\n\t\t\t\tbreak;\n\t\t\tcase TPP:\n\t\t\t\tvalue = c.tpp;\n\t\t\t\tbreak;\n\t\t\tcase BreathRate:\n\t\t\t\tvalue = c.breathRate;\n\t\t\t\tbreak;\n\t\t\tcase PCV:\n\t\t\t\tvalue = c.pcv;\n\t\t\t\tbreak;\n\t\t\tcase PulseRate:\n\t\t\t\tvalue = c.pulseRate;\n\t\t\t\tbreak;\n\t\t\tcase Fibrinogen:\n\t\t\t\tvalue = c.fibrinogen;\n\t\t\t\tbreak;\n\t\t\tcase Dimer:\n\t\t\t\tvalue = c.dimer;\n\t\t\t\tbreak;\n\t\t\tcase FibPerDim:\n\t\t\t\tvalue = c.fibPerDim;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Recursion\n\t\t\tif (value < tree.threshold) {\n\t\t\t\treturn testTree(c, tree.lessThanChildren);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn testTree(c, tree.greaterThanChildren);\n\t\t\t}\n\t\t}\n\t}",
"public boolean hasResult()\n/* */ {\n/* 119 */ return this.result != RESULT_NONE;\n/* */ }",
"boolean test() {\n return false; // REPLACE WITH SOLUTION\n }",
"@Override\n protected void runReturnAnnotationHandler() {\n checkContainsAny(MSG_RETURN_VALUE_WITH_NONNULL_BY_DEFAULT,\n NullnessAnnotation.RETURN_VALUES_ARE_NONNULL_BY_DEFAULT);\n checkContainsAny(MSG_RETURN_VALUE_WITH_NULLABLE,\n NullnessAnnotation.NULLABLE);\n checkContainsAll(MSG_CONTRADICTING_RETURN_VALUE_ANNOTATIONS, NullnessAnnotation.NONNULL,\n NullnessAnnotation.CHECK_FOR_NULL);\n checkContainsAll(MSG_OVERRIDDEN_METHOD_WITH_CHECK_RETURN_VALUE,\n NullnessAnnotation.CHECK_RETURN_VALUE, NullnessAnnotation.OVERRIDE);\n checkRedundancyDueToClassLevelAnnotation(MSG_REDUNDANT_NONNULL_BY_DEFAULT_ANNOTATION,\n NullnessAnnotation.PARAMETERS_ARE_NONNULL_BY_DEFAULT);\n checkRedundancyDueToClassLevelAnnotation(MSG_REDUNDANT_NULLABLE_BY_DEFAULT_ANNOTATION,\n NullnessAnnotation.PARAMETERS_ARE_NULLABLE_BY_DEFAULT);\n\n final DetailAST ast = getAst();\n if (isVoid(ast)) {\n checkContainsAny(MSG_VOID_WITH_CHECK_RETURN_VALUE_ANNOTATION,\n NullnessAnnotation.CHECK_RETURN_VALUE);\n }\n if (isPrimitiveType(ast)) {\n checkContainsAny(MSG_PRIMITIVES_WITH_NULLNESS_ANNOTATION,\n NullnessAnnotation.CHECK_FOR_NULL, NullnessAnnotation.NONNULL,\n NullnessAnnotation.NULLABLE);\n }\n else {\n final NullnessAnnotation annotation = getParentMethodOrClassAnnotation(\n NullnessAnnotation.RETURN_VALUES_ARE_NONNULL_BY_DEFAULT);\n final boolean returnValuesAreNonnullByDefault = annotation\n == NullnessAnnotation.RETURN_VALUES_ARE_NONNULL_BY_DEFAULT;\n final boolean isMethodOverridden = isMethodOverridden();\n\n if (returnValuesAreNonnullByDefault) {\n if (!isMethodOverridden) {\n checkContainsAny(MSG_REDUNDANT_NONNULL_RETURN_ANNOTATION,\n NullnessAnnotation.NONNULL);\n }\n }\n else {\n checkContainsNone(MSG_RETURN_WITHOUT_NULLNESS_ANNOTATION,\n NullnessAnnotation.CHECK_FOR_NULL, NullnessAnnotation.NONNULL,\n NullnessAnnotation.OVERRIDE);\n }\n\n if (isMethodOverridden && !allowOverridingReturnValue) {\n checkContainsAny(MSG_OVERRIDDEN_METHODS_ALLOW_ONLY_NONNULL,\n NullnessAnnotation.CHECK_FOR_NULL, NullnessAnnotation.NULLABLE);\n }\n\n if (isMethodOverridden) {\n checkContainsAny(MSG_NEED_TO_INHERIT_PARAM_ANNOTATIONS,\n NullnessAnnotation.PARAMETERS_ARE_NONNULL_BY_DEFAULT);\n }\n }\n }",
"boolean isValue();",
"public boolean isReturnVals() {\n return mReturnVals;\n }",
"boolean getValue();",
"@Override\n public Object evaluateNode(Interpretation interpretation) {\n InternalBoolean internalBoolean = term.verifyAndReturnBoolean(interpretation);\n return internalBoolean;\n }",
"public static void typeCheckReturn(PegObject node) {\n\t\tSymbolTable gamma = node.getSymbolTable();\n\t\tDefinedNameFunctor f = gamma.getName(\"return\");\n\t\tBunType returnType = f.getReturnType(BunType.UntypedType);\n\t\tSystem.out.println(\"returnType=\"+returnType);\n\t\tgamma.checkTypeAt(node, 0, returnType, false);\n\t}",
"@Override\n public boolean isDone() {\n // boolean result = true;\n // try {\n // result = !evaluateCondition();\n // } catch (Exception e) {\n // logger.error(e.getMessage(), e);\n // }\n // setDone(true);\n // return result;\n // setDone(false);\n return false;\n }",
"Boolean isPassed();",
"public boolean get_return(){\n return local_return;\n }",
"public boolean isResult (Object value);",
"ReturnedValueEvaluationCondition getReturnedValue();",
"boolean hasEresult();",
"public boolean evaluate() {\r\n\t\t\tif (this.isKnownValue()) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// handle the case when this.getValue() is null\r\n\t\t\tif (this.getValue() == null) {\r\n\t\t\t\t// if the value is null, then we just need to see if expected evaluation is also null\r\n\t\t\t\treturn this.getCurrentEvaluation() == null;\r\n\t\t\t}\r\n\t\t\t// if entities have the same name, they are equals.\r\n\t\t\tif (this.getCurrentEvaluation().getName().equalsIgnoreCase(this.getValue().getName())) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}",
"void checkReturnSt (int ln) {\r\n if (!return_type.isVoid ())\r\n OzcError.needReturnSt (ln);\r\n else \r\n need_return = true;\r\n }",
"public boolean evaluate();",
"public boolean getResult() {\n\t\tif (stack.size() != 1) {\n\t\t\tthrow new IllegalStateException(\"Stack size mismatch\");\n\t\t}\n\t\t\n\t\treturn stack.peek();\n\t}",
"public boolean get_return() {\r\n return local_return;\r\n }",
"@Override\n\tpublic void visit(ReturnNode node) {\n\t\tEvaluator.missingRet = false;\n\t\t/**\n\t\t * verificam check failed, nu si assert failed, deoarece eroarea de\n\t\t * missing return are prioritate mai mare decat cea de assert failed\n\t\t */\n\t\tif (Evaluator.checkScope(node) == false) {\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t * evaluam copilul nodului\n\t\t */\n\t\tEvaluator.evaluate(node.getChild(0));\n\t\t/**\n\t\t * preluam rezultatul evaluarii\n\t\t */\n\t\tif (node.getChild(0) instanceof Variable) {\n\t\t\tnode.setName(Evaluator.variables.get(node.getChild(0).getName()));\n\t\t} else {\n\t\t\tnode.setName(node.getChild(0).getName());\n\t\t}\n\t}",
"boolean getIsOk();",
"public boolean walkReturns(){\n int count = 1;\n move();\n \n while((x!=0)||(y!=0)){\n move();\n count++;\n if(count>=safeguard){\n return false;\n }\n }\n return true;\n }",
"public boolean isReturned() {\r\n\t\treturn isReturned;\r\n\t}",
"boolean result_is_boolean(DiagnosticChain diagnostics, Map<Object, Object> context);",
"public boolean matchResult() {\n return !pathMatchDependencies.isEmpty();\n }",
"public boolean getValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"boolean hasValue();",
"public ResultType isBalancedWithResultTypeHelper(TreeNode root){\n if(root == null){\n return new ResultType(true, 0);\n }\n ResultType left_rst = isBalancedWithResultTypeHelper(root.left);\n ResultType right_rst = isBalancedWithResultTypeHelper(root.right);\n if(!left_rst.isBalanced || !right_rst.isBalanced || Math.abs(left_rst.depth - right_rst.depth) >=2\n ){\n return new ResultType(false, 0);\n }\n return new ResultType(true, 1 + Math.max(left_rst.depth, right_rst.depth));\n\n }",
"private boolean returnStatementAfterTypeCheckCodeFragment() {\n\t\tStatementExtractor statementExtractor = new StatementExtractor();\r\n\t\tList<Statement> allReturnStatementsWithinTypeCheckCodeFragment = statementExtractor.getReturnStatements(typeCheckCodeFragment);\r\n\t\tList<ReturnStatement> returnStatementsHavingExpressionWithinTypeCheckCodeFragment = new ArrayList<ReturnStatement>();\r\n\t\tfor(Statement statement : allReturnStatementsWithinTypeCheckCodeFragment) {\r\n\t\t\tReturnStatement returnStatement = (ReturnStatement)statement;\r\n\t\t\tif(returnStatement.getExpression() != null)\r\n\t\t\t\treturnStatementsHavingExpressionWithinTypeCheckCodeFragment.add(returnStatement);\r\n\t\t}\r\n\t\tif(returnStatementsHavingExpressionWithinTypeCheckCodeFragment.isEmpty())\r\n\t\t\treturn false;\r\n\t\t//get all return statements having an expression within method body\r\n\t\tList<Statement> allReturnStatementsWithinTypeCheckMethod = statementExtractor.getReturnStatements(typeCheckMethod.getBody());\r\n\t\tList<ReturnStatement> returnStatementsHavingExpressionWithinTypeCheckMethod = new ArrayList<ReturnStatement>();\r\n\t\tfor(Statement statement : allReturnStatementsWithinTypeCheckMethod) {\r\n\t\t\tReturnStatement returnStatement = (ReturnStatement)statement;\r\n\t\t\tif(returnStatement.getExpression() != null)\r\n\t\t\t\treturnStatementsHavingExpressionWithinTypeCheckMethod.add(returnStatement);\r\n\t\t}\r\n\t\tList<ReturnStatement> returnStatementsHavingExpressionOutsideTypeCheckMethod = new ArrayList<ReturnStatement>();\r\n\t\treturnStatementsHavingExpressionOutsideTypeCheckMethod.addAll(returnStatementsHavingExpressionWithinTypeCheckMethod);\r\n\t\treturnStatementsHavingExpressionOutsideTypeCheckMethod.removeAll(returnStatementsHavingExpressionWithinTypeCheckCodeFragment);\r\n\t\tfor(ReturnStatement returnStatement : returnStatementsHavingExpressionOutsideTypeCheckMethod) {\r\n\t\t\tif(returnStatement.getStartPosition() > typeCheckCodeFragment.getStartPosition()+typeCheckCodeFragment.getLength())\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"@Override\n\tpublic boolean test(TreeNode node) {\n\t\tif (includedInResultByNode.containsKey(node)) {\n\t\t\treturn includedInResultByNode.get(node);\n\t\t} else if (node.getParent() == null || node.getParent() == evaluationRootNode) { // this is a root node, so it is considered eager\n\t\t\tincludedInResultByNode.put(node, true);\n\t\t\treturn true;\n\t\t} else if (node.getParent().isLazyChildren() && !node.getParent().isExpanded()) { // parent has lazy children\n\t\t\tincludedInResultByNode.put(node, false);\n\t\t\treturn false;\n\t\t} else { // whatever holds for the parent, also holds for this node\n\t\t\tboolean parentIncluded = test(node.getParent());\n\t\t\tincludedInResultByNode.put(node, parentIncluded);\n\t\t\treturn parentIncluded;\n\t\t}\n\t}",
"public boolean isSetReturnType() {\n return this.returnType != null;\n }",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"boolean hasResult();",
"Boolean getCompletelyCorrect();",
"public boolean getResult() {\r\n\treturn result;\r\n }",
"public Boolean validate (final Number res) throws CGException {\n sentinel.entering(((ATOutputSentinel)sentinel).validate);\n try {\n Boolean cond_2 = null;\n if (!(cond_2 = Boolean.valueOf(res.doubleValue() < 0)).booleanValue()) \n cond_2 = Boolean.valueOf(res.doubleValue() > 1000);\n if (cond_2.booleanValue()) \n return Boolean.FALSE;\n else \n return Boolean.TRUE;\n }\n finally {\n sentinel.leaving(((ATOutputSentinel)sentinel).validate);\n }\n }",
"boolean hasVal();",
"boolean hasVal();",
"public boolean hasValue() {\n return result.hasValue();\n }",
"public boolean hasValue() {\n return result.hasValue();\n }",
"default boolean isRoot() {\n if (isEmpty()){\n return false;\n }\n\n TreeNode treeNode = getTreeNode();\n return treeNode.getLeftValue() == 1;\n }",
"public Object getResult()\n/* */ {\n/* 129 */ Object resultToCheck = this.result;\n/* 130 */ return resultToCheck != RESULT_NONE ? resultToCheck : null;\n/* */ }",
"@Override\n public boolean getResult() {\n return result_;\n }",
"public Boolean getResult() {\n return result;\n }",
"boolean hasRecursive();",
"@Override\n public boolean getResult() {\n return result_;\n }",
"boolean getPossiblyBad();",
"public boolean isResult() {\n return result;\n }",
"static void return_unconditionally(String passed){\n\t\tcomplete_return_requirements();\n\t}",
"boolean hasCustomValue();",
"public boolean isCorrigeDatosRetencion()\r\n/* 623: */ {\r\n/* 624:696 */ return this.corrigeDatosRetencion;\r\n/* 625: */ }",
"@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkTest() {\n\t\tboolean flag = oTest.checkTest();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}",
"public StatementNode getStatementNodeOnTrue();",
"boolean isBranchTaken();",
"boolean isRecursive();",
"public boolean evaluate(SDGNode node);",
"@SuppressWarnings(\"restriction\")\n\tpublic boolean getNewValue() {\n\t\treturn invokeWithoutInvocationException(boolean.class, \"getNewValue\");\n\t}",
"private boolean hasReturn(Parameter[] parameters) {\n boolean hasReturn = false;\n if (parameters.length != 0) {\n Parameter lastParam = parameters[parameters.length - 1];\n DataType type = lastParam.getType();\n hasReturn = (lastParam.getDirection() == Direction.OUT\n && (type == DataType.OBJECT_T || type == DataType.PSCO_T || type == DataType.EXTERNAL_OBJECT_T));\n }\n\n return hasReturn;\n }",
"private boolean makeReturnable(Statement statement) throws LookupException {\n if (statement.metadata(ASSIGNMENT) == null) {\n Expression e = statement.nearestDescendants(Expression.class).get(0);\n if (!e.getType().name().equals(\"void\")) {\n Statement returnStatement = oFactory().createReturnStatement(e);\n statement.replaceWith(returnStatement);\n return true;\n }\n }\n\n return false;\n }"
] | [
"0.63611645",
"0.62335396",
"0.61659753",
"0.607501",
"0.5870928",
"0.58345306",
"0.5801567",
"0.5798153",
"0.5791217",
"0.5783684",
"0.5766599",
"0.5736012",
"0.5736012",
"0.5736012",
"0.5736012",
"0.5679641",
"0.56599444",
"0.56110215",
"0.55701447",
"0.55252814",
"0.55248225",
"0.55051965",
"0.55039895",
"0.5496044",
"0.5494612",
"0.5491128",
"0.54865897",
"0.5467283",
"0.54155624",
"0.5403768",
"0.5386707",
"0.53647906",
"0.5362008",
"0.535702",
"0.53569937",
"0.5341816",
"0.5331677",
"0.5324924",
"0.53208166",
"0.5319605",
"0.5316037",
"0.5312347",
"0.53078616",
"0.5307228",
"0.5306329",
"0.5306329",
"0.5306329",
"0.5306329",
"0.5306329",
"0.5306329",
"0.5306329",
"0.5306329",
"0.5306329",
"0.5306329",
"0.5306329",
"0.5306329",
"0.5306329",
"0.5306329",
"0.53050953",
"0.5304325",
"0.5296457",
"0.52949756",
"0.5280907",
"0.5280907",
"0.5280907",
"0.5280907",
"0.5280907",
"0.5280907",
"0.5280907",
"0.5280907",
"0.5280907",
"0.5280907",
"0.5280907",
"0.5280907",
"0.52782595",
"0.5273515",
"0.52548903",
"0.52539986",
"0.52539986",
"0.5251704",
"0.5251704",
"0.52469873",
"0.5234247",
"0.5233377",
"0.5229428",
"0.5227769",
"0.5208324",
"0.52081907",
"0.52052426",
"0.51897967",
"0.51882684",
"0.5164326",
"0.51559794",
"0.51364243",
"0.51241744",
"0.5121335",
"0.5120486",
"0.511583",
"0.5108406",
"0.509366"
] | 0.68568265 | 0 |
Returns a map of optional metadata about why this check matched the given tree. | public ImmutableMap<String, ?> getMatchMetadata(ExpressionTree tree, VisitorState state) {
return ImmutableMap.of();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic Map<String, Object> getMetadata() {\n\t\treturn null;\r\n\t}",
"Map<String, Object> getAllMetadata();",
"public HashMap getMetaData() ;",
"public Map<String, Match> getReferenceMatches();",
"java.util.Map<java.lang.String, java.lang.String>\n getMetadataMap();",
"java.util.Map<java.lang.String, java.lang.String>\n getMetadataMap();",
"HashMap<String, String> getAdditionalDescriptions();",
"Map<String, String> getCustomMetadata();",
"public Map<AsyncLoadMethodMatch, Long> getMatches() {\n if (matches == null) {\n matches = new HashMap<AsyncLoadMethodMatch, Long>();\n matches.put(AsyncLoadMethodMatch.TRUE, defaultTimeout);\n }\n\n return matches;\n }",
"public Map<String, String> customDetails() {\n return this.innerProperties() == null ? null : this.innerProperties().customDetails();\n }",
"public Map<String, List<ExprNodeDesc>> getNonFinalCandidates() {\n return nonFinalPreds;\n }",
"public Map<String, Variant<?>> GetMetadata();",
"public Map getMetadata() {\n return metadata;\n }",
"public Map<String, Object> getInfo();",
"public Map<String, String> getMetadata() {\n return metadata;\n }",
"public Map<String, String> getMetadata() {\n return metadata;\n }",
"public Map<AccessibilityNodeInfoCompat, Boolean> getSpeakingNodesCache();",
"public Map<String, List<ExprNodeDesc>> getFinalCandidates() {\n return pushdownPreds;\n }",
"private Map<String, String> extractSpecifications(final Document detailsDocument) {\n if (detailsDocument == null) {\n return null;\n }\n\n final Map<String, String> specs = new ConcurrentHashMap<>();\n detailsDocument.getElementsByClass(\"specs\").stream() //\n .map(specTable -> specTable.getElementsByTag(\"tr\")) //\n .map(specRowList -> specRowList.subList(1, specRowList.size())) //\n .flatMap(specRowList -> specRowList.stream()) //\n .forEach(specRow -> {\n final Element keyElement = specRow.getElementsByClass(\"lc\").get(0).getElementsByTag(\"span\").get(0);\n final Element valElement = specRow.getElementsByClass(\"rc\").get(0);\n\n specs.put(keyElement.ownText(), valElement.ownText());\n });\n return specs;\n }",
"boolean hasMetaData();",
"java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata>\n getEventMetadataMap();",
"protected Map<String, String> getMetaData(Response response) {\r\n\t\tMap<String, String> metadata = new HashMap<String, String>();\r\n Request request = response.getRequest();\r\n\r\n User authUser = request.getActiveUser();\r\n String user = \"?\";\r\n if (authUser != null) {\r\n user = authUser.getUserId();\r\n }\r\n\r\n\t\tmetadata.put(\"user\", encodeValue(user));\r\n\t\tmetadata.put(\"request\", encodeValue(RequestUtil.getRequestURL(request).toString()));\r\n\t\tmetadata.put(\"status\", encodeValue(\"ok\"));\r\n\r\n\r\n\t\tif ( null != request ) {\r\n\t\t\tmetadata.put(\"startTime\", metaDataTimeFormat.format(request.getCreateTime()));\r\n\t\t\tmetadata.put(\"endTime\", metaDataTimeFormat.format(System.currentTimeMillis()));\r\n\t\t}\r\n\r\n\t\treturn metadata;\r\n\t}",
"@Override\n public Map<String, XPathValue> getGlobalMetaMap() {\n return null;\n }",
"public Map<String, Boolean> getContainsErrorId() {\n return new HashMap<String, Boolean>() {\n @Override\n public Boolean get(Object key) {\n if (key == null) {\n return false;\n }\n final String keyString = key.toString();\n for (FxFacesMessage message : getFxMessages()) {\n if (keyString.equals(message.getId())) {\n return true;\n }\n }\n return false;\n }\n };\n }",
"public Map<String, Object> getMetaData() {\n\t\treturn metaData;\n\t}",
"@NonNull\n JsonMap getMetadata();",
"private static Map<String, Set<String>> getReagentToPotionsTestCaseMap()\n\t{\n\t\t// Set up the potions manual for this particular test case.\n\t\tList<PotionInfo> potionsManual = getPotionsManual();\n\n\t\t// Build a reagent -> potions map from this potions manual.\n\t\tMap<String, Set<String>> map = PotionMaster.reagentToPotionsMap(potionsManual);\n\n\t\t// Check that the resulting map has exactly the right contents.\n\t\tif (!checkReagentToPotionsMapContents(map))\n\t\t{\n\t\t\tSystem.out.println(\"Incorrect map. Aborting test case.\");\n\t\t\tPotionInfo.printMap(map);\n\n\t\t\t// Kill the program.\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\treturn map;\n\t}",
"java.util.Map<java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata>\n getStatMetadataMap();",
"protected Map<String, String> getFeatureAttrs(Map<String, Object> data) {\n\t\treturn null;\n\t}",
"public static Map<String, Object> mapFailure() {\n\t\tMap<String, Object> modelMap = new HashMap<String,Object>(2);\n\t\tmodelMap.put(\"success\", false);\n\t\t\n\t\treturn modelMap;\n\t}",
"public java.util.Map<java.lang.String, java.lang.String> getMetadataMap() {\n return internalGetMetadata().getMap();\n }",
"public java.util.Map<java.lang.String, java.lang.String> getMetadataMap() {\n return internalGetMetadata().getMap();\n }",
"private Map<String, String> findMetadata(InputStream table, String itemCode) throws IOException {\n\t\t\tfinal BufferedReader br = new BufferedReader(new InputStreamReader(table));\n\t\t\tfinal List<String> columnNames = Arrays.asList(br.readLine().split(\"\\t\"));\n\t\t\tfinal int codeIndex = columnNames.indexOf(CODE_COLUMN);\n\t\t\t\n\t\t\tString line;\n\t\t\twhile((line = br.readLine()) != null) {\n\t\t\t\tString[] values = line.split(\"\\t\");\n\t\t\t\tif(values[codeIndex].equals(itemCode)) {\n\t\t\t\t\tfinal Map<String, String> metadata = new HashMap<String, String>();\n\t\t\t\t\tfor(int i = 0; i < columnNames.size(); ++i) {\n\t\t\t\t\t\tmetadata.put(columnNames.get(i), values[i]);\n\t\t\t\t\t}\n\t\t\t\t\treturn metadata;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn null;\n\t\t}",
"public java.util.Map<java.lang.String, java.lang.String> getMetadataMap() {\n return internalGetMetadata().getMap();\n }",
"public java.util.Map<java.lang.String, java.lang.String> getMetadataMap() {\n return internalGetMetadata().getMap();\n }",
"public Map<String, Object> getMetadata() {\n return metadata;\n }",
"private static Map<String, Set<String>> getPotionToReagentsTestCaseMap()\n\t{\n\t\t// Set up the potions manual for this particular test case.\n\t\tList<PotionInfo> potionsManual = getPotionsManual();\n\n\t\t// Build a potion -> reagents map from this potions manual.\n\t\tMap<String, Set<String>> map = PotionMaster.potionToReagentsMap(potionsManual);\n\n\t\t// Check that the resulting map has exactly the right contents.\n\t\tif (!checkPotionToReagentsMapContents(map))\n\t\t{\n\t\t\tSystem.out.println(\"Incorrect map. Aborting test case.\");\n\t\t\tPotionInfo.printMap(map);\n\n\t\t\t// Kill the program.\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\treturn map;\n\t}",
"public Map<String, Object> getOtherInfo() {\n return otherInfo;\n }",
"@Override\n public GT_Recipe.GT_Recipe_Map getRecipeMap() {\n return null;\n }",
"public Map<String, Object> getAttrs();",
"@Override\n\tpublic List<Map<String, Object>> selectToTreeNocheckMap(Map param) {\n\t\treturn codeRegorgMapper.selectToTreeNocheckMap(param);\n\t}",
"public @NonNull Map<@NonNull String, @NonNull Object> getNodeMeta() {\n return this.nodeMeta;\n }",
"private Hashtable<String,String> constructCheckInfo(Document d)\n throws JezebelInputSyntax {\n Hashtable<String,String> o = new Hashtable<String,String>();\n Element root = d.getDocumentElement();\n if(!root.getTagName().equals(\"check\")) { throw new JezebelInputSyntax(); }\n o.put(\"module\", root.getAttribute(\"module\"));\n o.put(\"name\", root.getAttribute(\"name\"));\n o.put(\"target\", root.getAttribute(\"target\"));\n String target_ip = root.getAttribute(\"target_ip\");\n if(target_ip != null) o.put(\"target_ip\", target_ip);\n o.put(\"timeout\", root.getAttribute(\"timeout\"));\n o.put(\"period\", root.getAttribute(\"period\"));\n return o;\n }",
"public static Optional<Map<String, String>> getMetadata()\n {\n final Optional<Map<String, String>> metadata = metadataRef.get();\n if (metadata != null) {\n return metadata;\n }\n if (hypervisorAbsent()) {\n metadataRef.set(Optional.<Map<String, String>>absent());\n return metadataRef.get();\n }\n\n final ObjectMapper mapper = new ObjectMapper();\n try {\n final URL url = new URL(INSTANCE_DATA_URL);\n final URLConnection connection = url.openConnection();\n connection.setConnectTimeout(CONNECT_TIMEOUT_MS);\n connection.connect();\n final Map<String, String> response\n = mapper.readValue(\n connection.getInputStream(),\n new TypeReference<Map<String, String>>() {});\n metadataRef.set(Optional.fromNullable(\n response != null\n ? Collections.unmodifiableMap(response)\n : null));\n }\n catch (IOException e) {\n metadataRef.set(Optional.<Map<String, String>>absent());\n }\n return metadataRef.get();\n }",
"public Map<Language,String> getAllMessageCouldHaveFired(final SessionContext ctx)\r\n\t{\r\n\t\treturn (Map<Language,String>)getAllLocalizedProperties(ctx,MESSAGECOULDHAVEFIRED,C2LManager.getInstance().getAllLanguages());\r\n\t}",
"static Collection readMatches(Node nMagic, MagicImpl magic) {\n\t\t// get match nodes\n\t\tNode[] matches = getChildNodes(nMagic, \"match\");\n\t\tArrayList ret = new ArrayList(matches.length);\n\t\tfor (int i = 0; i < matches.length; i++) {\n\t\t\t// get attributes from match\n\t\t\tNode nMatch = matches[i];\n\t\t\tNamedNodeMap attrs = nMatch.getAttributes();\n\t\t\tNode nAttr = attrs.getNamedItem(\"type\");\n\t\t\tError.assertTrue(nAttr != null, \"Match does not contain type!\" + nMagic);\n\t\t\tString sType = nAttr.getNodeValue();\n\t\t\tint type = magic.typeToType(sType);\n\n\t\t\tnAttr = attrs.getNamedItem(\"offset\");\n\t\t\tError.assertTrue(nAttr != null, \"Match does not contain offset!\" + nMagic);\n\t\t\tString offset = nAttr.getNodeValue();\n\t\t\tint pos = offset.indexOf(':');\n\t\t\tint offsetStart = 0, offsetEnd = 0;\n\t\t\tif(pos < 0) {\n\t\t\t\toffsetStart = Integer.parseInt(offset);\n\t\t\t\toffsetEnd = offsetStart;\n\t\t\t} else {\n\t\t\t\toffsetStart = Integer.parseInt(offset.substring(0, pos));\t\t\t\t\n\t\t\t\toffsetEnd = Integer.parseInt(offset.substring(pos + 1));\n\t\t\t}\n\t\t\t\t \n\t\t\tnAttr = attrs.getNamedItem(\"value\");\n\t\t\tError.assertTrue(nAttr != null, \"Match does not contain value!\" + nMagic);\n\t\t\tString sValue = nAttr.getNodeValue();\n\t\t\tbyte[] value = ByteHelper.decode(-1, sValue, BIGENDIAN); \n\t\t\t\n\t\t\tnAttr = attrs.getNamedItem(\"mask\");\n\t\t\tString sMask = null;\n\t\t\tbyte[] mask = null;\n\t\t\tif(nAttr != null) {// mask is optional\n\t\t\t\tsMask = nAttr.getNodeValue();\n\t\t\t\tmask = ByteHelper.decode(-1, sMask, BIGENDIAN);\n\t\t\t}\n\t\t\t\n\t\t\tMatchImpl match = magic.addMatchImpl(type, offsetStart, offsetEnd, value, mask);\n\t\t\t// read sub matches\n\t\t\treadMatches(nMatch, match);\n\t\t}\n\t\t\n\t\treturn ret;\n\t}",
"public static LinkedHashMap<String,Class<?>> getNodeAttributesMap() {\r\n\t\tLinkedHashMap<String, Class<?>> map= new LinkedHashMap<String, Class<?>>();\r\n\t\tmap.put(uri, String.class);\r\n//\t\tmap.put(canonicalName, String.class);\r\n//\t\tmap.put(category , String.class);\r\n\t\tmap.put(scope,String.class);\r\n\t\tmap.put(segment,String.class);\r\n//\t\tmap.put(numInteractionEdges,Integer.class);\r\n//\t\tmap.put(numSubsumptionEdges,Integer.class);\r\n\t\tmap.put(timestamp,String.class);\r\n\t\tmap.put(modificationDate,String.class);\r\n\t\tmap.put(marked,Boolean.class);\r\n\t\tmap.put(nodeTypeURI, String.class);\r\n\t\t\r\n\t\tmap.put(GO_BIOLOGICAL_PROCESS, List.class);\r\n\t\tmap.put(GO_CELLULAR_COMPONENT, List.class);\r\n\t\tmap.put(GO_MOLECULAR_FUNCTION, List.class);\r\n\t\t\r\n\t\t//GO\r\n//\t\tmap.put(AddGOAnnotations.GO_BIOLOGICAL_PROCESS, String.class);\r\n//\t\tmap.put(AddGOAnnotations.GO_CELLURAL_COMPONENT, String.class);\r\n//\t\tmap.put(AddGOAnnotations.GO_MOLECULAR_FUNCTION, String.class);\r\n\t\t\r\n\t\treturn map;\r\n\t}",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"boolean hasMetadata();",
"@Nullable\n @Generated\n @Selector(\"metadata\")\n public native NSDictionary<?, ?> metadata();",
"public Map<AbstractVizResource<?, ?>, DataTime[]> getTimeMatchingMap() {\n return timeMatchingMap;\n }",
"public Map<String, Object> getTagMap();",
"public void computeExpectedChildrenProperties() {\n\t\t\n\t\tSet<Attribute<? extends IValue>> parentAttributes = new HashSet<>(popParents.getPopulationAttributes());\n\t\tparentAttributes.retainAll(pMatching.getDimensions());\n\t\t\n\t\tlogger.info(\"computing for the dimensions: {}\", parentAttributes);\n\t\t\n\t\t/*\n\t\t * \n\t\tMap<Set<Attribute<? extends IValue>>,Integer> parents2matchingCandidates = new HashMap<>();\n\t\tfor (Entry<ACoordinate<Attribute<? extends IValue>, IValue>, AControl<Double>> e: \n\t\t\tpMatching.getMatrix().entrySet()) {\n\t\t\t\n\t\t}\n\t\t\n\t\tGosplContingencyTable c = new GosplContingencyTable(pMatching.getDimensions());\n\t\t// for each coordinate of the probabilities table \n\t\t// 1) compute the \n\t\t * \n\t\t */\n\n\t\t\n\t}",
"Metadata getMetaData();",
"private Map<String, String> expectedSelectorLabels() {\n return Map.of(Labels.STRIMZI_CLUSTER_LABEL, CLUSTER,\n Labels.STRIMZI_NAME_LABEL, KafkaResources.zookeeperStatefulSetName(CLUSTER),\n Labels.STRIMZI_KIND_LABEL, Kafka.RESOURCE_KIND);\n }",
"private final Map<String, Object> m7134b() {\n HashMap hashMap = new HashMap();\n zzcf.zza zzco = this.f11698b.zzco();\n hashMap.put(\"v\", this.f11697a.zzawx());\n hashMap.put(\"gms\", Boolean.valueOf(this.f11697a.zzcm()));\n hashMap.put(\"int\", zzco.zzaf());\n hashMap.put(\"up\", Boolean.valueOf(this.f11700d.mo17775a()));\n hashMap.put(\"t\", new Throwable());\n return hashMap;\n }",
"public Map getPredicatesInfo()\n {\n return this.predicatesInfo;\n }",
"@Override\n public Map<K, V> getMatching( final String pattern )\n {\n final Map<K, V> unwrappedResults;\n\n final Map<K, ICacheElement<K, V>> wrappedResults = this.getCacheControl().getMatching( pattern );\n\n if ( wrappedResults == null )\n {\n unwrappedResults = new HashMap<>();\n }\n else\n {\n unwrappedResults = wrappedResults.entrySet()\n .stream()\n .filter(entry -> entry.getValue() != null)\n .collect(Collectors.toMap(\n Entry::getKey,\n entry -> entry.getValue().getVal()));\n }\n\n return unwrappedResults;\n }",
"public Map<Entity, Integer> computeHyponymCountMap()\r\n\t{\n\t\treturn null;\r\n\t}",
"public Map<String,String> getMetadataElementMap() {\n\t\tMap<String,String> uiList = new LinkedHashMap<String,String>();\n\t\tfor (MetadataElement element: MetadataElement.values()){\n\t\t\tuiList.put(element.toString(), element.getDisplayName());\n\t\t}\n \n\t\treturn uiList;\n\t}",
"boolean hasMetadataFields();",
"private Map<String, String> solutionForCNAEIsNotFull() {\r\n Map<String, String> map = new HashMap<>();\r\n map.put(this.students[0].getName(), this.schools[2].getName());\r\n map.put(this.students[1].getName(), this.schools[2].getName());\r\n map.put(this.students[2].getName(), null);\r\n map.put(this.students[3].getName(), this.schools[2].getName());\r\n return map;\r\n }",
"public Map<String, Boolean> getIsTypeOptionValidMap() {\n if (typeOptionValidMap == null) {\n typeOptionValidMap = new HashMap<String, Boolean>() {\n @Override\n public Boolean get(Object key) {\n return !(key == null || \"\".equals(key.toString().trim()) || countKeyOccurence(typeOptions, (String) key) > 1);\n }\n };\n }\n return typeOptionValidMap;\n }",
"@Override\n public Iterator<Map.Entry<String, Object>> getMetadata() {\n return new EmptyEntryIterator();\n }",
"public Map<String, Variant<?>> GetMetadata(int position);",
"Map<String,String> getNodeData(T node);",
"private static Map<String,String> getStringAttributes(Node node) {\r\n Map<String,String> ret = new HashMap<String,String>();\r\n \r\n NodeList children = node.getChildNodes();\r\n for (int j = 0; j < children.getLength(); j++) {\r\n Node attr = children.item(j); // an \"attr\" element which is a child\r\n // of the node\r\n if( attr.getNodeName().equals(\"attr\") ) {\r\n String key = getAttribute(attr, \"name\");\r\n NodeList values = attr.getChildNodes(); // a \"string\" element\r\n // which is a child of\r\n // attr\r\n for (int k = 0; k < values.getLength(); k++) {\r\n if (values.item(k).getNodeName().equals(\"string\")) {\r\n Node labelNode = values.item(k).getFirstChild();\r\n if (labelNode != null)\r\n ret.put(key, labelNode.getNodeValue());\r\n }\r\n }\r\n }\r\n }\r\n \r\n return ret;\r\n }",
"private void addToKmapAndPredMetadata(Collection<Node> nodes) {\n\t\tCollection<Edge> edges = Util.flatmap(Node::getEdges, nodes);\n\t\tUtil.map( translator::edgeToStatement, edges );\n\t}",
"public Map<String, Node> getSubTreeNodeInRAMap() {\n\t\treturn subTreeNodeInRAMap;\n\t}",
"public static Map<Integer, String> GetAllTags() {\n HashMap<Integer, String> map = new HashMap<Integer, String>();\n map.put(FOUND, \"Found\");\n map.put(DNF, \"Did Not Find\");\n map.put(FAVORITES, \"Favorite\");\n map.put(NEW, \"New\");\n map.put(MINE, \"Mine\");\n map.put(UNAVAILABLE, \"Unavailable\");\n map.put(LOCKED_FROM_OVERWRITING, \"Locked from overwriting\");\n return map;\n }",
"private static Map<String, ColumnMetaData> buildColumnMetadataMap(ResultSet rs) {\n\t\t/*\n\t\t * LinkedHashmap to preserve key traversal order.\n\t\t * Important as we output rows as arrays of values where the index position in\n\t\t * the row implicitly corresponds to the entry order of the column map.\n\t\t * Reason for this is performance. \n\t\t */\n\t\tMap<String, ColumnMetaData> columnMap = Maps.newLinkedHashMap();\n\t\ttry {\n\t\t\tResultSetMetaData rmd = rs.getMetaData();\n\t\t\tfor (int i=1; i<= rmd.getColumnCount(); i++) {\n\t\t\t\tColumnMetaData cmd = \n\t\t\t\t\tnew ColumnMetaData(rmd.getColumnName(i), rmd.getColumnTypeName(i));\n\t\t\t\tcolumnMap.put(cmd.columnName, cmd);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tThrowables.propagate(e);\n\t\t}\n\t\treturn columnMap;\n\t}",
"public Map<QName, String> getOtherAttributes() {\r\n return otherAttributes;\r\n }",
"public Map<QName, String> getOtherAttributes() {\n\t\treturn otherAttributes;\n\t}",
"public Map<QName, String> getOtherAttributes() {\n\t\treturn otherAttributes;\n\t}",
"public Map<QName, String> getOtherAttributes() {\n\t\treturn otherAttributes;\n\t}",
"public Map<String, String> getInformations()\n {\n\n if (userProfile == null)\n {\n return EMPTY_STRING_TO_STRING_MAP;\n }\n\n Map<String, String> infoMap = userProfile.getUserInfoMap();\n Map<String, String> filteredMap = new HashMap<String, String>();\n\n for (String key : infoMap.keySet())\n {\n if (JSR_168_P3P.contains(key))\n {\n filteredMap.put(key, infoMap.get(key));\n }\n }\n\n return Collections.unmodifiableMap(filteredMap);\n }",
"public Map<QName, String> getOtherAttributes() {\n return otherAttributes;\n }",
"public Map<QName, String> getOtherAttributes() {\n return otherAttributes;\n }",
"public Map<QName, String> getOtherAttributes() {\n return otherAttributes;\n }",
"public Map<QName, String> getOtherAttributes() {\n return otherAttributes;\n }",
"public Map<QName, String> getOtherAttributes() {\n return otherAttributes;\n }",
"public Map<QName, String> getOtherAttributes() {\n return otherAttributes;\n }",
"public Map<QName, String> getOtherAttributes() {\n return otherAttributes;\n }",
"public Map<QName, String> getOtherAttributes() {\n return otherAttributes;\n }"
] | [
"0.51407045",
"0.49925238",
"0.49709967",
"0.49188852",
"0.4895846",
"0.4895846",
"0.48888284",
"0.47523445",
"0.46788624",
"0.46133515",
"0.45966142",
"0.4590111",
"0.45690882",
"0.4518875",
"0.4502623",
"0.4502623",
"0.44958246",
"0.44861448",
"0.4475615",
"0.44742846",
"0.44726962",
"0.4454495",
"0.44537288",
"0.44507915",
"0.44409364",
"0.44329038",
"0.44313946",
"0.44293353",
"0.4404689",
"0.4400596",
"0.43820763",
"0.43820763",
"0.43810135",
"0.43798855",
"0.43798855",
"0.43791354",
"0.43759525",
"0.43682775",
"0.43646008",
"0.4363886",
"0.4360501",
"0.43551388",
"0.4322929",
"0.43196455",
"0.43138933",
"0.43022916",
"0.42979863",
"0.42969373",
"0.42969373",
"0.42969373",
"0.42969373",
"0.42969373",
"0.42969373",
"0.42969373",
"0.42969373",
"0.42969373",
"0.42969373",
"0.42969373",
"0.42969373",
"0.42969373",
"0.42969373",
"0.42969373",
"0.42969373",
"0.42969373",
"0.42969373",
"0.4285368",
"0.42839754",
"0.4277291",
"0.4263055",
"0.42434624",
"0.42395455",
"0.4237656",
"0.42376128",
"0.42303684",
"0.42261127",
"0.42135084",
"0.42085537",
"0.41976613",
"0.41904396",
"0.41846287",
"0.41754717",
"0.41726744",
"0.41722232",
"0.41710678",
"0.41695482",
"0.4144956",
"0.41390195",
"0.41347322",
"0.41306716",
"0.41306716",
"0.41306716",
"0.41297725",
"0.4128668",
"0.4128668",
"0.4128668",
"0.4128668",
"0.4128668",
"0.4128668",
"0.4128668",
"0.4128668"
] | 0.6754381 | 0 |
Match whatever additional conditions concrete subclasses want to match (a list of known | protected abstract Matcher<? super ExpressionTree> specializedMatcher(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract boolean isMoreSpecificThanOrEqualTo(Pattern pattern);",
"protected abstract boolean matches(String paramString, int paramInt);",
"public interface PacketMatcher {\n public boolean matches(ChatPacket packet);\n\n /**\n * Simple matcher for basing selection on PacketType\n * \n * @author Aaron Rosenfeld <ar374@drexel.edu>\n * \n */\n public static class TypeMatcher implements PacketMatcher {\n private PacketType[] types;\n\n public TypeMatcher(PacketType... types) {\n this.types = types;\n }\n\n @Override\n public boolean matches(ChatPacket packet) {\n for (PacketType t : types) {\n if (packet.getType() == t) {\n return true;\n }\n }\n return false;\n }\n }\n}",
"public boolean isMatchedWith(Object[] args) {\n if (args != null\n && mClassesOfProperties != null\n && args.length == mClassesOfProperties.length) {\n Object[] temp = new Object[args.length];\n for (int i = 0; i < args.length; ++i) {\n temp[i] = MatchRule.instance()\n .isMatch(args[i], mClassesOfProperties[i]);\n if (temp[i] == null) {\n return false;\n }\n }\n for (int i = 0; i < args.length; ++i) {\n args[i] = temp[i];\n }\n return true;\n } else {\n return false;\n }\n }",
"Object isMatch(Object arg, String wantedType);",
"protected abstract Boolean applicable(Map<String, Object> parameters);",
"boolean matchesType( Name primaryType,\n Set<Name> mixinTypes );",
"@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = \"match\")\n@JsonSubTypes(value = {\n @Type(AnyAnnotationSetCriteria.class)\n})\npublic interface AnnotationSetCriteria extends Criteria {\n\n}",
"public boolean match(ReflectClass classReflector);",
"public Collection hasAuxClasss(Collection auxClasssToCheck);",
"@Override\n\tpublic boolean canExecute(Collection<? extends EObject> selections) {\n\t\tfor (EObject eObject : selections) {\n\t\t\tif (!(eObject instanceof UnknowClass)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"boolean test(AbstractAnimals a);",
"Class<?>[] getHandledClasses();",
"boolean match(String mnemonic, List<ParameterType>[] parameters);",
"private boolean addKnown(String superclass, String subclass) {\n\tSet<String> v;\n v = classSet(superclass);\n if (v == null) {\n v = new ConcurrentSkipListSet<String>();\n Set<String> existed = subclasses.putIfAbsent(superclass, v);\n if (existed != null) v = existed; // discard new set.\n }\n\treturn v.add(subclass);\n }",
"protected abstract boolean matchesExclusion(String paramString, int paramInt);",
"public RTTIClass select(ClassFilter filter);",
"public abstract void process(final EClass Super, final EClass Sub);",
"boolean isSubclass(Concept x, Concept y);",
"public boolean isAcceptable(Class<? extends DataElement> clazz);",
"public boolean hasAllAuxClasss(Collection auxClasssToCheck);",
"protected void checkSubclass() {\n }",
"public abstract boolean isMatching(Properties p);",
"@Test\n public void multipleClassTest() throws CharSequenceCompilerException, InstantiationException, IllegalAccessException, NoSuchMethodException, SecurityException, IllegalArgumentException, InvocationTargetException {\n String s = \"public interface MyPredicate { public boolean accept(int i); }\";\n // Implementation for even numbers\n String s2 = \"public class EvenPredicate implements MyPredicate { public boolean accept(int i) { return i%2==0;}}\";\n\n Map<String, CharSequence> classesToCompile = new LinkedHashMap<String, CharSequence>();\n\n // put them in wrong order\n classesToCompile.put(\"EvenPredicate\", s2);\n classesToCompile.put(\"MyPredicate\", s);\n\n // Compile them\n CharSequenceCompiler<Object> compiler = new CharSequenceCompiler<Object>();\n Map<String, Class<Object>> compileClasses = compiler.compile(classesToCompile);\n\n // Invoke accept method\n Class<Object> implementationClass = compileClasses.get(\"EvenPredicate\");\n Object object = implementationClass.newInstance();\n Method method = implementationClass.getMethod(\"accept\", int.class);\n boolean res = (Boolean) method.invoke(object, 2);\n assertTrue(res);\n\n Class<Object> interfaceClass = compileClasses.get(\"MyPredicate\");\n\n try {\n interfaceClass.newInstance();\n fail(\"Can't instantiate an interface!\");\n } catch (InstantiationException e) {\n\n }\n }",
"boolean isHandled(Class<?> type);",
"protected void checkSubclass() {\n }",
"protected void checkSubclass() {\n }",
"protected void checkSubclass() {\n }",
"protected void initSpecSpecificConditions() {\r\n // THESE ARE ALL FOR MAF SPEC 1.0 ONLY\r\n\r\n //If variant_Type is \"ins\" Reference_Allele should always be \"-\",\r\n conditions.add(new ConditionalRequirement(FIELD_VARIANT_TYPE, getVariantInsSymbol(), FIELD_REFERENCE_ALLELE, Pattern.compile(\"[^\\\\-]\"), \"contain anything but '-' characters\", true));\r\n // and either of Tumor_Seq_Allele1 and Tumor_Seq_Allele2 should have \"-\".\r\n conditions.add(new ConditionalRequirement(ConditionalOperator.OR,\r\n new ConditionalRequirement(FIELD_VARIANT_TYPE, getVariantInsSymbol(), FIELD_TUMOR_SEQ_ALLELE1, Pattern.compile(\"-\"), \"contain at least one '-'\", false),\r\n new ConditionalRequirement(FIELD_VARIANT_TYPE, getVariantInsSymbol(), FIELD_TUMOR_SEQ_ALLELE2, Pattern.compile(\"-\"), \"contain at least one '-'\", false)));\r\n //If variant_Type is \"del\", then Reference_Allele can't contain \"-\",\r\n conditions.add(new ConditionalRequirement(FIELD_VARIANT_TYPE, getVariantTypeDelSymbol(), FIELD_REFERENCE_ALLELE, Pattern.compile(\"-\"), \"contain any '-' characters\", true));\r\n // and either Tumor_Seq_Allele1 or Tumor_Seq_Allele2 should contain \"-\".\r\n conditions.add(new ConditionalRequirement(ConditionalOperator.OR,\r\n new ConditionalRequirement(FIELD_VARIANT_TYPE, getVariantTypeDelSymbol(), FIELD_TUMOR_SEQ_ALLELE1, Pattern.compile(\"-\"), \"contain at least one '-'\", false),\r\n new ConditionalRequirement(FIELD_VARIANT_TYPE, getVariantTypeDelSymbol(), FIELD_TUMOR_SEQ_ALLELE2, Pattern.compile(\"-\"), \"contain at least one '-'\", false)));\r\n\r\n //If validation_status is \"wildtype\", then Tumor_Seq_Allele1=Tumor_Seq_Allele2\r\n //and Tumor_Seq_Allele1=Reference_Allele)\r\n conditions.add(new ConditionalRequirement(FIELD_VALIDATION_STATUS, VALIDATION_STATUS_WILDTYPE, FIELD_TUMOR_SEQ_ALLELE1, FIELD_TUMOR_SEQ_ALLELE2, false));\r\n conditions.add(new ConditionalRequirement(FIELD_VALIDATION_STATUS, VALIDATION_STATUS_WILDTYPE, FIELD_TUMOR_SEQ_ALLELE1, FIELD_REFERENCE_ALLELE, false));\r\n\r\n // if mutation_status is germline, tumor_seql_allele1 must be equal to match_norm_seq_allele1\r\n conditions.add(new ConditionalRequirement(FIELD_MUTATION_STATUS, MUTATION_STATUS_GERMLINE, FIELD_TUMOR_SEQ_ALLELE1,\r\n FIELD_MATCH_NORM_SEQ_ALLELE1, false));\r\n conditions.add(new ConditionalRequirement(FIELD_MUTATION_STATUS, MUTATION_STATUS_GERMLINE, FIELD_TUMOR_SEQ_ALLELE2,\r\n FIELD_MATCH_NORM_SEQ_ALLELE2, false));\r\n // if mutation_status is somatic and validation status is valid, then Match_Norm_Validation_Allele1 should equal Reference_Allele\r\n conditions.add(new ConditionalRequirement(new String[]{FIELD_MUTATION_STATUS, FIELD_VALIDATION_STATUS}, new String[]{MUTATION_STATUS_SOMATIC, VALIDATION_STATUS_VALID}, FIELD_MATCH_NORM_VALIDATION_ALLELE1,\r\n FIELD_REFERENCE_ALLELE, false));\r\n // if mutation_status is somatic and validation status is valid, then Match_Norm_Validation_Allele2 should equal Reference_Allele\r\n conditions.add(new ConditionalRequirement(new String[]{FIELD_MUTATION_STATUS, FIELD_VALIDATION_STATUS}, new String[]{MUTATION_STATUS_SOMATIC, VALIDATION_STATUS_VALID}, FIELD_MATCH_NORM_VALIDATION_ALLELE2,\r\n FIELD_REFERENCE_ALLELE, false));\r\n // if mutation_status is somatic and validation status is valid, then either Tumor_Seq_Allele1 or Tumor_Seq_Allele2 should NOT match Reference_Allele\r\n conditions.add(new ConditionalRequirement(ConditionalOperator.OR,\r\n new ConditionalRequirement(new String[]{FIELD_MUTATION_STATUS, FIELD_VALIDATION_STATUS}, new String[]{MUTATION_STATUS_SOMATIC, VALIDATION_STATUS_VALID}, FIELD_TUMOR_SEQ_ALLELE1, FIELD_REFERENCE_ALLELE, true), // not\r\n new ConditionalRequirement(new String[]{FIELD_MUTATION_STATUS, FIELD_VALIDATION_STATUS}, new String[]{MUTATION_STATUS_SOMATIC, VALIDATION_STATUS_VALID}, FIELD_TUMOR_SEQ_ALLELE2, FIELD_REFERENCE_ALLELE, true))); // not\r\n\r\n //If Mutation_Status == LOH AND Validation_Status==Unknown, then\r\n //Tumor_Seq_Allele1 == Tumor_Seq_Allele2 and\r\n //Match_Norm_Seq_Allele1 != Match_Norm_Seq_Allele2 and\r\n //Tumor_Seq_Allele1 = (Match_Norm_Seq_Allele1 or Match_Norm_Seq_Allele2)\r\n conditions.add(new ConditionalRequirement(new String[]{FIELD_MUTATION_STATUS, FIELD_VALIDATION_STATUS}, new String[]{MUTATION_STATUS_LOH, VALIDATION_STATUS_UNKNOWN}, FIELD_TUMOR_SEQ_ALLELE1, FIELD_TUMOR_SEQ_ALLELE2, false));\r\n conditions.add(new ConditionalRequirement(new String[]{FIELD_MUTATION_STATUS, FIELD_VALIDATION_STATUS}, new String[]{MUTATION_STATUS_LOH, VALIDATION_STATUS_UNKNOWN}, FIELD_MATCH_NORM_SEQ_ALLELE1, FIELD_MATCH_NORM_SEQ_ALLELE2, true)); // not\r\n conditions.add(new ConditionalRequirement(ConditionalOperator.OR,\r\n new ConditionalRequirement(new String[]{FIELD_MUTATION_STATUS, FIELD_VALIDATION_STATUS}, new String[]{MUTATION_STATUS_LOH, VALIDATION_STATUS_UNKNOWN}, FIELD_TUMOR_SEQ_ALLELE1, FIELD_MATCH_NORM_SEQ_ALLELE1, false),\r\n new ConditionalRequirement(new String[]{FIELD_MUTATION_STATUS, FIELD_VALIDATION_STATUS}, new String[]{MUTATION_STATUS_LOH, VALIDATION_STATUS_UNKNOWN}, FIELD_TUMOR_SEQ_ALLELE1, FIELD_MATCH_NORM_SEQ_ALLELE2, false)));\r\n //If Mutation_Status == LOH AND Validation_Status==Valid, then\r\n //Tumor_Validation_Allele1 == Tumor_Validation_Allele2 and\r\n //Match_Norm_Validation_Allele1 != Match_Norm_Validation_Allele2 and\r\n //Tumor_Validation_Allele1 == (Match_Norm_Validation_Allele1 or Match_Norm_Validation_Allele2).\r\n conditions.add(new ConditionalRequirement(new String[]{FIELD_MUTATION_STATUS, FIELD_VALIDATION_STATUS}, new String[]{MUTATION_STATUS_LOH, VALIDATION_STATUS_VALID}, FIELD_TUMOR_VALIDATION_ALLELE1, FIELD_TUMOR_VALIDATION_ALLELE2, false));\r\n conditions.add(new ConditionalRequirement(new String[]{FIELD_MUTATION_STATUS, FIELD_VALIDATION_STATUS}, new String[]{MUTATION_STATUS_LOH, VALIDATION_STATUS_VALID}, FIELD_MATCH_NORM_VALIDATION_ALLELE1, FIELD_MATCH_NORM_VALIDATION_ALLELE2, true)); // not\r\n conditions.add(new ConditionalRequirement(ConditionalOperator.OR,\r\n new ConditionalRequirement(new String[]{FIELD_MUTATION_STATUS, FIELD_VALIDATION_STATUS}, new String[]{MUTATION_STATUS_LOH, VALIDATION_STATUS_VALID}, FIELD_TUMOR_VALIDATION_ALLELE1, FIELD_MATCH_NORM_VALIDATION_ALLELE1, false),\r\n new ConditionalRequirement(new String[]{FIELD_MUTATION_STATUS, FIELD_VALIDATION_STATUS}, new String[]{MUTATION_STATUS_LOH, VALIDATION_STATUS_VALID}, FIELD_TUMOR_VALIDATION_ALLELE1, FIELD_MATCH_NORM_VALIDATION_ALLELE2, false)));\r\n // Tumor_Seq_Allele1 != Reference_Allele OR Tumor_Seq_Allele2 != Reference_Allele\r\n conditions.add(new ConditionalRequirement(ConditionalOperator.OR,\r\n new ConditionalRequirement(new String[]{}, new String[]{}, FIELD_TUMOR_SEQ_ALLELE1, FIELD_REFERENCE_ALLELE, true),\r\n new ConditionalRequirement(new String[]{}, new String[]{}, FIELD_TUMOR_SEQ_ALLELE2, FIELD_REFERENCE_ALLELE, true)));\r\n\r\n }",
"public abstract Match match();",
"static boolean test(List<Condition> conditions) {\n return true; // REPLACE WITH SOLUTION \n }",
"private void restrictClasses() {\n\t\tSet<String> classes = classMap.keySet();\n\t\tSet<String> intersect;\n\t\tfor (String s : disjointsInfo.keySet()) {\n\t\t\tintersect = disjointsInfo.get(s);\n\t\t\tintersect.retainAll(classes);\n\t\t\tdisjointsInfo.put(s, intersect);\n\t\t}\n\t\tfor (String s : supersInfo.keySet()) {\n\t\t\tintersect = supersInfo.get(s);\n\t\t\tintersect.retainAll(classes);\n\t\t\tsupersInfo.put(s, intersect);\n\t\t}\n\t}",
"@Test\r\n\tpublic void testContainsClass() {\r\n\t\tassertTrue(breaku1.containsClass(class1));\r\n\t\tassertTrue(externu1.containsClass(class1));\r\n\t\tassertTrue(meetingu1.containsClass(class1));\r\n\t\tassertTrue(teachu1.containsClass(class1));\r\n\t}",
"public abstract boolean isSatisfied();",
"boolean supports(Class<?> valueClass);",
"public interface ContentModelFilter {\n\n\n boolean isAttributeDatastream(String dsid, List<String> types);\n\n\n boolean isChildRel(String predicate, List<String> types);\n}",
"interface Matcher<R extends OWLPropertyRange, F extends R, P extends OWLPropertyExpression<R, P>> {\n boolean isMatch(OWLClassExpression c, P p, R f);\n\n boolean isMatch(OWLClassExpression c, P p, R f, boolean direct);\n\n /** Perform a recursive search, adding nodes that match. If direct is true\n * only add nodes if they have no subs that match\n * \n * @param c\n * class\n * @param p\n * property\n * @param start\n * start\n * @param direct\n * direct\n * @return set of leave nodes */\n NodeSet<F> getLeaves(OWLClassExpression c, P p, R start, boolean direct);\n\n /** Perform a search on the direct subs of start, adding nodes that match. If\n * direct is false then recurse into descendants of start\n * \n * @param c\n * class\n * @param p\n * property\n * @param start\n * start\n * @param direct\n * direct\n * @return set of root nodes */\n NodeSet<F> getRoots(OWLClassExpression c, P p, R start, boolean direct);\n}",
"public interface Matcher<T> {\n\n\t/**\n\t * This method determines if the element must be allowed to be on the list.\n\t * \n\t * @param element\n\t * \n\t * @return true if the element is allowed. false otherwise.\n\t */\n\tboolean accepts(T element);\n\n}",
"public ExtensibleMatchFilter()\n {\n super();\n }",
"public final boolean matches(List<Type> typeList) {\n return typeList.equals(pattern);\n }",
"private void findAllSubclassesOneClass(Class theClass,\r\n\t\t\tList listAllClasses, List listSubClasses, boolean innerClasses) {\r\n\t\tIterator iterClasses = null;\r\n\t\tString strClassName = null;\r\n\t\tString strSuperClassName = null;\r\n\t\tClass c = null;\r\n\t\tClass cParent = null;\r\n\t\tboolean bIsSubclass = false;\r\n\t\tstrSuperClassName = theClass.getName();\r\n\t\titerClasses = listAllClasses.iterator();\r\n\t\twhile (iterClasses.hasNext()) {\r\n\t\t\tstrClassName = (String) iterClasses.next();\r\n\t\t\t// only check classes if they are not inner classes\r\n\t\t\t// or we intend to check for inner classes\r\n\t\t\tif ((strClassName.indexOf(\"$\") == -1) || innerClasses) {\r\n\t\t\t\t// might throw an exception, assume this is ignorable\r\n\t\t\t\ttry {\r\n\t\t\t\t\t// Class.forName() doesn't like nulls\r\n\t\t\t\t\tif (strClassName == null)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tif (strClassName.endsWith(\".groovy\")) {\r\n\t\t\t\t\t\tGroovyClassLoader loader = new GroovyClassLoader(Thread.currentThread()\r\n\t\t\t\t\t\t\t\t.getContextClassLoader());\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tc = loader.parseClass(loader.getResourceAsStream(strClassName));\r\n\t\t\t\t\t\t} catch (Throwable e) {\r\n\t\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tFile gFile = new File(strClassName);\r\n\t\t\t\t\t\t\t\tc = loader.parseClass(new FileInputStream(gFile));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcatch(Throwable e1)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tSystem.out.println(\"file load failed: \" + e1);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tc = Class.forName(strClassName, false, Thread\r\n\t\t\t\t\t\t\t\t.currentThread().getContextClassLoader());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (!c.isInterface()\r\n\t\t\t\t\t\t\t&& !Modifier.isAbstract(c.getModifiers())) {\r\n\t\t\t\t\t\tbIsSubclass = theClass.isAssignableFrom(c);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tbIsSubclass = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (bIsSubclass) {\r\n\t\t\t\t\t\tlistSubClasses.add(c);\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (Throwable ignored) {\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private static boolean isMoreSpecific(AccessibleObject more, Class<?>[] moreParams, boolean moreVarArgs, AccessibleObject less, Class<?>[] lessParams, boolean lessVarArgs) { // TODO clumsy arguments pending Executable in Java 8\n if (lessVarArgs && !moreVarArgs) {\n return true; // main() vs. main(String...) on []\n } else if (!lessVarArgs && moreVarArgs) {\n return false;\n }\n // TODO what about passing [arg] to log(String...) vs. log(String, String...)?\n if (moreParams.length != lessParams.length) {\n throw new IllegalStateException(\"cannot compare \" + more + \" to \" + less);\n }\n for (int i = 0; i < moreParams.length; i++) {\n Class<?> moreParam = Primitives.wrap(moreParams[i]);\n Class<?> lessParam = Primitives.wrap(lessParams[i]);\n if (moreParam.isAssignableFrom(lessParam)) {\n return false;\n } else if (lessParam.isAssignableFrom(moreParam)) {\n return true;\n }\n if (moreParam == Long.class && lessParam == Integer.class) {\n return false;\n } else if (moreParam == Integer.class && lessParam == Long.class) {\n return true;\n }\n }\n // Incomparable. Arbitrarily pick one of them.\n return more.toString().compareTo(less.toString()) > 0;\n }",
"@Override\n\tpublic boolean supports(Class<?> arg0) {\n\t\treturn Competence.class.equals(arg0);\n\t\t\t\t\n\t}",
"boolean containsAll(Pattern type) {\n boolean matchesType = contains(type);\n if (!matchesType) {\n for (ASTNode child : children) {\n matchesType = child.containsAll(type);\n if (matchesType) return true;\n }\n\n // should be false\n return matchesType;\n } else return true;\n }",
"@Override\n public boolean isPattern(IClassRecord record, HashMap<String, IClassRecord> recordMap, Properties properties) {\n try {\n boolean hasConstructorAndField = false;\n boolean extendsDecorator = false;\n Class<?> thisClass = Class\n .forName(Type.getObjectType(record.getBaseRecord().getClassName()).getClassName());\n\n HashSet<String> possibles = new HashSet<String>();\n if (record.canConvertRecord(ExtendedClassRecord.class)) {\n ExtendedClassRecord extendedClassRecord = (ExtendedClassRecord) record\n .tryConvertRecord(ExtendedClassRecord.class);\n possibles.add(extendedClassRecord.getExtendsName());\n }\n if (record.canConvertRecord(ImplementsClassRecord.class)) {\n ImplementsClassRecord implementsClassRecord = (ImplementsClassRecord) record\n .tryConvertRecord(ImplementsClassRecord.class);\n possibles.addAll(implementsClassRecord.getImplementsList());\n }\n possibles.removeIf(p -> !record.getClassList().contains(p.replace(\"/\", \".\")));\n\n for (String possible : possibles) {\n Class<?> implmentingClass = Class.forName(Type.getObjectType(possible).getClassName());\n boolean orUses = false;\n if(record.canConvertRecord(UsesClassRecord.class)){\n UsesClassRecord usesClassRecord= (UsesClassRecord) record.tryConvertRecord(UsesClassRecord.class);\n orUses = usesClassRecord.getUsesNamesList().contains(possible);\n }\n for (InstanceVarRecord fieldRecord : record.getBaseRecord().getFieldsList()) {\n// System.out.println(\"Checking: \" + fieldRecord.getType());\n\n if (recordMap.containsKey(fieldRecord.getType().replace(\"[]\", \"\"))|| orUses) {\n if ((Class.forName(\"java.util.Collection\").isAssignableFrom(Class.forName(fieldRecord.getType().replace(\"[]\", \"\"))) || orUses)||\n fieldRecord.getType().contains(\"[]\")\n ) {\n// System.out.println(\" Is Assignable\");\n if (implmentingClass.isAssignableFrom(Class.forName(fieldRecord.getType().replace(\"[]\", \"\")))||\n orUses) {\n ClassRecord r = recordMap.get(possible.replace(\"/\", \".\")).getBaseRecord();\n// System.out.println(\" Is super-field\");\n return true;\n }\n }\n }\n }\n }\n } catch (ClassNotFoundException e) {\n// e.printStackTrace();\n return false;\n }\n return false;\n }",
"private boolean match(String set, String type, String suitface, int[] sublist, int[] mask, PointBreakdownObject points, int windoftheround, int playerwind)\n\t{\n\t\t// shortcut, as suits do not overlap\n\t\tif(conditional.length==3) {\n\t\t\tif (getValue(sublist[MARKER])>0) {\n\t\t\t\tpoints.addLine(getValue(sublist[MARKER]) +\" for\"+getTileOriententation(sublist[MARKER])+\" \"+set+\"/\"+type+\"/\"+suitface+\" (\"+ArrayUtilities.arrayToString(sublist)+\")\"); }\n\t\t\treturn true; }\n\n\t\t// do the specific tile matching\n\t\telse if(conditional.length>3){\n\t\t\tif(matchConditionalPath(sublist,mask,windoftheround,playerwind)) {\n\t\t\t\tif (getValue(sublist[MARKER])>0) {\n\t\t\t\t\tpoints.addLine(getValue(sublist[MARKER]) +\" for\"+getTileOriententation(sublist[MARKER])+\" \"+set+\"/\"+type+\"/\"+suitface+\": \"+ArrayUtilities.arrayToString(ArrayUtilities.removefirst(sublist))); }\n\t\t\t\treturn true; }\n\t\t\telse return false; }\n\n\t\t// we shouldn't really get here\n\t\telse { return false; }\n\t}",
"boolean match(String mnemonic, ParameterType[] parameters);",
"@Override\n public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) {\n \n }",
"private static void applyRules(Instances itemsets, Instances predictions) {\n\t\tfor (int i=0; i<predictions.numInstances(); ++i) {\n\t\t\tInstance instance = predictions.instance(i);\n\t\t\tboolean covered = true;\n\t\t\tfor (int j= 0; j<itemsets.numInstances(); ++j) {\n\t\t\t\tInstance rule = itemsets.instance(j);\n\t\t\t\tcovered = true;\n\t\t\t\tfor (int k=0; k< itemsets.numAttributes() -1 ; ++k) {\n\t\t\t\t\tif (rule.value(k)==1) {\n\t\t\t\t\t\tcovered = instance.value(k)==1;\n\t\t\t\t\t\tif(!covered){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif (covered) {\n\t\t\t\t\t\n\t\t\t\t\tinstance.setClassValue(rule.classValue());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static void main(String[] args) {\n List<String> testList = Lists.newArrayList();\n test(testList);\n \n List<? extends Person> list2 = new ArrayList<>();\n list2.add(new Father());\n \n List<Father> list3 = new ArrayList<>();\n test1(list3);\n }",
"public void setMatchAny() {\n this.value = ANY;\n }",
"boolean matches(@NotNull List<OrderConstraintsType> orderConstraints);",
"private boolean match(String set, int[] sublist, int[] mask, PointBreakdownObject points, int windoftheround, int playerwind)\n\t{\n\t\t// shortcut, as types do not overlap\n\t\tif(conditional.length==1) {\n\t\t\tif (getValue(sublist[MARKER])>0) {\n\t\t\t\tpoints.addLine(getValue(sublist[MARKER]) +\" for\"+getTileOriententation(sublist[MARKER])+\" \"+set+\" (\"+ArrayUtilities.arrayToString(sublist)+\")\"); }\n\t\t\treturn true; }\n\t\t\n\t\t// send on for face matching matching\n\t\telse if(conditional.length>1){\n\t\t\tmask = ArrayUtilities.add(mask, conditional[1]);\n\t\t\tif(matchConditionalPath(sublist,mask,windoftheround,playerwind)) { return match(set,types[conditional[1]],sublist,mask,points,windoftheround,playerwind); }\n\t\t\t// if nothing matched, false\n\t\t\treturn false; }\n\n\t\t// we shouldn't really get here\n\t\telse { return false;}\n\t}",
"private boolean match(String set, String type, int[] sublist, int[] mask, PointBreakdownObject points, int windoftheround, int playerwind)\n\t{\t\n\t\t// because faces can overlap, we need to check whether conditional[1] matches the face definiton before we shortcut\n\t\tif (type.equals(\"simple\") || type.equals(\"terminal\")) {\n\t\t\tboolean chow = set.equals(\"chow\")||set.equals(\"set\");\n\t\t\tboolean connected = set.equals(\"connectedpair\");\n\t\t\tif (type.equals(\"simple\")) {\n\t\t\t\tif(connected && (!TilePattern.isSimple(sublist[TILE]) || !TilePattern.isSimple(sublist[TILE+1]))) { return false; }\n\t\t\t\telse if(chow && (!TilePattern.isSimple(sublist[TILE]) || !TilePattern.isSimple(sublist[TILE+2]))) { return false; }\n\t\t\t\telse if(!TilePattern.isSimple(sublist[TILE])) { return false; }}\n\t\t\telse if (type.equals(\"terminal\")) {\n\t\t\t\tif(connected && !TilePattern.isTerminal(sublist[TILE]) && !TilePattern.isTerminal(sublist[TILE+1])) { return false; }\n\t\t\t\telse if(chow && !TilePattern.isTerminal(sublist[TILE]) && !TilePattern.isTerminal(sublist[TILE+2])) { return false; }\n\t\t\t\telse if(!TilePattern.isTerminal(sublist[TILE])) { return false; }}}\n\t\telse if (type.equals(\"numeral\")){ if(!TilePattern.isNumeral(sublist[TILE])) { return false; }}\n\t\t/**\n\t\t * TODO: add equality checks for \"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\" and \"nine\"\n\t\t **/\n\t\telse if (type.equals(\"wind\"))\t{ if(!TilePattern.isWind(sublist[TILE])) { return false; }}\n\t\t/**\n\t\t * TODO: add equality checks for \"east\", \"south\", \"west\" and \"north\"\n\t\t **/\n\t\telse if (type.equals(\"dragon\")) { if(!TilePattern.isDragon(sublist[TILE])) { return false; }}\n\t\t/**\n\t\t * TODO: add equality checks for \"red\", \"green\" and \"white\"\n\t\t **/\n\t\telse if (type.equals(\"honour\")) { if(!TilePattern.isHonour(sublist[TILE])) { return false; }}\n\t\telse if (type.equals(\"flower\")) { if(!TilePattern.isFlower(sublist[TILE])) { return false; }}\n\t\telse if (type.equals(\"season\")) { if(!TilePattern.isSeason(sublist[TILE])) { return false; }}\n\n\t\t// now for the shortcut\n\t\tif(conditional.length==2) {\n\t\t\tif (conditional[1]==ROUNDWIND && sublist[TILE]!=windoftheround) { return false; }\t\t// safety check\n\t\t\telse if (conditional[1]==OWNWIND && sublist[TILE]!=playerwind) { return false; }\t\t// safety check\n\t\t\telse {\t\t\t\n\t\t\t\tif (getValue(sublist[MARKER])>0) {\n\t\t\t\t\tpoints.addLine(getValue(sublist[MARKER]) +\" for\"+getTileOriententation(sublist[MARKER])+\" \"+set+\"/\"+type+\" (\"+ArrayUtilities.arrayToString(sublist)+\")\"); }\n\t\t\t\treturn true; }}\n\t\t\n\t\t// send on for suit matching\n\t\telse if(conditional.length>2){\n\t\t\tmask = ArrayUtilities.add(mask, conditional[2]);\n\t\t\tif(matchConditionalPath(sublist,mask,windoftheround,playerwind)) { return match(set,types[conditional[1]],suits[conditional[2]],sublist,mask,points,windoftheround,playerwind); }\n\t\t\t// if nothing matched, false\n\t\t\treturn false; }\n\n\t\t// we shouldn't really get here\n\t\telse { return false; }\n\t}",
"default public boolean containsAll(Iterable<? extends T> instances, M matchCondition) {\n if (Objects.equals(getComponent().getMatcher().getAnyMatchCondition(), matchCondition)) {\n return instances.iterator().hasNext() == !isEmpty();\n }\n for (T instance : instances) {\n if (!contains(instance, matchCondition)) {\n return false;\n }\n }\n return true;\n }",
"private void findAllSubclassesOneClass(Class theClass,\r\n\t\t\tList listAllClasses, List listSubClasses) {\r\n\t\tfindAllSubclassesOneClass(theClass, listAllClasses, listSubClasses,\r\n\t\t\t\tfalse);\r\n\t}",
"@SuppressWarnings(\"unchecked\")\n private Optional<Match> classMatchSearch(Class declaringClass) {\n// return memoizer.classMatches(result, declaringClass, () -> {\n List<Match> matches = new ArrayList<>();\n Stack<Class> classes = new Stack<>();\n classes.push(declaringClass);\n while(!classes.isEmpty()) {\n Class cls = classes.pop();\n Match match = result.getMatch(cls);\n\n if(match != null) {\n matches.add(match);\n }\n if(cls.getInterfaces() != null) {\n Stream.of(cls.getInterfaces()).forEach(c -> classes.push(c));\n }\n if(cls.getSuperclass() != null && !cls.getSuperclass().equals(Object.class)) {\n classes.push(cls.getSuperclass());\n }\n }\n\n if(matches.size() == 1) {\n return Optional.of(matches.get(0));\n } else if(matches.size() > 1) {\n // Join all the includes and excludes\n Match unionMatch = new Match();\n matches.forEach(m -> {\n unionMatch.getExcludes().addAll(m.getExcludes());\n unionMatch.getIncludes().addAll(m.getIncludes());\n unionMatch.getTransforms().putAll(m.getTransforms());\n });\n return Optional.of(unionMatch);\n } else {\n return Optional.empty();\n }\n// });\n }",
"private static boolean\n\t\tdoParametersMatch(Class<?>[] types, Object[] parameters)\n\t{\n\t\tif (types.length != parameters.length) return false;\n\t\tfor (int i = 0; i < types.length; i++)\n\t\t\tif (parameters[i] != null) {\n\t\t\t\tClass<?> clazz = parameters[i].getClass();\n\t\t\t\tif (types[i].isPrimitive()) {\n\t\t\t\t\tif (types[i] != Long.TYPE && types[i] != Integer.TYPE &&\n\t\t\t\t\t\ttypes[i] != Boolean.TYPE) throw new RuntimeException(\n\t\t\t\t\t\t\"unsupported primitive type \" + clazz);\n\t\t\t\t\tif (types[i] == Long.TYPE && clazz != Long.class) return false;\n\t\t\t\t\telse if (types[i] == Integer.TYPE && clazz != Integer.class) return false;\n\t\t\t\t\telse if (types[i] == Boolean.TYPE && clazz != Boolean.class) return false;\n\t\t\t\t}\n\t\t\t\telse if (!types[i].isAssignableFrom(clazz)) return false;\n\t\t\t}\n\t\treturn true;\n\t}",
"protected abstract boolean isSatisfiedBy(Design design, AUndertaking t);",
"protected static boolean meetsMechTypeRequirements(IType candidate){\n\t\tif(candidate == null){return false;}\n\t\t\n\t\ttry{\n\t\t\tString[] interfaces = candidate.getSuperInterfaceTypeSignatures();\n\t\t\t\n\t\t\tfor(String curInterface : interfaces){\n\t\t\t\tIType testing = ModelBuilderUtil.getJavaElement(candidate, \n\t\t\t\t\t\tcurInterface);\n\t\t\t\tif((testing != null)&&(testing.getFullyQualifiedName()\n\t\t\t\t\t\t.equalsIgnoreCase(ParseConstants.MECHANISM))){return true;}\n\t\t\t\tif(ModelBuilderUtil.isInterface(testing, \n\t\t\t\t\t\tParseConstants.MECHANISM)){return true;}\n\t\t\t}\n\t\t}catch(Exception e){return false;}\n\t\t\n\t\treturn false;\n\t}",
"public RoleRegisterAssembler includeGivenRaw(String... clazzes){\n\t\t//this.onlyFor = new LinkedList<String>();\n\t\tif(rr.onlyFor==null){\n\t\t\trr.onlyFor = new LinkedList<>();\n\t\t}\n\t\tfor(String clazz : clazzes){\n\t\t\trr.onlyFor.add(clazz);\n\t\t}\n\t\tsetMatchType(MatchType.STARTS_WITH);\n\t\treturn this;\n\t}",
"protected abstract <T> T match(SelectorModel<T> model, T element);",
"@Override\n protected void checkSubclass() {\n }",
"@Override\n\tpublic void before(Method method, Object[] args, Object obj) throws Throwable {\n\t\tMap<String, Object> conditionMap = new HashMap<String, Object>();\n\t\t\n\t\tList<Condition> conditionList = new ArrayList<Condition>();\n\t\tfor (int i = 0; i < args.length; i++) {\n\t\t\tif (args[i] instanceof Search) {\n\t\t\t\tSet<String> nameSet = new HashSet<String>();\n\t\t\t\tCondition c = null;\n\t\t\t\tServletRequest request = RequestContext.getCurrentContext().getRequest();\n\t\t\t\t@SuppressWarnings(\"rawtypes\")\n\t\t\t\tEnumeration enu = request.getParameterNames();\n\t\t\t\twhile (enu.hasMoreElements()) {\n\t\t\t\t\tString name = (String)enu.nextElement();\n\t\t\t\t\tString value = request.getParameter(name);\n\t\t\t\t\tList<String> params = Arrays.asList(\"routerName\", \"methods\", \"confirmMethods\", \"gridId\");\n\t\t\t\t\tif (params.contains(name)) {\n\t\t\t\t\t\tc = new Condition();\n\t\t\t\t\t\tc.setName(name);\n\t\t\t\t\t\tc.setValue(value);\n\t\t\t\t\t\tconditionMap.put(name, value);\n\t\t\t\t\t\tnameSet.add(c.getName());\n\t\t\t\t\t\tconditionList.add(c);\n\t\t\t\t\t} else if (name.toLowerCase().startsWith(SEARCH_PREFIX) \n\t\t\t\t\t\t\t&& (value != null && (!value.equals(\"\")))) {\n//\t\t\t\t\t\tboolean has = nameSet.contains(name.split(\"_\")[1]);\n//\t\t\t\t\t\tif (name.toLowerCase().endsWith(SEARCH_SUFFIX_START)) {\n//\t\t\t\t\t\t\tif (has) {\n//\t\t\t\t\t\t\t\tfor (Condition o : conditionList) {\n//\t\t\t\t\t\t\t\t\tif (o.getName().equals(name.split(\"_\")[1])) {\n//\t\t\t\t\t\t\t\t\t\tc = o;\n//\t\t\t\t\t\t\t\t\t\tconditionList.remove(o);\n//\t\t\t\t\t\t\t\t\t\tbreak;\n//\t\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t} else {\n//\t\t\t\t\t\t\t\tc = new MultiCondition();\n//\t\t\t\t\t\t\t\t((MultiCondition)c).setName(name.split(\"_\")[1]);\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\tif (((MultiCondition) c).getOperateType() == 0) {\n//\t\t\t\t\t\t\t\t((MultiCondition) c).setOperateType(ConditionOperator.GTE);\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t((MultiCondition)c).setValue(value);\n//\t\t\t\t\t\t} else if (name.toLowerCase().endsWith(SEARCH_SUFFIX_END)) {\n//\t\t\t\t\t\t\tif (has) {\n//\t\t\t\t\t\t\t\tfor (Condition o : conditionList) {\n//\t\t\t\t\t\t\t\t\tif (o.getName().equals(name.split(\"_\")[1])) {\n//\t\t\t\t\t\t\t\t\t\tc = o;\n//\t\t\t\t\t\t\t\t\t\tconditionList.remove(o);\n//\t\t\t\t\t\t\t\t\t\tbreak;\n//\t\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t} else {\n//\t\t\t\t\t\t\t\tc = new MultiCondition();\n//\t\t\t\t\t\t\t\t((MultiCondition)c).setName(name.split(\"_\")[1]);\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\tif (((MultiCondition) c).getOperateType2() == 0) {\n//\t\t\t\t\t\t\t\t((MultiCondition)c).setOperateType2(ConditionOperator.LTE);\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t((MultiCondition)c).setValue2(value);\n//\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tc = new Condition();\n\t\t\t\t\t\t\tc.setName(name.split(\"_\")[1]);\n//\t\t\t\t\t\t\tif (c.getOperateType() == 0) {\n//\t\t\t\t\t\t\t\tc.setOperateType(ConditionOperator.EQ);\n//\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (value.indexOf(\":\") > 0 && value.length() == 19) {\n\t\t\t\t\t\t\t\tc.setValue(DateUtil.formatTimestampToDate(value));\n\t\t\t\t\t\t\t} else if (\"on\".equals(value)) {\n\t\t\t\t\t\t\t\tvalue = \"1\";\n\t\t\t\t\t\t\t\tc.setValue(value);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tc.setValue(value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tconditionMap.put(name, value);\n//\t\t\t\t\t\t}\n\t\t\t\t\t\tnameSet.add(c.getName());\n\t\t\t\t\t\tconditionList.add(c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (conditionList.size() > 0) {\n\t\t\t\t\t((Search)args[i]).setConditionList(conditionList);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSearchConditionFilter s = method.getAnnotation(SearchConditionFilter.class);\n\t\tif (s != null && s.limits() != null && s.limits().length != 0) {\n\t\t\t//TODO 处理limits,只按照limits限制的条件查询,若不限制则默认全部(即不处理)\n\t\t\tList<Condition> removes = new ArrayList<Condition>();\n\t\t\tList<String> limitList = Arrays.asList(s.limits());\n\t\t\tfor (Condition cond : conditionList) {\n\t\t\t\tif (!limitList.contains(cond.getName())) {\n\t\t\t\t\tremoves.add(cond);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconditionList.removeAll(removes);\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < args.length; i++) {\n\t\t\tif (args[i] instanceof Model && conditionList.size() > 0) {\n\t\t\t\t((Model)args[i]).addAttribute(\"conditions\", conditionMap);\n\t\t\t\tfor (Iterator<Condition> ite = conditionList.iterator(); ite.hasNext();) {\n\t\t\t\t\tCondition cond = ite.next();\n\t\t\t\t\t((Model)args[i]).addAttribute(SEARCH_PREFIX + cond.getName(), conditionMap.get(SEARCH_PREFIX + cond.getName()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n//\t\tfor (int i = 0; i < args.length; i++) {\n//\t\t\tif (args[i] instanceof Model && conditionList.size() > 0) {\n//\t\t\t\tfor (Iterator<Condition> ite = conditionList.iterator(); ite.hasNext();) {\n//\t\t\t\t\tCondition cond = ite.next();\n//\t\t\t\t\tif (cond instanceof MultiCondition) {\n//\t\t\t\t\t\t((Model)args[i]).addAttribute(SEARCH_PREFIX + cond.getName() + SEARCH_SUFFIX_START, cond.getValue());\n//\t\t\t\t\t\t((Model)args[i]).addAttribute(SEARCH_PREFIX + cond.getName() + SEARCH_SUFFIX_END, ((MultiCondition)cond).getValue2());\n//\t\t\t\t\t\tconditionMap.put(SEARCH_PREFIX + cond.getName() + SEARCH_SUFFIX_START, cond.getValue());\n//\t\t\t\t\t\tconditionMap.put(SEARCH_PREFIX + cond.getName() + SEARCH_SUFFIX_END, ((MultiCondition)cond).getValue2());\n//\t\t\t\t\t} else {\n//\t\t\t\t\t\t((Model)args[i]).addAttribute(SEARCH_PREFIX + cond.getName(), cond.getValue());\n//\t\t\t\t\t\tconditionMap.put(SEARCH_PREFIX + cond.getName(), cond.getValue());\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\t((Model)args[i]).addAttribute(\"conditions\", conditionMap);\n//\t\t\t}\n//\t\t}\n\t\t\n\t\t\n\t\t//BusinessCallController、listcontent.ftl、BackendHelper、admin.common.js、index.ftl(resume)、\n\t\t//BasicBusinessService、ResumeBusinessService、、、UserBusinessService\n//\t\tString simpleClassName = obj.getClass().getSimpleName();\n//\t\tString beanId = StringUtil.convertFirstChar2LowerCase(simpleClassName.replace(\"Controller\", \"Helper\"));\n//\t\tBaseHelper helper = SpringApplicationContext.getBean(beanId);\n//\t\t\n//\t\tif (null != helper) {//设置Condition中value的类型\n//\t\t\thelper.getConditionValue(propertyName, value);\n//\t\t}\n\t}",
"public interface IClassIdentificator {\n\n public static IClassIdentificator create(EObject eObject, Collection<IMatchException> exceptions) {\n EClass eClass = eObject.eClass();\n for (IMatchException exception : exceptions) {\n if (exception.applies(eClass))\n return exception;\n }\n return new SimpleClassIdentificator(eClass.getName());\n }\n\n public static List<IClassIdentificator> create(List<String> classNames, MetamodelHandle metamodel1, MetamodelHandle metamodel2) throws MetamodelAssessorIoException {\n List<IClassIdentificator> ids = new ArrayList<>(classNames.size());\n for (String className : classNames) {\n if (IMatchException.canParse(className)) {\n ids.add(IMatchException.parse(className, metamodel1, metamodel2));\n } else {\n ids.add(new SimpleClassIdentificator(className));\n }\n }\n return ids;\n }\n\n /**\n * Checks (for the metamodel specified in the {@link AnalysisContext}) if the eClass is searched\n * by this identificator.\n * \n * @param eClass\n * that should be ckecked\n * @return if the eClass is amongst the ones that should identified by this identificator\n */\n boolean matches(EClass eClass);\n\n List<String> getMatchingErrorsAndReset();\n}",
"@Override\r\n protected void checkSubclass() {\n }",
"@Override\r\n protected void checkSubclass() {\n }",
"@Override\r\n protected void checkSubclass() {\n }",
"public abstract boolean supports(ClassificationMethod method);",
"@Override\n protected void checkSubclass() {\n }",
"@Override\n protected void checkSubclass() {\n }",
"@Override\n protected void checkSubclass() {\n }",
"public T[] matches(T element);",
"@Test\n public void testRuleClass() throws Exception {\n\n HepProgramBuilder programBuilder = HepProgram.builder();\n programBuilder.addRuleClass( CoerceInputsRule.class );\n\n HepPlanner planner = new HepPlanner( programBuilder.build() );\n\n planner.addRule( new CoerceInputsRule( LogicalUnion.class, false, AlgFactories.LOGICAL_BUILDER ) );\n planner.addRule( new CoerceInputsRule( LogicalIntersect.class, false, AlgFactories.LOGICAL_BUILDER ) );\n\n checkPlanning( planner, \"(select name from dept union select ename from emp) intersect (select fname from customer.contact)\" );\n }",
"abstract String classify(Instance inst);",
"private boolean matches(int[] sublist, PointBreakdownObject points, int windoftheround, int playerwind)\n\t{\n\t\t// switch based on what we need to match \n\t\tint target = sublist[MARKER];\n\n\t\t// cascade\n\t\tif ((target==SINGLE || target==CONCEALED_SINGLE) \n\t\t\t\t&& matchConditionalPath(sublist,lookuptable.get(\"single\"),windoftheround,playerwind)) {\n\t\t\treturn match(\"single\",sublist,lookuptable.get(\"single\"),points,windoftheround,playerwind); }\n\t\telse if ((target==CONNECTEDPAIR || target==CONCEALED_CONNECTEDPAIR)\n\t\t\t\t&& matchConditionalPath(sublist,lookuptable.get(\"connectedpair\"),windoftheround,playerwind))\t{\n\t\t\treturn match(\"connectedpair\",sublist,lookuptable.get(\"connectedpair\"),points,windoftheround,playerwind); }\n\t\telse if ((target==PAIR || target==CONCEALED_PAIR) \n\t\t\t\t&& matchConditionalPath(sublist,lookuptable.get(\"pair\"),windoftheround,playerwind))\t{\n\t\t\treturn match(\"pair\",sublist,lookuptable.get(\"pair\"),points,windoftheround,playerwind); }\n\t\telse if ((target==CHOW || target==CONCEALED_CHOW) \n\t\t\t\t&& matchConditionalPath(sublist,lookuptable.get(\"chow\"),windoftheround,playerwind))\t{\n\t\t\treturn match(\"chow\",sublist,lookuptable.get(\"chow\"),points,windoftheround,playerwind); }\n\t\telse if ((target==PUNG || target==CONCEALED_PUNG) \n\t\t\t\t&& matchConditionalPath(sublist,lookuptable.get(\"pung\"),windoftheround,playerwind))\t{\n\t\t\treturn match(\"pung\",sublist,lookuptable.get(\"pung\"),points,windoftheround,playerwind); }\n\t\telse if ((target==KONG || target==CONCEALED_KONG) \n\t\t\t\t&& matchConditionalPath(sublist,lookuptable.get(\"kong\"),windoftheround,playerwind))\t{\n\t\t\treturn match(\"kong\",sublist,lookuptable.get(\"kong\"),points,windoftheround,playerwind); }\n\n\t\t// if nothing worked, no.\n\t\treturn false;\n\t}",
"public interface GridFilter {\n\n public abstract String getLabel();\n\n public abstract AbstractField getCampo();\n\n public abstract boolean matches(Data d);\n}",
"@Test(expected = IllegalArgumentException.class)\n public void testAnotherInvalidMatch() throws Exception {\n ArrayList<Type> typeList = Lists.newArrayList();\n typeList.add(String.class);\n typeList.add(Object.class);\n typeList.add(Object.class);\n typeList.addAll(getBothParameters(ParamToListParam.class));\n typeList.add(getFirstTypeParameter(StringListSink.class));\n PipelineRegisterer.validateTypes(typeList);\n }",
"public static void addElementWildCardSuper( List < ? super Dog> dogs){\n dogs.add(new Kangal());\n dogs.add(new Dog());\n //dogs.add(new Animal());\n }",
"public void getAllAttributeTypes(List<IAttributeType<?>> all, ItemFilter<IAttributeType<?>> filter);",
"private ArrayList findAllSubclasses(List listSuperClasses,\r\n\t\t\tList listAllClasses) {\r\n\t\treturn findAllSubclasses(listSuperClasses, listAllClasses, false);\r\n\t}",
"private static void handlePolymorphism() {\n for(String subClass : superDict.keySet()) {\n try {\n petrinet.getPlace(subClass.toString());\n } catch (NoSuchNodeException e ) {\n petrinet.createPlace(subClass.toString());\n }\n assert (petrinet.containsNode(subClass));\n for (String superClass : superDict.get(subClass)) {\n // If the class is not in the petrinet, create the class\n try {\n petrinet.getPlace(superClass.toString());\n } catch (NoSuchNodeException e) {\n petrinet.createPlace(superClass.toString());\n }\n assert (petrinet.containsNode(superClass));\n\n String methodName = subClass + \"IsPolymorphicTo\" + superClass;\n petrinet.createTransition(methodName);\n petrinet.createFlow(subClass, methodName);\n petrinet.createFlow(methodName, superClass);\n }\n }\n }",
"public abstract boolean isFilterApplicable ();",
"public boolean match( ListExp p ) { return false; }",
"@Override\n\tprotected void checkSubclass() {\n\t}",
"@Override\n\tprotected void checkSubclass() {\n\t}",
"@Override\n\tprotected void checkSubclass() {\n\t}",
"@Override\n\tprotected void checkSubclass() {\n\t}",
"@Override\n\tprotected void checkSubclass() {\n\t}",
"@Override\n\tprotected void checkSubclass() {\n\t}",
"@Override\n\tprotected void checkSubclass() {\n\t}",
"@Override\n\tprotected void checkSubclass() {\n\t}",
"@Override\n\tprotected void checkSubclass() {\n\t}",
"@Override\n\tprotected void checkSubclass() {\n\t}",
"@Override\n\tprotected void checkSubclass() {\n\t}",
"@Override\n\tprotected void checkSubclass() {\n\t}",
"@Override\n\tprotected void checkSubclass() {\n\t}",
"@Override\n\tprotected void checkSubclass() {\n\t}",
"@Override\n\tprotected void checkSubclass() {\n\t}",
"@Override\n\tprotected void checkSubclass() {\n\t}"
] | [
"0.54747355",
"0.5431206",
"0.5429158",
"0.5375677",
"0.53102785",
"0.52063185",
"0.5102661",
"0.5087576",
"0.50856024",
"0.5083433",
"0.5056362",
"0.5055759",
"0.5015993",
"0.5007671",
"0.49881616",
"0.49850696",
"0.497777",
"0.49642614",
"0.4956454",
"0.49428663",
"0.49195006",
"0.48974413",
"0.4895164",
"0.4894326",
"0.4874714",
"0.48726147",
"0.48726147",
"0.48726147",
"0.48600855",
"0.48574463",
"0.48556623",
"0.48515433",
"0.48421863",
"0.48389012",
"0.48293522",
"0.4827788",
"0.48135674",
"0.47978717",
"0.47924215",
"0.47911623",
"0.47818187",
"0.47739917",
"0.47568342",
"0.475041",
"0.47442415",
"0.47308487",
"0.4727294",
"0.47139123",
"0.47135141",
"0.47115147",
"0.46917364",
"0.4689632",
"0.46884367",
"0.46809146",
"0.46793777",
"0.46758533",
"0.4662351",
"0.46552926",
"0.46367776",
"0.46305102",
"0.46264106",
"0.4608807",
"0.45891035",
"0.45869547",
"0.457451",
"0.45710847",
"0.45710847",
"0.45710847",
"0.45692575",
"0.45665175",
"0.45665175",
"0.45665175",
"0.45619863",
"0.45596227",
"0.4557061",
"0.45553574",
"0.45467097",
"0.4537905",
"0.45353255",
"0.45302373",
"0.45301285",
"0.45256644",
"0.4521609",
"0.45205915",
"0.451783",
"0.451783",
"0.451783",
"0.451783",
"0.451783",
"0.451783",
"0.451783",
"0.451783",
"0.451783",
"0.451783",
"0.451783",
"0.451783",
"0.451783",
"0.451783",
"0.451783",
"0.451783"
] | 0.49766245 | 17 |
Override this to return false to forbid discarding return values in testers that are testing whether an exception is thrown. | protected boolean allowInExceptionThrowers() {
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Boolean ignoreExceptions();",
"@Override\n protected boolean shouldSendThrowException() {\n return false;\n }",
"protected boolean ignoreFailure() {\n return ignoreFailure;\n }",
"@Override\n\tpublic boolean javaMethodBaseWithBooleanRet() {\n\t\treturn false;\n\t}",
"@Override\n boolean canFail() {\n return true;\n }",
"@Override\n\tpublic boolean rejectIt() {\n\t\treturn false;\n\t}",
"boolean getPossiblyBad();",
"public boolean isIgnoreFailed()\n {\n return ignoreFailed;\n }",
"public boolean isValidated() throws Exception\r\n {\n return false;\r\n }",
"@Override\n\tpublic boolean test() {\n\t\treturn false;\n\t}",
"@Override\n boolean isFailed() {\n return false;\n }",
"public void noReturn() {\n\t\tSystem.out.println(\"noReturn method will not returing any thing\");\n\t}",
"@Override\n public boolean isReturn() {\n return true;\n }",
"@Override\n\tpublic boolean canBeFalsey() {\n\t\treturn false;\n\t}",
"public boolean getIgnoreResult() {\n return ignoreResult;\n }",
"protected boolean reallyCancel() throws Exception { return true; }",
"public Boolean isProhibited() {\n throw new NotImplementedException();\n }",
"boolean test() {\n return false; // REPLACE WITH SOLUTION\n }",
"public Boolean shouldAbandon() {\n return false;\n }",
"public boolean test() throws Exception {\n throw new Exception(\"Test funcationality not yet implemented: unclear API\");\n }",
"@Override\n\tpublic boolean isBusinessException() {\n\t\treturn false;\n\t}",
"@Override\n\t\tpublic boolean isInvalid() {\n\t\t\treturn false;\n\t\t}",
"public boolean getReturn();",
"@Override\r\n\tpublic boolean doCatch(Throwable ex) throws Exception\r\n\t{\n\t\treturn false;\r\n\t}",
"protected boolean asEaten() {\n return false;\n }",
"public boolean isContentInvalid() {\n/* 1156 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public boolean isDontCare() {\r\n\t\treturn dontCare;\r\n\t}",
"public boolean method_218() {\r\n return false;\r\n }",
"public boolean isDontCare(){\n return hasDontCare;\n }",
"@Override\n\tpublic boolean handlesThrowable() {\n\t\treturn false;\n\t}",
"protected boolean shouldStopCheck(String retMessage) {\n if (!returnImmediate) {\n return false;\n }\n \n if (retMessage != null && !retMessage.isEmpty()) {\n return true;\n }\n return false;\n }",
"boolean hasException();",
"public static int methodWithoutReturn(){\n throw new Error();\n }",
"public boolean isNotOk() {\n return _type == Type.OK;\n }",
"@Override\n\tpublic boolean isFailureMode() {\n\t\treturn false;\n\t}",
"boolean isIgnorable() { return false; }",
"public boolean isReturn() {\n return (isReturn);\n }",
"@Override\n public boolean hasErrorResults() {\n return false;\n }",
"public boolean method_2453() {\r\n return false;\r\n }",
"public boolean isImportantForAccessibility() {\n/* 1302 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public boolean method_2434() {\r\n return false;\r\n }",
"@Test public void negativeValueExceptionTest() {\n boolean thrown = false;\n \n NegativeValueException nv = new NegativeValueException();\n \n try {\n PetBunny pb = new PetBunny(\"Floppy\", \"Holland Lop\", -3.5);\n }\n catch (NegativeValueException e) {\n thrown = true;\n }\n Assert.assertTrue(\"Expected NegativeValueException to be thrown.\",\n thrown);\n }",
"public boolean proceedOnErrors() {\n return false;\n }",
"boolean hasPossiblyBad();",
"boolean isFailure();",
"public boolean method_216() {\r\n return false;\r\n }",
"public boolean method_196() {\r\n return false;\r\n }",
"boolean canBeSkipped();",
"synchronized boolean ignoreForRecovery() {\n return ignoreForRecovery;\n }",
"@Override\n public MethodOutcome nonExistentSourceOutcome() {\n return new MethodOutcome(MethodOutcome.Type.RETURNS_FALSE);\n }",
"boolean ignoreExceptionsDuringInit();",
"public boolean hasExceptions();",
"public boolean isIgnorable()\n {\n return m_ignore;\n }",
"public boolean isEnabled() {\n/* 945 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\n public boolean ignoreAbsorbedDamage() {\n return false;\n }",
"@Override\n public boolean ignoreAbsorbedDamage() {\n return false;\n }",
"public boolean method_4093() {\n return false;\n }",
"@Test\n\tpublic void test_returnBooleanFoo_false() {\n\t}",
"@Override\r\n public boolean isSafe() {\n return false;\r\n }",
"public boolean method_214() {\r\n return false;\r\n }",
"public boolean throwsArithmeticException() {\n\t// conservatively assume that any division or mod may throw\n\t// ArithmeticException this is NOT true-- floats and doubles don't\n\t// throw any exceptions ever...\n\treturn op == DIV || op == MOD;\n }",
"public boolean validateInput() {\n/* 158 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\n public MethodOutcome nonExistentDeleteOutcome() {\n return new MethodOutcome(MethodOutcome.Type.RETURNS_FALSE);\n }",
"@Override\r\n\tpublic boolean isValid() {\n\t\treturn false;\r\n\t}",
"@Override\n\tpublic boolean isValid() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean isValid() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean isValid() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic Boolean test() throws RemoteException {\n\t\treturn true;\n\t}",
"boolean getHasExceptions();",
"public boolean method_210() {\r\n return false;\r\n }",
"public boolean enoughToFilter() {\n/* 468 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\n public boolean isDone() {\n // boolean result = true;\n // try {\n // result = !evaluateCondition();\n // } catch (Exception e) {\n // logger.error(e.getMessage(), e);\n // }\n // setDone(true);\n // return result;\n // setDone(false);\n return false;\n }",
"public boolean method_198() {\r\n return false;\r\n }",
"public boolean method_3897() {\r\n return false;\r\n }",
"boolean isFail();",
"public boolean userException() {\n return userEx_;\n }",
"public boolean method_4102() {\n return false;\n }",
"public Boolean getSkipFail() {\r\n\t\treturn this.skipFail;\r\n\t}",
"public boolean method_108() {\r\n return false;\r\n }",
"public boolean method_4088() {\n return false;\n }",
"@Override\n public boolean isSkipTests() {\n return skipTests;\n }",
"public boolean method_195() {\r\n return false;\r\n }",
"public boolean hasResult()\n/* */ {\n/* 119 */ return this.result != RESULT_NONE;\n/* */ }",
"public boolean isHandlingException() {\n return this.isHandlingException.get();\n }",
"public boolean isHandlingException() {\n return this.isHandlingException.get();\n }",
"public boolean isCovered(ExpressionTree tree, VisitorState state) {\n return isCheckReturnValue(tree, state);\n }",
"public boolean isIgnoreErrors() {\n return ignoreErrors;\n }",
"public Boolean isIgnored() {\n return ignored;\n }",
"@Override\n\tpublic boolean isDenied();",
"@Ignore\n @Test\n @Override\n public void testBoolean(TestContext ctx) {\n super.testBoolean(ctx);\n }",
"public boolean hasFail() {\n return result.hasFail();\n }",
"@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkThrough() {\n\t\tboolean flag = oTest.checkThrough();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}",
"@Override\n public boolean exitChecker() {\n return false;\n }",
"boolean isBroken() throws IllegalStateException;",
"@Override\n\t\tprotected boolean onError(final Exception e) {\n\t\t\treturn false;\n\t\t}",
"protected boolean avoidNegativeCoordinates() {\n \t\treturn false;\n \t}",
"@Override\r\n\tpublic boolean hasError() {\n\t\treturn false;\r\n\t}",
"public boolean b()\r\n {\r\n return false;\r\n }",
"protected boolean methodForbidden() {\n return methodToTest.getName().equals(\"getClassNull\")\n || methodToTest.getName().startsWith(\"isA\")\n || methodToTest.getName().equals(\"create\")\n || methodToTest.getName().equals(\"getTipString\")\n || methodToTest.getName().equals(\"toString\");\n }",
"public boolean hasEresult() {\n return ((bitField0_ & 0x00000040) == 0x00000040);\n }"
] | [
"0.72667193",
"0.7074942",
"0.7070042",
"0.6741932",
"0.66303647",
"0.66110253",
"0.66076887",
"0.6572281",
"0.6484878",
"0.64807856",
"0.6459721",
"0.6401756",
"0.6370753",
"0.63478667",
"0.63084114",
"0.6297992",
"0.6260377",
"0.6249192",
"0.62313575",
"0.6219969",
"0.62143016",
"0.61709946",
"0.61426306",
"0.61168677",
"0.6115422",
"0.60662746",
"0.6061466",
"0.60515404",
"0.60434663",
"0.6012368",
"0.6004211",
"0.5994411",
"0.59783775",
"0.5977287",
"0.5974243",
"0.5950305",
"0.5950113",
"0.5922118",
"0.5895967",
"0.5895676",
"0.58949995",
"0.58945596",
"0.5880336",
"0.58722496",
"0.58646566",
"0.5852797",
"0.5848845",
"0.5843407",
"0.58370465",
"0.58342177",
"0.58333945",
"0.58211124",
"0.58020854",
"0.5798601",
"0.57887167",
"0.57887167",
"0.5787579",
"0.57699573",
"0.5767579",
"0.5757235",
"0.57428265",
"0.5742729",
"0.57356155",
"0.57272524",
"0.5695586",
"0.5695586",
"0.5695586",
"0.56941044",
"0.56936526",
"0.5691221",
"0.56903565",
"0.5685714",
"0.5680349",
"0.5678644",
"0.56735176",
"0.56641406",
"0.5659874",
"0.5659171",
"0.56571114",
"0.56493616",
"0.56408477",
"0.563584",
"0.5631014",
"0.5627684",
"0.5627684",
"0.5625274",
"0.5614634",
"0.56144685",
"0.5611449",
"0.5600781",
"0.55969477",
"0.55961597",
"0.55885994",
"0.55853456",
"0.5584103",
"0.558253",
"0.55798084",
"0.55774176",
"0.55718714",
"0.5564864"
] | 0.6440683 | 11 |
Fixes the error by assigning the result of the call to the receiver reference, or deleting the method call. Subclasses may override if they prefer a different description. | protected Description describeReturnValueIgnored(
MethodInvocationTree methodInvocationTree, VisitorState state) {
return buildDescription(methodInvocationTree)
.addFix(makeFix(methodInvocationTree, state))
.setMessage(getMessage(getSymbol(methodInvocationTree).getSimpleName()))
.build();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected ForUnresolvedMethod(String message) {\n this.message = message;\n }",
"private void tryCallWithReferenceType() {\n\n StringBuilder builder = new StringBuilder(\"My content will \");\n // the method call will take the original value\n callMethod(builder);\n // the builder content has changed\n System.out.println(builder);\n }",
"@Override\n\tpublic void adjustToError() {\n\t\t\n\t}",
"private void correctError()\r\n\t{\r\n\t\t\r\n\t}",
"protected void failed()\r\n {\r\n //overwrite\r\n }",
"public void setError(CharSequence error) {\n/* 1515 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\n public void clearError() {\n\n }",
"@Override\n\tpublic void setWrongError() {\n\t\t\n\t}",
"protected abstract void afterCall(final Object result);",
"protected Description describeReturnValueIgnored(\n MemberReferenceTree memberReferenceTree, VisitorState state) {\n return buildDescription(memberReferenceTree)\n .setMessage(\n getMessage(\n state.getName(descriptiveNameForMemberReference(memberReferenceTree, state))))\n .build();\n }",
"@Deprecated\n public void declineCall(Call call, Reason reason);",
"public void failure(RetrofitError arg0) {\n\t\t\t\t\n\t\t\t}",
"public void failure(RetrofitError arg0) {\n\t\t\t\t\n\t\t\t}",
"final Fix makeFix(MethodInvocationTree methodInvocationTree, VisitorState state) {\n ExpressionTree identifierExpr = ASTHelpers.getRootAssignable(methodInvocationTree);\n Type identifierType = null;\n if (identifierExpr != null) {\n if (identifierExpr instanceof JCIdent) {\n identifierType = ((JCIdent) identifierExpr).sym.type;\n } else if (identifierExpr instanceof JCFieldAccess) {\n identifierType = ((JCFieldAccess) identifierExpr).sym.type;\n } else {\n throw new IllegalStateException(\"Expected a JCIdent or a JCFieldAccess\");\n }\n }\n\n Type returnType =\n ASTHelpers.getReturnType(((JCMethodInvocation) methodInvocationTree).getMethodSelect());\n\n Fix fix = SuggestedFix.emptyFix();\n Symbol symbol = getSymbol(identifierExpr);\n if (identifierExpr != null\n && symbol != null\n && !symbol.name.contentEquals(\"this\")\n && returnType != null\n && state.getTypes().isAssignable(returnType, identifierType)) {\n // Fix by assigning the assigning the result of the call to the root receiver reference.\n fix =\n SuggestedFix.prefixWith(\n methodInvocationTree, state.getSourceForNode(identifierExpr) + \" = \");\n } else {\n // Unclear what the programmer intended. Delete since we don't know what else to do.\n Tree parent = state.getPath().getParentPath().getLeaf();\n if (parent instanceof ExpressionStatementTree\n && constantExpressions.constantExpression(methodInvocationTree, state).isPresent()) {\n fix = SuggestedFix.delete(parent);\n }\n }\n return fix;\n }",
"public WrongMethodNameException() {\n\t\tsuper(defaultMsg);\n\t}",
"@Override\n public void onFailure(Call arg0, IOException arg1) {\n\n }",
"public void removeCall(java.lang.String r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.telecom.ConnectionServiceAdapterServant.2.removeCall(java.lang.String):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.telecom.ConnectionServiceAdapterServant.2.removeCall(java.lang.String):void\");\n }",
"public void setResult(final OrderEditPreviewFailure result);",
"public ExecutionError(Error cause) {\n/* 58 */ super(cause);\n/* */ }",
"@Override\n\tpublic void notifyFailure(ResourceOperationDescription operationDescription, Task task, OperationResult parentResult) {\n\t\tnotifyAny(operationDescription);\n\t}",
"@Override\n\t\t\t\t\t\tpublic void onFailure(Method method, Throwable exception) {\n\n\t\t\t\t\t\t}",
"@Override\n public void unInvoke() {\n if (!(affected instanceof MOB))\n return;\n final MOB mob = (MOB) affected;\n super.unInvoke();\n\n if ((canBeUninvoked()) && (mob.location() != null)) {\n if ((failed) || (!CMLib.flags().isSitting(mob)) || (room == null) || (title == null) || (mob.location() != room))\n mob.tell(L(\"You are no longer squatting.\"));\n else if (title.getOwnerName().length() > 0) {\n mob.tell(L(\"Your squat has succeeded. This property no longer belongs to @x1.\", title.getOwnerName()));\n title.setOwnerName(\"\");\n title.updateTitle();\n title.updateLot(null);\n } else {\n mob.tell(L(\"Your squat has succeeded. This property now belongs to you.\"));\n title.setOwnerName(mob.Name());\n title.updateTitle();\n title.updateLot(new XVector(mob.name()));\n }\n }\n failed = false;\n }",
"@Override\n\tpublic void calculateError() {\n\t\t\n\t}",
"@Override\n\tpublic void error(String message, Object p0, Object p1) {\n\n\t}",
"@Override\n\tpublic void error(Marker marker, MessageSupplier msgSupplier) {\n\n\t}",
"@Override\n\tpublic String doError() {\n\t\treturn null;\n\t}",
"public CharSequence getError() {\n/* 1523 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\r\n public boolean invokeRuleMethod(BusinessRule rule) {\r\n boolean result = super.invokeRuleMethod(rule);\r\n cleanErrorMessages();\r\n return result;\r\n }",
"@FormatMethod\n private void reportError(\n SourcePosition position, @FormatString String message, Object... arguments) {\n errorReporter.reportError(position, message, arguments);\n }",
"@Override\n\tpublic void error(Marker marker, String message, Object p0, Object p1) {\n\n\t}",
"@Override\n public void onFailure(Call<Menumodel> call, Throwable t) {\n\n }",
"@Override\n\tpublic void error(String message, Object p0, Object p1, Object p2) {\n\n\t}",
"public void setContentDescription(CharSequence contentDescription) {\n/* 1546 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\n\tpublic void error(Marker marker, String message, Object p0, Object p1, Object p2) {\n\n\t}",
"public void correctErrors();",
"@Override\r\n\tpublic void reportError(String errorInfo, String errorDetails) {\n\t\t\r\n\t}",
"@Override\n public void onFailure(@NonNull Call<Void> call, @NonNull Throwable t) {\n }",
"void setError();",
"@Override\n public void onFailure(Call<GetPotentialEarn> call, Throwable t) {\n }",
"public MissingMethodReturnException() {\n\t\tsuper(defaultMsg);\n\t}",
"public abstract void setError(String message);",
"@Override\n\tpublic void error(Marker marker, String message, Object p0) {\n\n\t}",
"public void onFailure(String method, Object data) {\n\t\t\t\t\n\t\t\t}",
"public void onFailure(String method, Object data) {\n\t\t\t\t\n\t\t\t}",
"public Object resolveReference( Object name ) {\n throw new UnsupportedOperationException( Messages.getErrorString( \"PMSFormulaContext.ERROR_0001_INVALID_USE\" ) ); //$NON-NLS-1$\n }",
"void setDeprecated(Operation operation, Method method);",
"@Override\r\n public String precondition() {\r\n return \"<html> The method call that returns an object is called twice in series. <br/>\" +\r\n \"Both method calls have no parameters, only return statements. <br/>\" +\r\n \"The object returned by the method call must be defined as a class. </html>\";\r\n }",
"public abstract void onError(Call call, Exception e);",
"@Override\n\tpublic void error(Marker marker, Supplier<?> msgSupplier) {\n\n\t}",
"@Override\n\tpublic void error(String message, Object p0) {\n\n\t}",
"public void Error(){\n }",
"protected abstract void error(String err);",
"public static Object perform(Object receiver, String methodName, Object[] arguments) throws DiagnoseException {\r\n Class<?>[] types = argumentTypesFrom(arguments);\r\n Object result;\r\n try {\r\n result = perform(receiver, methodName, arguments, types);\r\n } catch (DiagnoseException e) {\r\n for (int t = 0; t < types.length; t++)\r\n types[t] = types[t].getSuperclass(); // wild guess...\r\n result = perform(receiver, methodName, arguments, types);\r\n }\r\n return result;\r\n }",
"abstract void error(String error);",
"public updsertCompanyReferralPocily_result(updsertCompanyReferralPocily_result other) {\n if (other.isSetE()) {\n this.e = new com.moseeker.thrift.gen.common.struct.BIZException(other.e);\n }\n }",
"public graphene.model.idl.G_DocumentError.Builder clearDescription() {\n description = null;\n fieldSetFlags()[1] = false;\n return this;\n }",
"@Override\n\tpublic void setMyPhoneError() {\n\t\t\n\t}",
"public final void setCallerDisplayName(java.lang.String r1, java.lang.String r2, int r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: android.telecom.ConnectionServiceAdapterServant.2.setCallerDisplayName(java.lang.String, java.lang.String, int):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.telecom.ConnectionServiceAdapterServant.2.setCallerDisplayName(java.lang.String, java.lang.String, int):void\");\n }",
"@Override\n\tpublic void error(Marker marker, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7) {\n\n\t}",
"@Override\n\tpublic void errorOnExecution(final String message) {\n\t\tafterExecution();\n\t}",
"@Override\n public void onFailure(Call<Dados> call, Throwable t) {\n }",
"public void err2() {\n\t\tString errMessage = CalculatorValue.checkMeasureValue(text_Operand2.getText());\n\t\tif (errMessage != \"\") {\n\t\t\tlabel_errOperand2.setText(CalculatorValue.measuredValueErrorMessage);\n\t\t\tif (CalculatorValue.measuredValueIndexofError <= -1)\n\t\t\t\treturn;\n\t\t\tString input = CalculatorValue.measuredValueInput;\n\t\t\toperand2ErrPart1.setText(input.substring(0, CalculatorValue.measuredValueIndexofError));\n\t\t\toperand2ErrPart2.setText(\"\\u21EB\");\n\t\t}\n\t}",
"@Override\n\tprotected void minus(char c, InterimResult ir)\n\t{\n\t\terror(c, ir);\n\t}",
"@Override\n public QueryStatusMessage reset() {\n super.reset();\n cause = \"\";\n status = null;\n return this;\n }",
"@Override\n\tpublic void error(Marker marker, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6) {\n\n\t}",
"public void doTheFaultyThing();",
"protected abstract void setErrorCode();",
"private void usageError(String error) {\n System.err.println(\"\\n\" + error);\n usage(-1);\n }",
"public boolean setErrorResult(Object result)\n/* */ {\n/* 248 */ return setResultInternal(result);\n/* */ }",
"public void fail(String desc) {\n\t\tfail();\n error = desc;\n\t}",
"public static void callAndInvalidate(MethodHandle call, SwitchPoint sp, Lazy target) throws Throwable{\n\t\tcall.bindTo(target).invokeExact();\n\t\t// now we invalidate the switch point, which means this should never be called again\n\t\tSwitchPoint.invalidateAll(new SwitchPoint[]{sp});\n\t}",
"@Override\n public void taskErrorMessage(Object result) {\n\n }",
"public void inquiryError() {\n\t\t\n\t}",
"void putTargetError(final ReportWriter reporter) {\n\t\tString s = ((_refXdefName == null || (_refXdefName.length() == 0)\n\t\t\t? (_definition.getName() + '#' + getName())\n\t\t\t: (_refXdefName + '#' + getName())));\n\t\t//Referred object doesn't exist: &{0}\n\t\tgetSPosition().putReport(Report.error(XDEF.XDEF122, s), reporter);\n\t}",
"@Override\r\n\tpublic void setReferredOperation(String referredOperation) {\n\r\n\t}",
"@Override\n\tpublic void error(Marker marker, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7, Object p8, Object p9) {\n\n\t}",
"public InvalidInvocationException()\n {\n super(DEFAULT_MESSAGE);\n }",
"@Deprecated\n public void transferCallToAnother(Call call, Call dest);",
"public Clear_result(Clear_result other) {\r\n }",
"@Override\n public void errorOnUpdate(String buxError) {\n }",
"@Override\n public void onSetFailure(String s) {\n }",
"@Override\n public void onSetFailure(String s) {\n }",
"public void sub() {\n //TODO: Fill in this method, then remove the RuntimeException\n throw new RuntimeException(\"RatPolyStack->sub() unimplemented!\\n\");\n }",
"@Override\n public void failure(RetrofitError error) {\n }",
"@Override\n\tpublic void error(Marker marker, Object message) {\n\n\t}",
"@Override\n\tpublic void error(Marker marker, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4, Object p5, Object p6, Object p7, Object p8) {\n\n\t}",
"@Override\n public void failure(RetrofitError error) {\n }",
"@Override\n\tpublic void error(Marker marker, String message, Object p0, Object p1, Object p2, Object p3,\n\t\t\tObject p4) {\n\n\t}",
"@Override\n public void onFailure(Call<Business> call, Throwable t) {\n\n }",
"@Override\n\tpublic void error(Marker marker, String message, Object p0, Object p1, Object p2, Object p3) {\n\n\t}",
"@Override\n public void onFailure(Call call, IOException e) {\n call.cancel();\n System.out.println(\"FAILED\"+ e.getMessage());\n }",
"public void setCallReturn(Object obj) {\n\n\t}",
"@Override\n\tpublic void error(Marker marker, CharSequence message) {\n\n\t}",
"@Disabled\n\t@Test\n\tpublic void testBadCallToMock(){\n\t\twarehouseMock.remove(\"cola\",2);\n\t\treplay(warehouseMock);\n\t\tverify(warehouseMock);\n\t}",
"public InvalidInvocationException(String detailMessage)\n {\n super(detailMessage);\n }",
"@Override\n\tpublic void error(Marker marker, MessageSupplier msgSupplier, Throwable t) {\n\n\t}",
"@Override\n\tpublic void error(String message, Object p0, Object p1, Object p2, Object p3, Object p4,\n\t\t\tObject p5, Object p6, Object p7) {\n\n\t}",
"void onFailure(String description);",
"public void failure(RetrofitError arg0) {\n\t\t\t\tdialog.dismissWithFailure();\n\t\t\t}",
"public abstract boolean isDelCall();"
] | [
"0.54317224",
"0.5424552",
"0.53479326",
"0.53000885",
"0.52986735",
"0.5258782",
"0.52348006",
"0.5176901",
"0.51641226",
"0.5146372",
"0.5119409",
"0.5111753",
"0.5111753",
"0.51060575",
"0.50760853",
"0.5067539",
"0.50381696",
"0.50339544",
"0.50244635",
"0.5023394",
"0.5009954",
"0.49933833",
"0.49931818",
"0.49643755",
"0.4951365",
"0.49457836",
"0.49372336",
"0.49358138",
"0.4927932",
"0.49208456",
"0.49152163",
"0.49065444",
"0.48977876",
"0.48917264",
"0.4880343",
"0.48749998",
"0.4866396",
"0.48604622",
"0.48572877",
"0.4844092",
"0.48413238",
"0.48321542",
"0.48074225",
"0.48074225",
"0.48069915",
"0.4798027",
"0.47918674",
"0.4789216",
"0.47754854",
"0.47731307",
"0.47690287",
"0.47668383",
"0.47577566",
"0.47420606",
"0.4742057",
"0.4741531",
"0.47402036",
"0.4739832",
"0.47381583",
"0.4737974",
"0.47279155",
"0.47233555",
"0.47133887",
"0.47130522",
"0.47117615",
"0.47107986",
"0.47048682",
"0.4704284",
"0.4703346",
"0.46932778",
"0.4692189",
"0.4689357",
"0.46869493",
"0.46847984",
"0.4684509",
"0.46824896",
"0.4677688",
"0.46751264",
"0.4673316",
"0.4673216",
"0.46695405",
"0.46695405",
"0.46662796",
"0.46491653",
"0.46442112",
"0.46432915",
"0.46413052",
"0.46409646",
"0.46407983",
"0.46392944",
"0.4638075",
"0.46377295",
"0.46371135",
"0.4632842",
"0.46309158",
"0.46278608",
"0.46221733",
"0.46216667",
"0.46202466",
"0.4617017"
] | 0.52885973 | 5 |
Find the root of the field access chain, i.e. a.intern().trim() ==> a. | final Fix makeFix(MethodInvocationTree methodInvocationTree, VisitorState state) {
ExpressionTree identifierExpr = ASTHelpers.getRootAssignable(methodInvocationTree);
Type identifierType = null;
if (identifierExpr != null) {
if (identifierExpr instanceof JCIdent) {
identifierType = ((JCIdent) identifierExpr).sym.type;
} else if (identifierExpr instanceof JCFieldAccess) {
identifierType = ((JCFieldAccess) identifierExpr).sym.type;
} else {
throw new IllegalStateException("Expected a JCIdent or a JCFieldAccess");
}
}
Type returnType =
ASTHelpers.getReturnType(((JCMethodInvocation) methodInvocationTree).getMethodSelect());
Fix fix = SuggestedFix.emptyFix();
Symbol symbol = getSymbol(identifierExpr);
if (identifierExpr != null
&& symbol != null
&& !symbol.name.contentEquals("this")
&& returnType != null
&& state.getTypes().isAssignable(returnType, identifierType)) {
// Fix by assigning the assigning the result of the call to the root receiver reference.
fix =
SuggestedFix.prefixWith(
methodInvocationTree, state.getSourceForNode(identifierExpr) + " = ");
} else {
// Unclear what the programmer intended. Delete since we don't know what else to do.
Tree parent = state.getPath().getParentPath().getLeaf();
if (parent instanceof ExpressionStatementTree
&& constantExpressions.constantExpression(methodInvocationTree, state).isPresent()) {
fix = SuggestedFix.delete(parent);
}
}
return fix;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getRoot();",
"java.lang.String getField1009();",
"java.lang.String getField1286();",
"java.lang.String getField1086();",
"java.lang.String getField1186();",
"java.lang.String getField1134();",
"java.lang.String getField1189();",
"java.lang.String getField1089();",
"java.lang.String getField1034();",
"java.lang.String getField1129();",
"java.lang.String getField1786();",
"java.lang.String getField1339();",
"java.lang.String getField1187();",
"java.lang.String getField1789();",
"java.lang.String getField1338();",
"java.lang.String getField1184();",
"java.lang.String getField1179();",
"java.lang.String getField1336();",
"java.lang.String getField1677();",
"java.lang.String getField1077();",
"java.lang.String getField1177();",
"java.lang.String getField1289();",
"java.lang.String getField1586();",
"java.lang.String getField1689();",
"java.lang.String getField1027();",
"java.lang.String getField1330();",
"java.lang.String getField1088();",
"java.lang.String getField1084();",
"java.lang.String getField1183();",
"java.lang.String getField1334();",
"java.lang.String getField1087();",
"java.lang.String getField1137();",
"java.lang.String getField1037();",
"java.lang.String getField1093();",
"java.lang.String getField1079();",
"java.lang.String getField1193();",
"java.lang.String getField1337();",
"java.lang.String getField1335();",
"java.lang.String getField1019();",
"java.lang.String getField1777();",
"java.lang.String getField1139();",
"java.lang.String getField1188();",
"java.lang.String getField1109();",
"java.lang.String getField1091();",
"java.lang.String getField1131();",
"java.lang.String getField1081();",
"java.lang.String getField1029();",
"java.lang.String getField1277();",
"java.lang.String getField1589();",
"java.lang.String getField1038();",
"java.lang.String getField1169();",
"java.lang.String getField1138();",
"java.lang.String getField1271();",
"java.lang.String getField1053();",
"java.lang.String getField1279();",
"java.lang.String getField1082();",
"java.lang.String getField1181();",
"java.lang.String getField1284();",
"java.lang.String getField1734();",
"java.lang.String getField1018();",
"java.lang.String getField1389();",
"java.lang.String getField1727();",
"java.lang.String getField1076();",
"java.lang.String getField1176();",
"java.lang.String getField1178();",
"java.lang.String getField1726();",
"java.lang.String getField1153();",
"java.lang.String getField1731();",
"java.lang.String getField1031();",
"java.lang.String getField1781();",
"java.lang.String getField1143();",
"java.lang.String getField1182();",
"java.lang.String getField1127();",
"java.lang.String getField1083();",
"java.lang.String getField1092();",
"java.lang.String getField1147();",
"java.lang.String getField1039();",
"java.lang.String getField1486();",
"java.lang.String getField1779();",
"java.lang.String getField1192();",
"java.lang.String getField1288();",
"java.lang.String getField1579();",
"java.lang.String getField1784();",
"java.lang.String getField1157();",
"java.lang.String getField1047();",
"java.lang.String getField1787();",
"java.lang.String getField1108();",
"java.lang.String getField1434();",
"java.lang.String getField1477();",
"java.lang.String getField1386();",
"java.lang.String getField1237();",
"java.lang.String getField1135();",
"java.lang.String getField1584();",
"java.lang.String getField1194();",
"java.lang.String getField1163();",
"java.lang.String getField1534();",
"java.lang.String getField1142();",
"java.lang.String getField1729();",
"java.lang.String getField1022();",
"java.lang.String getField1057();",
"java.lang.String getField1581();"
] | [
"0.557114",
"0.5484592",
"0.54756564",
"0.5474999",
"0.54682267",
"0.5405099",
"0.53965163",
"0.5391236",
"0.5375989",
"0.5375351",
"0.5359125",
"0.53575355",
"0.53527385",
"0.5343358",
"0.534086",
"0.53383183",
"0.53330714",
"0.53310126",
"0.5326466",
"0.53261536",
"0.53250414",
"0.5322751",
"0.53179026",
"0.5317744",
"0.53165156",
"0.53151655",
"0.5304351",
"0.5302959",
"0.53022105",
"0.5299574",
"0.5299141",
"0.5298733",
"0.5297957",
"0.52969694",
"0.5296832",
"0.5292728",
"0.529045",
"0.5290151",
"0.5286575",
"0.52838254",
"0.5280576",
"0.5277691",
"0.52766365",
"0.52751756",
"0.52750975",
"0.52745926",
"0.5273428",
"0.5266353",
"0.52645695",
"0.52642",
"0.52620786",
"0.5261808",
"0.52608335",
"0.5259984",
"0.5258016",
"0.52565384",
"0.52542996",
"0.5250869",
"0.52474546",
"0.5244898",
"0.52441144",
"0.5243856",
"0.52421427",
"0.5241683",
"0.5238618",
"0.5235726",
"0.5235115",
"0.5233164",
"0.52330077",
"0.52322686",
"0.5231818",
"0.5231625",
"0.52304614",
"0.5229018",
"0.5228981",
"0.5226537",
"0.5225481",
"0.5225432",
"0.522359",
"0.52220213",
"0.52198786",
"0.5219316",
"0.5216108",
"0.52125436",
"0.52085185",
"0.5205934",
"0.52056694",
"0.5205575",
"0.520157",
"0.51998776",
"0.51991415",
"0.5198026",
"0.51970696",
"0.5194268",
"0.5193574",
"0.5192269",
"0.5192109",
"0.51913935",
"0.5190136",
"0.51898646",
"0.51888067"
] | 0.0 | -1 |
Uses the default description for results ignored via a method reference. Subclasses may override if they prefer a different description. | protected Description describeReturnValueIgnored(
MemberReferenceTree memberReferenceTree, VisitorState state) {
return buildDescription(memberReferenceTree)
.setMessage(
getMessage(
state.getName(descriptiveNameForMemberReference(memberReferenceTree, state))))
.build();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic String getDescription() {\n\t\tString descr=\"Results\";\r\n\t\treturn descr;\r\n\t}",
"public abstract void description();",
"String getDescriptionIfNotMet();",
"@Override\n protected String getDescription() {\n return null;\n }",
"@Override\n public void setDescription(String arg0)\n {\n \n }",
"@Override\n\tpublic String getDescription();",
"@Override\n public String getDescription()\n {\n return null;\n }",
"public String describe() { return new String(\"No description.\"); }",
"public String getDescription()\r\n {\r\n return \"unknow\";\r\n }",
"public abstract String description();",
"public abstract String description();",
"public String getDescription() {\n/* 179 */ return getDescription((String)null);\n/* */ }",
"@Override\r\n\tpublic String getDescription() {\n\t\treturn null;\r\n\t}",
"@Override\r\n\tpublic String getDescription() {\n\t\treturn null;\r\n\t}",
"@Override\n\tpublic String getDescription() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic String getDescription() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic String getDescription() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic String getDescription() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic String getDescription() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic String getDescription() {\n\t\treturn null;\n\t}",
"@Override\r\n\tpublic String getDescription() {\n\t\treturn \"\";\r\n\t}",
"@Override\n public String getDescription() {\n return description;\n }",
"public abstract String getDescription();",
"public abstract String getDescription();",
"public abstract String getDescription();",
"public abstract String getDescription();",
"public abstract String getDescription();",
"public abstract String getDescription();",
"public abstract String getDescription();",
"public abstract String getDescription();",
"@Override\n public String getDescription() {\n return description;\n }",
"@Override\n public String getDescription() {\n return descriptionText;\n }",
"@Override\n protected String getDescription() {\n return DESCRIPTION;\n }",
"@Override\n public void setTestDescription()\n {\n setTestDescription(\"Invoke perform ProductSpecOperation api by passing\"\n + \" null mor\");\n }",
"@Override\r\n public String description() {\r\n return \"<html>Create a new method in class A that delegates the call to object B. <br/>\" +\r\n \"Now the client doesn’t know about, or depend on, class B. </html>\";\r\n }",
"java.lang.String getDesc();",
"public String getDescription()\n/* */ {\n/* 74 */ return this.description;\n/* */ }",
"@Override\r\n\tpublic String description() {\n\t\treturn null;\r\n\t}",
"public abstract String getDescription ( );",
"@Override\n\tpublic String description() {\n\t\treturn null;\n\t}",
"public void setDescription(String descr);",
"@Override\r\n\tpublic String getDescription() {\n\t\treturn description;\r\n\t}",
"@Override\n\tpublic String getDescription() {\n\t\treturn description;\n\t}",
"@Override\n public String describe() {\n return null;\n }",
"public String description();",
"@Override\n public String getDescription() {\n return DESCRIPTION;\n }",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"public void setDescription (String Description);",
"public void setDescription (String Description);",
"public void setDescription (String Description);",
"public void setDescription (String Description);",
"public void setDescription (String Description);",
"public void setDescription (String Description);",
"public abstract void setDescription(String description);",
"public abstract void setDescription(String description);",
"public abstract String getDescription(Object value);",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"String getDesc();",
"public String getDescription ();",
"@Override\n\tpublic String getDescription() {\n\t\treturn \"?\";\n\t}",
"public void setDescription(String desc);",
"@Override\n public String getDescription() {\n return this.description;\n }",
"public void setDescription (String description);",
"public void setDescription(String description){this.description=description;}",
"public E16_OverloadJavaDoc() {\n System.out.println(\"Planting a seedling\");\n }",
"public abstract String commandDocumentation();",
"@Override\n public String getDescription()\n {\n return m_description;\n }",
"public Object getDescription() {\n\t\treturn null;\n\t}",
"public String getDescription(){\n \n return\"\";\n }",
"public List<String> description() {\n return Arrays.asList(new String[]{\"Default Description : Its a Performance Function\"});\n }"
] | [
"0.70452297",
"0.683013",
"0.67077065",
"0.67050886",
"0.65865403",
"0.6585574",
"0.6567537",
"0.65660274",
"0.6565673",
"0.6546029",
"0.6546029",
"0.6532282",
"0.6525077",
"0.6525077",
"0.6508845",
"0.6508845",
"0.6508845",
"0.6508845",
"0.6508845",
"0.6508845",
"0.6506376",
"0.65025175",
"0.6483475",
"0.6483475",
"0.6483475",
"0.6483475",
"0.6483475",
"0.6483475",
"0.6483475",
"0.6483475",
"0.64171976",
"0.6409859",
"0.6406302",
"0.6378874",
"0.63443583",
"0.6329353",
"0.632166",
"0.6315251",
"0.630867",
"0.62852216",
"0.62791395",
"0.62755996",
"0.6274838",
"0.62564",
"0.6252235",
"0.62409025",
"0.62359464",
"0.62359464",
"0.62359464",
"0.62359464",
"0.62359464",
"0.62359464",
"0.62359464",
"0.62359464",
"0.62359464",
"0.6235007",
"0.6235007",
"0.6235007",
"0.6235007",
"0.6235007",
"0.6235007",
"0.62310666",
"0.62310666",
"0.6222115",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6220432",
"0.6206014",
"0.61854756",
"0.61610496",
"0.6157273",
"0.6132486",
"0.61109716",
"0.6096063",
"0.6095478",
"0.6094105",
"0.60921395",
"0.6082019",
"0.6071293",
"0.60344833"
] | 0.0 | -1 |
Uses the default description for results ignored via a constructor call. Subclasses may override if they prefer a different description. | protected Description describeReturnValueIgnored(NewClassTree newClassTree, VisitorState state) {
return buildDescription(newClassTree)
.setMessage(
String.format(
"Ignored return value of '%s'",
state.getSourceForNode(newClassTree.getIdentifier())))
.build();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String describe() { return new String(\"No description.\"); }",
"@Override\n protected String getDescription() {\n return null;\n }",
"@Override\n public String getDescription() {\n return description;\n }",
"@Override\r\n\tpublic String getDescription() {\n\t\tString descr=\"Results\";\r\n\t\treturn descr;\r\n\t}",
"@Override\n public String getDescription()\n {\n return null;\n }",
"public abstract String description();",
"public abstract String description();",
"@Override\r\n\tpublic String getDescription() {\n\t\treturn null;\r\n\t}",
"@Override\r\n\tpublic String getDescription() {\n\t\treturn null;\r\n\t}",
"@Override\n\tpublic String getDescription() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic String getDescription() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic String getDescription() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic String getDescription() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic String getDescription() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic String getDescription() {\n\t\treturn null;\n\t}",
"@Override\n protected String getDescription() {\n return DESCRIPTION;\n }",
"@Override\n public String getDescription() {\n return description;\n }",
"@Override\r\n\tpublic String getDescription() {\n\t\treturn \"\";\r\n\t}",
"@Override\r\n\tpublic String description() {\n\t\treturn null;\r\n\t}",
"@Override\n public String getDescription() {\n return descriptionText;\n }",
"@Override\n public String describe() {\n return null;\n }",
"@Override\n\tpublic String description() {\n\t\treturn null;\n\t}",
"public Description(String aValue) {\n super(aValue);\n }",
"public abstract String getDescription();",
"public abstract String getDescription();",
"public abstract String getDescription();",
"public abstract String getDescription();",
"public abstract String getDescription();",
"public abstract String getDescription();",
"public abstract String getDescription();",
"public abstract String getDescription();",
"@Override\n public String getDescription()\n {\n return m_description;\n }",
"@Override\n public String getDescription() {\n return DESCRIPTION;\n }",
"public void setDescription(String description){this.description=description;}",
"public abstract void description();",
"public void setDescription(String description) { this.description = description; }",
"@Override\r\n\tpublic String getDescription() {\n\t\treturn description;\r\n\t}",
"@Override\r\n public String toString() {\r\n return String.format(\"%s\",\r\n description);\r\n }",
"@Override\n\tpublic String getDescription() {\n\t\treturn description;\n\t}",
"public ProjectDescription() {\n this.description = Project.PROJECT_DEFAULT_DESCRIPTION;\n }",
"@Override\n\tpublic String getDescription();",
"public String getDescription(){return description;}",
"public String getDescription(){return description;}",
"@Override\n public void setDescription(String arg0)\n {\n \n }",
"public String getDescription() { return description; }",
"public String getDescription(){ return description; }",
"public String getDescription() {\n/* 179 */ return getDescription((String)null);\n/* */ }",
"public ResourceDesc() {\n }",
"@Override\n public String toString() {\n return description;\n }",
"public Synopsis()\n\t{\n\n\t}",
"@Override\n public String getDescription() {\n return this.description;\n }",
"java.lang.String getDesc();",
"public String getDescription()\n/* */ {\n/* 74 */ return this.description;\n/* */ }",
"public String getDescription(){\n \n return\"\";\n }",
"public void setDescription (String Description);",
"public void setDescription (String Description);",
"public void setDescription (String Description);",
"public void setDescription (String Description);",
"public void setDescription (String Description);",
"public void setDescription (String Description);",
"public void setDescription(String description) {\n this.description = description;\n }",
"public void setDescription(String description) {\n this.description = description;\n }",
"public abstract String getDescription ( );",
"public void setDescription(String description)\n/* */ {\n/* 67 */ this.description = description;\n/* */ }",
"public String description();",
"public Object getDescription() {\n\t\treturn null;\n\t}",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"@Override\r\n\t\tpublic String toString() {\r\n\t\t\treturn description;\r\n\t\t}",
"public String getDescription()\r\n {\r\n return \"unknow\";\r\n }",
"public ApplicationDescription() {}",
"public String getDesc()\r\n {\r\n return description;\r\n }",
"public void setDescription(String descr);",
"@JsonIgnore\n @Override\n public String getDescription()\n {\n return description;\n }",
"@Override\n\tpublic String toString() {\n\t\treturn description;\n\t}",
"public void setDescription (String description);",
"public abstract void setDescription(String description);",
"public abstract void setDescription(String description);",
"@Override\r\n\tpublic String getDescription() {\n\t\treturn this.description;\r\n\t}",
"@Override\n public void setTestDescription()\n {\n setTestDescription(\"Invoke perform ProductSpecOperation api by passing\"\n + \" null mor\");\n }",
"public void setDescription(String description)\n {\n this.description = description;\n }",
"String description();",
"String description();",
"String description();",
"String description();",
"String description();",
"String description();",
"String description();",
"String description();",
"String description();",
"String description();",
"String description();",
"String description();",
"public void setDescription(String desc) {\n this.desc = desc;\n }"
] | [
"0.7305961",
"0.6963764",
"0.6833702",
"0.68281144",
"0.68043023",
"0.67697346",
"0.67697346",
"0.6766762",
"0.6766762",
"0.67478603",
"0.67478603",
"0.67478603",
"0.67478603",
"0.67478603",
"0.67478603",
"0.67419815",
"0.6734978",
"0.67314845",
"0.66826236",
"0.6663687",
"0.6662631",
"0.66514224",
"0.6649942",
"0.6634292",
"0.6634292",
"0.6634292",
"0.6634292",
"0.6634292",
"0.6634292",
"0.6634292",
"0.6634292",
"0.65965825",
"0.657943",
"0.6577548",
"0.65730983",
"0.65552145",
"0.6554348",
"0.6552892",
"0.6552056",
"0.6549529",
"0.6546098",
"0.6537686",
"0.6537686",
"0.6534064",
"0.6524621",
"0.6517637",
"0.65121824",
"0.6487545",
"0.64858675",
"0.6459592",
"0.6458727",
"0.64424515",
"0.6419835",
"0.6413335",
"0.6405111",
"0.6405111",
"0.6405111",
"0.6405111",
"0.6405111",
"0.6405111",
"0.638315",
"0.638315",
"0.63585806",
"0.6358142",
"0.63577944",
"0.6350992",
"0.63297826",
"0.63297826",
"0.63297826",
"0.63297826",
"0.63297826",
"0.63297826",
"0.63297826",
"0.63297826",
"0.63297826",
"0.6328938",
"0.6328522",
"0.63127124",
"0.6306937",
"0.63060355",
"0.6300228",
"0.62989146",
"0.62924325",
"0.6292341",
"0.6292341",
"0.6278518",
"0.6253523",
"0.62519944",
"0.6234057",
"0.6234057",
"0.6234057",
"0.6234057",
"0.6234057",
"0.6234057",
"0.6234057",
"0.6234057",
"0.6234057",
"0.6234057",
"0.6234057",
"0.6234057",
"0.62263066"
] | 0.0 | -1 |
Returns the diagnostic message. Can be overridden by subclasses to provide a customized diagnostic that includes the name of the invoked method. | protected String getMessage(Name name) {
return message();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getMessage();",
"public String getMessage();",
"public String getMessage();",
"public String getMessage();",
"public String getMessage();",
"public String getMessage();",
"public String getMessage();",
"java.lang.String getMessage();",
"java.lang.String getMessage();",
"java.lang.String getMessage();",
"java.lang.String getMessage();",
"java.lang.String getMessage();",
"java.lang.String getMessage();",
"java.lang.String getMessage();",
"java.lang.String getMessage();",
"java.lang.String getMessage();",
"java.lang.String getMessage();",
"java.lang.String getMessage();",
"java.lang.String getMessage();",
"java.lang.String getMessage();",
"java.lang.String getMessage();",
"java.lang.String getMessage();",
"java.lang.String getMessage();",
"java.lang.String getMessage();",
"@Override\n public String getMessage() {\n return message;\n }",
"@Override\n\tpublic String getMessage() {\n\t\treturn message;\n\t}",
"@Override\n\tpublic String getMessage() {\n\t\treturn message;\n\t}",
"@Override\n public String getMessage() {\n return message;\n }",
"@Override\n public String getMessage()\n {\n return message;\n }",
"String getMessage();",
"String getMessage();",
"String getMessage();",
"@Override\r\n\tpublic String getMessage() {\n\t\treturn this.message;\r\n\t}",
"protected abstract String getMessage();",
"@Override\n public String getMessage() {\n return MESSAGE;\n }",
"public abstract String getMessage();",
"@Override\n public String getMessage()\n {\n return message;\n }",
"public String getMessage() {\n return super.getString(Constants.Properties.MESSAGE);\n }",
"public String getMessage() {\r\n return messageKind.getMessage();\r\n }",
"@Override\n public String getMessage(){\n \n }",
"java.lang.String getTheMessage();",
"public String getMessage() { return message; }",
"public String getMessage () {\n return message;\n }",
"public String getMessage()\r\n\t{\r\n\t\treturn message;\r\n\t}",
"public String getMessage() {\n return null;\n }",
"java.lang.String getMsg();",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage()\n {\n return message;\n }",
"public String getMessage()\n {\n return message;\n }",
"public String getMessage()\r\n {\r\n return message;\r\n }",
"public String getMessage()\r\n {\r\n return message;\r\n }",
"public String getMessage() {\n\t\treturn msg;\n\t}",
"public String getMessage()\n\t{\n\t\treturn msg;\n\t}",
"public String getMessage()\n {\n return super.getMessage()+promo_error+\"not found\";\n }",
"public String getMessage() {\r\n return message;\r\n }",
"public String getMessage() {\r\n return message;\r\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMessage() {\n return message;\n }",
"public String getMethodName() {\n return LOG_TAG + \":\" + this.getClass().getSimpleName() + \".\" + new Throwable().getStackTrace()[1].getMethodName();\n }",
"@Override\n public String getMessage() {\n\n String thisMessage = super.getMessage();\n if (thisMessage != null && args != null && args.length > 0) {\n return MessageFormatter.arrayFormat(thisMessage, args).getMessage();\n }\n\n return thisMessage;\n }",
"public String getMessage() {\r\n\t\treturn message;\r\n\t}",
"public String getMessage() {\r\n\t\treturn message;\r\n\t}",
"public String getMessage() {\r\n\t\treturn message;\r\n\t}",
"public String getMessage() {\r\n\t\treturn message;\r\n\t}",
"String message() {\n if (arguments == null || arguments.length == 0) return message; // most case, message is from exception, and without no arguments\n\n var builder = new StringBuilder(256);\n LogManager.FILTER.append(builder, message, arguments);\n return builder.toString();\n }",
"public String getMessage()\n\t{\n\t\treturn message;\n\t}",
"public String toString() {\n\t\treturn getMessage();\n\t}",
"public String getMessage()\r\n/* 22: */ {\r\n/* 23:23 */ return this.a.a();\r\n/* 24: */ }",
"@Override\n\tpublic String getMessage() {\n\t\treturn null;\n\t}",
"public String getMessage()\n\t\t{\n\t\t\treturn message;\n\t\t}",
"public String getMessage() {\n\t\treturn message;\n\t}",
"public String getMessage() {\n\t\treturn message;\n\t}",
"public String getMessage() {\n\t\treturn message;\n\t}",
"public String simple() {\r\n return super.getMessage();\r\n }",
"public java.lang.String getMessage()\r\n {\r\n return message;\r\n }",
"public java.lang.String getMessage() {\n return message;\n }",
"public String getMessage(){\n return(message);\n }",
"@Accessor(qualifier = \"message\", type = Accessor.Type.GETTER)\n\tpublic String getMessage()\n\t{\n\t\treturn getMessage(null);\n\t}",
"public String getMessage(){\r\n\t\treturn message;\r\n\t}",
"public String getMessage() {\n return getMessage(this.key, (Object[]) null, this.key, (Locale) null);\n }",
"@Override\n\tpublic String getMessage()\n\t{\n\t\treturn errMessage;\n\t}"
] | [
"0.6832378",
"0.6832378",
"0.6832378",
"0.6832378",
"0.6832378",
"0.6832378",
"0.6832378",
"0.6745179",
"0.6745179",
"0.6745179",
"0.6745179",
"0.6745179",
"0.6745179",
"0.6745179",
"0.6745179",
"0.6745179",
"0.6745179",
"0.6745179",
"0.6745179",
"0.6745179",
"0.6745179",
"0.6745179",
"0.6745179",
"0.6745179",
"0.67060477",
"0.6680619",
"0.6680619",
"0.66631657",
"0.6653086",
"0.65947056",
"0.65947056",
"0.65947056",
"0.6563718",
"0.6543815",
"0.65302765",
"0.65208083",
"0.6477395",
"0.64237523",
"0.6415389",
"0.6371888",
"0.63546544",
"0.6331142",
"0.6246921",
"0.62416196",
"0.62285036",
"0.62254816",
"0.6216411",
"0.6216411",
"0.6216411",
"0.6216411",
"0.6214268",
"0.6214268",
"0.62134445",
"0.62134445",
"0.6187272",
"0.61872596",
"0.6184624",
"0.61705303",
"0.61705303",
"0.61699224",
"0.61699224",
"0.61699224",
"0.61699224",
"0.61699224",
"0.61699224",
"0.61699224",
"0.61699224",
"0.61699224",
"0.61699224",
"0.61699224",
"0.61699224",
"0.61699224",
"0.61699224",
"0.61699224",
"0.61699224",
"0.61699224",
"0.61699224",
"0.6169335",
"0.61664826",
"0.61598504",
"0.61598504",
"0.61598504",
"0.61598504",
"0.6153699",
"0.6143368",
"0.6121987",
"0.61201924",
"0.6116282",
"0.61093664",
"0.61025035",
"0.61025035",
"0.61025035",
"0.6101935",
"0.6101744",
"0.6093992",
"0.60903853",
"0.60892355",
"0.6083683",
"0.607241",
"0.605095"
] | 0.6387904 | 39 |
Checks that the return value of a functional interface is void. Note, we do not use ASTHelpers.isVoidType here, return values of Void are actually typechecked. Only voidreturning functions silently ignore return values of any type. | private static boolean functionalInterfaceReturnsObject(Type interfaceType, VisitorState state) {
Type objectType = state.getSymtab().objectType;
return ASTHelpers.isSubtype(
objectType,
ASTHelpers.getUpperBound(
state.getTypes().findDescriptorType(interfaceType).getReturnType(), state.getTypes()),
state);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isVoid()\r\n/* 146: */ {\r\n/* 147:177 */ return false;\r\n/* 148: */ }",
"@Override\n\tpublic Void visit(IsVoid isvoid) {\n\t\tprintIndent(\"isvoid\");\n\t\tindent++;\n\t\tisvoid.expr.accept(this);\n\t\tindent--;\n\t\treturn null;\n\t}",
"public boolean isVoid() {\n\t\treturn false;\n\t}",
"protected static boolean isVoid(DetailAST ast) {\n final DetailAST parameterType = ast.findFirstToken(TokenTypes.TYPE);\n final boolean result;\n final DetailAST identToken = parameterType.getFirstChild();\n result = identToken.getType() == TokenTypes.LITERAL_VOID;\n return result;\n }",
"public boolean isVoid() {\n boolean hasVoid = getKeywords().stream()\n .filter(keyword -> keyword == BuiltinTypeKeyword.VOID)\n .findAny()\n .isPresent();\n\n if (getKeywords().size() > 1) {\n SpecsLogs.msgInfo(\"'void' type has more than one keyword, check if ok: \" + getKeywords());\n }\n\n return hasVoid;\n }",
"public final void mVOID_TYPE() throws RecognitionException {\n try {\n int _type = VOID_TYPE;\n // /Users/benjamincoe/HackWars/C.g:191:2: ( 'void' )\n // /Users/benjamincoe/HackWars/C.g:191:4: 'void'\n {\n match(\"void\"); \n\n\n }\n\n this.type = _type;\n }\n finally {\n }\n }",
"public void noReturnOnVoid() {\n\t\treturn;\n\t}",
"private static boolean validateReturnType(Method method, Class<?> expected) {\n Class<?> returnType = method.getReturnType();\n if (returnType == void.class) {\n return false;\n }\n if (returnType != expected) {\n String expectedType = \"'\" + expected.getName() + \"'\";\n if (expected != void.class) {\n expectedType = \"'void' or \" + expectedType;\n }\n throw new IllegalStateException(method.getDeclaringClass().getName()\n + \".\"\n + method.getName()\n + \" must have return type of \"\n + expectedType);\n }\n return true;\n }",
"public boolean hasVoidSig() {\n for (Mounted mEquip : getMisc()) {\n MiscType mtype = (MiscType) mEquip.getType();\n if (mtype.hasFlag(MiscType.F_VOIDSIG)) {\n // The Mek has Void-Sig\n return true;\n }\n }\n return false;\n }",
"public static <A> Answer<Void> answerVoid(VoidAnswer1<A> answer) {\n return toAnswer(answer);\n }",
"interface MyFirstVoidFunctionalInterface {\n\n public void methodOne();\n\n}",
"public static <A, B> Answer<Void> answerVoid(VoidAnswer2<A, B> answer) {\n return toAnswer(answer);\n }",
"@SuppressWarnings(\"unchecked\")\n private static <T> Collector<T, Void, Void> collectVoid() {\n return (Collector<T, Void, Void>) VOID_COLLECTOR;\n }",
"public final void mT__47() throws RecognitionException {\n\t\ttry {\n\t\t\tint _type = T__47;\n\t\t\tint _channel = DEFAULT_TOKEN_CHANNEL;\n\t\t\t// /Users/probst/workspace/MiniJava_A6/src/compiler/Frontend/MiniJava.g:38:7: ( 'void' )\n\t\t\t// /Users/probst/workspace/MiniJava_A6/src/compiler/Frontend/MiniJava.g:38:9: 'void'\n\t\t\t{\n\t\t\tmatch(\"void\"); \n\n\t\t\t}\n\n\t\t\tstate.type = _type;\n\t\t\tstate.channel = _channel;\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t}",
"public static void asVoid(boolean ignored) {\n\t\t// This method needs to do nothing but swallow the passed value.\n\t}",
"void checkReturnSt (int ln) {\r\n if (!return_type.isVoid ())\r\n OzcError.needReturnSt (ln);\r\n else \r\n need_return = true;\r\n }",
"public final void entryRuleVoidOperation() throws RecognitionException {\n try {\n // InternalBSQL2Java.g:254:1: ( ruleVoidOperation EOF )\n // InternalBSQL2Java.g:255:1: ruleVoidOperation EOF\n {\n before(grammarAccess.getVoidOperationRule()); \n pushFollow(FOLLOW_1);\n ruleVoidOperation();\n\n state._fsp--;\n\n after(grammarAccess.getVoidOperationRule()); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }",
"@Override\n public TypeDescriptor<?> inferType() throws VilException {\n return TypeRegistry.voidType();\n }",
"public static <A, B, C, D, E, F> Answer<Void> answerVoid(VoidAnswer6<A, B, C, D, E, F> answer) {\n return toAnswer(answer);\n }",
"@Override\n public VarTypes getType(Analyzer analyzer) throws InvalidMethodException, InvalidTypeException {\n VarTypes returnType = analyzer.getSignature(callee).getReturnType();\n if (returnType == VarTypes.VOID) {\n throw new InvalidTypeException(VarTypes.VOID.getName());\n }\n return returnType;\n }",
"public final ValidateStateTransitionsParser.voidMethodDeclaration_return voidMethodDeclaration() throws RecognitionException {\r\n ValidateStateTransitionsParser.voidMethodDeclaration_return retval = new ValidateStateTransitionsParser.voidMethodDeclaration_return();\r\n retval.start = input.LT(1);\r\n\r\n int voidMethodDeclaration_StartIndex = input.index();\r\n\r\n CommonTree IDENT3=null;\r\n ValidateStateTransitionsParser_JavaTreeParser.block_return block4 =null;\r\n\r\n\r\n try {\r\n if ( state.backtracking>0 && alreadyParsedRule(input, 293) ) { return retval; }\r\n\r\n // E:\\\\GitHub\\\\CesTa\\\\src\\\\org\\\\cesta\\\\grammars\\\\java\\\\ValidateStateTransitionsParser.g:229:5: ( ^( VOID_METHOD_DECL modifierList ( genericTypeParameterList )? IDENT formalParameterList ( throwsClause )? ( block )? ) )\r\n // E:\\\\GitHub\\\\CesTa\\\\src\\\\org\\\\cesta\\\\grammars\\\\java\\\\ValidateStateTransitionsParser.g:230:9: ^( VOID_METHOD_DECL modifierList ( genericTypeParameterList )? IDENT formalParameterList ( throwsClause )? ( block )? )\r\n {\r\n match(input,VOID_METHOD_DECL,FOLLOW_VOID_METHOD_DECL_in_voidMethodDeclaration533); if (state.failed) return retval;\r\n\r\n match(input, Token.DOWN, null); if (state.failed) return retval;\r\n pushFollow(FOLLOW_modifierList_in_voidMethodDeclaration551);\r\n modifierList();\r\n\r\n state._fsp--;\r\n if (state.failed) return retval;\r\n\r\n // E:\\\\GitHub\\\\CesTa\\\\src\\\\org\\\\cesta\\\\grammars\\\\java\\\\ValidateStateTransitionsParser.g:233:17: ( genericTypeParameterList )?\r\n int alt12=2;\r\n int LA12_0 = input.LA(1);\r\n\r\n if ( (LA12_0==GENERIC_TYPE_PARAM_LIST) ) {\r\n alt12=1;\r\n }\r\n switch (alt12) {\r\n case 1 :\r\n // E:\\\\GitHub\\\\CesTa\\\\src\\\\org\\\\cesta\\\\grammars\\\\java\\\\ValidateStateTransitionsParser.g:233:17: genericTypeParameterList\r\n {\r\n pushFollow(FOLLOW_genericTypeParameterList_in_voidMethodDeclaration569);\r\n genericTypeParameterList();\r\n\r\n state._fsp--;\r\n if (state.failed) return retval;\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n IDENT3=(CommonTree)match(input,IDENT,FOLLOW_IDENT_in_voidMethodDeclaration588); if (state.failed) return retval;\r\n\r\n pushFollow(FOLLOW_formalParameterList_in_voidMethodDeclaration606);\r\n formalParameterList();\r\n\r\n state._fsp--;\r\n if (state.failed) return retval;\r\n\r\n // E:\\\\GitHub\\\\CesTa\\\\src\\\\org\\\\cesta\\\\grammars\\\\java\\\\ValidateStateTransitionsParser.g:236:17: ( throwsClause )?\r\n int alt13=2;\r\n int LA13_0 = input.LA(1);\r\n\r\n if ( (LA13_0==THROWS_CLAUSE) ) {\r\n alt13=1;\r\n }\r\n switch (alt13) {\r\n case 1 :\r\n // E:\\\\GitHub\\\\CesTa\\\\src\\\\org\\\\cesta\\\\grammars\\\\java\\\\ValidateStateTransitionsParser.g:236:17: throwsClause\r\n {\r\n pushFollow(FOLLOW_throwsClause_in_voidMethodDeclaration624);\r\n throwsClause();\r\n\r\n state._fsp--;\r\n if (state.failed) return retval;\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n // E:\\\\GitHub\\\\CesTa\\\\src\\\\org\\\\cesta\\\\grammars\\\\java\\\\ValidateStateTransitionsParser.g:237:17: ( block )?\r\n int alt14=2;\r\n int LA14_0 = input.LA(1);\r\n\r\n if ( (LA14_0==BLOCK_SCOPE) ) {\r\n alt14=1;\r\n }\r\n switch (alt14) {\r\n case 1 :\r\n // E:\\\\GitHub\\\\CesTa\\\\src\\\\org\\\\cesta\\\\grammars\\\\java\\\\ValidateStateTransitionsParser.g:237:17: block\r\n {\r\n pushFollow(FOLLOW_block_in_voidMethodDeclaration643);\r\n block4=block();\r\n\r\n state._fsp--;\r\n if (state.failed) return retval;\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n if ( state.backtracking==0 ) {\r\n functionDetected((IDENT3!=null?IDENT3.getText():null), (CommonTree)(block4!=null?((CommonTree)block4.start):null));\r\n }\r\n\r\n match(input, Token.UP, null); if (state.failed) return retval;\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n if ( state.backtracking>0 ) { memoize(input, 293, voidMethodDeclaration_StartIndex); }\r\n\r\n }\r\n return retval;\r\n }",
"public final void mT__47() throws RecognitionException {\n try {\n int _type = T__47;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalEsm.g:41:7: ( 'VOID' )\n // InternalEsm.g:41:9: 'VOID'\n {\n match(\"VOID\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }",
"public abstract void executeVoid(VirtualFrame frame);",
"public static <A, B, C> Answer<Void> answerVoid(VoidAnswer3<A, B, C> answer) {\n return toAnswer(answer);\n }",
"@Override\r\n\tpublic void visit(ReturnStmtNode returnStatement) {\n\t\texecPathStack.pushFrame();\r\n\t\t\r\n\t\t//Register\r\n\t\tcurOperation.addReturnStmt(returnStatement);\r\n\t\t\r\n\t\t//For later use, we set the function as semantics of this return stmt\r\n\t\treturnStatement.setSemantics(curOperation);\r\n\t\t\r\n\t\tExprNode result = returnStatement.getResult();\r\n\t\t\r\n\t\tif(result!=null){\r\n\t\t\t//Analyze the expression\r\n\t\t\tanalyzeExpression(result);\r\n\t\t\t\r\n\t\t\t//Void function? No return expression allowed!\r\n\t\t\tif(curOperation.getReturnType()==BASIC.VOID)\r\n\t\t\t\tthrow Problem.ofType(ProblemId.RETURNING_VALUE_IN_VOID_METHOD).at(returnStatement)\r\n\t\t\t\t\t\t\t.raiseUnrecoverable();\r\n\t\t\t\t\r\n\t\t\t//Check if the return type is correct\r\n\t\t\tif(!result.getInferedType().canImplicitCastTo(curOperation.getReturnType())){\r\n\t\t\t\tthrow Problem.ofType(ProblemId.TYPE_ERROR_INCOMPATIBLE_RETURN_TYPE).at(returnStatement)\r\n\t\t\t\t\t\t\t.details(curOperation.getReturnType().getFullName(),result.getInferedType().getFullName())\r\n\t\t\t\t\t\t\t.raiseUnrecoverable();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t} else {\r\n\t\t\t//Void return\r\n\t\t\tif(curOperation.getReturnType()!=BASIC.VOID)\r\n\t\t\t\tthrow Problem.ofType(ProblemId.RETURN_WITHOUT_VALUE).at(returnStatement)\r\n\t\t\t\t\t\t\t.raiseUnrecoverable();\r\n\t\t}\r\n\r\n\t}",
"@Override\r\n\tpublic boolean voidIt() {\n\t\treturn false;\r\n\t}",
"@Override\n public boolean isVoidSigActive() {\n if (!isShutDown()) {\n for (Mounted m : getMisc()) {\n EquipmentType type = m.getType();\n if (type.hasFlag(MiscType.F_VOIDSIG) && m.curMode().equals(\"On\") && m.isReady()) {\n return true;\n }\n }\n }\n return false;\n }",
"public static <A, B, C, D> Answer<Void> answerVoid(VoidAnswer4<A, B, C, D> answer) {\n return toAnswer(answer);\n }",
"@Override\n protected void validatePublicVoidNoArgMethods(Class<? extends Annotation> annotation, boolean isStatic,\n List<Throwable> errors) {\n List<FrameworkMethod> methods = getTestClass().getAnnotatedMethods(annotation);\n for (FrameworkMethod eachTestMethod : methods) {\n eachTestMethod.validatePublicVoid(isStatic, errors);\n }\n }",
"public static native void staticVoid();",
"@Test\n void nullProblem() {\n var x = (Void) null;\n var z = (String) null;\n System.out.println(x + \", \" + z);\n }",
"final /* synthetic */ void m65927a(Void voidR) {\n this.f56359a.m56689p();\n }",
"VoidOperation createVoidOperation();",
"public static void typeCheckReturn(PegObject node) {\n\t\tSymbolTable gamma = node.getSymbolTable();\n\t\tDefinedNameFunctor f = gamma.getName(\"return\");\n\t\tBunType returnType = f.getReturnType(BunType.UntypedType);\n\t\tSystem.out.println(\"returnType=\"+returnType);\n\t\tgamma.checkTypeAt(node, 0, returnType, false);\n\t}",
"private String addVoid() {\n\t\t// NO PARAMETERS\n\t\tStringBuilder tag = new StringBuilder();\n\t\ttag.append(\"VOID:VOID\");\n\t\treturn tag.toString();\n\n\t}",
"public interface wkhtmltoimage_void_callback extends Callback {\n\t\tvoid apply(Pointer converter);\n\t}",
"public void setVoidColor(int voidColor) {\n this.voidColor = voidColor;\n }",
"@Override\n public String visit(VoidType n, Object arg) {\n return null;\n }",
"public VoidElementStyle getVoidElementStyle() {\n return voidElementStyle;\n }",
"public static void typeCheckBlock(PegObject node) {\n\t\tSymbolTable gamma = node.getSymbolTable();\n\t\tfor(int i = 0; i < node.size(); i++) {\n\t\t\tgamma.checkTypeAt(node, i, BunType.VoidType, false);\n\t\t}\n\t\tDefinedNameFunctor f = gamma.getName(\"return\");\n\t\tBunType returnType = f.getReturnType(BunType.UntypedType);\n\t\tSystem.out.println(\"returnType=\"+returnType);\n\t\tgamma.checkTypeAt(node, 0, returnType, false);\n\t}",
"public Node typeCheck () {\n\tif (declist!=null) \n\t for (Node dec:declist)\n\t\tdec.typeCheck();\n if ( !(FOOLlib.isSubtype(body.typeCheck(),type)) ){\n System.out.println(\"Wrong return type for function \"+id);\n System.exit(0);\n } \n return null;\n }",
"public Type typeCheck(){\n\tType fnType = myId.sym().getType();\n\tboolean result = true;\n\tif(!(fnType instanceof FnType)){\n\t myId.typeCheckError(\"Attempt to call a non-function\");\n\t result = false;\n\t}else{ // it is a function call\n\t FnSym fs = (FnSym)myId.sym();\n\t List<Type> declFormal = fs.getParamTypes();\n\t List<ExpNode> callFormal = myExpList.getCallExpList();\n\t if(declFormal.size() != callFormal.size()){\n\t\tmyId.typeCheckError(\"Function call with wrong number of args\");\n\t\tresult = false;\n\t }else{ // check each type \n\t\tint s = declFormal.size();\n\t\tfor(int i = 0; i < s; i++){\n\t\t Type callType = callFormal.get(i).typeCheck();\n\t\t Type declType = declFormal.get(i);\n\n\t\t String callTypeName = callType.toString();\n\t\t String declTypeName = declType.toString();\n\t\t if(!(callTypeName.equals(declTypeName))){\n\t\t\tIdNode fId = callFormal.get(i).getExpFirstIdNode();\n\t\t\tfId.typeCheckError(\"Type of actual does not match type of formal\");\n\t\t\tresult = false;\n\t\t }\n\t\t}\n\t }\n\t}\n\n\tif(fnType instanceof FnType)\n\t return ((FnSym)(myId.sym())).getReturnType();\n\telse\n\t return new ErrorType();\n\t// if(result == true){\n\t// return ((FnSym)(myId.sym())).getReturnType();\n\t// }else{\n\t// return new ErrorType();\n\t// }\n\n }",
"public interface VoidCommandHandler<S extends State, C extends Command>\n extends CommandHandler<S, C, Event> {\n\n /**\n * Handle a command without returning an event.\n *\n * @param state The current state object.\n * @param command The command object to handle.\n */\n void handle(S state, C command);\n\n}",
"public static <A, B, C, D, E> Answer<Void> answerVoid(VoidAnswer5<A, B, C, D, E> answer) {\n return toAnswer(answer);\n }",
"@Override\n public void call(Void aVoid) {\n\n }",
"private void int_to_void_step( ExpressionNode nd, VMState vms ) {\n Assert.check( vms.top().at( nd ) == null ) ;\r\n \r\n // Clear the selection\r\n vms.top().setSelected( null ) ;\r\n \r\n // Get the operand value\r\n long x = getIntOperand( nd, vms, 0 ) ;\r\n \r\n // Compute the value\r\n switch( op_code ) {\r\n case SRAND :\r\n if( random == null ) random = new java.util.Random(1) ;\r\n random.setSeed( x ) ;\r\n case ASSERT :\r\n if( x== 0 ) {\r\n // Assertion tripped.\r\n // The TM will throw an error.\r\n SourceCoords sc = vms.getCurrentCoords() ;\r\n vms.getConsole().putString(\"Assertion failed at \"+sc.toString()+\"\\n\") ;\r\n vms.setEvaluationState( vms.EVALUATION_STATE_TERMINATED ) ;\r\n }\r\n break ;\r\n default: Assert.check(false) ;\r\n }\r\n/* \r\n // New datum on scratch\r\n Clc_ASTUtilities util\r\n = (Clc_ASTUtilities) vms.getProperty(\"ASTUtilities\") ;\r\n AbstractDatum d\r\n = util.scratchDatum(nd.get_type(), vms) ;\r\n \r\n vms.top().map(nd, d) ; */\r\n putVoidResult(nd, vms);\r\n }",
"public final void ruleVoidOperation() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalBSQL2Java.g:266:2: ( ( ( rule__VoidOperation__Group__0 ) ) )\n // InternalBSQL2Java.g:267:2: ( ( rule__VoidOperation__Group__0 ) )\n {\n // InternalBSQL2Java.g:267:2: ( ( rule__VoidOperation__Group__0 ) )\n // InternalBSQL2Java.g:268:3: ( rule__VoidOperation__Group__0 )\n {\n before(grammarAccess.getVoidOperationAccess().getGroup()); \n // InternalBSQL2Java.g:269:3: ( rule__VoidOperation__Group__0 )\n // InternalBSQL2Java.g:269:4: rule__VoidOperation__Group__0\n {\n pushFollow(FOLLOW_2);\n rule__VoidOperation__Group__0();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getVoidOperationAccess().getGroup()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"@Override\n\tpublic boolean javaMethodBaseWithBooleanRet() {\n\t\treturn false;\n\t}",
"public native void instanceVoid();",
"BrainTreeVoidResult voidTransaction(VoidRequest voidRequest);",
"@Override\n protected void runReturnAnnotationHandler() {\n checkContainsAny(MSG_RETURN_VALUE_WITH_NONNULL_BY_DEFAULT,\n NullnessAnnotation.RETURN_VALUES_ARE_NONNULL_BY_DEFAULT);\n checkContainsAny(MSG_RETURN_VALUE_WITH_NULLABLE,\n NullnessAnnotation.NULLABLE);\n checkContainsAll(MSG_CONTRADICTING_RETURN_VALUE_ANNOTATIONS, NullnessAnnotation.NONNULL,\n NullnessAnnotation.CHECK_FOR_NULL);\n checkContainsAll(MSG_OVERRIDDEN_METHOD_WITH_CHECK_RETURN_VALUE,\n NullnessAnnotation.CHECK_RETURN_VALUE, NullnessAnnotation.OVERRIDE);\n checkRedundancyDueToClassLevelAnnotation(MSG_REDUNDANT_NONNULL_BY_DEFAULT_ANNOTATION,\n NullnessAnnotation.PARAMETERS_ARE_NONNULL_BY_DEFAULT);\n checkRedundancyDueToClassLevelAnnotation(MSG_REDUNDANT_NULLABLE_BY_DEFAULT_ANNOTATION,\n NullnessAnnotation.PARAMETERS_ARE_NULLABLE_BY_DEFAULT);\n\n final DetailAST ast = getAst();\n if (isVoid(ast)) {\n checkContainsAny(MSG_VOID_WITH_CHECK_RETURN_VALUE_ANNOTATION,\n NullnessAnnotation.CHECK_RETURN_VALUE);\n }\n if (isPrimitiveType(ast)) {\n checkContainsAny(MSG_PRIMITIVES_WITH_NULLNESS_ANNOTATION,\n NullnessAnnotation.CHECK_FOR_NULL, NullnessAnnotation.NONNULL,\n NullnessAnnotation.NULLABLE);\n }\n else {\n final NullnessAnnotation annotation = getParentMethodOrClassAnnotation(\n NullnessAnnotation.RETURN_VALUES_ARE_NONNULL_BY_DEFAULT);\n final boolean returnValuesAreNonnullByDefault = annotation\n == NullnessAnnotation.RETURN_VALUES_ARE_NONNULL_BY_DEFAULT;\n final boolean isMethodOverridden = isMethodOverridden();\n\n if (returnValuesAreNonnullByDefault) {\n if (!isMethodOverridden) {\n checkContainsAny(MSG_REDUNDANT_NONNULL_RETURN_ANNOTATION,\n NullnessAnnotation.NONNULL);\n }\n }\n else {\n checkContainsNone(MSG_RETURN_WITHOUT_NULLNESS_ANNOTATION,\n NullnessAnnotation.CHECK_FOR_NULL, NullnessAnnotation.NONNULL,\n NullnessAnnotation.OVERRIDE);\n }\n\n if (isMethodOverridden && !allowOverridingReturnValue) {\n checkContainsAny(MSG_OVERRIDDEN_METHODS_ALLOW_ONLY_NONNULL,\n NullnessAnnotation.CHECK_FOR_NULL, NullnessAnnotation.NULLABLE);\n }\n\n if (isMethodOverridden) {\n checkContainsAny(MSG_NEED_TO_INHERIT_PARAM_ANNOTATIONS,\n NullnessAnnotation.PARAMETERS_ARE_NONNULL_BY_DEFAULT);\n }\n }\n }",
"public boolean isSetReturnType() {\n return this.returnType != null;\n }",
"Rule FunctionType() {\n // Push 1 FunctionType node onto the value stack\n return Sequence(\n FirstOf(\n FieldType(),\n Sequence(\"void \", push(new VoidNode()))),\n actions.pushFunctionTypeNode());\n }",
"public void outAReturnStmt(AReturnStmt node) throws TypeException{\n PExp exp = node.getExp();\n \n if(exp==null){\n if (!(funcReturnType == null)) throw new TypeException(\"[line \" + golite.weeder.LineNumber.getLineNumber(node) + \"] Empty return statement in a non-void function.\");\n }\n else {\n Type exptype = typemap.get(exp);\n if (!areSameType(exptype,funcReturnType)) throw new TypeException(\"[line \" + golite.weeder.LineNumber.getLineNumber(node) + \"] Return type and enclosing function type do not match.\");\n }\n \n }",
"public final void mVOID_KW() throws RecognitionException {\n\t\ttry {\n\t\t\tint _type = VOID_KW;\n\t\t\tint _channel = DEFAULT_TOKEN_CHANNEL;\n\t\t\t// src/VSLLexer.g:30:11: ( 'VOID' )\n\t\t\t// src/VSLLexer.g:30:13: 'VOID'\n\t\t\t{\n\t\t\tmatch(\"VOID\"); \n\n\t\t\t}\n\n\t\t\tstate.type = _type;\n\t\t\tstate.channel = _channel;\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t}",
"public void any_type() {\n if (var_type()) {\n return;\n }\n if (lexer.token != Symbol.VOID) {\n error.signal(\"Wrong type\");\n }\n lexer.nextToken();\n }",
"public boolean isPerformingCompletion() {\n/* 545 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\n\tpublic boolean validate(Object value) {\n\t\treturn value instanceof GenericFunction\n\t\t\t\t&& ((GenericFunction) value).getType().canUnify(this);\n\t}",
"public void visit(StatementNoReturnExpr statementNoReturnExpr) {\n \tif (currentMethod == null) {\r\n\t\t\treport_error(\"Greska na liniji \" + statementNoReturnExpr.getLine() + \" : \" + \" RETURN iskaz ne sme postojati izvan tela globalnih f-ja!\" + currentMethod.getName(), null);\r\n \t}\r\n \telse { \r\n\t \tStruct currMethType = currentMethod.getType();\r\n\t \tif(!currMethType.compatibleWith(Tab.noType)){\r\n\t\t\t\treport_error(\"Greska na liniji \" + statementNoReturnExpr.getLine() + \" : \" + \" Tekuca metoda nije deklarisana kao VOID! \" + currentMethod.getName(), null);\r\n\t \t}\r\n \t}\r\n }",
"ExecutionResult<Void> execute();",
"public boolean isCheckable() {\n/* 738 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"private void encodeVoid(Encoder encoder) throws IOException {\n\t\tencoder.openElement(ELEM_VOID);\n\t\tencoder.closeElement(ELEM_VOID);\n\t}",
"@Override\n boolean test(@NonNull T t);",
"static boolean finalConstVarVoidOrType(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"finalConstVarVoidOrType\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = finalConstVarVoidOrType_0(b, l + 1);\n if (!r) r = finalConstVarVoidOrType_1(b, l + 1);\n if (!r) r = finalConstVarVoidOrType_2(b, l + 1);\n if (!r) r = finalConstVarVoidOrType_3(b, l + 1);\n if (!r) r = finalConstVarVoidOrType_4(b, l + 1);\n if (!r) r = type(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }",
"private boolean isFunction(Tip t, Tip expectedRet) {\n\t\tif (t instanceof Funkcija) {\n\t\t\tFunkcija buff = (Funkcija) t;\n\t\t\tif (buff.primitiv.equals(expectedRet.primitiv)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"@Override\n\tpublic <R> R traceExit(R result) {\n\t\treturn null;\n\t}",
"public void noReturn() {\n\t\tSystem.out.println(\"noReturn method will not returing any thing\");\n\t}",
"private boolean isCallback(IMethodResult result)\n\t{\n\t\treturn (result != null && result.hasCallback());\n\t}",
"public VariType visit(IfStatement n, Table argu) {\n\t VariType _ret=null;\n\t n.f0.accept(this, argu);\n\t n.f1.accept(this, argu);\n\t VariType t2 = n.f2.accept(this, argu);\n\t if(t2.type != \"Boolean\") {\n\t \t PrintError.errorexist = true;\n\t \t String emsg = \"expression in If Statement does not match type Boolean\";\n\t \t PrintError.print(emsg, n.f1.beginLine, n.f1.beginColumn, 1);\n\t }\n\t n.f3.accept(this, argu);\n\t n.f4.accept(this, argu);\n\t n.f5.accept(this, argu);\n\t n.f6.accept(this, argu);\n\t return _ret;\n\t }",
"@Override\n public <A> Function1<Object, A> andThen$mcVI$sp (Function1<BoxedUnit, A> arg0)\n {\n return null;\n }",
"public final void rule__BSOperation__VopAssignment_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalBSQL2Java.g:3183:1: ( ( ruleVoidOperation ) )\n // InternalBSQL2Java.g:3184:2: ( ruleVoidOperation )\n {\n // InternalBSQL2Java.g:3184:2: ( ruleVoidOperation )\n // InternalBSQL2Java.g:3185:3: ruleVoidOperation\n {\n before(grammarAccess.getBSOperationAccess().getVopVoidOperationParserRuleCall_1_0()); \n pushFollow(FOLLOW_2);\n ruleVoidOperation();\n\n state._fsp--;\n\n after(grammarAccess.getBSOperationAccess().getVopVoidOperationParserRuleCall_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public static boolean untypedFunctionType(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"untypedFunctionType\")) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_, UNTYPED_FUNCTION_TYPE, \"<untyped function type>\");\n r = functionId(b, l + 1);\n r = r && untypedFunctionType_1(b, l + 1);\n r = r && parameterTypeList(b, l + 1);\n r = r && untypedFunctionType_3(b, l + 1);\n exit_section_(b, l, m, r, false, null);\n return r;\n }",
"private boolean hasReturn(Parameter[] parameters) {\n boolean hasReturn = false;\n if (parameters.length != 0) {\n Parameter lastParam = parameters[parameters.length - 1];\n DataType type = lastParam.getType();\n hasReturn = (lastParam.getDirection() == Direction.OUT\n && (type == DataType.OBJECT_T || type == DataType.PSCO_T || type == DataType.EXTERNAL_OBJECT_T));\n }\n\n return hasReturn;\n }",
"@Override\n public IType typeCheck() throws TypeException {\n ArrayList<IType> paramsType = new ArrayList<>();\n for (ParameterNode param : parameterNodeArrayList) {\n paramsType.add(param.getType());\n }\n\n //typecheck di ogni dichiarazione\n if (declarationsArrayList.size() > 0) {\n for (INode dec : declarationsArrayList) {\n dec.typeCheck();\n }\n }\n\n //controllo che il corpo ritorni il tipo dichiarato dalla funzione\n IType bodyType = body.typeCheck();\n\n if (!bodyType.isSubType(returnType)) {\n String fun = \"della funzione\";\n if (this instanceof MethodNode) {\n fun = \"del metodo\";\n }\n throw new TypeException(\"Il tipo restituito dal corpo \" + fun + \" '\" + idFunzione + \"' è '\" + body.typeCheck().toPrint() + \"'. Il tipo richiesto è '\" + returnType.toPrint() + \"'\\n\", parserRuleContext);\n }\n\n return new FunType(paramsType, returnType);\n }",
"public void visitIRETURN(IRETURN o){\n\t\tif (stack().peek() != Type.INT){\n\t\t\tconstraintViolated(o, \"The value at the stack top is not of type 'int', but of type '\"+stack().peek()+\"'.\");\n\t\t}\n\t}",
"void success(T t);",
"@NonBlocking\n void success(T value);",
"@Override\n public Value<Void> evaluate(ValueReferenceResolver valueRefResolver) {\n return null;\n }",
"public VariType visit(NotExpression n, Table argu) { \n\t VariType _ret = new VariType();\n\t n.f0.accept(this, argu);\n\t VariType t1 = n.f1.accept(this, argu);\n\t if(t1.type != \"Boolean\") {\n\t \t PrintError.errorexist = true;\n\t \t String emsg = \"variable type does not match, variable has type \"+t1.type+\", expect type Boolean\";\n\t \t PrintError.print(emsg, n.f0.beginLine, n.f0.beginColumn, 1);\n\t }\n\t _ret.type = \"Boolean\";\n\t return _ret;\n\t }",
"public boolean validateInput() {\n/* 158 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\n public Object fileKey() {\n return Void.TYPE;\n }",
"@FunctionalInterface\n public interface PReturn {\n\n //functional interfaces: one abstract method, as many instance or static methods as you'd like.\n public int returnInt(int x);\n //public abstract int returnInt2(String x);\n\n //new to java 8: default methods (cannot be used with @FunctionalInterfaces\n //public default int returnInt(int x) { return x; }\n\n //new to java 8: static methods now in interfaces\n public static boolean isIReturn(Object obj) { return obj instanceof IReturn; }\n}",
"@Override public abstract boolean test(T t);",
"public boolean isDone()\r\n/* 69: */ {\r\n/* 70:106 */ return isDone0(this.result);\r\n/* 71: */ }",
"private static boolean isDone0(Object result)\r\n/* 74: */ {\r\n/* 75:110 */ return (result != null) && (result != UNCANCELLABLE);\r\n/* 76: */ }",
"@Override\n\tpublic <R> R exit(R result) {\n\t\treturn null;\n\t}",
"@Override\r\n public void shiftVoid() throws ParserException\r\n {\r\n changeToState(new MDJ_12());\r\n }",
"@Override\n\tpublic void failed(Throwable arg0, Void arg1) {\n\t}",
"@Override\n\tpublic void failed(Throwable arg0, Void arg1) {\n\t}",
"public final void mT__89() throws RecognitionException {\n try {\n int _type = T__89;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:157:7: ( 'void' )\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:157:9: 'void'\n {\n match(\"void\"); if (state.failed) return ;\n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }",
"public boolean hasResult()\n/* */ {\n/* 119 */ return this.result != RESULT_NONE;\n/* */ }",
"public static void main(String[] args) {\n\t\t void_return obj=new void_return();\n\t\t obj.run(5);\n\t\t \n\t\t\n\t}",
"public int getVoidColor() {\n return voidColor;\n }",
"public final boolean func_boolean_a(int var1, int var2) {\n if (this.func_boolean_b(var1, var2)) {\n return true;\n } else if (var2 != 53 && var1 != 8) {\n if (var2 == -8) {\n super.field_class_cb_a.func_void_a(this.field_byte_c, (byte)0);\n return true;\n } else {\n return true;\n }\n } else {\n super.field_class_cb_a.func_void_a(this.field_byte_c, (byte)1);\n return true;\n }\n }",
"private boolean check(TokenType tokType) {\r\n if(tokens.get(position).returnType() != tokType) {\r\n return false;\r\n }\r\n return true;\r\n }",
"boolean isFail();",
"public static int methodWithoutReturn(){\n throw new Error();\n }",
"void acceptOrThrow(T t, U u, V v) throws Throwable;",
"public void visitRET(RET o){\n\t\tif (! (locals().get(o.getIndex()) instanceof ReturnaddressType)){\n\t\t\tconstraintViolated(o, \"Expecting a ReturnaddressType in local variable \"+o.getIndex()+\".\");\n\t\t}\n\t\tif (locals().get(o.getIndex()) == ReturnaddressType.NO_TARGET){\n\t\t\tthrow new AssertionViolatedException(\"Oops: RET expecting a target!\");\n\t\t}\n\t\t// Other constraints such as non-allowed overlapping subroutines are enforced\n\t\t// while building the Subroutines data structure.\n\t}",
"public final List<String> field_type_list() throws RecognitionException {\n List<String> types = null;\n\n\n TreeRuleReturnScope nonvoid_type_descriptor76 = null;\n\n\n types = Lists.newArrayList();\n\n try {\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:496:3: ( ( nonvoid_type_descriptor )* )\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:496:5: ( nonvoid_type_descriptor )*\n {\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:496:5: ( nonvoid_type_descriptor )*\n loop17:\n while (true) {\n int alt17 = 2;\n int LA17_0 = input.LA(1);\n if ((LA17_0 == ARRAY_DESCRIPTOR || LA17_0 == CLASS_DESCRIPTOR || LA17_0 == PRIMITIVE_TYPE)) {\n alt17 = 1;\n }\n\n switch (alt17) {\n case 1:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:497:7: nonvoid_type_descriptor\n {\n pushFollow(FOLLOW_nonvoid_type_descriptor_in_field_type_list1156);\n nonvoid_type_descriptor76 = nonvoid_type_descriptor();\n state._fsp--;\n\n\n types.add((nonvoid_type_descriptor76 != null ? ((smaliTreeWalker.nonvoid_type_descriptor_return) nonvoid_type_descriptor76).type : null));\n\n }\n break;\n\n default:\n break loop17;\n }\n }\n\n }\n\n } catch (RecognitionException re) {\n reportError(re);\n recover(input, re);\n } finally {\n // do for sure before leaving\n }\n return types;\n }"
] | [
"0.7338525",
"0.7090846",
"0.6923611",
"0.6904331",
"0.68359965",
"0.6519872",
"0.6313081",
"0.6034157",
"0.6026793",
"0.59184957",
"0.58014435",
"0.5787486",
"0.57377505",
"0.56927747",
"0.5690934",
"0.567088",
"0.55985177",
"0.5589934",
"0.54779536",
"0.54474443",
"0.5431887",
"0.5358955",
"0.53483295",
"0.5337298",
"0.5206505",
"0.51962763",
"0.5171452",
"0.5170961",
"0.5155336",
"0.5111694",
"0.5104931",
"0.5098025",
"0.5047956",
"0.50379974",
"0.5012686",
"0.49996462",
"0.49759468",
"0.49697796",
"0.49496374",
"0.4899825",
"0.48886973",
"0.48743796",
"0.48618224",
"0.48574772",
"0.48532492",
"0.48137698",
"0.4805451",
"0.48048773",
"0.47639775",
"0.47529435",
"0.47489122",
"0.46925727",
"0.46878365",
"0.46794197",
"0.4654586",
"0.4625716",
"0.4579098",
"0.45761383",
"0.45634723",
"0.4561963",
"0.45489562",
"0.45454705",
"0.45422858",
"0.4525949",
"0.451813",
"0.4515262",
"0.4484484",
"0.44767892",
"0.4475818",
"0.4470584",
"0.44704238",
"0.44684133",
"0.44517604",
"0.44385868",
"0.44340667",
"0.44278166",
"0.4425215",
"0.44198638",
"0.44193095",
"0.44142658",
"0.44014278",
"0.43985754",
"0.43855727",
"0.4385207",
"0.43846238",
"0.43746448",
"0.43685782",
"0.4354797",
"0.4354797",
"0.43490684",
"0.43426362",
"0.43280065",
"0.43270075",
"0.43262482",
"0.43252623",
"0.4316646",
"0.43144497",
"0.4310718",
"0.43084398",
"0.4300725"
] | 0.4659374 | 54 |
Returning a type from a lambda or method that returns Object loses the type information. | @Override
public Description matchReturn(ReturnTree tree, VisitorState state) {
Optional<Type> optionalType = lostType(state);
if (!optionalType.isPresent()) {
return Description.NO_MATCH;
}
Type objectType = state.getSymtab().objectType;
Type lostType = optionalType.get();
Type resultType = ASTHelpers.getResultType(tree.getExpression());
if (resultType == null) {
return Description.NO_MATCH;
}
if (resultType.getKind() == TypeKind.NULL || resultType.getKind() == TypeKind.NONE) {
return Description.NO_MATCH;
}
if (ASTHelpers.isSubtype(resultType, lostType, state)) {
// Traverse enclosing nodes of this return tree until either a lambda or a Method is reached.
for (Tree enclosing : state.getPath()) {
if (enclosing instanceof MethodTree) {
MethodTree methodTree = (MethodTree) enclosing;
MethodSymbol symbol = ASTHelpers.getSymbol(methodTree);
if (ASTHelpers.isSubtype(objectType, symbol.getReturnType(), state)
&& !isExemptedInterfaceMethod(symbol, state)) {
return buildDescription(tree)
.setMessage(
lostTypeMessage(resultType.toString(), symbol.getReturnType().toString()))
.build();
} else {
break;
}
}
if (enclosing instanceof LambdaExpressionTree) {
LambdaExpressionTree lambdaTree = (LambdaExpressionTree) enclosing;
if (isObjectReturningLambdaExpression(lambdaTree, state)) {
return buildDescription(tree)
.setMessage(lostTypeMessage(resultType.toString(), "Object"))
.build();
} else {
break;
}
}
}
}
return Description.NO_MATCH;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"TypeRef getType();",
"static Object resolveGeneric (FXLocal.Context context, Type typ) {\n if (typ instanceof ParameterizedType) {\n ParameterizedType ptyp = (ParameterizedType) typ;\n Type raw = ptyp.getRawType();\n Type[] targs = ptyp.getActualTypeArguments();\n if (raw instanceof Class) {\n String rawName = ((Class) raw).getName();\n if (FXClassType.SEQUENCE_CLASSNAME.equals(rawName) &&\n targs.length == 1) {\n return new FXSequenceType(context.makeTypeRef(targs[0]));\n }\n if (FXClassType.OBJECT_VARIABLE_CLASSNAME.equals(rawName) &&\n targs.length == 1) {\n return context.makeTypeRef(targs[0]);\n }\n if (FXClassType.SEQUENCE_VARIABLE_CLASSNAME.equals(rawName) &&\n targs.length == 1) {\n return new FXSequenceType(context.makeTypeRef(targs[0]));\n }\n if (rawName.startsWith(FXClassType.FUNCTION_CLASSNAME_PREFIX)) {\n FXType[] prtypes = new FXType[targs.length-1];\n for (int i = prtypes.length; --i >= 0; )\n prtypes[i] = context.makeTypeRef(targs[i+1]);\n FXType rettype;\n if (targs[0] == java.lang.Void.class)\n rettype = FXPrimitiveType.voidType;\n else\n rettype = context.makeTypeRef(targs[0]);\n return new FXFunctionType(prtypes, rettype);\n }\n }\n \n typ = raw;\n }\n if (typ instanceof WildcardType) {\n WildcardType wtyp = (WildcardType) typ;\n Type[] upper = wtyp.getUpperBounds();\n Type[] lower = wtyp.getLowerBounds();\n typ = lower.length > 0 ? lower[0] : wtyp.getUpperBounds()[0];\n if (typ instanceof Class) {\n String rawName = ((Class) typ).getName();\n // Kludge, because generics don't handle primitive types.\n FXType ptype = context.getPrimitiveType(rawName);\n if (ptype != null)\n return ptype;\n }\n return context.makeTypeRef(typ);\n }\n if (typ instanceof GenericArrayType) {\n FXType elType = context.makeTypeRef(((GenericArrayType) typ).getGenericComponentType());\n return new FXJavaArrayType(elType);\n }\n if (typ instanceof TypeVariable) {\n // KLUDGE\n typ = Object.class;\n }\n return typ;\n }",
"public abstract S castToReturnType(T o);",
"@Override\n\tpublic Type getType() {\n\t\treturn heldObj.getType();\n\t}",
"abstract public Type type();",
"@Override\n public Class<?> getObjectType() {\n return this.type;\n }",
"public abstract Type getType();",
"abstract public Type getType();",
"public T caseType(Type object) {\r\n\t\treturn null;\r\n\t}",
"public Type getType();",
"public Type unwrap() {\n return this;\n }",
"@Override\n public Class<Object> getObjectType() {\n return Object.class;\n }",
"public T caseType(Type object) {\n\t\treturn null;\n\t}",
"Type createType();",
"Type createType();",
"Type createType();",
"Type type();",
"Type type();",
"public abstract Type getSpecializedType(Type type);",
"MethodInvocation getImplicitInvocationType();",
"Type getReturnType();",
"public Class returnedClass();",
"protected LightweightTypeReference getLightweightType(XExpression expr) {\n\t\tfinal IResolvedTypes resolvedTypes = getResolvedTypes(expr);\n\t\tfinal LightweightTypeReference expressionType = resolvedTypes.getActualType(expr);\n\t\tif (expr instanceof AnonymousClass) {\n\t\t\tfinal List<LightweightTypeReference> superTypes = expressionType.getSuperTypes();\n\t\t\tif (superTypes.size() == 1) {\n\t\t\t\treturn superTypes.get(0);\n\t\t\t}\n\t\t}\n\t\treturn expressionType;\n\t}",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"public Class getType();",
"public T caseMakerType(MakerType object)\n {\n return null;\n }",
"type getType();",
"public Object elConvertType(Object value);",
"public JavaType getType() { return _type; }",
"@Override\n\tpublic Object visitType(Type type) {\n\t\treturn null;\n\t}",
"public String typeOf() { return null; }",
"@Override\n public TypeDescriptor<?> inferType() throws VilException {\n return TypeRegistry.voidType();\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic Class getObjectType()\n\t{\n\t\tObject obj = getObject();\n\t\tif (obj == null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\treturn obj.getClass();\n\t}",
"public Type toType() {\n return type;\n }",
"public ITypeInfo getReturnType();",
"<T> T convert(Object o, Class<T> type);",
"@Override\n\tpublic T getType() {\n\t\treturn this.type;\n\t}",
"public abstract JavaType resolveType(java.lang.reflect.Type jdkType);",
"public Class getType();",
"@Nullable\n @Override\n public PyType getGenericType(@NotNull PyClass cls, @NotNull TypeEvalContext context) {\n final PyFunction init = cls.findInitOrNew(true, context);\n if (init != null) {\n final PyCallableType callableType = PyUtil.as(context.getType(init), PyCallableType.class);\n if (callableType != null) {\n final PyType returnType = PyUtil.as(callableType.getReturnType(context), PyCollectionType.class);\n if (returnType != null) {\n return returnType;\n }\n }\n }\n\n return null;\n }",
"@Override\n\tpublic Object convert(Class<?> desiredType, Object in) throws Exception {\n\t\treturn null;\n\t}",
"@NotNull\n abstract public Type getType();",
"@Override\n public Type getType() {\n return null;\n }",
"@Override\n TypeInformation<T> getProducedType();",
"public Expression getType();",
"Object convert(Object source, TypeToken<?> targetTypeToken);",
"public T caseTypeDefinition(TypeDefinition object)\n {\n return null;\n }",
"public abstract Class<T> targetType();",
"public Type getType() {\n @SuppressWarnings(\"deprecation\")\n Type result = Type.valueOf(type_);\n return result == null ? Type.UNRECOGNIZED : result;\n }",
"@Ignore\n @Test\n public void untypedLambda2() {\n DependentLink A = param(\"A\", Universe(0));\n DependentLink params = params(A, param(\"B\", Pi(Reference(A), Universe(0))), param(\"a\", Reference(A)));\n Expression type = Pi(params, Apps(Reference(params.getNext()), Reference(params.getNext().getNext())));\n List<Binding> context = new ArrayList<>();\n context.add(new TypedBinding(\"f\", type));\n\n CheckTypeVisitor.Result result = typeCheckExpr(context, \"\\\\lam x1 x2 x3 => f x1 x2 x3\", null);\n assertEquals(type, result.type);\n }",
"public IClass getType() {\n IClass result = null;\n if (_javaMethod.getReturnType().isArray()) {\n result = new ArrayDef(new ExternalClass(_javaMethod.getReturnType().getComponentType()));\n }\n else {\n result = new ExternalClass(_javaMethod.getReturnType());\n }\n\n return result;\n }",
"Class<?> getType();",
"Class<?> getType();",
"Class<?> getType();",
"public Object getType()\r\n {\r\n\treturn type;\r\n }",
"Class<?> type();",
"private Type type()\r\n {\r\n Type t = new Type();\r\n\r\n t.ident = nextToken;\r\n t.type = basicType();\r\n if (t.type == Keyword.NONESY)\r\n {\r\n unresolved.add(t.ident.string = qualident());\r\n }\r\n else\r\n t.ident.string = null;\r\n\r\n t.dim = bracketsOpt();\r\n\r\n return t;\r\n }",
"public Object\n call() throws Exception { \n final ConstArray<?> argv;\n try {\n argv = deserialize(m,\n ConstArray.array(lambda.getGenericParameterTypes()));\n } catch (final BadSyntax e) {\n /*\n * strip out the parsing information to avoid leaking\n * information to the application layer\n */ \n throw (Exception)e.getCause();\n }\n \n // AUDIT: call to untrusted application code\n final Object r = Reflection.invoke(bubble(lambda), target,\n argv.toArray(new Object[argv.length()]));\n return Fulfilled.isInstance(r) ? ((Promise<?>)r).call() : r;\n }",
"<T> T mo19025a(Object obj, Class<T> cls);",
"@Override\n public VarTypes getType(Analyzer analyzer) throws InvalidMethodException, InvalidTypeException {\n VarTypes returnType = analyzer.getSignature(callee).getReturnType();\n if (returnType == VarTypes.VOID) {\n throw new InvalidTypeException(VarTypes.VOID.getName());\n }\n return returnType;\n }",
"default DfType correctForClosure() {\n return this;\n }",
"public interface ITypeable {\n public Type getType();\n}",
"public interface TypeConvertor {\n Object convert (Class from, Class to, Object obj);\n String getCodeGenString ();\n}",
"protected abstract Class<T> getType();",
"public IType getType();",
"@Override\n public Type type() {\n return null;\n }",
"public Type getType() {\n @SuppressWarnings(\"deprecation\")\n Type result = Type.valueOf(type_);\n return result == null ? Type.UNRECOGNIZED : result;\n }",
"public JType erasure() {\n return this;\n }",
"public abstract Class<?> getExpectedType();",
"@Test\n public void untypedLambda1() {\n DependentLink A = param(\"A\", Universe(0));\n Expression type = Pi(params(A, param(\"a\", Reference(A))), Nat());\n List<Binding> context = new ArrayList<>();\n context.add(new TypedBinding(\"f\", type));\n typeCheckExpr(context, \"\\\\lam x1 x2 => f x1 x2\", null);\n }",
"public T caseFlowType(FlowType object)\n {\n return null;\n }",
"private static TypeToken<?> typeVariable() {\n\t\tParameterizedType t = (ParameterizedType)TypeToken.of(Identity.class).getSupertype(StreamElement.class).getType();\n\t\treturn TypeToken.of(t.getActualTypeArguments()[0]);\n\t}",
"@Override\n\tpublic Type getType() {\n\t\treturn null;\n\t}",
"public static NamingContext unchecked_narrow(Object paramObject) {\n/* 82 */ if (paramObject == null)\n/* 83 */ return null; \n/* 84 */ if (paramObject instanceof NamingContext) {\n/* 85 */ return (NamingContext)paramObject;\n/* */ }\n/* */ \n/* 88 */ Delegate delegate = ((ObjectImpl)paramObject)._get_delegate();\n/* 89 */ _NamingContextStub _NamingContextStub = new _NamingContextStub();\n/* 90 */ _NamingContextStub._set_delegate(delegate);\n/* 91 */ return _NamingContextStub;\n/* */ }",
"String provideType();",
"public SoyType getType() {\n return getTypeWrapper().getType();\n }",
"public abstract JType unboxify();",
"Type getReturnType () { return return_type; }",
"public T caseClosureSurfaceType(ClosureSurfaceType object) {\n\t\treturn null;\n\t}",
"@NotNull\r\n default Type getType() {\r\n throw new IllegalArgumentException(\"getType is unsupported\");\r\n }",
"public abstract Object getUnderlyingObject();",
"public Class<?> getBoxedType();",
"private Object createInstanceOfType(Class<?> propertyType)\n\t{\n\t\tObject typeInstance = null;\n\t\tif (propertyType.isArray())\n\t\t{\n\t\t\ttypeInstance = createArray(propertyType);\n\t\t}\n\t\telse if (propertyType.isPrimitive())\n\t\t{\n\t\t\ttypeInstance = primitiveTypeFactory.create(propertyType);\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttypeInstance = knownTypeFactory.create(propertyType);\n\t\t}\n\t\treturn typeInstance;\n\t}",
"RakudoObject type_object_for(ThreadContext tc, RakudoObject how);",
"public synchronized EventType addReturnExistingAnonymousType(EventType requiredType) {\n if (!(requiredType instanceof EventTypeSPI) || requiredType instanceof WrapperEventType) {\n return requiredType;\n }\n\n // check recent types\n for (EventTypeSPI existing : recentTypes) {\n if (existing.getClass() == requiredType.getClass() &&\n Arrays.equals(requiredType.getPropertyNames(), existing.getPropertyNames()) &&\n Arrays.equals(requiredType.getPropertyDescriptors(), existing.getPropertyDescriptors()) &&\n existing.equalsCompareType(requiredType)) {\n return existing;\n }\n }\n\n // add, removing the oldest\n if (recentTypes.size() == size && !recentTypes.isEmpty()) {\n recentTypes.removeFirst();\n }\n if (recentTypes.size() < size) {\n recentTypes.addLast((EventTypeSPI) requiredType);\n }\n return requiredType;\n }",
"@Override\n public Type getType() {\n return type;\n }",
"@Override\n public Type getType() {\n return type;\n }",
"public T get() {\n return object;\n }",
"protected E getEmptyObject() {\n try {\n ParameterizedType type = (ParameterizedType) getClass().getGenericSuperclass();\n Class<E> eClazz = (Class<E>) type.getActualTypeArguments()[0];\n\n return eClazz.newInstance();\n } catch (InstantiationException | IllegalAccessException ex) {\n return null;\n }\n }",
"@Test\n void rawType_rawType() {\n var ref = new TypeRef<String>() {};\n assertEquals(String.class, ref.rawType());\n }"
] | [
"0.5972221",
"0.58922035",
"0.57401574",
"0.5701024",
"0.5635569",
"0.56319505",
"0.5573897",
"0.5562943",
"0.55627286",
"0.5547571",
"0.551608",
"0.55087847",
"0.5501267",
"0.5471798",
"0.5471798",
"0.5471798",
"0.546917",
"0.546917",
"0.5449982",
"0.54492503",
"0.53945774",
"0.5380983",
"0.5351624",
"0.53444135",
"0.53444135",
"0.53444135",
"0.53444135",
"0.53444135",
"0.53444135",
"0.53444135",
"0.53444135",
"0.53444135",
"0.53444135",
"0.53444135",
"0.5337351",
"0.5316088",
"0.53033966",
"0.5300503",
"0.52992743",
"0.528439",
"0.5278813",
"0.5274242",
"0.52598965",
"0.52419156",
"0.521458",
"0.52134055",
"0.5209349",
"0.5190417",
"0.51854384",
"0.51732326",
"0.5172276",
"0.51720536",
"0.51609445",
"0.5153868",
"0.51446813",
"0.5137768",
"0.51376367",
"0.5135197",
"0.5131061",
"0.51251495",
"0.5123885",
"0.51231813",
"0.51231813",
"0.51231813",
"0.5118376",
"0.5117721",
"0.5107538",
"0.51070166",
"0.5102191",
"0.5101176",
"0.5096616",
"0.5092024",
"0.508165",
"0.5079634",
"0.50783396",
"0.5077238",
"0.5061761",
"0.50441945",
"0.50391185",
"0.5035889",
"0.50239986",
"0.50140506",
"0.5012496",
"0.5009676",
"0.49844313",
"0.49780676",
"0.4964177",
"0.49628824",
"0.49605098",
"0.49566206",
"0.4956597",
"0.49545243",
"0.49514082",
"0.49496973",
"0.49486113",
"0.4943782",
"0.4943782",
"0.49424797",
"0.49396294",
"0.49264917"
] | 0.58396924 | 2 |
check next move if collide with other gameobject | public boolean isCollision(double x, double y) {
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void move() {\n if (!isCollision(xMove, 0))\n moveX();\n //else\n // adjustX(xMove);\n\n if (!isCollision(0, yMove))\n moveY();\n //else\n // adjustY(yMove);\n //check isCollision(gameObject) with calculating the position for next move\n\n }",
"@Override\n public boolean isCollided(gameObject obj){\n return Rect.intersects(obj.getastRect(), getRectplayer1())||\n Rect.intersects(obj.getastRect(), getRectplayer2()) ||\n Rect.intersects(obj.getastRect(), getRectplayer3()) ||\n Rect.intersects(obj.getastRect(), getRectplayer4());\n }",
"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 }",
"@Override\r\n public void tick() {\n playerNextTo();\r\n if (playerContact() && isCollisioned()) {\r\n if (!((GameState) game.getGameState()).getWorld().getTile((int) (x + xMove), (int) (y + yMove)).isSolid()\r\n && isValidMove(xMove, yMove)) {\r\n x += xMove;\r\n y += yMove;\r\n }\r\n }\r\n }",
"@Override\n public boolean canMove(double x, double y) {\n double xRec=rectangle.getX();\n double yRec=rectangle.getY();\n rectangle.setLocation((int)(xRec+x*1),(int)(yRec+y*1));\n\n List<Rectangle> staticRectangles= board.getStaticRectangles();\n List<Creature> creatures=board.getCreatures();\n Iterator<Rectangle> itr1=staticRectangles.iterator();\n\n while(itr1.hasNext()){\n Rectangle tmpRectangle =itr1.next();\n if(rectangle.intersects(tmpRectangle)) {\n return false;\n }\n }\n Iterator<Creature> itr2=creatures.iterator();\n while(itr2.hasNext()){\n Creature creature=itr2.next();\n if(creature==this){\n continue;\n }\n else{\n if(rectangle.intersects(creature.getRectangle()))\n return false;\n }\n\n }\n\n return true;\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}",
"public abstract boolean collisionWith(CollisionObject obj);",
"public boolean moveable() {\n //check reach border\n if (reachBorder()) {\n return false;\n }\n //get the location of the next spot to move to\n //move up\n Point nextLocation = this.getCenterLocation();\n if (direction == 12) {\n nextLocation = new Point(this.getCenterX(),\n this.getCenterY() - speed);\n }\n //move right\n if (direction == 3) {\n nextLocation = new Point(this.getCenterX() + speed,\n this.getCenterY());\n\n }\n //move down\n if (direction == 6) {\n nextLocation = new Point(this.getCenterX(),\n this.getCenterY() + speed);\n\n }\n //move left\n if (direction == 9) {\n nextLocation = new Point(this.getCenterX() - speed,\n this.getCenterY());\n }\n\n // get all objects in a circle of radius tileSize * 2 around the players\n //these objects are those which can possibly colide with the players\n int checkRadius = GameUtility.GameUtility.TILE_SIZE * 2;\n for (GameObject gameObject : GameManager.getGameObjectList()) {\n if (GameUtility.GameUtility.distance(gameObject.getCenterLocation(),\n this.getCenterLocation()) < checkRadius) {\n if ((GameUtility.GameUtility.dectectCollision(\n gameObject.getCenterLocation(),\n nextLocation)) && !(GameUtility.GameUtility.dectectCollision(\n gameObject.getCenterLocation(),\n this.getCenterLocation())) && gameObject.getType() != GameObjectType.POWER_UP && gameObject.getType() != GameObjectType.MONSTER && gameObject.getType() != GameObjectType.PLAYER) {\n return false;\n }\n }\n }\n return true;\n\n }",
"public boolean canMove2() {\n\t\tGrid<Actor> gr = getGrid(); \n\t\tif (gr == null) {\n\t\t\treturn false; \n\t\t}\n\t\t\n\t\tLocation loc = getLocation(); \n\t\tLocation next = loc.getAdjacentLocation(getDirection());\n\t\tLocation next2 = next.getAdjacentLocation(getDirection());\n\t\tif (!gr.isValid(next)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!gr.isValid(next2)) {\n\t\t\treturn false;\n\t\t}\n\t\tActor neighbor = gr.get(next2); \n\t\treturn (neighbor == null) || (neighbor instanceof Flower); \n\t}",
"private void checkCollision()\n {\n if (gameOverBool==false)\n { \n Actor a = getOneIntersectingObject(Wall.class);\n if (a != null||isAtEdge())\n {\n setImage(\"gone.png\");//laat de helicopter verdwijnen\n //greenfoot.GreenfootSound.stop(\"helisound.wav\");\n World world = getWorld();\n world.addObject(new Explosion(), getX(), getY());\n Greenfoot.playSound(\"heliExplosion.wav\");\n world.addObject( new Gameover(), 600, 300 );\n gameOverBool = true; \n }\n } \n }",
"void collisionHappened(int position);",
"private void checkForCollisionWithSelf() {\r\n if (isInSnake(snake[0].row,snake[0].column,true)) {\r\n gameOver();\r\n }\r\n }",
"private boolean updateMovingObjects(double elapsedSeconds) {\n for(Movable movingObj : engine.getMovingObjects()){\n double dx = 0, dy = 0;\n switch (movingObj.getFacing()){\n case UP:\n dy -= movingObj.getSpeed() * GRID_SIZE * elapsedSeconds;\n break;\n case DOWN:\n dy += movingObj.getSpeed() * GRID_SIZE * elapsedSeconds;\n break;\n case LEFT:\n dx -= movingObj.getSpeed() * GRID_SIZE * elapsedSeconds;\n break;\n case RIGHT:\n dx += movingObj.getSpeed() * GRID_SIZE * elapsedSeconds;\n break;\n }\n Node movingNode = getNodeById(movingObj.getObjID());\n if(movingNode == null) break; // if the node is deleted\n double oldX = movingNode.getTranslateX();\n double oldY = movingNode.getTranslateY();\n double newX = oldX + dx;\n double newY = oldY + dy;\n\n // translate objs\n movingNode.setTranslateX(newX);\n movingNode.setTranslateY(newY);\n\n // detect collisions\n for(GameObject anotherObj : engine.getAllObjects()){\n // ignore self with self\n if(movingObj.equals(anotherObj)) continue;\n\n Node anotherNode =\n getNodeById(anotherObj.getObjID());\n\n if(isColliding(movingNode, anotherNode)){\n CollisionResult result = engine.handleCollision(movingObj, anotherObj);\n if(handleCollision(result, movingNode, anotherNode, oldX, oldY))\n return true;\n }\n }\n\n engine.changeObjectLocation(movingObj, getUpdatedPoint(movingObj, newX, newY));\n }\n return false;\n }",
"private boolean detectCollisions(GameState mGaemState,ArrayList<GameObject> objects,SoundEngine se,ParticleSystem ps){\n boolean playerHit = false;\n for (GameObject go1:objects){\n if (go1.checkActive()){\n //the 1st object is active\n //so worth checking\n\n for (GameObject go2:objects){\n if (go2.checkActive()){\n //the 2nd object is active\n //so worth checking\n if (RectF.intersects(go1.getTransform().getCollider(),go2.getTransform().getCollider())){\n\n //switch goes here\n //there has been a collision\n //but does it matter?\n switch (go1.getTag() + \" with \" + go2.getTag()){\n case \"Player with Alien Laser\":\n playerHit = true;\n mGaemState.lostLife(se);\n\n break;\n\n case \"Player with Alien\":\n playerHit =true;\n mGaemState.lostLife(se);\n\n break;\n\n case \"Player Laser with Alien\":\n mGaemState.increaseScore();\n //respawn the alien\n ps.emitParticles(new PointF(go2.getTransform().getLocation().x,go2.getTransform().getLocation().y));\n go2.setInactive();\n go2.spawn(objects.get(Level.PLAYER_INDEX).getTransform());\n go1.setInactive();\n se.playAlienExplode();\n\n break;\n\n default:\n break;\n }\n\n }\n }\n }\n }\n }\n return playerHit;\n }",
"void checkCollision(Entity other);",
"public boolean collidesWith(ICollider other);",
"@Override\n public void checkCollision( Sprite obj )\n {\n \n }",
"public boolean collidesWith(GameObject other) {\n me.setBounds((int) x, (int) y, sprite.getWidth(), sprite.getHeight());\n him.setBounds((int) other.x, (int) other.y, other.sprite.getWidth(), other.sprite.getHeight());\n\n return me.intersects(him);\n }",
"protected void onCollision(Actor other) {\r\n\r\n\t}",
"public int checkCollision(Direction direction, GameObject object) {\n\n Position tempPosition = adjacentPosition(direction, object);\n\n if (object instanceof Player) {\n\n for (int i = 1; i < gameObjects.length; i++) {\n if (!gameObjects[i].getPosition().comparePosition(tempPosition)) {\n continue;\n }\n if (!(gameObjects[i] instanceof SpotX)) {\n return i;\n }\n }\n return -1;\n } else {\n for (int i = 1; i < gameObjects.length; i++) {\n if (!gameObjects[i].getPosition().comparePosition(tempPosition)) {\n continue;\n }\n return i;\n }\n return -1;\n }\n\n }",
"private void collide() {\n int collisionRange;\n \n if(isObstacle) {\n for(Thing thg: proximity) {\n if(\n thg.isObstacle\n &&\n !thg.equals(this)\n ) {\n collisionRange = (thg.size + this.size)/2;\n deltaA = this.distance(thg);\n \n if( \n Math.abs(deltaA[0]) <= collisionRange\n &&\n Math.abs(deltaA[1]) <= collisionRange\n ){\n if(deltaA[0] > deltaA[1]) {\n if(Math.abs(deltaA[0]) > Math.abs(deltaA[1])) {\n if(dA[0] == 1) {\n dA[0] = 0;\n }\n }\n if(Math.abs(deltaA[0]) < Math.abs(deltaA[1])) {\n if(dA[1] == -1) {\n dA[1] = 0;\n }\n }\n if(Math.abs(deltaA[0]) == Math.abs(deltaA[1])) {\n if(dA[0] != 0) {\n dA[1] = dA[0];\n }\n if(dA[1] != 0) {\n dA[0] = dA[1];\n }\n }\n }\n \n if(deltaA[0] < deltaA[1]) {\n if(Math.abs(deltaA[0]) > Math.abs(deltaA[1])) {\n if(dA[0] == -1) {\n dA[0] = 0;\n }\n } \n if(Math.abs(deltaA[0]) < Math.abs(deltaA[1])) {\n if(dA[1] == 1) {\n dA[1] = 0;\n }\n } \n if(Math.abs(deltaA[0]) == Math.abs(deltaA[1])) {\n dA[0] = 1 - 2*(int) (Math.random()*2);\n dA[1] = dA[0];\n }\n }\n \n if(Math.abs(deltaA[0]) == Math.abs(deltaA[1])) {\n dA[0] = 1 - 2*(int) (Math.random()*2);\n dA[1] = -dA[0];\n }\n }\n }\n }\n }\n }",
"public abstract void collide(InteractiveObject obj);",
"public boolean hasCollidedWith(InteractiveObject obj){\n\t\tif (obj == null) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn (leftCollision(obj) || rightCollision(obj));\n\t\t}\n\t}",
"private boolean stop() {\n\t\tboolean collide = false;\n\n\t\tdist = (int) MathMachine.distance((xOrigin - this.x), (yOrigin - this.y)); // distance traveled\n\t\tif (dist >= move_range) collide = true;\n\n\t\tif (Math.abs(x - xD) <= 2 && Math.abs(y - yD) <= 2) { // adding 8 shifts the collision box from the top left corner to the bottom right.\n\t\t\tcollide = true; // this is the important statement for collision detection. It works by looking at the tile you want to go to and seeing if it is solid.\n\t\t}\n\n\t\treturn collide;\n\t}",
"public void checkCollision() {}",
"private boolean rightCollision(InteractiveObject obj){\n\t\treturn rightUpCollision(obj) || rightDownCollision(obj);\n\t}",
"@Override\n public void checkCollision( Sprite obj )\n {\n\n }",
"private void checkMovement()\n {\n if (frames % 600 == 0)\n {\n \n ifAllowedToMove = true;\n \n \n }\n \n }",
"public boolean collidesWith(SpriteBase otherSprite) {\r\n boolean toReturn = false;\r\n\r\n if (distTo(otherSprite.x, x) < collideSize && distTo(otherSprite.y,y) < collideSize){\r\n toReturn = true;\r\n }\r\n\r\n return (toReturn);\r\n }",
"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 leftUpCollision(InteractiveObject obj){\n\t\treturn (((this.getX() - obj.getX()) < obj.getWidth()) && (this.getX() > obj.getX()) &&\n\t\t\t\t((this.getY() - obj.getY()) < obj.getHeight()) && (this.getY() > obj.getY()));\n\t}",
"public boolean isCollition(Sprite sprite2) {\n if (this.x < sprite2.getX() + sprite2.getAncho() &&\n this.x + this.ancho > sprite2.getX() &&\n this.y + this.alto > sprite2.getY() &&\n this.y < sprite2.getY() + sprite2.getAlto()) {\n return true;\n\n } else {\n return false;\n }\n\n }",
"@Override\n\tpublic boolean validMove(int xEnd, int yEnd, board b){\n\t\t//try to land one same color piece\n\t\tif(b.occupied(xEnd, yEnd)&&b.getPiece(xEnd, yEnd).getColor()==color){\n\t\t\treturn false;\n\t\t}\n\t\tif(v==0){\n\t\t\tif(!this.guard(xEnd, yEnd, b)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//normal move\n\t\tif((xEnd==x-1&&yEnd==y-1)||(xEnd==x-1&&yEnd==y)||(xEnd==x-1&&yEnd==y+1)||(xEnd==x&&yEnd==y-1)||(xEnd==x&&yEnd==y+1)||(xEnd==x+1&&yEnd==y-1)||(xEnd==x+1&&yEnd==y)||(xEnd==x+1&&yEnd==y+1)){\n\t\t\tif(b.occupied(xEnd, yEnd)){\n\t\t\t\t//set the enpass flage back\n\t\t\t\tb.setFlag(color, 100, 100);\n\t\t\t\tb.recycle(xEnd, yEnd);\n\t\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\t\tb.update();\n\t\t\t\tc=0;\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\t//set the enpass flage back\n\t\t\t\tb.setFlag(color, 100, 100);\n\t\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\t\tb.update();\n\t\t\t\tc=0;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}else if((xEnd==x-2&&yEnd==y)){ //castling\n\t\t\tpiece r = b.getPiece(0, y);\n\t\t\tif(r==null){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(r.getC()==0||r.getColor()!=color||r.getType()!= type.ROOK||c==0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor(int i=3;i>0;i--){\n\t\t\t\tif(b.occupied(i, y)){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\tr.setPosition(3,y);\n\t\t\tc=0;\n\t\t\tr.setC(0);\n\t\t\tb.setFlag(color, 100, 100);\n\t\t\tb.update();\n\t\t\treturn true;\n\t\t}else if((xEnd==x+2&&yEnd==y)){\n\t\t\tpiece r = b.getPiece(7, y);\n\t\t\tif(r==null){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(r.getC()==0||r.getColor()!=color||r.getType()!= type.ROOK||c==0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor(int i=5;i<=6;i++){\n\t\t\t\tif(b.occupied(i, y)){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\tr.setPosition(5,y);\n\t\t\tc=0;\n\t\t\tr.setC(0);\n\t\t\tb.setFlag(color, 100, 100);\n\t\t\tb.update();\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public void act() \n {\n move(4); \n collision();\n \n \n }",
"boolean canMove();",
"public Boolean physinteractor(int x, int y) {\n \tNextMoveY = y;\n \tNextMoveX =x;\n \tList<Entity> entities = new ArrayList<Entity>();\n \tentities = dungeon.checkEntity(x, y);\n \tEntity entity = null;\n \tfor(Entity z:entities) {\n \t\tif(!z.transparency()) {\n \t\t\tentity = z;\n \t\t\tbreak;\n \t\t}\n \t}\n \tif(!(entity instanceof Wall)) {\n\t \tif(entity instanceof Door) {\n\t \t\t//System.out.println(\"BAHAHAHAHA\");\n\t \t\tif(this.getkey() !=null) {\n\t \t\t\tthis.getkey().interaction(this);\n\t \t\t}\n\t \t}else {\n\t\t \tPhysicalEntities phye = (PhysicalEntities) entity;\n\t\t \t\n\t \t\tif(phye.playeradjacent(this)) {\n\t \t\t\treturn true;\n\t \t\t}\n\t\t \n\t \t}\n \t}\n \treturn false;\n }",
"@Override\n\tpublic boolean checkCollision() {\n\t\treturn true;\n\t}",
"public void controlla_collisioni() {\n\n for (int i = punti; i > 0; i--) {\n\n if ((i > 4) && (x[0] == x[i]) && (y[0] == y[i])) {\n in_gioco = false;\n }\n }\n\n if (y[0] >= ALTEZZA+85) { //devo aggungere +85 perche' l'area di gioco comincia dal punto 100,100\n in_gioco = false;\n }\n\n if (y[0] <= 100) {\n in_gioco = false;\n }\n\n if (x[0] >= LARGHEZZA+85) {\n in_gioco = false;\n }\n\n if (x[0] <= 100) {\n in_gioco = false;\n }\n }",
"@Override\n\tpublic boolean movable(Entity obj) {\n\t\tif (!(obj instanceof Player)) return false;\n\t\tPlayer player = (Player) obj;\n\t\t\n\t\tint futureX = this.getX();\n\t\tint futureY = this.getY();\n\t\t\n\t\t\n\t\tint playerX = player.getX();\n\t\tint playerY = player.getY();\n\t\t\n\t\tif (playerX == this.getX()) {\n\t\t\t// player moving either up or down\n\t\t\tif (playerY > this.getY()) {\n\t\t\t\t// player moving up so check what's up of boulder\n\t\t\t\tfutureY = this.getY() - 1;\n\t\t\t} else {\n\t\t\t\t// player moving down ''\n\t\t\t\tfutureY = this.getY() + 1;\n\t\t\t}\n\t\t} else if (playerY == this.getY()) {\n\t\t\t// player moving either left or right\n\t\t\tif (playerX > this.getX()) {\n\t\t\t\t// player moving left ''\n\t\t\t\tfutureX = this.getX() - 1;\n\t\t\t} else {\n\t\t\t\t// player moving right ''\n\t\t\t\tfutureX = this.getX() + 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\tboolean result = checkMoveable(futureX, futureY);\n\t\treturn result;\n\t}",
"private boolean processMovingObject()\n {\n MovingObject[] ap_objects = p_gsb.ap_MovingObjects;\n for (int li = 0;li < ap_objects.length;li++)\n {\n MovingObject p_obj = ap_objects[li];\n\n if (!p_obj.lg_Active) continue;\n\n if (p_obj.process())\n {\n if (p_obj.i_State == MovingObject.STATE_EXPLODE)\n {\n p_obj.lg_Active = false;\n continue;\n }\n }\n\n if (p_obj.i_State == MovingObject.STATE_EXPLODE) continue;\n\n switch (p_obj.i_Type)\n {\n case MovingObject.TYPE_ARROW:\n {\n p_obj.i_scry -= ARROWSPEED;\n if (p_obj.i_scry <= (0 - p_obj.i_height))\n {\n p_obj.lg_Active = false;\n continue;\n }\n }\n ;\n break;\n case MovingObject.TYPE_ASSAULTER:\n {\n if (getRandomInt(1000) <= p_gsb.i_shotfreq)\n {\n MovingObject p_arrow = p_gsb.getInactiveMovingObject();\n if (p_arrow != null)\n {\n p_arrow.activate(MovingObject.TYPE_ARROW,MovingObject.STATE_UP);\n p_arrow.i_scrx = p_obj.i_scrx;\n p_arrow.i_scry = p_obj.i_scry - p_arrow.i_height;\n }\n }\n\n if (p_obj.i_State != MovingObject.STATE_DOWN) generateLadderAndDamForAssaulter(p_obj);\n\n switch (p_obj.i_State)\n {\n case MovingObject.STATE_LEFT:\n {\n if (p_obj.i_scrx - ASSAULTER_HORZSPEED < 0)\n {\n p_obj.setState(MovingObject.STATE_RIGHT,false);\n }\n else\n {\n p_obj.i_scrx -= ASSAULTER_HORZSPEED;\n }\n }\n ;\n break;\n case MovingObject.STATE_RIGHT:\n {\n if (p_obj.i_scrx + p_obj.i_width + ASSAULTER_HORZSPEED >= i_screenWidth)\n {\n p_obj.setState(MovingObject.STATE_LEFT,false);\n }\n else\n {\n p_obj.i_scrx += ASSAULTER_HORZSPEED;\n }\n }\n ;\n break;\n case MovingObject.STATE_UP:\n {\n p_obj.i_scry -= ASSAULTER_VERTSPEED;\n if ((p_obj.i_scry + (p_obj.i_height >> 1)) / VIRTUALCELL_HEIGHT == 0/*p_gsb.i_playeralt*/) return true;\n }\n ;\n break;\n case MovingObject.STATE_DOWN:\n {\n p_obj.i_scry += ASSAULTER_VERTSPEED;\n int i_cellx = p_obj.i_scrx / VIRTUALCELL_WIDTH;\n int i_celly = (p_obj.i_scry + p_obj.i_height - 1) / VIRTUALCELL_HEIGHT;\n boolean lg_stop = false;\n if (i_celly < FIELD_HEIGHT-p_gsb.i_playeralt)\n {\n if (Assault_GSB.getElement(i_cellx,i_celly) != Assault_GSB.CELL_NONE) lg_stop = true;\n }\n else\n {\n lg_stop = true;\n i_celly--;\n }\n\n if (lg_stop)\n {\n p_obj.i_scry = i_celly * VIRTUALCELL_HEIGHT;\n if (getRandomInt(40) >= 20)\n {\n p_obj.setState(MovingObject.STATE_LEFT,false);\n }\n else\n {\n p_obj.setState(MovingObject.STATE_RIGHT,false);\n }\n }\n }\n ;\n break;\n }\n }\n ;\n break;\n case MovingObject.TYPE_STONE:\n {\n if (p_obj.i_State == MovingObject.STATE_DOWN)\n {\n p_obj.i_scry += STONESPEED;\n if ((p_obj.i_scry + p_obj.i_height) >= FIELD_HEIGHT * VIRTUALCELL_HEIGHT)\n {\n p_obj.i_scry = (FIELD_HEIGHT * VIRTUALCELL_HEIGHT) - p_obj.i_height - 1;\n p_obj.setState(MovingObject.STATE_EXPLODE,false);\n }\n }\n }\n ;\n break;\n }\n }\n return false;\n }",
"private boolean canMove() {\n return !(bestMove[0].getX() == bestMove[1].getX() && bestMove[0].getY() == bestMove[1].getY());\n }",
"void collide() {\n for (Target t : this.helicopterpieces) {\n if (!t.isHelicopter && ((t.x == this.player.x && t.y == this.player.y)\n || (t.x == this.player2.x && t.y == this.player2.y))) {\n this.collected--;\n t.isCollected = true;\n }\n if (t.isHelicopter && this.collected == 1\n && ((t.x == this.player.x && t.y == this.player.y) || (t.isHelicopter\n && this.collected == 1 && t.x == this.player2.x && t.y == this.player2.y))) {\n this.collected = 0;\n this.helicopter.isCollected = true;\n }\n }\n }",
"boolean isMoving();",
"private void enemyMove() {\n\n\t\tboolean goAgain = false;\n\n\t\tint x = (int) (Math.random() * 10);\n\t\tint y = (int) (Math.random() * 10);\n\n\t\t// Make sure the enemy hits in a checkerboard pattern.\n\t\tif (x % 2 == 0) { // if x is even, y should be odd\n\t\t\tif (y % 2 == 0) {\n\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\ty++;\n\t\t\t\telse\n\t\t\t\t\ty--;\n\t\t\t}\n\t\t} else { // if x is odd, y should be even\n\t\t\tif (y % 2 == 1)\n\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\ty++;\n\t\t\t\telse\n\t\t\t\t\ty--;\n\t\t}\n\n\t\tif (enemyLastShotHit && getDifficulty() > 0) { // /if last shot was a\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// hit, enemy\n\t\t\t// will try to\n\t\t\t// check around it only run if difficulty is\n\t\t\t// normal or above\n\t\t\tx = enemyLastHitX;\n\t\t\ty = enemyLastHitY;\n\n\t\t\tif (getDifficulty() != 2) {\n\n\t\t\t\tif (conflictX == 4) {\n\t\t\t\t\tconflictX = 0;\n\t\t\t\t} else if (conflictY == 4) {\n\t\t\t\t\tconflictY = 0;\n\t\t\t\t\t// System.out.println(\"conflict has been reset \");\n\t\t\t\t}\n\n\t\t\t\tif (conflictX != 0) {\n\t\t\t\t\tif (conflictX == 1)\n\t\t\t\t\t\tx++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\tconflictX = 4;\n\t\t\t\t} else if (conflictY == 1) {\n\t\t\t\t\t// System.out.println(\"checking down\");\n\t\t\t\t\tconflictY = 4;\n\t\t\t\t\ty++;\n\t\t\t\t}\n\n\t\t\t\tif (x + 1 < 10 && x - 1 >= 0) {// branch for multiple hits\n\t\t\t\t\tif (egrid[x + 1][y] == 1 && egrid[x - 1][y] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tif (x + 2 < 10) {\n\t\t\t\t\t\t\tif (egrid[x + 2][y] == 1) {\n\t\t\t\t\t\t\t\tconflictX = 1;\n\t\t\t\t\t\t\t\tx--;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (y + 1 < 10 && y - 1 >= 0) {// branch for multiple vertical\n\t\t\t\t\t\t\t\t\t\t\t\t// hits\n\t\t\t\t\tif (egrid[x][y + 1] == 1 && egrid[x][y - 1] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tconflictY = 1;\n\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (conflictX == 0 && conflictY == 0) {\n\n\t\t\t\t\tif (checkDirection == 0) // checks in each direction\n\t\t\t\t\t\tx++;\n\t\t\t\t\telse if (checkDirection == 1)\n\t\t\t\t\t\tx--;\n\t\t\t\t\telse if (checkDirection == 2)\n\t\t\t\t\t\ty++;\n\t\t\t\t\telse if (checkDirection == 3) {\n\t\t\t\t\t\ty--;\n\t\t\t\t\t\tenemyLastShotHit = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (x < 0) // making sure coordinates stay within bounds\n\t\t\t\t\t\tx = 0;\n\t\t\t\t\telse if (x > 9)\n\t\t\t\t\t\tx = 9;\n\t\t\t\t\tif (y < 0)\n\t\t\t\t\t\ty = 0;\n\t\t\t\t\telse if (y > 9)\n\t\t\t\t\t\ty = 9;\n\t\t\t\t}\n\t\t\t} // medium diff\n\n\t\t\telse if (getDifficulty() == 2) {// hard difficulty\n\t\t\t\t// gives enemy unfair advantage\n\n\t\t\t\tif (conflictX == 4)\n\t\t\t\t\tconflictX = 0;\n\t\t\t\tif (conflictY == 4)\n\t\t\t\t\tconflictY = 0;\n\n\t\t\t\tif (conflictX != 0) {\n\t\t\t\t\tif (conflictX == 1)\n\t\t\t\t\t\tx++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\tconflictX = 4;\n\t\t\t\t} else if (conflictY == 1) {\n\t\t\t\t\tconflictY = 4;\n\t\t\t\t\ty++;\n\t\t\t\t}\n\n\t\t\t\tif (x + 1 < 10 && x - 1 >= 0) {// branch for multiple hits\n\t\t\t\t\tif (egrid[x + 1][y] == 1 && egrid[x - 1][y] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tif (x + 2 < 10) {\n\t\t\t\t\t\t\tif (egrid[x + 2][y] == 1) {\n\t\t\t\t\t\t\t\tconflictX = 1;\n\t\t\t\t\t\t\t\tx--;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (y + 1 < 10 && y - 1 >= 0) {// branch for multiple vertical\n\t\t\t\t\t\t\t\t\t\t\t\t// hits\n\t\t\t\t\tif (egrid[x][y + 1] == 1 && egrid[x][y - 1] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tconflictY = 1;\n\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (conflictX == 0 && conflictY == 0) {\n\t\t\t\t\tif (y + 1 < 10) {\n\t\t\t\t\t\tif (egrid[x][y + 1] == 1)// if y+1 is a hit and it is\n\t\t\t\t\t\t\t\t\t\t\t\t\t// within bounds, it will go\n\t\t\t\t\t\t\t\t\t\t\t\t\t// there\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (y - 1 >= 0) {\n\t\t\t\t\t\tif (egrid[x][y - 1] == 1)\n\t\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t\tif (x + 1 < 10) {\n\t\t\t\t\t\tif (egrid[x + 1][y] == 1)\n\t\t\t\t\t\t\tx++;\n\t\t\t\t\t}\n\t\t\t\t\tif (x - 1 >= 0) {\n\t\t\t\t\t\tif (egrid[x - 1][y] == 1) {\n\t\t\t\t\t\t\tx--;\n\t\t\t\t\t\t\tenemyLastShotHit = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} // hard diff\n\t\t\tcheckDirection++;\n\t\t} // lasthit\n\n\t\tint tryCount = 0;\n\t\twhile (egrid[x][y] == 3) { // makes sure enemy doesn't hit same spot\n\t\t\t\t\t\t\t\t\t// twice\n\t\t\tx = (int) (Math.random() * 10);\n\t\t\ty = (int) (Math.random() * 10);\n\t\t\tif (tryCount < 20 && getDifficulty() > 0) {\n\t\t\t\tif (x % 2 == 0) { // if x is even, y should be odd\n\t\t\t\t\tif (y % 2 == 0) { // for checkerboard pattern\n\t\t\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t} else { // if x is odd, y should be even\n\t\t\t\t\tif (y % 2 == 1)\n\t\t\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ty--;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttryCount++;\n\t\t}\n\n\t\tif (egrid[x][y] == 1) { // hit branch\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tilehit.jpg\"));\n\t\t\tstatus.setText(\" Enemy got a hit\");\n\t\t\tenemyLastShotHit = true; // starts ai\n\t\t\tcheckDirection = 0;\n\t\t\tif (conflictX == 0 && conflictY == 0) {\n\t\t\t\tenemyLastHitX = x; // stores x and y values\n\t\t\t\tenemyLastHitY = y;\n\t\t\t}\n\t\t\tehits--; // keeps score\n\t\t}\n\n\t\telse if (egrid[x][y] == 2) { // poweup branch\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tilepower.jpg\"));\n\t\t\tstatus.setText(\" Enemy got a PowerUp\");\n\t\t\tgoAgain = true;\n\t\t}\n\n\t\telse\n\t\t\t// miss branch\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tilemiss.jpg\"));\n\n\t\tegrid[x][y] = 3;\n\n\t\tcheckEnemyWin();\n\n\t\tif (goAgain)\n\t\t\tenemyMove();\n\n\t}",
"public void collideWith(Rigidbody obj) {\n\t\t\r\n\t}",
"public boolean willBoxesCollide(Unit player, float deltaX, float deltaY) {\n\tScene currentScene = WorldMap.getInstance().getCurrentScene();\n\tfor (Obstacle obstacle : currentScene.getObstacleList()) {\n\t if (player.collisionBetweenBoxes(deltaX, deltaY, obstacle) && player.getPosZ() < obstacle.getProtrusionHeight())\n\t\treturn true;\n\t}\n\t \n\treturn false;\n }",
"public void move() {\n health -= 2; //health decrement\n age++; //age increment\n if (yPos > 300) {\n speed += 3;\n }\n boolean canMove = false;\n int distancex = (int) (Math.random() * speed);\n int distancey = (int) (Math.random() * speed);\n int counterx = r.nextInt(2);\n int countery = r.nextInt(2);\n while (!canMove) {\n distancex = (int) (Math.random() * speed);\n distancey = (int) (Math.random() * speed);\n counterx = r.nextInt(2);\n countery = r.nextInt(2);\n if (counterx == 0 && this.xPos - distancex > 0\n && countery == 0 && this.yPos - distancey > 0) {\n canMove = true;\n } else if (counterx == 1 && this.xPos + distancex < 510\n && countery == 1 && this.yPos + distancey < 530) {\n canMove = true;\n }\n }\n if (counterx == 0 && countery == 0) {\n xPos -= distancex;\n yPos -= distancey;\n } else if (counterx == 0 && countery == 1) {\n xPos -= distancex;\n yPos += distancey;\n } else if (counterx == 1 && countery == 0) {\n xPos += distancex;\n yPos -= distancey;\n } else if (counterx == 1 && countery == 1) {\n xPos += distancex;\n yPos += distancey;\n }\n }",
"public boolean collision(Objet o) {\r\n\t\treturn false;\r\n\t}",
"@Override\n public void collide(ScreenObject other) {\n switch (other.getType()) {\n case ASTEROID:\n hp -= other.dealDamage();\n break;\n case ENEMY:\n hp -= other.dealDamage();\n break;\n case ENEMYBULLET:\n hp -= other.dealDamage();\n break;\n case MACGUFFIN:\n macguffinsCollected++;\n break;\n case PORT:\n if (macguffinsCollected >= level.getMacguffinCount()\n && boundingCircle.contains(other.getPosition())) {\n Gdx.app.log(\"Ship\", \"level over\");\n //ends level\n }\n break;\n }\n }",
"boolean canMoveTo(Vector2d position);",
"public void onCollision(GameObject go){\n\t\t// to be completed later\n\t}",
"private boolean hasPossibleMove()\n {\n for(int i=0; i<FieldSize; ++i)\n {\n for(int j=1; j<FieldSize; ++j)\n {\n if(field[i][j] == field[i][j-1])\n return true;\n }\n }\n for(int j=0; j<FieldSize; ++j)\n {\n for(int i=1; i<FieldSize; ++i)\n {\n if(field[i][j] == field[i-1][j])\n return true;\n }\n }\n return false;\n }",
"boolean doMove();",
"private boolean collides(GameObject gameObject1) {\n return collides(gameObject1, 0.5);\n }",
"private boolean handleCollision(CollisionResult result, Node movingNode, Node anotherNode,\n double oldX, double oldY){\n if(result.containFlag(CollisionResult.REJECT)){\n // set translate co-ord back to before\n movingNode.setTranslateX(oldX);\n movingNode.setTranslateY(oldY);\n }\n if(result.containFlag(CollisionResult.LOSE)){\n System.out.println(\"You've LOST the game!\");\n Platform.runLater(this::handleLose);\n mainAnimation.stop();\n return true;\n }\n if(result.containFlag(CollisionResult.WIN)){\n System.out.println(\"You've WON the game!\");\n handleWin();\n mainAnimation.stop();\n return true;\n }\n if(result.containFlag(CollisionResult.DELETE_FIRST)){\n dungeonPane.getChildren().remove(movingNode);\n }\n if(result.containFlag(CollisionResult.DELETE_SECOND)){\n dungeonPane.getChildren().remove(anotherNode);\n }\n if(result.containFlag(CollisionResult.REFRESH_INVENTORY)){\n updateInventory();\n }\n if(result.containFlag(CollisionResult.REFRESH_EFFECT_TIMER)){\n // second one is the one being collided\n Potion potion = (Potion) result.getCollidingObjects()[1];\n Timer timer = new Timer(potion, arg -> player.removePotionEffect(engine, potion));\n\n timers.add(timer);\n }\n return false;\n }",
"private boolean leftCollision(InteractiveObject obj){\n\t\treturn leftUpCollision(obj) || leftDownCollision(obj);\n\t}",
"void move() {\r\n\t\tif (x + xa < 0){\r\n\t\t\txa = mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\telse if (x + xa > game.getWidth() - diameter){\r\n\t\t\txa = -mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\tif (y + ya < 0){\r\n\t\t\tya = mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\telse if (y + ya > game.getHeight() - diameter){\r\n\t\t\tgame.gameOver();\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\tif (colisionPalas()){\r\n\t\t\tya = -mov;\r\n\t\t}\r\n\t\telse if(colisionEstorbos()){\r\n\t\t\tgame.puntuacion+=2;\r\n\t\t}\r\n\t\t\r\n\t\tx = x + xa;\r\n\t\ty = y + ya;\r\n\t}",
"public void collide(){\n hp -= 10;\n resetPos();\n //canMove = false;\n }",
"private void fireball2Collisions() {\r\n\t\tGObject topLeft = getElementAt(fireball2.getX() - 1, fireball2.getY());\r\n\t\tGObject topRight = getElementAt(fireball2.getX() + fireball2.getWidth() + 1, fireball2.getY());\r\n\t\tGObject bottomLeft = getElementAt(fireball2.getX() - 1, fireball2.getY() + fireball2.getHeight());\r\n\t\tGObject bottomRight = getElementAt(fireball2.getX() + fireball2.getWidth() + 1, fireball2.getY() + fireball2.getHeight());\r\n\t\tif(topLeft == player || topRight == player || bottomLeft == player || bottomRight == player) {\r\n\t\t\tremove(fireball2);\r\n\t\t\tfireball2 = null;\r\n\t\t\thits++;\r\n\t\t\tloseLife();\r\n\t\t}\r\n\t}",
"public abstract boolean attemptMove(Player currentPlayerObj, Coordinate move);",
"private boolean collisonCheck(List<Tile> nextTiles, Snake enemy) {\n\t\t// check himself\n\t\tfor (Tile tile : (List<Tile>)snakeTiles) {\n\t\t\tfor (Tile t : nextTiles) {\n\t\t\t\tif (tile.equals(t)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// check enemy\n\t\tfor (Tile tile : enemy.getSnakeTiles()) {\n\t\t\tfor (Tile t : nextTiles) {\n\t\t\t\tif (tile.equals(t)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"@Override\n\tpublic void act(float delta) {\n\t\tsuper.act(delta);\n\t\t\n\t\tif(PWM.instance().pointIsInObstacle(this.getX(), this.getY())){\n\t\t\tif(!PWM.instance().pointIsInObstacle(this.getX(), lastPos.y)){\n\t\t\t\tthis.setPosition(this.getX(), lastPos.y);\n\t\t\t}else if(!PWM.instance().pointIsInObstacle(lastPos.x, this.getY())){\n\t\t\t\tthis.setPosition(lastPos.x, this.getY());\n\t\t\t}else{\n\t\t\t\tthis.setPosition(lastPos.x, lastPos.y);\n\t\t\t}\n\t\t\t\n\t\t\tthis.lastPos.x = this.getX();\n\t\t\tthis.lastPos.y = this.getY();\n\t\t\t\n\t\t}\t\t\t\t\n\t\t\n\t\tmainCameraFollowHero();\n\t\t\n\t\t\n\t}",
"private void checkPlayerCollisions() {\r\n\t\tGObject left = getElementAt(player.getX() - 1, player.getY() + player.getHeight() / 2.0);\r\n\t\tGObject right = getElementAt(player.getX() + player.getWidth() + 1, player.getY() + player.getHeight() / 2.0);\r\n\t\tif(dragon1 != null && (left == dragon1 || right == dragon1)) {\r\n\t\t\tremove(lifeBar);\r\n\t\t\tlifeBar = null;\r\n\t\t}\r\n\t\tif(dragon2 != null && (left == dragon2 || right == dragon2)) {\r\n\t\t\tremove(lifeBar);\r\n\t\t\tlifeBar = null;\r\n\t\t}\r\n\t}",
"@Override\n public boolean canMove(double x, double y) {\n double xr = this.x, yr = this.y - 32; //subtract y to get more accurate results\n //the thing is, subract to 32 (sprite size), so if we add 1 tile we get the next pixel tile with this\n //we avoid the shaking inside tiles with the help of steps\n if (direction == 0) {\n yr += sprite.getSize() - 1;\n xr += sprite.getSize() / 2;\n }\n if (direction == 1) {\n yr += sprite.getSize() / 2;\n xr += 1;\n }\n if (direction == 2) {\n xr += sprite.getSize() / 2;\n yr += 1;\n }\n if (direction == 3) {\n xr += sprite.getSize() - 1;\n yr += sprite.getSize() / 2;\n }\n int xx = Coordinates.pixelToTile(xr) + (int) x;\n int yy = Coordinates.pixelToTile(yr) + (int) y;\n Entity a = Board.getInstance().getEntity(xx, yy, this); //entity of the position we want to go\n return !a.collide(this);\n }",
"public void checkCollision()\r\n\t{\r\n\t\t//for Bullets against Avatar and Enemy\r\n\t\tfor(int bulletIndex = 0; bulletIndex < bullets.size(); bulletIndex++)\r\n\t\t{\r\n\t\t\tBullet b = bullets.get(bulletIndex);\r\n\t\t\tif (b instanceof AvatarBullet)\r\n\t\t\t{\r\n\t\t\t\t@SuppressWarnings(\"unused\")\r\n\t\t\t\tboolean collided = false;\r\n\t\t\t\tfor (int enemyIndex = 0; enemyIndex < enemy.size(); enemyIndex++)\r\n\t\t\t\t{\r\n\t\t\t\t\tEnemy e = enemy.get(enemyIndex);\r\n\t\t\t\t\tif(((AvatarBullet) b).collidedWith(e))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbullets.remove(bulletIndex);\r\n\t\t\t\t\t\tbulletIndex--;\r\n\t\t\t\t\t\tenemy.remove(enemyIndex);\r\n\t\t\t\t\t\tenemyIndex --;\r\n\t\t\t\t\t\tcollided = true;\r\n\t\t\t\t\t\tint score = getScore()+1;\r\n\t\t\t\t\t\tsetScore(score);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (b instanceof EnemyBullet)\r\n\t\t\t{\r\n\t\t\t\tif (((EnemyBullet) b).collidedWith(avatar))\r\n\t\t\t\t{\r\n\t\t\t\t\tbullets.remove(bulletIndex);\r\n\t\t\t\t\tbulletIndex--;\r\n\t\t\t\t\tint health = Avatar.getLives()-1;\r\n\t\t\t\t\tavatar.setLives(health);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int platformIndex = 0; platformIndex < platforms.size(); platformIndex++)\r\n\t\t{\r\n\t\t\tPlatforms p = platforms.get(platformIndex);\r\n\t\t\tif (p instanceof Platforms)\r\n\t\t\t{\r\n\t\t\t\t//boolean collided = false;\r\n\t\t\t\t//Avatar a = avatar.get(enemyIndex);\r\n\t\t\t\tif(((Platforms) p).collidedWith(avatar))\r\n\t\t\t\t{\r\n\t\t\t\t\tsetAlive(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\tsetAlive(false);\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}",
"@Override\n synchronized public void run() {\n if (gameBoard.wasCollisionDetected()) {\n Point collisionPoint = gameBoard.getLastCollision();\n if (collisionPoint.x >= 0) {\n dummyText.setText(\"Last Collision XY (\" + Integer.toString(collisionPoint.x) + \",\" + Integer.toString(collisionPoint.y) + \")\");\n score++;\n }\n //turn off the animation until reset gets pressed\n //return;\n }\n frame.removeCallbacks(frameUpdate);\n\n Point playerNewPosition = new Point(gameBoard.getPlayerX(), gameBoard.getPlayerY());\n Point targetNewPosition = new Point(gameBoard.getTargetX(), gameBoard.getTargetY());\n Point obstacle1NewPosition = new Point(gameBoard.getObstacle1X(), gameBoard.getObstacle1Y());\n Point obstacle2NewPosition = new Point(gameBoard.getObstacle2X(), gameBoard.getObstacle2Y());\n\n updatePlayerVelocity();\n playerNewPosition.y = playerNewPosition.y + playerVelocity.y;\n if (playerNewPosition.y > playerMaxY) {\n // return doge to original position if it overshoots\n playerNewPosition.y = playerMaxY;\n performJump = false;\n button.setEnabled(true);\n }\n\n targetNewPosition.x = targetNewPosition.x + targetVelocity.x;\n if (targetNewPosition.x > memeMaxX || targetNewPosition.x < 5) {\n targetVelocity.x *= -1;\n }\n targetNewPosition.y = targetNewPosition.y + targetVelocity.y;\n if (targetNewPosition.y > memeMaxY || targetNewPosition.y < 5) {\n targetVelocity.y *= -1;\n }\n\n obstacle1NewPosition.x = obstacle1NewPosition.x + obstacle1Velocity.x;\n if (obstacle1NewPosition.x > memeMaxX || obstacle1NewPosition.x < 5) {\n obstacle1Velocity.x *= -1;\n }\n obstacle1NewPosition.y = obstacle1NewPosition.y + obstacle1Velocity.y;\n if (obstacle1NewPosition.y > memeMaxY || obstacle1NewPosition.y < 5) {\n obstacle1Velocity.y *= -1;\n }\n\n obstacle2NewPosition.x = obstacle2NewPosition.x + obstacle2Velocity.x;\n if (obstacle2NewPosition.x > memeMaxX || obstacle2NewPosition.x < 5) {\n obstacle2Velocity.x *= -1;\n }\n obstacle2NewPosition.y = obstacle2NewPosition.y + obstacle2Velocity.y;\n if (obstacle2NewPosition.y > memeMaxY || obstacle2NewPosition.y < 5) {\n obstacle2Velocity.y *= -1;\n }\n\n gameBoard.setPlayerPosition(playerNewPosition.x, playerNewPosition.y);\n gameBoard.setTargetPosition(targetNewPosition.x, targetNewPosition.y);\n gameBoard.setObstacle1Position(obstacle1NewPosition.x, obstacle1NewPosition.y);\n gameBoard.setObstacle2Position(obstacle2NewPosition.x, obstacle2NewPosition.y);\n gameBoard.invalidate();\n frame.postDelayed(frameUpdate, getFrameRate());\n }",
"@Override\n\tpublic void move() {\n\t\tx += ((direction) * xSpeed);\n\t\t//If any sprite has collided with the left or right edge of the screen set collided to true\n\t\tif (x >= 800 - spriteImage.getWidth(null) || x <= 0) collided = true;\n\t}",
"@Override\r\n public void update() {\r\n super.update();\r\n hero.checkForTileCollision(getXOverlap(hero.oldx,hero.oldx+width,hero.x,hero.x+width), getYOverlap(hero.oldy,hero.oldy+hero.height,hero.y, hero.y+hero.height));\r\n int i = 0;\r\n\r\n while (turningPoints[i]!= null)\r\n {\r\n if (intersects(turningPoints[i].x,turningPoints[i].y, turningPoints[i].width,turningPoints[i].height))\r\n {\r\n vx = -vx;\r\n vy = -vy;\r\n }\r\n i++;\r\n }\r\n }",
"public boolean collides(AirObject ao) {\n LinkedNode curr = head;\n while (curr != null) {\n if (!curr.collides(ao)) {\n return false;\n }\n curr = curr.next();\n }\n return true;\n }",
"@Override\r\n public boolean canMove() {\r\n Grid<Actor> gr = getGrid();\r\n int dirs[] = {\r\n Location.AHEAD, Location.HALF_CIRCLE, Location.LEFT,\r\n Location.RIGHT };\r\n // 当终点在周围时,不能移动且isEnd应当为true\r\n for (int i = 0; i < dirs.length; i++) {\r\n Location tarLoc = getLocation().getAdjacentLocation(dirs[i]);\r\n if (gr.isValid(tarLoc) && gr.get(tarLoc) != null) {\r\n // Color直接用==计算竟然不可行(真是哔了dog...\r\n if (gr.get(tarLoc) instanceof Rock\r\n && gr.get(tarLoc).getColor().equals(Color.RED)) {\r\n isEnd = true;\r\n return false;\r\n }\r\n }\r\n }\r\n ArrayList<Location> nextLocs = getValid(getLocation());\r\n // 当附近没有可以移动的位置时,不能移动\r\n if (nextLocs.size() == 0) {\r\n return false;\r\n }\r\n // 当可以移动的位置>1时,说明存在一个节点,这个节点应当被新建一个arraylist入栈\r\n if (nextLocs.size() > 1) {\r\n ArrayList<Location> newStackElem = new ArrayList<Location>();\r\n newStackElem.add(getLocation());\r\n crossLocation.push(newStackElem);\r\n }\r\n // 有可以移动的位置时,向概率最高的方向移动\r\n int maxProbLoc = 0;\r\n // 由于nextLocs不一定有4个location,所以只好循环判断取最大值\r\n for (int i = 0; i < nextLocs.size(); i++) {\r\n Location loc = nextLocs.get(i);\r\n int dirNum = getLocation().getDirectionToward(loc) / 90;\r\n if (probablyDir[dirNum] > probablyDir[maxProbLoc]) {\r\n maxProbLoc = i;\r\n }\r\n }\r\n next = nextLocs.get(maxProbLoc);\r\n return true;\r\n }",
"public void collision(){\r\n\t\tif(currX < 0 || currX > 1000-width || currY < 0 || currY > 700-height){\r\n\t\t\tinGame=false;\r\n\t\t}\r\n\t\t/*\r\n\t\tI start at 1 because tail[0] will constantly be taking the position\r\n\t\tof the snake's head, so if i start at 0, the game would end immediately.\r\n\t\t*/\r\n\t\tfor(int i=1; i < numOranges; i++){\r\n\t\t\tRectangle currOrangeRect = new Rectangle(tail[i].getXcoords(), tail[i].getYcoords(), OrangeModel.getWidth(), OrangeModel.getHeight());\r\n\t\t\tif(new Rectangle(currX, currY, width, height).intersects(currOrangeRect)){\r\n\t\t\t\tinGame=false;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void paradiseMove(){\n if (!getCurrentMainCellCoordinates().equals(new DiscreteCoordinates(11, 9))) {\n move(30);\n }\n }",
"public boolean collision(GameObject initial, GameObject secondary){\n\n if (Rect.intersects(initial.getHitbox(),secondary.getHitbox())){\n MediaPlayer myplayer = MediaPlayer.create(getContext(), R.raw.robloxdeath);\n myplayer.start();\n return true;\n }\n return false;\n\n }",
"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 hasCollided(GameObject object1, GameObject object2){\n Position pos1 = object1.getPos();\n Position pos2 = object2.getPos();\n int object1Width = object1.getWidth();\n int object2Width = object2.getWidth();\n if(object1Width < 0){\n pos1.setX(pos1.getX()+object1Width);\n object1Width = Math.abs(object1Width);\n }\n if(object2Width < 0){\n pos2.setX(pos2.getX()+object2Width);\n object2Width = Math.abs(object2Width);\n }\n\n return(!(pos1.getX()+object1Width<pos2.getX()\n //Checks if the object is on either side of the other. If it is not, it is inside.\n || pos1.getY()>pos2.getY()+object2.getHeight()\n || pos1.getY() + object1.getHeight()<pos2.getY()\n || pos1.getX()>pos2.getX()+object2Width));\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}",
"private boolean rightUpCollision(InteractiveObject obj){\n\t\treturn (((obj.getX() - this.getX()) < this.getWidth()) && (obj.getX() > this.getX()) &&\n\t\t\t\t((this.getY() - obj.getY()) < obj.getHeight()) && (this.getY() > obj.getY()));\n\t}",
"private boolean isBallCollideCelling(GOval ball) {\n return ball.getY() <= 0;\n }",
"public void checkCollisions(){\n for(int i=bodyParts;i>0;i--){\n if((x[0]==x[i])&&(y[0]==y[i])){\n running=false;\n }\n }\n //head with left border\n if(x[0]<0){\n running=false;\n }\n //head with right border\n if(x[0]>screen_width){\n running=false;\n }\n //head with top border\n if(y[0]<0){\n running=false;\n }\n //head with bottom border\n if(y[0]>screen_height){\n running=false;\n }\n if(!running){\n timer.stop();\n }\n }",
"protected void onPlayerCollide(long time) {\n\t\tspecialMovement(player1, GameMap.WALL);\n\t\tspecialMovement(player2, GameMap.WALL);\n\t}",
"void move()\n {\n Random rand = new Random();\n int moveOrNot = rand.nextInt(2);//50% chance\n if(moveOrNot == 1)\n super.move();\n }",
"private void collision(){\n\t\tboolean touched = false;\n\t\tboolean hit;\n\t\tint j =0;\n\t\twhile ( j< this.game_.getSaveBaby().size() && !touched){\n\t\t\tBabyBunnies b = this.game_.getSaveBaby().get(j);\n\t\t\ttouched = this.game_.getBunnyHood().getPosition().dst(b.getPosition())<=80;\n\t\t\thit = this.game_.getWolf().getPosition().dst(b.getPosition())<=80;\n\t\t\tif (touched){\n\t\t\t\tthis.game_.setBabySaved(b);\n\t\t\t}\n\t\t\tif (hit){\n\t\t\t\tthis.game_.wolfCatchBunnies(b);\n\t\t\t\t/**\n\t\t\t\t * Test de callback, retour vers l app android\n\t\t\t\t */\n\t\t\t\tif(this.game_.getScoreWolf()==3){\n\t\t\t\t\tif (this.gameCallBack != null) {\n\n this.gameCallBack.gameOverActivity(this.game_.getScoreBunny());\n\t\t\t\t\t\tthis.isGameOver=true;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tGdx.app.log(\"MyGame\", \"To use this class you must implement MyGameCallback!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tj++;\n\t\t}\n\t}",
"private void checkCollisions() {\n float x = pacman.getPos().x;\n float y = pacman.getPos().y;\n\n GameEntity e;\n for (Iterator<GameEntity> i = entities.iterator(); i.hasNext(); ) {\n e = i.next();\n // auf kollision mit spielfigur pruefen\n if (Math.sqrt((x - e.getPos().x) * (x - e.getPos().x) + (y - e.getPos().y) * (y - e.getPos().y)) < 0.5f)\n if (e.collide(this, pacman))\n i.remove();\n }\n }",
"boolean player2Collisions(Direction direction, TwoPlayerBoard board) {\n\n Board.logger.log(Logger.LoggingType.DEBUG, \"player2Collisions\",\n \"Checking whether the actor is colliding with a player...\");\n\n if (direction == Direction.LEFT) {\n if (this.isLeftCollision(board.player2)) {\n Board.logger.log(Logger.LoggingType.DEBUG, \"player2Collisions\",\n \"There is a player to the LEFT of the actor...\");\n return true;\n }\n return false;\n } else if (direction == Direction.RIGHT) {\n if (this.isRightCollision(board.player2)) {\n Board.logger.log(Logger.LoggingType.DEBUG, \"player2Collisions\",\n \"There is a player to the RIGHT of the actor...\");\n return true;\n }\n return false;\n } else if (direction == Direction.UP) {\n if (this.isTopCollision(board.player2)) {\n Board.logger.log(Logger.LoggingType.DEBUG, \"player2Collisions\",\n \"There is a player to the TOP of the actor...\");\n return true;\n }\n return false;\n } else /* if (dir == Direction.DOWN) */ {\n if (this.isBottomCollision(board.player2)) {\n Board.logger.log(Logger.LoggingType.DEBUG, \"player2Collisions\",\n \"There is a player to the BOTTOM of the actor...\");\n return true;\n }\n Board.logger.log(Logger.LoggingType.DEBUG, \"player2Collisions\",\n \"There are no players blocking the actor, returning.\");\n return false;\n }\n\n }",
"public boolean move() {\n\t double[] movePre = movePreProcessing();\n\n double dxbak=movePre[0], dybak=movePre[1], dthetabak=movePre[2];\n boolean collision = false;\n\t\t\n\t\tif (hasGrown!=0 || dx!=0 || dy!=0 || dtheta!=0) {\n\t\t\thasMoved = true;\n\t\t\t// Check it is inside the world\n\t\t\tcollision = !isInsideWorld();\n\t\t\t// Collision detection with biological corridors\n\t\t\tif (alive) {\n\t\t\t\tOutCorridor c = _world.checkHitCorridor(this);\n\t\t\t\tif (c != null && c.canSendOrganism()) {\n\t\t\t\t\tif (c.sendOrganism(this))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Collision detection with other organisms.\n Organism otherOrganism = _world.checkHit(this);\n\t\t\tif (otherOrganism != null) {\n\t\t\t if (this.contact(otherOrganism)) {\n collision = true;\n }\n }\n\n\n\t\t\t// If there is a collision, undo movement.\n\t\t\tif (collision) {\n\t\t\t\thasMoved = false;\n\t\t\t\toffset(-dxbak,-dybak,-dthetabak);\n\t\t\t\tif (hasGrown!=0) {\n\t\t\t\t\t_growthRatio+=hasGrown;\n\t\t\t\t\tsymmetric();\n\t\t\t\t}\n\t\t\t\tcalculateBounds(hasGrown!=0);\n\t\t\t}\n\t\t}\n\t\t// Substract one to the time needed to reproduce\n\t\tif (_timeToReproduce > 0)\n\t\t\t_timeToReproduce--;\n\t\t// Check if it can reproduce: it needs enough energy and to be adult\n\t\tif (_energy > _geneticCode.getReproduceEnergy() + Utils.YELLOW_ENERGY_CONSUMPTION*(_nChildren-1)\n\t\t\t\t&& _growthRatio==1 && _timeToReproduce==0 && alive)\n\t\t\treproduce();\n\t\t// Check that it don't exceed the maximum chemical energy\n\t\tif (_energy > _geneticCode.getReproduceEnergy()) {\n\t\t\tif (_energy > 2*_geneticCode.getReproduceEnergy()) {\n\t\t\t\tuseEnergy(_energy - 2*_geneticCode.getReproduceEnergy());\n\t\t\t} else {\n\t\t\t useEnergy((_energy - _geneticCode.getReproduceEnergy()) / 300);\n\t\t\t}\n\t\t}\n\t\t// Maintenance\n\t\tbreath();\n\t\t// Check that the organism has energy after this frame\n\t\treturn _energy > Utils.tol;\n\t}",
"public void checkCollision(Enemy enemy){\r\n if(collidingEntity!=null && collidingEntity!=enemy){\r\n return;\r\n }\r\n FloatRect x = enemy.getRect ();\r\n\r\n if (rect1==null || x==null){\r\n return;\r\n }\r\n\r\n FloatRect ins = rect1.intersection (x);\r\n\r\n if(ins!=null) {\r\n this.collidingEntity= enemy;\r\n collide=true;\r\n checkRightCollision (x);\r\n checkLeftCollision (x);\r\n bounce(enemy);\r\n } else {\r\n noCollision ();\r\n }\r\n }",
"public void checkCollision(Actor a) {\r\n\t\tif (a.equals(this))\r\n\t\t\treturn;\r\n\r\n\t\tPolygon otherPoly = a.basePoly;\r\n\t\tint distance = 1;\r\n\r\n\t\tif (otherPoly != null && basePoly != null) {\r\n\t\t\t// Calculate distance using the formula x^2 + y^2 = z^2\r\n\t\t\tint x = otherPoly.getBounds().x - basePoly.getBounds().x;\r\n\t\t\tint y = otherPoly.getBounds().y - basePoly.getBounds().y;\r\n\t\t\tdistance = (int) Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\r\n\t\t}\r\n\t\tif (distance > 150 || a instanceof Particle)\r\n\t\t\treturn;\r\n\r\n\t\tfor (int i = 0; i < basePoly.npoints; i++) {\r\n\t\t\tif (otherPoly.contains(new Point(basePoly.xpoints[i],\r\n\t\t\t\t\tbasePoly.ypoints[i]))) {\r\n\t\t\t\tonCollision(a);\r\n\t\t\t\ta.onCollision(a);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public boolean isCollision(Ball ob) { // Kollisionsabfrage\r\n\t\t\r\n\t\tdX = posX - ob.getPosX();\r\n\t\tdY = posY - ob.getPosY();\r\n\t\tfloat vector = dX * dX + dY * dY;\r\n\t\tfloat hypo = radius * radius * 4;\r\n\t\tif (hypo >= vector) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"private void handleCollisions(Sprite sprite1, Sprite sprite2){\n\t\tif(!sprite1.isActive() || !sprite2.isActive()) return;\n\n\t\tif(sprite1.equals(sprite2)){\n\t\t\treturn;\n\t\t}\n\n\t\tBounds boundsSprite1 = renderSprite(sprite1).getChildren().get(0).getBoundsInParent();\n\t\tBounds boundsSprite2 = (renderSprite(sprite2).getChildren().get(0).getBoundsInParent());\n\n\t\tif(boundsSprite1.intersects(boundsSprite2)) {\n\t\t\tcollisionHandler.handleCollide(sprite1, sprite2);\n\t\t}\n\n\t}",
"public void move() {\n boolean changeDirection = true;\r\n if (y + y1 < 0) { // We want to change the direction if the ball hits the upper border\r\n y1 = game.speed;\r\n }else if (y + y1 > game.getHeight() - DIAMETER) { // we want to change the direction if the ball hits the lower border\r\n y1 = -game.speed;\r\n }else if (x + x1 < 0) { // Checks if the ball hits the left or right border. If it does, the round ends\r\n score2++;\r\n game.player2Score = score2;\r\n x1 = game.speed;\r\n }else if (x + x1 > game.getWidth() - DIAMETER) {\r\n score1++;\r\n game.player1Score = score1;\r\n x1 = -game.speed;\r\n }else if (collision1()) { // checks if our ball collides with our first racket\r\n x1 = -game.speed;\r\n// y = game.racket1.getTopY() - DIAMETER;\r\n game.speed++;\r\n }else if (collision2()) { // checks if our ball collides with our second racket\r\n x1 = game.speed + 1;\r\n// y = game.racket2.getTopY() + DIAMETER;\r\n// game.speed++;\r\n }else { // if neither of the borders nor the rackets are hit, we don't change our direction of the ball\r\n changeDirection = false;\r\n }\r\n if (changeDirection) { // if the ball hits the border or the racket, the sound of collision is going to play.\r\n Sound.BALL.play();\r\n }\r\n\r\n if (score1 == 3 || score2 == 3) {\r\n game.gameOver(\" Wins!\");\r\n }\r\n x += x1; // helps in moving our ball in x-axis\r\n y += y1; // helps in moving our ball in y-axis\r\n }",
"public static void checkCollisions() {\n\t \n\t\tfor (Ball b1 : Panel.balls) {\n\t\t\tfor (Ball b2 : Panel.balls) {\n\t\t\t\tif (b1.Bounds().intersects(b2.Bounds()) && !b1.equals(b2)) {\t\t\t//checking for collision and no equals comparisions\n\t\t\t\t\tint vX = b1.getxVelocity();\n\t\t\t\t\tint vY = b1.getyVelocity();\n\t\t\t\t\tb1.setxVelocity(b2.getxVelocity());\t\t\t\t\t\t\t\t//reversing velocities of each Ball object\n\t\t\t\t\tb1.setyVelocity(b2.getyVelocity());\n\t\t\t\t\tb2.setxVelocity(vX);\n\t\t\t\t\tb2.setyVelocity(vY);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public boolean collision(Object a, Object b) {\n if (Rect.intersects(a.getRect(), b.getRect())) { //if the two objects hitboxes colide\n return true;\n }\n return false;\n }",
"protected void check_turn(List<CollisionObject> collidables) {\n //Firing rays\n\n //select an area of 180 degrees (pi radians)\n boolean turn = true;\n Vector2 start_point = get_ray_fire_point();\n for (int ray = 0; ray <= number_of_rays; ray++) {\n\n if (turn) {\n ray--;\n float ray_angle = sprite.getRotation() + ((ray_angle_range / (number_of_rays / 2)) * ray);\n turn = false;\n } else {\n float ray_angle = sprite.getRotation() - ((ray_angle_range / (number_of_rays / 2)) * ray);\n turn = true;\n }\n\n float ray_angle = ((ray_angle_range / number_of_rays) * ray) + sprite.getRotation();\n\n for (float dist = 0; dist <= ray_range; dist += ray_step_size) {\n\n double tempx = (Math.cos(Math.toRadians(ray_angle)) * dist) + (start_point.x);\n double tempy = (Math.sin(Math.toRadians(ray_angle)) * dist) + (start_point.y);\n //check if there is a collision hull (other than self) at (tempx, tempy)\n for (CollisionObject collideable : collidables) {\n if (collideable.isShown() &&\n ((Obstacle) collideable).getSprite().getY() > sprite.getY() - 200 &&\n ((Obstacle) collideable).getSprite().getY() < sprite.getY() + 200 &&\n ((Obstacle) collideable).getSprite().getX() > sprite.getX() - 200 &&\n ((Obstacle) collideable).getSprite().getX() < sprite.getX() + 200)\n for (Shape2D bound : collideable.getBounds().getShapes()) {\n if (bound.contains((float) tempx, (float) tempy)) {\n // Determines which side the ai should turn to\n if (turn) {\n turn(-1);\n return;\n } else {\n turn(1);\n return;\n }\n\n }\n }\n\n }\n }\n }\n }",
"void collision(float x_a,float y_a,float x_b,float y_b){\n float dy = y_a - y_b;\r\n float dx = x_a - x_b;\r\n float distance12 = dy * dy + dx * dx;\r\n\r\n if (distance12 < ((2 * ballRadius) * (2 * ballRadius))) {\r\n\r\n ((GameActivity)mActivity).mTimer.cancel();\r\n ((GameActivity)mActivity).layout.removeAllViews();\r\n new AlartMessage(mActivity);\r\n }\r\n\r\n }",
"private void move() {\n if(this.movement[0]) {\n moveRight();\n } else {\n moveLeft();\n }\n if(this.movement[1]) {\n moveDown();\n } else {\n moveUp();\n }\n\n //Checking boundaries of the game\n if(this.XPosition + this.ballWidth > instance.getWidth()) {\n this.movement[0] = false;\n } else if(XPosition <= 0) {\n this.movement[0] = true;\n } else if(YPosition <= 0) {\n this.movement[1] = true;\n } else if(YPosition + ballHeight >= instance.getHeight()) {\n instance.missedBall();\n if (instance.getBalls() > 0){\n this.lostLife.play();\n }\n this.XPosition = instance.getWidth() / 2;\n this.YPosition = instance.getHeight() - 43;\n this.movement[1] = false;\n Player.setPlayerX((instance.getWidth() - 111) / 2);\n Player.setPlayerY(instance.getHeight() - 19);\n instance.isPaused(true);\n }\n\n if (this.boundingBox.intersects(this.playerBoundingBox)){\n Rectangle leftHalfOfPlayer = new Rectangle((int)this.playerBoundingBox.getWidth() / 2, (int)this.playerBoundingBox.getHeight(),\n this.playerBoundingBox.x, this.playerBoundingBox.y);\n this.movement[0] = !this.boundingBox.intersects(leftHalfOfPlayer);\n this.movement[1] = false;\n } else {\n // Check if ball collides with brick;\n for (Bricks[] bricks : instance.getBricks()){\n for (Bricks brick: bricks){\n if (brick.collidesWith(new Rectangle(this.XPosition , this.YPosition , this.ballWidth , this.ballHeight))){\n Rectangle iRect = brick.brickHitBox.intersection(this.boundingBox);\n brick.destroy();\n //Sound brickBreak = new Sound(\"res/Break-Sound.wav\");\n this.brickBreak.play();\n // make logic\n this.movement[1] = true;\n if ((this.boundingBox.x+(this.boundingBox.width/2))<(iRect.x+(iRect.width/2))) {\n this.movement[0] = false;\n }\n if ((this.boundingBox.x+(this.boundingBox.width/2))>(iRect.x+(iRect.width/2))) {\n this.movement[0] = true;\n }\n if ((this.boundingBox.y+(this.boundingBox.height/2))<(iRect.y+(iRect.height/2))) {\n this.movement[1] = false;\n }\n }\n }\n }\n\n }\n\n }",
"public boolean intersects(BaseGameObject other) {\r\n return (other.getPosx() - this.getPosx())\r\n * (other.getPosx() - this.getPosx())\r\n + (other.getPosy() - this.getPosy())\r\n * (other.getPosy() - this.getPosy())\r\n < (other.bound + this.bound) * (other.bound + this.bound);\r\n }",
"public void act() \n {\n // need to explicitly cast as the World subclass (i.e., Game)\n playField = (Game)getWorld();\n \n // behavior depends on the game status\n if ( playField.getGameStatus() == Status.NOT_PLAYING )\n {\n // don't do anything\n }\n else if ( playField.getGameStatus() == Status.PLAYING )\n {\n move();\n \n /* \n * Check for intersection with the player's paddle \n */\n Paddle possiblePaddle = (Paddle)( getOneObjectAtOffset(-4,0,Paddle.class) );\n if ( possiblePaddle != null )\n {\n // Display debug message\n System.out.printf(\"Ball has intersected with %s\\n\",possiblePaddle.toString());\n \n // compute return angle and increase speed by 10%\n // TODO: Since this code is duplicated elsewhere, I probably \n // should move it into a separate method in this class\n double hitLocation = (this.getExactY()-4.0) - (possiblePaddle.getExactY()-32.0);\n int returnAngle = (int)( 315.0 + (90.0/64.0)*hitLocation );\n getMovement().setDirection( returnAngle );\n getMovement().scale( 1.1 );\n playField.playHighBlip();\n } // end if\n \n /* \n * Check for intersection with the CPU paddle \n */\n CPUPaddle possibleCPUPaddle = (CPUPaddle)( getOneObjectAtOffset(+4,0,CPUPaddle.class) );\n if ( possibleCPUPaddle != null )\n {\n // Display debug message\n System.out.printf(\"Ball has intersected with %s\\n\",possibleCPUPaddle.toString());\n \n // compute return angle and increase speed by 10%\n // TODO: Since this code is duplicated elsewhere, I probably \n // should move it into a separate method in this class\n double hitLocation = (this.getExactY()-4.0) - (possibleCPUPaddle.getExactY()-32.0);\n int returnAngle = (int)( 225.0 - (90.0/64.0)*hitLocation );\n getMovement().setDirection( returnAngle );\n getMovement().scale( 1.1 );\n playField.playHighBlip();\n } // end if\n \n /*\n * If the ball hits the boundary, simply have it reflect off the \n * surface in the opposite Y direction \n */\n Boundary possibleTopBoundary = (Boundary)( getOneObjectAtOffset(0,-4,Boundary.class) );\n Boundary possibleBottomBoundary = (Boundary)( getOneObjectAtOffset(0,4,Boundary.class) );\n if ( possibleTopBoundary != null || possibleBottomBoundary != null )\n {\n getMovement().revertVertical();\n playField.playLowBlip();\n } // end if \n \n // check if the ball has passed the player's paddle\n if ( getExactX() <= 0 )\n {\n playField.updateScore( PLAYER_TWO );\n \n // TODO: Since this code is duplicated elsewhere, I probably \n // should move it into a separate method in this class\n setLocation( playField.GAME_WIDTH / 2, playField.GAME_HEIGHT / 2 );\n getMovement().setNeutral();\n getMovement().add( new Vector( -45 + Greenfoot.getRandomNumber( 90 ), 3.0 ) );\n \n if ( Greenfoot.getRandomNumber( 2 ) == 0 )\n {\n getMovement().revertHorizontal();\n } // end inner if\n \n playField.playLongBeep();\n } // end outer if\n \n // check if the ball has passed the CPU's paddle\n if ( getExactX() >= playField.GAME_WIDTH )\n {\n playField.updateScore( PLAYER_ONE );\n \n // TODO: Since this code is duplicated elsewhere, I probably \n // should move it into a separate method in this class\n setLocation( playField.GAME_WIDTH / 2, playField.GAME_HEIGHT / 2 );\n getMovement().setNeutral();\n getMovement().add( new Vector( -45 + Greenfoot.getRandomNumber( 90 ), 3.0 ) );\n \n if ( Greenfoot.getRandomNumber( 2 ) == 0 )\n {\n getMovement().revertHorizontal();\n } // end inner if\n \n playField.playLongBeep();\n } // end outer if\n \n } \n else if ( playField.getGameStatus() == Status.GAME_OVER )\n {\n playField.removeObject( this );\n } // end multiway if/else\n \n }",
"@Override\r\n public boolean collision(org.dyn4j.dynamics.Body body1, BodyFixture fixture1, org.dyn4j.dynamics.Body body2, BodyFixture fixture2) {\r\n //Default, keep processing this event\r\n\r\n return true;\r\n }",
"private void fireball1Collisions() {\r\n\t\tGObject topLeft = getElementAt(fireball1.getX() - 1, fireball1.getY());\r\n\t\tGObject bottomLeft = getElementAt(fireball1.getX() - 1, fireball1.getY() + fireball1.getHeight());\r\n\t\tGObject topRight = getElementAt(fireball1.getX() + fireball1.getWidth() + 1, fireball1.getY());\r\n\t\tGObject bottomRight = getElementAt(fireball1.getX() + fireball1.getWidth() + 1, fireball1.getY() + fireball1.getHeight());\r\n\t\tif(topLeft == player || bottomLeft == player || topRight == player || bottomRight == player) {\r\n\t\t\tremove(fireball1);\r\n\t\t\tfireball1 = null;\r\n\t\t\thits++;\r\n\t\t\tloseLife();\r\n\t\t}\r\n\t}",
"public boolean isColliding(){\n for(int i = 0; i < eng.getIDManager().getObjectsWithID(\"GameObject\").size(); i++){\n GameObject temp = eng.getIDManager().getObjectsWithID(\"GameObject\").get(i);\n \n if(temp.getHitBox().getBounds().intersects(rect.getBounds()) &&\n temp.getHitBox() != this){\n currentCollidingObject = temp;\n return true;\n }\n }\n \n return false;\n }",
"public void move() {\r\n if(direction == 1) {\r\n if(userRow < grid.getNumRows() - 1) {\r\n userRow++;\r\n handleCollision(userRow, 1);\r\n }\r\n } else if(direction == -1) {\r\n if(userRow > 0) {\r\n userRow--;\r\n handleCollision(userRow, 1);\r\n }\r\n }\r\n }"
] | [
"0.7112477",
"0.6869203",
"0.6714625",
"0.66922265",
"0.6633041",
"0.66165525",
"0.65949184",
"0.6536871",
"0.6529958",
"0.6464267",
"0.6418684",
"0.6409755",
"0.6392966",
"0.6383954",
"0.63623506",
"0.63478553",
"0.6341241",
"0.63151324",
"0.6309191",
"0.6286604",
"0.6264994",
"0.62573016",
"0.6250684",
"0.6237937",
"0.6221344",
"0.6218383",
"0.6217131",
"0.62085086",
"0.62078285",
"0.62018025",
"0.6197304",
"0.619558",
"0.6179418",
"0.6173738",
"0.6168133",
"0.6160046",
"0.6158815",
"0.61518097",
"0.6142934",
"0.61403334",
"0.6139954",
"0.61336344",
"0.6132971",
"0.61312294",
"0.6128783",
"0.6126682",
"0.6124967",
"0.61233586",
"0.6116216",
"0.61052215",
"0.6097205",
"0.60837156",
"0.60830784",
"0.60815907",
"0.6079624",
"0.6077762",
"0.607382",
"0.6070198",
"0.60668576",
"0.60622936",
"0.60617673",
"0.6053815",
"0.604654",
"0.60460895",
"0.60447824",
"0.6034582",
"0.6024694",
"0.60215944",
"0.6018162",
"0.60163176",
"0.60154164",
"0.60146916",
"0.6006505",
"0.600068",
"0.5999239",
"0.59980565",
"0.59908843",
"0.5989255",
"0.5984778",
"0.598206",
"0.5976208",
"0.59733653",
"0.59706837",
"0.59674114",
"0.59539276",
"0.59469616",
"0.5944267",
"0.59346634",
"0.5933866",
"0.59322333",
"0.5930799",
"0.5929905",
"0.5925721",
"0.591783",
"0.5916824",
"0.5911782",
"0.59079516",
"0.59069824",
"0.59047216",
"0.5900348",
"0.5898844"
] | 0.0 | -1 |
check isCollision(tiles) with calculating the position for next move | public void move() {
if (!isCollision(xMove, 0))
moveX();
//else
// adjustX(xMove);
if (!isCollision(0, yMove))
moveY();
//else
// adjustY(yMove);
//check isCollision(gameObject) with calculating the position for next move
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void recheckTileCollisions() {\n\t\tint len = regTiles.size();\n\t\tfor(int i = 0; i < len; i ++) {\n\t\t\tRegTile tile = regTiles.get(i);\n\t\t\t\n\t\t\ttry{\n\t\t\t\tif(OverlapTester.overlapRectangles(player.bounds, tile.bounds)) {\n\t\t\t\t\t//check-x cols and fix\n\t\t\t\t\tif(player.position.x > tile.position.x - tile.bounds.width/2 && player.position.x < tile.position.x + tile.bounds.width/2 && player.position.y < tile.position.y + tile.bounds.height/2 && player.position.y > tile.position.y - tile.bounds.height/2) {\n\t\t\t\t\t\tif(player.position.x < tile.position.x) {\n\t\t\t\t\t\t\tplayer.position.x = tile.position.x - 1;\n\t\t\t\t\t\t} else if(player.position.x > tile.position.x) {\n\t\t\t\t\t\t\tplayer.position.x = tile.position.x + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t} catch (Exception e) {}\n\t\t}\n\t}",
"public void processMove(MahjongSolitaireMove move)\n {\n // REMOVE THE MOVE TILES FROM THE GRID\n ArrayList<MahjongSolitaireTile> stack1 = tileGrid[move.col1][move.row1];\n ArrayList<MahjongSolitaireTile> stack2 = tileGrid[move.col2][move.row2]; \n MahjongSolitaireTile tile1 = stack1.remove(stack1.size()-1);\n MahjongSolitaireTile tile2 = stack2.remove(stack2.size()-1);\n \n // MAKE SURE BOTH ARE UNSELECTED\n tile1.setState(VISIBLE_STATE);\n tile2.setState(VISIBLE_STATE);\n \n // SEND THEM TO THE STACK\n tile1.setTarget(TILE_STACK_X + TILE_STACK_OFFSET_X, TILE_STACK_Y + TILE_STACK_OFFSET_Y);\n tile1.startMovingToTarget(MAX_TILE_VELOCITY);\n tile2.setTarget(TILE_STACK_X + TILE_STACK_2_OFFSET_X, TILE_STACK_Y + TILE_STACK_OFFSET_Y);\n tile2.startMovingToTarget(MAX_TILE_VELOCITY);\n stackTiles.add(tile1);\n stackTiles.add(tile2); \n \n // MAKE SURE THEY MOVE\n movingTiles.add(tile1);\n movingTiles.add(tile2);\n \n // AND MAKE SURE NEW TILES CAN BE SELECTED\n selectedTile = null;\n \n // PLAY THE AUDIO CUE\n miniGame.getAudio().play(MahjongSolitairePropertyType.MATCH_AUDIO_CUE.toString(), false);\n \n // NOW CHECK TO SEE IF THE GAME HAS EITHER BEEN WON OR LOST\n \n // HAS THE PLAYER WON?\n if (stackTiles.size() == NUM_TILES)\n {\n // YUP UPDATE EVERYTHING ACCORDINGLY\n endGameAsWin();\n }\n else\n {\n // SEE IF THERE ARE ANY MOVES LEFT\n MahjongSolitaireMove possibleMove = this.findMove();\n if (possibleMove == null)\n {\n // NOPE, WITH NO MOVES LEFT BUT TILES LEFT ON\n // THE GRID, THE PLAYER HAS LOST\n endGameAsLoss();\n }\n }\n }",
"public void checkTileMapCollision() {\t\t\t// Works for both x and y directions. Only going to use the x-component for now but leaves room for future expansion.\n\n\t\tcurrCol = (int)x / tileSize;\n\t\tcurrRow = (int)y / tileSize;\n\n\t\txdest = x + dx;\n\t\tydest = y + dy;\n\n\t\txtemp = x;\n\t\tytemp = y;\n\n\t\tcalculateCorners(x, ydest);\n\t\tif (dy < 0) { \t\t\t// upwards\n\t\t\tif (topLeft || topRight) {\n\t\t\t\tdy = 0;\n\t\t\t\tytemp = currRow * tileSize + height / 2;\t\t\t// Set just below where we bumped our head.\n\t\t\t} else {\n\t\t\t\tytemp += dy;\t\t// Otherwise keep going.\n\t\t\t}\n\t\t}\n\t\tif (dy > 0) { \t\t\t// downwards\n\t\t\tif (bottomLeft || bottomRight) {\n\t\t\t\tdy = 0;\n\t\t\t\tfalling = false;\n\t\t\t\tytemp = (currRow + 1) * tileSize - height / 2;\n\t\t\t} else {\n\t\t\t\tytemp += dy;\n\t\t\t}\n\t\t}\n\n\t\tcalculateCorners(xdest, y);\n\t\tif (dx < 0) { \t\t\t// left\n\t\t\tif (topLeft || bottomLeft) {\n\t\t\t\tdx = 0;\n\t\t\t\txtemp = currCol * tileSize + width / 2;\n\t\t\t} else {\n\t\t\t\txtemp += dx;\n\t\t\t}\n\t\t}\n\t\tif (dx > 0) { \t\t\t// right\n\t\t\tif (topRight || bottomRight) {\n\t\t\t\tdx = 0;\n\t\t\t\txtemp = (currCol + 1) * tileSize - width / 2;\n\t\t\t} else {\n\t\t\t\txtemp += dx;\n\t\t\t}\n\t\t}\n\n\t\tif(!falling) {\n\t\t\tcalculateCorners(x, ydest + 1);\t\t\t// Have to check the ground 1 pixel below us and make sure we haven't fallen off a cliff\n\t\t\tif(!bottomLeft && !bottomRight) {\n\t\t\t\tfalling = true;\n\t\t\t}\n\t\t}\n\n\t}",
"private void checkRegTileCollisions(float deltaTime) {\n\t\tint len = regTiles.size();\n\t\tfor(int i = 0; i < len; i ++) {\n\t\t\tRegTile tile = regTiles.get(i);\n\t\t\t\n\t\t\t//overlap between player and tile\n\t\t\t\n\t\t\t//experiment with these values to get close to perfect collisions *************************\n\t\t\ttry {\n\t\t\t\tif(OverlapTester.overlapRectangles(player.bounds, tile.bounds)) {\n\t\t\t\t\t\n\t\t\t\t\t//check y - collisions\n\t\t\t\t\tif(player.position.y > tile.position.y + (tile.bounds.height / 2) && player.position.x - (player.bounds.width / 2) + correctionFactor < tile.position.x + (tile.bounds.width / 2) && player.position.x + (player.bounds.width / 2) - correctionFactor > tile.position.x - (tile.bounds.width / 2)) {\n\t\t\t\t\t\tplayer.velocity.y = 0;\n\t\t\t\t\t\tplayer.position.y = tile.position.y + 1;\n\t\t\t\t\t\tif(player.velocity.x > 3) {\n\t\t\t\t\t\t\tplayer.velocity.x -= 0.2f; //prev. optimal was .3\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(player.position.y < tile.position.y - (tile.bounds.height / 2) && player.position.x - (player.bounds.width / 2) + correctionFactor < tile.position.x + (tile.bounds.width / 2) && player.position.x + (player.bounds.width / 2) - correctionFactor > tile.position.x - (tile.bounds.width / 2)) {\n\t\t\t\t\t\tplayer.velocity.y = 0;\n\t\t\t\t\t\tplayer.position.y = tile.position.y - 1;\n\t\t\t\t\t\tif(player.velocity.x > 3) {\n\t\t\t\t\t\t\tplayer.velocity.x -= 0.2f;\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//check x - collision\n\t\t\t\t\tif(player.position.x > tile.position.x + (tile.bounds.width / 2) + correctionFactor && player.position.y - (player.bounds.height / 2) + correctionFactor < tile.position.y + (tile.bounds.height / 2) && player.position.y + (player.bounds.height / 2) - correctionFactor > tile.position.y - (tile.bounds.height / 2)) {\n\t\t\t\t\t\tplayer.velocity.x = 0;\n\t\t\t\t\t\txColliding = true;\n\t\t\t\t\t\tplayer.position.x = tile.position.x + 1; //animate possibly\n\t\t\t\t\t\tif(player.velocity.y > 0) {\n\t\t\t\t\t\t\t//player.velocity.y -= 0.2f;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(player.position.x < tile.position.x - (tile.bounds.width / 2) - correctionFactor && player.position.y - (player.bounds.height / 2) + correctionFactor < tile.position.y + (tile.bounds.height / 2) && player.position.y + (player.bounds.height / 2) - correctionFactor > tile.position.y - (tile.bounds.height / 2)) {\n\t\t\t\t\t\tplayer.velocity.x = 0;\n\t\t\t\t\t\txColliding = true;\n\t\t\t\t\t\tplayer.position.x = tile.position.x - 1; //animate possibly\n\t\t\t\t\t\tif(player.velocity.y > 0) {\n\t\t\t\t\t\t\t//player.velocity.y -= 0.2f;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t} catch (Exception e) {}\n\t\t}\n\t\trecheckTileCollisions(); //fix frame-skipping \n\t}",
"public void checkCollisionTile(Entity entity) {\n\t\t\tint entityLeftX = entity.worldX + entity.collisionArea.x;\n\t\t\tint entityRightX = entity.worldX + entity.collisionArea.x + entity.collisionArea.width;\n\t\t\tint entityUpY = entity.worldY + entity.collisionArea.y;\n\t\t\tint entityDownY = entity.worldY + entity.collisionArea.y + entity.collisionArea.height;\n\t\t\t\n\t\t\tint entityLeftCol = entityLeftX/gamePanel.unitSize;\n\t\t\tint entityRightCol = entityRightX/gamePanel.unitSize;\n\t\t\tint entityUpRow = entityUpY/gamePanel.unitSize;\n\t\t\tint entityDownRow = entityDownY/gamePanel.unitSize;\n\t\t\t\n\t\t\tint point1;\n\t\t\tint point2;\n\t\t\t//This point is used for diagonal movement\n\t\t\tint point3;\n\t\t\t\n\t\t\tswitch(entity.direction) {\n\t\t\t\t//Lateral and longitudinal movements\n\t\t\t\tcase \"up\":\n\t\t\t\t\tentityUpRow = (entityUpY - entity.speed) / gamePanel.unitSize;\n\t\t\t\t\t//Sets the top left and top right point to draw a line which will check for collision\n\t\t\t\t\tpoint1 = gamePanel.tileSet.mapTileNum[entityLeftCol][entityUpRow];\n\t\t\t\t\tpoint2 = gamePanel.tileSet.mapTileNum[entityRightCol][entityUpRow];\n\t\t\t\t\t//If either points are touched, turn on collision stopping movement\n\t\t\t\t\tif(gamePanel.tileSet.tile[point1].collision == true || gamePanel.tileSet.tile[point2].collision == true) {\n\t\t\t\t\t\tentity.collisionOn = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"down\":\n\t\t\t\t\tentityDownRow = (entityDownY + entity.speed) / gamePanel.unitSize;\n\t\t\t\t\tpoint1 = gamePanel.tileSet.mapTileNum[entityLeftCol][entityDownRow];\n\t\t\t\t\tpoint2 = gamePanel.tileSet.mapTileNum[entityRightCol][entityDownRow];\n\t\t\t\t\tif(gamePanel.tileSet.tile[point1].collision == true || gamePanel.tileSet.tile[point2].collision == true) {\n\t\t\t\t\t\tentity.collisionOn = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"left\":\n\t\t\t\t\tentityLeftCol = (entityLeftX - entity.speed) / gamePanel.unitSize;\n\t\t\t\t\tpoint1 = gamePanel.tileSet.mapTileNum[entityLeftCol][entityUpRow];\n\t\t\t\t\tpoint2 = gamePanel.tileSet.mapTileNum[entityLeftCol][entityDownRow];\n\t\t\t\t\tif(gamePanel.tileSet.tile[point1].collision == true || gamePanel.tileSet.tile[point2].collision == true) {\n\t\t\t\t\t\tentity.collisionOn = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"right\":\n\t\t\t\t\tentityRightCol = (entityRightX + entity.speed) / gamePanel.unitSize;\n\t\t\t\t\tpoint1 = gamePanel.tileSet.mapTileNum[entityRightCol][entityUpRow];\n\t\t\t\t\tpoint2 = gamePanel.tileSet.mapTileNum[entityRightCol][entityDownRow];\n\t\t\t\t\tif(gamePanel.tileSet.tile[point1].collision == true || gamePanel.tileSet.tile[point2].collision == true) {\n\t\t\t\t\t\tentity.collisionOn = true;\n\t\t\t\t\t}\n\t\t\t\t//Diagonal Movements\n\t\t\t\tcase \"upleft\":\n\t\t\t\t\tentityUpRow = (entityUpY - entity.speed) / gamePanel.unitSize;\n\t\t\t\t\tentityLeftCol = (entityLeftX - entity.speed) / gamePanel.unitSize;\n\t\t\t\t\t//Sets the top left and top right point to draw a line which will check for collision\n\t\t\t\t\tpoint1 = gamePanel.tileSet.mapTileNum[entityLeftCol][entityUpRow];\n\t\t\t\t\tpoint2 = gamePanel.tileSet.mapTileNum[entityRightCol][entityUpRow];\n\t\t\t\t\tpoint3 = gamePanel.tileSet.mapTileNum[entityLeftCol][entityDownRow];\n\t\t\t\t\t//If either points are touched, turn on collision stopping movement\n\t\t\t\t\tif(gamePanel.tileSet.tile[point1].collision == true || gamePanel.tileSet.tile[point2].collision == true || gamePanel.tileSet.tile[point3].collision == true) {\n\t\t\t\t\t\tentity.collisionOn = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"upright\":\n\t\t\t\t\tentityRightCol = (entityRightX + entity.speed) / gamePanel.unitSize;\n\t\t\t\t\tentityUpRow = (entityUpY - entity.speed) / gamePanel.unitSize;\n\t\t\t\t\tpoint1 = gamePanel.tileSet.mapTileNum[entityRightCol][entityUpRow];\n\t\t\t\t\tpoint2 = gamePanel.tileSet.mapTileNum[entityRightCol][entityDownRow];\n\t\t\t\t\tpoint3 = gamePanel.tileSet.mapTileNum[entityLeftCol][entityUpRow];\n\t\t\t\t\tif(gamePanel.tileSet.tile[point1].collision == true || gamePanel.tileSet.tile[point2].collision == true || gamePanel.tileSet.tile[point3].collision == true) {\n\t\t\t\t\t\tentity.collisionOn = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase \"downleft\":\n\t\t\t\t\tentityLeftCol = (entityLeftX - entity.speed) / gamePanel.unitSize;\n\t\t\t\t\tentityDownRow = (entityDownY + entity.speed) / gamePanel.unitSize;\n\t\t\t\t\tpoint1 = gamePanel.tileSet.mapTileNum[entityLeftCol][entityUpRow];\n\t\t\t\t\tpoint2 = gamePanel.tileSet.mapTileNum[entityLeftCol][entityDownRow];\n\t\t\t\t\tpoint3 = gamePanel.tileSet.mapTileNum[entityRightCol][entityDownRow];\n\t\t\t\t\tif(gamePanel.tileSet.tile[point1].collision == true || gamePanel.tileSet.tile[point2].collision == true || gamePanel.tileSet.tile[point3].collision == true) {\n\t\t\t\t\t\tentity.collisionOn = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"downright\":\n\t\t\t\t\tentityDownRow = (entityDownY + entity.speed) / gamePanel.unitSize;\n\t\t\t\t\tentityRightCol = (entityRightX + entity.speed) / gamePanel.unitSize;\n\t\t\t\t\tpoint1 = gamePanel.tileSet.mapTileNum[entityLeftCol][entityDownRow];\n\t\t\t\t\tpoint2 = gamePanel.tileSet.mapTileNum[entityRightCol][entityDownRow];\n\t\t\t\t\tpoint3 = gamePanel.tileSet.mapTileNum[entityRightCol][entityUpRow];\n\t\t\t\t\tif(gamePanel.tileSet.tile[point1].collision == true || gamePanel.tileSet.tile[point2].collision == true || gamePanel.tileSet.tile[point3].collision == true) {\n\t\t\t\t\t\tentity.collisionOn = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"public static boolean collision(String direction, int speed){\n\t\tMain.p.updateHitboxs();\n\t\t/*LeftBottomHitbox[0] = Main.p.xLeft;\n\t\tLeftBottomHitbox[1] = Main.p.yLeft;\n\t\tRightBottomHitbox[0] = Main.p.xRight;\n\t\tRightBottomHitbox[1] = Main.p.yRight;\n\t\tLeftTopHitbox[0] = Main.p.xLeft;\n\t\tLeftTopHitbox[1] = Main.p.yLeft-(3 * Main.SCALE);\n\t\tRightTopHitbox[0] = Main.p.xRight;\n\t\tRightTopHitbox[1] = Main.p.yRight-(3 * Main.SCALE);\n\t\tif(!direction.equals(\"p\")){\n\t\t\tresult1 = checkCollision(speed, direction, LeftBottomHitbox);\n\t\t\tresult2 = checkCollision(speed, direction, RightBottomHitbox);\n\t\t\tresult3 = checkCollision(speed, direction, LeftTopHitbox);\n\t\t\tresult4 = checkCollision(speed, direction, RightTopHitbox);\n\t\t\tif(animationSwitchCount == 4)\n\t\t\t\tMain.p.pg.animationSet = 1;\n\t\t\tanimationSwitchCount = 0;\n\t\t\treturn result1 || result2 || result3 || result4;\n\t\t}\n\t\tresult1 = checkPlayerCollision(LeftBottomHitbox[0], LeftBottomHitbox[1]);\n\t\tresult2 = checkPlayerCollision(RightBottomHitbox[0], RightBottomHitbox[1]);\n\t\tresult3 = checkPlayerCollision(LeftTopHitbox[0], LeftTopHitbox[1]);\n\t\tresult4 = checkPlayerCollision(RightTopHitbox[0], RightTopHitbox[1]);\n\t\treturn result1 || result2 || result3 || result4;\n\t\t\t*/\n\t\tArrayList<int[]> tiles = new ArrayList<int[]>();\n\t\tint tempX, tempY;\n\t\tboolean copy = false, xOverextended = false, yOverextended = false;\n\t\t\n\t\tif(direction.equals(\"x\")){\n\t\t\tx = Main.p.getXStart() + speed;\n\t\t\ty = Main.p.getYStart();\n\t\t}\n\t\telse if (direction.equals(\"y\")){\n\t\t\tx = Main.p.getXStart();\n\t\t\ty = Main.p.getYStart() + speed;\n\t\t}\n\t\tif(!direction.equals(\"p\")){\n\t\t\tfor(int yCount = 0; yCount <= Main.p.getCOLLISIONSIZEY(); yCount++){\n\t\t\t\ttempY = y + (yCount * Main.T);\n\t\t\t\tif(tempY > y + Main.p.getCOLLISIONDISTANCEY()){\n\t\t\t\t\ttempY = y + Main.p.getCOLLISIONDISTANCEY();\n\t\t\t\t\tyOverextended = true;\n\t\t\t\t}\n\t\t\t\tfor(int xCount = 0; xCount <= Main.p.getCOLLISIONSIZEX(); xCount++){\n\t\t\t\t\ttempX = x + (xCount * Main.T);\n\t\t\t\t\tif(tempX > x + Main.p.getCOLLISIONDISTANCEX()){\n\t\t\t\t\t\txOverextended = true;\n\t\t\t\t\t\ttempX = x + Main.p.getCOLLISIONDISTANCEX();\n\t\t\t\t\t}\n\t\t\t\t\ttempTile = Main.p.getCurrentTile(tempX, tempY);\n\t\t\t\t\tfor(int i = 0; i < tiles.size(); i++){\n\t\t\t\t\t\tif(tempTile[0] == tiles.get(i)[0] && tempTile[1] == tiles.get(i)[1]){\n\t\t\t\t\t\t\tcopy = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!copy){\n\t\t\t\t\t\tif(collisionOccured())\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\ttiles.add(tempTile);\n\t\t\t\t\t}\n\t\t\t\t\tcopy = false;\n\t\t\t\t\tif(xOverextended){\n\t\t\t\t\t\txOverextended = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(yOverextended)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//If no tile collision is found sprite collisions are checked\n\t\tfor(int i = 0; i < Main.currentLocation.ls.sprites.size(); i++){\n\t\t\tif(Main.currentLocation.ls.sprites.get(i) != null && Main.currentLocation.ls.sprites.get(i).playerCollision(x, y))\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"@Override\n\tpublic void move(List<TileCollision> collidedTiles) \n\t{\t\t\t \n\t\tfor (TileCollision tc : collidedTiles)\n\t\t{\n\n\t\t\tint tileType = tc.theTile.getTileType();\n\n\t\t\tisWall = false;\n\t\t\t// 11 and 12 are the only tiles that are not walls.\n\t\t\tfor (int i = 0; i < 11; i++)\n\t\t\t{\n\t\t\t\tif (tileType == i) isWall = true;\n\t\t\t}\n\n\t\t\tif (tileType == 13 && tc.collisionSide == 0)\n\t\t\t{\n\t\t\t\tmoveUpToTileSide(tc);\n\t\t\t\tsetDirection(Direction.RIGHT.getValue());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (isWall)\n\t\t {\n\t\t\t\tmoveUpToTileSide(tc);\n\t\t\t\tsetDirection(randomDirection());\n\t\t\t\treturn;\n\t\t }\n\n\t\t\t// Only gets executed when pacman is in it normal state, and not in\n\t\t\t// hunter mode.\n\t\t\tif(!pacman.isHunter())\n\t\t\t{\n\t\t\t if(isPacmanToClose() && !inToCloseZone)\n\t\t\t {\n\t\t\t \tinToCloseZone = true;\n\n\t\t\t \tif (pacman.movesUp() || pacman.movesDown())\n\t\t\t \t{\n\t\t\t \t\treverseVerticalDirection();\n\t\t\t \t}\n\t\t\t \tif (pacman.movesLeft() || pacman.movesRight())\n\t\t\t \t{\n\t\t\t \t\treverseHorizontalDirection();\t\t\t \n\t\t\t \t}\n\t\t\t\t}\n\t\t\t else \n\t\t\t\t{\n\t\t\t\t\tinToCloseZone = false;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// Only gets executed when pacman eat a power up and is the hunter.\n\t\t\telse if(pacman.isHunter())\n\t\t {\n\t\t\t if (isWall)\n\t\t\t { \n\t\t\t\t\tmoveUpToTileSide(tc);\n\t\t\t\t\tif (getDirection() == Direction.UP.getValue())\n\t\t\t\t\t{\n\t\t\t\t\t\tif(collided)\n\t\t\t\t\t\t{\t\t\t\t\t\t\t \n\t\t\t\t\t\t\tsetDirection(Direction.DOWN.getValue());\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\tsetDirection(Direction.RIGHT.getValue());\n\t\t\t\t\t\t\tcollided = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t else if (getDirection() == Direction.RIGHT.getValue())\n\t\t\t\t\t {\n\t\t\t if(collided)\n\t\t\t {\n\t\t\t \t setDirection(Direction.DOWN.getValue());\t\t\t \t \n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t\t\t\t setDirection(Direction.UP.getValue()); \n\t\t\t\t\t\t\t collided = true;\n\t\t\t }\n\t\t\t\t\t }\n\n\t\t\t\t\t else if (getDirection() == Direction.LEFT.getValue())\n\t\t\t\t\t {\n\t\t\t\t\t\t if(collided)\n\t\t\t\t\t\t {\n\t\t\t \t setDirection(Direction.RIGHT.getValue());\n\t\t\t\t\t\t }\n\t\t\t\t\t\t else\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t setDirection(Direction.UP.getValue()); \n\t\t\t\t\t\t\t collided = true;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\n\t\t\t\t\t else if (getDirection() == Direction.DOWN.getValue())\n\t\t\t\t\t {\n\t\t\t\t\t\t if(collided)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t setDirection(Direction.LEFT.getValue()); \t \n\t\t\t\t\t\t }\n\t\t\t\t\t else\n\t\t\t\t\t {\n\t\t\t\t\t\t\t setDirection(Direction.RIGHT.getValue()); \n\t\t\t\t\t\t\t collided = true;\n\t\t\t\t\t } \n\t\t\t\t\t }\t\t\t\t\t\t \n\t\t\t } \n\t\t\t else\n\t\t\t {\n\t\t\t collided = false;\t\t\t\t\t \n\t\t\t }\n\t\t }\n\t }\n\t}",
"private void updateTileCollisions(Mob mob) {\n\t\tif (mob instanceof Player) {\r\n\t\t\tmob.setScreenPosition(\r\n\t\t\t\t\tnew Point(\r\n\t\t\t\t\t\t\tMath.max(mob.getScreenPosition().x, mob.getWidth() / 2), \r\n\t\t\t\t\t\t\tMath.max(mob.getScreenPosition().y, mob.getHeight() / 2)));\r\n\t\t\tmob.setScreenPosition(\r\n\t\t\t\t\tnew Point(\r\n\t\t\t\t\t\t\tMath.min(mob.getScreenPosition().x, Display.getWidth() - mob.getWidth() / 2), \r\n\t\t\t\t\t\t\tMath.min(mob.getScreenPosition().y, Display.getHeight() - mob.getHeight() / 2)));\n\r\n\t\t\tmob.setAbsPosition(\r\n\t\t\t\t\tnew Point(\r\n\t\t\t\t\t\t\tMath.max(mob.getAbsPosition().x, mob.getWidth() / 2), \r\n\t\t\t\t\t\t\tMath.max(mob.getAbsPosition().y, mob.getHeight() / 2)));\r\n\t\t\tmob.setAbsPosition(\r\n\t\t\t\t\tnew Point(\r\n\t\t\t\t\t\t\tMath.min(mob.getAbsPosition().x, tilemap.getWidth() - mob.getWidth() / 2), \r\n\t\t\t\t\t\t\tMath.min(mob.getAbsPosition().y, tilemap.getHeight()) - mob.getHeight() / 2));\r\n\t\t}\r\n\r\n\t\tPoint center = mob.getScreenPosition().add(offset);\r\n\r\n\t\tboolean hitGround = false; // used to check for vertical collisions and determine \r\n\t\t// whether or not the mob is in the air\r\n\t\tboolean hitWater = false;\r\n\r\n\t\t//update mob collisions with tiles\r\n\t\tfor (int i = 0; i < tilemap.grid.length; i++) {\r\n\t\t\tfor (int j = 0; j < tilemap.grid[0].length; j++) {\r\n\r\n\t\t\t\tif (tilemap.grid[i][j] != null &&\r\n\t\t\t\t\t\ttilemap.grid[i][j].getAbsPosition().x > center.x - (250) &&\r\n\t\t\t\t\t\ttilemap.grid[i][j].getAbsPosition().x < center.x + (250) &&\r\n\t\t\t\t\t\ttilemap.grid[i][j].getAbsPosition().y > center.y - (250) &&\r\n\t\t\t\t\t\ttilemap.grid[i][j].getAbsPosition().y < center.y + (250)) {\r\n\r\n\t\t\t\t\tRectangle mobRect = mob.getBounds();\r\n\t\t\t\t\tRectangle tileRect = tilemap.grid[i][j].getBounds();\r\n\r\n\t\t\t\t\t// if mob intersects a tile\r\n\t\t\t\t\tif (mobRect.intersects(tileRect)) {\r\n\r\n\t\t\t\t\t\t// get the intersection rectangle\r\n\t\t\t\t\t\tRectangle rect = mobRect.intersection(tileRect);\r\n\r\n\t\t\t\t\t\t// if the mob intersects a water tile, adjust its movement accordingly\r\n\t\t\t\t\t\tif (tilemap.grid[i][j].type == TileMap.WATER) { \r\n\r\n\t\t\t\t\t\t\tmob.gravity = mob.defaultGravity * 0.25f;\r\n\t\t\t\t\t\t\tmob.jumpSpeed = mob.defaultJumpSpeed * 0.35f;\r\n\t\t\t\t\t\t\tmob.moveSpeed = mob.defaultMoveSpeed * 0.7f;\r\n\r\n\t\t\t\t\t\t\tif (!mob.inWater) { \r\n\t\t\t\t\t\t\t\tmob.velocity.x *= 0.2;\r\n\t\t\t\t\t\t\t\tmob.velocity.y *= 0.2;\r\n\t\t\t\t\t\t\t\tmob.inWater = true;\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\thitWater = true;\r\n\t\t\t\t\t\t\tmob.jumping = false;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t// if intersection is vertical (and underneath player)\r\n\t\t\t\t\t\t\tif (rect.getHeight() < rect.getWidth()) {\r\n\r\n\t\t\t\t\t\t\t\t// make sure the intersection isn't really horizontal\r\n\t\t\t\t\t\t\t\tif (j + 1 < tilemap.grid[0].length && \r\n\t\t\t\t\t\t\t\t\t\t(tilemap.grid[i][j+1] == null || \r\n\t\t\t\t\t\t\t\t\t\t!mobRect.intersects(tilemap.grid[i][j+1].getBounds()))) {\r\n\r\n\t\t\t\t\t\t\t\t\t// only when the mob is falling\r\n\t\t\t\t\t\t\t\t\tif (mob.velocity.y <= 0) {\r\n\t\t\t\t\t\t\t\t\t\tmob.velocity.y = 0;\r\n\t\t\t\t\t\t\t\t\t\tmob.setAbsPosition(new Point(\r\n\t\t\t\t\t\t\t\t\t\t\t\tmob.getAbsPosition().x, \r\n\t\t\t\t\t\t\t\t\t\t\t\t(float)(mob.getAbsPosition().y + rect.getHeight() - 1)));\r\n\t\t\t\t\t\t\t\t\t\tmob.setScreenPosition(new Point(\r\n\t\t\t\t\t\t\t\t\t\t\t\tmob.getScreenPosition().x, \r\n\t\t\t\t\t\t\t\t\t\t\t\t(float)(mob.getScreenPosition().y + rect.getHeight() - 1)));\r\n\t\t\t\t\t\t\t\t\t\tmob.inAir = false;\t\r\n\t\t\t\t\t\t\t\t\t\tmob.jumping = false;\r\n\t\t\t\t\t\t\t\t\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\t// if intersection is horizontal\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tmob.velocity.x = 0;\r\n\r\n\t\t\t\t\t\t\t\tif (mobRect.getCenterX() < tileRect.getCenterX()) {\r\n\t\t\t\t\t\t\t\t\tmob.setAbsPosition(new Point(\r\n\t\t\t\t\t\t\t\t\t\t\t(float)(mob.getAbsPosition().x - rect.getWidth()), \r\n\t\t\t\t\t\t\t\t\t\t\tmob.getAbsPosition().y));\r\n\t\t\t\t\t\t\t\t\tmob.setScreenPosition(new Point(\r\n\t\t\t\t\t\t\t\t\t\t\t(float)(mob.getScreenPosition().x - rect.getWidth()), \r\n\t\t\t\t\t\t\t\t\t\t\tmob.getScreenPosition().y));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tmob.setAbsPosition(new Point(\r\n\t\t\t\t\t\t\t\t\t\t\t(float)(mob.getAbsPosition().x + rect.getWidth()), \r\n\t\t\t\t\t\t\t\t\t\t\tmob.getAbsPosition().y));\r\n\t\t\t\t\t\t\t\t\tmob.setScreenPosition(new Point(\r\n\t\t\t\t\t\t\t\t\t\t\t(float)(mob.getScreenPosition().x + rect.getWidth()), \r\n\t\t\t\t\t\t\t\t\t\t\tmob.getScreenPosition().y));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tfloat xToCenter = Math.abs((float)(mobRect.getCenterX() - tileRect.getCenterX()));\r\n\t\t\t\t\t\t\tfloat yToCenter = Math.abs((float)(mobRect.getCenterY() - tileRect.getCenterY())); \r\n\r\n\t\t\t\t\t\t\t// Check under the mob to see if it touches a tile. If so, hitGround = true\r\n\t\t\t\t\t\t\tif (yToCenter <= (mobRect.getHeight() / 2 + tileRect.getHeight() / 2) && \r\n\t\t\t\t\t\t\t\t\txToCenter <= (mobRect.getWidth() / 2 + tileRect.getWidth() / 2))\r\n\t\t\t\t\t\t\t\thitGround = true;\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// if mob doesn't intersect a tile vertically, they are in the air\r\n\t\tif (!hitGround) {\r\n\t\t\tmob.inAir = true;\r\n\t\t}\r\n\t\t// if the mob is not in the water, restore its default movement parameters\r\n\t\tif (!hitWater) {\r\n\t\t\tmob.gravity = mob.defaultGravity;\r\n\t\t\tmob.moveSpeed = mob.defaultMoveSpeed;\r\n\t\t\tmob.jumpSpeed = mob.defaultJumpSpeed;\r\n\t\t\tmob.inWater = false;\r\n\t\t}\r\n\t}",
"public boolean move(int x, int y, CheckersBoard board) {\n if (whiteTurn == true && team == Constants.TeamId.team1Id) {\n return false;\n }\n if (whiteTurn == false && team == Constants.TeamId.team2Id) {\n return false;\n }\n /**\n * then change the x - y coords of the piece\n * update the UI to remove the highlighted squares then move the piece\n * if chess and shared square you take a piece\n * if checkers you jumped them you take the piece\n * return new x - y components\n *\n * if this is too high up in the tree you can override this implementation or update it\n * to fit specific pieces if its not working for some reason\n */\n if (possible(x, y, gameBoard)) {\n int changex = this.getX()-x;\n int changey = this.getY()-y;\n CheckersPiece temp = gameBoard.boardPositions[getX()][getY()];\n gameBoard.boardPositions[getX()][getY()] = null;\n gameBoard.boardPositions[x][y] = temp;\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] != null) {\n System.out.println(\"Here\");\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].team != this.team) {\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].imageView.setVisibility(View.GONE);\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] = null;\n }\n }\n this.setX(x);\n this.setY(y);/*\n if (Math.abs(changex) == 2) {\n gameBoard.boardPositions[x + (changex/2)][y + (changey/2)] = null;\n if (team == Constants.TeamId.team1Id) {\n board.numPieces1--;\n } else if (team == Constants.TeamId.team2Id) {\n board.numPieces0--;\n }\n }*/\n\n gameBoard.boardPositions[x][y].imageView.setX(142*x);\n gameBoard.boardPositions[x][y].imageView.setY(142*y);\n // flips after move is\n whiteTurn = !whiteTurn;\n gameBoard.startTimer();\n }\n //setUpUI(gameBoard);\n if (getY() == 7 && team == Constants.TeamId.team2Id) {\n board.crown(this);\n }\n if (getY() == 0 && team == Constants.TeamId.team1Id) {\n board.crown(this);\n }\n return possible(x, y, gameBoard);\n }",
"public void MoveTileSelf(Integer position){\n /**\n * if opponent activated confusion - move to a random tile\n */\n if(confused){\n //random tile for confusion\n Integer tile;\n do{\n Integer tile1 = returnRandom(getNthDigit(position,1)-1,getNthDigit(position,1)+2);\n Integer tile2 = returnRandom(getNthDigit(position,2)-1,getNthDigit(position,2)+2); // between 0 and 2\n tile = Integer.parseInt(tile1.toString() + tile2.toString());\n }while (tile==myTile || tile==opponentTile || getNthDigit(tile,1)<1 || getNthDigit(tile,1)>7 || getNthDigit(tile,2)<1 || getNthDigit(tile,2)>7);\n position = tile;\n showTimedAlertDialog(\"You are confused!\", \"moving at a random direction\", 5);\n confused = false;\n }\n\n /**\n * send message to opponent\n */\n MultiplayerManager.getInstance().SendMessage(position.toString());\n\n if(!is_debug){\n HandleLejos(myTile, position);\n }\n\n ImageView player1 = findImageButton(\"square_\"+position.toString());\n ImageView player1_old = findImageButton(\"square_\"+myTile.toString());\n player1.setImageDrawable(getResources().getDrawable(R.drawable.tank_blue));\n player1_old.setImageDrawable(getResources().getDrawable(android.R.color.transparent));\n myTile = position;\n myTurn = false;\n turnNumber = turnNumber + 1;\n }",
"@Override\r\n public void tick() {\n playerNextTo();\r\n if (playerContact() && isCollisioned()) {\r\n if (!((GameState) game.getGameState()).getWorld().getTile((int) (x + xMove), (int) (y + yMove)).isSolid()\r\n && isValidMove(xMove, yMove)) {\r\n x += xMove;\r\n y += yMove;\r\n }\r\n }\r\n }",
"@Override\n public Map<Direction, List<Coordinate>> getPossibleMoves() {\n\n Map<Direction, List<Coordinate>> moves = new HashMap<>();\n\n Coordinate coordinate = this.getCoordinate();\n int row = coordinate.getRow();\n int col = coordinate.getCol();\n\n //Jumps\n List<Coordinate> jumps = new ArrayList<>();\n\n //\n //\n ////\n int tempRow1 = row - 2;\n int tempCol1 = col - 1;\n Coordinate tempCoordinate1 = new Coordinate(tempRow1, tempCol1);\n if (Board.inBounds(tempCoordinate1)) {\n jumps.add(tempCoordinate1);\n }\n\n ////\n //\n //\n int tempRow2 = row + 2;\n int tempCol2 = col - 1;\n Coordinate tempCoordinate2 = new Coordinate(tempRow2, tempCol2);\n if (Board.inBounds(tempCoordinate2)) {\n jumps.add(tempCoordinate2);\n }\n\n //////\n //\n int tempRow3 = row - 1;\n int tempCol3 = col - 2;\n Coordinate tempCoordinate3 = new Coordinate(tempRow3, tempCol3);\n if (Board.inBounds(tempCoordinate3)) {\n jumps.add(tempCoordinate3);\n }\n\n ///////\n //\n int tempRow4 = row - 1;\n int tempCol4 = col + 2;\n Coordinate tempCoordinate4 = new Coordinate(tempRow4, tempCol4);\n if (Board.inBounds(tempCoordinate4)) {\n jumps.add(tempCoordinate4);\n }\n\n ////\n //\n //\n int tempRow5 = row + 2;\n int tempCol5 = col + 1;\n Coordinate tempCoordinate5 = new Coordinate(tempRow5, tempCol5);\n if (Board.inBounds(tempCoordinate5)) {\n jumps.add(tempCoordinate5);\n }\n\n //\n //\n ////\n int tempRow6 = row - 2;\n int tempCol6 = col + 1;\n Coordinate tempCoordinate6 = new Coordinate(tempRow6, tempCol6);\n if (Board.inBounds(tempCoordinate6)) {\n jumps.add(tempCoordinate6);\n }\n\n //\n //////\n int tempRow7 = row + 1;\n int tempCol7 = col - 2;\n Coordinate tempCoordinate7 = new Coordinate(tempRow7, tempCol7);\n if (Board.inBounds(tempCoordinate7)) {\n jumps.add(tempCoordinate7);\n }\n\n //\n //////\n int tempRow8 = row + 1;\n int tempCol8 = col + 2;\n Coordinate tempCoordinate8 = new Coordinate(tempRow8, tempCol8);\n if (Board.inBounds(tempCoordinate8)) {\n jumps.add(tempCoordinate8);\n }\n\n if (!jumps.isEmpty()) {\n moves.put(Direction.Jump, jumps);\n }\n return moves;\n }",
"private boolean canMove() {\n\t\tif (System.currentTimeMillis() - lastTrunTime < 300) {// move time is\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 300ms before\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// last move\n\t\t\treturn false;\n\t\t}\n\t\tboolean status = false;\n\t\tif(stage == 1){\n\t\t\tmap = GameView.map;\n\t\t}else if(stage == 2){\n\t\t\tmap = GameViewStage2.map;\n\t\t}else {\n\t\t\tmap = GameViewStage3.map;\n\t\t}\n\t\tif (direction == UP) {// when tank moves up\n\t\t\tif (centerPoint.getY() - speed >= 0) {\n\t\t\t\tif (map[(centerPoint.getY() - speed) / UNIT][centerPoint\n\t\t\t\t\t\t.getX() / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() - speed) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + UNIT) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() - speed) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT) / UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == DOWN) {\n\t\t\tif (centerPoint.getY() + tankBmp.getHeight() + speed < screenHeight) {\n\t\t\t\tif (map[(centerPoint.getY() + 2 * UNIT + speed) / UNIT][centerPoint\n\t\t\t\t\t\t.getX() / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT][(centerPoint.getX() + UNIT) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT][(centerPoint.getX() + 2 * UNIT) / UNIT] == 0) {\n\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == LEFT) {\n\n\t\t\tif (centerPoint.getX() - speed >= 0) {\n\t\t\t\tif (map[centerPoint.getY() / UNIT][(centerPoint.getX() - speed)\n\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() - speed) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() - speed) / UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == RIGHT) {\n\t\t\tif (centerPoint.getX() + tankBmp.getWidth() + speed < screenWidth) {\n\t\t\t\tif (map[centerPoint.getY() / UNIT][(centerPoint.getX()\n\t\t\t\t\t\t+ 2 * UNIT + speed)\n\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (status)\n\t\t\tlastTrunTime = System.currentTimeMillis();\n\t\treturn status;\n\t}",
"public ArrayList<Coordinate> getPossibleMoveCoordinate() {\n ChessBoard board = this.getChessBoard(); // get chess board\n ArrayList<Coordinate> coords = new ArrayList<Coordinate>(); // create return ArrayList\n int x, y;\n /*\n several cases\n 2 3\n 1 4\n\n 5 8\n 6 7\n\n */\n // case1\n x = this.x_coordinate - 2;\n y = this.y_coordinate + 1;\n if(x >= 0 && y < board.getHeight()){\n addToCoordinatesIfValid(coords, x, y); // add to coords if the piece can move to that coordinate\n }\n // case2\n x = this.x_coordinate - 1;\n y = this.y_coordinate + 2;\n if(x >= 0 && y < board.getHeight()){\n addToCoordinatesIfValid(coords, x, y); // add to coords if the piece can move to that coordinate\n }\n // case3\n x = this.x_coordinate + 1;\n y = this.y_coordinate + 2;\n if(x < board.getWidth() && y < board.getHeight()){\n addToCoordinatesIfValid(coords, x, y); // add to coords if the piece can move to that coordinate\n }\n // case4\n x = this.x_coordinate + 2;\n y = this.y_coordinate + 1;\n if(x < board.getWidth() && y < board.getHeight()){\n addToCoordinatesIfValid(coords, x, y); // add to coords if the piece can move to that coordinate\n }\n // case5\n x = this.x_coordinate - 2;\n y = this.y_coordinate - 1;\n if(x >= 0 && y >= 0 ){\n addToCoordinatesIfValid(coords, x, y); // add to coords if the piece can move to that coordinate\n }\n // case6\n x = this.x_coordinate - 1;\n y = this.y_coordinate - 2;\n if(x >= 0 && y >= 0){\n addToCoordinatesIfValid(coords, x, y); // add to coords if the piece can move to that coordinate\n }\n // case7\n x = this.x_coordinate + 1;\n y = this.y_coordinate - 2;\n if(x < board.getWidth() && y >= 0){\n addToCoordinatesIfValid(coords, x, y); // add to coords if the piece can move to that coordinate\n }\n // case1\n x = this.x_coordinate + 2;\n y = this.y_coordinate - 1;\n if(x < board.getWidth() && y >= 0){\n addToCoordinatesIfValid(coords, x, y); // add to coords if the piece can move to that coordinate\n }\n\n\n return coords;\n }",
"public void move(long deltaTime) {\n\n Point currentTile = getOccupyingTile(position);\n\n /*\n if (!Simulator.getInstance().getTileMap().isInsideMap(currentTile))\n return;\n\n if (Simulator.getInstance().getTileMap().isAWall(currentTile) || Simulator.getInstance().getDestination().getDistanceMap().isNotInitialized(currentTile))\n return;\n*/\n\n if (Simulator.getInstance().getDestination().getDistanceMap().isNotInitialized(currentTile))\n return;\n\n setTargetVector(Simulator.getInstance().getDestination().getDistanceMap().getTiles()[currentTile.y][currentTile.x].getVector());\n\n\n if (!Simulator.getInstance().getDestination().getDistanceMap().isNotInitialized(currentTile) && Simulator.getInstance().getDestination().getDistanceMap().getTiles()[currentTile.y][currentTile.x].getVector().equals(new Point2D.Double(0.0, 0.0))) {\n setTargetVector(Simulator.getInstance().getDestination().getDistanceMap().getTiles()[currentTile.y][currentTile.x].getVector());\n double angle = 0;\n while ((angle >= 60 && angle <= 120) || (angle >= 150 && angle <= 210) || (angle >= 240 && angle <= 300) || (angle >= 330) || (angle <= 30)) {\n\n angle = Math.random() * 360;\n }\n setVector(new Point2D.Double(Math.cos(Math.toRadians(angle)) / 1.5, Math.sin(Math.toRadians(angle)) / 1.5));\n } else {\n setTargetVector(Simulator.getInstance().getDestination().getDistanceMap().getTiles()[currentTile.y][currentTile.x].getVector());\n }\n\n\n Point2D vectorDiff = new Point2D.Double(vector.getX() - targetVector.getX(), vector.getY() - targetVector.getY());\n\n if (vectorDiff.getX() < 0)\n vector.setLocation(vector.getX() + 0.001 * velocity * deltaTime, vector.getY());\n else if (vectorDiff.getX() > 0)\n vector.setLocation(vector.getX() - 0.001 * velocity * deltaTime, vector.getY());\n\n if (vectorDiff.getY() < 0)\n vector.setLocation(vector.getX(), vector.getY() + 0.001 * velocity * deltaTime);\n else if (vectorDiff.getY() > 0)\n vector.setLocation(vector.getX(), vector.getY() - 0.001 * velocity * deltaTime);\n\n\n Point2D newPosition = new Point2D.Double(\n position.getX() + (velocity * deltaTime) * vector.getX(), position.getY() + (velocity * deltaTime) * vector.getY());\n\n\n Point targetTile = getOccupyingTile(newPosition);\n\n\n Point direction = getDirection(currentTile, targetTile);\n\n\n if (!Simulator.getInstance().getTileMap().isInsideMap(targetTile) || Simulator.getInstance().getTileMap().isAWall(targetTile)\n || Simulator.getInstance().getDestination().getDistanceMap().isNotInitialized(targetTile)) {// || Simulator.getInstance().getDestination().getDistanceMap().getTiles()[targetTile.y][targetTile.x].getVector() == new Point2D.Double(0, 0)) {\n\n if (Simulator.getInstance().isUsingBounceCollision()) {\n if (direction.x > 0 || direction.x < 0)\n vector.setLocation(vector.getX() * -0.5, vector.getY());\n if (direction.y > 0 || direction.y < 0)\n vector.setLocation(vector.getX(), vector.getY() * -0.5);\n\n newPosition = new Point2D.Double(\n position.getX() + (velocity * deltaTime) * vector.getX(), position.getY() + (velocity * deltaTime) * vector.getY());\n\n\n targetTile = getOccupyingTile(newPosition);\n\n //Secondary check to make sure the bounce doesn't make it go out of bounds\n if (!Simulator.getInstance().getTileMap().isInsideMap(targetTile) || Simulator.getInstance().getTileMap().isAWall(targetTile)\n || Simulator.getInstance().getDestination().getDistanceMap().isNotInitialized(targetTile)) { //|| Simulator.getInstance().getDestination().getDistanceMap().getTiles()[targetTile.y][targetTile.x].getVector() == new Point2D.Double(0, 0)) {\n vector.setLocation(0, 0);\n } else {\n setPosition(newPosition);\n }\n\n\n } else {\n vector.setLocation(0, 0);\n }\n\n } else {\n setPosition(newPosition);\n }\n\n }",
"public void checkCollisions() {\n\t\t List<Missile> missiles = player.getMissiles();\n\t\t for(Missile n : missiles) {\n\t\t\t Rectangle r1 = n.getBounds();\n\t\t\t for(Mushroom mush : mushrooms) {\n\t\t\t\t Rectangle r2 = mush.getBounds();\n\t\t\t\t r2.x += 8;\n\t\t\t\t if(r1.intersects(r2)) {\n\t\t\t\t\t mush.hitCnt += 1;\n\t\t\t\t\t if(mush.hitCnt == 3) {\n\t\t\t\t\t\t score += 5;\n\t\t\t\t\t\t n.setVisible(false);\n\t\t\t\t\t\t mush.setVisible(false);\n\t\t\t\t\t } else {\n\t\t\t\t\t\t score += 1;\n\t\t\t\t\t\t n.setVisible(false);\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\t //check if Missile hits Centipede\n\t\t //missiles = player.getMissiles();\n\t\t for(Missile m: missiles) {\n\t\t\t Rectangle rm = m.getBounds();\n\t\t\t for(int i = 0; i < centipede.size(); i++) {\n\t\t\t\t Segment s = centipede.get(i);\n\t\t\t\t Rectangle rs = s.getBounds();\n\t\t\t\t if(rs.intersects(rm)) {\n\t\t\t\t\ts.hit();\n\t\t\t\t\tscore = (s.hitCnt < 2 ? score +2 : score + 0);\n\t\t\t\t\tif(s.hitCnt == 2){\n\t\t\t\t\t\t//split centipede\n\t\t\t\t\t\tscore += 5;\n\t\t\t\t\t\tm.setVisible(false);\n\t\t\t\t\t\tcentipede.remove(i);\n\t\t\t\t\t\t//mushrooms.add(new Mushroom(s.getX(), s.getY()));\n\t\t\t\t\t}else {\n\t\t\t\t\t\tm.setVisible(false);\n\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\t //check if missile hits spider\n\t\t missiles = player.getMissiles();\n\t\t for(Missile m : missiles) {\n\t\t\t Rectangle mBound = m.getBounds();\n\t\t\t Rectangle spiderBound = spider.getBounds();\n\t\t\t if(mBound.intersects(spiderBound)) {\n\t\t\t\t spiderHitCnt += 1;\n\t\t\t\t if(spiderHitCnt == 2) {\n\t\t\t\t\t m.setVisible(false);\n\t\t\t\t\t spider.setVisible(false);\n\t\t\t\t\t score += 600;\n\t\t\t\t } else {\n\t\t\t\t\t score += 100;\n\t\t\t\t\t m.setVisible(false);\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\t //check if centipede hits mushroom\n\t\t for(Segment c : centipede) {\n\t\t\t Rectangle cB = c.getBounds();\n\t\t\t for(Mushroom m: mushrooms) {\n\t\t\t\t Rectangle mB = new Rectangle(m.getX(), m.getY() + 5, m.getWidth(), m.getHeight() - 10);\n\t\t\t\t mB.y += 3;\n\t\t\t\t if(cB.intersects(mB)) {\n\t\t\t\t\t//makes each segment to go downs\n\t\t\t\t\tc.y += 16;\n\t\t\t\t\tc.dx = -c.dx;\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\t //check if Centipede hits Player\n\t\t Rectangle playerBounds = player.getBounds();\n\t\t for(Segment s : centipede) {\n\t\t\t Rectangle sB = s.getBounds();\n\t\t\t if(playerBounds.intersects(sB)) {\n\t\t\t\t playerLives -= 1;\n\t\t\t\t playerHitCnt += 1;\n\t\t\t\t if(playerHitCnt > MAX_HIT_COUNT) {\n\t\t\t\t\t// System.out.println(playerLives+\" \"+ x);\n\t\t\t\t\t player.setVisible(false);\n\t\t\t\t\t inGame = false;\n\t\t\t\t }else {\n\t\t\t\t\t\tplayer.x = 707;\n\t\t\t\t\t\tplayer.y = 708;\n\t\t\t\t\t\tPoint location = getLocationOnScreen();\n\t\t\t\t\t\trobot.mouseMove(location.x + 250, location.y + 425);\n\t\t\t\t\t\tplayer = new Player(300, 400);\n\t\t\t\t\t\tregenMushrooms();\n\t\t\t\t\t}\n\t\t\t }\n\t\t }\n\n\t\t //check if Spider hits Player\n\t\t playerBounds = player.getBounds();\n\t\t Rectangle spiderBounds = spider.getBounds();\n\t\t if(spiderBounds.intersects(playerBounds)) {\n\t\t\tplayerLives -= 1;\n\t\t\tplayerHitCnt += 1;\n\t\t\tif(playerLives > MAX_HIT_COUNT) {\n\t\t\t\t//System.out.println(playerLives+\" \"+ y);\n\t\t\t\tplayer.setVisible(false);\n\t\t\t\tspider.setVisible(false);\n\t\t\t}else {\n\t\t\t\tregenMushrooms();\n\t\t\t\tcentipede.clear();\n\t\t\t\tcreateCentipede();\n\t\t\t\tplayer.x = 707;\n\t\t\t\tplayer.y = 708;\n\t\t\t\tPoint location = getLocationOnScreen();\n\t\t\t\trobot.mouseMove(location.x + 250, location.y + 425);\n\t\t\t\tplayer = new Player(300, 400);\n\t\t\t}\n\t\t}\n\t }",
"boolean canMove(Tile t);",
"public void move() {\n\n int move_position_x = 0;\n int move_postion_y = 0;\n Random random = new Random();\n do {\n\n move_position_x = 0;\n move_postion_y = 0;\n int direction = random.nextInt(6);\n switch (direction) {\n case 0:\n move_postion_y = -1;\n break;\n case 1:\n case 4:\n move_postion_y = 1;\n break;\n case 2:\n case 5:\n move_position_x = 1;\n break;\n case 3:\n move_position_x = -1;\n }\n } while ((this.positionX + move_position_x < 0) || (this.positionX + move_position_x >= size_of_map) || (\n this.positionY + move_postion_y < 0) || (this.positionY + move_postion_y >= size_of_map));\n this.positionX += move_position_x;\n this.positionY += move_postion_y;\n }",
"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 }",
"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}",
"private boolean legalMove() {\n\n\t\t// empty landing spot\n\t\tif (tilePath.size() == 0) {\n\t\t\tdebug(\"illegal, empty landing spot\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!mBoard.tileIsEmpty(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, tile not empty\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// start doesn't equal end\n\t\tif (tilePath.get(0).equals(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, start doesn't equal end\");\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"@Override\r\n public void update() {\r\n super.update();\r\n hero.checkForTileCollision(getXOverlap(hero.oldx,hero.oldx+width,hero.x,hero.x+width), getYOverlap(hero.oldy,hero.oldy+hero.height,hero.y, hero.y+hero.height));\r\n int i = 0;\r\n\r\n while (turningPoints[i]!= null)\r\n {\r\n if (intersects(turningPoints[i].x,turningPoints[i].y, turningPoints[i].width,turningPoints[i].height))\r\n {\r\n vx = -vx;\r\n vy = -vy;\r\n }\r\n i++;\r\n }\r\n }",
"public void move() {\r\n if(direction == 1) {\r\n if(userRow < grid.getNumRows() - 1) {\r\n userRow++;\r\n handleCollision(userRow, 1);\r\n }\r\n } else if(direction == -1) {\r\n if(userRow > 0) {\r\n userRow--;\r\n handleCollision(userRow, 1);\r\n }\r\n }\r\n }",
"public void paradiseMove(){\n if (!getCurrentMainCellCoordinates().equals(new DiscreteCoordinates(11, 9))) {\n move(30);\n }\n }",
"public void tick() {\n\t\tif (mainRef.player().getPos()[1] <= lastEnd.getPos()[1] + 2000)\r\n\t\t\tloadNextMap();\r\n\r\n\t\tfor (GameObject go : gameObjects)\r\n\t\t\tgo.tick();\r\n\r\n\t\t// Check Player Collision\r\n\t\t// Top-Left\r\n\t\tPointColObj cTL = new PointColObj(mainRef.player().getPos()[0] + mainRef.player().getCol()[2],\r\n\t\t\t\tmainRef.player().getPos()[1] + mainRef.player().getCol()[3]);\r\n\t\t// Top-Right\r\n\t\tPointColObj cTR = new PointColObj(mainRef.player().getPos()[0] + mainRef.player().getCol()[2],\r\n\t\t\t\tmainRef.player().getPos()[1] + mainRef.player().getCol()[3] + mainRef.player().getCol()[1]);\r\n\t\t// Bottom-Left\r\n\t\tPointColObj cBL = new PointColObj(\r\n\t\t\t\tmainRef.player().getPos()[0] + mainRef.player().getCol()[2] + mainRef.player().getCol()[0],\r\n\t\t\t\tmainRef.player().getPos()[1] + mainRef.player().getCol()[3]);\r\n\t\t// Bottom-Right\r\n\t\tPointColObj cBR = new PointColObj(\r\n\t\t\t\tmainRef.player().getPos()[0] + mainRef.player().getCol()[2] + mainRef.player().getCol()[0],\r\n\t\t\t\tmainRef.player().getPos()[1] + mainRef.player().getCol()[3] + mainRef.player().getCol()[1]);\r\n\r\n\t\t// Inverse Collision, no part of the player's ColBox should be not\r\n\t\t// colliding...\r\n\t\tif (checkCollisionWith(cTL).size() == 0 || checkCollisionWith(cTR).size() == 0\r\n\t\t\t\t|| checkCollisionWith(cBL).size() == 0 || checkCollisionWith(cBR).size() == 0) {\r\n\t\t\t// If it would have left the bounding box of the floor, reverse the\r\n\t\t\t// player's posiiton\r\n\t\t\tmainRef.player().setMoveBack(true);\r\n\t\t} else\r\n\t\t\tmainRef.player().setMoveBack(false);\r\n\r\n\t\t// Check General Collision\r\n\t\tArrayList<GameObject> allCol = checkCollisionWith(mainRef.player());\r\n\t\tfor (GameObject go : allCol) {\r\n\t\t\tif (go instanceof Tile) {\r\n\t\t\t\tTile gameTile = (Tile) go;\r\n\t\t\t\tif (gameTile.getType() == GameObjectRegistry.TILE_WALL\r\n\t\t\t\t\t\t|| gameTile.getType() == GameObjectRegistry.TILE_BASE\r\n\t\t\t\t\t\t|| gameTile.getType() == GameObjectRegistry.TILE_DOOR\r\n\t\t\t\t\t\t|| gameTile.getType() == GameObjectRegistry.TILE_SEWER\r\n\t\t\t\t\t\t|| (gameTile.getType() == GameObjectRegistry.TILE_WATERFALL && gameTile.getVar() == 0)) {\r\n\t\t\t\t\tmainRef.player().setMoveBack(true);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t} else if (go instanceof LineColObjHor || go instanceof LineColObjVert) {\r\n\t\t\t\tmainRef.player().setMoveBack(true);\r\n\t\t\t\tbreak;\r\n\t\t\t} else if (go instanceof SkillDrop) {\r\n\t\t\t\tSkillDrop d = (SkillDrop) go;\r\n\t\t\t\tmainRef.player().getInv()[d.getVariation()]++;\r\n\t\t\t\tremoveGameObject(go);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}",
"private boolean checkCollisions(int keycode) {\n \t\t\n \t\tint sX = super.getX()/Main.gridSize;\n \t\tint sY = super.getY()/Main.gridSize;\n \t\t\n \t\tif (World.currentMap().solidAtPoint(sX-1, sY) && keycode == Keyboard.KEY_A) {\n \t\t\treturn false;\n \t\t} else if (World.currentMap().solidAtPoint(sX+1, sY) && keycode == Keyboard.KEY_D) {\n \t\t\treturn false;\n \t\t} else if (World.currentMap().solidAtPoint(sX, sY-1) && keycode == Keyboard.KEY_W) {\n \t\t\treturn false;\n \t\t} else if (World.currentMap().solidAtPoint(sX, sY+1) && keycode == Keyboard.KEY_S) {\n \t\t\treturn false;\n \t\t}\n \t\treturn true;\n \t}",
"public boolean isValidMultiplayerMove(int xMove, int yMove, ArrayList<Entity> objects, \r\n ArrayList<NonPlayerCharacter> npcs, ArrayList<Item> items, World world){\n for (int i = 0; i < objects.size(); i++)//collisioned an object\r\n {\r\n if (x + xMove == objects.get(i).getX() && y + yMove == objects.get(i).getY()) {\r\n objects.get(i).setCollisioned(true);\r\n return false;\r\n } else {\r\n objects.get(i).setCollisioned(false);\r\n }\r\n }\r\n\r\n //ArrayList<NonPlayerCharacter> npcs = ((GameState) game.getGameState()).getNpcs();\r\n for (int i = 0; i < npcs.size(); i++) {\r\n if (x + xMove == npcs.get(i).getX() && y + yMove == npcs.get(i).getY()) {\r\n npcs.get(i).setCollisioned(true);\r\n return false;\r\n }\r\n }\r\n\r\n //ArrayList<Item> items = ((GameState) game.getGameState()).getItems();\r\n for (int i = 0; i < items.size(); i++) {\r\n if (x + xMove == items.get(i).getX() && y + yMove == items.get(i).getY()) {\r\n items.get(i).setCollisioned(true);\r\n return false;\r\n }\r\n }\r\n\r\n /*if (((GameState) game.getGameState()).getWorld().getTile((int) (x + xMove), (int) (y + yMove)).isSolid()) {\r\n return false;\r\n }*/\r\n if (world.getTile((int) (x + xMove), (int) (y + yMove)).isSolid()) {\r\n return false;\r\n }\r\n \r\n if (world.getTile((int) (x + xMove), (int) (y + yMove)).getId() == 2) {\r\n return false;\r\n }\r\n\r\n /*if (x + xMove == ((GameState) game.getGameState()).getPlayer().getX()\r\n && y + yMove == ((GameState) game.getGameState()).getPlayer().getY()) {\r\n return false;\r\n }*/\r\n return true;\r\n }",
"private void handleMazeCollisions() {\n final ArrayList<Rectangle> segs = maze.getCollisionCandidates(getCenter());\n\n for (int i = 0; i < segs.size(); i++) {\n if (!checkCollision(segs.get(i).getPolygon())) {\n // The tank does not intersect the seg.\n segs.remove(i);\n i--;\n }\n }\n\n if (segs.size() == 0) {\n // The tank does not intersect any of the segs.\n return;\n }\n\n Runnable reverseOp = null;\n // Backtrack.\n final Tank tank = this;\n // Need to declare this up here instead of in each case because java's switch cases share scope. So java would think\n // we are redeclaring a variable.\n final Point2D decomposedVelocity;\n switch (lastMovementOp) {\n case FORWARD:\n decomposedVelocity = Physics.decomposeVector(-1, theta);\n reverseOp = () -> tank.moveBy(decomposedVelocity);\n break;\n case REVERSE:\n decomposedVelocity = Physics.decomposeVector(1, theta);\n reverseOp = () -> tank.moveBy(decomposedVelocity);\n break;\n case RIGHT:\n reverseOp = () -> tank.rotate(-TURNING_ANGLE / 12);\n break;\n case LEFT:\n reverseOp = () -> tank.rotate(TURNING_ANGLE / 12);\n break;\n }\n do {\n assert reverseOp != null;\n reverseOp.run();\n\n for (int i = 0; i < segs.size(); i++) {\n if (!checkCollision(segs.get(i).getPolygon())) {\n segs.remove(i);\n i--;\n }\n }\n } while (segs.size() > 0);\n }",
"Tile getPosition();",
"public boolean isGameOver(int x, int y, int z){\n Coords position = new Coords(x,y,z);\n if(!position.isCorrect) return false;\n for(int i=-1; i<2; i++)\n for(int j=-1; j<2; j++)\n for(int k=-1; k<2; k++){\n if(i==0 && j==0 && k==0) continue;\n Coords c2 = new Coords(position.getX()+i,position.getY()+j,position.getZ()+k);\n Coords c3 = new Coords(position.getX()+2*i,position.getY()+2*j,position.getZ()+2*k);\n Coords c4 = new Coords(position.getX()+3*i,position.getY()+3*j,position.getZ()+3*k);\n if(c2.isCorrect && c3.isCorrect && c4.isCorrect){\n if(board[position.getX()][position.getY()][position.getZ()]==\n board[c2.getX()][c2.getY()][c2.getZ()]&&board[c2.getX()][c2.getY()][c2.getZ()]\n ==board[c3.getX()][c3.getY()][c3.getZ()]&&board[c4.getX()][c4.getY()][c4.getZ()]\n ==board[c3.getX()][c3.getY()][c3.getZ()]) return true;}\n c4 = new Coords(position.getX()-i,position.getY()-j,position.getZ()-k);\n if(c2.isCorrect && c3.isCorrect && c4.isCorrect){\n if(board[position.getX()][position.getY()][position.getZ()]==\n board[c2.getX()][c2.getY()][c2.getZ()]&&board[c2.getX()][c2.getY()][c2.getZ()]\n ==board[c3.getX()][c3.getY()][c3.getZ()]&&board[c4.getX()][c4.getY()][c4.getZ()]\n ==board[c3.getX()][c3.getY()][c3.getZ()]) return true;}\n }\n return false;\n }",
"private boolean hasPossibleMove()\n {\n for(int i=0; i<FieldSize; ++i)\n {\n for(int j=1; j<FieldSize; ++j)\n {\n if(field[i][j] == field[i][j-1])\n return true;\n }\n }\n for(int j=0; j<FieldSize; ++j)\n {\n for(int i=1; i<FieldSize; ++i)\n {\n if(field[i][j] == field[i-1][j])\n return true;\n }\n }\n return false;\n }",
"void checkPositions() {\n //check if any bullets have hit any asteroids\n for (int i = 0; i < bullets.size(); i++) {\n for (int j = 0; j < asteroids.size(); j++) {\n if (asteroids.get(j).checkIfHit(bullets.get(i).pos)) {\n shotsHit++;\n bullets.remove(i);//remove bullet\n score +=1;\n break;\n }\n }\n }\n //check if player has been hit\n if (immortalityTimer <=0) {\n for (int j = 0; j < asteroids.size(); j++) {\n if (asteroids.get(j).checkIfHitPlayer(position)) {\n playerHit();\n }\n }\n }\n }",
"@Override\n public void update(){\n getNextPosition();\n checkTileMapCollision();\n setPosition(xtemp, ytemp);\n animation.update();\n }",
"public boolean isValidMove(MapTile[][] scanMapTiles, String direction) {\n\tint centerIndex = (scanMap.getEdgeSize() - 1) / 2;\n\tint x = centerIndex, y = centerIndex;\n\n\tswitch (direction) {\n\tcase \"N\":\n\t\ty = y - 1;\n\t\tbreak;\n\tcase \"S\":\n\t\ty = y + 1;\n\t\tbreak;\n\tcase \"E\":\n\t\tx = x + 1;\n\t\tbreak;\n\tcase \"W\":\n\t\tx = x - 1;\n\t\tbreak;\n\t}\n\n\tif (scanMapTiles[x][y].getTerrain() == Terrain.SAND || scanMapTiles[x][y].getTerrain() == Terrain.NONE\n\t\t\t|| scanMapTiles[x][y].getHasRover() == true)\n\t\treturn false;\n\n\treturn true;\n}",
"private void checkIfOccupied(int row, int col) {\n if (status == MotionStatus.DOWN || AIisAttacking) {\n\n// if (player && playerAttacks != null) {\n// // Ignore touch if player has previously committed an attack on that cell.\n// for (int i = 0; i < playerAttacks.size(); i++) {\n// if (playerAttacks.get(i).equals(row,col)) {\n// Log.i(\"for\", \"You Hit this Previously!\");\n// }\n// }\n// }\n\n for (int i = 0; i < occupiedCells.size(); i++) {\n if (occupiedCells.get(i).x == row && occupiedCells.get(i).y == col) {\n Point p = new Point(row, col);\n selectedShip = findWhichShip(p); //Touching View Updated\n Log.i(\"checkIfOccupied getHit\", \"\" + getHit() + \", (\" + row + \", \" + col + \")\");\n setHit(true);\n break;\n }\n }\n\n if (selectedShip == null) {\n setHit(false);\n Log.i(\"checkIfOccupied getHit\", \"\" + getHit() + \", (\" + row + \", \" + col + \")\");\n }\n\n } else if (status == MotionStatus.MOVE) {//MotionStatus.MOVE\n if (selectedShip != null) {//Need to make sure none of the current ship parts will overlap another.\n int rowHolder = selectedShip.getHeadCoordinatePoint().x;\n int colHolder = selectedShip.getHeadCoordinatePoint().y;\n int tempRow, tempCol;\n selectedShip.moveShipTo(row, col);\n for (Ship s : ships) {\n if (s != selectedShip) {\n\n for (int i = 0; i < selectedShip.getShipSize(); i++) {\n tempRow = selectedShip.getBodyLocationPoints()[i].x;\n tempCol = selectedShip.getBodyLocationPoints()[i].y;\n\n for (int j = 0; j < s.getShipSize(); j++) {\n if (tempRow == s.getBodyLocationPoints()[j].x && tempCol == s.getBodyLocationPoints()[j].y) {\n selectedShip.moveShipTo(rowHolder, colHolder);\n }\n }//for\n }//for\n }\n }//for\n }\n }//Move\n }",
"@Override\r\n\tpublic boolean canMove(int x, int y, Tile[][] tiles) {\r\n\t\treturn false;\r\n\t}",
"@Override\n\tpublic void move() {\n\t\tx += ((direction) * xSpeed);\n\t\t//If any sprite has collided with the left or right edge of the screen set collided to true\n\t\tif (x >= 800 - spriteImage.getWidth(null) || x <= 0) collided = true;\n\t}",
"public boolean moveable() {\n //check reach border\n if (reachBorder()) {\n return false;\n }\n //get the location of the next spot to move to\n //move up\n Point nextLocation = this.getCenterLocation();\n if (direction == 12) {\n nextLocation = new Point(this.getCenterX(),\n this.getCenterY() - speed);\n }\n //move right\n if (direction == 3) {\n nextLocation = new Point(this.getCenterX() + speed,\n this.getCenterY());\n\n }\n //move down\n if (direction == 6) {\n nextLocation = new Point(this.getCenterX(),\n this.getCenterY() + speed);\n\n }\n //move left\n if (direction == 9) {\n nextLocation = new Point(this.getCenterX() - speed,\n this.getCenterY());\n }\n\n // get all objects in a circle of radius tileSize * 2 around the players\n //these objects are those which can possibly colide with the players\n int checkRadius = GameUtility.GameUtility.TILE_SIZE * 2;\n for (GameObject gameObject : GameManager.getGameObjectList()) {\n if (GameUtility.GameUtility.distance(gameObject.getCenterLocation(),\n this.getCenterLocation()) < checkRadius) {\n if ((GameUtility.GameUtility.dectectCollision(\n gameObject.getCenterLocation(),\n nextLocation)) && !(GameUtility.GameUtility.dectectCollision(\n gameObject.getCenterLocation(),\n this.getCenterLocation())) && gameObject.getType() != GameObjectType.POWER_UP && gameObject.getType() != GameObjectType.MONSTER && gameObject.getType() != GameObjectType.PLAYER) {\n return false;\n }\n }\n }\n return true;\n\n }",
"private void checkCollision() {\n for (int i = snakeSize; i > 0; i--) {\n if (i>4 && x[0] == x[i] && y[0] == y[i]){\n isInGame=false;\n }\n }\n\n if (x[0] > FIELD_SIZE) {\n isInGame=false;\n }\n\n if (x[0] < 0) {\n isInGame=false;\n }\n\n if (y[0] > FIELD_SIZE) {\n isInGame=false;\n }\n\n if (y[0] < 0) {\n isInGame=false;\n }\n\n\n }",
"public void getPossibleMoves() { \n\t\t\tsuper.getPossibleMoves();\n\t\t\tfor (int i = 0; i < Math.abs(xrange); i++) {\n\t\t\t\tif (currentx + xrange - ((int) Math.pow(-1,color)*i) >= 0) { \n\t\t\t\t\tGameWindow.potentialMoves.add(GameWindow.GridCells[currentx + xrange - ((int) Math.pow(-1,color)*i) ][currenty]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( currentx - 1 >= 0 && currenty - 1 >= 0 &&\n\t\t\t\t\tGameWindow.GridCells[currentx + ((int) Math.pow(-1,color)) ][currenty - 1].isOccupiedByOpponent()) {\t// Diagonol left space occupied\n\t\t\t\tGameWindow.potentialMoves.add(GameWindow.GridCells[currentx + ((int) Math.pow(-1,color)) ][currenty - 1]);\n\t\t\t}\n\t\t\tif (currentx - 1 >= 0 && currenty + 1 <= 7 &&\n\t\t\t\t\tGameWindow.GridCells[currentx + ((int) Math.pow(-1,color)) ][currenty + 1].isOccupiedByOpponent()) { \t//Diagonol right space occupied\n\t\t\t\tGameWindow.potentialMoves.add(GameWindow.GridCells[currentx + ((int) Math.pow(-1,color)) ][currenty + 1]);\n\t\t\t}\n\t\t\t\n\t}",
"public boolean addBoardTile(Tile t, int xpos, int ypos) {\n \tTile leftTile = null;\n \tTile rightTile = null;\n \tif (ypos != 1) {\n \t\t// Aka if the tile isn't at the leftmost side\n \t\tleftTile = boardTiles.get(new Point(xpos - 1, ypos));\n \t} \t\n \tif (ypos != BoardController.BOARDSIZE) {\n \t\t// Aka if the tile isn't at the rightmost side\n \t\trightTile = boardTiles.get(new Point(xpos + 1, ypos));\n \t}\n \t\n \tif (leftTile != null && rightTile != null) {\n \t\t// Tile placed on the board between two existing melds\n \t\t// NOTE: If the tile is moved a space to the left or right, and that space is \n \t\t// not occupied, and there is another existing meld beside that space,\n \t\t// then the two melds are the meld it was moved beside and itself\n \t\tMeld leftMeld = findMeld(leftTile);\n \t\tMeld rightMeld = findMeld(rightTile);\n \t\t\n \t\t// First check if either meld is the single tile being moved\n \t\tif (leftMeld.getTiles().contains(t)) {\n \t\t\t// Treat as adding only that tile\n \t\t\tif(rightMeld.addLeftside(t)) {\n \t\t\t\tif (boardTiles.containsValue(t)) {\n \t\t\t\t\tremoveBoardTile(t);\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\tremoveHandTile(t);\n \t\t\t\t}\n \t\t\t\tboardTiles.put(new Point(xpos, ypos), t);\n \t\t\tcontroller.updateView();\n \t\t\treturn true;\n \t\t\t}\n \t\t\treturn false;\n \t\t}\n \t\telse if (rightMeld.getTiles().contains(t)) {\n \t\t\t// Treat as adding only that tile\n \t\t\tif(leftMeld.addRightside(t)) {\n \t\t\t\tif (boardTiles.containsValue(t)) {\n \t\t\t\t\tremoveBoardTile(t);\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\tremoveHandTile(t);\n \t\t\t\t}\n \t\t\t\tboardTiles.put(new Point(xpos, ypos), t);\n \t\t\tcontroller.updateView();\n \t\t\treturn true;\n \t\t\t}\n \t\t\treturn false;\n \t\t}\n \t\telse if (leftMeld.addRightside(t)) {\n \t\t\tif(combineMeld(leftMeld, rightMeld)) {\n \t\t\t\tif (boardTiles.containsValue(t)) {\n \t \t\t\tremoveBoardTile(t);\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\tremoveHandTile(t);\n \t\t\t\t}\n \t\t\t\tboardTiles.put(new Point(xpos, ypos), t);\n \t\t\t\tcontroller.updateView();\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\telse {\n \t\t\t\tleftMeld.removeFromMeld(t);\n \t\t\t\treturn false;\n \t\t\t}\n \t\t}\n \t\treturn false;\n \t}\n \t\n \telse if (leftTile == null && rightTile == null) {\n \t\t// Tile is placed on the board as the start of a new meld!\n \t\tmelds.add(new Meld(t));\n \t\tif (boardTiles.containsValue(t)) {\n \t\t\tremoveBoardTile(t);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tremoveHandTile(t);\n\t\t\t}\n\t\t\tboardTiles.put(new Point(xpos, ypos), t);\n\t\t\tcontroller.updateView();\n\t\t\treturn true;\n \t}\n \t\n \telse if(leftTile != null) {\n \t\t// Tile is added to the end of an existing meld\n \t\t// OR tile is moved to the right and the left tile is itself!\n \t\t\n \t\tif (leftTile.equals(t)) {\n \t\t\tif (findMeld(t).getSize() == 1) {\n \t\t\t\tmelds.remove(findMeld(t));\n \t\t\t}\n \t\t\telse {\n \t\t\t\tfindMeld(t).removeFromMeld(t);\n \t\t\t}\n \t\t\tmelds.add(new Meld(t));\n \t\tif (boardTiles.containsValue(t)) {\n \t\t\tremoveBoardTile(t);\n \t\t\t}\n \t\t\telse {\n \t\t\t\tremoveHandTile(t);\n \t\t\t}\n \t\t\tboardTiles.put(new Point(xpos, ypos), t);\n \t\t\tcontroller.updateView();\n \t\t\treturn true;\n \t\t}\n \t\t\n \t\tif(leftTile.getID() > 9) {\n \t\t\t// First tile of meld to add to is a joker\n \t\t\tif (findMeld(leftTile).getSize() == 2) {\n \t\t\t\t// Just the joker and another tile in the meld\n \t\t\t\t// Can change the joker's value now to reflect the newly\n \t\t\t\t// added tile\n \t\t\t\tif(findMeld(leftTile).setMeld(t, 0)) {\n \t\t\t\t\tboardTiles.put(new Point(xpos, ypos), t);\n \t \t\t\tcontroller.updateView();\n \t\t\t\t\treturn true;\n \t\t\t\t}\n \t\t\t\treturn false;\n \t\t\t}\n \t\t}\n \t\t\n \t\tMeld meldToAddTo = findMeld(leftTile);\n \t\tif (meldToAddTo != null) {\n \t\t\tif(meldToAddTo.addRightside(t)) {\n \t\t\t\tif (boardTiles.containsValue(t)) {\n \t\t\t\t\tremoveBoardTile(t);\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\tremoveHandTile(t);\n \t\t\t\t}\n \t\t\t\tboardTiles.put(new Point(xpos, ypos), t);\n \t\t\tcontroller.updateView();\n \t\t\treturn true;\n \t\t\t}\n \t\t\treturn false;\n \t\t}\n \t\telse {\n \t\t\t// The tile that was already on the board is\n \t\t\t// somehow not found in any meld. Should not\n \t\t\t// reach here!\n \t\t\tSystem.out.println(\"2\");\n \t\t\treturn false;\n \t\t}\n \t}\n \t\n \telse if(rightTile != null) {\n \t\tif (rightTile.equals(t)) {\n \t\t\tif (findMeld(t).getSize() == 1) {\n \t\t\t\tmelds.remove(findMeld(t));\n \t\t\t}\n \t\t\telse {\n \t\t\t\tfindMeld(t).removeFromMeld(t);\n \t\t\t}\n \t\t\tmelds.add(new Meld(t));\n \t\tif (boardTiles.containsValue(t)) {\n \t\t\tremoveBoardTile(t);\n \t\t\t}\n \t\t\telse {\n \t\t\t\tremoveHandTile(t);\n \t\t\t}\n \t\t\tboardTiles.put(new Point(xpos, ypos), t);\n \t\t\tcontroller.updateView();\n \t\t\treturn true;\n \t\t}\n \t\t\n \t\tif(rightTile.getID() > 9) {\n \t\t\t// First tile of meld to add to is a joker\n \t\t\tif (findMeld(rightTile).getSize() == 2) {\n \t\t\t\t// Just the joker and another tile in the meld\n \t\t\t\t// Can change the joker's value now to reflect the newly\n \t\t\t\t// added tile\n \t\t\t\tif(findMeld(rightTile).setMeld(t, 1)) {\n \t\t\t\t\tboardTiles.put(new Point(xpos, ypos), t);\n \t \t\t\tcontroller.updateView();\n \t\t\t\t\treturn true;\n \t\t\t\t}\n \t\t\t\treturn false;\n \t\t\t}\n \t\t}\n \t\t\n \t\tMeld meldToAddTo = findMeld(rightTile);\n \t\tif (meldToAddTo != null) {\n \t\t\tif(meldToAddTo.addLeftside(t)) {\n \t\t\t\tif (boardTiles.containsValue(t)) {\n \t\t\t\t\tremoveBoardTile(t);\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\tremoveHandTile(t);\n \t\t\t\t}\n \t\t\t\tboardTiles.put(new Point(xpos, ypos), t);\n \t\t\tcontroller.updateView();\n \t\t\treturn true;\n \t\t\t}\n \t\t\tSystem.out.print(\"We get here >:\");\n \t\t\tSystem.out.print(t.getValue());\n \t\t\tSystem.out.print(t.getColour().getName());\n \t\t\t\n \t\t\tSystem.out.println(rightTile.getValue());\n \t\t\tSystem.out.println(rightTile.getColour().getName());\n \t\t\treturn false;\n \t\t}\n \t\telse {\n \t\t\t// The tile that was already on the board is\n \t\t\t// somehow not found in any meld. Should not\n \t\t\t// reach here!\n \t\t\tSystem.out.println(\"3\");\n \t\t\treturn false;\n \t\t}\n \t}\n \telse {\n \t\t// Should not reach here, throw an error if it does\n \t\tSystem.out.println(\"4\");\n \t\treturn false;\n \t}\n }",
"private int Block_Move() {\n\t\tfinal int POSSIBLE_BLOCK = 2;\n\t\tint move = NO_MOVE;\n\t\t\n\t\tif(( gameBoard[TOP_LEFT] + gameBoard[TOP_CENTER] + gameBoard[TOP_RIGHT]) == POSSIBLE_BLOCK){\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_BLOCK){\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_BLOCK){\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_BLOCK){\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_BLOCK){\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}\t\t\t\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_RIGHT] + gameBoard[BTM_RIGHT]) == POSSIBLE_BLOCK){\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_BLOCK){\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_BLOCK){\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}",
"public void PlayerX(){\n\n if(directionX > 0){//going right\n int tempX = (int) ((x + directionX + bmp.getWidth()) / Tile.tileWidth);\n if(!CollisionWithTile(tempX, (int)y / Tile.tileHeight)) {\n x += directionX * speed * time;\n }\n }\n else if(directionX < 0){//going left\n int tempX = (int)((x + directionX) / Tile.tileWidth);\n if(!CollisionWithTile(tempX, (int)y / Tile.tileHeight)) {\n x += directionX * speed * time;\n }\n }\n }",
"@Override\n public boolean canMove(double x, double y) {\n double xr = this.x, yr = this.y - 32; //subtract y to get more accurate results\n //the thing is, subract to 32 (sprite size), so if we add 1 tile we get the next pixel tile with this\n //we avoid the shaking inside tiles with the help of steps\n if (direction == 0) {\n yr += sprite.getSize() - 1;\n xr += sprite.getSize() / 2;\n }\n if (direction == 1) {\n yr += sprite.getSize() / 2;\n xr += 1;\n }\n if (direction == 2) {\n xr += sprite.getSize() / 2;\n yr += 1;\n }\n if (direction == 3) {\n xr += sprite.getSize() - 1;\n yr += sprite.getSize() / 2;\n }\n int xx = Coordinates.pixelToTile(xr) + (int) x;\n int yy = Coordinates.pixelToTile(yr) + (int) y;\n Entity a = Board.getInstance().getEntity(xx, yy, this); //entity of the position we want to go\n return !a.collide(this);\n }",
"private void collide() {\n int collisionRange;\n \n if(isObstacle) {\n for(Thing thg: proximity) {\n if(\n thg.isObstacle\n &&\n !thg.equals(this)\n ) {\n collisionRange = (thg.size + this.size)/2;\n deltaA = this.distance(thg);\n \n if( \n Math.abs(deltaA[0]) <= collisionRange\n &&\n Math.abs(deltaA[1]) <= collisionRange\n ){\n if(deltaA[0] > deltaA[1]) {\n if(Math.abs(deltaA[0]) > Math.abs(deltaA[1])) {\n if(dA[0] == 1) {\n dA[0] = 0;\n }\n }\n if(Math.abs(deltaA[0]) < Math.abs(deltaA[1])) {\n if(dA[1] == -1) {\n dA[1] = 0;\n }\n }\n if(Math.abs(deltaA[0]) == Math.abs(deltaA[1])) {\n if(dA[0] != 0) {\n dA[1] = dA[0];\n }\n if(dA[1] != 0) {\n dA[0] = dA[1];\n }\n }\n }\n \n if(deltaA[0] < deltaA[1]) {\n if(Math.abs(deltaA[0]) > Math.abs(deltaA[1])) {\n if(dA[0] == -1) {\n dA[0] = 0;\n }\n } \n if(Math.abs(deltaA[0]) < Math.abs(deltaA[1])) {\n if(dA[1] == 1) {\n dA[1] = 0;\n }\n } \n if(Math.abs(deltaA[0]) == Math.abs(deltaA[1])) {\n dA[0] = 1 - 2*(int) (Math.random()*2);\n dA[1] = dA[0];\n }\n }\n \n if(Math.abs(deltaA[0]) == Math.abs(deltaA[1])) {\n dA[0] = 1 - 2*(int) (Math.random()*2);\n dA[1] = -dA[0];\n }\n }\n }\n }\n }\n }",
"public void updatePosition(){\n\t\t//maps the position to the closest \"grid\"\n\t\tif(y-curY>=GameSystem.GRID_SIZE/2){\n\t\t\tcurY=curY+GameSystem.GRID_SIZE;\n\t\t\tyGridNearest++;\n\t\t}\n\t\telse if(curX-x>=GameSystem.GRID_SIZE/2){\n\t\t\tcurX=curX-GameSystem.GRID_SIZE;\n\t\t\txGridNearest--;\n\t\t}\n\t\telse if(x-curX>=GameSystem.GRID_SIZE/2){\n\t\t\tcurX=curX+GameSystem.GRID_SIZE;\n\t\t\txGridNearest++;\n\t\t}\n\t\telse if(curY-y>=GameSystem.GRID_SIZE/2){\n\t\t\tcurY=curY-GameSystem.GRID_SIZE;\n\t\t\tyGridNearest--;\n\t\t}\n\t\t//sets the last completely arrived location grid\n\t\tif(y-yTemp>=GameSystem.GRID_SIZE){\n\t\t\tyTemp=yTemp+GameSystem.GRID_SIZE;\n\t\t\ty=yTemp;\n\t\t\tlastY++;\n\t\t}\n\t\telse if(xTemp-x>=GameSystem.GRID_SIZE){\n\t\t\txTemp=xTemp-GameSystem.GRID_SIZE;\n\t\t\tx=xTemp;\n\t\t\tlastX--;\n\t\t}\n\t\telse if(x-xTemp>=GameSystem.GRID_SIZE){\n\t\t\txTemp=xTemp+GameSystem.GRID_SIZE;\n\t\t\tx=xTemp;\n\t\t\tlastX++;\n\t\t}\n\t\telse if(yTemp-y>=GameSystem.GRID_SIZE){\n\t\t\tyTemp=yTemp-GameSystem.GRID_SIZE;\n\t\t\ty=yTemp;\n\t\t\tlastY--;\n\t\t}\n\t\t//only updates nextX and nextY when the move buttons are being pressed down\n\t\t/*\n\t\tif(movable){\n\t\t\tif(direction.equals(\"right\")){\n\t\t\t\t\tnextX=lastX+1;\n\t\t\t\t\tnextY=lastY;\n\t\t\t}\n\t\t\telse if(direction.equals(\"left\")){\n\t\t\t\tnextX=lastX-1;\n\t\t\t\tnextY=lastY;\n\t\t\t}\n\t\t\telse if(direction.equals(\"up\")){\n\t\t\t\tnextY=lastY-1;\n\t\t\t\tnextX=lastX;\n\t\t\t}\n\t\t\telse if(direction.equals(\"down\")){\n\t\t\t\tnextY=lastY+1;\n\t\t\t\tnextX=lastX;\n\t\t\t}\n\t\t}\n\t\t*/\n\t\t\n\t}",
"public boolean isLegalJump(MoveDirection dir){\r\n GamePosition curPos = currentGame.getCurrentPosition();\n\t\t\tPlayer white = currentGame.getWhitePlayer();\n\t\t\tint whiteCol = curPos.getWhitePosition().getTile().getColumn();\n\t\t\tint whiteRow = curPos.getWhitePosition().getTile().getRow();\n\t\t\tint blackCol = curPos.getBlackPosition().getTile().getColumn();\n\t\t\tint blackRow = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t\tint rChange = 0, cChange = 0;\n\t\t\tif(dir == MoveDirection.North) rChange = -2;\n\t\t\telse if(dir == MoveDirection.South) rChange = 2;\n\t\t\telse if(dir == MoveDirection.East) cChange = 2;\n\t\t\telse if(dir == MoveDirection.West) cChange = -2;\n\t\t\telse return false;\n\t\t\t\n\t\t\tif(curPos.getPlayerToMove().equals(white)) {\n\t\t\t\t\n\t\t\t\t//Moving left or right wall check\n\t\t\t\tif(cChange != 0) {\n\t\t\t\t\tif(blackRow != whiteRow || blackCol != (whiteCol + (cChange / 2) ) ) return false;\n\t\t\t\t\twhiteCol += cChange;\n\t\t\t\t\tif(whiteCol < 1 || whiteCol > 9) return false;\n\t\t\t\t\tfor(WallMove w : QuoridorController.getWalls()) {\n\t\t\t\t\t\tif(w.getWallDirection() == Direction.Vertical) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//If left- check col -1, -2. If right- check col +0, +1\n\t\t\t\t\t\t\tint tmp;\n\t\t\t\t\t\t\tif(cChange < 0) tmp = -2;\n\t\t\t\t\t\t\telse tmp = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint checkCol = (whiteCol -cChange) + tmp;\n\t\t\t\t\t\t\tif((w.getTargetTile().getColumn() == checkCol ||w.getTargetTile().getColumn() == checkCol + 1) && \n\t\t\t\t\t\t\t (w.getTargetTile().getRow() == whiteRow || w.getTargetTile().getRow() == whiteRow - 1)) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Horizontal Wall can't block right/left path\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\t//Moving up or down wall check\n\t\t\t\telse if(rChange != 0) {\n\t\t\t\t\tif(blackCol != whiteCol || blackRow != (whiteRow + (rChange / 2) ) ) return false;\n\t\t\t\t\twhiteRow += rChange;\n\t\t\t\t\tif(whiteRow < 1 || whiteRow > 9) return false;\n\t\t\t\t\tfor(WallMove w : QuoridorController.getWalls()) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(w.getWallDirection() == Direction.Horizontal) {\n\t\t\t\t\t\t\t//If up- check row -1, -2. If down- check row +0, +1\n\t\t\t\t\t\t\tint tmp;\n\t\t\t\t\t\t\tif(rChange < 0) tmp = -2;\n\t\t\t\t\t\t\telse tmp = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint checkRow = (whiteRow -rChange) + tmp;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif((w.getTargetTile().getRow() == checkRow || w.getTargetTile().getRow() == checkRow + 1)\n\t\t\t\t\t\t\t\t&& (w.getTargetTile().getColumn() == whiteCol || w.getTargetTile().getColumn() == whiteCol - 1)) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Vertical Wall can't block up/down path\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif((blackRow == whiteRow) && (blackCol == whiteCol)) return false;\n\t\t\t} else {\n\n\t\t\t\t//Moving left or right wall check\n\t\t\t\tif(cChange != 0) {\n\t\t\t\t\tif(blackRow != whiteRow || whiteCol != (blackCol + (cChange / 2) ) ) return false;\n\t\t\t\t\tblackCol += cChange;\n\t\t\t\t\tif(blackCol < 1 || blackCol > 9) return false;\n\t\t\t\t\tfor(WallMove w : QuoridorController.getWalls()) {\n\t\t\t\t\t\tif(w.getWallDirection() == Direction.Vertical) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//If left- check col -1, -2. If right- check col +0, +1\n\t\t\t\t\t\t\tint tmp;\n\t\t\t\t\t\t\tif(cChange < 0) tmp = -2;\n\t\t\t\t\t\t\telse tmp = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint checkCol = (blackCol -cChange) + tmp;\n\n\t\t\t\t\t\t\tif((w.getTargetTile().getColumn() == checkCol ||w.getTargetTile().getColumn() == checkCol + 1) && \n\t\t\t\t\t\t\t (w.getTargetTile().getRow() == blackRow || w.getTargetTile().getRow() == blackRow - 1)) {\n\t\t\t\t\t\t\t\treturn false;\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\t//Horizontal Wall can't block right/left path\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\t//Moving up or down wall check\n\t\t\t\telse if(rChange != 0) {\n\t\t\t\t\tif(blackCol != whiteCol || whiteRow != (blackRow + (rChange / 2) ) ) return false;\n\t\t\t\t\tblackRow += rChange;\n\t\t\t\t\tif(blackRow < 1 || blackRow > 9) return false;\n\t\t\t\t\tfor(WallMove w : QuoridorController.getWalls()) {\n\t\t\t\t\t\tif(w.getWallDirection() == Direction.Horizontal) {\n\t\t\t\t\t\t\t//If up- check row -1, -2. If down- check row +0, +1\n\t\t\t\t\t\t\tint tmp;\n\t\t\t\t\t\t\tif(rChange < 0) tmp = -2;\n\t\t\t\t\t\t\telse tmp = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint checkRow = (blackRow -rChange) + tmp;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif((w.getTargetTile().getRow() == checkRow || w.getTargetTile().getRow() == checkRow + 1)\n\t\t\t\t\t\t\t\t&& (w.getTargetTile().getColumn() == blackCol || w.getTargetTile().getColumn() == blackCol - 1)) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Vertical Wall can't block up/down path\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif((blackRow == whiteRow) && (blackCol == whiteCol)) return false;\n\t\t\t}\n\t\t\treturn true;\r\n }",
"public boolean isLegalStep(MoveDirection dir){\r\n GamePosition curPos = currentGame.getCurrentPosition();\n\t\tPlayer white = currentGame.getWhitePlayer();\n\t\tint[] toCheckPos = new int[2];\n\t\tint[] existingPos = new int[2];\n\t\tif(curPos.getPlayerToMove().equals(white)) {\n\t\t\ttoCheckPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t} else {\n\t\t\ttoCheckPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t}\n\t\t//0 = column, 1 = row\n\t\tif(dir == MoveDirection.North) {\n\t\t\tif(toCheckPos[1] == 1) return false;\n\t\t\tif(toCheckPos[1] - 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), -1, 0);\n\t\t} else if(dir == MoveDirection.South) {\n\t\t\tif(toCheckPos[1] == 9) return false;\n\t\t\tif(toCheckPos[1] + 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 1, 0);\n\t\t} else if(dir == MoveDirection.East) {\n\t\t\tif(toCheckPos[0] == 9) return false;\n\t\t\tif(toCheckPos[0] + 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, 1);\n\t\t} else if(dir == MoveDirection.West) {\n\t\t\tif(toCheckPos[0] == 1) return false;\n\t\t\tif(toCheckPos[0] - 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, -1);\n\t\t}\n\t\t\n\t\treturn false;\r\n }",
"static public Boolean slideTile(int row, int col, FloorTile newTile) {\r\n FloorTile oldTile1 = newTile;\r\n FloorTile oldTile2;\r\n boolean isNotFixed = true;\r\n if(row == 0 || row == board.length-1){//determine that the columns will be changed\r\n for (int i = 0; i < board.length; i++) {//check if there are any fixed or frozen tiles in the col\r\n if(board[i][col].isFixedTile() || board[i][col].isFrozen){\r\n isNotFixed = false;\r\n }\r\n }\r\n //move the tiles\r\n if(row == 0 && isNotFixed) {\r\n\r\n for(int i = 0; i < board.length; i++) {\r\n oldTile2 = board[i][col];\r\n board[i][col] = oldTile1;\r\n oldTile1 = oldTile2;\r\n }\r\n }else if(isNotFixed) {\r\n\r\n for(int i = board.length-1; i >= 0; i--) {\r\n oldTile2 = board[i][col];\r\n board[i][col] = oldTile1;\r\n oldTile1 = oldTile2;\r\n }\r\n }else {\r\n return false;\r\n }\r\n }else {//determine that the rows will be changed\r\n\r\n for (int i = 0; i < board[row].length; i++) {\r\n if(board[row][i].isFixedTile() || board[i][col].isFrozen){\r\n isNotFixed = false;\r\n }\r\n }\r\n\r\n if(col == 0 && isNotFixed) {\r\n for(int i = 0; i < board[row].length; i++) {\r\n oldTile2 = board[row][i];\r\n board[row][i] = oldTile1;\r\n oldTile1 = oldTile2;\r\n }\r\n\r\n }else if(isNotFixed) {\r\n for(int i = board[row].length-1; i >= 0; i--) {\r\n oldTile2 = board[row][i];\r\n board[row][i] = oldTile1;\r\n oldTile1 = oldTile2;\r\n }\r\n }else {\r\n return false;\r\n }\r\n\r\n }\r\n //if a player was standing on that tile it will be relocated to a new tile\r\n for(int i = 0; i < numOfPlayers; i++) {\r\n if(oldTile1 == players[i].getPosition()) {\r\n players[i].updateGetBackTiles(players[i].getPosition());\r\n players[i].setPosition(newTile);\r\n }\r\n }\r\n oldTile1.isFrozen = false;\r\n oldTile1.isOnFire = false;\r\n oldTile1.isFrozenForTheNextNTurns = 0;\r\n oldTile1.isOnFireForTheNextNTurns = 0;\r\n silkBag.add(oldTile1);\r\n return true;\r\n }",
"private void tryMovePlayer(int direction) {\n int layerOffset = 0, rowOffset = 0, colOffset = 0;\n boolean canMove = false;\n Maze3D.Cell currentCell = maze3D[playerLayer][playerRow][playerCol];\n Maze3D.Cell nextCell = null;\n try {\n switch (direction)\n {\n case Maze3D.UP:\n nextCell = maze3D[playerLayer][playerRow - 1][playerCol];\n canMove = !(currentCell.isWallTop() || nextCell.isWallBottom());\n rowOffset = -1;\n break;\n case Maze3D.DOWN:\n nextCell = maze3D[playerLayer][playerRow + 1][playerCol];\n canMove = !(currentCell.isWallBottom() || nextCell.isWallTop());\n rowOffset = 1;\n break;\n case Maze3D.LEFT:\n nextCell = maze3D[playerLayer][playerRow][playerCol - 1];\n canMove = !(currentCell.isWallLeft() || nextCell.isWallRight());\n colOffset = -1;\n break;\n case Maze3D.RIGHT:\n nextCell = maze3D[playerLayer][playerRow][playerCol + 1];\n canMove = !(currentCell.isWallRight() || nextCell.isWallLeft());\n colOffset = 1;\n break;\n case Maze3D.FRONT:\n nextCell = maze3D[playerLayer - 1][playerRow][playerCol];\n canMove = !(currentCell.isWallFront() || nextCell.isWallBack());\n layerOffset = -1;\n break;\n case Maze3D.BACK:\n nextCell = maze3D[playerLayer + 1][playerRow][playerCol];\n canMove = !(currentCell.isWallBack() || nextCell.isWallFront());\n layerOffset = 1;\n break;\n }\n //if cell is not null and can move, then move\n if (nextCell != null && canMove)\n {\n playerLayer += layerOffset;\n playerRow += rowOffset;\n playerCol += colOffset;\n mazeView.setPlayerLocation(playerLayer, playerRow, playerCol);\n moves++;\n }\n //if new position is the solution, then game is solved\n if (isSolved())\n {\n notifyGameEnd();\n }\n }\n catch (ArrayIndexOutOfBoundsException e)\n {\n Log.d(TAG, \"tryMovePlayer: player tried to move to edge\");\n }\n }",
"public void undoLastMove()\n {\n if (inProgress() && stackTiles.size() > 1)\n {\n // TAKE THE TOP 2 TILES\n MahjongSolitaireTile topTile = stackTiles.remove(stackTiles.size()-1);\n MahjongSolitaireTile nextToTopTile = stackTiles.remove(stackTiles.size() - 1);\n \n // SET THEIR DESTINATIONS\n float boundaryLeft = miniGame.getBoundaryLeft();\n float boundaryTop = miniGame.getBoundaryTop();\n \n // FIRST TILE 1\n int col = topTile.getGridColumn();\n int row = topTile.getGridRow();\n int z = tileGrid[col][row].size();\n float targetX = this.calculateTileXInGrid(col, z);\n float targetY = this.calculateTileYInGrid(row, z);\n topTile.setTarget(targetX, targetY);\n movingTiles.add(topTile);\n topTile.startMovingToTarget(MAX_TILE_VELOCITY);\n tileGrid[col][row].add(topTile);\n \n // AND THEN TILE 2\n col = nextToTopTile.getGridColumn();\n row = nextToTopTile.getGridRow();\n z = tileGrid[col][row].size();\n targetX = this.calculateTileXInGrid(col, z);\n targetY = this.calculateTileYInGrid(row, z);\n nextToTopTile.setTarget(targetX, targetY);\n movingTiles.add(nextToTopTile);\n nextToTopTile.startMovingToTarget(MAX_TILE_VELOCITY);\n tileGrid[col][row].add(nextToTopTile);\n \n // PLAY THE AUDIO CUE\n miniGame.getAudio().play(MahjongSolitairePropertyType.UNDO_AUDIO_CUE.toString(), false); \n }\n }",
"private void checkMoves(Tile t, MouseEvent e, ImageView img)\n {\n for(Tile tile : gb.getTiles())\n {\n tile.setStyle(null);\n tile.setOnMouseClicked(null);\n }\n ArrayList<Move> moves = t.getPiece().availableMoves(gb);\n for(Move m : moves)\n {\n gb.getTile(m.getX(),m.getY()).setStyle(\"-fx-background-color: #98FB98;\");\n gb.getTile(m.getX(),m.getY()).setOnMouseClicked(ev -> {\n if(ev.getTarget().getClass() == Tile.class)\n {\n movePiece(e,ev,t,img,moves);\n }\n else\n {\n ImageView img1 = (ImageView) ev.getTarget();\n Tile t2 = (Tile) img1.getParent();\n if(t2.isOccupied())\n {\n if(t2.getPiece().getClass() == King.class)\n {\n gb.setBlackKing(false);\n if(gameLogic.game(mainPane,gb.isBlackKing()))\n {\n cleanUp();\n }\n else {\n Platform.exit();\n }\n }\n t2.setImage(null);\n t2.setImage(img.getImage().getUrl());\n t.setImage(null);\n t2.setPiece(t.getPiece());\n t.setPiece(null);\n\n }\n else\n {\n t2.setImage(null);\n t2.setImage(img.getImage().getUrl());\n t.setImage(null);\n t2.setPiece(t.getPiece());\n t.setPiece(null);\n }\n cleanUpTile(moves);\n ev.consume();\n e.consume();\n }\n });\n }\n e.consume();\n }",
"private void checkForCollisionWithSelf() {\r\n if (isInSnake(snake[0].row,snake[0].column,true)) {\r\n gameOver();\r\n }\r\n }",
"void move() {\r\n\t\tif (x + xa < 0){\r\n\t\t\txa = mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\telse if (x + xa > game.getWidth() - diameter){\r\n\t\t\txa = -mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\tif (y + ya < 0){\r\n\t\t\tya = mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\telse if (y + ya > game.getHeight() - diameter){\r\n\t\t\tgame.gameOver();\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\tif (colisionPalas()){\r\n\t\t\tya = -mov;\r\n\t\t}\r\n\t\telse if(colisionEstorbos()){\r\n\t\t\tgame.puntuacion+=2;\r\n\t\t}\r\n\t\t\r\n\t\tx = x + xa;\r\n\t\ty = y + ya;\r\n\t}",
"private void checkCollision() {\n\n for(int b = 1; b < snakeLength; b++){\n if(xLength[b] == xLength[0] && yLength[b] == yLength[0]) {\n right = false;\n left = false;\n down = false;\n up = false;\n gameOver = true;\n }\n }\n\n if(right){\n if(xLength[0] >= 825) {\n gameOver = true;\n }\n }\n if(left){\n if(xLength[0] <= 50) {\n gameOver = true;\n }\n }\n if(down){\n if(yLength[0] >= 600) {\n gameOver = true;\n }\n }\n if(up){\n if(yLength[0] <= 100) {\n gameOver = true;\n }\n }\n }",
"private boolean checkCollision(int x, int y) {\r\n\t\tRectangle r = new Rectangle(); // Location Rectangle\r\n\t\tr.width = Tile.TILEWIDTH;\r\n\t\tr.height = Tile.TILEHEIGHT;\r\n\t\tr.x = x * Tile.TILEWIDTH;\r\n\t\tr.y = y * Tile.TILEHEIGHT;\r\n\t\tfor(Nonmoving n : handler.getWorld().getEntityManager().getNonmoving()) {\r\n\t\t\tif(n.getCollisionBounds(0, 0).intersects(r)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(Objects o : handler.getWorld().getEntityManager().getObjects()) {\r\n\t\t\tif(o.getCollisionBounds(0, 0).intersects(r)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public MahjongSolitaireMove findMove()\n {\n // MAKE A MOVE TO FILL IN \n MahjongSolitaireMove move = new MahjongSolitaireMove();\n\n // GO THROUGH THE ENTIRE GRID TO FIND A MATCH BETWEEN AVAILABLE TILES\n for (int i = 0; i < gridColumns; i++)\n {\n for (int j = 0; j < gridRows; j++)\n {\n ArrayList<MahjongSolitaireTile> stack1 = tileGrid[i][j];\n if (stack1.size() > 0)\n {\n // GET THE FIRST TILE\n MahjongSolitaireTile testTile1 = stack1.get(stack1.size()-1);\n for (int k = 0; k < gridColumns; k++)\n {\n for (int l = 0; l < gridRows; l++)\n {\n if (!((i == k) && (j == l)))\n { \n ArrayList<MahjongSolitaireTile> stack2 = tileGrid[k][l];\n if (stack2.size() > 0) \n {\n // AND TEST IT AGAINST THE SECOND TILE\n MahjongSolitaireTile testTile2 = stack2.get(stack2.size()-1);\n \n // DO THEY MATCH\n if (testTile1.match(testTile2))\n {\n // YES, FILL IN THE MOVE AND RETURN IT\n move.col1 = i;\n move.row1 = j;\n move.col2 = k;\n move.row2 = l;\n return move;\n }\n }\n }\n }\n }\n }\n }\n }\n // WE'VE SEARCHED THE ENTIRE GRID AND THERE\n // ARE NO POSSIBLE MOVES REMAINING\n return null;\n }",
"void doMove() {\n\t\t// we saved the moves in a queue to avoid recursing.\n\t\tint[] move;\n\t\twhile(!moveQueue.isEmpty()) {\n\t\t\tmove = moveQueue.remove(); \n\t\t\tif (board[move[0]][move[1]] == 0) {\n\t\t\t\tinsertNumber(move[0], move[1], move[2]);\n\t\t\t}\n\t\t}\n\t\tgoOverLines();\n\t}",
"private int Win_Move() {\n\t\tfinal int POSSIBLE_WIN = 8;\n\t\tint move = NO_MOVE;\n\t\tif(( gameBoard[TOP_LEFT] + gameBoard[TOP_CENTER] + gameBoard[TOP_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[TOP_CENTER] == EMPTY){\n\t\t\t\tmove = TOP_CENTER;\n\t\t\t}else if (gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[CTR_LEFT] + gameBoard[CTR_CENTER] + gameBoard[CTR_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[CTR_LEFT] == EMPTY){\n\t\t\t\tmove = CTR_LEFT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[CTR_RIGHT] == EMPTY){\n\t\t\t\tmove = CTR_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[BTM_LEFT] + gameBoard[BTM_CENTER] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}else if (gameBoard[BTM_CENTER] == EMPTY){\n\t\t\t\tmove = BTM_CENTER;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_LEFT] + gameBoard[BTM_LEFT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[CTR_LEFT] == EMPTY){\n\t\t\t\tmove = CTR_LEFT;\n\t\t\t}else if (gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_CENTER] + gameBoard[CTR_CENTER] + gameBoard[BTM_CENTER]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_CENTER] == EMPTY){\n\t\t\t\tmove = TOP_CENTER;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_CENTER] == EMPTY){\n\t\t\t\tmove = BTM_CENTER;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_RIGHT] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}else if (gameBoard[CTR_RIGHT] == EMPTY){\n\t\t\t\tmove = CTR_RIGHT;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_CENTER] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_CENTER] + gameBoard[BTM_LEFT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}\n\t\t}\n\t\treturn move;\n\t}",
"private void checkCollisions() {\n float x = pacman.getPos().x;\n float y = pacman.getPos().y;\n\n GameEntity e;\n for (Iterator<GameEntity> i = entities.iterator(); i.hasNext(); ) {\n e = i.next();\n // auf kollision mit spielfigur pruefen\n if (Math.sqrt((x - e.getPos().x) * (x - e.getPos().x) + (y - e.getPos().y) * (y - e.getPos().y)) < 0.5f)\n if (e.collide(this, pacman))\n i.remove();\n }\n }",
"private boolean collision(double xa, double ya) {\n\t\t\n\t\tint xMin = 2;\n int xMax = 15;\n int yMin = 15;\n int yMax = 19;\n if(Player.isSwimming){\n \tyMax = 1;\n \txMax = 18;\n }\n if (level.getTile((int)this.x / 32, (int)this.y / 32).getId() == 30) {\n \txMax = 18;\n \txMin = 20;\n }\n if (level.getTile((int)this.x / 32, (int)this.y / 32).getId() == 25) {\n \txMax = 32;\n \txMin = 32;\n \tyMax = 7;\n }\n \n \n int yMinWater = 0;\n for (int x = xMin; x < xMax; x++) {\n if (isSolidTile((int)xa, (int)ya, x, yMin)) {\n return true;\n }\n }\n for (int x = xMin; x < xMax; x++) {\n if (isSolidTile((int)xa,(int) ya, x, yMax)) {\n return true;\n }\n }\n for (int y = yMin; y < yMax; y++) {\n if (isSolidTile((int)xa, (int)ya, xMin, y)) {\n return true;\n }\n }\n for (int y = yMin; y < yMax; y++) {\n if (isSolidTile((int)xa, (int)ya, xMax, y)) {\n return true;\n }\n }\n if(Player.isSwimming || Player.isClimbing){\n \t for (int y = yMinWater; y < yMax; y++) {\n if (isSolidTile((int)xa, (int)ya, yMinWater, y)) {\n return true;\n }\n }\n }\n \n return false;\n\t}",
"public boolean validRook (int startRow, int startColumn, int endRow, int endColumn, Tile[][] board) {\n\t\t\n\t\tint distanceMovedUpDown =endRow-startRow; \n\t\tint distanceMovedLeftRight = endColumn-startColumn;\n\n\t\tif (distanceMovedUpDown !=0 && distanceMovedLeftRight != 0) { //have to stay in the same column or row to be valid\n\t\t\treturn false;\n\t\t}\n\n\n\t\tif (startRow == endRow) { //moving left or right \n\t\t\tif (Math.abs(distanceMovedLeftRight) > 1) { //checking if there's pieces btwn start and end if moving more than 1\n\t\t\t\tif (distanceMovedLeftRight > 0) {//moving to the right \n\t\t\t\t\tint x=startColumn + 1;\n\t\t\t\t\twhile (x < endColumn) {\n\t\t\t\t\t\tif (board[startRow][x].getOccupyingPiece() != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx++;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tif (distanceMovedLeftRight < 0) {//moving to the left\n\t\t\t\t\tint x = startColumn -1;\n\t\t\t\t\twhile (x > endColumn) {\n\t\t\t\t\t\tif (board[startRow][x].getOccupyingPiece() != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn true;\n\n\t\t}\n\t\tif (startColumn == endColumn) { //moving up or down\n\t\t\tif (Math.abs(distanceMovedUpDown) > 1) { //checking if there's pieces btwn start and end if moving more than 1\n\t\t\t\tif (distanceMovedUpDown > 0) {//moving up the array\n\t\t\t\t\tint x=startRow + 1;\n\t\t\t\t\twhile (x < endRow) {\n\t\t\t\t\t\tif (board[x][startColumn].getOccupyingPiece() != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx++;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tif (distanceMovedUpDown < 0) {//moving down the array\n\t\t\t\t\tint x = startRow -1;\n\t\t\t\t\twhile (x > endRow) {\n\t\t\t\t\t\tif (board[x][startColumn].getOccupyingPiece() != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\n\t}",
"public void checkwarp(){\n\t\tif(pacman.ypos > (colours[0].length*interval)-2){\r\n\t\t\tpacman.ypos = interval+2;\r\n\t\t}\r\n\t\telse if(pacman.xpos > (colours.length*interval)-2){\r\n\t\t\tpacman.xpos = interval+2;\r\n\t\t}\r\n\t\telse if(pacman.ypos < interval+2){\r\n\t\t\tpacman.ypos = (colours[0].length*interval)-2;\r\n\t\t}\r\n\t\telse if(pacman.xpos < interval+2){\r\n\t\t\tpacman.xpos = (colours.length*interval)-2;\r\n\t\t}\r\n\t\t\r\n\t}",
"private void moveTile()\n {\n int[] moveIndices = null;\n \n int sourceRow = moveIndices[0];\n int sourceCol = moveIndices[1];\n int destRow = moveIndices[2] - 1;\n int destCol = moveIndices[3];\n \n if (sourceRow == 0) \n {\n try\n {\n game.playTileFromHand(sourceCol, destRow, destCol);\n }\n catch(ArrayIndexOutOfBoundsException ex)\n {\n // TODO: ConsoleUtils.message(\"Unable to complete your play, wrong indices!\");\n }\n }\n else\n {\n sourceRow--;\n try\n {\n game.moveTileInBoard(sourceRow, sourceCol, destRow, destCol); \n }\n catch(ArrayIndexOutOfBoundsException ex)\n {\n // TODO: ConsoleUtils.message(\"Unable to complete your play, wrong indices!\");\n }\n }\n }",
"public boolean attemptMove(Move move, int color) {\n //ArrayList<Move> jumps = canJump(color);\n //make sure the to and from values don't go out of bounds\n if (move.xFrom > 7 || move.yFrom > 7 || move.xTo > 7 || move.yTo > 7 ||\n \tmove.xFrom < 0 || move.yFrom < 0 || move.xTo < 0 || move.yTo < 0 ){\n// System.out.println(\"out of bounds\");\n return false;\n }\n int stateOfFrom = gameState.getStateOfSquare(move.xFrom, move.yFrom);\n int stateOfTo = gameState.getStateOfSquare(move.xTo, move.yTo);\n \n\n //if there in no piece in the \"from\" location return false\n if (stateOfFrom == 0){\n// System.out.println(\"no piece at 'from'\");\n return false;\n }\n \n //if there is a piece in the \"to\" location return false\n if (!(stateOfTo == 0)){\n// System.out.println(\"'to' is not empty\");\n return false;\n }\n \n //if the \"from\" piece is not the correct color return false\n if (!(gameState.getStateOfSquare(move.xFrom, move.yFrom)%2 == color))\n {\n// System.out.println(\"that is not your piece\");\n return false;\n }\n \n //check if the \"from\" piece is moving in the right direction\n \n /*if (jumps.isEmpty() == false) //if there are jumps.\n {\n System.out.println(\"there are jumps\");\n //for every possible jump\n for (int i=0; i<jumps.size(); i++){\n \t//if this move matches a possible jump then it is valid\n \tSystem.out.println(\"is this jump \"+ i + \"?\");\n \tif ((move.xFrom == jumps.get(i).xFrom)&&\n \t\t\t(move.yFrom == jumps.get(i).yFrom)&&\n \t\t\t(move.xTo == jumps.get(i).xTo)&&\n \t\t\t(move.yTo == jumps.get(i).yTo)){\n \t\tSystem.out.println(\"yes\");\n \t\treturn true;\n \t}\n \telse{\n \t\tSystem.out.println(\"there are possible jumps\");\n \t}\n \t\t\n \t\n }\n //return false;\n \n //handle jumps\n }\n */\n //moving diagonally\n else{\n if (move.xTo == move.xFrom + 1 || move.xTo == move.xFrom - 1){\n //if (stateOfFrom >= 3) \n //if piece is king it can move both forward and back\n if (stateOfFrom >= 3 && (move.yTo == move.yFrom + 1 || move.yTo == move.yFrom - 1)){\n \treturn true;\n }\n //red can only move up\n else if(color == 0 && (move.yTo == move.yFrom + 1)){\n \treturn true;\n }\n //black can only move down\n else if(color == 1 && (move.yTo == move.yFrom - 1)){\n \treturn true;\n }\n else{\n// System.out.println(\"wrong way\");\n return false;\n }\n }\n else{\n// System.out.println(\"too far away\");\n return false;\n }\n }\n //return true;\n \n \n }",
"private void checkCollisionwithMonster() {\n\t\tr1.set(this.getX(),this.getY(),this.getWidth(),this.getHeight());\r\n\t\t\r\n\t\t//check collision with monsters\t\t\r\n\t\tif(Math.ceil(this.getColor().a) == 1 && System.nanoTime() - oldTime >= cdTime){\r\n\t\t\tfor(TreeMonster treeMon : treeMonArray){\r\n\t\t\t\tif(treeMon.isVisible()){\r\n\t\t\t\t\tr2.set(treeMon.getCollisionBox());\r\n\t\t\t\t\tif (!r1.overlaps(r2)) continue;\r\n\t\t\t\t\toldTime = System.nanoTime();\r\n\t\t\t\t\tsetHealth(health-1);\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\t\r\n\t\tif(Math.ceil(this.getColor().a) == 1 && System.nanoTime() - oldTime >= cdTime){\r\n\t\t\tfor(SlimeMonster slimeMon : slimeMonArray){\r\n\t\t\t\tif(slimeMon.isVisible()){\r\n\t\t\t\t\tr2.set(slimeMon.getCollisionBox());\r\n\t\t\t\t\tif (!r1.overlaps(r2)) continue;\r\n\t\t\t\t\toldTime = System.nanoTime();\r\n\t\t\t\t\tsetHealth(health-1);\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\t\r\n\t\tif(Math.ceil(this.getColor().a) == 1 && System.nanoTime() - oldTime >= cdTime){\r\n\t\t\tfor(FireMonster fireMon : fireMonArray){\r\n\t\t\t\tif(fireMon.isVisible()){\r\n\t\t\t\t\tr2.set(fireMon.getCollisionBox());\r\n\t\t\t\t\tif (!r1.overlaps(r2)) continue;\r\n\t\t\t\t\toldTime = System.nanoTime();\r\n\t\t\t\t\tsetHealth(health-1);\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}",
"@Override\n synchronized public void run() {\n if (gameBoard.wasCollisionDetected()) {\n Point collisionPoint = gameBoard.getLastCollision();\n if (collisionPoint.x >= 0) {\n dummyText.setText(\"Last Collision XY (\" + Integer.toString(collisionPoint.x) + \",\" + Integer.toString(collisionPoint.y) + \")\");\n score++;\n }\n //turn off the animation until reset gets pressed\n //return;\n }\n frame.removeCallbacks(frameUpdate);\n\n Point playerNewPosition = new Point(gameBoard.getPlayerX(), gameBoard.getPlayerY());\n Point targetNewPosition = new Point(gameBoard.getTargetX(), gameBoard.getTargetY());\n Point obstacle1NewPosition = new Point(gameBoard.getObstacle1X(), gameBoard.getObstacle1Y());\n Point obstacle2NewPosition = new Point(gameBoard.getObstacle2X(), gameBoard.getObstacle2Y());\n\n updatePlayerVelocity();\n playerNewPosition.y = playerNewPosition.y + playerVelocity.y;\n if (playerNewPosition.y > playerMaxY) {\n // return doge to original position if it overshoots\n playerNewPosition.y = playerMaxY;\n performJump = false;\n button.setEnabled(true);\n }\n\n targetNewPosition.x = targetNewPosition.x + targetVelocity.x;\n if (targetNewPosition.x > memeMaxX || targetNewPosition.x < 5) {\n targetVelocity.x *= -1;\n }\n targetNewPosition.y = targetNewPosition.y + targetVelocity.y;\n if (targetNewPosition.y > memeMaxY || targetNewPosition.y < 5) {\n targetVelocity.y *= -1;\n }\n\n obstacle1NewPosition.x = obstacle1NewPosition.x + obstacle1Velocity.x;\n if (obstacle1NewPosition.x > memeMaxX || obstacle1NewPosition.x < 5) {\n obstacle1Velocity.x *= -1;\n }\n obstacle1NewPosition.y = obstacle1NewPosition.y + obstacle1Velocity.y;\n if (obstacle1NewPosition.y > memeMaxY || obstacle1NewPosition.y < 5) {\n obstacle1Velocity.y *= -1;\n }\n\n obstacle2NewPosition.x = obstacle2NewPosition.x + obstacle2Velocity.x;\n if (obstacle2NewPosition.x > memeMaxX || obstacle2NewPosition.x < 5) {\n obstacle2Velocity.x *= -1;\n }\n obstacle2NewPosition.y = obstacle2NewPosition.y + obstacle2Velocity.y;\n if (obstacle2NewPosition.y > memeMaxY || obstacle2NewPosition.y < 5) {\n obstacle2Velocity.y *= -1;\n }\n\n gameBoard.setPlayerPosition(playerNewPosition.x, playerNewPosition.y);\n gameBoard.setTargetPosition(targetNewPosition.x, targetNewPosition.y);\n gameBoard.setObstacle1Position(obstacle1NewPosition.x, obstacle1NewPosition.y);\n gameBoard.setObstacle2Position(obstacle2NewPosition.x, obstacle2NewPosition.y);\n gameBoard.invalidate();\n frame.postDelayed(frameUpdate, getFrameRate());\n }",
"@Override\n public boolean isValidMove(Tile target, Board board) {\n if (target == null || board == null) {\n throw new NullPointerException(\"Arguments for the isValidMove method can not be null.\");\n }\n // current and target tiles have to be on a diagonal (delta between row and col index have to be identical)\n int currentCol = this.getTile().getCol();\n int currentRow = this.getTile().getRow();\n int targetCol = target.getCol();\n int targetRow = target.getRow();\n\n int deltaRow = Math.abs(currentRow - targetRow);\n int deltaCol = Math.abs(currentCol - targetCol);\n int minDelta = Math.min(deltaCol, deltaRow);\n\n boolean sameDiagonal = deltaCol == deltaRow;\n\n // check if there are pieces between the tiles\n boolean noPiecesBetween = true;\n // Directions -- (Up and to the left) , -+ (Up and to the right), ++, +-\n if (targetRow < currentRow && targetCol < currentCol) { // --\n for (int delta = 1; delta < minDelta; delta++) {\n Tile tileInBetween = board.getTile(currentRow - delta, currentCol - delta);\n if (tileInBetween.hasChessPiece()) {\n noPiecesBetween = false;\n }\n }\n\n } else if (targetRow > currentRow && targetCol < currentCol) { // +-\n for (int delta = 1; delta < minDelta; delta++) {\n Tile tileInBetween = board.getTile(currentRow + delta, currentCol - delta);\n if (tileInBetween.hasChessPiece()) {\n noPiecesBetween = false;\n }\n }\n } else if (targetRow > currentRow && targetCol > currentCol) { // ++\n for (int delta = 1; delta < minDelta; delta++) {\n Tile tileInBetween = board.getTile(currentRow + delta, currentCol + delta);\n if (tileInBetween.hasChessPiece()) {\n noPiecesBetween = false;\n }\n }\n } else if (targetRow < currentRow && targetCol > currentCol) { // -+\n for (int delta = 1; delta < minDelta; delta++) {\n Tile tileInBetween = board.getTile(currentRow - delta, currentCol + delta);\n if (tileInBetween.hasChessPiece()) {\n noPiecesBetween = false;\n }\n }\n }\n\n return sameDiagonal && noPiecesBetween;\n }",
"private boolean checkM(){\n if(currentLocation.x == previousLocation.x && currentLocation.y == previousLocation.y) {\n return false;\n }\n // Is outside the border\n if(currentLocation.x < size || currentLocation.y < size || currentLocation.x > map.numRows - size || currentLocation.y > map.numCols - size) {\n return false;\n }\n // Is on the land\n double angle2 = 0;\n while (angle2 < 6.3) {\n if (map.getTerrainGrid()[currentLocation.x + (int) (size/2 * cos(angle2))][currentLocation.y + (int) (size/2 * sin(angle2))] == Colors.OCEAN) {\n return false;\n }\n angle2 += 0.3;\n }\n return true;\n }",
"public void checkCollisions(){\n for(int i=bodyParts;i>0;i--){\n if((x[0]==x[i])&&(y[0]==y[i])){\n running=false;\n }\n }\n //head with left border\n if(x[0]<0){\n running=false;\n }\n //head with right border\n if(x[0]>screen_width){\n running=false;\n }\n //head with top border\n if(y[0]<0){\n running=false;\n }\n //head with bottom border\n if(y[0]>screen_height){\n running=false;\n }\n if(!running){\n timer.stop();\n }\n }",
"private void checkCollisions() {\n int x1 = 0;\n int x2 = 0;\n for(CollisionBox e : cols) {\n for(CollisionBox f : cols) {\n if(\n x2 > x1 && // Skip checking collisions twice\n// (\n// e != f || // The entities are not the same entity\n// ( // One of the entities's parent object is not the bullet of the other's (aka ignore player bullets colliding with player)\n// // And also check they're not both from the same entity (two bullets colliding both going in the same direction from the same entity)\n// f.getParent() != null && // The first entity has a parent and\n// e.getParent() != null && // The second entity has a parent and\n// f.getParent().getParent() != null && // The first entity's parent has a parent and\n// e.getParent().getParent() != null && // The second entity's parent has a parent and\n// f.getParent().getParent() != e.getParent() && // The first entity's parent's parent is not the second entity's parent\n// e.getParent().getParent() != f.getParent() &&// The second entity's parent's parent is not the first entity's parent\n// f.getParent().getParent() != e.getParent().getParent() // The first and second entities' parents' parents are not the same\n// )\n// ) &&\n SAT.isColliding(e, f) // The entities are colliding\n ) { // Collide the Entities\n Entity ep = e.getParent();\n Entity fp = f.getParent();\n ep.collide(fp);\n fp.collide(ep);\n }\n x2++;\n }\n x1++;\n x2 = 0;\n }\n }",
"public boolean checkCollisions(Tuple camera) {\n\n\t\t// already exploded\n\t\tif(disabled > 0) {\n\t\t\treturn false;\n\t\t} // if\n\t\t\n\t\t// collision detected\n\t\tif(location.distance(camera) - size < SHIP_SIZE) {\n\t\t\tdisabled = 1;\n\t\t\treturn true;\n\t\t} // if\n\t\treturn false;\n\t}",
"public boolean isMovePossible(int start, int end, boolean isRed){\n\n int moveDiff = end - start; //moveDiff tracks the movement made based on difference btwn start and end\n //general check for if a checker is on the end square\n if (mCheckerBoard.get(end) != null)\n {\n return false; //can't move b/c a checker is on the end square\n }\n\n //general checks that start and end are on the board\n if(end<0 || end>63)\n {\n return false; //can't move b/c end is off-board\n }\n\n\n //checks for diagonalRight\n if(moveDiff == 9 || moveDiff ==-7)\n {\n if(start % 8 == 7){\n return false; //can't move b/c off-board on right\n }\n }\n\n //checks for diagonalLeft\n if(moveDiff == 7 || moveDiff ==-9)\n {\n if(start % 8 == 0){\n return false; //can't move b/c off-board on left\n }\n }\n\n //checks for jumpRight\n if(moveDiff == 18 || moveDiff == -14){\n //column check\n if((start % 8 == 7) || (start % 8 == 6)){\n return false; //can't move b/c off-board on right\n }\n //need to check if there is a piece of opposite color in between\n int jumpSpace = start + (moveDiff/2);\n Checker jumped = mCheckerBoard.get(jumpSpace);\n if(jumped == null)\n {\n return false; //can't move b/c no checker to jump\n }\n else if (jumped.isRed() == isRed)\n {\n return false; //can't move b/c can't jump own color\n }\n }\n\n //checks for jumpLeft\n if(moveDiff == 14 || moveDiff == -18){\n if((start % 8 == 7) || (start % 8 == 6)) {\n return false; //can't move b/c off-board on right\n }\n //need to check if there is a piece of opposite color in between\n int jumpSpace = start + (moveDiff/2);\n Checker jumped = mCheckerBoard.get(jumpSpace);\n if(jumped == null)\n {\n return false; //can't move b/c no checker to jump\n }\n else if (jumped.isRed() == isRed)\n {\n return false; //can't move b/c can't jump own color\n }\n }\n\n if(moveDiff == 7 || moveDiff ==-7 || moveDiff ==9 || moveDiff ==-9\n || moveDiff == 18 || moveDiff == -18 || moveDiff == 14 || moveDiff ==-14){\n return true;\n }\n else{\n return false;\n }\n\n }",
"private void checkMovement()\n {\n if (frames % 600 == 0)\n {\n \n ifAllowedToMove = true;\n \n \n }\n \n }",
"public boolean checkReached(float xTile, float yTile)\r\n/* 134: */ {\r\n/* 135:149 */ if ((this.mission) && (tileReachObjectives(xTile, yTile)))\r\n/* 136: */ {\r\n/* 137:152 */ this.reach[((int)xTile)][((int)yTile)] = 0;\r\n/* 138:153 */ this.reachablePlaces -= 1;\r\n/* 139:154 */ if (this.reachablePlaces == 0) {\r\n/* 140:156 */ return true;\r\n/* 141: */ }\r\n/* 142: */ }\r\n/* 143:160 */ return false;\r\n/* 144: */ }",
"private void computeMovableTilesToDisplayToPlayer() {\n \tfor (Entity enemyEntity : allCreaturesOfCurrentRoom) {\n \t\tAIComponent aiComponent = Mappers.aiComponent.get(enemyEntity);\n \t\tif (aiComponent.getSubSystem() != null) {\n \t\t\tboolean handledInSubSystem = aiComponent.getSubSystem().computeMovableTilesToDisplayToPlayer(this, enemyEntity, room);\n \t\t\tif (handledInSubSystem) continue;\n \t\t}\n \t\t\n \tMoveComponent moveCompo = Mappers.moveComponent.get(enemyEntity);\n \tAttackComponent attackCompo = Mappers.attackComponent.get(enemyEntity);\n \t\n \t\t//clear the movable tile\n \t\tmoveCompo.clearMovableTiles();\n \t\tif (attackCompo != null) attackCompo.clearAttackableTiles();\n \t\t\n \t\tmoveCompo.setMoveRemaining(moveCompo.getMoveSpeed());\n \t\t\n \t//Build the movable tiles list\n \t\ttileSearchService.buildMoveTilesSet(enemyEntity, room);\n \t\tif (attackCompo != null) attackTileSearchService.buildAttackTilesSet(enemyEntity, room, false, true);\n \t\tmoveCompo.hideMovableTiles();\n \t\tif (attackCompo != null) attackCompo.hideAttackableTiles();\n \t}\n }",
"@Override\n public Collection<Move> calculateLegalMoves(Board board) {\n System.out.println(\"INSIDE Knight: calculateLegalMoves()\");\n System.out.println(\"------------------------------>\\n\");\n\n //ArrayList of moves used to store all possible legal moves.\n final List<Move> legalMoves = new ArrayList<>();\n\n //Iterate the constant class array of piece offsets.\n for(final int currentCandidate : CANDIDATE_MOVE_COORDS){\n //Add the current coordinate of the piece to each offset, storing as a destination coordinate.\n final int candidateDestinationCoord = this.piecePosition + currentCandidate;\n\n //If the destination coordinate is within legal board bounds (between 0 and 64)...\n if(BoardUtils.isValidCoord(candidateDestinationCoord)){\n //Check to see if the piece is in the first column and its destination would move it outside the board.\n if(isfirstColumnExclusion(this.piecePosition, currentCandidate) ||\n isSecondColumnExclusion(this.piecePosition, currentCandidate) ||\n isSeventhColumnExclusion(this.piecePosition, currentCandidate) ||\n isEighthColumnExclusion(this.piecePosition, currentCandidate)){\n continue; //Continue the loop if any of these methods return true\n }\n\n //Store the tile of the destination coordinate.\n final Tile candidateDestinationTile = board.getTile(candidateDestinationCoord);\n\n //If the tile is not marked as occupied by the Tile class...\n if(!candidateDestinationTile.isOccupied()){\n //Add the move to the list of legal moves as a non-attack move.\n legalMoves.add(new MajorMove(board, this, candidateDestinationCoord));\n }\n else{\n //Otherwise, get the type and alliance of the piece at the destination.\n final Piece pieceAtDestination = candidateDestinationTile.getPiece();\n final Alliance pieceAlliance = pieceAtDestination.getPieceAlliance();\n\n //If the piece at the occupied tile's alliance differs...\n if(this.pieceAlliance != pieceAlliance){\n //Add the move to the list of legal moves as an attack move.\n legalMoves.add(new MajorAttackMove(board, this, candidateDestinationCoord, pieceAtDestination));\n }\n }\n }\n }\n\n //Return the list of legal moves.\n return legalMoves;\n }",
"public void revisaColisionMapa() {\n\t\tactualCol = (int)x / tamTile;\n\t\tactualRen = (int)y / tamTile;\n\t\t\n\t\txdest = x + dx;\n\t\tydest = y + dy;\n\t\t\n\t\txtemp = x;\n\t\tytemp = y;\n\t\t\n\t\tcalcularEsquinas(x, ydest);\n\t\tif(dy < 0) {\n\t\t\tif(arribaIzq || arribaDer) {\n\t\t\t\tdy = 0;\n\t\t\t\tytemp = actualRen * tamTile + claltura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tytemp += dy;\n\t\t\t}\n\t\t}\n\t\tif(dy > 0) {\n\t\t\tif(abajoIzq || abajoDer) {\n\t\t\t\tdy = 0;\n\t\t\t\tcayendo = false;\n\t\t\t\tytemp = (actualRen + 1) * tamTile - claltura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tytemp += dy;\n\t\t\t}\n\t\t}\n\t\t\n\t\tcalcularEsquinas(xdest, y);\n\t\tif(dx < 0) {\n\t\t\tif(arribaIzq || abajoIzq) {\n\t\t\t\tdx = 0;\n\t\t\t\txtemp = actualCol * tamTile + clanchura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\txtemp += dx;\n\t\t\t}\n\t\t}\n\t\tif(dx > 0) {\n\t\t\tif(arribaDer || abajoDer) {\n\t\t\t\tdx = 0;\n\t\t\t\txtemp = (actualCol + 1) * tamTile - clanchura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\txtemp += dx;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!cayendo) {\n\t\t\tcalcularEsquinas(x, ydest + 1);\n\t\t\tif(!abajoIzq && !abajoDer) {\n\t\t\t\tcayendo = true;\n\t\t\t}\n\t\t}\n\t}",
"private void checkForBulletCollisions() {\r\n\t\tbulletMoveOffScreen();\r\n\t\tbulletCollisionWithObject();\r\n\t}",
"@Override\n\tpublic Collection<Move> calculateLegalMoves(final Board board) {\n\t\t\n\t\t//Array that will hold of the legal moves for the Pawn\n\t\tfinal List<Move> legalMoves = new ArrayList<>();\n\t\t\n\t\t//Loop through all possible moves by applying of the offsets to the Pawn's current position\n\t\tfor(final int currentCandidateOffset: CANDIDATE_MOVE_COORDINATES){\n\t\t\t\n\t\t\t//Apply the offset to the Pawn's current position\n\t\t\tfinal int candidateDestinationCoordinate = this.piecePosition + (this.getPieceTeam().getDirection() * currentCandidateOffset);\n\t\t\t\n\t\t\t//Checks if the Destination Coordinate is valid\n\t\t\tif(!BoardUtils.isValidTileCoordinate(candidateDestinationCoordinate)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//Checks if this tile is occupied\n\t\t\tif(currentCandidateOffset == 8 && !board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnMove(board, this, candidateDestinationCoordinate)));\n\t\t\t\telse\n\t\t\t\t\tlegalMoves.add(new Move.PawnMove(board, this, candidateDestinationCoordinate));\t\n\t\t\t}\n\t\t\t//Checks if the Pawn is on it's first move\n\t\t\telse if(currentCandidateOffset == 16 && this.isFirstMove() && ((BoardUtils.SEVENTH_RANK[this.piecePosition] && \n\t\t\t\t\tthis.getPieceTeam().isBlack()) || (BoardUtils.SECOND_RANK[this.piecePosition] && this.getPieceTeam().isWhite()))) {\n\t\t\t\t\n\t\t\t\t//Calculate coordinate of the tile behind candidate coordinate\n\t\t\t\tfinal int behindCandidateDestinationCoordinate = this.piecePosition + (this.pieceTeam.getDirection() * 8);\n\t\t\t\t\n\t\t\t\t//Checks if the tile behind the candidate destination is NOT occupied & if the Tile at the Candidate Destination is NOT occupied\n\t\t\t\tif(!board.getTile(behindCandidateDestinationCoordinate).isTileOccupied() && \n\t\t\t !board.getTile(candidateDestinationCoordinate).isTileOccupied())\n\t\t\t\t\t\tlegalMoves.add(new Move.PawnJump(board, this, candidateDestinationCoordinate));\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t//Checks for edge cases in the 7 direction\t\n\t\t\t} else if(currentCandidateOffset == 7 &&\n\t\t\t\t\t!((BoardUtils.FILE_H[this.piecePosition] && this.getPieceTeam().isWhite() ||\n\t\t\t\t\t(BoardUtils.FILE_A[this.piecePosition] && this.getPieceTeam().isBlack())))){\n\t\t\t\t\n\t\t\t\tif(board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\t\tfinal Piece pieceOnCandidate = board.getTile(candidateDestinationCoordinate).getPiece();\n\t\t\t\t\t//If the pieces are not on the same team an Attack move is added to legal moves.\n\t\t\t\t\tif(this.getPieceTeam() != pieceOnCandidate.getPieceTeam())\n\t\t\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate)));\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t\n\t\t\t\t//This basically checks if En Passant Pawn is next to Player's pawn\t\n\t\t\t\t} else if(board.getEnPassantPawn() != null){\n\t\t\t\t\tif(board.getEnPassantPawn().getPiecePosition() == (this.piecePosition + (this.pieceTeam.getOppositeDirection()))){\n\t\t\t\t\t\tfinal Piece pieceOnCandidate = board.getEnPassantPawn();\n\t\t\t\t\t\tif(this.pieceTeam != pieceOnCandidate.getPieceTeam()){\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnEnPassantAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t//Checks for edge cases in the 9 direction\t\n\t\t\t} else if(currentCandidateOffset == 9 && \n\t\t\t\t\t!((BoardUtils.FILE_A[this.piecePosition] && this.getPieceTeam().isWhite() ||\n\t\t\t\t\t(BoardUtils.FILE_H[this.piecePosition] && this.getPieceTeam().isBlack())))){\n\t\t\t\t\n\t\t\t\tif(board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\t\tfinal Piece pieceOnCandidate = board.getTile(candidateDestinationCoordinate).getPiece();\n\t\t\t\t\t//If the pieces are not on the same team an Attack move is added to legal moves.\n\t\t\t\t\tif(this.getPieceTeam() != pieceOnCandidate.getPieceTeam())\n\t\t\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate)));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t} else if(board.getEnPassantPawn() != null){\n\t\t\t\t\tif(board.getEnPassantPawn().getPiecePosition() == (this.piecePosition - (this.pieceTeam.getOppositeDirection()))){\n\t\t\t\t\t\tfinal Piece pieceOnCandidate = board.getEnPassantPawn();\n\t\t\t\t\t\tif(this.pieceTeam != pieceOnCandidate.getPieceTeam()){\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnEnPassantAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\treturn ImmutableList.copyOf(legalMoves);\n\t}",
"@Override\n public void placeShips(Fleet fleet, Board board) {\n foundPosition = new boolean[sizeX][sizeY];\n for (int i = fleet.getNumberOfShips() - 1; i >= 0; i--) {\n Ship s = fleet.getShip(i);\n boolean vertical = rnd.nextBoolean();\n Position pos;\n if (vertical) {\n int x = rnd.nextInt(sizeX);\n int y = rnd.nextInt(sizeY - (s.size()));\n\n while (true) {\n boolean check = false;\n for (int j = 0; j < s.size(); j++) {\n if (foundPosition[x][y + j]) {\n check = true;\n x = rnd.nextInt(sizeX);\n y = rnd.nextInt(sizeY - (s.size()));\n break;\n }\n }\n if (check == false) {\n break;\n }\n /* int counter = 0;\n if (counter > 1) {\n y = rnd.nextInt(sizeY - (s.size()));\n }\n boolean check = false;\n for (int j = 0; j < s.size(); j++) {\n if (foundPosition[x][y + j]) {\n check = true;\n x++;\n if (x >= sizeX) {\n x = 0;\n }\n }\n }\n if (check == false) {\n break;\n }\n counter++;\n }*/\n }\n for (int j = 0; j < s.size(); j++) {\n foundPosition[x][y + j] = true;\n }\n pos = new Position(x, y);\n } else {\n int x = rnd.nextInt(sizeX - (s.size()));\n int y = rnd.nextInt(sizeY);\n while (true) {\n boolean check = false;\n for (int j = 0; j < s.size(); j++) {\n if (foundPosition[x + j][y]) {\n check = true;\n x = rnd.nextInt(sizeX - (s.size()));\n y = rnd.nextInt(sizeY);\n }\n }\n if (check == false) {\n break;\n }\n /*int counter = 0;\n if (counter > 1) {\n x = rnd.nextInt(sizeX - (s.size() - 1));\n }\n boolean check = false;\n for (int j = 0; j < s.size(); j++) {\n if (foundPosition[x + j][y]) {\n check = true;\n y++;\n if (y >= sizeX) {\n y = 0;\n }\n }\n }\n if (check == false) {\n break;\n }\n counter++;\n }*/\n }\n for (int j = 0; j < s.size(); j++) {\n foundPosition[x + j][y] = true;\n }\n pos = new Position(x, y);\n }\n board.placeShip(pos, s, vertical);\n }\n }",
"public void checkCollision(){\r\n\r\n\t\t\t\tsmile.updateVelocity();\r\n\r\n\t\t\t\tsmile.updatePosition();\r\n\r\n\t\t\t\tif (smile.updateVelocity() > 0){\r\n\r\n\t\t\t\t\tfor (int k = 0; k < arrayPlat.size(); k++){\r\n\r\n\t\t\t\t\t\tif (smile.getNode().intersects(arrayPlat.get(k).getX(), arrayPlat.get(k).getY(), Constants.PLATFORM_WIDTH, Constants.PLATFORM_HEIGHT)){\r\n\r\n\t\t\t\t\t\t\tsmile.setVelocity(Constants.REBOUND_VELOCITY);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t}",
"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 }",
"boolean isValid(int xPos, int yPos, int destX, int destY) {\r\n\t\tboolean valid = false;\r\n\t\t\r\n\t\t//Moves White\r\n\t\tif(this.color == \"Weiß\"){\r\n\t\t//Moving 2 Tiles\r\n\t\tif (firstMove == true && destY - yPos == -2 && destX == xPos) {\r\n\t\t\tvalid = true;\r\n\t\t\tthis.firstMove = false;\r\n\t\t}\r\n\t\t//Moving 1 Tile\r\n\t\tif (destX == xPos && destY - yPos == -1) {\r\n\t\t\tvalid = true;\r\n\t\t\tthis.firstMove = false;\r\n\t\t}\r\n\t\t//Moving Diagonal if enemy is there\r\n\t\tif ((destX == xPos + 1 || destX == xPos-1) && destY == yPos -1){\r\n\t\t\tvalid = isValidLoop(destX, destY, valid);\r\n\t\t}\r\n\t\treturn valid;\r\n\t\t} \r\n\t\t\r\n\t\t//Moves Black\r\n\t\telse {\r\n\t\t//Moving 2 Tiles\r\n\t\tif (firstMove == true && destY - yPos == 2 && destX == xPos) {\r\n\t\t\tvalid = true;\r\n\t\t\tthis.firstMove = false;\r\n\t\t}\r\n\t\t//Moving 1 Tile\r\n\t\tif (destX == xPos && destY - yPos == 1) {\r\n\t\t\tvalid = true;\r\n\t\t\tthis.firstMove = false;\r\n\t\t}\r\n\t\t//Moving Diagonal\r\n\t\tif ((destX == xPos + 1 || destX == xPos-1) && destY == yPos +1){\r\n\t\t\tvalid = isValidLoop(destX, destY,valid);\r\n\t\t}\r\n\t\t}\r\n\t\treturn valid;\r\n\t}",
"protected boolean tileCollision(double xa, double ya) { // returns true if there is a collision\n\t\tboolean solid = false;\n\n\t\tfor (int c = 0; c < 4; c++) { // this checks all 4 corners for collision\n\t\t\tdouble xt = ((x - 6 + xa) - c % 2 * 4) / 16; // i honestly don't know hoW this works. It just does. Episode 65.\n\t\t\tdouble yt = ((y - 4 + ya) - c / 2 * 7) / 16;\n\n\t\t\tint ix = (int) Math.ceil(xt); // returns the smallest integer greater than or equal to a number\n\t\t\tint iy = (int) Math.ceil(yt);\n\n\t\t\tif (level.getTile(ix, iy).solid()) solid = true; // this is the important statement for collision detection. It works by looking at the tile you want to go to and seeing if it is solid.\n\t\t}\n\n\t\treturn solid;\n\t}",
"private boolean collisonCheck(List<Tile> nextTiles, Snake enemy) {\n\t\t// check himself\n\t\tfor (Tile tile : (List<Tile>)snakeTiles) {\n\t\t\tfor (Tile t : nextTiles) {\n\t\t\t\tif (tile.equals(t)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// check enemy\n\t\tfor (Tile tile : enemy.getSnakeTiles()) {\n\t\t\tfor (Tile t : nextTiles) {\n\t\t\t\tif (tile.equals(t)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"@Override\r\n public boolean canMove() {\r\n Grid<Actor> gr = getGrid();\r\n int dirs[] = {\r\n Location.AHEAD, Location.HALF_CIRCLE, Location.LEFT,\r\n Location.RIGHT };\r\n // 当终点在周围时,不能移动且isEnd应当为true\r\n for (int i = 0; i < dirs.length; i++) {\r\n Location tarLoc = getLocation().getAdjacentLocation(dirs[i]);\r\n if (gr.isValid(tarLoc) && gr.get(tarLoc) != null) {\r\n // Color直接用==计算竟然不可行(真是哔了dog...\r\n if (gr.get(tarLoc) instanceof Rock\r\n && gr.get(tarLoc).getColor().equals(Color.RED)) {\r\n isEnd = true;\r\n return false;\r\n }\r\n }\r\n }\r\n ArrayList<Location> nextLocs = getValid(getLocation());\r\n // 当附近没有可以移动的位置时,不能移动\r\n if (nextLocs.size() == 0) {\r\n return false;\r\n }\r\n // 当可以移动的位置>1时,说明存在一个节点,这个节点应当被新建一个arraylist入栈\r\n if (nextLocs.size() > 1) {\r\n ArrayList<Location> newStackElem = new ArrayList<Location>();\r\n newStackElem.add(getLocation());\r\n crossLocation.push(newStackElem);\r\n }\r\n // 有可以移动的位置时,向概率最高的方向移动\r\n int maxProbLoc = 0;\r\n // 由于nextLocs不一定有4个location,所以只好循环判断取最大值\r\n for (int i = 0; i < nextLocs.size(); i++) {\r\n Location loc = nextLocs.get(i);\r\n int dirNum = getLocation().getDirectionToward(loc) / 90;\r\n if (probablyDir[dirNum] > probablyDir[maxProbLoc]) {\r\n maxProbLoc = i;\r\n }\r\n }\r\n next = nextLocs.get(maxProbLoc);\r\n return true;\r\n }",
"private void processMove() {\n\t\tCoord chipEndPos = new Coord(0, 0);\n\t\tArrayList<Coord> targets = new ArrayList<Coord>();\n\n\t\tif (legalMove()) {\n\t\t\tif (player.isValid(tilePath, userChip, targets)) {\n\n\t\t\t\tchipEndPos = mBoard\n\t\t\t\t\t\t.getTileCenter(tilePath.get(tilePath.size() - 1));\n\n\t\t\t\tif (player.isRobot()) {\n\t\t\t\t\tuserChip.setNextCoord(chipEndPos);\n\t\t\t\t} else\n\t\t\t\t\tuserChip.setCoords(chipEndPos);\n\n\t\t\t\t// update tiles\n\t\t\t\tmBoard.setTileHasNothing(tilePath.get(0));\n\t\t\t\tmBoard.setTileChipIndex(tilePath.get(0), 0);\n\n\t\t\t\tif (userChip.isRed()) {\n\t\t\t\t\tmBoard.setTileHasRed(tilePath.get(tilePath.size() - 1));\n\t\t\t\t\tmBoard.setTileChipIndex(tilePath.get(tilePath.size() - 1),\n\t\t\t\t\t\t\tuserChip.getId());\n\t\t\t\t} else {\n\t\t\t\t\tmBoard.setTileHasYellow(tilePath.get(tilePath.size() - 1));\n\t\t\t\t\tmBoard.setTileChipIndex(tilePath.get(tilePath.size() - 1),\n\t\t\t\t\t\t\tuserChip.getId());\n\t\t\t\t}\n\n\t\t\t\tif (player.isBonus(tilePath, userChip) && targets.size() > 0) {\n\t\t\t\t\tendTurn = false;\n\t\t\t\t\ttake(targets);\n\t\t\t\t\tif (player.score >= 13)\n\t\t\t\t\t\tgameWon();\n\t\t\t\t} else\n\t\t\t\t\tendTurn = true;\n\n\t\t\t} else {\n\t\t\t\tchipEndPos = mBoard.getTileCenter(tilePath.get(0));\n\t\t\t\tuserChip.setCoords(chipEndPos);\n\t\t\t}\n\t\t} else {\n\t\t\tif (tilePath.size() > 0) {\n\t\t\t\tdebug(\"something's null... chipEndPos = \" + chipEndPos.getX()\n\t\t\t\t\t\t+ \", \" + chipEndPos.getY());\n\t\t\t\tdebug(\"tilePath.get(0) is \" + tilePath.get(0).getX() + \", \"\n\t\t\t\t\t\t+ tilePath.get(0).getY());\n\t\t\t\tdebug(\"userchip is \" + userChip.getCenterX() + \", \"\n\t\t\t\t\t\t+ userChip.getCenterY());\n\n\t\t\t\tchipEndPos = mBoard.getTileCenter(tilePath.get(0));\n\t\t\t\tuserChip.setCoords(chipEndPos);\n\t\t\t}\n\n\t\t}\n\n\t\t// after move stuff\n\t\tfor (int j = 0; j < tilePath.size(); ++j) {\n\t\t\tdebug(\"tilePath \" + j + \" is \" + tilePath.get(j).x + \", \"\n\t\t\t\t\t+ tilePath.get(j).y);\n\t\t}\n\t\tdebug(\"Score is now: \" + player.getScore());\n\t\tdisplayBoardStatus();\n\t\ttilePath.clear();\n\t\tuserChip = null;\n\n\t\tif (endTurn) {\n\t\t\tdebug(\"Reached end of Turn!\");\n\t\t\ttake(targets);\n\t\t\tif (player.score >= 13)\n\t\t\t\tgameWon();\n\t\t\telse {\n\t\t\t\tif (player.isHet) {\n\t\t\t\t\tplayer = homPlay;\n\n\t\t\t\t} else {\n\t\t\t\t\tplayer = hetPlay;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tendTurn = false;\n\t\t}\n\n\t\t// end of giant pain in the ass function \"processMove\"\n\t}",
"public boolean moveBoardTile(int x, int y, Tile t) {\n \tMeld m = findMeld(t);\n \tif (m != null) {\n \t\tif (m.getTiles().size() == 1) {\n \t\t\t// Meld has only this single tile, can move it freely.\n \t\t\tif (addBoardTile(t, x, y)) {\n \t\t\t\tmelds.remove(m);\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\treturn false;\n \t\t}\n \t\t\n \t\telse if (m.getTiles().indexOf(t) == 0) {\n \t\t\t// Tile is moved from the start of existing meld which means it\n \t\t\t// Will not mess up how it looks on the board\n \t\t\tif (addBoardTile(t, x, y)) {\n \t\t\t\tm.removeFromMeld(t);\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\treturn false;\n \t\t}\n \t\t\n \t\telse if (m.getTiles().indexOf(t) == m.getSize() - 1){\n \t\t\t// Tile is moved from the end of existing meld which means it\n \t\t\t// Will not mess up how it looks on the board\n \t\t\tif (addBoardTile(t, x, y)) {\n \t\t\t\tm.removeFromMeld(t);\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\treturn false;\n \t\t}\n \t\telse {\n \t\t\t// Tile is moved from the middle of a meld,\n \t\t\t// Need to split the meld into two new melds by where\n \t\t\t// the tile was moved from\n \t\t\tif (addBoardTile(t, x, y)) {\n \t\t\tint i;\n \t\t\tint splitIndex = m.getTiles().indexOf(t);\n \t\t\t\n \t\t\tMeld leftMeld = new Meld(m.getTiles().get(0));\n \t\t\tfor (i = 1; i < splitIndex; i++) {\n \t\t\t\tleftMeld.add((m.getTiles().get(i)));\n \t\t\t}\n \t\t\t\n \t\t\tMeld rightMeld = new Meld(m.getTiles().get(splitIndex + 1));\n \t\t\tfor (i = splitIndex + 1; i < m.getSize(); i++) {\n \t\t\t\trightMeld.add((m.getTiles().get(i)));\n \t\t\t}\n \t\t\t\n \t\t\tmelds.remove(m);\n \t\t\tmelds.add(leftMeld);\n \t\t\tmelds.add(rightMeld);\n \t\t\treturn true;\n \t\t\t} \t\t\t\n \t\t}\n \t}\n\t\treturn false;\n }",
"public void movimentar_dragao(int pos) {\n\t\tint check = 0;\n\t\tint counter = 0; //After 1000 tries it means that the dragon is trapped and cant move either way\n\t\twhile (check == 0 && counter < 1000) {\n\t\t\tint random = 1 + (int)(Math.random()*4);\n\t\t\tif (random == 1) {\n\t\t\t\tif (labirinto.getLab()[dragoes[pos].getX_coord()+1][dragoes[pos].getY_coord()] != 'X' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()+1][dragoes[pos].getY_coord()] != 'S' &&\n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()+1][dragoes[pos].getY_coord()] != 'D' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()+1][dragoes[pos].getY_coord()] != 'd' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()+1][dragoes[pos].getY_coord()] != 'O') {\n\t\t\t\t\tif (labirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()] == 'F')\n\t\t\t\t\t\tlabirinto.setLabCell(dragoes[pos].getX_coord(), dragoes[pos].getY_coord(), 'E');\n\t\t\t\t\telse\n\t\t\t\t\t\tlabirinto.setLabCell(dragoes[pos].getX_coord(), dragoes[pos].getY_coord(), ' ');\n\t\t\t\t\tdragoes[pos].setX_coord(dragoes[pos].getX_coord()+1);\n\t\t\t\t\tcheck = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (random == 2) {\n\t\t\t\tif (labirinto.getLab()[dragoes[pos].getX_coord()-1][dragoes[pos].getY_coord()] != 'X' &&\n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()-1][dragoes[pos].getY_coord()] != 'S' &&\n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()-1][dragoes[pos].getY_coord()] != 'D' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()-1][dragoes[pos].getY_coord()] != 'd' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()-1][dragoes[pos].getY_coord()] != 'O') {\n\t\t\t\t\tif (labirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()] == 'F')\n\t\t\t\t\t\tlabirinto.setLabCell(dragoes[pos].getX_coord(), dragoes[pos].getY_coord(), 'E');\n\t\t\t\t\telse\n\t\t\t\t\t\tlabirinto.setLabCell(dragoes[pos].getX_coord(), dragoes[pos].getY_coord(), ' ');\n\t\t\t\t\tdragoes[pos].setX_coord(dragoes[pos].getX_coord()-1);\n\t\t\t\t\tcheck = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (random == 3) {\n\t\t\t\tif (labirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()-1] != 'X' &&\n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()-1] != 'S' &&\n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()-1] != 'D' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()-1] != 'd' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()-1] != 'O') {\n\t\t\t\t\tif (labirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()] == 'F')\n\t\t\t\t\t\tlabirinto.setLabCell(dragoes[pos].getX_coord(), dragoes[pos].getY_coord(), 'E');\n\t\t\t\t\telse\n\t\t\t\t\t\tlabirinto.setLabCell(dragoes[pos].getX_coord(), dragoes[pos].getY_coord(), ' ');\n\t\t\t\t\tdragoes[pos].setY_coord(dragoes[pos].getY_coord()-1);\n\t\t\t\t\tcheck = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (labirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()+1] != 'X' &&\n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()+1] != 'S' &&\n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()+1] != 'D' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()+1] != 'd' && \n\t\t\t\t\t\tlabirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()+1] != 'O') {\n\t\t\t\t\tif (labirinto.getLab()[dragoes[pos].getX_coord()][dragoes[pos].getY_coord()] == 'F')\n\t\t\t\t\t\tlabirinto.setLabCell(dragoes[pos].getX_coord(), dragoes[pos].getY_coord(), 'E');\n\t\t\t\t\telse\n\t\t\t\t\t\tlabirinto.setLabCell(dragoes[pos].getX_coord(), dragoes[pos].getY_coord(), ' ');\n\t\t\t\t\tdragoes[pos].setY_coord(dragoes[pos].getY_coord()+1);\n\t\t\t\t\tcheck = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcounter++;\n\t\t}\n\t}",
"void check_missile_collisions() {\n for (int i = ship.missiles.size()-1; i >= 0; i --) {\n Missile missile = ship.missiles.get(i);\n for (int j = aliens.size()-1; j >= 0; j --) {\n Alien alien = aliens.get(j);\n boolean hit = alien.checkMissileCollisions(missile);\n if (hit) {\n alien_destroyed_audio.play();\n\n // Move the missile off-screen to be deleted by delete_missiles()\n missile.moveOffScreen();\n\n // Update the score, speed up remaining aliens, remove the alien\n update_score(alien.points);\n Alien.speed_up();\n alien_audio_intervals = (long) (500000000 - (100000000 * Alien.alien_speed));\n ImageView alien_image_view = alien_image_views.get(j);\n game_pane.getChildren().remove(alien_image_view);\n alien_image_views.remove(j);\n aliens.remove(alien);\n break;\n }\n }\n }\n\n // Check if any alien missiles hit the ship\n for (int i = Alien.missiles.size()-1; i >= 0; i --) {\n Missile missile = Alien.missiles.get(i);\n // Only check missiles that have reached the y-coordinate of the player\n if (missile.y_position+missile.missile_height >= ship.y_position) {\n boolean hit = ship.checkMissileCollisions(missile);\n if (hit) {\n ship_destroyed_clip.play();\n\n // Player loses a life\n lives -= 1;\n lives_text.setText(\"Lives: \" + lives);\n\n // Ship and missiles not respawn/removed for last life so that player can see how they died\n if (lives > 0){\n // Move the missile off-screen, deleted by delete_missiles()\n missile.moveOffScreen();\n ship_respawn();\n }\n break;\n }\n }\n }\n }",
"public abstract boolean validMove(ChessBoard board, Square from, Square to);",
"public static int misplacedTiles(Node A, Node B){\r\n int toReturn = 0;\r\n for (int i = 0; i<puzzleSize; i++){\r\n for (int j = 0; j<puzzleSize; j++){\r\n if (A.state[i][j]!=B.state[i][j])\r\n toReturn++;\r\n }\r\n }\r\n return toReturn;\r\n }",
"private void enemyMove() {\n\n\t\tboolean goAgain = false;\n\n\t\tint x = (int) (Math.random() * 10);\n\t\tint y = (int) (Math.random() * 10);\n\n\t\t// Make sure the enemy hits in a checkerboard pattern.\n\t\tif (x % 2 == 0) { // if x is even, y should be odd\n\t\t\tif (y % 2 == 0) {\n\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\ty++;\n\t\t\t\telse\n\t\t\t\t\ty--;\n\t\t\t}\n\t\t} else { // if x is odd, y should be even\n\t\t\tif (y % 2 == 1)\n\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\ty++;\n\t\t\t\telse\n\t\t\t\t\ty--;\n\t\t}\n\n\t\tif (enemyLastShotHit && getDifficulty() > 0) { // /if last shot was a\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// hit, enemy\n\t\t\t// will try to\n\t\t\t// check around it only run if difficulty is\n\t\t\t// normal or above\n\t\t\tx = enemyLastHitX;\n\t\t\ty = enemyLastHitY;\n\n\t\t\tif (getDifficulty() != 2) {\n\n\t\t\t\tif (conflictX == 4) {\n\t\t\t\t\tconflictX = 0;\n\t\t\t\t} else if (conflictY == 4) {\n\t\t\t\t\tconflictY = 0;\n\t\t\t\t\t// System.out.println(\"conflict has been reset \");\n\t\t\t\t}\n\n\t\t\t\tif (conflictX != 0) {\n\t\t\t\t\tif (conflictX == 1)\n\t\t\t\t\t\tx++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\tconflictX = 4;\n\t\t\t\t} else if (conflictY == 1) {\n\t\t\t\t\t// System.out.println(\"checking down\");\n\t\t\t\t\tconflictY = 4;\n\t\t\t\t\ty++;\n\t\t\t\t}\n\n\t\t\t\tif (x + 1 < 10 && x - 1 >= 0) {// branch for multiple hits\n\t\t\t\t\tif (egrid[x + 1][y] == 1 && egrid[x - 1][y] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tif (x + 2 < 10) {\n\t\t\t\t\t\t\tif (egrid[x + 2][y] == 1) {\n\t\t\t\t\t\t\t\tconflictX = 1;\n\t\t\t\t\t\t\t\tx--;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (y + 1 < 10 && y - 1 >= 0) {// branch for multiple vertical\n\t\t\t\t\t\t\t\t\t\t\t\t// hits\n\t\t\t\t\tif (egrid[x][y + 1] == 1 && egrid[x][y - 1] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tconflictY = 1;\n\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (conflictX == 0 && conflictY == 0) {\n\n\t\t\t\t\tif (checkDirection == 0) // checks in each direction\n\t\t\t\t\t\tx++;\n\t\t\t\t\telse if (checkDirection == 1)\n\t\t\t\t\t\tx--;\n\t\t\t\t\telse if (checkDirection == 2)\n\t\t\t\t\t\ty++;\n\t\t\t\t\telse if (checkDirection == 3) {\n\t\t\t\t\t\ty--;\n\t\t\t\t\t\tenemyLastShotHit = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (x < 0) // making sure coordinates stay within bounds\n\t\t\t\t\t\tx = 0;\n\t\t\t\t\telse if (x > 9)\n\t\t\t\t\t\tx = 9;\n\t\t\t\t\tif (y < 0)\n\t\t\t\t\t\ty = 0;\n\t\t\t\t\telse if (y > 9)\n\t\t\t\t\t\ty = 9;\n\t\t\t\t}\n\t\t\t} // medium diff\n\n\t\t\telse if (getDifficulty() == 2) {// hard difficulty\n\t\t\t\t// gives enemy unfair advantage\n\n\t\t\t\tif (conflictX == 4)\n\t\t\t\t\tconflictX = 0;\n\t\t\t\tif (conflictY == 4)\n\t\t\t\t\tconflictY = 0;\n\n\t\t\t\tif (conflictX != 0) {\n\t\t\t\t\tif (conflictX == 1)\n\t\t\t\t\t\tx++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\tconflictX = 4;\n\t\t\t\t} else if (conflictY == 1) {\n\t\t\t\t\tconflictY = 4;\n\t\t\t\t\ty++;\n\t\t\t\t}\n\n\t\t\t\tif (x + 1 < 10 && x - 1 >= 0) {// branch for multiple hits\n\t\t\t\t\tif (egrid[x + 1][y] == 1 && egrid[x - 1][y] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tif (x + 2 < 10) {\n\t\t\t\t\t\t\tif (egrid[x + 2][y] == 1) {\n\t\t\t\t\t\t\t\tconflictX = 1;\n\t\t\t\t\t\t\t\tx--;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (y + 1 < 10 && y - 1 >= 0) {// branch for multiple vertical\n\t\t\t\t\t\t\t\t\t\t\t\t// hits\n\t\t\t\t\tif (egrid[x][y + 1] == 1 && egrid[x][y - 1] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tconflictY = 1;\n\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (conflictX == 0 && conflictY == 0) {\n\t\t\t\t\tif (y + 1 < 10) {\n\t\t\t\t\t\tif (egrid[x][y + 1] == 1)// if y+1 is a hit and it is\n\t\t\t\t\t\t\t\t\t\t\t\t\t// within bounds, it will go\n\t\t\t\t\t\t\t\t\t\t\t\t\t// there\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (y - 1 >= 0) {\n\t\t\t\t\t\tif (egrid[x][y - 1] == 1)\n\t\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t\tif (x + 1 < 10) {\n\t\t\t\t\t\tif (egrid[x + 1][y] == 1)\n\t\t\t\t\t\t\tx++;\n\t\t\t\t\t}\n\t\t\t\t\tif (x - 1 >= 0) {\n\t\t\t\t\t\tif (egrid[x - 1][y] == 1) {\n\t\t\t\t\t\t\tx--;\n\t\t\t\t\t\t\tenemyLastShotHit = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} // hard diff\n\t\t\tcheckDirection++;\n\t\t} // lasthit\n\n\t\tint tryCount = 0;\n\t\twhile (egrid[x][y] == 3) { // makes sure enemy doesn't hit same spot\n\t\t\t\t\t\t\t\t\t// twice\n\t\t\tx = (int) (Math.random() * 10);\n\t\t\ty = (int) (Math.random() * 10);\n\t\t\tif (tryCount < 20 && getDifficulty() > 0) {\n\t\t\t\tif (x % 2 == 0) { // if x is even, y should be odd\n\t\t\t\t\tif (y % 2 == 0) { // for checkerboard pattern\n\t\t\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t} else { // if x is odd, y should be even\n\t\t\t\t\tif (y % 2 == 1)\n\t\t\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ty--;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttryCount++;\n\t\t}\n\n\t\tif (egrid[x][y] == 1) { // hit branch\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tilehit.jpg\"));\n\t\t\tstatus.setText(\" Enemy got a hit\");\n\t\t\tenemyLastShotHit = true; // starts ai\n\t\t\tcheckDirection = 0;\n\t\t\tif (conflictX == 0 && conflictY == 0) {\n\t\t\t\tenemyLastHitX = x; // stores x and y values\n\t\t\t\tenemyLastHitY = y;\n\t\t\t}\n\t\t\tehits--; // keeps score\n\t\t}\n\n\t\telse if (egrid[x][y] == 2) { // poweup branch\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tilepower.jpg\"));\n\t\t\tstatus.setText(\" Enemy got a PowerUp\");\n\t\t\tgoAgain = true;\n\t\t}\n\n\t\telse\n\t\t\t// miss branch\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tilemiss.jpg\"));\n\n\t\tegrid[x][y] = 3;\n\n\t\tcheckEnemyWin();\n\n\t\tif (goAgain)\n\t\t\tenemyMove();\n\n\t}",
"private void positionMinimap(){\n\t\tif(debutX<0)//si mon debutX est negatif(ca veut dire que je suis sorti de mon terrain (ter))\n\t\t\tdebutX=0;\n\t\tif(debutX>ter.length)//si debutX est plus grand que la taille de mon terrain(ter).\n\t\t\tdebutX=ter.length-100;\n\t\tif(debutY<0)\n\t\t\tdebutY=0;\n\t\tif(debutY>ter.length)\n\t\t\tdebutY=ter.length-100;\n\t\tif(debutX+100>ter.length)\n\t\t\tdebutX=ter.length-100;\n\t\tif(debutY+100>ter.length)\n\t\t\tdebutY=ter.length-100;\n\t\t//cette fonction est appelee uniquement si le terrain est strictement Superieur a 100\n\t\t// Donc je sais que ma fin se situe 100 cases apres.\n\t\tfinX=debutX+100;\n\t\tfinY=debutY+100;\n\t}",
"@Override\n public boolean detect() {\n \t slowDown();\n final MoveResult move = CurrentData.CALCULATED.tetromino.move;\n\t\t\t\t\t\tif (move.hasMove()) {\n final Tetromino moveTetromino = move.tetromino;\n final int y = QQRobot.findTetromino(moveTetromino, 3 + missingTetromino * 2);\n if (y == -1) {\n missingTetromino++;\n if (missingTetromino == 3) {\n // System.out.println(\"没找到块\" + nr + \"!\" + CurrentData.CALCULATED.tetromino.move + \", \"\n // + CurrentData.CALCULATED.tetromino + \", \"\n // + CurrentData.CALCULATED.tetromino.move.tetromino);\n // QQDebug.save(QQRobot.getScreen(), \"qqtetris_\" + nr);\n // nr++;\n throw new NoTetrominoFoundException(\"没找到块!\");\n // CurrentData.CALCULATED.tetromino.move.doMove();\n }\n } else {\n \t final int fallen = y - moveTetromino.y;\n if (fallen > 0) {\n // System.out.println(\"掉落:\" + fallen);\n moveTetromino.y = y;\n } \t \n \t if (move.clever) {\n \t \t if (firstScan) {\n \t \t firstScan = false;\n \t \t } else if (fallen > 0) {\n\t\t\t move.doMove(); \t \t \t \n \t \t }\n \t } else {\n\t\t move.doMove();\n \t }\n }\n }\n if (move.hasMove()) {\n return false;\n } else {\n // QQDebug.printBoard(CurrentData.CALCULATED.board);\n return true;\n }\n }",
"void collisionHappened(int position);",
"public boolean moveTile(int row, int col) {\n //first make sure the parameters are reasonable values\n if (row < 0 || row > 2 || col < 0 || col > 2) {\n return false;\n }\n int tile = getTiles()[row][col];\n if (tile == 0) {\n return false;\n }\n boolean inBounds;\n //check from one row to the left, to one row to the right\n for (int i = row - 1; i <= row + 1; i++) {\n //check from one column above, to one column below\n for (int j = col - 1; j <= col + 1; j++) {\n //use this to make sure our indices are reasonable\n inBounds = ((i >= 0 && i < 3) && (j >= 0 && j < 3));\n if (inBounds) {\n int otherTile = getTiles()[i][j];\n //can't move a cell to itself\n if (otherTile != tile) {\n //we want to ignore diagonals\n if (!(i != row && j != col)) {\n //if otherTile is blank, swap tile and otherTile\n if (otherTile == 0) {\n setTile(i, j, tile);\n setTile(row, col, otherTile);\n return true;\n }\n }\n }\n }\n }\n }\n //if we didn't return true yet, there was no adjacent blank tile\n return false;\n }",
"@Override\n\tpublic boolean validMove(int xEnd, int yEnd, board b){\n\t\t//try to land one same color piece\n\t\tif(b.occupied(xEnd, yEnd)&&b.getPiece(xEnd, yEnd).getColor()==color){\n\t\t\treturn false;\n\t\t}\n\t\tif(v==0){\n\t\t\tif(!this.guard(xEnd, yEnd, b)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//normal move\n\t\tif((xEnd==x-1&&yEnd==y-1)||(xEnd==x-1&&yEnd==y)||(xEnd==x-1&&yEnd==y+1)||(xEnd==x&&yEnd==y-1)||(xEnd==x&&yEnd==y+1)||(xEnd==x+1&&yEnd==y-1)||(xEnd==x+1&&yEnd==y)||(xEnd==x+1&&yEnd==y+1)){\n\t\t\tif(b.occupied(xEnd, yEnd)){\n\t\t\t\t//set the enpass flage back\n\t\t\t\tb.setFlag(color, 100, 100);\n\t\t\t\tb.recycle(xEnd, yEnd);\n\t\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\t\tb.update();\n\t\t\t\tc=0;\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\t//set the enpass flage back\n\t\t\t\tb.setFlag(color, 100, 100);\n\t\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\t\tb.update();\n\t\t\t\tc=0;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}else if((xEnd==x-2&&yEnd==y)){ //castling\n\t\t\tpiece r = b.getPiece(0, y);\n\t\t\tif(r==null){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(r.getC()==0||r.getColor()!=color||r.getType()!= type.ROOK||c==0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor(int i=3;i>0;i--){\n\t\t\t\tif(b.occupied(i, y)){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\tr.setPosition(3,y);\n\t\t\tc=0;\n\t\t\tr.setC(0);\n\t\t\tb.setFlag(color, 100, 100);\n\t\t\tb.update();\n\t\t\treturn true;\n\t\t}else if((xEnd==x+2&&yEnd==y)){\n\t\t\tpiece r = b.getPiece(7, y);\n\t\t\tif(r==null){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(r.getC()==0||r.getColor()!=color||r.getType()!= type.ROOK||c==0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor(int i=5;i<=6;i++){\n\t\t\t\tif(b.occupied(i, y)){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\tr.setPosition(5,y);\n\t\t\tc=0;\n\t\t\tr.setC(0);\n\t\t\tb.setFlag(color, 100, 100);\n\t\t\tb.update();\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"@Override\r\n\tpublic void move() {\n\t\tPoint target = strategy.search(this.getLocation(), new Point(0,0));\r\n\r\n\t\tint tries = 0;\r\n\t\t\r\n\t\twhile(!state.equals(\"Inactive\") && !game.movement(this, target.x, target.y)){\r\n\t\t\ttarget = strategy.search(new Point(x,y),playerLocation);\r\n\t\t\ttries++;\r\n\t\t\tif(tries > 4) return; // the search strategy has 4 tries to pick a valid location to move to\r\n\t\t}\r\n\t\t\r\n\t\tx = target.x;\r\n\t\ty = target.y;\r\n\r\n\t\tmoveSprite();\r\n\t}"
] | [
"0.74868447",
"0.7196627",
"0.70343924",
"0.69621503",
"0.68559337",
"0.6740747",
"0.6713642",
"0.65628916",
"0.6435978",
"0.6421123",
"0.64204246",
"0.63954544",
"0.6367805",
"0.63447106",
"0.6316809",
"0.63160765",
"0.63043237",
"0.6278796",
"0.6278173",
"0.6277777",
"0.62614524",
"0.62585884",
"0.6236863",
"0.62198395",
"0.62130666",
"0.619476",
"0.6188941",
"0.61887246",
"0.6186022",
"0.6185506",
"0.61822206",
"0.6176307",
"0.6164019",
"0.6162344",
"0.6153497",
"0.6135475",
"0.6126761",
"0.612619",
"0.611682",
"0.6105981",
"0.61007816",
"0.6095558",
"0.6089802",
"0.6085902",
"0.608532",
"0.60812455",
"0.6060747",
"0.6055153",
"0.6051446",
"0.60469365",
"0.6045989",
"0.6039625",
"0.60104144",
"0.6005457",
"0.5980183",
"0.5977392",
"0.5966512",
"0.59645593",
"0.59576327",
"0.59477544",
"0.59464985",
"0.5938637",
"0.59368724",
"0.59297884",
"0.59219664",
"0.59212494",
"0.59154606",
"0.5911488",
"0.5903693",
"0.5899373",
"0.5893821",
"0.5893622",
"0.58910584",
"0.587863",
"0.5865598",
"0.58634436",
"0.5860082",
"0.5858053",
"0.5857857",
"0.58577394",
"0.585335",
"0.5851962",
"0.5850797",
"0.58462137",
"0.5838103",
"0.5837068",
"0.5830318",
"0.5826518",
"0.58252436",
"0.58183813",
"0.5814531",
"0.5813715",
"0.5800052",
"0.57990223",
"0.57961303",
"0.57945234",
"0.5791773",
"0.578987",
"0.5785871",
"0.5783397"
] | 0.69247955 | 4 |
Package private so we can override the transport for testing. | HttpTransport createTransport() throws GeneralSecurityException, IOException {
return GoogleNetHttpTransport.newTrustedTransport();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface Transport {\r\n /**\r\n * Prepares connection to server and returns connection output stream.\r\n * \r\n * @param info\r\n * connection information object containing target URL, content encoding, etc.\r\n * @return connection output stream\r\n * @throws TransportException\r\n */\r\n OutputStream prepare(ConnectionInfo info) throws TransportException;\r\n \r\n \r\n // this method used for wsg request -- by felix\r\n /**\r\n * Prepares connection to server and returns connection output stream.\r\n * \r\n * @param info\r\n * connection information object containing target URL, content encoding, etc.\r\n * @return connection output stream\r\n * @throws TransportException\r\n */\r\n void prepare(ConnectionInfo info,byte[] reqXml) throws TransportException;\r\n\tpublic InputStream configPrepare(ConnectionInfo info) throws TransportException;\r\n public InputStream prepareAndConnect(ConnectionInfo info) throws TransportException ;\r\n public void prepareWsgPost(ConnectionInfo info,byte[] reqXml) throws TransportException ;\r\n \r\n\r\n /**\r\n * Sends request to server and receives a response.\r\n * <em>{@link #prepare(ConnectionInfo)} should be called prior to performing an exchange.</em>\r\n * \r\n * @return input stream containing server response\r\n * \r\n * @throws TransportException\r\n */\r\n InputStream exchange() throws TransportException;\r\n\r\n /**\r\n * Closes any pending connections and frees transport resources.\r\n */\r\n void close();\r\n}",
"@Override\n public TTransportWrapper getTransport(HostAndPort endpoint) throws Exception {\n return new TTransportWrapper(connectToServer(new InetSocketAddress(endpoint.getHostText(),\n endpoint.getPort())),\n endpoint);\n }",
"public Transport getTransport() {\n return transport;\n }",
"public void setTransport(Transport transport) {\n this.transport = transport;\n }",
"@Override\n public void setUp() throws Exception {\n transport = new TFramedTransport(new TSocket(\"123.56.206.195\", 1982));\n\n\n\n TProtocol protocol = new TBinaryProtocol(transport);\n client = new SubjectServ.Client(protocol);\n transport.open();\n }",
"public interface TransportSender {\n\n /**\n * Send messages using the underlying transport protocol.\n *\n * @param message The message to send\n */\n void send(String message);\n\n /**\n * Send messages to a particular uri using the underlying transport protocol.\n * Might not be implemented in case the underlying transport doesn't support it.\n *\n * @param message The message to send\n * @param uri The uri to send messages to\n */\n void send(String message, String uri);\n\n /**\n * Shutdowns the transport sender, which means typically to release resources, like sockets.\n */\n void shutdown();\n}",
"protected NetworkEmulatorTransport createTcpTransport() {\n return new NetworkEmulatorTransport(\n Transport.bindAwait(\n TransportConfig.defaultConfig().transportFactory(new TcpTransportFactory())));\n }",
"ServerTransport serverTransport(TransportResources resources);",
"protected AmqpTransportConfig() {\n\t\tsuper();\n\t}",
"ClientTransport clientTransport(TransportResources resources);",
"public interface Transport {\n\n /**\n * This method returns id of the current transport\n * @return\n */\n String id();\n\n /**\n * This methos returns Id of the upstream node\n * @return\n */\n String getUpstreamId();\n\n /**\n * This method returns random\n *\n * @param id\n * @param exclude\n * @return\n */\n String getRandomDownstreamFrom(String id, String exclude);\n\n /**\n * This method returns consumer that accepts messages for delivery\n * @return\n */\n Consumer<VoidMessage> outgoingConsumer();\n\n /**\n * This method returns flow of messages for parameter server\n * @return\n */\n Publisher<INDArrayMessage> incomingPublisher();\n\n /**\n * This method starts this Transport instance\n */\n void launch();\n\n /**\n * This method will start this Transport instance\n */\n void launchAsMaster();\n\n /**\n * This method shuts down this Transport instance\n */\n void shutdown();\n\n /**\n * This method will send message to the network, using tree structure\n * @param message\n */\n void propagateMessage(VoidMessage message, PropagationMode mode) throws IOException;\n\n /**\n * This method will send message to the node specified by Id\n *\n * @param message\n * @param id\n */\n void sendMessage(VoidMessage message, String id);\n\n /**\n * This method will send message to specified node, and will return its response\n *\n * @param message\n * @param id\n * @param <T>\n * @return\n */\n <T extends ResponseMessage> T sendMessageBlocking(RequestMessage message, String id) throws InterruptedException;\n\n /**\n * This method will send message to specified node, and will return its response\n *\n * @param message\n * @param id\n * @param <T>\n * @return\n */\n <T extends ResponseMessage> T sendMessageBlocking(RequestMessage message, String id, long waitTime, TimeUnit timeUnit) throws InterruptedException;\n\n /**\n * This method will be invoked for all incoming messages\n * PLEASE NOTE: this method is mostly suited for tests\n *\n * @param message\n */\n void processMessage(VoidMessage message);\n\n\n /**\n * This method allows to set callback instance, which will be called upon restart event\n * @param callback\n */\n void setRestartCallback(RestartCallback callback);\n\n /**\n * This methd allows to set callback instance for various\n * @param cls\n * @param callback\n * @param <T1> RequestMessage class\n * @param <T2> ResponseMessage class\n */\n <T extends RequestMessage> void addRequestConsumer(Class<T> cls, Consumer<T> consumer);\n\n /**\n * This method will be called if mesh update was received\n *\n * PLEASE NOTE: This method will be called ONLY if new mesh differs from current one\n * @param mesh\n */\n void onMeshUpdate(MeshOrganizer mesh);\n\n /**\n * This method will be called upon remap request\n * @param id\n */\n void onRemap(String id);\n\n /**\n * This method returns total number of nodes known to this Transport\n * @return\n */\n int totalNumberOfNodes();\n\n\n /**\n * This method returns ID of the root node\n * @return\n */\n String getRootId();\n\n /**\n * This method checks if all connections required for work are established\n * @return true\n */\n boolean isConnected();\n\n /**\n * This method checks if this node was properly introduced to driver\n * @return\n */\n boolean isIntroduced();\n\n /**\n * This method checks connection to the given node ID, and if it's not connected - establishes connection\n * @param id\n */\n void ensureConnection(String id);\n}",
"void connect() throws TransportException;",
"protected NetworkEmulatorTransport createWebsocketTransport() {\n return new NetworkEmulatorTransport(\n Transport.bindAwait(\n TransportConfig.defaultConfig().transportFactory(new WebsocketTransportFactory())));\n }",
"@Override\n\tpublic void open() throws TTransportException {\n\t}",
"public interface TransportAdapterClient {\r\n \r\n /**\r\n * Initializes instance. Configuration parameters are specific\r\n * to Transport Adapter implementation.\r\n * @param configuration\r\n */\r\n public void init(Map<String, String> configuration);\r\n \r\n /**\r\n * Submits batch to server side.\r\n * @param batch\r\n */\r\n public void submit(Batch batch);\r\n \r\n /**\r\n * Submits batch to server side applying operation filter if specified\r\n * i.e. only those batch units will be submitted which have operation\r\n * equal to provided operation filter.\r\n * \r\n * @param batch\r\n * @param opFilter\r\n */\r\n public void submit(Batch batch, BatchOperation opFilter); \r\n\r\n /**\r\n * Tests specified store alive.\r\n * @param storeName\r\n * @return\r\n */\r\n public boolean isAlive(String storeName);\r\n \r\n \r\n /**\r\n * Returns stream on content specified by content Id from store\r\n * specified by store Name.\r\n * \r\n * FIXME Providing OutputStream here implies that CSPCache must be capable\r\n * to provide either File as a future content placeholder or a OutputStream itself\r\n * \r\n * @param storeName\r\n * @param contentId\r\n * @param target is output stream to which content should be written\r\n */\r\n public void get(String storeName, Long jcrContentId, OutputStream target);\r\n \r\n \r\n}",
"private TransportOutDescription getTranport(String epr) {\r\n\t\tTransportOutDescription transport = null;\r\n\r\n\t\ttry {\r\n\t\t\tURL url = new URL(epr);\r\n\t\t\tString protocol = url.getProtocol();\r\n\t\t\tif (\"http\".equalsIgnoreCase(protocol) || \"https\".equalsIgnoreCase(protocol)) {\r\n\t\t\t\ttransport = new TransportOutDescription(protocol);\r\n\t\t\t\tClass senderClass;\r\n\t\t\t\tsenderClass = Loader\r\n\t\t\t\t\t\t.loadClass(\"org.apache.axis2.transport.http.CommonsHTTPTransportSender\");\r\n\t\t\t\tTransportSender sender = (TransportSender) senderClass.newInstance();\r\n\t\t\t\ttransport.setSender(sender);\r\n\t\t\t\ttransport.addParameter(new Parameter(\"PROTOCOL\", \"HTTP/1.1\"));\r\n\t\t\t\ttransport.addParameter(new Parameter(\"Transfer-Encoding\", \"chunked\"));\r\n\t\t\t\ttransport.addParameter(new Parameter(\"OmitSOAP12Action\", \"true\"));\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn transport;\r\n\t}",
"public interface TransportResponse<T>\n{\n /**\n * Returns the underlying value for this response. If this response has an error then this method\n * will return {@code null}.\n *\n * @return the value for this response or {@code null} if this response has an error.\n */\n T getResponse();\n\n /**\n * Returns {@code true} if this response has an error. Use {@link #getError()} to get the error.\n *\n * @return {@code true} if this response has an error.\n */\n boolean hasError();\n\n /**\n * If this response has an error, this method returns the error. Otherwise {@code null} is\n * returned.\n *\n * @return the response for this error or {@code null} if there is no error.\n */\n Throwable getError();\n\n /**\n * @return the wire attributes for this response.\n */\n Map<String, String> getWireAttributes();\n}",
"abstract public Transports createTransports();",
"public RecordedRpcTransport(XmlRpcCommonsTransportFactory pFactory) {\n super(pFactory);\n }",
"@Override\n public TTransport getTransport(final TTransport trans) throws TTransportException {\n TTransport result = ugi.doAs(new PrivilegedAction<TTransport>() {\n @Override\n public TTransport run() {\n try {\n return wrapped.getTransport(trans);\n } catch (TTransportException e) {\n cause = e;\n return null;\n } catch (RuntimeException re) {\n /*\n * One cause can be:\n * org.apache.thrift.transport.TSaslTransportException: No data or no sasl data in the stream\n * Others are possible.\n *\n * Get rid of RuntimeException.\n */\n cause = re.getCause();\n return null;\n }\n }\n });\n if (result == null) {\n throw new TTransportException(cause);\n }\n return result;\n }",
"private TTransport connectToServer(InetSocketAddress serverAddress) throws Exception {\n TTransport thriftTransport = createTransport(serverAddress);\n thriftTransport.open();\n LOGGER.debug(\"Successfully opened transport {} to {}\", thriftTransport, serverAddress);\n return thriftTransport;\n }",
"public TSimpleJSONProtocol(TTransport trans, boolean useBase64) {\n super(trans);\n this.delegate =\n useBase64 ? new Base64TSimpleJSONProtocol(trans) : new DefaultTSimpleJSONProtocol(trans);\n }",
"public String getTransport() {\n\t if (LogWriter.needsLogging(LogWriter.TRACE_DEBUG))\n\t LogWriter.logMessage(LogWriter.TRACE_DEBUG,\"getTransport()\");\n Via via=(Via)sipHeader;\n return via.getTransport();\n }",
"@GuardedBy(\"lock\")\n public void startNewTransport() {\n SocketAddress socketAddress;\n HttpConnectProxiedSocketAddress httpConnectProxiedSocketAddress;\n Preconditions.checkState(this.reconnectTask == null, \"Should have no reconnectTask scheduled\");\n if (this.addressIndex.isAtBeginning()) {\n this.connectingTimer.reset().start();\n }\n SocketAddress currentAddress = this.addressIndex.getCurrentAddress();\n if (currentAddress instanceof HttpConnectProxiedSocketAddress) {\n httpConnectProxiedSocketAddress = (HttpConnectProxiedSocketAddress) currentAddress;\n socketAddress = httpConnectProxiedSocketAddress.getTargetAddress();\n } else {\n socketAddress = currentAddress;\n httpConnectProxiedSocketAddress = null;\n }\n ClientTransportFactory.ClientTransportOptions httpConnectProxiedSocketAddress2 = new ClientTransportFactory.ClientTransportOptions().setAuthority(this.authority).setEagAttributes(this.addressIndex.getCurrentEagAttributes()).setUserAgent(this.userAgent).setHttpConnectProxiedSocketAddress(httpConnectProxiedSocketAddress);\n TransportLogger transportLogger = new TransportLogger();\n transportLogger.logId = getLogId();\n CallTracingTransport callTracingTransport = new CallTracingTransport(this.transportFactory.newClientTransport(socketAddress, httpConnectProxiedSocketAddress2, transportLogger), this.callsTracer);\n transportLogger.logId = callTracingTransport.getLogId();\n this.channelz.addClientSocket(callTracingTransport);\n this.pendingTransport = callTracingTransport;\n this.transports.add(callTracingTransport);\n Runnable start = callTracingTransport.start(new TransportListener(callTracingTransport, socketAddress));\n if (start != null) {\n this.syncContext.executeLater(start);\n }\n this.channelLogger.log(ChannelLogger.ChannelLogLevel.INFO, \"Started transport {0}\", transportLogger.logId);\n }",
"public TransportProtocol protocol() {\n return this.protocol;\n }",
"public void migrateToMultiTransport();",
"private void dumpTransport(TransportExt transport)\n {\n\n log(\"* Transport Information\");\n log(\"*\");\n assertTrue(\"TransportID should be greater than zero\", transport.getTransportID() > 0);\n log(\"* TransportID: \" + transport.getTransportID());\n assertNotNull(\"Transport DeliverySystemType should not be null\", transport.getDeliverySystemType());\n log(\"* DeliverySystemType: \" + transport.getDeliverySystemType());\n assertNotNull(\"Transport Handle should not be null\", transport.getTransportHandle());\n log(\"* Transport Handle: \" + transport.getTransportHandle());\n log(\"*\");\n }",
"public String getTransport() {\n\t\treturn messageProcessor.getTransport();\n\t}",
"Transport storeTransport(@NotNull EezerStoreTransportRequest request);",
"public interface EndpointBase {\n\n boolean isIdleNow();\n\n /**\n * @param connectionTimeout\n * @param methodTimeout\n */\n void setTimeouts(int connectionTimeout, int methodTimeout);\n\n /**\n * @param alwaysMainThread\n */\n void setCallbackThread(boolean alwaysMainThread);\n\n /**\n * @param flags\n */\n void setDebugFlags(int flags);\n\n int getDebugFlags();\n\n /**\n * @param delay\n */\n void setDelay(int delay);\n\n void addErrorLogger(ErrorLogger logger);\n\n void removeErrorLogger(ErrorLogger logger);\n\n void setOnRequestEventListener(OnRequestEventListener listener);\n\n\n void setPercentLoss(float percentLoss);\n\n int getThreadPriority();\n\n void setThreadPriority(int threadPriority);\n\n\n ProtocolController getProtocolController();\n\n void setUrlModifier(UrlModifier urlModifier);\n\n /**\n * No log.\n */\n int NO_DEBUG = 0;\n\n /**\n * Log time of requests.\n */\n int TIME_DEBUG = 1;\n\n /**\n * Log request content.\n */\n int REQUEST_DEBUG = 2;\n\n /**\n * Log response content.\n */\n int RESPONSE_DEBUG = 4;\n\n /**\n * Log cache behavior.\n */\n int CACHE_DEBUG = 8;\n\n /**\n * Log request code line.\n */\n int REQUEST_LINE_DEBUG = 16;\n\n /**\n * Log request and response headers.\n */\n int HEADERS_DEBUG = 32;\n\n /**\n * Log request errors\n */\n int ERROR_DEBUG = 64;\n\n /**\n * Log cancellations\n */\n int CANCEL_DEBUG = 128;\n\n /**\n * Log cancellations\n */\n int THREAD_DEBUG = 256;\n\n /**\n * Log everything.\n */\n int FULL_DEBUG = TIME_DEBUG | REQUEST_DEBUG | RESPONSE_DEBUG | CACHE_DEBUG | REQUEST_LINE_DEBUG | HEADERS_DEBUG | ERROR_DEBUG | CANCEL_DEBUG;\n\n int INTERNAL_DEBUG = FULL_DEBUG | THREAD_DEBUG;\n\n /**\n * Created by Kuba on 17/07/14.\n */\n interface UrlModifier {\n\n String createUrl(String url);\n\n }\n\n interface OnRequestEventListener {\n\n void onStart(Request request, int requestsCount);\n\n void onStop(Request request, int requestsCount);\n\n }\n}",
"public void writeToTransport(INetworkContext context, ByteBuffer buffer) throws MqttsnException {\n if(context.getReceivePort() == options.getSecurePort()){\n\n //-- use the DTLS version...\n\n } else {\n super.writeToTransport(context, buffer);\n }\n }",
"private TargetedChain getTransport(AxisEngine axisEngine, String transportName) throws AxisFault {\n Handler transport = axisEngine.getTransport(transportName);\n assertNotNull(\"No \" + transportName + \" transport returned from the configured engine\",\n transport);\n\n assertTrue(\"The \" + transportName + \" transport is not of the expected type\",\n transport instanceof TargetedChain);\n return (TargetedChain) transport;\n }",
"public void testTransportsTransportStreamsAndNetworks()\n {\n log(\"******************************************************************\");\n log(\"* Transport and Transport Stream information *\");\n log(\"******************************************************************\");\n log(\"\");\n try\n {\n TransportHandle[] transports = sidb.getAllTransports();\n for (int i = 0; i < transports.length; i++)\n {\n TransportImpl transport = (TransportImpl) sidb.createTransport(transports[i]);\n log(\"******************************************************************\");\n\n dumpTransport(transport);\n\n // try to dump the transport streams\n TransportStreamHandle[] tsHandles = sidb.getTransportStreamsByTransport(transports[i]);\n for (int j = 0; j < tsHandles.length; j++)\n {\n TransportStreamExt ts = sidb.createTransportStream(tsHandles[j]);\n dumpTransportStream(ts);\n assertTrue(\"TransportStream's Transport does not match expected value\",\n transport.equals(ts.getTransport()));\n }\n\n // try to dump the networks\n NetworkHandle[] netHandles = sidb.getNetworksByTransport(transports[i]);\n for (int j = 0; j < netHandles.length; j++)\n {\n NetworkExt net = sidb.createNetwork(netHandles[j]);\n dumpNetwork(net);\n assertTrue(\"Networks's Transport does not match expected value\",\n transport.equals(net.getTransport()));\n }\n log(\"******************************************************************\");\n }\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }",
"@SuppressWarnings(\"squid:S2095\")\n private TTransport createTransport(InetSocketAddress serverAddress)\n throws IOException {\n String hostName = serverAddress.getHostName();\n int port = serverAddress.getPort();\n TTransport socket = new TSocket(hostName, port, connectionTimeout);\n\n if (!isKerberosEnabled) {\n LOGGER.debug(\"created unprotected connection to {}:{} \", hostName, port);\n return socket;\n }\n\n String principal = SecurityUtil.getServerPrincipal(serverPrincipal, serverAddress.getAddress());\n String[] serverPrincipalParts = SaslRpcServer.splitKerberosName(principal);\n if (serverPrincipalParts.length != 3) {\n throw new IOException(\"Kerberos principal should have 3 parts: \" + principal);\n }\n\n UgiSaslClientTransport connection =\n new UgiSaslClientTransport(SaslRpcServer.AuthMethod.KERBEROS.getMechanismName(),\n serverPrincipalParts[0], serverPrincipalParts[1],\n socket, useUgi);\n\n LOGGER.debug(\"creating secured connection to {}:{} \", hostName, port);\n return connection;\n }",
"netty.framework.messages.TestMessage.TestRequest getRequest();",
"ITransport createTransport(T netconfAccessInfo) throws NetconfException;",
"pb4server.TransportResAskReq getTransportResAskReq();",
"public void transportConfigure(ParameterList params) throws TransportException {\n }",
"public String wantRoundTrip();",
"public interface Router {\n\n interface Message {\n /**\n * The reply-to header\n *\n * @return the reply-to header\n */\n default String replyTo() {\n return (String) metadata().get(\"reply-to\");\n }\n\n /**\n * The host header\n *\n * @return the host header\n */\n default String host() {\n return (String) metadata().get(\"x-host\");\n }\n\n /**\n * Get the name of the reply queue to send the message to\n *\n * @return the reply queue\n */\n default String replyQueue() {\n return (String) metadata().get(\"x-reply-queue\");\n }\n\n\n /**\n * The uri header\n *\n * @return the uri header\n */\n default String uri() {\n\n return (String) metadata().get(\"x-uri\");\n }\n\n /**\n * The scheme header\n *\n * @return the scheme header\n */\n default String scheme() {\n return (String) metadata().get(\"x-scheme\");\n }\n\n /**\n * The method header\n *\n * @return the method header\n */\n default String method() {\n String m = (String) metadata().get(\"x-method\");\n if (null == m) {\n m = \"get\";\n }\n return m.toLowerCase();\n }\n\n /**\n * Get the port... may be String, Number, or null\n *\n * @return get the port\n */\n default Object port() {\n return metadata().get(\"server-port\");\n }\n\n /**\n * get the protocol for the request\n *\n * @return\n */\n default String protocol() {\n return (String) metadata().get(\"x-server-protocol\");\n }\n\n /**\n * Get the uri args for the request\n *\n * @return the uri args for the request\n */\n default String args() {\n return (String) metadata().get(\"x-uri-args\");\n }\n\n /**\n * The content-type header\n *\n * @return the content-type header\n */\n default String contentType() {\n return (String) metadata().get(\"content-type\");\n }\n\n /**\n * The remote address of the client\n *\n * @return remote address\n */\n default String remoteAddr() {\n return (String) metadata().get(\"x-remote-addr\");\n }\n\n /**\n * The\n *\n * @return\n */\n Map<String, Object> metadata();\n\n Object body();\n\n byte[] rawBody();\n\n MessageBroker.ReceivedMessage underlyingMessage();\n }\n\n /**\n * Convert the message from the more generic one from the MessageBroker into\n * something that can be routed\n *\n * @param message\n * @return\n */\n default Message brokerMessageToRouterMessage(MessageBroker.ReceivedMessage message) {\n return new Message() {\n\n @Override\n public Map<String, Object> metadata() {\n return message.metadata();\n }\n\n @Override\n public Object body() {\n return message.body();\n }\n\n @Override\n public byte[] rawBody() {\n return message.rawBody();\n }\n\n @Override\n public MessageBroker.ReceivedMessage underlyingMessage() {\n return message;\n }\n };\n }\n\n /**\n * Route the message. This may cause the message to be queued to the next handler (Runner)\n * or route it to the handler Func.\n *\n * @param message the Message to route\n * @return the result of the Message application or void if this Router forwards the message\n */\n Object routeMessage(Message message) throws IOException;\n\n\n /**\n * Release any resources that the Router has... for example, any database pool connections\n */\n void endLife();\n\n /**\n * Get the host that this Router is listening for\n *\n * @return the name of the host. May be null\n */\n String host();\n\n /**\n * Get the base path for this Router\n *\n * @return the base path for the router\n */\n String basePath();\n\n /**\n * Return the name of the queue that is associated with the host/path combination\n *\n * @return the name of the queue associated with the host/path combination\n */\n String nameOfListenQueue();\n\n /**\n * Get the swagger for this Router\n *\n * @return the Swagger information for the router\n */\n Map<String, Object> swagger();\n\n}",
"@Override\n public void socket() {\n }",
"OutputStream prepare(ConnectionInfo info) throws TransportException;",
"public void testThatStandardTransportClientCanConnectToNoClientAuthProfile() throws Exception {\n try(TransportClient transportClient = new TestXPackTransportClient(Settings.builder()\n .put(transportClientSettings())\n .put(\"xpack.security.transport.ssl.enabled\", true)\n .put(\"node.name\", \"programmatic_transport_client\")\n .put(\"cluster.name\", internalCluster().getClusterName())\n .build(), LocalStateSecurity.class)) {\n transportClient.addTransportAddress(new TransportAddress(localAddress,\n getProfilePort(\"no_client_auth\")));\n assertGreenClusterState(transportClient);\n }\n }",
"public abstract Client getClient();",
"protected abstract String getBaseEndpoint();",
"@Override\n protected String inferProtocol() {\n return \"http\";\n }",
"public interface SubscriptionTransport\n{\n\tpublic static interface Callback\n\t{\n\n\t\tpublic abstract void onConnected();\n\n\t\tpublic abstract void onFailure(Throwable throwable);\n\n\t\tpublic abstract void onMessage(OperationServerMessage operationservermessage);\n\t}\n\n\tpublic static interface Factory\n\t{\n\n\t\tpublic abstract SubscriptionTransport create(Callback callback);\n\t}\n\n\n\tpublic abstract void connect();\n\n\tpublic abstract void disconnect(OperationClientMessage operationclientmessage);\n\n\tpublic abstract void send(OperationClientMessage operationclientmessage);\n}",
"public abstract void Listen() throws TransportLayerException;",
"public void setTransport(String transport) throws IllegalArgumentException, \n SipParseException {\n\tif (LogWriter.needsLogging(LogWriter.TRACE_DEBUG))\n\t LogWriter.logMessage(LogWriter.TRACE_DEBUG,\"setTransport() \" \n\t\t\t\t\t+ transport);\n Via via=(Via)sipHeader;\n if ( transport==null )\n throw new IllegalArgumentException\n (\"JAIN-EXCEPTION: transport argument is null\");\n\t else if ( transport.compareToIgnoreCase(TCP) != 0 \n\t\t && transport.compareToIgnoreCase(UDP) != 0 )\n\t throw new SipParseException(\"Bad transport string\");\n else via.setTransport(transport.toUpperCase());\n }",
"public RoundTripFromJavaJSONLegacyTest(String testName) {\n super(testName);\n }",
"@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n public static TransportReader<TransportMessage>\n createProductionDefault() {\n\n /*\n * TODO Remove raw types and unchecked conversion. Unfortunately I could\n * not find a way around using raw types and unchecked conversion my be\n * some one else can.\n */\n\n PtTlsMessageHeaderReader mReader = new PtTlsMessageHeaderReader(\n new PtTlsMessageHeaderBuilderIetf());\n\n PtTlsReader reader = new PtTlsReader(mReader);\n\n reader.add(IETFConstants.IETF_PEN_VENDORID,\n PtTlsMessageTypeEnum.IETF_PT_TLS_VERSION_REQUEST.id(),\n (TransportReader) new PtTlsMessageVersionRequestValueReader(\n new PtTlsMessageValueVersionRequestBuilderIetf()));\n reader.add(IETFConstants.IETF_PEN_VENDORID,\n PtTlsMessageTypeEnum.IETF_PT_TLS_VERSION_RESPONSE.id(),\n (TransportReader) new PtTlsMessageVersionResponseValueReader(\n new PtTlsMessageValueVersionResponseBuilderIetf()));\n reader.add(IETFConstants.IETF_PEN_VENDORID,\n PtTlsMessageTypeEnum.IETF_PT_TLS_PB_BATCH.id(),\n (TransportReader) new PtTlsMessagePbBatchValueReader(\n new PtTlsMessageValuePbBatchBuilderIetf()));\n reader.add(IETFConstants.IETF_PEN_VENDORID,\n PtTlsMessageTypeEnum.IETF_PT_TLS_ERROR.id(),\n (TransportReader) new PtTlsMessageErrorValueReader(\n new PtTlsMessageValueErrorBuilderIetf()));\n reader.add(IETFConstants.IETF_PEN_VENDORID,\n PtTlsMessageTypeEnum.IETF_PT_TLS_SASL_MECHANISMS.id(),\n (TransportReader) new PtTlsMessageSaslMechanismsValueReader(\n new PtTlsMessageValueSaslMechanismsBuilderIetf()));\n reader.add(\n IETFConstants.IETF_PEN_VENDORID,\n PtTlsMessageTypeEnum.IETF_PT_TLS_SASL_MECHANISM_SELECTION.id(),\n (TransportReader) new PtTlsMessageSaslMechanismSelectionValueReader(\n new PtTlsMessageValueSaslMechanismSelectionBuilderIetf()));\n reader.add(\n IETFConstants.IETF_PEN_VENDORID,\n PtTlsMessageTypeEnum.IETF_PT_TLS_SASL_AUTHENTICATION_DATA.id(),\n (TransportReader) new PtTlsMessageSaslAuthenticationDataValueReader(\n new PtTlsMessageValueSaslAuthenticationDataBuilderIetf()));\n reader.add(IETFConstants.IETF_PEN_VENDORID,\n PtTlsMessageTypeEnum.IETF_PT_TLS_SASL_RESULT.id(),\n (TransportReader) new PtTlsMessageSaslResultValueReader(\n new PtTlsMessageValueSaslResultBuilderIetf()));\n\n return reader;\n }",
"public interface DispatchConstants {\n\n public final static String TAG = \"APTDS\";\n\n /**\n * Pluggable Transports 2.0 Spec Constants 3.3.1.1. Common Configuration Parameters\n **/\n\n public final static String PT_VERSION = \"ptversion\"; //decimal //Specify the Pluggable Transport protocol version to use\n public final static String PT_STATE_DIRECTORY = \"state\"; //string path or file // Specify the directory to use to store state information required by the transports\n public final static String PT_EXIT_ON_STDIN_CLOSE = \"exit-on-stdin-close\"; //boolean // Set to true to force the dispatcher to close when the stdin pipe is closed\n\n // NOTE: -transports is parsed as a common command line flag that overrides either TOR_PT_SERVER_TRANSPORTS or TOR_PT_CLIENT_TRANSPORTS\n public final static String PT_TRANSPORTS = \"transports\"; //string transport name // Specify transports to enable\n\n // PT 2.0 specification, 3.3.1.2. Pluggable PT Client Configuration Parameters\n public final static String PT_CLIENT_UPSTREAM_PROXY = \"proxy\";\n\n // PT 2.0 specification, 3.3.1.3. Pluggable PT Server Environment Variables\n public final static String PT_SERVER_OPTIONS = \"options\"; //Specify the transport options for the server\n public final static String PT_SERVER_BIND_ADDR = \"bindaddr\"; //Specify the bind address for transparent server\n public final static String PT_SERVER_OR_PORT = \"orport\"; //Specify the address the server should forward traffic to in host:port format\n public final static String PT_SERVER_EXT_OR_PORT = \"extorport\"; // Specify the address of a server implementing the Extended OR Port protocol, which is used for per-connection metadata\n public final static String PT_SERVER_AUTH_COOKIE = \"authcookie\"; // Specify an authentication cookie, for use in authenticating with the Extended OR Port\n public final static String PT_SERVER_PROXY_LISTEN_ADDR = \"proxylistenaddr\"; //Specify the bind address for the local SOCKS server provided by the client\n\n // APT-DS implemented transports\n public final static String PT_TRANSPORTS_MEEK = \"meek_lite\";\n public final static String PT_TRANSPORTS_OBFS4 = \"obfs4\";\n public final static String PT_TRANSPORTS_SHADOWSOCKS = \"ss\";\n public final static String PT_TRANSPORTS_SNOWFLAKE = \"snowflake\";\n\n // goptbundle env var names\n public static final String TOR_PT_LOG_LEVEL = \"TOR_PT_LOG_LEVEL\";\n /**\n * If {@code tor} daemon keeps stdin open for use in termination detection (1/0)\n */\n public static final String TOR_PT_EXIT_ON_STDIN_CLOSE = \"TOR_PT_EXIT_ON_STDIN_CLOSE\";\n /**\n * Read the pluggable transports version from.\n */\n public static final String TOR_PT_MANAGED_TRANSPORT_VER = \"TOR_PT_MANAGED_TRANSPORT_VER\";\n /**\n * The directory to read the state of the pluggable transport from.\n */\n public static final String TOR_PT_STATE_LOCATION = \"TOR_PT_STATE_LOCATION\";\n /**\n * Comma-separated list of transports: obfs4,meek_lite,obfs2,obfs3,scramblesuit\n */\n public static final String TOR_PT_CLIENT_TRANSPORTS = \"TOR_PT_CLIENT_TRANSPORTS\";\n /**\n * Comma-separated list of transports: obfs4,meek_lite,obfs2,obfs3,scramblesuit\n */\n public static final String TOR_PT_SERVER_TRANSPORTS = \"TOR_PT_SERVER_TRANSPORTS\";\n public static final String TOR_PT_SERVER_BINDADDR = \"TOR_PT_SERVER_BINDADDR\";\n public static final String TOR_PT_SERVER_TRANSPORT_OPTIONS = \"TOR_PT_SERVER_TRANSPORT_OPTIONS\";\n /**\n * URL for the proxy to connect to in order to use the running pluggable transport\n */\n public static final String TOR_PT_PROXY = \"TOR_PT_PROXY\";\n public static final String TOR_PT_ORPORT = \"TOR_PT_ORPORT\";\n public static final String TOR_PT_AUTH_COOKIE_FILE = \"TOR_PT_AUTH_COOKIE_FILE\";\n public static final String TOR_PT_EXTENDED_SERVER_PORT = \"TOR_PT_EXTENDED_SERVER_PORT\";\n\n /**\n * A request to Orbot to transparently start Tor services\n */\n public final static String ACTION_START = \"info.pluggabletransports.aptds.intent.action.START\";\n /**\n * {@link Intent} send by Orbot with {@code ON/OFF/STARTING/STOPPING} status\n */\n public final static String ACTION_STATUS = \"info.pluggabletransports.aptds.intent.action.STATUS\";\n /**\n * {@code String} that contains a status constant: {@link #STATUS_ON},\n * {@link #STATUS_OFF}, {@link #STATUS_STARTING}, or\n * {@link #STATUS_STOPPING}\n */\n public final static String EXTRA_STATUS = \"info.pluggabletransports.aptds.intent.extra.STATUS\";\n /**\n * A {@link String} {@code packageName} for Orbot to direct its status reply\n * to, used in {@link #ACTION_START} {@link Intent}s sent to Orbot\n */\n public final static String EXTRA_PACKAGE_NAME = \"info.pluggabletransports.aptds.intent.extra.PACKAGE_NAME\";\n /**\n * The SOCKS proxy settings in URL form.\n */\n public final static String EXTRA_TRANSPORT_TYPE = \"info.pluggabletransports.aptds.intent.extra.PROXY_TYPE\";\n public final static String EXTRA_TRANSPORT_PORT = \"info.pluggabletransports.aptds.intent.extra.PROXY_PORT\";\n public final static String EXTRA_TRANSPORT_VPN = \"info.pluggabletransports.aptds.intent.extra.PROXY_VPN\";\n\n\n /**\n * All related services and daemons are stopped\n */\n public final static String STATUS_OFF = \"OFF\";\n /**\n * All related services and daemons have completed starting\n */\n public final static String STATUS_ON = \"ON\";\n public final static String STATUS_STARTING = \"STARTING\";\n public final static String STATUS_STOPPING = \"STOPPING\";\n\n public final static int FILE_WRITE_BUFFER_SIZE = 2048;\n\n public final static String DIRECTORY_BINARIES = \"bin\";\n\n\n}",
"protected void setUp() throws Exception {\n super.setUp();\n clientAddress = getNonAnonymousClientAddress();\n responseProcessor = Endpoint.create(new NonAnonymousRespProcessor(respMsgExchanger));\n responseProcessor.publish(clientAddress);\n }",
"public interface ITransportHandler {\n\n /**\n * Processing device returned messages\n * \n * @author\n * @param devReplyStr Message information returned by the device\n */\n void handlePacket(String devReplyStr);\n\n /**\n * Error information processing apparatus returns <br>\n * \n * @author\n * @param devReplyErr Error messages returned by the device\n */\n void handleError(String devReplyErr);\n\n /**\n * Device interaction with the end of the glyph packets <br>\n * \n * @author\n * @return End glyph packets\n */\n String getPacketEndTag();\n\n /**\n * Encoding packets\n * \n * @author\n * @return Encoding packets\n */\n String getCharsetName();\n\n}",
"public void setTransport(String value) {\n setAttributeInternal(TRANSPORT, value);\n }",
"public interface TransportService {\n\n /**\n * Create and persist a new transport.\n *\n * @param request the new transport data\n *\n * @return the new transport object, if successful\n */\n Transport storeTransport(@NotNull EezerStoreTransportRequest request);\n\n /**\n * Remove an existing transport by it's transportId.\n *\n * !!! NOTE: USUALLY WE DON'T DO THIS !!!\n *\n * @param transportId the transportId to remove\n */\n void removeTransport(@NotNull String transportId);\n\n /**\n * Fetch all existing transports in the system.\n * We don't return coordinates here, there is a\n * separate call for that.\n *\n * @return a list of all existing transports\n */\n List<Transport> getTransports();\n\n /**\n * Fetch all coordinates associated with a\n * specific transport.\n *\n * @param transportId the transportId\n *\n * @return a list of all coordinates\n */\n List<Coordinate> getCoordinates(@NotNull String transportId);\n\n}",
"public void testThatStandardTransportClientCanConnectToDefaultProfile() throws Exception {\n assertGreenClusterState(internalCluster().transportClient());\n }",
"@Override\n\tpublic String getProtocol() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic String getProtocol() {\n\t\treturn null;\n\t}",
"private void assertTransportConfiguration(AxisServer axisServer, AxisServer prototypeAxisServer)\n throws AxisFault {\n assertEquals(\"Request handler is not of the expected type\",\n getTransport(prototypeAxisServer, \"http\").getRequestHandler().getClass(),\n getTransport(axisServer, \"http\").getRequestHandler().getClass());\n\n assertEquals(\"Response handler is not of the expected type\",\n getTransport(prototypeAxisServer, \"local\").getResponseHandler().getClass(),\n getTransport(axisServer, \"local\").getResponseHandler().getClass());\n }",
"@Override\n\t\tpublic String getProtocol() {\n\t\t\treturn null;\n\t\t}",
"private void assertTransportConfiguration(AxisClient axisClient, AxisClient prototypeAxisClient)\n throws AxisFault {\n for (String transportName : new String[] {\"http\", \"local\", \"java\"}) {\n assertEquals(\"Pivot handler is not of the expected type\",\n getTransport(prototypeAxisClient, transportName).getPivotHandler().getClass(),\n getTransport(axisClient, transportName).getPivotHandler().getClass());\n }\n }",
"@Override\n\tprotected void requesting(ExtendedDataOutputStream out) throws Exception\n\t{\n\t\tout.writeObject(this.clientServerPort);\n\t}",
"@Test\n\tpublic void testWithInvalidID(){\n\t\tString invalidID = \"not a valid ID\";\n\t\ttry{\n\t\t\tclient.viewTransport(invalidID);\n\t\t\tfail();\n\t\t} catch(UnknownTransportFault_Exception e) {\n\t\t\tassertEquals(\"No transports match the given transport identifier.\",e.getMessage());\n\t\t}\n\t}",
"public HttpClientHelper() {\n defaultHeaders.put(\"Content-Type\", \"application/json\");\n defaultHeaders.put(\"Accept-Encoding\", \"gzip\");\n\n //postDefaultHeaders.put(\"Content-Type\", \"application/json\");\n //postDefaultHeaders.put(\"Content-Encoding\", \"gzip\");\n\n String key = MessageFormat.format(\"{0}#{1}\", UserUtil.getUserUuid(), UserUtil.getUserId());\n\n //postDefaultHeaders.put(\"X-CLIENT-KEY\", key);\n defaultHeaders.put(\"X-CLIENT-KEY\", key);\n client.setTimeout(3000);\n }",
"@Nullable\n public ClientTransport getTransport() {\n return this.activeTransport;\n }",
"public JsonHttpChannel() {\n this.defaultConstructor = new JsonHttpEventFactory();\n }",
"@Override\n\tpublic void createClient() {\n\t\t\n\t}",
"private MockClientNetworkModule() {\n\t\t// TODO complete this constructor\n\t}",
"public IngressTransportMethod transport() {\n return this.transport;\n }",
"public String getTransport() {\n return (String) getAttributeInternal(TRANSPORT);\n }",
"@Override\n public ClientTransport get(PickSubchannelArgs args) {\n return delayedTransport;\n }",
"public String getTransport() {\n return SIPConstants.UDP;\n }",
"public String getTransport() {\n return SIPConstants.UDP;\n }",
"public interface StreamSource {\n\n /**\n * Gets new streams. This should be called only if one of the streams \n * is dead. \n * @throws TransportException\n */\n void connect() throws TransportException;\n \n /**\n * Closes streams and underlying connections. \n * @throws TransportException\n */\n void disconnect() throws TransportException;\n \n /**\n * @return the stream to which we write outbound messages. \n * @throws TransportException\n */\n OutputStream getOutboundStream() throws TransportException;\n\n /**\n * @return the stream to which we expect the remote server to send messages. \n * @throws TransportException\n */\n InputStream getInboundStream() throws TransportException;\n \n}",
"Client getClient();",
"public ClientTSap() {\n socketFactory = SocketFactory.getDefault();\n }",
"@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkProtocol() {\n\t\tboolean flag = oTest.checkProtocol();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn false;\r\n\t}",
"public static HttpTransportAgent createTestTransportAgent(SyncConfig config) {\n HttpTransportAgent ta = new HttpTransportAgent(\n config.syncUrl,\n config.userAgent,\n \"UTF-8\",\n config.compress, config.forceCookies);\n // Force messages to be resent in case of errors\n ta.setResendMessageOnErrors(true);\n return ta;\n }",
"public TransportConn(RFTXHost host, int identity) {\n this.host = host;\n this.identity = identity;\n readyToRun=false;\n }",
"public String roundTrip();",
"public Transportation(NetworkLayers.LAYER_DIRECTION layerDirection) {\n frame = MinT.getInstance();\n this.networkManager = frame.getNetworkManager();\n this.scheduler = frame.getSystemScheduler();\n \n if (layerDirection == NetworkLayers.LAYER_DIRECTION.RECEIVE) {\n syshandle = new SystemHandler();\n routing = networkManager.getRoutingProtocol();\n sharing = networkManager.getSharing();\n }\n\n if (layerDirection == NetworkLayers.LAYER_DIRECTION.SEND) {\n serialization = new MatcherAndSerialization(layerDirection);\n// if(frame.isBenchMode()){\n// bench_send = new PacketPerform(\"Trans-sender\");\n// frame.addPerformance(MinT.PERFORM_METHOD.Trans_Sender, bench_send);\n// }\n }\n }",
"@Test\n public void testClientMessageDecode() throws Exception {\n testNettyMessageClientDecoding(false, false, false);\n }",
"@Override\r\n\tpublic void send() throws Exception {\n\t\t\r\n\t}",
"private RESTBackend()\n\t\t{\n\t\t\t\n\t\t}",
"public TTransportFactory wrapTransportFactory(TTransportFactory transFactory) {\n return new TUGIAssumingTransportFactory(transFactory, realUgi);\n }",
"@Override\n protected void configure() {\n }",
"public void testThatStandardTransportClientCannotConnectToClientProfile() throws Exception {\n try (TransportClient transportClient = createTransportClient(Settings.EMPTY)) {\n transportClient.addTransportAddress(new TransportAddress(localAddress, getProfilePort(\"client\")));\n transportClient.admin().cluster().prepareHealth().get();\n fail(\"Expected NoNodeAvailableException\");\n } catch (NoNodeAvailableException e) {\n assertThat(e.getMessage(), containsString(\"None of the configured nodes are available: [{#transport#-\"));\n }\n }",
"public HttpConnector(JsonSystem system) {\r\n super(system);\r\n }",
"@Override\n public Serializer<ResponseContainer> serializer() {\n return new Serializer<ResponseContainer>() {\n @Override\n public void configure(Map<String, ?> configs, boolean isKey) {\n // This method is left empty until needed.\n }\n\n @Override\n public byte[] serialize(String topic, ResponseContainer responseContainer) {\n return gson.toJson(responseContainer.getResponseData()).getBytes(StandardCharsets.UTF_8);\n }\n\n @Override\n public void close() {\n // This method is left empty until needed.\n }\n };\n }",
"@Override\n\t\t\tprotected void configure() {\n\t\t\t}",
"@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n public static TransportReader<TransportMessage>\n createExperimentalDefault() {\n\n /*\n * TODO Remove raw types and unchecked conversion. Unfortunately I could\n * not find a way around using raw types and unchecked conversion my be\n * some one else can.\n */\n\n PtTlsReader reader = (PtTlsReader) createProductionDefault();\n\n reader.add(IETFConstants.IETF_PEN_VENDORID,\n PtTlsMessageTypeEnum.IETF_PT_TLS_EXERIMENTAL.id(),\n (TransportReader) new PtTlsMessageExperimentalValueReader(\n new PtTlsMessageValueExperimentalBuilderIetf()));\n\n return reader;\n }",
"public void setTransportProtocolName(String val) {\n\t\tmTransportProtocolName = val;\n\t}",
"public Client() {}",
"@Before\n public void setUp() throws Exception {\n StoreDefinition.createAllTables(injector.getInstance(StructuredTableAdmin.class));\n cConf.setBoolean(Constants.Tethering.TETHERING_SERVER_ENABLED, true);\n cConf.setInt(Constants.Tethering.CONNECTION_TIMEOUT_SECONDS, 1);\n\n List<Permission> tetheringPermissions = Arrays.asList(InstancePermission.TETHER);\n InMemoryAccessController inMemoryAccessController = new InMemoryAccessController();\n inMemoryAccessController.grant(\n Authorizable.fromEntityId(InstanceId.SELF),\n MASTER_PRINCIPAL,\n Collections.unmodifiableSet(new HashSet<>(tetheringPermissions)));\n ContextAccessEnforcer contextAccessEnforcer =\n new DefaultContextAccessEnforcer(new AuthenticationTestContext(), inMemoryAccessController);\n AuthenticationTestContext.actAsPrincipal(MASTER_PRINCIPAL);\n\n service =\n new CommonNettyHttpServiceBuilder(\n CConfiguration.create(),\n getClass().getSimpleName(),\n new NoOpMetricsCollectionService())\n .setHttpHandlers(\n new TetheringServerHandler(\n cConf,\n tetheringStore,\n messagingService,\n contextAccessEnforcer,\n messagingProgramStatePublisher),\n new TetheringHandler(cConf, tetheringStore, messagingService, profileService))\n .build();\n service.start();\n config =\n ClientConfig.builder()\n .setConnectionConfig(\n ConnectionConfig.builder()\n .setHostname(service.getBindAddress().getHostName())\n .setPort(service.getBindAddress().getPort())\n .setSSLEnabled(false)\n .build())\n .build();\n }",
"public interface Transferable {\n\n\n\n /**\n *\n * @throws Exception\n */\n void init() throws Exception;\n\n\n /**\n *\n * @throws Exception\n */\n void parseHeader() throws Exception;\n\n\n /**\n *\n * @throws Exception\n */\n void parseBody() throws Exception;\n\n\n /**\n *\n * @throws Exception\n */\n void finish() throws Exception;\n}",
"protected static TransportImpl productionHttpRequest(String http_method,\n\t\t\tString url_, Map<String, String> headers, String entity,\n\t\t\tint read_timeout, int connect_timeout)\n\t\t\tthrows MalformedURLException, IOException, IP2GatewayException {\n\n\t\tURL m_url = new URL(url_);\n\n\t\tTransportImpl tpImpl = new TransportImpl();\n\t\ttry {\n\t\t\tHttpsURLConnection connection = (HttpsURLConnection) m_url\n\t\t\t\t\t.openConnection();\n\n\t\t\tconnection.setReadTimeout(read_timeout);\n\t\t\tconnection.setConnectTimeout(connect_timeout);\n\n\t\t\tconnection.setRequestMethod(http_method);\n\n\t\t\tif (headers != null && !headers.isEmpty()) {\n\t\t\t\tIterator t = headers.entrySet().iterator();\n\n\t\t\t\twhile (t.hasNext()) {\n\t\t\t\t\tMap.Entry entry = (Map.Entry<String, String>) t.next();\n\t\t\t\t\tconnection.setRequestProperty((String) entry.getKey(),\n\t\t\t\t\t\t\t(String) entry.getValue());\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconnection.setDoOutput(true);\n\n\t\t\tif (entity != null) {\n\n\t\t\t\ttry (OutputStreamWriter out = new OutputStreamWriter(\n\t\t\t\t\t\tconnection.getOutputStream())) {\n\t\t\t\t\tout.write(entity);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfinal InputStream is;\n\t\t\tfinal int responseCode = connection.getResponseCode();\n\t\t\t// connection.disconnect();\n\n\t\t\tif (responseCode != 200 || responseCode != 201) {\n\t\t\t\tis = connection.getErrorStream();\n\t\t\t} else {\n\t\t\t\tis = connection.getInputStream();\n\t\t\t}\n\t\t\tfinal String resp = getResponseMessage(is);\n\t\t\tconnection.disconnect();\n\n\t\t\ttpImpl.setLineStatus(responseCode);\n\t\t\ttpImpl.setMessage(resp);\n\t\t\treturn tpImpl;\n\n\t\t} catch (SocketTimeoutException ex) {\n\t\t\ttpImpl.setLineStatus(444);\n\t\t\ttpImpl.setMessage(ex.getMessage());\n\t\t\treturn tpImpl;\n\t\t} catch (IOException ex) {\n\t\t\treturn null;\n\t\t}\n\n\t}",
"public String getTransportProtocolProperty() {\n\n return EmailConnectionConstants.PROPERTY_TRANSPORT_NAME;\n }",
"public void setTransports(Transports transports);",
"protected void sendViaUnderlyingTransport(final String message){\n log.debug(\"Message to send {}\", message);\n\n Message.creator(phoneReceiver, phoneSender, message)\n .create();\n }"
] | [
"0.6513468",
"0.64319223",
"0.638205",
"0.6325093",
"0.6215903",
"0.6088502",
"0.6025137",
"0.6016085",
"0.6003794",
"0.5889928",
"0.588659",
"0.5858423",
"0.5827232",
"0.58151615",
"0.5754925",
"0.5731432",
"0.5691988",
"0.56661856",
"0.56570476",
"0.5591769",
"0.5570037",
"0.5554985",
"0.5524703",
"0.55237114",
"0.5522464",
"0.5521701",
"0.55126935",
"0.5473289",
"0.5471794",
"0.5471341",
"0.54641324",
"0.54548746",
"0.54416245",
"0.543523",
"0.54332167",
"0.5431565",
"0.5425945",
"0.54202133",
"0.5415312",
"0.54118055",
"0.53847927",
"0.53555256",
"0.534479",
"0.53404194",
"0.53360814",
"0.53055924",
"0.5290757",
"0.52864003",
"0.5285673",
"0.52795786",
"0.5261041",
"0.52607673",
"0.52581966",
"0.52574205",
"0.525271",
"0.5251951",
"0.5249833",
"0.52424186",
"0.52424186",
"0.52392894",
"0.52097076",
"0.5199938",
"0.51913",
"0.5182054",
"0.5177261",
"0.5174358",
"0.516668",
"0.5146159",
"0.51415384",
"0.51282364",
"0.51179653",
"0.511153",
"0.50730526",
"0.50730526",
"0.5060283",
"0.5048727",
"0.50433856",
"0.5038172",
"0.503729",
"0.5036358",
"0.50335395",
"0.502064",
"0.5020456",
"0.5017554",
"0.5003995",
"0.49992982",
"0.4991853",
"0.49782214",
"0.49749976",
"0.49716258",
"0.49669293",
"0.49668968",
"0.4961151",
"0.49520764",
"0.49502695",
"0.49492317",
"0.49420458",
"0.49410927",
"0.4928078",
"0.49247968"
] | 0.51987076 | 62 |
Class Constructor that takes in a type player as a parameter | public RandomEventText(Player player) {
Player playerDummy = new Player(player);
setPlayer(playerDummy);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Player(String type){\n \n this.type = type;\n }",
"public Player(){}",
"public Player(){}",
"public Player() {}",
"public Player() {}",
"public Player() {}",
"public Player() {}",
"public Player(){\n\n }",
"public Player(){\r\n\r\n }",
"public Player() {\t\n\t}",
"public GamePlayer() {}",
"void createPlayer(Player player);",
"Player(String playerName) {\n this.playerName = playerName;\n }",
"public Player() {\n this(\"\", \"\", \"\");\n }",
"public AbstractPlayer() {\r\n }",
"public Player(Game game){\r\n this.game = game;\r\n }",
"Player createPlayer();",
"public computerPlayer(Player player) {\n\t\tsuper(player);\n\t\t\n\t}",
"public Player(){\n default_init();\n }",
"public TestPlayer()\n {\n }",
"public Player(int type, int id, Scanner inputScanner){\t\t\n\t\t// Check for legal player type (we will see better ways to do this in the future).\n\t\tif (type != RANDOM && type != HEURISTIC \n\t\t\t\t&& type != SMART && type != HUMAN){\n\t\t\tSystem.out.println(\"Received an unknown player type as a parameter\"\n\t\t\t\t\t+ \" in Player constructor. Terminating.\");\n\t\t\tSystem.exit(-1);\n\t\t}\t\t\n\t\tplayerType = type;\t\n\t\tplayerId = id;\n\t\tscanner = inputScanner;\n\t}",
"public Player(Othello othello, char player) {\n\t\tthis.othello=othello;\n\t\tthis.player=player;\n\t\tthis.type = null;\n\t}",
"public Multi_Player()\r\n {\r\n \r\n }",
"public Player(String name) {\r\n this.name = name;\r\n }",
"public Player(String username)\n\t{\n\t\tm_username = username;\n\t\tm_requests = new HashMap<String, RequestType>();\n\t}",
"public Player(String name) {\r\n this.name = name;\r\n// Maxnum = 0;\r\n special = 0;\r\n index = 0;\r\n }",
"public Player(String s) //only constructor\n {\n \tsuper(s,1,false);\n \tposition=-1;\n \tship=false;\n \tSetHealth();\n \tSetWealth();\n }",
"public Player(int i){\r\n playerID=i;\r\n }",
"public Player(String inName)\n {\n // initialise instance variables\n mName = inName;\n mBrokenRules = new RuleBook();\n }",
"public Game()//Method was given\n {\n parser = new Parser();\n player = new Player();\n }",
"public Player(){\r\n\t\tname = \"\";\r\n\t\tchip = 0;\r\n\t\tbet = 0;\r\n\t\tplayerHand = new PlayerHand();\r\n\t\ttable = null;\r\n\t}",
"public StudentPlayer() {\n super(\"260740998\");\n }",
"public Player(String name) {\n this(name, null);\n }",
"public HexComputerPlayer1(String name) {\n // invoke superclass constructor\n super(name); // invoke superclass constructor\n }",
"public StudentPlayer() {\n super(\"260719721\");\n }",
"public HumanPlayer(String name) {\n super(name);\n }",
"public StudentPlayer() {\n super(\"260622641\");\n }",
"public Player(String name) {\n this.NAME = name;\n this.ownedCountries = new ArrayList<>();\n this.totArmyCount = 0;\n this.PlayerTurn = false;\n }",
"public Player(String name)\n\t{\n\t\tthis.name = name;\n\t}",
"public Pawn(String player){\r\n this.player=player;\r\n\r\n }",
"public Player(int type, int playerNum, int color, int startField, int AI)\n {\n this.type = type;\n this.playerNum = playerNum;\n this.color = color;\n this.startField = startField;\n this.AI = AI;\n }",
"public DefensivePlayers(){}",
"public Player(String name)\n {\n // initialise instance variables\n this.name = name;\n // start out with $100 in your wallet\n wallet = new Wallet(100);\n inventory = new HashMap<String, Item>();\n currentRoom = null;\n olcc = new OLCC();\n\n }",
"public Player2(){\n super();\n name=\"110\";\n }",
"public Player_ex1(String playerName){\n this.name = playerName;\n winner = false;\n }",
"Player(String name, int playerNumber, int age, int salary, PlayerStat playerStats) {\n this.name = name; \n this.playerNumber = playerNumber;\n this.age = age;\n this.salary = salary; \n this.playerStats = playerStats;\n\n this.playerRating = -1; //sets the rating as a clear wrong value\n }",
"Player(String name){\n\t\tthis.name = name;\n\t}",
"public PlayerMatches(String player1) {\n this.player1 = player1;\n }",
"public Player(String nickname, String color) {\n //Creating objects\n this.nickname = nickname;\n this.resources = new Assets();\n this.strengths = new Strengths();\n this.leaderCards = new ArrayList<>();\n this.familyMembers = new ArrayList<>();\n this.pickDiscounts = new HashMap<>();\n this.diceOverride = new HashMap<>();\n this.defaultHarvestBonus = new Assets();\n this.defaultProductionBonus = new Assets();\n this.color = color;\n this.cards = new HashMap<>();\n DEFAULT_TOWERS_COLORS.forEach(towerColor -> this.pickDiscounts.put(towerColor, new Assets()));\n pickDiscounts.put(BLACK_COLOR, new Assets());\n getLog().log(Level.INFO, \"New empty player %s created.\", nickname);\n }",
"public ComputerPlayer(Board board) \n {\n this.board = board;\n }",
"public Command(int Player) {\r\n\t\tmyPlayer = Player;\r\n\t}",
"public StudentPlayer() {\r\n super(\"260767897\");\r\n }",
"public Player() {\n hand = new Hand();\n }",
"public UserPlayer(){\n this.playerNum = 0;\n this.isLead = false;\n this.playerHand = new Hand();\n this.suitUserChose = null;\n }",
"public Skill(Player player){\n this.player = player;\n this.name = player.name;\n this.intellect = player.intellect;\n this.defense = player.defense;\n this.attack = player.attack;\n this.weapon = player.weapon;\n this.armor = player.armor;\n this.defense = player.defense;\n\n }",
"public Player2(State state){\n super(state);\n name=\"110\";\n }",
"public Player (Deck mainDeck) {\n this.mainDeck = mainDeck;\n }",
"public Player()\n\t{\n\t\tmyName = DEFAULT_NAME;\n\t\tmyHand = new PokerHand(5);\n\t\tmyNumberWins = 0;\n\t\tmyAmAI = false;\n\t}",
"public Player(String name)\n {\n this.name = name;\n cash = 0;\n }",
"public Player()\r\n\t{\r\n\t\tscore = 0;\r\n\t\tsetPlayerName();\r\n\t}",
"public SoccerPlayer(String name, String position, TeamDB team){\n\n// Random num = new Random();\n// int randInt1;\n// int randInt2;\n// int randInt3;\n// int randInt4;\n//\n// randInt1 = num.nextInt(10); //fix for height and weight.\n// randInt2 = num.nextInt(190);\n// randInt3 = num.nextInt(300);\n// randInt4 = num.nextInt(10);\n\n playerName = name;\n playerPosition = position;\n playerTeam = new TeamDB(\"\");\n// playerUniform = randInt1;\n// playerHeight = randInt2;\n// playerWeight = randInt3;\n// playerGoals = randInt4;\n }",
"public RandomPlayer() {\n\t\tsuper(\"Random\");\n\t}",
"public Player(int balance){\n this.hand = new Hand();\n this.balance = balance;\n this.scoreboard = new Scoreboard(balance);\n }",
"public Player(String name)\n\t{\n\t\tthis.money = START_MONEY;\n\t\tthis.name = name;\n\t}",
"Player() {\r\n setPlayerType(\"HUMAN\");\r\n\t}",
"public Prayer(Player player) {\n this.player = player;\n }",
"public Game(){\n player = new Player(createRooms());\n parser = new Parser(); \n }",
"public Player(double money)\n {\n spendingMoney = money;\n }",
"public Pawn(Player player) {\n super(player);\n }",
"public PlayableGame() {\r\n\r\n }",
"public Player(String name) {\n this.name = name;\n this.points = 0;\n }",
"public Player(String name) {\n setName(name);\n setId(++idCounter);\n setHealthPoints(100);\n setYourTurn(false);\n }",
"public Vitality(Player player)\n\t{\n\t\t_player = player;\n\t}",
"public Player(){\n reset();\n }",
"public Player(String Name)\n {\n // initialise instance variables\n score = 0;\n energy = 100;\n this.name = Name;\n items = new ArrayList<>();\n }",
"public Player(Player p){\n this.dead = p.dead;\n this.hiddenTreasures = p.hiddenTreasures;\n this.level = p.level;\n this.name = p.name;\n this.pendingBadConsequence = p.pendingBadConsequence;\n this.visibleTreasures = p.visibleTreasures;\n }",
"Player(String name, int health)\r\n {\r\n this.name = name;\r\n this.health = health;\r\n }",
"public Player(Position position) {\n this.position = position;\n this.image = new Image(\"O\");\n }",
"public Player(String nickname) {\n this(nickname, -1, -1);\n }",
"public HumanPlayer(Scanner scanner) {\n this.scanner = scanner;\n }",
"public Player1() {\n dbg = new DBG(DBG.PLAYERS, \"Player1\");\n }",
"public Player(String name) {\n this.name = name;\n this.badges = new LinkedList<>();\n }",
"public Player(Player p)\r\n {\r\n this(p.isCompletingGame, p.averageTime, p.fastestTime, p.gamesCompleted, p.rank, p.title, p.username);\r\n }",
"public PlayerFighter create(GamePlayer player);",
"public Player(World world) {\n\n super(world, playerShape);\n addImage(idleImage);\n score = 0;\n lives = 3;\n\n }",
"static Player createNewPlayer(String className, Color color) throws IllegalArgumentException {\n switch (className) {\n case \"PlayerKI\":\n return new PlayerKI(color);\n case \"PlayerKI2\":\n return new PlayerKI2(color);\n case \"PlayerKI3\":\n return new PlayerKI3(color);\n case \"PlayerKI4\":\n return new PlayerKI4(color);\n case \"PlayerHuman\":\n return new PlayerPhysical(color);\n default:\n throw new IllegalArgumentException(\"createNewPlayer in Player.java doesn't know how to handle this!\");\n }\n }",
"public FootballPlayerV3()\n {\n }",
"public Weapon (Player player) {\n\t\tthis.player = player;\n\t}",
"public Player(Playground_Registration pgr) {\n this.pgr = pgr;\n pgr.setPName(\"barca\");\n System.out.println(pgr.getPName());\n pgr.setLocation(\"naser city\");\n System.out.println(pgr.getLocation());\n pgr.setSize(5);\n System.out.println(pgr.getSize());\n pgr.setAvailable_Hour(3);\n System.out.println(pgr.getAvailable_Hour());\n pgr.setPrice_Of_hour(120);\n System.out.println(pgr.getPrice_Of_hour());\n pgr.setPlayground_Status(\"available\");\n System.out.println(pgr.getPlayground_Status());\n pgr.setCancelation_Perioud(\"\");\n System.out.println(pgr.getCancelation_Perioud());\n System.out.println(\"i want to book this play ground\");\n\n }",
"public Player(String name) {\n this.name = name;\n gameDeck = new Deck(false);\n wonDeck = new Deck(false);\n }",
"public interface PlayerCreator {\n\n // Factory method for creating a player\n public PlayerHandler create(String type, PlayerInfo playerInfo, List<Integer> otherPlayerIds);\n \n public List<String> getPlayerTypes();\n}",
"PlayerBean create(String name);",
"public Championship() {\n }",
"public ComputerPlayer()\r\n {\r\n x = 0;\r\n }",
"public Player(Keyboard input) {\n\t\tthis.input = input;\n\t}",
"Player attackingPlayer(int age, int overall, int potential) {\r\n Player newPlayer = new Player(this.nameGenerator.generateName(), age, overall, potential, 'C' , 'F');\r\n\r\n\r\n\r\n\r\n }",
"Player(String name, Board myBoard, Board opponentsBoard) {\n this.name = name;\n this.myBoard = myBoard;\n this.opponentsBoard = opponentsBoard;\n }",
"public Player() {\n\n\t\tnumberOfPlayers++;\n\t\tthis.playerNumber = \"Player \" + numberOfPlayers; \n\t\tthis.balance = 500.00; \n\t\tthis.numberOfLoans = 0;\n\t\tthis.score = 0;\n\t\tthis.inRound = true; \n\t}",
"public LabyrinthComputerPlayer2(String name) {\n // invoke superclass constructor\n super(name);\n }",
"public Player(Level l, Tile t)\n {\n \tstartTile = t;\n \tsetLevel(l);\n setUpStartPosition();\n \n System.out.println(\"----------> new Player\");\n \n if(!setUp)\n { \n initAnim(); \n setUpCollisionBox();\n initBow();\n setUpPlayerSpeed();\n setUp = true;\n }\n }",
"public Player(String name){\r\n\t\tthis.name = name;\r\n\t\tDie die = new Die();\r\n\t\tthis.die = die;\r\n\t}"
] | [
"0.8068214",
"0.7959888",
"0.7959888",
"0.7889386",
"0.7889386",
"0.7889386",
"0.7889386",
"0.7841071",
"0.7832741",
"0.76100755",
"0.7500694",
"0.7495886",
"0.7483278",
"0.7465366",
"0.7310002",
"0.7309311",
"0.72850704",
"0.7282952",
"0.72402585",
"0.7235122",
"0.7159222",
"0.71162057",
"0.7106752",
"0.70825785",
"0.7073071",
"0.7041924",
"0.7018",
"0.6996296",
"0.6993937",
"0.6988698",
"0.69884163",
"0.6976285",
"0.6974466",
"0.69646156",
"0.695935",
"0.69561774",
"0.6944153",
"0.6932983",
"0.6924585",
"0.6906151",
"0.69057727",
"0.6898391",
"0.6884597",
"0.68818355",
"0.6865719",
"0.6858091",
"0.68577874",
"0.6857342",
"0.68564427",
"0.6850155",
"0.6839912",
"0.68375427",
"0.6831591",
"0.682577",
"0.6817959",
"0.68159455",
"0.6810626",
"0.67786735",
"0.6771869",
"0.6766171",
"0.6760564",
"0.6742582",
"0.67392725",
"0.67374074",
"0.67371297",
"0.67339367",
"0.6732904",
"0.6722959",
"0.671071",
"0.67043376",
"0.6676097",
"0.6666016",
"0.66639197",
"0.66570866",
"0.66546875",
"0.6651136",
"0.6649302",
"0.6637748",
"0.66256905",
"0.66249037",
"0.66134626",
"0.6612882",
"0.6610215",
"0.6605451",
"0.6600085",
"0.6599217",
"0.6587022",
"0.65811026",
"0.6563214",
"0.6553072",
"0.65510124",
"0.65499747",
"0.6540398",
"0.6536032",
"0.6535009",
"0.6532804",
"0.65200824",
"0.6519579",
"0.65173984",
"0.6513808",
"0.64984554"
] | 0.0 | -1 |
Picks a random number and based off that number the player is put into a random event The random event can be anything from ship repair to paying bribes to the enemy fleet | public void randomEvent(){
/*Pick a random number dictating the events that could happen.
* 1: New gun for player
* 2: Paying Liu Yuen
* 3: Repairing the Ship
*/
RandomEventLogic randomEventLogic = new RandomEventLogic(getPlayer());
int[] randEvent = randomEventLogic.randEvent();
int eventNumber = randEvent[0];
int itemPrice = randEvent[1];
if(eventNumber == 1){
System.out.println("\nA vendor is selling a gun for $" + itemPrice + " for a gun?");
}
if(eventNumber == 2){
System.out.println("\nLiu Yuen asks $" + itemPrice + " in donation to the temple of Tin Hau, the Sea Goddess");
}
if(eventNumber == 3){
System.out.println("\nMc Henry from the Hong Kong shipyard has arrived,\nwould be willing to repair your ship for $" + itemPrice);
}
//Only runs if the player doesn't have enough space and is given a gun
if((eventNumber == 1 && getCargoSpace() < 10)){
TaipanShopText taipanShopText = new TaipanShopText(getPlayer());
taipanShopText.shop();
}
//Only runs if the player has 100 or greater HP and they got the ship repair man
if((eventNumber == 3 && getPlayer().getHP() >= 100)){
TaipanShopText taipanShopText = new TaipanShopText(getPlayer());
taipanShopText.shop();
}
//Runs for as long as the player doesn't decide if they want to pay
while(true){
System.out.println("Would you like to pay? (Y)es or (N)o");
Scanner keyboard = new Scanner(System.in);
String input = keyboard.next();
if (input.equalsIgnoreCase("Y") && getPlayer().getMoney() > itemPrice) {
//Buy Guns
if (eventNumber == 1 && (getCargoSpace() >= 10)) {
setGuns(getPlayer().getGuns() + 1);
setMoney(getPlayer().getMoney() - itemPrice);
TaipanShopText taipanShopText = new TaipanShopText(getPlayer());
taipanShopText.shop();
}
//Liu Yuen
if (eventNumber == 2) {
setAttackingShips(false);
setMoney(getPlayer().getMoney() - itemPrice);
TaipanShopText taipanShopText = new TaipanShopText(getPlayer());
taipanShopText.shop();
}
//Ship Repair
if (eventNumber == 3 && getPlayer().getHP() != 100) {
setHP(100);
setMoney(getPlayer().getMoney() - itemPrice);
TaipanShopText taipanShopText = new TaipanShopText(getPlayer());
taipanShopText.shop();
}
}
else {
System.out.println("Sorry you don't have enough money");
}
//If the player decides to leave then it will send them back to TaipanShop
if(input.equalsIgnoreCase("N")){
System.out.println("Aye aye Taipan, we'll send them off!\n");
TaipanShopText taipanShopText = new TaipanShopText(getPlayer());
taipanShopText.shop();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int generateEvent(){\r\n\t\tif (Event()){\r\n\t\t\treturn random.nextInt(12);\r\n\t\t} else {\r\n\t\t\treturn 4;\r\n\t\t}\r\n\t}",
"public void generateRandomEvents();",
"public static int getRandomEventChance() {\r\n\t\treturn 10; // 1-in\r\n\t}",
"@Override\n\tpublic void meetRandomEvent(String event) {\n\t\tSystem.out.println(\"You meet \" + event + \"!\");\n\t\tif(event == \"PIRATE\") \n\t\t{\n\t\t\tSystem.out.println(\"You meet a pirates, you should play number games to against pirates\");\n\t\t\tgame.meetPirate();\n\t\t}\n\t\telse if (event == \"UNFORTUNATE WEATHER\"){\n\t\t\tint damage = game.meetUnfortunateWeather();\n\t\t\tSystem.out.println(\"Your ship's health has been reduced by \" + damage + \" because you just meet unfortunate weather\");\n\t\t\tgame.backToMain();\n\t\t}\n\t\telse {\n\t\t\tint reward = game.meetSailorToRescue();\n\t\t\tSystem.out.println(\"Your have been rewarded by sailors you rescued, they gave you \" + reward + \" coin\");\n\t\t\tgame.backToMain();\n\t\t}\n\t}",
"private String randomEventSimulator(Player player) {\r\n\t\tdouble eventRoll = rand.nextDouble();\r\n\t\tif (player.hasLowestScore()) {\r\n\t\t\tif (eventRoll <= 0.27) {\r\n\t\t\t\treturn goodEventHelper(player);\r\n\t\t\t} else {\r\n\t\t\t\treturn \"No event happened.\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\tint cost = RANDOMEVENTPRICEMODIFIER[data.getRoundNum()];\r\n\t\t\tint playerMoney = player.getMoney();\r\n\t\t\t\r\n\t\t\tif (eventRoll <= 0.154) {\r\n\t\t\t\treturn goodEventHelper(player);\r\n\t\t\t} else if (eventRoll <= 0.193) {\t\r\n\t\t\t\tcost *= 4;\r\n\t\t\t\tif (playerMoney < cost) {\r\n\t\t\t\t\tplayer.deductMoney(playerMoney);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tplayer.deductMoney(cost);\r\n\t\t\t\t}\r\n\t\t\t\treturn \"FLYING CAT-BUGS ATE THE ROOF OFF YOUR HOUSE. REPAIRS COST \" + cost + \".\";\r\n\t\t\t} else if (eventRoll <= 0.231) {\r\n\t\t\t\tcost *= 6;\r\n\t\t\t\tif (playerMoney < cost) {\r\n\t\t\t\t\tplayer.deductMoney(playerMoney);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tplayer.deductMoney(cost);\r\n\t\t\t\t}\r\n\t\t\t\treturn \"YOUR SPACE GYPSY INLAWS MADE A MESS OF THE TOWN. IT COST YOU \" + cost \r\n\t\t\t\t\t\t+ \" TO CLEAN IT UP.\";\r\n\t\t\t} else if (eventRoll <= 0.27) {\r\n\t\t\t\tint playerFoodAmount = player.getResourceAmount(ResourceType.FOOD);\r\n\t\t\t\tplayer.removeResources(ResourceType.FOOD, playerFoodAmount/2);\r\n\t\t\t\treturn \"MISCHIEVOUS UGA STUDENTS BROKE INTO YOUR STORAGE SHED AND STOLE HALF YOUR \"\r\n\t\t\t\t\t\t+ \"FOOD.\";\r\n\t\t\t} else {\r\n\t\t\t\treturn \"No event happened.\";\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void newGame() {\n\t\ttheNumber = (int)(Math.random()* 100 + 1);\r\n\t\t\r\n\t}",
"public static void Random() {\n\t\tRandom ran =new Random();\r\n\t\trandom=ran.nextInt(6)+1;\r\n\t\t//random=1;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tif((ch[who].status)>0) {\r\n\t\t\tch[who].location=(ch[who].location)+random;\r\n\t\t\tch[who].status=(ch[who].status)-1;\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\r\n\t}",
"private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}",
"public static int RandomNum(){\n\n Random random = new Random();\n int ItemPicker = random.nextInt(16);\n return(ItemPicker);\n }",
"public int eDmg(){\r\n eDmg = rand.nextInt(13);\r\n return eDmg;\r\n }",
"@Override\n public Integer pee() {\n return (int) (random() * 8);\n }",
"@Override\n public int attack() {\n return new Random().nextInt(5);\n }",
"public int monsterAttack(){\n Random ran = new Random();\n return ran.nextInt(4);\n }",
"private int random_dragao_fire(Dragao dragao) {\n\t\tint spit = (int)(1 + Math.random()*5);\t\t\n\t\tif (spit == 1) {\n\t\t\tint spitX = (int)(1 + Math.random()*2);\n\t\t\tspitX--;\t\t\t\n\t\t\tint spitY = 0;\n\t\t\tif (spitX != 0) {\n\t\t\t\tspitY = (int)(1 + Math.random()*2);\n\t\t\t\tspitY--;\n\t\t\t}\t\t\t\n\t\t\treturn spit_fire (spitX, spitY, dragao);\n\t\t}\n\t\treturn 0;\n\t}",
"public abstract int getRandomDamage();",
"private int randomNum() {\r\n\t return((int)(Math.random() * 100));\r\n\t }",
"@Override\n public int attack(){\n //create an int list to store the numbers\n int[] arr = {zero, six, ten};\n //get a random index of the list\n int index = getRandom().nextInt(arr.length);\n //return the number on that random index\n int damageVal = arr[index];\n return damageVal;\n }",
"int randInt(int n) {\r\n return _randomSource.nextInt(n);\r\n }",
"private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}",
"private void chance(Player currentPlayer) {\n Random rand = new Random();\n int randomNum = rand.nextInt((3 - 1) + 1) + 1;\n\n if(randomNum == 1){\n convertTextToSpeech(\"Advance to Bond Street\");\n currentPlayer.setCurrentPosition(34);\n }\n if(randomNum == 2){\n convertTextToSpeech(\"Unpaid charges. Go to jail\");\n setJail(currentPlayer);\n }\n if(randomNum == 3){\n convertTextToSpeech(\"Build a rooftop swimming pool on your apartment, pay 300\");\n if(m_manageFunds) {\n currentPlayer.subtractMoney(300);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n m_freeParking += 300;\n Log.d(\"chance subtract 300\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance free parking\", String.valueOf(m_freeParking));\n }\n }\n }",
"int randInt(int n) {\n return _randomSource.nextInt(n);\n }",
"public int randomMove()\r\n {\r\n r = new Random();\r\n x = r.nextInt(7);\r\n return x;\r\n }",
"private void setRand(){\n rand = generator.nextInt(9) + 1;\n }",
"private void random() {\n\n\t}",
"private void enemy_choose_player(){\n\t\tint i;\n\t\tRandom r_gen = new Random();\n\t\tfor(i=0;i<enemy_num;i++){\n\t\t\tenemy[i][2] = r_gen.nextInt(player_num);\n\t\t}\n\t}",
"void random_alien_fires() {\n Random rand = new Random();\n int alien_index = rand.nextInt(aliens.size());\n alien_shoot_missile(aliens.get(alien_index));\n }",
"@Override\n public void run() {\n if (random.nextInt(10) == 0)\n addPowerUp(random.nextInt(256));\n }",
"public static void generateSeedData()\n\t{\n\t\teventIDCounter = 1; //set counter for ID of events to 1\n\t\t\n\t\t// generate the grid world\n\t\tfor(int i = 0; i <= (MAX_COORDS*2); i++)\n\t\t{\n\t\t\tfor(int j = 0; j <= (MAX_COORDS*2); j++)\n\t\t\t{\n\t\t\t\tgridWorld[i][j] = new Coordinate(i-MAX_COORDS,j-MAX_COORDS);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Assumption that there will be 1 event to every 10 coordinates\n\t\t// grid of 21*21=441, 441/10=44\n\t\tint numOfEvents = ((MAX_COORDS*2)+1)*((MAX_COORDS*2)+1)/10;\n\t\tEvent newEvent;\n\t\tint newXCoord;\n\t\tint newYCoord;\n\t\tTicket ticket;\n\t\tArrayList<Ticket> tickets;\n\t\t\n\t\tfor(int i = 1; i <= numOfEvents; i++)\n\t\t{\n\t\t\t// create random coordinates for new event\n\t\t\tnewXCoord = rand.nextInt(MAX_COORDS + 1 +MAX_COORDS) -MAX_COORDS;\n\t\t\tnewYCoord = rand.nextInt(MAX_COORDS + 1 +MAX_COORDS) -MAX_COORDS;\n\t\t\t\n\t\t\tnewEvent = new Event(i, gridWorld[newXCoord+MAX_COORDS][newYCoord+MAX_COORDS], \"Event \"+String.format(\"%03d\", i)); \n\t\t\t\n\t\t\t//create a random number of tickets between 0 and 5\n\t\t\ttickets = new ArrayList<Ticket>(); // clear all tickets in the arraylist\n\t\t\tfor(int j = 0; j < 4; j++)\n\t\t\t{\n\t\t\t\tint num = rand.nextInt(5000 - 1000) +1000; // create price in cents, from $10 to $50 \n\t\t\t\tdouble price = num/100.0; // convert to double\n\t\t\t\tticket = new BasicTicket((new BigDecimal(price)).setScale(2, RoundingMode.CEILING));\n\t\t\t\ttickets.add(ticket);\n\t\t\t}\n\t\t\tnewEvent.setTickets(tickets);\n\t\t\t\t\n\t\t\t// set the grid coordinate to have this event\n\t\t\tgridWorld[newXCoord+MAX_COORDS][newYCoord+MAX_COORDS].setEvent(newEvent);\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// Add a couple of events hard coded first for testing\n\t\t/*Event newEvent1 = new Event(gridWorld[18][20], \"Event 001\"); //distance of 18 from 0,0\n\t\tgridWorld[18][20].setEvent(newEvent1);\n\t\t\n\t\tEvent newEvent2 = new Event(gridWorld[9][10], \"Event 002\"); //distance of 1 from 0,0\n\t\tgridWorld[9][10].setEvent(newEvent2);\n\t\t\n\t\tEvent newEvent3 = new Event(gridWorld[8][5], \"Event 003\"); //distance of 7 from 0,0\n\t\tgridWorld[8][5].setEvent(newEvent3);\n\t\t\n\t\tEvent newEvent4 = new Event(gridWorld[10][14], \"Event 004\"); //distance of 4 from 0,0\n\t\tgridWorld[10][14].setEvent(newEvent4);\n\t\t\n\t\tEvent newEvent5 = new Event(gridWorld[10][11], \"Event 005\"); //distance of 1 from 0,0\n\t\tgridWorld[10][11].setEvent(newEvent5);\n\t\t\n\t\tEvent newEvent6 = new Event(gridWorld[5][10], \"Event 006\"); //distance of 5 from 0,0\n\t\tgridWorld[5][10].setEvent(newEvent6);\n\t\t\n\t\tEvent newEvent7 = new Event(gridWorld[11][12], \"Event 007\"); //distance of 3 from 0,0\n\t\tgridWorld[11][12].setEvent(newEvent7);\n\t\t\n\t\tEvent newEvent8 = new Event(gridWorld[0][0], \"Event 008\"); //distance of 20 from 0,0\n\t\tgridWorld[0][0].setEvent(newEvent8);*/\n\t\t\n\t\t\n\t\t\n\t}",
"public int decideRandomMove() {\n return (int) (Math.random() * 4);\n }",
"private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }",
"private void randomEventPhase() {\n ClickObserver.getInstance().setTerrainFlag(\"RandomEvents\");\n ArrayList<Piece> randomEvents = new ArrayList<Piece>();\n\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Game.getHelpText().setText(\"Random Event Phase. Players may now play 1 Random Event from their racks.\");\n }\n });\n\n try { Thread.sleep(2000); } catch(Exception e) { return; }\n\n for (Player p : playerList) {\n player = p;\n doneClicked = false;\n ClickObserver.getInstance().setActivePlayer(player);\n\n pause();\n\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n TheCupGUI.update();\n Game.getRackGui().setOwner(player);\n }\n });\n\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Game.getHelpText().setText(player.getName() + \", you may now play one of your Random Events.\");\n }\n });\n\n while (isPaused) {\n while (!doneClicked) {\n if (randomEventFlag) {\n System.out.println(randomEvent.getName());\n ((RandomEvent)randomEvent).performAbility();\n break;\n }\n \n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n randomEventFlag = false;\n randomEvent = null;\n }\n ClickObserver.getInstance().setTerrainFlag(\"\"); \n }",
"private void random() {\n GameState gs = cc.getGameState();\n ArrayList<int[]> moves = cc.getPlayerMoves(player);\n ArrayList<GameState> states = nextStates(moves, gs);\n for (int[] m : moves) {\n GameState next = checkMove(m, cc);\n states.add(next);\n }\n Random rand = new Random(System.nanoTime());\n int i = rand.nextInt(states.size());\n cc.setAIMove(states.get(i));\n }",
"public int rollResult(){\r\n return rand.nextInt(6) + 1;\r\n }",
"public int NewMonster(){\n int r = (int) (Math.random() * (9 - 2 + 1) + 2);\n return r;\n }",
"public static int getRandomAmount(){\n return rand.nextInt(1000);\n }",
"private void enemyAttack() {\n\t\t\n\t\tRandom rand = new Random();\t\n\t\t\n\t\tint roll = rand.nextInt(101);\n\t\t\n\t\tint sroll = rand.nextInt(101);\n\t\t\n\t\tevents.appendText(e.getName() + \" attacks!\\n\");\n\t\t\n\t\tif(roll <= p.getEV()) { // Player evades\n\t\t\t\n\t\t\tevents.appendText(\"You evaded \"+e.getName()+\"\\'s Attack!\\n\");\n\t\t\t\n\t\t}else if(roll > p.getEV()) { // Player is hit and dies if HP is 0 or less\n\t\t\t\n\t\t\tp.setHP(p.getHP() - e.getDMG());\n\t\t\t\n\t\t\tString newHp = p.getHP()+\"/\"+p.getMaxHP();\n\t\t\t\n\t\t\tString effect = e.getSpecial(); // Stats are afflicted\n\t\t\t\n\t\t\tif(sroll < 51){\n\t\t\t\t\n\t\t\tif(effect == \"Bleed\") { // Bleed Special\n\t\t\t\t\n\t\t\t\tp.setHP(p.getHP() - 100);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"You bleed profusely. - 100 HP\\n\");\n\t\t\t\t\n\t\t\t\tnewHp = String.valueOf(p.getHP()+\"/\"+p.getMaxHP());\n\t\t\t}\n\t\t\tif(effect == \"Break\") { // Break Special \n\t\t\t\t\n\t\t\t\tif(p.getEV()-5>0)\n\t\t\t\t\tp.setEV(p.getEV() - 5);\n\t\t\t\telse\n\t\t\t\t\tp.setEV(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"You feel a bone break restricting movement. - 5 EV\\n\");\n\t\t\t\t\n\t\t\t\tString newEV = String.valueOf(p.getEV());\n\t\t\t\t\n\t\t\t\tgev.setText(newEV);\n\t\t\t\t\n\t\t\t}\n\t\t\tif(effect == \"Fear\") { // Fear Special \n\t\t\t\t\n\t\t\t\tif(p.getDMG()-40>0)\n\t\t\t\t\tp.setDMG(p.getDMG() - 40);\n\t\t\t\telse\n\t\t\t\t\tp.setDMG(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"A crippling fear rattles your resolve. - 40 DMG\\n\");\n\t\t\t\t\n\t\t\t\tString newDMG = String.valueOf(p.getDMG());\n\t\t\t\t\n\t\t\t\tgdmg.setText(newDMG);\n\t\t\t\t\n\t\t\t}\n\t\t\tif(effect == \"Rend\") { // Rend Special \n\t\t\t\t\n\t\t\t\tif(p.getDMG()-30>0)\n\t\t\t\t\tp.setDMG(p.getDMG() - 30);\n\t\t\t\telse\n\t\t\t\t\tp.setDMG(0);\n\t\t\t\t\n\t\t\t\tif(p.getEV()-5>0)\n\t\t\t\t\tp.setEV(p.getEV() - 5);\n\t\t\t\telse\n\t\t\t\t\tp.setEV(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"Morthar unleashes a pillar of flame! - 30 DMG and - 5 EV\\n\");\n\t\t\t\t\n\t\t\t\tString newDMG = String.valueOf(p.getDMG());\n\t\t\t\t\n\t\t\t\tString newEV = String.valueOf(p.getEV());\n\t\t\t\t\n\t\t\t\tgdmg.setText(newDMG);\n\t\t\t\t\n\t\t\t\tgev.setText(newEV);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\n\t\t\tif(p.getHP() <= 0) {\n\t\t\t\t\n\t\t\t\tp.setDead(true);\n\t\t\t\t\n\t\t\t\tcurrentHp.setText(0+\"/\"+e.getMaxHP());\n\t\t\t\tplayerHPBar.setProgress((double)0);\n\t\t\t}else {\n\t\t\t\t\n\t\t\t\tcurrentHp.setText(newHp);\n\t\t\t\tplayerHPBar.setProgress((double)p.getHP()/p.getMaxHP());\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(p.isDead()) { // Game over if player dies\n\t\t\t\n\t\t\ttry {\n\t\t\t\tLoadGO();\n\t\t\t} catch (IOException e1) {\n\t\t\t\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tcombat = false;\n\t\t}\n\t}",
"public int getRandomsNumber(){\n Random random = new Random();\n int number = random.nextInt(12) + 1;\n return number;\n }",
"@Override\npublic void actionPerformed(ActionEvent e) {\n\t\tint rand = new Random().nextInt(4);\n\tif (rand == 0) {\n\t\tJOptionPane.showMessageDialog(null, \"The early bird get the worm\");\n\t}if (rand == 1) {\n\t\tJOptionPane.showMessageDialog(null, \"The start of riches shine upon you\");\n\t}if (rand == 2) {\n\t\tJOptionPane.showMessageDialog(null, \"Ignore previous fortunes\");\n\t}if (rand == 3) {\n\t\tJOptionPane.showMessageDialog(null, \"You are using a Java Program\");\n\t}if (rand == 4) {\n\t\tJOptionPane.showMessageDialog(null, \"Oscar finnished before you\");\n\t}\n}",
"private String goodEventHelper(Player player) {\r\n\t\tdouble goodEventRoll = rand.nextDouble();\r\n\t\tif (goodEventRoll <= 0.25) {\r\n\t\t\tplayer.addResources(ResourceType.FOOD, 3);\r\n\t\t\tplayer.addResources(ResourceType.ENERGY, 2);\r\n\t\t\treturn \"YOU JUST RECEIVED A PACKAGE FROM THE GT ALUMNI CONTAINING 3 FOOD AND 2 \"\r\n\t\t\t\t\t+ \"ENERGY UNITS.\";\r\n\t\t}\r\n\t\tif (goodEventRoll <= 0.5) {\r\n\t\t\tplayer.addResources(ResourceType.SMITHORE, 2);\r\n\t\t\treturn \"A WANDERING TECH STUDENT REPAID YOUR HOSPITALITY BY LEAVING TWO BARS OF \"\r\n\t\t\t\t\t+ \"ORE.\";\r\n\t\t}\r\n\t\t\r\n\t\tint price = RANDOMEVENTPRICEMODIFIER[data.getRoundNum()];\r\n\t\tif (goodEventRoll <= 0.75) {\r\n\t\t\tprice *= 8;\r\n\t\t\tplayer.addMoney(price);\r\n\t\t\treturn \"THE MUSEUM BOUGHT YOUR ANTIQUE PERSONAL COMPUTER FOR \" + price +\".\";\r\n\t\t} else {\r\n\t\t\tprice *= 2;\r\n\t\t\tplayer.addMoney(price);\r\n\t\t\treturn \"YOU FOUND A DEAD MOOSE RAT AND SOLD THE HIDE FOR \" + price + \".\";\r\n\t\t}\r\n\t}",
"int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }",
"public int generateRandom(Random ran)\n {\n if(nums.size()<=0)\n {\n Log.i(\"test\",\"No Pokemon left\");\n return 0;\n }\n return nums.remove(ran.nextInt(nums.size()));\n }",
"public void roll(){\n currentValue = rand.nextInt(6)+1;\n }",
"private int RandomResourceValue(int playerNumber) {\n\t\tArrayList<Integer> excludedNumbers = new ArrayList<>();\n\t\tfor (int i = 0; i < CurrentPlayer.resources.length; i++) {\n\t\t\tif (robberPlayers.get(playerNumber).resources[i] == 0)\n\t\t\t\texcludedNumbers.add(i);\n\t\t}\n\t\tRandom r = new Random();\n\t\tint randomVariable = 0;\n\t\trandomVariable = r.nextInt(5 - 0) + 0;\n\n\t\tif (excludedNumbers.size() < 5) {\n\t\t\twhile (excludedNumbers.contains(randomVariable)) {\n\t\t\t\trandomVariable = r.nextInt(5 - 0) + 0;\n\t\t\t}\n\t\t}\n\t\treturn randomVariable;\n\t}",
"private int getRandomPiece() {\r\n return new Random().nextInt(Constants.NUM_PIECES);\r\n }",
"private void eating(){\n int sleepTime = (int)(Math.random()*2000);\n try{\n Thread.sleep(sleepTime);\n }catch (InterruptedException e){\n e.printStackTrace();\n }\n }",
"public static void pointEN(int number) {\t\t\r\n\t\tdo {\r\n\t\t\tint dice1 = rand.nextInt(6) + 1;\t\t\t\t\t// ponovno bacanje kockica\r\n\t\t\tint dice2 = rand.nextInt(6) + 1;\r\n\t\t\tSystem.out.printf(\"Dice shows that you rolled %d and %d\\n\", dice1, dice2);\r\n\t\t\tif (dice1 + dice2 == 7) {\t\t\t\t\t\t\t// uslovi koji odredjuju pobjednika\r\n\t\t\t\tSystem.out.println(\"Unfortunately, you lose this one\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (dice1 + dice2 == number) {\r\n\t\t\t\tSystem.out.println(\"Tremendous!! You win!\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\trestartEN();\r\n\t\t} while (true);\r\n\t}",
"private static int getRandomNumberOfRooms(){\r\n return r.nextInt(50)+1;\r\n }",
"public static int getRandomNumber(){\n int random = 0; // set variable to 0\r\n random = (int)(Math.random()*10) + 1; //generate random number between 1 and 10\r\n return random; //return random number\r\n }",
"public void makeRandomMove() {\n\t\ttry{\r\n\t\t\tif (playerId == game.getState().getTurn()){\r\n\t\t\t\tgame.execute(randPlayer.requestAction(game.getState()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalArgumentException e){\r\n\t\t\t\r\n\t\t}\r\n\t}",
"@Override\n public void run() {\n int ran2 = random_number.nextInt(2) + 1;\n if (ran2 == 1) {\n //Play Win Sound\n mpWin.start();\n\n door3button.setImageResource(R.drawable.car);\n door2button.setImageResource(R.drawable.goat);\n door1button.setImageResource(R.drawable.goat);\n\n incrementWinCounter();\n }\n\n // Wrong door was chosen (door 1)\n else {\n //Play Loss Sound\n mpLoss.start();\n\n door3button.setImageResource(R.drawable.goat);\n door2button.setImageResource(R.drawable.goat);\n door1button.setImageResource(R.drawable.car);\n\n incrementLossCounter();\n }\n\n }",
"public void goAdventuring() {\n\n game.createRandomMonster(4);\n if(RandomClass.getRandomTenPercent() == 5) {\n System.out.println(\"Your are walking down the road... Everything looks peaceful and calm.. Hit enter to continue!\");\n sc.nextLine();\n\n } else {\n game.battle();\n p.checkXp();\n }\n }",
"private int randomInteger(int n) {\n return (int) (randGen.random() * (n - 1));\n }",
"public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}",
"private void randomBehavior() {\n\t\trandom = rand.nextInt(50);\n\t\tif (random == 0) {\n\t\t\trandom = rand.nextInt(4);\n\t\t\tswitch (random) {\n\t\t\t\tcase 0:\n\t\t\t\t\tchangeFacing(ACTION.DOWN);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tchangeFacing(ACTION.RIGHT);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tchangeFacing(ACTION.UP);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tchangeFacing(ACTION.LEFT);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"public static int getRandom(int n){\n\t\treturn rg.nextInt(n); \n\t}",
"@Override\r\n\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\tRandNum = (int)(Math.random()*100);\r\n\t\t\tresult.setText(Integer.toString(RandNum));\r\n\t\t}",
"public void generateRandomPosition() {\n\t\tx.set((int)(Math.floor(Math.random()*23+1)));\n\t\ty.set((int)(Math.floor(Math.random()*23+1)));\n\n\t}",
"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 }",
"public static int randomNext() { return 0; }",
"private int randomNumber(int high, int low){\n \t\t Random r = new Random();\n \t\t return (r.nextInt(high-low) + low);\n \t }",
"public int generateRandom() {\n\t\tint random = (int)(Math.random()*((6-1)+1))+1;\n\t\treturn random;\n\t}",
"public int randomNum()\r\n {\r\n Random rand = new Random();\r\n int n = rand.nextInt(52)+1;\r\n return n;\r\n }",
"@Test\n public void spawnPowerUpSelectedEventTest() {\n try {\n PowerUpsDeck powerUpsDeck = new PowerUpsDeck();\n PowerUpCardClient toKeep = new PowerUpCardClient(powerUpsDeck.drawCard());\n PowerUpCardClient spawnCard = new PowerUpCardClient(powerUpsDeck.drawCard());\n SpawnPowerUpSelectedEvent spawnPu = new SpawnPowerUpSelectedEvent(3, \"graz\", toKeep, spawnCard, true);\n try {\n turnController.handleEvent(spawnPu);\n } catch(HandlerNotImplementedException e) {\n e.printStackTrace();\n }\n } catch(URISyntaxException e) {\n e.printStackTrace();\n fail();\n }\n }",
"public void Diceroll()\n\t{\n\t\tdice1 = rand.nextInt(6)+1;\n\t\tdice2 = rand.nextInt(6)+1;\n\t\ttotal = dice1+dice2;\n\t}",
"private int rand() {\n return (int)(Math.random()*(RAND_MAX + 1));\n }",
"@Override\n public String execute(Actor actor, GameMap map) {\n // Set the bound for use in generating a random integer within the range [0-bound)\n // There will be 5 possible integers\n int bound = 5;\n // Pick up fruit by chance\n // To yield 1 or 2 when there are 5 possible integers = 40% chance\n Random random = new Random();\n int number = random.nextInt(bound);\n if (number == 1 || number == 2) {\n String result = \"\\n- Your eco points increases from \" + ((Player) actor).getEcoPoints();\n // Increment eco points of Player\n ((Player) actor).setEcoPoints(((Player) actor).getEcoPoints() + 10);\n result += \" to \" + ((Player) actor).getEcoPoints();\n return super.execute(actor, map) + result;\n }\n return \"You search the tree or bush for fruit, but you can't find any ripe ones\";\n }",
"public static int computerChoice(Random generator){\n int randNumber;\n \n randNumber = generator.nextInt(5);\n return randNumber;\n }",
"public int pickNumber() {\n\t\t\n\t\tint max=10;\n\t\t\n\t\tint i = (int) Math.floor((Math.random()*max)+1);\n\t\treturn i;\n\t\t\n\t}",
"@Test\n public void picksOpponentRandom() throws Exception {\n Map<Integer,Integer> allMovesMade = new HashMap<Integer,Integer>();\n allMovesMade.put(1, 2);\n SmartPlayer x = new SmartPlayer(0,0);\n x.setMovesMadeByOtherPlayers(allMovesMade);\n //suppose this game has 5 total players including the player x\n int opponent = x.picksOpponent(5);\n //the opponent cannot be himself or a player with a player number outside the total number of players in game\n assertTrue(opponent!=0 && opponent<5 && opponent>0);\n }",
"private int generateRandomNumber() {\n\t\treturn (int) Math.floor(Math.random() * Constants.RANDOM_NUMBER_GENERATOR_LIMIT);\n\t}",
"public void roll()\r\n\t{\r\n\t\tthis.value = rnd.nextInt(6) + 1;\r\n\t}",
"private void randomMove() {\n }",
"@Override\r\n\tpublic int attack() {\r\n\t\treturn rnd.nextInt(MAX_MONSTER_ATTACK_DAMAGE);\r\n\t}",
"private void selectRandomPlayer() {\n Random rand = new Random();\n // Restrict random number range to available indexes in the players list.\n // - 1 to offset zero-based index numbering.\n int random = rand.nextInt(players.size());\n activePlayer = players.get(random);\n }",
"public static int generateRandomNumber()\n\t{\n\t\tRandom r = new Random();\n\t\treturn r.nextInt();\n\t}",
"private void roll() {\n value = (int) (Math.random() * MAXVALUE) + 1;\n }",
"@Override\n public int damage(){\n int damage = 0;\n Random rand = new Random();\n int x = rand.nextInt(20) + 1;\n if (x == 1)\n damage = 50;\n return damage; \n }",
"@Override\n public int orinar() {\n\n return (int) (Math.random() * 400) + 400;\n }",
"public static int random(int n)\n {\n int num = (int)(Math.random()*n);\n return num;\n }",
"public int randomNum() {\n\t\treturn 1 + (int) (Math.random() * 3); // randomNum = minimum + (int)(Math.random() * maximum);\n\t}",
"public static int generateRandomWinner(int numberOfTickets) {\n return RandomUtils.nextInt(0, numberOfTickets);\n }",
"public static int randomNumber() {\n //Random rndNumbers = new Random();\n //for(int i = 0; i < 100; i++) {\n // int rndNumber = rndNumbers.nextInt();\n // System.out.println(rndNumber);\n int rand = (int) (Math.random() * 100);\n System.out.println(rand);\n if (rand > 50) {\n return rand;\n } else {\n System.out.println(\"-1\");\n }\n return rand;\n }",
"public int performDuel(){\n Random rand = new Random();\n int intRand;\n intRand = rand(6);\n while(this.engine.getGameInformation().cards[intRand][intRand] == 0 ){\n intRand = rand(6);\n }\n return intRand;\n }",
"public int dmg(){\r\n dmg = rand.nextInt(att);\r\n if(att == 1)\r\n dmg = 1;\r\n return dmg;\r\n }",
"public void rollRandom() {\n\t\tthis.strength = randomWithRange();\r\n\t\tthis.wisdom = randomWithRange();\r\n\t\tthis.dexterity = randomWithRange();\r\n\t\tthis.constitution = randomWithRange();\r\n\t\tthis.intelligence = randomWithRange();\r\n\t\tthis.charisma = randomWithRange();\r\n\t}",
"private void computerTurn() {\r\n\t\tPoint index = randomIndex();\r\n\t\tSETslot((int)index.getX(), (int)index.getY(), randomValue());\r\n\t}",
"public void randomTeleport() {\n Random random = new Random(seed);\n seed = random.nextInt(10000);\n int randomY = RandomUtils.uniform(random, 0, worldHeight);\n int randomX = RandomUtils.uniform(random, 0, worldWidth);\n int randomDirection = RandomUtils.uniform(random, 0, 4);\n move(randomX, randomY);\n turn(randomDirection);\n }",
"private void getRandomNumber() {\n\t\tRandom random = new Random();\n\t\tint randomCount = 255;\n\t\tint randNum = 0; \n\t\tfor(int i = 0; i < numberAmt; i++) {\n\t\t\trandNum = random.nextInt(randomCount);\n\t\t\tswitch (numberType) {\n\t\t\tcase 1:\n\t\t\t\trandomNumbers.add(Integer.toString(randNum));\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif(randNum > 15)\n\t\t\t\t\trandomNumbers.add(String.format(\"%8s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\telse\n\t\t\t\t\trandomNumbers.add(String.format(\"%4s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\trandomNumbers.add(Integer.toHexString(randNum));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"private int randomPiece() {\n return (int)(Math.random()*N_PIECES);\n }",
"public int randomGene();",
"@Override\n\tpublic void randomChanged(boolean random) {\n\t\t\n\t}",
"public int getRandomBreed() {\n Random r = new Random();\n// displayToast(Integer.toString(getRandomBreed())); // not needed. generates another random number\n return r.nextInt(6);\n }",
"int random(int m)\n {\n return (int) (1 + Math.random()%m);\n }",
"private int randomValue() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val = rand.nextInt(10);\r\n\t\tif(val == 9)\r\n\t\t\treturn 4;\r\n\t\telse\r\n\t\t\treturn 2;\r\n\t}",
"@Override\n\tpublic void run() {\n\t\tRandom r = new Random();\n\t\twhile(true) {\n\t\t\t//get a random double number between 0 and 1\n\t\t\tdouble expected_number = r.nextDouble();\n\t\t\t//use the Double class to get the integer part\n\t\t\t//time by 10000 to get the 10000th decimal place \n\t\t\tDouble a = expected_number*10000;\n\t\t\tInteger i = a.intValue();\n\t\t\t//if it is a even number, create the event object and call the listener\n\t\t\tif(i%2 == 0) {\n\t\t\t\tint expected_digit = i%10;\n\t\t\t\tEvent evt = new Event(expected_number,expected_digit);\n\t\t\t\tsynchronized(listeners) {\n\t\t\t\t\tfor(EventListener listener: listeners) {\n\t\t\t\t\t\tlistener.NotifyEvent(evt);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void setWhoGoesFirstRandom() {\n Random ran = new Random();\n int i = ran.nextInt(2) + 1;\n if(i == 1) {\n setWhoGoesFirst(humanPlayer);\n } else {\n setWhoGoesFirst(aiPlayer);\n }\n }",
"@Override\n public void run() {\n int number = random.nextInt(3) + 1;\n if(turn){\n switch(number){\n case 1:\n game_BTN_p1_lightAttack.performClick();\n break;\n case 2:\n game_BTN_p1_strongAttack.performClick();\n break;\n case 3:\n game_BTN_p1_brutalAttack.performClick();\n break;\n }\n //change turn\n turn = false;\n //count how many attacks p1 did\n count[0]++;\n }\n //p2 -> turn\n else{\n switch(number){\n case 1:\n game_BTN_p2_lightAttack.performClick();\n break;\n case 2:\n game_BTN_p2_strongAttack.performClick();\n break;\n case 3:\n game_BTN_p2_brutalAttack.performClick();\n break;\n }\n //change turn\n turn = true;\n //count how many attacks p2 did\n count[1]++;\n //make attack sound. each attack has a different sound\n }\n gameSound(number);\n // continue until the health bar is empty\n if(game_PB_p1HP.getProgress() < GameVariables.MAX_HP && game_PB_p2HP.getProgress() < GameVariables.MAX_HP){\n handlerGame.postDelayed(this, delay);\n //update the game_LBL_attackInfo\n attackInfo(number, !turn);\n\n }\n else{\n //p2 win\n if (turn)\n saveDataAndChangeActivity(count[1]);\n //p1 win\n else\n saveDataAndChangeActivity(count[0]);\n }\n }",
"private int getRandomNumber() {\n int randomInt = 0;\n Random randomGenerator = new Random();\n randomInt = randomGenerator.nextInt(NUM_LIST.length());\n if (randomInt - 1 == -1) {\n return randomInt;\n } else {\n return randomInt - 1;\n }\n }",
"public static void roll() {\n int random = (int) (Math.random() * (roll.size() - 1) + 0); // numbers are indexes not the actual number you will be genrating\n // thoes numbers are in the list.\n // System.out.println(random); // but you want the number NOT THE INDEX!!!\n int number = roll.get(random);\n System.out.println(\"The number generated is: \" + number);\n roll.remove(random);\n called.add(random); // so I can display the number I called\n for (int i = 0; i < card.length; i++) { // rows\n for (int j = 0; j < card[i].length; j++) { //coloums\n if (card[i][j] == number) {\n card[i][j] = 0;\n }\n\n }\n\n }\n }",
"public int attackRoll(){\r\n\t\treturn (int) (Math.random() * 100);\r\n\t}"
] | [
"0.7806984",
"0.716873",
"0.7042364",
"0.69583076",
"0.6834839",
"0.6599836",
"0.65961313",
"0.65947217",
"0.65484977",
"0.6503536",
"0.63984114",
"0.63950956",
"0.6394751",
"0.6387567",
"0.6370945",
"0.6335647",
"0.63175917",
"0.62922454",
"0.624957",
"0.6242994",
"0.6234868",
"0.6219288",
"0.6203382",
"0.61510456",
"0.61465883",
"0.60915613",
"0.60888046",
"0.60766405",
"0.6058354",
"0.6026939",
"0.6020355",
"0.60194856",
"0.5995488",
"0.5993627",
"0.5984526",
"0.59828085",
"0.5970356",
"0.5968585",
"0.59490347",
"0.5943441",
"0.5926145",
"0.5923723",
"0.5912215",
"0.5908132",
"0.5890965",
"0.58844477",
"0.5878165",
"0.58719057",
"0.5868859",
"0.5867826",
"0.58651066",
"0.5856155",
"0.58537954",
"0.58537453",
"0.5851809",
"0.5850548",
"0.5850279",
"0.58449364",
"0.58340204",
"0.58289236",
"0.58287615",
"0.5801538",
"0.5790984",
"0.578523",
"0.5777926",
"0.57769775",
"0.5773667",
"0.5749288",
"0.574152",
"0.57415193",
"0.57414633",
"0.5738698",
"0.5724682",
"0.5722175",
"0.5712487",
"0.57060355",
"0.57058203",
"0.5695389",
"0.56903",
"0.56877685",
"0.568735",
"0.56845665",
"0.5682767",
"0.56652486",
"0.5662688",
"0.56522495",
"0.56505096",
"0.56430906",
"0.5641047",
"0.56406003",
"0.56369305",
"0.5634953",
"0.5630322",
"0.5628882",
"0.56250995",
"0.5621495",
"0.5615813",
"0.5614948",
"0.5611285",
"0.5611232"
] | 0.72023124 | 1 |
Mojang API for accounts. | public Mojang(String email, String password) throws LoginException, IOException {
String payload = String.format("{\"agent\": {\"name\": \"Minecraft\",\"version\": 1},\"username\": \"" + email + "\",\"password\": \"" + password + "\",\"clientToken\": \"" + UUID.randomUUID() + "\"}");
URL authenticationURL = new URL("https://authserver.mojang.com/authenticate");
HttpsURLConnection connection = (HttpsURLConnection)authenticationURL.openConnection();
byte payloadAsBytes[] = payload.getBytes(Charset.forName("UTF-8"));
connection.setConnectTimeout(15000);
connection.setReadTimeout(15000);
connection.setRequestMethod("POST");
connection.setRequestProperty("charset", "UTF-8");
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("Content-Length", Integer.toString(payloadAsBytes.length));
connection.setDoInput(true);
connection.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
wr.write(payloadAsBytes);
wr.flush();
wr.close();
int status = connection.getResponseCode();
Reader streamReader = null;
if (status > 299) {
throw new LoginException("HTTP response code is above 299 (Bad response)");
} else {
streamReader = new InputStreamReader(connection.getInputStream());
}
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(streamReader);
this.accesstoken = obj.get("accessToken").toString();
this.authMode = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@RequestLine(\"GET /accounts\")\n AccountList getAccountsListOfUser();",
"@GET\n @Path(\"accounts/{uid}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response getBankAccounts(@PathParam(\"uid\") \n String uid) {\n \n Account a1 = new Account(1234, 12345678, 123.47, \"Current\", 1, 1);\n Account a2 = new Account(5678, 87654321, 4150.34, \"Savings\", 1, 1);\n \n ArrayList<Account> accounts = new ArrayList<>();\n accounts.add(a1);\n accounts.add(a2);\n \n String output = \"This entry point will return all bank accounts for the user: \" + uid;\n return Response.status(200).entity(gson.toJson(accounts)).build();\n \n }",
"@GET\n @Path(\"bank/account/{account_id}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response getBankAccountDetails(@PathParam(\"account_id\") \n String accountId) {\n \n int id = Integer.parseInt(accountId);\n Account a1 = new Account(1234, 12345678, 123.47, \"Current\", id, 1);\n return Response.status(200).entity(gson.toJson(a1)).build();\n \n }",
"private GetAccount()\r\n/* 19: */ {\r\n/* 20:18 */ super(new APITag[] { APITag.ACCOUNTS }, new String[] { \"account\" });\r\n/* 21: */ }",
"@RequestMapping(\"/accounts\")\n public List<Account> getAllAccounts(){\n return accountService.getAllAccounts();\n }",
"Account getAccount();",
"@GET\n @Path(\"/{accountID}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Account getAccount(@PathParam(\"accountID\") int a_id ) {\n \tSystem.out.println(\"get Account by ID: \"+a_id );\n\treturn AccountService.getAccount(a_id);\n }",
"public interface AccountService {\n @POST(\"authenticate/{provider}\")\n Call<TokenRes> authenticate(@Path(\"provider\") String provider, @Body AuthenticateForm authenticateForm);\n\n @POST(\"install\")\n Call<CreatedIdModelRes> install(@Body InstallForm installForm);\n\n @PUT(\"register\")\n Call<Void> register(@Body RegisterForm registerForm);\n}",
"public MnoAccount getAccountById(String id);",
"@Test\n public void testAllAccountsGET() {\n HttpAuthenticationFeature feature = \n HttpAuthenticationFeature.basic(\"admin\", \"admin\");\n Client client = ClientBuilder.newClient();\n URI uri = UriBuilder\n .fromUri(APPLICATION_NAME + APPLICATION_API_VERSION)\n .scheme(\"http\")\n .host(\"localhost\")\n .port(8080)\n .build();\n WebTarget webTarget = client\n .register(feature)\n .target(uri)\n .path(\"account\");\n Response response = webTarget\n .request(APPLICATION_JSON)\n .get();\n assertThat(response.getStatus(), is(200));\n }",
"private void lookupUserAccount() {\n String userId = tokens.getString(\"principalID\", \"\");\n String accessToken = tokens.getString(\"authorisationToken\", \"\");\n\n if (!\"\".equals(userId) && !\"\".equals(accessToken)) {\n // Make new json request\n String url = String.format(Constants.APIUrls.lookupUserAccount, userId);\n JsonRequest jsonRequest = new JsonObjectRequest(Request.Method.GET, url, null,\n new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n String email;\n try {\n email = response.getString(\"email\");\n } catch (JSONException ex){\n email = \"unknown\";\n }\n String name;\n try{\n JSONObject nameObject = response.getJSONObject(\"name\");\n String firstName = nameObject.getString(\"givenName\");\n String lastName = nameObject.getString(\"familyName\");\n name = firstName + \" \" + lastName;\n } catch (JSONException ex){\n name = \"unknown\";\n }\n Boolean accountBlocked;\n try{\n JSONObject accountInfo = response.getJSONObject(\"urn:mace:oclc.org:eidm:schema:persona:wmscircselfinfo:20180101\").getJSONObject(\"circulationInfo\");\n accountBlocked = accountInfo.getBoolean(\"isCircBlocked\");\n } catch (JSONException ex){\n ex.printStackTrace();\n accountBlocked = true;\n }\n String borrowerCategory;\n try {\n JSONObject accountInfo = response.getJSONObject(\"urn:mace:oclc.org:eidm:schema:persona:wmscircselfinfo:20180101\").getJSONObject(\"circulationInfo\");\n borrowerCategory = accountInfo.getString(\"borrowerCategory\");\n } catch (JSONException ex){\n borrowerCategory = \"\";\n }\n String userBarcode;\n try {\n JSONObject accountInfo = response.getJSONObject(\"urn:mace:oclc.org:eidm:schema:persona:wmscircselfinfo:20180101\").getJSONObject(\"circulationInfo\");\n userBarcode = accountInfo.getString(\"barcode\");\n } catch (JSONException ex){\n userBarcode = \"\";\n }\n tokens.edit().putString(\"name\", name).apply();\n tokens.edit().putString(\"email\", email).apply();\n tokens.edit().putBoolean(\"accountBlocked\", accountBlocked).apply();\n tokens.edit().putString(\"borrowerCategory\", borrowerCategory).apply();\n tokens.edit().putString(\"userBarcode\", userBarcode).apply();\n sendBroadcast(new Intent(Constants.IntentActions.LOOKUP_USER_ACCOUNT_RESPONSE));\n LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(new Intent(Constants.IntentActions.LOOKUP_USER_ACCOUNT_RESPONSE));\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n sendBroadcast(new Intent(Constants.IntentActions.LOOKUP_USER_ACCOUNT_ERROR));\n }\n }\n ){\n @Override\n public Map<String, String> getHeaders() {\n Map<String, String> headers = new HashMap<>();\n headers.put(\"Authorization\", accessToken);\n return headers;\n }\n };\n\n requestQueue.add(jsonRequest);\n\n\n Log.e(TAG, \"user response sent\");\n }\n\n }",
"@GET\n @Produces(\"application/hal+json\")\n public Response list(@PathParam(\"regNo\") String regNo, @PathParam(\"accountNo\") String accountNo) {\n Optional<Account> account = admin.findAccount(regNo, accountNo);\n if (account.isPresent()) {\n CacheControl cc = new CacheControl();\n cc.setMaxAge(10);\n return Response.ok(entityBuilder.buildTransactionsJson(account.get(), uriInfo)).cacheControl(cc).build();\n } else {\n return Response.status(Response.Status.NOT_FOUND).build();\n }\n }",
"java.lang.String getAccount();",
"Account() { }",
"List<Account> getAccounts(String login);",
"static void apiSample() {\n ApiClient client = new ApiClient(API_KEY, API_SECRET);\n // get symbol list:\n print(client.getSymbols());\n // get accounts:\n List<Account> accounts = client.getAccounts();\n print(accounts);\n if (!accounts.isEmpty()) {\n // find account id:\n Account account = accounts.get(0);\n long accountId = account.id;\n // create order:\n CreateOrderRequest createOrderReq = new CreateOrderRequest();\n createOrderReq.accountId = String.valueOf(accountId);\n createOrderReq.amount = \"0.02\";\n createOrderReq.price = \"1100.99\";\n createOrderReq.symbol = \"ethcny\";\n createOrderReq.type = CreateOrderRequest.OrderType.BUY_LIMIT;\n Long orderId = client.createOrder(createOrderReq);\n print(orderId);\n // place order:\n String r = client.placeOrder(orderId);\n print(r);\n }\n }",
"public abstract void createAccount(JSONObject account);",
"@GET\r\n @Produces(MediaType.APPLICATION_JSON)\r\n public List<NewAccount> getAllNewAccounts(){\r\n return newaccountservice.getAllNewAccounts();\r\n }",
"net.nyhm.protonet.example.proto.AccountProto.Account getAccount();",
"net.nyhm.protonet.example.proto.AccountProto.Account getAccount();",
"AccountDetail getAccount(String number) throws Exception;",
"public void getAccount( String email ){\r\n\r\n Map<String, String> params = new HashMap<>();\r\n params.put(\"email\", email);\r\n String url = API_DOMAIN + ACCOUNT_EXT;\r\n this.makeVolleyRequest( url, params );\r\n }",
"void updateAccount();",
"public JsonpAccount() {\n }",
"Collection<Account> getAll();",
"public interface Account extends LrsObject {\n /**\n * The canonical home page for the system the account is on. This is based on FOAF's accountServiceHomePage.\n */\n InternationalizedResourceLocator getHomePage();\n\n /**\n * The unique id or name used to log in to this account. This is based on FOAF's accountName.\n */\n String getName();\n}",
"public interface IAccounts {\n\n @GET(\"accounts\")\n Call<ResponseBody> getAccounts();\n\n}",
"int createAccount(Account account);",
"public interface AccountService {\n\n Account createAccount(Account account);\n\n AccountDto.ResponseAccount getAccountById(Long accountId);\n\n}",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"public Promise<Result> getAccount(final int accountId) throws APIException\n\t{\n\t\treturn accountAction(accountId, new PromiseCallback() {\n\t\t\t@Override\n\t\t\tpublic Promise<Result> execute() throws APIException\n\t\t\t{\n\t\t\t\tAccount a = Account.findById(accountId, true);\n\n\t\t\t\t//TODO hacer un serializer como la gente\n\t\t\t\tJSONSerializer serializer = new JSONSerializer()\n\t\t\t\t\t\t.include(\"tags\", \"invites\", \"gateways.name\", \"gateways.gatewayId\", \"users.firstName\", \"users.id\", \"users.lastName\", \"users.emailAddress\", \"users.phone\", \"users.permissions.*\", \"oem.*\", \"owner.accounts.id\", \"owner.accounts.owner.firstName\", \"owner.accounts.owner.lastName\",\n\t\t\t\t\t\t\t\t\"owner.accounts.companyName\")\n\t\t\t\t\t\t.exclude(\"*.class\", \"tags.possibleAlertMetadatas\", \"gateways.*\", \"users.*\", \"owner.accounts.kabaPassword\", \"kabaPassword\").prettyPrint(true);\n\n\t\t\t\treturn json(serializer.serialize(a));\n\t\t\t}\n\t\t});\n\t}",
"public String getAccount() {\r\n return account;\r\n }",
"@Test\n\tpublic void getAccountTestSuccess() {\n\n\t\tString accountNumber = createAccount(\"viaks\",1000);\n\t\tMap<String, String> parametersMap = new HashMap<>();\n\t\tparametersMap.put(\"accountNumber\", accountNumber);\n\n\t\tRestAssured.given().when().parameters(parametersMap).get(\"/account\").then().assertThat().statusCode(200);\n\t}",
"@Test\n public void testAccountGET() {\n Response response = webTarget\n .path(\"account/1\")\n .request(APPLICATION_JSON)\n .get();\n ChequingAccount c = response.readEntity(ChequingAccount.class);\n assertThat(response.getStatus(), is(200));\n assertEquals(1000.00, c.getBalance(),0.01);\n }",
"public Account getAccount() {\n return account;\n }",
"public Account getAccount() {\n return account;\n }",
"@GET\n @Path(\"user/account/{uid}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response getUserDetails(@PathParam(\"uid\") \n String uid) {\n \n int id = Integer.parseInt(uid);\n \n Customer cust = new Customer(id, \"name\", \"address\", \"ross@email.com\", \"password\");\n \n String output = \"This entry point will return the account details for the user: \" + uid;\n return Response.status(200).entity(gson.toJson(cust)).build();\n \n }",
"public void AddToAccountInfo();",
"public interface AccountInterface{\n\n @POST\n Call<LoginResultModel> postLogin(@Url String url, @Body LoginModel loginModel);\n\n @POST\n Call<Success2Model> postMemberSetting(@Url String url, @Body MemberSettingModel memberSettingModel);\n\n @GET(Utils.URL_MEMBER_SETTING)\n Call<MemberSettingResultModel> getUserTagList(@Query(\"fb_id\") String fb_id);\n \n @GET(Utils.URL_MEMBER_INFO)\n Call<MemberInfoModel> getMemberInfo(@Path(\"fb_id\") String fb_id);\n\n @GET(Utils.URL_GET_SETTING)\n Call<MemberSettingResultModel> getSetting(@Query(\"fb_id\") String fb_id);\n\n @POST\n Call<Success2Model> postEditAbout(@Url String url, @Body AboutModel aboutModel);\n\n @POST\n Call<SuccessTokenModel> getAccessToken(@Url String url, @Body AccessTokenModel accessTokenModel);\n\n @GET(Utils.URL_VERIFY_PHONE_NUMBER)\n Call<Success2Model> verifyPhoneNumber(@Path(\"fb_id\") String fb_id, @Path(\"phone\") String phone);\n\n @GET(Utils.URL_VERIFY_VERIFICATION_CODE)\n Call<Success2Model> verifyVerificationCode(@Path(\"fb_id\") String fb_id, @Path(\"token\") String token);\n\n @Multipart\n @POST(Utils.URL_UPLOAD)\n Call<SuccessUploadModel> upload4(@Part MultipartBody.Part photo, @Part(\"fb_id\") RequestBody fb_id);\n\n @GET(Utils.URL_CITY)\n Call<CityModel> getCityList();\n\n @POST(Utils.URL_DELETE_PHOTO)\n Call<Success2Model> deletePhoto(@Body ProfileDetailModel profileDetailModel);\n\n @POST(Utils.URL_POST_FRIEND_LIST)\n Call<Success2Model> postFriendList(@Path(\"fb_id\") String fb_id, @Path(\"friends_fb_id\") ArrayList<String> friendsFbId);\n\n @GET(Utils.URL_GET_INVITE_CODE)\n Call<InviteCodeResultModel> getInviteCode(@Path(\"fb_id\") String fbId);\n\n @GET(Utils.URL_UPDATE_MATCH_ME)\n Call<Success2Model> updateMatchMe(@Path(\"fb_id\") String fb_id, @Path(\"match_me\") String matchMe);\n\n}",
"@RequestMapping(value = \"/all\")\n public List<Account> getAll(){\n return new ArrayList<>(accountHelper.getAllAccounts().values());\n }",
"Account getAccount(int id);",
"@GET\n\t@Path(\"/getAll\")\n\t@Produces(MediaType.TEXT_HTML)\n\tpublic String getHtmlAccounts() {\n\t\tString res = \"<html> \" + \"<title>\" + \"Hello Jersey\" + \"</title>\" + \"<body>\";\n\n\t\tVector<Account> vs = MyAccountDAO.getAllAccounts();\n\t\tif ((vs == null) || (vs.size() == 0)) {\n\t\t\tres += \"<h1>No TRANSFERS available</h1>\\n\";\n\t\t} else {\n\t\t\tfor (int i = 0; i < vs.size(); i++) {\n\t\t\t\tres += \"<h1>\" + vs.elementAt(i) + \"</h1>\\n\";\n\t\t\t}\n\t\t}\n\t\tres += \"</body>\";\n\t\tres += \"</html>\";\n\t\treturn res;\n\n\t}",
"public String getAccount(){\n\t\treturn account;\n\t}",
"@Path(\"account\")\n @Service({\"account\"})\n public ResponseMessage addAccount(Account account) {\n return asi.addAccount(account);\n }",
"public AuthResponse registerAccount(Account acc){\n Call<AuthResponse> call = endpoints.registerAcc(acc);\n AuthResponse serverResponse = null;\n try {\n serverResponse = call.execute().body();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return serverResponse;\n }",
"public interface Account {\n\n\tpublic String getId();\n\n\tpublic String getEmail();\n\n\tpublic AccountState getState();\n\tpublic void setState(AccountState state);\n\t\n\tpublic void setEmail(String email);\n\n\tpublic String getCompanyName();\n\n\tpublic void setCompanyName(String companyName);\n\n\tpublic Name getFullName();\n\n\tpublic void setFullName(Name fullName);\n\n\tpublic Address getAddress();\n\n\tpublic void setAddress(Address address);\n\t\n\tpublic Map<String, String> getExternalAccounts();\n\t\n\tpublic void setExternalAccounts(Map<String, String> externalAccounts);\n\t\n}",
"public Account() {\n super();\n }",
"private void consumeAccountInfo() {\n Account[] accounts = mAccountManager.getAccountsByType(ACCOUNT_TYPE);\n Account account;\n if (accounts != null && accounts.length > 0) {\n account = accounts[0];\n } else {\n account = new Account(\"\", ACCOUNT_TYPE);\n }\n mAccountManager.getAuthToken(account, AUTH_TOKEN_TYPE, null, true, authTokenCallback, null);\n }",
"public interface EmailAccountService {\n\n RestfulResponse<PageDatas> listAccount(Integer pageNo, Integer pageSize, String search, String sortBy, Boolean isAscending);\n\n RestfulResponse<Long> addAccount(EmailHostAccountDto emailHostAccountDto);\n\n RestfulResponse<Long> updateAccount(EmailHostAccountDto emailHostAccountDto);\n\n RestfulResponse<Long> deleteAccount(Long id);\n\n EmailAccount getEmailAccount(String hostCode, Long hostSizeLimit);\n\n}",
"public void setAccount(String account) {\n this.account = account;\n }",
"public void setAccount(String account) {\n this.account = account;\n }",
"public void setAccount(String account) {\n this.account = account;\n }",
"public void setAccount(String account) {\n this.account = account;\n }",
"public HashMap<String, Accounts> getAccounts(){\n return accounts;\n }",
"@GetMapping(\"/accounts/{id}\")\n\tpublic ResponseEntity<Account> findById(@PathVariable(\"id\") int id){\n\t\tAccount body = this.accService.findById(id);\n\t\tResponseEntity<Account> response = new ResponseEntity<Account>(body, HttpStatus.OK);\n\t\treturn response;\n\t}",
"@GetMapping(\"/accounts\")\n public List<Account> getAccounts() {\n Iterable<Account> accounts = repository.findAll(Sort.by(\"name\"));\n return StreamSupport.stream(accounts.spliterator(), false).collect(Collectors.toList());\n }",
"public Accounts accounts() {\n return this.accounts;\n }",
"public static URL getUrlForGetAccInfo()\r\n {\r\n String strUrl = getBaseURL() +\"account_services/api/1.0/account\";\r\n return str2url( strUrl );\r\n }",
"public AccountService getAccountService(){\n return accountService;\n }",
"Account getAccount(Integer accountNumber);",
"protected void finishLogin() {\n\t\tLog.i(TAG, \"finishLogin()\");\n\t\tfinal Account account = new Account(data.getmHost(), Constants.ACCOUNT_TYPE);\n\n\t\tif (data.ismRequestNewAccount()) {\n\t\t\tBundle userData = new Bundle();\n\t\t\tuserData.putString(Constants.PARAM_USERNAME, data.getmUsername());\n\t\t\tuserData.putString(Constants.PARAM_PORT, data.getmPort() + \"\");\n\t\t\tuserData.putString(Constants.PARAM_HOST, data.getmHost());\n\t\t\tuserData.putString(Constants.PARAM_ENCRYPTION, data.getmEncryption() + \"\");\n\t\t\tuserData.putString(Constants.PARAM_SEARCHFILTER, data.getmSearchFilter());\n\t\t\tuserData.putString(Constants.PARAM_BASEDN, data.getmBaseDN());\n\t\t\t// Mappings for LDAP data\n\t\t\tuserData.putString(Constants.PARAM_MAPPING + Contact.FIRSTNAME, data.getmFirstName());\n\t\t\tuserData.putString(Constants.PARAM_MAPPING + Contact.LASTNAME, data.getmLastName());\n\t\t\tuserData.putString(Constants.PARAM_MAPPING + Contact.TELEPHONE, data.getmOfficePhone());\n\t\t\tuserData.putString(Constants.PARAM_MAPPING + Contact.MOBILE, data.getmCellPhone());\n\t\t\tuserData.putString(Constants.PARAM_MAPPING + Contact.HOMEPHONE, data.getmHomePhone());\n\t\t\tuserData.putString(Constants.PARAM_MAPPING + Contact.MAIL, data.getmEmail());\n\t\t\tuserData.putString(Constants.PARAM_MAPPING + Contact.PHOTO, data.getmImage());\n\t\t\tuserData.putString(Constants.PARAM_MAPPING + Contact.STREET, data.getmStreet());\n\t\t\tuserData.putString(Constants.PARAM_MAPPING + Contact.CITY, data.getmCity());\n\t\t\tuserData.putString(Constants.PARAM_MAPPING + Contact.ZIP, data.getmZip());\n\t\t\tuserData.putString(Constants.PARAM_MAPPING + Contact.STATE, data.getmState());\n\t\t\tuserData.putString(Constants.PARAM_MAPPING + Contact.COUNTRY, data.getmCountry());\n\t\t\tdata.getmAccountManager().addAccountExplicitly(account, data.getmPassword(), userData);\n\n\t\t\t// Set contacts sync for this account.\n\t\t\tContentResolver.setSyncAutomatically(account, ContactsContract.AUTHORITY, true);\n\t\t\tContactManager.makeGroupVisible(account.name, getContentResolver());\n\t\t} else {\n\t\t\tdata.getmAccountManager().setPassword(account, data.getmPassword());\n\t\t}\n\t\tfinal Intent intent = new Intent();\n\t\tdata.setmAuthtoken(data.getmPassword());\n\t\tintent.putExtra(AccountManager.KEY_ACCOUNT_NAME, account.name);\n\t\tintent.putExtra(AccountManager.KEY_ACCOUNT_TYPE, Constants.ACCOUNT_TYPE);\n\t\tif (data.getmAuthtokenType() != null && data.getmAuthtokenType().equals(Constants.AUTHTOKEN_TYPE)) {\n\t\t\tintent.putExtra(AccountManager.KEY_AUTHTOKEN, data.getmAuthtoken());\n\t\t}\n\t\tsetAccountAuthenticatorResult(intent.getExtras());\n\t\tsetResult(RESULT_OK, intent);\n\t\tfinish();\n\t}",
"@POST\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.TEXT_PLAIN)\n public Response createAccount(\n AccountModel input, @Context HttpServletResponse response) {\n if (input.getEmail() == null || input.getEmail().equals(\"\") || input.getPassword() == null || input.getPassword().isEmpty()\n || input.getUserName() == null || input.getUserName().isEmpty()) {\n return Response.status(Response.Status.BAD_REQUEST).build();\n }\n Customer customer = new Customer();\n customer.setEmail(input.getEmail());\n customer.setPassword(input.getPassword());\n customer.setUserName(input.getUserName());\n String sendToken = TokenUtil.getToken(input.getEmail(), input.getPassword());\n customer.setToken(sendToken);\n Long id = customerRef.save(customer);\n if (id != null || id > 0) {\n response.setHeader(\"AuthHeader\", sendToken);\n return Response.status(Response.Status.CREATED).build();\n }\n return Response.status(Response.Status.NOT_IMPLEMENTED).build();\n\n }",
"@Override\n public List<Account> listAccounts() {\n currentCustomer.findAndUpdateAccounts();\n // return list of accounts the customer owns\n return currentCustomer.getAccounts();\n }",
"public Account() {\n }",
"@GET\n\t@Path(\"/getAll\")\n\t@Produces(MediaType.TEXT_PLAIN)\n\tpublic String getPlainTextAccount() {\n\t\tString res = \"\";\n\t\tVector<Account> vs = MyAccountDAO.getAllAccounts();\n\t\tif (vs != null) {\n\t\t\tfor (int i = 0; i < vs.size(); i++) {\n\t\t\t\tres += vs.elementAt(i) + \"\\n\";\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tres = \"VUOTO!\";\n\t\t}\n\t\treturn res;\n\t}",
"@GET\n @Path(\"account/transactions/{account_id}\")\n public Response getAccountTransactions(@PathParam(\"account_id\") \n String accountId) {\n \n String output = \"This entry point will return all transactions related to the account: \" + accountId;\n return Response.status(200).entity(output).build();\n \n }",
"Account create();",
"GenerateUserAccount () {\r\n }",
"public Account status() {\n RestRequest request = new RestRequest();\n request.setResource(\"account/status\");\n\n return client.get(request, Account.class);\n }",
"int updateAccountInfo(Account account);",
"public Account() {\n\n\t}",
"public String getAccount() {\r\n\t\treturn account;\r\n\t}",
"List<Account> getAccountsForCustomerId(int customerId);",
"public abstract GDataAccount getAccount(String account) throws ServiceException;",
"public Account() {\n\n }",
"public Account() {\n }",
"public Account() {\n }",
"public void setAccount(Account account) {\n this.account = account;\n }",
"List<Account> findAll();",
"List<Account> findAll();",
"private String getApiToken(final Account account) {\r\n return account.getStringProperty(PROPERTY_ACCOUNT_api_token);\r\n }",
"public interface AccountService {\n\n Double getBalanceByDate(Long id, Date date);\n\n List<Account> getAllByUser(String mobileNumber);\n}",
"String addAccount(UserInfo userInfo);",
"public\n Account\n getAccount()\n {\n return itsAccount;\n }",
"@GET\n\t@Path(\"/getAll\")\n\t@Produces(MediaType.TEXT_XML)\n\tpublic String getXmlAccounts() {\n\t\tString res = \"<?xml version=\\\"1.0\\\"?>\" + \"\\n\" + \"<TRANSFER>\";\n\n\t\tVector<Account> vs = MyAccountDAO.getAllAccounts();\n\n\t\tfor (int i = 0; i < vs.size(); i++) {\n\t\t\tres += vs.elementAt(i).toXml();\n\t\t}\n\t\tres += \"</TRANSFER>\";\n\t\treturn res;\n\t}",
"@GET\r\n @Produces(MediaType.APPLICATION_JSON)\r\n public AppUser getJson() {\r\n return appUserBean.authenticate(\"admin\", \"admin\");\r\n }",
"@Override\n\tpublic List<Account> GetAllAccounts() {\n\t\tif(accountList.size() > 0)\n\t\t\treturn accountList;\n\t\treturn null;\n\t}",
"public static AccountService getAccountService(){\n\t\treturn new AccountServiceProxy();\n\t}",
"public interface Account {\n /**\n * Gets the id property: Fully qualified resource Id for the resource.\n *\n * @return the id value.\n */\n String id();\n\n /**\n * Gets the name property: The name of the resource.\n *\n * @return the name value.\n */\n String name();\n\n /**\n * Gets the type property: The type of the resource.\n *\n * @return the type value.\n */\n String type();\n\n /**\n * Gets the etag property: Resource Etag.\n *\n * @return the etag value.\n */\n String etag();\n\n /**\n * Gets the kind property: The Kind of the resource.\n *\n * @return the kind value.\n */\n String kind();\n\n /**\n * Gets the sku property: The resource model definition representing SKU.\n *\n * @return the sku value.\n */\n Sku sku();\n\n /**\n * Gets the identity property: Identity for the resource.\n *\n * @return the identity value.\n */\n Identity identity();\n\n /**\n * Gets the systemData property: Metadata pertaining to creation and last modification of the resource.\n *\n * @return the systemData value.\n */\n SystemData systemData();\n\n /**\n * Gets the tags property: Resource tags.\n *\n * @return the tags value.\n */\n Map<String, String> tags();\n\n /**\n * Gets the location property: The geo-location where the resource lives.\n *\n * @return the location value.\n */\n String location();\n\n /**\n * Gets the properties property: Properties of Cognitive Services account.\n *\n * @return the properties value.\n */\n AccountProperties properties();\n\n /**\n * Gets the region of the resource.\n *\n * @return the region of the resource.\n */\n Region region();\n\n /**\n * Gets the name of the resource region.\n *\n * @return the name of the resource region.\n */\n String regionName();\n\n /**\n * Gets the name of the resource group.\n *\n * @return the name of the resource group.\n */\n String resourceGroupName();\n\n /**\n * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.AccountInner object.\n *\n * @return the inner object.\n */\n AccountInner innerModel();\n\n /** The entirety of the Account definition. */\n interface Definition\n extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate {\n }\n\n /** The Account definition stages. */\n interface DefinitionStages {\n /** The first stage of the Account definition. */\n interface Blank extends WithResourceGroup {\n }\n\n /** The stage of the Account definition allowing to specify parent resource. */\n interface WithResourceGroup {\n /**\n * Specifies resourceGroupName.\n *\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @return the next definition stage.\n */\n WithCreate withExistingResourceGroup(String resourceGroupName);\n }\n\n /**\n * The stage of the Account definition which contains all the minimum required properties for the resource to be\n * created, but also allows for any other optional properties to be specified.\n */\n interface WithCreate\n extends DefinitionStages.WithLocation,\n DefinitionStages.WithTags,\n DefinitionStages.WithKind,\n DefinitionStages.WithSku,\n DefinitionStages.WithIdentity,\n DefinitionStages.WithProperties {\n /**\n * Executes the create request.\n *\n * @return the created resource.\n */\n Account create();\n\n /**\n * Executes the create request.\n *\n * @param context The context to associate with this operation.\n * @return the created resource.\n */\n Account create(Context context);\n }\n\n /** The stage of the Account definition allowing to specify location. */\n interface WithLocation {\n /**\n * Specifies the region for the resource.\n *\n * @param location The geo-location where the resource lives.\n * @return the next definition stage.\n */\n WithCreate withRegion(Region location);\n\n /**\n * Specifies the region for the resource.\n *\n * @param location The geo-location where the resource lives.\n * @return the next definition stage.\n */\n WithCreate withRegion(String location);\n }\n\n /** The stage of the Account definition allowing to specify tags. */\n interface WithTags {\n /**\n * Specifies the tags property: Resource tags..\n *\n * @param tags Resource tags.\n * @return the next definition stage.\n */\n WithCreate withTags(Map<String, String> tags);\n }\n\n /** The stage of the Account definition allowing to specify kind. */\n interface WithKind {\n /**\n * Specifies the kind property: The Kind of the resource..\n *\n * @param kind The Kind of the resource.\n * @return the next definition stage.\n */\n WithCreate withKind(String kind);\n }\n\n /** The stage of the Account definition allowing to specify sku. */\n interface WithSku {\n /**\n * Specifies the sku property: The resource model definition representing SKU.\n *\n * @param sku The resource model definition representing SKU.\n * @return the next definition stage.\n */\n WithCreate withSku(Sku sku);\n }\n\n /** The stage of the Account definition allowing to specify identity. */\n interface WithIdentity {\n /**\n * Specifies the identity property: Identity for the resource..\n *\n * @param identity Identity for the resource.\n * @return the next definition stage.\n */\n WithCreate withIdentity(Identity identity);\n }\n\n /** The stage of the Account definition allowing to specify properties. */\n interface WithProperties {\n /**\n * Specifies the properties property: Properties of Cognitive Services account..\n *\n * @param properties Properties of Cognitive Services account.\n * @return the next definition stage.\n */\n WithCreate withProperties(AccountProperties properties);\n }\n }\n\n /**\n * Begins update for the Account resource.\n *\n * @return the stage of resource update.\n */\n Account.Update update();\n\n /** The template for Account update. */\n interface Update\n extends UpdateStages.WithTags,\n UpdateStages.WithKind,\n UpdateStages.WithSku,\n UpdateStages.WithIdentity,\n UpdateStages.WithProperties {\n /**\n * Executes the update request.\n *\n * @return the updated resource.\n */\n Account apply();\n\n /**\n * Executes the update request.\n *\n * @param context The context to associate with this operation.\n * @return the updated resource.\n */\n Account apply(Context context);\n }\n\n /** The Account update stages. */\n interface UpdateStages {\n /** The stage of the Account update allowing to specify tags. */\n interface WithTags {\n /**\n * Specifies the tags property: Resource tags..\n *\n * @param tags Resource tags.\n * @return the next definition stage.\n */\n Update withTags(Map<String, String> tags);\n }\n\n /** The stage of the Account update allowing to specify kind. */\n interface WithKind {\n /**\n * Specifies the kind property: The Kind of the resource..\n *\n * @param kind The Kind of the resource.\n * @return the next definition stage.\n */\n Update withKind(String kind);\n }\n\n /** The stage of the Account update allowing to specify sku. */\n interface WithSku {\n /**\n * Specifies the sku property: The resource model definition representing SKU.\n *\n * @param sku The resource model definition representing SKU.\n * @return the next definition stage.\n */\n Update withSku(Sku sku);\n }\n\n /** The stage of the Account update allowing to specify identity. */\n interface WithIdentity {\n /**\n * Specifies the identity property: Identity for the resource..\n *\n * @param identity Identity for the resource.\n * @return the next definition stage.\n */\n Update withIdentity(Identity identity);\n }\n\n /** The stage of the Account update allowing to specify properties. */\n interface WithProperties {\n /**\n * Specifies the properties property: Properties of Cognitive Services account..\n *\n * @param properties Properties of Cognitive Services account.\n * @return the next definition stage.\n */\n Update withProperties(AccountProperties properties);\n }\n }\n\n /**\n * Refreshes the resource to sync with Azure.\n *\n * @return the refreshed resource.\n */\n Account refresh();\n\n /**\n * Refreshes the resource to sync with Azure.\n *\n * @param context The context to associate with this operation.\n * @return the refreshed resource.\n */\n Account refresh(Context context);\n\n /**\n * Lists the account keys for the specified Cognitive Services account.\n *\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the access keys for the cognitive services account along with {@link Response}.\n */\n Response<ApiKeys> listKeysWithResponse(Context context);\n\n /**\n * Lists the account keys for the specified Cognitive Services account.\n *\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the access keys for the cognitive services account.\n */\n ApiKeys listKeys();\n\n /**\n * Regenerates the specified account key for the specified Cognitive Services account.\n *\n * @param parameters regenerate key parameters.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the access keys for the cognitive services account along with {@link Response}.\n */\n Response<ApiKeys> regenerateKeyWithResponse(RegenerateKeyParameters parameters, Context context);\n\n /**\n * Regenerates the specified account key for the specified Cognitive Services account.\n *\n * @param parameters regenerate key parameters.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the access keys for the cognitive services account.\n */\n ApiKeys regenerateKey(RegenerateKeyParameters parameters);\n}",
"@ApiModelProperty(required = true, value = \"List of PSU account that are made available to the TPP \")\n @NotNull\n\n @Valid\n\n public List<AccountResource> getAccounts() {\n return accounts;\n }",
"@Override public Account provideAccount(String accountJson) {\n return null;\n }",
"public Account() {\n\t}"
] | [
"0.68165964",
"0.65313053",
"0.64810896",
"0.64790326",
"0.6431739",
"0.6424236",
"0.6362146",
"0.6338813",
"0.6249101",
"0.6235841",
"0.6156786",
"0.60903925",
"0.6084117",
"0.60736305",
"0.60327405",
"0.60317034",
"0.60132056",
"0.60090053",
"0.5967674",
"0.5967674",
"0.5934929",
"0.5934591",
"0.59066606",
"0.58597547",
"0.5851044",
"0.5850265",
"0.58456033",
"0.5839818",
"0.5838149",
"0.5803204",
"0.5803204",
"0.5803204",
"0.5803204",
"0.5803204",
"0.5803204",
"0.5803204",
"0.5803204",
"0.5803204",
"0.5803204",
"0.5803135",
"0.5797648",
"0.579709",
"0.579573",
"0.5784959",
"0.5784959",
"0.5777632",
"0.57763976",
"0.5770871",
"0.57666785",
"0.5766646",
"0.576647",
"0.57357776",
"0.57289016",
"0.5717362",
"0.57150435",
"0.57096606",
"0.56983864",
"0.5684479",
"0.5678935",
"0.5678935",
"0.5678935",
"0.5678935",
"0.56758857",
"0.5675672",
"0.5675405",
"0.5673169",
"0.5656498",
"0.5649685",
"0.5649417",
"0.5645361",
"0.5644848",
"0.5640537",
"0.5632797",
"0.5630129",
"0.56190956",
"0.5606876",
"0.55972475",
"0.559071",
"0.55811286",
"0.556177",
"0.5554821",
"0.5551918",
"0.5546377",
"0.55461675",
"0.5535631",
"0.5535631",
"0.55326426",
"0.55159163",
"0.55159163",
"0.55139315",
"0.55079615",
"0.5504422",
"0.5502529",
"0.5491887",
"0.548673",
"0.5483322",
"0.54728305",
"0.546885",
"0.5467583",
"0.5466009",
"0.5462764"
] | 0.0 | -1 |
Normal public mojang API. | public Mojang() {
this.accesstoken = null;
this.authMode = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public api() {}",
"public API() {}",
"private MApi() {}",
"API createAPI();",
"private ParkingLotApi()\r\n {\r\n }",
"private WAPIHelper() { }",
"private RESTBackend()\n\t\t{\n\t\t\t\n\t\t}",
"public void miseAJour();",
"private JSON() {\n\t}",
"public interface TwoversePublicApi {\n /**\n * Creates a new account.\n * \n * @param user\n * the user to create. Must have a hashed password set and must\n * NOT have an ID set. The ID will be set when returning from\n * this method.\n * @return the ID for new account\n * @throws ExistingUserException\n * if an account with this username already exists\n * @throws UnsetPasswordException\n * if the hashed password is not set\n */\n public int createAccount(User user) throws ExistingUserException,\n UnsetPasswordException;\n\n /**\n * Add a new object to the universe.\n * \n * These functions modify galaxy, but over XML-RPC that doesn't really work.\n * So, we must explicitly return the new object\n * \n * @param body\n * the object to add. The ID must NOT be set, and will be set on\n * returning from this method.\n * @return the ID for the new object\n * @throws UnhandledCelestialBodyException\n */\n public CelestialBody add(CelestialBody body)\n throws UnhandledCelestialBodyException;\n\n /**\n * Updates an object in the universe with the one provided, overwriting any\n * previous values.\n * \n * @param body\n * the body to update. The ID must be set and it must be known by\n * the server.\n * @return the updated object\n */\n public CelestialBody update(CelestialBody body);\n\n /**\n * Add a new link to the universe.\n * \n * @param link\n * the object to add. The ID must NOT be set, and will be set on\n * returning from this method.\n * @return the ID for the new object\n * @throws UnhandledCelestialBodyException\n */\n public Link add(Link link);\n}",
"private stendhal() {\n\t}",
"private Aliyun() {\n\t\tsuper();\n\t}",
"public abstract String mo9091a();",
"private TwitterAPI(){\n\t\t\n\t}",
"public interface Api {\n /**{\"response\": {\"zbsVer\": 0, \"hostId\": \"001207C40173\", \"room\": [{\"type\": \"\\u603b\\u7ecf\\u7406\", \"roomId\": \"322\", \"name\": \"\\u603b\\u7ecf\\u7406\"}, {\"roomId\": \"350\", \"type\": \"\\u4e3b\\u5367\", \"name\": \"\\u4e3b\\u5367\"}, {\"type\": \"\\u53a8\\u623f\", \"roomId\": \"366\", \"name\": \"\\u5475\\u5475\"}, {\"roomId\": \"381\", \"type\": \"\\u53a8\\u623f\", \"name\": \"\\u53a8\\u623f\"}, {\"roomId\": \"382\", \"type\": \"\\u9910\\u5385\", \"name\": \"\\u9910\\u5385\"}], \"softver\": 104, \"timestamp\": 1501838857, \"zbhVer\": 0, \"lastbackup\": 1499826785, \"pandId\": 101, \"firmver\": 217, \"numbers\": \"15905214137,15252089063,18912345678,15263985632,15152208332\", \"channelNo\": \"f\", \"registerHost\": false, \"name\": \"40173\"}, \"ret\": 0, \"md5\": \"a92c08fdf3a4b4f9aef04b3ce102df32\"}\n\n * 云端接口\n */\n String wrapper_request = \"/wrapper/request\";\n //\n// CloudInterface.h\n// ihome\n//\n// Created by on 3/13/15.\n// Copyright (c) 2015 Co.ltd. All rights reserved.\n\n //测试\n String urlCloud = \"/https://api2.boericloud.com\";\n //正式\n// String urlCloud = \"/https://api.boericloud.com\";\n\n String urlResetMobile = \"/auth/resetMobile\"; //重置手机号码\n String urlNegotiate = \"/auth/negotiate\";\n String urlRegister = \"/auth/register\"; //注册\n String urlSignin = \"/auth/login\"; //登录\n String urlSignOff = \"/auth/logout\"; //登出\n\n String urlResetCloudPassword = \"/auth/resetCloudpassword\"; //重置密码\n String urlSmsVerify = \"/auth/sms_verify\"; //短信验证\n String urlResetPWD = \"/auth/reset_password\"; //忘记密码\n String urlMobileVerify = \"/auth/mobile_verify\"; //验证手机号\n\n String urlUserUpdate = \"/user/update\";\n String urlUserUpdateToken = \"/user/update_token\";\n\n String urlUserPermissions = \"/user/host_permissions\"; //查询用户权限\n String urlUserUpdateExtend = \"/user/update_extend\"; //更新铃声和震动\n String urlUserShowExtend = \"/user/show_extend\"; //获取铃声和震动\n\n String urlHostBind = \"/host/bind\";\n String urlHostShow = \"/host/show\";\n\n String urlHostverifyadminpassword = \"/host/verifyadminpassword\";\n String urlHostSwitch = \"/host/switch\";\n\n String urlWrapperRequest = \"/wrapper/request\";//透传接口,一键备份\n String urlHostRestoreproperty = \"/host/restoreproperty\";//透传接口,一键还原\n\n String urlHostUpgrade = \"/upgrade/latest\";\n String urlHostUpgradeSoftware = \"/host/software_upgrade\";\n\n String urlSystemMessageShow = \"/systemMessage/show\"; //请求某天某类型的系统消息\n\n String urlWarningShow = \"/alarm/show1\"; //请求某天某类型的历史告警\n String urlAlarmDelete = \"/alarm/delete1\";//删除单条或多条历史告警\n String urlAlarmBatchDelete = \"/alarm/batch_delete\";//删除某天某类型的所有告警\n\n String urlSystemMessageDelete = \"/systemMessage/remove\";//删除某天某类型的系统消息\n String urlSystemBatchDelete = \"/systemMessage/batch_delete\";//删除某天某类型的所有系统消息\n\n String urlAlarmRead = \"/alarm/confirm_read\";//确认某条系统告警\n String urlSystemMessageRead = \"/systemMessage/confirmRead\";//确认某条系统消息\n\n String urlAddBlackList = \"/user/add_black_list\";//加入黑名单\n String urlRemoveBlackList = \"/user/remove_black_list\";//移除黑名单\n String urlQueryBlackList = \"/user/query_in_black_list\";//查询用户是否在黑名单内\n\n /*****************************/\n//主机直连 -> 设备相关\n String urlQueryWiseMediaList = \"/device/queryWiseMediaList\";//查询华尔斯背景音乐的歌曲列表\n String urlDeviceScan = \"/device/scan\";//扫描设备\n String urlDeviceLink = \"/device/link\";//关联设备->(新增)\n String urlDeviceQuerylink = \"/device/querylink\";//查询关联设备->(新增)\n String urlDeviceCmd = \"/device/cmd\";//控制设备\n String urlDeviceRemove = \"/device/remove\";//删除设备\n String urlDeviceDismiss = \"/device/dismiss\";//解绑设备\n String urlDeviceUpdateProp = \"/device/updateprop\";//更新设备属性\n String urlDevicesProperties = \"/devices/properties\";//查询设备属性\n String urlDeviceStatus = \"/device/status\";//查询设备状态\n String urlDeviceQueryOneProp = \"/device/queryOneProp\";//查询某一设备的属性->(新增)\n String urlDeviceConfigHgc = \"/device/configHgc\";//配置中控->(新增)\n String urlDeviceDeleteHgcConfig = \"/device/deleteHgcConfig\";//删除中控配置->(新增)\n String urlDeviceQueryHgcConfig = \"/device/queryHgcConfig\";//查询中控配置->(新增)\n String urlDeviceQueryMeterAddr = \"/device/queryMeterAddr\";//查询水电表的地址->(新增)\n String urlDeviceModifyMeterName = \"/device/modifyMeterName\";//修改水电表的名称->(新增)\n String urlDeviceQueryAllDevices = \"/device/queryAllDevices\";//查询所有设备的属性和状态->(新增)\n String urlDeviceSetFloorHeatingTimeTask = \"/device/setFloorHeatingTimeTask\";//设置地暖的定时任务->(新增)\n String urlDeviceSwitchFloorHeatingTimeTask = \"/device/switchFloorHeatingTimeTask\";//开启或者关闭地暖的定时任务->(新增)\n\n //主机直连 -> 主机相关\n String urlHostShowProperty = \"/host/showproperty\";//查询主机信息\n String urlHostModifyProperty = \"/host/modifyproperty\";//修改主机信息\n String urlHostQueryglobaldata = \"/host/queryglobaldata\";//查询全局信息->(新增)\n String urlHostModifyHostName = \"/host/modifyHostName\";//修改主机名称->(新增)\n\n //主机直连 -> 联动模式相关\n String urlPlanShow = \"/plan/show\";//查询指定的联动预案或模式\n String urlPlanUpdate = \"/plan/update\";//更新联动预案或模式\n String urlPlanQueryGlobalModes = \"/plan/queryGlobalModes\";//查询全局模式->(新增)\n String urlPlanModifyModeName = \"/plan/modifyModeName\";//修改模式名称->(新增)\n String urlPlanSetTimeTask = \"/plan/setTimeTask\";//设置模式定时\n String urlPlanTimeTaskSwitch = \"/plan/switchTimeTask\";//开启或关闭模式定时\n String urlPlanAllModes = \"/plan/allModes\";//查询当前主机下所有模式\n\n //主机直连 -> 房间区域相关\n String urlRoomsRemove = \"/room/remove\";//删除房间\n String urlRoomsUpdate = \"/room/update\";//更新房间\n String urlRoomsShow = \"/room/show\";//查询房间\n String urlAreaRemove = \"/room/removearea\";//删除区域\n String urlAreaUpdate = \"/room/updatearea\";//更新区域\n String urlAreaShow = \"/room/showarea\";//查询区域\n String urlRoomsUpdateMode = \"/room/updatemode\";//更新房间模式\n String urlRoomsShowMode = \"/room/showmode\";//查询房间模式\n String urlRoomsActiveMode = \"/room/activemode\";//激活房间模式\n\n//主机直连 -> 告警相关\n\n\n //主机直连 -> 用户相关\n String urlUserLogin = \"/user/login\";//直连登录->(新增)\n String urlUserAuthorizedLogin = \"/user/authorizedLogin\";//授权后的直连登陆(已在云端登陆)->(新增)\n String urlUserLogout = \"/user/logout\";//退出登录->(新增)\n String urlUserSaveUserInfo = \"/user/saveUserInfo\";//直连登录->(新增)\n /*****************************/\n\n String urlReportBloodsugar = \"/health/report_bloodsugar\";//上报血糖值\n String urlDeleteBloodsugar = \"/health/delete_bloodsugar\";//删除血糖值\n String urlUpdateBloodsugar = \"/health/update_bloodsugar\";//修改血糖值\n\n String urlReportBloodPressure = \"/health/report_bloodpressure\";//上报血压值\n String urlDeleteBloodPressure = \"/health/delete_bloodpressure\";//删除血压值\n\n String urlReportBodyWeight = \"/health/report_bodyweight\";//上报体重值\n String urlDeleteBodyWeight = \"/health/delete_bodyweight\";//删除体重值\n\n String urlReportUrine = \"/health/report_urine\"; //上报尿检值\n String urlDeleteUrine = \"/health/delete_urine\";//删除某一条尿检记录\n\n String urlDownHealthCache = \"/data/health_down\";//下载缓存数据\n String urlUploadHealthCache = \"/data/health_upload\";//上传缓存数据\n String urlUploadBloodPressureCache = \"/data/health_upload_blood_pressure\";//上传血压缓存数据\n String urlUploadBloodGlucoseCache = \"/data/health_upload_blood_glucose\";//上传血糖缓存数据\n String urlUploadBodyWeightCache = \"/data/health_upload_body_weight\";//上传体重缓存数据\n String urlUploadUrineCache = \"/data/health_upload_urine\";//上传尿检缓存数据\n\n String urlQueryElec = \"/energy/query_elec\"; //查询电能数据\n String urlQuerySocket = \"/energy/query_socket\"; //查询插座数据\n String urlQueryWater = \"/energy/query_water\"; //查询水表数据\n String urlQueryGas = \"/energy/query_gas\"; //查询气表数据\n\n\n String urlHostShow1 = \"/host/show1\"; //家庭管理中的主机属性\n\n String urlUserInfo = \"/user/userInfo\"; //查找用户信息\n String urlShowInviteCode = \"/user/show_invitecode\"; //查看邀请码\n String urlInvitationConvert = \"/integral/exchange_integral\"; //兑换邀请码\n String urlFamilyAddUser = \"/family/add_user\"; //增加家庭成员\n String urlFamilyTransPermission = \"/family/admin_permission_transfer\"; //转让管理员权限\n String urlFamilyUpdateAlias = \"/family/update_alias\"; //更新主机别名或用户别名\n String urlFamilyDeleteUser = \"/family/delete_user\"; //主机删除用户\n String urlFamilyDeleteHost = \"/family/delete_host\"; //管理员删除主机\n String urlFamilyUserIsAdmin = \"/family/user_isAdmin\"; //当前用户是否为管理员\n String urlFamilyUpdatePermissaion = \"/family/update_permission\"; //更新用户权限\n String urlFamilyUpdateShare = \"/family/update_share\"; //家庭分享健康数据\n String urlFamilyHostAdmin = \"/family/host_admin\"; //查询主机管理员\n\n String urlApplyUserApply = \"/apply/user_apply\"; //主机用户申请\n\n String urlApplyUserApplyV1 = \"/apply/user_apply_v1\"; //主机用户申请接口V1(将判断和推送放在后台)\n String urlApplyUserShow = \"/apply/user_show\"; //查询主机用户申请\n String urlApplyUserDelete = \"/apply/user_delete\"; //删除用户申请\n String urlApplyUserUpdateStatus = \"/apply/user_update_state\"; //更新用户状态\n\n String urlApplyUserUpdateStatusV1 = \"/apply/update_status_v1\"; //更新用户申请状态(将当前状态发送给后台进行筛选)\n String urlApplyUserHost = \"/apply/host_show\"; //查询主机下申请用户\n String urlApplyUserApplyIsExists = \"/apply/user_applyuserid_exist\"; //判断当前用户是否已经申请过\n String urlApplyUserReapply = \"/family/user_reapply\"; //用户重新申请\n String urlApplyQueryUserApplyOrAdnimReject = \"/apply/query_user_apply_reject\"; //查询用户申请或管理员拒绝记录\n\n String urlQueryUserApplyOrShare = \"/apply/query_user_apply_share\"; //查询用户是否有未处理申请或分享\n\n String urlNotificationPush = \"/notification/notification_push\"; //推送通知\n\n String notification_updateMsg = \"/notification_updateMsg\"; //报警通知\n String notification_updateScence = \"/notification_updateScence\"; //场景更新\n String notification_startHomeTimer = \"/notification_startHomeTimer\"; //开启主页轮询\n String notification_stopHomeTimer = \"/notification_stopHomeTimer\"; //关闭主页轮询\n String notification_startDeviceTimer = \"/notification_startDeviceTimer\"; //开启设备轮询\n String notification_stopDeviceTimer = \"/notification_stopDeviceTimer\"; //关闭设备轮询\n String notification_changeHost = \"/notification_changeHost\"; //切换主机\n String notification_updateCity = \"/notification_updateCity\"; //更新城市信息\n String notification_updateFamilyMembers = \"/notification_updateFamilyMembers\"; //更新家庭成员信息\n String notification_removeHomeNotifications = \"/notification_removeHomeNotifications\"; //移除所有通知\n String notification_familyRefresh = \"/notification_familyRefresh\"; //家庭成员刷新\n\n String urlShareUser = \"/share/user_share\"; //查询家庭的接口\n String urlQueryHealth = \"/health/query_health\"; //查询选定日期区间健康数据接口\n String urlQueryRecentHealth = \"/health/query_recent_health\"; //查询最近的健康数据分享接口\n\n String urlQueryRecentNotification = \"/notification/query_recent_notification\"; //查询最近的通知消息\n\n String urlFeedback = \"/feedback/feedback_push\"; //客户端的意见反馈\n\n String urlHostGuard = \"/host/guard\";//门禁对讲接听推送请求\n\n\n String urlStartScanBatch = \"/device/startScanBatch\";//开始批量添加\n String urlStopScanBatch = \"/device/stopScanBatch\";//停止批量添加\n\n String urlQueryDeviceBatch = \"/device/queryDeviceBatch\";//查询设备\n String urlSaveDeviceBatch = \"/device/saveDeviceBatch\";//保存\n\n String urlCommonDevice = \"/device/commondevice\";//设置、取消常用设备\n\n String urlHostShowOnline = \"/host/showonline\"; // 主机是否在线\n String urlgetMsgSettings = \"/settings/find_message_settings_by_mobile\";//获取消息设置\n String urlsetMsgSettings = \"/settings/save_message_settings\";//设置消息设置\n String urlsetPushMsg = \"/notification/notification_push\";//消息推送\n\n String urlQueryAirFilter = \"/energy/query_airFilter\";// 查询 历史记录\n String urlQueryTableWaterFilter = \"/energy/query_tableWaterFilter\";//\n String urlQueryFloorWaterFilter = \"/energy/query_floorWaterFilter\";//\n\n\n}",
"public abstract Object mo1771a();",
"public interface API {\n\n //Penyakit\n @GET(\"penyakitall/{page}/{count_page}\")\n Call<DiseaseResponse>\n getDiseaseList(@Path(\"page\") String page, @Path(\"count_page\") String count_page);\n\n @GET(\"penyakit/{page}/{count_page}\")\n Call<DiseaseResponse>\n getDiseaseListByLokasi(@Path(\"page\") String page, @Path(\"count_page\") String count_page, @Query(\"id_desa\") String id_desa);\n\n @POST(\"penyakit\")\n Call<DiseasePostResponse>\n postDisease(@Body DiseaseBody diseaseBody);\n @DELETE(\"penyakit\")\n Call<DeletePenyakitResponse> deletePenyakit(@Query(\"Id_penyakit\") String id_penyakit);\n\n @PUT(\"penyakit\")\n Call<PutPenyakitResponse> editPenyakit(@Query(\"Id_penyakit\") String id_penyakit,\n @Body PutPenyakitBody putPenyakitBody);\n\n @GET(\"tipepenyakit/{page}/{count_page}\")\n Call<TipePenyakitResponse>\n getTipePenyakitList(@Path(\"page\") String page, @Path(\"count_page\") String count_page);\n\n @POST(\"multimedia\")\n Call<MultimediaPostResponse>\n postMultimedia(@Body MultimediaBody multimediaBody);\n}",
"private ObiWanKenobi(){\n }",
"private ApiInfo apiInfo() {\n\t\treturn new ApiInfo(\"Langton ant app\", \"rest api for langton ant app\", version, null,\n\t\t\t\tnew Contact(\"leclerc\", \"N/A\", \"leclerc.cyril@hotmail.fr\"), null, null, Collections.EMPTY_LIST);\n\t}",
"void mo54405a();",
"private UsineJoueur() {}",
"private ApiInfo apiInfo() {\n Contact contact = new Contact(\"Hanchuanjun\", \"\", \"han@inhand.com.cn\");\n ApiInfo apiInfo = new ApiInfo(\n \"GEHC SmartX SSO-OAuth模块api\",\n \"GEHC SmartX SSO-OAuth模块服务api\",\n \"v0.0.1\",\n \"初始化版本\",\n contact,\n \"\",\n \"\");\n return apiInfo;\n }",
"public void mo55254a() {\n }",
"void mo1942k();",
"void mo60893b();",
"Request mo35725m0();",
"public GetMembersREST() {\n }",
"public abstract Object mo26777y();",
"void mo1970b();",
"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 abstract String mo9238av();",
"public interface GrosirMobilApi {\n\n String v1 = \"v1\";\n String v2 = \"v2\";\n\n String loginPath = \"/api/auth/loginMobile\";\n String tipeUsahaPath = \"/api/registrasi/tipeusahamobile\";\n String questionOnePath = \"/api/registrasi/KebutuhanKendaraanBulanMobile\";\n String questionTwoPath = \"/api/registrasi/Rata2PenjualanMobile\";\n String questionThreePath = \"/api/registrasi/KebutuhanPembelianMobile\";\n String questionFourPath = \"/api/registrasi/JenisMobilMobile\";\n String questionFivePath = \"/api/registrasi/SumberInfoMobile\";\n String tahunKendaraanPath = \"/api/registrasi/TahunKendaraanMobile\";\n String asalKendaraanPath = \"/api/registrasi/AsalKendaraanMobile\";\n String saveDataRegisterPath = \"/api/registrasi/SimpanMobile\";\n String validationOtpPath = \"/api/registrasi/validasiOtpMobile\";\n String resendOtpPath = \"/api/registrasi/resendOtp\";\n String logoutPath = \"/api/auth/logout\";\n String provincePath = \"/api/registrasi/Propinsi\";\n String kabupatenPath = \"/api/registrasi/Kabupaten\";\n String kecamatanPath = \"/api/registrasi/Kecamatan\";\n String kelurahanPath = \"/api/registrasi/Kelurahan\";\n String checkActiveTokenPath = \"/api/cekaktiftokenMobile\";\n String wareHousePath = \"/api/lokasi/warehouseMobile\";\n String homeLivePath = \"/api/Live/HomeMobile\";\n String homeComingSoonPath = \"/api/comingsoon/listeventMobile\";\n String homeHistoryPath = \"/api/Live/RiwayatMobile\";\n String liveVehicleDetailPath = \"/api/Live/detailMobile\";\n String timeServerPath = \"/api/jamserverMobile\";\n String liveNegoPath = \"/api/Live/LiveNegoMobile\";\n String liveBuyNowPath = \"/api/Live/LiveBuyNow\";\n String listCartPath = \"/api/Live/datakeranjang\";\n String setAndUnsetFavoritePath = \"/api/favorite/setAndUnsetFavorite\";\n String changePasswordPath = \"/api/auth/changePasswordForgot\";\n String generateVaPath = \"/api/Pembayaran/GenerateVA\";\n String invoiceVaPath = \"/api/Pembayaran/InvoiceVA\";\n String historyTransactionPath = \"/api/Live/RiwayatMobile\";\n String checkStatusHistoryTransactionPath = \"/api/Pembayaran/cekStatusPembayaran\";\n String merekPath = \"/api/filter/merek\";\n String gradePath = \"/api/filter/grade\";\n String infoMenuPath = \"/api/info/getInfo\";\n\n\n //@Headers(\"X-Requested-With:XMLHttpRequest\")\n\n @Headers(\"Content-Type: application/json\")\n @POST(loginPath)\n Single<LoginResponse> loginApi(@Body LoginRequest loginRequest);\n\n @Headers(\"Content-Type: application/json\")\n @GET(logoutPath)\n Call<GeneralResponse> logoutApi(@Header(\"Authorization\") String authToken);\n\n// @Headers(\"Content-Type: application/json\")\n// @POST(historyBillPaymentPath)\n// Single<HistoryBillPaymentResponse> historyBillPaymentApi(@Header(\"Authorization\") String authToken,\n// @Body HistoryTransactionRequest historyTransactionRequest);\n\n @Headers(\"Content-Type: application/json\")\n @GET(checkActiveTokenPath)\n Call<CheckActiveTokenResponse> checkActiveTokenApi(@Header(\"Authorization\") String authToken);\n\n @Headers(\"Content-Type: application/json\")\n @GET(provincePath)\n Call<ProvinceResponse> provinceApi();\n\n @Headers(\"Content-Type: application/json\")\n @POST(kabupatenPath)\n Call<KabupatenResponse> kabupatenApi(@Body KabupatenRequest kabupatenRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(kecamatanPath)\n Call<KecamatanResponse> kecamatanApi(@Body KecamatanRequest kecamatanRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(saveDataRegisterPath)\n Call<SaveDataRegisterResponse> saveDataRegisterApi(@Body SaveDataRegisterRequest saveDataRegisterRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(validationOtpPath)\n Call<GeneralResponse> validationOtpApi(@Body ValidationOtpRequest validationOtpRequest);\n\n\n @Headers(\"Content-Type: application/json\")\n @POST(resendOtpPath)\n Call<GeneralResponse> resendOtpApi(@Body ResendOtpRequest resendOtpRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(kelurahanPath)\n Call<KelurahanResponse> kelurahanApi(@Body KelurahanRequest kelurahanRequest);\n\n @Headers(\"Content-Type: application/json\")\n @GET(tipeUsahaPath)\n Call<TipeUsahaResponse> tipeUsahaApi(); \n \n @Headers(\"Content-Type: application/json\")\n @GET(questionOnePath)\n Call<QuestionResponse> questionOneApi();\n\n @Headers(\"Content-Type: application/json\")\n @GET(questionTwoPath)\n Call<QuestionResponse> questionTwoApi();\n\n @Headers(\"Content-Type: application/json\")\n @GET(questionThreePath)\n Call<QuestionResponse> questionThreeApi();\n\n @Headers(\"Content-Type: application/json\")\n @GET(questionFourPath)\n Call<QuestionResponse> questionFourApi();\n\n @Headers(\"Content-Type: application/json\")\n @GET(questionFivePath)\n Call<QuestionResponse> questionFiveApi();\n\n @Headers(\"Content-Type: application/json\")\n @GET(tahunKendaraanPath)\n Call<QuestionResponse> tahunKendaraanApi();\n\n @Headers(\"Content-Type: application/json\")\n @GET(asalKendaraanPath)\n Call<QuestionResponse> asalKendaraanApi();\n\n @Headers(\"Content-Type: application/json\")\n @GET(wareHousePath)\n Call<WareHouseResponse> wareHouseApi(@Header(\"Authorization\") String authToken);\n\n @Headers(\"Content-Type: application/json\")\n @POST(homeLivePath)\n Call<HomeLiveResponse> homeLiveApi(@Header(\"Authorization\") String authToken,\n @Body HomeLiveRequest homeLiveRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(homeComingSoonPath)\n Call<HomeComingSoonResponse> homeComingSoonApi(@Header(\"Authorization\") String authToken,\n @Body HomeComingSoonRequest homeComingSoonRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(homeHistoryPath)\n Call<HomeHistoryResponse> homeHistoryApi(@Header(\"Authorization\") String authToken,\n @Body HomeHistoryRequest homeHistoryRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(liveVehicleDetailPath)\n Call<VehicleDetailResponse> liveVehicleDetailApi(@Header(\"Authorization\") String authToken,\n @Body VehicleDetailRequest vehicleDetailRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(timeServerPath)\n Call<TimeServerResponse> timeServerApi();\n\n @Headers(\"Content-Type: application/json\")\n @POST(liveNegoPath)\n Call<GeneralNegoAndBuyNowResponse> liveNegoApi(@Header(\"Authorization\") String authToken,\n @Body NegoAndBuyNowRequest negoAndBuyNowRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(liveBuyNowPath)\n Call<GeneralNegoAndBuyNowResponse> liveBuyNowApi(@Header(\"Authorization\") String authToken,\n @Body NegoAndBuyNowRequest negoAndBuyNowRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(setAndUnsetFavoritePath)\n Call<GeneralResponse> setAndUnsetFavoriteApi(@Header(\"Authorization\") String authToken,\n @Body FavoriteRequest favoriteRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(listCartPath)\n Call<CartResponse> lisCartApi(@Header(\"Authorization\") String authToken);\n\n @Headers(\"Content-Type: application/json\")\n @POST(changePasswordPath)\n Call<GeneralResponse> changePasswordApi(@Body ChangePasswordRequest changePasswordRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(generateVaPath)\n Call<GenerateVaResponse> generateVaApi(@Header(\"Authorization\") String authToken,\n @Body GenerateVaRequest favoriteRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(invoiceVaPath)\n Call<InvoiceVaResponse> invoiceVaApi(@Header(\"Authorization\") String authToken,\n @Body InvoiceVaRequest invoiceVaRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(historyTransactionPath)\n Call<HistoryTransactionResponse> historyTransactionApi(@Header(\"Authorization\") String authToken,\n @Body HistoryTransactionRequest historyTransactionRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(merekPath)\n Call<MerekResponse> filterMerekApi(@Header(\"Authorization\") String authToken,\n @Body MerekRequest merekRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(gradePath)\n Call<GradeResponse> filterGradeApi(@Header(\"Authorization\") String authToken,\n @Body MerekRequest merekRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(infoMenuPath)\n Call<InfoMenuResponse> infoMenuApi(@Header(\"Authorization\") String authToken,\n @Body MerekRequest merekRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(checkStatusHistoryTransactionPath)\n Call<CheckStatusHistoryTransactionResponse> checkStatusHistoryTransactionApi(@Header(\"Authorization\") String authToken,\n @Body CheckStatusHistoryRequest historyTransactionRequest);\n\n}",
"public abstract String mo8770a();",
"void mo41083a();",
"private ApiInfo apiInfo()\r\n\t {\r\n\t ApiInfo apiInfo = new ApiInfo(\r\n\t \"My Project's REST API\",\r\n\t \"This is a description of your API.\",\r\n\t \"version-1\",\r\n\t \"API TOS\",\r\n\t \"inferno@mckesson.com\",\r\n\t \"API License\",\r\n\t \"API License URL\"\r\n\t );\r\n\t return apiInfo;\r\n\t }",
"int mo306b();",
"int mo302a();",
"public abstract String mo9239aw();",
"Petunia() {\r\n\t\t}",
"public abstract String mo118046b();",
"void mo1940i();",
"private APIClient() {\n }",
"private Public() {\n super(\"public\", null);\n }",
"private Api() {\n // Implement a method to build your retrofit\n buildRetrofit(BASE_URL);\n }",
"public interface MmInterface{\n //http://xehoihanoi.com.vn/api/auth/create?email=xuansang0509@gmail.com&password=123456&username=xuansang&phone=0986373770\n //1.\n @GET(\"api/auth/create\")\n Call<Response> createUser(@Query(\"username\") String username,@Query(\"email\") String email,@Query(\"password\") String password,@Query(\"phone\") String phone);\n\n //2.api/group/create?name=hoang&text=noidung&status=1\n @GET(\"api/auth/create\")\n Call<Response> createGroup(@Query(\"name\") String groupName,@Query(\"text\") String description,@Query(\"status\") String status);\n //3. http://xehoihanoi.com.vn/api/auth/login?email=xuansang0509@gmail.com&password=123456\n Call<Response> login(@Query(\"email\") String email,@Query(\"password\") String password);\n\n\n //4. Load AdUnitId\n\n}",
"private PluginAPI() {\r\n\t\tsuper();\r\n\t}",
"void mo38026a();",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"public interface HeshouyouApi {\n public String sendMsg(String msg);\n}",
"IWDViewController wdGetAPI();",
"void mo56163g();",
"public interface IPokeapiService {\n\n\n\n// @GET(\"lp_iem/result.json\")\n// Call<PokemonWs> listPokemon();\n\n @GET(\"?action=cardlist&\")\n Call<List<Pokemon>> listPokemon(@Query(\"user\")int user);\n //@Query(\"user\")int user\n\n @GET(\"?action=details&\")\n Call<Pokemon> getPokemon(@Query(\"card\")int id_card);\n\n @GET(\"?action=pokedex\")\n Call<List<Pokemon>> getPokedex();\n\n}",
"public abstract String mo24850a();",
"public interface QMApi {\n @GET(\"10001/getProvinceCityAreaList\")\n Call<BaseResModel<AddressEntity>> getProvinceCityAreaList(@Query(\"localVersion\") String localVersion);\n\n @POST(\"10001/qmLogin\")\n Call<BaseResModel<UserInfoEntity>> login(@Body RequestBody jsonBody);\n}",
"public KorisniciREST() {\n }",
"void mo88521a();",
"public abstract String mo41086i();",
"public abstract String mo10149a();",
"@Override\n public void memoria() {\n \n }",
"public interface API {\n\n// String BASE_URL = \"https://www.apiopen.top/\";\n String BASE_URL = \"http://gc.ditu.aliyun.com/\";\n\n\n @GET\n Observable<Response<ResponseBody>> doGet(@Url String Url);\n\n @FormUrlEncoded\n @POST\n Observable<Response<ResponseBody>> doPost(@Url String Url, @FieldMap HashMap<String, String> map);\n\n @Streaming\n @GET\n Observable<Response<ResponseBody>> doDownload(@Url String Url);\n}",
"public interface ClientApi extends Api {\n\n\t/**\n\t * To parse client request\n\t * \n\t * @param message\n\t * the request message from client to be parsed\n\t * @return IsoBuffer object the implementation of {@link ConcurrentHashMap}\n\t * @throws PosException\n\t * thrown when an exception occurs during parsing\n\t */\n\tpublic IsoBuffer parse(String message) throws PosException;\n\n\t/**\n\t * To parse emv data\n\t * \n\t * @param isoBuffer\n\t * the parsed buffer containing emv data\n\t * @return Map object containing tags and data as key value pair\n\t */\n\tpublic Map<EmvTags, String> parseEmvData(IsoBuffer isoBuffer);\n\n\t/**\n\t * To modify the {@link IsoBuffer} object for client response.\n\t * \n\t * @param isoBuffer\n\t * the buffer need to modified for response\n\t */\n\tpublic void modifyBits4Response(IsoBuffer isoBuffer, Data data);\n\n\t/**\n\t * To build the client message\n\t * \n\t * @param isoBuffer\n\t * the buffer holding all fields and data need to be formed as\n\t * response\n\t * @return response formed response {@link String} object need to responded\n\t * to client\n\t */\n\tpublic String build(IsoBuffer isoBuffer);\n\n\tpublic String getStoredProcedure();\n\t\n\tpublic Boolean checkHostToHost();\n\n\tpublic boolean errorDescriptionRequired();\n\n}",
"private Get() {}",
"private Get() {}",
"private ApiInfo getApiInfo()\n {\n Contact contact = new Contact(\"Melchior Vrolijk\", \"\",\"vrol0004@gmail.com\");\n\n return new ApiInfo(\n \"Spring boot secure API documentation\",\n \"This is the demo spring boot secure api project documentation\",\n \"1.0\",\"\",contact,\n \"\",\"\",Collections.emptyList());\n }",
"public abstract Object mo1185b();",
"public abstract String mo41079d();",
"public abstract Member mo23408O();",
"public interface Api {\n\n// String BASE_URL_REMOTE = \"http://192.168.0.11/videoworld/v1/\"; //远程服务器的\n\n String BASE_URL_REMOTE = \"http://www.luocaca.cn/VideoWorld/v1/\"; //远程服务器的\n// String BASE_URL_REMOTE = \"http://115.159.196.175/VideoWorld/v1/\"; //远程服务器的\n\n// String BASE_URL = \"http://v.juhe.cn/weather/\";\n\n\n @GET(\"citys\")\n Observable<AllCity> getAllCity(@Query(\"key\") String key);\n\n\n /**\n * http://localhost:8089/hello/book/add?name=大傻1&book_id=222&number=222&detail=详细信息\n *\n * @param book_id\n * @param number\n * @param detail\n * @param name\n * @return\n */\n\n @GET(\"book/add\")\n Observable<ApiResult> requestAdd(@Query(\"book_id\") String book_id,\n @Query(\"number\") String number,\n @Query(\"detail\") String detail,\n @Query(\"name\") String name,\n @Query(\"url\") String url\n );\n\n\n @GET(\"book/allbook\")\n Observable<ApiResult<List<Book>>> requestBookList();\n\n @GET(\"book/del/{bookId}\")\n Observable<ApiResult> requestDelete(@Path(\"bookId\") String bookId);\n\n @GET\n Observable<ObjectResponse> requestGetMovies(@Url String baseUrl, @Query(\"url\") String url);\n\n @GET\n Observable<ObjectResponse> requestAddMovies(@Url String baseUrl, @Query(\"url\") String url, @Query(\"list\") String list);\n\n //http://api.nlkmlk.com:81/love/user/1711111\n @GET\n Observable<Result> requestVip(@Url String baseUrl );\n\n\n}",
"void mo57278c();",
"@Override\n\t\tpublic void rest() {\n\t\t\t\n\t\t}",
"Room mo12151c();",
"void mo60892a();",
"void mo84a();",
"public void mo5382o() {\n }",
"void mo28306a();",
"public void mo6081a() {\n }",
"public abstract VKRequest mo118418h();",
"void mo1941j();",
"public OreAPI() {\n\t\tthis(DEFAULT_URL, null);\n\t}",
"public interface Api {\n @GET(\"sites\") //Check urls here https://inthecheesefactory.com/blog/retrofit-2.0/en?fb_comment_id=885081521586565_886605554767495\n Single<List<Site>> sitesGet();\n\n @GET(\"sites/state\")\n Single<List<SiteState>> sitesStateGet(@QueryMap() Map<String, String> query);\n\n @POST(\"sites/state/connection/follow\")\n Single<SiteState> follow(@Body FollowCommand params);\n\n @POST(\"sites/state/connection/unfollow\")\n Completable unfollow(@Body UnfollowCommand params);\n }",
"void mo10148a();",
"void mo37810a();",
"private Mongopool() {\n\t}",
"private NfkjBasic()\n\t\t{\n\t\t\t\n\t\t}",
"public SolicitudREST() {\n gson = new Gson();\n sdao= new SolicitudDAO();\n }",
"public abstract boolean mo2163j();",
"public abstract String mo9751p();",
"public interface KanazawaApi {\n /*@以降は用途に合わせて Get Post Put Delete を用いる\n @Pathは{}内の物を照会\n @Queryを用いることでよくあるevent.json?1d=19などを簡単に記述できる\n 例 getEvent(@Query(\"id\"));\n */\n\n @GET(\"/{name}.json\")// 「/」から開始しないとはじかれる\n public Observable<KanazawaEntity> getEvent(@Path(\"name\")String url);\n}",
"public void mo4359a() {\n }",
"public interface DubboApi {\n\n User hello(String name);\n\n String sleep();\n}",
"public interface API {\n @GET(\"api/v1.5/tr.json/translate\")\n Call<Resp> Translate(@QueryMap Map<String, String> parameters);\n\n}",
"public Musik(){}",
"Makhluk() { // kosong\n\n }",
"public interface TvApi {\n\n /*\n 获取电视节目表\n */\n @POST(\"getProgram\")\n Call<TvShowData> getProgram(@Query(\"code\") String code, @Query(\"date\") String date, @Query(\"key\") String key);\n\n /*\n 获取频道类型列表\n */\n @POST(\"getCategory\")\n Call<TvTypeData> getCategory(@Query(\"key\") String key);\n\n /*\n\n */\n @POST(\"getChannel\")\n Call<TvChannelData> getChannel(@Query(\"pId\") String pId, @Query(\"key\") String key);\n}"
] | [
"0.6772238",
"0.67619944",
"0.65091586",
"0.6396262",
"0.6234739",
"0.6194089",
"0.61809206",
"0.6066698",
"0.6064472",
"0.6050636",
"0.6030857",
"0.597371",
"0.5970213",
"0.59693444",
"0.59529257",
"0.59397525",
"0.5930988",
"0.59098005",
"0.59005713",
"0.58940196",
"0.58820325",
"0.58686304",
"0.58580774",
"0.5813584",
"0.58015925",
"0.5798545",
"0.57961524",
"0.5795762",
"0.57932085",
"0.57892185",
"0.57892185",
"0.57892185",
"0.57892185",
"0.57892185",
"0.57892185",
"0.57892185",
"0.5786351",
"0.5779246",
"0.57776386",
"0.57749957",
"0.5728183",
"0.5727476",
"0.5726641",
"0.57252395",
"0.5722451",
"0.57210296",
"0.5715548",
"0.5715471",
"0.5714723",
"0.5710424",
"0.57016665",
"0.5693662",
"0.5691212",
"0.5686205",
"0.5686071",
"0.5674477",
"0.5670111",
"0.5669186",
"0.5667832",
"0.5666976",
"0.5659274",
"0.56566125",
"0.565182",
"0.56465775",
"0.56387055",
"0.563486",
"0.56292105",
"0.5628649",
"0.5628649",
"0.56284857",
"0.56281203",
"0.562163",
"0.5619261",
"0.5619048",
"0.5618844",
"0.56172776",
"0.5615203",
"0.5609291",
"0.5602457",
"0.5598317",
"0.5597122",
"0.5595663",
"0.5595168",
"0.55924135",
"0.5591316",
"0.55894303",
"0.5584098",
"0.5577003",
"0.5576474",
"0.55763054",
"0.55730695",
"0.5572621",
"0.55704004",
"0.556892",
"0.5559456",
"0.55585",
"0.55497015",
"0.5548514",
"0.55444515",
"0.5540026"
] | 0.59791595 | 11 |
Gets the status of any of Mojang's servers. | public MojangServiceState getServiceStatus(@Nonnull MojangServiceType server) {
try {
HttpURLConnection connection = getGetConnection("https://status.mojang.com/check");
int status = connection.getResponseCode();
Reader streamReader = null;
if (status > 299) {
return MojangServiceState.UNKNOWN;
} else {
streamReader = new InputStreamReader(connection.getInputStream());
}
BufferedReader reader = new BufferedReader(streamReader);
MojangServiceState state = MojangServiceState.valueOf(StringUtils.substringBetween(StringUtils.substringBetween(reader.readLine(),"[","]").split(",")[server.getIndex()],"{","}").split(":")[1].replaceAll("\"","").toUpperCase(Locale.ROOT));
reader.close();
connection.disconnect();
return state;
} catch (IOException e) {
return MojangServiceState.UNKNOWN;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void getStatus() {\n\t\ttry {\n\t\t\tint i = 1;\n\t\t\tList<Object[]>serverDetails = ServerStatus.getServerDetails();\n\t\t\tfor (Object[] servers:serverDetails){\n\t\t\t\tServerStatus.verifyServerStatus(i,(String)servers[0], (String)servers[1], (String)servers[2]);\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch (Exception ex){\n\t\t\tex.printStackTrace();\n\t\t}\n\t}",
"public List<Server> getAllServers(){\n\t\tlogger.info(\"Getting the all server details\");\n\t\treturn new ArrayList<Server>(servers.values());\n\t}",
"public ServerStatus[] getServerStatus() {\r\n ServerStatus[] toReturn = new ServerStatus[0];\r\n\r\n String[] paramFields = {\"item_delimiter\", \"value_delimiter\"};\r\n SocketMessage request = new SocketMessage(\"admin\", \"server_status\",\r\n SocketMessage.PriorityType.EMERGENCY, SocketMessage.TransferType.BI_WAY, \"\", paramFields);\r\n request.setValue(\"item_delimiter\", ITEM_DELIMITER);\r\n request.setValue(\"value_delimiter\", VALUE_DELIMITER);\r\n\r\n SocketMessage response = handleMessage(request);\r\n if (!isSuccessful(response)) {\r\n if (\"\".equals(response.getErrorCode())) {\r\n setError(\"APIL_0201\", \"couldn't get server status\");\r\n } else {\r\n wrapError(\"APIL_0201\", \"couldn't get server status\");\r\n }\r\n return toReturn;\r\n } else {\r\n String serversString = response.getValue(\"servers\");\r\n StringTokenizer tokenizer = new StringTokenizer(serversString, ITEM_DELIMITER);\r\n toReturn = new ServerStatus[tokenizer.countTokens()];\r\n try {\r\n for (int i = 0; i < toReturn.length; i++) {\r\n String itemString = tokenizer.nextToken();\r\n StringTokenizer itemTokenizer = new StringTokenizer(itemString, VALUE_DELIMITER);\r\n String ip = itemTokenizer.nextToken();\r\n String portString = itemTokenizer.nextToken();\r\n String aliveString = itemTokenizer.nextToken();\r\n String timeString = itemTokenizer.nextToken();\r\n int port = Integer.parseInt(portString.trim());\r\n boolean alive = \"y\".equals(aliveString);\r\n long time = Tools.parseTime(timeString.trim());\r\n toReturn[i] = new ServerStatus(ip, port, time, alive);\r\n }\r\n } catch (Exception e) {\r\n setError(\"APIL_0202\", \"error in parsing status string: \" + serversString);\r\n return new ServerStatus[0];\r\n }\r\n }\r\n\r\n return toReturn;\r\n }",
"public List<ServerHardware> getServers();",
"public ServerList getServers() {\r\n return this.servers;\r\n }",
"List<Long> getServers();",
"public NdexStatus getServerStatus() throws IOException, NdexException {\n\t\treturn getServerStatus(false);\t\n }",
"public ArrayList<Server> getServers(){\n return this.serversList;\n }",
"List<Server> servers() {\n return servers;\n }",
"public NetworkInstance[] getServers();",
"public boolean[] getStatus()\n {\n\t return online;\n }",
"public static List<SkungeeServer> getServers() {\n\t\treturn ServerManager.getServers();\n\t}",
"@Override\n @GET\n @Path(\"/servers\")\n @Produces(\"application/json\")\n public Response getServers() throws Exception {\n log.trace(\"getServers() started.\");\n JSONArray json = new JSONArray();\n for (Server server : cluster.getServerList()) {\n JSONObject o = new JSONObject();\n String uri = String.format(\"%s/servers/%d\", rootUri, server.getServerId());\n String serverUri = String.format(\"/providers/%d/servers/%d\", provider.getProviderId(), server.getServerId());\n o.put(\"uri\", uri);\n o.put(\"baseUri\", serverUri);\n json.put(o);\n }\n\n log.trace(\"getServers() finished successfully.\");\n return Response.ok(json.toString()).build();\n }",
"public int fetchServerStatus (GUICalcProgressBar progress) {\n\n\t\t// Call the standard function in ServerCmd\n\n\t\tSystem.out.println ();\n\t\tint result = ServerCmd.gui_show_relay_status (progress);\n\n\t\treturn result;\n\t}",
"public List<ApplicationGatewayBackendHealthServerInner> servers() {\n return this.servers;\n }",
"public List<Server> getServerList() {\n return serverList;\n }",
"public List<Server> getServerList() {\n return new ArrayList<Server>(serversList);\n }",
"public List<ServerServices> listServerServices();",
"public static List<Object[]> getServerDetails(){\n\t\t\n\t\tString filePath = Holders.getFlatConfig().get(\"statusFile.use\").toString();\n\n\t\treturn getServerDetailsFromCSV(filePath, \"hostname\", \"user\",\"password\");\n\t}",
"private List<Server> getRemoteServers() {\n if (!isDas())\n throw new RuntimeException(\"Internal Error\"); // todo?\n\n List<Server> notdas = new ArrayList<Server>(targets.size());\n String dasName = serverEnv.getInstanceName();\n\n for (Server server : targets) {\n if (!dasName.equals(server.getName()))\n notdas.add(server);\n }\n\n return notdas;\n }",
"boolean hasServer();",
"public int[] availableServers() throws RemoteException {\n\t\t\tint i = 0;\n\n\t\t\t// convert to primitives array\n\t\t\tint[] result = new int[m_services.size()];\n\t\t\tfor (Integer id : m_services.keySet())\n\t\t\t\tresult[i++] = id;\n\t\t\t\n\t\t\treturn result;\n\t\t}",
"List<HttpServletServer> getHttpServers();",
"public static Server [] getServers(){\r\n Enumeration serversEnum = servers.elements();\r\n Server [] arr = new Server[servers.size()];\r\n for (int i = 0; i < arr.length; i++)\r\n arr[i] = (Server)serversEnum.nextElement();\r\n\r\n return arr;\r\n }",
"public boolean availableServer(){\n for(int i = 0; i < cntServer; i++){\n if(serverArray[i].busy == false){return true;}\n }\n return false;\n }",
"private static boolean isServerReachable() {\n\t\treturn new PingRpcExample().pingServer();\n\t}",
"public int getNumOfServers() {\n return numOfServers;\n }",
"public List<String> nameServers() {\n return this.nameServers;\n }",
"ResponseDTO startAllServers();",
"@HTTP(\n method = \"GET\",\n path = \"/apis/config.openshift.io/v1/apiservers/{name}/status\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesCall<APIServer> readAPIServerStatus(\n @Path(\"name\") String name);",
"public String getStatus() {\n try {\n ClusterHealthResponse clusterHealthResponse =\n this.client.admin().cluster().health(new ClusterHealthRequest()).get();\n return clusterHealthResponse.getStatus().name();\n } catch (InterruptedException | ExecutionException e) {\n logger.error(\"Error when obtain cluster health\", e);\n throw new ElasticExecutionException(\"Error when trying to obtain the server status\");\n }\n }",
"public PropertyRemoteServers getServers() {\n return this.m_Servers;\n }",
"private String getZkServers(ServletContext context){\n Configuration config = new Configuration();\n config.addResource(\"pxf-site.xml\");\n String zk_hosts = config.get(\"zookeeper\");\n if(LOG.isDebugEnabled())\n LOG.debug(\"zookeeper server is :\" + zk_hosts);\n\n return zk_hosts;\n }",
"public Object[] getNameServers() {\n\t\treturn _nameservers.toArray();\n\t}",
"public java.util.List<java.lang.Integer>\n getStatusList() {\n return status_;\n }",
"String getServerName() {\n return game.z.C;\n }",
"public java.util.List<String> getStatuses() {\n return statuses;\n }",
"boolean hasServerState();",
"private void notifyWhenServerIsOffline() {\n //We check if the user has enabled the notification\n if (!userPreferences.notifyWhenServerGoesOffline().get()) {\n if (DEBUG)\n Log.d(TAG, \"Notifications when a server goes offline are not enabled. Skipping\");\n return;\n }\n\n //After we have updated all servers\n final Observable<MinecraftServerEntity> offlineServersObservable = Observable.from(servers)\n .filter(new Func1<MinecraftServerEntity, Boolean>() {\n @Override\n public Boolean call(MinecraftServerEntity server) {\n return server.getDetailedStatus() == MinecraftServer.DetailedStatus.OFFLINE;\n }\n });\n\n //We create a notification only for servers that the user does not know they are offline.\n final Observable<List<MinecraftServerEntity>> serversRequiringNotification = offlineServersObservable.asObservable()\n .filter(new Func1<MinecraftServerEntity, Boolean>() {\n @Override\n public Boolean call(MinecraftServerEntity minecraftServerEntity) {\n return !minecraftServerEntity.hasOfflineStatusBeenSeen();\n }\n })\n .toList();\n\n //TODO : zip the two observable to have both the list and the number of offline servers.\n Observable.zip(offlineServersObservable.count(), serversRequiringNotification, new Func2<Integer, List<MinecraftServerEntity>, Object[]>() {\n @Override\n public Object[] call(Integer numberOfOfflineServers, List<MinecraftServerEntity> serversRequiringNotification) {\n return new Object[]{numberOfOfflineServers, serversRequiringNotification};\n }\n })\n .observeOn(AndroidSchedulers.mainThread())\n .subscribeOn(AndroidSchedulers.mainThread())\n .subscribe(new Action1<Object[]>() {\n @Override\n public void call(Object[] objects) {\n final Integer numberOfOfflineServers = (Integer) objects[0];\n final List<MinecraftServerEntity> serversRequiringNotification = (List<MinecraftServerEntity>) objects[1];\n\n if (DEBUG) {\n final StringBuilder sServersRequiringNotification = new StringBuilder();\n for (MinecraftServerEntity e : serversRequiringNotification) {\n if (sServersRequiringNotification.length() == 0)\n sServersRequiringNotification.append(\"'\" + e.getName() + \"'\");\n else\n sServersRequiringNotification.append(\", '\" + e.getName() + \"'\");\n }\n if (sServersRequiringNotification.length() == 0)\n sServersRequiringNotification.append(\"(none)\");\n Log.d(TAG, \"Number of offline servers : \" + numberOfOfflineServers + \". Offline server(s) requiring a notification : \" + sServersRequiringNotification.toString());\n }\n //If the service is bound to an activity, we do not notify the user\n if (bindCount > 0) {\n if (DEBUG)\n Log.d(TAG, \"Activity is displayed to end-user. Notification muted.\");\n notificationManager.cancel(OFFLINE_SERVER_NOTIFICATION_ID);\n } else {\n if (serversRequiringNotification.size() > 0) {\n final Notification notification = buildNotificationForOfflineServers(numberOfOfflineServers, serversRequiringNotification);\n notificationManager.notify(OFFLINE_SERVER_NOTIFICATION_ID, notification);\n } else\n notificationManager.cancel(OFFLINE_SERVER_NOTIFICATION_ID);\n }\n }\n });\n\n }",
"public Response status() {\n return getStates();\n }",
"public List<String> getCommandStatus() {\n\t\tList<Device> devices = DeviceClientSingleton.getDeviceList();\r\n\t\tList<String> commandStatus = new ArrayList<String>();\r\n\t\tfor (int i = 0; i < devices.size(); i++) {\r\n\t\t\tString deviceData = DeviceClientSingleton.getDeviceData(devices.get(i).getDeviceId());\r\n\t\t\tcommandStatus.add(deviceData);\r\n\t\t\tif ((!deviceData.equals(\"\")) && (!deviceData.equals(\" \"))) {\r\n\t\t\t\tDeviceClientSingleton.removeDeviceData(devices.get(i).getDeviceId());\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn commandStatus;\r\n\t}",
"@Override\n\tpublic GameServerStatus getModel() {\n\t\treturn gameServerStatus;\n\t}",
"public List<TorrentStatus> status() {\n torrent_status_vector v = alert.getStatus();\n int size = (int) v.size();\n\n List<TorrentStatus> l = new ArrayList<>(size);\n for (int i = 0; i < size; i++) {\n l.add(new TorrentStatus(v.get(i)));\n }\n\n return l;\n }",
"public String getStunServer();",
"public WorkerStatus getStatus(){\r\n\t\ttry {\r\n\t\t\t//System.out.println(\"Place 1\");\r\n\t\t\treturn this.workerStatusHandler.getWorkerStatus(this.getPassword());\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\t//System.out.println(\"Place 2\");\r\n\t\t\te.printStackTrace();\r\n\t\t\tdead = true;\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"com.google.rpc.Status getStatus();",
"com.google.rpc.Status getStatus();",
"public static ServerList getCurrentList(Context context) {\n if (sCurrentList != null)\n return sCurrentList;\n\n try {\n sCurrentList = parseCachedList(context);\n }\n catch (IOException e) {\n try {\n sCurrentList = parseBuiltinList(context);\n }\n catch (IOException be) {\n Log.w(TAG, \"unable to load builtin server list\", be);\n }\n }\n\n return sCurrentList;\n }",
"public Integer serverCount() {\n return this.serverCount;\n }",
"public static final void handleServerStatus(final MapleClient c) {\n final int numPlayer = LoginServer.getUsersOn();\n final int userLimit = LoginServer.getUserLimit();\n if (numPlayer >= userLimit) {\n c.sendPacket(LoginPacket.getServerStatus(2));\n } else if (numPlayer * 2 >= userLimit) {\n c.sendPacket(LoginPacket.getServerStatus(1));\n } else {\n c.sendPacket(LoginPacket.getServerStatus(0));\n }\n }",
"boolean runsServer();",
"@Override public Collection<String> getServerIds() {\n return getTrackedBranches().getServerIds();\n }",
"public static String getAll() {\n Result r = new Result();\n int status = 0;\n if((status = doGetList(r)) != 200) return \"Error from server \"+ status;\n return r.getValue();\n }",
"@Override\n\tpublic Collection<InetSocketAddress> getAvaliableServers() {\n\t\treturn null;\n\t}",
"public void waitServersReady() {\n }",
"public java.lang.String[] getServerIds() {\r\n return serverIds;\r\n }",
"public JenkinsStatus getStatus() {\n return status;\n }",
"public String getServerName();",
"@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response index() {\n ArrayList<String> serversClone = new ArrayList<>();\n this.cm.getServers().forEach(server -> {\n serversClone.add(server);\n });\n while (!serversClone.isEmpty()) {\n String selectedServer = this.cm.getServer();\n serversClone.remove(selectedServer);\n try{\n String endpoint = \"http://\" + selectedServer\n + \"/WebService/webresources/files\";\n String methodType=\"GET\";\n URL url = new URL(endpoint);\n HttpURLConnection urlConnection = (HttpURLConnection) \n url.openConnection();\n urlConnection.setRequestMethod(methodType);\n urlConnection.setDoOutput(true);\n urlConnection.setRequestProperty(\n \"Content-type\", MediaType.APPLICATION_JSON\n );\n urlConnection.setRequestProperty(\n \"Accept\", MediaType.APPLICATION_JSON\n );\n int httpResponseCode = urlConnection.getResponseCode();\n if (httpResponseCode == HttpURLConnection.HTTP_OK) {\n BufferedReader in = new BufferedReader(\n new InputStreamReader(urlConnection.getInputStream()));\n String inputLine;\n StringBuilder content = new StringBuilder();\n while ((inputLine = in.readLine()) != null) {\n content.append(inputLine);\n }\n return Response.ok(content.toString()).build();\n } else {\n if (serversClone.isEmpty()) {\n return Response\n .status(httpResponseCode).build();\n }\n } \n } catch (IOException ex) {\n System.err.println(ex);\n return Response.serverError().build();\n }\n }\n return Response.status(HttpURLConnection.HTTP_UNAVAILABLE).build();\n }",
"String status();",
"String status();",
"protected void selectValidServer() {\n boolean lastError = false;\n for (NotificationServiceOuterClass.MemberProto livingMember : livingMembers) {\n try {\n currentUri = livingMember.getServerUri();\n initNotificationServiceStub();\n NotificationServiceOuterClass.ListMembersRequest request =\n NotificationServiceOuterClass.ListMembersRequest.newBuilder()\n .setTimeoutSeconds(listMemberIntervalMs / 1000)\n .build();\n NotificationServiceOuterClass.ListMembersResponse response = notificationServiceStub.listMembers(request);\n if (response.getReturnCode() == NotificationServiceOuterClass.ReturnStatus.SUCCESS) {\n livingMembers = new HashSet<>(response.getMembersList());\n lastError = false;\n break;\n } else {\n lastError = true;\n }\n } catch (Exception e) {\n lastError = true;\n }\n }\n if (lastError) {\n logger.warn(\"No available server uri!\");\n }\n }",
"public ArrayList<StatusInfo> getStatusInfoList() {\n return this.statusInfoList;\n }",
"public boolean isRunning ()\n {\n return server == null ? false : true;\n }",
"@Override\n public List<AppServerType> getServerType()\n {\n return AppServerType.allvalues();\n }",
"public boolean startAll() throws ServerException;",
"public boolean ping();",
"default Promise<List<String>> findHealthyNodes() {\n final Promise<List<String>> promise = Promises.promise();\n promise.resolve(Collections.emptyList());\n return promise;\n }",
"@Override\n\tpublic List<String> getServersDescription() {\n\t\treturn null;\n\t}",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"int getStatus();",
"private boolean checkServer(Context mContext) {\n\t\t\t\tConnectivityManager cm = (ConnectivityManager) mContext\n\t\t\t\t\t\t.getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\t\t\tNetworkInfo netInfo = cm.getActiveNetworkInfo();\n\t\t\t\tif (netInfo != null && netInfo.isConnectedOrConnecting()) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}",
"public int getStatus();",
"public int getStatus();",
"public int getStatus();",
"public boolean isSetServersShuttingDown() {\n return this.serversShuttingDown != null;\n }",
"public int getStatusCount() {\n return status_.size();\n }",
"public Status getStatus();",
"public List<SkungeeServer> getServers(String... servers) {\n\t\treturn ServerManager.getServers(servers);\n\t}",
"@Exported\n public int getNumberOfOfflineSlaves() {\n int count = 0;\n for (Slave s : slaves) {\n if (s.getComputer().isOffline()) {\n count++;\n }\n }\n return count;\n }",
"public Map<String, Object> getStatus() throws IOException {\n String httpResponse = httpGet(baseUrl.resolve(\"/_status\"));\n return mapper.readValue(httpResponse, new TypeReference<Map<String, Object>>() {\n });\n }",
"@GET\n @Path(\"jobs/status\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response jobActiveByStatus() {\n List<LGJob> jobs = Utils.getJobManager().getAllLimitFields(\"_id\", \"status\", \"reason\");\n JSONObject ob = new JSONObject();\n for (LGJob job : jobs) {\n JSONObject t = new JSONObject();\n t.put(\"status\", job.getStatusString(job.getStatus()));\n t.put(\"reason\", job.getReason());\n ob.put(job.getJobId(), t);\n }\n return Response.status(200).entity(ob.toString(1)).build();\n }",
"public Iterator<PresenceStatus> getSupportedStatusSet()\n {\n return parentProvider.getJabberStatusEnum().getSupportedStatusSet();\n }",
"public String status() throws Exception {\n\n \t\tString apiUrl = \"api/status.json\";\n \t\t\n \t\tString url = this.baseUrl + apiUrl;\n\n URL urlObj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) urlObj.openConnection();\n\n con.setRequestMethod(\"GET\");\n\n con.setRequestProperty(\"User-Agent\", USER_AGENT);\n\n int responseCode = con.getResponseCode();\n String response = \"\";\n\t\tif (responseCode == 200) {\n response = buildReponse(con);\n\t\t} else {\n\t response = \"{'error': 'Something went wrong, looks like the server is down.'}\";\n\t\t}\n\n\t\treturn response; \n \t}",
"public List<RegionServer> regionServers() {\n\t\tBufferedReader bufReader = null;\n\t\tInputStreamReader input = null;\n\t\tList<RegionServer> list = new ArrayList<>();\n\t\ttry {\n\t\t\tURL url = new URL(HBase.HTTP + SystemConfig.getProperty(\"hive.cube.hbase.master\") + HBase.HBASE_REGION_SERVER_JMX);\n\t\t\tHttpURLConnection httpConn = (HttpURLConnection) url.openConnection();\n\t\t\tinput = new InputStreamReader(httpConn.getInputStream(), \"UTF-8\");\n\t\t\tbufReader = new BufferedReader(input);\n\t\t\tString line = \"\";\n\t\t\tStringBuilder contentBuf = new StringBuilder();\n\t\t\twhile ((line = bufReader.readLine()) != null) {\n\t\t\t\tcontentBuf.append(line);\n\t\t\t}\n\t\t\tJSONObject tmpBuf = JSON.parseObject(contentBuf.toString());\n\t\t\tJSONObject object = (JSONObject) JSON.parseArray(tmpBuf.getString(\"beans\")).get(0);\n\t\t\tString[] liveRegionServers = object.getString(\"tag.liveRegionServers\").split(\";\");\n\t\t\tfor (String node : liveRegionServers) {\n\t\t\t\tif (node.length() != 0) {\n\t\t\t\t\tRegionServer region = new RegionServer();\n\t\t\t\t\tregion.setRegionName(node.split(\",\")[0] + \":\" + node.split(\",\")[1]);\n\t\t\t\t\tregion.setStartTime(CalendarUtils.convertUnixTime(Long.parseLong(node.split(\",\")[2])));\n\t\t\t\t\tregion.setLive(true);\n\t\t\t\t\tlist.add(region);\n\t\t\t\t}\n\t\t\t}\n\t\t\tString[] deadRegionServers = object.getString(\"tag.deadRegionServers\").split(\";\");\n\t\t\tfor (String node : deadRegionServers) {\n\t\t\t\tif (node.length() != 0) {\n\t\t\t\t\tRegionServer region = new RegionServer();\n\t\t\t\t\tregion.setRegionName(node.split(\",\")[0] + \":\" + node.split(\",\")[1]);\n\t\t\t\t\tregion.setStartTime(CalendarUtils.convertUnixTime(Long.parseLong(node.split(\",\")[2])));\n\t\t\t\t\tregion.setLive(false);\n\t\t\t\t\tlist.add(region);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLOG.error(\"Filter[Region] HBase JMX has error,msg is \" + e.getMessage());\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (input != null) {\n\t\t\t\t\tinput.close();\n\t\t\t\t}\n\t\t\t\tif (bufReader != null) {\n\t\t\t\t\tbufReader.close();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tLOG.error(\"Close IO has error,msg is \" + e.getMessage());\n\t\t\t}\n\t\t}\n\n\t\treturn list;\n\t}",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();"
] | [
"0.72742355",
"0.6764961",
"0.66735",
"0.66134334",
"0.63161296",
"0.63129944",
"0.6298187",
"0.62814444",
"0.62493205",
"0.6133674",
"0.6031233",
"0.602143",
"0.5985233",
"0.5983279",
"0.598065",
"0.592631",
"0.5859884",
"0.5848029",
"0.5826182",
"0.5802082",
"0.57985854",
"0.5789802",
"0.5755614",
"0.5736399",
"0.5705085",
"0.56834126",
"0.5603088",
"0.5601365",
"0.5591583",
"0.5577951",
"0.5502766",
"0.54719585",
"0.5470095",
"0.5465176",
"0.546443",
"0.54472774",
"0.54464495",
"0.54362077",
"0.54323477",
"0.540516",
"0.54046136",
"0.5390055",
"0.53883344",
"0.537952",
"0.5364024",
"0.53636545",
"0.53636545",
"0.53389835",
"0.5326038",
"0.5324849",
"0.5322929",
"0.53228724",
"0.53035355",
"0.5293509",
"0.5283671",
"0.5276008",
"0.5265806",
"0.52604187",
"0.5253557",
"0.52491283",
"0.52491283",
"0.52339524",
"0.52330244",
"0.5231235",
"0.5220599",
"0.5218641",
"0.52008873",
"0.5192022",
"0.5186611",
"0.518636",
"0.518636",
"0.518636",
"0.518636",
"0.518636",
"0.518636",
"0.518636",
"0.518636",
"0.518636",
"0.518636",
"0.518636",
"0.5185346",
"0.5175905",
"0.5175905",
"0.5175905",
"0.5172052",
"0.5170093",
"0.51654637",
"0.51543677",
"0.5152724",
"0.5139896",
"0.5139868",
"0.51356167",
"0.51289314",
"0.51282334",
"0.51256776",
"0.51256776",
"0.51256776",
"0.51256776",
"0.51256776",
"0.51256776"
] | 0.61298585 | 10 |
/ Napisati program koji ce ispisati n brojeva Fibonacijevog niza. (Na internetu istraziti sta je Fibonacijev niz!!!) | public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Unesite ceo broj da dobijete Fibonacijev niz");
int n = sc.nextInt();
int a = 0;
int b = 1;
int sum, i;
System.out.println(a);
System.out.println(b);
for (i = 2; i <= n; ++i) {
sum = a + b;
a = b;
b = sum;
{
System.out.println(sum);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void ispisiSveNapomene() {\r\n\t\tint i = 0;// redni broj napomene\r\n\t\tint brojac = 0;\r\n\t\tfor (Podsjetnik podsjetnik : lista) {\r\n\r\n\t\t\ti++;\r\n\t\t\tSystem.out.println(i + \")\" + podsjetnik);\r\n\t\t\tbrojac = i;\r\n\t\t}\r\n\t\tif (brojac == 0) {\r\n\t\t\tSystem.out.println(\"Nema unesenih napomena!!\");\r\n\t\t}\r\n\r\n\t}",
"public static void brisanjeVozila() {\n\t\tint i = 0;\n\t\tfor (Vozilo v : Main.getVozilaAll()) {\n\t\t\tSystem.out.println(i + \"-Vrsta Vozila|\" + v.getVrstaVozila() + \" Registarski broj|\" + v.getRegBR()\n\t\t\t\t\t+ \" Status izbrisanosti vozila|\" + v.isVozObrisano());\n\t\t\ti++;\n\t\t}\n\t\tSystem.out.println(\"----------------------------------------\");\n\t\tSystem.out.println(\"Unesite redni broj vozila koje zelite da izbrisete ili vratite u neobrisano stanje\");\n\t\tint redniBroj = UtillMethod.unesiteInt();\n\t\tif (redniBroj < Main.getVozilaAll().size()) {\n\t\t\tVozilo temp = Main.getVozilaAll().get(redniBroj);\n\t\t\tif (UtillMethod.voziloImaRezervacije(temp)) {\n\t\t\t\tSystem.out.println(\"Ovo vozilo ima aktivne rezervacije i ne moze biti obrisano!\");\n\t\t\t} else {\n\t\t\t\tif (temp.isVozObrisano()) {\n\t\t\t\t\ttemp.setVozObrisano(false);\n\t\t\t\t\tSystem.out.println(\"Vozilo je vraceno u sistem(neobrisano stanje)\");\n\t\t\t\t} else {\n\t\t\t\t\ttemp.setVozObrisano(true);\n\t\t\t\t\tSystem.out.println(\"Vozilo je uspesno izbrisano!\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"Ne postoji vozilo sa tim brojem!\");\n\t\t}\n\t}",
"void zmniejszBieg();",
"float znajdzOstatecznaCene()\n\t{\n\t\t//getInput(\"znajdzOstatecznaCene\");\n\t\t//print (\"znajdzOstatecznaCene \"+iteracja);\n\t\t\n\t\t//debug\n\t\tBoolean debug = false;\n\t\tif (LokalneCentrum.getCurrentHour().equals(\"03:00\"))\n\t\t{\n\t\t\tprint(\"03:00 on the clock\",debug);\n\t\t\tdebug=false;\n\t\t}\n\t\t\n\t\t//wszystkie ceny jakie byly oglaszan ne na najblizszy slot w \n\t\tArrayList<Float> cenyNaNajblizszySlot =znajdzOstatecznaCeneCenaNaNajblizszeSloty();\n\t\t\n\t\t\n\t\t//Stworzenie cen w raportowaniu\n\t\tint i=0;\n\t\twhile (i<cenyNaNajblizszySlot.size())\n\t\t{\n\t\t\trynekHistory.kontraktDodajCene(cenyNaNajblizszySlot.get(i));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tprint(\"ceny na najblizszy slot \"+cenyNaNajblizszySlot.size());\n\n\t\t\n\t\t//do rpzerobienia problemu minimalizacji na maksymalizacje\n\t\tint inverter =-1;\n\t\t\n\t\ti=0;\n\t\tfloat cena =cenyNaNajblizszySlot.get(i);\n\t\tfloat minimuCena =cena;\t\t\n\t\tfloat minimumValue =inverter*funkcjaRynku2(cena, false,true);\n\t\ti++;\n\t\t\n\t\trynekHistory.kontraktDodajWartoscFunkcjiRynku(funkcjaRynku2(cena, false), minimuCena);\n\t\t\n\t\twhile (i<cenyNaNajblizszySlot.size())\n\t\t{\n\t\t\tcena =cenyNaNajblizszySlot.get(i);\n\t\t\tfloat value =inverter*funkcjaRynku2(cena, false,true);\t\t\t\n\n\t\t\trynekHistory.kontraktDodajWartoscFunkcjiRynku(funkcjaRynku2(cena, false), cena);\n\n\t\t\tif (value<minimumValue)\n\t\t\t{\n\t\t\t\tminimuCena =cena;\n\t\t\t\tminimumValue = value;\n\n\t\t\t}\n\t\t\t\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tif(debug)\n\t\t{\n\t\t\tgetInput(\"03:00 end\");\n\t\t}\n\t\t\n\t\t//getInput(\"znajdzOstatecznaCene - nto finished\");\n\t\treturn minimuCena;\n\t\t\n\t}",
"public static void dodavanjeBicikl() {\n\t\tString vrstaVozila = \"Bicikl\";\n\t\tString regBr = UtillMethod.unosRegBroj();\n\t\tGorivo gorivo = Main.nista;\n\t\tint brServisa = 1;\n\t\tdouble potrosnja100 = 0;\n\t\tSystem.out.println(\"Unesite broj km koje je vozilo preslo:\");\n\t\tdouble predjeno = UtillMethod.unesiteBroj();\n\t\tdouble preServisa = 700;\n\t\tdouble cenaServisa = 5000;\n\t\tSystem.out.println(\"Unesite cenu vozila za jedan dan:\");\n\t\tdouble cenaDan = UtillMethod.unesiteBroj();\n\t\tint brSedist = 1;\n\t\tint brVrata = 0;\n\t\tboolean vozObrisano = false;\n\t\tArrayList<Gorivo> gorivaVozila = new ArrayList<Gorivo>();\n\t\tgorivaVozila.add(gorivo);\n\t\tArrayList<Servis> servisiNadVozilom = new ArrayList<Servis>();\n\t\tBicikl vozilo = new Bicikl(vrstaVozila, regBr, gorivaVozila, brServisa, potrosnja100, predjeno, preServisa,\n\t\t\t\tcenaServisa, cenaDan, brSedist, brVrata, vozObrisano, servisiNadVozilom);\n\t\tUtillMethod.prviServis(vozilo, predjeno);\n\t\tMain.getVozilaAll().add(vozilo);\n\t\tSystem.out.println(\"Novo vozilo je uspesno dodato u sistem!\");\n\t\tSystem.out.println(\"--------------------------------------\");\n\t}",
"public static void proveraServisa() {\n\t\tSystem.out.println(\"Unesite redni broj vozila za koje racunate vreme sledeceg servisa:\");\n\t\tUtillMethod.izlistavanjeVozila();\n\t\tint redniBroj = UtillMethod.unesiteInt();\n\t\tif (redniBroj < Main.getVozilaAll().size()) {\n\t\t\tif (!Main.getVozilaAll().get(redniBroj).isVozObrisano()) {\n\t\t\t\tUtillMethod.proveraServisaVozila(Main.getVozilaAll().get(redniBroj));\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Ovo vozilo je obrisano i ne moze da se koristi!\");\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"Uneli ste pogresan redni broj!\");\n\t\t}\n\t}",
"private static void benvenuto() {\n\t\tUtilityIO.header(MSG_BENVENUTO, SIMBOLO_MESSAGGIO_BENV_USCITA);\n\t\tSystem.out.println();\n\t\t\n\t}",
"public static void dodavanjePutnickogVozila() {\n\t\tString vrstaVozila = \"Putnicko Vozilo\";\n\t\tString regBr = UtillMethod.unosRegBroj();\n\t\tGorivo gorivo = UtillMethod.izabirGoriva();\n\t\tGorivo gorivo2 = UtillMethod.izabirGorivaOpet(gorivo);\n\t\tint brServisa = 1;\n\t\tdouble potrosnja100 = UtillMethod.unesiteDoublePotrosnja();\n\t\tSystem.out.println(\"Unesite broj km koje je vozilo preslo:\");\n\t\tdouble predjeno = UtillMethod.unesiteBroj();\n\t\tdouble preServisa = 10000;\n\t\tdouble cenaServisa = 8000;\n\t\tSystem.out.println(\"Unesite cenu vozila za jedan dan:\");\n\t\tdouble cenaDan = UtillMethod.unesiteBroj();\n\t\tSystem.out.println(\"Unesite broj sedista u vozilu:\");\n\t\tint brSedist = UtillMethod.unesiteInt();\n\t\tSystem.out.println(\"Unesite broj vrata vozila:\");\n\t\tint brVrata = UtillMethod.unesiteInt();\n\t\tboolean vozObrisano = false;\n\t\tArrayList<Gorivo> gorivaVozila = new ArrayList<Gorivo>();\n\t\tgorivaVozila.add(gorivo);\n\t\tif(gorivo2!=Main.nista) {\n\t\t\tgorivaVozila.add(gorivo2);\n\t\t}\n\t\tArrayList<Servis> servisiNadVozilom = new ArrayList<Servis>();\n\t\tPutnickoVozilo vozilo = new PutnickoVozilo(vrstaVozila, regBr, gorivaVozila, brServisa, potrosnja100, predjeno,\n\t\t\t\tpreServisa, cenaServisa, cenaDan, brSedist, brVrata, vozObrisano, servisiNadVozilom);\n\t\tUtillMethod.prviServis(vozilo, predjeno);\n\t\tMain.getVozilaAll().add(vozilo);\n\t\tSystem.out.println(\"Novo vozilo je uspesno dodato u sistem!\");\n\t\tSystem.out.println(\"---------------------------------------\");\n\t}",
"public Fund hentArtikel(String u) {\n\t\tp(\"hentArtikel(\"+u+\")\");\n\t\tString vUrl = \"\";\n\t\tArrayList <String> beskrivelser = new ArrayList<>();\n\n\n\t\ttry {\n\t\t\tInputStream is = new URL(\"http://m.tegnsprog.dk/artikler/\"+u+\".html\").openStream();\n\t\t\tis = new BufferedInputStream(is);\n\t\t\tis.mark(1);\n\t\t\tif (is.read() == 0xef) {\n\t\t\t\tis.read();\n\t\t\t\tis.read();\n\n\t\t\t} else {\n\t\t\t\tis.reset();\n\t\t\t}\n\t\t\tp(\"#=#=#=#=#=#=#=#= hentArtikel() =#=#=#=#=#=#=#=#=#=#=#\");\n\t\t\tbyte[] contents = new byte[1024];\n\t\t\tString heleIndholdet = \"\";\n\t\t\tint bytesRead = 0;\n\t\t\t//bytesRead = is.read(contents); //skipper første linie\n\t\t\t//bytesRead = is.read(contents); //skipper anden linie\n\n\t\t\twhile((bytesRead = is.read(contents)) != -1) {\n\t\t\t\tString linie = new String(contents, 0, bytesRead);\n\t\t\t\theleIndholdet += linie;\n\n\n\n\t\t\t}\n\t\t\t\n\t\t\t//p(\"\\nArtikel_______________________________: \"+heleIndholdet);\n\n\n\n\t\t\t//-- Vi finder video-urlen\n\n\t\t\tint startindeks = heleIndholdet.indexOf(\"src=\\\"\");\n\t\t\tString tempUrl = heleIndholdet.substring(startindeks+5);\n\t\t\tint slutIndeks= tempUrl.indexOf(\"\\\" type='video/mp4'>Your browser does not support the video tag.\");\n\t\t\tvUrl = tempUrl.substring(0,slutIndeks);\n\t\t\tp(\"videourl::::::::::::::::::::::::::::::::\"+vUrl);\n\n\t\t\tif (webm) {\n\t\t\t\tint underscore = vUrl.lastIndexOf(\"_\") + 1;\n\t\t\t\tint sidstepunktum = vUrl.lastIndexOf(\".\");\n\n\t\t\t\tString indeksnr = vUrl.substring(underscore, sidstepunktum);\n\t\t\t\tp(\"indeksnr: \" + indeksnr);\n\t\t\t\tvUrl = \"http://m.tegnsprog.dk/video/mobil/t-webm/t_\" + indeksnr + \".webm\";\n\t\t\t\tp(vUrl);\n\t\t\t}\n\n\n\n\t\t\t//-- Vi finder de danske ord\n\n\t\t\tstartindeks = tempUrl.indexOf(\"<TABLE>\");\n\t\t\tslutIndeks = tempUrl.indexOf(\"<TABLE width=\\\"100%\\\">\");\n\t\t\tString tabelDKOrd = tempUrl.substring(startindeks, slutIndeks);\n\t\t\t//p(\"__________min html:\");\n\t\t\t//p(tabelDKOrd);\n\t\t\t//p(\"----------\");\n\t\t\t//dKOrd = tabelDKOrd.replaceAll(\"\\\\/TR><TR\", \"</TR><BR><TR>\").replaceAll(\"\\\\·\\\\;\", \" , \");\n\t\t\tString dKOrd = tabelDKOrd\n\t\t\t\t\t.replaceAll(\"<TABLE>\", \"\")\n\t\t\t\t\t.replaceAll(\"</TD><TD>\", \" \")\n\t\t\t\t\t.replaceAll(\"\\\\·\\\\;\", \" , \")\n\t\t\t\t\t.replaceAll(\"<TABLE/>\", \"\")\n\t\t\t\t\t.replaceAll(\"</TABLE>\", \"\")\n\t\t\t\t\t.replaceAll(\" \", \"\")\n\t\t\t\t\t.replaceAll(\"<TR>\", \"\")\n\t\t\t\t\t.replaceAll(\"<TR style=\\\"vertical-align:top;\\\">\", \"\")\n\t\t\t\t\t.replaceAll(\"</TR>\", \"\")\n\t\t\t\t\t.replaceAll(\"</TD>\", \"ønskernylinie\")\n\t\t\t\t\t.replaceAll(\"<TD>\", \"\")\n\t\t\t\t\t.replaceAll(\"<BR>\",\"\\n\")\n\t\t\t\t.replaceAll(\"<BR/>\",\"\\n\");\n\n\t\t\t//Erstat html-koder for danske vokaler\n\t\t\t//æ: æ\n\t\t\t//ø: ø\n\t\t\t//å: å\n\n\t\t\tdKOrd = dKOrd\n\t\t\t\t\t.replaceAll(\"æ\", \"æ\")\n\t\t\t\t\t.replaceAll(\"ø\", \"ø\")\n\t\t\t\t\t.replaceAll(\"å\", \"å\");\n\n\n\n\n\n\t\t\tbeskrivelser = new ArrayList<String>(Arrays.asList(dKOrd.split(\"ønskernylinie\")));\n\n\n\t\t\tp(\"Efter rens\");\n\t\t\tp(beskrivelser.toString());\n\n\n\n/*\n\t\t\t<HTML>\n\t\t\t\t<video width=\"100%\" autoplay>\n\t\t\t \t\t<source src=\"http://www.tegnsprog.dk/video/t/t_317.mp4\" type='video/mp4'>\n\t\t\t \t\tYour browser does not support the video tag.\n\t\t\t \t</video>\n\t\t\t\t<TABLE>\n\t\t\t\t\t<TR style=\"vertical-align:top;\">\n\t\t\t\t\t\t<TD>1. </TD>\n\t\t\t\t\t\t<TD>brun</TD>\n\t\t\t\t\t</TR>\n\t\t\t\t\t<TR style=\"vertical-align:top;\">\n\t\t\t\t\t\t<TD>2. </TD>\n\t\t\t\t\t\t<TD>kaffe</TD>\n\t\t\t\t\t</TR>\n\t\t\t\t</TABLE>\n\t\t\t\t<TABLE width=\"100%\">\n\t\t\t\t\t<TR>\n\t\t\t\t\t\t<TD>\n\t\t\t\t\t\t\t<A TITLE=\"Åbn den fulde ordbogsartikel i browseren\" href=\"#\" onclick=\"var ref = window.open('http://www.tegnsprog.dk/#|soeg|tegn|386', '_system');\">\n\t\t\t\t\t\t\t<IMG SRC=\"http://www.tegnsprog.dk/billeder/web/logo-mini.png\"/>\n\t\t\t\t\t\t\t\tVis på tegnsprog.dk</A></TD><TD style=\"text-align: right;\">\n\t\t\t\t\t\t\t<A TITLE=\"Gå til toppen\" href=\"#0\">\n\t\t\t\t\t\t\t\t⇧\n\t\t\t\t\t\t\t</A>\n\t\t\t\t\t\t</TD></TR></TABLE></HTML>\n\n\n\t\t\t\t\t\tANDEN VERSION______________________________\n\n\t\t\t\t<TABLE>\n\t\t\t\t\t<TR>\n\t\t\t\t\t\t<TD>\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t</TD>\n\t\t\t\t\t\t<TD>\n\t\t\t\t\t\t\tforan · forrest · føre · komme først\n\t\t\t\t\t\t</TD>\n\t\t\t\t\t</TR>\n\t\t\t\t</TABLE>\n\t\t\t\t<TABLE width=\"100%\"><TR><TD><A TITLE=\"Åbn den fulde ordbogsartikel i browseren\" href=\"#\" onclick=\"var ref = window.open('http://www.tegnsprog.dk/#|soeg|tegn|1000', '_system');\"><IMG SRC=\"http://www.tegnsprog.dk/billeder/web/logo-mini.png\"/>Vis på tegnsprog.dk</A></TD><TD style=\"text-align: right;\"><A TITLE=\"Gå til toppen\" href=\"#0\">⇧</A></TD></TR></TABLE></HTML>\n\n*/\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\tp(ex);\n\t\t\tp(ex.getMessage());\n\t\t\tnulNetBeskedFraBraggrund();\n\n\t\t}\n\t\tp(\"hentArtikel færdig\");\n\t\treturn new Fund(Uri.parse(vUrl), beskrivelser);\n\t}",
"public void renovarBolsa() {\n\t\tSystem.out.println(\"Bolsa renovada com suceso!\");\n\t}",
"public abstract String dohvatiKontakt();",
"public boolean fHalamanPelanggan(HttpSession vFSesi) {\n boolean vKeluaran = false;\n \n try{\n String vID = vFSesi.getAttribute(\"sesIDPub\").toString();\n String vSandi = vFSesi.getAttribute(\"sesSandiPUb\").toString();\n String vEmailDB = \"\";\n String vSandiDB = \"\";\n\n //String vKeluaran = \"fHalamanAdmin -> ID: \" + vID + \" & sandi: \" + vSandi;\n /* mencocokkan data session dengan basisdata */\n /* mengambil data nama dan sandi */\n ClsOperasiBasisdataOri oOpsBasisdata = new ClsOperasiBasisdataOri();\n\n /* \n String vFNamaBerkasKonf,\n String vFNamaBd,\n String vFNamaTabel,\n String[] vFArrNamaKolom,\n String vFKolomUrut,\n String vFJenisUrut,\n String[] vFOffset\n */\n\n ResultSet vHasil = oOpsBasisdata.fArrAmbilDataDbKondisi(\"\",\"\", \n \"tb_pelanggan\", \n new String[]{\"email\",\"sandi\"}, \n new String[]{\"email\"},\n \"nomor\", \n \"\", new String[]{\"0\",\"1\"},\"=\");\n\n /* keluaran permintaan */\n while(vHasil.next()){\n vEmailDB = vHasil.getString(\"email\");\n vSandiDB = vHasil.getString(\"sandi\");\n }\t\t\t\n \n System.out.println(vID + \"#\" + vEmailDB + \"#\" + \"#\" + vSandi + \"#\" + vSandiDB);\n /* mencocokkan data */\n if (vID != null && vEmailDB !=null && vSandi != null && vSandiDB != null) {\n \n /* sebelum divalidasi */\n /* apabila data POST sesuai dgn data dalam tabel basisdata: lupa password jadi di NOT */\n if(vID.equals(vEmailDB) && vSandi.equals(vSandiDB)){\n vKeluaran = true;\n }\n }\n }catch(SQLException | DOMException e){\n /* pencatatan sistem */\n if(ClsKonf.vKonfCatatSistem == true){\n String vNamaKelas = \"ClsPelanggan.java\";\n String vNamaMetode = \"fHalamanPelanggan\";\n String vCatatan = vNamaKelas + \"#\" + vNamaMetode + \"#\" + e.toString();\n /* obyek catat */\n ClsCatat oCatat = new ClsCatat();\n oCatat.fCatatSistem(ClsKonf.vKonfCatatKeOutput, \n ClsKonf.vKonfCatatKeBD, \n ClsKonf.vKonfCatatKeBerkas, \n vCatatan);\n }\n }\n \n /* debug nilai id dan password */\n //System.out.println(\"Belum divalidasi : \" + vID + \" = \" + vNamaDB + \" & \" + vSandi + \" = \" + vSandiDB);\n /* nilai keluaran */\n return vKeluaran;\n }",
"private String elaboraAvvisoScrittura() {\n String testo = VUOTA;\n\n if (usaHeadNonScrivere) {\n testo += TAG_NON_SCRIVERE;\n testo += A_CAPO;\n }// end of if cycle\n\n return testo;\n }",
"private String nalozZvieraNaVozidlo() {\r\n if (zoo.getPracovneVozidlo() == null) {\r\n return \"Pracovne vozidlo nie je pristavene\";\r\n }\r\n\r\n Integer pozicia = MojeMetody.vlozInt(\"Vloz cislo zvierata\");\r\n if (pozicia == null) return \"\";\r\n\r\n try {\r\n Prepravitelny z = (Prepravitelny) zoo.getZvierataZOO(pozicia - 1);\r\n zoo.nalozZivocicha(z);\r\n zoo.odstranZivocicha(pozicia - 1);\r\n return \"Zviera \" + z + \"\\n\\tbolo nalozene na prepravne vozidlo\";\r\n } catch (ClassCastException exCC) {\r\n return \"Zviera c. \" + pozicia + \" nemozno prepravit\\n\\t\";\r\n } catch (NullPointerException exNP) {\r\n return \"Zviera c. \" + pozicia + \" nie je v ZOO\";\r\n } catch (Exception ex) {\r\n return \"Neznama chyba:\\n\\t\" + ex;\r\n }\r\n }",
"public String nippideJarjend () throws Exception {\n File nippideFail = new File(\"nipid.txt\"); // txt failid peavad olema proj. samas kaustas antud juhul\n Scanner sc = new Scanner(nippideFail);\n List<String> listNipid = new ArrayList<>(); //failist loetud nipid salvestatakse kausta\n while (sc.hasNextLine()) {\n String rida = sc.nextLine();//rida tuleb eraldi muutujasse salvestada\n listNipid.add(rida);}\n sc.close();\n return listNipid.get((int) (Math.random() * (listNipid.size()))); //randomiga valitakse nipp\n }",
"public void estiloAcierto() {\r\n\t\t /**Bea y Jose**/\t\t\r\n \r\n\t}",
"public void pobierzukladprzegladRZiSBO() {\r\n if (uklad.getUklad() == null) {\r\n uklad = ukladBRDAO.findukladBRPodatnikRokPodstawowy(wpisView.getPodatnikObiekt(), wpisView.getRokWpisuSt());\r\n }\r\n List<PozycjaRZiSBilans> pozycje = UkladBRBean.pobierzpozycje(pozycjaRZiSDAO, pozycjaBilansDAO, uklad, \"\", \"r\");\r\n UkladBRBean.czyscPozycje(pozycje);\r\n rootProjektRZiS.getChildren().clear();\r\n List<StronaWiersza> zapisy = StronaWierszaBean.pobraniezapisowwynikoweBO(stronaWierszaDAO, wpisView);\r\n try {\r\n PozycjaRZiSFKBean.ustawRoota(rootProjektRZiS, pozycje, zapisy);\r\n level = PozycjaRZiSFKBean.ustawLevel(rootProjektRZiS, pozycje);\r\n Msg.msg(\"i\", \"Pobrano układ \");\r\n } catch (Exception e) {\r\n E.e(e);\r\n rootProjektRZiS.getChildren().clear();\r\n Msg.msg(\"e\", e.getLocalizedMessage());\r\n }\r\n }",
"private void cargarNotasEnfermeria() {\r\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\tparametros.put(\"admision_seleccionada\", admision_seleccionada);\r\n\t\tparametros.put(\"rol_medico\", \"S\");\r\n\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\t\"/pages/notas_enfermeria.zul\", \"NOTAS DE ENFERMERIA\",\r\n\t\t\t\tparametros);\r\n\t}",
"private static void etapa3Urna() {\n\t\t\n\t\turna.contabilizarVotosPorCandidato(enderecoCandidatos);\n\t\t\n\t}",
"String getAnnoPubblicazione();",
"public void kaufen(BesitzrechtFeld feld) {\n try {\n System.out.println(\"Dein aktueller Kontostand beträgt: \" + getKontostand());\n System.out.println(\"Die kosten für: \" + feld.getFeldname() + \" (\" + feld.getFarbe() + \") betragen :\" + feld.getGrundstueckswert());\n System.out.println(\"Möchtest du kaufen? (ja/nein)\");\n String eingabe = br.readLine();\n if (eingabe.trim().toLowerCase().equals(\"status\")) {\n eingabe = meinStatus();\n\n }\n if (eingabe.trim().toLowerCase().equals(\"ja\")) {\n if (einzahlen(feld.getGrundstueckswert())) {\n feld.setGekauft(true);\n feld.setSpieler(this);\n felderInBesitz.add(feld);\n switch (feld.getFarbe()) {\n case \"braun\":\n braun.add((Straße) feld);\n System.out.println(\"Du hast die Straße: \" + feld.getFeldname() + \"(\" + feld.getFarbe() + \") gekauft!\");\n System.out.println(\"Du hast \" + braun.size() + \" von 2 Feldern (\" + feld.getFarbe() + \") in deinem Besitz\");\n if (braun.size() == 2) {\n Straße s = (Straße) feld;\n s.hausBauen(this, feld);\n s.mieteÄndernStraße(braun);\n break;\n }\n break;\n case \"hellblau\":\n hellblau.add((Straße) feld);\n System.out.println(\"Du hast die Straße: \" + feld.getFeldname() + \"(\" + feld.getFarbe() + \") gekauft!\");\n System.out.println(\"Du hast \" + hellblau.size() + \" von 3 Feldern (\" + feld.getFarbe() + \") in deinem Besitz\");\n if (hellblau.size() == 3) {\n Straße s = (Straße) feld;\n s.hausBauen(this, feld);\n s.mieteÄndernStraße(hellblau);\n break;\n }\n break;\n case \"pink\":\n pink.add((Straße) feld);\n System.out.println(\"Du hast die Straße: \" + feld.getFeldname() + \"(\" + feld.getFarbe() + \") gekauft!\");\n System.out.println(\"Du hast \" + pink.size() + \" von 3 Feldern (\" + feld.getFarbe() + \") in deinem Besitz\");\n if (pink.size() == 3) {\n Straße s = (Straße) feld;\n s.hausBauen(this, feld);\n s.mieteÄndernStraße(pink);\n break;\n }\n break;\n case \"orange\":\n orange.add((Straße) feld);\n System.out.println(\"Du hast die Straße: \" + feld.getFeldname() + \"(\" + feld.getFarbe() + \") gekauft!\");\n System.out.println(\"Du hast \" + orange.size() + \" von 3 Feldern (\" + feld.getFarbe() + \") in deinem Besitz\");\n if (orange.size() == 3) {\n Straße s = (Straße) feld;\n s.hausBauen(this, feld);\n s.mieteÄndernStraße(orange);\n break;\n }\n break;\n case \"rot\":\n rot.add((Straße) feld);\n System.out.println(\"Du hast die Straße: \" + feld.getFeldname() + \"(\" + feld.getFarbe() + \") gekauft!\");\n System.out.println(\"Du hast \" + rot.size() + \" von 3 Feldern (\" + feld.getFarbe() + \") in deinem Besitz\");\n if (rot.size() == 3) {\n Straße s = (Straße) feld;\n s.hausBauen(this, feld);\n s.mieteÄndernStraße(rot);\n break;\n }\n break;\n case \"gelb\":\n gelb.add((Straße) feld);\n System.out.println(\"Du hast die Straße: \" + feld.getFeldname() + \"(\" + feld.getFarbe() + \") gekauft!\");\n System.out.println(\"Du hast \" + gelb.size() + \" von 3 Feldern (\" + feld.getFarbe() + \") in deinem Besitz\");\n if (gelb.size() == 3) {\n Straße s = (Straße) feld;\n s.hausBauen(this, feld);\n s.mieteÄndernStraße(gelb);\n break;\n }\n break;\n case \"grün\":\n grün.add((Straße) feld);\n System.out.println(\"Du hast die Straße: \" + feld.getFeldname() + \"(\" + feld.getFarbe() + \") gekauft!\");\n System.out.println(\"Du hast \" + grün.size() + \" von 3 Feldern (\" + feld.getFarbe() + \") in deinem Besitz\");\n if (grün.size() == 3) {\n Straße s = (Straße) feld;\n s.hausBauen(this, feld);\n s.mieteÄndernStraße(grün);\n break;\n }\n break;\n case \"dunkelblau\":\n dunkelblau.add((Straße) feld);\n System.out.println(\"Du hast die Straße: \" + feld.getFeldname() + \"(\" + feld.getFarbe() + \") gekauft!\");\n System.out.println(\"Du hast \" + dunkelblau.size() + \" von 2 Feldern (\" + feld.getFarbe() + \") in deinem Besitz\");\n if (dunkelblau.size() == 2) {\n Straße s = (Straße) feld;\n s.hausBauen(this, feld);\n s.mieteÄndernStraße(dunkelblau);\n break;\n }\n break;\n case \"bahnhof\":\n bahnhoefe.add((Bahnhof) feld);\n System.out.println(\"Du hast den Bahnhof: \" + feld.getFeldname() + \" gekauft!\");\n System.out.println(\"Du hast \" + bahnhoefe.size() + \" von 4 Bahnhöfen in deinem Besitz\");\n Bahnhof b = (Bahnhof) feld;\n b.mieteÄndernBahnhof(bahnhoefe);\n\n break;\n case \"werk\":\n werke.add(feld);\n System.out.println(\"Du hast das Werk: \" + feld.getFeldname() + \" gekauft!\");\n System.out.println(\"Du hast \" + werke.size() + \" von 2 Werken in deinem Besitz\");\n break;\n default:\n System.out.println(\"Feld konnte keiner Farbe/Kategorie zugeordnet werden\");\n\n }\n\n }\n System.out.println(\"Dein neuer Kontostand beträgt: \" + getKontostand());\n }\n } catch (IOException ex) {\n Logger.getLogger(Spieler.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public int liczbaelnastosie() {\n\t\treturn 0;\n\t}",
"public void pretraziPoslovneKorisnike() throws BazaPodatakaException {\r\n\t\tString naziv = nazivTF.getText().toLowerCase();\r\n\t\tString web = webTF.getText().toLowerCase();\r\n\t\tString email = emailTF.getText().toLowerCase();\r\n\t\tString telefon = telefonTF.getText();\r\n\r\n\t\tList<PoslovniKorisnik> listaKorisnika = BazaPodataka.dohvatiPoslovnogKorisnikaPremaKriterijima(email, telefon,\r\n\t\t\t\tnaziv, web);\r\n\t\ttablicaPoslovnihKorisnika.setItems(FXCollections.observableArrayList(listaKorisnika));\r\n\r\n\t}",
"public void bienvenida(){\n System.out.println(\"Bienvenid@ a nuestro programa de administracion de parqueos\");\n }",
"private static void kapazitaetPruefen(){\n\t\tList<OeffentlichesVerkehrsmittel> loev = new ArrayList<OeffentlichesVerkehrsmittel>();\n\t\t\n\t\tLinienBus b1 = new LinienBus();\n\t\tFaehrschiff f1 = new Faehrschiff();\n\t\tLinienBus b2 = new LinienBus();\t\n\t\t\n\t\tloev.add(b1);\n\t\tloev.add(b2);\n\t\tloev.add(f1);\n\t\t\n\t\tint zaehlung = 500;\n\t\tboolean ausreichend = kapazitaetPruefen(loev,500);\n\t\tp(\"Kapazitaet ausreichend? \" + ausreichend);\n\t\t\n\t}",
"public void hentSøgeindeks2(String u) {\n\n\t\ttry { // Henter fil\n\n\t\t\tString heleIndholdet = \"\";\n\n\t\t\tif (sp.getBoolean(\"cachedSøgeindeks\", false)){\n\t\t\t\t//todo: tjek om der er ny version..\n\t\t\t\t//heleIndholdet = sp.getString(\"søgeindeks\", \"\");\n\t\t\t\tp(\"hentSøgeindeks() henter data fra cache\");\n\n\n\t\t\t\tType type = new TypeToken<ArrayList<Indgang>>() {}.getType();\n\t\t\t\tsøgeindeks = new Gson().fromJson(sp.getString(\"søgeindeks\", null), type);\n\t\t\t\tType type2 = new TypeToken<ArrayList<String>>() {}.getType();\n\t\t\t\ttilAutoComplete = new Gson().fromJson(sp.getString(\"tilAutoComplete\", null), type2);\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\tInputStream is = new URL(u).openStream();\n\t\t\t\tis = new BufferedInputStream(is);\n\t\t\t\tis.mark(1);\n\t\t\t\tif (is.read() == 0xef) {\n\t\t\t\t\tis.read();\n\t\t\t\t\tis.read();\n\n\t\t\t\t} else {\n\t\t\t\t\tis.reset();\n\t\t\t\t}\n\t\t\t\tp(\"hentSøgeindeks() henter data fra net\");\n\t\t\t\tbyte[] contents = new byte[1024];\n\n\t\t\t\tint bytesRead = 0;\n\n\t\t\t\t//--Først hentes al tekst ind i én stor streng\n\n\t\t\t\twhile ((bytesRead = is.read(contents)) != -1) {\n\n\n\t\t\t\t\tString linie = new String(contents, 0, bytesRead, \"iso-8859-1\");\n\n\t\t\t\t\theleIndholdet += linie;\n\n\t\t\t\t}\n\n\t\t\t\tsp.edit().\n\t\t\t\t\t\tputString(\"søgeindeks\", heleIndholdet).\n\t\t\t\t\t\tputBoolean(\"cachedSøgeindeks\", true).\n\t\t\t\t\t\tcommit();\n\n\n\n\n\t\t\t\tString [] linjesplit = heleIndholdet.split(\"\\n\");\n\t\t\t\t//p(\"Array længde: \"+linjesplit.length);\n\t\t\t\tfor (int i = 0; i < linjesplit.length; i++) {\n\t\t\t\t\tString indgangS = linjesplit[i];\n\t\t\t\t\t//p(\"indgangS: \" + indgangS.length());\n\t\t\t\t\t//p(\"Ind__\" + indgangS);\n\t\t\t\t\tString[] indgangSA = indgangS.split(\"\\t\");\n\t\t\t\t\tif (indgangSA.length < 2) break;\n\t\t\t\t\t//p(\"IndgangSA: \" + indgangSA.length);\n\t\t\t\t\tString søgeordet = indgangSA[0];\n\t\t\t\t\tString[] ix = indgangSA[1].split(\";\");\n\t\t\t\t\t//p(\"Array længde: \" + ix.length);\n\t\t\t\t\tArrayList<String> ix2 = new ArrayList();\n\n\t\t\t\t\tfor (int j = 0; j < ix.length; j++) {\n\t\t\t\t\t\tString gammel = \"\"; //tjek for dubletter\n\t\t\t\t\t\tif (j > 0) gammel = ix[j - 1].trim();\n\n\t\t\t\t\t\tString s = ix[j].trim();\n\n\t\t\t\t\t\tif (!gammel.equalsIgnoreCase(s))\n\t\t\t\t\t\t\tix2.add(s); // add kun hvis den ikke findes i forvejen\n\t\t\t\t\t}\n\t\t\t\t\t//p(\"Ud1___\"+søgeordet+ \" \"+ix2);\n\t\t\t\t\tIndgang indgang = new Indgang(søgeordet.trim(), ix2);\n\t\t\t\t\tsøgeindeks.add(indgang);\n\t\t\t\t\ttilAutoComplete.add(søgeordet);\n\t\t\t\t\t//p(\"Ud2___\"+indgang);\n\n\t\t\t\t}\n\n\t\t\t\t//gem\n\t\t\t\tsp.edit().putString(\"søgeindeks\", new Gson().toJson(søgeindeks))\n\t\t\t\t\t\t.putString(\"tilAutoComplete\", new Gson().toJson(tilAutoComplete))\n\t\t\t\t\t\t.apply();\n\t\t\t}\n\n\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\tp(ex);\n\t\t\tp(ex.getMessage());\n\t\t\tnulNetBeskedFraBraggrund();\n\t\t}\n\n\n\t}",
"private static void cajas() {\n\t\t\n\t}",
"@Override\n\tpublic String bajarFichero(String URLdiscoCliente, int idFichero, int idSesionCliente) throws RemoteException, MalformedURLException, NotBoundException {\n\t\tdatos = (ServicioDatosInterface) Naming.lookup(\"rmi://\" + direccion + \":\" + puerto + \"/almacen\");\n\t\t\n\t\t//se deberia comprobar si el fichero realmente es el del cliente\n\t\t\n\t\tMetadatos m = datos.descargarFichero(idFichero,idSesionCliente);\n\t\tint idCliente = datos.sesion2id(idSesionCliente);\n\t\tint idSesionRepo = datos.dimeRepositorio(idCliente);\n\t\tif (m != null){\n\t\t\t\n\t\t\tInterfaz.imprime(\"Se ha notificado que el fichero \" + m.getNombreFichero() + \" va a ser descargado\");\n\t\t\tString URLservicioSrOperador = \"rmi://\" + direccionServicioSrOperador + \":\" + puertoServicioSrOperador + \"/sroperador/\" + idSesionRepo;\n\t\t\n\t\t\t//ahora buscamos el Servicio SrOperador y le pasamos la URL del DiscoCliente y el id de cliente que es el nombre de la carpeta\n\t\t\tServicioSrOperadorInterface servicioSrOperador =(ServicioSrOperadorInterface)Naming.lookup(URLservicioSrOperador);\n\t\t\t//el tercer parametro es la carpeta donde esta el fichero real, en caso de compartido es la carpeta dequien comparte evidentemente.\n\t\t\tservicioSrOperador.bajarFichero(URLdiscoCliente,m.getNombreFichero(),m.getIdCliente());\n\t\t\treturn m.getNombreFichero();\n\t\t}else return null;\t\t\n\t}",
"public String ottieniListaCodiceBilancio(){\n\t\tInteger uid = sessionHandler.getParametro(BilSessionParameter.UID_CLASSE);\n\t\tcaricaListaCodiceBilancio(uid);\n\t\treturn SUCCESS;\n\t}",
"private String elaboraIncipit() {\n String testo = VUOTA;\n\n if (usaHeadIncipit) {\n testo += elaboraIncipitSpecifico();\n testo += A_CAPO;\n }// fine del blocco if\n\n return testo;\n }",
"public void binPelicual(Noticia p) {\n txtTitulo.setText(p.getTitulo());\n\n }",
"public void nastaviIgru() {\r\n\t\t// nastavi igru poslije pobjede\r\n\t\tigrajPoslijePobjede = true;\r\n\t}",
"public static void traduitSiteFrancais() {\n\t\t\n\t}",
"public void trykkPaa() throws TrykketPaaBombe {\n // Ingenting skal skje dersom en av disse er true;\n if (brettTapt || trykketPaa || flagget) {\n return;\n }\n\n // Om ruten er en bombe taper man brettet\n if (bombe) {\n trykketPaa = true;\n setText(\"x\");\n setBackground(new Background(new BackgroundFill(Color.RED, CornerRadii.EMPTY, Insets.EMPTY)));\n throw new TrykketPaaBombe();\n }\n // Om ruten har null naboer skal et stoerre omraade aapnes\n else if (bombeNaboer == 0) {\n Lenkeliste<Rute> besokt = new Lenkeliste<Rute>();\n Lenkeliste<Rute> aapneDisse = new Lenkeliste<Rute>();\n aapneDisse.leggTil(this);\n // Rekursiv metode som fyller aapneDisse med riktige ruter\n finnAapentOmraade(besokt, aapneDisse);\n for (Rute r : aapneDisse) {\n r.aapne();\n }\n } else {\n aapne();\n }\n }",
"public static void korisnikNijeUneoIspravnuSifru() {\r\n\t\tJOptionPane.showMessageDialog(teretanaGui.getContentPane(), \"Niste uneli ispravnu sifru!\", \"Obavestenje\",\r\n\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t}",
"static public void zapisz(String host){\n\n String daneWysyłane=\"oddaj=\";\n Wyp[] wyporzyczeniaDoZmiany=new Wyp[wyporzyczenia.size()];\n for(int i=0;i<wyporzyczenia.size();i++){\n Wyp el=wyporzyczenia.elements().nextElement();\n if(el.zmieniony){\n wyporzyczeniaDoZmiany[i]=el;\n daneWysyłane+=el.id+\"/\"+el.czasKoniec+\";\";\n\n }\n }\n daneWysyłane+=\"&dodaj=\";\n Wyp[] wyporzyczeniaDoDodania=new Wyp[wyporzyczenia.size()];\n for(int i=0;i<wyporzyczenia.size();i++){\n Wyp el=wyporzyczenia.elements().nextElement();\n if(el.dodany){\n wyporzyczeniaDoDodania[i]=el;\n daneWysyłane+=el.laptop.id+\"/\"+el.kto.id+\"/\"+el.czasStart()+\"/\"+el.czasKoniec()+\";\";\n\n }\n }\n URL u = null;\n try {\n u = new URL(\"http://\"+host+\"/zapisz.php\");\n HttpURLConnection con = (HttpURLConnection) u.openConnection();\n\n //add reuqest header\n con.setRequestMethod(\"POST\");\n con.setRequestProperty(\"User-Agent\", \"Android\");\n con.setRequestProperty(\"Accept-Language\", \"en-US,en;q=0.5\");\n\n\n // Send post request\n con.setDoOutput(true);\n DataOutputStream wr = new DataOutputStream(con.getOutputStream());\n wr.writeBytes(daneWysyłane);\n wr.flush();\n wr.close();\n\n int responseCode = con.getResponseCode();\n\n BufferedReader in = new BufferedReader(\n new InputStreamReader(con.getInputStream()));\n String inputLine;\n StringBuffer response = new StringBuffer();\n\n while ((inputLine = in.readLine()) != null) {\n response.append(inputLine);\n }\n in.close();\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void bajarBloque() {\n\t\tif (piezaActual != null) {\n\t\t\tif (Mapa.getInstance().estaLibre(piezaActual.getBloque3().getX(),\n\t\t\t\t\tpiezaActual.getBloque3().getY() + 1)) {\n\t\t\t\tpiezaActual.getBloque3().bajar(); // Dejar en ese orden\n\t\t\t\tpiezaActual.getBloque2().bajar();\n\t\t\t\tpiezaActual.getBloque1().bajar();\n\t\t\t} else {\n\t\t\t\tthis.piezaNueva();\n\t\t\t}\n\t\t}\n\t}",
"public String SoloDNI() {\nreturn MuestraSoloDNI();\t\t\t\t\t\n}",
"private void cargarFichaLepra_discapacidades() {\r\n\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"codigo_empresa\", codigo_empresa);\r\n\t\tparameters.put(\"codigo_sucursal\", codigo_sucursal);\r\n\t\tparameters.put(\"nro_identificacion\", tbxNro_identificacion.getValue());\r\n\t\tparameters.put(\"fecha_actual\", new Date());\r\n\r\n\t\t// log.info(\"parameters\" + parameters);\r\n\t\tseguimiento_control_pqtService.setLimit(\"limit 25 offset 0\");\r\n\r\n\t\t// log.info(\"parameters>>>>\" + parameters);\r\n\t\tBoolean fecha_tratamiento = seguimiento_control_pqtService\r\n\t\t\t\t.existe_fecha_fin_tratamiento(parameters);\r\n\t\t// log.info(\"fecha_tratamiento>>>>\" + fecha_tratamiento);\r\n\r\n\t\tif (fecha_tratamiento) {\r\n\t\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\t\tparametros.put(\"nro_identificacion\",\r\n\t\t\t\t\tadmision_seleccionada.getNro_identificacion());\r\n\t\t\tparametros.put(\"nro_ingreso\",\r\n\t\t\t\t\tadmision_seleccionada.getNro_ingreso());\r\n\t\t\tparametros.put(\"estado\", admision_seleccionada.getEstado());\r\n\t\t\tparametros.put(\"codigo_administradora\",\r\n\t\t\t\t\tadmision_seleccionada.getCodigo_administradora());\r\n\t\t\tparametros.put(\"id_plan\", admision_seleccionada.getId_plan());\r\n\t\t\tparametros.put(IVias_ingreso.ADMISION_PACIENTE,\r\n\t\t\t\t\tadmision_seleccionada);\r\n\t\t\tparametros.put(IVias_ingreso.OPCION_VIA_INGRESO,\r\n\t\t\t\t\tOpciones_via_ingreso.REGISTRAR);\r\n\t\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\t\tIRutas_historia.PAGINA_VALORACION_DISCAPACIDADES_LEPRA,\r\n\t\t\t\t\tIRutas_historia.LABEL_VALORACION_DISCAPACIDADES_LEPRA,\r\n\t\t\t\t\tparametros);\r\n\t\t}\r\n\t}",
"public static void traduitSiteAnglais() {\n\t\t\n\t}",
"public void pobierzNajlepsze(MainWindow win)\n\t{\n\t\tif(czyZdalnie())\n\t\t{\n\t\t\tPobranieWynikow wyniki = new PobranieWynikow(win, port, host);\n\t\t\tThread zadanie = new Thread(wyniki);\n\t\t\tzadanie.start();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tString wyniki = najlepsze.pobierz();\n\t\t\tif(wyniki.isEmpty())\n\t\t\t\twyniki = \"Brak wynikow\";\n\t\t\tJOptionPane.showMessageDialog(win, wyniki, \"Najpelsze wyniki lokalnie\",JOptionPane.INFORMATION_MESSAGE);\n\t\t}\n\n\t}",
"private String vylozZvieraZVozidla() {\r\n if (zoo.getPracovneVozidlo() == null) {\r\n return \"Pracovne vozidlo nie je pristavene\";\r\n }\r\n\r\n Integer pozicia = MojeMetody.vlozInt(\"Vloz index zvierata\");\r\n if (pozicia == null) return \"\";\r\n\r\n try {\r\n Zivocich ziv = zoo.vylozZivocicha(pozicia-1);\r\n if (ziv == null) {\r\n return \"Zviera c. \" + pozicia + \" nie je na vozidle\\n\\t\";\r\n }\r\n zoo.pridajZivocicha(ziv);\r\n return \"Zviera \" + ziv\r\n + \"\\n\\tbolo vylozene z prepravneho vozidla\";\r\n } catch (ClassCastException exCC) {\r\n return \"Zviera c. \" + pozicia + \" nie je na vozidle\\n\\t\";\r\n } catch (Exception ex) {\r\n return \"Neznama chyba:\\n\\t\" + ex;\r\n }\r\n }",
"float znajdzOstatecznaCene2()\n\t{\n\t\tArrayList<Float> cenyNaNajblizszySlot =znajdzOstatecznaCeneCenaNaNajblizszeSloty();\n\t\t\n\t\tfloat minimuCena =-1;\n\t\t\n\t\t//Stworzenie cen w raportowaniu\n\t\tint i=0;\n\t\twhile (i<cenyNaNajblizszySlot.size())\n\t\t{\n\t\t\trynekHistory.kontraktDodajCene(cenyNaNajblizszySlot.get(i));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t//wyznacz liste ktora ma najwieksza wartosc funkcji rynkowej\n\t\t\n\t\tArrayList<Float> cenyZNajwiekszaFunkcjaRynkowa = new ArrayList<>();\n\t\tfloat maximumFunkcjiRynkowej=-1;\n\t\t\n\t\ti=0;\n\t\twhile (i<cenyNaNajblizszySlot.size())\n\t\t{\n\t\t\tfloat cena =cenyNaNajblizszySlot.get(i);\n\t\t\tfloat value =funkcjaRynku2(cena, false,true);\t\t\t\n\n\t\t\trynekHistory.kontraktDodajWartoscFunkcjiRynku(value, cena);\n\n\t\t\t\n\t\t\tif (value>maximumFunkcjiRynkowej)\n\t\t\t{\n\t\t\t\tcenyZNajwiekszaFunkcjaRynkowa.clear();\n\t\t\t\tcenyZNajwiekszaFunkcjaRynkowa.add(cena);\n\t\t\t\tmaximumFunkcjiRynkowej = value;\n\t\t\t}\n\t\t\telse if (value==maximumFunkcjiRynkowej)\n\t\t\t{\n\t\t\t\tcenyZNajwiekszaFunkcjaRynkowa.add(cena);\n\t\t\t} \n\t\t\t\n\t\t\t\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tminimuCena = cenyZNajwiekszaFunkcjaRynkowa.get(cenyZNajwiekszaFunkcjaRynkowa.size()/2);\n\t\t\n\t\treturn minimuCena;\n\n\t}",
"@Given(\"^daje ci otwarta strone$\")\n public void daje_ci_otwarta_strone() throws Throwable {\n driver = new ChromeDriver();\n String url = \"http://www.pollub.pl/\";\n driver.navigate().to(url);\n driver.manage().window().maximize();\n // driver.manage().timeouts().implicitlyWait(5000, TimeUnit.MILLISECONDS); // PRZYKLAD GLOBALNEGO IMPLICITY WAIT-A\n\n }",
"private void pokupiIzPoljaIKreirajServisera() {\n\t\tServiser noviServiser;\n\t\tif(izmena == false) {\n\t\t\tString ime = rssv.getTfIme().getText();\n\t\t\tString prezime = rssv.getTfPrezime().getText();\n\t\t\tString JMBG = rssv.getTfJMBG().getText();\n\t\t\tPol pol = rssv.getPolBox().getSelectionModel().getSelectedItem();\n\t\t\tString adresa = rssv.getTfAdresa().getText();\n\t\t\tString brojTelefona = rssv.getTfBrojTelefona().getText();\n\t\t\tString korisnickoIme = rssv.getTfKorisnickoIme().getText();\n\t\t\tString lozinka = rssv.getTfLozinka().getText();\n\t\t\tSpecijalizacija specijalizacija = rssv.getSpecijalizacijaBox().getSelectionModel().getSelectedItem();\n\t\t\t\t\n\t\t\ttry {\n\t\t\t\tdouble plata = Double.valueOf(rssv.getTfPlata().getText());\n\t\t\t\tnoviServiser = new Serviser(ime, prezime, JMBG, pol, adresa, brojTelefona, korisnickoIme, lozinka, specijalizacija, plata);\n\t\t\t\trssv.getTabela().getItems().add(noviServiser);\n\t\t\t\tServiserController.upisiServiseraUFajl(noviServiser);\n\t\t\t\trssv.resetujPolja();\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\trssv.izbaciPorukuOGresci(e.getMessage());\n\t\t\t} catch (Exception e) {\n\t\t\t\trssv.izbaciPorukuOGresci(e.getMessage());\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\tString ime = rssv.getTfIme().getText();\n\t\t\tString prezime = rssv.getTfPrezime().getText();\n\t\t\tString JMBG = rssv.getTfJMBG().getText();\n\t\t\tPol pol = rssv.getPolBox().getSelectionModel().getSelectedItem();\n\t\t\tString adresa = rssv.getTfAdresa().getText();\n\t\t\tString brojTelefona = rssv.getTfBrojTelefona().getText();\n\t\t\tString korisnickoIme = rssv.getTfKorisnickoIme().getText();\n\t\t\tString lozinka = rssv.getTfLozinka().getText();\n\t\t\tSpecijalizacija specijalizacija = rssv.getSpecijalizacijaBox().getSelectionModel().getSelectedItem();\n\t\t\t\n\t\t\ttry {\n\t\t\t\tdouble plata = Double.valueOf(rssv.getTfPlata().getText());\n\t\t\t\tnoviServiser = new Serviser(tempServiser.getOznaka(), ime, prezime, JMBG, pol, adresa, brojTelefona, korisnickoIme, lozinka, false, specijalizacija, plata);\n\t\t\t\tServiserController.izbrisiIzUcitanihServiseraSaOznakom(tempServiser.getOznaka());\n\t\t\t\trssv.getTabela().getItems().add(noviServiser);\n\t\t\t\tServiserController.upisiServiseraUFajl(noviServiser);\n\t\t\t\trssv.getTabela().getItems().remove(tempServiser);\n\t\t\t\tServiserController.sacuvajIzmeneUFajl();\n\t\t\t\trssv.resetujPolja();\n\t\t\t\t\n\t\t\t\tizmena = false;\n\t\t\t\ttempServiser = null;\n\t\t\t\t\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"private void datosVehiculo(boolean esta_en_revista) {\n\t\ttry{\n\t\t\t String Sjson= Utils.doHttpConnection(\"http://datos.labplc.mx/movilidad/vehiculos/\"+placa+\".json\");\n\t\t\t JSONObject json= (JSONObject) new JSONTokener(Sjson).nextValue();\n\t\t\t JSONObject json2 = json.getJSONObject(\"consulta\");\n\t\t\t JSONObject jsonResponse = new JSONObject(json2.toString());\n\t\t\t JSONObject sys = jsonResponse.getJSONObject(\"tenencias\");\n\t\t\t \n\t\t\t if(sys.getString(\"tieneadeudos\").toString().equals(\"0\")){\n\t\t\t \tautoBean.setDescripcion_tenencia(getResources().getString(R.string.sin_adeudo_tenencia));\n\t\t\t \tautoBean.setImagen_teencia(imagen_verde);\n\t\t\t }else{\n\t\t\t \tautoBean.setDescripcion_tenencia(getResources().getString(R.string.con_adeudo_tenencia));\n\t\t\t \tautoBean.setImagen_teencia(imagen_rojo);\n\t\t\t \tPUNTOS_APP-=PUNTOS_TENENCIA;\n\t\t\t }\n\t\t\t \n\t\t\t JSONArray cast = jsonResponse.getJSONArray(\"infracciones\");\n\t\t\t String situacion;\n\t\t\t boolean hasInfraccion=false;\n\t\t\t for (int i=0; i<cast.length(); i++) {\n\t\t\t \tJSONObject oneObject = cast.getJSONObject(i);\n\t\t\t\t\t\t try {\n\t\t\t\t\t\t\t situacion = (String) oneObject.getString(\"situacion\");\n\t\t\t\t\t\t\t if(!situacion.equals(\"Pagada\")){\n\t\t\t\t\t\t\t\t hasInfraccion=true;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t } catch (JSONException e) { \n\t\t\t\t\t\t\t DatosLogBean.setDescripcion(Utils.getStackTrace(e));\n\t\t\t\t\t\t }\n\t\t\t }\n\t\t\t if(hasInfraccion){\n\t\t\t \t autoBean.setDescripcion_infracciones(getResources().getString(R.string.tiene_infraccion));\n\t\t\t\t \tautoBean.setImagen_infraccones(imagen_rojo);\n\t\t\t\t \tPUNTOS_APP-=PUNTOS_INFRACCIONES;\n\t\t\t }else{\n\t\t\t \t autoBean.setDescripcion_infracciones(getResources().getString(R.string.no_tiene_infraccion));\n\t\t\t\t autoBean.setImagen_infraccones(imagen_verde);\n\t\t\t }\n\t\t\t JSONArray cast2 = jsonResponse.getJSONArray(\"verificaciones\");\n\t\t\t if(cast2.length()==0){\n\t\t\t \t autoBean.setDescripcion_verificacion(getResources().getString(R.string.no_tiene_verificaciones));\n\t\t\t\t\t autoBean.setImagen_verificacion(imagen_rojo);\n\t\t\t\t\t PUNTOS_APP-=PUNTOS_VERIFICACION;\n\t\t\t }\n\t\t\t\t\t Date lm = new Date();\n\t\t\t\t\t String lasmod = new SimpleDateFormat(\"yyyy-MM-dd\").format(lm);\n\t\t\t\t\t SimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\t\t\tBoolean yaValide=true;\n\t\t\t\t for (int i=0; i<cast2.length(); i++) {\n\t\t\t\t \tJSONObject oneObject = cast2.getJSONObject(i);\n\t\t\t\t\t\t\t try {\n\t\t\t\t\t\t\t\t\tif(!esta_en_revista&&yaValide){\n\t\t\t\t\t\t\t\t\t\t autoBean.setMarca((String) oneObject.getString(\"marca\"));\n\t\t\t\t\t\t\t\t\t\t autoBean.setSubmarca((String) oneObject.getString(\"submarca\"));\n\t\t\t\t\t\t\t\t\t\t autoBean.setAnio((String) oneObject.getString(\"modelo\"));\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t autoBean.setDescripcion_revista(getResources().getString(R.string.sin_revista));\n\t\t\t\t\t\t\t\t\t\t autoBean.setImagen_revista(imagen_rojo);\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t Calendar calendar = Calendar.getInstance();\n\t\t\t\t\t\t\t\t\t\t int thisYear = calendar.get(Calendar.YEAR);\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t if(thisYear-Integer.parseInt(autoBean.getAnio())<=10){\n\t\t\t\t\t\t\t\t\t\t\t autoBean.setDescripcion_vehiculo(getResources().getString(R.string.carro_nuevo)+\" \"+getResources().getString(R.string.Anio)+\" \"+autoBean.getAnio());\n\t\t\t\t\t\t\t\t\t\t\t autoBean.setImagen_vehiculo(imagen_verde);\n\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t\t autoBean.setDescripcion_vehiculo(getResources().getString(R.string.carro_viejo)+\" \"+getResources().getString(R.string.Anio)+\" \"+autoBean.getAnio());\n\t\t\t\t\t\t\t\t\t\t\t autoBean.setImagen_vehiculo(imagen_rojo);\n\t\t\t\t\t\t\t\t\t\t\t PUNTOS_APP-=PUNTOS_ANIO_VEHICULO;\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t yaValide=false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t Date date1 = formatter.parse(lasmod);\n\t\t\t\t\t\t\t\t Date date2 = formatter.parse(oneObject.getString(\"vigencia\").toString());\n\t\t\t\t\t\t\t\t int comparison = date2.compareTo(date1);\n\t\t\t\t\t\t\t\t if((comparison==1||comparison==0)&&!oneObject.getString(\"resultado\").toString().equals(\"RECHAZO\")){\n\t\t\t\t\t\t\t\t\t autoBean.setDescripcion_verificacion(getResources().getString(R.string.tiene_verificaciones)+\" \"+oneObject.getString(\"resultado\").toString());\n\t\t\t\t\t\t\t\t\t autoBean.setImagen_verificacion(imagen_verde); \n\t\t\t\t\t\t\t\t\t hasVerificacion=true;\n\t\t\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t autoBean.setDescripcion_verificacion(getResources().getString(R.string.no_tiene_verificaciones));\n\t\t\t\t\t\t\t\t\t autoBean.setImagen_verificacion(imagen_rojo);\n\t\t\t\t\t\t\t\t\t hasVerificacion=false;\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\n\t\t\t\t\t\t\t } catch (JSONException e) { \n\t\t\t\t\t\t\t\t DatosLogBean.setDescripcion(Utils.getStackTrace(e));\n\t\t\t\t\t\t\t } catch (ParseException e) {\n\t\t\t\t\t\t\t\t DatosLogBean.setDescripcion(Utils.getStackTrace(e));\n\t\t\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t\t if(!hasVerificacion){\n\t\t\t\t \t PUNTOS_APP-=PUNTOS_VERIFICACION;\n\t\t\t\t }\n\t\t\t \n\t\t\t}catch(JSONException e){\n\t\t\t\tDatosLogBean.setDescripcion(Utils.getStackTrace(e));\n\t\t\t}\n\t\t\n\t}",
"private void jogarIa() {\n\t\tia = new IA(this.mapa,false);\r\n\t\tia.inicio();\r\n\t\tthis.usouIa = true;\r\n\t\tatualizarBandeirasIa();//ATUALIZA AS BANDEIRAS PARA DEPOIS QUE ELA JOGOU\r\n\t\tatualizarNumeroBombas();//ATUALIZA O NUMERO DE BOMBAS PARA DPS QUE ELA JOGOU\r\n\t\tatualizarTela();\r\n\t\tif(ia.isTaTudoBem() == false)\r\n\t\t\tJOptionPane.showMessageDialog(this, \"IMPOSSIVEL PROSSEGUIR\", \"IMPOSSIVEL ENCONTRAR CASAS CONCLUSIVAS\", JOptionPane.INFORMATION_MESSAGE);\r\n\t}",
"private String sprawdzRozszerzenie(String adresPliku) {\r\n\t\tString[] tablica = adresPliku.split(\"\\\\.\");\r\n\r\n\t\treturn tablica[tablica.length - 1];\r\n\t}",
"public void orina() {\n System.out.println(\"Que bien me quedé! Deposito vaciado.\");\n }",
"protected String seuraavaBittijono(String binaarina, int i) {\n int loppu = Math.min(binaarina.length(), i + merkkienPituus);\n return binaarina.substring(i, loppu);\n }",
"public void internetConnectionProble()\n\t\t{\n\n\n\t\t}",
"public void acheter(){\n\t\t\n\t\t// Achete un billet si il reste des place\n\t\ttry {\n\t\t\tthis.maBilleterie.vendre();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tthis.status.put('B', System.currentTimeMillis());\n\t\tSystem.out.println(\"STATE B - Le festivalier \" + this.numFestivalier + \" a acheté sa place\");\n\t}",
"public void eisagwgiFarmakou() {\n\t\t// Elegxw o arithmos twn farmakwn na mhn ypervei ton megisto dynato\n\t\tif(numOfMedicine < 100)\n\t\t{\n\t\t\tSystem.out.println();\t\n\t\t\tmedicine[numOfMedicine] = new Farmako();\t\n\t\t\tmedicine[numOfMedicine].setCode(rnd.nextInt(1000000)); // To sistima dinei automata ton kwdiko tou farmakou\n\t\t\tmedicine[numOfMedicine].setName(sir.readString(\"DWSTE TO ONOMA TOU FARMAKOU: \")); // Zitaw apo ton xristi na mou dwsei to onoma tou farmakou\n\t\t\tmedicine[numOfMedicine].setPrice(sir.readPositiveFloat(\"DWSTE THN TIMH TOU FARMAKOU: \")); // Pairnw apo ton xristi tin timi tou farmakou\n\t\t\tSystem.out.println();\n\t\t\t// Elegxos monadikotitas tou kwdikou tou farmakou\n\t\t\th = rnd.nextInt(1000000);\n\t\t\tfor(int i = 0; i < numOfMedicine; i++)\n\t\t\t{\n\t\t\t\tif(medicine[i].getCode() == h)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tSystem.out.println(\"O KWDIKOS AUTOS YPARXEI HDH!\");\n\t\t\t\t\th = rnd.nextInt(10);\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t}\n\t\t\tnumOfMedicine++;\n\t\t}\n\t\t// An xeperastei o megistos arithmos farmakwn\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"DEN MPOREITE NA EISAGETE ALLA FARMAKA!\");\n\t\t\tSystem.out.println(\"EXEI SYMPLHRWTHEI O PROVLEPOMENOS ARITHMOS!\");\n\t\t}\n\t}",
"public void Zabojstwa() {\n\t\tSystem.out.println(\"Zabojstwa\");\n\t\tfor(int i=0;i<Plansza.getNiebezpieczenstwoNaPlanszy().size();i++) {\n\t\t\tfor(GenerujNiebezpieczenstwo niebez : Plansza.getNiebezpieczenstwoNaPlanszy()) {\n\n\t\t\t\tif(niebez.getZabojca() instanceof DzikieZwierzeta) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getNiewolnikNaPLanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getNiewolnikNaPLanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getNiewolnikNaPLanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getNiewolnikNaPLanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getUbrania() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getNiewolnikNaPLanszy().getJedzenie() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setUbrania(Plansza.getNiewolnikNaPLanszy().getUbrania() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setJedzenie(Plansza.getNiewolnikNaPLanszy().getJedzenie() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setLicznikNiebezpieczenstw(Plansza.getNiewolnikNaPLanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(niebez.getZabojca() instanceof Bandyci) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getRzemieslnikNaPlanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getRzemieslnikNaPlanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getRzemieslnikNaPlanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getRzemieslnikNaPlanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getMaterialy() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getRzemieslnikNaPlanszy().getNarzedzia() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tif(GeneratorRandom.RandomOd0(101) <= ZapisOdczyt.getRzemieslnicySzansa()) {\n\t\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setMaterialy(Plansza.getRzemieslnikNaPlanszy().getMaterialy() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setNarzedzia(Plansza.getRzemieslnikNaPlanszy().getNarzedzia() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setLicznikNiebezpieczenstw(Plansza.getRzemieslnikNaPlanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(niebez.getZabojca() instanceof Zlodzieje) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getArystokrataNaPlanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getArystokrataNaPlanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getArystokrataNaPlanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getArystokrataNaPlanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getTowary() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getArystokrataNaPlanszy().getZloto() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setTowary(Plansza.getArystokrataNaPlanszy().getTowary() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setZloto(Plansza.getArystokrataNaPlanszy().getZloto() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setLicznikNiebezpieczenstw(Plansza.getArystokrataNaPlanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"private void vCarg()\n {\n /*Contiene la MAC del equipo*/\n String sMAC;\n\n /*Obtiene la MAC del equipo*/\n InetAddress ip;\n try \n {\n /*Obtiene la ip local del equipo*/\n ip = InetAddress.getLocalHost(); \n\n /*Obtiene otros parámetros de conexión*/\n NetworkInterface network = NetworkInterface.getByInetAddress(ip);\n\n /*Obtiene en bytes la MAC*/\n byte[] mac = network.getHardwareAddress();\n\n /*Dale formato a la MAC*/\n StringBuilder sb = new StringBuilder();\n for(int i = 0; i < mac.length; i++) \n sb.append(String.format(\"%02X%s\", mac[i], (i < mac.length - 1) ? \"-\" : \"\")); \n\n /*Inicia la MAC*/\n sMAC = sb.toString();\n }\n catch(UnknownHostException expnUnknowHos) \n {\n //Procesa el error y regresa\n Star.iErrProc(this.getClass().getName() + \" \" + expnUnknowHos.getMessage(), Star.sErrUnknowHos, expnUnknowHos.getStackTrace()); \n return; \n }\n catch(SocketException expnSock)\n {\n //Procesa el error y regresa\n Star.iErrProc(this.getClass().getName() + \" \" + expnSock.getMessage(), Star.sErrSock, expnSock.getStackTrace()); \n return; \n }\n \n /*Obtiene del web service los mensajes de esta MAC ya desencriptados*/\n String sResp;\n try\n {\n sResp = Star.sDecryp(msjmac(Star.sEncrip(sMAC)));\n }\n catch(Exception expnExcep)\n { \n //Procesa el error y regresa\n Star.iErrProc(this.getClass().getName() + \" \" + expnExcep.getMessage(), Star.sErrExcep, expnExcep.getStackTrace()); \n return; \n } \n\n /*Agrega en el control la respuesta del servidor*/\n jED1.setText(sResp); \n \n }",
"public static void main(String[] args) {\n String site = \"www.ics.upjs.sk\";\n int port = 80;\n Socket socket = null;\n try {\n socket = new Socket(site, port);\n OutputStream os = socket.getOutputStream();\n PrintWriter pw = new PrintWriter(os);\n\n InputStream is = socket.getInputStream();\n InputStreamReader isr = new InputStreamReader(is);\n BufferedReader br = new BufferedReader(isr);\n\n // poslanie poziadavky\n pw.println(\"GET / HTTP/1.1\");\n pw.println(\"Host: \"+site);\n pw.println();\n\n // odoslanie dat ktore su pripavene v streame\n pw.flush();\n\n // spravovanie poziadavky\n\n String riadok;\n while ((riadok = br.readLine()) != null) {\n System.out.println(riadok);\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (socket != null) {\n try {\n socket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n }",
"public void urciStupneVrcholu(){\n\t\tfor(int i = 0;i < vrchP.length; i++){\n\t\t\tstupenVrcholu(vrchP[i].klic);\n\t\t}\n\t}",
"public void realizacjap34() {\n System.out.println(\"REALIZACJA PUNKTU 3\\n\");\n\n System.out.println(\"\\nWyszukiwanie osob po imieniu (Piotr) ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzOsobyPoImieniu(Listy.osoby, \"Piotr\").forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po nazwisku (Oleszczuk) ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzOsobyPoNazwisku(Listy.osoby, \"Oleszczuk\").forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po stazu pracy mniejszym niz 10============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoStazuPracyMniejszymNiz(Listy.osoby, 10).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po stazu pracy większym niz 10============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoStazuPracyWiekszymNiz(Listy.osoby, 10).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po stazu pracy równym 5============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoStazuPracyRownym(Listy.osoby, 5).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po liczbie nadgodzin mniejszej niz 6 ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoNadgodzinachMniejszychNiz(Listy.osoby, 6).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po liczbie nadgodzin wiekszej niz 6 ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoNadgodzinachWiekszychNiz(Listy.osoby, 6).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po liczbie nadgodzin równej 6 ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoNadgodzinachRownych(Listy.osoby, 6).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po pensji wiekszej niz 15000 ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoPensjiWiekszejNiz(Listy.osoby, 15000).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po pensji mniejszej niz 15000 ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoPensjiMniejszejNiz(Listy.osoby, 15000).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po pensji rownej 15000 ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoPensjiRownej(Listy.osoby, 15000).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie osob po stanowisku (Adiunkt) ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzPracownikowPoStanowisku(Listy.osoby, \"Adiunkt\").forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie studenta po numerze indeksu (123456) ============================================================================\\n\");\n System.out.println(NarzedziaWyszukiwania.znajdzStudentaPoIndeksie(Listy.osoby, \"123456\"));\n\n System.out.println(\"\\nWyszukiwanie studentów po roku studiów (1) ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzStudentowPoRokuStudiow(Listy.osoby, 1).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie studentów po kierunku (Informatyka Stosowana) ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzStudentowPoKierunku(Listy.osoby, \"Informatyka Stosowana\").forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie kursu po nazwie (Analiza Matematyczna 1) ============================================================================\\n\");\n System.out.println(NarzedziaWyszukiwania.znajdzKursPoNazwie(Listy.kursy, \"Analiza Matematyczna 1\"));\n\n System.out.println(\"\\nWyszukiwanie kursów po liczbie ects (5) ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzKursyPoECTS(Listy.kursy, 5).forEach(System.out::println);\n\n System.out.println(\"\\nWyszukiwanie kursów po prowadzacym+\"+Listy.osoby.get(0).getImie()+\" \"+Listy.osoby.get(0).getNazwisko()+\" ============================================================================\\n\");\n NarzedziaWyszukiwania.znajdzKursyPoProwadzacym(Listy.kursy, Listy.osoby.get(0)).forEach(System.out::println);\n\n\n //REALIZACJA PUNKTU 4\n System.out.println(\"=====================================================================================================================\");\n System.out.println(\"REALIZACJA PUNKTU 4\");\n System.out.println(\"=====================================================================================================================\\n\");\n System.out.println(\"Kursy:\\n\");\n for (Kurs kurs : Listy.kursy) {\n System.out.println(kurs.toString());\n }\n\n System.out.println(\"\\nOsoby:\\n\");\n for (Osoba osoba : Listy.osoby) {\n System.out.println(\"OSOBA====================================================================================================\");\n System.out.println(osoba.toString());\n System.out.println();\n }\n }",
"public void carroNoAgregado(){\n System.out.println(\"No hay un parqueo para su automovil\");\n }",
"public void faiBagnetto() {\n System.out.println(\"Scrivere 1 per Bagno lungo, al costo di 150 Tam\\nSeleziona 2 per Bagno corto, al costo di 70 Tam\\nSeleziona 3 per Bide', al costo di 40 Tam\");\n\n switch (creaturaIn.nextInt()) {\n case 1 -> {\n puntiVita += 50;\n puntiFelicita -= 30;\n soldiTam -= 150;\n }\n case 2 -> {\n puntiVita += 30;\n puntiFelicita -= 15;\n soldiTam -= 70;\n }\n case 3 -> {\n puntiVita += 10;\n puntiFelicita -= 5;\n soldiTam -= 40;\n }\n }\n checkStato();\n }",
"public static void main(String[] args) {\n\t\t\r\n\t\tclass Ulamek{\r\n\t\t\tprivate int licznik, mianownik;\r\n\r\n\t\t\tpublic void ustawLicznik (int l){\r\n\t\t\t\tlicznik=l;\r\n\t\t\t}\r\n\t\t\tpublic void ustawMianownik (int m){\r\n\t\t\t\tmianownik=m;\r\n\t\t\t}\r\n\t\t\tpublic void ustawUlamek (int u1, int u2){\r\n\t\t\t\tlicznik=u1;\r\n\t\t\t\tmianownik=u2;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tpublic void wyswietl (){\r\n\t\t\t\t\r\n\t\t\t\tint przod, reszta, przod_dlugosc, mianownik_dlugosc, licznik_dlugosc;\r\n\t\t\t\tString przod_zamiana, mianownik_string, licznik_string;\r\n\t\t\t\tdouble wynik;\r\n\t\t\t\t\r\n\t\t\t\tif (mianownik!=0 && licznik !=0){\r\n\t\t\t\tprzod=licznik/mianownik;\r\n\t\t\t\treszta=licznik-(przod*mianownik);\r\n\t\t\t\tprzod_zamiana=\"\"+przod;\r\n\t\t\t\tprzod_dlugosc=przod_zamiana.length();\r\n\t\t\t\twynik=1.0*licznik/mianownik;\r\n\t\t\t\t\r\n\t\t\t\tif(reszta!=0){\r\n\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\tint licznik = 0;\r\n\t\t\t\t\tdo{\r\n\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t licznik++;\r\n\t\t\t\t\t}while (licznik!=przod_dlugosc);\r\n\t\t\t\tSystem.out.println(reszta);\r\n\t\t\t}\r\n\r\n\t\t\t\t//zamiana na stringa i liczenie\r\n\t\t\t\tmianownik_string=\"\"+mianownik;\r\n\t\t\t\tmianownik_dlugosc=mianownik_string.length();\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//brak calości\r\n\t\t\t\tif(przod==0){\r\n\t\t\t\tSystem.out.print(\" \"+\" \"+\" \");\r\n\t\t\t\tint licznik3 = 0;\r\n\t\t\t\tdo{\r\n\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t licznik3++;\r\n\t\t\t\t}while (licznik3!=mianownik_dlugosc);\r\n\t\t\t System.out.print(\" = \"+wynik);\r\n\r\n\t\t\t System.out.println();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\r\n\r\n\t\t\t\tif(przod!=0){\r\n\t\t\t\tSystem.out.print(\" \"+przod+\" \");\r\n\t\t\t\tint licznik3 = 0;\r\n\t\t\t\tdo{\r\n\t\t\t\t\tif(reszta!=0){\r\n\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t}\r\n\t\t\t\t licznik3++;\r\n\t\t\t\t}while (licznik3!=mianownik_dlugosc);\r\n\t\t\t System.out.print(\" = \"+wynik);\r\n\r\n\t\t\t System.out.println();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(reszta!=0){\r\n\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\tint licznik2 = 0;\r\n\t\t\t\tdo{\r\n\t\t\t\t\tif(reszta!=0){\r\n\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t licznik2++;\r\n\t\t\t\t\t\r\n\t\t\t\t}while (licznik2!=przod_dlugosc);\r\n\t\t\t\tSystem.out.println(mianownik);\r\n\t\t\t System.out.println();\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t//jezeli blad \r\n\t\t\t\t\tmianownik_string=\"\"+mianownik;\r\n\t\t\t\t\tmianownik_dlugosc=mianownik_string.length();\r\n\t\t\t\t\tlicznik_string=\"\"+licznik;\r\n\t\t\t\t\tlicznik_dlugosc=licznik_string.length();\r\n\t\t\t\t\tif(licznik_dlugosc>mianownik_dlugosc){\r\n\t\t\t\t\t\tmianownik_dlugosc=licznik_dlugosc;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//gora\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t//if(licznik==0){\r\n\t\t\t\t\t//System.out.print(\" \");\r\n\t\t\t\t\t//}\r\n\r\n\t\t\t\t\tSystem.out.println(licznik);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//srodek\r\n\t\t\t\t\tSystem.out.print(\" \"+\" \"+\" \");\r\n\t\t\t\t\t\r\n\t\t\t\t\tint licznik3 = 0;\r\n\t\t\t\t\tdo{\r\n\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t licznik3++;\r\n\t\t\t\t\t}while (licznik3!=mianownik_dlugosc);\r\n\t\t\t\t System.out.print(\" = \"+\"ERR\");\r\n\r\n\t\t\t\t System.out.println();\r\n\t\t\t\t\t\r\n\t\t\t\t //dol\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t\t\tSystem.out.println(mianownik);\r\n\t\t\t\t\t System.out.println();\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t Ulamek u1=new Ulamek();\r\n\t\t Ulamek u2=new Ulamek();\r\n\r\n\t\t u1.ustawLicznik(3);\r\n\t\t u1.ustawMianownik(5);\r\n\r\n\t\t u2.ustawLicznik(142);\r\n\t\t u2.ustawMianownik(8);\r\n\r\n\t\t u1.wyswietl();\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t \r\n\t\t u2.wyswietl();\r\n\r\n\r\n\r\n\r\n\t\t u2.ustawUlamek(100,0);\r\n\r\n\r\n\t\t u2.wyswietl();\r\n\r\n\t}",
"public static void main(String []args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int N = Integer.parseInt(br.readLine());\n String[] imeDobriDeca = new String[N];\n // tuka se zachuvuvaat soodvetnite adresi na decata\n String[] poklonDobriDeca = new String[N];\n String pom;\n CBHT<String,String> hashTable = new CBHT<String, String>((int)(N/0.7));\n for (int i = 0; i < N; i++) {\n pom = br.readLine();\n String[] del = pom.split(\" \");\n imeDobriDeca[i] = del[0];\n poklonDobriDeca[i] = del[1];\n hashTable.insert(del[0],del[1]);\n }\n //tuka se zapishuva imeto na deteto shto treba da se proveri\n String deteZaProverka = br.readLine();\n deteZaProverka = evaluate(deteZaProverka);\n if ( hashTable.search(deteZaProverka) != null ){\n System.out.println(hashTable.search(deteZaProverka).element.value);\n }\n else System.out.println(\"Nema poklon\");\n }",
"String getNetzanbieter();",
"private void esconderBotao() {\n\t\tfor (int i = 0; i < dificuldade.getValor(); i++) {// OLHAM TODOS OS BOTOES\r\n\t\t\tfor (int j = 0; j < dificuldade.getValor(); j++) {\r\n\t\t\t\tif (celulaEscolhida(botoes[i][j]).isVisivel() && botoes[i][j].isVisible()) {// SE A CELULA FOR VISIVEL E\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// O BOTAO FOR VISIVEL,\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// ESCONDE O BOTAO\r\n\t\t\t\t\tbotoes[i][j].setVisible(false);//DEIXA BOTAO INVISIVEL\r\n\t\t\t\t\tlblNumeros[i][j].setVisible(true);//DEIXA O LABEL ATRAS DO BOTAO VISIVEL\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void maasHesapla() {\n\t\tSystem.out.println(\"isciler icin maas 5000 tl \");\n \t\t\n\t}",
"@Override // Métodos que fazem a anulação\n\tpublic void getBonificação() {\n\t\t\n\t}",
"public void NopagaImpuestos(){\n\t\tif(sueldoBruto<BASE_MINIMA_IMPUESTOS){\n\t\tsueldoNeto=sueldoBruto;\n\t\ttipoImpuesto=\"En esta ocasión no paga impuestos\";\n\t\t}\n\t}",
"private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {\n String Nazwa = txaNazwa.getText();\n String NIP = txtNIP.getText().replaceAll(\"-\", \"\");\n String nrB = txtNrB.getText();\n String nrL = txtNrL.getText();\n String ulica = txtUlica.getText();\n String kodP = kodP1.getText();\n String kodP_2 = kodP2.getText();\n String miejscowosc = txtMiejscowosc.getText();\n String kod = jTextField1.getText();\n\n try {\n if (validKod()&&validNIP()&&validNipUse()) {\n if (Nazwa.equals(\"\") || NIP.equals(\"\") || nrB.equals(\"\") || kodP.equals(\"\") || kodP_2.equals(\"\") || miejscowosc.equals(\"\")) {\n JOptionPane.showMessageDialog(null, \"Proszę sprawdzić wprowadzone dane\", \"Error\", JOptionPane.ERROR_MESSAGE);\n } else {\n Firma firma = new Firma(Nazwa, NIP, nrB, nrL, ulica, kodP + \"-\" + kodP_2, miejscowosc, kod, jTextArea1.getText());\n FirmaDB firmaDB = new FirmaDB(con);\n firmaDB.insertFirma(firma);\n JOptionPane.showMessageDialog(null, \"Firma \" + Nazwa + \" została dodana\", \"\", JOptionPane.INFORMATION_MESSAGE);\n dispose();\n\n }\n }\n } catch (SQLException ex) {\n Logger.getLogger(nowyKlientFrame.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }",
"public static void main(String[] args) {\n\n // Pitamo korisnika za ime fajla koji korisitmo\n String imeFajla = Svetovid.in.readLine(\"Unesite ime fajla:\");\n\n // Poziv prvog nacina ispisivanja\n citajSveRedove(imeFajla);\n\n // Moramo zatvoriti fajl da bi ga opet citali ispocetka\n Svetovid.in(imeFajla).close();\n\n // Poziv drugog nacina ispisivanja\n citajSveRedoveAlt(imeFajla);\n\n }",
"private String beriIzDatoteke(String ime){\n\n // ustvarimo vhodni podatkovni tok\n FileInputStream inputStream;\n\n //ugotovimo, koliko je velika datoteka\n File file = new File(getFilesDir(), ime);\n int length = (int) file.length();\n\n //pripravimo spremenljivko, v katero se bodo prebrali podatki\n byte[] bytes = new byte[length];\n\n //preberemo podatke\n try {\n inputStream = openFileInput(ime);\n inputStream.read(bytes);\n inputStream.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n //podatke pretvorimo iz polja bajtov v znakovni niz\n String vsebina = new String(bytes);\n\n return vsebina;\n }",
"private Zivocich vytvorZivocicha() {\r\n final String[] zFarba = {\"cervena\", \"zelena\", \"modra\", \"zlta\", \"zlto-zelena\"};\r\n Zivocich zviera = null;\r\n double kolkoVazi = 0.0;\r\n\r\n //-- Vygenerujeme zviera\r\n int vygenerovane = 1 + generator.nextInt(4); //cislo <1,4>\r\n\r\n switch (vygenerovane) {\r\n case 1: //blcha \r\n double kolkoDoskoci=3 * generator.nextDouble() ; //cislo <0;2.99>\r\n double kolkoVyskoci=3 * generator.nextDouble() ; //cislo <0;2.99>\r\n zviera=new Blcha(6,kolkoDoskoci,kolkoVyskoci);\r\n break;\r\n case 2: //simpanz\r\n kolkoVazi=3 + (97 * generator.nextDouble()); //cislo <3;99.9>\r\n boolean cviceny;\r\n cviceny=generator.nextBoolean(); \r\n zviera=new Simpanz(kolkoVazi,cviceny);\r\n break;\r\n case 3: //papagaj\r\n kolkoVazi = 0.1 + (5*generator.nextDouble()); // cislo <0.1; 6>\r\n String farba = zFarba[generator.nextInt(5)]; // farba zo zoznamu\r\n zviera = new Papagaj(\"Ara\", 2, kolkoVazi, farba); \r\n break;\r\n case 4: //slon\r\n kolkoVazi=20 + (480*generator.nextDouble()); //cislo <20;500> \r\n int pocet=generator.nextInt(50); //pocet zubov bude <0,49>\r\n zviera=new Slon(kolkoVazi,pocet);\r\n break;\r\n } //------------------------------------------------------------- switch --\r\n return zviera;\r\n }",
"public static void zapisPliku(String nazwaPlikuZapis) throws IOException{\n FileWriter plikZapisz = null;\n try {\n // tworzy nowy plik jeżeli nie istnieje, w przeciwnym przypadku\n // usuwa zawartość pliku i nadpisuje od początku\n plikZapisz = new FileWriter(nazwaPlikuZapis);\n //zapis łańcucha\n plikZapisz.write(tekstDoZapisu);\n //zapis po znaku\n for (char znak = 'a'; znak <='z'; znak++){\n plikZapisz.write(znak);\n plikZapisz.write('\\n');\n }\n }finally {\n if (plikZapisz != null){\n plikZapisz.close();\n }\n }\n }",
"public static void trazenjeVozila(Iznajmljivac o) {\n\t\tLocalDate pocetniDatum = UtillMethod.unosDatum(\"pocetni\");\n\t\tLocalDate krajnjiDatum = UtillMethod.unosDatum(\"krajnji\");\n\t\tSystem.out.println(\"------------------------------------\");\n\t\tSystem.out.println(\"Provera dostupnosti vozila u toku...\\n\");\n\t\tArrayList<Vozilo> dostupnaVoz = new ArrayList<Vozilo>();\n\t\tint i = 0;\n\t\tfor (Vozilo v : Main.getVozilaAll()) {\n\t\t\tif (!postojiLiRezervacija(v, pocetniDatum, krajnjiDatum) && !v.isVozObrisano()) {\n\t\t\t\tSystem.out.println(i + \"-\" + v.getVrstaVozila() + \"-\" + \"Registarski broj\" + \"-\" + v.getRegBR()\n\t\t\t\t\t\t+ \"-Potrosnja na 100km-\" + v.getPotrosnja100() + \"litara\");\n\t\t\t\ti++;\n\t\t\t\tdostupnaVoz.add(v);\n\t\t\t}\n\t\t}\n\t\tif (i > 0) {\n\t\t\tSystem.out.println(\"------------------------------------------------\");\n\t\t\tSystem.out.println(\"Ukucajte kilometrazu koju planirate da predjete:\");\n\t\t\tdouble km = UtillMethod.unesiteBroj();\n\t\t\tint km1 = (int) km;\n\t\t\tporedjenjeVozila d1 = new poredjenjeVozila(km1);\n\t\t\tCollections.sort(dostupnaVoz,d1);\n\t\t\tint e = 0;\n\t\t\tfor(Vozilo v : dostupnaVoz) {\n\t\t\t\tdouble temp = cenaTroskaVoz(v, km, v.getGorivaVozila().get(0));\n\t\t\t\tSystem.out.println(e + \" - \" + v.getVrstaVozila()+ \"-Registarski broj: \"+ v.getRegBR()+\" | \"+ \"Cena na dan:\"+v.getCenaDan() +\" | Broj sedista:\"+ v.getBrSedist()+ \" | Broj vrata:\"+ v.getBrVrata() + \"| Cena troskova puta:\" + temp + \" Dinara\");\n\t\t\t\te++;\n\t\t\t}\n\t\t\tSystem.out.println(\"---------------------------------------\");\n\t\t\tSystem.out.println(\"Unesite redni broj vozila kojeg zelite:\");\n\t\t\tint redniBroj = UtillMethod.unesiteInt();\n\t\t\tif (redniBroj < dostupnaVoz.size()) {\n\t\t\t\tDateTimeFormatter formatters = DateTimeFormatter.ofPattern(\"dd/MM/yyyy\");\n\t\t\t\tString pocetni = pocetniDatum.format(formatters);\n\t\t\t\tString krajnji = krajnjiDatum.format(formatters);\n\t\t\t\tdouble cena = UtillMethod.cenaIznaj(pocetniDatum, krajnjiDatum, dostupnaVoz.get(redniBroj));\n\t\t\t\tRezervacija novaRez = new Rezervacija(dostupnaVoz.get(redniBroj), o, cena, false, pocetni, krajnji);\n\t\t\t\tMain.getRezervacijeAll().add(novaRez);\n\t\t\t\tSystem.out.println(\"Uspesno ste napravili rezervaciju!\");\n\t\t\t\tSystem.out.println(\"---------------------------------\");\n\t\t\t\tSystem.out.println(novaRez);\n\t\t\t\tSystem.out.println(\"---------------------------------\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Uneli ste pogresan redni broj!\");\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"Nema dostupnih vozila za rezervaaciju.\");\n\t\t}\n\t}",
"static void citajSveRedoveAlt(String imeFajla) {\n\n /* Koriste se pogodnosti biblioteke za citanje svih redova odjednom */\n Svetovid.out.println(Svetovid.in(imeFajla).readAll());\n\n }",
"private void cargarCodDocente() {\n ClsNegocioDocente negoDoc = new ClsNegocioDocente(); \n txtCodDocente.setText(negoDoc.ObtenerCodigo());\n try {\n negoDoc.conexion.close();\n } catch (SQLException ex) {\n Logger.getLogger(FrmCRUDDocente.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void PoblarINFO(String llamado) {//C.P.M Aqui llega como argumento llamado\r\n try {\r\n rs = modelo.Obteninfo();//C.P.M Mandamos a poblar la informacion de negocio\r\n if (llamado.equals(\"\")) {//C.P.M si el llamado llega vacio es que viene de la interface\r\n while (rs.next()) {//C.P.M recorremos el resultado para obtener los datos\r\n vista.jTNombreempresa.setText(rs.getString(1));//C.P.M los datos los enviamos a la vista de la interface\r\n vista.jTDireccion.setText(rs.getString(2));\r\n vista.jTTelefono.setText(rs.getString(3));\r\n vista.jTRFC.setText(rs.getString(4));\r\n }\r\n }\r\n if (llamado.equals(\"factura\")) {//C.P.M de lo contrario es llamado de factura y los valores se van a la vista de vactura \r\n while (rs.next()) {//C.P.M recorremos el resultado \r\n vistafactura.jTNombreempresa.setText(rs.getString(1));//C.P.M enviamos los datos a la vista de factura\r\n vistafactura.jTDireccion.setText(rs.getString(2));\r\n vistafactura.jTTelefono.setText(rs.getString(3));\r\n vistafactura.jTRFC.setText(rs.getString(4));\r\n }\r\n }\r\n } catch (SQLException ex) {//C.P.M Notificamos a el usuario si ocurre algun error\r\n JOptionPane.showMessageDialog(null,\"Ocurio un error al intentar consultar la informacion del negocio\");\r\n }\r\n }",
"public void zapisUrok() {\r\n\r\n\t\taktualnyZostatok = getZostatok() * urokovaSadzba / 100;\r\n\t\tsetVklad(aktualnyZostatok);\r\n\r\n\t}",
"public void sincronizza() {\n boolean abilita;\n\n super.sincronizza();\n\n try { // prova ad eseguire il codice\n\n /* abilitazione bottone Esegui */\n abilita = false;\n if (!Lib.Data.isVuota(this.getDataInizio())) {\n if (!Lib.Data.isVuota(this.getDataFine())) {\n if (Lib.Data.isSequenza(this.getDataInizio(), this.getDataFine())) {\n abilita = true;\n }// fine del blocco if\n }// fine del blocco if\n }// fine del blocco if\n this.getBottoneEsegui().setEnabled(abilita);\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }",
"@Test\r\n\tpublic void CT04ConsultarLivroComNomeEmBranco() {\r\n\t\ttry {\r\n\t\t\t// cenario\r\n\t\t\t@SuppressWarnings(\"unused\")\r\n\t\t\tUsuario usuario;\r\n\t\t\t// acao\r\n\t\t\tusuario = ObtemUsuario.comNome_branco();\r\n\t\t} catch (RuntimeException e) {\r\n\t\t\t// verificacao\r\n\t\t\tassertEquals(\"Nome inválido\", e.getMessage());\r\n\t\t}\r\n\t}",
"public void showBreach();",
"public void pridejNovePivo ()\n\t{\n\t\n\t\tpivo = pivo + PRODUKCE;\n\t\t\n\t}",
"@Override\r\n\t\tpublic String nazivLika() {\r\n\t\t\treturn \"ELIPSA\";\r\n\t\t}",
"public void sendeSpielfeld();",
"protected void podesiRaspUlaznice(String nazivPredstave) {\n\t\tfor (Predstave p:Kontroler.getInstanca().vratiRepertoar())\r\n\t\t\tif(p.getNazivPredstave().equals(nazivPredstave))\r\n\t\t\t\tnoviBrRasUl=p.getBrojRaspolozivihUlaznica();\r\n\t}",
"public MacchinaStatiFiniti(String nome)\r\n\t{\r\n\t\tthis.nome=nome;\r\n\t\tcorrente=null;\r\n\t}",
"java.lang.String getBunho();",
"java.lang.String getBunho();",
"public void get_B8(String URL);",
"void TaktImpulsAusfuehren ()\n {\n \n wolkebew();\n \n }",
"private void inicializarFicha(){\n \tTypeface tfBubleGum = Util.fontBubblegum_Regular(this);\n \tTypeface tfBenton = Util.fontBenton_Boo(this);\n \tTypeface tfBentonBold = Util.fontBenton_Bold(this);\n\t\tthis.txtNombre.setTypeface(tfBubleGum);\n\t\tthis.txtDescripcion.setTypeface(tfBenton);\n\t\tthis.lblTitulo.setTypeface(tfBentonBold);\n \tpanelCargando.setVisibility(View.GONE);\n \t\n \t//cargar los datos de las informaciones\n \tif(DataConection.hayConexion(this)){\n \t\tpanelCargando.setVisibility(View.VISIBLE);\n \t\tInfo.infosInterface = this;\n \t\tInfo.cargarInfo(this.app, this.paramIdItem);\n \t}else{\n \t\tUtil.mostrarMensaje(\n\t\t\t\t\tthis, \n\t\t\t\t\tgetResources().getString(R.string.mod_global__sin_conexion_a_internet), \n\t\t\t\t\tgetResources().getString(R.string.mod_global__no_dispones_de_conexion_a_internet) );\n \t}\n }",
"public void irNoSiteN11 (){\n driver.get(URLbase);\n }",
"public void trenneVerbindung();",
"private void cargarFichaLepra_convivientes() {\r\n\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"codigo_empresa\", codigo_empresa);\r\n\t\tparameters.put(\"codigo_sucursal\", codigo_sucursal);\r\n\t\tparameters.put(\"nro_identificacion\", tbxNro_identificacion.getValue());\r\n\t\tparameters.put(\"fecha_actual\", new Date());\r\n\r\n\t\t// log.info(\"parameters\" + parameters);\r\n\t\tseguimiento_control_pqtService.setLimit(\"limit 25 offset 0\");\r\n\r\n\t\t// log.info(\"parameters>>>>\" + parameters);\r\n\t\tBoolean fecha_tratamiento = seguimiento_control_pqtService\r\n\t\t\t\t.existe_fecha_fin_tratamiento(parameters);\r\n\t\t// log.info(\"fecha_tratamiento>>>>\" + fecha_tratamiento);\r\n\r\n\t\tif (fecha_tratamiento) {\r\n\t\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\t\tparametros.put(\"nro_identificacion\",\r\n\t\t\t\t\tadmision_seleccionada.getNro_identificacion());\r\n\t\t\tparametros.put(\"nro_ingreso\",\r\n\t\t\t\t\tadmision_seleccionada.getNro_ingreso());\r\n\t\t\tparametros.put(\"estado\", admision_seleccionada.getEstado());\r\n\t\t\tparametros.put(\"codigo_administradora\",\r\n\t\t\t\t\tadmision_seleccionada.getCodigo_administradora());\r\n\t\t\tparametros.put(\"id_plan\", admision_seleccionada.getId_plan());\r\n\t\t\tparametros.put(IVias_ingreso.ADMISION_PACIENTE,\r\n\t\t\t\t\tadmision_seleccionada);\r\n\t\t\tparametros.put(IVias_ingreso.OPCION_VIA_INGRESO,\r\n\t\t\t\t\tOpciones_via_ingreso.REGISTRAR);\r\n\t\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\t\tIRutas_historia.PAGINA_CONTROL_CONVIVIENTES_LEPRA,\r\n\t\t\t\t\tIRutas_historia.LABEL_CONTROL_CONVIVIENTES_LEPRA,\r\n\t\t\t\t\tparametros);\r\n\t\t}\r\n\t}",
"void berechneFlaeche() {\n\t}",
"public boolean kraj() {\r\n\t\treturn (broj_slobodnih == 0 && !mozeLiSeSpojiti());\r\n\t}",
"String getCodiceFiscale();",
"public static void dodavanjeTeretnogVozila() {\n\t\tString vrstaVozila = \"Teretno Vozilo\";\n\t\tString regBr = UtillMethod.unosRegBroj();\n\t\tGorivo gorivo = UtillMethod.izabirGoriva();\n\t\tGorivo gorivo2 = UtillMethod.izabirGorivaOpet(gorivo);\n\t\tint brServisa = 1;\n\t\tdouble potrosnja = UtillMethod.unesiteDoublePotrosnja();\n\t\tSystem.out.println(\"Unesite broj km koje je vozilo preslo:\");\n\t\tdouble predjeno = UtillMethod.unesiteBroj();\n\t\tdouble preServisa = 20000;\n\t\tdouble cenaServisa = 10000;\n\t\tSystem.out.println(\"Unesite cenu vozila za jedan dan:\");\n\t\tdouble cenaDan = UtillMethod.unesiteBroj();\n\t\tSystem.out.println(\"Unesite broj sedista u vozilu:\");\n\t\tint brSedista = UtillMethod.unesiteInt();\n\t\tSystem.out.println(\"Unesite broj vrata vozila:\");\n\t\tint brVrata = UtillMethod.unesiteInt();\n\t\tboolean vozObrisano = false;\n\t\tArrayList<Gorivo> gorivaVozila = new ArrayList<Gorivo>();\n\t\tgorivaVozila.add(gorivo);\n\t\tif(gorivo2!=Main.nista) {\n\t\t\tgorivaVozila.add(gorivo2);\n\t\t}\n\t\tArrayList<Servis> servisiNadVozilom = new ArrayList<Servis>();\n\t\tSystem.out.println(\"Unesite maximalnu masu koje vozilo moze da prenosi u KG !!\");\n\t\tint maxMasauKg = UtillMethod.unesiteInt();\n\t\tSystem.out.println(\"Unesite maximalnu visinu u m:\");\n\t\tdouble visinauM = UtillMethod.unesiteBroj();\n\t\tTeretnaVozila vozilo = new TeretnaVozila(vrstaVozila, regBr, gorivaVozila, brServisa, potrosnja, predjeno, preServisa,\n\t\t\t\tcenaServisa, cenaDan, brSedista, brVrata, vozObrisano, servisiNadVozilom, maxMasauKg, visinauM);\n\t\tUtillMethod.prviServis(vozilo, predjeno);\n\t\tMain.getVozilaAll().add(vozilo);\n\t\tSystem.out.println(\"Novo vozilo je uspesno dodato u sistem!\");\n\t\tSystem.out.println(\"--------------------------------------\");\n\t}",
"private String elaboraRitorno() {\n String testo = VUOTA;\n String titoloPaginaMadre = getTitoloPaginaMadre();\n\n if (usaHeadRitorno) {\n if (text.isValid(titoloPaginaMadre)) {\n testo += \"Torna a|\" + titoloPaginaMadre;\n testo = LibWiki.setGraffe(testo);\n }// fine del blocco if\n }// fine del blocco if\n\n return testo;\n }",
"public static void bestFit(PCB processo, PCB novoprocesso) {\n\n int endereco_pai = processo.getEnderecoInicial();\n int endereco = -1;\n int melhor_espaco = processo.getMemoriaOcupada();\n for (int i = 0; i < tamanho_processos_acabados.size(); i++) {\n if (melhor_espaco <= tamanho_processos_acabados.get(i)) {\n melhor_espaco = tamanho_processos_acabados.get(i);\n endereco = enderecos_processos_acabados.get(i);\n }\n }\n novoprocesso.setEnderecoInicial(endereco);\n for (Pagina pagina : Paginas) {\n if (pagina.getEndereco_inicial() == endereco) {\n pagina.setDados(StageRun.procura_processo_pagina(endereco_pai));\n pagina.setPagina_pid(novoprocesso.getPid());\n pagina.setAlocado(true);\n pagina.setEspacoVazio(pagina.getTamanho() - pagina.getDados().length);\n novoprocesso.setMemoriaOcupada(novoprocesso.getMemoriaOcupada() + tamanho_pagina);\n endereco_pai = endereco_pai + tamanho_pagina;\n } else if (pagina.getEndereco_inicial() > endereco && pagina.getEndereco_inicial() < endereco + processo.getMemoriaOcupada()) {\n pagina.setDados(StageRun.procura_processo_pagina(endereco_pai));\n pagina.setPagina_pid(novoprocesso.getPid());\n pagina.setAlocado(true);\n pagina.setEspacoVazio(pagina.getTamanho() - pagina.getDados().length);\n novoprocesso.setMemoriaOcupada(novoprocesso.getMemoriaOcupada() + tamanho_pagina);\n endereco_pai = endereco_pai + tamanho_pagina;\n } else {\n\n }\n }\n\n }",
"private void yas(){\n System.out.println(namn);\n \n try{\n String fraga = \"SELECT TEXT FROM INLAGG WHERE RUBRIK = 'Borttappad strumpa'\";\n String XD = db.fetchSingle(fraga);\n System.out.println(XD);\n txtInlagg.append(XD);\n }\n catch(InfException e){\n JOptionPane.showMessageDialog(null, \"Kunde ej hämta inlägg\");\n }\n }",
"public void Jomijoma()\n {\n System.out.println(\"Ami dadar jomi joma paya geci\");\n }"
] | [
"0.606127",
"0.6058464",
"0.60246855",
"0.596031",
"0.59355366",
"0.59195995",
"0.59159154",
"0.5846527",
"0.58318126",
"0.580719",
"0.58041877",
"0.57680917",
"0.5745026",
"0.57351005",
"0.5732936",
"0.5724245",
"0.5722079",
"0.5697974",
"0.56921715",
"0.56771374",
"0.5646285",
"0.5645738",
"0.56330425",
"0.5631484",
"0.56306505",
"0.56297946",
"0.56250966",
"0.56189865",
"0.56176245",
"0.56137687",
"0.56107724",
"0.56057733",
"0.55982655",
"0.5595513",
"0.559411",
"0.55785537",
"0.5576257",
"0.5565075",
"0.55628157",
"0.5559237",
"0.5552963",
"0.55469",
"0.5545413",
"0.5532426",
"0.55320114",
"0.55270255",
"0.55238014",
"0.55045944",
"0.5499033",
"0.54938745",
"0.5482597",
"0.54762846",
"0.5475995",
"0.5460334",
"0.545686",
"0.54445577",
"0.5444512",
"0.5439734",
"0.5437682",
"0.54350823",
"0.5431181",
"0.5431054",
"0.5430199",
"0.542526",
"0.5420769",
"0.54172665",
"0.5416351",
"0.5408342",
"0.5403483",
"0.54000056",
"0.53956723",
"0.5392833",
"0.5390728",
"0.5390132",
"0.5380961",
"0.53791",
"0.5370362",
"0.53693146",
"0.53646445",
"0.53570354",
"0.5349713",
"0.5349274",
"0.5343045",
"0.5338842",
"0.5331281",
"0.5327285",
"0.5327285",
"0.53252584",
"0.53226364",
"0.53212595",
"0.5319959",
"0.5319121",
"0.5316185",
"0.53038484",
"0.53036624",
"0.53012365",
"0.52998585",
"0.5297514",
"0.5295123",
"0.5287101",
"0.52833253"
] | 0.0 | -1 |
Mapping of user ID and the percentage of ownership | Map<UUID, Double> getOwners(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Query(\"select (select count(n) from User u join u.newspapers n where n.isPrivate = true and n.publisher.id = ?1)*1.0/count(n) from User u join u.newspapers n where n.isPrivate = false and n.publisher.id = ?1\")\n\tDouble ratioPrivatePublicPerUser(int id);",
"@Query(\"select ((select count(distinct r.user) from Rendezvous r) * 100)/ count(u) from User u\")\n\tCollection<Double> dashboardRendezvousesRatioCreation();",
"int sumOfYearsOfUniqueUsers(List<User> users);",
"public double getPercentMutants() {\n\t\tdouble count = (double) getNumMutants();\n\t\tdouble pSize = (double) this.getPopSize();\n\n\t\treturn count*100.0 / pSize;\n\t}",
"@Query(\"select (select count(u) from User u where u.articles is not empty)*1.0/count(u) from User u\")\n\tDouble ratioUsersWithArticle();",
"private Map<User, Double> calcUsersProfit(Car carWinner, BetsMap map) {\n\t\tint totalAmountBets = map.getSumBets();\n\t\tList<Bet> betsForCarWinner = map.forCar(carWinner);\n\t\tMap<User, Double> usersProfit = new HashMap<>();\n\t\t\n\t\tMap<User, Double> profitForWinners = caclProfitForWinners(betsForCarWinner, totalAmountBets);\n\t\t\n\t\tmap.forEachCar((car, bets) -> {\n\t\t\tif (!car.equals(carWinner)) {\n\t\t\t\tbets.forEach(bet -> {\n\t\t\t\t\tif (!profitForWinners.containsKey(bet.getUser())) {\n\t\t\t\t\t\tdouble amount = -bet.getAmount();\n\t\t\t\t\t\tif (usersProfit.containsKey(bet.getUser())) {\n\t\t\t\t\t\t\tamount += usersProfit.get(bet.getUser());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tusersProfit.put(bet.getUser(), amount);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\tusersProfit.putAll(profitForWinners);\n\t\t\n\t\treturn usersProfit;\n\t}",
"@Override\n\tpublic double percentualeUtentiAbilitati () throws DAOException{\n\t\tConnection connection = null;\n\t\tPreparedStatement statement = null;\n\t\tResultSet resultSet = null;\n\t\tdouble numeroUtenti = 0.0;\n\t\ttry {\n\t\t\tconnection = DataSource.getInstance().getConnection();\n\t\t\tstatement = connection.prepareStatement(\" SELECT COUNT (UTENTE.ID)*100/(SELECT COUNT(ID) FROM UTENTE) FROM UTENTE WHERE ABILITATO = 1 GROUP BY(UTENTE.ABILITATO) \");\n\t\t\tresultSet = statement.executeQuery();\n\t\t\tif (resultSet.next()) {\n\t\t\t\tnumeroUtenti = BigDecimal.valueOf(resultSet.getDouble(1)).setScale(2, RoundingMode.HALF_UP).doubleValue();\n\t\t\t}\n\t\t} catch (SQLException | DAOException e) {\n\t\t\tthrow new DAOException(\"ERRORE percentualeUtentiAbilitati utenteAdmin\" + e.getMessage(), e);\n\t\t} finally {\n\t\t\tDataSource.getInstance().close(resultSet);\n\t\t\tDataSource.getInstance().close(statement);\n\t\t\tDataSource.getInstance().close(connection);\n\t\t}\n\t\treturn numeroUtenti;\n\t}",
"@Query(\"select (select count(u) from User u where u.newspapers is not empty)*1.0/count(u) from User u\")\n\tDouble ratioUsersWithNewspaper();",
"public double getVentureChecklistPercent(Member member1) {\n\t\tdouble mapSubclassCount;\r\n\t\tdouble mySubclassCount;\r\n\t\tdouble percentCount;\r\n\t\tSl1 = \"SELECT COUNT(*) AS count FROM map_subclass WHERE mapClassID=?\";\r\n\t\ttry {\r\n\t\t\tconn = dataSource.getConnection();\r\n\t\t\tsmt = conn.prepareStatement(Sl1);\r\n\t\t\tsmt.setString(1, member1.getSetPercent());\r\n\t\t\tSystem.out.println(\"getSetPercent()=\"+member1.getSetPercent());\r\n\t\t\trs1 = smt.executeQuery();\r\n\t\t\tif(rs1.next()){\t\r\n\t\t\t\tmapSubclassCount=rs1.getInt(\"count\");\r\n\t\t\t\tSystem.out.println(\"mapSubclassCount=\"+mapSubclassCount);\t\t\t\t\r\n\t\t\t\tSl2 = \"SELECT COUNT(*) AS count FROM venture_checklist WHERE mapClassID=? AND memberAccount =? \";\r\n\t\t\t\tsmt = conn.prepareStatement(Sl2);\r\n\t\t\t\tsmt.setString(1, member1.getSetPercent());\r\n\t\t\t\tsmt.setString(2, member1.getAccount());\r\n\t\t\t\trs2 = smt.executeQuery();\r\n\t\t\t\tif(rs2.next()){\t\r\n\t\t\t\t\tmySubclassCount=rs2.getInt(\"count\");\r\n\t\t\t\t\t//System.out.println(\"mySubclassCount=\"+mySubclassCount);\t\r\n\t\t\t\t\tpercentCount = mySubclassCount/mapSubclassCount;\r\n\t\t\t\t\t//System.out.println(\"percentCount=\"+(mySubclassCount/mapSubclassCount));\r\n\t\t\t\t\treturn percentCount;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsmt.executeQuery();\r\n\t\t\trs1.close();\r\n\t\t\trs2.close();\r\n\t\t\tsmt.close();\r\n \r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new RuntimeException(e);\r\n \r\n\t\t} finally {\r\n\t\t\tif (conn != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconn.close();\r\n\t\t\t\t} catch (SQLException e) {}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn 0;\r\n\t}",
"@Query(\"select count(a) from Rendezvous a right join a.user r group by r.id\")\n\tCollection<Double> dashboardRendezvousesByUser();",
"int getPercentageHeated();",
"@Override\n\tpublic int findUserOwnnum(int id) {\n\t\treturn this.borrowrecordMapper.findUserOwnnum(id);\n\t}",
"Map<Long, Integer> getUsersWithPendingMeeting(Long forUserId);",
"public Long getContributingUserCount(){\n\n return User.count(\"from User u where u.status in (?1) and u.company = ?2 AND exists(select id from Question q where q.user = u and status = ?3)\",\n UserStatus.getStatusesConsideredInUse(), this, QuestionStatus.ACCEPTED);\n }",
"@Query(\"select count(a) from Reservation a right join a.rendezvous r group by r.id\")\n\tCollection<Double> dashboardUsersPerRendezvous();",
"@Override\n public Long2DoubleMap makeUserProfile(@Nonnull UserHistory<Rating> history) {\n Long2DoubleOpenHashMap profile = new Long2DoubleOpenHashMap();\n\n // Normalize the user's ratings\n // Build the user's weighted profile\n double mean = 0;\n int count = 0;\n for (Rating r: history) {\n if (r.hasValue()) {\n mean += r.getValue();\n ++count;\n }\n }\n mean /= count;\n\n for (Rating r: history) {\n if (r.hasValue()) {\n for (Map.Entry<Long, Double> entry : model.getItemVector(r.getItemId()).entrySet()) {\n Double newValue = entry.getValue() * (r.getValue() - mean);\n if (profile.containsKey(entry.getKey())) {\n newValue += profile.get(entry.getKey());\n }\n profile.put(entry.getKey(), newValue);\n }\n }\n }\n\n // The profile is accumulated, return it.\n // It is good practice to return a frozen vector.\n return LongUtils.frozenMap(profile);\n }",
"public double getOccupancyPercentage() throws SQLException {\n\t\tdouble result = (double) getOccupancy() / getMaxOccupancy() * 100;\n\t\tresult = Math.round (result * 100.0) / 100.0; \n\t\treturn result;\n\t}",
"public int countByUserId(long userId);",
"public int countByUserId(long userId);",
"public void userWithMostLikes(){\n Map<Integer,Integer> userLikesCount = new HashMap<>();\n Map<Integer,User> users = DataStore.getInstance().getUsers();\n \n for(User user : users.values()){\n for(Comment c : user.getComments()){\n int likes=0;\n if(userLikesCount.containsKey(user.getId())){\n\n likes = userLikesCount.get(user.getId());\n }\n likes += c.getLikes();\n userLikesCount.put(user.getId(), likes);\n }\n }\n System.out.println(userLikesCount);\n int max=0;\n int maxId=0;\n for(int id: userLikesCount.keySet()){\n if(userLikesCount.get(id)>max){\n max= userLikesCount.get(id);\n maxId=id;\n }\n }\n System.out.println(\"\\nUser with most likes : \"+ max+ \"\\n\"+ users.get(maxId));\n }",
"public double calculateHpPercent();",
"user showGoodsByUserId(long userId);",
"@Query(\"select (select count(u) from User u where u.chirps.size *1.0 > (select avg(u.chirps.size)*1.75 from User u))*1.0/count(u) from User u\")\n\tDouble usersAboveAvgChirps();",
"Integer countByUserId(Long userId);",
"long countUsersByProfilePhoto(KivbookImage profilePhoto);",
"public double averageChirpsPerUser() {\n\t\tcheckAuthority();\n\t\ttry {\n\t\t\treturn this.administratorRepository.averageChirpsPerUser();\n\t\t} catch (Exception e) {\n\t\t\treturn 0.;\n\t\t}\n\t}",
"Integer loadUserCount();",
"java.lang.String getPercentage();",
"private float getPercentage(int count, int total) {\n return ((float) count / total) * 100;\n }",
"private String createPercentage(String districtName, String line, HashMap<String, Integer> totalVotesHashMap){\n Integer total_votes = totalVotesHashMap.get(districtName);\n Integer votes = Integer.parseInt(line);\n\n return Double.toString(Math.round(Double.parseDouble(line) /\n Double.parseDouble(Integer.toString(totalVotesHashMap.get(districtName))) *\n 10000.0) / 100.0);\n }",
"int getWhoThisUserFollows(User user, AsyncResultHandler handler);",
"public void userWithMostLikes() {\n Map<Integer, Integer> userLikesCount = new HashMap<>();\n Map<Integer, User> users = DataStore.getInstance().getUsers();\n \n for (User user : users.values()) {\n for (Comment c : user.getComments()) {\n int likes = 0;\n if (userLikesCount.containsKey(user.getId())) {\n likes = userLikesCount.get(user.getId());\n }\n likes += c.getLikes();\n userLikesCount.put(user.getId(), likes);\n }\n }\n int max = 0;\n int maxId = 0;\n for (int id : userLikesCount.keySet()) {\n if (userLikesCount.get(id) > max) {\n max = userLikesCount.get(id);\n maxId = id;\n }\n }\n System.out.println(\"User with most likes: \" + max + \"\\n\" \n + users.get(maxId));\n }",
"public void userWithMostLikes() {\n Map<Integer, Integer> userLikesCount = new HashMap<>();\n Map<Integer, User> users = DataStore.getInstance().getUsers();\n \n for (User user : users.values()) {\n for (Comment c : user.getComments()) {\n int likes = 0;\n if (userLikesCount.containsKey(user.getId())) {\n likes = userLikesCount.get(user.getId());\n }\n likes += c.getLikes();\n userLikesCount.put(user.getId(), likes);\n }\n }\n int max = 0;\n int maxId = 0;\n for (int id : userLikesCount.keySet()) {\n if (userLikesCount.get(id) > max) {\n max = userLikesCount.get(id);\n maxId = id;\n }\n }\n System.out.println(\"User with most likes: \" + max + \"\\n\" \n + users.get(maxId));\n }",
"public Future<List<UUID>> checkOwner(Map<String, List<String>> req, String userId) {\n Promise<List<UUID>> p = Promise.promise();\n\n Future<List<UUID>> resGrp;\n Future<List<UUID>> resItem;\n if (req.containsKey(RES_GRP)) {\n\n List<String> resGrpIds = req.get(RES_GRP);\n resGrp = resGrpOwner(resGrpIds, userId);\n } else resGrp = Future.succeededFuture(new ArrayList<>());\n\n if (req.containsKey(RES)) {\n List<String> resIds = req.get(RES);\n resItem = resOwner(resIds, userId);\n } else resItem = Future.succeededFuture(new ArrayList<>());\n\n CompositeFuture.all(resGrp, resItem)\n .onSuccess(\n obj -> {\n List<UUID> resp = new ArrayList<>();\n if (!resGrp.result().isEmpty()) resp.addAll(resGrp.result());\n\n if (!resItem.result().isEmpty()) resp.addAll(resItem.result());\n\n p.complete(resp);\n })\n .onFailure(fail -> p.fail(INTERNALERROR));\n // return map of res_id,iowners in place of user id\n // check if userid is delegate for any of these owners\n // compose\n // check if user id is an active delegate of all of the owner ids for resource\n // return list of not delegate\n return p.future();\n }",
"private float calculateTip( float amount, int percent, int totalPeople ) {\n\t\tfloat result = (float) ((amount * (percent / 100.0 )) / totalPeople);\n\t\treturn result;\n\t}",
"void spray(double percent)\n {\n roaches = (int) (roaches - (roaches * percent / 100));\n }",
"private int getOrInit(String userId, HashMap<String, Integer> balance) {\n if (balance.containsKey(userId)) {\n return balance.get(userId);\n } else {\n return 1000;\n }\n }",
"public int getOwnUserId()\n {\n return this.ownUserId;\n }",
"Counter getDeskMembersCounts(String userID) throws GAException;",
"@Override\r\n\tprotected void map(LongWritable key, Text value, Context context)\r\n\t\t\tthrows IOException, InterruptedException {\n\r\n\t\tString[] userUserAndCount = value.toString().split(\r\n\t\t\t\tProtocols.USER_USER_COUNT_SEPARATOR);\r\n\t\tString[] users = userUserAndCount[0]\r\n\t\t\t\t.split(Protocols.USER_USER_SEPARATOR);\r\n\r\n\t\tcontext.write(new IntWritable(Integer.parseInt(users[0])), new Text(\r\n\t\t\t\tusers[1] + Protocols.USER_WEIGHT + userUserAndCount[1]));\r\n\t\tcontext.write(new IntWritable(Integer.parseInt(users[1])), new Text(\r\n\t\t\t\tusers[0] + Protocols.USER_WEIGHT + userUserAndCount[1]));\r\n\r\n\t}",
"@Override\n\tpublic double percentualeUtentiDisabilitati () throws DAOException{\n\t\tConnection connection = null;\n\t\tPreparedStatement statement = null;\n\t\tResultSet resultSet = null;\n\t\tdouble numeroUtenti = 0.0;\n\t\ttry {\n\t\t\tconnection = DataSource.getInstance().getConnection();\n\t\t\tstatement = connection.prepareStatement(\"SELECT COUNT (UTENTE.ID)*100/(SELECT COUNT(ID) FROM UTENTE) FROM UTENTE WHERE ABILITATO = 0 GROUP BY(UTENTE.ABILITATO)\");\n\t\t\tresultSet = statement.executeQuery();\n\t\t\tif (resultSet.next()) {\n\t\t\t\tnumeroUtenti = BigDecimal.valueOf(resultSet.getDouble(1)).setScale(2, RoundingMode.HALF_UP).doubleValue();\n\t\t\t\t\n\t\t\t\tSystem.out.println(numeroUtenti);\n\t\t\t}\n\t\t} catch (SQLException | DAOException e) {\n\t\t\tthrow new DAOException(\"ERRORE percentualeUtentiAbilitati utenteAdmin\" + e.getMessage(), e);\n\t\t} finally {\n\t\t\tDataSource.getInstance().close(resultSet);\n\t\t\tDataSource.getInstance().close(statement);\n\t\t\tDataSource.getInstance().close(connection);\n\t\t}\n\t\treturn numeroUtenti;\n\t}",
"public String getWinnerVotePercent(String state) {\r\n result = table.get(state);\r\n String winnerVotePercentage = result.get(2);// getting winner percentage from array list\r\n \r\n return winnerVotePercentage ;\r\n }",
"public double getCredits(User user) throws Exception;",
"@Override\n\tpublic String countProfile(String user_id) throws Exception {\n\t\tint boardC = sqlSession.selectOne(namespace+\".board_count\", user_id);\n\t\tint friendC = sqlSession.selectOne(namespace+\".friend_count\", user_id);\n\t\t\n\t\tString result = boardC +\",\" + friendC;\n\t\treturn result;\n\t}",
"public String findTotalCount(WorkLetPermitDetailDTO workLetPermitDetailDTO, WorkLetPermitPointListDTO workLetPermitPointListDTO, User user) throws Exception;",
"Map<Long, Integer> getUsersWithPendingMeeting();",
"private long calculateAvaregeRating(long curentUserRating) {\n long totalStars = 0;\n for (int x = 1; x < 6; x++) {\n totalStars = totalStars + ((long) documentSnapshot.get(x + \"_star\")) * x;\n }\n totalStars = totalStars + curentUserRating;\n return totalStars / ((long) documentSnapshot.get(\"total_rating\") + 1);\n }",
"public double ratioUsersMorePosted75ChirpsOfAveragePerUser() {\n\t\tcheckAuthority();\n\t\ttry {\n\t\t\treturn this.administratorRepository\n\t\t\t\t\t.ratioUsersMorePosted75ChirpsOfAveragePerUser();\n\t\t} catch (Exception e) {\n\t\t\treturn 0.;\n\t\t}\n\t}",
"private static Achievement createFollowedAchievement(){\n\n ArrayList<String> picturesPaths = new ArrayList<>();\n picturesPaths.add(\"followed_none\");\n picturesPaths.add(\"followed_bronze\");\n picturesPaths.add(\"followed_silver\");\n picturesPaths.add(\"followed_diamond\");\n\n ArrayList<String> picturesLabels = new ArrayList<>();\n picturesLabels.add(\"No followers\");\n picturesLabels.add(\"Followed Chef\");\n picturesLabels.add(\"Famous Chef\");\n picturesLabels.add(\"Renowned Chef\");\n\n ArrayList<Integer> levelSteps = new ArrayList<>();\n levelSteps.add(1);\n levelSteps.add(30);\n levelSteps.add(100);\n\n Function<User, Integer> getUserNbFollowers = u -> u.getSubscribers().size();\n\n return new Achievement(\"followed\", STANDARD_NB_LEVELS, picturesPaths, picturesLabels, levelSteps, getUserNbFollowers);\n }",
"public void percentualGordura(){\n\n s0 = 4.95 / denscorp;\n s1 = s0 - 4.50;\n percentgord = s1 * 100;\n\n }",
"int getWhoFollows(User user, AsyncResultHandler handler);",
"public String getLoserVotePercent(String state) {\r\n result = table.get(state);\r\n String loserVotePercentage = result.get(3);//getting loser percentage from array list\r\n \r\n \r\n return loserVotePercentage;\r\n }",
"public interface CounterRepository<T extends Identifiable>{\n\n public Integer getValue(Identifiable entity);\n\n public void save(Identifiable entity, Integer count);\n\n public Map<T, Integer> getAll();\n \n public Map<User, Map<String, Integer>> getUserDiscountMap();\n\n public void setUserDiscountMap(Map<User, Map<String, Integer>> userDiscountMap);\n \n \n}",
"@Override\r\n\tpublic int getUserIdCount(String user_id) {\n\t\treturn userDao.getUserIdCount(user_id);\r\n\t}",
"public float getPercentage(int n, int total) {\n\n float proportion = ((float) n) / ((float) total);\n\n return proportion * 100;\n }",
"public double ratioUsersEverWrittenArticle() {\n\t\tcheckAuthority();\n\t\ttry {\n\t\t\treturn this.administratorRepository.ratioUsersEverWrittenArticle();\n\t\t} catch (Exception e) {\n\t\t\treturn 0.;\n\t\t}\n\t}",
"@Override\n public int compare(User o1, User o2) {\n if ((o1 == null) && (o2 != null))\n return -1;\n else if ((o1 != null) && (o2 == null))\n return 1;\n else if ((o1 == null) && (o2 == null))\n return 0;\n\n long d1 = o1.getUserPublicProfile().getBirthdate().getTime();\n long d2 = o2.getUserPublicProfile().getBirthdate().getTime();\n\n long res = d2-d1;\n\n return ((res > Integer.MAX_VALUE)?Integer.MAX_VALUE:((res < Integer.MIN_VALUE)?Integer.MIN_VALUE:((res==0)?o1.getUserID().compareToIgnoreCase(o2.getUserID()):(int)res)));\n }",
"public int getPercentage() {\r\n return Percentage;\r\n }",
"public double getPercent() { return this.percentage; }",
"@Override\n\tpublic long getStatusByUserId();",
"public static Integer getAchievementsPercentage(Player p) {\n\n\t\tint NumberOfAch = 0;\n\t\tint NumberCompleted = 0;\n\n\t\tfor(Achievements ach : Achievements.values()) {\n\t\t\tNumberOfAch += 1;\n\t\t\tif(PlayerConfig.hasAchivement(p, ach))\n\t\t\t{\n\t\t\t\tNumberCompleted += 1;\n\t\t\t}\n\t\t}\n\t\tint percent = (int)((NumberCompleted * 100.0f) / NumberOfAch);\n\n\t\treturn percent;\n\t}",
"public Percentage map(UnaryOperator<Decimal> mapper) {\n return new Percentage(mapper.apply(amount));\n }",
"public int selectCountByUserId(Integer userId);",
"@GetMapping(\"/users/{id}\")\r\n public ResponseEntity<?> findAllStatsByUserId(@PathVariable long id) {\r\n List<SportStats> allSportsByUserId = sportStatsService.findAllStatsByUserId(id);\r\n return new ResponseEntity<>(allSportsByUserId, HttpStatus.OK);\r\n }",
"private void updatePrizeInformation(String sourceUserId, String targetUserId, String tombolaId) {\n TombolaDrawing drawing = tombolaAerospikeDao.getTombolaDrawing(tombolaId);\n Predicate<TombolaWinner> isWinnerSourceUser = winner -> StringUtils.equals(winner.getUser().getUserId(), sourceUserId);\n\t\tif (drawing != null && drawing.getWinners().stream().anyMatch(isWinnerSourceUser)) {\n drawing.getWinners().stream()\n \t.filter(isWinnerSourceUser)\n \t.forEach(matchingWinner -> {\n \t\tApiProfileBasicInfo userInfo = commonProfileDao.getProfileBasicInfo(targetUserId);\n \t\tmatchingWinner.setUser(userInfo);\n \t});\n tombolaAerospikeDao.updateDrawing(tombolaId, drawing);\n }\n }",
"public double getTotalPercentOfPresentIngredients(int presentFertiliserId){\r\n\t\tdouble sum = 0.0;\r\n\t\t\r\n\t\tfor (int i=0; i< this.getNrZutaten(); i++){\r\n\t\t\tif (this.modelData.getIngredients().getIngredient().get(i).isActive() == true && this.modelData.getIngredients().getIngredient().get(i).getActive() == true && model.getIdOfPresentIngredientsFromPresentFertiliser(model.getPresentFertiliser(presentFertiliserId)).contains(i) == true ){\r\n\t\t\t\tint index = model.getIndexOfPresentIngredientFromIngredientId(model.getPresentFertiliser(presentFertiliserId), i);\r\n\t\t\t\tsum += this.modelData.getPresentFertiliser().get(presentFertiliserId).getPresentIngredients().getPresentIngredient().get(index).getPercent();\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Percent: \" + this.modelData.getPresentFertiliser().get(presentFertiliserId).getPresentIngredients().getPresentIngredient().get(index).getPercent() + \" Fertiliser: \" + presentFertiliserId);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\treturn this.runden(sum, 2);\r\n\t}",
"int getRemainderPercent();",
"protected int[] getOwners() {\n \t\treturn owners;\n \t}",
"int getCountOfFemaleUsers(List<User> users);",
"@Query(\"select count(a) from Announcement a right join a.rendezvous r group by r.id\")\n\tCollection<Double> dashboardAnnouncementsRatio();",
"float getBonusPercentHP();",
"List<UserDTO> getUserByOccupation( String occupation );",
"public int getAvgUsers()\n/* */ {\n/* 31 */ return this.avgUsers;\n/* */ }",
"@GetMapping(\"/users/{userId}\")\r\n public UserRating getUserRating(@PathVariable(\"userId\") String userId) {\r\n List<Rating> ratings = Arrays.asList(\r\n new Rating(\"120\", 4),\r\n new Rating(\"35\", 3)\r\n );\r\n return new UserRating(ratings);\r\n }",
"public List getOwnerUsersList(Map map) {\n\t String currentUser = UserUtil.getCurrentPrincipalUser();\r\n\t\t List ls = (List)map.get(currentUser);\r\n//\t\t System.out.println(\"map.size()\"+currentUser) ;\r\n//\t\t System.out.println(map.size()) ;\r\n\t\treturn ls;\r\n\t}",
"@Override\n public WeightedGraph<Long> computeTrustValues(\n DatasetLoader<? extends Rating> datasetLoader,\n Collection<Long> users) throws CannotLoadRatingsDataset {\n boolean printPartialResults;\n\n final RatingsDataset<? extends Rating> ratingsDataset = datasetLoader.getRatingsDataset();\n printPartialResults = ratingsDataset.allRatedItems().size() <= 100 && ratingsDataset.allUsers().size() <= 28;\n\n if (!Global.isInfoPrinted()) {\n printPartialResults = false;\n }\n\n int numTrustValuesThatNeedToBePropagated = 0;\n\n Map<Long, Map<Long, Number>> MSD = new TreeMap<>();\n Map<Long, Map<Long, Number>> UJaccard = new TreeMap<>();\n {\n int i = 1;\n for (Long idUser : users) {\n MSD.put(idUser, new TreeMap<>());\n UJaccard.put(idUser, new TreeMap<>());\n\n Map<Long, ? extends Rating> userRatings;\n try {\n userRatings = ratingsDataset.getUserRatingsRated(idUser);\n } catch (UserNotFound ex) {\n ERROR_CODES.USER_NOT_FOUND.exit(ex);\n return null;\n }\n\n //Para cada vecino calculo el MSD\n for (Long idUserNeighbor : users) {\n try {\n double meanUser = ratingsDataset.getMeanRatingUser(idUser);\n double meanUserNeighbour = ratingsDataset.getMeanRatingUser(idUserNeighbor);\n\n Map<Long, ? extends Rating> userNeighbourRatings = ratingsDataset.getUserRatingsRated(idUserNeighbor);\n\n Set<Long> commonItems = new TreeSet<>(userRatings.keySet());\n commonItems.retainAll(userNeighbourRatings.keySet());\n if (commonItems.isEmpty()) {\n numTrustValuesThatNeedToBePropagated++;\n continue;\n }\n double[] ratings = new double[commonItems.size()];\n double[] predictions = new double[commonItems.size()];\n\n //Compute predictions. At the same time, compute mand min of rating and prediction, to save cycles later on.\n double ratingMax = -Double.MAX_VALUE;\n double ratingMin = Double.MAX_VALUE;\n double predictionMax = -Double.MAX_VALUE;\n double predictionMin = Double.MAX_VALUE;\n\n {\n int index = 0;\n for (Long idItem : commonItems) {\n double rating = userRatings.get(idItem).getRatingValue().doubleValue();\n ratings[index] = rating;\n double prediction = meanUser + userNeighbourRatings.get(idItem).getRatingValue().doubleValue() - meanUserNeighbour;\n predictions[index] = prediction;\n index++;\n\n ratingMax = Math.max(ratingMax, rating);\n ratingMin = Math.min(ratingMin, rating);\n predictionMax = Math.max(predictionMax, prediction);\n predictionMin = Math.min(predictionMin, prediction);\n }\n }\n\n //Ratings MaxMin normalisation\n if (ratingMax == ratingMin) {\n for (int index = 0; index < ratings.length; index++) {\n ratings[index] = 1;\n }\n } else {\n for (int index = 0; index < ratings.length; index++) {\n ratings[index] = (ratings[index] - ratingMin) / (ratingMax - ratingMin);\n }\n }\n\n //Predictions MaxMin normalisation\n if (predictionMax == predictionMin) {\n for (int index = 0; index < predictions.length; index++) {\n predictions[index] = 1;\n }\n } else {\n for (int index = 0; index < ratings.length; index++) {\n predictions[index] = (predictions[index] - predictionMin) / (predictionMax - predictionMin);\n }\n }\n\n //Calculo el MSD\n double sumOfError = 0;\n for (int index = 0; index < ratings.length; index++) {\n sumOfError += Math.pow(ratings[index] - predictions[index], 2);\n }\n\n double MSD_of_pair = 1 - (sumOfError / commonItems.size());\n MSD.get(idUser).put(idUserNeighbor, MSD_of_pair);\n\n //Calculo el Jaccard\n double numUserRatings = userRatings.size();\n double numUserNeighborRatings = userNeighbourRatings.size();\n double numCommon = commonItems.size();\n double jaccard_of_pair = numCommon / (numUserRatings + numUserNeighborRatings - commonItems.size());\n UJaccard.get(idUser).put(idUserNeighbor, jaccard_of_pair);\n } catch (UserNotFound ex) {\n ERROR_CODES.USER_NOT_FOUND.exit(ex);\n }\n }\n\n fireProgressChanged(\"User-Based trust\", (int) ((i * 100.0f) / users.size()), -1);\n\n if (Global.isVerboseAnnoying()) {\n Global.showInfoMessage(new Date().toString() + \": User-based trust \" + ((i * 100.0f) / users.size()) + \"%\\n\");\n }\n i++;\n }\n }\n\n TreeMap<Long, Map<Long, Number>> usersTrust = new TreeMap<>();\n for (Long idUser : users) {\n usersTrust.put(idUser, new TreeMap<>());\n\n for (Long idUserNeighbour : users) {\n\n if (!UJaccard.containsKey(idUser) || !UJaccard.get(idUser).containsKey(idUserNeighbour) || !MSD.containsKey(idUser) || !MSD.get(idUser).containsKey(idUserNeighbour)) {\n continue;\n }\n\n usersTrust.get(idUser).put(idUserNeighbour, MSD.get(idUser).get(idUserNeighbour).doubleValue() * UJaccard.get(idUser).get(idUserNeighbour).doubleValue());\n\n }\n }\n\n UJaccard.clear();\n MSD.clear();\n\n if (propagate == false) {\n return new WeightedGraph<>(usersTrust);\n }\n\n fireProgressChanged(\"Trust propagation\", 0, -1);\n\n /**\n * Las confianzas propagadas se incluyen aqui para no ser tenidas en\n * cuenta al propagar confianza, sólo cuando ha finalizado el proceso.\n */\n Map<Long, Map<Long, Double>> propagatedTrusts = new TreeMap<>();\n {\n int i = 0;\n for (Long idSourceUser : users) {\n for (Long idTargetUser : users) {\n if (usersTrust.get(idSourceUser).containsKey(idTargetUser)) {\n //Los usuarios ya son adyacentes, no es necesario propagar.\n } else {\n if (!propagatedTrusts.containsKey(idSourceUser)) {\n propagatedTrusts.put(idSourceUser, new TreeMap<>());\n }\n //Propagate trust to complete this connection.\n if (printPartialResults) {\n Global.showInfoMessage(\"Propagating trust between user \" + idSourceUser + \" and user \" + idTargetUser + \"\\n\");\n }\n\n Set<Long> adyacentesAAmbos = new TreeSet<>(usersTrust.get(idSourceUser).keySet());\n adyacentesAAmbos.retainAll(usersTrust.get(idTargetUser).keySet());\n if (adyacentesAAmbos.isEmpty()) {\n //No tienen ningún adyacente en común, por lo que no se puede propagar, hay que contar este enlace para el porcentaje de progreso.\n } else {\n double numerador = 0;\n double denominador = 0;\n for (Long idIntermediateUser : adyacentesAAmbos) {\n double usersTrustAB = usersTrust.get(idSourceUser).get(idIntermediateUser).doubleValue();\n double usersTrustBC = usersTrust.get(idIntermediateUser).get(idTargetUser).doubleValue();\n int numCommonAB;\n try {\n TreeSet<Long> commonAB = new TreeSet<>(ratingsDataset.getUserRated(idSourceUser));\n commonAB.retainAll(ratingsDataset.getUserRated(idIntermediateUser));\n numCommonAB = commonAB.size();\n } catch (UserNotFound ex) {\n numCommonAB = 0;\n ERROR_CODES.USER_NOT_FOUND.exit(ex);\n }\n\n int numCommonBC;\n try {\n TreeSet<Long> commonBC = new TreeSet<>(ratingsDataset.getUserRated(idIntermediateUser));\n commonBC.retainAll(ratingsDataset.getUserRated(idTargetUser));\n numCommonBC = commonBC.size();\n } catch (UserNotFound ex) {\n numCommonBC = 0;\n ERROR_CODES.USER_NOT_FOUND.exit(ex);\n }\n\n //Efectivamente, numCommonAB y/o numCommonBC pueden ser cero si la confianza viene de haber sido propagada previamente (Esto ya no se aplica ya que la confianza propagada no se tiene en cuenta para propagar otros valores).\n double contribucionNumerador = numCommonAB * usersTrustAB + numCommonBC * usersTrustBC;\n double contribucionDenominador = numCommonAB + numCommonBC;\n numerador += contribucionNumerador;\n denominador += contribucionDenominador;\n }\n double PTrustAB = numerador / denominador;\n propagatedTrusts.get(idSourceUser).put(idTargetUser, PTrustAB);\n if (printPartialResults) {\n Global.showInfoMessage(\"Propagated trust between user \" + idSourceUser + \" and user \" + idTargetUser + \" --> \" + PTrustAB + \" (\" + (int) ((i * 100f) / numTrustValuesThatNeedToBePropagated) + \"%)\\n\");\n }\n }\n fireProgressChanged(\"User trust propagation\", (int) ((i * 100f) / numTrustValuesThatNeedToBePropagated), -1);\n i++;\n }\n }\n }\n }\n\n //Una vez todas las confianzas propagadas se han calculado, se introducen en el grafo.\n for (Long idSourceUser : propagatedTrusts.keySet()) {\n for (Long idTargetUser : propagatedTrusts.get(idSourceUser).keySet()) {\n double PTrustAB = propagatedTrusts.get(idSourceUser).get(idTargetUser);\n usersTrust.get(idSourceUser).put(idTargetUser, PTrustAB);\n }\n }\n\n fireProgressChanged(\"Finished trust calculation\", 100, -1);\n return new WeightedGraph<>(usersTrust);\n }",
"long getOwnedEntryCount();",
"public Map<User, Double> getSalesPrUser() {\n\t\tMap<User, Double> sales = new HashMap<>();\n\n\t\tfor (Order o : orders) {\n\t\t\tDouble currentTotal = sales.get(o.getUser());\n\n\t\t\tif (currentTotal == null) {\n\t\t\t\tcurrentTotal = 0.0;\n\t\t\t}\n\n\t\t\tcurrentTotal += o.totalPrice();\n\n\t\t\tsales.put(o.getUser(), currentTotal);\n\t\t}\n\n\t\treturn sales;\n\t}",
"Float getFedAnimalsPercentage();",
"public double averageFollowupsPerArticle() {\n\t\tcheckAuthority();\n\t\ttry {\n\t\t\treturn this.administratorRepository.averageFollowupsPerArticle();\n\t\t} catch (Exception e) {\n\t\t\treturn 0.;\n\t\t}\n\n\t}",
"int getNumberOfRegsUser(long idUser);",
"public HashMap<Integer, User> process(List<User> list) {\n HashMap<Integer, User> map = new HashMap<>();\n for (User user : list) {\n int userId = user.getId();\n map.putIfAbsent(userId, user);\n }\n return map;\n }",
"int getUsersCount();",
"int getUsersCount();",
"int getUsersCount();",
"List<User> getUsersWithCorrectedAge(List<User> users);",
"public double usagePercentage() {\n return 1.0 * (this.rectangleCount() - 1) / (this.M * this.nodeCount()); // -1 in order to ignore de root\n }",
"private Map<Profile, Integer> rating(){\n\t\treturn allRatings;\n\t}",
"public int awardTriviaCoins (double pct) {\n Random r = new Random();\n int min = 1;\n if (pct > 0.75) {\n min = 15;\n } else if (pct > 0.5) {\n min = 10;\n } else if (pct > 0.25) {\n min = 5;\n }\n int winnings = min + (int)(Math.ceil(r.nextInt(10) * pct));\n this.coinCount += winnings;\n this.save();\n \n UserEvent.NewCoins message = new UserEvent.NewCoins(this.id, winnings);\n notifyMe(message);\n \n return winnings;\t \n\t}",
"public double getPercentageIdentity(ValueEdge edge) {\n\t\tPair<HitVertex> pair = this.getEndpoints(edge);\n\t\tSubHit subHit[] = edge.getSubHit();\n\t\tint identitiesSum = 0;\n\t\tint lengthSum = 0;\n\t\tfor (int i = 0; i < subHit.length; i++) {\n\t\t\tidentitiesSum += subHit[i].getNumberOfIdentities();\n\t\t\tlengthSum += Math.max(\n\t\t\t\t\tsubHit[i].getQuerySequenceEnd()\n\t\t\t\t\t\t\t- subHit[i].getQuerySequenceStart(),\n\t\t\t\t\tsubHit[i].getSubjectSequenceEnd()\n\t\t\t\t\t\t\t- subHit[i].getSubjectSequenceStart());\n\t\t}\n\n\t\treturn identitiesSum * 100.0 / lengthSum;\n\t}",
"public double getHitsPercentual()\n\t{\n\t\t//Convert int to double values\n\t\tdouble doubleHits = hits;\n\t\tdouble doubleTotalProcessedStops = totalProcessedStops;\n\t\t\n\t\t//Hits percentual obtained by Jsprit algorithm\n\t\treturn Math.round(100 * (doubleHits / doubleTotalProcessedStops));\n\t}",
"int getUserCount();",
"int getUserCount();",
"UserDTO getProfile(final int userId) throws DataUnreachableException;",
"public HashMap<String,Long> getSurveyCompletedCount(Long userId);",
"@Override\n public UserFraudScore getAggregatedFraudScore(NewUserRequest newUserRequest) {\n return fraudChecks.stream()\n .map(fraudCheck -> fraudCheck.getFraudScore(newUserRequest))\n .reduce((a, b) -> { return UserFraudScore.getHighest(a, b); })\n .get();\n }",
"@Override\n\tpublic double percentualeGruppiCompletati () throws DAOException{\n\t\tConnection connection = null;\n\t\tPreparedStatement statement = null;\n\t\tResultSet resultSet = null;\n\t\tdouble numeroGruppiCompletati = 0.0;\n\t\ttry {\n\t\t\tconnection = DataSource.getInstance().getConnection();\n\t\t\tstatement = connection.prepareStatement(\"SELECT COUNT (GRUPPO.ID)*100/(SELECT COUNT(ID) FROM GRUPPO) FROM GRUPPO WHERE COMPLETO = 1 GROUP BY(GRUPPO.COMPLETO)\");\n\t\t\tresultSet = statement.executeQuery();\n\t\t\tif (resultSet.next()) {\n\t\t\t\tnumeroGruppiCompletati = BigDecimal.valueOf(resultSet.getDouble(1)).setScale(2, RoundingMode.HALF_UP).doubleValue();\n\t\t\t}\n\t\t} catch (SQLException | DAOException e) {\n\t\t\tthrow new DAOException(\"ERRORE percentualeGruppiCompletati utenteAdmin\" + e.getMessage(), e);\n\t\t} finally {\n\t\t\tDataSource.getInstance().close(resultSet);\n\t\t\tDataSource.getInstance().close(statement);\n\t\t\tDataSource.getInstance().close(connection);\n\t\t}\n\t\treturn numeroGruppiCompletati;\n\t}",
"String calculateAttendancePercentage(int attended, int missing)\n {\n int total = attended + missing;\n\n float percent = ((float)attended / (float)total) * 100;\n\n DecimalFormat df = new DecimalFormat(\"#.#\");\n\n // return as a string\n String returnVal = \"Total Attendance: \\n\" + df.format(percent) + \"%\";\n\n return returnVal;\n }",
"public ArrayList<User> retrieveUserFraction(Database db, float fractionOfData)\n\t{\n\t\tArrayList<User> results = new ArrayList<User>();\n\t\ttry {\n\t\t\tint tableLength = (db.length(\"user_profile\"));\n\t\t\tint selectedLength = (int) (tableLength * fractionOfData);\n\t\t\t\n\t\t\tfor (int i=0;i<selectedLength;i++)\n\t\t\t{\n\t\t\t\tint offset = (int) (Math.random()* selectedLength);\n\t\t\t\tObject[] obj = db.getOneRow(\"user_profile\", offset);\n\t\t\t\t\n\t\t\t\tint id = (Integer)obj[0];\n\t\t\t\t\n\t\t\t\t// TODO handle differently actions and follows\n\t\t\t\tUser currentUser = new User(id,db);\n\t\t\t\t\n\t\t\t\tresults.add(currentUser);\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\treturn results;\n\t}",
"private void updateFriendsCount(String userId, String ownId, boolean increment) {\n String error = \"Failed to update friends count information\";\n UserDatabase userDb = new UserDatabase(userId);\n DocumentReference documentReference = userDb.getDatabase();\n documentReference.get()\n .addOnSuccessListener(success -> setFriendsCount(documentReference, success.getData(), increment, true))\n .addOnFailureListener(fail -> handleError(error, fail));\n\n userDb = new UserDatabase(ownId);\n DocumentReference documentReference1 = userDb.getDatabase();\n documentReference1.get()\n .addOnSuccessListener(success -> setFriendsCount(documentReference1, success.getData(), increment, false)) // our profile view is out of sight, so don't update\n .addOnFailureListener(fail -> handleError(error, fail));\n }"
] | [
"0.6024218",
"0.5963864",
"0.56726015",
"0.5505425",
"0.54169625",
"0.5293519",
"0.522346",
"0.5157771",
"0.5145175",
"0.514291",
"0.5139935",
"0.5129702",
"0.5111893",
"0.51053935",
"0.51016426",
"0.50769395",
"0.5073125",
"0.50457156",
"0.50457156",
"0.50434756",
"0.504112",
"0.50291556",
"0.5001234",
"0.49930713",
"0.49627376",
"0.49597642",
"0.4954791",
"0.49449056",
"0.49317753",
"0.49278826",
"0.49249417",
"0.49143255",
"0.49143255",
"0.4901712",
"0.4896668",
"0.48953402",
"0.4895046",
"0.48933774",
"0.48874348",
"0.48810703",
"0.48769847",
"0.48622996",
"0.48513636",
"0.4848052",
"0.48468494",
"0.48412544",
"0.482043",
"0.4820106",
"0.4800726",
"0.47883242",
"0.4786525",
"0.47859925",
"0.47605354",
"0.47585502",
"0.47553748",
"0.4753172",
"0.47529653",
"0.4749469",
"0.47346494",
"0.47346333",
"0.47340828",
"0.47296363",
"0.47284064",
"0.47282037",
"0.47266227",
"0.47239688",
"0.47205728",
"0.47119004",
"0.47115448",
"0.47114006",
"0.47084978",
"0.47027907",
"0.4698352",
"0.46976092",
"0.46973014",
"0.46855125",
"0.46829727",
"0.46780404",
"0.46774977",
"0.46620423",
"0.4661103",
"0.4660542",
"0.46601278",
"0.46601278",
"0.46601278",
"0.46587148",
"0.4656396",
"0.4652721",
"0.4649001",
"0.46485457",
"0.46410462",
"0.46306407",
"0.46306407",
"0.46257785",
"0.46246535",
"0.46141648",
"0.46128038",
"0.46059358",
"0.46055603",
"0.45929548"
] | 0.62685 | 0 |
wait for Agent1_0DeploymentUnitByType3 to initialise | @Test(invocationCount=1,skipFailedInvocations=false)
public void testDemo() throws TimeOut{
MentalStateManager msmAgent1_0DeploymentUnitByType3=MSMRepository.getInstance().waitFor("Agent1_0DeploymentUnitByType3");
// wait for Agent1_0DeploymentUnitByType2 to initialise
MentalStateManager msmAgent1_0DeploymentUnitByType2=MSMRepository.getInstance().waitFor("Agent1_0DeploymentUnitByType2");
// wait for Agent0_0DeploymentUnitByType1 to initialise
MentalStateManager msmAgent0_0DeploymentUnitByType1=MSMRepository.getInstance().waitFor("Agent0_0DeploymentUnitByType1");
// wait for Agent0_0DeploymentUnitByType0 to initialise
MentalStateManager msmAgent0_0DeploymentUnitByType0=MSMRepository.getInstance().waitFor("Agent0_0DeploymentUnitByType0");
GenericAutomata ga=null;
ga=new GenericAutomata();
ga.addInitialState("default_WFTestInitialState0");
ga.addInitialState("default_WFTestInitialState1");
ga.addFinalState("WFTestFinalState0");
ga.addStateTransition("default_WFTestInitialState0","Agent0_0DeploymentUnitByType0-Task0","WFTestInitialState0");
ga.addStateTransition("WFTestInitialState0","Agent1_0DeploymentUnitByType2-Task1","WFTestFinalState0");
ga.addStateTransition("default_WFTestInitialState1","Agent0_0DeploymentUnitByType1-Task0","WFTestInitialState1");
ga.addStateTransition("WFTestInitialState1","Agent1_0DeploymentUnitByType2-Task1","WFTestFinalState0");
TaskExecutionValidation tev=new TaskExecutionValidation(ga);
tev.registerTask("Agent0_0DeploymentUnitByType0","Task0");
tev.registerTask("Agent1_0DeploymentUnitByType2","Task1");
tev.registerTask("Agent0_0DeploymentUnitByType1","Task0");
tev.registerTask("Agent1_0DeploymentUnitByType2","Task1");
RetrieveExecutionData cwfe=new RetrieveExecutionData();
EventManager.getInstance().register(cwfe);
long step=100;
long currentTime=0;
long finishedTime=0;
long duration=2000;
long maxtimepercycle=2000;
MainInteractionManager.goAutomatic(); // tells the agents to start working
while (currentTime<finishedTime){
try {
Thread.currentThread().sleep(step);
} catch (InterruptedException e) {
e.printStackTrace();
}
currentTime=currentTime+step;
}
if (currentTime<duration){
TestUtils.doNothing(duration-currentTime); // waits for tasks to execute
}
MainInteractionManager.goManual(); // now it commands to not execute more tasks
EventManager.getInstance().unregister(cwfe);
Vector<String> counterExamples=tev.validatePartialTermination(cwfe,ga,maxtimepercycle);
assertTrue("The execution does not match the expected sequences. I found the following counter examples "+counterExamples,counterExamples.isEmpty());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void waitServersReady() {\n }",
"public void checkAndInstallPC(){\n psconfig.setAndSaveProperty(LiferayConstants.SETUP_DONE,\"true\");\n \n \n \n // logger.info(\"Trying to install PC............\");\n /* ProgressHandle handle = ProgressHandleFactory.createHandle(org.openide.util.NbBundle.getMessage(SunASStartStopListener.class, \"INSTALLING_PORTLET_CONTAINER\"));\n handle.start();\n try{\n \n \n String pcHome = psconfig.getPSHome();\n String serverHome = psconfig.getServerHome();\n \n // String pcBase = getPCBaseDir(psconfig);\n pcHome = changeToOSSpecificPath(pcHome);\n serverHome = changeToOSSpecificPath(serverHome);\n // pcBase = changeToOSSpecificPath(pcBase);\n String domainDir = psconfig.getDomainDir();\n domainDir = changeToOSSpecificPath(domainDir);\n \n \n \n \n Properties props = new Properties();\n props.setProperty(\"portlet_container_home\",pcHome);\n // props.setProperty(\"portlet_container_base\",pcBase);\n props.setProperty(\"GLASSFISH_HOME\",serverHome);\n props.setProperty(\"DOMAIN\",psconfig.getDefaultDomain());\n props.setProperty(\"AS_ADMIN_USER\",psconfig.getProperty(SunAppServerConstants.SERVER_USER));\n props.setProperty(\"AS_ADMIN_PASSWORD\",psconfig.getProperty(SunAppServerConstants.SERVER_PASSWORD));\n \n //find setup.xml\n \n File file = new File(pcHome + File.separator + \"setup.xml\");\n if(!file.exists()) {\n logger.log(Level.SEVERE,org.openide.util.NbBundle.getMessage(SunASStartStopListener.class, \"SETUP_XML_NOT_FOUND\"));\n return;\n }\n \n FileObject setUpXmlObj = FileUtil.toFileObject(file);\n \n ExecutorTask executorTask = ActionUtils.runTarget(setUpXmlObj,new String[]{\"deploy_on_glassfish\"},props);\n psconfig.setAndSaveProperty(LifeRayConstants.SETUP_DONE,\"true\");\n executorTask.waitFinished();\n \n try{\n handle.finish();\n handle = ProgressHandleFactory.createHandle(org.openide.util.NbBundle.getMessage(SunASStartStopListener.class, \"STARTING_APPSERVER\"));\n handle.start();\n }catch(Exception e){\n \n }*/\n \n //logger.info(\"Starting Glassfish Server.....\");\n /// dm.getStartServerHandler().startServer();\n \n /* }catch(Exception e){\n logger.log(Level.SEVERE,org.openide.util.NbBundle.getMessage(SunASStartStopListener.class, \"ERROR_INSTALLING_PC\"),e);\n }finally{\n handle.finish();\n }*/\n \n }",
"public void ondemandSetupIsDone();",
"void waitForAddStatusIsDisplayed() {\n\t\tSeleniumUtility.waitElementToBeVisible(driver, homepageVehiclePlanning.buttonTagAddStatusHomepageVehiclePlanning);\n\t}",
"private void initialDeploy() {\n }",
"public Status waitUntilFinished();",
"protected void waitUntilCommandFinished() {\n }",
"@Before\n public void init(){\n mSignal = new CountDownLatch(1);\n }",
"void finishInitialization() throws SetupException;",
"protected void waitDownloads() throws Exception {\n runtimeWrapper.newCommand();\n }",
"protected void checkIfReady() throws Exception {\r\n checkComponents();\r\n }",
"public static void waitForRegistrationButton(){\n DriverManager.waitForElement(Constans.REGISTRATION_BUTTON_LOCATOR);\n }",
"protected abstract void beforeWait();",
"@SuppressWarnings({\"unchecked\"})//class casting to string array\n @Test\n public void testMetatypeInformationInstalledBundleXML() throws IOException, InterruptedException\n {\n MessageListener listener = new MessageListener(socket);\n\n //find the test bundle\n long testBundleId = BundleNamespaceUtils.getBundleBySymbolicName(\"mil.dod.th.ose.integration.example.metatype\", \n socket);\n\n //verify that the test bundle was found\n assertThat(testBundleId, greaterThan(0L));\n\n int regId = RemoteEventRegistration.regRemoteEventMessages(socket, \n RemoteMetatypeConstants.TOPIC_METATYPE_INFORMATION_AVAILABLE);\n\n //jar to update\n File jarFile = new File(ResourceUtils.getBaseIntegrationPath(), \n \"generated/mil.dod.th.ose.integration.example.metatype.jar\");\n byte[] buf = FileUtils.readFileToByteArray(jarFile);\n //construct request to start bundle\n UpdateRequestData requestStart = UpdateRequestData.newBuilder().setBundleFile(ByteString.copyFrom(buf)).\n setBundleId(testBundleId).build();\n TerraHarvestMessage message = \n BundleNamespaceUtils.createBundleMessage(requestStart, BundleMessageType.UpdateRequest);\n\n //send message\n message.writeDelimitedTo(socket.getOutputStream());\n\n //listen for response from the configuration listener, extraneous wait\n //because the bundle needs time to start, framework needs to post bundle event and then\n //then the metatype listener will post its event.\n List<MessageDetails> responses = listener.waitForRemoteEvents(\n RemoteMetatypeConstants.TOPIC_METATYPE_INFORMATION_AVAILABLE, TIME_OUT, MatchCount.atLeast(2));\n\n //unreg listener\n MessageListener.unregisterEvent(regId, socket);\n\n //parse Response\n EventAdminNamespace namespace = (EventAdminNamespace)responses.get(0).getNamespaceMessage();\n SendEventData event = SendEventData.parseFrom(namespace.getData());\n\n Map<String, Object> propertyMap = \n SharedRemoteInterfaceUtils.getSimpleMapFromComplexTypesMap(event.getPropertyList());\n\n //check other response\n namespace = (EventAdminNamespace)responses.get(1).getNamespaceMessage();\n event = SendEventData.parseFrom(namespace.getData());\n\n Map<String, Object> propertyMap2 = \n SharedRemoteInterfaceUtils.getSimpleMapFromComplexTypesMap(event.getPropertyList());\n //verify events\n if (((List<String>)propertyMap.get(RemoteMetatypeConstants.EVENT_PROP_PIDS)).\n contains(\"example.metatype.XML.ExampleClass\"))\n {\n assertThat((Long)propertyMap.get(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(testBundleId));\n }\n else\n {\n //verify\n assertThat((Long)propertyMap.get(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(testBundleId));\n assertThat((List<String>)propertyMap.get(RemoteMetatypeConstants.EVENT_PROP_PIDS), \n hasItem(\"example.metatype.configadmin.ExampleInMemConfigClass\"));\n }\n //verify events\n if (((List<String>)propertyMap2.get(RemoteMetatypeConstants.EVENT_PROP_PIDS)).\n contains(\"example.metatype.XML.ExampleClass\"))\n {\n assertThat((Long)propertyMap2.get(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(testBundleId));\n }\n else\n {\n //verify\n assertThat((Long)propertyMap2.get(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(testBundleId));\n assertThat((List<String>)propertyMap2.get(RemoteMetatypeConstants.EVENT_PROP_PIDS), \n hasItem(\"example.metatype.configadmin.ExampleInMemConfigClass\"));\n }\n }",
"boolean isSetupDone();",
"@Override\n public boolean waitToProceed() {\n return false;\n }",
"public void waitForLoad() {\n\tExpectedCondition<Boolean> pageLoadCondition = new ExpectedCondition<Boolean>()\r\n\t { \r\n public Boolean apply(WebDriver driver) \r\n {\r\n\t return ((JavascriptExecutor)driver).executeScript(\"return document.readyState\").equals(\"complete\");\r\n\t\t }\r\n\t\t };\r\n\t// a\r\n\t\t if((new WebDriverWait(driver, 0.1).until(PageLoadCondition))==false){\r\n\t\t \t \t\r\n\t\t \t//Takesscreenshot is a java class - screenshot code\r\n\t\t \tTakesScreenshot scrShot=((TakesScreenshot)driver);\r\n\t\t \tFile SrcFile=scrShot.getScreenshotAs(OutputType.FILE);\r\n\t\t \tFile DestFile=new File(fileWithPath);\r\n\t\t \tFileUtils.copyFile(SrcFile, DestFile);\r\n\t\t \tSyso(\"page failed to load in 0.1 sec, refer screenshot saved in ___\");\r\n\t\t }\r\n\t\t// b \r\n\t\t if ((new WebDriverWait(driver, 5).until(PageLoadCondition))==true)){\r\n\t\t System.out.println(\"page loaded in 5 sec\");\t\r\n\t\t }\r\n\t}",
"public void ensureM2EcipseBeingInited()\r\n\t\t\tthrows Exception {\r\n\t\t// TODO: disable this because Maven is not available in V3. Working on solutions later.\r\n\t\t// maybe we can put it in Repo system.\r\n//\t\tBundleContext context = MavenPlugin.getDefault().getBundleContext();\r\n//\t\tMavenPlugin.getDefault().start(context);\r\n//\t\tint state = MavenPlugin.getDefault().getBundle().getState();\r\n//\t\t\r\n//\t\twhile(state != Bundle.ACTIVE) {\r\n//\t\t\tSystem.out.println(\"M2 Eclipse still not started. Sleeping and trying again.\");\r\n//\t\t\tThread.sleep(5000L);\r\n//\t\t\tstate = MavenPlugin.getDefault().getBundle().getState();\r\n//\t\t}\r\n\t}",
"public void reportInitSuccessful() {\n\n System.out.println(\"Subsystem \" + getName() + \" has initialized successfully.\");\n\n SmartDashboard.putBoolean(getName()+\" status\", true);\n }",
"@Test\n public void testInitialize() {\n System.out.println(\"initialize\");\n ExecutorService mwp = MY_WORKER_POOL;\n MyStatus status = mystatus;\n Class<?> package4Prefs = SettingTest.class;\n Setting.initialize(mwp, status, package4Prefs);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public void waitForTransfer() {\n\t\tWebDriverUtil.waitForElementVisible(driver, redirectTimer, 10);\n\t\tWebDriverWait wait = new WebDriverWait(driver, 10);\n\t\tLOG.info(\"waiting to be transferred to merchant site...\");\n\t\twait.until(ExpectedConditions.invisibilityOfElementLocated(By.id(\"transfer-success\")));\n\t\tLOG.info(\"done waiting\"); \n\t}",
"ProcessRunner waitFor();",
"protected void setup() {\n /**\n * Content manager manages the content languages and ontologies \"known\" by a given agent.\n * We register new languages that is required that our agent knows.\n * SLCodec is the codec class for the FIPA-SLn languages.\n * MobilityOntology is the class that represents the ontology used for JADE mobility.\n */\n getContentManager().registerLanguage(new SLCodec());\n getContentManager().registerOntology(MobilityOntology.getInstance());\n\n /**\n * Create containers. ProfileImpl allows us to set boot-parameters for the new containers.\n */\n homeContainer = getContainerController(); //retrieve the containercontroller that this agent lives in\n createdContainers = new AgentContainer[3]; //we require 3 containers for this scenario\n ProfileImpl curatorContainer1 = new ProfileImpl();\n curatorContainer1.setParameter(ProfileImpl.CONTAINER_NAME, \"Curator-Container-1\");\n ProfileImpl curatorContainer2 = new ProfileImpl();\n curatorContainer2.setParameter(ProfileImpl.CONTAINER_NAME, \"Curator-Container-2\");\n ProfileImpl artistManagerContainer = new ProfileImpl();\n artistManagerContainer.setParameter(ProfileImpl.CONTAINER_NAME, \"Artistmanager-Container\");\n createdContainers[0] = runtime.createAgentContainer(curatorContainer1);\n createdContainers[1] = runtime.createAgentContainer(curatorContainer2);\n createdContainers[2] = runtime.createAgentContainer(artistManagerContainer);\n doWait(2000); //wait while containers initializes\n\n /**\n * Request a list of all containers on the platform from AMS\n */\n getAllContainers();\n\n /**\n * Initialize gui\n */\n\n myGui = new ControllerAgentGUI(this, (String[]) containersOnPlatform.keySet().toArray(new String[containersOnPlatform.keySet().size()]));\n myGui.setVisible(true);\n }",
"@Override\n @BeforeMethod(alwaysRun=true)\n public boolean testSetUp()\n throws Exception\n {\n sessionManager = new SessionManager(connectAnchor);\n boolean status = false;\n log.info(\"Test setup Begin:\");\n HashMap<ManagedObjectReference, HostSystemInformation> hostsMap = null;\n Set<ManagedObjectReference> allHosts = null;\n Iterator<ManagedObjectReference> it = null;\n String[] pnicIds = null;\n\n this.ivm = new VirtualMachine(connectAnchor);\n this.iDVS = new DistributedVirtualSwitchHelper(connectAnchor);\n this.iDVPG = new DistributedVirtualPortgroup(connectAnchor);\n this.ihs = new HostSystem(connectAnchor);\n this.ins = new NetworkSystem(connectAnchor);\n hostsMap = this.ihs.getAllHosts(VersionConstants.ESX4x, HostSystemConnectionState.CONNECTED);\n if (hostsMap != null) {\n\n allHosts = hostsMap.keySet();\n if (allHosts != null && allHosts.size() > 0) {\n it = allHosts.iterator();\n while (it.hasNext()) {\n ManagedObjectReference tempMor = it.next();\n if (tempMor != null) {\n if (this.ins.getPNicIds(tempMor) != null) {\n this.hostMor = tempMor;\n break;\n }\n }\n }\n if (this.hostMor != null) {\n hostVersion = this.ihs.getHostProductIdVersion(this.hostMor);\n hostConnectSpec = this.ihs.getHostConnectSpec(this.hostMor);\n log.info(\"Found a host with free pnics in the inventory\");\n this.nsMor = this.ins.getNetworkSystem(this.hostMor);\n if (this.nsMor != null) {\n pnicIds = this.ins.getPNicIds(this.hostMor);\n if (pnicIds != null) {\n status = true;\n } else {\n log.error(\"There are no free pnics on the host\");\n }\n } else {\n log.error(\"The network system MOR is null\");\n }\n } else {\n log.error(\"There are no free pnics on any of the host in \"\n + \"the inventory\");\n }\n } else {\n log.error(\"There are no hosts in the VC inventory\");\n }\n } else {\n log.error(\"The host map is null\");\n }\n\n assertTrue(status, \"Cleanup failed\");\n assertTrue(status, \"Setup failed\");\n return status;\n }",
"public void waitJobPrepareSuccess(final String distSQL) {\n for (int i = 0; i < 5; i++) {\n List<Map<String, Object>> jobStatus = queryForListWithLog(distSQL);\n Set<String> statusSet = jobStatus.stream().map(each -> String.valueOf(each.get(\"status\"))).collect(Collectors.toSet());\n if (statusSet.contains(JobStatus.PREPARING.name()) || statusSet.contains(JobStatus.RUNNING.name())) {\n Awaitility.await().pollDelay(2L, TimeUnit.SECONDS).until(() -> true);\n }\n }\n }",
"public void waitLoadPage() {\n WebDriverHelper.waitUntil(inputTeamName);\n }",
"public void waitUntilStarted() {\n mStarted.block();\n }",
"@InSequence(1)\n @Test\n public void worksAfterDeployment() throws InterruptedException {\n int sum = sendMessages(10);\n runJob();\n Assert.assertEquals(10, collector.getLastItemCount());\n Assert.assertEquals(sum, collector.getLastSum());\n Assert.assertEquals(1, collector.getNumberOfJobs());\n }",
"default void waitUntilReady(double timeoutInSeconds)\n {\n SeleniumAsserts\n .assertThatSoon(timeoutInSeconds, \"Component becomes ready: \" + describe(), () -> this,\n SeleniumMatchers.isReady());\n }",
"private void waitForBuyersAction() throws InterruptedException\n {\n while(waiting)\n {\n Thread.sleep(100);\n }\n waiting = true;\n }",
"@Test\n public void registerUpdateQuickLifecycleTest() throws Exception {\n applicationInfoManager.setInstanceStatus(InstanceInfo.InstanceStatus.UP);\n applicationInfoManager.setInstanceStatus(InstanceInfo.InstanceStatus.UNKNOWN);\n applicationInfoManager.setInstanceStatus(InstanceInfo.InstanceStatus.DOWN);\n Thread.sleep(400);\n // this call will be rate limited, but will be transmitted by the automatic update after 10s\n applicationInfoManager.setInstanceStatus(InstanceInfo.InstanceStatus.UP);\n Thread.sleep(2400);\n\n Assert.assertEquals(Arrays.asList(\"DOWN\", \"UP\"), mockLocalEurekaServer.registrationStatuses);\n Assert.assertEquals(2, mockLocalEurekaServer.registerCount.get());\n }",
"@Override\n public void init() {\n robot.init(hardwareMap);\n\n // Send telemetry message to signify robot waiting;\n telemetry.addData(\"Status\", \"Initialized\"); //\n }",
"protected void systemReady()\n\t{\n\t\t//~: check the service\n\t\tcheckService();\n\n\t\t//~: start planning\n\t\tself(new ExecPlanEvent());\n\t}",
"public void waitForRootRegionLocation() {\n regionManager.waitForRootRegionLocation();\n }",
"public void initialize() {\n\n getStartUp();\n }",
"private void init() {\n healthCheckTimer.newTimeout(\n new TimerTask() {\n @Override\n public void run(Timeout timeout) throws Exception {\n if (!isStop) {\n List<BrpcChannel> newHealthyInstances = new ArrayList<BrpcChannel>();\n Iterator<BrpcChannel> iter = unhealthyInstances.iterator();\n while (iter.hasNext()) {\n BrpcChannel instance = iter.next();\n boolean isHealthy = isInstanceHealthy(instance.getIp(), instance.getPort());\n if (isHealthy) {\n newHealthyInstances.add(instance);\n }\n }\n\n List<BrpcChannel> newUnhealthyInstances = new ArrayList<BrpcChannel>();\n iter = healthyInstances.iterator();\n while (iter.hasNext()) {\n BrpcChannel instance = iter.next();\n boolean isHealthy = isInstanceHealthy(instance.getIp(), instance.getPort());\n if (!isHealthy) {\n newUnhealthyInstances.add(instance);\n }\n }\n\n healthyInstances.addAll(newHealthyInstances);\n unhealthyInstances.removeAll(newHealthyInstances);\n\n healthyInstances.removeAll(newUnhealthyInstances);\n unhealthyInstances.addAll(newUnhealthyInstances);\n notifyInvalidInstance(newUnhealthyInstances);\n\n healthCheckTimer.newTimeout(this,\n rpcClient.getRpcClientOptions().getHealthyCheckIntervalMillis(),\n TimeUnit.MILLISECONDS);\n }\n\n }\n },\n rpcClient.getRpcClientOptions().getHealthyCheckIntervalMillis(),\n TimeUnit.MILLISECONDS);\n }",
"private void initialize() {\n int implicitWaitTime = 20;\n int explicitWaitTime = 30;\n int waitSleepTime = 10;\n\n ChromeDriverManager.getInstance(CHROME).setup();\n// FirefoxDriverManager.getInstance(FIREFOX).setup();\n this.webDriver = new ChromeDriver();\n this.webDriver.manage().window().maximize();\n this.webDriver.manage().timeouts().implicitlyWait(implicitWaitTime, TimeUnit.SECONDS);\n webDriverWait = new WebDriverWait(webDriver, explicitWaitTime,waitSleepTime);\n }",
"@InSequence(20)\n @Test\n @OperateOnDeployment(\"dep2\")\n public void wakeUpCacheB() throws IOException {\n waitForSync();\n getCache();\n }",
"@BeforeClass\n public static void beforeClass() throws Throwable\n {\n // Create and set a new MC Bootstrap\n BasicBootstrap bootstrap = new BasicBootstrap();\n Ejb3McRegistrarTestCase.setBootstrap(bootstrap);\n bootstrap.run();\n Kernel kernel = bootstrap.getKernel();\n\n // Bind the Ejb3Registrar\n Ejb3RegistrarLocator.bindRegistrar(new Ejb3McRegistrar(kernel));\n\n // Deploy\n BasicXMLDeployer deployer = new BasicXMLDeployer(kernel);\n URL deployUrl = getDeployableXmlUrl(Ejb3McRegistrarTestCase.class);\n deployer.deploy(deployUrl);\n }",
"protected void tryDeploy() {\n ComponentManager mgr = harness.getContext().getRuntime().getComponentManager();\n // the stash may already contains contribs (from @Setup methods)\n if (mgr.hasChanged()) { // first reset the registry if it was changed by the last test\n mgr.reset();\n // the registry is now stopped\n }\n // deploy current test contributions if any\n deploy(runner, harness);\n mgr.refresh(true);\n // now the stash is empty\n mgr.start(); // ensure components are started\n }",
"@Test(alwaysRun=true, priority=17,enabled=true)\n\tpublic void tenantVerification() throws InterruptedException, IOException {\t\n\t\tadminPage.tenantVerification(driver);\n\t\t\n\t}",
"@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)\n public void initialisePtuContainers() {\n LocalDateTime timestamp = DateTimeUtil.getCurrentDateTime();\n LocalDate period = timestamp.toLocalDate();\n int ptuIndex = PtuUtil.getPtuIndex(timestamp, config.getIntegerProperty(ConfigParam.PTU_DURATION));\n LOGGER.error(\"Initialising PTUs at startup, current PTU is {} {}\", period, ptuIndex);\n int updated = ptuContainerRepository.initialisePtuContainers(period, ptuIndex);\n LOGGER.debug(\"Updated {} PTUs\", updated);\n }",
"public void reportInitFailed() {\n System.out.println(\"Subsystem \" + getName() + \" failed to initialize!\");\n\n SmartDashboard.putBoolean(getName()+\" status\", false);\n\n isWorking = false;\n }",
"@Test\n public void testRegisterTrigger_NoServerSetup_NoErrors() throws Exception {\n Assume.assumeTrue(AdServicesInfo.INSTANCE.version() >= 5);\n\n assertThat(mMeasurementManager.registerTriggerAsync(TRIGGER_REGISTRATION_URI).get())\n .isNotNull();\n }",
"public void waitUntilLoadingDoesNotExistAndVerifyContainerDisplayed(){\n\t\tverifyContainerDisplayedResultsPage();\r\n\t}",
"void initAgents() {\n Runtime rt = Runtime.instance();\n\n //Create a container to host the Default Agent\n Profile p = new ProfileImpl();\n p.setParameter(Profile.MAIN_HOST, \"localhost\");\n //p.setParameter(Profile.MAIN_PORT, \"10098\");\n p.setParameter(Profile.GUI, \"false\");\n ContainerController cc = rt.createMainContainer(p);\n\n HashMap<Integer, String> neighbors = new HashMap <Integer, String>();\n neighbors.put(1, \"2, 4, 3\");\n neighbors.put(2, \"1, 3\");\n neighbors.put(3, \"1, 2, 4\");\n neighbors.put(4, \"1, 3, 5\");\n neighbors.put(5, \"4\");\n\n//Create a container to host the Default Agent\n try {\n for (int i = 1; i <= MainController.numberOfAgents; i++) {\n AgentController agent = cc.createNewAgent(Integer.toString(i), \"ru.spbu.mas.DefaultAgent\",\n new Object[]{neighbors.get(i)});\n agent.start();\n }\n } catch (StaleProxyException e) {\n e.printStackTrace();\n }\n }",
"@Test\n public void testMetatypeInformationInstalledBundle() throws IOException, InterruptedException\n {\n MessageListener listener = new MessageListener(socket);\n\n //find the test bundle\n long testBundleId = BundleNamespaceUtils.getBundleBySymbolicName(\n \"mil.dod.th.ose.integration.example.metatype\", socket);\n\n //construct request to stop bundle\n StopRequestData request = StopRequestData.newBuilder().setBundleId(testBundleId).build();\n TerraHarvestMessage message = BundleNamespaceUtils.createBundleMessage(request, BundleMessageType.StopRequest);\n\n //send message\n message.writeDelimitedTo(socket.getOutputStream());\n\n int regId = RemoteEventRegistration.regRemoteEventMessages(socket, \n RemoteMetatypeConstants.TOPIC_METATYPE_INFORMATION_AVAILABLE);\n\n //construct request to start bundle\n StartRequestData requestStart = StartRequestData.newBuilder().setBundleId(testBundleId).build();\n message = BundleNamespaceUtils.createBundleMessage(requestStart, BundleMessageType.StartRequest);\n\n //send message\n message.writeDelimitedTo(socket.getOutputStream());\n\n //going to be at least one because there is the example XML class\n List<MessageDetails> responses = listener.waitForRemoteEvents(\n RemoteMetatypeConstants.TOPIC_METATYPE_INFORMATION_AVAILABLE, TIME_OUT, MatchCount.atLeast(1));\n \n //unreg listener\n MessageListener.unregisterEvent(regId, socket);\n\n //parse Response\n EventAdminNamespace namespace = (EventAdminNamespace)responses.get(0).getNamespaceMessage();\n SendEventData event = SendEventData.parseFrom(namespace.getData());\n\n //Look at property keys find the bundle id, this should be the same ID of the bundle that was stopped\n \n Map<String, Object> props = SharedRemoteInterfaceUtils.getSimpleMapFromComplexTypesMap(event.getPropertyList());\n assertThat(props, rawMapHasEntry(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID, testBundleId));\n }",
"@BeforeTest\n public void setUp() {\n// WebDriverWait wait =new WebDriverWait(driver, 10, 10);\n }",
"@Test\n\tpublic void functionKoreDatastructureTest() {\n\t\ttry {\n\t\t\tString DataStructureAgent1Name = \"DataStructureAgent1\"; \n\t\t\t//String weatherAgent2Name = \"WeatherAgent2\"; \n\t\t\tString datageneratorservice = \"DataStructureGenerator\";\n\n\t\t\tAgentConfig cf = AgentConfig.newConfig(DataStructureAgent1Name)\n\t\t\t\t\t.addFunction(FunctionConfig.newConfig(datageneratorservice, KoreDataStructureGeneratorMock.class))\n\t\t\t\t\t.addFunction(FunctionConfig.newConfig(\"LamprosUI\", UserInterfaceCollector.class)\n\t\t\t\t\t\t\t.addManagedDatapoint(\"KORE\", DataStructureAgent1Name + \":\" + datageneratorservice + \"/result\", SyncMode.SUBSCRIBEONLY));\n\t\t\tCell weatherAgent = this.launcher.createAgent(cf);\n\t\t\t\n\t\t\t//=== Init finished ===//\n\n\t\t\tsynchronized (this) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.wait(2000);\n\t\t\t\t} catch (InterruptedException e) {\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tlog.info(\"=== All agents initialized ===\");\n\t\t\t\n\t\t\tweatherAgent.getCommunicator().execute(weatherAgent.getName() + \":\" + datageneratorservice + \"/command\", (new Request())\n\t\t\t\t\t.setParameter(\"command\", ControlCommand.START)\n\t\t\t\t\t.setParameter(\"blocking\", false), 100000);\n\t\t\t\n\t\t\t//Wait while the system runs\n\t\t\tsynchronized (this) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.wait(2000000000);\n\t\t\t\t} catch (InterruptedException e) {\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Read the state of the system\n\t\t\t//JsonObject systemState = weatherAgent.readLocalDatapoint(CFStateGenerator.SYSTEMSTATEADDRESS).getValue().getAsJsonObject();\n\t\t\t\n\t\t\t//String currentResult = systemState.get(\"hasFunction\").getAsJsonArray().get(0).getAsJsonObject().get(\"hasState\").getAsString();\n\t\t\t//String expectedResult = \"RUNNING\"; //As the system is still running, when the request is sent\n\t\t\t\n\t\t\t//weatherAgent.getCommunicator().write(DatapointBuilder.newDatapoint(weatherservice + \".command\").setValue(ControlCommand.STOP));\n\t\t\t\n\t\t\t//log.info(\"current result={}, expected result={}\", currentResult, expectedResult);\n\t\t\tassertEquals(true, false);\n\t\t\t\n\t\t\tlog.info(\"Tests passed\");\n\t\t} catch (Exception e) {\n\t\t\tlog.error(\"Error testing system\", e);\n\t\t\tfail(\"Error\");\n\t\t}\n\n\t}",
"@Override\n public void run(String... args) throws Exception {\n initProgressReporter.submitProgress(String.format(LoaderProgress.ENTRY_POINT.message(), delayStartInSeconds));\n Thread.sleep(delayStartInSeconds * 1000);\n\n boolean allReady;\n do {\n initProgressReporter.submitProgress(LoaderProgress.WAITING_FOR_ALL.message());\n\n var applications = this.discoveryClient.getServices();\n initProgressReporter.submitProgress(\n String.format(LoaderProgress.N_SERVICES_REGISTERED.message(), applications.size()));\n for (var application : applications) {\n initProgressReporter.submitProgress(\n String.format(LoaderProgress.SERVICE_REGISTERED.message(), application));\n }\n\n allReady = applications.containsAll(\n Arrays.asList(\"config-server\", \"site-service\", \"role-service\", \"practitioner-service\"));\n if (!allReady) {\n Thread.sleep(5000);\n }\n } while (!allReady);\n\n initProgressReporter.submitProgress(LoaderProgress.ALL_REGISTERED.message());\n\n try {\n initProgressReporter.submitProgress(LoaderProgress.GET_ROLES_FROM_CONFIG.message());\n var roles = trialConfig.getRoles();\n\n initProgressReporter.submitProgress(LoaderProgress.CREATE_ROLES.message());\n roleServiceInvoker.createRoles(roles);\n\n initProgressReporter.submitProgress(LoaderProgress.GET_SITES_FROM_CONFIG.message());\n var sites = trialConfig.getSites();\n\n initProgressReporter.submitProgress(LoaderProgress.CREATE_SITES.message());\n List<String> siteIds = siteServiceInvoker.createSites(sites);\n\n initProgressReporter.submitProgress(LoaderProgress.GET_PERSONS_FROM_CONFIG.message());\n var persons = trialConfig.getPersons();\n\n initProgressReporter.submitProgress(String.format(\n LoaderProgress.SELECT_FIRST_SITE_FROM_COLLECTION_OF_SIZE.message(), siteIds.size()));\n // Assumption in story https://ndph-arts.atlassian.net/browse/ARTS-164\n String siteIdForUserRoles = siteIds.get(0);\n initProgressReporter.submitProgress(LoaderProgress.CREATE_PRACTITIONER.message());\n practitionerServiceInvoker.execute(persons, siteIdForUserRoles);\n initProgressReporter.submitProgress(LoaderProgress.FINISHED_SUCCESSFULY.message());\n } catch (Exception ex) {\n initProgressReporter.submitProgress(ex.toString());\n initProgressReporter.submitProgress(LoaderProgress.FAILURE.message());\n throw ex;\n }\n }",
"public void waitingForPartner();",
"@Before\n public void init() {\n \tcontract = CandidateContract.load(\n web3j,\n CREDENTIALS,\n new DefaultWasmGasProvider()\n );\n }",
"private void buildWaitScene(){\n\t\t//Nothing to do\n\t}",
"public final void testScript() throws InterruptedException, IOException\n\t{\n\t\t// Step 1 : login to deviceConnect with test user.\n\t\t//*************************************************************// \n\t\tstrstepDescription = \"Login to deviceConnect with valid user.\";\n\t\tstrexpectedResult = \"User should be logged in successfully.\";\n\t\tisEventSuccessful = Login();\n\n\n\t\t//*************************************************************// \n\t\t// Step 2 : Navigate to first available device details page\n\t\t//*************************************************************// \n\t\tisEventSuccessful =GoToDevicesPage(); //Navigates to Devices page\n \n //Applying filters\n isEventSuccessful = selectPlatform(\"Android,iOS\");\n isEventSuccessful = selectStatus(\"Available\");\n \n //Selecting first device\n values=GoTofirstDeviceDetailsPage(); \n \n\n\t\t//*************************************************************// \n\t\t// Step 3 : Click on uninstall all button to uninstall all applications\n\t\t//*************************************************************// \n \n installedApps=getInstalledApps();\n\n if (!installedApps.contains(\"Trust Browser\")) // If Trust Browser app not already installed, installing it\n {\n isEventSuccessful=PerformAction(dicOR.get(\"btnInstall_TrustBrowser_AvailableAppList_DeviceDetails\"),Action.ClickUsingJS);\n Thread.sleep(20000);\n PerformAction(\"browser\", Action.Refresh);\n }\n //table[@class='table data-grid installed-apps-table']/tbody/tr/td[@title='Trust Browser']/../td[@class='btn-column']/button[contains(text(),'Uninstall')]\n \n installedApps=getInstalledApps();\n System.out.println(installedApps);\n \n \n isEventSuccessful=PerformAction(dicOR.get(\"btnUninstall_TrustBrowser_InstalledAppList_DeviceDetails\"),Action.Click);\n waitForPageLoaded();\n \tPerformAction(dicOR.get(\"UninstallAppContinuebtn\"), Action.WaitForElement);\n \tPerformAction(dicOR.get(\"UninstallAppContinuebtn\"), Action.Click);\n \t\n isEventSuccessful=false;\n strActualResult=\"Uninstalled application does not gets removed automatically from installed app list.\";\n for(int iwaitcounter=0; iwaitcounter<=10; iwaitcounter++) \n {\n Thread.sleep(4000); \n installedApps=getInstalledApps();\n if (!installedApps.contains(\"Trust Browser\"))\n {\n \t strActualResult=\"Uninstalled application removed from installed app list as expected.\";\n isEventSuccessful=true;\n break;\n } \n }\n \n reporter.ReportStep(\"Uninstalling an application removed it from installed app list automatically.\", \"Page refreshes automatically and changes are reflected.\", strActualResult, isEventSuccessful);\n \n \n if (installedApps.contains(\"No applications installed\")) // If Trust Browser app not already installed, installing it\n {\n PerformAction(dicOR.get(\"btnInstall_TrustBrowser_AvailableAppList_DeviceDetails\"),Action.Click);\n Thread.sleep(20000);\n PerformAction(\"browser\", Action.Refresh);\n }\n \n installedApps=getInstalledApps();\n System.out.println(installedApps);\n \n \tPerformAction(dicOR.get(\"BtnUninstallAllEnabled\"), Action.Click);\n \twaitForPageLoaded();\n \tPerformAction(\"browser\",\"waitforpagetoload\");\n \t\n \tisEventSuccessful=PerformAction(dicOR.get(\"UninstallAppContinuebtn\"), Action.WaitForElement);\n \tif (isEventSuccessful)\n \t{\n \t\t\n \t\treporter.ReportStep(\"Verify Continue button is available on Uninstall All Applications pop-up.\", \"Continue button should be available.\", \"Continue button is available.\", isEventSuccessful);\n \t\t\n \t\t//*********************Verify Cancel button is displayed********************\n \t\tboolean isCancelButtonAppeared=PerformAction(dicOR.get(\"btnCancel\"), Action.isDisplayed);\n \t\tif (isCancelButtonAppeared)\n \t\t\treporter.ReportStep(\"Cancel button should be displayed.\", \"Cancel button is displayed.\", \"Cancel button is available.\" , isCancelButtonAppeared);\n \t\telse\n \t\t\treporter.ReportStep(\"Cancel button should be displayed.\", \"Cancel button is displayed.\", \"Cancel button is not available.\" , isCancelButtonAppeared);\n \t\t//***********************************************************************************************\n \t\t\n \t\t\n \t\tisEventSuccessful=PerformAction(dicOR.get(\"UninstallAppContinuebtn\"), Action.Click);\n \twaitForPageLoaded();\n \tPerformAction(\"browser\",Action.WaitForPageToLoad);\n \t\t\n \tisEventSuccessful=PerformAction(dicOR.get(\"finishbtninstallDialog\"), Action.WaitForElement);\n \tif (isEventSuccessful)\n \t{\n \t\treporter.ReportStep(\"Verify Finish button is available on Uninstall All Applications pop-up.\", \"Finish button should be available.\", \"Finish button is available.\", isEventSuccessful);\n \t\t\n \t\t//*********************Verify Continue button disappears when finish button appears********************\n \t\tboolean isContinueButtonDisappeared=PerformAction(dicOR.get(\"UninstallAppContinuebtn\"), Action.isNotDisplayed);\n \t\tif (isContinueButtonDisappeared)\n \t\t\treporter.ReportStep(\"Continue button should disappear when finish button is displayed.\", \"Continue button disappears.\", \"Continue button dispappeared.\" , isContinueButtonDisappeared);\n \t\telse\n \t\t\treporter.ReportStep(\"Continue button should disappear when finish button is displayed.\", \"Continue button disappears.\", \"Continue button is available.\" , isContinueButtonDisappeared);\n \t\t//***********************************************************************************************\n \t\t\n \t\t//*********************Verify Cancel button disappears when finish button appears********************\n \t\tboolean isCancelButtonDisappeared=PerformAction(dicOR.get(\"btnCancel\"), Action.isNotDisplayed);\n \t\tif (isCancelButtonDisappeared)\n \t\t\treporter.ReportStep(\"Cancel button should disappear when finish button is displayed.\", \"Cancel button disappears.\", \"Cancel button dispappeared.\" , isCancelButtonDisappeared);\n \t\telse\n \t\t\treporter.ReportStep(\"Cancel button should disappear when finish button is displayed.\", \"Cancel button disappears.\", \"Cancel button is available.\" , isCancelButtonDisappeared);\n \t\t//***********************************************************************************************\n \t\t\n \t\tPerformAction(dicOR.get(\"finishbtninstallDialog\"), Action.Click);\n \t\n \tPerformAction(\"browser\",\"waitforpagetoload\");\n \t\n \tisEventSuccessful=false;\n strActualResult=\"Uninstalling all application does not gets reflected automaticall. from installed app list.\";\n for(int iwaitcounter=0; iwaitcounter<=5; iwaitcounter++) \n {\n Thread.sleep(1000); \n installedApps=getInstalledApps();\n if (installedApps.contains(\"No applications installed\"))\n {\n \t strActualResult=\"Uninstalling all applications get reflected automatically as expected.\";\n \t isEventSuccessful=true;\n \t break;\n } \n }\n \t \t\n reporter.ReportStep(\"Uninstalling all applications get reflected in installed app list automatically.\", \"Page refreshes automatically and changes are reflected.\", strActualResult, isEventSuccessful);\n \t}\n \telse\n \t\treporter.ReportStep(\"Verify Finish button is available on Uninstall All Applications pop-up.\", \"Finish button should be available.\", \"Finish button is not available.\", isEventSuccessful);\n \t}\n \telse\n \t\treporter.ReportStep(\"Verify Continue button is available on Uninstall All Applications pop-up.\", \"Continue button should be available.\", \"Continue button is not available.\", isEventSuccessful);\n \t\t\n \t \n\t\t\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 }",
"@BeforeTest()\n\tpublic void initializemanager() {\n\t\tsetDriver(\"chrome\");\n\t\tdriver.get(getApplicationUrl(\"salesforce\"));\n\t\tdriver.manage().window().maximize();\n\t\tWebpageFactory.initializePageObjects(driver);\n\t\tDBUtil.createConnection();\n\t}",
"@Override\n\t\t\t\tpublic void onIabSetupFinished(IabResult result) {\n\t\t\t\t\tif (!result.isSuccess()) {\n\t // Oh noes, there was a problem.\n\t return;\n\t }\n\t\t\t\t\t\n\t\t\t\t\t if (mHelper == null) return;\n\t\t\t\t\t iap_is_ok = true;\n\t\t\t\t\t mHelper.queryInventoryAsync(mGotInventoryListener);\n\t\t\t\t}",
"@Override\n\tpublic void waitCheck(double hours) {\n\t\t\n\t}",
"@Override\n\tpublic void waitCheck(double hours) {\n\t\t\n\t}",
"@Test \n\t@Description(\"Wait for Loader to finish TC\")\n\tpublic void waitText() {\n\t\therokuappNavigate();\n\t\therokuapp hero = new herokuapp(driver);\n\t\thero.dynamicloadclick();\n\t\thero.example2click();\n\t\thero.start();\n\t\t//hero.waitToFinish();\n\t\tWebDriverWait wait = new WebDriverWait(driver, 40);\n\t\twait.until(ExpectedConditions.invisibilityOf(hero.ajaxloader));\n\t\tAssert.assertEquals(hero.finishmsg.getText(), \"Hello World!\");\n\t\t//logger.pass(\"Required Search Result appeared\");\n\t\t//logger.fail(\"Required Search Result didn't appear\");\n\t}",
"@Test\n public void testBundleStatePreserved() throws Exception {\n \t{\n final Object listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, getInstallableResource(\n getTestBundle(BUNDLE_BASE_NAME + \"-testA-1.0.jar\")), null);\n this.waitForBundleEvents(\"Bundle must be installed\", listener,\n new BundleEvent(\"osgi-installer-testA\", \"1.0\", org.osgi.framework.BundleEvent.INSTALLED),\n new BundleEvent(\"osgi-installer-testA\", \"1.0\", org.osgi.framework.BundleEvent.STARTED));\n \t}\n {\n final Object listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, getInstallableResource(\n getTestBundle(BUNDLE_BASE_NAME + \"-testB-1.0.jar\")), null);\n this.waitForBundleEvents(\"Bundle must be installed\", listener,\n new BundleEvent(\"osgi-installer-testB\", \"1.0\", org.osgi.framework.BundleEvent.INSTALLED),\n new BundleEvent(\"osgi-installer-testB\", \"1.0\", org.osgi.framework.BundleEvent.STARTED));\n final Bundle b = findBundle(\"osgi-installer-testB\");\n assertNotNull(\"Test bundle B must be found\", b);\n b.stop();\n }\n\n assertBundle(\"Bundle A must be started\", \"osgi-installer-testA\", null, Bundle.ACTIVE);\n assertBundle(\"Bundle B must be stopped\", \"osgi-installer-testB\", null, Bundle.RESOLVED);\n\n \t// Execute some OsgiController operations\n Object listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.0.jar\")), null);\n sleep(150);\n installer.updateResources(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.2.jar\")), null);\n sleep(150);\n installer.updateResources(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.1.jar\")), null);\n this.waitForBundleEvents(\"Bundle must be installed\", listener,\n new BundleEvent(\"osgi-installer-testbundle\", \"1.0\", org.osgi.framework.BundleEvent.INSTALLED),\n new BundleEvent(\"osgi-installer-testbundle\", \"1.2\", org.osgi.framework.BundleEvent.UPDATED),\n new BundleEvent(\"osgi-installer-testbundle\", \"1.2\", org.osgi.framework.BundleEvent.STARTED));\n assertBundle(\"After installing testbundle\", \"osgi-installer-testbundle\", \"1.2\", Bundle.ACTIVE);\n\n listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, null, getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.0.jar\")));\n sleep(150);\n this.assertNoBundleEvents(\"Update to same version should generate no OSGi tasks.\", listener, \"osgi-installer-testbundle\");\n\n listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, null, getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.1.jar\")));\n sleep(150);\n this.assertNoBundleEvents(\"Update to same version should generate no OSGi tasks.\", listener, \"osgi-installer-testbundle\");\n\n listener = this.startObservingBundleEvents();\n installer.updateResources(URL_SCHEME, null, getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + \"-testbundle-1.2.jar\")));\n this.waitForBundleEvents(\"Bundle must be uninstalled\", listener,\n new BundleEvent(\"osgi-installer-testbundle\", \"1.2\", org.osgi.framework.BundleEvent.STOPPED),\n new BundleEvent(\"osgi-installer-testbundle\", \"1.2\", org.osgi.framework.BundleEvent.UNINSTALLED));\n\n assertNull(\"testbundle must be gone at end of test\", findBundle(\"osgi-installer-testbundle\"));\n\n \t// Now check that bundles A and B have kept their states\n assertBundle(\"Bundle A must still be started\", \"osgi-installer-testA\", null, Bundle.ACTIVE);\n assertBundle(\"Bundle B must still be stopped\", \"osgi-installer-testB\", null, Bundle.RESOLVED);\n }",
"@InSequence(10)\n @Test\n @OperateOnDeployment(\"dep1\")\n public void wakeUpCacheA() throws IOException {\n getCache();\n }",
"public void waitForUp(int node) {\n try {\n InetAddress address = InetAddress.getByName(ipOfNode(node));\n CCMBridge.busyWaitForPort(address, 9042, true);\n } catch (UnknownHostException e) {\n Assert.fail(\"Unknown host \" + ipOfNode(node) + \"( node \" + node + \" of CCMBridge)\");\n }\n }",
"int waitFor(String variable);",
"public void waitForCategorytoLoad() throws Exception {\n\t\twaitForJavascripttoLoad();\n\t}",
"public static void waitToGo() {\r\n try {\r\n sendMessageToMaster(SocketMessage.SLAVE_READY_TO_GO);\r\n wait_to_run.acquire();\r\n } catch (InterruptedException e) {\r\n }\r\n }",
"@PostConstruct\n\tpublic void init() throws UnknownHostException {\n\t\tfor(int i = 0; i < requestTaskThreadSize; i++) {\n\t\t\tworkerExecutor.execute(new OmcTestServiceRequestTask(requestQueue, deliveryQueue));\n\t\t}\n\n\t\tfor(int i = 0; i < deliveryTaskThreadSize; i++) {\n\t\t\tworkerExecutor.execute(new OmcTestServiceDeliveryTask(deliveryQueue, omcServiceDiscovery, deliveryMode, omcObserverState, deliveryRetryCount));\n\t\t}\n\n\t\tif(omcServiceRegistry != null) {\n\t\t\tString hostname = InetAddress.getLocalHost().getHostName();\n\t\t\tString uri = hostname + \":\" + omcObserverProperties.getServerPort() + servletContext.getContextPath();\n\t\t\tomcServiceRegistry.registerService(omcServiceRegistryName, uri);\n\t\t\tlogger.debug(\"Register service with path: \" + omcServiceRegistryName + \", value: \" + uri);\n\t\t}\n\t}",
"@BeforeClass\n public static void beforeClass() throws Exception\n {\n AbstractEJB3TestCase.beforeClass();\n\n // Deploy the test SLSB\n container = deploySessionEjb(ImplementsSessionSynchronizationBean.class);\n }",
"@Override\r\n public void init() {\r\n /* Initialize the hardware variables.\r\n * The init() method of the hardware class does all the work here\r\n */\r\n robot.init(hardwareMap);\r\n\r\n // Send telemetry message to signify robot waiting;\r\n telemetry.addData(\"Status\", \"Initialized\");\r\n }",
"public void waitForDecision(){\n if(gameOver) {\n return;\n }\n if(!decisionActive) {\n try {\n uiWaiting = true;\n synchronized(uiWait) {\n uiWait.wait();\n }\n } catch (Exception e) { logger.log(\"\"+e); }\n }\n }",
"public void waitForPageLoaded() {\r\n\r\n\t\tExpectedCondition<Boolean> expectation = new ExpectedCondition<Boolean>() {\r\n\t\t\tpublic Boolean apply(WebDriver driver) {\r\n\t\t\t\treturn ((JavascriptExecutor) driver).executeScript(\"return document.readyState\").equals(\"complete\");\r\n\t\t\t}\r\n\t\t};\r\n\t\tWait<WebDriver> wait = new WebDriverWait(driver, timeout);\r\n\t\twait.until(expectation);\r\n\t}",
"public void waitForElementPresent(By locator){\n \tWebDriverWait wait=new WebDriverWait(driver,20);\n \twait.until(ExpectedConditions.presenceOfElementLocated(locator));\n }",
"public static void waitForAI(){\n try {\n Thread.sleep(2000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }",
"public void test_Initialize_Failure3_empty_unitName()\r\n throws Exception {\r\n context.addEntry(\"unitName\", \" \");\r\n context.addEntry(\"activeContestStatusId\", new Long(1));\r\n context.addEntry(\"defaultDocumentPathId\", new Long(1));\r\n context.addEntry(\"loggerName\", \"contestManager\");\r\n context.addEntry(\"documentContentManagerClassName\",\r\n \"com.topcoder.service.studio.contest.documentcontentmanagers.SocketDocumentContentManager\");\r\n context.addEntry(\"documentContentManagerAttributeKeys\",\r\n \"serverAddress,serverPort\");\r\n context.addEntry(\"serverAddress\", \"127.0.0.1\");\r\n context.addEntry(\"serverPort\", new Integer(40000));\r\n\r\n Method method = beanUnderTest.getClass()\r\n .getDeclaredMethod(\"initialize\",\r\n new Class[0]);\r\n\r\n method.setAccessible(true);\r\n\r\n try {\r\n method.invoke(beanUnderTest, new Object[0]);\r\n fail(\"ContestManagementException is expected.\");\r\n } catch (InvocationTargetException e) {\r\n // success\r\n }\r\n }",
"@Test(timeOut = DEFAULT_TEST_TIMEOUT * 2, groups = \"1\", enabled = false)\r\n \tpublic void bootstrapEc2CloudTest() throws Exception {\r\n \t \r\n \t\tfor (int i = 0; i < NUM_OF_MANAGEMENT_MACHINES; i++) {\r\n \t\t\t// The rest home page is a JSP page, which will fail to compile if there is no JDK installed. So use testrest instead\r\n \t\t\tassertWebServiceAvailable(new URL( restAdminUrl[i].toString() + \"/service/testrest\"));\r\n \t\t\tassertWebServiceAvailable(webUIUrl[i]);\r\n \t\t}\r\n \t \r\n \t\tString connectCommand = \"connect \" + restAdminUrl[0].toString() + \";\";\r\n \t \r\n \t URL machinesURL = getMachinesUrl(restAdminUrl[0].toString());\r\n \t assertEquals(\"Expecting \" + NUM_OF_MANAGEMENT_MACHINES + \" machines\", \r\n \t \t\tNUM_OF_MANAGEMENT_MACHINES, getNumberOfMachines(machinesURL));\r\n \t \r\n \t //running install application on simple\r\n \t String installCommand = new StringBuilder()\r\n \t .append(\"install-application \")\r\n \t .append(\"--verbose \")\r\n \t .append(\"-timeout \")\r\n \t .append(TimeUnit.MILLISECONDS.toMinutes(DEFAULT_TEST_TIMEOUT * 2)).append(\" \")\r\n\t .append((new File(ScriptUtils.getBuildPath(), \"examples/travel\").toString()).replace('\\\\', '/'))\r\n \t .toString();\r\n \t \r\n \t String output = CommandTestUtils.runCommandAndWait(connectCommand + installCommand);\r\n \t \r\n \t Assert.assertTrue(output.contains(INSTALL_TRAVEL_EXPECTED_OUTPUT));\r\n \r\n \t // Travel is started with 2 instances (1 tomcat, 1 cassandra) so we are expecting two more machine\r\n assertEquals(\"Expecting \" + (NUM_OF_MANAGEMENT_MACHINES+2) + \" machines\", \r\n NUM_OF_MANAGEMENT_MACHINES+2, getNumberOfMachines(machinesURL));\r\n \t \r\n \t \r\n \t //uninstall simple application\r\n \t String uninstallCommand = \"uninstall-application --verbose travel\";\r\n \t output = CommandTestUtils.runCommandAndWait(connectCommand + uninstallCommand);\r\n \t \r\n \t Assert.assertTrue(output.contains(UNINSTALL_TRAVEL_EXPECTED_OUTPUT));\r\n \t \r\n \t}",
"protected abstract void afterWait();",
"public boolean operationWaiting(){\n\t\tif (var2Set) return true; else return false;\n\t}",
"@And(\"^I wait for page to load completely$\")\n\tpublic void waitForCompleteLoading(){\n\t\tString result=selenium.synchronize();\n\t\tAssert.assertEquals(selenium.result_pass, result);\n\t}",
"protected void setup(){\n this.setEnabledO2ACommunication(true, 0);\n \n showMessage(\"Agent (\" + getLocalName() + \") .... [OK]\");\n \n // Register the agent to the DF\n ServiceDescription sd1 = new ServiceDescription();\n sd1.setType(UtilsAgents.BOAT_COORDINATOR);\n sd1.setName(getLocalName());\n sd1.setOwnership(UtilsAgents.OWNER);\n DFAgentDescription dfd = new DFAgentDescription();\n dfd.addServices(sd1);\n dfd.setName(getAID());\n try {\n DFService.register(this, dfd);\n showMessage(\"Registered to the DF\");\n }catch (FIPAException e) {\n System.err.println(getLocalName() + \" registration with DF \" + \"unsucceeded. Reason: \" + e.getMessage());\n doDelete();\n }\n \n //Search for the CentralAgent\n ServiceDescription searchBoatCoordCriteria = new ServiceDescription();\n searchBoatCoordCriteria.setType(UtilsAgents.COORDINATOR_AGENT);\n this.coordinatorAgent = UtilsAgents.searchAgent(this, searchBoatCoordCriteria);\n\n // Register response behaviours\n //TODO canviar i posar l'altra content\n MessageTemplate mt = MessageTemplate.MatchContent(\"Movement request\");\n this.addBehaviour(new RequestResponseBehaviour(this,mt ));\n }",
"@Override\n public void waitUntilPageObjectIsLoaded() {\n }",
"protected void waitThePageToLoad() {\n ExpectedCondition pageLoadCondition = new ExpectedCondition<Boolean>() {\n public Boolean apply(WebDriver driver) {\n return ((JavascriptExecutor) driver).executeScript(\"return document.readyState\").equals(\"complete\");\n }\n };\n WaitUtils.waitUntil(driver, pageLoadCondition);\n }",
"@Override\n\tpublic void testInit(IRobot robot) {\n\t}",
"protected boolean waitBeforeExecution() throws InterruptedException {\n/* 112 */ Integer mx = ((IncomingSearchRequest)getInputMessage()).getMX();\n/* */ \n/* 114 */ if (mx == null) {\n/* 115 */ log.fine(\"Invalid search request, did not contain MX header: \" + getInputMessage());\n/* 116 */ return false;\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 122 */ if (mx.intValue() > 120 || mx.intValue() <= 0) mx = MXHeader.DEFAULT_VALUE;\n/* */ \n/* */ \n/* 125 */ if (getUpnpService().getRegistry().getLocalDevices().size() > 0) {\n/* 126 */ int sleepTime = this.randomGenerator.nextInt(mx.intValue() * 1000);\n/* 127 */ log.fine(\"Sleeping \" + sleepTime + \" milliseconds to avoid flooding with search responses\");\n/* 128 */ Thread.sleep(sleepTime);\n/* */ } \n/* */ \n/* 131 */ return true;\n/* */ }",
"@Override\n protected void setup() {\n // exception handling for invoke the main2();\n try {\n main2();\n } catch (StaleProxyException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n // create central agent of the application\n try {\n AgentController Main = main1.createNewAgent(\"Main\",\"test.Main\",null);\n Main.start();\n } catch (StaleProxyException e) {\n e.printStackTrace();\n }\n try {\n showResualt();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }",
"protected boolean waitForClusterToStart() throws HoneycombTestException {\n\n Log.INFO(\"Waiting for cluster to come Online...\");\n boolean ready = false;\n int i = MAX_ONLINE_ITERATIONS;\n while (i > 0 && !ready) {\n try {\n i--;\n ArrayList lines = readSysstat();\n if (lines.toString().contains(nodesOnlineString)) {\n ready = true;\n } \n if (!ready)\n pause(SLEEP_WAKEUP_TIMEOUT);\n } catch (Throwable e) {\n pause(SLEEP_WAKEUP_TIMEOUT);\n }\n }\n if (i == 0) {\n Log.WARN(\"Cluster is not Online\");\n }\n if (!ready)\n okToProceed = false;\n return ready;\n }",
"private boolean waitForAO()\n {\n int countOfRetry = 15;\n do\n {\n try\n {\n log.debug(\"Attempting to wait for AO.\");\n activeObjects.count(MessageMapping.class);\n log.debug(\"Attempting to wait for AO - DONE.\");\n stop = true;\n return true;\n }\n catch (PluginException e)\n {\n countOfRetry--;\n try\n {\n Thread.sleep(5000);\n }\n catch (InterruptedException ie)\n {\n // nothing to do\n }\n }\n }\n while (countOfRetry > 0 && !stop);\n log.debug(\"Attempting to wait for AO - UNSUCCESSFUL.\");\n return false;\n }",
"@Test\n public void createNewComputerBuildSuccess() {\n ComputerBuild computerBuild = createComputerBuild(SAMPLE_BUDGET_COMPUTER_BUILD_NAME, SAMPLE_BUDGET_COMPUTER_BUILD_DESCRIPTION);\n LoginRequest loginRequest = new LoginRequest(ANOTHER_USER_NAME_TO_CREATE_NEW_USER, USER_PASSWORD);\n\n loginAndCreateBuild(computerBuild, loginRequest, SAMPLE_BUDGET_COMPUTER_BUILD_NAME, SAMPLE_BUDGET_COMPUTER_BUILD_DESCRIPTION);\n }",
"@Test\n public void testStartTaskReadyByPotentialOwner() throws HTException {\n\n Task t = createTask_TwoPotentialOwners();\n this.services.startTask(t.getId(), \"user1\");\n \n org.junit.Assert.assertEquals(\"user1\", t.getActualOwner().getName());\n org.junit.Assert.assertEquals(Status.IN_PROGRESS, t.getStatus());\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 }",
"@Test\n\tpublic void testIfWSStatusChange() {\n\t\tfinal WorkSpace ws = new WorkSpace(null);\n\t\tWorkPackage wp1 = new WorkPackage(null);\n\t\twp1.setStatus(WPMaturity.State.InProgress);\n\t\tWorkPackage wp2 = new WorkPackage(null);\n\t\twp2.setStatus(WPMaturity.State.InProgress);\n\t\t\t\n\t\tws.addWP(wp1);\n\t\tws.addWP(wp2);\n\t\t\n\t\tAssert.assertTrue(ws.getWSMaturity().equals(WSMaturity.State.InProgress));\n\t\tnew Thread(new Runnable() {\n\t\t\t\n\t\t\tpublic void run() {\n\t\t\t\tWorkPackage wp3 = new WorkPackage(null);\n\t\t\t\twp3.setStatus(WPMaturity.State.Start);\n\t\t\t\tws.addWP(wp3);\n\t\t\t\t\n\t\t\t}\n\t\t}).start();\n\t\tAssert.assertTrue(ws.getWSMaturity().equals(WSMaturity.State.Start));\n\t}",
"@Override\n protected void before() throws Throwable {\n log.info(\"Starting docker container\");\n executeCommand(getDockerInstallCommand(false));\n do {\n Thread.sleep(5000);\n } while (!new SystemApiClient(getServiceUrl()).isHealthy().isSuccessful());\n }",
"@Test\n public void testMetatypeInformationTestBundle() throws IOException, InterruptedException\n {\n MessageListener listener = new MessageListener(socket);\n\n //install test bundle\n final long testBundleId = BundleNamespaceUtils.installBundle(\n ResourceUtils.getExampleProjectBundleFile(), \"test.RemoteInterface.bundle\", false, socket);\n\n //register to listen to event\n int regId = RemoteEventRegistration.regRemoteEventMessages(\n socket, RemoteMetatypeConstants.TOPIC_METATYPE_INFORMATION_AVAILABLE);\n\n //construct request to start bundle\n StartRequestData requestStart = StartRequestData.newBuilder().setBundleId(testBundleId).build();\n TerraHarvestMessage message = \n BundleNamespaceUtils.createBundleMessage(requestStart, BundleMessageType.StartRequest);\n\n //send message\n message.writeDelimitedTo(socket.getOutputStream());\n\n //listen for response\n try\n {\n listener.waitForMessage(Namespace.EventAdmin, EventAdminMessageType.SendEvent, TIME_OUT);\n fail(\"Expected exception because we do not expect a message.\");\n }\n catch (AssertionError e)\n {\n //expecting exception\n }\n\n //unreg listener\n MessageListener.unregisterEvent(regId, socket);\n\n //uninstall bundle\n BundleNamespaceUtils.uninstallBundle(testBundleId, socket);\n }",
"@Test\n public void testDeployCommand() {\n d_gameData.getD_playerList().get(0).setD_noOfArmies(10);\n d_orderProcessor.processOrder(\"deploy india 6\", d_gameData);\n d_gameData.getD_playerList().get(0).issue_order();\n Order l_order = d_gameData.getD_playerList().get(0).next_order();\n boolean l_check = l_order.executeOrder();\n assertEquals(true, l_check);\n int l_countryArmies = d_gameData.getD_playerList().get(0).getD_ownedCountries().get(0).getD_noOfArmies();\n assertEquals(6, l_countryArmies);\n int l_actualArmiesInPlayer = d_gameData.getD_playerList().get(0).getD_noOfArmies();\n assertEquals(4, l_actualArmiesInPlayer);\n }",
"@Test\n public void testInitalState() throws Exception {\n DefaultPersonBizPolicyConsultant underTest = new DefaultPersonBizPolicyConsultant();\n assertEquals(PENDING, underTest.getDefaultRegistrationStatus());\n assertEquals(Arrays.asList(PENDING), underTest.allowedRegistrationStatusOnCreate());\n assertTrue(underTest.enforceRegistrationStatusOnCreate());\n assertEquals(Arrays.asList(Role.ROLE_USER), underTest.getRolesForRegistrationStatus(APPROVED));\n assertEquals(Collections.<Role>emptyList(), underTest.getRolesForRegistrationStatus(PENDING));\n assertEquals(Collections.<Role>emptyList(), underTest.getRolesForRegistrationStatus(BLACK_LISTED));\n }",
"public void waitForVerifyHhsPage() {\n verifyHHSPageElement.waitForState().enabled(30);\n }",
"protected void initialize() {\n \tif ((deploy && Robot.intake.getHopperTracker() == Status.deployed) || \n \t\t\t(!deploy && Robot.intake.getHopperTracker() == Status.stowed)) {\n \t\t// Hopper is already in desired position, so do nothing\n \t\twaitForMovement = false;\n \t} else if (deploy && (Robot.intake.getIntakeTracker() != Status.deployed)) {\n \t\t// Can't deploy hopper if intake is not deployed (ie., if stowed or unknown or moving)\n \t\twaitForMovement = false;\n \t} else {\n \t\t// OK, we can move the hopper\n \t\twaitForMovement = true;\n \t\tRobot.intake.setHopperTracker(Status.unknown);\t// put in unknown state while hopper is moving\n \tif (deploy) Robot.intake.deployHopper();\n \telse { Robot.intake.stowHopper(); }\n \t}\n }",
"public void waitForPageToLoad(){\r\n\t\t\t\tDriver.driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\r\n\t\t\t}",
"protected PayerThread() {\n\t\t\tEvent.ASSERTION.issue(sets == null, \"builders is null\");\n\t\t\tEvent.ASSERTION.issue(workloadConfiguration == null, \"configuration is null\");\n\n\t\t\tsetDaemon(true);\n\t\t}",
"void init(Deployment deployment);",
"@Override\n\tprotected void initAsService() {\n\t\tif (log.isDebugEnabled()) {\n\t\t\tlog.debug(\"Initiating service...\");\n\t\t}\n\t\trunnerFuture = activityRunner.schedule(this::scanModulesHealth, 500, TimeUnit.MILLISECONDS);\n\t}"
] | [
"0.58707726",
"0.5624756",
"0.5505905",
"0.5474878",
"0.5462048",
"0.5431508",
"0.53843427",
"0.5349405",
"0.5287018",
"0.5234545",
"0.517912",
"0.5169206",
"0.5154258",
"0.51427996",
"0.51140535",
"0.50866663",
"0.50825137",
"0.5080369",
"0.50708157",
"0.5069164",
"0.5061635",
"0.50466096",
"0.5041218",
"0.5036047",
"0.50295603",
"0.5022425",
"0.5018487",
"0.50172967",
"0.49974185",
"0.49968028",
"0.4993648",
"0.4990243",
"0.4989869",
"0.49797735",
"0.49603963",
"0.4958152",
"0.4954656",
"0.4954355",
"0.49505207",
"0.49467131",
"0.492898",
"0.49252746",
"0.49239242",
"0.4917421",
"0.49005455",
"0.49005282",
"0.48997533",
"0.4898068",
"0.4887017",
"0.48867962",
"0.4884075",
"0.48811257",
"0.4880401",
"0.4875493",
"0.48704672",
"0.48633507",
"0.48550805",
"0.4846971",
"0.4846971",
"0.48423657",
"0.48405084",
"0.48267075",
"0.48221558",
"0.4812575",
"0.48107722",
"0.48044783",
"0.47929183",
"0.47792855",
"0.4775363",
"0.4772002",
"0.47720018",
"0.4770594",
"0.4770273",
"0.47681358",
"0.4761972",
"0.47599617",
"0.47577998",
"0.47506562",
"0.47452936",
"0.47451538",
"0.47422272",
"0.47414717",
"0.4738909",
"0.47383228",
"0.4738213",
"0.47363034",
"0.47328275",
"0.4732822",
"0.47298837",
"0.47286332",
"0.4723443",
"0.47215942",
"0.47190586",
"0.47170958",
"0.47155893",
"0.4711833",
"0.47103125",
"0.47086242",
"0.47073323",
"0.47066548"
] | 0.6136834 | 0 |
Created by dkudryavtsev on 5/7/15. | public interface ILayer {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"private stendhal() {\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"public final void mo51373a() {\n }",
"@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 public void init() {\n\n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\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 }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"@Override\n void init() {\n }",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\n public void init() {}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n public int describeContents() { return 0; }",
"@Override\r\n\tpublic void init() {}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void init() {\n }",
"@Override\n\tprotected void initialize() {\n\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}",
"public void mo38117a() {\n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"private void init() {\n\n\t}",
"@Override\n\tpublic void gravarBd() {\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}",
"protected boolean func_70814_o() { return true; }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tpublic void init() {\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"private void m50366E() {\n }",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n\tpublic void init()\n\t{\n\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n public void initialize() { \n }",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n protected void getExras() {\n }",
"private void poetries() {\n\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t}",
"@Override\n\tprotected void initialize() {\n\t}",
"public void mo4359a() {\n }",
"@Override\n\t\tpublic void init() {\n\t\t}",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n public void initialize() {}",
"@Override\n public void initialize() {}",
"@Override\n public void initialize() {}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"private Rekenhulp()\n\t{\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n public void init() {\n }",
"@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}",
"@Override\n public void initialize() {\n \n }",
"@Override\n public int retroceder() {\n return 0;\n }",
"@Override\r\n\tpublic final void init() {\r\n\r\n\t}",
"private static void cajas() {\n\t\t\n\t}",
"@Override\n public int getSize() {\n return 1;\n }",
"@Override public int describeContents() { return 0; }"
] | [
"0.6117489",
"0.59401023",
"0.59107184",
"0.5864704",
"0.5821561",
"0.58015174",
"0.58015174",
"0.5745675",
"0.5741052",
"0.5735924",
"0.5707962",
"0.56993514",
"0.569077",
"0.56792593",
"0.56792593",
"0.56792593",
"0.56792593",
"0.56792593",
"0.56746817",
"0.56718326",
"0.56718326",
"0.56718326",
"0.56718326",
"0.56718326",
"0.56718326",
"0.5657515",
"0.5656411",
"0.5654472",
"0.5645821",
"0.56329685",
"0.56302714",
"0.56302714",
"0.56270355",
"0.56219995",
"0.5618064",
"0.5606042",
"0.5596834",
"0.55934066",
"0.55836684",
"0.5582306",
"0.5564883",
"0.5564246",
"0.5564246",
"0.5564246",
"0.55632406",
"0.55589885",
"0.55436134",
"0.55436134",
"0.55354154",
"0.55354154",
"0.55354154",
"0.55353373",
"0.5518168",
"0.5514034",
"0.5509739",
"0.5509739",
"0.5509739",
"0.55018073",
"0.54894114",
"0.54891133",
"0.54889613",
"0.5478583",
"0.54771405",
"0.54739594",
"0.5471389",
"0.54655105",
"0.5465182",
"0.5461208",
"0.5461208",
"0.5459653",
"0.5456157",
"0.5455557",
"0.5455462",
"0.5450382",
"0.54448843",
"0.54448843",
"0.54435027",
"0.54380614",
"0.5420039",
"0.54165375",
"0.54164094",
"0.54164094",
"0.54164094",
"0.54137534",
"0.5395734",
"0.5395734",
"0.5395734",
"0.5395734",
"0.5395734",
"0.5395734",
"0.5395734",
"0.5389137",
"0.53849036",
"0.5383194",
"0.5376017",
"0.5367627",
"0.535923",
"0.53528243",
"0.5350672",
"0.5340324",
"0.5336958"
] | 0.0 | -1 |
your code goes here MK Alex loop through all keys of dict if value type is string, add that to flat dictionary if value in dictionary is an object type , append prefix to subkeys return main dictionary helper method for recursion method accepts: (HashMap, currentKey) functionality: updates the existing flattened_dict w/ the contents of hashMap for every key,value pair in a dictionary: if the value is a string or int > just add it to flattened_dict if the value is a Dictionary, call helper(dictaionary, key) | public HashMap<String, String> flattenDictionary(HashMap<String, Object> dict) {
HashMap<String, String> flat_dict = new HashMap<String, String>();
helper("",dict,flat_dict);
return flat_dict;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static HashMap<String, String> flattenDictionary(HashMap<String, Object> dict) {\n HashMap<String,String> ans = new HashMap<>();\n\n if(dict == null){\n return ans;\n }\n flatten(dict,\"\",ans);\n return ans;\n }",
"private Map<String, Object> flatten(Map<String, Object> map) {\n\t\tMap<String, Object> result = new LinkedHashMap<>();\n\t\tflatten(null, result, map);\n\t\treturn result;\n\t}",
"@SuppressWarnings(\"unchecked\")\n\tprivate Map<String, Object> sanitize(String prefix, Map<String, Object> map, boolean showUnsanitized) {\n\t\tmap.forEach((key, value) -> {\n\t\t\tString qualifiedKey = getQualifiedKey(prefix, key);\n\t\t\tif (value instanceof Map) {\n\t\t\t\tmap.put(key, sanitize(qualifiedKey, (Map<String, Object>) value, showUnsanitized));\n\t\t\t}\n\t\t\telse if (value instanceof List) {\n\t\t\t\tmap.put(key, sanitize(qualifiedKey, (List<Object>) value, showUnsanitized));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmap.put(key, sanitizeWithPropertySourceIfPresent(qualifiedKey, value, showUnsanitized));\n\t\t\t}\n\t\t});\n\t\treturn map;\n\t}",
"public static Map<String, String> expand(Map<String, String> props){\r\n\t\tMap<String, String> result = new HashMap<String, String>();\r\n\t\tSet<String> entriesNeedingSubstitution = new HashSet<String>();\r\n\t\t// First pass: put all properties into result and identify properties which need expanding\r\n\t\tfor (Entry<String, String> entry: props.entrySet()) {\r\n\t\t\tString key = entry.getKey();\r\n\t\t\tString value = entry.getValue();\r\n\t\t\tMatcher m = SUBST_REGEXP.matcher(value);\r\n\t\t\tif (m.find()) entriesNeedingSubstitution.add(key);\r\n\t\t\tresult.put(key, value);\r\n\t\t}\r\n\r\n\t\t// Substitution passes\r\n\t\tfor (int nestingDepth = 1; nestingDepth < MAX_SUBSTITUTION_PASSES && entriesNeedingSubstitution.size() > 0; nestingDepth++) {\r\n\t\t\tlogger.trace(\"Starting substitution pass #{}\",nestingDepth);\r\n\t\t\tIterator<String> iter = entriesNeedingSubstitution.iterator();\r\n\t\t\twhile (iter.hasNext()) {\r\n\t\t\t\tString expKey = iter.next();\r\n\t\t\t\tString value = result.get(expKey);\r\n\t\t\t\tvalue = expand(value, result);\r\n\t\t\t\tresult.put(expKey, value);\r\n\t\t\t\tif (!SUBST_REGEXP.matcher(value).find()) {\r\n\t\t\t\t\titer.remove();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"private TreeMap<String,Element> parseObject() {\r\n \r\n TreeMap<String,Element> object=new TreeMap<>();//create hashed map \r\n \r\n char chr=next();//consume first character\r\n assert chr=='{';//assert first character is open curly bracket\r\n while (chr!='}') {//until closing bracket found\r\n \r\n switch (peek()) {//switch on next character\r\n case ' ':\r\n case '\\t':\r\n case '\\n':\r\n case '\\r': chr=next(); //discard whitespace\r\n break;\r\n case '\"': String key=parseString();//parse key\r\n while (peek()<=' ') next();//skip whitespace\r\n chr=next();//consume the next character\r\n if (chr!=':') throw new RuntimeException(\"Invalid syntax : \"+context());//must be havin a giraffe?\r\n while (peek()<=' ') next();//skip whitespace\r\n switch (peek()) {//switch on the next character in key value pair\r\n case '\"': object.put(key, new ScalarElement(Element.STRING,parseString()));//parse string value\r\n break;\r\n case '-':\r\n case '0':\r\n case '1':\r\n case '2':\r\n case '3':\r\n case '4':\r\n case '5':\r\n case '6':\r\n case '7':\r\n case '8':\r\n case '9': object.put(key, new ScalarElement(Element.NUMBER,parseNumber()));//parse number value\r\n break;\r\n case 'f':\r\n case 't': object.put(key, new ScalarElement(Element.BOOLEAN,parseBoolean()));//parse boolean value\r\n break;\r\n case 'n': object.put(key, new ScalarElement(Element.NULL,parseNull()));//parse null value\r\n break;\r\n case '[': object.put(key, new ArrayElement(parseArray()));//parse array value \r\n break;\r\n case '{': object.put(key, new ObjectElement(parseObject()));//parse object value\r\n break;\r\n default : throw new RuntimeException(\"Invalid syntax : \"+context());//we have a problem houston\r\n };//switch on the next character in key value pair\r\n break;\r\n case ',': chr=next();//consume comma character\r\n break;\r\n case '}': chr=next();//consume close bracket character\r\n break;\r\n default : throw new RuntimeException(\"Invalid syntax : \"+context());//gone pete tong\r\n }//switch on next character\r\n \r\n }//until closing bracket found \r\n \r\n return object;//happy days\r\n \r\n }",
"static private Map<Object, Object> stripNonKeys(Object hints) {\n if (hints == null) {\n return null;\n }\n @SuppressWarnings(\"unchecked\")\n Map<Object, Object> filtered = (Map) hints;\n for (final Iterator it=hints.keySet().iterator(); it.hasNext();) {\n final Object key = it.next();\n if( key instanceof Stirng){\n \t// not formal\n if (filtered == hints) {\n // Copies the map only if needed.\n filtered = new HashMap<Object, Object>(filtered);\n }\n filtered.remove(key);\n }\n }\n return filtered;\n\t}",
"public static Map<String, Object> flatten(Map<String, Object> map) {\n Map<String, Object> result = new LinkedHashMap<>();\n flatten(null, result, map);\n return result;\n }",
"@Override\n public void flatMap1(String input1_value, Collector<String> out) {\n JSONObject originalJSON = JSONObject.parseObject(input1_value);\n String appId= originalJSON.getString(\"appId\");\n String userId = originalJSON.getString(\"userId\");\n String userName= dimMap.get(\"userMap\").get(userId);\n String funcId = originalJSON.getString(\"funcId\");\n String orgCode = originalJSON.getString(\"orgCode\");\n String orgName = \"\";\n String stropDate = originalJSON.getString(\"opDate\");\n String funcName = dimMap.get(\"funcMap\").get(funcId);\n\n JSONObject jsondata = geneJSONData(appId,funcId,funcName,stropDate,orgCode,orgName,userId,userName);\n//System.out.println(jsondata.toJSONString());\n\n out.collect(jsondata.toJSONString());\n\n }",
"private int setDictionaryValue(final PdfObject pdfObject,int i, final byte[] raw, final boolean ignoreRecursion) {\n int end=i;\n int nextC=i;\n \n //ignore any gaps\n while(raw[nextC]==10 || raw[nextC]==32 || raw[nextC]==9) {\n nextC++;\n }\n \n //allow for null object\n if(raw[nextC]=='n' && raw[nextC+1]=='u' && raw[nextC+2]=='l' && raw[nextC+3]=='l'){\n i=nextC+4;\n return i;\n }else if(raw[nextC]=='[' && raw[nextC+1]==']'){ //allow for empty object []\n i=nextC;\n return i;\n }\n \n if(raw[i]!='<' && raw[i+1]!='<') {\n end += 2;\n }\n \n boolean inDictionary=true;\n final boolean isKey=raw[end-1]=='/';\n \n while(inDictionary){\n \n if(raw[end]=='<'&& raw[end+1]=='<'){\n int level2=1;\n end++;\n while(level2>0){\n \n if(raw[end]=='<'&& raw[end+1]=='<'){\n level2++;\n end += 2;\n }else if(raw[end-1]=='>'&& raw[end]=='>'){\n level2--;\n if(level2>0) {\n end += 2;\n }\n }else if(raw[end]=='('){ //scan (strings) as can contain >> \n \n end++;\n while(raw[end]!=')' || ObjectUtils.isEscaped(raw, end)) {\n end++;\n }\n }else {\n end++;\n }\n }\n \n inDictionary=false;\n \n }else if(raw[end]=='R' ){\n inDictionary=false;\n }else if(isKey && (raw[end]==' ' || raw[end]==13 || raw[end]==10 || raw[end]==9)){\n inDictionary=false;\n }else if(raw[end]=='/'){\n inDictionary=false;\n end--;\n }else if(raw[end]=='>' && raw[end+1]=='>'){\n inDictionary=false;\n end--;\n }else {\n end++;\n }\n }\n \n //boolean save=debugFastCode;\n Dictionary.readDictionary(pdfObject,i, raw, PDFkeyInt, ignoreRecursion, objectReader, isInlineImage);\n \n //use correct value\n return end;\n }",
"protected void recursiveInitialize(List<JoinPath> joinPaths, Object rootObj) throws OgnlException\n {\n\n Map<String, Object> joinPathMap = new HashMap<String, Object>();\n Map<String, Object> flatIndex = new HashMap<String, Object>();\n HashMap parentMap = new HashMap();\n parentMap.put(\"alias\",\"this\");\n parentMap.put(\"joinType\", JoinType.LEFT_JOIN);\n joinPathMap.put(\"this\", parentMap);\n flatIndex.put(\"this\", parentMap);\n\n for (JoinPath joinPath : joinPaths)\n {\n if(StringUtils.isBlank(joinPath.alias))\n {\n //kalo kosong lewati\n/*\n String[] pathArray = joinPath.path.split(\"[.]\");\n HashMap mapMember = new HashMap();\n mapMember.put(\"joinType\", joinPath.joinType);\n String key = pathArray[pathArray.length - 1];\n if(flatIndex.get(key)!=null)//ada alias kembar tolak !!\n {\n throw new RuntimeException(\"Alias dari Join Path :\"+key+\" terdefinisi lebih dari sekali\");\n }\n flatIndex.put(key, mapMember);\n*/\n }\n else\n {\n HashMap mapMember = new HashMap();\n mapMember.put(\"joinType\", joinPath.joinType);\n String key = joinPath.alias;\n if(flatIndex.get(key)!=null)//ada alias kembar tolak !!\n {\n throw new RuntimeException(\"Alias dari Join Path :\"+key+\" terdefinisi lebih dari sekali\");\n }\n flatIndex.put(key, mapMember);\n }\n }\n for (JoinPath joinPath : joinPaths)\n {\n String[] pathArray = joinPath.path.split(\"[.]\");\n if(pathArray.length>1)\n {\n //gabung alias ke pathnya\n //cari parent\n Map mapParent = (Map) flatIndex.get(pathArray[0]);\n if(mapParent==null)\n continue;\n //cari alias child\n Map mapChild;\n //ambil dari alias dari looping atas\n if(StringUtils.isNotBlank(joinPath.alias))\n {\n mapChild = (Map) flatIndex.get(joinPath.alias);\n }\n else\n {\n mapChild = (Map) flatIndex.get(pathArray[1]);\n }\n mapParent.put(pathArray[1], mapChild);\n }\n else\n {\n //gabung alias ke pathnya\n //cari parent -- this\n Map mapParent = (Map) flatIndex.get(\"this\");\n if(mapParent==null)\n continue;\n //cari alias child\n Map mapChild;\n //ambil dari alias dari looping atas\n if(StringUtils.isNotBlank(joinPath.alias))\n {\n mapChild = (Map) flatIndex.get(joinPath.alias);\n }\n else\n {\n mapChild = (Map) flatIndex.get(pathArray[0]);\n }\n mapParent.put(pathArray[0], mapChild);\n }\n }\n if(cleanUp((Map<String, Object>) joinPathMap.get(\"this\")))\n {\n if (Collection.class.isAssignableFrom(rootObj.getClass()))\n {\n for (Object rootObjIter : ((Collection) rootObj))\n {\n recursiveInitialize((Map<String, Object>) joinPathMap.get(\"this\"), rootObjIter, true);\n }\n }\n else\n {\n recursiveInitialize((Map<String, Object>) joinPathMap.get(\"this\"), rootObj, false);\n }\n }\n }",
"public abstract boolean apply( String inputKey, Object input, WalkedPath walkedPath, Map<String,Object> output );",
"public interface DataContext extends Map<String, Map<String, String>>, Mergable<DataContext> {\n Map<String,Map<String,String>> getData();\n\n default Converter<String, String> replaceDataReferencesConverter() {\n return DataContextUtils.replaceDataReferencesConverter(getData());\n }\n\n /**\n * Create a deep copy\n *\n * @return a new object\n */\n DataContext copy();\n\n\n /**\n * Return a converter that can expand the property references within a string\n *\n * @param converter secondary converter to apply to property values before replacing in a string\n * @param failOnUnexpanded if true, fail if a property value cannot be expanded\n *\n * @return a Converter to expand property values within a string\n */\n default Converter<String, String> replaceDataReferencesConverter(\n final Converter<String, String> converter,\n final boolean failOnUnexpanded\n )\n {\n return DataContextUtils.replaceDataReferencesConverter(getData(), converter, failOnUnexpanded);\n }\n\n\n default String[] replaceDataReferences(\n final String[] args,\n final Converter<String, String> converter,\n boolean failIfUnexpanded\n )\n {\n return replaceDataReferences(args, converter, failIfUnexpanded, false);\n }\n\n\n /**\n * Replace the embedded properties of the form '${key.name}' in the input Strings with the value from the data\n * context\n *\n * @param args argument string array\n * @param converter converter\n * @param failIfUnexpanded true to fail if property is not found\n * @param blankIfUnexpanded true to use blank if property is not found\n *\n * @return string array with replaced embedded properties\n */\n default String[] replaceDataReferences(\n final String[] args,\n Converter<String, String> converter,\n boolean failIfUnexpanded,\n boolean blankIfUnexpanded\n )\n {\n return DataContextUtils.replaceDataReferencesInArray(args, getData(), converter, failIfUnexpanded, blankIfUnexpanded);\n }\n\n /**\n * Replace the embedded properties of the form '${key.name}' in the input Strings with the value from the data\n * context\n *\n * @param args argument string array\n *\n * @return string array with replaced embedded properties\n */\n default String[] replaceDataReferences(final String[] args) {\n return replaceDataReferences(args, null, false);\n }\n\n /**\n * Recursively replace data references in the values in a map which contains either string, collection or Map\n * values.\n *\n * @param input input map\n *\n * @return Map with all string values having references replaced\n */\n default Map<String, Object> replaceDataReferences(final Map<String, Object> input) {\n return DataContextUtils.replaceDataReferences(input, getData());\n }\n\n default String resolve(\n final String group,\n final String key\n )\n {\n return resolve(group, key, null);\n }\n\n /**\n * Return the resolved value from the context\n *\n * @param group group name\n * @param key key name\n * @param defaultValue default if the value is not resolvable\n *\n * @return resolved value or default\n */\n default String resolve(\n final String group,\n final String key,\n final String defaultValue\n )\n {\n Map<String, Map<String, String>> data = getData();\n return null != data && null != data.get(group) && null != data.get(group).get(key)\n ? data.get(group).get(key)\n : defaultValue;\n }\n\n /**\n * Replace the embedded properties of the form '${key.name}' in the input Strings with the value from the data\n * context\n *\n * @param input input string\n *\n * @return string with values substituted, or original string\n */\n default String replaceDataReferences(final String input) {\n return DataContextUtils.replaceDataReferencesInString(input, getData());\n }\n\n /**\n * Replace the embedded properties of the form '${key.name}' in the input Strings with the value from the data\n * context\n *\n * @param input input string\n * @param converter converter to encode/convert the expanded values\n * @param failOnUnexpanded true to fail if a reference is not found\n *\n * @return string with values substituted, or original string\n */\n default String replaceDataReferences(\n final String input,\n final Converter<String, String> converter,\n boolean failOnUnexpanded\n )\n {\n return replaceDataReferences(input, converter, failOnUnexpanded, false);\n }\n\n /**\n * Replace the embedded properties of the form '${key.name}' in the input Strings with the value from the data\n * context\n *\n * @param input input string\n * @param converter converter to encode/convert the expanded values\n * @param failOnUnexpanded true to fail if a reference is not found\n * @param blankIfUnexpanded true to use blank if a reference is not found\n *\n * @return string with values substituted, or original string\n */\n default String replaceDataReferences(\n final String input,\n final Converter<String, String> converter,\n boolean failOnUnexpanded,\n boolean blankIfUnexpanded\n )\n {\n return DataContextUtils.replaceDataReferencesInString(input, getData(), converter, failOnUnexpanded, blankIfUnexpanded);\n\n }\n\n /**\n *\n * @param other\n * @return new data context of this context merged with the other context\n */\n default DataContext merged(DataContext other) {\n return new BaseDataContext(DataContextUtils.merge(this, other));\n }\n}",
"private Map<String, Object> enrichJson(JsonObject jsonObject) {\n Map<String, Object> enriched = new LinkedHashMap<String, Object>();\n for (Map.Entry<String, JsonElement> entry : jsonObject.entrySet()) {\n enriched.put(entry.getKey(), enrichJsonElement(entry.getValue()));\n }\n\n return enriched;\n }",
"public Map<String,String> toMap(final Object object)\r\n {\r\n final HashMap<String,String> hashMap = new HashMap<String,String>();\r\n final Class<?> clazz = object.getClass();\r\n final Method[] methods = getDeclaredMethods(clazz);\r\n\r\n for( Method method : methods ) {\r\n if(\r\n method.getParameterTypes().length != 0\r\n || !methodesNamePattern.matcher(\r\n method.getName()\r\n ).matches()\r\n ) {\r\n continue;\r\n }\r\n\r\n Class<?> returnType = method.getReturnType();\r\n Object result0;\r\n\r\n if( isMappable( returnType ) ) {\r\n if( returnType.isArray() ) {\r\n Mappable[] result1 = (Mappable[])invoke(object, method, hashMap, Mappable.class);\r\n\r\n if(result1 == null) {\r\n continue;\r\n }\r\n\r\n int len = Array.getLength(result1);\r\n String methodName = method.getName();\r\n int i = 0;\r\n\r\n do {\r\n if(i >= len) {\r\n continue;// label0;\r\n }\r\n\r\n Mappable value = (Mappable)Array.get(result1, i);\r\n String name = formatIterableEntry(methodName, i, len);\r\n\r\n if(value == null) {\r\n hashMap.put(name, null);\r\n\r\n }\r\n else {\r\n MappableBuilder.addRec(hashMap, name, value);\r\n }\r\n i++;\r\n } while(true);\r\n }\r\n\r\n result0 = invoke(object, method, hashMap, Mappable.class);\r\n\r\n if(result0 != null) {\r\n MappableBuilder.addRec(\r\n hashMap,\r\n (new StringBuilder()).append(method.getName()).append(\"().\").toString(),\r\n ((Mappable) (result0) )\r\n );\r\n }\r\n continue;\r\n }\r\n\r\n if(mappableItemSet.contains(MappableItem.DO_ITERATOR) && Iterator.class.isAssignableFrom(returnType)) {\r\n Iterator<?> iter = (Iterator<?>)invoke(object, method, hashMap, Iterator.class);\r\n String name = method.getName();\r\n\r\n int i = 0;\r\n hashMap.put(\r\n formatMethodName(name),\r\n (new StringBuilder()).append(iter).toString()\r\n );\r\n while( iter.hasNext() ) {\r\n hashMap.put(\r\n formatIteratorEntry(name, i++, -1),\r\n toString( iter.next())\r\n );\r\n }\r\n continue;\r\n }\r\n\r\n if( mappableItemSet.contains( MappableItem.DO_ITERABLE ) &&\r\n Iterable.class.isAssignableFrom( returnType )\r\n ) {\r\n Iterable<?> iterLst = (Iterable<?>)invoke(object, method, hashMap, Iterable.class);\r\n Iterator<?> iter = iterLst.iterator();\r\n String methodName = method.getName();\r\n\r\n int i = 0;\r\n hashMap.put(\r\n formatMethodName( methodName ),\r\n iter == null ? null : iter.toString()\r\n );\r\n\r\n while( iter.hasNext() ) {\r\n hashMap.put(\r\n formatIterableEntry(methodName, i++, -1),\r\n toString(iter.next())\r\n );\r\n }\r\n continue;\r\n }\r\n\r\n if( mappableItemSet.contains(MappableItem.DO_ENUMERATION) && Enumeration.class.isAssignableFrom(returnType)) {\r\n Enumeration<?> enum0 = (Enumeration<?>)invoke(object, method, hashMap, Enumeration.class);\r\n String methodName = method.getName();\r\n\r\n int i = 0;\r\n hashMap.put(\r\n formatMethodName( methodName ),\r\n enum0 == null ? null : enum0.toString()\r\n );\r\n\r\n if( enum0 != null ) {\r\n while( enum0.hasMoreElements() ) {\r\n hashMap.put(\r\n formatEnumerationEntry(methodName, i++, -1),\r\n toString( enum0.nextElement() )\r\n );\r\n }\r\n }\r\n continue;\r\n }\r\n\r\n if( !shouldEvaluate(returnType) ) {\r\n continue;\r\n }\r\n\r\n Object methodResult = invoke(object, method, hashMap, Object.class);\r\n\r\n if( returnType.isArray() ) {\r\n final String methodName = method.getName();\r\n\r\n if( methodResult == null ) {\r\n hashMap.put(\r\n formatMethodName( methodName ),\r\n toString( methodResult )\r\n );\r\n }\r\n else {\r\n int len = Array.getLength( methodResult );\r\n\r\n for(int i = 0; i < len; i++) {\r\n Object value = Array.get( methodResult, i );\r\n\r\n hashMap.put(\r\n formatArrayEntry(methodName, i, len),\r\n toString(value)\r\n );\r\n }\r\n }\r\n }\r\n else {\r\n if( methodResult == null ) {\r\n hashMap.put(\r\n formatMethodName(method.getName()),\r\n null\r\n );\r\n }\r\n else {\r\n hashMap.put(\r\n formatMethodName(method.getName()),\r\n methodResult.toString()\r\n );\r\n }\r\n }\r\n }\r\n\r\n return new TreeMap<String,String>(hashMap);\r\n }",
"private void rebuildKey() {\r\n\r\n final StringBuffer sb = new StringBuffer();\r\n\r\n sb.append(getClassField().getCanonicalName());\r\n for (final Object k : this.keyPartList) {\r\n sb.append(k.toString()).append('|');\r\n }\r\n this.key = sb.toString();\r\n }",
"private Map<String, Object> normalizeSectionNames(Map<String, Object> data) {\n Map<String, Object> normalized = new HashMap<String, Object>();\n\n Set<String> keys = data.keySet();\n\n for (String key : keys) {\n normalized.put( normalizeSectionName( key ), data.get( key ) );\n }\n return normalized;\n }",
"public BinarySearchTree(JSONObject object) {\r\n\t\tthis.root = null;\r\n for (Object key : object.keySet()) {\r\n \taddKeyValuePair(String.valueOf(key).toLowerCase(), (String)object.get(key));\r\n }\r\n\t}",
"private Map deepMerge(Map original, Map newMap) {\r\n for (Object key : newMap.keySet()) {\r\n if (newMap.get(key) instanceof Map && original.get(key) instanceof Map) {\r\n Map originalChild = (Map) original.get(key);\r\n Map newChild = (Map) newMap.get(key);\r\n original.put(key, deepMerge(originalChild, newChild));\r\n } else if (newMap.get(key) instanceof List && original.get(key) instanceof List) {\r\n List originalChild = (List) original.get(key);\r\n List newChild = (List) newMap.get(key);\r\n for (Object each : newChild) {\r\n if (!originalChild.contains(each)) {\r\n originalChild.add(each);\r\n }\r\n }\r\n } else {\r\n original.put(key, newMap.get(key));\r\n }\r\n }\r\n return original;\r\n }",
"public Map<String, FieldType> flatten() {\n if (fields == null || fields.length == 0) {\n return Collections.<String, FieldType> emptyMap();\n }\n\n Map<String, FieldType> map = new LinkedHashMap<String, FieldType>();\n\n for (Field nestedField : fields) {\n addSubFieldToMap(map, nestedField, null);\n }\n\n return map;\n }",
"private static JSONObject addAllKeyValuePairs(JSONObject source, JSONObject destination) {\n Iterator<?> keys = source.keys();\n while (keys.hasNext()) {\n try {\n String key = (String) keys.next();\n String value = source.get(key).toString();\n destination.put(key, value);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n return destination;\n }",
"static void flatten(Value value, Collection<Value> result) {\r\n if (value instanceof ContainerValue) {\r\n ContainerValue cont = (ContainerValue) value;\r\n for (int i = 0, size = cont.getElementSize(); i < size; i++) {\r\n flatten(cont.getElement(i), result);\r\n } \r\n } else {\r\n result.add(value);\r\n }\r\n }",
"@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\r\n\tpublic static Map convertToFlatConfigMap(\r\n\t\t\tfinal String name, final Map map) {\r\n\t\tfinal Map flatConfigMap = new HashMap();\r\n\r\n\t\tfor (final Object keyObj : map.keySet()) {\r\n\t\t\tString key = (String) keyObj;\r\n\t\t\tflatConfigMap.put(name + \"__\" + key,\r\n\t\t\t\t\tmap.get(key));\r\n\t\t}\r\n\t\treturn flatConfigMap;\r\n\t}",
"private void parseJSON(Map<String,Object> map, String baseName, JSONObject toParse) {\n\t\ttoParse.keys().forEachRemaining(key -> {\n\t\t\tObject value = parseJSONVal(toParse.get(key));\n\t\t\t\n\t\t\tif(value instanceof JSONObject)\n\t\t\t\tparseJSON(map, baseName+key+StringParser.DELIMITER, (JSONObject) value);\n\t\t\telse if(value instanceof JSONArray) \n\t\t\t\tparseJSON(map, baseName+key+StringParser.DELIMITER, (JSONArray) value);\n\t\t\telse\n\t\t\t\tmap.put(baseName+key, value);\n\t\t});\n\t}",
"@SuppressWarnings(\"unchecked\")\n private Object asReversedIteration(final Map<String, Object> input, final boolean recursive, final List<Object> disc) {\n Stack<Entry<String, Object>> s = new Stack<>();\n disc.add(input);\n outerLoop:\n for (Entry<String, Object> entry : input.entrySet()) {\n s.push(entry);\n\n for (Object e : disc) {\n {\n if (e == entry) {\n continue outerLoop;\n }\n }\n }\n if (recursive) {\n if (entry.getValue() instanceof List<?>) {\n entry.setValue(asReversedIteration((List<Object>) entry.getValue(), true, disc));\n }\n if (entry.getValue() instanceof Map<?, ?>) {\n entry.setValue(asReversedIteration((Map<String, Object>) entry.getValue(), true, disc));\n }\n }\n\n }\n input.clear();\n int size = s.size();\n for (int i = 0; i < size; i++) {\n Entry<String, Object> e = s.pop();\n input.put(e.getKey(), e.getValue());\n }\n return input;\n }",
"public static HashMap GetTypeMapFromProtocolString(String protocolString, int[] startIndex, int[] endIndex)\n {\n endIndex[0] = protocolString.indexOf(\"\\\"\", startIndex[0] + 1);\n HashMap tbl = new HashMap();\n String token = protocolString.substring(startIndex[0], (endIndex[0]));\n\n if (token.equals(\"__dictionary\"))\n {\n startIndex[0] = endIndex[0] + 1;\n endIndex[0] = protocolString.indexOf(\"\\\"\", endIndex[0] + 1);\n int dicCount = Integer.parseInt(protocolString.substring(startIndex[0], (endIndex[0])));\n\n for (int i = 0; i < dicCount; i++)\n {\n startIndex[0] = endIndex[0] + 1;\n endIndex[0] = protocolString.indexOf(\"\\\"\", endIndex[0] + 1);\n String key = protocolString.substring(startIndex[0], (endIndex[0]));\n\n startIndex[0] = endIndex[0] + 1;\n endIndex[0] = protocolString.indexOf(\"\\\"\", endIndex[0] + 1);\n\n // If value to be stored is _dictionary then call the function recursively other wise its an attribute\n String value = protocolString.substring(startIndex[0], (endIndex[0]));\n\n if (value.equals(\"__dictionary\"))\n {\n HashMap temp = new HashMap();\n temp = GetTypeMapFromProtocolString(protocolString, startIndex, endIndex);\n tbl.put(key, temp);\n }\n else\n {\n tbl.put(key, value);\n }\n }\n }\n return tbl;\n }",
"@Override\n\tpublic void convertitMap(Map<String, Object> map) {\n\t\t\n\t}",
"public static LinkedHashMap<String, Integer> getOrderedResult(TreeMap<String, Integer> inputMap, Boolean debug, Rappresentation typeOrder)\r\n { \r\n Boolean mergeNote = false;\r\n Boolean getIndex = false;\r\n \r\n LinkedHashMap<String, Integer> outputMap = new LinkedHashMap<>();\r\n \r\n ArrayList<String> anglosaxonClassOrder = new ArrayList<>(Arrays.asList(\"C\",\"C#\",\"Db\",\"D\",\"D#\",\"Eb\",\"E\",\"F\",\"F#\",\"Gb\",\"G\",\"G#\",\"Ab\",\"A\",\"A#\",\"Bb\",\"B\"));\r\n ArrayList<String> diatonicNoteOrder = new ArrayList<>(Arrays.asList(\"Do\",\"Do#\",\"Reb\",\"Re\",\"Re#\",\"Mib\",\"Mi\",\"Fa\",\"Fa#\",\"Solb\",\"Sol\",\"Sol#\",\"Lab\",\"La\",\"La#\",\"Sib\",\"Si\"));\r\n ArrayList<String> pitchClassOrder = new ArrayList<>(Arrays.asList(\"C\",\"C#/Db\",\"D\",\"D#/Eb\",\"E\",\"F\",\"F#/Gb\",\"G\",\"G#/Ab\",\"A\",\"A#/Bb\",\"B\"));\r\n \r\n ArrayList<String> listToOrder = new ArrayList<>();\r\n \r\n if(typeOrder.name().equals(\"ANGLOSASSONE\"))\r\n {\r\n //System.out.println(\"Inside IF ANGLOSASSONE\");\r\n listToOrder = anglosaxonClassOrder;\r\n mergeNote = true;\r\n }\r\n else if(typeOrder.name().equals(\"DIATONICA\"))\r\n {\r\n //System.out.println(\"Inside IF DIATONICA\");\r\n listToOrder = diatonicNoteOrder;\r\n }\r\n else if(typeOrder.name().equals(\"PITCH_CLASS\"))\r\n {\r\n //System.out.println(\"Inside IF PITCH_CLASS\");\r\n listToOrder = anglosaxonClassOrder;\r\n getIndex = true;\r\n }\r\n\r\n for(int k=0; k<listToOrder.size(); k++)\r\n {\r\n String keyMap = \"\";\r\n if(inputMap.containsKey(listToOrder.get(k)))\r\n {\r\n if(mergeNote)\r\n {\r\n if(listToOrder.get(k).equals(\"C#\") || listToOrder.get(k).equals(\"Db\"))\r\n keyMap = \"C#/Db\";\r\n else if(listToOrder.get(k).equals(\"D#\") || listToOrder.get(k).equals(\"Eb\"))\r\n keyMap = \"D#/Eb\";\r\n else if(listToOrder.get(k).equals(\"F#\") || listToOrder.get(k).equals(\"Gb\"))\r\n keyMap = \"F#/Gb\";\r\n else if(listToOrder.get(k).equals(\"G#\") || listToOrder.get(k).equals(\"Ab\"))\r\n keyMap = \"G#/Ab\";\r\n else if(listToOrder.get(k).equals(\"A#\") || listToOrder.get(k).equals(\"Bb\"))\r\n keyMap = \"A#/Bb\";\r\n else\r\n keyMap = listToOrder.get(k);\r\n }\r\n else\r\n {\r\n if(!getIndex)\r\n keyMap = listToOrder.get(k);\r\n else\r\n {\r\n String tmpIndex = \"\";\r\n if(listToOrder.get(k).equals(\"C#\") || listToOrder.get(k).equals(\"Db\"))\r\n {\r\n tmpIndex = \"C#/Db\";\r\n keyMap = Integer.toString(pitchClassOrder.indexOf(tmpIndex));\r\n System.out.println(\"tmpIndex: \" + tmpIndex + \" keyMap: \" + keyMap);\r\n }\r\n\r\n else if(listToOrder.get(k).equals(\"D#\") || listToOrder.get(k).equals(\"Eb\"))\r\n {\r\n tmpIndex = \"D#/Eb\";\r\n keyMap = Integer.toString(pitchClassOrder.indexOf(tmpIndex));\r\n System.out.println(\"tmpIndex: \" + tmpIndex + \" keyMap: \" + keyMap);\r\n }\r\n else if(listToOrder.get(k).equals(\"F#\") || listToOrder.get(k).equals(\"Gb\"))\r\n {\r\n tmpIndex = \"F#/Gb\";\r\n keyMap = Integer.toString(pitchClassOrder.indexOf(tmpIndex));\r\n System.out.println(\"tmpIndex: \" + tmpIndex + \" keyMap: \" + keyMap);\r\n }\r\n else if(listToOrder.get(k).equals(\"G#\") || listToOrder.get(k).equals(\"Ab\"))\r\n {\r\n tmpIndex = \"G#/Ab\";\r\n keyMap = Integer.toString(pitchClassOrder.indexOf(tmpIndex));\r\n System.out.println(\"tmpIndex: \" + tmpIndex + \" keyMap: \" + keyMap);\r\n }\r\n else if(listToOrder.get(k).equals(\"A#\") || listToOrder.get(k).equals(\"Bb\"))\r\n {\r\n tmpIndex = \"A#/Bb\";\r\n keyMap = Integer.toString(pitchClassOrder.indexOf(tmpIndex));\r\n System.out.println(\"tmpIndex: \" + tmpIndex + \" keyMap: \" + keyMap);\r\n }\r\n else\r\n {\r\n tmpIndex = listToOrder.get(k);\r\n keyMap = Integer.toString(pitchClassOrder.indexOf(tmpIndex));\r\n System.out.println(\"k: \" + k + \" tmpIndex: \" + tmpIndex + \" keyMap: \" + keyMap);\r\n }\r\n } \r\n }\r\n outputMap.put(keyMap, inputMap.get(listToOrder.get(k))); \r\n } \r\n }\r\n if(debug)\r\n {\r\n System.out.println(\"getOrderResult keySet \" + outputMap.keySet());\r\n System.out.println(\"getOrderResult values \" + outputMap.values());\r\n }\r\n if(!outputMap.isEmpty())\r\n return outputMap;\r\n else\r\n {\r\n outputMap.put(\"Empty\", -1);\r\n }\r\n return outputMap;\r\n }",
"public static void main(String[] args) throws IllegalAccessException, InvocationTargetException, InstantiationException {\n\r\n Map<String, Shape> shapeMap = new HashMap<>();\r\n\r\n shapeMap.put(\"Triangle\", new SimpleTriangle(3, 5, 5));\r\n shapeMap.put(\"Circle\", new SimpleCircle(5));\r\n\r\n for (Map.Entry<String, Shape> entry : shapeMap.entrySet()) {\r\n System.out.println(\"Key - \" + entry.getKey() + \" Value \" + entry.getValue());\r\n }\r\n\r\n //Write a Java program to count the number of key-value (size) mappings in a map\r\n\r\n int size = shapeMap.size();\r\n System.out.println(size);\r\n\r\n //Write a Java program to copy all of the mappings from the specified map to another map.\r\n\r\n Map<String, Shape> shapeMap1 = new HashMap<>();\r\n shapeMap1.put(\"Square7\", new SimpleSquare(7));\r\n shapeMap1.put(\"Square9\", new SimpleSquare(9));\r\n\r\n shapeMap.putAll(shapeMap1);\r\n\r\n System.out.println(shapeMap);\r\n\r\n //Write a Java program to check whether a map contains key-value mappings (empty) or not.Try to use .clear()\r\n\r\n shapeMap1.clear();\r\n System.out.println(shapeMap1.isEmpty());\r\n\r\n //Write a Java program to test if a map contains a mapping for the specified key.\r\n\r\n boolean what = shapeMap.containsKey(\"Square7\");\r\n System.out.println(what);\r\n\r\n //Write a Java program to test if a map contains a mapping for the specified value.\r\n\r\n boolean whatValue = shapeMap.containsValue(new SimpleSquare(7));\r\n System.out.println(whatValue);\r\n\r\n //Write a Java program to create a set view of the mappings contained in a map.\r\n\r\n\r\n //Tree Set\r\n\r\n Set<Employee> treeSet = new TreeSet<>();\r\n treeSet.add(new Employee(17_000, \"J\"));\r\n treeSet.add(new Employee(20_000, \"K\"));\r\n\r\n System.out.println(treeSet);\r\n\r\n final EmployeeAgeComparator ageComparator = new EmployeeAgeComparator();\r\n Set<Employee> treeSetByAge = new TreeSet<>(ageComparator);\r\n treeSetByAge.add(new Employee(22_000, 35, \"L\"));\r\n treeSetByAge.add(new Employee(78_000, 19, \"J\"));\r\n treeSetByAge.add(new Employee(93_000, 55, \"P\"));\r\n\r\n System.out.println(treeSetByAge);\r\n\r\n final EmployeeSalaryComparator salaryComparator = new EmployeeSalaryComparator();\r\n Set<Employee> treeSetBySalary = new TreeSet<>(salaryComparator);\r\n treeSetBySalary.add(new Employee(98_120, 59, \"LA\"));\r\n treeSetBySalary.add(new Employee(92_000, 79, \"AA\"));\r\n treeSetBySalary.add(new Employee(18_100, 44, \"AC\"));\r\n\r\n System.out.println(treeSetBySalary);\r\n\r\n System.out.println(\"==============================================\");\r\n\r\n Set<Employee> treeSetByName = new TreeSet<Employee>((o1, o2) -> o1.getName().compareTo(o2.getName()));\r\n\r\n treeSetByName.add(new Employee(98_120, 59, \"LA\"));\r\n treeSetByName.add(new Employee(92_000, 79, \"AA\"));\r\n treeSetByName.add(new Employee(18_100, 44, \"AC\"));\r\n\r\n System.out.println(treeSetByName);\r\n\r\n Employee newEmployee = null;\r\n final Constructor<?>[] constructorsEmp = Employee.class.getConstructors();\r\n for (Constructor constructor : constructorsEmp) {\r\n System.out.println(constructor.getParameterCount());\r\n if (constructor.getParameterCount() == 2) {\r\n newEmployee = (Employee) constructor.newInstance(66_000, \"From Reflection\");\r\n }\r\n }\r\n if(newEmployee != null){\r\n System.out.println(newEmployee);\r\n }\r\n\r\n }",
"public static Map<String, String> m3185a(Map<String, String> map) {\n Map<String, String> hashMap = new HashMap();\n map = map.entrySet().iterator();\n while (map.hasNext()) {\n Entry entry = (Entry) map.next();\n Object obj = (String) entry.getKey();\n Object obj2 = (String) entry.getValue();\n if (obj.length() > 40) {\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"cd key length over:\");\n stringBuilder.append(obj);\n C0784a.m3253a(stringBuilder.toString());\n obj = obj.substring(0, 40);\n }\n if (obj2 != null && obj2.length() > 1024) {\n stringBuilder = new StringBuilder();\n stringBuilder.append(\"cd value length over:\");\n stringBuilder.append(obj2);\n C0784a.m3253a(stringBuilder.toString());\n obj2 = obj2.substring(0, 1024);\n }\n hashMap.put(obj, obj2);\n }\n return hashMap;\n }",
"public static Map<Integer, List<Integer>> displayResult( Map<Integer, List<Integer>> result) {\n Map<Integer, List<Integer>> desiredResult = new HashMap<Integer, List<Integer>>();\n List<Integer> oneParents = new ArrayList<Integer>();\n List<Integer> noParents = new ArrayList<Integer>();\n\n if(result != null) {\n for( int key : result.keySet() ) {\n List<Integer> parents = result.get( key);\n if( parents.size() == 0) {\n noParents.add(key);\n } else if ( parents.size() == 1 ) {\n oneParents.add( key);\n }\n }\n desiredResult.put(0, noParents);\n desiredResult.put(1, oneParents);\n }\n return desiredResult;\n }",
"private HashMap parseMap(String localData){\n int localPointer = 0;\n HashMap temp = new HashMap();\n char c = localData.charAt(localPointer++);\n while (c != '}'){\n String entry = \"\";\n entry_loop :\n while (c != '}'){\n switch (c){\n case ',' :\n c = localData.charAt(localPointer++);\n break entry_loop;\n case '{' :\n String tempEntry = this.getFull(localData.substring(localPointer),0);\n entry += tempEntry;\n localPointer += tempEntry.length();\n break ;\n case '[' :\n String tempEntry2 = this.getFull(localData.substring(localPointer),1);\n entry += tempEntry2;\n localPointer += tempEntry2.length();\n break ;\n default :\n entry += c;\n break ;\n }\n c = localData.charAt(localPointer++);\n }\n entry = entry.trim();\n String[] entryArray = entry.split(\":\",2);\n String key = entryArray[0].trim();\n String value = entryArray[1].trim();\n Object keyObj = null;\n Object valueObj = null;\n\n switch (this.getDataType(key.trim())){\n case String:\n keyObj = key.trim().replace(\"\\\"\",\"\");\n break ;\n case Integer:\n keyObj = Long.parseLong(key.trim());\n break ;\n case Float:\n keyObj = Float.parseFloat(key.trim());\n break ;\n case Boolean:\n keyObj = Boolean.parseBoolean(key.trim());\n break ;\n case Map:\n keyObj = this.parseMap(key.trim());\n break ;\n case List:\n keyObj = this.parseList(key.trim());\n }\n\n switch (this.getDataType(value.trim())){\n case String:\n valueObj = value.trim().replace(\"\\\"\",\"\");\n break ;\n case Integer:\n valueObj = Long.parseLong(value.trim());\n break ;\n case Float:\n valueObj = Float.parseFloat(value.trim());\n break ;\n case Boolean:\n valueObj = Boolean.parseBoolean(value.trim());\n break ;\n case Map:\n valueObj = this.parseMap(value.trim());\n break ;\n case List:\n valueObj = this.parseList(value.trim());\n }\n temp.put(keyObj,valueObj);\n }\n return temp;\n }",
"@SuppressWarnings(\"rawtypes\")\n void\n addToObject(Pair<HashMap<String, Object>> obj, Pair<String> key, Pair add)\n {\n if (!obj.parsed.containsKey(key.parsed))\n {\n obj.parsed.put(key.parsed, add.parsed);\n obj.unparsed = obj.unparsed.substring(0, obj.unparsed.length() - 1);\n if (obj.unparsed.length() > 1)\n obj.unparsed += \",\";\n obj.unparsed += (key.unparsed + \":\" + add.unparsed + \"}\");\n } // if\n }",
"private Set<Product> payloadToProductSet(LinkedHashMap body) { //throws Exception {\n //System.out.println(\"body: \" + body.toString());\n ArrayList arrayListProducts = (ArrayList) body.get(\"product\");\n //System.out.println(\"arrayList: \" + arrayListProducts);\n Set<Product> productSet = new HashSet<>();\n// try {\n arrayListProducts.forEach(\n productIndex -> {\n ((HashMap) productIndex).values().forEach(\n productValue -> {\n Product product = new Product();\n TreeMap<Tab, TreeMap<Category, TreeMap<Item, TreeSet<Tag>>>> tabMap = new TreeMap();\n //System.out.println(\"productValue: \" + productValue);\n ((HashMap) productValue).forEach(\n (substanceKey, substanceValue) -> {\n //System.out.println(\"substanceKey: \" + substanceKey);\n //System.out.println(\"substanceValue: \" + substanceValue);\n ((HashMap) substanceValue).values().forEach(\n tabArrayWrapped -> {\n //System.out.println(\"tabArrayWrapped: \" + tabArrayWrapped);\n ((ArrayList) tabArrayWrapped).forEach(\n tabArrayUnwrapped -> {\n //System.out.println(\"tabArrayUnwrapped: \" + tabArrayUnwrapped);\n ((HashMap) tabArrayUnwrapped).forEach(\n (tabKey, tabValue) -> {\n TreeMap<Category, TreeMap<Item, TreeSet<Tag>>> categoryMap = new TreeMap<>();\n //System.out.println(\"tabValue: \" + tabValue);\n ((HashMap) tabValue).values().forEach(\n categoryWrapped -> {\n //System.out.println(\"categoryWrapped: \" + categoryWrapped);\n ((ArrayList) categoryWrapped).forEach(\n categoryUnwrapped -> {\n //System.out.println(\"categoryUnwrapped: \" + categoryUnwrapped);\n ((HashMap) categoryUnwrapped).forEach(\n (categoryKey, categoryValue) -> {\n TreeMap<Item, TreeSet<Tag>> itemMap = new TreeMap();\n //System.out.println(\"categoryValue: \" + categoryValue);\n ((HashMap) categoryValue).values().forEach(\n itemWrapped -> {\n //System.out.println(\"itemWrapped: \" + itemWrapped);\n ((ArrayList) itemWrapped).forEach(\n itemUnwrapped -> {\n\n Item item = new Item();\n //System.out.println(\"itemUnwrapped: \" + itemUnwrapped);\n ((HashMap) itemUnwrapped).forEach(\n (itemKey, itemValue) -> {\n //System.out.println(\"itemKey: \" + itemKey + \" itemValue: \" + itemValue);\n if (itemKey.equals(\"Title\")) {\n item.setName(itemValue.toString());\n }\n if (itemKey.equals(\"Description\")) {\n item.setDescription(itemValue.toString());\n }\n if (itemKey.equals(\"Tag\")) {\n TreeSet<Tag> tagSet = new TreeSet();\n ((ArrayList) itemValue).forEach(tagName -> tagSet.add(new Tag(tagName.toString())));\n itemMap.put(item, tagSet);\n categoryMap.put(new Category(categoryKey.toString()), itemMap);\n tabMap.put(new Tab(tabKey.toString()), categoryMap);\n product.getProduct().put(new Substance(substanceKey.toString()), tabMap);\n productSet.add(product);\n }\n });\n });\n });\n });\n });\n });\n });\n });\n });\n });\n });\n });\n// }\n// catch (Exception ex){\n// System.out.println(\"Ex: \" + ex.getMessage());\n// }\n\n return productSet;\n }",
"public void collectPhoneNumbers1(Map<String,Object> VerifiedParents) {\n for (Map.Entry<String, Object> entry : VerifiedParents.entrySet()){\n\n //Get user map\n Map singleUser = (Map) entry.getValue();\n //Get phone field and append to list\n phoneNumbers.add((String) singleUser.get(\"email\"));\n }\n// Toast.makeText(getApplicationContext(), \"It is running\",\n// Toast.LENGTH_SHORT).show();\n\n }",
"private boolean isPrefixInDictionaryRecursive(String prefix, BSTNode<String> n) {\n\t\tif (n.getData() == null){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tint comparison = n.getData().compareToIgnoreCase(prefix);\n\t\tboolean isPrefix = n.getData().startsWith(prefix);\n\t\tif (isPrefix) \n\t\t\treturn true;\n\t\t\n\t\t//makes sure the new parameters are not null references\n\t\tif (comparison < 0 && n.getLeft() != null)\n\t\t\treturn isPrefixInDictionaryRecursive( prefix, n.getLeft());\n\t\telse if ( comparison > 0 && n.getRight() != null)\n\t\t\treturn isPrefixInDictionaryRecursive( prefix, n.getRight());\n\t\telse //this case should never happen\n\t\t\treturn true;\n\t\t\n\t\t/**old code written by Professor below\n\t\t */\n\t\t\n\t\t//if (begin > end )\n\t\t//return false;\n\t\t\n\t\t//int half = (begin+end+1) / 2;\n\t\t//int comparison = words.get(half).compareToIgnoreCase(prefix);\n\t\t//boolean isPrefix = words.get(half).startsWith(prefix);\n\t\t//if (isPrefix) \n\t\t\t//return true;\n\t\t\n\t\t//if (comparison < 0 )\n\t\t\t//return isPrefixInDictionaryRecursive( prefix, half + 1, end );\n\t\t//else if ( comparison > 0 )\n\t\t\t//return isPrefixInDictionaryRecursive( prefix, begin, half - 1);\n\t\t//else //this case should never happen\n\t\t\t//return true;\n\t}",
"protected void augmentToStringFields(final Map<String, Object> augmentedToStringFields) {}",
"private void mapObject(Object obj) {\n if (!objectIdMap.containsKey(obj))\n objectIdMap.put(obj, objectIdMap.size());\n if (obj instanceof Map) {\n Map dict = (Map) obj;\n Set<Map.Entry<String, Object>> de = dict.entrySet();\n for (Map.Entry<String, Object> e : de)\n mapObject(e.getKey());\n for (Map.Entry<String, Object> e : de)\n mapObject(e.getValue());\n } else if (obj instanceof List) {\n List list = (List) obj;\n for (int i = 0; i < list.size(); i++)\n mapObject(list.get(i));\n } else if (obj instanceof String || obj instanceof Float || obj instanceof Double ||\n obj instanceof Integer || obj instanceof Long || obj instanceof byte[] ||\n obj instanceof Date || obj instanceof Boolean) {\n // do nothing.\n } else\n throw new IllegalStateException(\"Incompatible object \" + obj + \" found\");\n }",
"public static void main(String[] args) {\n\t\tMap map = new HashMap<>();\n\n//\t\tmap.put(\"name\", \"mykong\");\n//\t\tmap.put(\"age\", 12);\n\t\tList<Object> lstTemp = new ArrayList<Object>();\n//\t\tlstTemp.add(map);\n//\t\tmap = new HashMap<>();\n//\t\tmap.put(\"name\", \"henv\");\n//\t\tmap.put(\"age\", \"2\");\n//\t\tlstTemp.add(map);\n\t\t\n\t\tmap = new HashMap<>();\n\t\tmap.put(\"name\", \"henv3\");\n\t\tmap.put(\"age\", \"100\");\n\t\tList<DynamicVO> lstDynamic = new ArrayList<DynamicVO>();\n\t\tDynamicVO d = new DynamicVO();\n\t\td.setKey(\"dKey\");\n\t\td.setValue(\"dValue\");\n\t\tlstDynamic.add(d);\n\t\tmap.put(\"charactor\", lstDynamic);\n\t\t\n\t\tlstTemp.add(map);\n\t\t\n\t\ttry {\n\t\t\tList<Henv> listResults = convert2ClassVO(Henv.class, lstTemp);\n\t\t\tfor(int i = 0; i < listResults.size(); i++) {\n\t\t\t\tfor(int j = 0; j < listResults.get(i).getLstDynamic().size(); j++) {\n\t\t\t\t\tDynamicVO dn = (DynamicVO) listResults.get(i).getLstDynamic().get(j);\n\t\t\t\t\tSystem.out.println(dn.getKey()+ dn.getValue());\n\t\t\t\t}\n//\t\t\t\tSystem.out.println(listResults.get(i).getLstDynamic().get(i).getKey());\n//\t\t\t\tSystem.out.println(listResults.get(i).getLstDynamic().get(i).getValue());\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t} catch (InstantiationException | IllegalAccessException | NoSuchFieldException | NoSuchMethodException\n\t\t\t\t| InvocationTargetException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\tTreeMap<String,Long> actorMap = new TreeMap<String, Long>();\t\t\n\t\tactorMap.put(\"Varun Dhawan\", 9966337744L);\n\t\tactorMap.put(\"Jonny Depp\", 9912347744L);\n\t\tactorMap.put(\"Robert Jr.\", 9967837744L);\n\t\tactorMap.put(\"Aalia Bhat\", 9526335744L);\n\t\tactorMap.put(\"Shraddha Kapoor\", 9963337744L);\n\t\t\n\t\tSystem.out.println(\"Phone No of Varun Dhawan : \" + actorMap.get(\"Varun Dhawan\"));\n\t\t\n\t\tSystem.out.println(actorMap);\n\t\n\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\tSet<String> actor = actorMap.keySet();\n\t\tSystem.out.println(\"User Iterator\");\n\t\tIterator<String> it = actor.iterator();\n\t\twhile(it.hasNext()) {\n\t\t\tString actorName = it.next();\n\t\t\tlong phNo = actorMap.get(actorName);\n\t\t\tSystem.out.println(\"Actor Name : \" + actorName + \"\\tPhone Number : \" + phNo);\n\t\t}\n\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\n\t\tNavigableMap<String, Long> hdMap = actorMap.headMap(\"Shraddha Kapoor\", false);\n\t\tSystem.out.println(\"Head Map : \" +hdMap);\n\t\t\n\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\n\t\tNavigableMap<String, Long> tlMap = actorMap.tailMap(\"Shraddha Kapoor\", false);\n\t\tSystem.out.println(\"Tail Map : \" +tlMap);\n\t\t\n\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\n\t\tSortedMap<String, Long> sbMap = actorMap.subMap(\"Aalia Bhat\", \"Shraddha Kapoor\");\n\t\tSystem.out.println(\"Sub Map : \" +sbMap);\n\t\t\n\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\n\t\tSystem.out.println(\"Ceiling of Shraddha Kapoor is \" + actorMap.ceilingKey(\"Shraddha Kapoor\") );\n\t\t\n\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\n\t\tSystem.out.println(\"Floor of Shraddha Kapoor is \" + actorMap.floorKey(\"Shraddha Kapoor\"));\n\t\t\n\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\n\t\tSystem.out.println(\"Higher of Shraddha Kapoor is \" + actorMap.higherKey(\"Shraddha Kapoor\"));\n\t\t\n\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\n\t\tSystem.out.println(\"Lower of Shraddha Kapoor is \" + actorMap.lowerKey(\"Shraddha Kapoor\"));\n\t\t\n\t}",
"private static ImmutableMap<String, Object> theme(String key, String... parentKeys) {\n ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();\n builder.put(\"path\", \".\");\n builder.put(\"key\", key);\n if (parentKeys != null) {\n builder.put(\"parent\", ImmutableList.copyOf(parentKeys));\n }\n return builder.build();\n }",
"public interface ComplexKeyMap<K, V> extends Map<K, V> {\n\n}",
"public void logAllPossibleKeysWithType() {\n log.info(\"Log all possible keys with type:\");\n Map<String, Class> keysWithType = context.entrySet().stream()\n .collect(toMap(Entry::getKey, entry -> entry.getValue().getClass()));\n log.info(mapToString(keysWithType));\n }",
"public static String getKey(String prefix, Class<?> dtoType, Map<String, Object> record) {\n StringBuilder finalKey = new StringBuilder(Constants.EMPTY_STRING);\n List<String> keys = EntityUtils.getPrimaryKey(getEntityType(dtoType));\n for (String key : keys) {\n if (!StringUtils.isEmpty(prefix)) {\n key = prefix + Constants.DOT + key;\n }\n Object value = record.get(key);\n finalKey.append(null != value ? value.toString() : Constants.EMPTY_STRING)\n .append(Constants.UNDERSCORE);\n }\n return finalKey.deleteCharAt(finalKey.length() - 1).toString(); // remove last underscore\n }",
"public void iterate(){//iterate over all the keys\n\t\tSystem.out.println(\"Keys are :\");\n\t\tSystem.out.println(\"-----------------------\");\n\t\titerate(this.root);\n\t\tSystem.out.println(\"-----------------------\");\n\t}",
"@Override\n\tprotected void wrapperDicsOrEnums(JSONObject jSONObject) {\n\t\tsuper.wrapperDicsOrEnums(jSONObject);\n\t\tJSONArray lstImportClass = jSONObject.getJSONArray(\"importClass\");\n lstImportClass.add(\"java.util.Map\");\n jSONObject.put(\"importClass\", removeDuplicate((List) lstImportClass));\n\t}",
"private Map<Integer, Map<K, V>> classifyBatch(Map<K, V> batch) {\n Map<Integer, Map<K, V>> classifiedBatch = new HashMap<Integer, Map<K, V>>();\n for (Entry<K, V> entry : batch.entrySet()) {\n int keyRange = hash(entry.getKey());\n Map<K, V> subBatch = classifiedBatch.get(keyRange);\n if (subBatch == null) {\n subBatch = new HashMap<K, V>();\n classifiedBatch.put(keyRange, subBatch);\n }\n subBatch.put(entry.getKey(), entry.getValue());\n }\n return classifiedBatch;\n }",
"@Test\n public void testAlteringUserTypeNestedWithinMap() throws Throwable\n {\n String[] columnTypePrefixes = {\"frozen<map<text, \", \"map<text, frozen<\"};\n for (String columnTypePrefix : columnTypePrefixes)\n {\n String ut1 = createType(\"CREATE TYPE %s (a int)\");\n String columnType = columnTypePrefix + KEYSPACE + \".\" + ut1 + \">>\";\n\n createTable(\"CREATE TABLE %s (x int PRIMARY KEY, y \" + columnType + \")\");\n\n execute(\"INSERT INTO %s (x, y) VALUES(1, {'firstValue':{a:1}})\");\n assertRows(execute(\"SELECT * FROM %s\"), row(1, map(\"firstValue\", userType(1))));\n flush();\n\n execute(\"ALTER TYPE \" + KEYSPACE + \".\" + ut1 + \" ADD b int\");\n execute(\"INSERT INTO %s (x, y) VALUES(2, {'secondValue':{a:2, b:2}})\");\n execute(\"INSERT INTO %s (x, y) VALUES(3, {'thirdValue':{a:3}})\");\n execute(\"INSERT INTO %s (x, y) VALUES(4, {'fourthValue':{b:4}})\");\n\n assertRows(execute(\"SELECT * FROM %s\"),\n row(1, map(\"firstValue\", userType(1))),\n row(2, map(\"secondValue\", userType(2, 2))),\n row(3, map(\"thirdValue\", userType(3, null))),\n row(4, map(\"fourthValue\", userType(null, 4))));\n\n flush();\n\n assertRows(execute(\"SELECT * FROM %s\"),\n row(1, map(\"firstValue\", userType(1))),\n row(2, map(\"secondValue\", userType(2, 2))),\n row(3, map(\"thirdValue\", userType(3, null))),\n row(4, map(\"fourthValue\", userType(null, 4))));\n }\n }",
"public static void main(String[] args) {\n\t\t\n\t\tMap<Integer,Employee> map = new HashMap<Integer, Employee>();\n\t\tMap<String, Employee> hashMap = new HashMap();\n\t\tMap<Employee, Integer> hashMap1 = new HashMap();\n\t\tfor (int i =1; i<=10; i++){\n\t\t\t\n\t\t\tmap.put(i, new Employee(i+3, \"Manish\"+(i+3)));\n\t\t}\n\t\tSystem.out.println(map);\n\t\t\n\t\tEmployee emp1 = new Employee(4, \"Manish3\");\n\t\t//Use of Contains\n\t\tSystem.out.println(map.containsValue(emp1)); \n\t\t\n\t\t//Key Set\n\t\tSystem.out.println(map.keySet());\n\t\t\n\t\t//retrieve entry set\n\t\tSystem.out.println(map.entrySet());\n\t\t\n\t\t//map.forEach(action);; TO DO- need to understand this method\n\t\t\n\n\t\t//Returns in sorted order when Key is natural (permitives or String or Enum)\n\t\thashMap.put(\"A\", new Employee(1, \"Manish\"));\n\t\thashMap.put(\"C\", new Employee(3, \"Gaurav\"));\n\t\thashMap.put(\"B\", new Employee(2, \"Vinay\"));\n\t\tSystem.out.println(hashMap);\n\t\t\n\t\t//maintains insertion order when key is Object type(dont have any natural order)\n\t\thashMap1.put(new Employee(1, \"Manish\"),1);\n\t\thashMap1.put(new Employee(3, \"Gaurav\"),3);\n\t\thashMap1.put(new Employee(2, \"Vinay\"),2);\n\t\tSystem.out.println(hashMap1);\n\t\tHashMap<Long, String> masterRoomPoolMapping = new HashMap<Long, String>();\n\t\tmasterRoomPoolMapping.put(new Long(123), \"Manish\");\n\t\tmasterRoomPoolMapping.put(new Long(124), \"Manish\");\n\t\tmasterRoomPoolMapping.put(new Long(125), \"Manish\");\n\t\tSystem.out.println(\"***************************************************\");\n\t\tSet<Long> keySet = masterRoomPoolMapping.keySet();\n\t\tSet<Long> newKeySet = new HashSet<Long>();\n\t\tfor(Long key : keySet){\n\t\t\tnewKeySet.add(new Long(key));\n\t\t}\n\t\tSystem.out.println(\"newKeySet***************************************************\");\n\t\tif(newKeySet.contains(new Long(123)))\n\t\t\tnewKeySet.remove(new Long(123));\n\t\tfor(Long key : newKeySet){\n\t\t\tSystem.out.println(key);\n\t\t}\n\t\tSystem.out.println(\"keySet1***************************************************\");\n\t\tSet<Long> keySet1 = masterRoomPoolMapping.keySet();\n\t\tfor(Long key : keySet1){\n\t\t\tSystem.out.println(masterRoomPoolMapping.get(key));\n\t\t}\n\t\tSystem.out.println(\"***************************************************\");\n\t\tSystem.out.println(masterRoomPoolMapping);\n\t}",
"private static HashMap<String, String> initMapping()\n {\n HashMap<String, String> typeMapping = new HashMap<String, String>();\n\n typeMapping.put(\"boolean\", \"boolean\");\n typeMapping.put(\"float\", \"float\");\n typeMapping.put(\"double\", \"double\");\n typeMapping.put(\"byte\", \"byte\");\n typeMapping.put(\"unsignedByte\", \"short\");\n typeMapping.put(\"short\", \"short\");\n typeMapping.put(\"unsignedShort\", \"int\");\n typeMapping.put(\"int\", \"int\");\n typeMapping.put(\"integer\", \"java.math.BigDecimal\");\n typeMapping.put(\"positiveInteger\", \"java.math.BigInteger\");\n typeMapping.put(\"unsignedInt\", \"java.math.BigInteger\");\n typeMapping.put(\"long\", \"java.math.BigInteger\");\n typeMapping.put(\"unsignedLong\", \"java.math.BigDecimal\");\n typeMapping.put(\"decimal\", \"java.math.BigDecimal\");\n typeMapping.put(\"string\", \"String\");\n typeMapping.put(\"hexBinary\", \"byte[]\");\n typeMapping.put(\"base64Binary\", \"byte[]\");\n typeMapping.put(\"dateTime\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"time\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"date\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"gDay\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"gMonth\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"gMonthDay\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"gYear\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"gYearMonth\", \"javax.xml.datatype.XMLGregorianCalendar\");\n typeMapping.put(\"duration\", \"javax.xml.datatype.Duration\");\n typeMapping.put(\"NOTATION\", \"javax.xml.namespace.QName\");\n typeMapping.put(\"QName\", \"javax.xml.namespace.QName\");\n typeMapping.put(\"anyURI\", \"String\");\n typeMapping.put(\"Name\", \"String\");\n typeMapping.put(\"NCName\", \"String\");\n typeMapping.put(\"negativeInteger\", \"java.math.BigDecimal\");\n typeMapping.put(\"NMTOKEN\", \"String\");\n typeMapping.put(\"nonNegativeInteger\", \"java.math.BigDecimal\");\n typeMapping.put(\"nonPositiveInteger\", \"java.math.BigDecimal\");\n typeMapping.put(\"normalizedString\", \"String\");\n typeMapping.put(\"token\", \"String\");\n typeMapping.put(\"any\", \"Object\");\n\n return typeMapping;\n }",
"private Map<String,Map<String,List<String>>> buildDictionary(Document doc){\n\t\t\n\t\tElement root = doc.getDocumentElement();\n\t\t\n\t\t\n\t\tMap<String,Map<String,List<String>>> dictionary = new HashMap<String,Map<String,List<String>>>();\n\t\tthis.termSet = new TreeSet<String>();\n\t\t\n\t\tNodeList termList = doc.getElementsByTagName(\"term\");\n\t\tfor(int i = 0; i < termList.getLength(); i++){\n\t\t\tElement termElement = (Element) termList.item(i);\n\t\t\tElement nameElement = (Element) termElement.getElementsByTagName(\"name\").item(0);\n\t\t\tString name = nameElement.getTextContent();\n\t\t\tthis.termSet.add(name);\n\n\t\t\tMap<String,List<String>> synonymGroup = new HashMap<String,List<String>>();\n\t\t\tsynonymGroup.put(\"exact\", new ArrayList<String>());\n\t\t\tsynonymGroup.put(\"related\", new ArrayList<String>());\n\t\t\tsynonymGroup.put(\"broad\", new ArrayList<String>());\n\t\t\tsynonymGroup.put(\"narrow\", new ArrayList<String>());\n\t\t\t\n\t\t\tNodeList synonyms = termElement.getElementsByTagName(\"synonym\");\n\t\t\tfor(int j=0; j<synonyms.getLength(); j++){\n\t\t\t\tElement synonymElement = (Element) synonyms.item(j);\n\t\t\t\tString synonym = synonymElement.getTextContent();\n\t\t\t\tString scope = synonymElement.getAttribute(\"scope\");\n\t\t\t\t//System.out.println(scope);\n\t\t\t\tList<String> synonymList = (List<String>) synonymGroup.get(scope);\n\t\t\t\t\n\t\t\t\t//System.out.println(synonym);\n\t\t\t\t\n\t\t\t\tsynonymList.add(synonym);\n\t\t\t}\n\t\t\t\n\t\t\tdictionary.put(name,synonymGroup);\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\treturn dictionary;\n\t}",
"@SuppressWarnings(\"unchecked\")\n public Map<String, Object> toNestedMap() {\n Map<String, Object> map = new HashMap<>();\n for (ObjectLongCursor<String> counter : counters) {\n if (counter.key.contains(\".\")) {\n String[] parts = counter.key.split(\"\\\\.\");\n Map<String, Object> curr = map;\n for (int i = 0; i < parts.length; i++) {\n String part = parts[i];\n boolean isLast = i == parts.length - 1;\n if (isLast == false) {\n if (curr.containsKey(part) == false) {\n curr.put(part, new HashMap<String, Object>());\n curr = (Map<String, Object>) curr.get(part);\n } else {\n curr = (Map<String, Object>) curr.get(part);\n }\n } else {\n curr.put(part, counter.value);\n }\n }\n } else {\n map.put(counter.key, counter.value);\n }\n }\n\n return map;\n }",
"public void flatten () {\n String tags2 = tags.toString();\n tags.delete (0, tags.length());\n int e2 = 0;\n int s2 = indexOfNextWordStart (tags2, e2, slashToSeparate);\n while (s2 < tags2.length()) {\n e2 = indexOfNextSeparator (tags2, s2, true, true, slashToSeparate);\n merge (tags2.substring (s2, e2));\n s2 = indexOfNextWordStart (tags2, e2, slashToSeparate);\n }\n }",
"private void treeMapDemo() {\n TreeMap intMap = new TreeMap();\n TreeMap abcMap = new TreeMap();\n \n // Add values to tMap\n intMap.put(1, \"Jonathan\");\n intMap.put(3, \"Kevin\");\n intMap.put(4, \"Craig\");\n \n abcMap.put(\"Name\", \"Jonathan\");\n abcMap.put(\"Age\", 26);\n abcMap.put(\"Hometown\", \"Denham Springs\");\n \n System.out.println(intMap.toString());\n \n System.out.println(abcMap.toString());\n \n // Add new value to fill the 2 position\n intMap.put(2, \"Jasmine\");\n \n // Add new value to abcMap\n abcMap.put(\"Acrobatic Skill\", \"Bad\");\n abcMap.put(\"Zoology Skill\", \"Decent\");\n \n System.out.println(intMap.toString());\n \n System.out.println(abcMap.toString());\n \n }",
"private void populatePrefixMappings(OntModel model) {\n\t\tMap<String, String> pm = model.getNsPrefixMap();\n\t\tneededPrefixesForQueries = new String[pm.keySet().size()];\n\t\tint i=0;\n\t\tfor(String key:pm.keySet())\n\t\t{\n\t\t\tneededPrefixesForQueries[i] = key + \": <\" + pm.get(key) + \">\";\n\t\t\ti++;\n\t\t}\n\t}",
"@SuppressWarnings(\"rawtypes\")\n\tpublic Map<String, String> parseKeyAndValueToMap(JSONObject sourceObj) {\n\t\tif (sourceObj == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tMap<String, String> keyAndValueMap = new HashMap<String, String>();\n\t\tfor (Iterator iter = sourceObj.keys(); iter.hasNext();) {\n\t\t\tString key = (String) iter.next();\n\t\t\tputMapNotEmptyKey(keyAndValueMap, key,\n\t\t\t\t\tgetString(sourceObj, key, \"\"));\n\n\t\t}\n\t\treturn keyAndValueMap;\n\t}",
"@Override\n\tpublic JsonElement serialize(Map<Integer,Location> src, Type typeOfSrc, JsonSerializationContext context) {\n\t\tJsonObject locations = new JsonObject();\n\t\t//locations.add(property, value);\n\t\tJsonArray locationArray = new JsonArray();\n\t\tfor (Entry<Integer,Location> e: src.entrySet()) {\n\t\t\tJsonObject location = new JsonObject();\n\t\t\t\n\t\t\tlocation.addProperty(\"uniqueId\", e.getValue().getUniqueId());\n\t\t\tlocation.addProperty(\"locationId\", e.getValue().getLocationId());\n\t\t\tlocation.addProperty(\"locationName\", e.getValue().getLocationName());\n\t\t\tlocation.addProperty(\"description\", e.getValue().getDescription());\n\t\t\tlocation.addProperty(\"latitude\", e.getValue().getLatitude());\n\t\t\tlocation.addProperty(\"longitude\", e.getValue().getLongitude());\n\t\t\tlocation.addProperty(\"altitude\", e.getValue().getAltitude());\n\t\t\tlocation.addProperty(\"area\", e.getValue().getArea());\n\t\t\t\n\t\t\tJsonArray jsonArray = new JsonArray();\n\t\t\tfor (Modifier a : e.getValue().getEnvironmentModifiers()) {\n\t\t\t\tJsonObject listElement = new JsonObject();\n\t\t\t\tString modClassName = a.getClass().getName();\n\t\t\t\t//\t\t\tSystem.out.println(className + \":\" + a.toString());\n\t\t\t\tlistElement.addProperty(CLASSNAME, modClassName);\n\t\t\t\tJsonElement elem = context.serialize(a);\n\t\t\t\tlistElement.add(INSTANCE, elem);\n\t\t\t\tjsonArray.add(listElement);\n\t\t\t}\n\t\t\tlocation.add(\"environmentModifiers\", jsonArray);\n\t\t\tlocationArray.add(location);\n\t\t\t//JsonElement elem = context.serialize(e.getValue().getLocations(), typeOfSrc);\n\t\t\t//retValue.add(\"locations\", elem);\n\t\t\t//.getLocationName());\n\t\t\t//\n\t\t\t//retValueArray.add(retValue);\n\t\t}\n\t\tlocations.add(\"locations\", locationArray);\n//\t\tfor (int j = retValueArray.size() - 1 ; j>1; j--) {\n//\t\t\tretValueArray.get(j-1).add(\"location\", retValueArray.get(j).getAsJsonObject());\n//\t\t\tSystem.out.format(\"added %d to %d\\n\", j, j-1 );\n//\t\t}\n\t\t//return retValueArray.get(1).getAsJsonObject();\n\t\t\n\t\treturn locations;\n\t}",
"public void parseHashMapEntry(JsonObject jsonObject, Entry<String, Object> entry) {\n if (((String) entry.getKey()).equals(\"parent\")) {\n jsonObject.add((String) entry.getKey(), parseJsonObject(entry.getValue()));\n } else if (((String) entry.getKey()).equals(BoxItem.FIELD_SHARED_LINK)) {\n if (entry.getValue() == null) {\n jsonObject.add((String) entry.getKey(), (String) null);\n } else {\n jsonObject.add((String) entry.getKey(), parseJsonObject(entry.getValue()));\n }\n } else {\n super.parseHashMapEntry(jsonObject, entry);\n }\n }",
"public static void main(String[] args) {\n\t\tMap<String,Double> items = new HashMap<>();\r\n\t\t\r\n\t\titems.put(\"Toaster\",350.00);\t\t//inits elements into map [STRING == KEY; DOUBLE == VALUE]\r\n\t\titems.put(\"Dongle\", 5.99);\r\n\t\titems.put(\"Sham Wow\", 19.99);\r\n\t\titems.put(\"Flex Seal\",19.99);\r\n\t\t\r\n\t\tSet<String> setOKeys = items.keySet();\r\n\t\tint count = 0;\r\n\t\tfor(String key : items.keySet()){\r\n\t\t\tSystem.out.print(++count + \") \" + key + \": $\" /*+ items.get(key)USED IN NORMAL FORMAT; NEEDED TO UPDATE FOR 2 DECI POINTS see below*/);\r\n\t\t\tSystem.out.printf(\"%.2f\\n\", items.get(key));\t//printf; decimal format to help\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(items.containsKey(\"Sham Wow\"));\r\n\t\tSystem.out.println(items.containsValue(19.99));\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t//ANIMAL BOOK HASH MAP EXAMPLE\r\n\t\tMap<String, Integer> ani = new HashMap<>();\r\n\t\tani.put(\"Toucan\", 40);\r\n\t\tani.put(\"Lizard\", 7);\t\t\t//Stored by Integer value\r\n\t\tani.put(\"Wallaby\", 18);\r\n\t\t\r\n\t\tSystem.out.println(ani.get(\"Lizard\"));\r\n\t\t\r\n\t\tani.remove(\"Toucan\");\r\n\t\t\r\n\t\tSystem.out.println(ani); //toString Method is in the collections class automatically\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t//TREE MAP\r\n\t\tSet<Character> letters = new TreeSet<>(); //LINKEDHASHSET will be unordered\r\n\t\tletters.add('b');\r\n\t\tletters.add('c');\r\n\t\tletters.add('a');\r\n\t\tletters.add('c');\t\t//duplicate REMOVED automatically\r\n\t\t\r\n\t\tSystem.out.println(letters);\r\n\t\t\r\n\t\tletters.remove('b');\r\n\t\tSystem.out.println(letters);\r\n\t\t\r\n\t\tSystem.out.println(letters.contains('f'));\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tLinkedList<String> food = new LinkedList<>(); //can do list-linked list, linked list-linked list\r\n\t\t\r\n\t\tfood.add(\"Sauerkraut\");\r\n\t\tfood.add(\"Carrots\");\r\n\t\tfood.add(\"Mud\");\r\n\t\tfood.add(1, \"Margarine\"); //at indx 1; Margarine\r\n\t\t\r\n\t\tCollections.sort(food); //method in collections class which sorts\r\n\t\tfood.toString();\r\n\t\t//food.clear(); clears list\r\n\t\t\r\n\t\tString marg = food.get(3);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tQueue<String> cities = new PriorityQueue<>();\r\n\t\t\r\n\t\tcities.offer(\"Detroit\");\t\t//QUEUES 'OFFER'\r\n\t\tcities.offer(\"Los Angeles\");\r\n\t\tcities.offer(\"Vienna\");\r\n\t\tcities.offer(\"Windsor\");\r\n\t\t\r\n\t\tSystem.out.println(cities.peek()); //insertion order\r\n\t\tSystem.out.println(cities);\r\n\t\t\r\n\t\tStack<String> dishes = new Stack<>();\r\n\t\t\r\n\t\tdishes.add(\"Cereal bowl\");\r\n\t\tdishes.add(\"Lunch tray\");\r\n\t\tdishes.add(\"Pots and pans\");\r\n\t\tdishes.add(\"Dinner fork\");\r\n\t\t\r\n\t\tSystem.out.println(dishes.peek());\r\n\t\t\r\n\t\tdishes.pop();\r\n\t\tdishes.pop();\t\t//removing the oldest; fifo \r\n\t\t\r\n\t\tSystem.out.println(dishes);\r\n\t}",
"public static Map<String, String> extractContext(Context context, String fullContextName, boolean useShortNames, boolean addTypeToValue){\r\n\t\tMap<String, String> result = new HashMap<String, String>();\r\n\t\ttry {\r\n\t\t\tNamingEnumeration<Binding> bindings = context.listBindings(\"\");\r\n\t\t\twhile (bindings.hasMore()) {\r\n\t\t\t\tBinding binding = bindings.next();\r\n\t\t\t\tString shortName = binding.getName();\r\n\t\t\t\tString fullName = makeFullJNDIName(fullContextName, shortName);\r\n\t\t\t\tObject boundObject = binding.getObject();\r\n\t\t\t\tif (boundObject != null) {\r\n\t\t\t\t\tif (boundObject instanceof Context) {\r\n\t\t\t\t\t\tresult.putAll(extractContext((Context) boundObject, fullName, useShortNames, addTypeToValue) );\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tString value = boundObject.toString();\r\n\t\t\t\t\t\tif (addTypeToValue) {\r\n\t\t\t\t\t\t\tString className = boundObject.getClass().getName();\r\n\t\t\t\t\t\t\tif (!baseTypes.contains(className))\tvalue = \"[\" + className + \"] \" + value; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tresult.put(fullName, value);\r\n\t\t\t\t\t\t// Make the entry findable by both the full and the short name\r\n\t\t\t\t\t\t // This runs the real danger of overwriting previous values, so it's off by default\r\n\t\t\t\t\t\tif (useShortNames) result.put(shortName, value);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (NamingException e){\r\n\t\t\t// This is be expected behavior for tomcat's jndi implementation, but it's not clear why\r\n\t\t\t// What about other jndi implementation?\r\n\t\t\tif (!\"java:/comp\".equals(fullContextName)) { \r\n\t\t\t\tlogger.error(\"[ERROR] unable to get bindings for {}\",fullContextName);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"HashMap<String,Object> processQueryResultRow(Map<String,Object> rawRow, String collectionName) {\n HashMap<String,Object> resultRow = new HashMap<>();\n for (String key: rawRow.keySet()) {\n Object value = rawRow.get(key);\n if (collectionName != null)\n value = formatFieldValue(collectionName,key,value);\n if (value != null) resultRow.put(key,value);\n }\n return resultRow;\n }",
"private static List<Map<String, Object>> parseRelsType(RelsType value) {\n\t\tList<Map<String, Object>> mapList = new ArrayList<>();\n\n\t\tfor (RelType rel : value.getRel()) {\n\t\t\tMap<String, Object> relMap = new HashMap<String, Object>();\n\t\t\tString inferenceprovenance = rel.getInferenceprovenance();\n\t\t\tString provenanceaction = rel.getProvenanceaction();\n\t\t\tString trust = rel.getTrust();\n\t\t\t// System.out.println(\"-----------------------------------------------\");\n\t\t\t// System.out.println(\"\\tREL:\");\n\t\t\t// System.out.println(\"\\tinferenceprovenance: \" + inferenceprovenance);\n\t\t\t// System.out.println(\"\\tprovenanceaction: \" + provenanceaction);\n\t\t\t// System.out.println(\"\\ttrust: \" + trust);\n\n\t\t\trelMap.put(\"inferenceprovenance\", inferenceprovenance);\n\t\t\trelMap.put(\"provenanceaction\", provenanceaction);\n\t\t\trelMap.put(\"trust\", trust);\n\n\t\t\t// List<Map<String, Object>> listElement = new ArrayList<>();\n\n\t\t\tfor (JAXBElement<?> relElement : rel.getToOrTitleOrWebsiteurl()) {\n\t\t\t\t// decide what to todo\n\t\t\t\t// System.out.println(\"\\t\\tname: \" + relElement.getName().toString() + \" value:\n\t\t\t\t// \"\n\t\t\t\t// + relElement.getValue().toString());\n\t\t\t\t// System.out.println(\"\\t\\tname: \" + relElement.getName().toString());\n\t\t\t\tString NAME = relElement.getName().toString();\n\n\t\t\t\tif (relElement.getValue() instanceof RelToType) {\n\t\t\t\t\tRelToType r = (RelToType) relElement.getValue();\n\t\t\t\t\tMap<String, Object> m = parseRelToType(r);\n\t\t\t\t\t// Map<String, Object> res = new HashMap<>();\n\t\t\t\t\trelMap.put(NAME, m);\n\t\t\t\t\t// listElement.add(res);\n\n\t\t\t\t} else if (relElement.getValue() instanceof OptionalClassedSchemedElement) {\n\t\t\t\t\tOptionalClassedSchemedElement val = (OptionalClassedSchemedElement) relElement.getValue();\n\t\t\t\t\tMap<String, Object> o = parseOptionalClassedSchemedElement(val);\n\t\t\t\t\t// Map<String, Object> res = new HashMap<>();\n\t\t\t\t\trelMap.put(NAME, o);\n\t\t\t\t\t// listElement.add(res);\n\n\t\t\t\t} else if (relElement.getValue() instanceof FundingFlatType) {\n\t\t\t\t\tFundingFlatType fund = (FundingFlatType) relElement.getValue();\n\t\t\t\t\tMap<String, Object> o = parseFundingFlatType(fund);\n\t\t\t\t\t// Map<String, Object> res = new HashMap<>();\n\t\t\t\t\trelMap.put(NAME, o);\n\t\t\t\t\t// listElement.add(res);\n\n\t\t\t\t} else if (relElement.getValue() instanceof String) {\n\t\t\t\t\tString val = (String) relElement.getValue();\n\t\t\t\t\t// Map<String, Object> res = new HashMap<>();\n\t\t\t\t\trelMap.put(NAME, val);\n\n\t\t\t\t} else if (relElement.getValue() instanceof WebresourceType) {\n\t\t\t\t\t// String val = (String) relElement.getValue();\n\n\t\t\t\t\tWebresourceType web = (WebresourceType) relElement.getValue();\n\t\t\t\t\tString url = web.getUrl();\n\t\t\t\t\t// Map<String, Object> res = new HashMap<>();\n\t\t\t\t\trelMap.put(NAME, url);\n\n\t\t\t\t} else if (relElement.getValue() instanceof ClassedSchemedElement) {\n\t\t\t\t\tClassedSchemedElement cl = (ClassedSchemedElement) relElement.getValue();\n\t\t\t\t\tMap<String, Object> o = parseClassedSchemedElement(cl);\n\t\t\t\t\t// Map<String, Object> res = new HashMap<>();\n\t\t\t\t\trelMap.put(NAME, o);\n\t\t\t\t\t// listElement.add(res);\n\n\t\t\t\t} else {\n\t\t\t\t\t// Map<String, Object> res = new HashMap<>();\n\t\t\t\t\trelMap.put(NAME, null);\n\t\t\t\t\t// listElement.add(res);\n\n\t\t\t\t}\n\n\t\t\t\t// relMap.put(\"ToOrTitleOrWebsiteurl\", listElement);\n\n\t\t\t\t// System.out.println(\"\\t\" + relElement.getValue().toString());\n\t\t\t}\n\t\t\tmapList.add(relMap);\n\n\t\t}\n\t\treturn mapList;\n\t}",
"@Override\r\n public NavigableMap<K, V> subMap(final K fromKey, final boolean inclusive) {\n return null;\r\n }",
"public <S> S recallByHierarchy(String key) {\n if (key.contains(\".\")) {\n String[] paths = key.split(\"\\\\.\");\n String objectKey = paths[0];\n Object object = recall(objectKey);\n if (object != null && !object.getClass().isPrimitive()\n && !(object instanceof Map || object instanceof String || object instanceof Number)) {\n for (int i = 1; i < paths.length; i++) {\n try {\n object = FieldUtils.readField(object, paths[i], true);\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n }\n return (S) object;\n }\n }\n return null;\n }",
"private static Map<String, List<String>> getCustomStringStructure(@NotNull String s) {\n String[] arr = s.split(\" \");\n // the storage\n Map<String, List<String>> map = new TreeMap<>();\n // put the first element in the storage\n List<String> l = new ArrayList<>();\n l.add(arr[0]);\n map.put(arr[0].substring(0, 1), l);\n\n for (int i = 1; i < arr.length; i++) {\n String sub = arr[i].substring(0, 1);\n // if map contains key put String arr[i] in the List\n if (map.containsKey(sub)) {\n map.get(sub).add(arr[i]);\n } else {\n // if not put first letter as a key and arr[i] as a value in the map\n List<String> list = new ArrayList<>();\n list.add(arr[i]);\n map.put(sub, list);\n }\n }\n\n // sort by size, by string's length and alphabetically\n Map<String, List<String>> collect = map.entrySet()\n .stream()\n .filter(k -> k.getValue().size() > 1)\n .collect(Collectors.toMap(\n Map.Entry::getKey,\n e -> e.getValue().stream().sorted((o1, o2) -> {\n if (o2.length() != o1.length()) {\n return o2.length() - o1.length();\n } else {\n return o1.compareTo(o2);\n }\n })\n .collect(Collectors.toList())\n ));\n\n // return TreeMap to sort keys\n return new TreeMap<>(collect);\n }",
"public static HashMap<String, HashMap<String, TemplateString>> expandTemplate(Template template, String baseFormat) {\r\n\t\t// This map is a different format than the output map despite same dimensions - the key is the template format\r\n\t\tHashMap<String, ArrayList<TemplateString>> rawExpandedData = new HashMap<>();\r\n\t\tfor(TemplateFormat format : template.values()) {\r\n\t\t\trawExpandedData.put(format.formatName, format.baseProgression.getPossibilities());\r\n\t\t}\r\n\t\t\r\n\t\t// Find matching formats\r\n\t\tArrayList<TemplateString> baseStrings = rawExpandedData.get(baseFormat);\r\n\t\tif(baseStrings == null) {\r\n\t\t\t// If base format not found, return an empty result\r\n\t\t\treturn new HashMap<String, HashMap<String, TemplateString>>();\r\n\t\t}\r\n\t\t\r\n\t\tHashMap<String, HashMap<String, TemplateString>> result = new HashMap<>();\r\n\t\tfor(TemplateString baseString : baseStrings) {\r\n\t\t\t// Initialize array \r\n\t\t\tHashMap<String, TemplateString> stringList = new HashMap<>();\r\n\t\t\tstringList.put(baseFormat, baseString);\r\n\t\t\t\r\n\t\t\t// Check other formats to find the possibility with the most variable matches\r\n\t\t\touter:\r\n\t\t\tfor(Entry<String, ArrayList<TemplateString>> entry : rawExpandedData.entrySet()) {\r\n\t\t\t\tif(entry.getKey().equals(baseFormat)) continue; // Skip the base format\r\n\t\t\t\t\r\n\t\t\t\t// Find the string with the most matches to the base string \r\n\t\t\t\tint maxMatches = -1;\r\n\t\t\t\tTemplateString currentMatch = null;\r\n\t\t\t\tfor(TemplateString otherString : entry.getValue()) {\r\n\t\t\t\t\tint matches = 0;\r\n\t\t\t\t\tfor(VarData var : otherString.variables.values()) {\r\n\t\t\t\t\t\tVarData baseVar = baseString.variables.get(var.id);\r\n\t\t\t\t\t\tif(baseVar == null) continue; // If the variable simply doesn't exist in the base string do nothing\r\n\t\t\t\t\t\tif(baseVar.choice != var.choice) {\r\n\t\t\t\t\t\t\tcontinue outer; // Variable is mismatched so skip\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tmatches++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(matches > maxMatches) { // Check for most matches\r\n\t\t\t\t\t\tcurrentMatch = otherString;\r\n\t\t\t\t\t\tmaxMatches = matches;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Add any found string (there should be one) to the list\r\n\t\t\t\tif(currentMatch != null) {\r\n\t\t\t\t\tstringList.put(entry.getKey(), currentMatch);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresult.put(baseString.string, stringList);\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}",
"public static void main(String[] args) {\n\t\tHashMap<String,String> capitalMap=new HashMap<String,String>();//creating hashmap\n\t\tcapitalMap.put(\"India\", \"New Delhi\");\n\t\tcapitalMap.put(\"USA\", \"WashingtonDC\");//adding values into it\n\t\tcapitalMap.put(\"UK\", \"London\");\n\t\tcapitalMap.put(\"Australlia\", \"Canberra\");\n\t\tcapitalMap.put(\"UK\", \"London111\");\n\t\tcapitalMap.put(\"Africa\", null);\n\t\tcapitalMap.put(\"Odisa\", null);\n\n\n\t\t//getting the values from it\n\t\tSystem.out.println(capitalMap.get(\"Australlia\"));\n\t\tSystem.out.println(capitalMap.get(\"Germany\"));// if value is not present then it will throw null\n\t\tSystem.out.println(capitalMap.get(\"UK\"));// always take the lates value\n\t\t\n\t\t//we can store n number of null valuesbut only one null key\n\t\tcapitalMap.put(null, \"LA\");\n\t\tcapitalMap.put(null, \"SFO\");// can have multiple null values but one null key\n\t\tSystem.out.println(capitalMap.get(null));\n\t\tSystem.out.println(capitalMap.get(\"Africa\"));\n\t\tSystem.out.println(capitalMap.get(\"Odisa\"));\n\t\t\n\t\t//How to Traverse through Hashmap-USing Iterator\n\t\tIterator<String> it=capitalMap.keySet().iterator();// applying iterator on keyset or value set\n\t\t\n\t\twhile(it.hasNext()) {\n\t\tString key=\tit.next();\n\t\tString value=capitalMap.get(key);\n\t\tSystem.out.println(\"Key = \"+key+\" \"+\"value= \"+value );\n\t\t}\n\t\t\n\t\tSystem.out.println(\"****************************************\");\n\t\t//entry set iterator\n\t\tIterator<Entry<String, String>> it1=capitalMap.entrySet().iterator();\n\t\t\n\t\twhile(it1.hasNext()) {\n\t\t\tEntry<String, String> entry=it1.next();\n\t\t\tSystem.out.println(\"Key is \"+entry.getKey()+ \" Value is \"+entry.getValue());\n\t\t}\n\t\t\n\t\tSystem.out.println(\"****************************************\");\n\t\t\n\t\t//iterator with for each and lamda java 8\n\t\tcapitalMap.forEach((k,v)->System.out.println(\"key \"+k+\" value\"+v));\n\t\t\n\t\t\n\t\t\n\n\n\t\t\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}",
"@Override\n\tpublic void printFilteredMap() {\n\t\tthis.result.forEach((k, v )-> v.forEach((ke,ve) -> ve.forEach((s) -> System.out.println(k + \" : \"+ ke + \" : \"+ s))));\n\n\t}",
"private static <T> void findAndAddSelected(final Class<T> type, final List<Entry<Object[], T>> results,\r\n\t\t\tfinal List<Object> prefix, final Object value, final Object[] segments, final int index) {\r\n\t\tif (value == null) {\r\n\t\t\treturn;\r\n\t\t} else if (index >= segments.length) {\r\n\t\t\t// Found a potential match\r\n\t\t\tif (type.isInstance(value)) {\r\n\t\t\t\tresults.add(SimpleEntry.valueOf(prefix.toArray(), type.cast(value)));\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tfinal Object segment = segments[index];\r\n\t\tfinal int prefixLength = prefix.size();\r\n\t\tif (segment == PropertyPath.ANY_KEY) {\r\n\t\t\t// Loop all elements in map\r\n\t\t\tif (value instanceof Map) {\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tfinal Map<String, Object> map = (Map<String, Object>)value;\r\n\t\t\t\tfor (final Entry<String, Object> entry: map.entrySet()) {\r\n\t\t\t\t\tprefix.add(entry.getKey());\r\n\t\t\t\t\tfindAndAddSelected(type, results, prefix, entry.getValue(), segments, index + 1);\r\n\t\t\t\t\twhile (prefix.size() > prefixLength) {\r\n\t\t\t\t\t\tprefix.remove(prefixLength);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (segment == PropertyPath.ANY_INDEX) {\r\n\t\t\t// Loop all elements in list\r\n\t\t\tif (value instanceof List) {\r\n\t\t\t\tint listIndex = 0;\r\n\t\t\t\tfor (final Object next:(List<?>)value) {\r\n\t\t\t\t\tprefix.add(listIndex);\r\n\t\t\t\t\tfindAndAddSelected(type, results, prefix, next, segments, index + 1);\r\n\t\t\t\t\twhile (prefix.size() > prefixLength) {\r\n\t\t\t\t\t\tprefix.remove(prefixLength);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlistIndex++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (segment instanceof Integer) {\r\n\t\t\t// Match index in list\r\n\t\t\tfinal int targetIndex = (Integer)segment;\r\n\t\t\tif (value instanceof List && targetIndex < ((List<?>)value).size()) {\r\n\t\t\t\tfinal Object next = ((List<?>)value).get(targetIndex);\r\n\t\t\t\tprefix.add(targetIndex);\r\n\t\t\t\tfindAndAddSelected(type, results, prefix, next, segments, index + 1);\r\n\t\t\t\twhile (prefix.size() > prefixLength) {\r\n\t\t\t\t\tprefix.remove(prefixLength);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else { // String\r\n\t\t\t// Match named key in map\r\n\t\t\tfinal String targetKey = (String)segment;\r\n\t\t\tif (value instanceof Map) {\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tfinal Map<String, Object> map = (Map<String, Object>)value;\r\n\t\t\t\tfinal Object next = map.get(targetKey);\r\n\t\t\t\t\r\n\t\t\t\tprefix.add(targetKey);\r\n\t\t\t\tfindAndAddSelected(type, results, prefix, next, segments, index + 1);\r\n\t\t\t\twhile (prefix.size() > prefixLength) {\r\n\t\t\t\t\tprefix.remove(prefixLength);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void flatten()\n\t{\n\t}",
"public static void main(String[] args) {\n Map<String, Set<Integer>> ms = new HashMap<>(); \n Set<Integer> s1 = new HashSet<>(Arrays.asList(1,2,3));\n Set<Integer> s2 = new HashSet<>(Arrays.asList(4,5,6));\n Set<Integer> s3 = new HashSet<>(Arrays.asList(7,8,9));\n ms.put(\"one\", s1);\n ms.put(\"two\", s2);\n ms.put(\"three\", s3);\n System.out.println(ms); \n // ch07.collections.Ch0706InterfacesVsConcrete$1\n // {one=[1, 2, 3], two=[4, 5, 6], three=[7, 8, 9]}\n\n // this is how LinkedHashMap<Integer,Tuple2<String,LinkedHashMap<Double,String>>>\n // can be initially initialized\n LinkedHashMap<Integer,Tuple2<String,LinkedHashMap<Double,String>>> toc =\n new LinkedHashMap<>();\n System.out.println(toc); // just using toc to get rid of eclipse warning about not using it\n \n \n\n\n\n }",
"private void prepareUserFieldMapping(JsonObject jsonObj) throws AutomicException {\n Set<Entry<String, JsonElement>> entrySet = jsonObj.entrySet();\n if (userInputFields == null) {\n resultFields = new ArrayList<String>(entrySet.size());\n List<String> excludeHeaders = getExcludedFields();\n for (Map.Entry<String, JsonElement> entry : entrySet) {\n String key = entry.getKey();\n JsonElement value = jsonObj.get(key);\n if (!excludeHeaders.contains(key)) {\n if (value.isJsonPrimitive()) {\n resultFields.add(key);\n } else if (value.isJsonObject()) {\n JsonObject jObj = (JsonObject) value;\n if (jObj.has(\"_refObjectName\")) {\n resultFields.add(key);\n }\n }\n }\n }\n userInputFields = resultFields;\n } else {\n resultFields = new ArrayList<String>();\n Map<String, String> tempMap = new HashMap<String, String>(entrySet.size());\n for (Map.Entry<String, JsonElement> entry : entrySet) {\n String key = entry.getKey();\n tempMap.put(key.toLowerCase(), key);\n }\n StringBuilder invalidFields = new StringBuilder();\n for (String userInput : userInputFields) {\n String resultKey = tempMap.get(userInput.toLowerCase());\n if (resultKey != null) {\n resultFields.add(resultKey);\n } else {\n invalidFields.append(userInput).append(\" \");\n }\n }\n if (invalidFields.length() != 0) {\n throw new AutomicException(\"Invalid export fields have been specified \" + invalidFields.toString());\n }\n }\n }",
"private void wordBreakRecur(String word, String result) {\n\t\tint size = word.length();\n\n\t\tfor (int i = 1; i <= size; i++) {\n\t\t\tString prefix = word.substring(0, i);\n\n\t\t\tif (dictionaryContains(prefix)) {\n\t\t\t\tif (i == size) {\n\t\t\t\t\tresult += prefix;\n\t\t\t\t\tSystem.out.println(result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twordBreakRecur(word.substring(i), result + prefix + \" \");\n\t\t\t}\n\t\t}\n\t}",
"private void count(Entry curr)\n {\n \t//Increase Prefix count if any word is found.\n \tif (curr.EndOfWord == true)\n \t\tprefixCnt += 1;\n \t\n \tfor (HashMap.Entry<Character, Entry> entry : curr.child.entrySet())\n \t{\n \t\tcount(entry.getValue());\n \t}\n }",
"public void toMap(HashMap<String, String> map, String prefix) {\n this.setParamSimple(map, prefix + \"PropertyKey\", this.PropertyKey);\n this.setParamSimple(map, prefix + \"PropertyValue\", this.PropertyValue);\n this.setParamSimple(map, prefix + \"Logic\", this.Logic);\n this.setParamSimple(map, prefix + \"OperateLogic\", this.OperateLogic);\n\n }",
"public void toMap(HashMap<String, String> map, String prefix) {\n this.setParamSimple(map, prefix + \"GroupKey\", this.GroupKey);\n this.setParamSimple(map, prefix + \"GroupValue\", this.GroupValue);\n this.setParamSimple(map, prefix + \"TotalCost\", this.TotalCost);\n this.setParamSimple(map, prefix + \"RealTotalCost\", this.RealTotalCost);\n this.setParamSimple(map, prefix + \"CashPayAmount\", this.CashPayAmount);\n this.setParamSimple(map, prefix + \"IncentivePayAmount\", this.IncentivePayAmount);\n this.setParamSimple(map, prefix + \"VoucherPayAmount\", this.VoucherPayAmount);\n this.setParamSimple(map, prefix + \"TransferPayAmount\", this.TransferPayAmount);\n this.setParamArrayObj(map, prefix + \"Business.\", this.Business);\n\n }",
"private Map<String, Set<String>> flattenDependencyTree() {\n final Map<String, Set<String>> newDeps = new HashMap<String, Set<String>>();\n for (Iterator<String> it = dependencies.keySet().iterator(); it.hasNext();) {\n String targetName = it.next();\n Set<String> flattenDeps = new HashSet<String>();\n flattenDependencyTree(targetName, new Stack<String>(), flattenDeps);\n newDeps.put(targetName, flattenDeps);\n }\n return newDeps;\n }",
"@Nullable\n @SuppressWarnings(\"unchecked\")\n protected Map createMap(MappingContext context, Object value) {\n if (value instanceof Map<?, ?>) {\n if (context.getGenericTypeInfoOrFail(0).getSafeToWriteClass() != String.class) {\n throw new ConfigMeMapperException(context, \"The key type of maps may only be of String type\");\n }\n TypeInformation mapValueType = context.getGenericTypeInfoOrFail(1);\n\n Map<String, ?> entries = (Map<String, ?>) value;\n Map result = createMapMatchingType(context);\n for (Map.Entry<String, ?> entry : entries.entrySet()) {\n Object mappedValue = convertValueForType(\n context.createChild(\"[k=\" + entry.getKey() + \"]\", mapValueType), entry.getValue());\n if (mappedValue == null) {\n context.registerError(\"Cannot map value for key \" + entry.getKey());\n } else {\n result.put(entry.getKey(), mappedValue);\n }\n }\n return result;\n }\n return null;\n }",
"public static void main(String[] args) {\n\t\tProduct proone=new Product();\r\n\t\tproone.setProdid(10001);\r\n\t\tproone.setProdname(\"lg\");\r\n\t\tproone.setProdprice(1181.11);\r\n\t\t\r\n\t\tProduct protwo=new Product();\r\n\t\tprotwo.setProdid(10008);\r\n\t\tprotwo.setProdname(\"lg\");\r\n\t\tprotwo.setProdprice(1181.11);\r\n\t\t\r\n\t\tProduct prothree=new Product();\r\n\t\tprothree.setProdid(10011);\r\n\t\tprothree.setProdname(\"lg\");\r\n\t\tprothree.setProdprice(1181.11);\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n /* Map<Integer,String> myMap=new HashMap<>();\r\n myMap.put(1, \"abcd\");\r\n myMap.put(2,\"life\");\r\n myMap.put(3,\"veena\");\r\n */\r\n\t\t Map<Integer,Product> myMap=new HashMap<>();\r\n\t myMap.put(1, protwo);\r\n\t myMap.put(3,prothree);\r\n System.out.println(myMap);\r\n System.out.println(myMap.keySet());//give all keys\r\n System.out.println(myMap.get(2));\r\n System.out.println(myMap.values());//all values\r\n System.out.println(\"____________________for loop_=====================\");\r\n \r\n for(Integer keys:myMap.keySet())\r\n {\r\n \t System.out.println(\"Keys are:\"+keys+\"Values \"+myMap.get(keys));\r\n }\r\n for(Integer keys:myMap.keySet())\r\n {\r\n \t System.out.println(myMap.get(keys).getProdid());\r\n \t System.out.println(myMap.get(keys).getProdname());\r\n \t System.out.println(myMap.get(keys).getProdprice());\r\n \t \r\n }\r\n System.out.println(\"____________________Iterator=====================\");\r\n \r\n // Iterator it=myMap.iterator(); error becoz map is not part of collection but list nd set are part of collection\r\n //convert to set wid help of keyset...keyset will only convert keys entryset will convert evrythng\r\n \r\n Set myData=myMap.entrySet();\r\n Iterator it=myData.iterator();\r\n \r\n while(it.hasNext())\r\n {\r\n \t System.out.println(it.next());\r\n }\r\n \r\n System.out.println(\"============================\");\r\n //Collections.sort(myMap);\r\n \r\n // Set<Product> trgtset=new HashSet<>(myMap.values());\r\n Collection<Product> mySet=myMap.values(); \r\n //Set<Product> sett=new TreeSet<>(mySet);\r\n List<Product> myList=new LinkedList<>(mySet);\r\n Collections.sort(myList);\r\n \r\n /* for(Product prod:myList)\r\n {\r\n \t System.out.println(prod.getProdid());\r\n \t System.out.println(prod.getProdname());\r\n \t System.out.println(prod.getProdprice());\r\n }\r\n\r\n */\r\n Iterator it1=myData.iterator();\r\n \r\n while(it1.hasNext())\r\n {\r\n \t System.out.println(it1.next());\r\n }\r\n Map mp=new HashMap<>();\r\n mp.put(null,null);\r\n mp.put(1, null);\r\n mp.put(2, null);\r\n mp.put(null,null);\r\n System.out.println(mp);\r\n //is same above snippet written with map mp=new HashTable<>() it will giv nullpointer exception\r\n \r\n\t}",
"@Override\n public List<String> keysWithPrefix(String prefix) {\n List<String> results = new ArrayList<>();\n Node x = get(root, prefix, 0);\n collect(x, new StringBuilder(prefix), results);\n return results;\n }",
"@Override\n @SuppressWarnings(\"unchecked\")\n public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) {\n AbstractMap<String, String> map = (AbstractMap<String, String>) source;\n map.forEach((key, value) -> {\n writer.startNode(key);\n writer.setValue(value);\n writer.endNode();\n });\n }",
"@Test\n\tpublic void test1() {\n\t\tMap<Long, String> map = new HashMap<Long, String>();\n\t\tmap.put(1L, \"1111111,1111111\");\n\t\tmap.put(2L, \"2222,2222\");\n\t\tString str = JSONObject.toJSONString(map);\n\t\tSystem.out.println(str);\n\t\tMap<Long,String> result = JSONObject.parseObject(str, new TypeReference<Map<Long,String>>(){});\n\t\tSystem.out.println(result);\n\t\tSystem.out.println(result.get(1L));\n\t}",
"public static final Map<String, Object> toFlatMap(Object object, String... ignoreProperties) {\n return toMap(object, new HashSet<Object>(), true, ignoreProperties);\n }",
"private LinkedHashMap<String, Type> scalarMappingODU() {\r\n\t\tLinkedHashMap<String, Type> scalarMapping = new LinkedHashMap<String, Type>();\r\n\t\tscalarMapping.put(DaoConstants.MAP_ODUID, StandardBasicTypes.LONG); // 0\r\n\t\tscalarMapping.put(DaoConstants.MAP_SITE_GROUP,\r\n\t\t\t\tStandardBasicTypes.STRING); // 1\r\n\t\tscalarMapping.put(DaoConstants.MAP_PARENT_CHILD,\r\n\t\t\t\tStandardBasicTypes.STRING); // 2\r\n\t\tscalarMapping.put(DaoConstants.MAP_NAME, StandardBasicTypes.STRING); // 3\r\n\t\tscalarMapping.put(DaoConstants.MAP_CENTRAL_ADDRESS,\r\n\t\t\t\tStandardBasicTypes.STRING); // 4\r\n\t\tscalarMapping.put(DaoConstants.MAP_PARENT_ID, StandardBasicTypes.LONG); // 5\r\n\t\tscalarMapping.put(DaoConstants.MAP_TYPE, StandardBasicTypes.STRING); // 6\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMAXLATITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 7\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMAXLONGITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 8\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMINLATITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 9\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMINLONGITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 10\r\n\t\tscalarMapping.put(DaoConstants.MAP_ODU_SVG_PATH,\r\n\t\t\t\tStandardBasicTypes.STRING); // 11\r\n\t\tscalarMapping.put(DaoConstants.MAP_SEVERITY, StandardBasicTypes.STRING); // 12\r\n\t\tscalarMapping.put(DaoConstants.MAP_SLINKADD, StandardBasicTypes.STRING); // 13\r\n\t\tscalarMapping.put(DaoConstants.MAP_ALARM_CODE,\r\n\t\t\t\tStandardBasicTypes.STRING); // 14\r\n\t\tscalarMapping.put(DaoConstants.MAP_C2, StandardBasicTypes.DOUBLE); // 15\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Outdoor\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Temp\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_1, StandardBasicTypes.LONG); // 16\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs_1\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_2, StandardBasicTypes.LONG); // 17\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs_2\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_3, StandardBasicTypes.LONG); // 18\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs_3\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_4, StandardBasicTypes.LONG); // 19\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// PAC\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_5, StandardBasicTypes.LONG); // 20\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// EngineWorkingHrs\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_6, StandardBasicTypes.LONG); // 21\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// NOT_IN_USE_EnginOilChange\r\n\t\tscalarMapping.put(DaoConstants.MAP_G44, StandardBasicTypes.STRING); // 22\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// GenerationPower\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGID, StandardBasicTypes.LONG); // 23\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGNAME, StandardBasicTypes.STRING); // 24\r\n\t\tscalarMapping.put(DaoConstants.MAP_VRFHRS1, StandardBasicTypes.DOUBLE); // 25\r\n\t\tscalarMapping.put(DaoConstants.MAP_VRFHRS2, StandardBasicTypes.DOUBLE); // 26\r\n\t\tscalarMapping.put(DaoConstants.MAP_VRFHRS3, StandardBasicTypes.DOUBLE); // 27\r\n\t\tscalarMapping.put(DaoConstants.MAP_PACHRS, StandardBasicTypes.DOUBLE); // 28\r\n\t\tscalarMapping.put(DaoConstants.MAP_GHPHRS, StandardBasicTypes.DOUBLE); // 29\r\n\t\tscalarMapping.put(DaoConstants.MAP_GHPOIL, StandardBasicTypes.DOUBLE); // 30\r\n\t\tscalarMapping.put(DaoConstants.MAP_SITEPATH, StandardBasicTypes.STRING); // 31\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPANYNAME,\r\n\t\t\t\tStandardBasicTypes.STRING); // 32\r\n\t\tscalarMapping.put(DaoConstants.MAP_CASTATUS, StandardBasicTypes.STRING); // 33\r\n\t\tscalarMapping.put(DaoConstants.MAP_V23, StandardBasicTypes.STRING); // 34\r\n\t\t// Demand\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPRESSOR1,\r\n\t\t\t\tStandardBasicTypes.BOOLEAN); // 35\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPRESSOR2,\r\n\t\t\t\tStandardBasicTypes.BOOLEAN); // 36\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPRESSOR3,\r\n\t\t\t\tStandardBasicTypes.BOOLEAN); // 37\r\n\t\t//add by shanf\r\n\t\tscalarMapping.put(DaoConstants.DEVICE_MODEL,\r\n\t\t\t\tStandardBasicTypes.STRING); // 38\r\n\r\n\t\treturn scalarMapping;\r\n\t}",
"public DoubleDictionary(BigTable bigTable) {\n\t\tstringKeyDictionary = new TreeMap<String, Integer>();\n\t\tintegerKeyDictionary = new ArrayList<String>();\n\t\t\n\t\tint dictionarySize = 0;\n\t\tfor(int index = 0; index < bigTable.getSize(); index++) {\n\t\t\t\n\t\t\tif(!stringKeyDictionary.containsKey(bigTable.getTriple(index).getSubjectString())) {\n\t\t\t\tstringKeyDictionary.put(bigTable.getTriple(index).getSubjectString(), dictionarySize);\n\t\t\t\tintegerKeyDictionary.add(bigTable.getTriple(index).getSubjectString());\n\t\t\t\tdictionarySize++;\n\t\t\t}\n\t\t\tif(!stringKeyDictionary.containsKey(bigTable.getTriple(index).getObjectString())) {\n\t\t\t\tstringKeyDictionary.put(bigTable.getTriple(index).getObjectString(), dictionarySize);\n\t\t\t\tintegerKeyDictionary.add(bigTable.getTriple(index).getObjectString());\n\t\t\t\tdictionarySize++;\n\t\t\t}\n\t\t\tif(!stringKeyDictionary.containsKey(bigTable.getTriple(index).getPredicateString())) {\n\t\t\t\tstringKeyDictionary.put(bigTable.getTriple(index).getPredicateString(), dictionarySize);\n\t\t\t\tintegerKeyDictionary.add(bigTable.getTriple(index).getPredicateString());\n\t\t\t\tdictionarySize++;\n\t\t\t}\n\t\t}\n\t}",
"private Map<String,KeystoreMetadata> buildKeystores(\r\n Map<String,Object> keyObjMap, Map<String,CertificateMetadata> certMap, IPresenter presenter)\r\n {\r\n Map<String,KeystoreMetadata> keyMap = new HashMap<>();\r\n for(Map.Entry<String,Object> keyEntry : keyObjMap.entrySet())\r\n {\r\n Map<String,Object> propertiesMap = null;\r\n try {\r\n propertiesMap = (Map<String, Object>) keyEntry.getValue();\r\n } catch (ClassCastException e) {\r\n throw new MetadataException(\"Certificate metadata is incorrectly formatted\");\r\n }\r\n \r\n String outputKeystoreFilename = keyEntry.getKey();\r\n KeystoreMetadata km = new KeystoreMetadata();\r\n km.setOutputKeystoreFilename(outputKeystoreFilename);\r\n km.setBaseKeystoreFilename((String) propertiesMap.get(\"base-keystore-filename\"));\r\n km.setKeystorePassword((String) propertiesMap.get(\"keystore-password\"));\r\n \r\n Map<String,Object> certsObjectMap = null;\r\n try {\r\n certsObjectMap = (Map<String,Object>) propertiesMap.get(\"certificates\");\r\n } catch(ClassCastException e) {\r\n throw new MetadataException(\"Certificate metadata is incorrectly formatted\");\r\n }\r\n \r\n List<CertificateMetadata> certList = new LinkedList<>();\r\n if(certsObjectMap == null) // allow creation of empty keystores\r\n presenter.emptyKeystore(outputKeystoreFilename);\r\n else\r\n for(Map.Entry<String,Object> certEntry : certsObjectMap.entrySet())\r\n {\r\n String certRef = certEntry.getKey();\r\n String certAlias = (String) certEntry.getValue();\r\n CertificateMetadata cert = certMap.get(certRef);\r\n km.addCertByAlias(certAlias,cert);\r\n km.addAliasByCertRef(certRef,certAlias);\r\n certList.add(cert);\r\n }\r\n km.setCertificates(certList);\r\n keyMap.put(outputKeystoreFilename, km);\r\n }\r\n return keyMap;\r\n }",
"private void processEntitesMap(LinkedHashMap obj, String currKey, List<Entity> entities, String rELATIONAL_KEY2) {\n\t\t\n\t}",
"public static HashMap<String,String> splitJson(String s) {\n ObjectMapper mapper1 = new ObjectMapper();\n HashMap<String,String> rtn = new HashMap<String,String>();\n HashMap<String,String> jobj = null;\n try {\n jobj = mapper1.readValue(s, HashMap.class);\n for (Map.Entry<String, String> entrySet : jobj.entrySet()) {\n String key = entrySet.getKey();\n Object value = entrySet.getValue();\n rtn.put(key, mapper1.writeValueAsString(value));\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n return rtn;\n }",
"public void toMap(HashMap<String, String> map, String prefix) {\n this.setParamArrayObj(map, prefix + \"ImageInfoList.\", this.ImageInfoList);\n this.setParamObj(map, prefix + \"HandleParam.\", this.HandleParam);\n this.setParamSimple(map, prefix + \"Type\", this.Type);\n this.setParamSimple(map, prefix + \"IsUsedClassify\", this.IsUsedClassify);\n this.setParamSimple(map, prefix + \"UserType\", this.UserType);\n this.setParamArrayObj(map, prefix + \"ReportTypeVersion.\", this.ReportTypeVersion);\n\n }",
"public List<SalesforceMetadataTree> metaDataList(ArrayList<String> objectArray,ArrayList<String> fieldArray, Map<String, SalesforceSetupDetail> hashTable,List<SalesforceMetadataTree> treeMapDataList,String type) {\r\n\r\n\t\tint i=0 ;\r\n\t\tif(!type.equalsIgnoreCase(\"Custom\")){\r\n\t\t\ti=1;\r\n\t\t}\r\n\t\tfor ( ;i < objectArray.size(); i++) {\r\n\r\n\t\t\tMap map = new HashMap();\r\n\t\t\t// Adding elements to map\r\n\t\t\tif(type.equalsIgnoreCase(\"Custom\"))\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tmap.put(objectArray.get(i), fieldArray.get(i));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tmap.put(objectArray.get(i), fieldArray.get(i-1));\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t// Traversing Map\r\n\t\t\tSet set = map.entrySet();// Converting to Set so that we can\r\n\t\t\t\t\t\t\t\t\t\t// traverse\r\n\t\t\tIterator itr = set.iterator();\r\n\t\t\twhile (itr.hasNext()) {\r\n\t\t\t\tboolean ischecked = false;\r\n\t\t\t\tSalesforceMetadataTree mtc = null;\r\n\t\t\t\tList<SalesforceMetadataTree> mtca = new ArrayList<SalesforceMetadataTree>();\r\n\t\t\t\t// Converting to Map.Entry so that we can get key and value\r\n\t\t\t\t// separately\r\n\t\t\t\tMap.Entry entry = (Map.Entry) itr.next();\r\n\t\t\t\tSystem.out.println(entry.getKey() + \" \" + entry.getValue());\r\n\t\t\t\tString[] sarray = entry.getValue().toString().split(\",\");\r\n\t\t\t\ttreeMap.put(entry.getKey().toString(), sarray);\r\n\t\t\t\tSalesforceMetadataTree child = null;\r\n\t\t\t\tSalesforceSetupDetail colvalues = hashTable.get(entry.getKey().toString());\r\n\t\t\t\tfor (int k = 0; k < sarray.length; k++) {\r\n\t\t\t\t\tchild = new SalesforceMetadataTree();\r\n\t\t\t\t\tchild.setName(sarray[k]);\r\n\t\t\t\t\tif (colvalues != null && colvalues.getSalesforceFields().contains(sarray[k])) {\r\n\t\t\t\t\t\tchild.setChecked(true);\r\n\t\t\t\t\t\tischecked=true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tchild.setChecked(false);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmtca.add(child);\r\n\t\t\t\t}\r\n\t\t\t\tmtc = new SalesforceMetadataTree();\r\n\t\t\t\tmtc.setName(entry.getKey().toString());\r\n\t\t\t\tif(!ischecked)\r\n\t\t\t\t{\r\n\t\t\t\t\tmtc.setChecked(false);\r\n\t\t\t\t}else\r\n\t\t\t\t{\r\n\t\t\t\t\tmtc.setChecked(true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tmtc.setChildren(mtca);\r\n\t\t\t\tif(colvalues!= null){\r\n\t\t\t\t\tmtc.setId(colvalues.getId());\r\n\t\t\t\t}\r\n\t\t\t\ttreeMapDataList.add(mtc);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tSystem.out.println(treeMapDataList);\r\n\t\treturn treeMapDataList;\r\n\r\n\t}",
"public IExtendedDictionary getDictionary(IKey key);",
"void addTypes(EntryRep bits) {\n\tString classFor = bits.classFor();\n\tString[] superclasses = bits.superclasses();\n\n\t//The given EntryRep will add its className to the\n\t//subtype list of all its supertypes.\n\n\tString prevClass = classFor;\n\tfor (int i = 0; i < superclasses.length; i++) {\n\t if (!addKnown(superclasses[i], prevClass)) {\n\t\treturn;\n\t }\n\t prevClass = superclasses[i];\n\t}\n\n\t// If we are here prevClass must have java.Object as its\n\t// direct superclass (we don't store \"java.Object\" in\n\t// EntryRep.superclasses since that would be redundant) and\n\t// prevClass is not already in the the tree. Place it in the\n\t// \"net.jini.core.entry.Entry\" bucket so it does not get lost\n\t// if it does not have any sub-classes.\n\t//\n\t// Fix suggested by Lutz Birkhahn <lutz.birkhahn@GMX.DE>\n\taddKnown(ROOT, prevClass);\n }",
"public static void main(String[] args) {\n\n\t\tHashMap<String,String> hm = new HashMap<String, String>();\n\t\t\n\t\thm.put(\"e\",\"a1\");\n\t\thm.put(\"b\",\"a1\");\n\t\thm.put(\"a\",\"a2\");\n\t\t \n\t\thm.put(\"a\",\"a5\");\n\t\t\n\t\tSet s = hm.entrySet();\n\t\tIterator it = s.iterator();\n\t\t\n\t\tfor(Map.Entry me : hm.entrySet())\n\t\t\tSystem.out.println(me.getKey()+\" \"+me.getValue());\n\t\t\n\t\t\n\t\twhile(it.hasNext())\n\t\t{\n\t\t\tMap.Entry mentry = (Map.Entry) it.next();\n\t\t\tSystem.out.println(mentry.getKey() +\" \"+mentry.getValue());\n\t\t\t\n\t\t}\n\t\t\n\tMap<String,String> thmp = \tnew TreeMap<String,String> (hm);\n\tSystem.out.println();\n\tfor(Map.Entry g : thmp.entrySet())\n\t\tSystem.out.println(g.getKey()+\" \"+g.getValue());\n\t\n\t\n\tSystem.out.println(hm.containsKey(\"a\")+\" \"+hm.containsValue(\"a5\"));\n\t\n\t\t\n\t\t\n\t\t\n\t}",
"private String[] buildTypeRegistrations(String[] baseKeys, boolean noSQLrecurse) {\n\t\tClassLoaderService cls = registry.getService(ClassLoaderService.class);\n\t\tArrayList<String> keys = new ArrayList<>( baseKeys.length << 1 );\n\t\tfor ( String bk : baseKeys ) {\n\t\t\tString className;\n\t\t\tboolean addSQL = true;\n\t\t\ttry {\n\t\t\t\tClass c;\n\t\t\t\tswitch ( bk ) {\n\t\t\t\t\tcase \"boolean\":\n\t\t\t\t\t\tc = boolean.class;\n\t\t\t\t\t\tclassName = \"Z\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"byte\":\n\t\t\t\t\t\tc = byte.class;\n\t\t\t\t\t\tclassName = \"B\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"char\":\n\t\t\t\t\t\tc = char.class;\n\t\t\t\t\t\tclassName = \"C\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"double\":\n\t\t\t\t\t\tc = double.class;\n\t\t\t\t\t\tclassName = \"D\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"float\":\n\t\t\t\t\t\tc = float.class;\n\t\t\t\t\t\tclassName = \"F\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"int\":\n\t\t\t\t\t\tc = int.class;\n\t\t\t\t\t\tclassName = \"I\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"long\":\n\t\t\t\t\t\tc = long.class;\n\t\t\t\t\t\tclassName = \"J\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"short\":\n\t\t\t\t\t\tc = short.class;\n\t\t\t\t\t\tclassName = \"S\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// load to make sure it exists\n\t\t\t\t\t\tc = cls.classForName( bk );\n\t\t\t\t\t\tclassName = c.getName();\n\t\t\t\t\t\taddSQL = false;\n\t\t\t\t}\n\t\t\t\tif ( c.isPrimitive() ) {\n\t\t\t\t\t// disallow. \n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( c.isArray() ) {\n\t\t\t\t\tkeys.add( \"[\" + className );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tkeys.add( \"[L\" + className + \";\" );\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch ( ClassLoadingException ex ) {\n\t\t\t\t// just ignore. It means we won't be adding that key\n\t\t\t}\n\t\t\tif ( addSQL ) {\n\t\t\t\t// Not all type names given are Java classes, so assume the others are Database types\n\t\t\t\tif ( noSQLrecurse ) {\n\t\t\t\t\t// type is just \"basetype ARRAY\", never \"basetype ARRAY ARRAY ARRAY\"\n\t\t\t\t\tkeys.add( bk );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// PostgreSQL type names\n\t\t\t\t\tkeys.add( bk + \"[]\" );\n\t\t\t\t\t// standard SQL\n\t\t\t\t\tkeys.add( bk + \" ARRAY\" );\n\t\t\t\t\t// also possible\n\t\t\t\t\tkeys.add( bk + \" array\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn keys.toArray( new String[keys.size()] );\n\t}",
"private void normalizeDictionary() {\n\t\t\n\t\tCollections.sort(idfValues, Collections.reverseOrder());\n\t\tCollections.sort(idf2Values, Collections.reverseOrder());\n\t\tDouble maxIDF=idfValues.get(0)==0.0?1.0:idfValues.get(0);\n\t\tDouble maxIDF2=idf2Values.get(0)==0.0?1.0:idf2Values.get(0);\t\n\t\tfor (int i = 0; i < getTfMapArrayIDF().size(); i++) {\n\t\t\tList<Map<String,List<Double>>> gestureDocument = getTfMapArrayIDF().get(i);\n\t\t\tfor (int j = 0; j < gestureDocument.size(); j++) {\n\t\t\t\tMap<String,List<Double>> tempMap = gestureDocument.get(j);\n\t\t\t\tIterator<Entry<String, List<Double>>> it = tempMap.entrySet().iterator();\n\t\t\t\t while (it.hasNext()) {\n\t\t\t\t Map.Entry<String,List<Double>> pairs = (Map.Entry)it.next();\n\t\t\t\t \t//normalize tf-idf\n\t\t\t\t \tpairs.getValue().set(3, pairs.getValue().get(3)/maxIDF);\n\t\t\t\t \t//normalize tf-idf2\n\t\t\t\t \tpairs.getValue().set(4, pairs.getValue().get(4)/maxIDF2);\n\t\t\t\t }\n\t\t\t}\n\t\t}\n\t}",
"public static void getPerms(HashMap<Character,Integer> freqMap,String prefix,int length,ArrayList<String> result) {\n if(length==0) {\n result.add(prefix);\n return;\n }\n for(Character c:freqMap.keySet()){\n Integer count= freqMap.get(c);\n if(count>0){\n freqMap.put(c,count-1);\n getPerms(freqMap,prefix+c,length-1,result);\n freqMap.put(c,count);\n }\n\n }\n }",
"private static void straightenArrayToIncludeOnlyObjects(String arrKey, JSONObject report, String keyToInsert, String... path)\n\t{\n\t\ttry {\n\t\t\t// find the element\n\t\t\tJSONObject temp = report;\n\t\t\tfor (String key : path) {\n\t\t\t\ttemp = temp.getJSONObject(key);\n\t\t\t\tif (temp == null)\n\t\t\t\t\treturn;\n\t\t\t}\n\n\t\tJSONArray arr = temp.optJSONArray(arrKey);\n\t\tif (arr == null) {\n\t\t\t// maybe it's just a string:\n\t\t\tString str = temp.optString(arrKey);\n\t\t\tif (str != null && !str.equals(\"\")) {\n\t\t\t\tJSONObject obj = new JSONObject();\n\t\t\t\tobj.put(keyToInsert, str);\n\t\t\t\ttemp.put(arrKey, obj);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tList<String> toAdd = new ArrayList<>();\n\t\t\n\t\t// change all strings to objects\n\t\tfor (Iterator<Object> iter = arr.iterator(); iter.hasNext();) {\n\t\t\tObject obj = iter.next();\n\t\t\tif (obj instanceof String) {\n\t\t\t\titer.remove();\n\t\t\t\ttoAdd.add((String)obj);\n\t\t\t}\t\n\t\t}\n\t\tfixElements(arr, keyToInsert, toAdd);\n\t\t}catch (Exception e) {\n\t\t\tErrorLogger.getInstance().getLogger().fine(e.getMessage());\n\t\t\treturn;\n\t\t}\n\t}",
"private void prefix(ExpressionNodes root, StringBuilder sb)\n\t {\n\t \t\n\t \t// add the string of this node to the the string builder \n\t \tsb.append(root.data);\n\t \t\n\t \t// add a space in between nodes for clarity.\n\t \tsb.append(\" \");\n\t \t\n\t \tif (root.left != null) // if there is a left child\n\t \t{ \n\t \t\tprefix(root.left, sb); // run recursive method \n\t \t}\n\t \t\n\t \tif (root.right != null) // if there is a right child\n\t \t{ \n\t \t\tprefix(root.right, sb); // run recursive method \n\t \t}\n\t \t\n\t }",
"public <K> Map<K, JAVATYPE> convertMap(Map<K, JAVATYPE> oldMap, final METATYPE meta);",
"private static String nativeObjectToJSONString(NativeObject nativeObject) throws Exception \n { \n \tMap<String, String> mapJson = new LinkedHashMap<String, String>();\n \tMap<String, Class<?>> mapTypeJson = new LinkedHashMap<String, Class<?>>();\n \t\n Object[] ids = nativeObject.getIds(); \n for (Object id : ids) \n { \n String key = id.toString();\n Object value = nativeObject.get(key, nativeObject);\n if(!(value instanceof Undefined)) {\n Object json = toJson(value);\n mapJson.put(key, json+\"\");\n if(!(json instanceof String) && json!=null) mapTypeJson.put(key, json.getClass()); \n }\n } \n \n return HAPUtilityJson.buildMapJson(mapJson, mapTypeJson); \n }",
"@Override\n public List<String> keysWithPrefix(String prefix) {\n if (prefix == null || prefix.length() == 0 || root == null) {\n throw new NoSuchElementException();\n }\n List<String> result = new ArrayList<>();\n Node p = root;\n // Get to the branch with such a prefix\n for (int i = 0; i < prefix.length(); i++) {\n Node childNode = p.next.get((prefix.charAt(i)));\n if (childNode == null) {\n throw new NoSuchElementException();\n } else {\n p = childNode;\n }\n }\n // P is now at the branch, scan every branch of p to get the list of words\n if (p.isKey) {\n result.add(prefix);\n }\n for (Node i : p.next.values()) {\n if (i != null) {\n keysWithPrefix(result, prefix, i);\n }\n }\n return result;\n }"
] | [
"0.66693896",
"0.57254833",
"0.5248366",
"0.52433395",
"0.5144409",
"0.50637114",
"0.49858698",
"0.48035675",
"0.47851607",
"0.47653",
"0.4764461",
"0.47589052",
"0.47546604",
"0.4748711",
"0.47352558",
"0.47204018",
"0.46821773",
"0.46777445",
"0.4668539",
"0.46493316",
"0.46309048",
"0.46196762",
"0.45855126",
"0.45782122",
"0.45549396",
"0.4554402",
"0.4539684",
"0.4530069",
"0.45278707",
"0.45181796",
"0.45169333",
"0.45149425",
"0.45041487",
"0.4502118",
"0.44985723",
"0.44919816",
"0.44750252",
"0.4472669",
"0.44457304",
"0.44358057",
"0.4433358",
"0.4424667",
"0.44233447",
"0.44073895",
"0.44042096",
"0.44018292",
"0.44009918",
"0.4397775",
"0.43859643",
"0.4383741",
"0.43786365",
"0.4370127",
"0.43692595",
"0.43555337",
"0.4348183",
"0.43471095",
"0.4343917",
"0.4330147",
"0.43098727",
"0.4306753",
"0.4305278",
"0.4303072",
"0.43029726",
"0.42917356",
"0.4284075",
"0.4278967",
"0.42771655",
"0.4273967",
"0.42714456",
"0.42700818",
"0.42648852",
"0.426395",
"0.42611024",
"0.42596316",
"0.42580336",
"0.42532843",
"0.4252879",
"0.4247553",
"0.4247152",
"0.4233465",
"0.42326856",
"0.42290404",
"0.42223668",
"0.4220303",
"0.42180628",
"0.421439",
"0.4212669",
"0.4205009",
"0.4202582",
"0.42024425",
"0.41986826",
"0.41900495",
"0.41878182",
"0.4186889",
"0.41847163",
"0.4182736",
"0.41816694",
"0.41803017",
"0.41787708",
"0.41759858"
] | 0.6661286 | 1 |
TODO Autogenerated method stub | public static void main(String[] args) {
int randNum,num;
GuessGame player=new GuessGame();
while(true) {
//生成随机数
randNum=player.RandomNum();
System.out.println("请输入你猜的数字(你只有3次机会)");
for(int i=3;i>0;i--) {
num=player.inputNum();
if(player.isTrue(randNum, num)) {
System.out.println("你猜对了,你的得分是:"+player.counter);
break;
}else {
if(i-1!=0)
System.out.println("你猜错了,你还有"+(i-1)+"次机会");
else {
System.out.println("你猜错了,已经没有机会了。");
System.out.println("最终得分:"+player.counter);
System.out.println("随机数为:"+randNum);
}
}
}
System.out.println("游戏结束,按“1”,重玩,按“0”退出");
if(player.inputNum()==0)
break;
else
player.counter=0;//重置分数为0
}
} | {
"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}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"private stendhal() {\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\r\n\tpublic void dispase() {\n\r\n\t}",
"@Override\n\tprotected void initialize() {\n\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.66708666",
"0.65675074",
"0.65229905",
"0.6481001",
"0.64770633",
"0.64584893",
"0.6413091",
"0.63764185",
"0.6275735",
"0.62541914",
"0.6236919",
"0.6223816",
"0.62017626",
"0.61944294",
"0.61944294",
"0.61920846",
"0.61867654",
"0.6173323",
"0.61328775",
"0.61276996",
"0.6080555",
"0.6076938",
"0.6041293",
"0.6024541",
"0.6019185",
"0.5998426",
"0.5967487",
"0.5967487",
"0.5964935",
"0.59489644",
"0.59404725",
"0.5922823",
"0.5908894",
"0.5903041",
"0.5893847",
"0.5885641",
"0.5883141",
"0.586924",
"0.5856793",
"0.58503157",
"0.58464456",
"0.5823378",
"0.5809384",
"0.58089525",
"0.58065355",
"0.58065355",
"0.5800514",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57896614",
"0.5789486",
"0.5786597",
"0.5783299",
"0.5783299",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5760369",
"0.5758614",
"0.5758614",
"0.574912",
"0.574912",
"0.574912",
"0.57482654",
"0.5732775",
"0.5732775",
"0.5732775",
"0.57207066",
"0.57149917",
"0.5714821",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57115865",
"0.57045746",
"0.5699",
"0.5696016",
"0.5687285",
"0.5677473",
"0.5673346",
"0.56716853",
"0.56688815",
"0.5661065",
"0.5657898",
"0.5654782",
"0.5654782",
"0.5654782",
"0.5654563",
"0.56536144",
"0.5652585",
"0.5649566"
] | 0.0 | -1 |
View product details Link | private Link lnkViewDetails(final String productName) {
return new Link(
"//span[@class='subhedcsb' and contains(., '"
+ productName.trim() + "')]/../following-sibling::td[3]//a");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void viewProductById(long id);",
"@RequestMapping(value = {\"/product_detail/{id}\"}, method = RequestMethod.GET)\n public String viewProductDetail(Model model, @PathVariable(\"id\") long id, HttpServletRequest request) {\n Product product = getProduct(id, request);\n model.addAttribute(\"product\", product);\n return \"product_detail\";\n }",
"@Override\n public void openDetail(@NonNull Product product) {\n mMainView.openDetailUi(product);\n }",
"@Override\n public void onClick(Product product) {\n Log.i(\"MainActivity\", product.toString());\n Intent detailIntent = new Intent(this, DetailActivity.class);\n detailIntent.putExtra(Constants.Keys.PRODUCT_DETAIL.toString(), product);\n startActivity(detailIntent);\n }",
"public String getCartDetailonProductDetailPage()\n\t{\n\t\twaitForVisibility(cartDetailonProductDetailPage);\n\t\treturn cartDetailonProductDetailPage.getText();\n\t}",
"@RequestMapping(value = {\"/add_product\"}, method = RequestMethod.GET)\n public String viewProductAdd() {\n return \"product_detail_new\";\n }",
"@RequestMapping(\"/productlist/Productdetails/{id}\")\n\n public String Productdetails(@PathVariable String id, Model model) throws IOException{\n\n Product bike = productDao.getProductById(id);\n model.addAttribute(bike);\n\n\n return \"productdetails\";\n }",
"@Override\r\n\tprotected String getPath() {\n\t\treturn \"/product/detail.do?param=\";\r\n\t}",
"public String productListForDetail() {\n return SUCCESS;\n }",
"@RequestMapping(value = \"/show/{id}/product\") \n\tpublic ModelAndView showSingleProduct(@PathVariable int id) throws ProductNotFoundException {\n\t\t\n\t\tModelAndView mv = new ModelAndView(\"page\");\n\t\t\n\t\tProduct product = productDAO.get(id);\n\t\t\n\t\tif(product == null) throw new ProductNotFoundException();\n\t\t\n\t\t// update the view count\n\t\tproduct.setViews(product.getViews() + 1);\n\t\tproductDAO.update(product);\n\t\t//---------------------------\n\t\t\n\t\tmv.addObject(\"title\", product.getName());\n\t\tmv.addObject(\"product\", product);\n\t\t\n\t\tmv.addObject(\"userClickShowProduct\", true);\n\t\t\n\t\t\n\t\treturn mv;\n\t\t\n\t}",
"@RequestMapping(value = \"/show/{id}/product\")\r\n\tpublic ModelAndView showingSingleProduct(@PathVariable(\"id\") int id) throws ProductNotFound {\r\n\t\tModelAndView mv = new ModelAndView(\"page\");\r\n\t\tProduct product = productDAO.get(id);\r\n\t\tif (product == null){\r\n\t\t\tthrow new ProductNotFound();\t\r\n\t\t}\r\n\t\t\t\r\n\t\tproduct.setViews(product.getViews() + 1);\r\n\t\tproductDAO.update(product);\r\n\t\tmv.addObject(\"title\", product.getName());\r\n\t\tmv.addObject(\"product\", product);\r\n\t\tmv.addObject(\"onClickShowProduct\", true);\r\n\t\treturn mv;\r\n\r\n\t}",
"@Override\n\tpublic ProductVO detailProduct(int product_id) {\n\t\treturn null;\n\t}",
"@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 DisplayProductDetails getDisplayProductDetails(final Product product) {\n final DisplayProductDetails productDetails = new DisplayProductDetails();\n if (product != null) {\n // TODO Get product rating details from DB\n \tList<BreadCrumb> breadcrumbList = new LinkedList<BreadCrumb>();\n \t\n \tBreadCrumb breadcrumb1 = new BreadCrumb();\n \tbreadcrumb1.setDisplayText(product.getCategory().getParentCategory().getCategoryName());\n \tbreadcrumb1.setLinkUrl(\"category/\"+product.getCategory().getParentCategory().getCategoryPartNumber());\n \t\n \tBreadCrumb breadcrumb2 = new BreadCrumb();\n \tbreadcrumb2.setDisplayText(product.getCategory().getCategoryName());\n \tbreadcrumb2.setLinkUrl(\"category/\"+product.getCategory().getCategoryPartNumber());\n \t\n \tbreadcrumbList.add(breadcrumb1);\n \tbreadcrumbList.add(breadcrumb2);\n \t\n \tproductDetails.setBreadcrumb(breadcrumbList);\n \tproduct.getCategory().getParentCategory().getCategoryId();\n\n productDetails.setAverageProductRating(new BigDecimal(3));\n productDetails.setProductName(product.getProductName());\n productDetails.setProductId(product.getProductId());\n productDetails.setProductPartNumber(product.getProductPartNumber());\n // If product doesn't have a description use its category description.\n final String productDesc = (product.getProductDescription() != null && !product.getProductDescription().isEmpty()) ? product.getProductDescription()\n : product.getCategory().getDescription();\n productDetails.setProductDescription(productDesc);\n\n // Set the product image and image gallery details\n productDetails.setProductImageGallery(getDisplayProductGallery(product.getProductId()));\n\n // End of setting the product image gallery options .\n\n BigDecimal productPrice = null;\n String currencyCode = null;\n if (product.getProductPrice() != null) {\n productPrice = product.getProductPrice().getPrice();\n currencyCode = product.getProductPrice().getCurrency().getCurrencyCode();\n }\n productDetails.setProductPrice(productPrice);\n productDetails.setProductCurrency(currencyCode);\n // Set the product price options in other currencies .\n final List<ProductPriceOptions> priceOptionsList = getPriceOptionForProduct(product);\n productDetails.setProductPriceOptions(priceOptionsList);\n // End of setting the product price options in other currencies\n\n // Get the product availability info\n final String availability = product.isEnabled() ? ProductAvailability.INSTOCK.getStatusDescription()\n : ProductAvailability.OUTOFSTOCK.getStatusDescription();\n // End of setting the product availability info\n productDetails.setProductAvailablility(availability);\n\n // Get the product specifications\n productDetails.setProductSpecification(getDisplayProductSpecification(product.getProductSpecification()));\n\n }\n return productDetails;\n }",
"@RequestMapping(\"/detail/{id}\")\n public String showproduct(@PathVariable(\"id\") long id, Model model, Principal principal, Authentication authentication) {\n model.addAttribute(\"product\", productRepository.findById(id).get());\n model.addAttribute(\"categories\", categoryRepository.findAll());\n// model.addAttribute(\"product_user_id\", userRepository.findByUsername(principal.getName()).getId());\n\n String username = null;\n try {\n username = principal.getName();\n model.addAttribute(\"product_user_id\", userRepository.findByUsername(principal.getName()).getId());\n model.addAttribute(\"user_id\", userRepository.findByUsername(principal.getName()).getId());\n\n return \"show\";\n } catch (Exception e){\n model.addAttribute(\"product_user_id\", 0);\n return \"show\";\n }\n }",
"@RequestMapping(value = \"/admin/account/renew/individual\", method = RequestMethod.GET)\n public String getCurrentIndividualProductInfoView() {\n return \"getCurrentIndividualProductInfo\";\n }",
"@Override\n\tpublic void showDetails(Manufacturer entity) {\n\n\t}",
"@GetMapping(VERSION + \"/product/{productId}\")\n public ResponseEntity<?> retrieveProductDetails(@PathVariable(\"productId\") String productId) {\n ProductDto productDto = productCompositeService.fetchProductById(productId);\n return ResponseEntity.ok().body(productDto);\n }",
"@Test\n public void getProductDetailTest() throws ApiException {\n String productId = null;\n ResponseBankingProduct response = api.getProductDetail(productId);\n\n // TODO: test validations\n }",
"@GetMapping(\"/sysadmin/product/view/{id}\")\n public String showProductPage(@PathVariable(value = \"id\") Integer id, ModelMap model) {\n Product product = productService.findById(id);\n if (product == null) {\n return \"redirect:/admin/product\";\n }\n\n ProductUpdateDTO productDTO = new ProductUpdateDTO();\n productDTO.setProductCode(product.getProductCode());\n productDTO.setCategory(product.getCategory());\n productDTO.setDescription(product.getDescription());\n productDTO.setPrice(product.getPrice());\n productDTO.setTitle(product.getTitle());\n productDTO.setType(product.getType());\n productDTO.setPublished(product.isPublish());\n\n List<CodeValue> lstCode = codeValueService.getByType(\"product_category\");\n for(int i = 0; i < lstCode.size(); i++){\n CodeValue code = lstCode.get(i);\n if(code.getCode() == productDTO.getCategory()){\n productDTO.setCategoryDescription(code.getDescription());\n break;\n }\n }\n model.addAttribute(\"product\", productDTO);\n model.addAttribute(\"productCategory\", codeValueService.getByType(\"product_category\"));\n\n return \"admin/sysadm/productFormView\";\n }",
"public URI getPricingDetailLink() {\n return this.pricingDetailLink;\n }",
"public String productList(ProductDetails p);",
"@RequestMapping(method = RequestMethod.GET, value = \"/**\", produces = {MediaType.TEXT_HTML_VALUE})\n public String handleProductDetailPage(HttpServletRequest request, HttpServletResponse response) throws ContentProviderException {\n\n // TODO: How to handle variants ??\n\n // Path pattern for product detail pages: /p/[SEO name]/[second id]\n final String requestPath = webRequestContext.getRequestPath().replaceFirst(\"/p\", \"\");\n final String[] pathTokens = requestPath.split(\"/\");\n final String productSeoId;\n final String productId;\n if ( pathTokens.length == 3 ) {\n productSeoId = pathTokens[1];\n productId = pathTokens[2];\n }\n else if ( pathTokens.length == 2 ) {\n productSeoId = null;\n productId = pathTokens[1];\n }\n else {\n throw new PageNotFoundException(\"Invalid product detail URL.\");\n }\n\n //final Category category = fredhopperService.getCategoryByPath(requestPath);\n //final List<FacetParameter> facets = fredhopperService.getFacetParametersFromRequestMap(request.getParameterMap());\n ProductDetailResult detailResult = this.detailService.getDetail(productId);\n\n if ( detailResult != null && detailResult.getProductDetail() != null ) {\n\n request.setAttribute(PRODUCT_ID, productId);\n request.setAttribute(PRODUCT, detailResult.getProductDetail());\n request.setAttribute(RESULT, detailResult);\n request.setAttribute(URL_PREFIX, \"/c\");\n final PageModel templatePage = resolveTemplatePage(request, this.getSearchPath(productSeoId, productId));\n templatePage.setTitle(detailResult.getProductDetail().getName());\n\n final MvcData mvcData = templatePage.getMvcData();\n return this.viewResolver.resolveView(mvcData, \"Page\", request);\n }\n throw new PageNotFoundException(\"Product detail page not found.\");\n }",
"DescribeProductViewResult describeProductView(DescribeProductViewRequest describeProductViewRequest);",
"public String getProductUrl() {\n\t\treturn productUrl;\n\t}",
"@GetMapping(\"/product/{pid}\")\n public String getProductDetails(@PathVariable(\"pid\") String pid, Model model){\n if(!Util.isPositiveInteger(pid)){\n return \"redirect:/products\";\n }\n\n Product currProduct = productService.findById(Long.valueOf(pid));\n\n //Redirect user to a /products if invalid id is received\n if(currProduct == null){\n return \"redirect:/products\";\n }\n\n\n model.addAttribute(\"categories\",categoryService.findAll());\n model.addAttribute(\"currProduct\", currProduct);\n\n return \"productDetails\";\n }",
"public void displayProduct() {\n\t\tDisplayOutput.getInstance()\n\t\t\t\t.displayOutput(StoreFacade.getInstance());\n\t}",
"public CimString getProductUrl() {\n return productUrl;\n }",
"private void detailedClicked(int position) {\n Intent i = new Intent(getContext(), ScrollingActivity.class);\n i.putExtra(\"name\", productList.get(position).getName());\n i.putExtra(\"init\", productList.get(position).getInitialPrice());\n i.putExtra(\"curr\", productList.get(position).getCurrentPrice());\n i.putExtra(\"change\", productList.get(position).getChange());\n i.putExtra(\"date\", productList.get(position).getDate());\n i.putExtra(\"url\", productList.get(position).getURL());\n getContext().startActivity(i);\n }",
"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 }",
"@Override\r\n\tpublic String detail() {\n\t\tSystem.out.println(\"detailView.\");\r\n\t\t//javax.servlet.http.HttpSession session=request.getSession();\r\n\t\t//javax.servlet.ServletContext application=request.getServletContext();\r\n\t\t\r\n\t\t//String vId=request.getParameter(\"id\");\r\n\t\tif(!SysFun.isNullOrEmpty(id)) {\r\n\t\t\tLong iId=SysFun.parseLong(id);\r\n\t\t\tHeadLine bean=headLineService.load(iId);\r\n\t\t\tif(bean!=null) {\r\n\t\t\t\trequest.put(\"bean\", bean);\r\n\t\t\t\treturn \"detail\";\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"detail\";\r\n\t}",
"public void printProduct() {\n System.out.println(\"nom_jeu : \" + name);\n System.out.println(\"price : \" + price);\n System.out.println(\"uniqueID : \" + identifier);\n System.out.println(\"stock : \" + stock);\n System.out.println(\"image : \" + image);\n System.out.println(\"genre : \" + genre);\n System.out.println(\"plateforme : \" + platform);\n System.out.println();\n }",
"public String viewDetailShop() throws Exception {\n\t\t\n\t\treturn SUCCESS;\n\t}",
"@Override\n\tpublic ProductBean view(String pname) {\n\t\treturn session.selectOne(namespace+\".view\", pname);\n\t}",
"public void gotoProduct(Product product){\n Intent detail = new Intent(getContext(), ProductDetail.class);\n detail.putExtra(\"PRODUCT\",product);\n // create the animator for this view (the start radius is zero)\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {\n\n //itemView.getContext().startActivity(detail);\n }else{\n\n }\n //ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(getActivity(),recycler,\"heading\");\n //getContext().startActivity(detail,options.toBundle());\n getContext().startActivity(detail);\n\n }",
"Object getViewDetails();",
"public void showAllProducts() {\n try {\n System.out.println(Constants.DECOR+\"ALL PRODUCTS IN STORE\"+Constants.DECOR_END);\n List<Product> products = productService.getProducts();\n System.out.println(Constants.PRODUCT_HEADER);\n for (Product product : products) { \n System.out.println((product.getName()).concat(\"\\t\\t\").concat(product.getDescription()).concat(\"\\t\\t\")\n .concat(String.valueOf(product.getId()))\n .concat(\"\\t\\t\").concat(product.getSKU()).concat(\"\\t\").concat(String.valueOf(product.getPrice()))\n .concat(\"\\t\").concat(String.valueOf(product.getMaxPrice())).concat(\"\\t\")\n .concat(String.valueOf(product.getStatus()))\n .concat(\"\\t\").concat(product.getCreated()).concat(\"\\t\\t\").concat(product.getModified())\n .concat(\"\\t\\t\").concat(String.valueOf(product.getUser().getUserId())));\n }\n } catch (ProductException ex) {\n System.out.println(ex);\n }\n }",
"@Override public void onItemClick(View view, int position) {\n Details d = productList.get(position);\n Intent intent = new Intent(Dec_Col.this, Col_Description.class);\n intent.putExtra(\"Title\", d.getTitle());\n intent.putExtra(\"Desc\", d.getDesc());\n intent.putExtra(\"Long_desc\", d.getLong_desc());\n intent.putExtra(\"date\",d.getDate());\n intent.putExtra(\"img\", d.getImage());\n startActivity(intent);\n\n }",
"public void clickProductDetailsViewInCartBtn(){\n clickElement(productDetailsViewInCart);\n }",
"@OnShow\n\tpublic void onShow() {\n\t\tviewForm.setValue(\n\t\t\t\t// load product using the \"id\" parameter\n\t\t\t\tdatastore.query().target(TARGET).filter(ID.eq(id)).findOne(PRODUCT)\n\t\t\t\t\t\t// throw an exception if not found\n\t\t\t\t\t\t.orElseThrow(() -> new DataAccessException(\"Product not found: \" + id)));\n\t}",
"public String extractHomeView() {\n return (new StringBuilder()\n .append(\"<a href=\\\"/products/details/\" + this.getId() + \"\\\" class=\\\"col-md-2\\\">\")\n .append(\"<div class=\\\"product p-1 chushka-bg-color rounded-top rounded-bottom\\\">\")\n .append(\"<h5 class=\\\"text-center mt-3\\\">\" + this.getName() + \"</h5>\")\n .append(\"<hr class=\\\"hr-1 bg-white\\\"/>\")\n .append(\"<p class=\\\"text-white text-center\\\">\")\n .append(this.getDescription())\n .append(\"</p>\")\n .append(\"<hr class=\\\"hr-1 bg-white\\\"/>\")\n .append(\"<h6 class=\\\"text-center text-white mb-3\\\">$\" + this.getPrice() + \"</h6>\")\n .append(\"</div>\")\n .append(\"</a>\")\n ).toString();\n }",
"@Override\n public void onClick(View v) {\n Intent intent = new Intent(context, Detail_Product_Normal.class);\n intent.putExtra(Param_Collection.EXTRA_POST_ID, item.getContent().getPostId().toString());\n intent.putExtra(Param_Collection.EXTRA_POST_PRODUCT_TITLE, item.getActivity());\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(intent);\n }",
"void onProductClick(Product product, int code);",
"public String getProductReference() {\n return productReference;\n }",
"@RequestMapping(value = \"/showGrnproductList\", method = RequestMethod.GET)\n\t public ModelAndView showGrnProductList(ModelAndView model) \n\t {\n\t model.addObject(\"grnProduct\", new GrnProduct());\n\t \n\t model.setViewName(\"productgrn/productGrn\");\n\t \n\t\t\treturn model;\n\t }",
"@When(\"I click on NikonD5500DSLR product link\")\n public void i_click_on_nikon_d5500dslr_product_link() {\n BasePage.camaraAndPhotoPage.getNikonD5500dslrLink().click();\n }",
"@GetMapping(\"/edit\")\r\n\tpublic String showEdit(@RequestParam Integer id,Model model)\r\n\t{\r\n\t\tProduct p=service.getOneProduct(id);\r\n\t\tmodel.addAttribute(\"product\", p);\r\n\t\treturn \"ProductEdit\";\r\n\t}",
"public ViewProductInfo() {\n initComponents();\n }",
"@Override\n public void onClick(View view) {\n Intent intent = new Intent(mContext, ItemDetailsActivity.class);\n\n intent.putExtra(\"name\", modellist.get(postition).getTitle());\n intent.putExtra(\"picture\", modellist.get(postition).getType() + postition);\n intent.putExtra(\"cost\", modellist.get(postition).getCost());\n intent.putExtra(\"id\", modellist.get(postition).getId());\n intent.putExtra(\"description\", modellist.get(postition).getDescription());\n intent.putExtra(\"extra\", modellist.get(postition).getExtra());\n\n mContext.startActivity(intent);\n// Toast.makeText(mContext, \"Make the user see the details of the item\", Toast.LENGTH_SHORT).show();\n }",
"Product getProductDetails(int idproduct) throws DataBaseException;",
"private void displayProductDetails() {\n //loading picture offline\n Picasso.get().load(pImage).networkPolicy(NetworkPolicy.OFFLINE)\n .placeholder(R.drawable.warning).into(productImage, new Callback() {\n @Override\n public void onSuccess() {\n\n }\n\n @Override\n public void onError(Exception e) {\n Picasso.get().load(pImage)\n .placeholder(R.drawable.warning).into(productImage);\n }\n });\n productName.setText(pName);\n productPrize.setText(pPrice);\n\n try{\n if (pCategory.equalsIgnoreCase(\"Bulk Purchase\")){\n quantity.setText(pLimitedQty);\n }\n } catch (Exception ex){\n Log.i(\"error\", ex.getMessage());\n catchErrors.setErrors(ex.getMessage(), dateAndTime.getDate(), dateAndTime.getTime(),\n \"OrderProductActivity\", \"displayProductDetails\");\n }\n }",
"@Override\r\n\tpublic void ManageProduct() {\n\t\tint id = this.view.enterId();\r\n\t\tString name = this.view.enterName();\r\n\t\tfloat price = this.view.enterPrice();\r\n\t\tint quantity = this.view.enterQuantity();\r\n\t\t\r\n\t\tthis.model.updProduct(id, name, price, quantity);\r\n\t}",
"public String getfirstVolumeDiscountonProductDetailPage()\n\t{\n\t\twaitForVisibility(firstVolumeDiscountonProductDetailPage);\n\t\treturn firstVolumeDiscountonProductDetailPage.getText();\n\t}",
"@GetMapping(\"/viewItem/{id}\")\n\tpublic ModelAndView viewItemById(@PathVariable(value=\"id\") long id) {\n\t\tModelAndView mv = new ModelAndView();\n\t\tItem item = itemService.findItemById(id);\n\t\tmv.setViewName(\"preview\");\n\t\tmv.addObject(\"item\", item);\n\t\t\n\t\treturn mv;\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 }",
"@RequestMapping(value=\"ProductDetail/{id}\",method=RequestMethod.GET)\r\n\tpublic String searchId(@PathVariable(\"id\")String id,ModelMap model){\r\n\t\tProductTO productTO=new ProductTO();\r\n\t\tproductTO=searchService.getProductById(id);\r\n\t\tmodel.addAttribute(\"productTO\", productTO);\r\n\t\treturn \"ProductDetail\";\r\n\t}",
"public abstract String showDetails();",
"@Given(\"I am on the product page\")\n\t\tpublic void i_am_on_the_product_page() {\n\t\t\tdriver.get(ExpectedUrl);\n\t\t}",
"@RequestMapping(value={\"/manageProducts\",\"/Product\"}, method=RequestMethod.GET)\n\tpublic ModelAndView manageProducts()\n\t{\n\t\tModelAndView mv=new ModelAndView(\"admin/Product\");\n\t\tmv.addObject(\"isAdminClickedProducts\",\"true\");\n\t\tmv.addObject(\"product\", new Product());\n\t\tsetData();\n\t\treturn mv;\n\t}",
"@RequestMapping(\"/viewproducts\") \r\n public ModelAndView viewproducts(){ \r\n List<Product> list=productDao.getAllProducts();\r\n return new ModelAndView(\"viewproducts\",\"list\",list); \r\n }",
"@GetMapping(\"/sysadm/product\")\n public String showAllProduct() {\n return \"admin/sysadm/productList\";\n }",
"@GetMapping(\"/product/{id}\")\n\tpublic Product getProductById(@PathVariable(\"id\") Long id);",
"public String editProduct() {\n ConversationContext<Product> ctx = ProductController.newEditContext(products.getSelectedRow());\n ctx.setLabelWithKey(\"part_products\");\n ctx.setCallBack(editProductCallBack);\n getCurrentConversation().setNextContextSub(ctx);\n return ctx.view();\n }",
"@Override\n public void onListItemSelected(String asinID,String title,String price) {\n if(UtilityFunctions.isNetworkAvailable(getActivity())) {\n Intent i = new Intent(getActivity(), ProductInformationPageActivity.class);\n i.putExtra(Tag.PIP_URL, Tag.PIP_URL + asinID);\n i.putExtra(Tag.TITLE, title);\n i.putExtra(Tag.PRICE, price);\n startActivity(i);\n }\n else\n {\n Toast.makeText(getActivity(),Tag.NO_INTERNET,Toast.LENGTH_SHORT).show();\n }\n }",
"private void viewProducts(){\n Database manager = new Database(this, \"Market\", null, 1);\n\n SQLiteDatabase market = manager.getWritableDatabase();\n\n Cursor row = market.rawQuery(\"select * from products\", null);\n\n if (row.getCount()>0){\n while(row.moveToNext()){\n listItem.add(row.getString(1));\n listItem.add(row.getString(2));\n listItem.add(row.getString(3));\n listItem.add(row.getString(4));\n }\n adapter = new ArrayAdapter(\n this, android.R.layout.simple_list_item_1, listItem\n );\n productList.setAdapter(adapter);\n } else {\n Toast.makeText(this, \"No hay productos\", Toast.LENGTH_SHORT).show();\n }\n }",
"@Override\n public void onClick(View view) {\n Intent detail = new Intent(getBaseContext(), DetailArticle.class);\n detail.putExtra(\"webURL\", webHotURL);\n startActivity(detail);\n }",
"@Override\n public void loadDetailProductData() {\n mDetailPresenter.loadDetailProductData();\n }",
"public String getsecondVolumeDiscountonProductDetailPage()\n\t{\n\t\twaitForVisibility(secondVolumeDiscountonProductDetailPage);\n\t\treturn secondVolumeDiscountonProductDetailPage.getText();\n\t}",
"@RequestMapping(value=\"/manage_product_edit/{id}\", method=RequestMethod.GET)\n\tpublic ModelAndView editProduct(@PathVariable(\"id\")String id)\n\t{\n\t\tModelAndView mv = new ModelAndView(\"/admin/Product\");\n\t\tProduct prod =productDAO.getProductById(id);\n\t\tmv.addObject(\"product\",prod);\n\t\tmv.addObject(\"isEditing\",true);\n\t\t\n\t\treturn mv;\t\n\t}",
"public void getProducts(String eId){\n // invoke getProductsById from ProductDatabse and assign products, productIds and productNames\n products = myDb.getProductsById(eId);\n productIds = new ArrayList<Integer>();\n ArrayList<String> productNames = new ArrayList<String>();\n for(Product product: products){\n productIds.add(Integer.parseInt(product.getProductId()));\n productNames.add(product.getProductName());\n }\n //if products exists in database then its displayed as a list else no products message is displayed\n if(products.size() > 0){\n productsadded.setVisibility(View.VISIBLE);\n noproducts.setVisibility(View.GONE);\n }else{\n productsadded.setVisibility(View.GONE);\n noproducts.setVisibility(View.VISIBLE);\n }\n otherProductAdapter = new ArrayAdapter<String>(this,\n android.R.layout.simple_expandable_list_item_1, productNames);\n otherProductsList.setAdapter(otherProductAdapter);\n if(productNames.size() > 0){\n //invoked on click of the product\n otherProductsList.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Intent intent = new Intent(OtherEventsProductsActivity.this, PurchaseProductActivity.class);\n intent.putExtra(\"eventId\", eventId);\n intent.putExtra(\"productId\", \"\"+productIds.get(position));\n intent.putExtra(\"status\", \"view\");\n startActivity(intent);\n }\n });\n }\n }",
"@Override\n public void onClick(View v) {\n if (postmodel.getSellType() == 1) {\n\n Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(postmodel.getProductLink()));\n context.startActivity(i);\n } else {\n Bundle bundle = new Bundle();\n bundle.putStringArray(\"images\", finalImageArray);\n Intent intent = new Intent(context, ProductPage.class);\n intent.putExtra(\"product_name\", postmodel.getProductName());\n intent.putExtra(\"product_cat\", postmodel.getProductCat());\n intent.putExtra(\"product_desc\", postmodel.getProductDesc());\n intent.putExtra(\"product_link\", postmodel.getProductLink());\n intent.putExtra(\"product_price\", String.valueOf(postmodel.getProductPrice()));\n intent.putExtra(\"id\", String.valueOf(postmodel.getId()));\n intent.putExtras(bundle);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(intent);\n }\n\n }",
"@Override\n public void onClick(View v) {\n ArticleUtil.launchDetailActivity(mContext, bean.getAid(), bean.getSid(), bean.getAl(), false, bean);\n GoogleAnalyticsTracker.setGoogleAnalyticsEvent(mContext, \"Related Article\", \"Related article: Article Clicked\", \"Article detail page\");\n FlurryAgent.logEvent(\"Related Article: \" + \"Article Clicked\");\n }",
"public void viewOrderDetails(){\n\t\tlibManhattanCommonFunctions.clickAnyElement(getPageElement(\"StatisticsTab\"), \"StatisticsTab\");\n\t\tlibManhattanCommonFunctions.clickAnyElement(getPageElement(\"OrdersTab\"), \"OrdersTab\");\n\t\tlibManhattanCommonFunctions.clickAnyElement(getPageElement(\"BtnOrderDetails\"), \"Order Details Button\");\t\n\t}",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\tIntent it = new Intent(getActivity(), DetailActivity.class);\n\t\t\t\tBundle bundle = new Bundle();\n\t\t\t\tbundle.putString(MangaInfoFrag.MANGA_LINK_STRING, getActivity()\n\t\t\t\t\t\t.getResources().getString(R.string.domain)\n\t\t\t\t\t\t+ results.get(position - 1).getLink());\n\t\t\t\tit.putExtras(bundle); \n\t\t\t\tstartActivity(it);\n\t\t\t\tToast.makeText(getActivity(),\n\t\t\t\t\t\tresults.get(position - 1).getLink(), Toast.LENGTH_SHORT)\n\t\t\t\t\t\t.show();\n\t\t\t}",
"@GetMapping(\"/view-all\")\r\n\tpublic List<ProductDetails> viewAllProducts() {\r\n\r\n\t\treturn productUtil.toProductDetailsList(productService.viewAllProducts());\r\n\t}",
"public List<Products> getProductsDetails() {\n\t\treturn productsRepo.findAll();\n\t}",
"@Override\n public void onClick(View v) {\n Intent detail=new Intent(getBaseContext(),DetailArticle.class);\n detail.putExtra(\"webURL\",webHotURL);\n startActivity(detail);\n }",
"@RequestMapping(value = \"/showProductGrn\", method = RequestMethod.GET)\n\t public ModelAndView showEmployee(ModelAndView model) \n\t {\n\t model.addObject(\"grnProduct\", new GrnProduct());\n\t \n\t model.setViewName(\"productgrn/createProductGrn\");\n\t \n\t\t\treturn model;\n\t }",
"public static void sendViewedProduct(final Context context, final Product product)\r\n {\r\n SharedPreferencesManager sharedPreferencesManager = new SharedPreferencesManager(context);\r\n\r\n User user = sharedPreferencesManager.retrieveUser();\r\n long id = user.getId();\r\n\r\n String fixedURL = Utils.fixUrl(Properties.SERVER_URL + \":\" + Properties.SERVER_SPRING_PORT\r\n + \"/users/\" + id + \"/\" + product.getId() + \"/\" + Properties.ACTION_VIEWED);\r\n\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Conectando con: \" + fixedURL + \" para marcar el producto como visto\");\r\n\r\n StringRequest stringRequest = new StringRequest(Request.Method.GET\r\n , fixedURL\r\n , new Response.Listener<String>()\r\n {\r\n @Override\r\n public void onResponse(String response) {}\r\n }\r\n , new Response.ErrorListener()\r\n {\r\n @Override\r\n public void onErrorResponse(VolleyError error) {}\r\n });\r\n\r\n VolleySingleton.getInstance(context).addToRequestQueue(stringRequest);\r\n }",
"@RequestMapping(\"/showForm\")\n\t\tpublic String displayDetails(){\n\t\t\treturn \"mngt-page\";\n\t\t}",
"public void printProduct(int id)\n {\n Product product = findProduct(id);\n \n if(product != null) \n {\n System.out.println(product.toString());\n }\n }",
"@RequestMapping(\"/index\")\r\n\tpublic ModelAndView index(@RequestParam(value = \"productId\", required = false) String productId,\r\n Map<String, Object> map) {\r\n\t\tif(!StringUtils.isEmpty(productId)) {\r\n\t\t\tProductInfo productInfo = productService.findByProductId(productId);\r\n\t\t\tmap.put(\"productInfo\", productInfo);\r\n\t\t}\r\n\t\t\r\n\t\t// Query all the product category\r\n List<ProductCategory> categoryList = categoryService.findAll();\r\n map.put(\"categoryList\", categoryList);\r\n map.put(\"defaultImage\", defaultImageUrl);\r\n\r\n return new ModelAndView(\"product/index\", map);\r\n\t}",
"@ApiOperation(value = \"Get details of a Product\", response = ProductDetail.class)\n\t@ApiResponses(value = {\n @ApiResponse(code = 200, message = \"Return the total and a list of products\", response = ProductDetail.class ),\n @ApiResponse(code = 400, message = \"Return a error object\", response = error.class) })\n\t\n\t@GetMapping(path = \"/api/products/{product_id}/details\")\n\tpublic ResponseEntity<Optional<ProductDetail>> getDetailsProduct(\n\t\t\t@PathVariable(name = \"product_id\", required = true) Integer productId) {\n\t\treturn ResponseEntity.ok(productService.getProductDetails(productId));\n\t}",
"@NonNull\n @SuppressLint({\"SetTextI18n\", \"DefaultLocale\"})\n public View getView(int position, View convertView, @NonNull ViewGroup parent) {\n View row = convertView != null ? convertView\n : LayoutInflater.from(parent.getContext())\n .inflate(R.layout.simple_list_product, parent, false);\n Product product = productList.get(position);\n ImageView icon = row.findViewById(R.id.imageView2);\n if (product.getURL().contains(\"amazon\")) {\n icon.setImageResource(R.drawable.amazon256);\n }\n if (product.getURL().contains(\"ebay\")) {\n icon.setImageResource(R.drawable.ebay256);\n }\n if (product.getURL().contains(\"walmart\")) {\n icon.setImageResource(R.drawable.walmart256);\n }\n if (product.getURL().contains(\"homedepot\")) {\n icon.setImageResource(R.drawable.homedepot256);\n }\n ConstraintLayout layout = row.findViewById(R.id.frameLayout);\n layout.setOnLongClickListener((view1) -> createPopup(view1, position));\n layout.setOnClickListener(v -> detailedClicked(position));\n TextView view = row.findViewById(R.id.productNameString);\n view.setText(Html.fromHtml(String.format(\"<b>%s</b>\",\n product.getName())));\n TextView view2 = row.findViewById(R.id.description);\n String color = \"\";\n if (product.getChange() < 0) {\n color = \"#008000\";\n } else if (product.getChange() > 0) {\n color = \"#FF0000\";\n }\n view2.setText(Html.fromHtml(String.format(\"<b>Current Price:</b> $%.2f<br>\" +\n \"<b>Change:</b> <font color='%s'>%.2f%%<br></font> \" +\n \"<b>Date Added:</b> %s\",\n product.getCurrentPrice(), color, product.getChange(), product.getDate())));\n return row;\n }",
"@GetMapping(path = \"/detail/\")\n\tpublic String viewProjectDetail() {\n\t\treturn \"sprint-detail\";\n\t}",
"public void linkProduct() {\n Product result;\n String supplierID = getToken(\"Enter supplier ID: \");\n if (warehouse.searchSupplier(supplierID) == null) {\n System.out.println(\"No such supplier!\");\n return;\n }\n do {\n String productID = getToken(\"Enter product ID: \");\n result = warehouse.linkProduct(supplierID, productID);\n if (result != null) {\n System.out.println(\"Product [\" + productID + \"] assigned to supplier: [\" + supplierID + \"]\");\n }\n else {\n System.out.println(\"Product could not be assigned\");\n }\n if (!yesOrNo(\"Assign more products to supplier: [\" + supplierID + \"]\")) {\n break;\n }\n } while (true);\n }",
"public String getProduct_id() {\n return product_id;\n }",
"public String getProduct_id() {\n return product_id;\n }",
"@RequestMapping(value = Constants.GET_PRODUCT_BY_ID, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n public ResponseEntity<String> getProductDetails(@PathVariable (Constants.ID) Integer id) {\n try {\n ResponseWrapper result = productService.getProductDetails(id);\n ObjectMapper mapper = new ObjectMapper().configure(SerializationFeature.WRITE_NULL_MAP_VALUES, false);\n mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);\n return new ResponseEntity<>(mapper.writeValueAsString(result), HttpStatus.OK);\n }\n catch (Exception e) {\n logger.error(Constants.EXCEPTION + e);\n return ExceptionHandler.handleException();\n }\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n String id = request.getParameter(\"id\");\n int productId = Integer.parseInt(id);\n DBOperations dbOps = new DBOperations(); //instantiate dboperations object\n Product product = dbOps.getProductDetailsByID(productId);//retrieved product\n ArrayList<Product> products = dbOps.getRelatedProductsList(productId, 4);\n //attaches product info to jsp\n if (product == null) {\n request.setAttribute(\"product\", new Product(-1, \"No Such Product found\", 0, \"\", \"notfound.jpg\"));\n //products = dbOps.getAllProductsList();\n } else {\n request.setAttribute(\"product\", product);\n \n }\n //attach related products list\n request.setAttribute(\"products\", products);\n request.getRequestDispatcher(\"purchase.jsp\").forward(request, response);\n }",
"void clickProduct(View v);",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\tItemDetails itemDetails = (ItemDetails) list.getAdapter()\n\t\t\t\t\t\t.getItem(arg2);\n\n\t\t\t\tnew AlertDialog.Builder(FindAProductActivity.this)\n\t\t\t\t\t\t.setTitle(\"Information:\")\n\t\t\t\t\t\t.setMessage(\"\" + itemDetails.getName())\n\t\t\t\t\t\t.setIcon(android.R.drawable.ic_dialog_info)\n\t\t\t\t\t\t.setNeutralButton(\"OK\", null).show();\n\n\t\t\t\t// Bundle bundle = new Bundle();\n\t\t\t\t// bundle.putSerializable(\"ItemDetails\", itemDetails);\n\t\t\t\t// i.putExtras(bundle);\n\t\t\t\t// startActivity(i);\n\t\t\t}",
"@Override\n public void onClick(View v) {\n mContext.startActivity(new Intent(mContext, DetailActivity.class).putExtra(\"resourceId\", bean.getId()).putExtra(\"resourceType\", bean.getResourceType()));\n }",
"@Override\n public void onClick(View v) {\n\n Intent intent = new Intent(getApplicationContext(), DetailActivity.class);\n intent.putExtra(Constant.INTENT_WEB_URL, webHotUrl);\n startActivity(intent);\n }",
"private void showImageDetail() {\n }",
"public String getProductid() {\n return productid;\n }",
"@GetMapping(\"/products/{id}\")\r\n\t@ApiOperation(value=\"Return unique product.\")\r\n\tpublic Product showOneProduct(@PathVariable(value=\"id\") long id){\n\t\treturn productRepository.findById(id);\r\n\t}",
"public String getProductName(){\n return productRelation.getProductName();\n }",
"@GetMapping(\"/getProduct/{id}\")\n\tpublic Product getProduct(@PathVariable(\"id\") Long id){\n\n\t\treturn productServiceImpl.getProduct(id);\n\t}",
"void displayDetails(String title, String description);"
] | [
"0.73371446",
"0.7273705",
"0.69849163",
"0.69743675",
"0.6949923",
"0.6927073",
"0.6691482",
"0.6658273",
"0.6642353",
"0.6619179",
"0.6604479",
"0.64675677",
"0.64466584",
"0.6381643",
"0.6284705",
"0.62716866",
"0.6265276",
"0.6238536",
"0.62207735",
"0.62207097",
"0.62111753",
"0.6190851",
"0.6183534",
"0.6172201",
"0.61694354",
"0.615906",
"0.6134611",
"0.61295307",
"0.61253095",
"0.61146027",
"0.60898834",
"0.6087739",
"0.60759234",
"0.6056914",
"0.60343057",
"0.6032464",
"0.6030421",
"0.60227215",
"0.600282",
"0.59736884",
"0.59659255",
"0.59601307",
"0.5958008",
"0.5946262",
"0.5927961",
"0.59272647",
"0.592132",
"0.58827955",
"0.58739126",
"0.58498585",
"0.58408093",
"0.58387315",
"0.58337593",
"0.5826896",
"0.58227175",
"0.582055",
"0.58019483",
"0.58012825",
"0.57832986",
"0.57812285",
"0.57800734",
"0.57771957",
"0.5769423",
"0.57628655",
"0.5760258",
"0.575321",
"0.5752508",
"0.57444865",
"0.574118",
"0.5732081",
"0.573064",
"0.57195485",
"0.57095754",
"0.57094413",
"0.5708454",
"0.5693571",
"0.5689916",
"0.5684253",
"0.56788796",
"0.56687903",
"0.5662214",
"0.56534547",
"0.5643896",
"0.56397957",
"0.5632816",
"0.56251895",
"0.5624552",
"0.5624552",
"0.5624253",
"0.5622409",
"0.5621903",
"0.56192535",
"0.5608372",
"0.56021374",
"0.56005585",
"0.5599797",
"0.55988616",
"0.5597586",
"0.5597103",
"0.55959326"
] | 0.7088738 | 2 |
Constructor for use by VcfReaderFactory | VcfReader(VcfParser parser, BrLineReader in) throws IOException {
this(parser, in, parser.parseHeader(in));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"VcfReader(VcfParser parser, LineReader reader, VcfHeader header) throws IOException {\n mParser = parser;\n mIn = reader;\n mHeader = header;\n mNumSamples = mHeader.getNumberOfSamples();\n setNext();\n }",
"public FvFactoryImpl() {\n\t\tsuper();\n\t}",
"public Reader(){\n\n\t}",
"public FeedReaderContract() {}",
"public FeedReaderContract() {}",
"public FeedReaderContract() {}",
"public FeedReaderContract() {}",
"private CoverageReaderContract() {}",
"private CustomerReader()\r\n\t{\r\n\t}",
"public VizualizerFactoryImpl()\n {\n super();\n }",
"public CustomerReader() {\r\n }",
"public PajekNetReader()\n {\n this(false, false);\n }",
"public FeedReaderContract() {\n }",
"private VegetableFactory() {\n }",
"public BlobFilterDetails() {\n }",
"private RawGltfDataReader() {\n // Private constructor to prevent instantiation\n }",
"private FeedReaderContract() {}",
"private TextReader() {\n // There are no fields required to initialize\n }",
"private FeedReaderContract() {\n }",
"public MsxReader ( ) {\r\n\t\tsuper();\r\n\t}",
"public \n PipedObjectReader() \n {}",
"private ConfigReader() {\r\n\t\tsuper();\r\n\t}",
"public InstanceReader(String filename) throws FileNotFoundException{\n this.reader = new FileReader(filename);\n }",
"public StreamReader() {}",
"private CategoriesReaderFactory() {\n }",
"public VCRStateAdapter() {}",
"public ExternalServiceLayerCIMFactoryImpl() {\n\t\tsuper();\n\t}",
"protected StatDataFileReaderSpi() {\n }",
"public FileDicomBaseInner() {}",
"public XpeDccNewContractSetupROVORowImpl() {\n }",
"public ColorFabRollInvVOImpl() {\n }",
"public CarroResource() {\r\n }",
"@Override\n public void construct() throws IOException {\n \n }",
"public CLONDATAFactoryImpl() {\n\t\tsuper();\n\t}",
"public Object getReaderCtor(String paramString) {\n }",
"public ObjReader(String filename){\n file = filename;\n }",
"@Override\n\tpublic void init(String file_name) { deserialize(file_name); }",
"public Factory() {\n this(getInternalClient());\n }",
"public void init(BinaryDataReader dataReader) throws IOException\n\t{\n\t}",
"public ConstantPoolReader() {\n }",
"private BookReader() {\n\t}",
"private MappingReader() {\n\t}",
"public CvFile() {\n }",
"public Vaccine() {\n\t}",
"public VITACareer()\r\n {\r\n }",
"public Factory() {\n\t\tsuper();\n\t}",
"private CatalogContract() {}",
"public SwimConnectionFactory() {\n\t\tsuper();\n\t}",
"public AbstractRetriever() {\n }",
"public VOCSesame () {\n }",
"public VfsSaxSource(XMLReader xmlReader, VfsInputSource inputSource) {\r\n\t\tsuper(xmlReader, inputSource);\r\n\t}",
"private BookReader() {\r\n }",
"public VehicleInfoAvro() {}",
"public Tass4Reader ( ) {\r\n\t\tsuper();\r\n\t}",
"public CreChqTrnValVerUVOClient() {\n }",
"public DocumentReader ()\n {\n this.instanceStatus = new ServiceInstanceStatus(serviceStatus);\n this.instanceStatus.notifyCreation();\n }",
"public PropertyReader(String propertyFileName)\r\n\t{\r\n\t\tthis.propertyFileName = propertyFileName;\r\n\t}",
"protected StreamParser()\n {\n }",
"private BlobFromFile() {\n }",
"public XCanopusFactoryImpl()\r\n {\r\n super();\r\n }",
"private CardReaderMonitorFactory() {\t\t\n\t}",
"public ObjectFactory() {\n super(grammarInfo);\n }",
"public Constructor(){\n\t\t\n\t}",
"private TemplateReader() {\n }",
"public TurnoVOClient() {\r\n }",
"public FileObjectFactory() {\n }",
"public MetaDataContract()\n {\n }",
"protected VersionData() {}",
"public EcoreFactoryImpl() {\n super();\n }",
"public AvroPerson() {}",
"public BaseContract() {}",
"private TMDBContract() {\n }",
"public EcoreFactoryImpl()\n {\n super();\n }",
"private PtTlsReaderFactory() {\n throw new AssertionError();\n }",
"public EsoFactoryImpl()\r\n {\r\n super();\r\n }",
"private FavouriteContract() {\n }",
"public StatDataFileReader createReaderInstance() throws IOException{\n return createReaderInstance(null);\n }",
"Constructor() {\r\n\t\t \r\n\t }",
"public ObjectFactory() {\n\t}",
"private VerifierFactory() {\n }",
"public CloudFileSystem(VRSContext context, ServerInfo info)\n throws VlInitializationException, VlPasswordException, VRLSyntaxException, VlIOException, VlException {\n super(context, info);\n\n if (info.getServerVRL().getScheme().endsWith(\"ssl\")) {\n init(info, context, \"https\");\n } else {\n init(info, context, \"http\");\n }\n try {\n connect();\n } catch (Exception ex) {\n if (ex instanceof VlConfigurationError && ex.getMessage().contains(\"Unrecognized SSL message, plaintext connection?\")) {\n disconnect();\n init(info, context, \"http\");\n connect();\n }\n if (ex.getMessage() != null && ex.getMessage().contains(\"Unrecognized SSL message, plaintext connection?\")) {\n } else {\n throw new nl.uva.vlet.exception.VlInitializationException(ex.getMessage());\n }\n }\n }",
"public CarResource() {\n }",
"private ResourceFactory() {\r\n\t}",
"public AFMV() {\r\n }",
"public FWMSStockExchangeVOImpl() {\r\n }",
"public ObjectFactory() {\r\n\t}",
"public ServiceClient() {\n\t\tsuper();\n\t}",
"private RecentCardDBContract() {}",
"public KaChingContract() {\n\t}",
"public VibrationalStructureInfo() {\n }",
"public SapFactoryImpl() {\n super();\n }",
"public ProtoVehicle() {\n super();\n }",
"public CalccustoRequest()\r\n\t{\r\n\t}",
"protected ReaderContext<FSDataInputStream> createDelimitedReaderContext()\n {\n return new ReaderContext.ReadAheadLineReaderContext<FSDataInputStream>();\n }",
"public SimpleDocReader() { }",
"public CommonsFactoryImpl() {\n\t\tsuper();\n\t}",
"public KeyVaultProperties() {\n }",
"public LibraryAdapterFactory() {\r\n\t}",
"public EcoreFactoryImpl() {\r\n\t\tsuper();\r\n\t}",
"public XpeDccContractLineImpl() {\n }"
] | [
"0.70230204",
"0.65441054",
"0.6503183",
"0.6262169",
"0.6262169",
"0.6262169",
"0.6262169",
"0.6221678",
"0.6186544",
"0.61302304",
"0.61140347",
"0.61130023",
"0.61002004",
"0.60946447",
"0.6080122",
"0.60397136",
"0.60178065",
"0.60051304",
"0.59772694",
"0.5967394",
"0.5960591",
"0.5952856",
"0.59189534",
"0.5905386",
"0.59047323",
"0.58676803",
"0.58638906",
"0.58351624",
"0.5827298",
"0.580674",
"0.5801273",
"0.58006203",
"0.5788386",
"0.578338",
"0.57833415",
"0.57802916",
"0.5770889",
"0.5761793",
"0.5760028",
"0.57491827",
"0.57389235",
"0.57211703",
"0.5719877",
"0.5714708",
"0.5714186",
"0.57123464",
"0.57102394",
"0.57034266",
"0.56981856",
"0.56793964",
"0.56778944",
"0.56736535",
"0.56706184",
"0.5667469",
"0.566666",
"0.5662262",
"0.5659563",
"0.56524575",
"0.5650339",
"0.564928",
"0.5634588",
"0.5630618",
"0.5630355",
"0.5624781",
"0.561064",
"0.5610194",
"0.56056076",
"0.56050694",
"0.5604895",
"0.55908173",
"0.5588411",
"0.55840147",
"0.5579651",
"0.557202",
"0.5567028",
"0.5558426",
"0.55569816",
"0.5554295",
"0.5554055",
"0.5553209",
"0.5548769",
"0.55236864",
"0.5520368",
"0.5519255",
"0.55181754",
"0.55181324",
"0.55083895",
"0.5506371",
"0.549667",
"0.5494111",
"0.5486957",
"0.54868555",
"0.54816043",
"0.5480694",
"0.54772633",
"0.5452881",
"0.5451217",
"0.54450274",
"0.54444",
"0.5443371"
] | 0.7215541 | 0 |
Read VcfRecords from a region of a blockcompressed file, preparsed header | VcfReader(VcfParser parser, LineReader reader, VcfHeader header) throws IOException {
mParser = parser;
mIn = reader;
mHeader = header;
mNumSamples = mHeader.getNumberOfSamples();
setNext();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"UnalignedRecords read(long position, int size) throws IOException;",
"private void processRecordBlock(String[][] vcfRecords, Gzipper out) throws Exception {\n\t\tif (vcfRecords[0] == null) return;\n\t\t\n\t\t//run queries\n\t\tJSONObject jsonResultsVcf = null;\n\t\tJSONObject jsonResultsBed = null;\n\n\t\t//remote service?\n\t\tif (queryURL != null){\n\t\t\t//create search strings, any vcfs to query?\n\t\t\tString[] searchStrings = makeSearchUrls(vcfRecords);\n\t\t\tif (searchStrings != null) {\n\t\t\t\t//execute vcf query\n\t\t\t\tjsonResultsVcf = new JSONObject(query(searchStrings[0]));\n\t\t\t\tjsonResultsBed = new JSONObject(query(searchStrings[1]));\n\t\t\t}\n\t\t}\n\t\t//local file system query?\n\t\telse {\n\t\t\tif (loadVcfsBedsToQuery(vcfRecords)) {\n\t\t\t\tquery(userQueryVcf);\n\t\t\t\tquery(userQueryBed);\n\t\t\t\tjsonResultsVcf = userQueryVcf.getResults();\n\t\t\t\tjsonResultsBed = userQueryBed.getResults();\n\t\t\t}\n\t\t}\n\n\t\t//parse and annotate\n\t\tif (jsonResultsVcf != null && jsonResultsBed != null) {\n\n\t\t\tif (debug) IO.p(\"VCF RETURN\\n\"+jsonResultsVcf.toString(1));\t\t\t\n\t\t\tloadVcfResults(jsonResultsVcf);\n\n\t\t\tif (debug) IO.p(\"BED RETURN\\n\"+jsonResultsBed.toString(1));\n\t\t\tloadBedResults(jsonResultsBed);\n\n\t\t\t//for each record\n\t\t\tfor (int i=0; i< vcfRecords.length; i++){\n\t\t\t\t//pull counts and calc ratio\n\t\t\t\tString[] vcf = vcfRecords[i];\n\t\t\t\tif (vcf == null) break;\n\t\t\t\tdouble vcfCount = idVcfCount[i];\n\t\t\t\tdouble bedCount = idBedCount[i];\n\t\t\t\tdouble ratio = 0;\n\t\t\t\tif (bedCount > 0) {\n\t\t\t\t\tratio = vcfCount/bedCount;\n\t\t\t\t\tif (ratio > 1.0) ratio = 1.0;\n\t\t\t\t}\n\t\t\t\tString cf = \"CF=\"+Num.formatNumber(ratio, 3)+\",\"+(int)vcfCount+\",\"+(int)bedCount;\n\n\t\t\t\t//modify INFO field of each record\n\t\t\t\tvcfRecords[i][7] = cf+\";\"+vcfRecords[i][7];\n\t\t\t\tboolean printMe = true;\n\n\t\t\t\t//check bed count, must pass this before any filtering is applied.\n\t\t\t\tif (bedCount >= minBedCount) {\n\t\t\t\t\thist.count(ratio);\n\t\t\t\t\tif (ratio > maxCallFreq){\n\t\t\t\t\t\t//just append or skip\n\t\t\t\t\t\tif (appendFilter) vcfRecords[i][6] = modifyFilter(vcfRecords[i][6]);\n\t\t\t\t\t\telse printMe = false;\n\t\t\t\t\t\tnumFailingCallFreq++;\n\t\t\t\t\t}\n\t\t\t\t\telse numPassingCallFreq++;\n\t\t\t\t}\n\t\t\t\telse numWithLowBedCount++;\n\n\t\t\t\t//print it?\n\t\t\t\tif (printMe){\n\t\t\t\t\tout.print(vcf[0]);\n\t\t\t\t\tfor (int x=1; x< vcf.length; x++){\n\t\t\t\t\t\tout.print(\"\\t\");\n\t\t\t\t\t\tout.print(vcf[x]);\n\t\t\t\t\t}\n\t\t\t\t\tout.println();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse throw new IOException(\"Error! the json vcf or bed result is null?!\");\n\t\tSystem.out.print(\".\");\n\n\t}",
"int readFrom(byte[] iStream, int pos, ORecordVersion version);",
"void readBlock(int blockId, byte[] buffer, int offset) throws IOException;",
"protected void readBlock(BlockMetadata blockMetadata) throws IOException\n {\n readerContext.initialize(stream, blockMetadata, consecutiveBlock);\n ReaderContext.Entity entity;\n while ((entity = readerContext.next()) != null) {\n\n counters.getCounter(ReaderCounterKeys.BYTES).add(entity.getUsedBytes());\n\n byte[] record = entity.getRecord();\n\n if (record != null) {\n counters.getCounter(ReaderCounterKeys.RECORDS).increment();\n records.emit(record);\n }\n }\n }",
"@Test\n void testFirstBlock() throws Exception {\n HMEFMessage msg;\n try (InputStream is = _samples.openResourceAsStream(\"quick-winmail.dat\")) {\n msg = new HMEFMessage(is);\n }\n\n MAPIAttribute attr = msg.getMessageMAPIAttribute(MAPIProperty.RTF_COMPRESSED);\n assertNotNull(attr);\n MAPIRtfAttribute rtfAttr = (MAPIRtfAttribute) attr;\n\n // Truncate to header + flag + data for flag\n byte[] data = Arrays.copyOf(rtfAttr.getRawData(), 16 + 12);\n\n // Decompress it\n CompressedRTF comp = new CompressedRTF();\n byte[] decomp = comp.decompress(new ByteArrayInputStream(data));\n String decompStr = new String(decomp, StandardCharsets.US_ASCII);\n\n // Test\n assertEquals(block1.length(), decomp.length);\n assertEquals(block1, decompStr);\n }",
"protected byte[] readRecordData(RecordHeader header) throws IOException {\n byte[] buf = new byte[header.dataCount];\n file.seek(header.dataPointer);\n file.readFully(buf);\n return buf;\n }",
"public void testFetchBlocks() throws IOException {\n\t\tLocalRawDataBlockList list = new LocalRawDataBlockList();\r\n\t\tbyte[] data = new byte[512];\r\n\t\tint offset = 0;\r\n\r\n\t\tLittleEndian.putInt(data, offset, -3); // for the BAT block itself\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 1: is at end of file already; start block = -2\r\n\t\t// document 2: has only one block; start block = 1\r\n\t\tLittleEndian.putInt(data, offset, -2);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 3: has a loop in it; start block = 2\r\n\t\tLittleEndian.putInt(data, offset, 2);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 4: peeks into document 2's data; start block = 3\r\n\t\tLittleEndian.putInt(data, offset, 4);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\t\tLittleEndian.putInt(data, offset, 1);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 5: includes an unused block; start block = 5\r\n\t\tLittleEndian.putInt(data, offset, 6);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\t\tLittleEndian.putInt(data, offset, -1);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 6: includes a BAT block; start block = 7\r\n\t\tLittleEndian.putInt(data, offset, 8);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\t\tLittleEndian.putInt(data, offset, 0);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 7: includes an XBAT block; start block = 9\r\n\t\tLittleEndian.putInt(data, offset, 10);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\t\tLittleEndian.putInt(data, offset, -4);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 8: goes off into space; start block = 11;\r\n\t\tLittleEndian.putInt(data, offset, 1000);\r\n\t\toffset += LittleEndianConsts.INT_SIZE;\r\n\r\n\t\t// document 9: no screw ups; start block = 12;\r\n\t\tint index = 13;\r\n\r\n\t\tfor (; offset < 508; offset += LittleEndianConsts.INT_SIZE) {\r\n\t\t\tLittleEndian.putInt(data, offset, index++);\r\n\t\t}\r\n\t\tLittleEndian.putInt(data, offset, -2);\r\n\t\tlist.add(new RawDataBlock(new ByteArrayInputStream(data)));\r\n\t\tlist.fill(1);\r\n\t\tint[] blocks = { 0 };\r\n\t\tBlockAllocationTableReader table = new BlockAllocationTableReader(\r\n\t\t POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS, 1, blocks, 0, -2, list);\r\n\t\tint[] start_blocks = { -2, 1, 2, 3, 5, 7, 9, 11, 12 };\r\n\t\tint[] expected_length = { 0, 1, -1, -1, -1, -1, -1, -1, 116 };\r\n\r\n\t\tfor (int j = 0; j < start_blocks.length; j++) {\r\n\t\t\ttry {\r\n\t\t\t\tListManagedBlock[] dataBlocks = table.fetchBlocks(start_blocks[j], -1, list);\r\n\r\n\t\t\t\tif (expected_length[j] == -1) {\r\n\t\t\t\t\tfail(\"document \" + j + \" should have failed, but found a length of \"\r\n\t\t\t\t\t\t\t+ dataBlocks.length);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tassertEquals(expected_length[j], dataBlocks.length);\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tif (expected_length[j] == -1) {\r\n\r\n\t\t\t\t\t// no problem, we expected a failure here\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow e;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"void readBlock(int blockId, byte[] buffer) throws IOException;",
"VcfReader(VcfParser parser, BrLineReader in) throws IOException {\n this(parser, in, parser.parseHeader(in));\n }",
"@SuppressWarnings(\"unused\")\n public static MassSpecExtractedData extractMetaAndBlockDataFromFileVersion_1_0(Path inputDataFile) throws IOException {\n MassSpecExtractedData massSpecExtractedData = new MassSpecExtractedData();\n List<String> contentsByLine = new ArrayList<>(Files.readAllLines(inputDataFile, Charset.defaultCharset()));\n // test for version 1.00\n if (0 != contentsByLine.get(0).trim().compareToIgnoreCase(\"Version,1.00\")) {\n throw new IOException(\"Expecting Version 1.0 of data file.\");\n } else {\n List<String[]> headerByLineSplit = new ArrayList<>();\n List<String[]> columnNamesSplit = new ArrayList<>();\n List<String[]> detectorsByLineSplit = new ArrayList<>();\n List<String> dataByBlock = new ArrayList<>();\n\n int phase = 0;\n int currentBlockNumber = 1;\n contentsByLine.add(\"#END,0,\");\n for (String line : contentsByLine) {\n if (!line.trim().isBlank()) {\n if (line.startsWith(\"#START\")) {\n massSpecExtractedData.populateHeader(headerByLineSplit);\n massSpecExtractedData.populateDetectors(detectorsByLineSplit);\n phase = 1;\n } else if (line.startsWith(\"#END\")) {\n phase = 4;\n }\n\n switch (phase) {\n case 0 -> headerByLineSplit.add(line.split(\",\"));\n case 1 -> phase = 2;\n case 2 -> {\n columnNamesSplit.add(line.split(\",\"));\n massSpecExtractedData.populateColumnNamesList(columnNamesSplit);\n phase = 3;\n }\n case 3 -> {\n String[] lineSplit = line.split(\",\");\n // each block gets treated as a singleton block #1\n int blockNumber = Integer.parseInt(lineSplit[1].trim());\n if (blockNumber != currentBlockNumber) {\n // save off block and prepare for next block\n massSpecExtractedData.addBlockRecord(\n parseAndBuildSingleBlockRecord(1, currentBlockNumber, dataByBlock));\n dataByBlock = new ArrayList<>();\n currentBlockNumber = blockNumber;\n }\n dataByBlock.add(line);\n }\n case 4 -> {\n // test if complete block by checking last entry's cycle number != 0\n boolean isComplete = 0 < Integer.parseInt(dataByBlock.get(dataByBlock.size() - 1).split(\",\")[2].trim());\n if (isComplete) {\n massSpecExtractedData.addBlockRecord(\n parseAndBuildSingleBlockRecord(1, currentBlockNumber, dataByBlock));\n }\n }\n }\n }\n }\n }\n return massSpecExtractedData;\n }",
"private void readBlock(DataInputStream in, byte op) throws IOException {\n //\n // Read in the header\n //\n Block b = new Block();\n b.readFields(in);\n\n long toSkip = 0;\n long endOffset = -1;\n if (op == OP_READSKIP_BLOCK) {\n toSkip = in.readLong();\n } else if (op == OP_READ_RANGE_BLOCK) {\n toSkip = in.readLong();\n endOffset = in.readLong();\n }\n\n //\n // Open reply stream\n //\n DataOutputStream out = new DataOutputStream(new BufferedOutputStream(s.getOutputStream()));\n try {\n //\n // Write filelen of -1 if error\n //\n if (! data.isValidBlock(b)) {\n out.writeLong(-1);\n } else {\n //\n // Get blockdata from disk\n //\n long len = data.getLength(b);\n if (endOffset < 0) { endOffset = len; }\n DataInputStream in2 = new DataInputStream(data.getBlockData(b));\n out.writeLong(len);\n\n long amtSkipped = 0;\n if ((op == OP_READSKIP_BLOCK) || (op == OP_READ_RANGE_BLOCK)) {\n if (toSkip > len) {\n toSkip = len;\n }\n try {\n amtSkipped = in2.skip(toSkip);\n } catch (IOException iex) {\n shutdown();\n throw iex;\n }\n out.writeLong(amtSkipped);\n }\n if (op == OP_READ_RANGE_BLOCK) {\n if (endOffset > len) {\n endOffset = len;\n }\n out.writeLong(endOffset);\n }\n\n byte buf[] = new byte[BUFFER_SIZE];\n try {\n int toRead = (int) (endOffset - amtSkipped + 1);\n int bytesRead = 0;\n try {\n bytesRead = in2.read(buf, 0, Math.min(BUFFER_SIZE, toRead));\n myMetrics.readBytes(bytesRead);\n } catch (IOException iex) {\n shutdown();\n throw iex;\n }\n while (toRead > 0 && bytesRead >= 0) {\n out.write(buf, 0, bytesRead);\n toRead -= bytesRead;\n if (toRead > 0) {\n try {\n bytesRead = in2.read(buf, 0, Math.min(BUFFER_SIZE, toRead));\n myMetrics.readBytes(bytesRead);\n } catch (IOException iex) {\n shutdown();\n throw iex;\n }\n }\n }\n } catch (SocketException se) {\n // This might be because the reader\n // closed the stream early\n } finally {\n try {\n in2.close();\n } catch (IOException iex) {\n shutdown();\n throw iex;\n }\n }\n }\n myMetrics.readBlocks(1);\n LOG.info(\"Served block \" + b + \" to \" + s.getInetAddress());\n } finally {\n out.close();\n }\n }",
"@Test\n public void testNonConsecutiveBlocks()\n {\n long blockSize = 1000;\n int noOfBlocks = (int)((testMeta.dataFile.length() / blockSize)\n + (((testMeta.dataFile.length() % blockSize) == 0) ? 0 : 1));\n\n testMeta.blockReader.beginWindow(1);\n\n for (int i = 0; i < 10; i++) {\n for (int j = 0; j < Math.ceil(noOfBlocks / 10.0); j++) {\n int blockNo = 10 * j + i;\n if (blockNo >= noOfBlocks) {\n continue;\n }\n BlockMetadata.FileBlockMetadata blockMetadata = new BlockMetadata.FileBlockMetadata(s3Directory + FILE_1,\n blockNo, blockNo * blockSize,\n blockNo == noOfBlocks - 1 ? testMeta.dataFile.length() : (blockNo + 1) * blockSize,\n blockNo == noOfBlocks - 1, blockNo - 1, testMeta.dataFile.length());\n testMeta.blockReader.blocksMetadataInput.process(blockMetadata);\n }\n }\n\n testMeta.blockReader.endWindow();\n\n List<Object> messages = testMeta.messageSink.collectedTuples;\n Assert.assertEquals(\"No of records\", testMeta.messages.size(), messages.size());\n\n Collections.sort(testMeta.messages, new Comparator<String[]>()\n {\n @Override\n public int compare(String[] rec1, String[] rec2)\n {\n return compareStringArrayRecords(rec1, rec2);\n }\n });\n\n Collections.sort(messages, new Comparator<Object>()\n {\n @Override\n public int compare(Object object1, Object object2)\n {\n String[] rec1 = new String((byte[])object1).split(\",\");\n String[] rec2 = new String((byte[])object2).split(\",\");\n return compareStringArrayRecords(rec1, rec2);\n }\n });\n for (int i = 0; i < messages.size(); i++) {\n byte[] msg = (byte[])messages.get(i);\n Assert.assertTrue(\"line \" + i, Arrays.equals(new String(msg).split(\",\"), testMeta.messages.get(i)));\n }\n }",
"protected void initFile(String id) throws FormatException, IOException {\n super.initFile(id);\n in = new RandomAccessFile(id, \"r\");\n \n // initialize an array containing tag offsets, so we can\n // use an O(1) search instead of O(n) later.\n // Also determine whether we will be reading color or grayscale\n // images\n \n //in.seek(0);\n byte[] toRead = new byte[4];\n in.read(toRead);\n long order = batoi(toRead); // byte ordering\n little = toRead[2] != 0xff || toRead[3] != 0xff;\n \n toRead = new byte[4];\n Vector v = new Vector(); // a temp vector containing offsets.\n \n // Get first offset.\n in.seek(16);\n in.read(toRead);\n int nextOffset = batoi(toRead);\n int nextOffsetTemp;\n \n boolean first = true;\n while(nextOffset != 0) {\n in.seek(nextOffset + 4);\n in.read(toRead);\n // get next tag, but still need this one\n nextOffsetTemp = batoi(toRead);\n in.read(toRead);\n if ((new String(toRead)).equals(\"PICT\")) {\n boolean ok = true;\n if (first) {\n // ignore first image if it is called \"Original Image\" (pure white)\n first = false;\n in.skipBytes(47);\n byte[] layerNameBytes = new byte[127];\n in.read(layerNameBytes);\n String layerName = new String(layerNameBytes);\n if (layerName.startsWith(\"Original Image\")) ok = false;\n }\n if (ok) v.add(new Integer(nextOffset)); // add THIS tag offset\n }\n if (nextOffset == nextOffsetTemp) break;\n nextOffset = nextOffsetTemp;\n }\n \n in.seek(((Integer) v.firstElement()).intValue());\n \n // create and populate the array of offsets from the vector\n numBlocks = v.size();\n offsets = new int[numBlocks];\n for (int i = 0; i < numBlocks; i++) {\n offsets[i] = ((Integer) v.get(i)).intValue();\n }\n \n // populate the imageTypes that the file uses\n toRead = new byte[2];\n imageType = new int[numBlocks];\n for (int i = 0; i < numBlocks; i++) {\n in.seek(offsets[i]);\n in.skipBytes(40);\n in.read(toRead);\n imageType[i] = batoi(toRead);\n }\n \n initMetadata();\n }",
"RecordHeader readRecordHeaderFromIndex(int position) throws IOException {\n file.seek(indexPositionToRecordHeaderFp(position));\n return RecordHeader.readHeader(file);\n }",
"private synchronized void readContent(RecordInputStream s) throws IOException {\r\n originalNamesToFixedNames.clear();\r\n fixedNamesToOriginalNames.clear();\r\n \r\n int nEntries = s.readIntCompressed();\r\n for (int i = 0; i < nEntries; i++) {\r\n String originalName = s.readUTF();\r\n String fixedName = s.readUTF();\r\n originalNamesToFixedNames.put(originalName, fixedName);\r\n fixedNamesToOriginalNames.put(fixedName, originalName);\r\n }\r\n }",
"@Override\n public CarDocument readNextRecord(BufferedReader bRdr) throws IOException {\n return null;\n }",
"@Test\n void testFirstTwoBlocks() throws Exception {\n HMEFMessage msg;\n try (InputStream is = _samples.openResourceAsStream(\"quick-winmail.dat\")) {\n msg = new HMEFMessage(is);\n }\n\n MAPIAttribute attr = msg.getMessageMAPIAttribute(MAPIProperty.RTF_COMPRESSED);\n assertNotNull(attr);\n MAPIRtfAttribute rtfAttr = (MAPIRtfAttribute) attr;\n\n // Truncate to header + flag + data for flag + flag + data\n byte[] data = Arrays.copyOf(rtfAttr.getRawData(), 16 + 12 + 13);\n\n // Decompress it\n CompressedRTF comp = new CompressedRTF();\n byte[] decomp = comp.decompress(new ByteArrayInputStream(data));\n String decompStr = new String(decomp, StandardCharsets.US_ASCII);\n\n // Test\n assertEquals(block2, decompStr);\n }",
"@SuppressWarnings(\"unused\")\n public static MassSpecExtractedData extractMetaAndBlockDataFromFileVersion_1_2(Path inputDataFile) throws IOException {\n MassSpecExtractedData massSpecExtractedData = new MassSpecExtractedData();\n List<String> contentsByLine = new ArrayList<>(Files.readAllLines(inputDataFile, Charset.defaultCharset()));\n // test for version 1.20\n if ((!contentsByLine.get(2).trim().startsWith(\"Version,1.\")) && (!contentsByLine.get(2).trim().startsWith(\"Version,2.\"))) {\n throw new IOException(\"Expecting Version 1.2.n of data file.\");\n } else {\n // first pass is to assemble data by blocks\n List<String[]> headerByLineSplit = new ArrayList<>();\n List<String[]> detectorsByLineSplit = new ArrayList<>();\n List<String[]> columnNamesSplit = new ArrayList<>();\n List<List<String>> dataByBlocks = new ArrayList<>();\n List<String> dataByBlock = new ArrayList<>();\n\n int phase = 0;\n int currentBlockNumber = 1;\n for (String line : contentsByLine) {\n if (!line.trim().isBlank()) {\n if (line.startsWith(\"#COLLECTORS\")) {\n massSpecExtractedData.populateHeader(headerByLineSplit);\n phase = 1;\n } else if (line.startsWith(\"#BASELINES\")) {\n massSpecExtractedData.populateDetectors(detectorsByLineSplit);\n phase = 3;\n } else if (line.startsWith(\"#ONPEAK\")) {\n phase = 6;\n } else if (line.startsWith(\"#END\")) {\n phase = 9;\n }\n\n switch (phase) {\n case 0 -> headerByLineSplit.add(line.split(\",\"));\n case 1 -> phase = 2;\n case 2 -> detectorsByLineSplit.add(line.split(\",\"));\n case 3 -> phase = 4;\n case 4 -> {\n columnNamesSplit.add(line.split(\",\"));\n massSpecExtractedData.populateColumnNamesList(columnNamesSplit);\n phase = 5;\n }\n case 6 -> phase = 7;\n case 7 -> phase = 8;\n\n case 5, 8 -> {\n String[] lineSplit = line.split(\",\");\n // each block gets treated as a singleton block #1\n int blockNumber = Integer.parseInt(lineSplit[1].trim());\n if (blockNumber != currentBlockNumber) {\n // save off block and prepare for next block new for BL and add to for OPeak\n if (8 == phase) {\n dataByBlocks.get(currentBlockNumber - 1).addAll(dataByBlock);\n massSpecExtractedData.addBlockRecord(\n parseAndBuildSingleBlockRecord(2, currentBlockNumber, dataByBlocks.get(currentBlockNumber - 1)));\n } else {\n dataByBlocks.add(dataByBlock);\n }\n dataByBlock = new ArrayList<>();\n currentBlockNumber = blockNumber;\n }\n dataByBlock.add(line);\n }\n }\n } else if ((5 == phase) && !dataByBlock.isEmpty()) {\n // clean up last block\n dataByBlocks.add(dataByBlock);\n dataByBlock = new ArrayList<>();\n currentBlockNumber = 1;\n } else if ((8 == phase) && !dataByBlock.isEmpty()) {\n // clean up last block\n // check for missing baseline action\n if (dataByBlocks.isEmpty()) {\n dataByBlocks.add(dataByBlock);\n } else {\n dataByBlocks.get(currentBlockNumber - 1).addAll(dataByBlock);\n }\n massSpecExtractedData.addBlockRecord(\n parseAndBuildSingleBlockRecord(2, currentBlockNumber, dataByBlocks.get(currentBlockNumber - 1)));\n }\n }\n }\n return massSpecExtractedData;\n }",
"public ByteArrayInputStream readByteArrayObject() throws IOException {\n int blockCount = raf.readInt();\n\n // Reserved\n raf.skipBytes(4);\n\n int chunkSize;\n\n // data was deleted\n if ((chunkSize=raf.readInt()) == 0)\n return null;\n\n // Reserved\n raf.skipBytes(4);\n\n // Reserved\n raf.skipBytes(16);\n\n byte[] buffer = new byte[chunkSize];\n\n // read chunk of data from file to buffer\n raf.read(buffer);\n\n // move across padded area\n raf.skipBytes(blockCount*blockSize - chunkSize);\n\n // convert into bis, and return the bis\n return new ByteArrayInputStream(buffer);\n }",
"public List<VCFFilterHeaderLine> headerLines();",
"public static Block createBlock(String edfRecord, String data) throws UnsupportedEncodingException {\r\n\t\tString[] values = edfRecord.split(\",\");\r\n\t\tTemporalProperties temporalProperties = new TemporalProperties(reformatDatetime(values[7]));\r\n\t\tSpatialProperties spatialProperties = new SpatialProperties(parseFloat(values[24]), parseFloat(values[25]));\r\n\t\tFeatureSet features = new FeatureSet();\r\n\t\tfeatures.put(new Feature(\"platform_id\", values[0]));\t\t\r\n\t\tfeatures.put(new Feature(\"date\", values[1]));\r\n\t\tfeatures.put(new Feature(\"time\", values[2]));\r\n\t\tfeatures.put(new Feature(\"datetime\", values[3]));\r\n\t\tfeatures.put(new Feature(\"frac_days_since_jan1\", parseFloat(values[4])));\r\n\t\tfeatures.put(new Feature(\"frac_hrs_since_jan1\", parseFloat(values[5])));\r\n\t\tfeatures.put(new Feature(\"julian_days\", parseFloat(values[6])));\r\n\t\tfeatures.put(new Feature(\"epoch_time\", reformatDatetime(values[7])));\r\n\t\tfeatures.put(new Feature(\"alarm_status\", parseFloat(values[8])));\r\n\t\tfeatures.put(new Feature(\"inst_status\", parseFloat(values[9])));\r\n\t\tfeatures.put(new Feature(\"cavity_pressure\", parseFloat(values[10])));\r\n\t\tfeatures.put(new Feature(\"cavity_temp\", parseFloat(values[11])));\r\n\t\tfeatures.put(new Feature(\"das_temp\", parseFloat(values[12])));\r\n\t\tfeatures.put(new Feature(\"etalon_temp\", parseFloat(values[13])));\r\n\t\tfeatures.put(new Feature(\"warm_box_temp\", parseFloat(values[14])));\r\n\t\tfeatures.put(new Feature(\"species\", parseFloat(values[15])));\r\n\t\tfeatures.put(new Feature(\"mvp_position\", parseFloat(values[16])));\r\n\t\tfeatures.put(new Feature(\"outlet_valve\", parseFloat(values[17])));\r\n\t\tfeatures.put(new Feature(\"solenoid_valves\", parseFloat(values[18])));\r\n\t\tfeatures.put(new Feature(\"co2\", parseFloat(values[19])));\r\n\t\tfeatures.put(new Feature(\"co2_dry\", parseFloat(values[20])));\r\n\t\tfeatures.put(new Feature(\"ch4\", parseFloat(values[21])));\r\n\t\tfeatures.put(new Feature(\"ch4_dry\", parseFloat(values[22])));\r\n\t\tfeatures.put(new Feature(\"h2o\", parseFloat(values[23])));\r\n\t\tfeatures.put(new Feature(\"gps_abs_lat\", parseFloat(values[24])));\r\n\t\tfeatures.put(new Feature(\"gps_abs_lon\", parseFloat(values[25])));\r\n\t\tfeatures.put(new Feature(\"gps_fit\", parseFloat(values[26])));\r\n\t\tfeatures.put(new Feature(\"gps_time\", parseFloat(values[27])));\r\n\t\tfeatures.put(new Feature(\"ws_wind_lon\", parseFloat(values[28])));\r\n\t\tfeatures.put(new Feature(\"ws_wind_lat\", parseFloat(values[29])));\r\n\t\tfeatures.put(new Feature(\"ws_cos_heading\", parseFloat(values[30])));\r\n\t\tfeatures.put(new Feature(\"ws_sin_heading\", parseFloat(values[31])));\r\n\t\tfeatures.put(new Feature(\"wind_n\", parseFloat(values[32])));\r\n\t\tfeatures.put(new Feature(\"wind_e\", parseFloat(values[33])));\r\n\t\tfeatures.put(new Feature(\"wind_dir_sdev\", parseFloat(values[34])));\r\n\t\tfeatures.put(new Feature(\"ws_rotation\", parseFloat(values[35])));\r\n\t\tfeatures.put(new Feature(\"car_speed\", parseFloat(values[36])));\r\n\t\tfeatures.put(new Feature(\"postal_code\", values[37]));\r\n\t\tfeatures.put(new Feature(\"locality\", values[38]));\r\n\t\tfeatures.put(new Feature(\"s2_30_int\", parseLong(values[39])));\r\n\t\t\t\r\n\t\tMetadata metadata = new Metadata();\r\n\t\tmetadata.setName(GeoHash.encode(parseFloat(values[24]), parseFloat(values[25]), 7));\r\n\t\tmetadata.setTemporalProperties(temporalProperties);\r\n\t\tmetadata.setsIndex(new SearchIndex(\"24\",\"25\",\"7\"));\r\n\t\tmetadata.setSpatialProperties(spatialProperties);\r\n\t\tmetadata.setSpatialHint(new SpatialHint(\"gps_abs_lat\", \"gps_abs_lon\"));\r\n\t\tmetadata.setAttributes(features);\r\n\t\t\r\n\t\treturn new Block(\"airview\", metadata, data.getBytes(\"UTF-8\"));\r\n\t}",
"public Sample load(BufferedReader r) throws IOException {\n\tString line = r.readLine();\n\tif (line==null || !line.startsWith(\"HEADER:\"))\n\t throw new WrongFiletypeException(); // no HEADER: found\n\n\t// new sample, with given filename\n\tSample s = new Sample();\n\n\t// don't know end, yet\n\tYear end = null;\n\tint length = -1;\n\n\t// metadata\n\tfor (;;) {\n\t // read a line\n\t line = r.readLine();\n\n\t // got to data, stop\n\t if (line.startsWith(\"DATA:\"))\n\t\tbreak;\n\n\t // parse line as \"variable = value\", and put into s.meta\n\t int i = line.indexOf(\"=\");\n\t if (i == -1)\n\t\tthrow new WrongFiletypeException();\n\t String tag = line.substring(0, i);\n\t String value = line.substring(i+1);\n\n\t // got end-date.\n\t if (tag.equals(\"DateEnd\"))\n\t\tend = new Year(value);\n\t \n\t if (tag.equals(\"Length\"))\n\t \tlength = Integer.parseInt(value);\n\n\t // WRITE ME: parse other tags and interpret metadata as\n\t // intelligently as possible\n\t}\n\n\ts.count = new ArrayList();\n\ts.incr = new ArrayList();\n\ts.decr = new ArrayList();\n\n\t// data -- i'll assume all data is (width,count,up,down)\n\tStreamTokenizer t = new StreamTokenizer(r);\n\tint idx = 0;\n\t\n\tfor (;;) {\n\t // parse (datum, count, up, dn)\n\t\tint datum, count, up, dn;\n\t\ttry {\n\t\t\t\tt.nextToken();\n\t\t\t\tdatum = (int) t.nval;\n\t\t\t\tt.nextToken();\n\t\t\t\tcount = (int) t.nval;\n\t\t\t\tt.nextToken();\n\t\t\t\tup = (int) t.nval;\n\t\t\t\tt.nextToken();\n\t\t\t\tdn = (int) t.nval;\n\t\t} catch (IOException ioe) {\n\t\t\tthrow new WrongFiletypeException();\n\t\t}\n\n\t // (0,0,0,0) seems to mean end-of-sample\n\t if (datum == 0)\n\t \tbreak;\n\n\t // add to lists\n\t s.data.add(new Integer(datum));\n\t s.count.add(new Integer(count));\n\t s.incr.add(new Integer(up));\n\t s.decr.add(new Integer(dn));\n\t \n\t idx++;\n\t \n\t // break out if we have 'length' samples\n\t if(idx == length)\n\t \tbreak;\n\t}\n\n\t// no end? die.\n\tif (end == null)\n\t throw new WrongFiletypeException();\n\n\t// set range, and return\n\ts.range = new Range(end.add(1 - s.data.size()), end);\n\treturn s;\n }",
"public ReversedLinesFileReader(File file, int blockSize, String encoding) throws IOException {\n/* 165 */ this(file, blockSize, Charsets.toCharset(encoding));\n/* */ }",
"public Header parseHeader(CharArrayBuffer buffer) throws ParseException {\n/* 445 */ return (Header)new BufferedHeader(buffer);\n/* */ }",
"public byte[] read(long pos) {\n final long tic = System.nanoTime();\n if (log.isTraceEnabled()) log.trace(\"read mapped from {} @ {}\", virtualFileNumber, pos);\n int size = readInt(pos);\n byte[] buf = new byte[size];\n super.read(pos + 4, buf);\n if (log.isTraceEnabled()) log.trace(\"read mapped {} bytes from {} @ {}\", size, virtualFileNumber, pos);\n\n blobStoreMetricsAdders.readCounter.increment();\n blobStoreMetricsAdders.bytesRead.add(recordSize(buf));\n blobStoreMetricsAdders.readTimer.add(System.nanoTime() - tic);\n return buf;\n }",
"public Object initialize(final File source) throws FileNotFoundException {\n List<String> header = null;\n int linesLookedAt = 0;\n xReadLines reader = new xReadLines(source);\n \n for ( String line : reader ) {\n Matcher m = HEADER_PATTERN.matcher(line);\n if ( m.matches() ) {\n //System.out.printf(\"Found a header line: %s%n\", line);\n header = new ArrayList<String>(Arrays.asList(line.split(DELIMITER_REGEX)));\n //System.out.printf(\"HEADER IS %s%n\", Utils.join(\":\", header));\n }\n \n if ( linesLookedAt++ > MAX_LINES_TO_LOOK_FOR_HEADER )\n break;\n }\n \n // check that we found the header\n if ( header != null ) {\n logger.debug(String.format(\"HEADER IS %s%n\", Utils.join(\":\", header)));\n } else {\n // use the indexes as the header fields\n logger.debug(\"USING INDEXES FOR ROD HEADER\");\n // reset if necessary\n if ( !reader.hasNext() )\n reader = new xReadLines(source);\n header = new ArrayList<String>();\n int tokens = reader.next().split(DELIMITER_REGEX).length;\n for ( int i = 0; i < tokens; i++)\n header.add(Integer.toString(i));\n }\n \n return header;\n }",
"private void readHeader(){ \n Set<Object> tmpAttr = headerFile.keySet();\n Object[] attributes = tmpAttr.toArray(new Object[tmpAttr.size()]);\n \n Object[][] dataArray = new Object[attributes.length][2];\n for (int ndx = 0; ndx < attributes.length; ndx++) {\n dataArray[ndx][0] = attributes[ndx];\n dataArray[ndx][1] = headerFile.get(attributes[ndx]);\n if (attributes[ndx].toString().equals(\"Description\"))\n Description = headerFile.get(attributes[ndx]);\n }\n data = dataArray;\n }",
"phaseI.Hdfs.BlockLocations getNewBlock();",
"@Override\n public void parse() {\n if (file == null)\n throw new IllegalStateException(\n \"File cannot be null. Call setFile() before calling parse()\");\n\n if (parseComplete)\n throw new IllegalStateException(\"File has alredy been parsed.\");\n\n FSDataInputStream fis = null;\n BufferedReader br = null;\n\n try {\n fis = fs.open(file);\n br = new BufferedReader(new InputStreamReader(fis));\n\n // Go to our offset. DFS should take care of opening a block local file\n fis.seek(readOffset);\n records = new LinkedList<T>();\n\n LineReader ln = new LineReader(fis);\n Text line = new Text();\n long read = readOffset;\n\n if (readOffset != 0)\n read += ln.readLine(line);\n\n while (read < readLength) {\n int r = ln.readLine(line);\n if (r == 0)\n break;\n\n try {\n T record = clazz.newInstance();\n record.fromString(line.toString());\n records.add(record);\n } catch (Exception ex) {\n LOG.warn(\"Unable to instantiate the updateable record type\", ex);\n }\n read += r;\n }\n\n } catch (IOException ex) {\n LOG.error(\"Encountered an error while reading from file \" + file, ex);\n } finally {\n try {\n if (br != null)\n br.close();\n\n if (fis != null)\n fis.close();\n } catch (IOException ex) {\n LOG.error(\"Can't close file\", ex);\n }\n }\n\n LOG.debug(\"Read \" + records.size() + \" records\");\n }",
"public void initializeFullRead() {\r\n\r\n try {\r\n bPtr = 0;\r\n\r\n if (raFile != null) {\r\n fLength = raFile.length();\r\n } else {\r\n return;\r\n }\r\n\r\n if (tagBuffer == null) {\r\n tagBuffer = new byte[(int) fLength];\r\n } else if (fLength > tagBuffer.length) {\r\n tagBuffer = new byte[(int) fLength];\r\n }\r\n\r\n raFile.readFully(tagBuffer);\r\n } catch (final IOException ioE) {}\r\n }",
"phaseI.Hdfs.BlockLocationsOrBuilder getNewBlockOrBuilder();",
"protected abstract Object readFile(BufferedReader buf) throws IOException, FileParseException;",
"phaseI.Hdfs.BlockLocations getBlockInfo();",
"public VCFHeader getHeader();",
"@Test\n\t@SuppressWarnings(\"unchecked\")\n\tpublic void test_headerSplitOnNofLines() throws StageException, IOException {\n\t\tprocessor.headerConfig = getHeaderConfig(null, NOF_HEADER_LINES);\n\n\t\t// prepare details config\n\t\tprocessor.detailsConfig.detailsColumnHeaderType = DetailsColumnHeaderType.USE_HEADER;\n\t\tprocessor.detailsConfig.separatorAsRegex = false;\n\t\tprocessor.parserConfig.splitDetails = true;\n\t\t\n\t\trunner = new ProcessorRunner.Builder(HeaderDetailParserDProcessor.class, processor)\n\t\t\t\t.setExecutionMode(ExecutionMode.STANDALONE)\n\t\t\t\t.setResourcesDir(\"/tmp\")\n\t\t\t\t.addOutputLane(\"header\").addOutputLane(\"headerDetails\")\n\t\t\t\t.build();\n\t\trunner.runInit();\n\n\t\t// run the test\n\t\tList<Record> op = null;\n\t\ttry {\n\t\t\tList<Record> input = prepareInput(TEST_FILE_WITH_HEADER_AND_DETAILS_HEADER);\n\t\t\t\n\t\t\tlong startTime = System.currentTimeMillis();\n\n\t\t\tStageRunner.Output output = runner.runProcess(input);\n\t\t\t\n\t\t System.out.println(\"test_headerSplitOnNofLines - Total execution time: \" + (System.currentTimeMillis()-startTime) + \"ms\"); \n\n\t\t\top = output.getRecords().get(\"headerDetails\");\n\n\t\t} finally {\n\t\t\trunner.runDestroy();\n\t\t}\n\n\t\t// assert\n\t\tassertEquals(42324, op.size());\n//\t\tassertEquals(\"11:02:12.000\", StringUtils.substring(op.get(0).get(\"/detail\").getValueAsString(), 0, 12));\n\t}",
"@Override\n public RecordType parseMetadata() {\n \n this.stationIndex = StationLookup.lookup(getStationId(this.filename));\n \n try {\n reader.mark(READ_AHEAD_LIMIT);\n String line = null;\n boolean headerRead = false;\n List<Variable> vars = null;\n while (null != (line = reader.readLine())) {\n Matcher matcher = headerLinePattern.matcher(line);\n if (matcher.matches()) {\n vars = headerVariables(matcher.group(1));\n reader.mark(READ_AHEAD_LIMIT);\n headerRead = true;\n }\n else if (headerRead) {\n matcher = dataLinePattern.matcher(line);\n if (matcher.matches()) {\n String date = matcher.group(1);\n Instant timestep = Instant.parse(date, getInputDateFormatter());\n this.baseDate = timestep;\n \n RecordType recordType = new RecordType(\"days since \" + baseDate.toString());\n for (Variable var : vars) {\n recordType.addType(var);\n }\n \n reader.reset();\n return recordType;\n }\n }\n }\n \n }\n catch (IOException ex) {\n LOG.debug(\"Error reading metadata\", ex);\n }\n return null;\n }",
"public byte[] readBlock(int blocknr){ \r\n byte[] bdata = new byte[16];\r\n for (int i=0;i<16;i++) bdata[i]=0;\r\n int result = cardReader.read(handle,(byte)blocknr,bdata);\r\n if (result < 0){\r\n System.err.println(\"error reading block \"+ blocknr);\r\n return bdata;\r\n }\r\n System.err.printf(\"Page %02d: \", blocknr);\r\n for (int i=0; i<4;i++){\r\n int b = bdata[i] & 0xFF;\r\n System.err.printf(\"%02X \",b); \r\n }\r\n System.err.println();\r\n return bdata;\r\n }",
"public FastqRecord readRecord() throws IOException, RecordFormatException\n\t{\n\t\t// Read the defline from the BufferedReader. Return null if you read null, \n\t\t// indicating end of file.\n\n\t\t\n\t\t// Read the next 3 lines from the buffered reader. Construct and return\n\t\t// a FastqRecord.\n\n\t}",
"@Override\n public void readFields(DataInput in) throws IOException {\n super.readFields(in);\n\n byte flags = in.readByte();\n hasFooter = (FOOTER_FLAG & flags) != 0;\n isOriginal = (ORIGINAL_FLAG & flags) != 0;\n hasBase = (BASE_FLAG & flags) != 0;\n boolean hasLongFileId = (HAS_LONG_FILEID_FLAG & flags) != 0,\n hasWritableFileId = (HAS_SYNTHETIC_FILEID_FLAG & flags) != 0,\n hasSyntheticProps = (HAS_SYNTHETIC_ACID_PROPS_FLAG & flags) != 0;\n if (hasLongFileId && hasWritableFileId) {\n throw new IOException(\"Invalid split - both file ID types present\");\n }\n\n deltas.clear();\n int numDeltas = in.readInt();\n for(int i=0; i < numDeltas; i++) {\n AcidInputFormat.DeltaMetaData dmd = new AcidInputFormat.DeltaMetaData();\n dmd.readFields(in);\n deltas.add(dmd);\n }\n if (hasFooter) {\n int tailLen = WritableUtils.readVInt(in);\n byte[] tailBuffer = new byte[tailLen];\n in.readFully(tailBuffer);\n OrcProto.FileTail fileTail = OrcProto.FileTail.parseFrom(tailBuffer);\n orcTail = new OrcTail(fileTail, null);\n }\n if (hasLongFileId) {\n fileKey = in.readLong();\n } else if (hasWritableFileId) {\n SyntheticFileId fileId = new SyntheticFileId();\n fileId.readFields(in);\n this.fileKey = fileId;\n }\n fileLen = in.readLong();\n rootDir = new Path(in.readUTF());\n\n if (hasSyntheticProps) {\n long rowId = in.readLong();\n int bucket = in.readInt();\n long writeId = in.readLong();\n\n syntheticAcidProps = new OffsetAndBucketProperty(rowId, bucket, writeId);\n }\n }",
"private void readLOC() throws java.io.IOException {\n byte locbuf[] = new byte[LOCHDR];\n ZipFile zf = this.zf;\n ZipEntry ze = this.ze;\n long offset = ze.getOffset();\n if (TRACE)\n System.out.println(this +\": reading LOC, offset=\" + offset);\n zf.read(offset, locbuf, 0, LOCHDR);\n if (ZipFile.get32(locbuf, 0) != LOCSIG) {\n throw new java.util.zip.ZipException(\n \"invalid LOC header signature\");\n }\n // Get length and position of entry data\n long count = ze.getCompressedSize();\n this.count = count;\n if (TRACE)\n System.out.println(this +\": count=\" + count);\n long pos =\n ze.getOffset()\n + LOCHDR\n + ZipFile.get16(locbuf, LOCNAM)\n + ZipFile.get16(locbuf, LOCEXT);\n this.pos = pos;\n if (TRACE)\n System.out.println(this +\": pos=\" + pos);\n long cenpos = zf.cenpos;\n if (TRACE)\n System.out.println(this +\": cenpos=\" + cenpos);\n if (pos + count > cenpos) {\n throw new java.util.zip.ZipException(\n \"invalid LOC header format\");\n }\n }",
"private void _readHeader() throws PicoException, IOException {\n if (!_open)\n return;\n\n // Save the current position and move to the start of the header.\n long pos = _backing.getFilePointer();\n _backing.seek(PicoStructure.HEAD_START);\n\n // Read the header from the file. We read the fixed length portion\n // here, up through the start of the key.\n byte[] _fixedhdr = new byte[(int) PicoStructure.FIXED_HEADER_LENGTH];\n int length = _backing.read(_fixedhdr);\n\n // Make sure we have enough bytes for the magic string.\n if (length < PicoStructure.MAGIC_LENGTH - PicoStructure.MAGIC_OFFSET) {\n // The magic string was not present. This cannot be a Pico wrapper\n // file.\n throw new PicoException(\"File too short; missing magic string.\");\n }\n\n // Process the fixed portion of the header. After calling this the\n // key is allocated, but not populated.\n _head = PicoHeader.getHeader(_fixedhdr);\n\n // The hash is valid because we just read it from the file and nothing\n // has yet been written. All write methods must invalidate the hash.\n _hashvalid = true;\n\n // Go and read the key, now that we know its length. Note that we read\n // it directly into the array returned by getKey.\n length = _backing.read(_head.getKey());\n\n // Make sure we have the complete key. The only bad case is that the\n // file ends before the key is complete.\n if (length != _head.getKey().length) {\n throw new PicoException(\"File too short; incomplete key.\");\n }\n\n // Move to the original position in the file.\n _backing.seek(pos);\n\n // Ka-presto! The header has been read. Life is good.\n }",
"public void testReadingConstructor() throws IOException {\n\t\tLocalRawDataBlockList list = new LocalRawDataBlockList();\r\n\r\n\t\tlist.createNewXBATBlock(4, 130, 1);\r\n\t\tlist.createNewXBATBlock(131, 131, -2);\r\n\t\tfor (int j = 0; j < 130; j++) {\r\n\t\t\tlist.createNewBATBlock(j * 128);\r\n\t\t}\r\n\t\tlist.fill(132);\r\n\t\tint[] blocks = { 2, 3 };\r\n\t\tBlockAllocationTableReader table = new BlockAllocationTableReader(\r\n\t\t POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS, 130, blocks, 2, 0, list);\r\n\r\n\t\tfor (int i = 0; i < (130 * 128); i++) {\r\n\t\t\tif (i % 256 == 0) {\r\n\t\t\t\tassertTrue(\"verifying block \" + i + \" is unused\", !table.isUsed(i));\r\n\t\t\t} else if (i % 256 == 255) {\r\n\t\t\t\tassertEquals(\"Verify end of chain for block \" + i, POIFSConstants.END_OF_CHAIN,\r\n\t\t\t\t\t\ttable.getNextBlockIndex(i));\r\n\t\t\t} else {\r\n\t\t\t\tassertEquals(\"Verify next index for block \" + i, i + 1, table.getNextBlockIndex(i));\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"phaseI.Hdfs.BlockLocationsOrBuilder getBlockInfoOrBuilder();",
"private void initMetadata() throws IOException {\n \n // start by reading the file header\n in.seek(0);\n byte[] toRead = new byte[4];\n in.read(toRead);\n long order = batoi(toRead); // byte ordering\n little = toRead[2] != 0xff || toRead[3] != 0xff;\n metadata.put(\"Byte Order\", new Boolean(little));\n \n in.skipBytes(4);\n in.read(toRead);\n long version = DataTools.bytesToLong(toRead, little);\n metadata.put(\"Version\", new Long(version));\n \n byte[] er = new byte[2];\n in.read(er);\n short count = DataTools.bytesToShort(er, little);\n metadata.put(\"Count\", new Short(count));\n \n in.skipBytes(2);\n \n in.read(toRead);\n long offset = DataTools.bytesToLong(toRead, little);\n \n // skip to first tag\n in.seek(offset);\n \n // read in each tag and its data\n \n for (int i=0; i<count; i++) {\n in.read(er);\n short tag = DataTools.bytesToShort(er, little);\n in.skipBytes(2);\n \n in.read(toRead);\n offset = DataTools.bytesToLong(toRead, little);\n \n in.read(toRead);\n long fmt = DataTools.bytesToLong(toRead, little);\n metadata.put(\"Format\", new Long(fmt));\n \n in.read(toRead);\n long numBytes = DataTools.bytesToLong(toRead, little);\n metadata.put(\"NumBytes\", new Long(numBytes));\n \n if (tag == 67 || tag == 68) {\n byte[] b = new byte[1];\n in.read(b);\n boolean isOpenlab2;\n if (b[0] == '0') isOpenlab2 = false;\n else isOpenlab2 = true;\n metadata.put(\"isOpenlab2\", new Boolean(isOpenlab2));\n \n in.skipBytes(2);\n in.read(er);\n short layerId = DataTools.bytesToShort(er, little);\n metadata.put(\"LayerID\", new Short(layerId));\n \n in.read(er);\n short layerType = DataTools.bytesToShort(er, little);\n metadata.put(\"LayerType\", new Short(layerType));\n \n in.read(er);\n short bitDepth = DataTools.bytesToShort(er, little);\n metadata.put(\"BitDepth\", new Short(bitDepth));\n \n in.read(er);\n short opacity = DataTools.bytesToShort(er, little);\n metadata.put(\"Opacity\", new Short(opacity));\n \n // not sure how many bytes to skip here\n in.skipBytes(10);\n \n in.read(toRead);\n long type = DataTools.bytesToLong(toRead, little);\n metadata.put(\"ImageType\", new Long(type));\n \n // not sure how many bytes to skip\n in.skipBytes(10);\n \n in.read(toRead);\n long timestamp = DataTools.bytesToLong(toRead, little);\n metadata.put(\"Timestamp\", new Long(timestamp));\n \n in.skipBytes(2);\n \n if (isOpenlab2 == true) {\n byte[] layerName = new byte[127];\n in.read(layerName);\n metadata.put(\"LayerName\", new String(layerName));\n \n in.read(toRead);\n long timestampMS = DataTools.bytesToLong(toRead, little);\n metadata.put(\"Timestamp-MS\", new Long(timestampMS));\n \n in.skipBytes(1);\n byte[] notes = new byte[118];\n in.read(notes);\n metadata.put(\"Notes\", new String(notes));\n }\n else in.skipBytes(123);\n }\n else if (tag == 69) {\n in.read(toRead);\n long platform = DataTools.bytesToLong(toRead, little);\n metadata.put(\"Platform\", new Long(platform));\n \n in.read(er);\n short units = DataTools.bytesToShort(er, little);\n metadata.put(\"Units\", new Short(units));\n \n in.read(er);\n short imageId = DataTools.bytesToShort(er, little);\n metadata.put(\"ID\", new Short(imageId));\n in.skipBytes(1);\n \n byte[] toRead2 = new byte[8];\n double xOrigin = DataTools.readDouble(in, little);\n metadata.put(\"XOrigin\", new Double(xOrigin));\n double yOrigin = DataTools.readDouble(in, little);\n metadata.put(\"YOrigin\", new Double(yOrigin));\n double xScale = DataTools.readDouble(in, little);\n metadata.put(\"XScale\", new Double(xScale));\n double yScale = DataTools.readDouble(in, little);\n metadata.put(\"YScale\", new Double(yScale));\n in.skipBytes(1);\n \n byte[] other = new byte[31];\n in.read(other);\n metadata.put(\"Other\", new String(other));\n }\n \n // Initialize OME metadata\n \n if (ome != null) {\n OMETools.setBigEndian(ome, !little);\n if (metadata.get(\"BitDepth\") != null) {\n int bitDepth = ((Integer) metadata.get(\"BitDepth\")).intValue();\n String type;\n \n if (bitDepth <= 8) type = \"int8\";\n else if (bitDepth <= 16) type = \"int16\";\n else type = \"int32\";\n \n OMETools.setPixelType(ome, type);\n }\n if (metadata.get(\"Timestamp\") != null) {\n OMETools.setCreationDate(ome, (String) metadata.get(\"Timestamp\"));\n }\n \n if (metadata.get(\"XOrigin\") != null) {\n Double xOrigin = (Double) metadata.get(\"XOrigin\");\n OMETools.setStageX(ome, xOrigin.floatValue());\n }\n \n if (metadata.get(\"YOrigin\") != null) {\n Double yOrigin = (Double) metadata.get(\"YOrigin\");\n OMETools.setStageY(ome, yOrigin.floatValue());\n }\n \n if (metadata.get(\"XScale\") != null) {\n Double xScale = (Double) metadata.get(\"XScale\");\n OMETools.setPixelSizeX(ome, xScale.floatValue());\n }\n \n if (metadata.get(\"YScale\") != null) {\n Double yScale = (Double) metadata.get(\"YScale\");\n OMETools.setPixelSizeY(ome, yScale.floatValue());\n }\n }\n in.seek(offset);\n }\n }",
"public static DataHeader readDataHeader(ArchiveFileBuffer buffer, CtrlInfoReader info) throws Exception\n {\n final File file = buffer.getFile();\n final long offset = buffer.offset();\n\n // first part of data file header:\n // 4 bytes directory_offset (skipped)\n // \" next_offset (offset of next entry in its file)\n // \" prev_offset (offset of previous entry in its file)\n // \" cur_offset (used by FileAllocator writing file)\n // \" num_samples (number of samples in the buffer)\n // \" ctrl_info_offset (offset in this file of control info header (units, limits, etc.))\n // \" buff_size (bytes allocated for this entry, including header)\n // \" buff_free (number of un-used, allocated bytes for this header)\n // 2 bytes DbrType (type of data stored in buffer)\n // 2 bytes DbrCount (count of values for each buffer element, i.e. 1 for scalar types, >1 for array types)\n // 4 bytes padding (used to align the period)\n // 8 bytes (double) period\n // 8 bytes (epicsTimeStamp) begin_time\n // \" next_file_time\n // \" end_time\n // char [40] prev_file\n // char [40] next_file\n // --> Total of 152 bytes in data header\n buffer.skip(4);\n final long nextOffset = buffer.getUnsignedInt();\n buffer.skip(4);\n buffer.skip(4);\n final long numSamples = buffer.getUnsignedInt();\n final long ctrlInfoOffset = buffer.getUnsignedInt();\n final long buff_size = buffer.getUnsignedInt();\n final long buff_free = buffer.getUnsignedInt();\n final short dbrTypeCode = buffer.getShort();\n final short dbrCount = buffer.getShort();\n buffer.skip(4);\n buffer.skip(8);\n final Instant beginTime = buffer.getEpicsTime();\n final Instant nextTime = buffer.getEpicsTime();\n final Instant endTime = buffer.getEpicsTime();\n\n buffer.skip(40);\n final byte nameBytes [] = new byte [40];\n buffer.get(nameBytes);\n\n if (!info.isOffset(ctrlInfoOffset))\n info = new CtrlInfoReader(ctrlInfoOffset);\n final DbrType dbrType = DbrType.forValue(dbrTypeCode);\n\n // compute amount of data in this data file entry: (bytes allocated) - (bytes free) - (bytes in header)\n final long buffDataSize = buff_size - buff_free - 152;\n System.out.println(buffDataSize);\n\n // Size of samples:\n // 12 bytes for status/severity/timestamp,\n // padding, value, padding\n final long dbr_size = 12 + dbrType.padding + dbrCount * dbrType.valueSize + dbrType.getValuePad(dbrCount);\n final long expected = dbr_size * numSamples;\n System.out.println(dbr_size);\n System.out.println(expected);\n\n if (expected != buffDataSize)\n throw new Exception(\"Expected \" + expected + \" byte buffer, got \" + buffDataSize);\n\n String nextFilename = nextOffset != 0 ? new String(nameBytes).split(\"\\0\", 2)[0] : \"*\";\n File nextFile = new File(buffer.getFile().getParentFile(), nextFilename);\n\n logger.log(Level.FINE, \"Datablock\\n\" +\n \"Buffer : '\" + file + \"' @ 0x\" + Long.toHexString(offset) + \"\\n\" +\n \"Time : \" + beginTime + \"\\n\" +\n \"... : \" + endTime);\n\n return new DataHeader(file, offset, nextFile, nextOffset, nextTime, info, dbrType, dbrCount, numSamples);\n }",
"@Test\n public void testSingleBlock()\n {\n BlockMetadata.FileBlockMetadata block = new BlockMetadata.FileBlockMetadata(s3Directory + FILE_1, 0L, 0L,\n testMeta.dataFile.length(), true, -1, testMeta.dataFile.length());\n\n testMeta.blockReader.beginWindow(1);\n testMeta.blockReader.blocksMetadataInput.process(block);\n testMeta.blockReader.endWindow();\n\n List<Object> actualMessages = testMeta.messageSink.collectedTuples;\n Assert.assertEquals(\"No of records\", testMeta.messages.size(), actualMessages.size());\n\n for (int i = 0; i < actualMessages.size(); i++) {\n byte[] msg = (byte[])actualMessages.get(i);\n Assert.assertTrue(\"line \" + i, Arrays.equals(new String(msg).split(\",\"), testMeta.messages.get(i)));\n }\n }",
"public void parseHeader() {\n\t\tthis.release = (Integer) this.headerData.get(0);\n\t\tthis.endian = (ByteOrder) this.headerData.get(1);\n\t\tthis.K = (Short) this.headerData.get(2);\n\t\tthis.datasetLabel = (String) this.headerData.get(4);\n\t\tthis.datasetTimeStamp = (String) this.headerData.get(5);\n\t\tthis.mapOffset = (Integer) this.headerData.get(6);\n\t}",
"alluxio.proto.journal.File.NewBlockEntry getNewBlock();",
"ByteBlockInfo getBlockInfo(BigInteger index, int fieldOffset) {\n\t\tSortedMap<BigInteger, BlockInfo> tailMap = blockInfoMap.tailMap(index);\n\t\tif (tailMap.isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\tBlockInfo blockInfo = tailMap.get(tailMap.firstKey());\n\t\tBigInteger byteIndex = index.multiply(bytesInLine).add(BigInteger.valueOf(fieldOffset));\n\t\tif ((byteIndex.compareTo(blockInfo.blockStart) >= 0) &&\n\t\t\t(byteIndex.compareTo(blockInfo.blockEnd) < 0)) {\n\t\t\treturn new ByteBlockInfo(blockInfo.block, byteIndex.subtract(blockInfo.blockStart));\n\t\t}\n\t\treturn null;\n\t}",
"public BlockFileContainer (String prefix, int blockSize, FilesystemOperations fso) {\n\t\tthis.prefix = prefix;\n\t\tthis.blockSize = blockSize;\n\t\tthis.fso = fso;\n\n\t\topenFiles();\n\t\treset();\n\t}",
"private List<BedData> readBedDataBlock(RPTreeLeafNodeItem leafHitItem) {\n\n // get the chromosome names associated with the hit region ID's\n int startChromID = leafHitItem.getChromosomeBounds().getStartChromID();\n int endChromID = leafHitItem.getChromosomeBounds().getEndChromID();\n chromosomeMap = chromIDTree.getChromosomeIDMap(startChromID, endChromID);\n\n boolean isLowToHigh = chromDataTree.isIsLowToHigh();\n int uncompressBufSize = chromDataTree.getUncompressBuffSize();\n\n // decompress leaf item data block for feature extraction\n BigBedDataBlock bedDataBlock = new BigBedDataBlock(fis, header, leafHitItem, chromosomeMap, isLowToHigh, uncompressBufSize);\n\n // get data block Bed feature list and set next index to first item\n return bedDataBlock.getBedData(selectionRegion, contained);\n\n }",
"@Override\n\tpublic BctsJobHeader read() throws Exception {\n\t\treturn fileReder();\n\t}",
"public WaveData read() throws IOException {\n\t\tint res = inputStream.read(buf);\n\t\tif (res != headerSize) {\n\t\t\tthrow new IOException(\"Header reading failed\");\n\t\t}\n\t\theader.setChunkID(Arrays.copyOfRange(buf, 0, 4));\n\t\tif (new String(header.getChunkID()).compareTo(\"RIFF\") != 0) {\n\t\t\tthrow new IOException(\"Format failed\");\n\t\t}\n\n\t\theader.setChunkSize(toInt(4, false));\n\t\theader.setFormat(Arrays.copyOfRange(buf, 8, 12));\n\t\theader.setSubChunk1ID(Arrays.copyOfRange(buf, 12, 16));\n\t\theader.setSubChunk1Size(toInt(16, false));\n\t\theader.setAudioFormat(toShort(20, false));\n\t\theader.setNumChannels(toShort(22, false));\n\t\theader.setSampleRate(toInt(24, false));\n\t\theader.setByteRate(toInt(28, false));\n\t\theader.setBlockAlign(toShort(32, false));\n\t\theader.setBitsPerSample(toShort(34, false));\n\t\theader.setSubChunk2ID(Arrays.copyOfRange(buf, 36, 40));\n\t\theader.setSubChunk2Size(toInt(40, false));\n\t\treturn header;\n\t}",
"private void readHeader() throws IOException {\n\n header = new byte[ShapeConst.SHAPE_FILE_HEADER_LENGTH];\n\n /*\n * Make sure we're at the beginning of the file\n */\n rafShp.seek(0); \n\n rafShp.read(header, 0, ShapeConst.SHAPE_FILE_HEADER_LENGTH);\n\n int fileCode = ByteUtils.readBEInt(header, 0);\n\n if (fileCode != ShapeConst.SHAPE_FILE_CODE) {\n\n throw new IOException(\"Invalid file code, \" + \"probably not a shape file\");\n\n }\n\n fileVersion = ByteUtils.readLEInt(header, 28);\n\n if (fileVersion != ShapeConst.SHAPE_FILE_VERSION) {\n\n throw new IOException(\"Unable to read shape files with version \" +\n fileVersion);\n\n }\n\n fileLength = ByteUtils.readBEInt(header, 24);\n\n /* \n * convert from 16-bit words to 8-bit bytes\n */\n fileLength *= 2;\n\n fileShapeType = ByteUtils.readLEInt(header, 32);\n\n /*\n * read ESRIBoundingBox and convert to SHPEnvelope\n */\n fileMBR = new SHPEnvelope(ShapeUtils.readBox(header, 36));\n\n }",
"protected void readHeader() {\n // Denote no lines have been read.\n this.lineCount = 0;\n // Read the header.\n if (! this.reader.hasNext()) {\n // Here the entire file is empty. Insure we get EOF on the first read.\n this.nextLine = null;\n } else {\n this.headerLine = this.reader.next();\n // Parse the header line into labels and normalize them to lower case.\n this.labels = this.splitLine(headerLine);\n // Set up to return the first data line.\n this.readAhead();\n }\n }",
"private void readFields() throws IOException, ClassFormatException {\n final int fields_count = dataInputStream.readUnsignedShort();\n fields = new Field[fields_count];\n for (int i = 0; i < fields_count; i++) {\n fields[i] = new Field(dataInputStream, constant_pool);\n }\n }",
"@Test\n\t@SuppressWarnings(\"unchecked\")\n\tpublic void test_headerSplitOnNofLinesWithRegex() throws StageException, IOException {\n\t\tprocessor.headerConfig = getHeaderConfig(null, NOF_HEADER_LINES);\n\n\t\t// prepare details config\n\t\tprocessor.detailsConfig.detailsColumnHeaderType = DetailsColumnHeaderType.USE_HEADER;\n\t\tprocessor.detailsConfig.separatorAsRegex = true;\n\t\tprocessor.parserConfig.splitDetails = true;\n\t\t\n\t\trunner = new ProcessorRunner.Builder(HeaderDetailParserDProcessor.class, processor)\n\t\t\t\t.setExecutionMode(ExecutionMode.STANDALONE)\n\t\t\t\t.setResourcesDir(\"/tmp\")\n\t\t\t\t.addOutputLane(\"header\").addOutputLane(\"headerDetails\")\n\t\t\t\t.build();\n\t\trunner.runInit();\n\n\t\t// run the test\n\t\tList<Record> op = null;\n\t\ttry {\n\t\t\tList<Record> input = prepareInput(TEST_FILE_WITH_HEADER_AND_DETAILS_HEADER);\n\t\t \n\t\t\tlong startTime = System.currentTimeMillis();\n\t\t\t\n\t\t\tStageRunner.Output output = runner.runProcess(input);\n\t\t\t\n\t\t System.out.println(\"test_headerSplitOnNofLinesWithRegex - Total execution time: \" + (System.currentTimeMillis()-startTime) + \"ms\"); \n\t\t\t\n\t\t op = output.getRecords().get(\"headerDetails\");\n\n\t\t} finally {\n\t\t\trunner.runDestroy();\n\t\t}\n\n\t\t// assert\n\t\tassertEquals(42324, op.size());\n//\t\tassertEquals(\"11:02:12.000\", StringUtils.substring(op.get(0).get(\"/detail\").getValueAsString(), 0, 12));\n\t}",
"public ReversedLinesFileReader(File file, int blockSize, Charset encoding) throws IOException {\n/* 96 */ this.blockSize = blockSize;\n/* 97 */ this.encoding = encoding;\n/* */ \n/* */ \n/* 100 */ Charset charset = Charsets.toCharset(encoding);\n/* 101 */ CharsetEncoder charsetEncoder = charset.newEncoder();\n/* 102 */ float maxBytesPerChar = charsetEncoder.maxBytesPerChar();\n/* 103 */ if (maxBytesPerChar == 1.0F)\n/* */ \n/* 105 */ { this.byteDecrement = 1; }\n/* 106 */ else if (charset == Charsets.UTF_8)\n/* */ \n/* */ { \n/* 109 */ this.byteDecrement = 1; }\n/* 110 */ else if (charset == Charset.forName(\"Shift_JIS\") || charset == Charset.forName(\"windows-31j\") || charset == Charset.forName(\"x-windows-949\") || charset == Charset.forName(\"gbk\") || charset == Charset.forName(\"x-windows-950\"))\n/* */ \n/* */ { \n/* */ \n/* */ \n/* */ \n/* 116 */ this.byteDecrement = 1; }\n/* 117 */ else if (charset == Charsets.UTF_16BE || charset == Charsets.UTF_16LE)\n/* */ \n/* */ { \n/* 120 */ this.byteDecrement = 2; }\n/* 121 */ else { if (charset == Charsets.UTF_16) {\n/* 122 */ throw new UnsupportedEncodingException(\"For UTF-16, you need to specify the byte order (use UTF-16BE or UTF-16LE)\");\n/* */ }\n/* */ \n/* 125 */ throw new UnsupportedEncodingException(\"Encoding \" + encoding + \" is not supported yet (feel free to \" + \"submit a patch)\"); }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 130 */ this.newLineSequences = new byte[][] { \"\\r\\n\".getBytes(encoding), \"\\n\".getBytes(encoding), \"\\r\".getBytes(encoding) };\n/* */ \n/* 132 */ this.avoidNewlineSplitBufferSize = (this.newLineSequences[0]).length;\n/* */ \n/* */ \n/* 135 */ this.randomAccessFile = new RandomAccessFile(file, \"r\");\n/* 136 */ this.totalByteLength = this.randomAccessFile.length();\n/* 137 */ int lastBlockLength = (int)(this.totalByteLength % blockSize);\n/* 138 */ if (lastBlockLength > 0) {\n/* 139 */ this.totalBlockCount = this.totalByteLength / blockSize + 1L;\n/* */ } else {\n/* 141 */ this.totalBlockCount = this.totalByteLength / blockSize;\n/* 142 */ if (this.totalByteLength > 0L) {\n/* 143 */ lastBlockLength = blockSize;\n/* */ }\n/* */ } \n/* 146 */ this.currentFilePart = new FilePart(this.totalBlockCount, lastBlockLength, null);\n/* */ }",
"public void processRaw(String rawfilepath){\n\t\tbyte tempbyte[] = new byte[131072];\n\t\ttempbyte = loadBytes(rawfilepath);\n\t\tfor (int i=0; i < header.length; i++){\n\t\t\theader[i]= tempbyte[i];\n\t\t}\n\t\tfor (int i = 0; i < EEPROM.length;){\n\t\t\tEEPROM[i] = tempbyte[i+1024];\n\t\t}\n\t\torganizeEEPROM();\n\t\tprocessData();\n\t\tsavefile();\n\t}",
"public long parseVCard(BufferedReader vCard) throws IOException {\n\t\t// Reset the currently read values.\n\t\treset();\n\n\t\t// Find Begin.\n\t\tString line = vCard.readLine();\n\t\tif (line != null)\n\t\t\tparseLen += line.length();\n\t\telse\n\t\t\treturn -1;\n\n\t\twhile (line != null && !beginPattern.matcher(line).matches()) {\n\t\t\tline = vCard.readLine();\n\t\t\tparseLen += line.length();\n\t\t}\n\n\t\tboolean skipRead = false;\n\n\t\twhile (line != null) {\n\t\t\tif (!skipRead) {\n\t\t\t\tline = vCard.readLine();\n\t\t\t}\n\n\t\t\tif (line == null) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tparseLen += line.length();\n\n\t\t\tskipRead = false;\n\n\t\t\t// do multi-line unfolding (cr lf with whitespace immediately\n\t\t\t// following is removed, joining the two lines).\n\t\t\tvCard.mark(1);\n\t\t\tfor (int ch = vCard.read(); ch == (int) ' ' || ch == (int) '\\t'; ch = vCard\n\t\t\t\t\t.read()) {\n\t\t\t\tvCard.reset();\n\t\t\t\tString newLine = vCard.readLine();\n\t\t\t\tif (newLine != null) {\n\t\t\t\t\tline += newLine;\n\t\t\t\t\tparseLen += line.length();\n\t\t\t\t\t// parseLen += newLine.length();\n\t\t\t\t}\n\t\t\t\tvCard.mark(1);\n\t\t\t}\n\t\t\tvCard.reset();\n\n\t\t\t// parseLen += line.length(); // TODO: doesn't include CR LFs\n\n\t\t\tMatcher pm = propPattern.matcher(line);\n\n\t\t\tif (pm.matches()) {\n\t\t\t\tString prop = pm.group(1);\n\t\t\t\tString val = pm.group(2);\n\n\t\t\t\tif (prop.equalsIgnoreCase(\"END\")\n\t\t\t\t\t\t&& val.equalsIgnoreCase(\"VCARD\")) {\n\t\t\t\t\t// End of vCard\n\t\t\t\t\treturn parseLen;\n\t\t\t\t}\n\n\t\t\t\tMatcher ppm = propParamPattern.matcher(prop);\n\t\t\t\tif (!ppm.find())\n\t\t\t\t\t// Doesn't seem to be a valid vCard property\n\t\t\t\t\tcontinue;\n\n\t\t\t\tString propName = ppm.group(1).toUpperCase();\n\t\t\t\tVector<String> propVec = new Vector<String>();\n\t\t\t\tString charSet = \"UTF-8\";\n\t\t\t\tString encoding = \"\";\n\t\t\t\twhile (ppm.find()) {\n\t\t\t\t\tString param = ppm.group(1);\n\t\t\t\t\tString paramVal = ppm.group(3);\n\t\t\t\t\tpropVec.add(param\n\t\t\t\t\t\t\t+ (paramVal != null ? \"=\" + paramVal : \"\"));\n\t\t\t\t\tif (param.equalsIgnoreCase(\"CHARSET\"))\n\t\t\t\t\t\tcharSet = paramVal;\n\t\t\t\t\telse if (param.equalsIgnoreCase(\"ENCODING\"))\n\t\t\t\t\t\tencoding = paramVal;\n\t\t\t\t\tLog.d(TAG, \"propName: \" + propName + \", paramVal: \"\n\t\t\t\t\t\t\t+ paramVal);\n\t\t\t\t}\n\t\t\t\tif (encoding.equalsIgnoreCase(\"QUOTED-PRINTABLE\")) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tval = QuotedPrintable.decode(val.getBytes(charSet),\n\t\t\t\t\t\t\t\t\"UTF-8\");\n\t\t\t\t\t} catch (UnsupportedEncodingException uee) {\n\n\t\t\t\t\t}\n\t\t\t\t} else if (encoding.equalsIgnoreCase(\"BASE64\")) {\n\t\t\t\t\tStringBuffer tmpVal = new StringBuffer(val);\n\t\t\t\t\tdo {\n\t\t\t\t\t\tline = vCard.readLine();\n\n\t\t\t\t\t\tif ((line == null) || (line.length() == 0)\n\t\t\t\t\t\t\t\t|| (!base64Pattern.matcher(line).matches())) {\n\t\t\t\t\t\t\t// skipRead = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparseLen += line.length();\n\t\t\t\t\t\ttmpVal.append(line);\n\t\t\t\t\t} while (true);\n\n\t\t\t\t\tBase64Coder.decodeInPlace(tmpVal);\n\t\t\t\t\tval = tmpVal.toString();\n\t\t\t\t}\n\t\t\t\thandleProp propHandler = propHandlers.get(propName);\n\t\t\t\tif (propHandler != null)\n\t\t\t\t\tpropHandler.parseProp(propName, propVec, val);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"public void readRecordComp(float[] data, int start, int length, int offset,\n\t\t\tint pixelStride, int n2, int n3) throws IOException;",
"public RDCAnalysisChunking(byte[] fileContent) {\n super(fileContent);\n }",
"public synchronized long readRecords(int locusLength, List<SAMRecord> targetList){\n targetList.clear();\n this.curLocus += locusLength; // read with coordinate less than this will be put into targetList\n int curLocus = this.curLocus;\n\n // put reads in buffer whose coordinate is before curLocus into target\n // reads not in range keep in readBuffer.\n ArrayList<SAMRecord> swapBuffer = new ArrayList<SAMRecord>();\n for(SAMRecord record : readBuffer){\n int coordinate = record.getReadNegativeStrandFlag() ? record.getUnclippedEnd() : record.getUnclippedStart();\n if(coordinate <= curLocus){\n targetList.add(record);\n }\n else{\n swapBuffer.add(record);\n }\n }\n readBuffer.clear();\n readBuffer = swapBuffer;\n\n // scan the file to see new reads\n try {\n final CloseableIterator<SAMRecord> iterator = samHeaderAndIterator.iterator;\n while (iterator.hasNext()) {\n SAMRecord record = iterator.next();\n readFileIndex++;\n if (record.getReadUnmappedFlag() || record.isSecondaryOrSupplementary())\n continue;\n int thisCoordinate = record.getReadNegativeStrandFlag() ? record.getUnclippedEnd() : record.getUnclippedStart();\n record.setAttribute(ReadEnds.FILE_INDEX_TAG, Long.toString(readFileIndex));\n\n int contigIdx = record.getReferenceIndex();\n if (contigIdx != curContigIdx) { // Finish this method and jump to next contig.\n curContigIdx = contigIdx;\n this.curLocus = record.getAlignmentStart(); // mark as the start as it always larger than alignmentEnd\n readBuffer.add(record);\n return targetList.size();\n }\n if (thisCoordinate <= curLocus) { // if in the region, just add into the target\n targetList.add(record);\n } else { // if not in the region, see if is negative read.\n if (record.getReadNegativeStrandFlag()) { // if so, there may still have positive read following, so store it in buffer.\n readBuffer.add(record);\n } else {\n readBuffer.add(record); // if not, there's no reads in this position, just cut off.\n return targetList.size();\n }\n }\n }\n iterator.close(); // may close many times\n }catch (AssertionError e){ // iterator has been closed\n return -1;\n }\n if(readBuffer.size() == 0) { // if no reads left, return -1 to represent.\n return -1;\n }\n return targetList.size();\n }",
"protected List<String[]> readCsvFile(byte[] bytes, String separator, String quote) {\n\t\ttry (CharSequenceReader seq = new CharSequenceReader(new String(bytes, Charset.forName(DynamoConstants.UTF_8)));\n\t\t CSVReader reader = new CSVReader(seq, separator.charAt(0), quote.charAt(0))) {\n\t\t\treturn reader.readAll();\n\t\t} catch (IOException ex) {\n\t\t\tthrow new OCSImportException(ex.getMessage(), ex);\n\t\t}\n\t}",
"private byte[] readFdocaBytes(int length) {\n\n checkForSplitRowAndComplete(length);\n\n byte[] b = new byte[length];\n dataBuffer_.readBytes(b);\n// System.arraycopy(dataBuffer_, position_, b, 0, length);\n// position_ += length;\n//\n return b;\n }",
"@Test\n public void testMultipleBlocks()\n {\n long blockSize = 1000;\n int noOfBlocks = (int)((testMeta.dataFile.length() / blockSize)\n + (((testMeta.dataFile.length() % blockSize) == 0) ? 0 : 1));\n\n testMeta.blockReader.beginWindow(1);\n\n for (int i = 0; i < noOfBlocks; i++) {\n BlockMetadata.FileBlockMetadata blockMetadata = new BlockMetadata.FileBlockMetadata(s3Directory + FILE_1, i,\n i * blockSize, i == noOfBlocks - 1 ? testMeta.dataFile.length() : (i + 1) * blockSize, i == noOfBlocks - 1,\n i - 1, testMeta.dataFile.length());\n testMeta.blockReader.blocksMetadataInput.process(blockMetadata);\n }\n\n testMeta.blockReader.endWindow();\n\n List<Object> messages = testMeta.messageSink.collectedTuples;\n Assert.assertEquals(\"No of records\", testMeta.messages.size(), messages.size());\n for (int i = 0; i < messages.size(); i++) {\n\n byte[] msg = (byte[])messages.get(i);\n Assert.assertTrue(\"line \" + i, Arrays.equals(new String(msg).split(\",\"), testMeta.messages.get(i)));\n }\n }",
"public Block(Record[] records, int blockSize) {\n this.records = records;\n this.blockSize = blockSize;\n }",
"public void processHeader()\n {\n try{\n String line = oReader.readLine();\n String regrex = line.replaceAll(\"[^0-9]+\",\"\"); //only looking at the numbers\n this.maxmem = Integer.parseInt(regrex.substring(4, 8), 16);\n mem = new MainMemory(maxmem);\n\n } catch(IOException e)\n {\n e.printStackTrace();\n }\n }",
"public static void readHeaderFields(InputStream in, HashMap headerfields) throws IOException, ProtocolException {\r\n\t\tString fieldname = null;\r\n\t\tint i;\r\n\t\tSimpleStringBuilder buffer = Toolkit.getInstance().createSimpleStringBuilder();\r\n\t\tboolean foundCR = false;\r\n\t\tboolean foundCRLF = false;\r\n\t\twhile (((i = in.read()) != -1)) {\r\n\t\t\tif (fieldname == null) {\r\n\t\t\t\tif (i == Specialchars.CR && foundCRLF) {\r\n\t\t\t\t\tfoundCR = true;\r\n\t\t\t\t\tfoundCRLF = false;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif (foundCR) {\r\n\t\t\t\t\tif (i == Specialchars.LF) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthrow new ProtocolException(FAULT_MALFORMED_HEADERFIELD);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (i == Specialchars.COL) {\r\n\t\t\t\t\tfieldname = buffer.toString().toLowerCase();\r\n\t\t\t\t\tif (fieldname.length() == 0) {\r\n\t\t\t\t\t\tthrow new ProtocolException(FAULT_MALFORMED_HEADERFIELD);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbuffer.clear();\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t// no CTL (ascii 0-31) allowed for field-name\r\n\t\t\t\t// no separators allowed for token (see RFC2616 2.2)\r\n\t\t\t\tif ((i >= 0x00 && i <= 0x1F) || i == 0x28 || i == 0x29 || i == 0x3C || i == 0x3D || i == 0x3E || i == 0x40 || i == 0x2C || i == 0x3F || i == 0x3B || i == 0x2F || i == 0x5C || i == 0x5B || i == 0x5D || i == 0x7B || i == 0x7D || i == 0x22 || i == Specialchars.SP || i == Specialchars.HT) { //\r\n\t\t\t\t\tthrow new ProtocolException(FAULT_MALFORMED_HEADERFIELD);\r\n\t\t\t\t}\r\n\t\t\t\tfoundCRLF = false;\r\n\t\t\t\tbuffer.append((char) i);\r\n\t\t\t} else {\r\n\t\t\t\tif (i == Specialchars.CR) {\r\n\t\t\t\t\tif (foundCR) {\r\n\t\t\t\t\t\tthrow new ProtocolException(FAULT_MALFORMED_HEADERFIELD);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfoundCR = true;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t// check for new line end\r\n\t\t\t\tif (i == Specialchars.LF) {\r\n\t\t\t\t\tif (!foundCR) {\r\n\t\t\t\t\t\tthrow new ProtocolException(FAULT_MALFORMED_HEADERFIELD);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (foundCRLF) {\r\n\t\t\t\t\t\t// double CRLF, header ends here\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (fieldname.startsWith(MIMEConstants.DEFAULT_HEADERFIELD_PREFIX)) {\r\n\t\t\t\t\t\theaderfields.put(fieldname, buffer.toTrimmedString().toLowerCase());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfoundCR = false;\r\n\t\t\t\t\tfoundCRLF = true;\r\n\t\t\t\t\tbuffer.clear();\r\n\t\t\t\t\tfieldname = null;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tfoundCR = false;\r\n\t\t\t\tfoundCRLF = false;\r\n\t\t\t\tbuffer.append((char) i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tthrow new IOException(FAULT_MALFORMED_HEADERFIELD);\r\n\t}",
"IRegion getLineInformation(int line) throws BadLocationException;",
"protected long readDataStartHeader() throws IOException {\n file.seek(DATA_START_HEADER_LOCATION);\n return file.readLong();\n }",
"FieldLocation getFieldLocation(ByteBlock block, BigInteger offset, FieldFactory[] factorys) {\n\t\tfor (BlockInfo blockInfo : blockInfoMap.values()) {\n\t\t\tif (blockInfo.block == block) {\n\t\t\t\tBigInteger byteIndex = blockInfo.blockStart.add(offset);\n\t\t\t\tBigInteger index = byteIndex.divide(bytesInLine);\n\t\t\t\tint lineOffset = byteIndex.remainder(bytesInLine).intValue();\n\n\t\t\t\t//int fieldOffset = lineOffset / fields.length;\n\t\t\t\tint nbytesPerField = bytesInLine.intValue() / factorys.length;\n\t\t\t\tint fieldOffset = (lineOffset / nbytesPerField) * nbytesPerField;\n\n\t\t\t\tint byteOffset = lineOffset % nbytesPerField;\n\n\t\t\t\tint fieldNum = getFieldNum(index, fieldOffset, factorys);\n\t\t\t\tint col = factorys[fieldNum].getColumnPosition(block, byteOffset);\n\t\t\t\treturn new FieldLocation(index, fieldNum, 0, col);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"IRegion getLineInformationOfOffset(int offset) throws BadLocationException;",
"private DecoderState readHeaders(ByteBuf in) {\n\n DecoderState nextState = DecoderState.READ_HEADERS;\n String line;\n\n // Read as long as we haven't reached the end of the headers (i.e.\n // the next state) and we have full lines to read.\n while (nextState == DecoderState.READ_HEADERS && (line = readLine(in))\n != null) {\n\n if (line.isEmpty()) {\n nextState = DecoderState.READ_BODY;\n }\n else {\n int pos = line.indexOf(COLON_CHAR);\n if (pos > 0) {\n String key = line.substring(0, pos);\n\n // The spec defines that only the first occurrance of a header\n // should be preserved in a single frame.\n if (!headers.getHeaderNames().contains(key)) {\n\n // Move past the colon delimiter.\n pos++;\n\n // Extract the value and decode header value as per the spec. Is\n // there a faster way to do this than a bunch of individual\n // replaces?\n String value = pos >= line.length() ? null : line.substring(pos).\n replace(OCTET_92_92, OCTET_92)\n .replace(OCTET_92_99, OCTET_58)\n .replace(OCTET_92_110, OCTET_10)\n .replace(OCTET_92_114, OCTET_13);\n\n headers.put(key, value);\n }\n }\n else {\n // Invalid frame. A header must contain a ':'.\n throw new CorruptedFrameException(\"Header must contain a name and \"\n + \"value separated by a colon character.\");\n }\n }\n }\n\n return nextState;\n }",
"protected RecordHeader getRecordAt(long targetFp) throws IOException {\n for (RecordHeader next : getMemIndex().values()) {\n if (targetFp >= next.dataPointer &&\n targetFp < next.dataPointer + (long)next.dataCapacity) {\n return next;\n }\n }\n return null;\n }",
"alluxio.proto.journal.File.NewBlockEntryOrBuilder getNewBlockOrBuilder();",
"@Override\n\tpublic byte[] readBlock(byte[] input) {\n\t\tReadBlockRequest readBlockRequest = new ReadBlockRequest(input);\n\t\tReadBlockResponse readBlockResponse = new ReadBlockResponse();\n\t\ttry {\n\t\t\tFile file = new File(\"\" + readBlockRequest.blockNumber);\n\t\t\tif (file.exists()) {\n\t\t\t\tFileInputStream fis = new FileInputStream(file);\n\t\t\t\tbyte[] data = new byte[(int) file.length()];\n\t\t\t\tfis.read(data);\n\t\t\t\treadBlockResponse.data = data;\n\t\t\t\treadBlockResponse.status = 1;\n\t\t\t\tfis.close();\n\t\t\t} else {\n\t\t\t\treadBlockResponse.status = -1;\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t// readBlockRequest.blockNumber;\n\t\treturn readBlockResponse.toProto();\n\t}",
"public ByteBuffer read(int fileId) throws IOException {\n Assert.isPositive(fileId, \"File Id must be positive\");\n Assert.isTrue(fileId <= 0xFFFFFF, \"File Id is 3 bytes at most\");\n\n if(fileId * INDEX_BLOCK_LEN >= index.size()) {\n // We avoid slipping off the edge of the file and trying to access data that doesn't exist.\n // This isn't the only possible reason a file doesn't exist though!\n throw new FileNotFoundException(\"no such file (\" + fileId + \")\");\n }\n\n ByteBuffer entry = ByteBuffer.allocate(INDEX_BLOCK_LEN);\n index.read(entry, fileId * INDEX_BLOCK_LEN);\n entry.flip();\n\n int size = readTriByte(entry);\n int nextBlock = readTriByte(entry);\n\n if (nextBlock == 0) {\n throw new FileNotFoundException(\"no such file (\" + fileId + \") - it may have been erased or not initialised\");\n }\n\n ByteBuffer contents = ByteBuffer.allocate(size);\n ByteBuffer chunk = ByteBuffer.allocate(TOTAL_BLOCK_LEN);\n\n int chunkNumber = 0;\n while(contents.remaining() > 0) {\n data.read(chunk, nextBlock * TOTAL_BLOCK_LEN);\n chunk.flip();\n\n Assert.equal(fileId, chunk.getShort() & 0xFFFF);\n Assert.equal(chunkNumber, chunk.getShort() & 0xFFFF);\n\n nextBlock = readTriByte(chunk);\n Assert.equal(indexId, chunk.get());\n\n // We read as much of the chunk as we can, until the buffer is full. Once the buffer\n // is full, the rest of the chunk is garbage (and there should be no more chunks)\n int limit = chunk.limit();\n if(chunk.remaining() > contents.remaining()) {\n chunk.limit(chunk.position() + contents.remaining());\n }\n\n contents.put(chunk);\n chunk.limit(limit);\n\n chunk.flip();\n chunkNumber++;\n }\n\n contents.flip();\n\n return contents;\n }",
"public interface RawSnapshotReader extends Closeable, Iterable<RecordBatch> {\n /**\n * Returns the end offset and epoch for the snapshot.\n */\n OffsetAndEpoch snapshotId();\n\n /**\n * Returns the number of bytes for the snapshot.\n *\n * @throws IOException for any IO error while reading the size\n */\n long sizeInBytes() throws IOException;\n\n /**\n * Reads bytes from position into the given buffer.\n *\n * It is not guarantee that the given buffer will be filled.\n *\n * @param size size to read from snapshot file\n * @param position the starting position in the snapshot to read\n * @return the region read from snapshot\n * @throws IOException for any IO error while reading the snapshot\n */\n UnalignedRecords read(long position, int size) throws IOException;\n}",
"protected int readNumRecordsHeader() throws IOException {\n file.seek(NUM_RECORDS_HEADER_LOCATION);\n return file.readInt();\n }",
"public abstract RecordReader<K , V> createRecordReader(InputSplit inputSplit) throws IOException, SfsFileDoesNotExistException;",
"private Block getBlockFromRecord(GameLogsRecord record) {\n JsonObject json = JsonParser.parseString(record.getMessage()).getAsJsonObject();\n // If Block logs are incomplete, the missing values are the default 0\n // This should only occur for games that were played before\n // TODO: date of setting up infrastructure commit 96b2fde on the server\n int x = 0, y = 0, z = 0;\n if (json.has(\"x\")) {\n x = json.get(\"x\").getAsInt();\n } else {\n logger.error(\"Missing x value for block at {}: {}\", json, record.getTimestamp());\n }\n if (json.has(\"y\")) {\n y = json.get(\"y\").getAsInt();\n } else {\n logger.error(\"Missing y value for block at {}: {}\", json, record.getTimestamp());\n }\n if (json.has(\"z\")) {\n z = json.get(\"z\").getAsInt();\n } else {\n logger.error(\"Missing z value for block at {}: {}\", json, record.getTimestamp());\n }\n return new Block(x, y, z);\n }",
"public static void load() {\r\n\t\tString mar = new String(readMAR().getStr());\r\n\t\tTraceINF.write(\"Read memory \"+mar);\r\n\t\tFormatstr content = new Formatstr();\r\n//\t\tSystem.out.println(\"index\"+Integer.parseInt(mar.substring(0, mar.length() - 2), 2));\r\n\t\tcontent.setStr(getBank(mar)[Integer.parseInt(mar.substring(0, mar.length() - 2), 2)]);\r\n\t\t\r\n\t\twriteMBR(content);\r\n\t\tTraceINF.write(\"Read finished.\");\r\n\t}",
"private void readHeader(byte[] content){\n StringBuilder header = new StringBuilder();\n char c;\n int j = 0;\n for (int i = 0; i < 3; ++i){\n c = (char) content[j];\n header.append(c);\n ++j;\n if(c == '#')--i;\n while((c = (char) content[j]) != '\\n') {\n header.append(c);\n ++j;\n }\n header.append(c);\n ++j;\n }\n this.header = header.toString();\n this.headerSize = header.length();\n\n j = 0;\n for(int i = 0; i < 3; ++i){\n c = header.charAt(j);\n if(c == '#'){\n while(header.charAt(j) != '\\n')++j;\n ++j;\n --i;\n } else{\n if(i == 0){\n while(header.charAt(j) != '\\n')++j;\n ++j;\n } else if(i==1){\n StringBuilder width = new StringBuilder();\n StringBuilder height = new StringBuilder();\n while(c != ' '){\n width.append(c);\n ++j;\n c = header.charAt(j);\n }\n ++j;\n c = header.charAt(j);\n while(c != '\\n' && c != '#' && c != ' '){\n height.append(c);\n ++j;\n c = header.charAt(j);\n }\n while(header.charAt(j)!='\\n')++j;\n ++j;\n this.width = Integer.parseInt(width.toString());\n this.height = Integer.parseInt(height.toString());\n } else {\n StringBuilder resolution = new StringBuilder();\n while(c != '\\n'){\n resolution.append(c);\n ++j;\n c = header.charAt(j);\n }\n this.resolution = Integer.parseInt(resolution.toString());\n }\n }\n }\n }",
"public byte[] deserializeBinFile(byte[] buf){\n int size = buf.length;\n ByteBuffer buffer = ByteBuffer.wrap(buf);\n msgType = buffer.getShort(0);\n byte[] srcIP_temp = new byte[15];\n System.arraycopy(buf, 2, srcIP_temp, 0, 15);\n String srcIP_str = new String(srcIP_temp);\n srcIP = srcIP_str.trim();\n srcPort = buffer.getInt(17);\n desCost = buffer.getFloat(21);\n byte[] desIP_temp = new byte[15];\n System.arraycopy(buf, 25, desIP_temp, 0, 15);\n String desIP_str = new String(desIP_temp);\n desIP = desIP_str.trim();\n desPort = buffer.getInt(40);\n byte[] filenameBuf = new byte[filenameSize];\n System.arraycopy(buf, 44, filenameBuf, 0, filenameSize);\n String filename_str = new String(filenameBuf);\n filename = filename_str.trim();\n offset = buffer.getInt(44 + filenameSize);\n checksum = buffer.getShort(44+filenameSize+offsetSize);\n int pos = 44+filenameSize+offsetSize+2;\n if(pos>=size) return null;\n byte[] binBytes = new byte[size-pos];\n System.arraycopy(buf, pos, binBytes, 0, binBytes.length);\n return binBytes;//the returned bin array which does not include the offset.\n }",
"private ByteList fread(RubyThread thread, int length) throws IOException, BadDescriptorException {\n Stream stream = openFile.getMainStreamSafe();\n int rest = length;\n waitReadable(stream);\n ByteList buf = blockingFRead(stream, thread, length);\n if (buf != null) {\n rest -= buf.length();\n }\n while (rest > 0) {\n waitReadable(stream);\n openFile.checkClosed(getRuntime());\n stream.clearerr();\n ByteList newBuffer = blockingFRead(stream, thread, rest);\n if (newBuffer == null) {\n // means EOF\n break;\n }\n int len = newBuffer.length();\n if (len == 0) {\n // TODO: warn?\n // rb_warning(\"nonblocking IO#read is obsolete; use IO#readpartial or IO#sysread\")\n continue;\n }\n if (buf == null) {\n buf = newBuffer;\n } else {\n buf.append(newBuffer);\n }\n rest -= len;\n }\n if (buf == null) {\n return ByteList.EMPTY_BYTELIST.dup();\n } else {\n return buf;\n }\n }",
"public BlockFileContainer (String prefix, int blockSize) {\n\t\tthis(prefix, blockSize, JavaFilesystemOperations.DEFAULT_INSTANCE);\n\t}",
"public void readBinary(RandomAccessFile stream) {\r\n\t\t\r\n\t\t// Create a byte array for all the string fields with the max length\r\n\t\tbyte[] dateByte = new byte[dateLength];\r\n\t\tbyte[] stratumByte = new byte[stratumLength];\r\n\t\tbyte[] raceOtherByte = new byte[raceOtherLength];\r\n\t\tbyte[] diagOtherByte = new byte[diagOtherLength];\r\n\t\tbyte[] narr1Byte = new byte[narr1Length];\r\n\t\tbyte[] narr2Byte = new byte[narr2Length];\r\n\t\t\r\n\t\t// Read the fields from Binary file\r\n\t\ttry {\r\n\t\t\tcpscCase = stream.readInt();\r\n\t\t\tstream.readFully(dateByte);\r\n\t\t\ttrmt_date = new String(dateByte);\r\n\t\t\tpsu = stream.readInt();\r\n\t\t\tweight = stream.readDouble();\r\n\t\t\tstream.readFully(stratumByte);\r\n\t\t\tstratum = new String(stratumByte);\r\n\t\t\tage = stream.readInt();\r\n\t\t\tsex = stream.readInt();\r\n\t\t\trace = stream.readInt();\r\n\t\t\tstream.readFully(raceOtherByte);\r\n\t\t\trace_other = new String(raceOtherByte);\r\n\t\t\tdiag = stream.readInt();\r\n\t\t\tstream.readFully(diagOtherByte);\r\n\t\t\tdiag_other = new String(diagOtherByte);\r\n\t\t\tbody_part = stream.readInt();\r\n\t\t\tdisposition = stream.readInt();\r\n\t\t\tlocation = stream.readInt();\r\n\t\t\tfmv = stream.readInt();\r\n\t\t\tprod1 = stream.readInt();\r\n\t\t\tprod2 = stream.readInt();\r\n\t\t\tstream.readFully(narr1Byte);\r\n\t\t\tnarr1 = new String(narr1Byte);\r\n\t\t\tstream.readFully(narr2Byte);\r\n\t\t\tnarr2 = new String(narr2Byte);\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}",
"phaseI.Hdfs.BlockLocations getBlockLocations(int index);",
"@Override\n public byte[] readBlock(long offset, int length) {\n\n if (length == 0) {\n return new byte[]{};\n }\n\n Range range = getRange(offset, length);\n\n byte[] block = new byte[length];\n ByteBuffer buffer = ByteBuffer.wrap(block);\n\n readWriteLock.readLock().lock();\n try {\n range.visitFiles(new RangeFileVisitor() {\n\n int offsetInBlock = 0;\n\n @Override\n public void visitFile(StorageUnit unit, long off, long lim) {\n\n long len = lim - off;\n if (len > Integer.MAX_VALUE) {\n throw new BtException(\"Too much data requested\");\n }\n\n if (((long) offsetInBlock) + len > Integer.MAX_VALUE) {\n // overflow -- isn't supposed to happen unless the algorithm in range is incorrect\n throw new BtException(\"Integer overflow while constructing block\");\n }\n\n buffer.position(offsetInBlock);\n buffer.limit(offsetInBlock + (int)len);\n unit.readBlock(buffer, off);\n offsetInBlock += len;\n }\n });\n } finally {\n readWriteLock.readLock().unlock();\n }\n\n return block;\n }",
"public interface VicarInput extends VicarIOBase\n{\n\n/***********************************************************************\n * Low-level read function, returns a byte array for the given record.\n * The most normal call, to read an entire record, would be\n * <code>x.readRecord(data, 0, 0, 0, 1, line, band);</code>\n * @param data The array to read into\n * @param start Starting position in the record. Normally 0 to read the whole\n * record.\n * @param length Number of pixels to read. If 0, the rest of the record is\n * read.\n * @param offset Offset into the data array at which to put the data.\n * @param pixelStride Offset from one pixel to the next in the array. For\n * example, a stride of 1 has all pixels contiguous while a stride of 3\n * allows band interleaved pixels in the array (pixels read from the file\n * will be put 3 elements apart in the array). This has nothing to do with\n * what is read from the file - only where the data is put in the array.\n * Note that this value is measured in pixels or array elements - not bytes.\n * @param n2 \"Line number\" to read (for BSQ organization). (For BIL: band\n * number, for BIP: sample number). The second dimension's index.\n * @param n3 \"Band number\" to read (for BSQ organization). (For BIL or BIP:\n * line number). The third dimension's index.\n * @throws NonSequentialAccessException (subclass of IOException)\n * @throws IOException\n */\n public void readRecord(byte[] data, int start, int length, int offset,\n\t\t\tint pixelStride, int n2, int n3) throws IOException;\n\n/***********************************************************************\n * Low-level read function, returns a short array for the given record.\n * Follow the See Also link for parameters.\n * @see #readRecord(byte[], int, int, int, int, int, int)\n */\n public void readRecord(short[] data, int start, int length, int offset,\n\t\t\tint pixelStride, int n2, int n3) throws IOException;\n\n/***********************************************************************\n * Low-level read function, returns an unsigned short array for the given\n * record. Although unsigned short is not a VICAR data type, it is useful\n * for some other formats which use this library. Note that a short array\n * must be used, although the data should be interepreted as unsigned.\n * For this reason, a different method name is needed.\n * <p>\n * Follow the See Also link for parameters.\n * @see #readRecord(byte[], int, int, int, int, int, int)\n */\n public void readRecordUshort(short[] data, int start, int length,\n\t\tint offset, int pixelStride, int n2, int n3) throws IOException;\n\n/***********************************************************************\n * Low-level read function, returns an int array for the given record.\n * Follow the See Also link for parameters.\n * @see #readRecord(byte[], int, int, int, int, int, int)\n */\n public void readRecord(int[] data, int start, int length, int offset,\n\t\t\tint pixelStride, int n2, int n3) throws IOException;\n\n/***********************************************************************\n * Low-level read function, returns a float array for the given record.\n * Follow the See Also link for parameters.\n * @see #readRecord(byte[], int, int, int, int, int, int)\n */\n public void readRecord(float[] data, int start, int length, int offset,\n\t\t\tint pixelStride, int n2, int n3) throws IOException;\n\n/***********************************************************************\n * Low-level read function, returns a double array for the given record.\n * Follow the See Also link for parameters.\n * @see #readRecord(double[], int, int, int, int, int, int)\n */\n public void readRecord(double[] data, int start, int length, int offset,\n\t\t\tint pixelStride, int n2, int n3) throws IOException;\n\n/***********************************************************************\n * Low-level read function, returns complex data in a float array for the\n * given record. Each complex value is stored in two consecutive float\n * elements in the array, so it must be twice as long as you would normally\n * expect, and <code>offset</code> must be multiplied by 2. <code>length</code>\n * is still measured in <em>pixels</em>, so there are 2*<code>length</code>\n * values filled in the array.\n * <p>\n * Follow the See Also link for parameters.\n * @see #readRecord(byte[], int, int, int, int, int, int)\n */\n public void readRecordComp(float[] data, int start, int length, int offset,\n\t\t\tint pixelStride, int n2, int n3) throws IOException;\n\n////////////////////////////////////////////////////////////////////////\n\n/***********************************************************************\n * Provides access to the binary header, which is NLB records at the beginning\n * of the file. This function returns a <code>VicarBinaryLabel</code> object\n * which contains the entire header. From it, you can get a limited-length\n * stream which implements <code>DataInput</code>. This stream automatically\n * translates data types based on BINTFMT and BREALFMT, so e.g. if you call\n * <code>readFloat()</code>, the stream will either return the next four\n * bytes as a float (BREALFMT=IEEE), byte-swap them (BREALFMT=RIEEE), or\n * convert them from VAX format (BREALFMT=VAX). So a typical binary header\n * might be read like this:\n * <pre>\n * VicarBinaryLabel bh = file.getBinaryHeader();\n * DataInput di = bh.getDataInput();\n * int first = di.readInt();\n * short second = di.readShort();\n * byte b[8];\n * for (i=0; i<8; i++) b[i] = di.readByte();\n * String third(b);\n * ... etc ...\n * </pre>\n * The returned stream will signal EOF when the end of the binary header area\n * is reached. You can also access the label buffer directly via\n * <code>VicarBinaryLabel.getBuffer()</code>, but this is not recommended\n * (because no data type translation is done).\n * <p>\n * Internally, the header is copied to a buffer, so the\n * <code>VicarBinaryLabel</code> object will stay valid as long as you\n * need it (i.e., you can read data from the file and the header will still\n * stay valid).\n * <p>\n * If this routine is used with a strictly sequential file, it must be called\n * before any pixel data (or binary prefixes) are read.\n *\n * @return A VicarBinaryLabel that contains the header, or NULL if there is\n * header.\n * @throws NonSequentialAccessException (subclass of IOException)\n * @throws IOException\n * @see VicarBinaryLabel\n */\n public VicarBinaryLabel getBinaryHeader() throws IOException;\n\n/***********************************************************************\n * Provides access to the binary prefix, which is NBB <em>bytes</em> at the\n * beginning of each record. This function returns a\n * <code>VicarBinaryLabel</code> object which contains the entire prefix.\n * From it, you can get a limited-length stream which implements\n * <code>DataInput</code>, and behaves as described in\n * <code>getBinaryHeader()</code>. The stream will signal EOF at the end\n * of the prefix for this record. A buffer is maintained, as with the\n * header, so the <code>VicarBinaryLabel</code> object will stay valid in\n * the future. Direct access to the buffer is possibly but strongly\n * discouraged.\n * <p>\n * If this routine is used with a strictly sequential file, it must be called\n * before the pixel data for this record is read (and of course, after the\n * previous record's data). For this reason, this routine is incompatible\n * with the Tile read functions for strictly sequential files (unless the\n * tile height is 1).\n *\n * @param n2 \"Line number\" to read (for BSQ organization). (For BIL: band\n * number, for BIP: sample number). The second dimension's index.\n * @param n3 \"Band number\" to read (for BSQ organization). (For BIL or BIP:\n * line number). The third dimension's index.\n * @return A VicarBinaryLabel that contains the prefix, or NULL if there is no\n * prefix.\n * @throws NonSequentialAccessException (subclass of IOException)\n * @throws IOException\n * @see #getBinaryHeader()\n * @see VicarBinaryLabel\n */\n public VicarBinaryLabel getBinaryPrefix(int n2, int n3) throws IOException;\n\n////////////////////////////////////////////////////////////////////////\n\n/***********************************************************************\n * High-level read function. Given an x/y position in the file, read a\n * complete tile (size specified by the SampleModel) into the DataBuffer.\n * Data is placed in the SM starting at its origin. If the file does not\n * contain enough data to fill the SM, then only the parts that can be read,\n * are read. No error is returned in this case (it is up to the caller to\n * check the boundary conditions if needed).\n * @throws IOException if there are problems reading the file\n */\n public void readTile(int x, int y, SampleModel m, DataBuffer b)\n\t\t\tthrows IOException;\n\n/***********************************************************************\n * High-level read function. Given an x/y position in the file, and a\n * width/height, read that portion of the file into the given DataBuffer.\n * Data is placed starting at an origin of x_off/y_off within the SampleModel\n * (i.e. x/y is the position in the file to read, x_off/y_off is the position\n * within the buffer to place the data). If the file does not contain enough\n * data to satisfy width/height, then only the parts that can be read, are\n * read. No error is returned in this case (it is up to the caller to\n * check the boundary conditions if needed). However, if the requested\n * width/height (combined with x_off/y_off) will not fit within the SampleModel,\n * an ArrayIndexOutOfBoundsException is thrown.\n * @throws IOException if there are problems reading the file\n */\n public void readTile(int x, int y, int w, int h, int x_off, int y_off,\n\t\t\tSampleModel m, DataBuffer b)\n\t\t\tthrows IOException;\n\n/***********************************************************************\n * High-level read function. Just like the previous readTile, except that\n * an array of band numbers is also provided. Only bands in this array are\n * read. On output, the number of bands actually read will equal the size\n * of this array, i.e. original band numbers are not preserved. If too many\n * bands, or an out-of-range band number is specified, an\n * ArrayIndexOutOfBoundsException is thrown.\n * <p>\n * bandList may be null, in which case all bands are read. Note that for\n * Complex data, each part (real/imaginary) is treated as a separate band.\n * So, a multi-banded Complex file with have 2*nb bands. The bands requested\n * in bandList take this into account, e.g. band 2 in the list is the real\n * part of the file's band 1 (counting from 0), band 5 in the list is the\n * imaginary part of the file's band 3, etc.\n * <p>\n * For BIP data (Band Interleaved by Pixel), it is much more efficient to\n * read all bands at once (i.e. pass bandList as null).\n * @see #readTile(int,int,int,int,int,int,SampleModel,DataBuffer)\n * @throws IOException if there are problems reading the file\n */\n public void readTile(int x, int y, int w, int h, int x_off, int y_off,\n\t\t\tint bandList[],\n\t\t\tSampleModel m, DataBuffer b)\n\t\t\tthrows IOException;\n}",
"public int readVectorHeader() throws IOException {\n return in.readInt();\n }",
"@Override\n public void readTilePositions(BufferedRandomAccessFile braf) throws IOException {\n row0 = braf.leReadInt();\n col0 = braf.leReadInt();\n nRows = braf.leReadInt();\n nCols = braf.leReadInt();\n this.row1 = row0 + nRows - 1;\n this.col1 = col0 + nCols - 1;\n if (nCols == 0) {\n offsets = null;\n // no position records follow in file.\n } else {\n offsets = new long[nRows][];\n for (int i = 0; i < nRows; i++) {\n offsets[i] = new long[nCols];\n }\n for (int i = 0; i < nRows; i++) {\n for (int j = 0; j < nCols; j++) {\n offsets[i][j] = braf.leReadLong();\n }\n }\n }\n }",
"byte getBlockData();",
"@Nullable private CheckpointEntry parseFromFile(ByteBuffer buf, File file) throws IgniteCheckedException {\n Matcher matcher = CP_FILE_NAME_PATTERN.matcher(file.getName());\n\n if (!matcher.matches())\n return null;\n\n CheckpointEntryType type = CheckpointEntryType.valueOf(matcher.group(3));\n\n if (type != CheckpointEntryType.START)\n return null;\n\n long cpTs = Long.parseLong(matcher.group(1));\n UUID cpId = UUID.fromString(matcher.group(2));\n\n WALPointer ptr = readPointer(file, buf);\n\n return createCheckPointEntry(cpTs, ptr, cpId, null, CheckpointEntryType.START);\n }",
"byte[] load(String bucket, String file) throws IOException;",
"private void readHeader() throws IOException {\n\t\tString line = this.readLine();\n\t\tSystem.out.println(String.format(\"header->{%s}\", line));\n\t\tthis.columnNames = line.split(DEFAULT_DELIMITER);\n\t}",
"public void readFile(File inputFile) throws IOException {\n\t\tCSVParser csvParser = CSVParser.parse(inputFile, charset, csvFormat);\n\t\trecordList = csvParser.getRecords();\n\t}",
"private int readBlock() throws IOException {\n\t\t\tif (getSource().offset() == getSource().length()) return -1;\n\t\t\tgetMetadata().setBlockSize(getSource().read() & 0xff);\n\t\t\tint n = 0;\n\t\t\tint count;\n\n\t\t\tif (getMetadata().getBlockSize() > 0) {\n\t\t\t\ttry {\n\t\t\t\t\twhile (n < getMetadata().getBlockSize()) {\n\t\t\t\t\t\tcount = getSource().read(getMetadata().getdBlock(), n, getMetadata()\n\t\t\t\t\t\t\t.getBlockSize() - n);\n\t\t\t\t\t\tif (count == -1) break;\n\t\t\t\t\t\tn += count;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (final IOException e) {\n\t\t\t\t\tlog().trace(\"Truncated block\", e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn n;\n\t\t}"
] | [
"0.5760382",
"0.57004267",
"0.5557499",
"0.540668",
"0.53767693",
"0.5309247",
"0.52956134",
"0.5266628",
"0.52617973",
"0.5245842",
"0.52303916",
"0.5179832",
"0.50937223",
"0.50906855",
"0.5072218",
"0.5068747",
"0.5061825",
"0.5056536",
"0.5053652",
"0.50177544",
"0.50135654",
"0.5009325",
"0.49893817",
"0.49850118",
"0.49472415",
"0.49409065",
"0.4937451",
"0.49233896",
"0.49131736",
"0.49126628",
"0.49121648",
"0.49104238",
"0.49103534",
"0.49100462",
"0.49064088",
"0.48946106",
"0.4892594",
"0.48873076",
"0.4882313",
"0.48728928",
"0.4853669",
"0.48534396",
"0.48317555",
"0.4828655",
"0.48195127",
"0.4815594",
"0.48083925",
"0.48016936",
"0.4796273",
"0.47887442",
"0.4787606",
"0.47831574",
"0.47737882",
"0.47734392",
"0.47664088",
"0.4759927",
"0.47509426",
"0.4749039",
"0.47486392",
"0.474502",
"0.47441334",
"0.47353002",
"0.47337773",
"0.47316056",
"0.4726583",
"0.4720112",
"0.4719628",
"0.4719227",
"0.47110483",
"0.4706977",
"0.46965832",
"0.46932754",
"0.46784568",
"0.46781623",
"0.4668458",
"0.4660859",
"0.46476173",
"0.46460968",
"0.46369952",
"0.46360528",
"0.462578",
"0.46226406",
"0.46191743",
"0.46186507",
"0.46120852",
"0.46052366",
"0.46043408",
"0.46034864",
"0.45931315",
"0.45864752",
"0.4583063",
"0.45806044",
"0.45672736",
"0.45656562",
"0.456424",
"0.45642254",
"0.4560391",
"0.4550554",
"0.45449185",
"0.45368063"
] | 0.52531236 | 9 |
Get the current VCF record without advancing the reader | public VcfRecord peek() {
if (mCurrent == null) {
throw new IllegalStateException("No more records");
}
return mCurrent;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Record getCurrentRecord() {\n return mCurrentRecord;\n }",
"public Record getRecord() {\n return record;\n }",
"public Record getRecord() {\n return record;\n }",
"public OpenERPRecord get() {\r\n\t\tif (records == null)\r\n\t\t\treturn null;\r\n\t\tif (records.size() == 0)\r\n\t\t\treturn null;\r\n\t\treturn records.elementAt(0);\r\n\t}",
"public Integer getCurrentRecord() {\n return this.currentRecord;\n }",
"private void loadCurrentRecord() {\n SharedPreferences recordPreferences = mContext.getSharedPreferences(RECORD_PREFERENCES, Context.MODE_PRIVATE);\n String currentRecordJson = recordPreferences.getString(CURRENT_RECORD_KEY, null);\n if (!TextUtils.isEmpty(currentRecordJson)) {\n mCurrentRecord = mGson.fromJson(currentRecordJson, Record.class);\n }\n }",
"public @NonNull R getFoundRecord() {\n if (!foundItems.isEmpty()) {\n return foundItems.get(recordIndex);\n// assert foundRecord != null;\n// return Objects.requireNonNull(foundRecord);\n }\n R emptyRecord = createNewEmptyRecord();\n foundItems.add(emptyRecord);\n fireModelListChanged(); // Is it dangerous to fire the listener before returning the record?\n return emptyRecord;\n }",
"public Record readRecord(int recordId) {\n return records[recordId];\n }",
"public java.lang.String getRefTrackRecord(){\r\n return this.refTrackRecord;\r\n }",
"public ViewObjectImpl getQueryRecordVOInstance() {\n return (ViewObjectImpl)findViewObject(\"QueryRecordVOInstance\");\n }",
"public int getRecord(){\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.getContext()); return prefs.getInt(\"record\", -1);\n }",
"public String getRecord() {\n\t\tif (null != this.record) {\n\t\t\treturn this.record;\n\t\t}\n\t\tValueExpression _ve = getValueExpression(\"record\");\n\t\tif (_ve != null) {\n\t\t\treturn (String) _ve.getValue(getFacesContext().getELContext());\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"public native Record get(int pos) /*-{\r\n var self = this.@com.smartgwt.client.core.BaseClass::getOrCreateJsObj()();\r\n var recordJS = self.get(pos);\r\n return recordJS == null || recordJS === undefined ? null : @com.smartgwt.client.data.Record::getOrCreateRef(Lcom/google/gwt/core/client/JavaScriptObject;)(recordJS);\r\n }-*/;",
"@Override\n public CarDocument readNextRecord(BufferedReader bRdr) throws IOException {\n return null;\n }",
"public int getReadedRecordNumber();",
"public Record readRecord(Long id);",
"public GAZRecordDataModel getGAZRecord()\n\t{\n\t\tGAZRecordDataModel GAZRecordDataModel = null;\n\t\tList<AbsRecord> results = getRecordBy(getWhereConditionBaseOnIdRecord(), new GAZRecordRowMapper());\n\n\t\tif (!results.isEmpty())\n\t\t{\n\t\t\tGAZRecordDataModel = (GAZRecordDataModel) results.get(0);\n\t\t}\n\n\t\treturn GAZRecordDataModel;\n\t}",
"public void getRecord(LVValue value) throws LRException\n\t{\n\t\tDataHRecordData myData=(DataHRecordData)getData();\n\t\tgetBackground();\n\t\tmyData.record=createRecord(myData.spec,null);\n\t\ttry\n\t\t{\n\t\t\tif (value.isNumeric())\n\t\t\t\tmyData.record.setID(new Long(value.getNumericValue()));\n\t\t\telse\n\t\t\t\tmyData.record.setID(value.getStringValue());\n\t\t\tmyData.record=myData.record.restore(background.getClient());\n\t\t}\n\t\tcatch (LDBException e) { setStatus(e); }\n\t}",
"public Object getRecord(int key) {\n throw new UnsupportedOperationException(\"implement me!\");\n }",
"RecordResult retrieveRecord(String recordID) throws RepoxException;",
"@Override\r\n\tpublic ReviewVO read(int no) {\n\t\treturn sqlSession.selectOne(namespace + \".read\", no);\r\n\t}",
"private void getrec() {\n\t\tcontractDetail.retrieve(stateVariable.getXwordn(), stateVariable.getXwabcd());\n\t\tnmfkpinds.setPgmInd36(! lastIO.isFound());\n\t\tnmfkpinds.setPgmInd66(isLastError());\n\t\t// BR00010 Product not found on Contract_Detail\n\t\tif (nmfkpinds.pgmInd36()) {\n\t\t\tmsgObjIdx = setMsgObj(\"OES0115\", \"XWABCD\", msgObjIdx, messages);\n\t\t\tstateVariable.setZmsage(subString(errmsg, 1, 78));\n\t\t}\n\t\telse {\n\t\t\tif (nmfkpinds.pgmInd66()) {\n\t\t\t\tif (fileds.filests == 1218) {\n\t\t\t\t\tmsgObjIdx = setMsgObj(\"Y3U9999\", \"\", msgObjIdx, messages);\n\t\t\t\t\tstateVariable.setZmsage(subString(errmsg, 1, 78));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmsgObjIdx = setMsgObj(\"OEM0004\", \"\", msgObjIdx, messages);\n\t\t\t\t\tstateVariable.setZmsage(subString(errmsg, 1, 78));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvalidt();\n\t\t\t}\n\t\t}\n\t}",
"public final Object getCurrent()\n\t{\n\t\treturn getCapture();\n\t}",
"public boolean isCurrentRecordIndicator() {\n return currentRecordIndicator;\n }",
"public boolean isCurrentRecordIndicator() {\n return currentRecordIndicator;\n }",
"public Object findRecord(Object key) \n\t{\n\t check(\"find\", key);\n \n\t Object record = htRecords.get(key);\n\t if ( record != null )\n\t {\n\t\t //--- Return a copy of the record\n\t return copy ( record );\n\t }\n\t else\n\t {\n\t return null ;\n\t }\n\t}",
"@Nullable\n public abstract FDBStoredRecord<M> getStoredRecord();",
"Object getCurrentData();",
"boolean getForRead();",
"public Record getRecord(int index) throws IOException{\n\t\t//buff.checkBuffers(index);\n\t\t//buff=new BufferPool();\n\t\t//System.out.println(\"f\");\n\t\tRecord rec = buff.checkBuffers(index);\n\t\t//System.out.println(\"f\");\n\t\tif(rec.getKey()==-1){\n\t\tRecord recs = buff.doLRU(index);\n\t\t\treturn recs;\n\t\t}\n\t\t\n\t\t//buff.checkBuff(index)\n\t\t\n\t\t\n\t\treturn rec;\n\t\t\n\t\t//looks to see if index is in buffer length.\n\t\t//if not. checks which buffer is dirty\n\t\t//if none, still write buffer back to file if all are full\n\t\t//then read in what hasnt been read from index\n\t\t\n\t\t\n\t}",
"@Override\n\tpublic emWaveForm getRecording(int srcPin) throws emException, TException {\n\t\treturn outputSequence.getRecording(srcPin);\n\t}",
"public ContentObject getCurrent(\n )\n {\n if(index < 0 || index >= objects.size())\n return null;\n\n return objects.get(index);\n }",
"@Override\n\tpublic SmCdr2 getCurrentValue() throws IOException, InterruptedException {\n\t\treturn null;\n\t}",
"public HBRecordDataModel getHBRecord()\n\t{\n\t\tHBRecordDataModel HBRecordDataModel = null;\n\t\tList<AbsRecord> results = getRecordBy(getWhereConditionBaseOnIdRecord(), new HBRecordRowMapper());\n\n\t\tif (!results.isEmpty())\n\t\t{\n\n\t\t\tHBRecordDataModel = (HBRecordDataModel) results.get(0);\n\t\t}\n\n\t\treturn HBRecordDataModel;\n\t}",
"public Record openMainRecord()\n {\n if (this.getRecord(BookingLine.BOOKING_LINE_FILE) != null)\n return this.getRecord(BookingLine.BOOKING_LINE_FILE);\n return new BookingLine(this);\n }",
"public RecordData readRecord(String key) {\n\t\tsynchronized (key.intern()) {\n\t\t\tRecordData data = records.get(key);\n\t\t\tif (data == null)\n\t\t\t\trecords.put(key, data = new RecordData(\"\", 0, \"\"));\n\t\t\treturn data;\n\t\t}\n\t}",
"public Object read() throws IOException, RecordIOException;",
"public RecordField getField() {\n return field;\n }",
"public String getRecordFile() {\n return recordFile;\n }",
"public T getCurrent(){\r\n if(curr != null){\r\n return curr.data;\r\n }\r\n return null;\r\n }",
"public MRecord peek() throws Exception;",
"public Object getCustomerContactRecordContactDialogueRecord() {\n return customerContactRecordContactDialogueRecord;\n }",
"public Object getCustomerContactRecord() {\n return customerContactRecord;\n }",
"public Record copy() {\n\t\treturn new Record(video, numOwned, numOut, numRentals);\n\t}",
"public Object getCaseInstanceAnalysisRecord() {\n return caseInstanceAnalysisRecord;\n }",
"private Flight getFlight(int fid) throws SQLException{\n\t\tgetFlightStatement.clearParameters();\n\t\tgetFlightStatement.setInt(1, fid);\n\t\tResultSet result = getFlightStatement.executeQuery();\n\t\tresult.next();\n\t\tFlight out = new Flight(result, 0);\n\t\tresult.close();\n\t\treturn out;\n\t}",
"public Object getFunctionalRiskRetrieveActionTaskRecord() {\n return functionalRiskRetrieveActionTaskRecord;\n }",
"public final Capture getCapture()\n\t{\n\t\tif (_curindex < 0 || _curindex >= _rcc.size())\n\t\t{\n\t\t\tthrow new UnsupportedOperationException(SR.GetString(SR.EnumNotStarted));\n\t\t}\n\n\t\treturn _rcc.getItem(_curindex);\n\t}",
"SingleDocumentModel getCurrentDocument();",
"public Object getChequeExtractionInstanceReportRecord() {\n return chequeExtractionInstanceReportRecord;\n }",
"@GET\n\t\t\t@Path(\"/{id}/record\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getChannelRecord() {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new ChannelDao(uriInfo,header).getChannelRows();\n\t\t\t\t} catch (AuthenticationException e) {\n\t\t\t\t\t rows=new TemplateUtility().getFailedMessage(e.getMessage());\n\t\t\t\t\t e.printStackTrace();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t logger.info( \"Error calling getChannelRecord()\"+ ex.getMessage());\n\t\t\t\t\t ex.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}",
"public Integer getREC_ID() {\n return REC_ID;\n }",
"@Override\n\tpublic ExternalRecord getItemExternalRecord(int itemId) {\n\t\tif (!loaded)\n\t\t\treturn super.getItemExternalRecord(itemId);\n\t\telse\n\t\t\treturn externalItemRecordMap.get(itemId);\n\t}",
"public ViewObjectImpl getIssueRecordVOInstance() {\n return (ViewObjectImpl)findViewObject(\"IssueRecordVOInstance\");\n }",
"public IVirtualBookRef currentVirtualBook() {\n\t\tif (currentElement >= 0 && currentElement < size()) {\n\t\t\treturn get(currentElement);\n\t\t}\n\t\treturn null;\n\t}",
"public int getRecordNumber () {\n return recordNumber;\n }",
"@Override\n\tpublic ReadRecord readItem() throws Exception {\n\t\tif (failimmediate){\n\t\t\tthrow new Exception(\"read fail immediate\");\n\t\t}\n\t\telse {\n\t\t\treturn new ReadRecord();\n\t\t}\n\t}",
"public String getRecordFile();",
"public synchronized final Object readObject() {\n\t\tif (!inQueue.isEmpty())\n\t\t\treturn inQueue.dequeue();\n\t\telse return null;\n\t}",
"public String getRecord(long offset) throws IOException {\n\t\tdataBase.seek(offset);\n\t\treturn dataBase.readLine();\n\t}",
"public Record getRecord(long id) {\n SQLiteDatabase db = this.getReadableDatabase();\n\n Cursor cursor = db.query(Record.TABLE_NAME,\n new String[]{Record.COLUMN_ID,\n Record.COLUMN_TITLE,\n Record.COLUMN_AUTHOR,\n Record.COLUMN_DESCRIPTION,\n Record.COLUMN_URL,\n Record.COLUMN_IMAGE,\n Record.COLUMN_CONTENT,\n Record.COLUMN_TIMESTAMP},\n Record.COLUMN_ID + \"=?\",\n new String[]{String.valueOf(id)}, null, null, null, null);\n\n if (cursor != null)\n cursor.moveToFirst();\n\n // prepare record object\n Record record = new Record(\n cursor.getInt(cursor.getColumnIndex(Record.COLUMN_ID)),\n cursor.getString(cursor.getColumnIndex(Record.COLUMN_TITLE)),\n cursor.getString(cursor.getColumnIndex(Record.COLUMN_AUTHOR)),\n cursor.getString(cursor.getColumnIndex(Record.COLUMN_DESCRIPTION)),\n cursor.getString(cursor.getColumnIndex(Record.COLUMN_URL)),\n cursor.getString(cursor.getColumnIndex(Record.COLUMN_IMAGE)),\n cursor.getString(cursor.getColumnIndex(Record.COLUMN_CONTENT)),\n cursor.getString(cursor.getColumnIndex(Record.COLUMN_TIMESTAMP)));\n\n // close the db connection\n cursor.close();\n\n return record;\n }",
"@Override\r\n\tpublic List<T> getRecords() {\n\t\treturn null;\r\n\t}",
"public FamilyPlanningRecord fetch(){\n\t\ttry{\n\t\t\tif(cursor.isBeforeFirst()){\n\t\t\t\tcursor.moveToFirst();\n\t\t\t}\n\t\t\t\n\t\t\tint index=cursor.getColumnIndex(SERVICE_REC_ID);\n\t\t\tint id=cursor.getInt(index);\n\t\t\tindex=cursor.getColumnIndex(CommunityMembers.COMMUNITY_MEMBER_ID);\n\t\t\tint communityMemberId=cursor.getInt(index);\n\t\t\tindex=cursor.getColumnIndex(FamilyPlanningServices.SERVICE_ID);\n\t\t\tint serviceId=cursor.getInt(index);\n\t\t\tindex=cursor.getColumnIndex(SERVICE_DATE);\n\t\t\tString serviceDate=cursor.getString(index);\n\t\t\tindex=cursor.getColumnIndex(QUANTITY);\n\t\t\tdouble quantity=cursor.getDouble(index);\n\t\t\t\n\t\t\tindex=cursor.getColumnIndex(CommunityMembers.COMMUNITY_MEMBER_NAME);\n\t\t\tString fullname=\"\";\n\t\t\tif(index>0){\n\t\t\t\tfullname=cursor.getString(index);\n\t\t\t}\n\t\t\tString serviceName=\"\";\n\t\t\tindex=cursor.getColumnIndex(FamilyPlanningServices.SERVICE_NAME);\n\t\t\tif(index>0){\n\t\t\t\tserviceName=cursor.getString(index);\n\t\t\t}\n\t\t\tString scheduleDate=\"\";\n\t\t\tindex=cursor.getColumnIndex(SCHEDULE_DATE);\n\t\t\tif(index>0){\n\t\t\t\tscheduleDate=cursor.getString(index);\n\t\t\t}\n\t\t\t\n\t\t\tint serviceType=0;\n\t\t\tindex=cursor.getColumnIndex(SERVICE_TYPE);\n\t\t\tif(index>0){\n\t\t\t\tserviceType=cursor.getInt(index);\n\t\t\t}\n\t\t\t\n\t\t\tFamilyPlanningRecord record=new FamilyPlanningRecord(id,communityMemberId,fullname,serviceId,serviceName,serviceDate,quantity,scheduleDate,serviceType);\n\t\t\tcursor.moveToNext();\n\t\t\treturn record;\n\t\t\t\n\t\t}catch(Exception ex){\n\t\t\treturn null;\n\t\t}\n\t}",
"public String getRequestRecordReference() {\n return requestRecordReference;\n }",
"protected HttpRequestRecord filterRecord(HttpRequestRecord record) {\n return record;\n }",
"public IDfPersistentObject getObject() {\n\t\treturn object;\n\t}",
"public Object getMatchingInstanceReportRecord() {\n return matchingInstanceReportRecord;\n }",
"public void saveCurrentRecord() {\n ThreadUtil.executeOnNewThread(new Runnable() {\n @Override\n public void run() {\n SharedPreferences recordPreferences = mContext.getSharedPreferences(RECORD_PREFERENCES, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = recordPreferences.edit();\n if (mCurrentRecord == null) {\n editor.putString(CURRENT_RECORD_KEY, null);\n } else {\n String recordJson = mGson.toJson(mCurrentRecord);\n editor.putString(CURRENT_RECORD_KEY, recordJson);\n }\n editor.apply();\n\n if (mCurrentRecord != null) {\n saveRecord(mCurrentRecord);\n }\n }\n });\n }",
"public Object get() {\n while(isLocked() ) {\n try {\n Thread.sleep(10);\n }\n catch(InterruptedException ie) {\n // do nothing\n }\n }\n \n Object retVal = getHead();\n LAST_READ_TIME = now();\n return retVal;\n }",
"public org.afscme.enterprise.common.RecordData getRecordData() {\n return recordData;\n }",
"public Object getAssistedRetrieveActionTaskRecord() {\n return assistedRetrieveActionTaskRecord;\n }",
"public Recibo getRecibo() {\r\n\t\treturn recibo;\r\n\t}",
"public Record next() {\n throw new UnsupportedOperationException(\"hw3: TODO\");\n }",
"public int getRecordNum() {\n return RecordNum;\n }",
"public com.sforce.soap.enterprise.sobject.UserRecordAccess getUserRecordAccess() {\r\n return userRecordAccess;\r\n }",
"public RecordDefinition getRecDef () {\n return recDef;\n }",
"public Object getCustomerContactActivityRecord() {\n return customerContactActivityRecord;\n }",
"@Override\r\n\tpublic Invigilate getOne(Integer no) {\n\t\treturn invigilateMapper.selectByPrimaryKey(no);\r\n\t}",
"public synchronized boolean isRecording()\n {\n synchronized(recordingLock)\n {\n return recording;\n }\n\n }",
"public Cursor getRecord(int id) {\n Cursor res = db.rawQuery( \"select * from TRACKRECORD where TRACKID=\"+id+\"\", null );\n return res;\n }",
"protected Track _obtainCurrentLocation() {\n\t\tCursor cursor = activity.getContentResolver().query(TrackDAO.QUERY_MOST_RECENT_URI, null,null,null,null);\n\t\tTrack objTrack = TrackDAO.createObject(cursor);\n\n\t\treturn objTrack;\n\t}",
"public FSReturnVals ReadPrevRecord(FileHandle ofh, RID pivot, TinyRec rec)\n {\n FSReturnVals outcome = FSReturnVals.Fail;\n // should set ip address, port number\n Vector<IP> servers = ofh.getServersForChunk(pivot.getChunkHandle());\n int numServers = servers.size();\n if (ofh == null)\n {\n return FSReturnVals.BadHandle;\n }\n if (rec == null)\n {\n return FSReturnVals.RecDoesNotExist;\n }\n for(int i = 0; i < numServers; i++)\n {\n IP ip = new IP();\n ip.setPort(servers.elementAt(i).getPort());\n ip.setAddress(servers.elementAt(i).getAddress());\n try\n {\n Socket sock = new Socket(ip.getAddress(), ip.getPort());\n ObjectOutputStream serverOutput = new ObjectOutputStream(sock.getOutputStream());\n serverOutput.flush();\n ObjectInputStream serverInput = new ObjectInputStream(sock.getInputStream());\n serverOutput.writeInt(Constants.IsClient);\n \n serverOutput.writeInt(Constants.READ_PREV_RECORD);\n serverOutput.writeInt(pivot.getChunkHandle().length());\n serverOutput.writeBytes(pivot.getChunkHandle());\n serverOutput.flush();\n serverOutput.writeInt(pivot.index);\n \n int response = serverInput.readInt();\n if (response == Constants.FALSE)\n {\n i--;\n continue;\n }\n else if (response == Constants.NOT_IN_CHUNK)\n {\n i--;\n continue;\n }\n \n //int type = serverOutput.readInt();\n //int command = serverOutput.readInt();\n //if(type == Constants.IsServer && command = Constants.READ_NEXT_RECORD)\n //{\n int sz = serverInput.readInt();\n byte[] data = new byte[sz];\n serverInput.read(data, 0, sz);\n String datastr = new String(data, \"UTF-8\");\n if(data.length > 0)\n {\n int j = serverInput.readInt();\n outcome = intToFSReturnVal(j);\n rec.setPayload(data);\n break;\n }\n else\n {\n i--;\n continue;\n }\n //}\n //else\n //{\n // int j = serverInput.readInt();\n // outcome = intToFSReturnVal(j)\n //}\n \n }\n catch (Exception e)\n {\n outcome = FSReturnVals.Fail;\n System.out.println(\"Unable to append records (ClientREC:65)\");\n }\n }\n \n return outcome;\n }",
"public Object getCreditInstanceAnalysisRecord() {\n return creditInstanceAnalysisRecord;\n }",
"@Override\r\n\tpublic Record getNextSnapShotRecord() {\n\t\tif (iterSnapshot == null)\r\n\t\t\treturn null;\r\n\t\t\r\n\t\tif (iterSnapshot.hasNext())\r\n\t\t\treturn iterSnapshot.next();\r\n\t\telse\r\n\t\t\treturn null;\r\n\t}",
"public List<Record> _queryWholePatrolCard_Records(Long fid) {\n synchronized (this) {\n if (wholePatrolCard_RecordsQuery == null) {\n QueryBuilder<Record> queryBuilder = queryBuilder();\n queryBuilder.where(Properties.Fid.eq(null));\n wholePatrolCard_RecordsQuery = queryBuilder.build();\n }\n }\n Query<Record> query = wholePatrolCard_RecordsQuery.forCurrentThread();\n query.setParameter(0, fid);\n return query.list();\n }",
"@Override\n\tpublic StockDataRecord get(int id) throws SQLException,\n\t\t\tBusinessObjectException {\n\t\treturn null;\n\t}",
"public FastqRecord readRecord() throws IOException, RecordFormatException\n\t{\n\t\t// Read the defline from the BufferedReader. Return null if you read null, \n\t\t// indicating end of file.\n\n\t\t\n\t\t// Read the next 3 lines from the buffered reader. Construct and return\n\t\t// a FastqRecord.\n\n\t}",
"public WaveformViewer getActiveWaveformViewerPart() {\n\t\treturn waveformViewerPart;\n\t}",
"public OpenERPRecord get(int id) {\r\n\t\tIterator<OpenERPRecord> i = records.iterator();\r\n\t\twhile (i.hasNext()) {\r\n\t\t\tOpenERPRecord n = i.next();\r\n\t\t\tInteger rID = (Integer) n.get(\"id\"); // no class cast exception\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// expected here...\r\n\t\t\tif (rID == id)\r\n\t\t\t\treturn n;\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"@Nullable\r\n\t@Override\r\n\tpublic RegistryRecord read(@NotNull Stub<RegistryRecord> stub) {\r\n\t\treturn registryRecordDao.readFull(stub.getId());\r\n\t}",
"public ReleaseRecord getRelease() { return (ReleaseRecord)Database.getReleaseIndex().getRecord(releaseId); }",
"public Object get(Vector primaryKey) {\n CacheKey cacheKey = getCacheKeyWithReadLock(primaryKey);\n\n if (cacheKey == null) {\n return null;\n }\n return cacheKey.getObject();\n }",
"@Override\r\n\tpublic NoticeVO read(int no) {\n\t\treturn sqlSession.selectOne(namespace + \".read\", no);\r\n\t}",
"@Override\n public byte[] recDirect() {\n return null;\n }",
"@Override\n\t\tpublic Object getItem(int arg0) {\n\t\t\treturn mRecords.get(arg0);\n\t\t}",
"public boolean isRecordable()\n\t{\n\t\treturn mRecordable;\n\t}",
"public ChatRecord.Req getChatRecordReq() {\n return instance.getChatRecordReq();\n }",
"protected ORecordInternal<?> popRecord(final ORID iRID) {\n\t\tif (maxSize == 0)\n\t\t\t// PRECONDITIONS\n\t\t\treturn null;\n\n\t\tacquireExclusiveLock();\n\t\ttry {\n\t\t\treturn entries.remove(iRID);\n\t\t} finally {\n\t\t\treleaseExclusiveLock();\n\t\t}\n\t}",
"@Override\n\tpublic ExternalRecord getUserExternalRecord(int userId) {\n\t\tif (!loaded)\n\t\t\treturn super.getUserExternalRecord(userId);\n\t\telse\n\t\t\treturn externalUserRecordMap.get(userId);\n\t}",
"public Object getProspectusRetrieveActionTaskRecord() {\n return prospectusRetrieveActionTaskRecord;\n }"
] | [
"0.65840155",
"0.649792",
"0.649792",
"0.6273903",
"0.62477547",
"0.61382437",
"0.5977646",
"0.5886262",
"0.58466864",
"0.5801088",
"0.58007663",
"0.577507",
"0.5742466",
"0.57245594",
"0.57059556",
"0.5700782",
"0.56454134",
"0.5639737",
"0.5580032",
"0.555681",
"0.55535275",
"0.5528246",
"0.55068624",
"0.55022264",
"0.55022264",
"0.5474957",
"0.54588276",
"0.5453471",
"0.54392225",
"0.5432949",
"0.54232985",
"0.54133683",
"0.54118484",
"0.54065716",
"0.538144",
"0.53784645",
"0.53757244",
"0.53699833",
"0.5365318",
"0.5364703",
"0.53600353",
"0.5336465",
"0.5328067",
"0.5326066",
"0.5323212",
"0.5320026",
"0.5316001",
"0.53124404",
"0.530765",
"0.53076464",
"0.5302437",
"0.52950215",
"0.5293707",
"0.52882516",
"0.527891",
"0.52741194",
"0.52668464",
"0.5266332",
"0.5262048",
"0.52444625",
"0.5239196",
"0.5236385",
"0.52355975",
"0.52303815",
"0.52216053",
"0.52191186",
"0.52173567",
"0.52172583",
"0.5212063",
"0.5208913",
"0.51874924",
"0.51828635",
"0.5177581",
"0.517533",
"0.5159403",
"0.5146717",
"0.5144103",
"0.51435727",
"0.5135764",
"0.51342046",
"0.5132016",
"0.5125599",
"0.51229227",
"0.511684",
"0.51164025",
"0.51143247",
"0.51141524",
"0.51136786",
"0.51131654",
"0.5110499",
"0.51086193",
"0.5097419",
"0.5091992",
"0.50849205",
"0.508152",
"0.5078981",
"0.5074941",
"0.5072585",
"0.5071328",
"0.50629693"
] | 0.68036395 | 0 |
Read the next record, if any. | private boolean setNext() throws IOException {
final String line = mIn.readLine();
if (line == null) {
mCurrent = null;
return false;
}
try {
mCurrent = mParser.parseLine(line);
if (mCurrent.getNumberOfSamples() != mNumSamples) {
throw new VcfFormatException("Expected " + mNumSamples + " samples, but there were " + mCurrent.getNumberOfSamples());
}
} catch (final VcfFormatException e) {
throw new VcfFormatException("Invalid VCF record. " + e.getMessage() + " on line:" + line); // Add context information
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void readNext() {\n nextLine = null;\n try {\n while (nextLine == null) {\n nextLine = reader.readNext();\n reader.consumeEmptyLines();\n if (reader.eof()) {\n break;\n }\n }\n if (nextLine != null) {\n super.recordCounter++;\n if (super.readLimit > 0 && super.recordCounter > super.readLimit) {\n nextLine = null;\n }\n }\n } catch (Exception ignore) {\n // no more lines\n }\n }",
"private String[] readNextRecord() throws IOException {\n final String nextLine = getNextLine();\n return parseLine(nextLine, true);\n }",
"public void getNextRecord() throws LRException\n\t{\n\t\tDataHRecordData myData=(DataHRecordData)getData();\n\t\tgetBackground();\n\t\ttry\n\t\t{\n\t\t\tmyData.record.getNextRecord(background.getClient());\n\t\t}\n\t\tcatch (LDBException e) { setStatus(e); }\n\t}",
"public ArrowRecordBatch readNext() throws IOException {\n ArrowRecordBatchBuilder recordBatchBuilder =\n jniWrapper.nativeReadNext(nativeInstanceId);\n if (recordBatchBuilder == null) {\n return null;\n }\n ArrowRecordBatchBuilderImpl recordBatchBuilderImpl =\n new ArrowRecordBatchBuilderImpl(recordBatchBuilder);\n ArrowRecordBatch batch = recordBatchBuilderImpl.build();\n if (batch == null) {\n throw new IllegalArgumentException(\"failed to build record batch\");\n }\n this.lastReadLength = batch.getLength();\n return batch;\n }",
"@Override\n public CarDocument readNextRecord(BufferedReader bRdr) throws IOException {\n return null;\n }",
"public Record next() {\n if (hasNext()) {\n if (nextRecord != null) {\n Record out = nextRecord;\n nextRecord = null;\n return out;\n }\n }\n throw new NoSuchElementException();\n //throw new UnsupportedOperationException(\"hw3: TODO\");\n }",
"public FastqRecord readRecord() throws IOException, RecordFormatException\n\t{\n\t\t// Read the defline from the BufferedReader. Return null if you read null, \n\t\t// indicating end of file.\n\n\t\t\n\t\t// Read the next 3 lines from the buffered reader. Construct and return\n\t\t// a FastqRecord.\n\n\t}",
"public boolean onNextRecord(IDataTableRecord record) throws Exception;",
"public WALRecord next() throws IgniteCheckedException {\n try {\n for (;;) {\n if (!iterator.hasNextX())\n return null;\n\n IgniteBiTuple<WALPointer, WALRecord> tup = iterator.nextX();\n\n if (tup == null)\n return null;\n\n WALRecord rec = tup.get2();\n\n WALPointer ptr = tup.get1();\n\n rec.position(ptr);\n\n // Filter out records by group id.\n if (rec instanceof WalRecordCacheGroupAware) {\n WalRecordCacheGroupAware grpAwareRecord = (WalRecordCacheGroupAware) rec;\n\n if (!cacheGroupPredicate.apply(grpAwareRecord.groupId()))\n continue;\n }\n\n // Filter out data entries by group id.\n if (rec instanceof DataRecord)\n rec = filterEntriesByGroupId((DataRecord) rec);\n\n return rec;\n }\n }\n catch (IgniteCheckedException e) {\n boolean throwsCRCError = throwsCRCError();\n\n if (X.hasCause(e, IgniteDataIntegrityViolationException.class)) {\n if (throwsCRCError)\n throw e;\n else\n return null;\n }\n\n log.error(\"There is an error during restore state [throwsCRCError=\" + throwsCRCError + ']', e);\n\n throw e;\n }\n }",
"public Record next() {\n throw new UnsupportedOperationException(\"hw3: TODO\");\n }",
"public NV readNext() throws ThingsException;",
"private LogRecordWithInputStream nextLogRecord() throws IOException {\n try {\n return nextLogRecord(reader);\n } catch (EndOfStreamException e) {\n eos = true;\n return null;\n }\n }",
"@Override\r\n\tpublic CEntity readNext(CEntity entity) {\n\t\tentity.read(scanner);\r\n\t\treturn entity;\r\n\t}",
"public FSReturnVals ReadNextRecord(FileHandle ofh, RID pivot, TinyRec rec)\n {\n FSReturnVals outcome = FSReturnVals.Fail;\n // should set ip address, port number\n Vector<IP> servers = ofh.getServersForChunk(pivot.getChunkHandle());\n int numServers = servers.size();\n if (ofh == null)\n {\n return FSReturnVals.BadHandle;\n }\n if (rec == null)\n {\n return FSReturnVals.RecDoesNotExist;\n }\n for(int i = 0; i < numServers; i++)\n {\n IP ip = new IP();\n ip.setPort(servers.elementAt(i).getPort());\n ip.setAddress(servers.elementAt(i).getAddress());\n try\n {\n Socket sock = new Socket(ip.getAddress(), ip.getPort());\n ObjectOutputStream serverOutput = new ObjectOutputStream(sock.getOutputStream());\n serverOutput.flush();\n ObjectInputStream serverInput = new ObjectInputStream(sock.getInputStream());\n serverOutput.writeInt(Constants.IsClient);\n \n serverOutput.writeInt(Constants.READ_NEXT_RECORD);\n serverOutput.writeInt(pivot.getChunkHandle().length());\n serverOutput.writeBytes(pivot.getChunkHandle());\n serverOutput.flush();\n serverOutput.writeInt(pivot.index);\n \n int response = serverInput.readInt();\n if (response == Constants.FALSE)\n {\n i--;\n continue;\n }\n else if (response == Constants.NOT_IN_CHUNK)\n {\n i--;\n continue;\n }\n \n //int type = serverOutput.readInt();\n //int command = serverOutput.readInt();\n //if(type == Constants.IsServer && command = Constants.READ_NEXT_RECORD)\n //{\n int sz = serverInput.readInt();\n byte[] data = new byte[sz];\n serverInput.read(data, 0, sz);\n String datastr = new String(data, \"UTF-8\");\n if(data.length > 0)\n {\n int j = serverInput.readInt();\n outcome = intToFSReturnVal(j);\n rec.setPayload(data);\n break;\n }\n else\n {\n i--;\n continue;\n }\n //}\n //else\n //{\n // int j = serverInput.readInt();\n // outcome = intToFSReturnVal(j)\n //}\n \n }\n catch (Exception e)\n {\n outcome = FSReturnVals.Fail;\n System.out.println(\"Unable to append records (ClientREC:65)\");\n }\n }\n \n return outcome;\n }",
"@ActionTrigger(action=\"KEY-NXTREC\", function=KeyFunction.NEXT_RECORD)\n\t\tpublic void spriden_NextRecord()\n\t\t{\n\t\t\t\n\t\t\t\tif ( !isInLastRecord(true) )\n\t\t\t\t{\n\t\t\t\t\tnextRecord();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tinfoMessage(GNls.Fget(toStr(\"SOAIDNS-0001\"), toStr(\"FORM\"), toStr(\"At last record.\")));\n\t\t\t\t}\n\t\t\t}",
"public IndexRecord getIteratorNext() {\n iter = (iter == next - 1 ? -1: iter + 1);\n return (iter == -1 ? null : data[iter]);\n }",
"@Override\r\n\tpublic Record getNextSnapShotRecord() {\n\t\tif (iterSnapshot == null)\r\n\t\t\treturn null;\r\n\t\t\r\n\t\tif (iterSnapshot.hasNext())\r\n\t\t\treturn iterSnapshot.next();\r\n\t\telse\r\n\t\t\treturn null;\r\n\t}",
"public byte[] nextRecord() {\n return (byte[]) resultsEnumeration.nextElement();\n }",
"public VcfRecord peek() {\n if (mCurrent == null) {\n throw new IllegalStateException(\"No more records\");\n }\n return mCurrent;\n }",
"default CompletableFuture<List<OUT>> fetchNextRecords() throws IOException {\n return fetchNextRecord().thenApply((r) -> Collections.singletonList(r));\n }",
"@Override\n\tpublic ReadRecord readItem() throws Exception {\n\t\tif (failimmediate){\n\t\t\tthrow new Exception(\"read fail immediate\");\n\t\t}\n\t\telse {\n\t\t\treturn new ReadRecord();\n\t\t}\n\t}",
"public MoviePlotRecord next() {\n\t\t\t\t\tString title = null;\n\t\t\t\t\tStringBuilder plots = new StringBuilder();\n\t\t\t\t\tStringBuilder authors = new StringBuilder();\n\t\t\t\t\t\n\t\t\t\t\tfor (String line : record) {\n\t\t\t\t\t\tif (line.startsWith(\"MV: \")) {\n\t\t\t\t\t\t\tif (title != null) {\n\t\t\t\t\t\t\t\tthrow new RuntimeException(\"IMDB parse error: two plot titles\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttitle = line.substring(4);\n\t\t\t\t\t\t} else if (line.startsWith(\"PL: \")) {\n\t\t\t\t\t\t\tplots.append(line.substring(4)).append(\" \");\n\t\t\t\t\t\t} else if (line.startsWith(\"BY: \")) {\n\t\t\t\t\t\t\tauthors.append(line.substring(4)).append(\" \");\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// read next record\n\t\t\t\t\trecord = nextRecord();\n\t\t\t\t\t\n\t\t\t\t\treturn new MoviePlotRecord(title, plots.toString(), authors.toString());\n\t\t\t\t}",
"private List<String> nextRecord() {\n\t\t\t\t\tList<String> record = new LinkedList<String>();\n\t\t\t\t\twhile (lines.hasNext()) {\n\t\t\t\t\t\tString line = lines.next();\n\t\t\t\t\t\tif (line.startsWith(\"---\")) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\trecord.add(line);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\treturn record;\n\t\t\t\t}",
"public FastqRecord readRecord() throws IOException, RecordFormatException\n\t{\n\t\t// Read the defline from the BufferedReader. Return null if you read null, \n\t\t// indicating end of file.\n\t\tString defline = theBufferedReader.readLine();\n\t\tif(defline != null)\n\t\t{\n\t\t\t// Read the next 3 lines from the buffered reader. Construct and return\n\t\t\t// a FastqRecord.\n\t\t\tString sequence = theBufferedReader.readLine();\n\t\t\tString line = theBufferedReader.readLine();\n\t\t\tString quality = theBufferedReader.readLine();\n\t\t\tFastqRecord fastqRecord = new FastqRecord(defline, sequence, quality);\n\t\t\treturn fastqRecord;\n\t\t}\n\t\treturn null;\n\t}",
"public RecordData readRecord(String key) {\n\t\tsynchronized (key.intern()) {\n\t\t\tRecordData data = records.get(key);\n\t\t\tif (data == null)\n\t\t\t\trecords.put(key, data = new RecordData(\"\", 0, \"\"));\n\t\t\treturn data;\n\t\t}\n\t}",
"public String readNextLine() throws IOException {\n if (this.reader == null) {\n return null;\n }\n\n boolean openNext = false;\n String line;\n while ((line = this.reader.readLine()) == null) {\n // The current file is read at the end, ready to read next one\n this.close(this.index);\n\n if (++this.index < this.readables.size()) {\n // Open the second or subsequent readables, need\n this.reader = this.open(this.index);\n openNext = true;\n } else {\n return null;\n }\n }\n // Determine if need to skip duplicate header\n if (openNext && isDuplicateHeader(line)) {\n line = this.readNextLine();\n }\n return line;\n }",
"@Override\r\n public Boolean moreRecords()\r\n {\r\n Boolean blnRet = false;\r\n try\r\n {\r\n blnRet = dbRecordset.next();\r\n }\r\n catch (Exception e)\r\n {\r\n blnRet = false;\r\n }\r\n return blnRet; // only one RETURN in each function!\r\n }",
"protected Tuple readNext()\n throws TransactionAbortedException, DbException {\n if(readNextCalled)\n return null;\n readNextCalled = true;\n\n BufferPool bp = Database.getBufferPool();\n int insertCount = 0;\n while(child.hasNext()) {\n bp.insertTuple(tid, tableid, child.next());\n insertCount++;\n }\n\n Tuple retTuple = new Tuple(td);\n retTuple.setField(0, new IntField(insertCount));\n return retTuple;\n }",
"public Record readRecord(int recordId) {\n return records[recordId];\n }",
"private String readNextLine() {\n StringBuilder sb = new StringBuilder();\n\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(stream));\n sb.append(br.readLine());\n } catch (IOException e) {\n e.fillInStackTrace();\n }\n\n return sb.toString();\n }",
"@Override public WALRecord next() throws IgniteCheckedException {\n WALRecord rec = super.next();\n\n if (rec == null)\n return null;\n\n if (rec.type() == CHECKPOINT_RECORD) {\n CheckpointRecord cpRec = (CheckpointRecord)rec;\n\n // We roll memory up until we find a checkpoint start record registered in the status.\n if (F.eq(cpRec.checkpointId(), status.cpStartId)) {\n log.info(\"Found last checkpoint marker [cpId=\" + cpRec.checkpointId() +\n \", pos=\" + rec.position() + ']');\n\n needApplyBinaryUpdates = false;\n }\n else if (!F.eq(cpRec.checkpointId(), status.cpEndId))\n U.warn(log, \"Found unexpected checkpoint marker, skipping [cpId=\" + cpRec.checkpointId() +\n \", expCpId=\" + status.cpStartId + \", pos=\" + rec.position() + ']');\n }\n\n return rec;\n }",
"private void advanceToNextReader(){\r\n\t\tcurrentReader = null;\r\n\t\treaderQueueIndex++;\r\n\t}",
"public String[] readNext() {\n\t\treturn null;\n\t}",
"public TableGenRow nextRow() {\n try {\n if(DBMacros.next(rs)) {\n return this;\n }\n } catch (Exception t) {\n dbg.ERROR(\"nextRow() Exception skipping to the next record!\");\n dbg.Caught(t);\n }\n return null;\n }",
"public synchronized Pair<K, V> next() throws IOException {\n\t\t\treturn data.next();\n\t\t}",
"private SAMRecord nextIfRecordIsUnmappedAtEOF(final SAMRecord record) {\n // when we find unmapped reads with -1 as their reference index, there should be no mapped reads later in the file.\n if (foundUnmappedEOFReads) { // previously found unmapped reads at the end of the file\n final SAMRecord unmappedRecord = backingIterator.next(); // since we called backingIterator.peek()\n\n if (!record.isSecondaryOrSupplementary()) {\n // update metrics\n final DuplicationMetrics metrics = getMetrics(record);\n ++metrics.UNMAPPED_READS;\n }\n\n // We should have no more in the queue\n if (!outputBuffer.isEmpty()) {\n throw new PicardException(\"Encountered unmapped reads at the end of the file, but the alignment start buffer was not empty.\");\n }\n return unmappedRecord; // unmapped end of file records can simply be emitted - no need to duplicate mark them\n } else {\n foundUnmappedEOFReads = true;\n // move past all mapped reads\n referenceIndex = header.getSequenceDictionary().getSequences().size();\n\n // do the final round of duplicate marking\n tryPollingTheToMarkQueue(true, null);\n\n // NB: we do not call next here since we will recurse and perhaps hit the flush, or re-enter the if with unmapped EOF reads\n return markDuplicatesAndGetTheNextAvailable(); // this should flush the buffer\n }\n }",
"public synchronized boolean next() throws IOException {\n\t\treturn next(true);\n\t}",
"public Data nextData()\r\n\t\t{\r\n\t\t\treturn this.nextData;\r\n\t\t}",
"public void _next() {\n Object o;\n try {\n o = iter.next();\n } catch (NoSuchElementException e) {\n has_next = 0;\n return;\n }\n // resolve object\n if (o == null) {\n has_next = 1;\n next = null;\n } else if (o instanceof IdentityIF) {\n try {\n o = txn.getObject((IdentityIF)o, true);\n if (o == null) {\n _next();\n } else {\n has_next = 1;\n next = (F) o;\n }\n } catch (Throwable t) {\n has_next = -1;\n next = null;\n }\n } else {\n has_next = 1;\n next = (F) o;\n }\n }",
"protected void readAhead() {\n if (! reader.hasNext()) {\n this.nextLine = null;\n } else {\n this.nextLine = reader.next();\n while (this.nextLine != null && this.nextLine.isEmpty() && reader.hasNext())\n this.nextLine = reader.next();\n }\n }",
"public MRecord peek() throws Exception;",
"public String next() {\n try {\n String result = fNextLine;\n if (fNextLine != null) {\n fNextLine = fIn.readLine();\n if (fNextLine == null) {\n fIn.close();\n }\n }\n\n return result;\n } catch (IOException e) {\n throw new IllegalArgumentException(e);\n }\n }",
"public Record getRecord(int index) throws IOException{\n\t\t//buff.checkBuffers(index);\n\t\t//buff=new BufferPool();\n\t\t//System.out.println(\"f\");\n\t\tRecord rec = buff.checkBuffers(index);\n\t\t//System.out.println(\"f\");\n\t\tif(rec.getKey()==-1){\n\t\tRecord recs = buff.doLRU(index);\n\t\t\treturn recs;\n\t\t}\n\t\t\n\t\t//buff.checkBuff(index)\n\t\t\n\t\t\n\t\treturn rec;\n\t\t\n\t\t//looks to see if index is in buffer length.\n\t\t//if not. checks which buffer is dirty\n\t\t//if none, still write buffer back to file if all are full\n\t\t//then read in what hasnt been read from index\n\t\t\n\t\t\n\t}",
"UnalignedRecords read(long position, int size) throws IOException;",
"public void setNextRecord()\n {\n currRecord++;\n if (monitor != null)\n monitor.setPercentComplete(currRecord / maxRecords * 100);\n }",
"public Object read() throws IOException, RecordIOException;",
"public DataRecord nextRecordIn () \n throws IOException, FileNotFoundException {\n HTMLTag tag;\n StringBuffer text = new StringBuffer(\"\");\n String href = \"\";\n dataRec = new DataRecord();\n do {\n tag = readTag();\n if (tag == null) {\n // don't do anything\n } // end if tag is null\n else { // tag not null\n text.append (tag.getPrecedingText());\n if (tag.getName().equals(\"a\")) {\n if (tag.isEnding()) {\n // capture anchor when we fall out of the do loop\n } // end if ending tag\n else {\n href = tag.getAttribute(\"href\").getValue();\n text.setLength(0);\n } // end beginning a tag \n } // end a tag\n else // not an a (anchor) tag\n if ((! headingsAsCategories)\n && tag.isListItemEnd()\n && text.length() > 0) {\n int catIndex = tag.getListLevel() + headingLevelsUsed;\n if ((tag.getListLevel() > 0) \n && ((catIndex) <= MAX_CATEGORY_LEVEL)) {\n category [catIndex] = text.toString();\n for (int i = catIndex + 1; i <= MAX_CATEGORY_LEVEL; i++) {\n category [i] = \"\";\n }\n }\n }\n else // not an a (anchor) tag and not a list category\n if ((headingsAsCategories || headingsAndLists)\n && tag.isHeadingTag()\n && tag.isEnding()\n && text.length() > 0) {\n if (tag.getHeadingLevel() > 0) {\n int h = tag.getHeadingLevel();\n int l = 0;\n if (headings [h] > 0) {\n l = headings [h];\n } else {\n headingLevelsUsed++;\n headings [h] = headingLevelsUsed;\n l = headingLevelsUsed;\n }\n if (l <= MAX_CATEGORY_LEVEL) {\n category [l] = text.toString();\n }\n }\n }\n if ((! headingsAsCategories)\n && tag.isListItemStart()) {\n text.setLength(0);\n }\n else\n if ((headingsAsCategories || headingsAndLists)\n && tag.isHeadingTag()\n && (! tag.isEnding())) {\n text.setLength(0);\n }\n } // end tag not null\n } while (tag != null\n && (!(tag.isEnding() \n && tag.getName().equals(\"a\")\n && href != null)));\n if (tag == null || href == null) {\n return null;\n }\n else {\n // populate the data record\n int dtLevelsUsed = 0;\n if (tag.isDefTermActive()) {\n dtLevelsUsed = 1;\n } \n int listLevelsUsed = tag.getListLevel();\n if (listLevelsUsed < 0) {\n listLevelsUsed = 0;\n }\n else\n if (listLevelsUsed > 0) {\n listLevelsUsed--;\n }\n for (int i = 1; i <= MAX_CATEGORY_LEVEL; i++) {\n if ((! headingsAsCategories)\n && i <= (listLevelsUsed + headingLevelsUsed + dtLevelsUsed)) {\n storeField (CATEGORY_FIELD_NAME [i], category[i]);\n }\n else\n if (headingsAsCategories\n && i < tag.getHeadingLevel()) {\n storeField (CATEGORY_FIELD_NAME [i], category[i]);\n }\n else {\n storeField (CATEGORY_FIELD_NAME [i], \"\");\n }\n }\n storeField (ANCHOR, text.toString());\n text.setLength(0);\n if (href.startsWith (\"mailto:\")) {\n storeField (EMAIL, href.substring(7));\n storeField (URL, \"\");\n }\n else {\n storeField (EMAIL, \"\");\n storeField (URL, href);\n }\n recordNumber++;\n return dataRec;\n }\n }",
"public boolean next() throws IOException;",
"public interface RecordReader {\r\n\r\n /**\r\n * Reads a single record from this input stream. The type of object\r\n * returned depends on the format of the stream.\r\n * @return the record value, or null if the end of the stream was reached.\r\n * @throws IOException if an I/O error occurs reading from the stream\r\n * @throws RecordIOException if the record is malformed and cannot\r\n * \t be parsed, but subsequent reads may still be possible\r\n */\r\n public Object read() throws IOException, RecordIOException;\r\n\r\n /**\r\n * Closes this input stream.\r\n * @throws IOException if an I/O error occurs closing the stream\r\n */\r\n public void close() throws IOException;\r\n\r\n /**\r\n * Returns the line number of the last record from this input stream. If a\r\n * record spans multiple lines, the line number at the beginning of the\r\n * record is returned. May return -1 if the end of the stream was reached,\r\n * or 0 if new lines are not used to terminate records.\r\n * @return the beginning line number of the last record read\r\n */\r\n public int getRecordLineNumber();\r\n\r\n /**\r\n * Returns the unparsed record text of the last record read.\r\n * @return the unparsed text of the last record read\r\n */\r\n public String getRecordText();\r\n\r\n}",
"public SAMRecord next() {\n SAMRecord rec = wrappedIterator.next();\n\n // Always consolidate the cigar string into canonical form, collapsing zero-length / repeated cigar elements.\n // Downstream code (like LocusIteratorByState) cannot necessarily handle non-consolidated cigar strings.\n rec.setCigar(AlignmentUtils.consolidateCigar(rec.getCigar()));\n\n // if we are using default quals, check if we need them, and add if necessary.\n // 1. we need if reads are lacking or have incomplete quality scores\n // 2. we add if defaultBaseQualities has a positive value\n if (defaultBaseQualities >= 0) {\n byte reads [] = rec.getReadBases();\n byte quals [] = rec.getBaseQualities();\n if (quals == null || quals.length < reads.length) {\n byte new_quals [] = new byte [reads.length];\n for (int i=0; i<reads.length; i++)\n new_quals[i] = defaultBaseQualities;\n rec.setBaseQualities(new_quals);\n }\n }\n\n // if we are using original quals, set them now if they are present in the record\n if ( useOriginalBaseQualities ) {\n byte[] originalQuals = rec.getOriginalBaseQualities();\n if ( originalQuals != null )\n rec.setBaseQualities(originalQuals);\n }\n\n return rec;\n }",
"@Override\n\tpublic String getNext() throws IOException {\n\t\ttry {\n\t\t\t// Ignore space, tab, newLine, commentary\n\t\t\tint nextVal = reader.read();\n\t\t\tnextVal = this.ignore(nextVal);\n\n\t\t\treturn (!isEndOfFile(nextVal)) ? this.getInstruction(nextVal) : null;\n\t\t} catch (java.io.IOException e) {\n\t\t\tthrow new IOException();\n\t\t}\n\n\t}",
"private String getNextLine() throws IOException {\n final BufferedReader in = this.in;\n if (in == null) {\n throw new NoSuchElementException();\n } else {\n final String nextLine = this.in.readLine();\n if (nextLine == null) {\n throw new NoSuchElementException();\n }\n return nextLine;\n }\n }",
"public void readRecords()\r\n {\r\n RandomAccessAccountRecord record = new RandomAccessAccountRecord();\r\n\r\n System.out.printf( \"%-10s%-15s%-15s%10s\\n\", \"Account\",\r\n \"First Name\", \"Last Name\", \"Balance\" );\r\n\r\n try // read a record and display\r\n {\r\n while ( true )\r\n {\r\n do\r\n {\r\n record.read( input );\r\n } while ( record.getAccount() == 0 );\r\n\r\n // display record contents\r\n System.out.printf( \"%-10d%-12s%-12s%10.2f\\n\",\r\n record.getAccount(), record.getFirstName(),\r\n record.getLastName(), record.getBalance() );\r\n } // end while\r\n } // end try\r\n catch ( EOFException eofException ) // close file\r\n {\r\n return; // end of file was reached\r\n } // end catch\r\n catch ( IOException ioException )\r\n {\r\n System.err.println( \"Error reading file.\" );\r\n System.exit( 1 );\r\n } // end catch\r\n }",
"public FSReturnVals ReadPrevRecord(FileHandle ofh, RID pivot, TinyRec rec)\n {\n FSReturnVals outcome = FSReturnVals.Fail;\n // should set ip address, port number\n Vector<IP> servers = ofh.getServersForChunk(pivot.getChunkHandle());\n int numServers = servers.size();\n if (ofh == null)\n {\n return FSReturnVals.BadHandle;\n }\n if (rec == null)\n {\n return FSReturnVals.RecDoesNotExist;\n }\n for(int i = 0; i < numServers; i++)\n {\n IP ip = new IP();\n ip.setPort(servers.elementAt(i).getPort());\n ip.setAddress(servers.elementAt(i).getAddress());\n try\n {\n Socket sock = new Socket(ip.getAddress(), ip.getPort());\n ObjectOutputStream serverOutput = new ObjectOutputStream(sock.getOutputStream());\n serverOutput.flush();\n ObjectInputStream serverInput = new ObjectInputStream(sock.getInputStream());\n serverOutput.writeInt(Constants.IsClient);\n \n serverOutput.writeInt(Constants.READ_PREV_RECORD);\n serverOutput.writeInt(pivot.getChunkHandle().length());\n serverOutput.writeBytes(pivot.getChunkHandle());\n serverOutput.flush();\n serverOutput.writeInt(pivot.index);\n \n int response = serverInput.readInt();\n if (response == Constants.FALSE)\n {\n i--;\n continue;\n }\n else if (response == Constants.NOT_IN_CHUNK)\n {\n i--;\n continue;\n }\n \n //int type = serverOutput.readInt();\n //int command = serverOutput.readInt();\n //if(type == Constants.IsServer && command = Constants.READ_NEXT_RECORD)\n //{\n int sz = serverInput.readInt();\n byte[] data = new byte[sz];\n serverInput.read(data, 0, sz);\n String datastr = new String(data, \"UTF-8\");\n if(data.length > 0)\n {\n int j = serverInput.readInt();\n outcome = intToFSReturnVal(j);\n rec.setPayload(data);\n break;\n }\n else\n {\n i--;\n continue;\n }\n //}\n //else\n //{\n // int j = serverInput.readInt();\n // outcome = intToFSReturnVal(j)\n //}\n \n }\n catch (Exception e)\n {\n outcome = FSReturnVals.Fail;\n System.out.println(\"Unable to append records (ClientREC:65)\");\n }\n }\n \n return outcome;\n }",
"public Record readRecord(Long id);",
"private LoadedRow getNextRow(final ReadCSV csv) {\t\t\r\n\t\tif( csv.next() ) {\r\n\t\t\treturn new LoadedRow(csv);\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\t\t\r\n\t}",
"Object nextValue() throws IOException;",
"@Override\npublic Tuple get_next() throws IOException, JoinsException, IndexException, InvalidTupleSizeException,\n\t\tInvalidTypeException, PageNotReadException, TupleUtilsException, PredEvalException, SortException,\n\t\tLowMemException, UnknowAttrType, UnknownKeyTypeException, Exception {\n\treturn null;\n}",
"public FSReturnVals ReadFirstRecord(FileHandle ofh, TinyRec rec)\n {\n FSReturnVals outcome = FSReturnVals.Fail;\n // should set ip address, port number\n Vector<IP> servers = ofh.getServersForChunk(rec.getRID().getChunkHandle());\n int numServers = servers.size();\n if (ofh == null)\n {\n return FSReturnVals.BadHandle;\n }\n if (rec == null)\n {\n return FSReturnVals.BadRecID;\n }\n for(int i = 0; i < numServers; i++)\n {\n IP ip = new IP();\n ip.setPort(servers.elementAt(i).getPort());\n ip.setAddress(servers.elementAt(i).getAddress());\n try\n {\n Socket sock = new Socket(ip.getAddress(), ip.getPort());\n ObjectOutputStream serverOutput = new ObjectOutputStream(sock.getOutputStream());\n serverOutput.flush();\n ObjectInputStream serverInput = new ObjectInputStream(sock.getInputStream());\n serverOutput.writeInt(Constants.IsClient);\n \n serverOutput.writeInt(Constants.READ_FIRST_RECORD);\n serverOutput.writeInt(rec.getRID().getChunkHandle().length());\n serverOutput.writeBytes(rec.getRID().getChunkHandle());\n serverOutput.flush();\n \n int response = serverInput.readInt();\n if (response == Constants.FALSE)\n {\n i--;\n continue;\n }\n \n //int type = serverOutput.readInt();\n //int command = serverOutput.readInt();\n //if(type == Constants.IsServer && command = Constants.READ_FIRST_RECORD)\n //{\n int sz = serverInput.readInt();\n byte[] data = new byte[sz];\n serverInput.read(data, 0, sz);\n String datastr = new String(data, \"UTF-8\");\n if(data.length > 0)\n {\n int j = serverInput.readInt();\n outcome = intToFSReturnVal(j);\n rec.setPayload(data);\n break;\n }\n else\n {\n i--;\n continue;\n }\n //}\n //else\n //{\n // int j = serverInput.readInt();\n // outcome = intToFSReturnVal(j)\n //}\n }\n catch (Exception e)\n {\n outcome = FSReturnVals.Fail;\n System.out.println(\"Unable to append records (ClientREC:65)\");\n }\n }\n \n return outcome;\n\t}",
"public Object fetchNext()\n {\n if (!isOpen) {\n isOpen = true;\n open();\n }\n for (;;) {\n if (leftObj == null) {\n Object next = inputIterator.fetchNext();\n if (next instanceof NoDataReason) {\n return next;\n }\n\n leftObj = next;\n }\n if (rightIterator == null) {\n rightIterator = getNextRightIterator();\n needNullRow = isLeftOuter;\n }\n if (rightIterator instanceof TupleIter) {\n TupleIter ri = (TupleIter) rightIterator;\n Object next = ri.fetchNext();\n if (next == NoDataReason.END_OF_DATA) {\n if (needNullRow) {\n needNullRow = false;\n return calcRightNullRow();\n }\n leftObj = null;\n rightObj = null;\n rightIterator = null;\n continue;\n }\n rightObj = next;\n } else {\n rightObj = rightIterator;\n rightIterator = TupleIter.EMPTY_ITERATOR;\n }\n Object row = calcJoinRow();\n if (row != null) {\n needNullRow = false;\n return row;\n }\n }\n }",
"public String getRecord(long offset) throws IOException {\n\t\tdataBase.seek(offset);\n\t\treturn dataBase.readLine();\n\t}",
"private @NotNull RecordDatum finishReadingRecord(\n @NotNull JsonToken token,\n @Nullable String fieldName,\n @NotNull RecordType type\n ) throws IOException, JsonFormatException {\n\n ensure(token, JsonToken.START_OBJECT);\n RecordDatum.Builder datum = type.createBuilder();\n if (fieldName == null) { // empty record?\n ensureCurr(JsonToken.END_OBJECT, \"field name or '}'\");\n return datum;\n } else {\n while (true) {\n Field field = type.fieldsMap().get(fieldName);\n if (field == null) throw error(\n \"Unknown field '\" + fieldName + \"' in record type '\" + type.name().toString() + \"'\"\n );\n Data fieldData = readData(field.dataType());\n datum._raw().setData(field, fieldData);\n\n token = nextNonEof();\n if (token == JsonToken.END_OBJECT) break;\n if (token == JsonToken.FIELD_NAME) fieldName = currentName();\n else throw expected(\"field name or '}'\");\n }\n }\n return datum;\n }",
"public void next() {\n\t\t}",
"public VCFLine getNextLine () throws IOException {\n\t\tgoNextLine();\n\t\treturn reader.getCurrentLine();\n\t}",
"public Payee getNextPayee() throws IOException {\n\t\tRow r = this.payCursorSeq.getNextRow();\n\t\t\n\t\tif (r != null) {\n\t\t\treturn new Payee().\n\t\t\t\t\tsetOrigId(r.getInt(PAYEE_ID)).\n\t\t\t\t\tsetName(r.getString(FULL_NAME));\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"protected long getRecordNumber() {\n\t\treturn _nextRecordNumber.getAndIncrement();\n\t}",
"public String[] get_nextrecs() throws Exception {\n\t\treturn this.nextrecs;\n\t}",
"@Override\n public Object next() {\n Object retval = this.nextObject;\n advance();\n return retval;\n }",
"public boolean next() throws SQLException {\n\n try {\n debugCodeCall(\"next\");\n checkClosed();\n return nextRow();\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }",
"public boolean readNext (TSMessageConsumer processor);",
"@SuppressWarnings(\"unchecked\")\n\t\tpublic T next() throws NoSuchElementException {\n\t\t\ttry {\n//\t\t\t\tT object = (T)data[cursor * numCols + pinnedColumn];\n\t\t\t\tT object = get(cursor, pinnedColumn);\n\t\t\t\tlastRet = cursor++;\n\t\t\t\treturn object;\n\t\t\t} catch ( IndexOutOfBoundsException e ) {\n\t\t\t\tthrow new NoSuchElementException( \"You have iterated past the last element.\" + e.toString() );\n\t\t\t}\n\t\t}",
"public FlujoDetalleDTO next() {\n/* */ try {\n/* 64 */ if (this.rs.next()) {\n/* 65 */ return leerRegistro();\n/* */ }\n/* */ }\n/* 68 */ catch (Exception e) {\n/* 69 */ e.printStackTrace();\n/* 70 */ Utilidades.writeError(\"FlujoDetalleDAO:next \", e);\n/* */ } \n/* 72 */ return null;\n/* */ }",
"public DataChunk getNext() throws RecoverableInputProblem\n\t{\n\t data.setTo( base + amplitude * Math.random());\n\t ++counter;\n\t return data;\n\t}",
"boolean next() throws IOException;",
"@Override\n public Integer next() {\n return query.poll();\n }",
"@Override\r\n\tprotected T doRead() throws Exception {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tif (cursor.hasNext()){\r\n\t\t\treturn converter.convert(cursor.next());\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"@Override\n public Optional<UniqueRecordList> readRecordList() throws DataConversionException, IOException {\n return readRecordList(recordListFilePath);\n }",
"public byte[] getNextInput(byte[] buffer) throws IOException {\r\n // byte[] buffer = new byte[8192];\r\n file.seek(currOffset);\r\n file.read(buffer);\r\n currOffset += buffer.length;\r\n return buffer;\r\n }",
"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 void next() {\n\t\tif ((position == 0) && (pause != 3)) {\n\t\t\tpause++;\n\t\t} else {\n\t\t\tposition++;\n\t\t\tpause = 0;\n\t\t\tif (position == (origionalMessage.length() + 10)) {\n\t\t\t\tposition = 0;\n\t\t\t}\n\t\t}\n\n\t}",
"@SuppressWarnings(\"unchecked\")\n\t\tpublic T next() throws NoSuchElementException {\n\n\t\t\ttry {\n\n//\t\t\t\tT object = (T)data[currentRow * numCols + currentColumn];\n\t\t\t\tT object = get(currentRow, currentColumn);\n\n\t\t\t\tcurrentRow++;\n\t\t\t\tif ( currentRow == numRows ) {\n\t\t\t\t\tcurrentRow = 0;\n\t\t\t\t\tcurrentColumn++;\n\t\t\t\t}\n\n\t\t\t\tlastRet = cursor++;\n\t\t\t\treturn object;\n\t\t\t} catch ( IndexOutOfBoundsException e ) {\n\t\t\t\tthrow new NoSuchElementException( \"You have iterated past the last element. \" + e.toString() );\n\t\t\t}\n\n\t\t}",
"protected Tuple fetchNext() throws NoSuchElementException, TransactionAbortedException, DbException {\n\t\t// some code goes here\n\t\tTuple ret;\n\t\twhile (childOperator.hasNext()) {\n\t\t\tret = childOperator.next();\n\t\t\tif (pred.filter(ret))\n\t\t\t\treturn ret;\n\t\t}\n\t\treturn null;\n\t}",
"public void next() throws IOException {\r\n if (hasNext()) {\r\n line = next;\r\n next = null;\r\n\r\n int split = line.indexOf('=');\r\n fid = line.substring(0, split);\r\n text = line.substring(split + 1).split(\"\\\\|\", -1);//use -1 as limit to include empty trailing spaces\r\n if (type.getAttributeCount() != text.length)\r\n throw new DataSourceException(\"format error: expected \" + type.getAttributeCount()\r\n + \" attributes, but found \" + text.length + \". [\" + line + \"]\");\r\n } else {\r\n throw new NoSuchElementException();\r\n }\r\n }",
"public final UnitOfWork getNext() throws IOException {\n UnitOfWork result = null;\n\n synchronized (addedFrontWork) {\n if (addedFrontWork.size() > 0) {\n result = addedFrontWork.removeFirst();\n }\n }\n\n if (result == null) {\n result = doGetNext();\n\n if (result == null) {\n synchronized (addedBackWork) {\n if (addedBackWork.size() > 0) {\n result = addedBackWork.removeFirst();\n }\n }\n }\n }\n\n if (result != null && result.getWorkStatus() == WorkStatus.ALL_DONE) {\n sawAllDone.set(true);\n }\n\n return result;\n }",
"@Override\n\tpublic boolean moveNext() {\n\t\t/* the first bit signalises whether the row is deleted. \n\t\t * The folowing [schema.types.length] bits signal whether the field is NULL\n\t\t * the following 8 - (schema.types.length % 8 + 1) bits are disregarded\n\t\t */\n\t\t\n\t\ttry {\n\t\t\tint flags[] = new int[schema.types.length / 8 + 1];\n\t\t\tfor (int i = 0; i < flags.length; i++) {\n\t\t\t\tflags[i] = reader.read();\n\t\t\t\tmyBufferPosition++;\n\t\t\t\tif (flags[i] == -1) {\n\t\t\t\t\t//EOF\n\t\t\t\t\tcleanUp();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tString[] values = new String[schema.types.length];\n\t\t\tTypeInt intConv = new TypeInt();\n\t\t\tfor (int i = 0; i < schema.types.length; i++) {\n\t\t\t\tint size = 0;\n\t\t\t\tif (schema.types[i].variableSize) {\n\t\t\t\t\tbyte[] sizeByte = new byte[4];\n\t\t\t\t\treader.read(sizeByte);\n\t\t\t\t\tmyBufferPosition += sizeByte.length;\n\t\t\t\t\tsize = intConv.getIntFromByteArr(sizeByte);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsize = schema.types[i].size;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tint index = (i + 1) / 8;\n\t\t\t\tint mask = 0b10000000 >> ((i + 1) % 8);\n\t\t\t\tif ((flags[index] & mask) > 1) {\n\t\t\t\t\tvalues[i] = null;\n\t\t\t\t}\n\t\t\t\telse if (size > 0) {\n\t\t\t\t\tbyte[] buf = new byte[size];\n\t\t\t\t\treader.read(buf);\n\t\t\t\t\tmyBufferPosition += buf.length;\n\t\t\t\t\tvalues[i] = schema.types[i].fromByteArr(buf);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (flags[0] >> 7 == 1) { //record is deleted\n\t\t\t\tdelCounter++;\n\t\t\t\treturn moveNext();\n\t\t\t}\n\t\t\tthis.current = new Tuple(schema, values);\n\t\t\trecordCounter++;\n\t\t\treturn true;\n\t\t\t\n\t\t} catch (final IOException e) {\n\t\t\tthrow new RuntimeException(\"could not read: \" + this.reader + \n\t\t\t\t\". Error is \" + e);\n\t\t}\n\t}",
"private void next() {\n\t\tParcel pc = Parcel.obtain();\n\t\tParcel pc_reply = Parcel.obtain();\n\t\ttry {\n\t\t\tSystem.out.println(\"DEBUG>>>pc\" + pc.toString());\n\t\t\tSystem.out.println(\"DEBUG>>>pc_replay\" + pc_reply.toString());\n\t\t\tib.transact(2, pc, pc_reply, 0);\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"@Override\n public RadarContent next() {\n RadarContent p = pq.arrProfiles[iCursor];\n iCursor++;\n return p;\n }",
"public T next(){\n return (T)data[ci++];\n }",
"void loadNext();",
"@Override\n\tpublic Row next(){\n\t\treturn res;\n\t}",
"private void initializeNextItem() {\n while (!messagesToReturn.hasNext() && dbCursor.hasNext()) {\n messagesToReturn = storageStrategy.extractEventMessages(dbCursor.next(), actualAggregateIdentifier,\n eventSerializer, upcasterChain).iterator();\n }\n next = messagesToReturn.hasNext() ? messagesToReturn.next() : null;\n }",
"public void nextRecord( View v)\n {\n \t//\tClear out the display first\n \tclearBtn( v );\n \t//\tGo get the sheep id of this record\n \tLog.i(\"in next record\", \"this sheep ID is \" + String.valueOf(thissheep_id));\n \tcursor.moveToNext();\n \tLog.i(\"in next record\", \"after moving the cursor \");\n \tthissheep_id = cursor.getInt(0);\n \tthissheep_name = cursor.getString(1);\n \tLog.i(\"in next record\", \"this sheep ID is \" + String.valueOf(thissheep_id));\n \tLog.i(\"in next record\", \"this sheep name is \" + thissheep_name);\n \trecNo += 1;\n \tfindTagsShowAlert(v, thissheep_id);\n//\t\t// I've moved forward so I need to enable the previous record button\n\t\tButton btn3 = (Button) findViewById( R.id.prev_rec_btn );\n\t\tbtn3.setEnabled(true);\t \t\n \tif (recNo == (nRecs)) {\n \t\t// at end so disable next record button\n \t\tButton btn2 = (Button) findViewById( R.id.next_rec_btn );\n \tbtn2.setEnabled(false); \t\t\n \t}\n }",
"protected T input() {\n\t\tRecordReader<T> inputReader = getReader(getMainConstraint());\n\t\tif (inputReader == null) {\n\t\t\tLogger.getLogger(OneToManyLookupProcessNode.class).error(\"no main reader!\"); //$NON-NLS-1$\n\t\t\treturn null;\n\t\t}\n\t\tT inputRecord = inputReader.read();\n\t\tif (inputRecord == null) {\n\t\t\tLogger.getLogger(OneToManyLookupProcessNode.class).info(\"end of input\"); //$NON-NLS-1$\n\t\t\treturn null;\n\t\t}\n\t\t// Logger.getLogger(OneToManyLookupProcessNode.class).info(\"got input\"); //$NON-NLS-1$\n\t\tsetInCount(getInCount() + 1);\n\t\tif (getProgressCount() > 0 && getInCount() % getProgressCount() == 0) {\n\t\t\tLogger.getLogger(ProcessNode.class).info(\"input records: \" + getInCount()); //$NON-NLS-1$\n\t\t\tlong newTime = System.currentTimeMillis();\n\t\t\tLogger.getLogger(ProcessNode.class).info(\n\t\t\t\t\"duration: \" + String.valueOf(((double) newTime - (double) getTime()) / 1000)); //$NON-NLS-1$\n\t\t\tsetTime(newTime);\n\t\t}\n\t\treturn inputRecord;\n\t}",
"public abstract void next();",
"private int getNextIndicator() throws IOException {\n if (this.indicator == 0) {\n this.indicator = in.read();\n }\n return this.indicator;\n }",
"axiom Object readLine(Object BufferedReader(FileReaderr f)) {\n\treturn f.get(0);\n }",
"public T getNextItem();",
"@Override\n public Item next() {\n if(!hasNext()) throw new NoSuchElementException(\"Failed to perform next because hasNext returned false!\");\n Item item = current.data;\n current = current.next;\n return item;\n }",
"public boolean fetchNext(Transaction trans, DatasetCursor cursor,\n DBObject obj, Filter filter, boolean forUpdate)\n throws StorageException, LockConflict {\n Rowid rowid = cursor.getRowid();\n int index = rowid.getIndex();\n\n while (true) {\n ++index;\n\n if (index < 0 || index >= dir.getCount())\n return false;\n\n rowid.setIndex((short) index);\n\n if (_read(trans, obj, index, forUpdate, filter))\n return true;\n }\n }",
"public void read() {\n\t\tthis.isRead = true;\n\t}",
"public LogRecord extractFirstLogRecord() throws IOException {\n\n InferenceMachine infMach = new InferenceMachine(logConfig.getLogFile());\n\n /* First is to find a log record header */\n String line;\n do {\n line = getNextLine();\n } while ((line != null) && !infMach.isLogRecordHeader(line));\n\n /* There was any header found? */\n if (line == null) {\n throw new IllegalArgumentException(\"The file contains no record log header\");\n }\n\n LogRecord logRecord = new LogRecord(line);\n while (((line = bufferedReader.readLine()) != null) && !infMach.isLogRecordHeader(line)) {\n logRecord.addLine(line);\n }\n\n return logRecord;\n }"
] | [
"0.77763027",
"0.7393347",
"0.72949654",
"0.7235936",
"0.7164531",
"0.6828945",
"0.6809784",
"0.6537403",
"0.6525082",
"0.65242636",
"0.64991003",
"0.6480387",
"0.6477972",
"0.6477896",
"0.64081526",
"0.63034284",
"0.63015705",
"0.62350005",
"0.61900616",
"0.6161531",
"0.6136149",
"0.61008084",
"0.60976607",
"0.6095471",
"0.6087487",
"0.60727096",
"0.60691476",
"0.60664064",
"0.60526556",
"0.6044841",
"0.60292864",
"0.6027716",
"0.60189986",
"0.6010517",
"0.5953755",
"0.59343225",
"0.5911643",
"0.5888268",
"0.58821464",
"0.5869776",
"0.58627963",
"0.5860981",
"0.5849007",
"0.58251387",
"0.58075607",
"0.5803872",
"0.5800568",
"0.5794787",
"0.5753784",
"0.57214487",
"0.5716613",
"0.57164896",
"0.56949186",
"0.56917214",
"0.56705076",
"0.56613237",
"0.56319904",
"0.5629805",
"0.5596875",
"0.5590736",
"0.5585177",
"0.55784196",
"0.5577467",
"0.55621177",
"0.55316925",
"0.5528989",
"0.55215776",
"0.5516358",
"0.55032206",
"0.5477412",
"0.547171",
"0.5469476",
"0.544919",
"0.5436432",
"0.54363656",
"0.54331535",
"0.54323643",
"0.54241353",
"0.542364",
"0.54230934",
"0.5422344",
"0.5420738",
"0.5415363",
"0.54153234",
"0.5409545",
"0.5404832",
"0.5403709",
"0.5390943",
"0.5388282",
"0.5374586",
"0.5367897",
"0.53668123",
"0.5360137",
"0.53571486",
"0.5344191",
"0.5343442",
"0.5341888",
"0.53412825",
"0.53406763",
"0.5337323",
"0.5336606"
] | 0.0 | -1 |
The default port to listen on. Constructors Constructs an instance of the echo server. | public void createTableUser(){
Statement stmt;
try {
stmt = this.getConn().createStatement();
///////////////*********remember to retrieve*************/////////////
//stmt.executeUpdate("create table user(username VARCHAR(40),email VARCHAR(40), password int);");
//stmt.executeUpdate("INSERT INTO user VALUES('A','pit@gmail.com',12344);");
//stmt.executeUpdate("INSERT INTO user VALUES('CC','pit234@gmail.com',3231);");
} catch (SQLException e) { e.printStackTrace();}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Server() {\n\t\t\n\t\ttry {\n\t\t\tss= new ServerSocket(PORT);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace(); // Default\n\t\t}\n\t}",
"public Server(){\n\t\ttry {\n\t\t\t// initialize the server socket with the specified port\n\t\t\tsetServerSocket(new ServerSocket(PORT));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IO Exception while creating a server\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public Server() throws IOException\n {\n socket = new ServerSocket(port);\n }",
"public ServerMain( int port )\r\n\t{\r\n\t\tthis.port = port;\r\n\t\tserver = new Server( this.port );\r\n\t}",
"public Server() throws IOException{\n\t\tsuper();\n\t\tthis.serversocket = new java.net.ServerSocket(DEFAULTPORT);\n\t\tif (DEBUG){\n\t\t\tSystem.out.println(\"Server socket created:\" + this.serversocket.getLocalPort());\n\t\t\tclient_list.add(String.valueOf(this.serversocket.getLocalPort()));\n\t\t}\n\t}",
"public Server() {\n\t\tsession = new WelcomeSession();\n\t\tmPort = DEFAULT_PORT;\n\t\texecutor = Executors.newCachedThreadPool();\n\t}",
"public Server(int port)\r\n\t\t{\r\n log(\"Initialising port \" + port);\r\n\r\n\t\t// Set the port\r\n\t\tthis.port = port;\r\n\r\n // Create the server socket\r\n createServerSocket();\r\n \t}",
"public Server() {\n try {\n welcomeSocket = new ServerSocket(PORT);\n System.out.println(\"Server listening on \" + PORT);\n } catch (IOException e) {\n System.out.println(\"Error creating welcome socket. Is this socket available?\");\n }\n }",
"public Server() {\n\t\tinit(new Config());\n\t}",
"public Server(int port) throws IOException{\n\t\tsuper();\n\t\tthis.serversocket= new java.net.ServerSocket(port);\n\t\t\n\t\tif (DEBUG){\n\t\t\tSystem.out.println(\"Server socket created:\" + this.serversocket.getLocalPort());\n\t\t\tclient_list.add(String.valueOf(this.serversocket.getLocalPort()));\n\t\t}\n\t}",
"public DefaultTCPServer(int port) throws Exception {\r\n\t\tserverSocket = new ServerSocket(port);\t}",
"public TCPServer(int port) throws IOException {\n\tthis.socket = new ServerSocket(port);\n\tthis.clients = new ArrayList();\n\n\tSystem.out.println(\"SERVER: Started\");\n }",
"public UDPEchoServer() throws SocketException {\r\n super(DEFAULT_PORT);\r\n }",
"public static void main(String[] args) \n {\n int port = DEFAULT_PORT; //Port to listen on\n\n\n ServerGui serverGui = new ServerGui();\n serverGui.setVisible(true);\n serverGui.setSize(450, 300);\n \n \n //----------------------------------\n // EchoServer sv = new EchoServer(port);\n \n }",
"public Server() {}",
"public ChatRoomServer(int portNumber){\n this.ClientPort = portNumber;\n }",
"public OOXXServer(){\n\t\ttry\n\t\t{\n\t\t\tserver = new ServerSocket(port);\n\t\t\t\n\t\t}\n\t\tcatch(java.io.IOException e)\n\t\t{\n\t\t}\n\t}",
"public Server() throws IOException {\n try {\n this.serverSocket = new ServerSocket(this.port,100, InetAddress.getByName(host));\n } catch (UnknownHostException e) {\n System.out.println(\"Erreur lors de la construction du serveur (Hôte inconnu) - Server Constructor Error\");\n e.printStackTrace();\n } catch(IOException e) {\n e.printStackTrace();\n }\n }",
"public Server(int port){\n\t\ttry {\n\t\t\tdatagramSocket = new DatagramSocket(port);\n\t\t\trequest = new byte[280];\n\t\t} catch (SocketException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\n\t}",
"public ServerConnection()\n {\n //Initializing of the variables used in the constructor\n this.hostAddress = \"http://localhost\";\n this.port = 8882;\n }",
"public Server(int port) {\r\n \r\n this.m_Port = port;\r\n this.m_Clients = new TeilnehmerListe();\r\n }",
"public ChatServer() throws Exception {\n \n // Set port\n port = Integer.parseInt(config.getConfig(\"chatPort\"));\n \n System.out.println(\"Chat server running on port \" + port);\n \n }",
"public GameServer(int portNum)\n\t{\n\t\tport = portNum;\n\t}",
"public WebServer (int port)\t\t\t\t\t\t\t\t\t\t\t\r\n\t{\r\n\t\tthis.shost = DEF_HOST; \t\t\t\t\t\t\t\t\r\n\t\tthis.sPort = port; \t\t\t\t\t\t\t\t\t\t\r\n\t}",
"public Server(int port) {\n this.port = port;\n try {\n socket = new DatagramSocket(port);\n } catch (SocketException e) {\n e.printStackTrace();\n }\n run = new Thread(this, \"Server\");\n run.start();\n }",
"public Server(){\r\n \r\n this.m_Clients = new TeilnehmerListe();\r\n this.m_Port = 7575;\r\n }",
"public WebServer ()\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t{\r\n\t\tthis.shost = DEF_HOST; \t\t\t\t\t\t\t\t\r\n\t\tthis.sPort = DEF_PORT; \t\t\t\t\t\t\t\t\r\n\t}",
"public Server(int port) {\n this.port = port;\n try {\n sock = new ServerSocket(port);\n clientSock = sock.accept();\n\n //Connection established, do some fancy stuff here\n processReq();\n } catch (IOException e) {\n System.err.println(\"ERROR: Sth failed while creating server socket :( \");\n }\n }",
"public Server() throws IOException {\n System.out.println(\"\\t Server Started \\n\");\n }",
"@Override\n @SuppressWarnings(\"CallToPrintStackTrace\")\n public void simpleInitApp() {\n \n\n try {\n System.out.println(\"Using port \" + port);\n // create the server by opening a port\n server = Network.createServer(port);\n server.start(); // start the server, so it starts using the port\n } catch (IOException ex) {\n ex.printStackTrace();\n destroy();\n this.stop();\n }\n System.out.println(\"Server started\");\n // create a separat thread for sending \"heartbeats\" every now and then\n new Thread(new NetWrite()).start();\n server.addMessageListener(new ServerListener(), ChangeVelocityMessage.class);\n // add a listener that reacts on incoming network packets\n \n }",
"public Server() {\n print_addr();\n follow_updates();\n }",
"public TCPServer(int portNumber){\r\n\t\t// Abro el socket en el puerto dado y obtengo los stream\r\n\t\ttry {\r\n\t\t\tmServerSocket = new ServerSocket(portNumber);\r\n\t\t} catch (IOException e) { e.printStackTrace(); }\r\n\t}",
"public WebServer (String sHost, int port)\t\t\t\t\t\t\t\r\n\t{\r\n\t\tthis.shost = sHost; \t\t\t\t\t\t\t\t\t\t\r\n\t\tthis.sPort = port; \t\t\t\t\t\t\t\t\t\t\r\n\t}",
"public static void main(String[] args) throws IOException {\n int port = 7788;\n Server server = new Server(port);\n server.listen();\n }",
"protected ClassServer(int aPort) throws IOException{\n this(aPort, null);\n }",
"public Configuration() {\r\n\t\tthis.serverAddress = \"127.0.0.1\";\r\n\t\tthis.serverPort = \"2586\";\r\n\t}",
"public WebServer()\n {\n if (!Variables.exists(\"w_DebugLog\"))\n Variables.setVariable(\"w_DebugLog\", true);\n\n if (!Variables.exists(\"w_Port\"))\n Variables.setVariable(\"w_Port\", 80);\n\n if (!Variables.exists(\"w_NetworkBufferSize\"))\n Variables.setVariable(\"w_NetworkBufferSize\", 2048);\n\n PORT = Variables.getInt(\"w_Port\");\n DEBUG = Variables.getBoolean(\"w_DebugLog\");\n BUFFER_SIZE = Variables.getInt(\"w_NetworkBufferSize\");\n }",
"public TCPCanSocket() throws IOException\n \t{\n \t\t// this(new ServerSocket(DEFAULT_PORT).accept());\n \t\tthis(new ServerSocket(DEFAULT_PORT, 100).accept());\n \t\tSystem.out.println( \"constructor: open server socket\" );\n \t}",
"public SocketIO(int port) throws UnknownHostException, IOException\n\t{\n\t\tthis((new ServerSocket(port)).accept());\n\t}",
"public ConnectionManager() {\r\n\t\tthis(DEFAULT_PORT, true, true);\r\n\t}",
"public UDPSocketServer() throws IOException {\n udpSocket = new DatagramSocket( SERVER_PORT );\n serverSocket = new ServerSocket( PORT_WEB);\n System.out.println(\"Started the UDP socket server at port \" + SERVER_PORT);\n System.out.println(\"Started the WebServer at port \" + PORT_WEB);\n\n }",
"public ControlCenter(){\n serverConnect = new Sockets();\n serverConnect.startClient(\"127.0.0.1\", 5000);\n port = 5000;\n }",
"public O2OServer(int port, boolean keepAlive, IO2OWorkerFactory workerFactory){\r\n\t\tsuper(port, new O2OConnectionFactory(workerFactory, keepAlive));\r\n\t}",
"public ExternalNodeServiceClient() {\n this(ExternalNodeService.DEFAULT_PORT);\n }",
"public WebServer(int port) {\n\t\ttry {\n\t\t\tthis.listen_port = new ServerSocket(port);\n\t\t\tthis.pool = Executors.newFixedThreadPool(40);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public ServerGame(int port)\r\n\t{\r\n\t\tsuper(NetworkMode.SERVER);\r\n\t\tserver = new Server(port, getWorld());\r\n\t}",
"public ServerSide(Config config, InetAddress inetAddress, int port) {\n super(config);\n this.inetAddress = inetAddress;\n this.port = port;\n }",
"public void startServer() {\n\r\n try {\r\n echoServer = new ServerSocket(port);\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n // Whenever a connection is received, start a new thread to process the connection\r\n // and wait for the next connection.\r\n while (true) {\r\n try {\r\n clientSocket = echoServer.accept();\r\n numConnections++;\r\n ServerConnection oneconnection = new ServerConnection(clientSocket, numConnections, this);\r\n new Thread(oneconnection).start();\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }\r\n\r\n }",
"public void listen(final int port) {\n listen(port, \"localhost\");\n }",
"public void start() {\n\t\t\n\t\ttry {\n\t\t\tmainSocket = new DatagramSocket(PORT_NUMBER);\n\t\t}\n\t\tcatch(SocketException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t\n\t\t//Lambda expression to shorten the run method\n\t\tThread serverThread = new Thread( () -> {\n\t\t\tlisten();\n\t\t});\n\t\t\n\t\tserverThread.start();\n\t}",
"public void run() {\n ServerSocketChannelFactory acceptorFactory = new OioServerSocketChannelFactory();\n ServerBootstrap server = new ServerBootstrap(acceptorFactory);\n\n // The pipelines string together handlers, we set a factory to create\n // pipelines( handlers ) to handle events.\n // For Netty is using the reactor pattern to react to data coming in\n // from the open connections.\n server.setPipelineFactory(new EchoServerPipelineFactory());\n\n server.bind(new InetSocketAddress(port));\n }",
"private void startListen() {\n try {\n listeningSocket = new ServerSocket(listeningPort);\n } catch (IOException e) {\n throw new RuntimeException(\"Cannot open listeningPort \" + listeningPort, e);\n }\n }",
"public Server() {\n\t\tthis.currentMode = Mode.TEST; // TODO: implement\n\t}",
"public PingServer(int port, int noOfClients) {\n\t\tthis.port = port;\n\t\tthis.noOfClients = noOfClients;\n\t}",
"public Server(int port, Consumer<Serializable> onReceiveCallBack)\r\n {\r\n //superclass Constructor called \r\n super(onReceiveCallBack);\r\n \r\n //\r\n this.port = port;\r\n }",
"public TCPServer(TCPViewModel viewModel, int port) {\n this.viewModel = viewModel;\n this.port = port;\n startServerMsg = \"TCP server listener successfully started on port [\"+port+\"]... listening for incoming connections.\";\n }",
"void startServer(int port) throws Exception;",
"public IndexServer(int port, File fname) throws IOException {\n super(port, fname);\n }",
"public TCPServerEmployee(int NumPort, ControllerC controller) {\n\t\ttry\n\t\t{\n\t\t\tsocketserver = new ServerSocket(NumPort);\n\t\t\tthis.controller = controller;\n\t\t}\n\t\tcatch (IOException e) \n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public static void main(String[] args) throws IOException \n {\t \n\tScanner scannerIn = new Scanner(System.in);\n\tSystem.out.print(\"Please enter port number for the Chat Server to run on : \");\n\tint port = scannerIn.nextInt();\n\t//starts new ChatServer\n\tChatServer cs = new ChatServer(port);\n }",
"public Server() throws Exception {\r\n\t}",
"public EchoClient(String address, int port) {\n try {\n inetAddress = InetAddress.getByName((address != null) ? address : \"localhost\");\n } catch (UnknownHostException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n try {\n socket = new DatagramSocket(port, inetAddress);\n } catch (SocketException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }",
"protected Server() {\n super(\"Ublu Server\");\n }",
"public TCPServer(String ip, int port) throws SocketException\n\t{\n\t\tsuper(ip, port);\n\t\tsetCheck(null);\n\t}",
"public Client() {\n initComponents();\n \n Server server = new Server();\n server.start();\n \n }",
"public TestRouter() throws IOException {\n super( PORT );\n addDefaultRoutes();\n }",
"public Client() {\n _host_name = DEFAULT_SERVER;\n _port = PushCacheFilter.DEFAULT_PORT_NUM;\n }",
"private ServerSocket createServerSocket() throws IOException {\n ServerSocket serverSocket = new ServerSocket(Constants.SERVER_PORT);\n System.out.printf(\"Server for chatting started at %d\\n\", Constants.SERVER_PORT);\n return serverSocket;\n }",
"public TCPAdapter(int port) throws IOException {\n\t\tLOG.info(\"Binding port: \"+Integer.toString(port));\n\t\tthis.socket = new ServerSocket(port);\n\t}",
"public BorrowMyStuffServer(int port) throws IOException {\n\t\t// model = new MessageModel();\n\t\tserverSocket = new ServerSocket(port);\n\t\tserverSocket.setSoTimeout(500000);\n\t\t// users = new ArrayList<>();\n\t}",
"private void start(String[] args){\n\t\tServerSocket listenSocket;\n\n\t\ttry {\n\t\t\tlistenSocket = new ServerSocket(Integer.parseInt(args[0])); //port\n\t\t\tSystem.out.println(\"Server ready...\");\n\t\t\twhile (true) {\n\t\t\t\tSocket clientSocket = listenSocket.accept();\n\t\t\t\tSystem.out.println(\"Connexion from:\" + clientSocket.getInetAddress());\n\t\t\t\tClientThread ct = new ClientThread(this,clientSocket);\n\t\t\t\tct.start();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Error in EchoServer:\" + e);\n\t\t}\n\t}",
"public ServidorSocket() throws IOException {\n\t\tservidor = new ServerSocket(PUERTO);\n\t\tcliente = new Socket();\n\t}",
"public RemoteConsoleWriter(int port)\n {\n debug(\"Create remote console server instance.\");\n\n ServerSocket server = null;\n Thread thread = null;\n try {\n server = new ServerSocket();\n thread = new Thread(this);\n thread.setDaemon(true);\n thread.start();\n }\n catch(IOException e) {\n error(\"Error creating the server. Remote console writer is unable to process appender messages.\");\n }\n\n this.port = port;\n this.server = server;\n this.thread = thread;\n }",
"default int getPort() {\n return getServer().getPort();\n }",
"public SocketServer() {\n \n super();\n start();\n\n }",
"public void init() throws IOException {\r\n try {\r\n serverSocket = new ServerSocket(PORT);\r\n this.running = true;\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }",
"public Server(final Config config) {\n\t\tValidate.notNull(config);\n\t\tinit(config);\n\t}",
"public static ServerSocket createServerSocket() {\n \t\n try {\n listener = new ServerSocket(PORT,1, InetAddress.getByName(hostname));\n } catch (IOException e) {\n e.printStackTrace();\n }\n return listener;\n }",
"public static void main(String[] args) throws IOException {\n int port = 8080;\n\n try {\n if (args.length == 1) {\n port = Integer.parseInt(args[0]);\n }\n ServerSocket serverSocket = new ServerSocket(port);\n ChatServer server = new ChatServer(serverSocket);\n server.startServer();\n } catch (NumberFormatException ne) {\n System.out.println(\"Illegal inputs provided when starting the server!\");\n return;\n }\n }",
"public static void main(String[] args) {\n BasicConfigurator.configure();\n\n if (args.length < 1) {\n log.error(\"Please specify port number for Echo service\");\n System.exit(1);\n }\n\n EchoServiceLauncher echoService = new EchoServiceLauncher();\n echoService.launch( Integer.valueOf(args[0]) );\n }",
"public ServerDef() {}",
"public MockServerClient(String host, int port) {\n this(host, port, \"\");\n }",
"public Server(int port, mainViewController viewController, LogViewController consoleViewController){\n isRunningOnCLI = false;\n this.viewController = viewController;\n this.port = port;\n this.consoleViewController = consoleViewController;\n viewController.serverStarting();\n log = new LoggingSystem(this.getClass().getCanonicalName(),consoleViewController);\n log.infoMessage(\"New server instance.\");\n try{\n this.serverSocket = new ServerSocket(port);\n //this.http = new PersonServlet();\n log.infoMessage(\"main.Server successfully initialised.\");\n clients = Collections.synchronizedList(new ArrayList<>());\n ServerOn = true;\n log.infoMessage(\"Connecting to datastore...\");\n //mainStore = new DataStore();\n jettyServer = new org.eclipse.jetty.server.Server(8080);\n jettyContextHandler = new ServletContextHandler(jettyServer, \"/\");\n jettyContextHandler.addServlet(servlets.PersonServlet.class, \"/person/*\");\n jettyContextHandler.addServlet(servlets.LoginServlet.class, \"/login/*\");\n jettyContextHandler.addServlet(servlets.HomeServlet.class, \"/home/*\");\n jettyContextHandler.addServlet(servlets.DashboardServlet.class, \"/dashboard/*\");\n jettyContextHandler.addServlet(servlets.UserServlet.class, \"/user/*\");\n jettyContextHandler.addServlet(servlets.JobServlet.class, \"/job/*\");\n jettyContextHandler.addServlet(servlets.AssetServlet.class, \"/assets/*\");\n jettyContextHandler.addServlet(servlets.UtilityServlet.class, \"/utilities/*\");\n jettyContextHandler.addServlet(servlets.EventServlet.class, \"/events/*\");\n //this.run();\n } catch (IOException e) {\n viewController.showAlert(\"Error initialising server\", e.getMessage());\n viewController.serverStopped();\n log.errorMessage(e.getMessage());\n }\n }",
"public void start(int port);",
"public UDPServidor(String filename, int port) {\n this.filename = filename;\n this.port = port;\n }",
"public static void runServer(int port) throws IOException {\n\t\tserver = new CEMSServer(port);\n\t\tuiController.setServer(server);\n\t\tserver.listen(); // Start listening for connections\n\t}",
"public static void main(String[] args) \r\n {\r\n\r\n int portNumber = 5007;\r\n\r\n if (args.length != 2) {\r\n System.err.println(\"Syntax: java Server <port number>\");\r\n System.exit(1);\r\n }\r\n\r\n portNumber = Integer.parseInt(args[1]);\r\n\r\n chatd server = new chatd(\"-port\", portNumber);\r\n server.launch();\r\n }",
"public SecureWebServer(int port)\n {\n this(port, null);\n }",
"protected ServerBase(int port, int maxConnections, ActivityLogger logger) {\r\n l = logger;\r\n connections = new ArrayList<>();\r\n \r\n try {\r\n l.logI(\"Init server with port \" + port\r\n + \" with \" + maxConnections + \" connections\");\r\n this.server = new ServerSocket (port, maxConnections); \r\n } catch (IOException ex) {\r\n l.logE(ex.toString());\r\n }\r\n }",
"private void initServerSocket()\n\t{\n\t\tboundPort = new InetSocketAddress(port);\n\t\ttry\n\t\t{\n\t\t\tserverSocket = new ServerSocket(port);\n\n\t\t\tif (serverSocket.isBound())\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Server bound to data port \" + serverSocket.getLocalPort() + \" and is ready...\");\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unable to initiate socket.\");\n\t\t}\n\n\t}",
"public UDPLayer() \n\t\tthrows SocketException\n\t{\n\t\tthis(0, true); // use any available port on the local host machine\n\t\t// TODO use -1 instead of 0?\n\t}",
"public ServerConnecter() {\r\n\r\n\t}",
"public FileServer(int port) throws IOException {\n serverThread = new Thread(new RunningService(port));\n }",
"public MemcachedServerSocket(int port) throws IOException {\n this(port, 0);\n }",
"public static void main(String[] args) {\r\n ChatServer server = new ChatServer(portNumber);\r\n server.startServer();\r\n }",
"public ServerS(int PortC){\r\n\t\ttry{\r\n\t\t\tsServer = new ServerSocket(PortC);\r\n\t\t\tescoltant = false;\r\n\t\t}catch(IOException e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"Client(String host, int port) {\n super(host, port);\n }",
"public static void main(String[] args){\n\t\tif (args.length != 1) {\n\t\t\tSystem.out.println(\"Usage: java EchoServer <EchoServer port>\");\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\tEchoServerMultiThreaded echoServerMultiThreaded = new EchoServerMultiThreaded();\n\t\techoServerMultiThreaded.start(args);\n\t}",
"public static void main(String[] args) {\n Server server = new Server(1234);\n server.listen();\n \n // YOUR CODE HERE\n // It is not required (or recommended) to implement the server in\n // this runner class.\n }",
"public void openServer() {\n try {\n this.serverSocket = new ServerSocket(this.portNumber);\n } catch (IOException ex) {\n System.out.println(ex);\n }\n }",
"public MyServer() {\n try {\n \ttimer = new Timer(1000, timerListener());\n regularSocket = new ServerSocket(7777);\n webServer = new Server(new InetSocketAddress(\"127.0.0.1\", 80));\n WebSocketHandler wsHandler = new WebSocketHandler() {\n\t @Override\n\t public void configure(WebSocketServletFactory factory) {\n\t factory.register(HumanClientHandler.class);\n\t }\n\t };\n\t \n webServer.setHandler(wsHandler);\n\t webServer.start();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }"
] | [
"0.76192373",
"0.7524119",
"0.7393373",
"0.7279793",
"0.7253972",
"0.7127994",
"0.7122446",
"0.7095989",
"0.69877446",
"0.69840086",
"0.6970769",
"0.68969125",
"0.6891154",
"0.6867499",
"0.6848366",
"0.6791788",
"0.6784965",
"0.6730801",
"0.6723182",
"0.6672766",
"0.66613543",
"0.6659694",
"0.6644621",
"0.6642428",
"0.66320765",
"0.66257936",
"0.6618906",
"0.65860385",
"0.6580937",
"0.6519201",
"0.6498874",
"0.64966637",
"0.64678663",
"0.64445215",
"0.64172024",
"0.6413129",
"0.6412625",
"0.6412499",
"0.64103854",
"0.6401102",
"0.6389113",
"0.63756627",
"0.6373773",
"0.63041335",
"0.62909305",
"0.6287271",
"0.628038",
"0.6252304",
"0.62518936",
"0.62455386",
"0.6236837",
"0.6203837",
"0.6199924",
"0.61795515",
"0.61731625",
"0.6172017",
"0.6171618",
"0.6170584",
"0.6152249",
"0.61503947",
"0.61316276",
"0.6111521",
"0.6102932",
"0.6082864",
"0.60794085",
"0.60745627",
"0.6064633",
"0.6055624",
"0.60438097",
"0.60400206",
"0.60359025",
"0.6034219",
"0.6032059",
"0.6031042",
"0.6030908",
"0.602409",
"0.6023155",
"0.6018048",
"0.6017913",
"0.5998773",
"0.59970975",
"0.59969145",
"0.5996856",
"0.5988413",
"0.5986547",
"0.59829456",
"0.5978999",
"0.59751165",
"0.5972443",
"0.596956",
"0.596847",
"0.5949185",
"0.5946702",
"0.594452",
"0.5935494",
"0.59278417",
"0.59277785",
"0.5922375",
"0.59211427",
"0.5913516",
"0.59110266"
] | 0.0 | -1 |
Instance methods This method handles any messages received from the client. | public void handleMessageFromClient (Object msg, ConnectionToClient client)
{
Envelope en=(Envelope)msg;
User user=null;
int write=0;
String str=msg.toString();
try{
Statement stmt = conn.createStatement();
if((en.getTask()).equals("login")) //search Login
{
logInMod showfiles=(logInMod)en.getObject();
file f;
String username;
String pass;
String mail;
int status;
ArrayList<file> files=new ArrayList<>();
String re = "SELECT * FROM users WHERE users.username= '"+(showfiles.getUserName()+"' AND users.password='"+showfiles.getPassword()+"'");
rs = stmt.executeQuery(re);
if(rs.next()==true)
{
username=rs.getString(1);
pass=rs.getString(2);
mail=rs.getString(3);
status=rs.getInt(4);
String re2 = "SELECT * FROM files WHERE files.username= '"+(showfiles.getUserName()+"'");
rs1 = stmt.executeQuery(re2);
while(rs1.next()==true)
{
f=new file(rs1.getString(2),rs1.getString(3));
files.add(f);
}
user = new User(username,pass,mail,status,files);
en=new Envelope(user,"log in handle");
client.sendToClient(en);
}
else
client.sendToClient("Not found User");
}
if(en.getTask().equals("forgotPass"))
{
forgetPassCon forgot=(forgetPassCon)en.getObject();
String re = "SELECT * FROM users WHERE users.email= '"+(forgot.getUserMail()+"'");
rs = stmt.executeQuery(re);
if(rs.next()==true)
{
client.sendToClient("we found the mail!");
}
else
client.sendToClient("mail doesn't exists");
}
if(en.getTask().equals("log in status"))
{
User userloged=(User)en.getObject();
String upd = "UPDATE users SET status= '1' WHERE users.username = '"+(userloged.getUsreName()+"' AND users.password='"+userloged.getUpassword())+"'";
stmt.executeUpdate(upd);
controller.SetLog(userloged,"login"); //update the login serverLogGui
}
if(en.getTask().equals("log out status"))
{
User userloged=(User)en.getObject();
String upd = "UPDATE users SET status= '0' WHERE users.username = '"+(userloged.getUsreName()+"' AND users.password='"+userloged.getUpassword())+"'";
stmt.executeUpdate(upd);
controller.SetLog(userloged,"logout"); //update the logout serverLogGui
}
if(en.getTask().equals("show user interest groups"))
{
interestGroups s= null;
interestGroups s2= null;
user=(User)en.getObject();
ArrayList<interestGroups> interestGroup=new ArrayList<>();
ArrayList<interestGroups> allGroup=new ArrayList<>();
String re="select * from test.interstgroups where interstgroups.username= '"+user.getUserName() +"'";
rs = stmt.executeQuery(re);
while(rs.next()==true)
{
s=new interestGroups(rs.getString(2));
interestGroup.add(s);
}
user.setInterestGroupInDB(interestGroup);
String temp;
String re2="select distinct groupname from test.interstgroups";
rs = stmt.executeQuery(re2);
while(rs.next()==true)
{
temp = rs.getString(1);
s2=new interestGroups(temp);
allGroup.add(s2);
}
user.setAllGroupInDB(allGroup);
en=new Envelope(user,"show user interest groups");
client.sendToClient(en);
}
}
catch (SQLException e) {
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void handleMessageFromClient(Object msg) {\n\n }",
"@Override\n public void handleMessage(Message message) {}",
"@Override\r\n public void handleMessage(Message msg) {\n }",
"protected void handleMessage(Message msg) {}",
"public void handleMessage(Msg clientMsg) {\n switch (clientMsg.getMsgType()) {\n case ID_IS_SET:\n handle_id_is_set(clientMsg);\n break;\n\n case SHIPS_PLACED:\n handle_ships_placed(clientMsg);\n break;\n\n case WAITING:\n break;\n\n case SHOT_PERFORMED:\n handle_shot_performed(clientMsg);\n break;\n }\n }",
"@Override\n\tprotected void processConnection() {\n\t\t\n\t\twhile(true) {\n\t\t\t\n\t\t\ttry {\n\t\t\t\tint receiverID = (Integer) input.readObject();\n\t\t\t\tString message = (String) input.readObject();\n\t\t\t\t\n\t\t\t\tClientHandler recieverHandler = Server.clientConnections.get(receiverID);\n\t\t\t\tif(recieverHandler == null) {\n\t\t\t\t\tsendData(ERROR_CODE);\n\t\t\t\t\tsendData(\"Not available\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\trecieverHandler.sendData(clientID);\n\t\t\t\t\trecieverHandler.sendData(message);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(ClassNotFoundException classNotFoundException) {\n\t\t\t\tserver.serverGUI.showMessage(\"Unknown object type recieved.\");\n\t\t\t}\n\t\t\tcatch(IOException ioException) {\n\t\t\t\tserver.serverGUI.showMessage(\"Client terminated connection.\\n\");\n\t\t\t\tcloseConnection();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"public void handleMessage(Message message);",
"@Override\n public void handleMessage(Message msg) {\n System.out.println(\"recibe mensajes ...\");\n System.out.println(msg.obj);\n }",
"@Override\n public void handleMessage(Message msg) {\n\t \tif(mService.get() != null && inAllowedState(msg.what)){\n\t \n\t \t\t// Keep track of the current request\n\t \t\tif(msg.what != MSG_GETSTATE)\n\t \t\t\tmService.get().currentRequest = msg.what;\n\t \t\t\n\t \t\t// Send the message to the service\n\t \t\tswitch (msg.what) {\n case MSG_INITIALIZE:\n \tLog.v(TAG, \"initialize client request: \" + msg.obj.toString());\n \tif(!isInitialized() || msg.arg1 > 0){\n mService.get().initializeOCR(new WeakReference<Messenger> (msg.replyTo), msg.obj.toString());\n \t} else {\n \t\tmService.get().sendMessage(new WeakReference<Messenger> (msg.replyTo), MSG_REPLY, \n \t\t\t\tmsg.what, mService.get().getString(R.string.error_already_initialized));\n \t}\n break;\n case MSG_RELEASE:\n \tLog.v(TAG, \"release client request\");\n \tmService.get().releaseOCR();\t\n \tmService.get().sendMessage(new WeakReference<Messenger> (msg.replyTo), MSG_REPLY, \n \t\t\tmsg.what, mService.get().getString(R.string.success_release));\n break;\n case MSG_RECOGNIZE:\n case MSG_RECOGNIZE_TXT:\n \tLog.v(TAG, \"recognize client request\");\n \t\tmService.get().recognize(new WeakReference<Messenger> (msg.replyTo), \n \t\t\t\t(msg.obj instanceof Bitmap) ? (Bitmap) msg.obj : null);\n break;\n case MSG_GETSTATE:\n \tLog.v(TAG, \"get state client request\");\n \tmService.get().sendMessage(new WeakReference<Messenger> (msg.replyTo), MSG_REPLY, \n \t\t\tmsg.what, mService.get().mState.toString());\n \tbreak;\n case MSG_CANCEL:\n \tLog.v(TAG, \"cancel request\");\n \tmService.get().cancel();\n \tbreak;\n case MSG_INSTALL_CHECK:\n \tLog.v(TAG, \"check installation request\");\n \tmService.get().checkInstallation(new WeakReference<Messenger> (msg.replyTo));\n \tbreak;\n default:\n super.handleMessage(msg);\n\t }\t \t\t\n\t \t} else {\n\t try {\n\t \tif(mService.get() != null){\n\t \t\t// It is in an invalid state\n\t \t \t\tLog.e(TAG,\"IncomingHandler: Invalid state, namely: \" + mService.get().mState + \".\");\n\t \t\tmsg.replyTo.send(Message.obtain(null, MSG_ERROR, \n\t \t\t\t\tmService.get().getString(R.string.error_invalid_state)));\n\t \t} else {\n\t \t \t\t// The service does not exist\n\t \t \t\tLog.e(TAG,\"IncomingHandler: Service reference is null.\");\n\t \t\tmsg.replyTo.send(Message.obtain(null, MSG_ERROR, \"Service does not exist.\"));\n\t \t}\n\t } catch (RemoteException e) {\n\t // The client is dead. \n\t\t \t\tLog.e(TAG,\"IncomingHandler: The client is dead.\");\n\t } catch (NullPointerException e) {\n\t // The reply to client is does not exist. \n\t\t \t\tLog.e(TAG,\"IncomingHandler: msg.replyTo was null.\");\n\t }\n\t \t}\n\t }",
"@Override\n\tpublic void onMessageRecieved(Message arg0) {\n\t\t\n\t}",
"@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 void receiveAndDispatchMessage() {\n String response = null;\n try {\n while((response = bufferedReader.readLine()) != null) {\n System.out.println(\"received message from server: \" + response);\n String messageKind = \"\";\n if(response.contains(\":\")) {\n messageKind = response.substring(0, response.indexOf(\":\"));\n } else {\n messageKind = response;\n }\n Bundle bundle = new Bundle();\n bundle.putString(\"response\", response);\n switch (messageKind) {\n case ClientMessageKind.SIGNUPDENIED:\n case ClientMessageKind.SIGNUPOK:\n if(resultReceiverMap.keySet().contains(ActivityNames.COMMONSIGNUPACTIVITY)) {\n resultReceiverMap.get(ActivityNames.COMMONSIGNUPACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.SIGNINDENIED:\n case ClientMessageKind.SIGNINOK:\n if(resultReceiverMap.keySet().contains(ActivityNames.COMMONSIGNINACTIVITY)) {\n resultReceiverMap.get(ActivityNames.COMMONSIGNINACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERLOC:\n if(resultReceiverMap.keySet().contains(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERLOC:\n if(resultReceiverMap.keySet().contains(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.CHATFROMDRIVER:\n if(resultReceiverMap.keySet().contains(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.CHATFROMPASSENGER:\n if(resultReceiverMap.keySet().contains(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERDEST:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.STARTRIDE:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n } else if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.ENDRIDE:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERENDSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERENDSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERCANCEL:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERCANCEL:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.UPDATEPASSENGERPROFILEDENIED:\n case ClientMessageKind.UPDATEPASSENGERPROFILEOKAY:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERUPDATEPROFILEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERUPDATEPROFILEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.UPDATEDRIVERPROFILEDENIED:\n case ClientMessageKind.UPDATEDRIVERPROFILEOKAY:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERUPDATEPROFILEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERUPDATEPROFILEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERREQUESTLOC:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERREQUESTLOC:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n default:\n break;\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"public void run()\n {\n \n try {\n String Msg = \"\";\n ArrayList<String> tokens=new ArrayList<String>();\n while ((Msg = this.reader.readLine())!=null)\n {\n if(!tokens.isEmpty())\n {\n //not empty,clear.\n tokens.clear();\n\n }\n //check the msg\n System.out.println(\"Inside while, Received msg in client handler:\"+Msg);\n //all the meta datas are separated using :\n tokens.addAll(Constants.tokens(Msg, \":\"));\n //if it's a login request\n if(tokens.contains(Constants.LOGIN_ID))\n {\n this.userID=tokens.get(1);//the 2nd string of this format LOGIN_ID:username:password\n this.password=tokens.get(2);\n this.client_delegate.validate(this);\n }\n //if it's a log out request.\n if(tokens.contains(Constants.LOGOUT_ID))\n {\n this.client_delegate.logout(this);\n }\n //public room message\n if(tokens.contains(Constants.PUBLIC_ROOM))\n {\n \n if(tokens.get(1).contains(\"file\"))\n {\n //there is smiley,but the parts were separated due to the presence of an internal : after word 'file'\n this.client_delegate.sendMessage(tokens.get(1)+\":\"+tokens.get(2));\n }\n else\n {\n //the message is without smiley...\n this.client_delegate.sendMessage(tokens.get(1));\n }\n \n }\n //private message\n if(tokens.contains(Constants.MESSAGE_ID))\n {\n //private message\n if(tokens.get(2).contains(\"file\"))\n {\n //there is smiley,but the parts were separated due to the presence of an internal : after word 'file'\n this.client_delegate.sendMessageFromThisTo(tokens.get(1), tokens.get(2)+\":\"+tokens.get(3), tokens.get(4));\n }\n else\n {\n //the message is without smiley...\n this.client_delegate.sendMessageFromThisTo(tokens.get(1), tokens.get(2), tokens.get(3));\n }\n }\n if(tokens.contains(Constants.FILE))\n {\n this.client_delegate.sendFileTo(tokens.get(1), Integer.parseInt(tokens.get(2)), tokens.get(3));\n }\n \n \n\n }\n } catch (Exception ex) {\n System.out.printf(\"Error parsing message from client:%s.\",this.userID);\n }\n }",
"public void handleMessage(Message msg) {\n switch (msg.what) {\n case handlerState:\n String readMessage = (String) msg.obj; // msg.arg1 = bytes from connect thread\n ReceivedData.setData(readMessage);\n break;\n\n case handlerState1:\n tempSound = Boolean.parseBoolean((String) msg.obj);\n ReceivedData.setSound(tempSound);\n break;\n\n case handlerState5:\n if(\"ACK\".equals ((String) msg.obj ))\n ReceivedData.clearPPGwaveBuffer();\n break;\n\n }\n ReceivedData.Process();\n }",
"public void handleMessageFromClient (Object msg, ConnectionToClient client)\n {\n\t int i=0;\n\t int scanCode=0;\n\t ArrayList<Object> answer = new ArrayList<Object>();\n\t \n\t String command = (String)( ((ArrayList<Object>)msg).get(0) );\n\t \t \n\t scanCode = convertToScanCode( command );\n\t \n\t String logLine = new String (client.getName() + \" \" + command + \" \"); \n\t logger.addString(logLine);\n\t\n\t switch (scanCode)\n\t {\n\t \n\t case(001):\n\t\t {\n\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\t\tanswer = functions.login( (UserEntity) ((ArrayList<Object>)msg).get(1) );\n\t\t\t\t\t\n\t\t\t\t\t\tclient.sendToClient(answer);\n\n\t\t\t\t\t}catch (IOException e){\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t//\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t }\n\t\t \n\t case(002):\n\t\t {\n\t\t\t\n\t\n\t\t\t String userID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\t\t answer = functions.getInfo(userID);\n\t\t\t try {\n\t\t\t\tclient.sendToClient(answer);\n\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\t\t\t\tbreak;\n\t\t }\n\t\t \n\t case(003):\n\t {\n\t \tRequestEntity request= (RequestEntity) ((ArrayList<Object>)msg).get(1);\n\t \t//int fileLength= (int) ((ArrayList<Object>)msg).get(3);\n\t \tint fileLength= Integer.parseInt((((ArrayList<Object>)msg).get(3).toString()));\n\t \tbyte[] bytes= (byte[]) ((ArrayList<Object>)msg).get(2);\t\t\n\t\tanswer = functions.request( (RequestEntity) ((ArrayList<Object>)msg).get(1) );\n\t \tif(fileLength>0){\n\t \t\tfunctions.uploadFile(request, bytes, fileLength);\n\t \t}\n\t\ttry {\n\t\t\tclient.sendToClient(answer);\n\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\tbreak;\n\t }\n\t\t \n\t case(004):\n\t\t {\n\t\t\t \n\t\t \tanswer = functions.getListOfColumn(\"systeminfo\", \"Description\", \"listOfSystems\"); // General reusable method\n\t\t\t try {\n\t\t\t\tclient.sendToClient(answer);\n\t\t\t} catch (IOException e) \n\t\t\t{\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t//e.printStackTrace();\n\t\t\t}\n\t\t\t\tbreak;\n\t\t }\n\t\t\n\n\t case(007):\n\t {\n\t\t\n\t\t String userID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\t answer = functions.getRequestHistory(userID);\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t }\n\t \n\t case(8):\n\t {\n\t\t\n\t\t String requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\t answer = functions.getRequest(requestID);\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t }\n\t case(9):\n\t {\n\t\t \n\t\t\n\t\t answer = functions.getReq((String)( ((ArrayList<Object>)msg).get(1)));\n\t\t try {\n\t\t\tclient.sendToClient(answer);\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\t\t\t\tbreak;\n\t\t }\n\t case(102):\n\t {\n\t\t\n\t\t \n\t\t\n\t\t String userID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\t String currentStatus= new String((String) ((ArrayList<Object>)msg).get(2));\n\t\t \n\t\t \n\t\t answer = functions.getlistOfRequests(userID,currentStatus);\n\t\t try {\n\t\t\t \n\t\t\t \n\t\t\tclient.sendToClient(answer);\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\tbreak;\n\t }\n case(101):\n {\n\t scanCode=000;\n\t String request = new String((String) ((ArrayList<Object>)msg).get(1));\n\t String days = new String((String) ((ArrayList<Object>)msg).get(2));\n\t String newStatus= new String((String) ((ArrayList<Object>)msg).get(3));\n\t answer = functions.setTaskDuration(request,days,newStatus);\n\t try { \n\t\tclient.sendToClient(answer);\n\t} catch (IOException e) {\n\t\t// TODO Auto-generated catch block\n\t//\te.printStackTrace();\n\t}\n\t\tbreak;\n }\n\n \n case(302):\n { \n\t\t\n \tString assID = new String((String) ((ArrayList<Object>)msg).get(1));\t\n \tanswer = functions.getReviewAndDecision(assID); \n \n \t\t try {\n \t\t\tclient.sendToClient(answer);\n \t\t} catch (IOException e)\n \t\t{\n \t\t//\te.printStackTrace();\n \t\t}\n \t\t\tbreak;\n }\n \n case(303):\n { \n \tString requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n \tString discussionLog = new String((String) ((ArrayList<Object>)msg).get(2));\n \tanswer = functions.setValueByRequestID(\"reviewanddecision\", \"reviewAndDecision\", \"reqID\", requestID, discussionLog, \"discussionLogAnswer\" ); \n \t\n \t\t try {\n \t\t\tclient.sendToClient(answer);\n \t\t} catch (IOException e)\n \t\t{\n \t\t\t//e.printStackTrace();\n \t\t}\n \t\t\tbreak;\n }\n \n case(304):\n\t {\n\t\t\n\t\t String assessmentID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\t answer = functions.getAssessment(assessmentID);\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\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\tbreak;\n\t }\n \n case(200):\n {\n\t String userID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t String currentStatus= new String((String) ((ArrayList<Object>)msg).get(2));\n\t String Elid = (String) ((ArrayList<Object>)msg).get(3);\n\t String table = (String) ((ArrayList<Object>)msg).get(4);\n\t answer = functions.getlistOfExRequests(userID,currentStatus,Elid,table);\n\t try {\n\t\tclient.sendToClient(answer);\n\t} catch (IOException e) {\n\t\t//e.printStackTrace();\n\t}\n\t\tbreak;\n }\n \n case(305):\n { \n \t\n \tanswer = functions.getRequestsWithTwoValues(\"request\", \"Status\", \"Rid\", \"5\", \"6\", \"reviewableRequests\"); \n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n case(307):\n { \n\t \tString requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t \tString discussionLog = new String((String) ((ArrayList<Object>)msg).get(2));\n \tanswer = functions.insertValuesToReviewAndDecision (requestID, discussionLog ); \n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n case(308):\n { \n\t \tString requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n \tanswer = functions.convertRequestIDtoAssessmentID(requestID); \n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n case(309):\n\t {\n\t\t\n\t\t String requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\t answer = functions.getRequest(requestID);\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t }\n case(310):\n {\n\t\n\t\n\t answer = functions.getAss();\n\t try {\n\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t }\n\t \n\n case(201):\n {\n\t String code = ((String)((ArrayList<Object>)msg).get(0));\n\t String request = new String((String) ((ArrayList<Object>)msg).get(1));\n\t String det= new String((String) ((ArrayList<Object>)msg).get(2));\n\t String newStatus = (String) ((ArrayList<Object>)msg).get(4);\n\t functions.changeStatus(request, newStatus);\n\t int req = Integer.parseInt(request);\n\t answer = functions.getExeccutionEntity(code,req);\n\t if (answer.get(1).equals(\"Valid\"))\n\t {\n\t\t answer = functions.updateExecutedReq(code, request, det);\n\t }\n\t else{\n\t\t answer = functions.enterNewExecutionRecord(code, request, det, \"no\");\n\t }\n\t if(!((ArrayList<Object>)msg).get(5).equals(\"nothing\"))\n\t {\n\t\t ArrayList<Object> ex = new ArrayList<Object>();\n\t\t String code1=((String)((ArrayList<Object>)msg).get(5));\n\t\t int number = Integer.parseInt((((ArrayList<Object>)msg).get(6)).toString());\n\t\t RequestEntity en = ((RequestEntity)((ArrayList<Object>)msg).get(7));\n\t\t String status = ((String)((ArrayList<Object>)msg).get(8));\n\t\t String pid1 = ((String)((ArrayList<Object>)msg).get(9));\n\t\t ex = functions.fillInExceeded(code1,en.getRID(),en.getUid(),number,status);\n\t\t ArrayList<Object> eleader = functions.getUsers(\"getEleader\",pid1);\n\t\t if(eleader.get(1).equals(\"Valid\"))\n\t\t {\n\t\t\t EmailEntity eleMail = (EmailEntity) eleader.get(2);\n\t\t\t String mail = eleMail.getMail();\n\t\t\t SendMailSSL.SendEmail(mail, \"Ass' exceeded\", \"For your notice ! the ass number\" + request + \"have Exceeded!\" );\n\t\t\t SendMailSSL.SendEmail(\"braudeSupervisor@gmail.com\",\"Ass' exceeded\", \"For your notice ! the ass number\"+request + \"have Exceeded!\");\n\t\t\t SendMailSSL.SendEmail(\"no1984name@hotmail.com\",\"Ass' exceeded\", \"For your notice ! the ass number\" + request + \"have Exceeded!\");\n\t\t }\n\t\t \n\t\t \n\t\t answer.add(ex);\n\t }\n\t else\t// was put in order not to check out of bounds place .\n\t {\n\t\t ArrayList<Object> ex = new ArrayList<Object>();\n\t\t String code1 = \"fillInExceeded\";\n\t\t String Valid = \"notValid\";\n\t\t ex.add(code1);\n\t\t ex.add(Valid);\n\t\t answer.add(ex);\n\t }\n\t try {\n\t\tclient.sendToClient(answer);\n\t} catch (IOException e) {\n\t\t// TODO Auto-generated catch block\n\t\t//e.printStackTrace();\n\t}\n\t\tbreak; \n }\n \n case(900):\n { \n\t \tExtendEntity deadlineRequest = ((ExtendEntity) ((ArrayList<Object>)msg).get(1));\n \tanswer = functions.extendDeadlineRequest(deadlineRequest); \n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n\t \n case(901):\n { \n\t \t\n \tanswer.add(\"extentionRequestWasSent\");\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n case(902):\n { \n\t String requestID = ((String)((ArrayList<Object>)msg).get(1));\n\t \tanswer = functions.changeStatus(requestID,\"62\");\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n\r\n case(903):\n { \n\t String requestID = ((String)((ArrayList<Object>)msg).get(1));\n\t \tanswer = functions.changeStatus(requestID,\"7\");\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n case(904):\n { \n\t String requestID = ((String)((ArrayList<Object>)msg).get(1));\n\t String additionalInformation = ((String)((ArrayList<Object>)msg).get(2));\n\t \n\t \tanswer = functions.requireAdditionalInformation(requestID,additionalInformation);\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n\r\n case(800):\n {\n\r\n\t\n\t String userID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t answer = functions.getUser(userID);\n\t try {\n\t\tclient.sendToClient(answer);\n\n\t} catch (IOException e) {\n\t\t// TODO Auto-generated catch block\n\t\t//e.printStackTrace();\n\t}\n\t\tbreak;\n }\n case(801):\n {\n\t\n\t String reqID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t String ID = new String((String) ((ArrayList<Object>)msg).get(2));\n\t String identity =new String((String) ((ArrayList<Object>)msg).get(3));\n\t String status =new String((String) ((ArrayList<Object>)msg).get(4));\n\t \n\t answer = functions.Pair(reqID,ID,identity,status);\n\t try {\n\t\tclient.sendToClient(answer);\n\n\t} catch (IOException e) {\n\t\t// TODO Auto-generated catch block\n\t\t//e.printStackTrace();\n\t}\n\t\tbreak;\n }\n case(802):\n {\n\t \n\t\n\t answer = functions.getExe();\n\t try {\n\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t }\n\t\n case(103):\n {\n\t \n\t AssessmentEntity assessmentEntity=((AssessmentEntity) ((ArrayList<Object>)msg).get(1));\n\t String newStatus= new String((String) ((ArrayList<Object>)msg).get(2));\n\t String requestID= assessmentEntity.getRid();\n\t String userID = functions.requestToUserID(requestID);\n\t String email;\n\t \n\t ArrayList<Object> requestArray = functions.getRequest(requestID);\n\t RequestEntity request = (RequestEntity)(requestArray.get(1));\n\t if (CommonMethods.exceededDeadline(request.getDeadline()))\n\t {\n\t\t functions.fillInExceeded(\"fillInExceeded\", Integer.parseInt(requestID), request.getUid(),CommonMethods.getExceededTime(request.getDeadline()), request.getStatusid());\n\t\t if (!userID.equalsIgnoreCase(\"none\"))\n\t\t {\n\t\t\t ArrayList<Object> user = functions.getInfo(userID);\n\t\t\t email = (String)user.get(3);\n\t\t\tSendMailSSL.SendEmail(email, \"Deadline exceeded!\", \"You have exceeded the deadline for request \" + requestID);\n\t\t }\n\t\t\n\t\t\n\t }\n\t \n\t \n\t answer = functions.setAssessment(assessmentEntity, newStatus);\n\t try {\n\t\t \n\t\t client.sendToClient(answer);\n\t\t \n\t } catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t//\te.printStackTrace();\n\t }\n\t break;\n }\n\n case(202):\n { \n\t \tArrayList<Object> extra = new ArrayList<Object>();\n\t \tString code = new String((String) ((ArrayList<Object>)msg).get(0));\n \t\tString requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\tanswer = functions.getRequest(requestID);\n \tint request = Integer.parseInt(requestID);\n \textra = functions.getExeccutionEntity(code,request);\n \tanswer.add(extra);\n \ttry {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n case(905):\n { \n\t String status = new String((String) ((ArrayList<Object>)msg).get(1));\n\t \tanswer = functions.getListsForAssignment(status);\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n case(906):\n { \n\t String userSkill = new String((String) ((ArrayList<Object>)msg).get(1));\n\t \tanswer = functions.getListOfUsers(userSkill);\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n case(803):\n {\n\t\n\t String reqID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t String status = new String((String) ((ArrayList<Object>)msg).get(2));\n\t answer = functions.approveEXDu(reqID, status);\n\t try {\n\t\tclient.sendToClient(answer);\n\n\t} catch (IOException e) {\n\t\t// TODO Auto-generated catch block\n\t\t//e.printStackTrace();\n\t}\n\t\tbreak;\n }\n case(804):\n {\n\t\n\t String reqID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\t\n\n\t answer = functions.getDu(reqID);\n\t try {\n\t\tclient.sendToClient(answer);\n\n\t} catch (IOException e) {\n\t\t// TODO Auto-generated catch block\n\t\t//e.printStackTrace();\n\t}\n\t\tbreak;\n }\n \n case(907):\n { \n\t String inspectorID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t String requestID = new String((String) ((ArrayList<Object>)msg).get(2));\n\t \tanswer = functions.setInspectorToRequest(requestID, inspectorID);\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n case(805):\n { \n\t\t\n\n\t String reqID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t //int newDuration=(int)((ArrayList<Object>) msg).get(2);\n\t int newDuration= Integer.parseInt((((ArrayList<Object>) msg).get(2)).toString());\n\t\t\n\t \tanswer = functions.setNewDuration(reqID,newDuration);\n\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n case(205):\n {\n\t String code = ((String)((ArrayList<Object>)msg).get(0));\n\t String request = new String((String) ((ArrayList<Object>)msg).get(1));\n\t String det= new String((String) ((ArrayList<Object>)msg).get(2));\n\t String bool = new String((String) ((ArrayList<Object>)msg).get(3));\n\t answer = functions.enterNewExecutionRecord(code,request,det,bool);\n\t try {\n\t\t\tclient.sendToClient(answer);\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\tbreak; \n }\n case(204):\n {\n\t String code = ((String)((ArrayList<Object>)msg).get(0));\n\t String request = new String((String) ((ArrayList<Object>)msg).get(1));\n\t String det= new String((String) ((ArrayList<Object>)msg).get(2));\n\t answer = functions.updateExecutedReq(code,request,det);\n\t try {\n\t\tclient.sendToClient(answer);\n\t} catch (IOException e) {\n\t//\te.printStackTrace();\n\t}\n\t\tbreak; \n }\n \n case(203):\n { \n\t \tArrayList<Object> extra = new ArrayList<Object>();\n \tString code = ((String) ((ArrayList<Object>)msg).get(0));\n \tString requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n \tint request = Integer.parseInt(requestID);\n \textra = functions.getExeccutionEntity(code,request);\n \ttry {\n\t\t\tclient.sendToClient(extra);\n\t\t} catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n } \n\ncase(908):\n{ \n\t\tString inspectorID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t \tanswer = functions.getRequestsWithTwoValues(\"request\", \"Status\", \"Rid\", \"12\", \"5555\", \"listOfInspectionableRequests\");\n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n}\n\n\n\ncase(909):\n{ \n\t\tString requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t \tanswer = functions.getExeccutionEntity(\"executionEntity\",Integer.parseInt(requestID));\n\r\n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n}\n\ncase(910):\n{ \n\t\tString requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t \tanswer = functions.getInspection(requestID);\n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n}\n\ncase(911):\n{ \n\t\n\t\tInspectionEntity inspection = ((InspectionEntity) ((ArrayList<Object>)msg).get(1));\n\t\tArrayList<Object> ans1 = new ArrayList<Object>();\n\t\tString action = ((String)((ArrayList<Object>)msg).get(2));\n\t\tanswer = functions.setInspection(inspection, action);\n\t \n\t\tif (action.equalsIgnoreCase(\"approve\") && ((String)answer.get(1)).equalsIgnoreCase(\"Valid\") )\n\t \t{\n\t \t\tans1=functions.changeStatus(inspection.getRequestID(), \"121\");\n\t \t}\n\t \telse\n\t \tif (action.equalsIgnoreCase(\"deny\") && ((String)answer.get(1)).equalsIgnoreCase(\"Valid\") )\n\t\t{\n\t\t \tans1=functions.changeStatus(inspection.getRequestID(), \"122\");\n\t\t}\t\n\t \telse\n\t \t{\n\t\t\tans1.add(\"somthing\");\n\t\t\tans1.add(\"StatusNotSet\");\n\t\t}\t\n\t\tanswer.add(ans1.get(1).toString());\n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n} \ncase(806):\n{ \n\t\n\t \tanswer = functions.getExtend();\n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n}\n\ncase(500):\n{ \n\t\t\n\t\tanswer = functions.initializeMangeEmployees();\n\t\t\n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n} \ncase(807):\n{ \n\t\tString reqID = new String( (String)((ArrayList<Object>)msg).get(1));\n\t \tanswer = functions.getExtendInfo(reqID);\n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n}\n\ncase(501):\n{ \n\t\tUserEntity oldChairman = ((UserEntity) ((ArrayList<Object>)msg).get(1));\n\t\tUserEntity newChairman = ((UserEntity) ((ArrayList<Object>)msg).get(2));\n\t\tanswer = functions.switchChairman(oldChairman, newChairman);\n\t \n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n} \ncase(104):\n{\n\t \n\t AssessmentEntity assessmentEntity=((AssessmentEntity) ((ArrayList<Object>)msg).get(1));\n\t answer = functions.newAssessmentRow(assessmentEntity);\n\t try {\n\t\t \n\t\t client.sendToClient(answer);\n\t\t \n\t } catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t }\n\t break;\n}\ncase(808):\n{ \n\t\tString code = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\tString extID = new String((String) ((ArrayList<Object>)msg).get(2));\n\t \tanswer = functions.approvDenyExt(code,extID);\n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t//\t\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n}\n\ncase(502):\n{ \n\t\tUserEntity oldCommitteeMember = ((UserEntity) ((ArrayList<Object>)msg).get(1));\n\t\tUserEntity newCommitteeMember = ((UserEntity) ((ArrayList<Object>)msg).get(2));\n\t\tanswer = functions.switchCommitteeMembers(oldCommitteeMember, newCommitteeMember);\n\t \n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n} \n\ncase(206):\n{\n\t\n\tString code = ((String) ((ArrayList<Object>)msg).get(0));\n\tString pid = ((String) ((ArrayList<Object>)msg).get(1));\n\tString oldStatus =((String) ((ArrayList<Object>)msg).get(2));\n\tanswer = functions.getDeniedExecutions(code,pid,oldStatus);\n\ttry {\n\t\tclient.sendToClient(answer);\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t\t\n\t}\n\tbreak;\n}\n\ncase(207):\n{\n\tArrayList<Object> extra = new ArrayList<Object>();\n\tString code = ((String) ((ArrayList<Object>)msg).get(0));\n\tString rid = ((String) ((ArrayList<Object>)msg).get(1));\n\tString newStatus =((String) ((ArrayList<Object>)msg).get(2));\n\tanswer = functions.changeStatus(rid,newStatus);\n\textra = functions.DelExeReq(rid);\n\ttry{\n\t\tclient.sendToClient(extra);\n\t}\n\tcatch(Exception e)\n\t{\n\t\te.getCause();\n\t\t\n\t}\n\tbreak;\n}\n\ncase(503):\n{ \n\t\tUserEntity currentUser = ((UserEntity) ((ArrayList<Object>)msg).get(1));\n\t\tanswer = functions.setUserAccess(currentUser);\n\t \n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n}\ncase(105):\n{\n\tanswer = functions.changeStatus();\n\ttry\n\t{\n\t\tclient.sendToClient(answer);\n\t}\n\tcatch (IOException e)\n\t{\n\t//\te.printStackTrace();\n\t}\n\tbreak;\n}\ncase(809):\n{\n\tString reqID = ((String) ((ArrayList<Object>)msg).get(1));\n\tString currentS = ((String) ((ArrayList<Object>)msg).get(2));\n\tString change = ((String) ((ArrayList<Object>)msg).get(3));\n\tString explanation =((String) ((ArrayList<Object>)msg).get(4));\n\tString supervisorID = ((String) ((ArrayList<Object>)msg).get(5));\n\tanswer = functions.updateFields(reqID,currentS,change,explanation,supervisorID);\n\ttry {\n\t\tclient.sendToClient(answer);\n\t\t\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t\t}\n\tbreak;\n}\ncase(810):\n{\n\tString status1 = ((String) ((ArrayList<Object>)msg).get(1));\n\tString status2 = ((String) ((ArrayList<Object>)msg).get(2));\n\tanswer = functions.completeReq(status1,status2);\n\ttry {\n\t\tclient.sendToClient(answer);\n\t\t\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t\t}\n\tbreak;\n}\n\n\n\ncase(504):\n{ \n\t\tString userID = ((String) ((ArrayList<Object>)msg).get(1));\n\t\tfunctions.logOff(userID);\n\t\t\n\t\n\t\t\tbreak;\n}\n\n\n\n\n\ncase(811):\n{\n\tString reqID = ((String) ((ArrayList<Object>)msg).get(1));\n\tString status = ((String) ((ArrayList<Object>)msg).get(2));\n\tanswer = functions.changeStatus(reqID,status);\n\ttry {\n\t\tclient.sendToClient(answer);\n\t\t\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t\t}\n\tbreak;\n}\ncase(106):\n{\n\tString reqID = ((String) ((ArrayList<Object>)msg).get(1));\n\tanswer = functions.getFile(reqID);\n\n\ttry{\n\t\tclient.sendToClient(answer);\n\t}\n\tcatch(IOException e)\n\t{\n\t\t//e.printStackTrace();\n\t}\n\tbreak;\n}\n\n\ncase(812):\n{\n\tString exeID = ((String) ((ArrayList<Object>)msg).get(1));\n\t\n\tanswer = functions.getExecute(exeID);\n\ttry {\n\t\tclient.sendToClient(answer);\n\t\t\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t\t}\n\tbreak;\n}\ncase(813):\n{\n\tString rID = ((String) ((ArrayList<Object>)msg).get(1));\n\t\n\tanswer = functions.ridToAid(rID);\n\ttry {\n\t\tclient.sendToClient(answer);\n\t\t\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t\t}\n\tbreak;\n}\n\ncase(912):\n{\n\t \n\tanswer = functions.getListOfColumn(\"request\", \"Rid\", \"getListOfAllRequests\"); // General reusable method\n\t try {\n\t\tclient.sendToClient(answer);\n\t} catch (IOException e) \n\t{\n\t\t// TODO Auto-generated catch block\n\t//\te.printStackTrace();\n\t}\n\t\tbreak;\n}\ncase(913):\n{\n\t \n\tanswer = functions.getListOfColumn(\"assessment\", \"Assid\", \"getListOfAllAssessments\"); // General reusable method\n\t try {\n\t\tclient.sendToClient(answer);\n\t} catch (IOException e) \n\t{\n\t\t// TODO Auto-generated catch block\n\t\t//e.printStackTrace();\n\t}\n\t\tbreak;\n}\n\n\ncase(914):\n{\n\t \n\tanswer = functions.getListOfColumn(\"assessment\", \"Assid\", \"getListOfAllExecutions\"); // General reusable method\n\t try {\n\t\tclient.sendToClient(answer);\n\t} catch (IOException e) \n\t{\n\t\t// TODO Auto-generated catch block\n\t//\te.printStackTrace();\n\t}\n\t\tbreak;\n}\n\n\ncase(915):\n{\n\tint numberofdays;\n\tString days;\n\tString requestID = ((String) ((ArrayList<Object>)msg).get(1));\n\tArrayList<Object> request = functions.getRequest(requestID);\n\t\n\tRequestEntity myrequest = ((RequestEntity) ((ArrayList<Object>)request).get(1));\n\t\t\n\tnumberofdays = functions.getexceedTime(requestID);\n\tnumberofdays = numberofdays + CommonMethods.numberOfDays(myrequest.getDate(), myrequest.getDeadline());\n\tdays= Integer.toString(numberofdays);\n\t\n\tanswer = functions.changeStatus(requestID , \"999\");\n\tfunctions.setTaskDuration(requestID, days, \"999\");\n\t try {\n\t\tclient.sendToClient(answer);\n\t} catch (IOException e) \n\t{\n\t\t// TODO Auto-generated catch block\n\t\t//e.printStackTrace();\n\t}\n\t\tbreak;\n}\n\ncase(814):\n{\n \n answer = functions.getAllReq();\n try {\n client.sendToClient(answer);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n break;\n }\ncase(815):\n{\n String rID = ((String) ((ArrayList<Object>)msg).get(1));\n String reason= ((String) ((ArrayList<Object>)msg).get(2));\n answer = functions.suspend(rID, reason);\n try {\n client.sendToClient(answer);\n \n }\n catch (Exception e)\n {\n e.getCause();\n }\n break;\n}\ncase(816):\n{\n String rID = ((String) ((ArrayList<Object>)msg).get(1));\n answer = functions.resume(rID);\n try {\n client.sendToClient(answer);\n \n }\n catch (Exception e)\n {\n e.getCause();\n }\n break;\n}\ncase(817):\n{\n String rID = ((String) ((ArrayList<Object>)msg).get(1));\n answer = functions.susInfo(rID);\n try {\n client.sendToClient(answer);\n \n }\n catch (Exception e)\n {\n e.getCause();\n }\n break;\n}\ncase(107):\n{\n\tString from = ((String) ((ArrayList<Object>)msg).get(1));\n\tString to = ((String) ((ArrayList<Object>)msg).get(2));\n\tanswer = functions.activityReport(from, to);\n\tSystem.out.println(\"after answer sent to user\");\n\ttry {\n\t\tclient.sendToClient(answer);\t\t\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t}\n\tbreak;\n}\ncase(108):\n{\n\tString date = ((String) ((ArrayList<Object>)msg).get(1));\n\tbyte[] bytes = ((byte[]) ((ArrayList<Object>)msg).get(2));\n\tint fileLength=((int) ((ArrayList<Object>)msg).get(3));\n\tanswer = functions.saveReport(date, bytes, fileLength);\n\ttry {\n\t\tclient.sendToClient(answer);\t\t\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t}\n\tbreak;\n}\ncase(109):\n{\n\tString date = ((String) ((ArrayList<Object>)msg).get(1));\n\tanswer = functions.getReport(date);\n\ttry {\n\t\tclient.sendToClient(answer);\t\t\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t}\n\tbreak;\n}\n\n }\n}",
"public void run() {\r\n\t\ttry {\r\n\t\t\toutput = clientSocket.getOutputStream();\r\n\t\t\tinput = clientSocket.getInputStream();\r\n\t\t// send initial message on connect\r\n\t\t\tsendMessage(new common.messages.KVAdminMessage(\"connect\", \"CONNECT_SUCCESS\", \"\", \"\")); \r\n\r\n\t\t\r\n\t\t\twhile(isOpen) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\t// Receive the KV Message from Client and check if it is valid\r\n\t\t\t\t\tcommon.messages.KVMessage latestMsg = receiveMessage();\r\n\t\t\t\t\tif (latestMsg.validityCheck() == null) {\r\n\t\t\t\t\t\t// If it is valid Handle the message by calling the function in KVServer\r\n\t\t\t\t\t\tcommon.messages.KVMessage returnMsg = m_server.handleClientMessage(latestMsg);\r\n\t\t\t\t\t\tif (returnMsg.validityCheck() == null) {\r\n\t\t\t\t\t\t\t// If returned KVMessage was valid send it back to the client\r\n\t\t\t\t\t\t\tif (returnMsg.getStatus().equals(\"SERVER_STOPPED\") || returnMsg.getStatus().equals(\"SERVER_WRITE_LOCK\") || returnMsg.getStatus().equals(\"SERVER_NOT_RESPONSIBLE\")){\r\n\t\t\t\t\t\t\t\tSystem.out.println(\"Last command from client \" + latestMsg.getHeader() + \" was not processed by Server.\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tSystem.out.println(\"Last command from client \" + latestMsg.getHeader() + \" was Successfully Processed by Server!\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tsendMessage(returnMsg);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// If returned KVMessage is not valid it will have all blank fields\r\n\t\t\t\t\t\t\tSystem.out.println(\"Last command from client \" + latestMsg + \" encountered a problem on Server side!\");\r\n\t\t\t\t\t\t\tsendMessage(returnMsg);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} \r\n\t\t\t\t\telse if (latestMsg.getHeader().trim().equals(\"\")) {\r\n\t\t\t\t\t\t//echo empty messages\r\n\t\t\t\t\t\tsendMessage(latestMsg);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t// If it is a bad message output error and echo it back to the client\r\n\t\t\t\t\t\tlogger.debug(\"Message from Client was not valid, sending errorous message back to client\");\r\n\t\t\t\t\t\tlogger.debug(latestMsg.getError());\r\n\t\t\t\t\t\tsendMessage(new common.messages.KVAdminMessage(latestMsg.getHeader(), \"FAILED\", latestMsg.getKey(), latestMsg.getValue()));\r\n\t\t\t\t\t}\r\n\t\t\t\t/* connection either terminated by the client or lost due to \r\n\t\t\t\t * network problems*/\t\r\n\t\t\t\t} catch (IOException ioe) {\r\n\t\t\t\t\tlogger.error(\"Connection lost!\");\r\n\t\t\t\t\tisOpen = false;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch (IOException ioe) {\r\n\t\t\tlogger.error(\"Error! Connection could not be established!\", ioe);\r\n\t\t\t\r\n\t\t} finally {\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tif (clientSocket != null) {\r\n\t\t\t\t\tinput.close();\r\n\t\t\t\t\toutput.close();\r\n\t\t\t\t\tclientSocket.close();\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException ioe) {\r\n\t\t\t\tlogger.error(\"Error! Unable to tear down connection!\", ioe);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void messageHandler(String read){\n\n try {\n buffer.append(read);\n }catch (MalformedMessageException e){\n System.out.println(\"[CLIENT] The message received is not in XML format.\");\n }\n\n while(!buffer.isEmpty()) {\n if (buffer.getPong()) pong = true;\n else if (buffer.getPing()) send(\"<pong/>\");\n else {\n try {\n clientController.onReceivedMessage(buffer.get());\n } catch (EmptyBufferException e) {\n System.out.println(\"[CLIENT] The buffer is empty!\");\n }\n }\n }\n\n }",
"public void run() {\n\t\ttry {\n\t\t\tout = new PrintWriter(client.getOutputStream(), true);\n\t\t\tin = new BufferedReader(new InputStreamReader(client.getInputStream()));\n\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\ts.getMessage(this, inputLine);\n\t\t\t\tSystem.out.println(inputLine);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Couldn't get I/O for the connection to host\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t}",
"public void readMessages() {\n if (!this.isConnectedToClientServer){return;}\n String inputMessage = inputQueue.poll();\n if (inputMessage != null){\n try{\n ClientMessageType messageType = ClientMessageParser.parse(inputMessage);\n if (messageType == ClientMessageType.INCOMING_BALL){\n //parses the message to get a ball, which is then added to the board\n Ball ball = ClientMessageParser.parseIncomingBall(inputMessage);\n board.addBall(ball);\n }\n else if (messageType == ClientMessageType.WALL_INVISIBILITY){\n //parses the messages to find out which boundary to make invisible, and does so\n BoundarySide whichBoundary = ClientMessageParser.parseWallInvisibility(inputMessage, board.neighbors);\n board.makeInvisible(whichBoundary);\n }\n else if (messageType == ClientMessageType.WALL_VISIBILITY){\n //parses the messages to find out which boundary to make visible, and does so\n BoundarySide whichBoundary = ClientMessageParser.parseWallVisibility(inputMessage, board.neighbors);\n board.makeVisible(whichBoundary);\n }\n else if (messageType == ClientMessageType.DISCONNECT_CLIENT){\n disconnectFromClientAndServer();\n }\n } catch (IncorrectFormatException e){\n //don't do anything --> message is not parsed, but play on this board still continues\n }\n }\n }",
"@Override\n public void run() {\n handleClientRequest();\n }",
"abstract public Object handleMessage(Object message) throws Exception;",
"@Override\n public void react(@NotNull ClientConnection client) throws IOException {\n String[] params = message.getHeader().split(\" \");\n if( params.length != getMessagesSize || client.getClientID() == null )\n return ;\n int roomID = Integer.parseInt(params[1]);\n List<String> messages = UserRequests.getMessagesFromRoom(roomID, nMessage);\n if (messages == null) return;\n assert client.getStreamMessage() != null;\n client.getStreamMessage().write(\n new Message(getMessagesType + \" \" + roomID, messages));\n }",
"protected void processMessagesOnConnection() {\n try {\n logger.info(\"Connected to \" + getConnectionName());\n state.set(StreamState.CONNECTED);\n notifyConnection();\n inputBuffer.flip();\n\n while (!Thread.currentThread().isInterrupted() && isConnected()) {\n try {\n // Find the start of message\n byte byStart = 0;\n while(byStart != START_OF_MSG && !Thread.currentThread().isInterrupted() && isConnected()) {\n byStart = nextByte(inputBuffer);\n }\n\n // and then make sure there are enough bytes and read the protocol\n readCompleteMessage(inputBuffer);\n if(inputBuffer.get() != protocol.getKeyIdentifier()) throw new TcProtocolException(\"Bad protocol\");\n\n logByteBuffer(\"Line read from stream\", inputBuffer);\n\n // now we take a shallow buffer copy and process the message\n MenuCommand mc = protocol.fromChannel(inputBuffer);\n logger.info(\"Command received: \" + mc);\n notifyListeners(mc);\n }\n catch(TcProtocolException ex) {\n // a protocol problem shouldn't drop the connection\n logger.warn(\"Probable Bad message reason='{}' Remote={} \", ex.getMessage(), getConnectionName());\n }\n }\n logger.info(\"Disconnected from \" + getConnectionName());\n } catch (Exception e) {\n logger.error(\"Problem with connectivity on \" + getConnectionName(), e);\n }\n finally {\n close();\n }\n }",
"public abstract void msgHandler(Message msg);",
"public abstract void handleClientSide(T message, EntityPlayer player);",
"@Override\n public void onReceive(Object msg) throws Exception {\n }",
"@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}",
"private void handleServerMessage() throws IOException {\n System.out.println(\"Handeling message for \" + id + \" with type: \" + sm.getType().toString());\n switch (sm.getType()) {\n case REGISTER:\n registrationLoginHandler.register(sm, output);\n break;\n case LOGIN:\n this.user = registrationLoginHandler.login(sm, output);\n break;\n case BOOT:\n bootHandler.boot(user, output);\n break;\n case ADD_CONTACT:\n contactHandler.addContact(sm, user, output);\n handleAddContact();\n break;\n case REMOVE_CONTACT:\n break;\n case UPDATE_NICKNAME:\n break;\n case UPDATE_STATUS:\n break;\n case UPDATE_PROFILE_PIC:\n break;\n case CLIENT_DISCONNECT:\n keepGoing = false;\n close();\n server.remove(id);\n break;\n }\n }",
"@Override\n public void onReceive(Object message) throws Exception {\n }",
"public void handleMessageFromClient\n (Object msg, ConnectionToClient client)\n \t{\n\t System.out.println(\"Message received: \" + msg + \" from \" + client);\n\t try {\n\t \tObject rs = dbConnector.accessToDB(msg);\n\t \tif(rs != null)\t\n\t \t\tclient.sendToClient(rs);\n\t \t}\n\t\tcatch (ClassCastException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t catch (IOException q)\n\t {\n\t \t\n\t }\n\t }",
"@Override\n public void handle() throws RetriableException, UnRetriableException {\n Observable<Client> permissionObservable = checkPermission(getMessage().getSessionId(),\n getMessage().getAuthKey(), AuthorityRole.CONNECT);\n permissionObservable.subscribe(\n\n (client) -> {\n\n\n /**\n * MUST respond to a PUBREL packet by sending a PUBCOMP packet containing the same Packet Identifier as the PUBREL.\n * After it has sent a PUBCOMP, the receiver MUST treat any subsequent PUBLISH packet that contains that Packet Identifier as being a new publication.\n */\n\n\n Observable<PublishMessage> messageObservable = getDatastore().getMessage(\n client.getPartition(), client.getClientId(), getMessage().getMessageId(), true);\n\n messageObservable.subscribe(publishMessage -> {\n\n publishMessage.setReleased(true);\n Observable<Long> messageIdObservable = getDatastore().saveMessage(publishMessage);\n\n messageIdObservable.subscribe(messageId -> {\n try {\n\n client.internalPublishMessage(getMessenger(), publishMessage);\n\n //Initiate a publish complete.\n CompleteMessage destroyMessage = CompleteMessage.from(publishMessage.getMessageId());\n destroyMessage.copyBase(publishMessage);\n pushToServer(destroyMessage);\n\n\n //Destroy message.\n getDatastore().removeMessage(publishMessage);\n\n } catch (RetriableException e) {\n log.error(\" releaseInboundMessage : encountered a problem while publishing.\", e);\n }\n });\n });\n }, this::disconnectDueToError);\n }",
"@Override\r\n\tpublic void handleRequest(){\r\n\r\n\t\ttry {\r\n\t\t\t_inFromClient = new ObjectInputStream(_socket.getInputStream());\r\n\t\t\t_outToClient = new ObjectOutputStream(_socket.getOutputStream());\r\n\t\t _humanQuery = (String) _inFromClient.readObject();\r\n\t\t _outToClient.writeObject(manageCommunication());\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} \r\n\t}",
"private void HandleMessage(Message message)\n\t{\n\t\tswitch (message.messageType) {\n\t\tcase disconnect: ApplicationManager.Instance().Disconnect();\n\t\t\tbreak;\n\t\tcase log: PrintLogMessageOnTextChat((String)message.message);\n\t\t\tbreak;\n\t\tcase message: PrintMessageOnTextChat((MessageWithTime)message.message);\n\t\t\tbreak;\n\t\tcase UserJoinChannel: UserJoinChannel((ClientData)message.message);\n\t\t\tbreak;\n\t\tcase UserDisconnectChannel: UserDisconnectChannel((ClientData)message.message);\n\t\t\tbreak;\n\t\tcase changeChannel: OnChannelChanged((ChannelData)message.message);\n\t\t\tbreak;\n\t\tcase serverData: data = (ServerData) message.message; \n\t\t\t\t\t\t ApplicationManager.channelsList.DrawChannels(data);\n\t\t\t\tbreak;\n\t\tcase channelInfo: clientsData = (ClientsOnChannelData)message.message;\n\t\t\t\t\t\t ApplicationManager.informationsList.ShowInfo(clientsData);\n\t\t \t\tbreak;\n\t\tcase sendMessageToUser: ApplicationManager.textChat.write((MessageToUser)message.message);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}",
"void handleMessage(byte messageType, Object message);",
"@Override\n\t\tpublic void handleMessage(final Message msg) {\n\t\t\tswitch (msg.what) {\n\t\t\tcase 0:\n\t\t\t\ttry {\n\t\t\t\t\tHttpDataCallBackEntity entity = (HttpDataCallBackEntity) msg.obj;\n\t\t\t\t\tentity.HttpSuccessCallBack();\n\t\t\t\t} catch (Exception e) {\n\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\ttry {\n\t\t\t\t\tHttpDataCallBackEntity entity = (HttpDataCallBackEntity) msg.obj;\n\t\t\t\t\tentity.HttpFailCallBack();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO: handle exception\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Looper.loop();\n\t\t}",
"public void run() {\r\n String request = \"\";\r\n\r\n try {\r\n /**\r\n * The ClientConnectionHandler constantly waits for requests from the client. Requests are the initial message\r\n * that the client sends. This initial message determines how the server receives the messages that come after\r\n * it (if there are any).\r\n */\r\n while (isOpen) {\r\n request = readMessage();\r\n processRequest(request);\r\n }\r\n clientSocket.close();\r\n System.out.println(\"Client #\" + clientNumber + \" has closed\");\r\n } catch (Exception e) {}\r\n }",
"@Override\n public void run() {\n\n startPingTimer();\n String read = \"\";\n\n try {\n while ((read = in.readLine()) != null){\n\n //System.out.println(\"[CLIENT] Received: \" + read);\n messageHandler(read);\n\n }\n closeConnection();\n\n }catch (IOException e){\n\n System.out.println(\"[CLIENT] \" + e.getMessage());\n System.out.println(\"[CLIENT] Connection closed.\");\n\n }\n\n }",
"@Override\n\tprotected void channelRead0(ChannelHandlerContext ctx, WsClientMessage msg) throws Exception {\n\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}",
"public void receive()\n {\n //Client receives a message: it finds out which type of message is and so it behaves differently\n //CHAT message: prints the message in the area\n //CONNECT message: client can't receive a connect message from the server once it's connected properly\n //DISCONNECT message: client can't receive a disconnect message from the server\n //USER_LIST message: it shows the list of connected users\n try\n {\n String json = inputStream.readLine();\n\n switch (gson.fromJson(json, Message.class).getType())\n {\n case Message.CHAT:\n ChatMessage cmsg = gson.fromJson(json, ChatMessage.class);\n\n if(cmsg.getReceiverClient() == null)\n ChatGUI.getInstance().getChatHistory().append(cmsg.getSenderClient() + \" (TO ALL): \" + cmsg.getText() + \"\\n\");\n else\n ChatGUI.getInstance().getChatHistory().append(cmsg.getSenderClient() + \" (TO YOU): \" + cmsg.getText() + \"\\n\");\n break;\n case Message.CONNECT:\n //Send login nickname and wait for permission to join\n //if message code is 1, nickname is a duplicate and must be changed, then login again\n //(send call is inside button event)\n ConnectMessage comsg = gson.fromJson(json, ConnectMessage.class);\n\n if(comsg.getCode() == 1)\n {\n //Show error\n ChatGUI.getInstance().getLoginErrorLabel().setVisible(true);\n }\n else\n {\n //Save nickname\n nickname = ChatGUI.getInstance().getLoginField().getText();\n\n //Hide this panel and show main panel\n ChatGUI.getInstance().getLoginPanel().setVisible(false);\n ChatGUI.getInstance().getMainPanel().setVisible(true);\n }\n break;\n case Message.USER_LIST:\n UserListMessage umsg2 = gson.fromJson(json, UserListMessage.class);\n fillUserList(umsg2);\n break;\n }\n } \n catch (JsonSyntaxException | IOException e)\n {\n System.out.println(e.getMessage());\n System.exit(1);\n }\n }",
"@Override\n public void handleMessage(Message msg) {\n Bundle data = msg.getData();\n if (data.containsKey(\"command\")) {\n if (data.getString(\"command\").equalsIgnoreCase(\"get_data\")) {\n mGetDataMessenger = msg.replyTo;\n getData();\n }\n }\n }",
"@Override\n\tpublic void run()\n\t{\n\t\tif(socket != null && !socket.isClosed() && socket.isConnected())\n\t\t{\n\t\t\tSendMessage(ApplicationManager.Instance().GetName(), MessageType.clientData);\n\t\t\tApplicationManager.textChat.writeGreen(\"Connected to \" + connectionInfo.ServerAdress);\n\t\t\t\n\t\t\ttry \n\t\t\t{\n\t\t\t\twhile (IsConnected) \n\t\t {\n\t\t Message message = (Message) in.readObject();\n\t\t\t\t\t\n\t\t if(!IsConnected)\n\t\t \tbreak;\n\t\t \t\n\t\t if(message == null)\n\t\t {\n\t\t \tIsConnected = false;\n\t\t \tbreak;\n\t\t }\n\t\t \n\t\t HandleMessage(message); \n\t\t }\n\t\t\t \n\t\t\t} \n\t\t\tcatch (SocketException | EOFException e) {\n\t\t\t\tif(IsConnected)\n\t\t\t\tApplicationManager.textChat.writeGreen(\"Server go down!\");\n\t\t\t}\n\t\t\tcatch (IOException | ClassNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tApplicationManager.Instance().Disconnect();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tApplicationManager.textChat.writeGreen(\"Cannot connect!\");\n\t\t\tApplicationManager.Instance().Disconnect();\n\n\t\t}\n\t}",
"@Override\n\tpublic void msgReceived(Message msg) {\n\n\t}",
"@Override\n public void onMessageReceived(RemoteMessage remoteMessage) {\n }",
"public EchoClientHandler() {\n firstMessage = Unpooled.buffer(EchoClient.SIZE);\n for (int i = 0; i < firstMessage.capacity(); i ++) {\n firstMessage.writeByte((byte) i);\n }\n }",
"@Override\n public void run() {\n Message message = mHandler.obtainMessage(1);\n mHandler.sendMessage(message);\n }",
"@Override\n public void run() {\n FILEPREFIX = \".//files\"+serverID + \"//\";\n ClientMessage = (Message) socketRead();\n ServerMessage = getReturnMessage(ClientMessage);\n //System.out.println(\"client\"+ClientMessage.getFrom()+\"message : \"+ClientMessage.getContent());\n File file = new File(FILEPREFIX + ClientMessage.getFileName());\n switch (ClientMessage.getType()){\n case \"enquiry\"://return the list of file\n ServerMessage.setContent(ListAllFile());\n break;\n case \"read\"://read the last line\n System.out.println(ClientMessage.getFrom() + \": Reading...\");\n ServerMessage.setContent(\"Reading: \"+ReadLastLine(file));\n System.out.println(\"Reading \"+ClientMessage.getContent());\n break;\n case \"write\"://write to the end of file\n System.out.println(ClientMessage.getFrom() + \": writing...\");\n try{\n WriteLastLine(file,ClientMessage.getContent());\n }catch (IOException e) {\n System.out.println(\"write error\");\n }\n\n ServerMessage.setContent(\"writing: \"+ReadLastLine(file));\n System.out.println(\"Writing \"+ClientMessage.getContent());\n break;\n default://unknown command\n System.out.println(ClientMessage.getType());\n ServerMessage.setContent(\"Error\");\n System.out.println(ClientMessage.getFrom() + \": Wrong type\");\n break;\n }\n socketWrite(ServerMessage);\n\n try {//close the socket connection\n client.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void handleMessageEvent(StunMessageEvent e) {\n delegate.processRequest(e);\n }",
"@Override\n public void onMessage(Message message) {\n try {\n // Generate data\n QueueProcessor processor = getBean(QueueProcessor.class);\n ServiceData serviceData = processor.parseResponseMessage(response, message);\n\n // If return is a DataList or Data, parse it with the query\n if (serviceData.getClientActionList() == null || serviceData.getClientActionList().isEmpty()) {\n serviceData = queryService.onSubscribeData(query, address, serviceData, parameterMap);\n } else {\n // Add address to client action list\n for (ClientAction action : serviceData.getClientActionList()) {\n action.setAddress(getAddress());\n }\n }\n\n // Broadcast data\n broadcastService.broadcastMessageToUID(address.getSession(), serviceData.getClientActionList());\n\n // Log sent message\n getLogger().log(QueueListener.class, Level.DEBUG,\n \"New message received from subscription to address {0}. Content: {1}\",\n getAddress().toString(), message.toString());\n } catch (AWException exc) {\n broadcastService.sendErrorToUID(address.getSession(), exc.getTitle(), exc.getMessage());\n\n // Log error\n getLogger().log(QueueListener.class, Level.ERROR, \"Error in message from subscription to address {0}. Content: {1}\", exc,\n getAddress().toString(), message.toString());\n } catch (Exception exc) {\n broadcastService.sendErrorToUID(address.getSession(), null, exc.getMessage());\n\n // Log error\n getLogger().log(QueueListener.class, Level.ERROR, \"Error in message from subscription to address {0}. Content: {1}\", exc,\n getAddress().toString(), message.toString());\n }\n }",
"@Override\r\n\t\t\tpublic void handleMessage(Message msg) {\n\t\t\t\tswitch (msg.what) {\r\n\t\t\t\tcase Constant.CONFERENCE_QUERY_SECCUESS:\r\n\t\t\t\t\tdismissProgressDialog();\r\n\t\t\t\t\tMeetingDetail.this.data = (ConferenceUpdateQueryResponseItem) msg.obj;\r\n\t\t\t\t\tiniParams();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase Constant.CONFERENCE_QUERY_FAIL:\r\n\t\t\t\t\tdismissProgressDialog();\r\n\t\t\t\t\tshowLongToast(\"错误代码:\" + ((NormalServerResponse) msg.obj).getEc());\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}",
"@Override\r\n\tpublic void messageReceived(Object obj) {\n\t\t\r\n\t}",
"@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tsuper.handleMessage(msg);\n\t\t\tswitch (msg.what) {\n\t\t\tcase 0:\n\t\t\t\ttv_read.setText(msg.obj.toString());\n\t\t\t\tToast.makeText(N20PINPadControllerActivity.this, \"recv\",\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"private void handleMessage(Message msg) {\n switch (msg.what) {\n case R.id.clientReady: // 음성인식 준비 가능\n txtResult.setText(\"Connected\");\n writer = new AudioWriterPCM(Environment.getExternalStorageDirectory().getAbsolutePath() + \"/NaverSpeechTest\");\n writer.open(\"Test\");\n break;\n case R.id.audioRecording:\n writer.write((short[]) msg.obj);\n break;\n case R.id.partialResult:\n mResult = (String) (msg.obj);\n mResult += mResult;\n txtResult.setText(mResult);\n break;\n case R.id.finalResult: // 최종 인식 결과\n SpeechRecognitionResult speechRecognitionResult1 = (SpeechRecognitionResult) msg.obj;\n List<String> results1 = speechRecognitionResult1.getResults();\n StringBuilder strBuf1 = new StringBuilder();\n for(String result : results1) {\n strBuf1.append(result);\n //strBuf.append(\"\\n\");\n break;\n }\n mResult = strBuf1.toString();\n txtResult.setText(mResult);\n\n requestChatbot();\n\n break;\n case R.id.recognitionError:\n if (writer != null) {\n writer.close();\n }\n mResult = \"Error code : \" + msg.obj.toString();\n txtResult.setText(mResult);\n btnStart.setText(R.string.str_start);\n btnStart.setEnabled(true);\n break;\n case R.id.clientInactive:\n if (writer != null) {\n writer.close();\n }\n btnStart.setText(R.string.str_start);\n btnStart.setEnabled(true);\n break;\n }\n }",
"void onMessageReceived(Message message);",
"public void handle(int ID, Object message){}",
"@Override\n public void handleMessage(ACLMessage message) {\n try {\n onMessage(message);\n } catch (Exception e) {\n e.getMessage();\n }\n }",
"@Override\n\tpublic void run() {\n\t\t\n\t\twhile(connected) {\n\t\t\tif(GameActivity.getInstance() == null)\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\ttry {\n\t\t\t\t// Read first 4 bytes (int, messageType) from stream\n\t\t\t\t//in.read(bytes, 0, 4);\n\t\t\t\tint messageType = in.readInt();\n\t\t\t\t//intByteBuffer.clear(); // Clear buffer so we can read from it again\n\t\t\t\t\n\t\t\t\t// Receive appropriate message based on received messageType\n\t\t\t if(messageType == Message.CHARACTERS.value()) {\n\t\t\t\t\treceiveCharacters();\n\t\t\t\t} else if(messageType == Message.ID.value()) {\n\t\t\t\t\treceiveId();\n\t\t\t\t} else {\n\t\t\t\t\tSystem.err.println(\"Received message with unknown id: \" + messageType);\n\t\t\t\t}\n\t\t\t \n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(\"Connection to server lost\");\n\t\t\t\te.printStackTrace();\n\t\t\t\tclose();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"@Override\n public void handle(Message<JsonObject> message) {\n logger.info(\"Handling event conjoiner.simplevertical\");\n\n // Start by deserializing the message back into a Object\n try {\n TransponderMessage msg = new TransponderMessage().messageToObject(message);\n logger.info(\"Decoded message: \" + msg.toJsonString());\n\n } catch (DataFormatException e) {\n e.printStackTrace();\n logger.warning(\"Unable to deserialize this\");\n }\n\n }",
"@Override\n public void run() {\n while (connected) {\n Message message = getMessage();\n if (!connected)\n break;\n Executors.newCachedThreadPool().execute(() -> {\n try {\n message.handle(messageHandler);\n } catch (IOException e) {\n e.printStackTrace();\n }\n });\n }\n }",
"private void receivedMessage(ChannelHandlerContext channelHandlerContext, ByteBuf response) {\n String message = new String(getByteArray(response));\n if (message.contains(\"Heartbeat\")) {\n logger.info(\"Received Heartbeat message\");\n channelHandlerContext.fireUserEventTriggered(response);\n } else {\n clientChannelHandlerObserver.processResponse(getByteArray(response));\n }\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}",
"public abstract void handleClient(Client conn);",
"public boolean handleMessage(Message msg) \r\n\t{\t\r\n\t\tswitch (msg.what)\r\n\t\t{\r\n\t\tcase TCPClient.MSG_COMSTATUSCHANGE:\r\n\t\tcase MSG_UIREFRESHCOM:\r\n\t\t\t{\r\n\t\t\t\tif (msg.arg2==uitoken)\r\n\t\t\t\t\tUI_RefreshConnStatus ();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\tcase TCPClient.MSG_NEWSTATUSMESSAGE:\r\n\t\tcase MSG_NEWSTATUSMESSAGE:\t\r\n\t\t\t{\r\n\t\t\t\tif (msg.arg2==uitoken)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.e(TAG,\"Status Message ACCE : \" + (String)msg.obj);\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\tcase TCPClient.MSG_CONNECTIONSTART:\r\n\t\t\t{\r\n\t\t\t\tif (msg.arg2==uitoken)\r\n\t\t\t\t{\r\n\t\t\t\t\tonRobotConnect (true);\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\tcase TCPClient.MSG_CONNECTIONSTOP:\r\n\t\t\t{\r\n\t\t\t\tif (msg.arg2==uitoken)\r\n\t\t\t\t{\r\n\t\t\t\t\tboolean bbNotify;\r\n\t\t\t\t\tsynchronized (this)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbbNotify=_bbCanSend;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tonRobotDisconnect (bbNotify);\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\tcase TCPClient.MSG_SENT:\r\n\t\t\t{\r\n\t\t\t\tif (msg.arg2==uitoken)\r\n\t\t\t\t\tlast_sent_msg = (String)msg.obj;\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\tcase MSG_CENTER:\r\n\t\t\t{\r\n\t\t\t\tif (isConnecting())\r\n\t\t\t\t{\r\n\t\t\t\t\tstopConnection(true);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tstartConnection();\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"@Override\r\n\t\t\tpublic void run() {\n\t\t\t\twhile (true) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\treMsg = withClient.getInputStream();\r\n\t\t\t\t\t\tbyte[] reBuffer = new byte[500];\r\n\t\t\t\t\t\treMsg.read(reBuffer);\r\n\t\t\t\t\t\tString msg = new String(reBuffer);\r\n\t\t\t\t\t\tmsg = msg.trim();\r\n\t\t\t\t\t\tif (msg.indexOf(\"/bye\") == 0) {\r\n\t\t\t\t\t\t\tendCat();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tAnalysis.ckMsg(mySin, msg);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\tendCat();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}",
"@Override\n public void handleMessage(Message msg) {\n\n Bundle bundle = msg.getData();\n if(bundle != null)\n {\n String cmd = bundle.getString(\"cmd\");\n\n writeToBle(cmd);\n }\n\n switch (msg.what) {\n case MSG_SET_TRACKING:\n setTracking(msg.arg1 == 1);\n break;\n case MSG_REGISTER_CLIENT:\n mClients.add(msg.replyTo);\n break;\n case MSG_UNREGISTER_CLIENT:\n mClients.remove(msg.replyTo);\n break;\n default:\n super.handleMessage(msg);\n }\n }",
"@Override\n\tpublic void dispatchHandler(Message msg) {\n\t\t\n\t}",
"@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}",
"@Override\n public void channelRead(ChannelHandlerContext ctx, Object msg) {\n try {\n // The incoming message should have been transformed to a CorfuMsg earlier in the pipeline.\n CorfuMsg m = ((CorfuMsg) msg);\n // We get the handler for this message from the map\n AbstractServer handler = handlerMap.get(m.getMsgType());\n if (handler == null) {\n // The message was unregistered, we are dropping it.\n log.warn(\"Received unregistered message {}, dropping\", m);\n } else {\n if (validateEpoch(m, ctx)) {\n // Route the message to the handler.\n log.trace(\"Message routed to {}: {}\", handler.getClass().getSimpleName(), msg);\n handlerWorkers.submit(() -> handler.handleMessage(m, ctx, this));\n }\n }\n } catch (Exception e) {\n log.error(\"Exception during read!\", e);\n }\n }",
"public void run() \n { \n String message; // String for incoming messages\n \n // listen for messages until stopped\n while ( keepListening ) \n { \n try \n { \n message = input.readLine(); // read message from client\n } // end try\n catch ( SocketTimeoutException socketTimeoutException ) \n {\n continue; // continue to next iteration to keep listening\n } // end catch\n catch ( IOException ioException ) \n {\n ioException.printStackTrace(); \n break;\n } // end catch\n\n // ensure non-null message\n if ( message != null ) \n {\n // tokenize message to retrieve user name and message body\n StringTokenizer tokenizer = new StringTokenizer( \n message, MESSAGE_SEPARATOR );\n\n // ignore messages that do not contain a user\n // name and message body\n if ( tokenizer.countTokens() == 2 ) \n {\n // send message to MessageListener\n messageListener.messageReceived( \n tokenizer.nextToken(), // user name\n tokenizer.nextToken() ); // message body\n } // end if\n else\n {\n // if disconnect message received, stop listening\n if ( message.equalsIgnoreCase(\n MESSAGE_SEPARATOR + DISCONNECT_STRING ) ) \n stopListening();\n } // end else\n } // end if\n } // end while \n \n try\n { \n input.close(); // close BufferedReader (also closes Socket)\n } // end try\n catch ( IOException ioException ) \n {\n ioException.printStackTrace(); \n } // end catch \n }",
"public Thread messageHandler(boolean isGUI, ClientView clientView) {\n Gson gson = new Gson();\n this.isGUI = isGUI;\n return new Thread(() -> {\n MessageEnvelope envelope = null;\n try {\n do {\n String inputMessage = (String)serverInput.readObject();\n envelope = gson.fromJson(inputMessage, MessageEnvelope.class);\n if (envelope.getType() != MessageType.PING) {\n synchronized (messageQ) {\n messageQ.add(inputMessage);\n messageQ.notifyAll();\n }\n if (!isGUI && envelope.getType().equals(MessageType.ENDGAME)) {\n EndGameMessage endGameMessage = gson.fromJson(envelope.getMessage(), EndGameMessage.class);\n if (!endGameMessage.isWinner() && !endGameMessage.getPlayer().isEmpty()) {\n clientView.endRead(true);\n }\n }\n }\n } while (!socket.isClosed() && !view.isQuitting());\n } catch (IOException | ClassNotFoundException e) {\n // If this branch is executed when the user is not really quitting, there was a server disconnection.\n // If the user is quitting, this thread is terminated (catches the exception because of the socket closing),\n // due to viewRun socket.close() call (should do nothing)\n if (!view.isQuitting()) {\n // Line needed to avoid another do..while iteration in viewRun()\n view.setQuitting(true);\n EndGameMessage message = new EndGameMessage(\"\", null);\n MessageEnvelope finalEnvelope = new MessageEnvelope(MessageType.ENDGAME, gson.toJson(message, EndGameMessage.class));\n try {\n serverInput.close();\n clientOutput.close();\n socket.close();\n synchronized (messageQ) {\n messageQ.add(gson.toJson(finalEnvelope, MessageEnvelope.class));\n messageQ.notifyAll();\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n if (!isGUI) {\n clientView.endRead(false);\n }\n }\n }\n });\n }",
"private void receiveClientMessage() throws IOException {\n mRemoteClientMessage = lengthValueRead(in, ClientMessage.class);\n \n if (mRemoteClientMessage == null) {\n setExchangeStatus(Status.ERROR);\n setErrorMessage(\"Remote client message was not received.\");\n throw new IOException(\"Remote client message not received.\");\n }\n\n if (mRemoteClientMessage.messages == null) {\n setExchangeStatus(Status.ERROR);\n setErrorMessage(\"Remote client messages field was null\");\n throw new IOException(\"Remote client messages field was null\");\n }\n\n mMessagesReceived = mRemoteClientMessage.messages;\n }",
"@Override\n protected void channelRead0(ChannelHandlerContext ctx, Message msg)\n {\n mDispatcher.dispatch(mPeer, msg);\n }",
"@Override\n public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {\n Channel ch = ctx.getChannel();\n //Player player = (Player) ch.getAttachment();\n Client client = (Client) ch.getAttachment();\n \n if (ch.isConnected()) { // && !client.getPlayer().destroyed() \n RSCPacket packet = (RSCPacket) e.getMessage();\n //player.addPacket(p); // Used to log packets for macro detection\n //engine.addPacket(p); // This one actually results in the packet being processed!\n client.pushToMessageQueue(packet);\n }\n }",
"@Override\n public void run() {\n try {\n boolean autoFlush = true;\n fromClient = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));\n toClient = new PrintWriter(clientSocket.getOutputStream(), autoFlush);\n } catch (IOException ioe) {\n throw new UncheckedIOException(ioe);\n }\n for (String entry : communicationWhenStarting) {\n sendMsg(entry);\n }\n while (connected) {\n try {\n Message msg = new Message(fromClient.readLine());\n updateClientAction(msg);\n } catch (IOException ioe) {\n disconnectClient();\n throw new MessageException(ioe);\n }\n }\n }",
"abstract void onMessage(byte[] message);",
"@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tsuper.handleMessage(msg);\n\t\t\tswitch (msg.what) {\n\t\t\tcase 911:\n\t\t\t\tqueryMsg();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}",
"public abstract void messageReceived(String message);",
"@Override public void handleMessage(Message msg) {\n super.handleMessage(msg);\n byte[] byteArray = (byte[]) msg.obj;\n int length = msg.arg1;\n byte[] resultArray = length == -1 ? byteArray : new byte[length];\n for (int i = 0; i < byteArray.length && i < length; ++i) {\n resultArray[i] = byteArray[i];\n }\n String text = new String(resultArray, StandardCharsets.UTF_8);\n if (msg.what == BluetoothTalker.MessageConstants.MESSAGE_WRITE) {\n Log.i(TAG, \"we just wrote... [\" + length + \"] '\" + text + \"'\");\n// mIncomingMsgs.onNext(text);\n } else if (msg.what == BluetoothTalker.MessageConstants.MESSAGE_READ) {\n Log.i(TAG, \"we just read... [\" + length + \"] '\" + text + \"'\");\n Log.i(TAG, \" >>r \" + Arrays.toString((byte[]) msg.obj));\n mIncomingMsgs.onNext(text);\n sendMsg(\"I heard you : \" + Math.random() + \"!\");\n// mReadTxt.setText(++ri + \"] \" + text);\n// if (mServerBound && mServerService.isConnected()) {\n// mServerService.sendMsg(\"I heard you : \" + Math.random() + \"!\");\n// } else if (mClientBound && mClientService.isConnected()) {\n// mClientService.sendMsg(\"I heard you : \" + Math.random() + \"!\");\n// }\n// mBluetoothStuff.mTalker.write();\n }\n }",
"@Override\n public void run() {\n Message message = new Message();\n message.what=1;\n handler.sendMessage(message);\n }",
"@Override\n public void handleMessage(Message msg){\n BTRobotRemoteActivity activity = outer.get();\n\n //can't access main UI activity\n if(activity == null){return;}\n\n //find out what message was sent\n switch(msg.what){\n //bluetooth\n case BluetoothClientService.MESSAGE_STATE_CHANGE:{\n //update bluetooth connection status\n activity.setStatus(msg.arg1);\n break;\n }\n //service wrote data \n case BluetoothClientService.MESSAGE_WRITE:{\n //store data as a string\n String writeMessage = new String((byte[]) msg.obj);\n break;\n }\n //service read data\n case BluetoothClientService.MESSAGE_READ:{\n String readMessage = new String((byte[])msg.obj, 0, msg.arg1);\n break;\n }\n //service retreived device's name\n case BluetoothClientService.MESSAGE_DEVICE_NAME:{\n // save the connected device's name\n activity.setDeviceName(msg.getData().getString(DEVICE_NAME));\n Toast.makeText(activity.getApplicationContext(), \"Connected to \"\n + activity.getDeviceName(), Toast.LENGTH_SHORT).show();\n break;\n }\n //motion sensor\n case MotionMonitor.MESSAGE_MOTION:{\n if(msg.arg1 == MotionMonitor.ARG_ACCEL){\n Bundle b = (Bundle) msg.obj;\n if(b == null){Log.e(TAG, \"Failed to convert message object to bundle\");}\n float [] data = b.getFloatArray(MotionMonitor.KEY_ACCEL);\n activity.updateOrientation(data);\n }\n else if(msg.arg1 == MotionMonitor.ARG_GYRO){\n Bundle b = (Bundle) msg.obj;\n if(b == null){Log.e(TAG, \"Failed type message data to float []\");}\n //set data in gyrostats view \n float [] data = b.getFloatArray(MotionMonitor.KEY_ROTATE);\n TextView stats = (TextView) activity.findViewById(R.id.gyro_stats);\n stats.setText(String.format(\"%4f, %4f, %4f\", data[0], data[1], data[2]));\n }\n else{Log.e(TAG, \"Unsupported argument for MESSAGE_MOTION in handleMessage()\");}\n }\n //ignore other types\n default:{\n }}\n }",
"@Override\n public void run() {\n Message message = new Message();\n message.what = 4;\n handler.sendMessage(message);\n }",
"void onReceive(Message message) throws IOException {\n server.onReceive(message);\n }",
"public void handleMessage(Message message, Socket socket) throws IOException, HandlingException;",
"@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tthis.sendMessage(Response.WELCOME_MESSAGE);\n\t\t\t// Get new command from client\n\t\t\twhile (true) {\n\t\t\t\tthis.executeCommand();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// If a exception is catch we just close the client connection\n\t\t\ttry {\n\t\t\t\tthis.close();\n\t\t\t} catch (IOException e1) {\n\t\t\t\t/// just throw the exception of the close\n\t\t\t\tthrow new RuntimeException(e1);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void handleMessage(Message message) {\n // ...\n // When needed, stop the service with\n // stopSelf();\n }",
"@Override\n\tpublic void onMessageReceived(Message m) {\n\t\thandle.addMessage(m);\n\t\trefreshMessages();\n\t}",
"@Override\n public void handleClientRequest(User sender, ISFSObject params) {\n }",
"@Override\r\n public void handleData(Serializable data)\r\n {\r\n try\r\n {\r\n // get the client context\r\n clientContext = (TwoPlayerClientContext) data;\r\n messageQueue.appendText(\r\n \"Received IO Message: \" + clientContext.getIOMSG().toString());\r\n messageQueue.appendText(clientContext.getIOMSG()\r\n .equals(IOMSG.QUERY_INITIAL_CONTEXT) ? \"\\n\"\r\n : \" from \" + clientContext.getClientID() + \"\\n\");\r\n messageQueue.appendText(\"Server received actions: \"\r\n + clientContext.toString() + \"\\n\\n\");\r\n switch (clientContext.getIOMSG())\r\n {\r\n case QUERY_INITIAL_CONTEXT:\r\n transmitData(IOMSG.UPDATE_INITIAL_CONTEXT,\r\n serverContext.createClientContext(true),\r\n serverContext.getNumClients() - 1);\r\n break;\r\n case RELAY_CONTEXT:\r\n processAction(clientContext, \"Updated client context.\");\r\n break;\r\n case ROLL:\r\n processAction(clientContext, clientContext.getSelectedActor() + \" rolled a \"\r\n + clientContext.getDie().toString() + \"!\");\r\n break;\r\n case MOVE:\r\n processAction(clientContext, clientContext.getSelectedActor() + \" moved!\");\r\n break;\r\n default:\r\n break;\r\n }\r\n } catch (Exception ex)\r\n {\r\n Logger.getLogger(EpicDuelsServerController.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }",
"@Override\n\tpublic void handle(T event) {\n\t\tString messageFromClient;\n\t\tmessageFromClient = breakOut.getView().getInputTextfield().getText();\n\t\ttry {\n\t\t\tbreakOut.getClient().getWriter().println(messageFromClient);\n\t\t\tbreakOut.getClient().getWriter().flush();\n\t\t\tbreakOut.getView().getInputTextfield().clear();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"No reachable Server\");\n\t\t}\n\t}",
"@Override\n\tpublic void process(MessageStream<ServerMessage> message)\n\t{\n\t\t\n\t}",
"public void handleObject(SocketManager sm, Object msg)\n\t\t{\n\t\t\tif (msg instanceof RequestPeerListMsg)\n\t\t\t{\n\t\t\t\t// start a new thread to send the peer list\n\t\t\t\tif(SessionManager.debug) System.out.println(\"New leader \" + _sm.getIdentity() + \"received RequestPeerListMsg. Sending peer list.\");\n\t\t\t\tnew PeerListSender().start();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// handle a promotion event\n\t\t\tif (msg instanceof PromoteMsg)\n\t\t\t{\n\t\t\t\tif(SessionManager.debug) System.out.println(\"PromoteMsg received by \" + _sm.getIdentity() + \". New leader is \" + ((PromoteMsg) msg).new_leader);\n\t\t\t\t_sm.peerPromoted( ( (PromoteMsg) msg).new_leader);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (msg instanceof ByteBundle)\n\t\t\t{\n\t\t\t\tByteBundle bb = (ByteBundle) msg;\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif (bb.hasInt)\n\t\t\t\t\t{\n\t\t\t\t\t\t_pos.write(bb.val);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t_pos.write(bb.array);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (IOException ioe)\n\t\t\t\t{\n\t\t\t\t\tioe.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// if it wasn't one of the above, pass handling off to the\n\t\t\t// MessageListener.\n\t\t\tsynchronized (PeerChannel.this)\n\t\t\t{\n\t\t\t\t// queue up messages until we get a MessageListener to give these\n\t\t\t\t// to.\n\t\t\t\tif (_ml == null)\n\t\t\t\t{\n\t\t\t\t\t_msg_queue.addLast(msg);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_ml.messageReceived( (Serializable) msg);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public void messageReceived() {\n\tTrackedMessage.accumulateMap(TrackedMessage.unmapType(\n\t\tTrackedMessage.messagesRecieved, this.getClass()), this\n\t\t.getMessageType(), 1);\n\tTrackedMessage.accumulateMap(TrackedMessage.unmapType(\n\t\tTrackedMessage.bytesRecieved, this.getClass()), this\n\t\t.getMessageType(), TrackedMessage.objectSize(this));\n }",
"@Override\n\t\t\tpublic void handleMessage(Message msg) {\n\t\t\t\tprocessBluetoothDeviceMessage(msg);\n\t\t\t}",
"@Override\n public void run()\n {\n while (true)\n {\n\n // create output stream attached to the socket\n\n // read message from client.\n try\n {\n Message message = (Message) inFromClient.readObject();\n System.out.println(\"Message from Client: \" + message);\n\n // Send reply to client.\n Message replyMessage = new Message(message.getId(), message.getBody().toUpperCase());\n\n for (int i = 0; i < mb.numberofclients(); i++)\n {\n mb.getConnection(i).returnMessage().writeObject(message);\n\n }\n list.add(message);\n db2.Write(list);\n\n }\n catch (Exception ex)\n {\n \n }\n }\n\n }",
"@Override\r\n\t\tpublic void handleMessage(Message msg)\r\n\t\t{\n\t\t\tswitch (msg.what)\r\n\t\t\t{\r\n\t\t\t\tcase CONNECT_ERROR:\r\n\t\t\t\t\tmyAlert.ShowToast(aty_SWP_Circle.this, getString(R.string.network_error));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase RESTART_CIRCLE:\r\n\t\t\t\t\t//关闭资源,重新发起圈存过程\r\n\t\t\t\t\tm_swp.UICCClose();\r\n\t\t\t\t\tInitSWP(mHandler);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase CIRCLE_COMPELETE:\r\n\t\t\t\t\t//启用服务发送完成报告\r\n\t\t\t\t\tBindSerive(aty_SWP_Circle.this);\r\n\t\t\t\t\t//添加圈存完成界面\r\n\t\t\t\t\tAddCircleCompelete();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}",
"@Override\r\n \tpublic void clientCommandReceivedCallback(RoMClient client, ClientCommand clientCommand) {\r\n \t\tLogger.logMessage(client.getSessionID() + \" newCommand: \" + clientCommand);\r\n \r\n \t\tthis.processClientCommand(client, clientCommand);\r\n \t}",
"@Override\n public void handleTextMessage(WebSocketSession session, TextMessage message) throws IOException {\n// \tlogger.info(\"Server received text: {}\", message.getPayload());\n \tMessage msg = messageEncoderDecoder.deserialize(message.getPayload(), Message.class);\n\t\tlogger.info(\"Message received: {}\", msg.getClass().getSimpleName());\n\n \tif (msg instanceof MapCreateRequested)\n \t{\n \t\tlogger.info(\"MapCreateRequested received!\");\n \t\tmaps.registerNewMap(new WebSocketClient(session), \"initName\");\n \t}\n \telse if (msg instanceof GenericMapUpdateRequested)\n \t{\n \t\tlogger.info(\"MapUpdateRequested received!\");\n \t\tGenericMapUpdateRequested msgMapUpdateRequested = (GenericMapUpdateRequested)msg;\n \t\tGenericUpdateBlockCompleted updateBlockCompleted = msgMapUpdateRequested.update();\n\n \t\tmaps.processMapUpdates(new WebSocketClient(session), updateBlockCompleted);\n \t}\n }",
"@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tsuper.handleMessage(msg);\n\t\t\tswitch (msg.what) {\n\t\t\tcase SUCCESS:\n\t\t\t\tmCallback.onSuccess(mTag);\n\t\t\t\tbreak;\n\t\t\tcase FAIL:\n\t\t\t\tmCallback.onFail(mTag);\n\t\t\t}\n\t\t}",
"@Override\n protected void decode(ChannelHandlerContext ctx, Message msg, List<Object> out) throws Exception \n {\n GameAppContext context = ctx.channel().attr(GameAppContextKey.KEY).get();\n \n // and let the context decide what to do with the message\n context.handleMessage(msg);\n \n // we dont break the cycle here - maybe other handlers sit behind this one\n out.add(msg);\n }",
"@Override\n public void receiveMessage(String message) {\n }",
"@Override\n public void handleMessage(Message msg){\n switch (msg.what) {\n case PSensor.MESSAGE_STATE_CHANGE:\n break;\n case PSensor.MESSAGE_WRITE:\n break;\n case PSensor.MESSAGE_READ:\n PSensor.sensorData.parseInput((byte[])msg.obj);//parseInput((byte[])msg.obj);\n multiGauge.handleSensor(PSensor.sensorData.boost);\n multiGaugeVolts.handleSensor(PSensor.sensorData.batVolt);\n break;\n case PSensor.MESSAGE_DEVICE_NAME:\n break;\n case PSensor.MESSAGE_TOAST:\n break;\n default:\n break;\n }\n }"
] | [
"0.764998",
"0.7434646",
"0.73907626",
"0.7321689",
"0.71623975",
"0.7045082",
"0.69506377",
"0.6923347",
"0.68690854",
"0.6857326",
"0.68191826",
"0.6803126",
"0.6797442",
"0.66932696",
"0.6687805",
"0.6687093",
"0.6686234",
"0.66669333",
"0.66616386",
"0.6661471",
"0.6657729",
"0.66372865",
"0.66315633",
"0.66123825",
"0.6587676",
"0.65843225",
"0.65838283",
"0.65625954",
"0.6532668",
"0.6530123",
"0.6528982",
"0.652431",
"0.6511761",
"0.64735264",
"0.6464426",
"0.64613783",
"0.646031",
"0.6458662",
"0.64474493",
"0.6434488",
"0.6430819",
"0.64303094",
"0.6415079",
"0.6409417",
"0.6407682",
"0.6399806",
"0.6390027",
"0.6387345",
"0.63829285",
"0.63741606",
"0.63730943",
"0.6371486",
"0.63684034",
"0.6365469",
"0.63596714",
"0.63587785",
"0.6354512",
"0.6336084",
"0.6333951",
"0.6330956",
"0.63299876",
"0.6322755",
"0.63161004",
"0.6296478",
"0.6292815",
"0.62829536",
"0.62795216",
"0.62720305",
"0.6271984",
"0.62699854",
"0.6268346",
"0.6264301",
"0.62574774",
"0.62564653",
"0.6252857",
"0.6252164",
"0.6251063",
"0.62454534",
"0.62397784",
"0.62387526",
"0.6238172",
"0.6236309",
"0.6232331",
"0.62321573",
"0.6220037",
"0.6218208",
"0.6211942",
"0.6196875",
"0.6193503",
"0.6193042",
"0.6192825",
"0.6188602",
"0.6185156",
"0.6179076",
"0.6178729",
"0.6169665",
"0.6163144",
"0.61627686",
"0.61554307",
"0.615527",
"0.61426425"
] | 0.0 | -1 |
TODO Autogenerated method stub | private void sendToClient(String string) {
} | {
"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}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"private stendhal() {\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\r\n\tpublic void dispase() {\n\r\n\t}",
"@Override\n\tprotected void initialize() {\n\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.66708666",
"0.65675074",
"0.65229905",
"0.6481001",
"0.64770633",
"0.64584893",
"0.6413091",
"0.63764185",
"0.6275735",
"0.62541914",
"0.6236919",
"0.6223816",
"0.62017626",
"0.61944294",
"0.61944294",
"0.61920846",
"0.61867654",
"0.6173323",
"0.61328775",
"0.61276996",
"0.6080555",
"0.6076938",
"0.6041293",
"0.6024541",
"0.6019185",
"0.5998426",
"0.5967487",
"0.5967487",
"0.5964935",
"0.59489644",
"0.59404725",
"0.5922823",
"0.5908894",
"0.5903041",
"0.5893847",
"0.5885641",
"0.5883141",
"0.586924",
"0.5856793",
"0.58503157",
"0.58464456",
"0.5823378",
"0.5809384",
"0.58089525",
"0.58065355",
"0.58065355",
"0.5800514",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57896614",
"0.5789486",
"0.5786597",
"0.5783299",
"0.5783299",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5760369",
"0.5758614",
"0.5758614",
"0.574912",
"0.574912",
"0.574912",
"0.57482654",
"0.5732775",
"0.5732775",
"0.5732775",
"0.57207066",
"0.57149917",
"0.5714821",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57115865",
"0.57045746",
"0.5699",
"0.5696016",
"0.5687285",
"0.5677473",
"0.5673346",
"0.56716853",
"0.56688815",
"0.5661065",
"0.5657898",
"0.5654782",
"0.5654782",
"0.5654782",
"0.5654563",
"0.56536144",
"0.5652585",
"0.5649566"
] | 0.0 | -1 |
This method overrides the one in the superclass. Called when the server starts listening for connections. | protected void serverStarted()
{
System.out.println
("Server listening for connections on port " + getPort());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void StartListening()\n\t{\n\t\t\n\t}",
"@Override\n\tpublic void listenerStarted(ConnectionListenerEvent evt) {\n\t\t\n\t}",
"protected void serverStarted()\n {\n // System.out.println\n // (\"Server listening for connections on port \" + getPort());\n }",
"protected void serverStarted()\n {\n System.out.println(\"Server listening for connections on port \" + getPort());\n }",
"void onListeningStarted();",
"public void startListening() {\r\n\t\tlisten.startListening();\r\n\t}",
"public void startListening();",
"public void startListeningForConnection() {\n startInsecureListeningThread();\n }",
"public void startServer()\n\t{\n\t\twhile(true)\n\t\t{\n\t\t\tSystem.out.println(\"Listen\");\n\t\t\tif(listenInitialValuesRequest)\n\t\t\t{\n\t\t\t\tlistenInitialValuesRequest();\n\t\t\t}\n\t\t}\n\t}",
"void startListening()\n {\n if (outstanding_accept != null || open_connection != null) {\n return;\n }\n \n outstanding_accept = new AcceptThread(bt_adapter, handler);\n outstanding_accept.start();\n }",
"@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tlisten();\n\t\t\t\t}",
"@Override\n\tprotected void onConnect() {\n\t\tLogUtil.debug(\"server connect\");\n\n\t}",
"void onServerStarted();",
"public static void startServer() {\n clientListener.startListener();\n }",
"void initAndListen() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket clientSocket = serverSocket.accept();\n\t\t\t\t// Startuje nowy watek z odbieraniem wiadomosci.\n\t\t\t\tnew ClientHandler(clientSocket, this);\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Accept failed.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}",
"public void startListening() {\n if (Util.isDebugBuild()) {\n Log.d(TAG, \"mAcceptThread: \" + mAcceptThread);\n }\n\n // Start the AcceptThread which listens for incoming connection requests\n if (mAcceptThread == null) {\n mAcceptThread = new AcceptThread(mContext, mHandler, services, this);\n }\n\n if (Util.isDebugBuild()) {\n Log.d(TAG, \"mAcceptThread.isAlive(): \" + mAcceptThread.isAlive());\n }\n\n if (!mAcceptThread.isAlive()) {\n mAcceptThread.start();\n }\n }",
"private void startListen() {\n try {\n listeningSocket = new ServerSocket(listeningPort);\n } catch (IOException e) {\n throw new RuntimeException(\"Cannot open listeningPort \" + listeningPort, e);\n }\n }",
"@Override\n public void run() {\n try {\n registerWithServer();\n initServerSock(mPort);\n listenForConnection();\n\t} catch (IOException e) {\n Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, e);\n setTextToDisplay(\"run(): \" + e.getMessage());\n setConnectedStatus(false);\n\t}\n }",
"private void listen() {\n\t\ttry {\n\t\t\tServerSocket servSocket = new ServerSocket(PORT);\n\t\t\tSocket clientSocket;\n\t\t\twhile(true) {\n\t\t\t\tclientSocket = servSocket.accept();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Error - Could not open connection\");\n\t\t}\n\t\t\n\t}",
"public void listen()\n {\n service = new BService (this.classroom, \"tcp\");\n service.register();\n service.setListener(this);\n }",
"public void startListening() {\n\twhile (true) {\n\t try {\n\t\tSocket s = socket.accept();\n\n\t\tnew TCPSessionClient(s, this.clients);\n\t } // end of try\n\n\t catch (IOException e) {\n\t\te.printStackTrace();\n\t } // end of catch\n\t} // end of while\n }",
"@Override\n\tpublic boolean IsListening() {\n\t\treturn listening;\n\t}",
"public synchronized void listen() {\n// synchronized (this) {\n try {\n String input;\n if ((input = in.readLine()) != null) {\n parseCommand(input);\n }\n } catch (IOException ex) {\n Logger.getLogger(ClientIO.class.getName()).log(Level.SEVERE, null, ex);\n }\n// }\n }",
"public void notifyServerListening() {\r\n nui.notifyHostListening();\r\n }",
"public void start() throws IOException {\n\t\tserverSocket = new ServerSocket(port);\n\t\tserverCallbacks.forEach(c -> c.onServerStarted(this, port));\n\t}",
"public SocketServer() {\n \n super();\n start();\n\n }",
"protected void onConnect() {}",
"public void start() {\n\t\t\n\t\ttry {\n\t\t\tmainSocket = new DatagramSocket(PORT_NUMBER);\n\t\t}\n\t\tcatch(SocketException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t\n\t\t//Lambda expression to shorten the run method\n\t\tThread serverThread = new Thread( () -> {\n\t\t\tlisten();\n\t\t});\n\t\t\n\t\tserverThread.start();\n\t}",
"public SuperPeer listen() {\n try {\n this.log(String.format(\"Listening on %s...\", this));\n while (true) {\n // accept an incoming connection\n Socket peerSocket = this.server.accept();\n PeerHandler ph = new PeerHandler(this, peerSocket);\n ph.start();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return this;\n }",
"@Override\n protected void startListener(){\n Socket socket = null;\n while (isRunning()){\n socket = acceptSocket();\n if (socket == null) {\n continue;\n }\n \n try {\n handleConnection(socket);\n } catch (Throwable ex) {\n getLogger().log(Level.FINE, \n \"selectorThread.handleConnectionException\",\n ex);\n try {\n socket.close(); \n } catch (IOException ioe){\n // Do nothing\n }\n continue;\n }\n } \n }",
"public void start() {\n System.out.println(\"server started\");\n mTerminalNetwork.listen(mTerminalConfig.port);\n }",
"public void startListener() throws IOException {\n\t\tthis.listener = new ServerSocket(this.port);\n\n Runnable serverThread = new Runnable() {\n @Override\n public void run() {\n try {\n System.out.println(\"Waiting for clients to connect...\");\n\n while (true) {\n \t// Wait for connections\n Socket newSocket = listener.accept();\n\n // Init new peer and add it to our list\n PeerCommunicator newCommunication = new PeerCommunicator(id, \"\", newSocket);\n activePeers.add(newCommunication);\n\n // Span new thread\n Thread clientThread = new Thread(new ReceivedConnection(newCommunication, fm));\n clientThread.start();\n }\n } catch (Exception e) {\n System.err.println(\"Unable to process incoming client\");\n e.printStackTrace();\n }\n }\n };\n\n // Start it up\n (new Thread(serverThread)).start();\n\n // Once everything's good, mark server as running\n //this.status = Status.RUNNING;\n\t}",
"private void createAndListen() {\n\n\t\t\n\t}",
"public TCPMessengerServer() {\n initComponents();\n customInitComponents();\n listenForClient(); \n }",
"public void startListener() throws BindException, Exception{ // NOPMD by luke on 5/26/07 11:10 AM\n\t\tsynchronized (httpServerMutex){\n\t\t\t// 1 -- Shutdown the previous instances to prevent multiple listeners\n\t\t\tif( webServer != null )\n\t\t\t\twebServer.shutdownServer();\n\t\t\t\n\t\t\t// 2 -- Spawn the appropriate listener\n\t\t\twebServer = new HttpServer();\n\t\t\t\n\t\t\t// 3 -- Start the listener\n\t\t\twebServer.startServer( serverPort, sslEnabled);\n\t\t}\n\t}",
"public synchronized void start() {\n if (D) Log.d(TAG, \"start\");\n\n // Cancel any thread attempting to make a connection\n if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}\n\n // Cancel any thread currently running a connection\n if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}\n\n setState(STATE_LISTEN);\n }",
"@Override\r\n\tpublic void start(Socket socket){}",
"@Override\n public void run() {\n this.running.set(true);\n Socket socket = null;\n // if flag is set to listen, keep listening for client connection request and keep accepting connections\n while (this.running.get()) {\n try {\n if (connectionCount.get() < Constants.MAX_CLIENT_CONNECTIONS) {\n socket = serverSocket.accept();\n socket.setSoTimeout(30000); // timeout set to 30,000 ms\n socket.setKeepAlive(true);\n log.info(\"Connection Accepted: Local Add {} Remote Add {}\", socket.getLocalAddress(),\n socket.getRemoteSocketAddress());\n // add the connected socket to the list\n socketList.add(socket);\n // Pass the socket to the RequestHandler thread for processing\n IncomingMessageHandler messageHandler = new IncomingMessageHandler(socket, logWriter, fileWriterQueue,\n periodicReportingService, orderShutdown);\n messageHandler.start();\n connectionCount.getAndIncrement();// increment connection count\n log.debug(\"Current number of connections {}\", connectionCount.get());\n } else {\n if(maxConnWarnCount < 4) {\n log.warn(\"Reached maximum connection limit {}; Stopping to accept more client connections\"\n , connectionCount.get());\n maxConnWarnCount++;\n }\n }\n } catch (IOException e) {\n log.error(\"Error in accepting connections\", e);\n if (e instanceof SocketException) {\n log.error(\"SocketException for remote connection\");\n }\n }\n }\n }",
"public void Listen() {\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\t//reconstruct byte array for receiving\r\n\t\t\treceiveData = new byte[5192];\r\n\t\t\t\r\n\t\t\t//receive a packet!\r\n\t\t\tserverSocket.receive(packet = new DatagramPacket(receiveData, receiveData.length));\r\n\t\t\t\r\n\t\t\t//translate into a string and print to console\r\n\t\t\tString output = new String(packet.getData());\r\n\t\t\t//address = serverSocket.getInetAddress();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tNetConsole.window.addText(output, false);\r\n\t\t\t\r\n\t\t\t//deconstruct array so remnants of last commands don't get shown. \r\n\t\t\treceiveData = null;\r\n\t\t\tpacket = null;\r\n\t\t\t\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\treturn;\r\n\t\t\r\n\t}",
"@Override\n public void socket() {\n }",
"public void start() {\n System.err.println(\"Server will listen on \" + server.getAddress());\n server.start();\n }",
"private void listenForConnection() throws IOException {\n\twhile(true) {\n System.out.println(\"Waiting for connection...\");\n // Wait for client to connect\n Socket cli = server.accept();\n if(connlist.size() < MAX_CONN) {\n\t\t// if numCli is less then 100\n initConnection(cli);\n }\n\t}\n }",
"@Override\n\tpublic void run() {\n\t\tif (FrameworkHandler.DEBUG_MODE){\n\t\t\tString strType = \"\";\n\t\t\tif (type == RULE_CONNECTION) strType = \"New RemoteRule Listener\";\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(strType + \" LISTENING on port: \" + listeningSocket.getLocalPort());\n\t\t}\n\t\ttry {\n\t\t\twhile (running) {\n\t\t\t\tSocket newSocket = listeningSocket.accept();\n\t\t\t\t\n\t\t\t\tif (FrameworkHandler.DEBUG_MODE)\n\t\t\t\t\tSystem.out.println(\"New request obtained on \" + newSocket.getPort() + \"|\" + newSocket.getLocalPort());\n\t\t\t\t\n\t\t\t\tcreateNewConnection(newSocket);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tFrameworkHandler.exceptionLog(FrameworkHandler.LOG_ERROR, this, e);\n\t\t}\n\t}",
"private void runServer()\n {\n int port = Integer.parseInt(properties.getProperty(\"port\"));\n String ip = properties.getProperty(\"serverIp\");\n \n Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, \"Server started. Listening on: {0}, bound to: {1}\", new Object[]{port, ip});\n try\n {\n serverSocket = new ServerSocket();\n serverSocket.bind(new InetSocketAddress(ip, port));\n do\n {\n Socket socket = serverSocket.accept(); //Important Blocking call\n Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, \"Connected to a client. Waiting for username...\");\n ClientHandler ch = new ClientHandler(socket, this);\n clientList.add(ch);\n ch.start();\n } while (keepRunning);\n } catch (IOException ex)\n {\n Logger.getLogger(ChatServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public String listen(){\t\n\t\tSystem.out.println(\"Server lauscht.\");\n\t\treturn receiveString();\n\t}",
"private void initServer() throws IOException {\r\n \t\tLogger.logMessage(\"Binding Server to \" + this.serverIpAddress + \":\" + this.serverPort);\r\n \r\n \t\tthis.isAlive = true;\r\n \t\tthis.serverSocket = new ServerSocket(this.serverPort, this.backLog, this.serverIpAddress);\r\n \t\tthis.dataLayer = DataLayerFactory.getDataLayer();\r\n \r\n \t\t// Generate the grouplist\r\n \t\tCollection<String> dbGroupList = this.dataLayer.getGroups();\r\n \r\n \t\tfor (String group : dbGroupList) {\r\n \t\t\tthis.groupList.addGroup(group);\r\n \t\t}\r\n \r\n \t\tLogger.logMessage(\"Server successfuly bound!\");\r\n \t}",
"@Override\n\tpublic void run()\n\t{\n\t\tSocket clientSocket;\n\t\tMemoryIO serverIO;\n\t\t// Detect whether the listener is shutdown. If not, it must be running all the time to wait for potential connections from clients. 11/27/2014, Bing Li\n\t\twhile (!super.isShutdown())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Wait and accept a connecting from a possible client residing on the coordinator. 11/27/2014, Bing Li\n\t\t\t\tclientSocket = super.accept();\n\t\t\t\t// Check whether the connected server IOs exceed the upper limit. 11/27/2014, Bing Li\n\t\t\t\tif (MemoryIORegistry.REGISTRY().getIOCount() >= ServerConfig.MAX_SERVER_IO_COUNT)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// If the upper limit is reached, the listener has to wait until an existing server IO is disposed. 11/27/2014, Bing Li\n\t\t\t\t\t\tsuper.holdOn();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (InterruptedException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If the upper limit of IOs is not reached, a server IO is initialized. A common Collaborator and the socket are the initial parameters. The shared common collaborator guarantees all of the server IOs from a certain client could notify with each other with the same lock. Then, the upper limit of server IOs is under the control. 11/27/2014, Bing Li\n//\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator(), ServerConfig.COORDINATOR_PORT_FOR_MEMORY);\n\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator());\n\t\t\t\t// Add the new created server IO into the registry for further management. 11/27/2014, Bing Li\n\t\t\t\tMemoryIORegistry.REGISTRY().addIO(serverIO);\n\t\t\t\t// Execute the new created server IO concurrently to respond the client requests in an asynchronous manner. 11/27/2014, Bing Li\n\t\t\t\tsuper.execute(serverIO);\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\tpublic void run() {\n try {\n serverSocket = new ServerSocket(port);\n \n while (true) {\n System.out.println(\"[GenericServer.run] Waiting for connections on Port #\" + port);\n socket = serverSocket.accept();\n System.out.println(\"[GenericServer.run] A connection to a client is established!\");\n processConnection(socket);\n }\n\n } catch (IOException ioe) {\n System.err.println(\"IOException\" + ioe.getMessage());\n ioe.printStackTrace();\n }\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 listen() throws Exception {\n if (serverSocket != null) {\n try {\n serverSocket.setSoTimeout(0);\n } catch (SocketException sx) {\n sx.printStackTrace();\n }\n }\n }",
"@Override\n \tpublic void connectionOpened(NetHandler netClientHandler, String server, int port, INetworkManager manager)\n \t{\n \t}",
"public void listen(){\n \ttry{ \t\t\n \t\twhile(true){\n \t \t\tSocket socket = server.accept();\n \t \t\tString nickname = new String(\"Guest_\" + String.valueOf(nextId));\n \t \t\t\n \t \t\t// Create a server connection and connect it to the appropriate user.\n \t \t\tServerConnection userConnection = new ServerConnection(nextId, socket, this);\n \t \t\tUser user = new User(nextId, nickname, userConnection);\n \t \t\tuserConnection.setUser(user);\n \t \t\t\n \t \t\tsynchronized(userMap){\n \t \t\t\tuserMap.put(nextId, user);\n \t \t\t}\n \t \t\t// Send a response that connection was successful;\n \t \t\tuserConnection.sendMessage(new Message(Command.REPLY_SUCCESS, \"\", Calendar.getInstance(), \"\"));\n \t \t\t\n \t \t\tnextId++;\n \t\t}\n \t}\n \tcatch(IOException e){\n \t\te.printStackTrace();\n \t}\n }",
"protected ConnectionServer(Activity ctx) {\n mContext = ctx;\n services = new HashMap<String, ConnectionService>();\n mAcceptThread = new AcceptThread(mContext, mHandler, services, this);\n }",
"@Override\n\tpublic void run() {\n\t\trespond();\n\t\tlisten();\n\t}",
"public void runServer() {\n\t\tint i = 0;\n\n\t\tclientList = new ArrayList<>();\n\t\ttry {\n\t\t\tServerSocket listener = new ServerSocket(port);\n\n\t\t\tSocket server;\n\n\t\t\tprintDetails();\n\n\t\t\twhile ((i++ < maxConnections) || (maxConnections == 0)) {\n\n\t\t\t\tserver = listener.accept();\n\t\t\t\tSession session = new Session(server, this.storageLocation );\n\n\t\t\t\tnew Thread(session).start();\n\n\t\t\t\tString name = session.getName();\n\t\t\t\tSystem.out.printf(\"%s STARTED\\r\\n\", name );\n\t\t\t\tclientList.add( session );\n\t\t\t\tdoGC();\n\n\t\t\t}\n\t\t} catch (IOException ioe) {\n\t\t\tSystem.out.println(\"IOException on socket listen: \" + ioe);\n\t\t\tioe.printStackTrace();\n\t\t}\n\t}",
"private void resumeListening() {\n Thread listener = new Thread() {\n @Override\n public void run() {\n try {\n mListenerSocket = new ServerSocket();\n mListenerSocket.setReuseAddress(true);\n mListenerSocket.bind(new InetSocketAddress(LOCAL_PORT));\n while (true) {\n Socket connSocket = mListenerSocket.accept();\n Scanner sc = new Scanner(connSocket.getInputStream());\n String encMsg = sc.nextLine();\n connSocket.close();\n sc.close();\n Message msg = mHandler.obtainMessage();\n msg.obj = encMsg;\n mHandler.sendMessage(msg);\n }\n } catch (IOException e) {\n Log.d(\"LANConnection\", \"Stopping listener thread due to error\", e);\n }\n }\n };\n listener.start();\n }",
"public Server() {\n print_addr();\n follow_updates();\n }",
"public void listen() {\n\t\t\n\t\twhile(true) {\n\t\t\t\n\t\t\tDatagramPacket packet = new DatagramPacket(recieveData, MAX_SIZE);\n\t\t\tint available = 0;\n\t\t\t\n\t\t\ttry {\n\t\t\t\t//The 'receive(...)' method fills up the buffer of the packet we passed into it with the data received\n\t\t\t\tmainSocket.receive(packet);\n\t\t\t\t//available = packet.getLength();\n\t\t\t\tbyte[] data = packet.getData();\n\t\t\t\t\n\t\t\t\tif(data[0] == HEADER && data[1] == CONNECTION)\n\t\t\t\t\tif(askUser(packet, available))\n\t\t\t\t\t\tmakeClientThread();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\tcatch(PortUnreachableException ex) {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"PortUnreachableException caught in server side.\\n Unable to recieve packet\\n\");\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t\tcatch (IOException ex) {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"1. IOException Caught in server side.\\n Unable to vertify user\\n\");\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public abstract void handleServer(ServerConnection conn);",
"public void listen() throws IOException {\n listen(Thread.currentThread());\n }",
"public abstract void listen(ServiceConfig serviceConfig) throws IOException;",
"protected abstract void onConnect();",
"public void startServer() {\n\r\n try {\r\n echoServer = new ServerSocket(port);\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n // Whenever a connection is received, start a new thread to process the connection\r\n // and wait for the next connection.\r\n while (true) {\r\n try {\r\n clientSocket = echoServer.accept();\r\n numConnections++;\r\n ServerConnection oneconnection = new ServerConnection(clientSocket, numConnections, this);\r\n new Thread(oneconnection).start();\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }\r\n\r\n }",
"public void run() {\n try {\n this.listener = new ServerSocket(port);\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n // On new connections, start a new thread to handle communications.\n try {\n while(true) {\n new Handler(this.listener.accept()).start();\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n this.listener.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }",
"protected void listen(int backlog) throws IOException {\n return;\n }",
"public void startServer() throws Exception\n {\n\t\t\tString SERVERPORT = \"ServerPort\";\n\t\t\tint serverport = Integer.parseInt(ConfigurationManager.getConfig(SERVERPORT));\n\t\t\t\n \n Srvrsckt=new ServerSocket ( serverport );\n while ( true )\n {\n Sckt =Srvrsckt.accept();\n new Thread ( new ConnectionHandler ( Sckt ) ).start();\n }\n \n \n\n\n }",
"protected abstract void startListener();",
"void onConnectionAdded(SocketConnection connection);",
"@Override\r\n\tpublic void run() {\n\t boolean listen = true;\r\n\t while (listen) {\r\n\t\ttry {\r\n\t\t Socket socket = listeningSocket.accept();\r\n\t\t Thread ConnThread = new Thread (new Connection (socket, pid));\r\n\t\t ConnThread.start();\r\n\t\t connThreads.add(ConnThread);\r\n\t\t \r\n\t\t} catch (SocketException e) {\r\n\t\t // TODO Auto-generated catch block\r\n\t\t listen = false;\r\n\t\t} catch (Exception e) {\r\n\t\t System.err.println(\"Random exception\");\r\n\t\t}\r\n\t }\r\n\t}",
"@Override\n public void run()\n {\n while (true)\n {\n try\n {\n final Socket socket = m_ServerSocket.accept(); // NOFORTIFY: unreleased resource:\n //resources are managed by the remote channel lookup\n m_Logging.info(\"Connection made from %s for remote interface\", \n socket.getRemoteSocketAddress());\n \n m_RemoteChannelLookup.newServerSocketChannel(socket);\n }\n catch (final IOException e)\n {\n if (m_ServerSocket.isClosed())\n {\n m_Logging.info(\"Server socket has been closed, will stop accepting connections\");\n return;\n }\n }\n }\n }",
"private void runServer() {\n while(true) {\n try {\n SSLSocket socket = (SSLSocket)listener.accept();\n\n this.establishClient(socket);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }",
"public void onConnection();",
"@Override\r\n\t\tpublic void onConnect(Connection connection) {\n\r\n\t\t}",
"private RRCPConnectionListener() {\n mainThread = new Thread(this);\n }",
"public void startServer()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t}\r\n\t\tcatch (IOException e1)\r\n\t\t{\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Waiting for client connection.\");\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\tSocket socket = serverSocket.accept();\r\n\t\t\tSystem.out.println(\"Client connects.\");\r\n\r\n\t\t\tObjectInputStream ois = null;\r\n\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tois = new ObjectInputStream(new BufferedInputStream(socket.getInputStream()));\r\n\t\t\t\tObject o = ois.readObject();\r\n\t\t\t\tif (!(o instanceof Message))\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new Exception(\"Received information is not message. Skip.\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmessage = (Message) o;\r\n\t\t\t\tSystem.out.println(\"Message received: \" + message);\r\n\t\t\t}\r\n\t\t\tcatch (IOException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tcatch (ClassNotFoundException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tcatch (Exception e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tfinally\r\n\t\t\t{\r\n\t\t\t\tCloseUtil.closeAll(ois, socket, serverSocket);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (IOException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public void listen() {\n\t\tthread(\"NetworkClientInput\", () -> {\n\t\t\twhile (true) {\n\t\t\t\ttry {\n\t\t\t\t\tString str = in.readLine();\n\t\t\t\t\t\n\t\t\t\t\tif (str == null)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"[CLIENT] Received: \" + str);\n\t\t\t\t\ttry {\n\t\t\t\t\t\thandle(str);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tSystem.err.println(\"[Client] Error handling input\");\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(\"[Client] Disconnected.\");\n\t\t\t\t\tconnected = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tconnected = false;\n\t\t\texecutor.shutdown();\n\t\t\tsocket.close();\n\t\t});\n\t}",
"private void initServerSocket()\n\t{\n\t\tboundPort = new InetSocketAddress(port);\n\t\ttry\n\t\t{\n\t\t\tserverSocket = new ServerSocket(port);\n\n\t\t\tif (serverSocket.isBound())\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Server bound to data port \" + serverSocket.getLocalPort() + \" and is ready...\");\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unable to initiate socket.\");\n\t\t}\n\n\t}",
"private void initBinding() throws IOException {\n serverSocketChannel.bind(new InetSocketAddress(0));\n serverSocketChannel.configureBlocking(false);\n serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);\n\n sc.configureBlocking(false);\n var key = sc.register(selector, SelectionKey.OP_CONNECT);\n uniqueContext = new ClientContext(key, this);\n key.attach(uniqueContext);\n sc.connect(serverAddress);\n }",
"@Override\r\n protected void onStart() {\r\n super.onStart();\r\n adapter.startListening();\r\n }",
"@Override protected void onStart()\n {\n super.onStart();\n adapter.startListening();\n }",
"protected void serverStopped()\n {\n // System.out.println\n // (\"Server has stopped listening for connections.\");\n }",
"@Override\n\tpublic void connectionReady() {\n\t}",
"public void init(){\n\t\tmultiplexingClientServer = new MultiplexingClientServer(selectorCreator);\n\t}",
"@Override\r\n\tpublic void start() {\n\t\tscavenger.start();\r\n\t\tnew Thread() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\twhile (!serverSocket.isClosed()) {\r\n\t\t\t\t\tSocket socket = null;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tsocket = serverSocket.accept();\r\n\t\t\t\t\t\tscavenger.addSocket(socket);\r\n\t\t\t\t\t\tnew SynchronousSocketThread(socket).start();\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.start();\r\n\t}",
"public void startClientServer() {\n try {\n this.server_socket = new ServerSocket( port );\n this.start();\n } catch (IOException e ) {\n System.err.println( \"Failure: Socket couldn't OPEN! -> \" + e );\n } finally {\n System.out.println( \"Success: Server socket is now Listening on port \" + port + \"...\" );\n }\n }",
"@Override\n public void onFeedbackServerStarted() {\n }",
"private void listen() {\n System.out.println(\"launch listen task\");\n listenTask = new AsyncTask<Void, String, IOException>() {\n @Override\n protected IOException doInBackground(Void... params) {\n try (BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()))) {\n String line;\n while ((line = in.readLine()) != null) {\n System.out.println(\"receive \" + line);\n publishProgress(line);\n }\n } catch (SocketException e) {\n if (e.toString().equals(\"java.net.SocketException: Socket closed\")) {\n //that's what will happen when task.cancel() is called.\n System.out.println(\"listening is stopped as socket is closed\");\n return null;\n } else {\n e.printStackTrace();\n return e;\n }\n } catch (IOException e) {\n e.printStackTrace();\n return e;\n }\n return null;\n }\n\n @Override\n protected void onProgressUpdate(String... values) {\n handler.accept(new Message(MsgType.SERVER, values[0]));\n }\n\n @Override\n protected void onPostExecute(IOException e) {\n if (e == null) {\n handler.accept(new Message(MsgType.INFO, \"listening finished\"));\n } else {\n handler.accept(new Message(MsgType.ERROR,\n \"exception while listening\" + \"\\n\" + e.toString()));\n }\n }\n\n @Override\n protected void onCancelled() {\n super.onCancelled();\n }\n };\n //the listen task will last for a quite long time (blocking) and thus should run in a parallel pool.\n listenTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n }",
"protected void serverStopped()\n {\n System.out.println(\"Server has stopped listening for connections.\");\n }",
"public abstract void onConnect();",
"abstract void onConnect();",
"public void startServer(){\r\n try {\r\n\r\n while(true){\r\n\r\n s = sc.accept();\r\n new ServerThread(s).start();\r\n }\r\n }\r\n catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n finally {\r\n try {\r\n sc.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }",
"@Override\n protected void onStart() {\n super.onStart();\n adapter.startListening();\n }",
"public abstract void Listen() throws TransportLayerException;",
"public void run(){\n\t\t\n\t\twhile(true){\n\t\t\ttry {\n\t\t\t\tSocket s = listener.accept();\n\t\t\t\tnew ServerConnection(chatServ, s).start();\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\treturn; // stop listening\n\t\t\t}\n\t\t}\n\t}",
"@ Override\r\n\tpublic void start(Connection connection)\r\n\t{\n\r\n\t}",
"void onConnect(IServerConnection<_ATTACHMENT> connection);",
"void onServerBecomesAvailable(ServerBecomesAvailableEvent event);",
"protected void serverStopped()\r\n {\r\n System.out.println\r\n (\"Server has stopped listening for connections.\");\r\n }",
"@SubscribeEvent\n public void onServerStarting(FMLServerStartingEvent event) {\n // do something when the server starts\n Server server = new Server(event.getServer());\n }",
"public void startServer() {\n server.start();\n }"
] | [
"0.79635805",
"0.7439096",
"0.7434448",
"0.7373006",
"0.72837186",
"0.7253091",
"0.72395587",
"0.7186658",
"0.71187866",
"0.7057349",
"0.705525",
"0.7053482",
"0.70179766",
"0.6960774",
"0.69570124",
"0.69463605",
"0.6917087",
"0.6897275",
"0.6870307",
"0.68686193",
"0.6739891",
"0.67218333",
"0.67060995",
"0.6653337",
"0.6630527",
"0.66022986",
"0.6600125",
"0.6561158",
"0.6517221",
"0.6514984",
"0.64853954",
"0.6479598",
"0.6464473",
"0.6436468",
"0.6427563",
"0.6421535",
"0.64109784",
"0.6403096",
"0.64021343",
"0.6398093",
"0.6395689",
"0.639523",
"0.63939625",
"0.6384291",
"0.6375884",
"0.6364375",
"0.6362108",
"0.6360646",
"0.63585085",
"0.63398457",
"0.63354385",
"0.6310881",
"0.6306646",
"0.62987196",
"0.6289758",
"0.6285365",
"0.62706196",
"0.62705564",
"0.6266072",
"0.6265677",
"0.62645286",
"0.62515354",
"0.6243205",
"0.6240114",
"0.6239931",
"0.62361187",
"0.6235314",
"0.62333655",
"0.6231395",
"0.6228885",
"0.6216272",
"0.62098867",
"0.62096655",
"0.6207382",
"0.62069815",
"0.61950654",
"0.61757594",
"0.6175611",
"0.6160895",
"0.61607224",
"0.61602896",
"0.6151333",
"0.6149747",
"0.61475796",
"0.6141724",
"0.6138232",
"0.6137875",
"0.61297977",
"0.61240184",
"0.61208767",
"0.6118022",
"0.6115971",
"0.6115471",
"0.61143285",
"0.6106801",
"0.6101566",
"0.60993457",
"0.60989153",
"0.6097199",
"0.60945827"
] | 0.7401023 | 3 |
This method overrides the one in the superclass. Called when the server stops listening for connections. | protected void serverStopped()
{
System.out.println
("Server has stopped listening for connections.");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void StopListening()\n\t{\n\t\t\n\t}",
"protected void serverStopped()\n {\n System.out.println(\"Server has stopped listening for connections.\");\n }",
"protected void serverStopped()\n {\n // System.out.println\n // (\"Server has stopped listening for connections.\");\n }",
"public void stopListening() {\n try {\n mListenerSocket.close();\n } catch (IOException e) {\n // just log\n Log.e(\"LanConnection\",\"Error closing listener socket at \" + LOCAL_PORT, e);\n }\n }",
"public void stopListening() {\r\n\t\tlisten.stopListening();\r\n\t}",
"public void stopListening();",
"public void stopListening() {\n new Thread(new Runnable() {\n @Override\n public void run() {\n synchronized (ConnectionServer.this) {\n if (mAcceptThread != null) {\n mAcceptThread.cancel();\n mAcceptThread = null;\n }\n }\n }\n }).start();\n }",
"void onServerStopped();",
"@Override\n\tprotected void onStop() {\n\t\tsendMessageToService(ConnectionService.STOP);\n\t\tsuper.onStop();\n\t}",
"public void stopListening() {\n\t\tkeepListening = false;\n\t}",
"@Override\n public void onServerDisconnectedListener() {\n disconnect();\n\n if (serviceDisconnectedListener != null) {\n serviceDisconnectedListener.onServerDisconnectedListener();\n }\n }",
"public void stopListener(){\n\t\tsynchronized (httpServerMutex){\n\t\t\ttry{\n\t\t\t\tif( webServer != null ){\n\t\t\t\t\twebServer.shutdownServer();\n\t\t\t\t\twebServer = null; // NOPMD by luke on 5/26/07 11:10 AM\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch( InterruptedException e){\n\t\t\t\t//Ignore, InterruptedException don't matter in this context.\n\t\t\t}\n\t\t\tcatch( Exception e){\n\t\t\t\t//Ignore, InterruptedException don't matter in this context.\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public void stopListening() \n {\n keepListening = false;\n }",
"public static void stopServer() {\n try {\n clientListener.stopListener();\n server.close();\n connectionList.clear();\n } catch (IOException ex) {\n System.err.println(\"Error closing server: \\\"\" + ex.getMessage() + \"\\\"\");\n }\n System.out.println(\"SERVER SHUT DOWN\");\n }",
"public synchronized void disconnect()\r\n\t\t{\r\n\t\tif (state == RUNNING)\r\n\t\t stop();\r\n\t\tif (state == CLOSING_DOWN)\r\n\t\t {\r\n // Close the server socket\t\t \r\n try {\r\n \t\tserverSocket.close();\r\n \t}\r\n catch (IOException e)\r\n {\r\n }\r\n \r\n \t\t// flag the server as stopped\r\n \t\tstate = STOPPED;\r\n\t\t }\r\n\t\t}",
"public void serverStop() {\n\t\tJOptionPane.showMessageDialog(dlg, \"与服务器失去连接\");\n\t\tserver = null;\n\t\tconnectAction.setEnabled(false);\n\t\t\n\t}",
"@Override\r\n\t\t\t\tpublic void onServerDisconnect() {\n\t\t\t\t\tSystem.out.println(\"CONNECTION HAS BEEN LOST.\");\r\n\t\t\t\t}",
"private void stopServer() {\n\t\tlogger.trace(\"stopServer() is called\");\n\n\t\tif (socketListeningTask != null){\n\t\t\tsocketListeningTask.stopServer();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t//Sleep time is needed to prevent connection counter being reset too soon before socketListeningTask.stopServer() is completed. Sleep time may need to be increased if not enough.\n\t\t\t\tThread.sleep(200);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tSystem.err.println(\"thread sleep method of KKServerGUI is being interrupted.\");\n\t\t\t\tlogger.error(\"thread sleep method of KKServerGUI is being interrupted.\");\n\t\t\t}\n\t\t\t\n\t\t\tConnectionCounter.resetConnectionCounter();\n\t\t\tsocketListeningTask = null;\n\t\t\tserverStatusLabel.setText(serverStopped);\n\t\t\ttotalClientConectionLabel.setText(\"Client connections: 0\");\n\n\t\t\tstartServerToolBarButton.setEnabled(true);\n\t\t\tstopServerToolBarButton.setEnabled(false);\n\n\t\t\tconnectionCheckingTask.stopCheckingConnection();\n\t\t}\n\t}",
"@Override\n\tpublic void listenerClosed(ConnectionListenerEvent evt) {\n\t\t\n\t}",
"public void stopListeningFoConnection() {\n /* If it's running stop synchronization. */\n stopAllWorkerThreads();\n\n }",
"@Override\r\n\t\t\t\tpublic void onServerDisconnect() {\n\t\t\t\t}",
"public void stop() {\n\t\ttry {\n\t\t\tif (serverSocket != null)\n\t\t\t\tserverSocket.close();\n\t\t} catch (IOException ioe) {\n\t\t\t// shouldn't happen\n\t\t}\n\t}",
"@Override\n\tpublic void listenerInterrupted(ConnectionListenerEvent evt) {\n\t\t\n\t}",
"public void stopServer() {\n stop();\n }",
"protected void serverStopped() \n\t{\n\t\ttry\n\t\t{\n\t\t\tThread.sleep(500);\n\t\t} catch (InterruptedException e) {}\n\n\t\tlog.append(\"Server stopped accepting new clients - Press Listen to start accepting new clients\\n\");\n\t\tstatus.setText(\"Stopped\");\n\t\tstatus.setForeground(Color.RED);\n\t}",
"@OnClose\n public void end() {\n listener.connectionTerminated();\n Logger.getGlobal().info(\"Connection with \" \n + nickname + \" terminated.\\n\"); //$NON-NLS-1$ //$NON-NLS-2$\n }",
"public void stopCommunicationServer() {\n\t\t\tthis.running = false;\n\t\t}",
"private void closeServer() {\n\t\tif (listener != null && !listener.isClosed()) {\n\t\t\ttry {\n\t\t\t\tfor (String name : ConnectedClients.keySet()) {\n\t\t\t\t\tSystem.out.println(\"key: \" + name);\n\t\t\t\t\tArrayList<Object> ClientData = new ArrayList<Object>();\n\t\t\t\t\tClientData = ConnectedClients.get(name);\n\t\t\t\t\tDataOutputStream send = (DataOutputStream) ClientData.get(1);\n\t\t\t\t\tsend.writeUTF(\"SERVER DOWN\");\n\n\t\t\t\t}\n\t\t\t\t//close the socket \n\t\t\t\tlistener.close();\n\n\t\t\t} catch (IOException e) {\n\t\t\t\t// e.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public void stopServer() {\r\n\t\tserverRunning = false;\r\n\t}",
"abstract protected void onDisconnection();",
"@Override protected void onStop()\n {\n super.onStop();\n adapter.stopListening();\n }",
"void serverLostConnection();",
"@Override\n public void stop() {\n try {\n serverSocket.close();\n }\n catch (IOException e) {\n getExceptionHandler().receivedException(e);\n }\n\n // Close all open connections.\n synchronized (listConnections) {\n for (TcpConnectionHandler tch : listConnections)\n tch.kill();\n listConnections.clear();\n }\n\n // Now close the executor service.\n executorService.shutdown();\n try {\n executorService.awaitTermination(3, TimeUnit.SECONDS);\n }\n catch (InterruptedException e) {\n getExceptionHandler().receivedException(e);\n }\n }",
"protected void connectionClosed() {}",
"public void stop() {\n System.err.println(\"Server will stop\");\n server.stop(0);\n }",
"public synchronized void stopListening() {\n if (mCallback == null) {\n return;\n }\n\n mCallback = null;\n mContext.getSystemService(ConnectivityManager.class)\n .unregisterNetworkCallback(mConnectivityCallback);\n }",
"public void disconnect(){\n\n\t\tserverConnection.disconnect();\n\t}",
"void onConnectionRemoved(SocketConnection connection);",
"public void stop() {\n tcpServer.stopServer();\n ThreadExecutor.shutdownClient(this.getClass().getName());\n }",
"@Override\r\n protected void onStop() {\r\n super.onStop();\r\n adapter.stopListening();\r\n }",
"public void stop() {\n System.err.println(\"Server will stop\");\n server.stop(0);\n }",
"public void shutdown() {\n\t\tserver.stop(0);\n\t}",
"public void disconnect() {\n if (serverSocket != null) {\n try {\n serverSocket.close();\n Log.i(TAG, \"ServerSocket closed\");\n } catch (IOException e) {\n Log.e(TAG, \"Error closing the serverSocket\");\n }\n }\n\n sendDisconnectionMessage();\n\n // FIXME - Change this into a message sent it listener\n // Wait 2 seconds to disconnection message was sent\n Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n public void run() {\n WiFiDirectUtils.clearServiceRequest(wiFiP2PInstance);\n WiFiDirectUtils.stopPeerDiscovering(wiFiP2PInstance);\n WiFiDirectUtils.removeGroup(wiFiP2PInstance);\n\n serverSocket = null;\n isRegistered = false;\n clientsConnected.clear();\n }\n }, 2000);\n }",
"@Override\n protected void onStop() {\n super.onStop();\n if (isBounded) {\n unbindService(mConnection);\n isBounded = false;\n }\n }",
"public void stopServer() {\n\t\tthis.running=false;\t\t\t\t\t\t\t//the loop of the thread fails\n\t\ttry {\n\t\t\tthis.socket.close();\t\t\t\t\t//closes the socket\n\t\t}catch (Exception e) {\n\t\t\tSystem.out.println(\"TCPServer : Socket non fermé\");\n\t\t}\n\t}",
"@Override\n protected void onStop() {\n super.onStop();\n adapter.stopListening();\n }",
"private void stopServer() {\n if (mBluetoothGattServer == null) return;\n\n mBluetoothGattServer.close();\n }",
"@Override\n public void onDestroy() {\n Log.d(TAG, \"Shutting Server\");\n busHandler.sendMessage(busHandler.obtainMessage(BusHandler.DISCONNECT));\n }",
"public void stop() {\n server.stop();\n }",
"public void stop () {\n if (server != null)\n server.shutDown ();\n server = null;\n }",
"public void stop() {\n if (server != null) {\n server.shutdown();\n }\n }",
"public synchronized void shutdown() {\n server.stop();\n }",
"public void onStop() {\n connectivityMonitor.unregister();\n requestTracker.pauseRequests();\n }",
"public void shutDown()\n {\n stunStack.removeSocket(serverAddress);\n messageSequence.removeAllElements();\n localSocket.close();\n }",
"public void stopListening() throws IOException {\n\n if (threadListen != null) {\n if (v) Log.d(TAG, \"Stop listening\");\n threadListen.cancel();\n threadListen = null;\n setState(STATE_NONE);\n }\n }",
"public void stop() {\n while (currentState.get() == ServerConstants.SERVER_STATUS_STARTING) {\r\n try {\r\n Thread.sleep(500);\r\n } catch (InterruptedException e) {\r\n // Ignore.\r\n }\r\n }\r\n\r\n if (currentState.compareAndSet(ServerConstants.SERVER_STATUS_STARTED, ServerConstants.SERVER_STATUS_OFF)) {\r\n try {\r\n bossGroup.shutdownGracefully();\r\n workerGroup.shutdownGracefully();\r\n connectionPool.shutdownAll();\r\n\r\n failedTimes.set(0);\r\n\r\n logger.info(\"Netty server stopped\");\r\n } catch (Exception ex) {\r\n logger.warn(\"Failed to stop netty server (port={}), exception:\", port, ex);\r\n }\r\n }\r\n }",
"public void stop() {\n\t\tstopFlag.set(true);\n\t\tif (serverStarted.get()) {\n\t\t\tnotifyListener(\"About to stop server. \" + toString());\n\t\t\ttry {\n\t\t\t\tserverActivity.get();\n\t\t\t\tserverSocket.close();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tnotifyListener(\"Interrupted whilst waiting for the server start to finish. [message=\" + e.getMessage() + \"]\" + toString());\n\t\t\t} catch (ExecutionException e) {\n\t\t\t\tnotifyListener(\"Server start caused exception. [message=\" + e.getMessage() + \"]\" + toString());\n\t\t\t} catch (IOException e) {\n\t\t\t\tnotifyListener(\"Unable to close cleanly the server socket. [message=\" + e.getMessage() + \"]\" + toString());\n\t\t\t}\n\t\t\tserverStarted.set(false);\n\t\t} else {\n\t\t\tnotifyListener(\"Server already stopped. \" + toString());\n\t\t}\n\t}",
"@Override\r\n\tpublic void stopped() {\r\n\r\n\t\t// Stop timers\r\n\t\tsuper.stopped();\r\n\r\n\t\t// Disconnect\r\n\t\tdisconnect();\r\n\t}",
"public void shutdown() {\n try {\n \t\n \tserverSocket.close();\n \t\n } catch (Exception e) {\n System.err.println(e.getMessage());\n e.printStackTrace();\n }\n }",
"@Override\r\n\t\t\t\tpublic void onClientDisconnect(ServerConnection sc) {\n\t\t\t\t}",
"private void stopServer() {\n\t\ttry {\n//\t\t\tserver.shutdown();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: add message in UI for user\n\t\t}\n\t}",
"public void onConnectionClosed() {\r\n\t\tcurrentConnections.decrementAndGet();\r\n\t}",
"public void Stop() throws IOException {\n DisposeServer();\n }",
"public final void exit() {\n if (this.serverSocket instanceof ServerSocket) {\n try {\n this.serverSocket.close();\n } catch (IOException ex) {\n Logger.getLogger(ServerThread.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }",
"public void end() {\n \t\ttry {\n \t\t\tnameServerClient.leave();\n \t\t} catch (Exception e) {\n \t\t\t__.fwdAbort__(e);\n \t\t}\n \t}",
"@Override\r\n\t\t\t\tpublic void onClientDisconnect(ServerConnection sc) {\n\t\t\t\t\tSystem.out.println(\"CLIENT DISCONNECTED FROM SERVER.\");\r\n\t\t\t\t}",
"public void serverWasShutdown();",
"public void stop() throws IOException {\n kv_out.println_debug(\"Try to stop the handler\");\n isRunning = false;\n serverSocket.close();\n }",
"void handleConnectionClosed();",
"public void stopClient() {\r\n\r\n // send message that we are closing the connection\r\n mRun = false;\r\n\r\n if (mBufferOut != null) {\r\n mBufferOut.flush();\r\n mBufferOut.close();\r\n }\r\n\r\n try {\r\n if (mBufferIn != null) {\r\n mBufferIn.close();\r\n }\r\n }\r\n catch (IOException e) {\r\n Log.d(TAG, \"error closing input buffer: \" + e.getMessage());\r\n }\r\n\r\n try {\r\n if (socket != null) {\r\n socket.close();\r\n Log.i(TAG, \"Socket closed in stopClient\");\r\n }\r\n }\r\n catch (IOException e) {\r\n Log.e(TAG, \"error closing socket: \" + e.getMessage());\r\n }\r\n\r\n mMessageListener = null;\r\n mBufferIn = null;\r\n mBufferOut = null;\r\n mServerMessage = null;\r\n }",
"public void stop() {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tif (socket != null) {\n\t\t\t\tsocket.close();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Socket closed.\");\n\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n\t\n\t\t}\n\t}",
"public abstract void quitServer();",
"public void stopServer() throws IOException {\r\n b = false;\r\n serverSocket.close();\r\n }",
"@Override\n\tpublic void connectionClosed() {\n\t}",
"public void stop() {\n \n // first interrupt the server engine thread\n if (m_runner != null) {\n m_runner.interrupt();\n }\n\n // close server socket\n if (m_serverSocket != null) {\n try {\n m_serverSocket.close();\n }\n catch(IOException ex){\n }\n m_serverSocket = null;\n } \n \n // release server resources\n if (m_ftpConfig != null) {\n m_ftpConfig.dispose();\n m_ftpConfig = null;\n }\n\n // wait for the runner thread to terminate\n if( (m_runner != null) && m_runner.isAlive() ) {\n try {\n m_runner.join();\n }\n catch(InterruptedException ex) {\n }\n m_runner = null;\n }\n }",
"public void shutDownServer() throws IOException {\r\n \t\tthis.shutDownServer(true);\r\n \t}",
"public void kill() {\n this.server.stop();\n }",
"@Override\r\n public void stop() {\r\n\r\n _log.info(\"Start stoping the HornetQ connection channel\");\r\n for (String queue : queues) {\r\n Channel channel = channels.get(queue);\r\n try {\r\n Channels.fireStop(channel);\r\n } catch (HandlerException e) {\r\n _log.error(\"failed stop the channel queue [\" + queue + \"]\", e);\r\n }\r\n }\r\n _log.info(\"Finish stop the HornetQ connection channel\");\r\n\r\n }",
"@Override\n\tpublic void serverShutdown(int port, String host) {\n\t\t\n\t}",
"@Override\n\t\tpublic void onServerQuit(Vector<byte[]> outQ) {\n\t\t\t\n\t\t}",
"public void notifyServerStop(String msg);",
"public void stopServer() throws IOException {\n\t\tlistenThread.interrupt();\n\t\tlistenSocket.close();\n\t\tfor(TestInstance t: testInstances) t.abortTest();\n\t}",
"@Override\n\tpublic void onStop() {\n\n\t\t// If the client is connected\n\t\tif (mLocationClient.isConnected()) {\n\t\t\tstopPeriodicUpdates();\n\t\t}\n\n\t\t// After disconnect() is called, the client is considered \"dead\".\n\t\tmLocationClient.disconnect();\n\n\t\tsuper.onStop();\n\t}",
"public void stopInbound();",
"public void shutdown() {\n _udpServer.stop();\n _registrationTimer.cancel();\n _registrationTimer.purge();\n }",
"@Override\n\tpublic void onSocketRemoved(ISocketInstance childSocket) {\n\t\t\n\t}",
"void connectionHandlerRequestStopScanning();",
"protected void processDisconnection(){}",
"public static void stopServer()\n {\n keepRunning = false;\n Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, \"Stop server!\");\n }",
"private void disconnectFromServer() {\n\t\ttry {\n\t\t\tsocket.close();\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tSystem.out.println(\"CLIENT: Cannot disconnect from server\");\n\t\t}\n\t}",
"public void disconnectedFrom(ServerDescriptor desc);",
"public void afterProcessSession() throws Exception\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif (server != null)\r\n\t\t\t{\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tserver.close();\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception e)\r\n\t\t\t\t{\r\n\t\t\t\t\tlogMonitor(\"close server error: \" + e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t\tfinally\r\n\t\t\t\t{\r\n\t\t\t\t\tserver = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tIterator<Integer> sessionIds = handlers.keySet().iterator();\r\n\r\n\t\t\twhile (sessionIds.hasNext())\r\n\t\t\t{\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tTCPHandler handler = handlers.get(sessionIds.next());\r\n\r\n\t\t\t\t\tif (handler != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\thandler.stop(1000);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception e)\r\n\t\t\t\t{\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\thandlers.clear();\r\n\t\t}\r\n\t\tfinally\r\n\t\t{\r\n\t\t\tsuper.afterProcessSession();\r\n\t\t}\r\n\t}",
"void stopListener()\n {\n\n locationManager.removeUpdates(RetriveLocation.this);\n isListening = false;\n }",
"@Override\r\n protected void onDestroy() {\r\n super.onDestroy();\r\n socketManager.disconnectSocket();\r\n }",
"private void shutdown() {\n\t\ttry {\n\t\t\tsock.close();\n\t\t\tgame.handleExit(this);\n\t\t\tstopped = true;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}",
"public synchronized void stop() {\r\n\t\t//TODO read why stop is deprecated http://docs.oracle.com/javase/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html\r\n\t\tif (udplistener != null) {\r\n\t\t\tudplistener.datagramSocket.close();\r\n\t\t\tudpthread.stop();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tif (tcplistener != null) {\r\n\t\t\t\ttcplistener.serverSocket.close();\r\n\t\t\t\ttcpthread.stop();\r\n\t\t\t}\r\n\t\t} catch (IOException e) {e.printStackTrace();}\t\t\r\n\t}",
"public void shutdown() {\n\t\t//We call peers.values() and put into Array to create an unchanging copy, one that\n\t\t//does not shrink even as the sockets remove themselves from the peers list\n\t\t//this prevents a ConcurrentModificationException\n\t\tonline = false;\n\t\tArrayList<DecentSocket> connections = new ArrayList<DecentSocket>(peers.values());\n\t\tfor(DecentSocket socket: connections) {\n\t\t\tsocket.stop();\n\t\t}\n\t\tlistener.stop();\n\t\tchecker.stop();\n\t}",
"protected void stop() {\n keepGoing = false;\n // connect to myself as Client to exit\n try {\n new Socket(\"localhost\", port);\n } catch(Exception e) {\n // exception handling\n }\n }",
"@Override\n public void stopEndpoint() {\n if (!isRunning()) {\n return;\n }\n\n setRunning(false);\n\n try {\n try{\n if ( getServerSocket() != null ) {\n getServerSocket().close();\n }\n } catch (Throwable t){\n getLogger().log(Level.SEVERE,\n \"selectorThread.closeSocketException\", t);\n }\n\n unregisterComponents();\n\n clearTasks();\n } catch (Throwable t) {\n getLogger().log(Level.SEVERE,\"selectorThread.stopException\", t);\n }\n }",
"private void stopClient() {\n\n run = false;\n\n if (bufferOut != null) {\n bufferOut.flush();\n bufferOut.close();\n }\n\n messageListener = null;\n bufferIn = null;\n bufferOut = null;\n serverMessage = null;\n }"
] | [
"0.7918346",
"0.77657557",
"0.75930077",
"0.7453024",
"0.7355203",
"0.73545814",
"0.7345051",
"0.7204444",
"0.7048451",
"0.7030834",
"0.6964708",
"0.6937451",
"0.6934567",
"0.68804234",
"0.68437743",
"0.6840576",
"0.68204254",
"0.681471",
"0.6804768",
"0.6804489",
"0.67971873",
"0.6795303",
"0.67656666",
"0.67280173",
"0.6726384",
"0.6709898",
"0.6689887",
"0.66871876",
"0.664363",
"0.66416705",
"0.6640003",
"0.6637384",
"0.6626243",
"0.662196",
"0.6616332",
"0.66113603",
"0.6607082",
"0.66006726",
"0.65964645",
"0.6595067",
"0.6593086",
"0.6585463",
"0.65805584",
"0.65501744",
"0.65422446",
"0.65294296",
"0.652316",
"0.6523144",
"0.65217525",
"0.6489022",
"0.6480804",
"0.6479473",
"0.6470508",
"0.6469243",
"0.6468992",
"0.6461867",
"0.6445977",
"0.64306134",
"0.642387",
"0.6417639",
"0.6395434",
"0.6386913",
"0.6374578",
"0.63743013",
"0.6369397",
"0.63678426",
"0.63588977",
"0.63554615",
"0.63435555",
"0.63342726",
"0.6334123",
"0.6307981",
"0.6303965",
"0.6302146",
"0.6295293",
"0.6290525",
"0.62865674",
"0.62864035",
"0.626466",
"0.6255807",
"0.62504333",
"0.6249551",
"0.62458813",
"0.6236008",
"0.62235874",
"0.6222821",
"0.6214206",
"0.6213909",
"0.620836",
"0.6202475",
"0.6184568",
"0.61840767",
"0.61802226",
"0.61781096",
"0.6172903",
"0.6169055",
"0.6142616",
"0.6141592",
"0.61365414",
"0.61347157"
] | 0.77531743 | 2 |
Creates a Node that is FULL, and represents an allocated process. | public Node(int id, int index, int size){
processId = id;
startIndex = index;
this.size = size;
this.full = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void allocateNode(int processId){\n this.processId = processId;\n this.full = true;\n }",
"public void deallocateNode(){\n this.processId = NO_PROCESS;\n this.full = false;\n }",
"Node(){\n\t\t\tthis.array = new Node[256];\n\t\t\tthis.val = null;\n\t\t}",
"public Node(int index, int size){\n processId = NO_PROCESS;\n startIndex = index;\n this.size = size;\n this.full = false;\n }",
"@Override\n public void process() {\n Simulator.allocateServer(c);\n }",
"public Node() {\n name = null;\n missionDescription = null;\n roles = null;\n stateValueBindings = null;\n nodeRuntime = null;\n isNetworkSingleton = false;\n }",
"public Node()\n\t{\n\t\ttitle = \" \";\n\t\tavail = 0;\n\t\trented = 0;\n\t\tleft = null;\n\t\tright = null;\n\t\t\n\t}",
"public int allocate_pid()\n {\n int pid = 0;\n int size = MAX_PID - MIN_PID;\n //traverse untill we find a false value and pid vale is not equal to size \n while( pid!=size && pid_map[pid] != false )\n {\n pid++;\n }\n //if the value of pid is equal to the size of the map then all the pid's are occupied\n //so we return -1\n if(pid == size)\n {\n return -1;\n }\n //replace the false value with true\n pid_map[pid] = true;\n //return the pid + MIN_PID to bring the pid within range of MIN_PID and MAX_PID\n return pid+MIN_PID;\n }",
"public Proc() {\n\t\tpriority = Integer.MIN_VALUE; /*\n\t\t\t\t\t\t\t\t\t * This way new Proc objects will always\n\t\t\t\t\t\t\t\t\t * have a default lowest priority which can\n\t\t\t\t\t\t\t\t\t * be changed later\n\t\t\t\t\t\t\t\t\t */\n\t\tprocID = 0; // Default ID value that will likely be occupied\n\t\theapIndex = -1; // Invalid value for a new Proc, to keep the process from overwriting any used locations\n\t}",
"public int allocate_pid() {\r\n\t\tif (idnum == idSize)\r\n\t\t\treturn -1;\r\n\t\tfor (int i = 0; i < idSize; i++) {\r\n\t\t\tif (p_id[i] == 0) {\r\n\t\t\t\tp_id[i] = 1;\r\n\t\t\t\tidnum++;\r\n\t\t\t\treturn i + MIN_PID;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t}",
"private BTNode createNode() {\n BTNode btNode;\n btNode = new <DataPair>BTNode ();\n btNode.mIsLeaf = true;\n btNode.mCurrentKeyNum = 0;\n return btNode;\n }",
"protected NodeFigure createNodePlate() {\r\n\t\tDefaultSizeNodeFigure result = new DefaultSizeNodeFigure(12, 12);\r\n\t\treturn result;\r\n\t}",
"public GraphPool() {\n\t\tmMetadataPool = new PoolNodeMetadata();\n\t\tmIdentifierPool = new PoolNodeIdentifier(mMetadataPool);\n\t\tmLinkPool = new PoolExpandedLink(mIdentifierPool, mMetadataPool);\n\t}",
"void nodeCreate( long id );",
"public VMProcess() {\n\t\tsuper();\n\t}",
"public static Process createEntity() {\n Process process = new Process()\n .name(DEFAULT_NAME)\n .isRunning(DEFAULT_IS_RUNNING)\n .createdAt(DEFAULT_CREATED_AT)\n .updatedAt(DEFAULT_UPDATED_AT);\n return process;\n }",
"public static LabelToNode createIncremental()\n { return new LabelToNode(new SingleScopePolicy(), nodeAllocatorDeterministic()); }",
"protected void freeNode(int nodeNum) {\n\t\tsendMessage(\"/n_free\", new Object[] { nodeNum });\n\t}",
"public Node() {\n\t\tsplithorizon = false;\n\t\troutingTable = new ArrayList<ArrayList<Integer>>();\n\t\troutingTable.add(new ArrayList<Integer>());\n\t\troutingTable.add(new ArrayList<Integer>());\n\t\troutingTable.add(new ArrayList<Integer>());\n\t}",
"public Node()\n {\n this.name=\"/\";\n this.type=0;\n this.stage=0;\n children=new ArrayList<Node>();\n }",
"public MinHeap(){\r\n nextAvail = 1;\r\n }",
"public Node()\r\n\t{\r\n\t\tnext = null;\r\n\t\tinfo = 0;\r\n\t}",
"public void setAsStartingPoint() {\n\t\tnodeStatus = Status.occupied;\n\t}",
"public static UserProcess newUserProcess() {\n\treturn (UserProcess)Lib.constructObject(Machine.getProcessClassName());\n }",
"public Node() {\n pNext = null;\n }",
"public Process() {\n\t\tthis(null);\n\t}",
"public WaitingProcessQueue() {\r\n this.data = new CustomProcess[INITIAL_CAPACITY];\r\n }",
"public Node() {}",
"public Node() {}",
"public Node() {}",
"public Node() {}",
"public UserProcess() {\n\t fileDescriptors = new OpenFile[16];\n\n\t boolean interrupt = Machine.interrupt().disable();\n\n\t processId = processIdCounter++;\n\t if(parentProcess == null){\n\t\t\tstdin = UserKernel.console.openForReading();\n\t\t\tstdout = UserKernel.console.openForWriting();\n\t\t}else{\n\t\t\tstdin = parentProcess.stdin;\n\t\t\tstdout= parentProcess.stdout;\n\t\t}\n\n\t Machine.interrupt().restore(interrupt);\n\n\t fileDescriptors[0] = stdin;\n\t fileDescriptors[1] = stdout;\n\n\t childProcesses = new HashMap<Integer, UserProcess>();\n\t //exitStats = new HashMap<>();\n\n\t parentProcess = null;\n\t lock = new Lock();\n\n\t\tint numPhysPages = Machine.processor().getNumPhysPages();\n\t\tpageTable = new TranslationEntry[numPhysPages];\n\t\tfor (int i=0; i<numPhysPages; i++)\n\t\t\tpageTable[i] = new TranslationEntry(i,i, true,false,false,false);\n\n }",
"Process createProcess();",
"public Node() {\n this.nodeMap = new HashMap<>();\n }",
"private void createRootNode()\r\n {\r\n root = new Node(\"root\", null);\r\n Node.clear();\r\n }",
"public JobBuilder memoryPerNode(String memoryPerNode) {\r\n job.setMemoryPerNode(memoryPerNode);\r\n return this;\r\n }",
"public PlanElement createAllocation(Task t, Asset a){\n Date from = prefHelper.getReadyAt (t);\n Date to = prefHelper.getBestDate (t);\n\n double confidence = \n (((GLMAsset) a).hasOrganizationPG ()) ? allocHelper.MEDIUM_CONFIDENCE : allocHelper.HIGHEST_CONFIDENCE;\n\n if (isDebugEnabled())\n debug (getName () + \".createAllocation - ready at \" + from + \n\t \" - best \" + to + \" confidence \" + confidence);\n\n AspectValue [] values = new AspectValue [2];\n values[0] = AspectValue.newAspectValue (AspectType.START_TIME, from.getTime());\n values[1] = AspectValue.newAspectValue (AspectType.END_TIME, to.getTime());\n\n PlanElement pe = allocHelper.makeAllocation(this,\n\t\t\t\t\t\tldmf, realityPlan, t, a, \n\t\t\t\t\t\tvalues,\n\t\t\t\t\t\tconfidence,\n\t\t\t\t\t\tConstants.Role.TRANSPORTER);\n return pe;\n }",
"abstract AbstractRuntimeServiceNode<T> newRuntimeNode();",
"public Node() {\r\n\t\tthis.input = null;\r\n\t\tthis.inputWeights = null;\r\n\t}",
"private void updateLruWithNewNode(PageId pid, Page retrievedPage) {\n Node node = new Node(pid, retrievedPage);\n changeHead(node);\n bufferedPages.put(pid, node);\n }",
"public VMProcess() \n\t{\n\t\tsuper();\n\t}",
"public void MIPSme()\n {\n sir_MIPS_a_lot.getInstance().heap_allocate(size, targetReg);\n }",
"public Node createNode(String p_name) {\n\t\tNode n = new Node(p_name, this);\n\t\taddNode(n);\n\t\treturn n;\n\t}",
"void allocate(ApexFile parent_file, int link_factor){\n assert this.used == false;\n\n //delete the block from parent file\n\n // CHECK THAT IF THE PARENT FILE IS NULL THEN DO NOT DO THE DELETE BLOCK STEP\n if(this.parentFile != null){\n this.parentFile.deleteBlock(this);\n }\n\n this.parentFile = parent_file;\n this.used = true;\n this.hf = 1;//reset\n this.uf = 1;//reset\n this.lf = link_factor;//binaries or non binaries\n }",
"public Block allocateAt(long p) {\n for (Block b : freeSpace) {\n if (b.start == p)\n return checkout(b, b.length);\n }\n return null;\n }",
"public CassandraNode() {\r\n\t\tthis(null, 0);\r\n\t}",
"public Node()\n\t{\n\t\t\n\t\tdata = new IntData();\n\t\tdata.setData(Integer.MIN_VALUE);\n\t\tnext=null;\n\t}",
"public void createPartition(int nPid);",
"public void create(NetworkNode networkNode);",
"@Override\n\tpublic boolean isProcessForSessionAllocation() {\n\t\treturn false;\n\t}",
"void reserveNodes(int nodeCount) {\n\t\tm_list_nodes.setCapacity(nodeCount);\n\t}",
"public static GraphNode createGraphNodeForSubsystem() {\n GraphNode nameNode = new GraphNode();\n\n for (int i = 0; i < 3; i++) {\n GraphNode childNode = new GraphNode();\n\n childNode.setPosition(AccuracyTestHelper.createPoint(0, 12 * i));\n childNode.setSize(AccuracyTestHelper.createDimension(100, 22));\n\n nameNode.addContained(childNode);\n }\n\n nameNode.setPosition(AccuracyTestHelper.createPoint(20, 20));\n nameNode.setSize(AccuracyTestHelper.createDimension(100, 100));\n\n GraphNode graphNode = new GraphNode();\n graphNode.addContained(nameNode);\n graphNode.addContained(new GraphNode());\n\n graphNode.setPosition(AccuracyTestHelper.createPoint(20, 20));\n graphNode.setSize(AccuracyTestHelper.createDimension(1000, 1000));\n\n // create a subsystem\n Subsystem subsystem = new SubsystemImpl();\n\n // set namespace\n Namespace namespace = new MockNamespaceImplAcucracy();\n subsystem.setNamespace(namespace);\n\n // create a semantic model\n Uml1SemanticModelBridge semanticModel = new Uml1SemanticModelBridge();\n semanticModel.setElement(subsystem);\n\n graphNode.setSemanticModel(semanticModel);\n\n return graphNode;\n }",
"private NodeDB() {\n\t\tNodeInfo me = new NodeInfo();\n\t\tme.alive = true;\n\t\tme.nodecomms = ConfigManager.get().node_interface;\n\t\tme.nodehash = ConfigManager.get().nodehash;\n\t\tme.timestamp = System.currentTimeMillis();\n\t\tthis.update(new NodeDB.NodeInfo[] { me });\n\t\tthis.random = new Random();\n\t\tthis.random.setSeed(System.currentTimeMillis());\n\t}",
"public BPM getNode() {\n return BPMNode;\n }",
"public Heap() {\r\n\t\tthis(DEFAULT_INITIAL_CAPACITY, null);\r\n\t}",
"public Node(){}",
"public int allocate() {\n int freeBitIndex = nextAvailableBit();\n if (freeBitIndex == -1) {\n return -1; // All ids assigned\n }\n idPool.set(freeBitIndex); \n setBitsInTree(freeBitIndex);\n\n return freeBitIndex + 1 - maxId;\n }",
"public Node()\n {\n \n name = new String();\n type = new String(\"internal\"); //Initial Node type set to internal\n length = new Double(0); //Set initial branch length to zero\n children = new ArrayList<Node>();\n level = 0;\n treesize = new Double(0);\n depth = 0;\n newicklength = 0;\n startycoord = -1;\n startxcoord = -1;\n endxcoord = -1;\n endycoord = -1;\n standardy = -1;\n selected = false;\n xmultiplier = 0;\n ymultiplier = 0;\n }",
"public QueueNode() {\n first = null;\n last = null;\n n = 0;\n }",
"public static Node buildNextNode(Node Parent, Point newSpace){\r\n //start with a blank node\r\n Node child = new Node();\r\n \r\n //point its parent to the root node\r\n child.parent = Parent;\r\n \r\n //copy the parent's state\r\n for (int i = 0; i<puzzleSize; i++){\r\n for (int j = 0; j<puzzleSize; j++)\r\n child.state[i][j] = Parent.state[i][j];\r\n }\r\n \r\n //add 1 to the depth\r\n child.depth = Parent.depth + 1;\r\n \r\n //set the space to the argument provided\r\n child.setSpace(newSpace);\r\n \r\n //find value in position of newSpace, replace with zero\r\n int x = (int)newSpace.getX();\r\n int y = (int)newSpace.getY();\r\n int val = child.getState()[x][y];\r\n child.setState(x, y ,0);\r\n \r\n // find previous space, replace with value\r\n Point oldSpace = Parent.getSpace();\r\n int i = (int)oldSpace.getX();\r\n int j = (int)oldSpace.getY();\r\n child.setState(i, j, val);\r\n \r\n return child;\r\n }",
"MemoryPartition createMemoryPartition();",
"public Node() {\n portnum = 0;\n senders = new Hashtable<String, Sender>();\n }",
"public static LabelToNode createScopeByGraph() {\n return new LabelToNode(new GraphScopePolicy(), nodeAllocatorByGraph());\n }",
"void addNode()\n {\n Node newNode = new Node(this.numNodes);\n this.nodeList.add(newNode);\n this.numNodes = this.numNodes + 1;\n }",
"public Node()\n\t{\n\t\toriginalValue = sumValue = 0;\n\t\tparent = -1;\n\t}",
"@Override\n public Node getFullNode() {\n return getBasicNode();\n }",
"public static GeglNode newNode() {\n\t\treturn com.jibee.gegl.priv.Gegl.INSTANCE.gegl_node_new();\n\t}",
"private BlankNode createOwnBlankNode(final String name, final String uuid) {\n return new BlankNode() {\n @Override\n public String ntriplesString() {\n return \"_: \" + name;\n }\n\n @Override\n public String uniqueReference() {\n return uuid;\n }\n\n @Override\n public int hashCode() {\n return uuid.hashCode();\n }\n\n @Override\n public boolean equals(final Object obj) {\n if (!(obj instanceof BlankNode)) {\n return false;\n }\n final BlankNode other = (BlankNode) obj;\n return uuid.equals(other.uniqueReference());\n }\n };\n }",
"public TtreeNode() {\n\t numberOfNodes++;\n\t }",
"public ChargeNode(Context context)\r\n {\r\nif (instanceCount == null) instanceCount = 1;\r\nelse instanceCount++;\r\nthis.thisInstance = instanceCount;\r\nLog.i(com.tumanako.ui.UIActivity.APP_TAG, String.format( \" ChargeNode -> Constructor (%d of %d)\", this.thisInstance,instanceCount ) );\r\n\r\n dashMessages = new DashMessages(context,this, intentFilters );\r\n weakContext = new WeakReference<Context>(context); \r\n resume(); // Start the update timer! \r\n }",
"public Node(){\n this(9);\n }",
"protected void addNode(NodeView nv, boolean locked) {\n\tCyNode node = (CyNode) nv.getNode();\n\tLayoutNode v = new LayoutNodeImpl(nv, nodeIndex++);\n\tnodeList.add(v);\n\tnodeToLayoutNode.put(node, v);\n\n\tif (locked) {\n\t v.lock();\n\t lockedNodes++;\n\t} else {\n\t updateMinMax(nv.getXPosition(), nv.getYPosition());\n\t this.width += nv.getWidth();\n\t this.height += nv.getHeight();\n\t}\n }",
"public MemManager( int poolSize )\n {\n\n this.poolSize = poolSize;\n memoryPool = new byte[poolSize];\n // creates a twoWayLinkedList that will store HashMaps defining the\n // blocks\n // of free space within our pool\n freeBlock = new HashMap<Integer, Integer>( 1 );\n freeBlock.put( 0, poolSize );\n freeBlockList = new TwoWayLinkedList<HashMap<Integer, Integer>>();\n // Initially adds the entire memory\n freeBlockList.add( freeBlock );\n\n }",
"@Override\n public String visit(HAllocate n) {\n String _ret = null;\n /*\n * li $a0, 16\n * jal _halloc\n */\n this.moveReg = \"a0\";\n n.f1.accept(this);\n Global.outputString += \"jal _halloc\\n\";\n return _ret;\n }",
"public ThreadedTreeNode createThreadedBinaryTree()\n\t{\n\t\tThreadedTreeNode head=new ThreadedTreeNode();\n\t\tThreadedTreeNode a=new ThreadedTreeNode(80);\n\t\tThreadedTreeNode b=new ThreadedTreeNode(70);\n\t\tThreadedTreeNode c=new ThreadedTreeNode(90);\n\t\tThreadedTreeNode d=new ThreadedTreeNode(65);\n\t\tThreadedTreeNode e=new ThreadedTreeNode(75);\n\t\tThreadedTreeNode f=new ThreadedTreeNode(95);\n\t\tThreadedTreeNode g=new ThreadedTreeNode(85);\n\t\thead.left=a;\n\t\thead.right=head;\n\t\t\n\t\ta.left=b;\n\t\ta.right=c;\n\t\tb.left=d;\n\t\tb.right=e;\n\t\tc.left=g;\n\t\tc.right=f;\n\t\t//use empty links as threads\n\t\td.right=b;\n\t\td.rthread=1;\n\t\te.right=a;\n\t\te.rthread=1;\n\t\tg.right=c;\n\t\tg.rthread=1;\n\t\t\t\t\n\t\treturn head;\n\t\t\n\t}",
"public Map createBuffer() {\n // Get the available processors, processors==threads is probably best?\n Runtime runtime = Runtime.getRuntime();\n int nProcessors = runtime.availableProcessors();\n int nThreads = 1; // nProcessors/2;\n compute();\n return serviceArea;\n }",
"void createGraphForMassiveLoad();",
"private void addNode() {\n // Add GUI node\n int nodeCount = mGraph.getNodeCount();\n Node node = mGraph.addNode(String.valueOf(nodeCount));\n node.addAttribute(\"ui.label\", nodeCount);\n\n // Add Node_GUI node for algorithm to read from\n Node_GUI listNode = new Node_GUI();\n mNodeList.add(listNode);\n }",
"public void blank() {\r\n\t\trunning = false;// sets the simulation to stopped\r\n\t\tfor (int i = 0; i < TOTAL_TILES; i++)// loops through all tiles\r\n\t\t\tnodes[i] = new Node(new Point(i / WIDTH_TILES * SIZE_TILES, i % HEIGHT_TILES * SIZE_TILES), new ImageIcon(\"empty.png\").getImage(), false, \"empty\");// sets empty tile\r\n\t}",
"public PDDeviceNProcess getProcess() {\n/* 93 */ COSDictionary process = (COSDictionary)this.dictionary.getDictionaryObject(COSName.PROCESS);\n/* 94 */ if (process == null)\n/* */ {\n/* 96 */ return null;\n/* */ }\n/* 98 */ return new PDDeviceNProcess(process);\n/* */ }",
"abstract protected T createModuleNode(NodeDescriptor node);",
"public Node()\r\n {\r\n initialize(null);\r\n lbl = id;\r\n }",
"private Node() {\n // Start empty.\n element = null;\n }",
"public Node clone() {\n Node n = new Node((float) this.getSimPos().getX(), (float) this.getSimPos().getY(), radius*2, isStationary, this.renderColor);\n n.node_uuid = this.node_uuid;\n return n;\n }",
"public void allocateToken(int tokenNum) {\n inflightingRPCCounter.addAndGet(tokenNum);\n lastUpdateTs = System.currentTimeMillis();\n }",
"public Node() {\r\n\t}",
"public Node() {\r\n\t}",
"MaximaProcess getProcess() {\r\n \t\trequestTimeHistory.add(System.currentTimeMillis());\r\n \r\n \t\t// Start a new one as we are going to take one...\r\n \t\tif (startupThrotle.availablePermits() > 0) {\r\n \t\t\tstartProcess();\r\n \t\t}\r\n \r\n \t\tMaximaProcess mp = null;\r\n \t\twhile (mp == null) {\r\n \t\t\ttry {\r\n \t\t\t\tmp = pool.take();\r\n \t\t\t} catch (InterruptedException e) {\r\n \t\t\t\t// If we failed to get one, wait a bit.\r\n \t\t\t\te.printStackTrace();\r\n \t\t\t\ttry {\r\n \t\t\t\t\tThread.sleep(3);\r\n \t\t\t\t} catch (InterruptedException ee) {\r\n \t\t\t\t\tee.printStackTrace();\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\tusedPool.add(mp);\r\n \t\tmp.activate();\r\n \r\n \t\treturn mp;\r\n \t}",
"public suiluppo_equip_allocation create(long equip_allocat_id);",
"public void addNode() {\r\n \r\n Nod nod = new Nod(capacitate_noduri);\r\n numar_noduri++;\r\n noduri.add(nod);\r\n }",
"public int allocate() {\n int setIndex = this.freeSet.nextSetBit(this.lastIndex);\n if (setIndex<0) { // means none found in trailing part\n setIndex = this.freeSet.nextSetBit(0);\n }\n if (setIndex<0) return -1;\n this.lastIndex = setIndex;\n this.freeSet.clear(setIndex);\n return setIndex + this.loRange;\n }",
"public void markProcessPidCreate() throws JNCException {\n markLeafCreate(\"processPid\");\n }",
"void createNode(NodeKey key);",
"public Node(){\n\n\t\t}",
"int memSize() {\n // treat Code as free\n return BASE_NODE_SIZE + 3 * 4;\n }",
"public HeapImp() {\n\t\tthis(10000);\n\t}",
"public ItemReference alloc();",
"public Process(int ID, int MaxMemUsage) \n {\n Random NumGen = new Random();\n \n m_Pause = false;\n ControlBlock = new PCB();\n ControlBlock.ID = ID;\n ControlBlock.MemUsage = NumGen.nextInt(409600) + 1; //random mem usage in bytes\n RunTime = NumGen.nextInt(30000); //random time in ms <= 6001\n if(RunTime < 1000){RunTime = 1000;}\n ControlBlock.TotalRunTime = RunTime;\n //ControlBlock.StartTime\n }",
"public Node() {\n }",
"public PhysicalMemory()\n {\n frames = new TreeMap<Long, MemoryFrame>();\n for (int i = 0; i < Const.MEM_FRAMES; i++) {\n MemoryFrame frame = new MemoryFrame(i);\n Long zero = new Long(i);\n frames.put(zero, frame);\n }\n }"
] | [
"0.78209674",
"0.664616",
"0.5467174",
"0.53751403",
"0.5332596",
"0.5326065",
"0.5313544",
"0.5312384",
"0.5311468",
"0.52662885",
"0.52061695",
"0.5178729",
"0.5175298",
"0.515514",
"0.5089584",
"0.5057817",
"0.5046828",
"0.5041812",
"0.4995518",
"0.498393",
"0.49702823",
"0.4959796",
"0.49514487",
"0.492588",
"0.49039146",
"0.48947352",
"0.4894726",
"0.48933133",
"0.48933133",
"0.48933133",
"0.48933133",
"0.488235",
"0.4877092",
"0.48721242",
"0.48520577",
"0.48504436",
"0.48462012",
"0.484617",
"0.48365423",
"0.4832454",
"0.48275128",
"0.48231173",
"0.48081297",
"0.48051986",
"0.4804906",
"0.4804474",
"0.48027545",
"0.4802176",
"0.47911832",
"0.47864723",
"0.47864366",
"0.47839168",
"0.47763613",
"0.4771555",
"0.47697195",
"0.47650203",
"0.4764442",
"0.474846",
"0.47446957",
"0.47439185",
"0.4711828",
"0.47070682",
"0.47063437",
"0.4702606",
"0.46908695",
"0.46853244",
"0.46683657",
"0.46646026",
"0.4660373",
"0.46517617",
"0.46387982",
"0.4637143",
"0.46361563",
"0.46343747",
"0.46342698",
"0.46301442",
"0.4624558",
"0.46193153",
"0.46176115",
"0.4613109",
"0.46112913",
"0.4611012",
"0.45942986",
"0.4585281",
"0.45839524",
"0.45816216",
"0.45816216",
"0.4578524",
"0.457702",
"0.45759735",
"0.4575509",
"0.45743817",
"0.4573818",
"0.45692906",
"0.45676547",
"0.45658517",
"0.45625237",
"0.45613378",
"0.45597777",
"0.45583948"
] | 0.5411366 | 3 |
Creates a Node that is EMPTY, and has no process Id. | public Node(int index, int size){
processId = NO_PROCESS;
startIndex = index;
this.size = size;
this.full = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Node() {}",
"public Node() {}",
"public Node() {}",
"public Node() {}",
"private void createRootNode()\r\n {\r\n root = new Node(\"root\", null);\r\n Node.clear();\r\n }",
"public Node() {\n }",
"public Node() {\r\n\t}",
"public Node() {\r\n\t}",
"public Node()\r\n {\r\n initialize(null);\r\n lbl = id;\r\n }",
"private Node() {\n // Start empty.\n element = null;\n }",
"public Node() {\n\t}",
"private BlankNode createOwnBlankNode(final String name, final String uuid) {\n return new BlankNode() {\n @Override\n public String ntriplesString() {\n return \"_: \" + name;\n }\n\n @Override\n public String uniqueReference() {\n return uuid;\n }\n\n @Override\n public int hashCode() {\n return uuid.hashCode();\n }\n\n @Override\n public boolean equals(final Object obj) {\n if (!(obj instanceof BlankNode)) {\n return false;\n }\n final BlankNode other = (BlankNode) obj;\n return uuid.equals(other.uniqueReference());\n }\n };\n }",
"public CassandraNode() {\r\n\t\tthis(null, 0);\r\n\t}",
"public Node(){}",
"public Node() {\n name = null;\n missionDescription = null;\n roles = null;\n stateValueBindings = null;\n nodeRuntime = null;\n isNetworkSingleton = false;\n }",
"public Node() {\n\n }",
"public void allocateNode(int processId){\n this.processId = processId;\n this.full = true;\n }",
"private Node() {\n\n }",
"public Node()\r\n\t{\r\n\t\tnext = null;\r\n\t\tinfo = 0;\r\n\t}",
"void nodeCreate( long id );",
"public Node()\n {\n this.name=\"/\";\n this.type=0;\n this.stage=0;\n children=new ArrayList<Node>();\n }",
"public Node() {\r\n\t\tthis.input = null;\r\n\t\tthis.inputWeights = null;\r\n\t}",
"public Node() {\n this.nodeMap = new HashMap<>();\n }",
"public Node() {\n pNext = null;\n }",
"private BTNode createNode() {\n BTNode btNode;\n btNode = new <DataPair>BTNode ();\n btNode.mIsLeaf = true;\n btNode.mCurrentKeyNum = 0;\n return btNode;\n }",
"public NodeInfo() {\n }",
"public Node(){\n }",
"public static LinkedList createEmpty(){\n return new LinkedList();\n }",
"public void makeEmpty()\n {\n root = nil;\n }",
"public Node(){\n\n\t\t}",
"TNode createTNode();",
"Node(){\r\n\t\tdata = null;\r\n\t\tnext = null;\r\n\t}",
"public Node()\n\t{\n\t\t\n\t\tdata = new IntData();\n\t\tdata.setData(Integer.MIN_VALUE);\n\t\tnext=null;\n\t}",
"public Node() {\n portnum = 0;\n senders = new Hashtable<String, Sender>();\n }",
"public void makeEmpty( )\r\n\t{\r\n\t\troot = null;\r\n\t}",
"public void create(NetworkNode networkNode);",
"public BinaryNode() {\n\t\tthis(null);\t\t\t// Call next constructor\n\t}",
"public Node generateDefaultNode(Position pos) {\n\t\tNode n = generateNode(pos);\n\t\tn.finishInitializationWithDefaultModels(true);\n\t\treturn n;\n\t}",
"public void setAsEmpty(){\n\t\tnodeStatus = Status.empty;\n\t\tunitNum=-1;\n\t}",
"public Node() {\n\t\tdata = null;\n\t\tnext = null;\n\t\tprevious = null;\n\t}",
"public void makeEmpty() {\n root = null;\n }",
"void createNode(NodeKey key);",
"private Node createNullLeaf(Node parent) {\n Node leaf = new Node();\n leaf.color = Color.BLACK;\n leaf.isNull = true;\n leaf.parent = parent;\n leaf.count = Integer.MAX_VALUE;\n leaf.ID = Integer.MAX_VALUE;\n return leaf;\n }",
"@Override\n public boolean isMissingNode() { return false; }",
"Node(){\n\t\t\tthis.array = new Node[256];\n\t\t\tthis.val = null;\n\t\t}",
"public Builder clearNode() {\n if (nodeBuilder_ == null) {\n node_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000001);\n onChanged();\n } else {\n nodeBuilder_.clear();\n }\n return this;\n }",
"public Node() \r\n\t{\r\n\t\tincludedNode = new ArrayList<Node>();\r\n\t\tin = false; \r\n\t\tout = false;\r\n\t}",
"public Node()\n\t{\n\t\ttitle = \" \";\n\t\tavail = 0;\n\t\trented = 0;\n\t\tleft = null;\n\t\tright = null;\n\t\t\n\t}",
"public void makeEmpty() {\n\t\troot = null;\n\t}",
"public void makeEmpty() {\r\n\t\troot = null;\r\n\t}",
"public Node()\n {\n \n name = new String();\n type = new String(\"internal\"); //Initial Node type set to internal\n length = new Double(0); //Set initial branch length to zero\n children = new ArrayList<Node>();\n level = 0;\n treesize = new Double(0);\n depth = 0;\n newicklength = 0;\n startycoord = -1;\n startxcoord = -1;\n endxcoord = -1;\n endycoord = -1;\n standardy = -1;\n selected = false;\n xmultiplier = 0;\n ymultiplier = 0;\n }",
"public TreeNode() {\n // do nothing\n }",
"public TreeNode()\r\n\t\t{\r\n\t\t\thead = null; //no data so set head to null\r\n\t\t}",
"public Node()\n\t{\n\t\toriginalValue = sumValue = 0;\n\t\tparent = -1;\n\t}",
"public void blank() {\r\n\t\trunning = false;// sets the simulation to stopped\r\n\t\tfor (int i = 0; i < TOTAL_TILES; i++)// loops through all tiles\r\n\t\t\tnodes[i] = new Node(new Point(i / WIDTH_TILES * SIZE_TILES, i % HEIGHT_TILES * SIZE_TILES), new ImageIcon(\"empty.png\").getImage(), false, \"empty\");// sets empty tile\r\n\t}",
"protected GraphNode() {\n }",
"protected GraphNode() {\n }",
"public FlowNodeInstance() {\n\t}",
"private HashNode() {\r\n key = null;\r\n value = null;\r\n }",
"public Builder clearNodeCharacteristicIdNull() {\n \n nodeCharacteristicIdNull_ = false;\n onChanged();\n return this;\n }",
"public VISNode() {\n this.model = new VISNodeModel();\n }",
"public QueueNode() {\n first = null;\n last = null;\n n = 0;\n }",
"private AsyncFuture<Void> createMembersNode(final String memberId) {\n return bind(op -> op\n .create()\n .creatingParentContainersIfNeeded()\n .withMode(CreateMode.EPHEMERAL)::inBackground,\n op -> op.forPath(MEMBERS + \"/\" + memberId, EMPTY_BYTES)).directTransform(event -> null);\n }",
"private HPTNode<K, V> buildRoot() {\n HPTNode<K, V> node = new HPTNode<K, V>(keyIdSequence++, null);\n node.children = reallocate(ROOT_CAPACITY);\n return node;\n }",
"public static INode createRootNode(INode node) {\n String type = node.getClass().getSimpleName();\n INode rootNode = createNode(type, node.getLabel(), IntegerOIDGenerator.getNextOID());\n rootNode.setRoot(true);\n return rootNode;\n }",
"private BinaryTree() {\n root = new Node(0);\n }",
"public Node createNode(int value) {\r\n\t\treturn new Node(value, null, null);\r\n\t}",
"public Node()\r\n\t{\r\n\t\tnext = null;\r\n\t\tprev = null;\r\n\t\telem = 0;\r\n\t}",
"public Builder clearNode() {\n if (nodeBuilder_ == null) {\n node_ = null;\n onChanged();\n } else {\n node_ = null;\n nodeBuilder_ = null;\n }\n\n return this;\n }",
"public Builder clearNode() {\n if (nodeBuilder_ == null) {\n node_ = null;\n onChanged();\n } else {\n node_ = null;\n nodeBuilder_ = null;\n }\n\n return this;\n }",
"@Override\n public void clear() {\n root = new Node ('i', false, 256);\n }",
"public Node() {\n\t\tsplithorizon = false;\n\t\troutingTable = new ArrayList<ArrayList<Integer>>();\n\t\troutingTable.add(new ArrayList<Integer>());\n\t\troutingTable.add(new ArrayList<Integer>());\n\t\troutingTable.add(new ArrayList<Integer>());\n\t}",
"public Node createNode(String p_name) {\n\t\tNode n = new Node(p_name, this);\n\t\taddNode(n);\n\t\treturn n;\n\t}",
"public Node clone() {\n Node n = new Node((float) this.getSimPos().getX(), (float) this.getSimPos().getY(), radius*2, isStationary, this.renderColor);\n n.node_uuid = this.node_uuid;\n return n;\n }",
"public Node()\n {\n\t this.data = 0;\n\t this.prev = null;\n\t this.next = null;\n }",
"public Tree() {\n // constructor. no nodes in tree yet\n root = null;\n }",
"Node() {\r\n this.k = null;\r\n this.v = null;\r\n this.c = null;\r\n kcount = 0;\r\n }",
"public Builder clearTreeNodeIdNull() {\n \n treeNodeIdNull_ = false;\n onChanged();\n return this;\n }",
"public Node(int id, int index, int size){\n processId = id;\n startIndex = index;\n this.size = size;\n this.full = true;\n }",
"private static NodeCppOSM createNodeIfNonexisting(\n \t\t\tGraphUndirected<NodeCppOSM, EdgeCppOSM> osmGraph,\n \t\t\tfinal Long nodeId) {\n \t\tif (osmGraph.getNode(nodeId) == null) {\n \t\t\tfinal NodeCppOSM newNode = new NodeCppOSM(nodeId);\n \t\t\tnewNode.setName(\"\"+nodeId);\n \t\t\tosmGraph.addNode(newNode);\n \t\t}\n \t\treturn osmGraph.getNode(nodeId);\n \t}",
"public static <T> DequeNode<T> createSentinelNode() {\n return new DequeNode<>(null);\n }",
"public Node(){\n this(9);\n }",
"public static GeglNode newNode() {\n\t\treturn com.jibee.gegl.priv.Gegl.INSTANCE.gegl_node_new();\n\t}",
"public Nodo() {\n\t\tthis(null, null);\n\t}",
"private static void createNodeIfNonexisting(\n \t\t\tGraphDirected<NodeCppOSMDirected, EdgeCppOSMDirected> osmGraph,\n \t\t\tfinal Long nodeId) {\n \t\tif (osmGraph.getNode(nodeId) == null) {\n \t\t\tfinal NodeCppOSMDirected newNode = new NodeCppOSMDirected(nodeId);\n \t\t\tnewNode.setName(\"\"+nodeId);\n \t\t\tosmGraph.addNode(newNode);\n \t\t}\n \t}",
"public void clear() {\n\t\tthis.root = new Node();\n\t}",
"public static TreeNode makeNull(ArrowType type) {\n return new NullNode(type);\n }",
"private void createNullVertex(int x, int y, DefaultGraphCell dad){\n\t\t\tDefaultGraphCell v = new DefaultGraphCell(\"\");\n\t\t\tnullnodes.add(v);\n\t\t\tDefaultPort port = new DefaultPort();\n\t\t\tv.add(port);\n\t\t\tport.setParent(v);\n\t\t\tint width = DEFAULT_NULL_SIZE.width;\n\t\t\tint height = DEFAULT_NULL_SIZE.height;\n\t\t\tGraphConstants.setBounds(v.getAttributes(), new\n\t\t\t\t\t Rectangle2D.Double(x-width/2,y,width,height));\n\t\t\tGraphConstants.setGradientColor(v.getAttributes(), Color.black);\n\t\t\tGraphConstants.setOpaque(v.getAttributes(), true);\n\t\t\tinsertEdge(getDefaultPort(dad), getDefaultPort(v));\n\t\t}",
"public static ClassNode createRootNode(Ontology o) {\n\t\treturn createRootNode(o, false, false);\n\t}",
"protected CreateMachineNodeModel() {\r\n super(0,1);\r\n }",
"public static void setNumberOfNodesFieldToZero() {\n numberOfNodes=0;\n\t }",
"private static Node createNode(int value) {\n\t\treturn new Node(value);\n\t}",
"public LinkedBinaryTree() { // constructs an empty binary tree\n\n }",
"public Node() {\n\t\tnumberOfAttacks = Integer.MAX_VALUE;\n\t\tstate = new State(); // Generate a random state.\n\t\t// Calculate its number of attacks.\n\t\tnumberOfAttacks = state.calculatenumberOfAttacks();\n\t}",
"protected SceneGraphObject createNode() {\n\tthrow new SGIORuntimeException(\"createNode() not implemented in class \"+this.getClass().getName());\n }",
"private void createNode() throws Exception {\n try {\n _curator.create().creatingParentsIfNeeded().forPath(_zkPath, new byte[0]);\n } catch (KeeperException.NodeExistsException e) {\n // Don't care\n }\n }",
"@Test\n\tpublic void testNodeInit() {\n\t\tNode<Integer> node = new Node<Integer>(3);\n\t\tassertTrue(node.getData() == 3);\n\t\tassertTrue(node.getParent() == null);\n\t\tassertTrue(node.countChildren() == 0);\n\t}",
"public static Node constructTree() {\n\n Node node2 = new Node(2, null, null);\n Node node8 = new Node(8, null, null);\n Node node12 = new Node(12, null, null);\n Node node17 = new Node(17, null, null);\n\n Node node6 = new Node(6, node2, node8);\n Node node15 = new Node(15, node12, node17);\n\n //Root Node\n Node node10 = new Node(10, node6, node15);\n\n return node10;\n }",
"public Element createEmptyElement(EmptyTask task) {\n\t\tElement empty = this.document.createElement(\"empty\");\n\t\t\n//\t\tBPELUtil.setStandardAttributes(empty, task);\n\t\t\n//\t\treturn createScopeForAttachedHandlers(empty, task);\n\t\treturn null;\n\t\t\n\t}",
"public EmptyOrganizer(Node node, ModelInstance modelInstance, IProcess parentProcess)\r\n {\r\n super(node, modelInstance, parentProcess);\r\n \r\n String emptyName = getAttribute(\"name\");\r\n element = (IBasicElement) modelInstance.getElement(emptyName);\r\n element.setParentProcess(parentProcess);\r\n ((IActivity)element).setName( emptyName );\r\n String suppresed = getAttribute( ATTRIBUTE_SUPPRESED_JOIN_FAILURE );\r\n \r\n if(suppresed == null)\r\n ((IActivity)element).useActivitySupressJoinFailure();\r\n \r\n ((IActivity)element).setSuppressJoinFailure( Boolean.parseBoolean( suppresed ) );\r\n\r\n empty = (IEmpty) element;\r\n }"
] | [
"0.6969877",
"0.6969877",
"0.6969877",
"0.6969877",
"0.6888063",
"0.6797845",
"0.67769355",
"0.67769355",
"0.6758983",
"0.673144",
"0.6674927",
"0.6620087",
"0.66164505",
"0.6611093",
"0.6577288",
"0.6484441",
"0.6476344",
"0.64444804",
"0.6419554",
"0.6359644",
"0.63488793",
"0.6301552",
"0.6273487",
"0.6265863",
"0.6233562",
"0.62239075",
"0.6180364",
"0.6168921",
"0.61567265",
"0.6156536",
"0.6146329",
"0.6083143",
"0.6078241",
"0.60653454",
"0.6048643",
"0.6027852",
"0.6022376",
"0.6010255",
"0.6002746",
"0.5977668",
"0.59767884",
"0.596046",
"0.59502405",
"0.5945177",
"0.5940219",
"0.5935737",
"0.5925349",
"0.59220314",
"0.591536",
"0.59104705",
"0.587839",
"0.5877524",
"0.58762497",
"0.58753985",
"0.5872885",
"0.58386874",
"0.58386874",
"0.582891",
"0.5810517",
"0.5806956",
"0.57857585",
"0.57644403",
"0.5757811",
"0.5755713",
"0.5752817",
"0.574762",
"0.5735464",
"0.5718296",
"0.57103413",
"0.57103413",
"0.57050353",
"0.5701961",
"0.56695616",
"0.56566703",
"0.5655652",
"0.56434864",
"0.56407577",
"0.5638246",
"0.56287867",
"0.5628562",
"0.56242776",
"0.561879",
"0.5602108",
"0.5598174",
"0.5586559",
"0.5569063",
"0.5560505",
"0.5554193",
"0.55489534",
"0.5543837",
"0.5536878",
"0.5533399",
"0.5519418",
"0.5518877",
"0.5518201",
"0.55105585",
"0.55033094",
"0.55014485",
"0.54910976",
"0.54855645"
] | 0.5512794 | 95 |
Adds a process to this node and sets it as Full | public void allocateNode(int processId){
this.processId = processId;
this.full = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean addProcess(Process p){\n\t\tioQueue.insert(p);\n\t\tstats.maxIOQueueSize = Math.max(stats.maxIOQueueSize, ioQueue.getQueueLength());\n\t\tif(currentProcess == null){\n\t\t\tstart();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t\t\n\t}",
"public void addProcess(Process4 p)\n\t{\n\t\tif(currentProcess == null)\n\t\t{\n\t\t\tcurrentProcess = p;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tProcesses.enqueue(p);\n\t\t}\n\t}",
"synchronized void addProcess(DpinProcess dp)\n{\n if (dp != null) process_set.put(dp.getId(),dp);\n notifyAll();\n}",
"public void startProcess() {\r\n\t\tprocess = true;\r\n\t}",
"public void addProcessPid() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"process-pid\",\n null,\n childrenNames());\n }",
"public void addProcess(Process p, PriorityQueue<Process> queue){\n \t\t// FCFS add's process directly to the end. \n\t\tp.setOrder(order);\n\t\torder++;\n\t\tqueue.add(p);\n\t}",
"public void enqueue(process p) {\n\t\tqueue.addLast(p);\n\t}",
"@Override\r\n\t\t\tpublic void autStartProcess() {\n\t\t\t}",
"public Process() {\n\t\tthis(null);\n\t}",
"protected void setProcess(Process rNewProcess)\n\t{\n\t\trProcess = rNewProcess;\n\t\tfragmentParam().annotate(PROCESS, rProcess);\n\t}",
"public void addJob(Process p) \n {\n \tif(p != null)\n \t\tprocesses.add(p);\n }",
"private void startProcess() {\r\n \t\tstartCount++;\r\n \t\tString threadName = Thread.currentThread().getName() + \"-starter-\" + startCount;\r\n \t\tThread starter = new Thread(threadName) {\r\n \t\t\t@Override\r\n \t\t\tpublic void run() {\r\n \t\t\t\tstartupThrotle.acquireUninterruptibly();\r\n \t\t\t\tlong startTime = System.currentTimeMillis();\r\n \t\t\t\tMaximaProcess mp = makeProcess();\r\n \t\t\t\tstartupTimeHistory.add(System.currentTimeMillis() - startTime);\r\n \t\t\t\tmp.deactivate();\r\n \t\t\t\tpool.add(mp);\r\n \t\t\t\tstartupThrotle.release();\r\n \t\t\t}\r\n \t\t};\r\n \t\tstarter.start();\r\n \t}",
"@Override\n public void process() {\n Simulator.allocateServer(c);\n }",
"public void deallocateNode(){\n this.processId = NO_PROCESS;\n this.full = false;\n }",
"public void coreProcess(Process coreProcess) {\r\n this.coreProcess = coreProcess;\r\n }",
"public void markProcessPidMerge() throws JNCException {\n markLeafMerge(\"processPid\");\n }",
"public void setProcess(ServiceProcess process) {\n\t\tthis.process = process;\n\t}",
"public void markProcessPidReplace() throws JNCException {\n markLeafReplace(\"processPid\");\n }",
"public void start() {\n process(0);\n }",
"@Override\n\t\t\tpublic void onProcess(int process) {\n\t\t\t}",
"public final void setProcessId(int pid) {\n \tif ( getOpenCount() == 0)\n \t\tm_pid = pid;\n }",
"public AsynchronousProcess(final Process process) {\n super();\n this.process = process;\n processWrapper = new PriTh(process, this);\n }",
"public void markProcessPidCreate() throws JNCException {\n markLeafCreate(\"processPid\");\n }",
"public void makeStandalone() {\n mCommonProcess = this;\n }",
"@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}",
"protected void startProcess() {\n System.out.println(\"Process started\");\r\n }",
"public void addJob(Process p) {\n // Remove the next lines to start your implementation\n //throw new UnsupportedOperationException();\n \n // Fill in this method\n /*------------------------------------------------------------*/\n\n //Add the job to the unfinished process queue if it is not already present\n if(!this.unfinishedJobs.contains(p)){\n this.unfinishedJobs.add(p);\n }\n /*------------------------------------------------------------*/\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}",
"public synchronized long queueProcess(AbstractProcess process) {\n\t\tif (process == null)\n\t\t\tthrow new NullPointerException();\n\t\t// TODO: See if this process already belongs to a process manager\n\t\tlong uid = uidGenerator.nextLong();\n\t\t// Prevent collisions (should be very unlikely)\n\t\twhile (processes.containsKey(uid)) {\n\t\t\tuid = uidGenerator.nextLong();\n\t\t}\n\t\tif (cullThread == null) {\n\t\t\tcullThread = new CullThread();\n\t\t\tcullThread.start();\n\t\t}\n\t\tprocess.setUID(uid);\n\t\tProcessEntry entry = new ProcessEntry(process);\n\t\tprocesses.put(uid, entry);\n\t\tprocess.addStatusListener(new ProcessManagerStatusListener(uid));\n\t\t// Queue it up\n\t\twaitingQueue.addLast(entry);\n\t\tcheckRunningProcesses();\n\t\treturn uid;\n\t}",
"public VMProcess() {\n\t\tsuper();\n\t}",
"public abstract void initializeProcess();",
"public void attach(Process p) {\n\t\tif (stdout == null) stdout = new StdOutReader();\n\t\tif (stderr == null) stderr = new StdErrReader();\n\t\tattach(p, stdout, stderr);\n\t}",
"public void setNumToProcess(long aNumToProcess) {\n numToProcess = aNumToProcess;\n }",
"public com.opentext.bn.converters.avro.entity.DocumentEvent.Builder clearProcessId() {\n processId = null;\n fieldSetFlags()[18] = false;\n return this;\n }",
"public void incrementProcess() {\n this.currProcessProgressValue++; \n this.pbarProcess.setValue(this.currProcessProgressValue); \n this.lblProgressCaption.setText(processCaption +\" \" +currProcessProgressValue+\n \" of \" + maximumchars+\" \"+processingCaption+\" \");\n //this.lblTimeCaption.setText(\"Time Remaining :\"+(maximumtime-this.currTimeProgressValue));\n decrementTime();\n }",
"public UserProcess() {\n\t fileDescriptors = new OpenFile[16];\n\n\t boolean interrupt = Machine.interrupt().disable();\n\n\t processId = processIdCounter++;\n\t if(parentProcess == null){\n\t\t\tstdin = UserKernel.console.openForReading();\n\t\t\tstdout = UserKernel.console.openForWriting();\n\t\t}else{\n\t\t\tstdin = parentProcess.stdin;\n\t\t\tstdout= parentProcess.stdout;\n\t\t}\n\n\t Machine.interrupt().restore(interrupt);\n\n\t fileDescriptors[0] = stdin;\n\t fileDescriptors[1] = stdout;\n\n\t childProcesses = new HashMap<Integer, UserProcess>();\n\t //exitStats = new HashMap<>();\n\n\t parentProcess = null;\n\t lock = new Lock();\n\n\t\tint numPhysPages = Machine.processor().getNumPhysPages();\n\t\tpageTable = new TranslationEntry[numPhysPages];\n\t\tfor (int i=0; i<numPhysPages; i++)\n\t\t\tpageTable[i] = new TranslationEntry(i,i, true,false,false,false);\n\n }",
"public RafProcess persistRafProcess(RafProcess rafProcess);",
"@Override\n public void addComponent(String name, AbstractProcess component)\n {\n components.add(name, component);\n addProcessToExec(name, component);\n }",
"public ManagedProcess(final String executable, final Process process) {\n myProcess = process;\n myOutput = new StringBuilder();\n\n myLock = new ReentrantLock();\n myLogUpdated = myLock.newCondition();\n\n myReader = new BufferedReader(new InputStreamReader(\n myProcess.getInputStream()));\n\n new Thread(new OutputReader(), executable + \" Process Drain\").start();\n }",
"public void addProcess(String name, int time, HashMap<Integer, Integer> listOfInOut, HashMap<Integer, Integer> listOfResource) {\n listOfProcess.add(new Processus(name, time, listOfInOut, listOfResource));\n }",
"public abstract void setProcessID(long pid);",
"public com.opentext.bn.converters.avro.entity.DocumentEvent.Builder setProcessId(java.lang.String value) {\n validate(fields()[18], value);\n this.processId = value;\n fieldSetFlags()[18] = true;\n return this;\n }",
"public static void printAdd(Process process) {\n\t\tSystem.out.println(\"Added: \"+ process.getName() + \" of size \" + process.getSize() \n\t\t\t\t\t+ \" and duration \"\t+ process.getDuration()\t);\t\t\n\t}",
"public edu.umich.icpsr.ddi.ProcStatType addNewProcStat()\n {\n synchronized (monitor())\n {\n check_orphaned();\n edu.umich.icpsr.ddi.ProcStatType target = null;\n target = (edu.umich.icpsr.ddi.ProcStatType)get_store().add_element_user(PROCSTAT$16);\n return target;\n }\n }",
"@Override\n public void addNode(node_data n) {\n this.modeCount += this.nodes.putIfAbsent(n.getKey(), n) == null ? 1 : 0; // if the node was already in the graph - it will simply do nothing, if it wasn't - it will add it to the graph and increment modeCount by 1\n }",
"public Process start() {\n\t\tif (ioQueue.isEmpty()) {\n\t\t\tcurrentProcess = null;\n\t\t\tgui.setIoActive(null);\n\t\t}else{\n\t\t\tcurrentProcess = (Process) ioQueue.removeNext();\n\t\t\tgui.setIoActive(currentProcess);\n\t\t}\n\t\treturn currentProcess;\n\t}",
"@JsonProperty(\"processClass\")\r\n @JacksonXmlProperty(localName = \"process_class\", isAttribute = true)\r\n public void setProcessClass(String processClass) {\r\n this.processClass = processClass;\r\n }",
"public void setNode(String procId) {\r\n\t\tif (recordRoute) {\r\n\t\t\tsuper.setNode(procId); //Record route\r\n\t\t} else {\r\n\t\t\t//Just set the processing node.\r\n\t\t\tthis.procNode = procId;\r\n\t\t}\r\n\t}",
"public Process() {\t// constructor with empty parameter\r\n\t\tthis.priority = -1;\t// int value will be -1\r\n \tthis.type = null;\t// String object initialized to null\r\n\t}",
"@Override\n\t\tpublic void processStatusChanged(ProcessStatusEvent event) {\n\t\t\tif (event.getNewStatus().isDead() && event.getOldStatus() == AbstractProcess.Status.RUNNING) {\n\t\t\t\tfreeProcess(uid);\n\t\t\t}\n\t\t}",
"public boolean add(ConProcess conProcess) throws AppException;",
"public SetPCProcess()\n {\n super(\"SetPC\");\n }",
"@Override\n public void run() {\n MemUsage memUsage = new MemUsage();\n Runtime run = Runtime.getRuntime();\n String memPath = \"/proc/\" + processId + \"/status\";\n LOG.info(\"Reading the file for memory: \" + memPath);\n String currentTime;\n File statusFile;\n float pcpu;\n int pmem;\n ProcessInfoBean processInfoBean = new ProcessInfoBean();\n processInfoBean.setLocalHostIp(ip);\n processInfoBean.setProceeName(processName);\n while (running) {\n pcpu = getCPUUsageByTopCommond(run, cmd);\n if (pcpu != -1) {\n statusFile = new File(memPath);\n if (statusFile.exists()) {\n pmem = memUsage.getMemUsage(statusFile);\n if (pmem != -1) {\n currentTime = TimeUtils.getCurrentTime();//获取系统当前时间\n processInfoBean.setUpdateTime(currentTime);\n processInfoBean.setCpuUsage(pcpu);\n processInfoBean.setMemUsage(pmem);\n processInfoBean.setPid(Integer.parseInt(processId));\n processInfoDao.insert_process_monitor(processInfoBean);\n MybatisUtils.session.commit();\n try {\n Thread.sleep(intervalTime);\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }\n }\n }\n }",
"private void setProcessId(int value) {\n\t\tthis.processId = value;\n\t}",
"public void addProcessus(Processus processus)\n\t\t{\n\t\tif (this.jPanelAction.getOrdonnanceur() == null) { return; }\n\n\t\tthis.jPanelAction.addProcessus(processus);\n\t\t}",
"public void inProcess(Class<?> cls) {\n inProcess.add(cls);\n }",
"public Builder setAlwaysProcess(boolean value) {\n \n alwaysProcess_ = value;\n onChanged();\n return this;\n }",
"public VMProcess() \n\t{\n\t\tsuper();\n\t}",
"public void setProcessSync(java.lang.Boolean processSync) {\n this.processSync = processSync;\n }",
"public void runNextProcess()\n\t{\n\t\tProcess4 temp = Processes.dequeue();\n\t\tcurrentProcess = temp;\n\t}",
"public void setAsStartingPoint() {\n\t\tnodeStatus = Status.occupied;\n\t}",
"public void setProcessId(String processId)\r\n\t{\r\n\t\tthis.processId = processId;\r\n\t}",
"void arrivingProcess(process theProcess, int time);",
"public void process() {\n\t}",
"public void process();",
"public RafProcess mergeRafProcess(RafProcess rafProcess);",
"protected void addNode(NodeView nv, boolean locked) {\n\tCyNode node = (CyNode) nv.getNode();\n\tLayoutNode v = new LayoutNodeImpl(nv, nodeIndex++);\n\tnodeList.add(v);\n\tnodeToLayoutNode.put(node, v);\n\n\tif (locked) {\n\t v.lock();\n\t lockedNodes++;\n\t} else {\n\t updateMinMax(nv.getXPosition(), nv.getYPosition());\n\t this.width += nv.getWidth();\n\t this.height += nv.getHeight();\n\t}\n }",
"public abstract void onProcess();",
"public PythonProcessManager(Ignite ignite) {\n this(new NativeProcessManager(ignite));\n }",
"public void updProcess(Process pold, Process pnew, PriorityQueue<Process> queue) {\n\t\tint oldorder = pold.getOrder();\n\t\tpnew.setOrder(oldorder);\n\t\tqueue.add(pnew);\n\t}",
"public void setProcesses(List<AProcess> processes) {\n this.processes = processes;\n }",
"@Override\n\tpublic String OpenProcessPost() {\n\t\treturn null;\n\t}",
"public void setProcessed (boolean Processed);",
"public void setProcessed (boolean Processed);",
"public void setProcessed (boolean Processed);",
"public void setProcessed (boolean Processed);",
"public void setProcessed (boolean Processed);",
"public void setProcessed (boolean Processed);",
"MaximaProcess makeProcess() {\r\n \t\treturn new MaximaProcess(processBuilder, processConfig);\r\n \t}",
"public void addAdjacentProcess(Process adjacentProcess) {\n\t\tthis.adjacentProcesses.add(adjacentProcess);\n\t}",
"private void setSmartpointProcess(ProcessRequest processRequest, InternalResultsResponse<Process> response)\r\n\t{\r\n\t\tProcess process = processRequest.getProcess();\r\n\r\n\t\tHashMap<String, Object> paramMap = new HashMap<String, Object>();\r\n\t\tparamMap.put(PROCESS_ID, process.getId());\r\n\t\tparamMap.put(PROCESS_RESULT, processRequest.getProcessItemStatusEnumValue());\r\n\t\tparamMap.put(FAILURE_ID, processRequest.getProcessStatusReasonEnumValue());\r\n\r\n\t\tList<ProcessItem> processItemFailureList = processRequest.getProcessItemFailureList();\r\n\t\tif (ValidationUtil.isNull(process.getProcessItems())\r\n\t\t\t\t&& !ValidationUtil.isNull(processRequest.getSearchLight()))\r\n\t\t{\r\n\t\t\tparamMap.put(PROCESS_ITEM_FAILURE_LIST, processItemFailureList);\r\n\r\n\t\t\tInquiryLightRequest lightRequest = createInquiryLightRequest(processRequest);\r\n\t\t\tparamMap.putAll(getParametersToFetchAllLights(lightRequest));\r\n\t\t\tdoInsert(getSqlSession(), INSERT_SMARTPOINT_PROCESS_DYNAMIC, paramMap, response);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Add the different process results\r\n\t\tinsertProcessItem(process.getProcessItems(), paramMap, response);\r\n\r\n\t\t// Add the different process results\r\n\t\tinsertProcessItem(processItemFailureList, paramMap, response);\r\n\t}",
"public Proc() {\n\t\tpriority = Integer.MIN_VALUE; /*\n\t\t\t\t\t\t\t\t\t * This way new Proc objects will always\n\t\t\t\t\t\t\t\t\t * have a default lowest priority which can\n\t\t\t\t\t\t\t\t\t * be changed later\n\t\t\t\t\t\t\t\t\t */\n\t\tprocID = 0; // Default ID value that will likely be occupied\n\t\theapIndex = -1; // Invalid value for a new Proc, to keep the process from overwriting any used locations\n\t}",
"public synchronized void setProcessingActivity(ProcessingActivity processingActivity){\n\t\tthis.processingActivity=processingActivity;\n\t}",
"public void addNode() {\r\n \r\n Nod nod = new Nod(capacitate_noduri);\r\n numar_noduri++;\r\n noduri.add(nod);\r\n }",
"public Process getProcess(){\n\t\treturn p;\n\t}",
"public Process getProcess() {\n return this.process;\n }",
"private synchronized void freeProcess(long uid) {\n\t\trunningCount--;\n\t\tlogger.debug(\"End process {}, have {} processes still running.\", uid, runningCount);\n\t\tcheckRunningProcesses();\n\t}",
"public synchronized void yeetProcess(Process p){\n pros.remove(p.getId());\n freshSort();\n }",
"public Node<T> put(T element) throws InterruptedException {\n do {\n // Get a free node.\n Node<T> freeNode = getFree();\n if (freeNode != null) {\n // Attach the element.\n return freeNode.attach(element);\n } else {\n // Block.\n waitForFree();\n }\n // Forever.\n } while (true);\n }",
"private synchronized void nodeProcessed(PackProcessingNode node) {\n if (processedCount.addAndGet(1) == processingNodes.size) {\n finishProcessing();\n }\n }",
"public Process getProcess() {\n \t\treturn process;\n \t}",
"public void AddArtifactInstance(ArtifactInstance Artifact, ProcessInstance Process)\r\n\t{\n\t\t\r\n\t\tProcess.addArtifactInstance(Artifact);\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"MaximaProcess getProcess() {\r\n \t\trequestTimeHistory.add(System.currentTimeMillis());\r\n \r\n \t\t// Start a new one as we are going to take one...\r\n \t\tif (startupThrotle.availablePermits() > 0) {\r\n \t\t\tstartProcess();\r\n \t\t}\r\n \r\n \t\tMaximaProcess mp = null;\r\n \t\twhile (mp == null) {\r\n \t\t\ttry {\r\n \t\t\t\tmp = pool.take();\r\n \t\t\t} catch (InterruptedException e) {\r\n \t\t\t\t// If we failed to get one, wait a bit.\r\n \t\t\t\te.printStackTrace();\r\n \t\t\t\ttry {\r\n \t\t\t\t\tThread.sleep(3);\r\n \t\t\t\t} catch (InterruptedException ee) {\r\n \t\t\t\t\tee.printStackTrace();\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\tusedPool.add(mp);\r\n \t\tmp.activate();\r\n \r\n \t\treturn mp;\r\n \t}"
] | [
"0.6037805",
"0.5914129",
"0.5875818",
"0.5860474",
"0.56274134",
"0.5581613",
"0.54542357",
"0.53845453",
"0.537783",
"0.5340303",
"0.52592266",
"0.52438414",
"0.5172131",
"0.503924",
"0.50265014",
"0.50001264",
"0.49671087",
"0.4948157",
"0.49191478",
"0.48894793",
"0.48779714",
"0.48592606",
"0.48576948",
"0.4848097",
"0.4824013",
"0.4824013",
"0.48214784",
"0.48198897",
"0.4808706",
"0.4808706",
"0.4808706",
"0.4808706",
"0.4808706",
"0.4808706",
"0.4808706",
"0.47821096",
"0.4766393",
"0.47283748",
"0.4716129",
"0.4715922",
"0.47147304",
"0.47106048",
"0.47095695",
"0.46831298",
"0.4679734",
"0.46713802",
"0.46326286",
"0.4628755",
"0.4628596",
"0.46284786",
"0.46180654",
"0.46156576",
"0.45973065",
"0.45972064",
"0.45908606",
"0.45783684",
"0.45721874",
"0.45495674",
"0.45376047",
"0.4520346",
"0.4498171",
"0.44968352",
"0.44928098",
"0.44925275",
"0.44844866",
"0.44823602",
"0.44823",
"0.44749135",
"0.44736",
"0.44587263",
"0.44487113",
"0.44291693",
"0.4418167",
"0.44171464",
"0.44144717",
"0.4411317",
"0.44074214",
"0.4407011",
"0.44018552",
"0.4395164",
"0.4395164",
"0.4395164",
"0.4395164",
"0.4395164",
"0.4395164",
"0.4394699",
"0.43941694",
"0.43923745",
"0.43819857",
"0.438014",
"0.43742797",
"0.43698943",
"0.43671352",
"0.43670455",
"0.43629438",
"0.43546405",
"0.43504542",
"0.4333484",
"0.4333133",
"0.43307436"
] | 0.65592253 | 0 |
Removes a process from this node and sets it as Empty. | public void deallocateNode(){
this.processId = NO_PROCESS;
this.full = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void unsetProcessPidValue() throws JNCException {\n delete(\"process-pid\");\n }",
"public com.opentext.bn.converters.avro.entity.DocumentEvent.Builder clearProcessId() {\n processId = null;\n fieldSetFlags()[18] = false;\n return this;\n }",
"public void markProcessPidDelete() throws JNCException {\n markLeafDelete(\"processPid\");\n }",
"public void remove() {\n\t\tprocess temp = queue.removeFirst();\n\t}",
"public com.opentext.bn.converters.avro.entity.ContentErrorEvent.Builder clearProcessId() {\n processId = null;\n fieldSetFlags()[8] = false;\n return this;\n }",
"public void unsetProcStat()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(PROCSTAT$16, 0);\n }\n }",
"public synchronized void yeetProcess(Process p){\n pros.remove(p.getId());\n freshSort();\n }",
"public void clear() {\n\t\tproc = \"\";\n\t}",
"public void removeRafProcess(RafProcess rafProcess);",
"public synchronized void deQueue(Process p){\n if(p.getId() == queue[0].getId()){\n for(int i =0; i<(queue.length-1);i++){\n queue[i] = queue[i+1];\n }\n queue[queue.length-1] = p;\n }else if(p.getId() == queue[1].getId()){\n for(int i = 1; i<(queue.length-1);i++){\n queue[i] = queue[i+1];\n }\n queue[queue.length-1] = p;\n }else return;\n }",
"@Override\n\tpublic void destroyProcess() {\n\t\tsuper.destroyProcess();\n\t\tDataDirRemoverHandler ddhHandler = \n\t\t\tnew DataDirRemoverHandler(getLogHandler());\n\t\tddhHandler.setRetryLimitInMillis(2000);\n\t\tddhHandler.execute();\n\t\tportsInUse.remove(port);\n\t}",
"public void remove() {\n removeNode(this);\n }",
"public Builder clearAlwaysProcess() {\n \n alwaysProcess_ = false;\n onChanged();\n return this;\n }",
"public void Kill() {\n\tif (process != null) {\n\t process.destroy();\n\t childStdin.Kill();\n\t childStdout.Kill();\n\t childStderr.Kill();\n\t}\n\tprocess = null;\n }",
"public int remove() \r\n { \r\n int v = h[1];\r\n hPos[v] = 0; // v is no longer in heap\r\n h[N+1] = 0; // put null node into empty spot\r\n \r\n h[1] = h[N--];\r\n siftDown(1);\r\n \r\n return v;\r\n }",
"public static void printRemove(Process process) {\n\t\tSystem.out.println(\"Removed: Process \" + process.getName() );\n\t}",
"@Override\n\t\tpublic void processStatusChanged(ProcessStatusEvent event) {\n\t\t\tif (event.getNewStatus().isDead() && event.getOldStatus() == AbstractProcess.Status.RUNNING) {\n\t\t\t\tfreeProcess(uid);\n\t\t\t}\n\t\t}",
"public void remove () { this.setAsDown(); n.remove(); }",
"public void reset() {\n \titems.clear();\n \tsetProcessCount(0);\n }",
"public void removeProcess(String processId) throws ProcessManagerException {\r\n try {\r\n ((UpdatableProcessInstanceManager) Workflow.getProcessInstanceManager())\r\n .removeProcessInstance(processId);\r\n } catch (WorkflowException we) {\r\n throw new ProcessManagerException(\"ProcessManagerSessionController\",\r\n \"processManager.ERR_REMOVE_PROCESS\", we);\r\n }\r\n }",
"public boolean removeJob(Process p)\n {\n \tif(activeJob != null && activeJob.equals(p))\n \t{\n \t\tactiveJob = null;\n \t\treturn true;\n \t}\n \treturn processes.remove(p);\n }",
"public void remove()\n {\n removed();\n node.shapeRemoved(shape);\n }",
"public void removeBootStrapNode() throws RemoteException{\n\t\tnodeIp=null;\n\t\thasNeighbours = false;\n\t\n\t}",
"public void remove(){\n\t\tqueueArray[1][0] = null;\n\t\tqueueArray[1][1] = null;\n\t}",
"public void remove() {\n btRemove().push();\n }",
"public void remove() {\n btRemove().push();\n }",
"public Node remove() {\n Node result = peek();\n\n //new root is last leaf\n heap[1] = heap[size];\n heap[size] = null;\n size--;\n\n //reconstruct heap\n shiftDown();\n\n return result;\n }",
"private synchronized void freeProcess(long uid) {\n\t\trunningCount--;\n\t\tlogger.debug(\"End process {}, have {} processes still running.\", uid, runningCount);\n\t\tcheckRunningProcesses();\n\t}",
"public synchronized void decrement() {\n --processCount_;\n if (processCount_ == 0) {\n process_.setReady();\n }\n }",
"void notifyProcessFinishedWith(MaximaProcess mp) {\r\n \t\tusedPool.remove(mp);\r\n \t}",
"public void clear( CachedNode node );",
"public Process delete(int p){\n\t\tif (search(p) == -1){\n\t\tSystem.out.println(p);\n\t\t\tSystem.out.println(\"error: tried to delete nonexistent process\");\n\t\t\treturn new Process(0, 0, \"errorprocess\");\n\t\t}\n\t\tProcess output = this.table[search(p)].getValue();\n\t\tthis.table[search(p)] = null;\n\t\treturn output;\n\t\t\n\t}",
"public void clear() {\r\n\t\t\r\n\t\ttopNode = null; // Sets topNode pointer to null.\r\n\t\t\r\n\t}",
"public final void removeFirst() {\n this.size--;\n setFirst((Node) ((Node) get()).get());\n }",
"public void clear() {\n\t\tthis.root = new Node();\n\t}",
"public void restProcessList() {\n listOfProcess.clear();\n }",
"public void allocateNode(int processId){\n this.processId = processId;\n this.full = true;\n }",
"public void stopProcess() {\r\n\t\tprocess = false;\r\n\t}",
"public void clear()\n\t\t{ while (!children.isEmpty()) remove(children.get(0)); }",
"public void remove() {\r\n\t\theadNode.link = headNode.link.link;\r\n\t\tsize--;\r\n\t}",
"public void remove() {\n\n\t\tif (size() > 1) {\n\n\t\t\tNode node = head;\n\n\t\t\tfor (int i = 0; i < size() - 1; i++) {\n\n\t\t\t\tnode = node.getNextNode();\n\n\t\t\t}\n\n\t\t\tif (node != null) {\n\n\t\t\t\tnode.setNextNode(null);\n\t\t\t\tsize--;\n\n\t\t\t}\n\n\t\t} else if (size() == 1) {\n\n\t\t\thead = null;\n\t\t\tsize--;\n\n\t\t}\n\n\t}",
"public void unsetPir()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(PIR$12, 0);\r\n }\r\n }",
"public void clear() {\r\n data = new Node[DEFAULT_CAPACITY];\r\n size = 0;\r\n }",
"public boolean removeJob(Process p) {\n // Remove the next lines to start your implementation\n\n //Remove process from the queue of unifinished jobs that are cycled back and forth\n //from the CPU\n return this.unfinishedJobs.remove(p);\n /*------------------------------------------------------------*/\n }",
"public void unsetPresent()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(PRESENT$0, 0);\n }\n }",
"public void clear()\n {\n nodes.clear();\n }",
"public void clear() {\n\t\tnodeList.clear();\n\t}",
"public void unsetPdb()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(PDB$28, 0);\r\n }\r\n }",
"public void remove ( ) {\n\t\texecute ( handle -> handle.remove ( ) );\n\t}",
"public void clear(){\r\n\t\tqueue.clear();\r\n\t}",
"public void setRemover() {\n Disposable d = Disposable.from(() -> parent.psm.remove(this));\n UNSAFE.putOrderedObject(this, REMOVE, d);\n }",
"public void reset(){\r\n \tif (blank != null){\r\n \t\tblank.clear();\r\n \t}\r\n \tif (blankNode != null){\r\n \t\tblankNode.clear();\r\n \t}\r\n }",
"public void clear() {\n root = null;\n size = 0;\n }",
"public void clear() {\n root = null;\n size = 0;\n }",
"public void removeNode()\n\t{\n\t\tif (parent != null)\n\t\t\tparent.removeChild(this);\n\t}",
"public void removeProcessstep(int index) throws java.lang.IndexOutOfBoundsException {\n\t\t_Processstep =null;\n\t\ttry{\n\t\t\tgetItem().removeChild(SCHEMA_ELEMENT_NAME + \"/processStep\",index);\n\t\t} catch (FieldNotFoundException e1) {logger.error(e1);}\n\t}",
"public void clear() {\r\n\t\troot = null;\r\n\t\tsize = 0;\r\n\t}",
"public void unsetPart()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(PART$2, 0);\n }\n }",
"public void clear() {\n\t\thead.setNext(null);\n\t\tmodcount++;\n\t\tnodeCount = 0;\n\t}",
"public void clear() {\n while(taskList.size > 0)\n taskList.pop().removeSafely();\n }",
"public void clear(){\n firstNode = null;\n lastNode = null;\n }",
"public void clear()\n {\n if (nodes != null)\n {\n detachNodes(nodes);\n nodes = null;\n namedNodes = null;\n }\n }",
"@Override\n\tpublic void removepro(int pnum) {\n\t\tsession.update(namespace+\".removepro\", pnum);\n\t}",
"@Override\n\tpublic Node removeNode() {\n\t\tif(isEmpty())\n\t\t\treturn null;\n\t\t// BreadthFirstSearch using a queue, first in first out principle\n\t\treturn frontier.removeFirst();\n\t}",
"public void cancelCurrentProcess()\n\t{\n\t\tcurrentProcess = Processes.peek();\n\t\tProcesses.dequeue();\n\t}",
"public void clear() {\n\t\tmSize = 0;\n\t\tmHead = new Node(null, null);\n\t\tmTail = new Node(null, null);\n\t\tmHead.next = mTail;\n\t\tmodCount++;\n\t}",
"public void clear()\n\t{\n\t\tthis.getChildren().clear();\n\t}",
"@Override\n public T remove() throws NoSuchElementException {\n if (size() == 0) {\n // throws NoSuchElementException if the heap is empty\n throw new NoSuchElementException();\n }\n\n // Store the root of heap before it is removed\n T root = heap[0];\n // Replace root with last element in the heap\n heap[0] = heap[size() - 1];\n // Decrease number of elements by 1, removes the old root from heap\n nelems--;\n // Trickle down the new root to the appropriate level in the heap\n trickleDown(0);\n\n // Return the old root\n return root;\n }",
"public void removePiece() {\n\t\troot.getChildren().clear();\n\t\tthis.piece = null;\n\t\troot.getChildren().add(rectangle);\n\t}",
"@Override\r\n public CustomProcess removeBest() {\r\n if (isEmpty()) {\r\n throw new NoSuchElementException(\"queue is empty, cannot remove from empty queue\");\r\n }\r\n CustomProcess best = data[0]; // process to be removed\r\n data[0] = data[size - 1];\r\n data[size - 1] = null;\r\n minHeapPercolateDown(0); // Percolate down on first index\r\n size--;\r\n return best;\r\n }",
"void removeChild(InetSocketAddress address) {\n Neighbor neighbor = children.remove(address);\n if (neighbor != null) {\n neighbor.detach();\n }\n }",
"public void erase()\n {\n this.top = null;\n }",
"public void Kill(){\n this.dead.getAndSet(true);\n if(this.registry != null){\n try {\n UnicastRemoteObject.unexportObject(this.registry, true);\n } catch(Exception e){\n System.out.println(\"None reference\");\n }\n }\n }",
"public void removeItem(){\n\t\tthis.item = null;\n\t}",
"public void unsetFromNumber()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(FROMNUMBER$2, 0);\n }\n }",
"public void markProcessPidReplace() throws JNCException {\n markLeafReplace(\"processPid\");\n }",
"void destroy() {\n \t\ttry {\r\n \t\t\tupKeep.stopRunning();\r\n \t\t} catch (InterruptedException e) {\r\n \t\t}\r\n \r\n \t\t// Kill all running processes.\r\n \t\tfor (MaximaProcess mp : pool) {\r\n \t\t\tmp.kill();\r\n \t\t}\r\n \t\tpool.clear();\r\n \r\n \t\t// Kill all used processes.\r\n \t\tfor (MaximaProcess mp : usedPool) {\r\n \t\t\tmp.kill();\r\n \t\t}\r\n \t\tusedPool.clear();\r\n \t}",
"public void removeMaster() {\n master = null;\n }",
"@Override\n public void clear() {\n root = null;\n size = 0;\n }",
"@Override\n public void clear() {\n root = null;\n size = 0;\n }",
"@Override\n public void clear() {\n root = null;\n size = 0;\n }",
"public final void clear()\n {\n\t\tcmr_queue_.removeAllElements();\n buffer_size_ = 0;\n }",
"public void clear() {\n root = null;\n }",
"public void clear() {\n root = null;\n }",
"public Process() {\n\t\tthis(null);\n\t}",
"public void unsetQuantity()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(QUANTITY$10, 0);\n }\n }",
"public void clear() {\n this.top = null;\n }",
"public void destroy() {\n synchronized (monitor) {\n while (!queue.isEmpty()) {\n queue.poll().node.discard();\n }\n destroyed = true;\n }\n }",
"public void unsetPrf()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(PRF$26, 0);\r\n }\r\n }",
"public void clear() {\n\t\thead = null;\n\t}",
"void clear() {\n\t\t\tfor (int i = 0 ; i < nodes.length; i++) {\n\t\t\t\tnodes[i].clear((byte) 1);\n\t\t\t}\n\t\t\tsize = 0;\n\t\t}",
"public void setAsEmpty(){\n\t\tnodeStatus = Status.empty;\n\t\tunitNum=-1;\n\t}",
"@Override\n\tpublic void clear() {\n\t\tsize = 0;\n\t\troot = null;\n\t}",
"synchronized void cullDeadProcesses() {\n\t\t// Removes processes that have completed and haven't been checked on\n\t\t// for maxLiveTime milliseconds.\n\t\t//long cullBefore = System.currentTimeMillis() - maxLiveTime;\n\t\t//int before = processes.size();\n\t\tIterator<Map.Entry<Long, ProcessEntry>> iter = processes.entrySet().iterator();\n\t\tint runningCount = 0;\n\t\twhile (iter.hasNext()) {\n\t\t\tMap.Entry<Long, ProcessEntry> entry = iter.next();\n\t\t\tProcessEntry pe = entry.getValue();\n\t\t\tAbstractProcess.Status status = pe.process.getStatus();\n\t\t\t// For now, we never remove \"dead\" processes to ensure the status\n\t\t\t// is maintained. So instead all this does is check to make sure\n\t\t\t// that the run count doesn't get messed up.\n\t\t\t/*if (pe.lastAccess < cullBefore && status.isDead()) {\n\t\t\t\tif (logger.isDebugEnabled()) {\n\t\t\t\t\tlogger.debug(\"Process {} last accessed {}, before cutoff of {}.\",\n\t\t\t\t\t\t\tnew Object[] { uidToString(entry.getKey()),\n\t\t\t\t\t\t\tdateFormat.format(new Date(entry.getValue().lastAccess)),\n\t\t\t\t\t\t\tdateFormat.format(new Date(cullBefore)) });\n\t\t\t\t}\n\t\t\t\tpe.process.destroy();\n\t\t\t\titer.remove();\n\t\t\t} else */\n\t\t\tif (status == AbstractProcess.Status.RUNNING) {\n\t\t\t\trunningCount++;\n\t\t\t}\n\t\t}\n\t\t//logger.info(\"Removed {} processes.\", before - processes.size());\n\t\tif (this.runningCount != runningCount) {\n\t\t\tlogger.error(\"Actual running count {} does not match stored running count of {}! This is a bug!\", runningCount, this.runningCount);\n\t\t\t// Fix this\n\t\t\tthis.runningCount = runningCount;\n\t\t\tcheckRunningProcesses();\n\t\t}\n\t}",
"@Override\r\n public void clear(){\r\n root = null;\r\n }",
"public void cleanPile() {\n while (!emptyPile()) {\n eraseNode();\n }\n }",
"public void binomialHeapDelete(Node x) {\n\t\tthis.binomialHeapDecreaseKey(x, Integer.MIN_VALUE);\n\t\tthis.binomialHeapExtractMin();\n\t}",
"public void clear(){\n root = null;\n count = 0;\n }",
"@Override\n\tpublic boolean removeProcess(String procLabel) {\n\t\tif(findProcess(procLabel)) {\n\t\t\tProc procTBD = getProcViaLabel(procLabel);\n\n\t\t\tif(procTBD.getLeftProc() == null && procTBD.getRightProc() == null) {\n\t\t\t\tif(procTBD.getParentProc() != null \n\t\t\t\t\t\t&& procTBD.getParentProc().getLeftProc().getProcLabel().equals(procLabel)){\n\t\t\t\t\tprocTBD.getParentProc().setLeftProc(null);\n\t\t\t\t\tprocTBD = null;\n\t\t\t\t\treturn true;\n\t\t\t\t}else {\n\t\t\t\t\tprocTBD.getParentProc().setRightProc(null);\n\t\t\t\t\tprocTBD = null;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t}else if(procTBD.getLeftProc() != null && procTBD.getRightProc() == null) {\n\t\t\t\tif(procTBD.getParentProc() != null) {\n\t\t\t\t\tprocTBD.getParentProc().setLeftProc(procTBD.getLeftProc());\n\t\t\t\t\tprocTBD = null;\n\t\t\t\t\treturn true;\n\t\t\t\t}else if(procTBD.getParentProc() == null) {\n\t\t\t\t\troot = procTBD.getLeftProc();\n\t\t\t\t\troot.setParentProc(null);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}else if(procTBD.getLeftProc() == null && procTBD.getRightProc() != null) {\n\t\t\t\tprocTBD = procTBD.getRightProc();\n\t\t\t}else if(procTBD.getLeftProc() != null && procTBD.getRightProc() != null) {\n\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false; // placeholder, modify this\n\t}",
"@Override\n public void clear() {\n size = 0;\n root = null;\n }"
] | [
"0.6289713",
"0.6060631",
"0.5927963",
"0.5874478",
"0.5747934",
"0.5730097",
"0.566679",
"0.54930687",
"0.5433511",
"0.54022163",
"0.5399988",
"0.53334266",
"0.5281227",
"0.52356386",
"0.51902515",
"0.51768476",
"0.51554",
"0.513864",
"0.51326334",
"0.50962555",
"0.5094337",
"0.5090399",
"0.50872684",
"0.5086371",
"0.50742537",
"0.50742537",
"0.5067924",
"0.50656044",
"0.50650114",
"0.50529355",
"0.5051553",
"0.50493294",
"0.50492007",
"0.5044235",
"0.5041704",
"0.5035205",
"0.5026484",
"0.5008654",
"0.50085896",
"0.499197",
"0.4978669",
"0.49776167",
"0.49638006",
"0.49564815",
"0.49563947",
"0.49461916",
"0.49459526",
"0.4941128",
"0.4924772",
"0.49204016",
"0.49197185",
"0.49195594",
"0.4919019",
"0.4919019",
"0.49180743",
"0.49180362",
"0.4886586",
"0.48811364",
"0.48695973",
"0.4858409",
"0.48395354",
"0.48338804",
"0.48320454",
"0.48221266",
"0.48183525",
"0.48180905",
"0.48165408",
"0.48161432",
"0.48155433",
"0.4814343",
"0.48143327",
"0.48113883",
"0.48037192",
"0.48035455",
"0.4803185",
"0.48026204",
"0.48014492",
"0.47991693",
"0.47973776",
"0.47973776",
"0.47973776",
"0.47956905",
"0.47908273",
"0.47908273",
"0.47852263",
"0.47811806",
"0.4771739",
"0.4758943",
"0.475805",
"0.47576377",
"0.47494203",
"0.47452864",
"0.47392306",
"0.47369123",
"0.47349972",
"0.47303584",
"0.47296837",
"0.47294793",
"0.47252536",
"0.47198552"
] | 0.65526533 | 0 |
Create the notification in the statusbar | protected void onPreExecute() {
mNotificationHelper.createNotification(context.getResources().getString(R.string.upload));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 }",
"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}",
"private void showNotification(LBSBundle lbs,int status){\n\t\tScenario scenario = (Scenario) EntityPool.instance(\r\n\t\t\t\t).forId(lbs.getParentId(), lbs.getParentTag());\r\n\t\t\r\n\t\t\r\n\t\t// Set the icon, scrolling text and timestamp\r\n\t\tNotification notification = new Notification(R.drawable.compass25,\r\n\t\t\t\tscenario.getName(), System.currentTimeMillis());\r\n\t\tnotification.flags |= Notification.FLAG_AUTO_CANCEL;\r\n\t\tnotification.sound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\r\n\t\t// The PendingIntent to launch our activity if the user selects this\r\n\t\t// notification\r\n\t\tIntent intent = new Intent(this, TaskOverViewActivity.class);\r\n\t\tintent.setAction(TaskOverViewActivity.TASK_OVERVIEWBY_SCENARIO);\r\n\t\tintent.putExtra(TaskOverViewActivity.IN_SCENAIRO_ID, scenario.getId());\r\n\t\t//intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);\r\n\t\tPendingIntent contentIntent = PendingIntent.getActivity(this, 0,\r\n\t\t\t\tintent, PendingIntent.FLAG_UPDATE_CURRENT);\r\n\r\n\t\tCharSequence text = getText(status);\r\n\t\t// Set the info for the views that show in the notification panel.\r\n\t\tnotification.setLatestEventInfo(this, scenario.getName(),\r\n\t\t\t\ttext, contentIntent);\r\n\r\n\t\t// Send the notification.\r\n\t\t// We use a layout id because it is a unique number. We use it later to\r\n\t\t// cancel.\r\n\t\tmNM.notify(\tstatus, notification);\r\n\t}",
"static void makeStatusNotification(String message,Context context) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n // Create the NotificationChannel, but only on API 26+ because\n // the NotificationChannel class is new and not in the support library\n CharSequence name = \"bookNotificationChannel\";\n String description = \"Notification channel for sending book title weekly\";\n int importance = NotificationManager.IMPORTANCE_HIGH;\n NotificationChannel channel =\n new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n\n // Add the channel\n NotificationManager notificationManager =\n (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n\n if (notificationManager != null) {\n notificationManager.createNotificationChannel(channel);\n }\n }\n\n // Create the notification\n NotificationCompat.Builder builder = new NotificationCompat.Builder(context, CHANNEL_ID)\n .setSmallIcon(R.drawable.ic_launcher_foreground)\n .setContentTitle(\"Book of the Week\")\n .setContentText(message)\n .setPriority(NotificationCompat.PRIORITY_HIGH)\n .setVibrate(new long[0]);\n\n // Show the notification\n NotificationManagerCompat.from(context).notify(NOTIFICATION_ID, builder.build());\n }",
"private void createStatusNotificationChannel(){\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {\n statusChannel = new NotificationChannel(\"2\",\"Status\",NotificationManager.IMPORTANCE_DEFAULT);\n statusChannel.setDescription(\"This is a status notification channel\");\n\n NotificationManager notificationManager = ctx.getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(statusChannel);\n }\n }",
"private void showNotification() {\n CharSequence text = \"Running\";\n\n // The PendingIntent to launch our activity if the user selects this notification\n PendingIntent contentIntent = PendingIntent.getActivity(this, 0,\n new Intent(this, MainActivity.class), 0);\n\n // Set the info for the views that show in the notification panel.\n Notification notification = new Notification.Builder(this)\n //.setSmallIcon(R.drawable.stat_sample) // the status icon\n .setTicker(text) // the status text\n //.setWhen(System.currentTimeMillis()) // the time stamp\n .setContentTitle(\"PodcastFTPService\") // the label of the entry\n .setContentText(text) // the contents of the entry\n .setContentIntent(contentIntent) // The intent to send when the entry is clicked\n .build();\n\n // Send the notification.\n mNM.notify(0, notification);\n }",
"private void showNotification() {\r\n\t\t// In this sample, we'll use the same text for the ticker and the\r\n\t\t// expanded notification\r\n\t\tCharSequence text = getText(R.string.local_service_started);\r\n\r\n\t\t// Set the icon, scrolling text and timestamp\r\n\t\tNotification notification = new Notification(R.drawable.compass25,\r\n\t\t\t\ttext, System.currentTimeMillis());\r\n\t\tnotification.sound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\r\n\t\t// The PendingIntent to launch our activity if the user selects this\r\n\t\t// notification\r\n\t\tIntent intent = new Intent(this, TaskOverViewActivity.class);\r\n\t\t//intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);\r\n\t\tPendingIntent contentIntent = PendingIntent.getActivity(this, 0,\r\n\t\t\t\tintent, PendingIntent.FLAG_UPDATE_CURRENT);\r\n\r\n\t\t// Set the info for the views that show in the notification panel.\r\n\t\tnotification.setLatestEventInfo(this, getText(R.string.service_name),\r\n\t\t\t\ttext, contentIntent);\r\n\r\n\t\t// Send the notification.\r\n\t\t// We use a layout id because it is a unique number. We use it later to\r\n\t\t// cancel.\r\n\t\tmNM.notify(R.string.local_service_started, notification);\r\n\t}",
"private void showNotification() {\n // In this sample, we'll use the same text for the ticker and the expanded notification\n CharSequence text = \"Siguiendo el trayecto\";\n\n // The PendingIntent to launch our activity if the user selects this notification\n PendingIntent contentIntent = PendingIntent.getActivity(this, 0,\n new Intent(this, InformacionServicio.class), 0);\n\n // Set the info for the views that show in the notification panel.\n Notification notification = new Notification.Builder(this)\n .setSmallIcon(R.drawable.estrella_full) // the status icon\n .setTicker(text) // the status text\n .setWhen(System.currentTimeMillis()) // the time stamp\n .setContentTitle(\"Conductor Serv\") // the label of the entry\n .setContentText(text) // the contents of the entry\n .setContentIntent(contentIntent) // The intent to send when the entry is clicked\n .build();\n\n // Send the notification.\n //mNM.notify(55, notification);\n //startForeground(56,notification);\n\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)\n startMyOwnForeground();\n else\n startForeground(1, notification);\n\n }",
"private void noti1(){\n\t\t/*Contenido de notificacion*/\n\t\tNotification notificacion = new Notification( \n R.drawable.metrans_logo,\n \"Metrans inicializando... Bienvenido\",\n System.currentTimeMillis() );\n\t\t/*Fin de contenido de la notificacion*/\n\t\tPendingIntent intencionPendiente = PendingIntent.getActivity(\n\t\t this, 0, new Intent(this, MainActivity.class), 0);\n\t\tnotificacion.setLatestEventInfo(this, \"Somos tan chingones\",\n\t\t \"que tenemos notificaciones aqui\", intencionPendiente);\n\t\n\t\t nm1.notify(ID_NOTIFICACION_CREAR, notificacion); //Enviamos la notificacion al status bar\n\t\tnotificacion.defaults |= Notification.DEFAULT_VIBRATE; //Agregando algo de vibracion... Espero y funcione\n\t\t\n\t}",
"public void createNotification(Context context, String msg, String msgText, String msgAlert, int notifID) {\n\n NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n\n Intent repeating_intent = new Intent(context, MainMenu.class);\n repeating_intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\n PendingIntent pendingIntent = PendingIntent.getActivity(context, notifID, repeating_intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n NotificationCompat.Builder builder = new NotificationCompat.Builder(context)\n .setContentIntent(pendingIntent)\n .setSmallIcon(R.drawable.ic_fridge_empty)\n .setContentTitle(msg)\n .setContentText(msgText)\n .setTicker(msgAlert)\n .setColor(0xFFC107) // colour of the circle backgroud\n .setVibrate(new long[]{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000}) // Vibration\n .setLights(0xFFFF00, 100, 50) // LED\n .setAutoCancel(true);\n\n notificationManager.notify(notifID, builder.build());\n }",
"@SuppressWarnings(\"deprecation\")\n\tprivate Notification makeNotification(){\n \tNotification notice = new Notification(R.drawable.ic_action_about, \n \t\t\tgetString(R.string.notice_ticker), System.currentTimeMillis());\n \tnotice.setLatestEventInfo(this, getString(R.string.notice_title), getString(R.string.notice_content), \n \t\t\tPendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class).\n \t\t\t\t\tsetFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP), 0));\n\n \tnotice.flags |= Notification.FLAG_NO_CLEAR;\n \t\n \treturn notice;\n\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}",
"private void showNotification() {\n // In this sample, we'll use the same text for the ticker and the expanded notification\n CharSequence text = getText(R.string.local_service_started);\n\n // Set the icon, scrolling text and timestamp\n Notification notification = new Notification(R.drawable.icon, text,\n System.currentTimeMillis());\n\n // The PendingIntent to launch our activity if the user selects this notification\n PendingIntent contentIntent = PendingIntent.getActivity(this, 0,\n new Intent(this, ServiceActivity.class), 0);\n\n // Set the info for the views that show in the notification panel.\n notification.setLatestEventInfo(this, getText(R.string.local_service_label),\n text, contentIntent);\n\n // Send the notification.\n mNM.notify(NOTIFICATION, notification);\n }",
"private void createNotification(int icon, String name, String auto_manual, String secondText, int color) {\n\n Intent notificationIntent = new Intent(this, SyncopyActivity.class);\n\n PendingIntent pendingIntent = PendingIntent.getActivity(this,\n 0, notificationIntent, 0);\n Notification notification = new NotificationCompat.Builder(this, CHANNEL_ID)\n .setContentTitle(name)\n .setContentText(secondText)\n .setSubText(String.format(\"(%s)\", auto_manual))\n .setSmallIcon(icon)\n .setColor(getResources().getColor(color))\n .setContentIntent(pendingIntent)\n .setVibrate(null)\n .setSound(null)\n .setPriority(NotificationManager.IMPORTANCE_LOW)\n .build();\n\n synchronized (notification){\n notification.notify();\n }\n\n startForeground(1, notification);\n\n\n }",
"private void showNotification() {\r\n\t\t// In this sample, we'll use the same text for the ticker and the\r\n\t\t// expanded notification\r\n\t\tCharSequence text = getText(R.string.local_service_started);\r\n\r\n\t\t// Set the icon, scrolling text and timestamp\r\n\t\tNotification notification = new Notification(R.drawable.service_icon,\r\n\t\t\t\ttext, System.currentTimeMillis());\r\n\r\n\t\t// The PendingIntent to launch our activity if the user selects this\r\n\t\t// notification\r\n\t\tPendingIntent contentIntent = PendingIntent.getActivity(this, 0,\r\n\t\t\t\tnew Intent(this, stopServiceJ.class), 0);\r\n\r\n\t\t// Set the info for the views that show in the notification panel.\r\n\t\tnotification.setLatestEventInfo(this, getText(R.string.service_name),\r\n\t\t\t\ttext, contentIntent);\r\n\r\n\t\t// Send the notification.\r\n\t\t// We use a layout id because it is a unique number. We use it later to\r\n\t\t// cancel.\r\n\t\tmNM.notify(R.string.local_service_started, notification);\r\n\t}",
"private void showNotification() {\n\n }",
"public void addNotification() {\n PendingIntent pi = PendingIntent.getActivity(this, 0, new Intent(this, MapActivity.class), 0);\n Resources r = getResources();\n Notification notification = new NotificationCompat.Builder(this)\n .setTicker(r.getString(R.string.notification_titles))\n .setSmallIcon(android.R.drawable.ic_menu_report_image)\n .setContentTitle(r.getString(R.string.notification_titles))\n .setContentText(r.getString(R.string.notification_tex))\n .setContentIntent(pi)\n .setAutoCancel(true)\n .build();\n\n NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n notificationManager.notify(0, notification);\n }",
"private void showNotification() {\n }",
"void notifyStatus(String strStatus)\n \t{\n \tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\n \tboolean bNotify = prefs.getBoolean(\"notify_status\", true);\n \t\n \tif (bNotify)\n \t{\n \t \tNotification notification = new Notification(\n \t \t\t\tR.drawable.icon, strStatus, System.currentTimeMillis());\n \t \tPendingIntent contentIntent = PendingIntent.getActivity(\n \t \t\t\tthis, 0, new Intent(this, MainActivity.class), 0);\n \t \tnotification.setLatestEventInfo(\n \t \t\t\tthis, getText(R.string.app_name), strStatus, contentIntent);\n \t \tmNM.notify(R.string.app_name, notification);\n \t}\n \n \t}",
"public StatusBar() {\n super();\n super.setPreferredSize(new Dimension(100, 16));\n setMessage(\"Ready\");\n }",
"private void showStatusBarNotification(String title, String sendMessage) {\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 createNotification(FoodEvents event) {\n Context context = getBaseContext();\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context).setSmallIcon(R.drawable.ic_launcher).setContentTitle(event.getTitle())\n .setContentText(event.getDescription());\n Intent resultIntent = new Intent(this, EventDetails.class);\n resultIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n resultIntent.putExtra(EventDetails.EXTRA_EVENT, event);\n PendingIntent resultPendingIntent = PendingIntent.getActivity(getBaseContext(), 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT, null);\n mBuilder.setContentIntent(resultPendingIntent);\n NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n mNotificationManager.notify(MESSAGE_NOTIFICATION_ID, mBuilder.build());\n notifyMyWatch(event);\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 void crearNotificacion(){\n Intent dismissIntent = new Intent(this, MainActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n dismissIntent.setAction(\"Sincronizar\");\n PendingIntent piDismiss = PendingIntent.getActivity(this, 0, dismissIntent, 0);\n\n//set intents and pending intents to call service on click of \"snooze\" action button of notification\n /*Intent snoozeIntent = new Intent(this, MyService.class);\n snoozeIntent.setAction(ACTION_SNOOZE);\n PendingIntent piSnooze = PendingIntent.getService(this, 0, snoozeIntent, 0);*/\n\n //build notification\n android.support.v4.app.NotificationCompat.Builder builder =\n new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ic_app)\n .setContentTitle(\"Sincronización pendiente\")\n .setContentText(\"Sincronice la aplicación para recuperar nuevos eventos\")\n .setDefaults(Notification.DEFAULT_ALL) // must requires VIBRATE permission\n .setPriority(NotificationCompat.PRIORITY_HIGH) //must give priority to High, Max which will considered as heads-up notification\n /*.addAction(R.drawable.snooze,\n getString(R.string.snooze), piSnooze)*/;\n builder.setContentIntent(piDismiss);\n builder.setAutoCancel(true);\n\n// Gets an instance of the NotificationManager service\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n//to post your notification to the notification bar with a id. If a notification with same id already exists, it will get replaced with updated information.\n notificationManager.notify(10000, builder.build());\n }",
"private void showNotification() {\n\n Intent intent = new Intent(this, DashboardActivity.class);\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n stackBuilder.addParentStack(DashboardActivity.class);\n stackBuilder.addNextIntent(intent);\n\n final NotificationCompat.Builder builder = new NotificationCompat.Builder(this);\n\n builder.setSmallIcon(R.drawable.ic_gps);\n builder.setContentText(getText(R.string.local_service_started));\n builder.setContentTitle(getText(R.string.local_service_label));\n builder.setOngoing(true);\n builder.setContentIntent(stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT));\n\n final Notification notification = builder.build();\n\n // Send the notification.\n mNotificationManager.notify(NOTIFICATION, notification);\n }",
"private void showNotification(int count) {\n\t\tLog.i(\"zlt\", \"showNotification\");\n\t\tNotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\t\tNotificationCompat.Builder builder = new NotificationCompat.Builder(\n\t\t\t\tgetApplicationContext());\n\n\t\tbuilder.setContentTitle(\"通知\")\n\t\t\t\t.setContentText(String.format(\"你有%1$d条新的应急任务\", count))\n\t\t\t\t.setContentIntent(\n\t\t\t\t\t\tgetDefalutIntent(Notification.FLAG_AUTO_CANCEL))\n\t\t\t\t// .setNumber(number)//显示数量\n\t\t\t\t.setTicker(\"新的消息\")// 通知首次出现在通知栏,带上升动画效果的\n\t\t\t\t.setWhen(System.currentTimeMillis())// 通知产生的时间,会在通知信息里显示\n\t\t\t\t.setPriority(Notification.PRIORITY_DEFAULT)// 设置该通知优先级\n\t\t\t\t// .setAutoCancel(true)//设置这个标志当用户单击面板就可以让通知将自动取消\n\t\t\t\t.setOngoing(false)// ture,设置他为一个正在进行的通知。他们通常是用来表示一个后台任务,用户积极参与(如播放音乐)或以某种方式正在等待,因此占用设备(如一个文件下载,同步操作,主动网络连接)\n\t\t\t\t.setDefaults(Notification.DEFAULT_VIBRATE)//\n\t\t\t\t// 向通知添加声音、闪灯和振动效果的最简单、最一致的方式是使用当前的用户默认设置,使用defaults属性,可以组合:\n\t\t\t\t// Notification.DEFAULT_ALL Notification.DEFAULT_SOUND 添加声音 //\n\t\t\t\t// requires VIBRATE permission\n\t\t\t\t.setSmallIcon(R.drawable.app_icon).setAutoCancel(true);\n\t\t// 点击的意图ACTION是跳转到Intent\n\n\t\tIntent resultIntent = new Intent(getApplicationContext(),\n\t\t\t\tActivityInspection.class);\n\t\tresultIntent.putExtra(\"taskType\", 2);\n\t\tresultIntent.putExtra(\"fromService\", true);\n\t\tresultIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t// resultIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);\n\t\tPendingIntent pendingIntent = PendingIntent.getActivity(\n\t\t\t\tgetApplicationContext(), 0, resultIntent,\n\t\t\t\tPendingIntent.FLAG_UPDATE_CURRENT);\n\t\tbuilder.setContentIntent(pendingIntent);\n\t\tmanager.notify(100, builder.build());\n\n\t}",
"private void showNotification() {\n // In this sample, we'll use the same text for the ticker and the expanded notification\n // Set the icon, scrolling text and timestamp\n Notification notification = new Notification(R.drawable.icon, \"Longitude is active\", System.currentTimeMillis());\n\n // The PendingIntent to launch our activity if the user selects this notification\n PendingIntent contentIntent = PendingIntent.getActivity(this, 0,\n new Intent(this, LongitudeActivity.class), 0);\n\n // Set the info for the views that show in the notification panel.\n notification.setLatestEventInfo(this, \"Longitude\", \"Tracking your location\", contentIntent);\n\n // Send the notification.\n notificationManager.notify(NOTIFICATION, notification);\n }",
"private void createNotificationChannel() {\n mNotificationManager =\r\n (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\r\n\r\n // Notification channels are only available in OREO and higher.\r\n // So, add a check on SDK version.\r\n if (android.os.Build.VERSION.SDK_INT >=\r\n android.os.Build.VERSION_CODES.O) {\r\n\r\n // Create the NotificationChannel with all the parameters.\r\n NotificationChannel notificationChannel = new NotificationChannel\r\n (PRIMARY_CHANNEL_ID,\r\n \"Stand up notification\",\r\n NotificationManager.IMPORTANCE_HIGH);\r\n\r\n notificationChannel.enableLights(true);\r\n notificationChannel.setLightColor(Color.RED);\r\n notificationChannel.enableVibration(true);\r\n notificationChannel.setDescription(\"Daje znać użytkownikowi \" +\r\n \"by wprowadził swoje wydatki\");\r\n mNotificationManager.createNotificationChannel(notificationChannel);\r\n }\r\n }",
"private void sendNotification() {\n int mNotificationId = 001;\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ic_action_camera)\n .setContentTitle(\"Daily Selfie\")\n .setContentText(\"Time for another selfie\");\n Intent resultIntent = new Intent(this, MainActivity.class);\n PendingIntent resultPendingIntent =\n PendingIntent.getActivity(\n this,\n 0,\n resultIntent,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n mBuilder.setContentIntent(resultPendingIntent);\n // Gets an instance of the NotificationManager service\n NotificationManager mNotifyMgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n // Builds the notification and issues it.\n mNotifyMgr.notify(mNotificationId, mBuilder.build());\n }",
"private void showNotification() throws NullPointerException\n\t{\n\t\tint status;\n//\t\tstatus = mqttClient != null ? R.string.connected_to_server\n//\t\t\t\t: R.string.cannot_connect_to_server;\n//\t\tPendingIntent contentIntent = PendingIntent.getActivity( this, 0,\n//\t\t\t\tnew Intent( this, MainActivity.class ), 0 );\n//\t\tnotification = new Notification.Builder( this )\n//\t\t\t\t.setContentTitle( this.getString( R.string.service_label ) )\n//\t\t\t\t.setContentText( getResources().getString( status ) )\n//\t\t\t\t.setSmallIcon( Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP\n//\t\t\t\t\t\t? R.mipmap.pristine_zen_icon_silhouette : R.mipmap.pristine_zen_icon )\n//\t\t\t\t.setContentIntent( contentIntent )\n//\t\t\t\t.setAutoCancel( false )\n//\t\t\t\t.setOngoing( true )\n//\t\t\t\t.build();\n\t\tmNotificationManager =\n\t\t\t\t(NotificationManager) getApplicationContext().getSystemService( NOTIFICATION_SERVICE );\n\t\t//notification.flags |= Notification.FLAG_ONGOING_EVENT;\n\t\t//notification.flags |= Notification.FLAG_AUTO_CANCEL;\n\n\t\tmNotificationManager.notify( 123321, notification );\n\t}",
"public StatusBar() {\n\t\tthis(DEFAULT_STATUS_MESSAGE, true, 1, 1, true);\n\t}",
"private void showNotification() {\n Intent intent = new Intent(this, MainActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);\n Notification notification = new NotificationCompat.Builder(getApplicationContext())\n .setContentIntent(PendingIntent.getActivity(this, 0, intent, 0))\n .setSmallIcon(R.drawable.ic_launcher)\n .setContentText(getText(R.string.local_service_running))\n .setContentTitle(getText(R.string.local_service_notification)).build();\n notificationManager.notify(NOTIFICATION, notification);\n }",
"public void createNotificationChannel() {\n mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n // Notification channels are only available in OREO and higher.\n // So, add a check on SDK version.\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {\n // Create the NotificationChannel with all the parameters.\n NotificationChannel notificationChannel = new NotificationChannel(PRIMARY_CHANNEL_ID,\"Log the game!\", NotificationManager.IMPORTANCE_HIGH);\n notificationChannel.enableLights(true);\n notificationChannel.setLightColor(Color.RED);\n notificationChannel.enableVibration(true);\n notificationChannel.setDescription(\"Reminder to log your game on Friday's at 3:05 pm\");\n mNotificationManager.createNotificationChannel(notificationChannel);\n }\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 showNotification(String title,String message)\n {\n\n Bitmap icon = BitmapFactory.decodeResource(this.getResources(),\n R.drawable.girl);\n// NotificationCompat.Builder builder = new NotificationCompat.Builder(this,\"Notify\")\n// .setContentTitle(title).setSmallIcon(R.drawable.common_google_signin_btn_icon_dark)\n\n// // .addAction(R.drawable.user,\"Pay\",payInent)\n// //.addAction(R.drawable.user,\"Pay Later\",payLaterInent)\n// .setDefaults(Notification.DEFAULT_ALL)\n// .setPriority(NotificationManager.IMPORTANCE_HIGH)\n// .setAutoCancel(true).setContentText(message).setLargeIcon(icon)\n// .setStyle(new NotificationCompat.BigPictureStyle()\n// .bigPicture(icon).bigLargeIcon(null));\n\n// NotificationCompat.Builder builder;\n// builder = new NotificationCompat.Builder(this, \"Notify\");\n// builder.setContentTitle(title) // required\n// .setSmallIcon(R.drawable.user) // required\n// .setContentText(message) // required\n// .setStyle(new NotificationCompat.BigPictureStyle()\n// .bigPicture(icon).setSummaryText(\"\"))\n// .setAutoCancel(true)\n// .setVibrate(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400})\n// .setSound(Settings.System.DEFAULT_NOTIFICATION_URI)\n// .setPriority(NotificationCompat.PRIORITY_HIGH)\n// ;\n\n Notification notification = null;\n if( message.charAt(0) == 'C' )\n {\n// Intent intent = new Intent(this, PayLater.class);\n Intent intent = new Intent(this, PayLaterTest.class);\n PendingIntent payInent = PendingIntent.getActivity(MyMessagingService.this, 0, intent, 0);\n notification = new NotificationCompat.Builder(this, \"Notify\")\n .setSmallIcon(android.R.drawable.ic_dialog_info)\n .setContentTitle(title)\n .setContentText(message)\n .setDefaults(Notification.DEFAULT_ALL)\n .setPriority(NotificationCompat.PRIORITY_DEFAULT)\n .setVibrate(new long[0])// heads-up\n .addAction(R.drawable.user,\"Pay\",payInent)\n .setAutoCancel(true)\n .build();\n }\n else if( message.charAt(0) == 'G' )\n {\n //start activity go in\n Intent intent = new Intent(this, PayActivity.class);\n PendingIntent payInent = PendingIntent.getActivity(MyMessagingService.this, 0, intent, 0);\n notification = new NotificationCompat.Builder(this, \"Notify\")\n .setSmallIcon(android.R.drawable.ic_dialog_info)\n .setContentTitle(title)\n .setContentText(message)\n .setDefaults(Notification.DEFAULT_ALL)\n .setPriority(NotificationCompat.PRIORITY_DEFAULT)\n .setVibrate(new long[0])// heads-up\n .addAction(R.drawable.user,\"Verify\",payInent)\n .setAutoCancel(true)\n .build();\n }\n else if( message.charAt(0) == 'I' )\n {\n //start activity invalid slot\n// Intent intent = new Intent(this, PayActivity.class);\n\n// PendingIntent payInent = PendingIntent.getActivity(MyMessagingService.this, 0, intent, 0);\n notification = new NotificationCompat.Builder(this, \"Notify\")\n .setSmallIcon(android.R.drawable.ic_dialog_info)\n .setContentTitle(title)\n .setContentText(message)\n .setDefaults(Notification.DEFAULT_ALL)\n .setPriority(NotificationCompat.PRIORITY_DEFAULT)\n .setAutoCancel(true)\n .setVibrate(new long[0])// heads-up\n // .addAction(R.drawable.user,\"Verify\",payInent)\n .build();\n }\n\n m = (NotificationManager) getSystemService(getApplicationContext().NOTIFICATION_SERVICE);;\n m.notify(999,notification);\n // m.cancel(999);\n }",
"public void startDownloadNotification(Context context) {\r\n mNotifyManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\r\n mBuilder = new NotificationCompat.Builder(context);\r\n mBuilder.setContentTitle(\"Files Downloading From PC\").setContentText(\"Download progress\").setSmallIcon(android.R.drawable.stat_sys_download_done);\r\n }",
"private void showNotification() {\n\t\t\t\tPendingIntent contentIntent = PendingIntent.getActivity(this, 0, \n\t\t\t\t\t\tnew Intent(this, MainActivity.class), 0);\n\t\t\t\t\n\t\t// Use NotificationCompat.Builder to build the notification, display using mNM\n\t\tNotificationCompat.Builder mNotifyBuilder= new NotificationCompat.Builder(this)\n\t\t\t.setContentTitle(getText(R.string.notificationTitle))\n\t\t\t.setContentText(getText(R.string.notificationText))\n\t\t\t.setSmallIcon(R.drawable.ic_launcher)\n\t\t\t.setContentIntent(contentIntent);\n\t\t\n\t\tmNM.notify(notifyID, mNotifyBuilder.build());\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 static void createNotification(Context context, Reminder reminder) {\n Intent viewIntent = new Intent(context, MainScreen.class);\n viewIntent.putExtra(\"NOTIFICATION_ID\", reminder.getId());\n viewIntent.putExtra(\"NOTIFICATION_DISMISS\", true);\n PendingIntent pending = PendingIntent.getActivity(context, reminder.getId(), viewIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n /* // Create intent for notification snooze click behaviour\n Intent snoozeIntent = new Intent(context, SnoozeActionReceiver.class);\n snoozeIntent.putExtra(\"NOTIFICATION_ID\", reminder.getId());\n PendingIntent pendingSnooze = PendingIntent.getBroadcast(context, reminder.getId(), snoozeIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n*/\n int imageResId = context.getResources().getIdentifier(reminder.getIcon(), \"drawable\", context.getPackageName());\n\n\n /*NotificationCompat.Builder builder = new NotificationCompat.Builder(context, CHANNEL_ID)\n .setSmallIcon(R.drawable.notification_icon)\n .setContentTitle(textTitle)\n .setContentText(textContent)\n .setPriority(NotificationCompat.PRIORITY_DEFAULT);\n\n */\n NotificationCompat.Builder builder = new NotificationCompat.Builder(context)\n .setSmallIcon(imageResId)\n .setColor(Color.parseColor(reminder.getColour()))\n .setStyle(new NotificationCompat.BigTextStyle().bigText(reminder.getContent()))\n .setContentTitle(reminder.getTitle())\n .setContentText(reminder.getContent())\n .setTicker(reminder.getTitle())\n .setContentIntent(pending);\n\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);\n\n /*if (sharedPreferences.getBoolean(\"checkBoxNagging\", false)) {\n Intent swipeIntent = new Intent(context, DismissReceiver.class);\n swipeIntent.putExtra(\"NOTIFICATION_ID\", reminder.getId());\n PendingIntent pendingDismiss = PendingIntent.getBroadcast(context, reminder.getId(), swipeIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n builder.setDeleteIntent(pendingDismiss);\n\n Calendar calendar = Calendar.getInstance();\n calendar.add(Calendar.MINUTE, sharedPreferences.getInt(\"nagMinutes\", context.getResources().getInteger(R.integer.default_nag_minutes)));\n calendar.add(Calendar.SECOND, sharedPreferences.getInt(\"nagSeconds\", context.getResources().getInteger(R.integer.default_nag_seconds)));\n Intent alarmIntent = new Intent(context, NagReceiver.class);\n AlarmUtil.setAlarm(context, alarmIntent, reminder.getId(), calendar);\n }*/\n\n String soundUri = sharedPreferences.getString(\"NotificationSound\", \"content://settings/system/notification_sound\");\n if (soundUri.length() != 0) {\n builder.setSound(Uri.parse(soundUri));\n }\n if (sharedPreferences.getBoolean(\"checkBoxLED\", true)) {\n builder.setLights(Color.BLUE, 700, 1500);\n }\n if (sharedPreferences.getBoolean(\"checkBoxOngoing\", false)) {\n builder.setOngoing(true);\n }\n if (sharedPreferences.getBoolean(\"checkBoxVibrate\", true)) {\n long[] pattern = {0, 300, 0};\n builder.setVibrate(pattern);\n }\n /*if (sharedPreferences.getBoolean(\"checkBoxMarkAsDone\", false)) {\n Intent intent = new Intent(context, DismissReceiver.class);\n intent.putExtra(\"NOTIFICATION_ID\", reminder.getId());\n PendingIntent pendingIntent = PendingIntent.getBroadcast(context, reminder.getId(), intent, PendingIntent.FLAG_UPDATE_CURRENT);\n builder.addAction(R.drawable.ic_done_white_24dp, context.getString(R.string.mark_as_done), pendingIntent);\n }\n if (sharedPreferences.getBoolean(\"checkBoxSnooze\", false)) {\n builder.addAction(R.drawable.ic_snooze_white_24dp, context.getString(R.string.snooze), pendingSnooze);\n }*/\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {\n builder.setPriority(Notification.PRIORITY_HIGH);\n }\n\n NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.notify(reminder.getId(), builder.build());\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 }",
"void makeNotification(){\n\n\n ++count;\n Toast.makeText(this, \"Congrats! MyService Notify \"+count, Toast.LENGTH_SHORT).show();\n NotificationCompat.Builder builder =\n new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ic_launcher)\n .setContentTitle(\"My Notification Title \"+count)\n .setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE)\n .setContentText(\"Something interesting happened \"+count);\n int NOTIFICATION_ID = 12345;\n\n //Add sound in notification here.\n Intent targetIntent = new Intent(this, MainActivity.class);\n PendingIntent contentIntent = PendingIntent.getActivity(this, 0, targetIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n builder.setContentIntent(contentIntent);\n NotificationManager nManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n nManager.notify(NOTIFICATION_ID, builder.build());\n }",
"public void MostrarNotificacion(Boolean estado, int cancelar){\n //hora del evento\n long hora = System.currentTimeMillis();\n\n NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext(), CHANNEL_ID);\n builder.setSmallIcon(R.drawable.ic_launcher_background);\n builder.setContentTitle(\"Titulo\");\n builder.setContentText(\"Cuerpo\");\n builder.setWhen(hora);\n builder.setPriority(NotificationCompat.PRIORITY_DEFAULT);\n\n //para poner la notificacion permanente\n builder.setOngoing(estado);\n\n //construir la notificacion\n NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(getApplicationContext());\n notificationManagerCompat.notify(NOTIFICACION_ID, builder.build());\n\n //para quitar la notificacion\n notificationManagerCompat.cancel(cancelar);\n\n\n\n }",
"public void createNotificationChannel() {\n mNotificationManager =\n (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n // Notification channels are only available in OREO and higher.\n // So, add a check on SDK version.\n if (android.os.Build.VERSION.SDK_INT >=\n android.os.Build.VERSION_CODES.O) {\n\n // Create the NotificationChannel with all the parameters.\n NotificationChannel notificationChannel = new NotificationChannel\n (PRIMARY_CHANNEL_ID,\n \"Stand up notification\",\n NotificationManager.IMPORTANCE_HIGH);\n\n notificationChannel.enableLights(true);\n notificationChannel.setLightColor(Color.RED);\n notificationChannel.enableVibration(true);\n notificationChannel.setDescription(\"Notifies every 15 minutes to \" +\n \"stand up and walk\");\n mNotificationManager.createNotificationChannel(notificationChannel);\n }\n }",
"private void showSimpleNotification() {\n Notification notification = new NotificationCompat.Builder(getActivity())\n //Title of the notification\n .setContentTitle(getString(R.string.nf_simple_title))\n //Content of the notification once opened\n .setContentText(getString(R.string.nf_simple_message))\n //This bit will show up in the notification area in devices that support that\n .setTicker(getString(R.string.nf_simple_ticker))\n //Icon that shows up in the notification area\n .setSmallIcon(R.drawable.ic_notify)\n //Icon that shows up in the drawer\n .setLargeIcon(BitmapFactory.decodeResource(getActivity().getResources(), R.drawable.ic_launcher))\n //Set the intent\n .setContentIntent(pendingIntentForNotification())\n //Build the notification with all the stuff you've just set.\n .build();\n\n //Add the auto-cancel flag to make it dismiss when clicked on\n //This is a bitmask value so you have to pipe-equals it.\n notification.flags |= Notification.FLAG_AUTO_CANCEL;\n\n //Grab the NotificationManager and post the notification\n NotificationManager notificationManager = (NotificationManager)\n getActivity().getSystemService(Context.NOTIFICATION_SERVICE);\n\n //Set a tag so that the same notification doesn't get reposted over and over again and\n //you can grab it again later if you need to.\n notificationManager.notify(TAG_SIMPLE_NOTIFICATION, notification);\n }",
"public static void buildDemoNotification(Context context) {\n int eventId = 0;\n String eventTitle = \"Demo title\";\n String eventLocation = \"Mountain View\";\n\n int notificationId = 001;\n // Build intent for notification content\n Intent viewIntent = new Intent(context, ViewEventActivity.class);\n viewIntent.putExtra(EXTRA_EVENT_ID, eventId);\n PendingIntent viewPendingIntent =\n PendingIntent.getActivity(context, 0, viewIntent, 0);\n\n NotificationCompat.Builder notificationBuilder =\n new NotificationCompat.Builder(context)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(eventTitle)\n .setContentText(eventLocation)\n .setContentIntent(viewPendingIntent);\n\n // Get an instance of the NotificationManager service\n NotificationManagerCompat notificationManager =\n NotificationManagerCompat.from(context);\n\n // Build the notification and issues it with notification manager.\n notificationManager.notify(notificationId, notificationBuilder.build());\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_settings);\n\n String text = \"lol\";\n\n NotificationCompat.Builder mBuilder =\n (NotificationCompat.Builder) new NotificationCompat.Builder(this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(\"My notification\")\n .setContentText(\"Hello World!\");\n\n\n Intent resultIntent = new Intent(this, MainActivity.class);\n\n // Because clicking the notification opens a new (\"special\") activity, there's\n // no need to create an artificial back stack.\n PendingIntent resultPendingIntent =\n PendingIntent.getActivity(\n this,\n 0,\n resultIntent,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n\n\n mBuilder.setContentIntent(resultPendingIntent);\n\n\n // NotificationCompat.Builder mBuilder;\n // Sets an ID for the notification\n // Use the notify() method to issue the notification. When you call notify(), specify a notification ID. You can use\n // this ID to update the notification later on. This is described in more detail in Managing Notifications.\n // http://developer.android.com/training/notify-user/managing.html\n int mNotificationId = 001;\n// Gets an instance of the NotificationManager service\n NotificationManager mNotifyMgr =\n (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n// Builds the notification and issues it.\n mNotifyMgr.notify(mNotificationId, mBuilder.build());\n\n }",
"private static void createNotification(Activity a, CustomFBProfile prof) {\n NotificationCompat.Builder mBuilder =\n new NotificationCompat.Builder(a)\n .setSmallIcon(R.drawable.acba)\n .setContentTitle(\"New Message\")\n .setTicker(\"New Message!!\");\n NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();\n mBuilder.setStyle(inboxStyle);\n mBuilder.setVibrate(new long[]{2000, 500, 500, 250});\n mBuilder.setLights(Color.YELLOW, 3000, 3000);\n mBuilder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));\n mBuilder.setAutoCancel(true);\n\n// Creates an explicit intent for an Activity in your app\n Intent resultIntent = new Intent(a, LoginActivity.class);\n\n// The stack builder object will contain an artificial back stack for the\n// started Activity.\n// This ensures that navigating backward from the Activity leads out of\n// your application to the Home screen.\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(a);\n// Adds the back stack for the Intent (but not the Intent itself)\n stackBuilder.addParentStack(LoginActivity.class);\n// Adds the Intent that starts the Activity to the top of the stack\n stackBuilder.addNextIntent(resultIntent);\n PendingIntent resultPendingIntent =\n stackBuilder.getPendingIntent(\n 0,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n mBuilder.setContentIntent(resultPendingIntent);\n NotificationManager mNotificationManager =\n (NotificationManager) a.getSystemService(Context.NOTIFICATION_SERVICE);\n// mId allows you to update the notification later on.\n mNotificationManager.notify(1, mBuilder.build());\n }",
"private void ShowNotification()\n {\n Notification n = new Notification.Builder(this)\n .setContentTitle(\"Message from Himanshu\")\n .setContentText(\"Thank you Sir. Enjoyed Your Class!\")\n .setSmallIcon(R.drawable.cloud)\n //.setContentIntent(pIntent)\n .setAutoCancel(true)\n //.addAction(R.drawable.icon, \"Call\", pIntent)\n //.addAction(R.drawable.icon, \"More\", pIntent)\n //.addAction(R.drawable.icon, \"And more\", pIntent)\n .getNotification();\n\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n try {\n notificationManager.notify(0, n);\n }catch (Exception ex) {\n Log.d(\"MyApp\", \"Exception Occured!\");\n }\n }",
"@Override\n\tpublic StatusBar createStatusBar() {\n\t\tLightVisualThemeStatusBar lightVisualThemeStatusBar = new LightVisualThemeStatusBar();\n\t\treturn lightVisualThemeStatusBar;\n\t}",
"private void createStatusBar() {\r\n\t\tJPanel panel = new JPanel();\r\n\t\tpanel.setLayout(new GridLayout(1, 4));\r\n\t\t\r\n\t\tlengthLab = new JLabel(\"Length: 0\");\r\n\t\tlengthLab.setForeground(Color.GRAY);\r\n\t\tlengthLab.setHorizontalAlignment(SwingConstants.LEFT);\r\n\t\tpanel.add(lengthLab);\r\n\t\t\r\n\t\tlnLab = new JLabel(\"Ln: 0\");\r\n\t\tlnLab.setForeground(Color.GRAY);\r\n\t\tlnLab.setHorizontalAlignment(SwingConstants.LEFT);\r\n\t\tpanel.add(lnLab);\r\n\t\t\r\n\t\tcolLab = new JLabel(\"Col: 1\");\r\n\t\tcolLab.setForeground(Color.GRAY);\r\n\t\tcolLab.setHorizontalAlignment(SwingConstants.LEFT);\r\n\t\tpanel.add(colLab);\r\n\t\t\r\n\t selLab = new JLabel(\"Sel: 0\");\r\n\t\tselLab.setForeground(Color.GRAY);\r\n\t\tselLab.setHorizontalAlignment(SwingConstants.LEFT);\r\n\t\tpanel.add(selLab);\r\n\t\t\r\n\t\tJLabel clock = new JLabel(new Date().toString());\r\n\t\tclock.setHorizontalAlignment(SwingConstants.RIGHT);\r\n\t\tpanel.add(clock, BorderLayout.PAGE_END);\r\n\t\ttimer = new Timer(100, (e) -> { \r\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\t\tclock.setText(sdf.format(new Date()));\r\n\t\t});\r\n\t\ttimer.start();\r\n\t\t\r\n\t\tgetContentPane().add(panel, BorderLayout.PAGE_END);\r\n\t}",
"public void onCreate(Bundle bundle) {\n super.onCreate(bundle);\n Theme.createDialogsResources(this);\n Theme.createChatResources(this, false);\n AndroidUtilities.fillStatusBarHeight(this);\n for (int i = 0; i < 3; i++) {\n NotificationCenter.getInstance(i).addObserver(this, NotificationCenter.appDidLogout);\n NotificationCenter.getInstance(i).addObserver(this, NotificationCenter.updateInterfaces);\n NotificationCenter.getInstance(i).addObserver(this, NotificationCenter.messagePlayingProgressDidChanged);\n NotificationCenter.getInstance(i).addObserver(this, NotificationCenter.messagePlayingDidReset);\n NotificationCenter.getInstance(i).addObserver(this, NotificationCenter.contactsDidLoad);\n }\n NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.pushMessagesUpdated);\n NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.emojiLoaded);\n this.classGuid = ConnectionsManager.generateClassGuid();\n this.statusDrawables[0] = new TypingDotsDrawable(false);\n this.statusDrawables[1] = new RecordStatusDrawable(false);\n this.statusDrawables[2] = new SendingFileDrawable(false);\n this.statusDrawables[3] = new PlayingGameDrawable(false, (Theme.ResourcesProvider) null);\n this.statusDrawables[4] = new RoundStatusDrawable(false);\n AnonymousClass1 r2 = new SizeNotifierFrameLayout(this) {\n /* access modifiers changed from: protected */\n public void onMeasure(int i, int i2) {\n View.MeasureSpec.getMode(i);\n View.MeasureSpec.getMode(i2);\n int size = View.MeasureSpec.getSize(i);\n int size2 = View.MeasureSpec.getSize(i2);\n setMeasuredDimension(size, size2);\n if (measureKeyboardHeight() <= AndroidUtilities.dp(20.0f)) {\n size2 -= PopupNotificationActivity.this.chatActivityEnterView.getEmojiPadding();\n }\n int childCount = getChildCount();\n for (int i3 = 0; i3 < childCount; i3++) {\n View childAt = getChildAt(i3);\n if (childAt.getVisibility() != 8) {\n if (PopupNotificationActivity.this.chatActivityEnterView.isPopupView(childAt)) {\n childAt.measure(View.MeasureSpec.makeMeasureSpec(size, NUM), View.MeasureSpec.makeMeasureSpec(childAt.getLayoutParams().height, NUM));\n } else if (PopupNotificationActivity.this.chatActivityEnterView.isRecordCircle(childAt)) {\n measureChildWithMargins(childAt, i, 0, i2, 0);\n } else {\n childAt.measure(View.MeasureSpec.makeMeasureSpec(size, NUM), View.MeasureSpec.makeMeasureSpec(Math.max(AndroidUtilities.dp(10.0f), AndroidUtilities.dp(2.0f) + size2), NUM));\n }\n }\n }\n }\n\n /* access modifiers changed from: protected */\n /* JADX WARNING: Removed duplicated region for block: B:20:0x0065 */\n /* JADX WARNING: Removed duplicated region for block: B:24:0x0073 */\n /* JADX WARNING: Removed duplicated region for block: B:28:0x008b */\n /* JADX WARNING: Removed duplicated region for block: B:32:0x0094 */\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public void onLayout(boolean r10, int r11, int r12, int r13, int r14) {\n /*\n r9 = this;\n int r10 = r9.getChildCount()\n int r0 = r9.measureKeyboardHeight()\n r1 = 1101004800(0x41a00000, float:20.0)\n int r1 = org.telegram.messenger.AndroidUtilities.dp(r1)\n r2 = 0\n if (r0 > r1) goto L_0x001c\n org.telegram.ui.PopupNotificationActivity r0 = org.telegram.ui.PopupNotificationActivity.this\n org.telegram.ui.Components.ChatActivityEnterView r0 = r0.chatActivityEnterView\n int r0 = r0.getEmojiPadding()\n goto L_0x001d\n L_0x001c:\n r0 = 0\n L_0x001d:\n if (r2 >= r10) goto L_0x00e3\n android.view.View r1 = r9.getChildAt(r2)\n int r3 = r1.getVisibility()\n r4 = 8\n if (r3 != r4) goto L_0x002d\n goto L_0x00df\n L_0x002d:\n android.view.ViewGroup$LayoutParams r3 = r1.getLayoutParams()\n android.widget.FrameLayout$LayoutParams r3 = (android.widget.FrameLayout.LayoutParams) r3\n int r4 = r1.getMeasuredWidth()\n int r5 = r1.getMeasuredHeight()\n int r6 = r3.gravity\n r7 = -1\n if (r6 != r7) goto L_0x0042\n r6 = 51\n L_0x0042:\n r7 = r6 & 7\n r6 = r6 & 112(0x70, float:1.57E-43)\n r7 = r7 & 7\n r8 = 1\n if (r7 == r8) goto L_0x0056\n r8 = 5\n if (r7 == r8) goto L_0x0051\n int r7 = r3.leftMargin\n goto L_0x0061\n L_0x0051:\n int r7 = r13 - r4\n int r8 = r3.rightMargin\n goto L_0x0060\n L_0x0056:\n int r7 = r13 - r11\n int r7 = r7 - r4\n int r7 = r7 / 2\n int r8 = r3.leftMargin\n int r7 = r7 + r8\n int r8 = r3.rightMargin\n L_0x0060:\n int r7 = r7 - r8\n L_0x0061:\n r8 = 16\n if (r6 == r8) goto L_0x0073\n r8 = 80\n if (r6 == r8) goto L_0x006c\n int r6 = r3.topMargin\n goto L_0x007f\n L_0x006c:\n int r6 = r14 - r0\n int r6 = r6 - r12\n int r6 = r6 - r5\n int r8 = r3.bottomMargin\n goto L_0x007e\n L_0x0073:\n int r6 = r14 - r0\n int r6 = r6 - r12\n int r6 = r6 - r5\n int r6 = r6 / 2\n int r8 = r3.topMargin\n int r6 = r6 + r8\n int r8 = r3.bottomMargin\n L_0x007e:\n int r6 = r6 - r8\n L_0x007f:\n org.telegram.ui.PopupNotificationActivity r8 = org.telegram.ui.PopupNotificationActivity.this\n org.telegram.ui.Components.ChatActivityEnterView r8 = r8.chatActivityEnterView\n boolean r8 = r8.isPopupView(r1)\n if (r8 == 0) goto L_0x0094\n int r3 = r9.getMeasuredHeight()\n if (r0 == 0) goto L_0x0092\n int r3 = r3 - r0\n L_0x0092:\n r6 = r3\n goto L_0x00da\n L_0x0094:\n org.telegram.ui.PopupNotificationActivity r8 = org.telegram.ui.PopupNotificationActivity.this\n org.telegram.ui.Components.ChatActivityEnterView r8 = r8.chatActivityEnterView\n boolean r8 = r8.isRecordCircle(r1)\n if (r8 == 0) goto L_0x00da\n org.telegram.ui.PopupNotificationActivity r6 = org.telegram.ui.PopupNotificationActivity.this\n android.widget.RelativeLayout r6 = r6.popupContainer\n int r6 = r6.getTop()\n org.telegram.ui.PopupNotificationActivity r7 = org.telegram.ui.PopupNotificationActivity.this\n android.widget.RelativeLayout r7 = r7.popupContainer\n int r7 = r7.getMeasuredHeight()\n int r6 = r6 + r7\n int r7 = r1.getMeasuredHeight()\n int r6 = r6 - r7\n int r7 = r3.bottomMargin\n int r6 = r6 - r7\n org.telegram.ui.PopupNotificationActivity r7 = org.telegram.ui.PopupNotificationActivity.this\n android.widget.RelativeLayout r7 = r7.popupContainer\n int r7 = r7.getLeft()\n org.telegram.ui.PopupNotificationActivity r8 = org.telegram.ui.PopupNotificationActivity.this\n android.widget.RelativeLayout r8 = r8.popupContainer\n int r8 = r8.getMeasuredWidth()\n int r7 = r7 + r8\n int r8 = r1.getMeasuredWidth()\n int r7 = r7 - r8\n int r3 = r3.rightMargin\n int r7 = r7 - r3\n L_0x00da:\n int r4 = r4 + r7\n int r5 = r5 + r6\n r1.layout(r7, r6, r4, r5)\n L_0x00df:\n int r2 = r2 + 1\n goto L_0x001d\n L_0x00e3:\n r9.notifyHeightChanged()\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.telegram.ui.PopupNotificationActivity.AnonymousClass1.onLayout(boolean, int, int, int, int):void\");\n }\n };\n setContentView(r2);\n r2.setBackgroundColor(-NUM);\n RelativeLayout relativeLayout = new RelativeLayout(this);\n r2.addView(relativeLayout, LayoutHelper.createFrame(-1, -1.0f));\n AnonymousClass2 r10 = new RelativeLayout(this) {\n /* access modifiers changed from: protected */\n public void onMeasure(int i, int i2) {\n super.onMeasure(i, i2);\n int measuredWidth = PopupNotificationActivity.this.chatActivityEnterView.getMeasuredWidth();\n int measuredHeight = PopupNotificationActivity.this.chatActivityEnterView.getMeasuredHeight();\n for (int i3 = 0; i3 < getChildCount(); i3++) {\n View childAt = getChildAt(i3);\n if (childAt.getTag() instanceof String) {\n childAt.measure(View.MeasureSpec.makeMeasureSpec(measuredWidth, NUM), View.MeasureSpec.makeMeasureSpec(measuredHeight - AndroidUtilities.dp(3.0f), NUM));\n }\n }\n }\n\n /* access modifiers changed from: protected */\n public void onLayout(boolean z, int i, int i2, int i3, int i4) {\n super.onLayout(z, i, i2, i3, i4);\n for (int i5 = 0; i5 < getChildCount(); i5++) {\n View childAt = getChildAt(i5);\n if (childAt.getTag() instanceof String) {\n childAt.layout(childAt.getLeft(), PopupNotificationActivity.this.chatActivityEnterView.getTop() + AndroidUtilities.dp(3.0f), childAt.getRight(), PopupNotificationActivity.this.chatActivityEnterView.getBottom());\n }\n }\n }\n };\n this.popupContainer = r10;\n r10.setBackgroundColor(Theme.getColor(\"windowBackgroundWhite\"));\n relativeLayout.addView(this.popupContainer, LayoutHelper.createRelative(-1, 240, 12, 0, 12, 0, 13));\n ChatActivityEnterView chatActivityEnterView2 = this.chatActivityEnterView;\n if (chatActivityEnterView2 != null) {\n chatActivityEnterView2.onDestroy();\n }\n ChatActivityEnterView chatActivityEnterView3 = new ChatActivityEnterView(this, r2, (ChatActivity) null, false);\n this.chatActivityEnterView = chatActivityEnterView3;\n chatActivityEnterView3.setId(1000);\n this.popupContainer.addView(this.chatActivityEnterView, LayoutHelper.createRelative(-1, -2, 12));\n this.chatActivityEnterView.setDelegate(new ChatActivityEnterView.ChatActivityEnterViewDelegate() {\n public /* synthetic */ void bottomPanelTranslationYChanged(float f) {\n ChatActivityEnterView.ChatActivityEnterViewDelegate.CC.$default$bottomPanelTranslationYChanged(this, f);\n }\n\n public void didPressAttachButton() {\n }\n\n public /* synthetic */ boolean hasForwardingMessages() {\n return ChatActivityEnterView.ChatActivityEnterViewDelegate.CC.$default$hasForwardingMessages(this);\n }\n\n public /* synthetic */ boolean hasScheduledMessages() {\n return ChatActivityEnterView.ChatActivityEnterViewDelegate.CC.$default$hasScheduledMessages(this);\n }\n\n public void needChangeVideoPreviewState(int i, float f) {\n }\n\n public void needShowMediaBanHint() {\n }\n\n public void needStartRecordAudio(int i) {\n }\n\n public void needStartRecordVideo(int i, boolean z, int i2) {\n }\n\n public void onAttachButtonHidden() {\n }\n\n public void onAttachButtonShow() {\n }\n\n public void onAudioVideoInterfaceUpdated() {\n }\n\n public void onMessageEditEnd(boolean z) {\n }\n\n public void onPreAudioVideoRecord() {\n }\n\n public void onSendLongClick() {\n }\n\n public void onStickersExpandedChange() {\n }\n\n public void onStickersTab(boolean z) {\n }\n\n public void onSwitchRecordMode(boolean z) {\n }\n\n public void onTextChanged(CharSequence charSequence, boolean z) {\n }\n\n public void onTextSelectionChanged(int i, int i2) {\n }\n\n public void onTextSpansChanged(CharSequence charSequence) {\n }\n\n public /* synthetic */ void onTrendingStickersShowed(boolean z) {\n ChatActivityEnterView.ChatActivityEnterViewDelegate.CC.$default$onTrendingStickersShowed(this, z);\n }\n\n public void onUpdateSlowModeButton(View view, boolean z, CharSequence charSequence) {\n }\n\n public void onWindowSizeChanged(int i) {\n }\n\n public /* synthetic */ void openScheduledMessages() {\n ChatActivityEnterView.ChatActivityEnterViewDelegate.CC.$default$openScheduledMessages(this);\n }\n\n public /* synthetic */ void prepareMessageSending() {\n ChatActivityEnterView.ChatActivityEnterViewDelegate.CC.$default$prepareMessageSending(this);\n }\n\n public /* synthetic */ void scrollToSendingMessage() {\n ChatActivityEnterView.ChatActivityEnterViewDelegate.CC.$default$scrollToSendingMessage(this);\n }\n\n public void onMessageSend(CharSequence charSequence, boolean z, int i) {\n if (PopupNotificationActivity.this.currentMessageObject != null) {\n if (PopupNotificationActivity.this.currentMessageNum >= 0 && PopupNotificationActivity.this.currentMessageNum < PopupNotificationActivity.this.popupMessages.size()) {\n PopupNotificationActivity.this.popupMessages.remove(PopupNotificationActivity.this.currentMessageNum);\n }\n MessagesController.getInstance(PopupNotificationActivity.this.currentMessageObject.currentAccount).markDialogAsRead(PopupNotificationActivity.this.currentMessageObject.getDialogId(), PopupNotificationActivity.this.currentMessageObject.getId(), Math.max(0, PopupNotificationActivity.this.currentMessageObject.getId()), PopupNotificationActivity.this.currentMessageObject.messageOwner.date, true, 0, 0, true, 0);\n MessageObject unused = PopupNotificationActivity.this.currentMessageObject = null;\n PopupNotificationActivity.this.getNewMessage();\n }\n }\n\n public void needSendTyping() {\n if (PopupNotificationActivity.this.currentMessageObject != null) {\n MessagesController.getInstance(PopupNotificationActivity.this.currentMessageObject.currentAccount).sendTyping(PopupNotificationActivity.this.currentMessageObject.getDialogId(), 0, 0, PopupNotificationActivity.this.classGuid);\n }\n }\n });\n FrameLayoutTouch frameLayoutTouch = new FrameLayoutTouch(this);\n this.messageContainer = frameLayoutTouch;\n this.popupContainer.addView(frameLayoutTouch, 0);\n ActionBar actionBar2 = new ActionBar(this);\n this.actionBar = actionBar2;\n actionBar2.setOccupyStatusBar(false);\n this.actionBar.setBackButtonImage(NUM);\n this.actionBar.setBackgroundColor(Theme.getColor(\"actionBarDefault\"));\n this.actionBar.setItemsBackgroundColor(Theme.getColor(\"actionBarDefaultSelector\"), false);\n this.popupContainer.addView(this.actionBar);\n ViewGroup.LayoutParams layoutParams = this.actionBar.getLayoutParams();\n layoutParams.width = -1;\n this.actionBar.setLayoutParams(layoutParams);\n ActionBarMenuItem addItemWithWidth = this.actionBar.createMenu().addItemWithWidth(2, 0, AndroidUtilities.dp(56.0f));\n TextView textView = new TextView(this);\n this.countText = textView;\n textView.setTextColor(Theme.getColor(\"actionBarDefaultSubtitle\"));\n this.countText.setTextSize(1, 14.0f);\n this.countText.setGravity(17);\n addItemWithWidth.addView(this.countText, LayoutHelper.createFrame(56, -1.0f));\n FrameLayout frameLayout = new FrameLayout(this);\n this.avatarContainer = frameLayout;\n frameLayout.setPadding(AndroidUtilities.dp(4.0f), 0, AndroidUtilities.dp(4.0f), 0);\n this.actionBar.addView(this.avatarContainer);\n FrameLayout.LayoutParams layoutParams2 = (FrameLayout.LayoutParams) this.avatarContainer.getLayoutParams();\n layoutParams2.height = -1;\n layoutParams2.width = -2;\n layoutParams2.rightMargin = AndroidUtilities.dp(48.0f);\n layoutParams2.leftMargin = AndroidUtilities.dp(60.0f);\n layoutParams2.gravity = 51;\n this.avatarContainer.setLayoutParams(layoutParams2);\n BackupImageView backupImageView = new BackupImageView(this);\n this.avatarImageView = backupImageView;\n backupImageView.setRoundRadius(AndroidUtilities.dp(21.0f));\n this.avatarContainer.addView(this.avatarImageView);\n FrameLayout.LayoutParams layoutParams3 = (FrameLayout.LayoutParams) this.avatarImageView.getLayoutParams();\n layoutParams3.width = AndroidUtilities.dp(42.0f);\n layoutParams3.height = AndroidUtilities.dp(42.0f);\n layoutParams3.topMargin = AndroidUtilities.dp(3.0f);\n this.avatarImageView.setLayoutParams(layoutParams3);\n TextView textView2 = new TextView(this);\n this.nameTextView = textView2;\n textView2.setTextColor(Theme.getColor(\"actionBarDefaultTitle\"));\n this.nameTextView.setTextSize(1, 18.0f);\n this.nameTextView.setLines(1);\n this.nameTextView.setMaxLines(1);\n this.nameTextView.setSingleLine(true);\n this.nameTextView.setEllipsize(TextUtils.TruncateAt.END);\n this.nameTextView.setGravity(3);\n this.nameTextView.setTypeface(AndroidUtilities.getTypeface(\"fonts/rmedium.ttf\"));\n this.avatarContainer.addView(this.nameTextView);\n FrameLayout.LayoutParams layoutParams4 = (FrameLayout.LayoutParams) this.nameTextView.getLayoutParams();\n layoutParams4.width = -2;\n layoutParams4.height = -2;\n layoutParams4.leftMargin = AndroidUtilities.dp(54.0f);\n layoutParams4.bottomMargin = AndroidUtilities.dp(22.0f);\n layoutParams4.gravity = 80;\n this.nameTextView.setLayoutParams(layoutParams4);\n TextView textView3 = new TextView(this);\n this.onlineTextView = textView3;\n textView3.setTextColor(Theme.getColor(\"actionBarDefaultSubtitle\"));\n this.onlineTextView.setTextSize(1, 14.0f);\n this.onlineTextView.setLines(1);\n this.onlineTextView.setMaxLines(1);\n this.onlineTextView.setSingleLine(true);\n this.onlineTextView.setEllipsize(TextUtils.TruncateAt.END);\n this.onlineTextView.setGravity(3);\n this.avatarContainer.addView(this.onlineTextView);\n FrameLayout.LayoutParams layoutParams5 = (FrameLayout.LayoutParams) this.onlineTextView.getLayoutParams();\n layoutParams5.width = -2;\n layoutParams5.height = -2;\n layoutParams5.leftMargin = AndroidUtilities.dp(54.0f);\n layoutParams5.bottomMargin = AndroidUtilities.dp(4.0f);\n layoutParams5.gravity = 80;\n this.onlineTextView.setLayoutParams(layoutParams5);\n this.actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() {\n public void onItemClick(int i) {\n if (i == -1) {\n PopupNotificationActivity.this.onFinish();\n PopupNotificationActivity.this.finish();\n } else if (i == 1) {\n PopupNotificationActivity.this.openCurrentMessage();\n } else if (i == 2) {\n PopupNotificationActivity.this.switchToNextMessage();\n }\n }\n });\n PowerManager.WakeLock newWakeLock = ((PowerManager) ApplicationLoader.applicationContext.getSystemService(\"power\")).newWakeLock(NUM, \"screen\");\n this.wakeLock = newWakeLock;\n newWakeLock.setReferenceCounted(false);\n handleIntent(getIntent());\n }",
"private void sendNotification(String title,String date)\n {\n\n NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n Intent intent = new Intent(getApplicationContext(), MainActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n intent.putExtra(\"msg\", title);\n\n PendingIntent contentIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this).setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(title)\n .setStyle(new NotificationCompat.BigTextStyle().bigText(title))\n .setContentText(date)\n .setAutoCancel(true)\n .setVibrate(new long[]{0, 500});\n\n mBuilder.setContentIntent(contentIntent);\n mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());\n\n }",
"public void updateNotification(){\n Bitmap androidImage=BitmapFactory.decodeResource(getResources(),R.drawable.mascot_1);\n NotificationCompat.Builder notifyBuilder=getNotificationBuilder();\n notifyBuilder.setStyle(new NotificationCompat.BigPictureStyle().bigPicture(androidImage).setBigContentTitle(\"Notificacion actualizada!\"));\n mNotifyManager.notify(NOTIFICATION_ID,notifyBuilder.build());\n setNotificationButtonState(false, false, true);\n\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\r\n CharSequence name = \"Picture upload\";\r\n String description =\"PRIKACENA SLIKA\";\r\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\r\n NotificationChannel channel = new NotificationChannel(\"slika1\", name, importance);\r\n channel.setDescription(description);\r\n // Register the channel with the system; you can't change the importance\r\n // or other notification behaviors after this\r\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\r\n notificationManager.createNotificationChannel(channel);\r\n }\r\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tAHNotification notification = new AHNotification.Builder()\n\t\t\t\t\t\t.setText(\":)\")\n\t\t\t\t\t\t.setBackgroundColor(ContextCompat.getColor(ManagerDemoActivity.this, R.color.color_notification_back))\n\t\t\t\t\t\t.setTextColor(ContextCompat.getColor(ManagerDemoActivity.this, R.color.color_notification_text))\n\t\t\t\t\t\t.build();\n\t\t\t\tbottomNavigation.setNotification(notification, 1);\n\t\t\t\tSnackbar.make(bottomNavigation, \"Parking Hero welcomes you :)\",\n\t\t\t\t\t\tSnackbar.LENGTH_SHORT).show();\n\t\t\t}",
"public static Notification createNotification(XmlAppConfigurationProvider appConfigurationProvider,\n Context context, String title, String content, Bundle intentExtras) {\n int smallNotificationIconResourceId = appConfigurationProvider.getSmallNotificationIconResourceId();\n if (smallNotificationIconResourceId == 0) {\n Log.d(TAG, \"Small notification icon resource was not found. Will use the app icon when \" +\n \"displaying notifications.\");\n smallNotificationIconResourceId = appConfigurationProvider.getApplicationIconResourceId();\n }\n\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context);\n notificationBuilder.setTicker(title);\n notificationBuilder.setAutoCancel(true);\n\n // Create broadcast intent that will fire when the notification has been opened. To action on these messages,\n // register a broadcast receiver that listens to intent <your_package_name>.intent.APPBOY_NOTIFICATION_OPENED\n // and <your_package_name>.intent.APPBOY_PUSH_RECEIVED.\n String pushOpenedAction = context.getPackageName() + \".intent.APPBOY_NOTIFICATION_OPENED\";\n Intent pushOpenedIntent = new Intent(pushOpenedAction);\n if (intentExtras != null) {\n pushOpenedIntent.putExtras(intentExtras);\n }\n PendingIntent pushOpenedPendingIntent = PendingIntent.getBroadcast(context, 0, pushOpenedIntent, PendingIntent.FLAG_ONE_SHOT);\n notificationBuilder.setContentIntent(pushOpenedPendingIntent);\n\n\n // Sets the icon used in the notification bar itself.\n notificationBuilder.setSmallIcon(smallNotificationIconResourceId);\n notificationBuilder.setContentTitle(title);\n notificationBuilder.setContentText(content);\n\n // Setting notification sounds are supported after Honeycomb.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && intentExtras != null) {\n // Retrieve sound uri if included in intentExtras bundle.\n if (intentExtras.containsKey(Constants.APPBOY_PUSH_NOTIFICATION_SOUND_KEY)) {\n String soundURI = intentExtras.getString(Constants.APPBOY_PUSH_NOTIFICATION_SOUND_KEY);\n if(soundURI != null) {\n if (soundURI.equals(Constants.APPBOY_PUSH_NOTIFICATION_SOUND_DEFAULT_VALUE)) {\n notificationBuilder.setDefaults(Notification.DEFAULT_SOUND);\n } else {\n notificationBuilder.setSound(Uri.parse(soundURI));\n }\n\n }\n }\n }\n\n // From Honeycomb to ICS, we can use a custom view for our notifications which will allow them to be taller than\n // the standard one line of text.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {\n Resources resources = context.getResources();\n String packageName = context.getPackageName();\n\n int layoutResourceId = resources.getIdentifier(APPBOY_NOTIFICATION_ID, \"layout\", packageName);\n int titleResourceId = resources.getIdentifier(APPBOY_NOTIFICATION_TITLE_ID, \"id\", packageName);\n int contentResourceId = resources.getIdentifier(APPBOY_NOTIFICATION_CONTENT_ID, \"id\", packageName);\n int iconResourceId = resources.getIdentifier(APPBOY_NOTIFICATION_ICON_ID, \"id\", packageName);\n int timeViewResourceId = resources.getIdentifier(APPBOY_NOTIFICATION_TIME_ID, \"id\", packageName);\n int twentyFourHourFormatResourceId = resources.getIdentifier(APPBOY_NOTIFICATION_TWENTY_FOUR_HOUR_FORMAT_ID, \"string\", packageName);\n int twelveHourFormatResourceId = resources.getIdentifier(APPBOY_NOTIFICATION_TWELVE_HOUR_FORTMAT_ID, \"string\", packageName);\n\n String twentyFourHourTimeFormat = getOptionalStringResource(resources,\n twentyFourHourFormatResourceId, Constants.DEFAULT_TWENTY_FOUR_HOUR_TIME_FORMAT);\n String twelveHourTimeFormat = getOptionalStringResource(resources,\n twelveHourFormatResourceId, Constants.DEFAULT_TWELVE_HOUR_TIME_FORMAT);\n\n if (layoutResourceId == 0 || titleResourceId == 0 || contentResourceId == 0 || iconResourceId == 0\n || timeViewResourceId == 0) {\n Log.w(TAG, String.format(\"Couldn't find all resource IDs for custom notification view, extended view will \" +\n \"not be used for push notifications. Received %d for layout, %d for title, %d for content, %d for icon, \" +\n \"and %d for time.\",\n layoutResourceId, titleResourceId, contentResourceId, iconResourceId, timeViewResourceId));\n } else {\n Log.d(TAG, \"Using RemoteViews for rendering of push notification.\");\n RemoteViews remoteViews = new RemoteViews(packageName, layoutResourceId);\n remoteViews.setTextViewText(titleResourceId, title);\n remoteViews.setTextViewText(contentResourceId, content);\n remoteViews.setImageViewResource(iconResourceId, smallNotificationIconResourceId);\n\n // Custom views cannot be used as part of a RemoteViews so we're using a TextView widget instead. This\n // view will always display the time without date information (even after the day has changed).\n SimpleDateFormat timeFormat = new SimpleDateFormat(\n android.text.format.DateFormat.is24HourFormat(context) ? twentyFourHourTimeFormat : twelveHourTimeFormat);\n String notificationTime = timeFormat.format(new Date());\n remoteViews.setTextViewText(timeViewResourceId, notificationTime);\n notificationBuilder.setContent(remoteViews);\n return notificationBuilder.build();\n }\n }\n\n // If we're using Jelly Bean, we can use the Big View Style, which lets the notification layout size grow to\n // accommodate longer text and images.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {\n\n // Summary text which appears with content in expanded view.\n String summaryText = \"\";\n\n // If there is an image url found in the extras payload and the image can be downloaded, then\n // use the android BigPictureStyle as the notification. Else, use the BigTextStyle instead.\n if (intentExtras != null) {\n\n // Retrieve summary text if included in intentExtras bundle.\n if (intentExtras.containsKey(Constants.APPBOY_PUSH_SUMMARY_TEXT_KEY)) {\n summaryText = intentExtras.getString(Constants.APPBOY_PUSH_SUMMARY_TEXT_KEY);\n }\n\n // Set a custom notification priority if defined in the bundle.\n notificationBuilder.setPriority(getNotificationPriority(intentExtras));\n\n Bundle extrasBundle = getExtrasBundle(intentExtras);\n if (extrasBundle!=null && extrasBundle.containsKey(Constants.APPBOY_PUSH_BIG_IMAGE_URL_KEY)) {\n String imageUrl = extrasBundle.getString(Constants.APPBOY_PUSH_BIG_IMAGE_URL_KEY);\n Bitmap imageBitmap = downloadImageBitmap(imageUrl);\n if (imageBitmap != null) {\n Log.d(TAG, \"Rendering push notification with BigPictureStyle\");\n\n return getBigPictureNotification(notificationBuilder, imageBitmap, content, summaryText);\n } else {\n Log.d(TAG, \"Bitmap download failed for push notification\");\n }\n }\n }\n Log.d(TAG, \"Rendering push notification with BigTextStyle\");\n return getBigTextNotification(notificationBuilder, content, summaryText);\n }\n return notificationBuilder.build();\n }",
"public void sendNotification(View view) {\n\t\t Intent intent = new Intent(this, MainActivity.class);\r\n\t\t PendingIntent pIntent = PendingIntent.getActivity(this, 0, intent, 0);\r\n\r\n\t\t // Build notification\r\n\t\t // Actions are just fake\r\n\t\t Notification noti = new Notification.Builder(this)\r\n\t\t .setContentTitle(\"TodoList Item\")\r\n\t\t .setContentText(\"A New Item was Added\").setSmallIcon(R.drawable.ic_launcher)\r\n\t\t .setContentIntent(pIntent).build();\r\n\t\t //.addAction(R.drawable.ic_launcher, \"Call\", pIntent);\r\n\t\t //.addAction(R.drawable.ic_launcher, \"More\", pIntent)\r\n\t\t //.addAction(R.drawable.ic_launcher, \"And more\", pIntent).build();\r\n\t\t NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\r\n\t\t // hide the notification after its selected\r\n\t\t noti.flags |= Notification.FLAG_AUTO_CANCEL;\r\n\r\n\t\t notificationManager.notify(0, noti);\r\n\r\n\t\t }",
"public void oreo(String t, String d){\n String id = \"messange\";\n\n NotificationManager nm = (NotificationManager) getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);\n NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext(),id);\n Uri soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);\n Intent intent = new Intent(getApplicationContext(), Menu_principla_Activity.class);\n\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){\n NotificationChannel nc = new NotificationChannel(id,\"nuevo\",NotificationManager.IMPORTANCE_HIGH);\n nc.setDescription(\"Notification FCM\");\n nc.setShowBadge(true);\n assert nm != null;\n System.out.println(\"Bandera 1\");\n nm.createNotificationChannel(nc);\n }\n/*\n\n\n // intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(),1,intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n builder.setAutoCancel(true)\n .setWhen(System.currentTimeMillis())\n .setContentTitle(t).setCategory(Notification.CATEGORY_SERVICE)\n .setDefaults(Notification.DEFAULT_ALL)\n .setSound(soundUri)\n .setTicker(\"Nueva notification\")\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentText(d)\n .setContentIntent(pendingIntent)\n .setContentInfo(\"nuevo\")\n .setVibrate(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});\n\n Random random = new Random();\n int idNotify = random.nextInt(8000);\n\n assert nm != null;\n nm.notify(idNotify,builder.build());\n\n */\n PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(),1,intent, PendingIntent.FLAG_UPDATE_CURRENT);\n notification = new NotificationCompat.Builder(getApplicationContext())\n .setContentIntent(pendingIntent)\n .setSmallIcon(R.drawable.ic_medical_services_black_24dp)\n .setSound(soundUri)\n .setAutoCancel(true)\n .setContentTitle(t).setCategory(Notification.CATEGORY_SERVICE)\n .setContentText(d).build();\n nm.notify(1,notification);\n\n System.out.println(\"Bandera 2\");\n }",
"private void sendHeadlinerNotification() {\n startService(new Intent(this, ForegroundNotificationService.class));\n }",
"private Notification.Builder createNotificationWithOutChannel(String title, String message){\n PendingIntent pendingIntent = setIntent(title,message);\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT_WATCH) {\n Notification.Action action = new Notification.Action.Builder(\n android.R.drawable.ic_menu_send,\n \"See details\",\n pendingIntent\n ).build();\n }\n\n return new Notification.Builder(getApplicationContext())\n .setContentTitle(title)\n .setContentIntent(pendingIntent)\n .setContentText(message)\n .setSmallIcon(android.R.drawable.stat_notify_chat)\n .setAutoCancel(true);\n }",
"public void createNotificationChannel() {\n weatherNotificationManager =\n (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n // Notification channels are only available in OREO and higher.\n // So, add a check on SDK version.\n if (android.os.Build.VERSION.SDK_INT >=\n android.os.Build.VERSION_CODES.O) {\n\n // Create the NotificationChannel with all the parameters.\n NotificationChannel notificationChannel = new NotificationChannel\n (PRIMARY_CHANNEL_ID,\n \"Weather change.\",\n NotificationManager.IMPORTANCE_HIGH);\n\n notificationChannel.enableLights(true);\n notificationChannel.setLightColor(Color.RED);\n notificationChannel.enableVibration(true);\n notificationChannel.setDescription\n (\"Conditions have are below threshold\");\n weatherNotificationManager.createNotificationChannel(notificationChannel);\n\n }\n }",
"public void createNotificationChannel()\n {\n //Instantiate the NotificationManager\n mNotifyManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n //Notification Channel constructed\n NotificationChannel notificationChannel = new NotificationChannel(PRIMARY_CHANNEL_ID, \"Simple Notification\", NotificationManager.IMPORTANCE_HIGH);\n notificationChannel.enableLights(true);\n notificationChannel.setLightColor(Color.RED);\n notificationChannel.enableVibration(true);\n notificationChannel.setDescription(\"Simple Notification\");\n\n //Create the channel with the NotificationManager\n mNotifyManager.createNotificationChannel(notificationChannel);\n }",
"public static void noti(Context context, String title, String content, int notifyid) {\n NotificationCompat.Builder builder = new NotificationCompat.Builder(context);\n builder.setContentTitle(title)\n .setContentText(content)\n .setSmallIcon(R.mipmap.ic_launcher);\n builder.setDefaults(Notification.DEFAULT_SOUND);\n// Creates an Intent for the Activity\n Intent notifyIntent =\n new Intent(context, SmartCabinetDeviceListActivity.class);\n// Sets the Activity to start in a new, empty task\n notifyIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK\n | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n// Creates the PendingIntent\n PendingIntent notifyPendingIntent =\n PendingIntent.getActivity(\n context,\n 0,\n notifyIntent,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n// Puts the PendingIntent into the notification builder\n builder.setContentIntent(notifyPendingIntent);\n// Notifications are issued by sending them to the\n// NotificationManager system service.\n NotificationManager mNotificationManager =\n (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n// Builds an anonymous Notification object from the builder, and\n// passes it to the NotificationManager\n mNotificationManager.notify(notifyid, builder.build());\n }",
"@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.main);\n\n\t\tmNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n\t\t// status bar notifications\n\t\tnotifyDetails = new Notification(R.drawable.ic_launcher,\n\t\t\t\t\"New Alert, Click Me!\", System.currentTimeMillis());\n\n\t\t// on notification click\n\t\tCharSequence contentTitle = \"Notification Details.........\";\n\n\t\tCharSequence contentText = \"Child has changed the sim\";\n\t\tIntent notificationIntent = new Intent(this,\n\t\t\t\tParentHomeActivity.class);\n\t\tPendingIntent contentIntent = PendingIntent.getActivity(this, 0,\n\t\t\t\tnotificationIntent, 0);\n\n\t\tnotifyDetails.setLatestEventInfo(this, contentTitle, contentText,\n\t\t\t\tcontentIntent);\n\t}",
"private NotificationCompat.Builder getNotificationBuilder()\n {\n //Launches the application once the user clicks the notification\n //Pending intent that is sent when the user clicks on the notification in the notification bar\n Intent notificationIntent = new Intent(this, MainActivity.class);\n PendingIntent notificationPendingIntent = PendingIntent.getActivity(this, NOTIFICATION_ID, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n NotificationCompat.Builder notifyBuilder = new NotificationCompat.Builder(this, PRIMARY_CHANNEL_ID)\n .setContentTitle(\"You've been notified!\")\n .setContentText(\"This is your notification text.\")\n .setContentIntent(notificationPendingIntent)\n .setSmallIcon(R.drawable.ic_stat_name);\n return notifyBuilder;\n }",
"public void showNotification(String title,\n String message) {\n\n Intent intent\n = new Intent(this, HomeActivity.class);\n\n String channel_id = \"CCULife\";\n\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\n PendingIntent pendingIntent\n = PendingIntent.getActivity(\n this, 0, intent,\n PendingIntent.FLAG_ONE_SHOT);\n\n // Create a Builder object using NotificationCompat\n // class. This will allow control over all the flags\n NotificationCompat.Builder builder\n = new NotificationCompat\n .Builder(getApplicationContext(),\n channel_id)\n .setSmallIcon(R.drawable.sicon)\n .setAutoCancel(true)\n .setVibrate(new long[]{1000, 1000, 1000,\n 1000, 1000})\n .setOnlyAlertOnce(true)\n .setContentIntent(pendingIntent);\n\n // A customized design for the notification can be\n // set only for Android versions 4.1 and above. Thus\n // condition for the same is checked here.\n if (Build.VERSION.SDK_INT\n >= Build.VERSION_CODES.JELLY_BEAN) {\n builder = builder.setContent(\n getCustomDesign(title, message));\n } // If Android Version is lower than Jelly Beans,\n // customized layout cannot be used and thus the\n // layout is set as follows\n else {\n builder = builder.setContentTitle(title)\n .setContentText(message)\n .setSmallIcon(getNotificationIcon());\n }\n // Create an object of NotificationManager class to\n // notify the\n // user of events that happen in the background.\n NotificationManager notificationManager\n = (NotificationManager) getSystemService(\n Context.NOTIFICATION_SERVICE);\n // Check if the Android Version is greater than Oreo\n if (Build.VERSION.SDK_INT\n >= Build.VERSION_CODES.O) {\n NotificationChannel notificationChannel\n = new NotificationChannel(\n channel_id, \"CCULife\",\n NotificationManager.IMPORTANCE_HIGH);\n notificationManager.createNotificationChannel(\n notificationChannel);\n }\n\n notificationManager.notify(0, builder.build());\n }",
"public void createOrUpdateNotification(Stock stock) {\n Intent intent = new Intent(mContext, MainActivity.class);\n PendingIntent pIntent = PendingIntent.getActivity(mContext, 0, intent, 0);\n\n // Build notification\n // Actions are just fake\n\n int color = stock.getLastDelta() > 0 ? mContext.getResources().getColor(android.R.color.holo_green_light) : mContext.getResources().getColor(android.R.color.holo_red_light);\n\n int change = (int) ((stock.getLastDelta() * 100) / (stock.getPrice() - stock.getLastDelta()));\n String indicator_text = stock.getLastDelta() > 0 ? mContext.getString(R.string.risen) : mContext.getString(R.string.dropped);\n\n DecimalFormat myFormatter = new DecimalFormat(\"##0.00\");\n\n\n String contentText = mContext.getString(R.string.notification_content, stock\n .getSymbol().toUpperCase(), color, indicator_text, myFormatter.format(stock.getPrice()), \"(\" + change +\"%)\");\n\n\n SpannableStringBuilder cs = new SpannableStringBuilder(contentText);\n int start = contentText.indexOf(indicator_text);\n int end = start + indicator_text.length();\n cs.setSpan(new ForegroundColorSpan(color), start, end, Spanned.SPAN_INCLUSIVE_INCLUSIVE);\n\n\n\n Notification noti = new NotificationCompat.Builder(mContext)\n .setContentTitle(mContext.getString(R.string.title))\n .setContentText(cs)\n .setSmallIcon(R.drawable.ic_launcher)\n .setContentIntent(pIntent)\n .build();\n\n NotificationManager notificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);\n\n // Hide the notification after its selected\n noti.flags |= Notification.FLAG_AUTO_CANCEL;\n\n notificationManager.notify(stock.getId().intValue(), noti);\n\n\n }",
"public static void createNotification1(Context context, Reminder reminder) {\n\n\n Intent intent = new Intent(context, SplashActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(context, 0 /* Request code */, intent,\n PendingIntent.FLAG_ONE_SHOT);\n\n String channelId = context.getString(R.string.default_notification_channel_id);\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n NotificationCompat.Builder notificationBuilder =\n new NotificationCompat.Builder(context, channelId)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(reminder.getTitle())\n .setContentText(reminder.getContent())\n .setAutoCancel(true)\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager =\n (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n\n // Since android Oreo notification channel is needed.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n NotificationChannel channel = new NotificationChannel(channelId,\n \"Channel human readable title\",\n NotificationManager.IMPORTANCE_DEFAULT);\n notificationManager.createNotificationChannel(channel);\n }\n\n notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());\n\n DeleteNotification(reminder,context);\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 }",
"private void showNotificationCourse(Bundle data) {\n\n/* try {\n int unreadNotificationCount = Integer.valueOf(data.getString(\"total_unread_notification\"));\n NotificationCountEventBus.Event event = new NotificationCountEventBus.Event(unreadNotificationCount);\n NotificationCountEventBus.getInstance().post(event);\n } catch (Exception ignored) {\n\n }*/\n\n // check the type_push from data and navigate to activity\n Intent intent = navigateNotification(data);\n\n PendingIntent pendingIntent = PendingIntent.getActivity(this, notificationId, intent,\n PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT);\n\n\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(getNotificationIcon())\n .setContentTitle(data.getString(\"title\"))\n .setContentText(data.getString(\"body\"))\n .setAutoCancel(true)\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n notificationManager.notify(notificationId++, notificationBuilder.build());\n }",
"@NonNull\n\tNotificationBuilder newNotification();",
"private void sendNotificationSample() {\n Intent notificationIntent = new Intent(GCMIntentService.this, AlertActivity.class);\n\n // Get a PendingIntent containing the entire back stack.\n int i = new Random().nextInt(100);\n PendingIntent notificationPendingIntent = PendingIntent.getActivity(GCMIntentService.this, i, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // Get a notification builder that's compatible with platform versions >= 4\n NotificationCompat.Builder builder = new NotificationCompat.Builder(GCMIntentService.this);\n\n // Define the notification settings.\n builder.setSmallIcon(R.drawable.icon_v2)\n // In a real app, you may want to use a library like Volley\n // to decode the Bitmap.\n //.setLargeIcon(BitmapFactory.decodeResource(ctx.getResources(), R.drawable.ic_launcher)).\n .setContentTitle(\"Shang\").setContentText(i + \". This is test mesage from notification\").setContentIntent(notificationPendingIntent);\n\n // Dismiss notification once the user touches it.\n builder.setAutoCancel(true);\n\n Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n builder.setSound(alarmSound);\n\n builder.setVibrate(new long[]{0, 2000});\n\n builder.setContentIntent(notificationPendingIntent);\n\n // Get an instance of the Notification manager\n NotificationManager mNotificationManager = (NotificationManager) GCMIntentService.this.getSystemService(Context.NOTIFICATION_SERVICE);\n\n // Issue the notification\n mNotificationManager.notify(i, builder.build());\n }",
"@Override\n public void onNotificationPosted(StatusBarNotification sbn) {\n int notificationCode = matchNotificationCode(sbn);\n String pack = \"\";\n Bundle extras = null;\n String title = \"\";\n String text = \"\";\n String subtext = \"\";\n String key = \"\";\n try {\n pack = sbn.getPackageName();\n extras = sbn.getNotification().extras;\n //Prendo i dati della notifica\n title = extras.getString(\"android.title\");\n //Parso il titolo\n if (title.contains(\"(\") && title.contains(\")\") && (title.contains((\"messaggi\")) || title.contains(\"messaggio\"))) {\n int posA = title.lastIndexOf('(');\n title = title.substring(0, posA - 1);\n }\n text = extras.getCharSequence(\"android.text\").toString();\n subtext = \"\";\n } catch (Exception ex) {\n Log.d(\"WHATSAPP RIGA 100\", \"Conv fallita\");\n }\n if (matchNotificationCode(sbn) != InterceptedNotificationCode.OTHER_NOTIFICATIONS_CODE) {\n if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)) {\n //EDIT\n /* Used for SendBroadcast */\n try {\n Parcelable b[] = (Parcelable[]) extras.get(Notification.EXTRA_MESSAGES);\n String content;\n if (b != null) {\n content = \"\";\n for (Parcelable tmp : b) {\n key = String.valueOf(tmp.hashCode());\n Bundle msgBundle = (Bundle) tmp;\n subtext = msgBundle.getString(\"text\");\n //content = content + msgBundle.getString(\"text\") + \"\\n\";\n }\n /*Toast.makeText(getApplicationContext(), content,\n Toast.LENGTH_LONG).show();*/\n }\n if (subtext.isEmpty()) {\n subtext = text;\n }\n } catch (Exception e) {\n Log.d(\"ERRORE RIGA 90 WHATSAPP\", \"Probabilmente la notifica è sballata\");\n }\n Notifica nuovaNotifica = new Notifica();\n\n if (subtext != null) {\n if (!text.contains(\"nuovi messaggi\") && !text.contains(\"WhatsApp Web is currently active\") && !text.contains(\"WhatsApp Web login\") && !title.toLowerCase().equals(\"whatsapp\")) {\n try {\n DateFormat df = new SimpleDateFormat(\"ddMMyyyyHHmmss\");\n String date = df.format(Calendar.getInstance().getTime());\n nuovaNotifica = new Notifica(key, pack, title, subtext, date);\n } catch (Exception ex) {\n Log.d(\"WHATSAPP RIGA 100\", \"Conversione fallita\");\n }\n try {\n //Parso il messaggio se viene da instagram\n if (matchNotificationCode(sbn) == InterceptedNotificationCode.INSTAGRAM_CODE) {\n //Elimino l'username nel messaggio\n if (subtext.contains(\":\"))\n subtext = subtext.substring(subtext.indexOf(':') + 2, subtext.length());\n else {\n if (subtext.contains(title)) {\n int ind = subtext.indexOf(title);\n subtext = subtext.replace(title, \"\");\n subtext = subtext.substring(1, subtext.length());\n }\n }\n }\n } catch (Exception ex) {\n Log.d(\"WHATSAPP RIGA 160\", \"Parser fallito\");\n }\n //Controllo che non abbia già ricevuto il messaggio\n String contatto = title + matchNotificationCode(sbn);\n int posizioneContatto = TrovaContattoInUltimiMessaggi(contatto);\n boolean daInviare = true;\n //Se ho trovato il contatto, controllo il valore se è diverso aggiungo e invio\n //Altrimenti modifico e non invio\n //Se non lo trovo lo registro e invio\n if (posizioneContatto != -1) {\n String strV = UltimiMessaggi.get(posizioneContatto).UltimoMessaggio;\n if (strV.equals(subtext)) {\n daInviare = false;\n } else {\n SettaUltimoMessaggio(posizioneContatto, subtext);\n }\n } else {\n //Aggiungo il contatto e il messaggio nella lista\n UltimiMessaggi.add(new ContattoAC(contatto, subtext));\n }\n //Invio la notifica alla mainActivity\n if (daInviare) {\n Intent intent = new Intent(\"ricevitoreNotifiche\");\n try {\n /*//LOG\n Log.d(\"Notifica KEY\", key);\n Log.d(\"Contatto\", title);\n Log.d(\"Messaggio\", subtext);*/\n intent.putExtra(\"ID\", nuovaNotifica.getID());\n intent.putExtra(\"Applicazione\", nuovaNotifica.getApplicazione());\n intent.putExtra(\"Titolo\", nuovaNotifica.getTitolo());\n intent.putExtra(\"Testo\", nuovaNotifica.getTesto());\n intent.putExtra(\"DateTime\", nuovaNotifica.getDateTime());\n sendBroadcast(intent);\n } catch (Exception ex) {\n Log.d(\"ERROR RIGA 103 WHATSAPP\", \"Non riesco a inviare in broadcast\");\n }\n }\n }\n /* End Used for Toast */\n }\n }\n }\n\n }",
"private void initStatusBar() {\n ModelerSession.getStatusBarService().addStatusBarItem(\n getIdentifier(), selectedToolStatusBarItem, JideBoxLayout.FIX\n );\n }",
"public void sendNotification(View view) {\n\n NotificationManager nm= (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.O){\n\n //We have to create a notification channel\n NotificationChannel nc = new NotificationChannel(\"srminterns\",\"SRM NOTIFICATIONS\",NotificationManager.IMPORTANCE_HIGH);\n nm.createNotificationChannel(nc);\n\n }\n\n // we have to normally write notification code.\n\n NotificationCompat.Builder builder=new NotificationCompat.Builder(this,\"srminterns\");\n builder.setSmallIcon(R.drawable.umbrella);\n builder.setContentTitle(\"Sample Notification\");\n builder.setContentText(\"This is the description of the notification\");\n builder.setAutoCancel(true);\n\n /* Pending Intent\n * - It is the description of the operation to be performed\n * - can be created using the following methods\n * -getActivity() - if you want to open an activity with pending Intent\n * -getService() - if you want to strat a service with Pending Intent\n * -getBroadcast() - if you want to send a broadcast with Pending Intent\n *\n * Requires 4 Arguments\n * -context\n * -Pending Intent ID (Can be any Integer)\n * -Intent(Action that you want to perform)\n * - FLAG (This flag will tell the existing pending Intent about what to do if there\n * is a new Pending Intent (Arrival) */\n\n PendingIntent pi = PendingIntent.getActivity(this,12,new Intent(this, MainActivity.class)\n ,PendingIntent.FLAG_UPDATE_CURRENT);\n\n builder.setContentIntent(pi);\n\n /*\n * Step1: is to convert any image format that you want to display into a Bitmap image format\n * Step2: is to create bigPicture style before you issue the notification.\n *\n *\n *\n *\n * */\n\n Bitmap bitmap= BitmapFactory.decodeResource(getResources(),R.drawable.kathmandu);\n builder.setStyle(new NotificationCompat.BigPictureStyle().bigPicture(bitmap));\n nm.notify(42,builder.build());\n }",
"private void sendNotification() {\n //Log.e(\"sendNotification: \", \"\" + message);\n\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\n Intent intent = new Intent(this, ClubNewsActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,\n 0);\n\n notificationBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher))\n .setContentTitle(getResources().getString(R.string.app_name))\n .setContentText(getUnexpandedContentText(strArrList.size()))\n .setAutoCancel(true)\n /*.setNumber(strArrList.size())*/\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent)\n .setPriority(Notification.PRIORITY_HIGH)\n .setStyle(getExpandedNotificationStyle(strArrList));\n\n NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();\n // Moves events into the expanded layout\n for (int iCount = 0; iCount < strArrList.size(); iCount++) {\n inboxStyle.addLine(strArrList.get(iCount));\n }\n NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.notify(0, notificationBuilder.build());\n }",
"public StatusBar() {\n\t\tsuper();\n\t}",
"@Override\n public void onNotificationPosted(StatusBarNotification sbn) {\n\n if(isConnected()) {\n cone = ConnectBlActivity.con;\n //Here every notification is checked and if the user wands to listen to facebook, we get the message\n if (getFb()) {\n\n\n if (sbn.getPackageName().equals(\"com.facebook.orca\")) { //checking if the is a notification from facebook\n Bundle extras = sbn.getNotification().extras;\n String title;\n\n\n if (!extras.getString(\"android.text\").equals(\"Chat heads active\")) {\n String pack = \"Facebook\";\n title = extras.getString(\"android.text\"); //This is the actual user that sends the message\n String text = extras.getCharSequence(\"android.title\").toString(); //and that is the actual message\n\n\n Log.i(\"Title\", title);\n Log.i(\"Text\", text);\n\n\n //The message is being put in a String Builder\n StringBuilder msg = new StringBuilder();\n msg.append(pack);\n msg.append(\"\\n\");\n msg.append(text);\n msg.append(\"\\n\");\n msg.append(title);\n\n //The ui gets updated with the message\n Main.t.setText(msg);\n\n\n //The message is written to the outputStream\n\n byte[] send = msg.toString().getBytes();\n try {\n cone.write(String.valueOf(msg));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }\n\n\n //Here every notification is checked and if the user wands to listen to instagram, we get the message\n if (getInsta()) {\n if (sbn.getPackageName().equals(\"com.instagram.android\")) { //checking if the is a notification from facebook\n Bundle extras = sbn.getNotification().extras;\n String title = extras.getString(\"android.text\"); //This is the actual user that sends the message\n String text = extras.getCharSequence(\"android.title\").toString(); //and that is the actual message\n\n SimpleDateFormat sdff = new SimpleDateFormat(\"HH:mm\", Locale.getDefault());\n String tempf = sdff.format(new Date());\n\n\n Log.i(\"Title\", title);\n Log.i(\"Text\", text);\n\n\n //The message is being put in a String Builder\n StringBuilder msg = new StringBuilder();\n msg.append(\"`\");\n msg.append(tempf);\n msg.append(\" \");\n msg.append(text);\n msg.append(\" \");\n msg.append(title);\n\n //The ui gets updated with the message\n Main.t.setText(msg);\n\n\n //The message is written to the outputStream\n try {\n cone.write(String.valueOf(msg));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }\n }",
"private void showInboxStyleNotification() {\n NotificationCompat.InboxStyle style = new NotificationCompat.InboxStyle();\n style.setBigContentTitle(\"Inbox Style Regular Notification\");\n style.addLine(\"Line 1\");\n style.addLine(\"Line 2\");\n style.addLine(\"Line 3\");\n style.addLine(\"Line 4\");\n\n //Build the content of the notification\n NotificationCompat.Builder builder = new NotificationCompat.Builder(ActivityA.this);\n builder.setContentTitle(\"Inbox Style Regular Notification\");\n builder.setContentText(contentText);\n builder.setSmallIcon(R.drawable.ic_launcher_background);\n builder.setTicker(\"Hey, This is a ticker!!!!!!\");\n builder.setAutoCancel(true);\n builder.setStyle(style);\n\n\n //Provide explicit intents for notification\n Intent i = new Intent(ActivityA.this,ActivityB.class);\n //Add a back stack using task using stack builder and set the intent to pending intent\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n stackBuilder.addParentStack(ActivityB.class);\n stackBuilder.addNextIntent(i);\n PendingIntent pi_main =stackBuilder.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n //Provide explicit intents Add a back stack using task using stack builder and set the intent to pending intent for settings\n Intent j = new Intent(ActivityA.this,Settings.class);\n TaskStackBuilder stackBuilder_settings = TaskStackBuilder.create(this);\n stackBuilder_settings.addParentStack(Settings.class);\n stackBuilder_settings.addNextIntent(j);\n PendingIntent pi_settings =stackBuilder_settings.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n\n //Provide explicit intents Add a back stack using task using stack builder and set the intent to pending intent for help\n Intent k = new Intent(ActivityA.this,Help.class);\n TaskStackBuilder stackBuilder_help = TaskStackBuilder.create(this);\n stackBuilder_help.addParentStack(Help.class);\n stackBuilder_help.addNextIntent(k);\n PendingIntent pi_help =stackBuilder_help.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n builder.setContentIntent(pi_main);\n builder.addAction(R.drawable.settings,\"Settings\",pi_settings);\n builder.addAction(R.drawable.help,\"Help\",pi_help);\n\n //Notifications through notification manager\n Notification notification = builder.build();\n NotificationManager manager = (NotificationManager) this.getSystemService(NOTIFICATION_SERVICE);\n manager.notify(29,notification);\n }",
"public static void createNotification(MainActivity a, CustomFBProfile profile, IMessagingMetaData meta, HashMap<String, String> loc) {\n NotificationCompat.Builder mBuilder =\n new NotificationCompat.Builder(a)\n .setSmallIcon(R.drawable.acba)\n .setContentTitle(\"New Message\")\n .setContentText(meta.getName().toUpperCase()).setTicker(\"New Message!!\");\n NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();\n mBuilder.setStyle(inboxStyle);\n mBuilder.setVibrate(new long[]{2000, 2000, 1000});\n mBuilder.setLights(Color.RED, 3000, 3000);\n mBuilder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));\n mBuilder.setAutoCancel(true);\n\n// Creates an explicit intent for an Activity in your app\n Intent resultIntent = a.startMessagingActivityFromAnywhereInApp(profile, meta, loc);\n\n// The stack builder object will contain an artificial back stack for the\n// started Activity.\n// This ensures that navigating backward from the Activity leads out of\n// your application to the Home screen.\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(a);\n// Adds the back stack for the Intent (but not the Intent itself)\n stackBuilder.addParentStack(MainActivity.class);\n// Adds the Intent that starts the Activity to the top of the stack\n stackBuilder.addNextIntent(resultIntent);\n PendingIntent resultPendingIntent =\n stackBuilder.getPendingIntent(\n 0,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n mBuilder.setContentIntent(resultPendingIntent);\n NotificationManager mNotificationManager =\n (NotificationManager) a.getSystemService(Context.NOTIFICATION_SERVICE);\n// mId allows you to update the notification later on.\n mNotificationManager.notify(1, mBuilder.build());\n }",
"private void sendNotification(Map<String, String> serverData) {\n Intent intent = new Intent(serverData.get(\"click_action\"));\n String title = serverData.get(\"title\");\n String body = serverData.get(\"body\");\n intent.putExtra(\"title\",title);\n intent.putExtra(\"body\",body);\n intent.putExtra(\"order\" , serverData.get(\"order\"));\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(this,0 /* request code */, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n long[] pattern = {500,500,500,500,500};\n\n Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\n NotificationCompat.Builder notificationBuilder = (NotificationCompat.Builder) new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ok)\n .setContentTitle(serverData.get(\"title\"))\n .setContentText(serverData.get(\"body\"))\n .setAutoCancel(true)\n .setVibrate(pattern)\n .setLights(Color.BLUE,1,1)\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.notify(0 , notificationBuilder.build());\n }",
"private void addNewLevelNotification() {\n\t\tDisplay.getDefault().syncExec(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tNewLevelNotification notification = new NewLevelNotification(Display.getDefault());\n\t\t\t\tNotificationManager.add(notification);\n\t\t\t}\n\t\t});\n\t}",
"public void showTestDoneNotification() {\n Intent intent = new Intent(this, MainActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);\n Notification notification = new NotificationCompat.Builder(getApplicationContext())\n .setContentIntent(PendingIntent.getActivity(this, 0, intent, 0))\n .setSmallIcon(R.drawable.ic_launcher)\n .setContentText(getText(R.string.local_service_test_done))\n .setContentTitle(getText(R.string.local_service_notification)).build();\n notificationManager.notify(NOTIFICATION, notification);\n status = new Status(getString(R.string.ready), false);\n sendStatusMessage();\n }",
"@SuppressWarnings(\"deprecation\")\n\tprivate void showNotification() {\n\t\t// What happens when the notification item is clicked\n\t\tIntent contentIntent = new Intent(this, MainActivity.class);\n\n\t\tPendingIntent pending = PendingIntent.getActivity(\n\t\t\t\tgetApplicationContext(), 0, contentIntent,\n\t\t\t\tandroid.content.Intent.FLAG_ACTIVITY_NEW_TASK);\n\n\t\tNotification nfc = new Notification(R.drawable.ic_launcher, null,\n\t\t\t\tSystem.currentTimeMillis());\n\t\tnfc.flags |= Notification.FLAG_ONGOING_EVENT;\n\n\t\tString contentText = getString(R.string.service_label);\n\n\t\tnfc.setLatestEventInfo(getApplicationContext(), contentText,\n\t\t\t\tcontentText, pending);\n\n\t\tmNM.notify(NOTIFICATION, nfc);\n\t\tSession.setNotificationVisible(true);\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 Notification getNotification() {\n NotificationCompat.Builder builder = new NotificationCompat.Builder(this)\n .setColor(getResources().getColor(R.color.tt_primary))\n .setSmallIcon(R.drawable.ic_action_my_location)\n .setContentTitle(getText(R.string.app_name));\n\n builder.setContentText(getText(R.string.notif_text_tracking));\n\n builder.addAction(\n R.drawable.ic_action_close,\n getString(R.string.action_stop_tracking),\n getServicePendingIntent(ACTION_CLOSE)\n );\n\n builder.setContentIntent(getActivityPendingIntent());\n\n return builder.build();\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n if(status.connection_status == enums.connection_status.connected)\n {\n CharSequence name = \"Sample VPN\";\n String description = \"VPN notification\";\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = home_model.getInstance().getHomeInstance().getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }\n }",
"void showNotification() {\n Intent notificationIntent = new Intent(mContext, MainActivity.class);\n\n // Construct a task stack.\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(mContext);\n\n // Add the main Activity to the task stack as the parent.\n stackBuilder.addParentStack(MainActivity.class);\n\n // Push the content Intent onto the stack.\n stackBuilder.addNextIntent(notificationIntent);\n\n // Get a PendingIntent containing the entire back stack.\n PendingIntent notificationPendingIntent =\n stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);\n\n Notification.Builder notificationBuilder = new Notification.Builder(mContext)\n .setContentTitle(getLocationResultTitle())\n .setContentText(getLocationResultText())\n .setSmallIcon(R.mipmap.ic_launcher)\n .setAutoCancel(true)\n .setContentIntent(notificationPendingIntent);\n\n getNotificationManager().notify(0, notificationBuilder.build());\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = MyShardPrefernces.myNotificationChannelName;\n\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(MyShardPrefernces.myNoficataionChannelID, name, importance);\n channel.setDescription(\"Notifications for alert Messenging\");\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\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 }",
"@Override\r\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tNotificationManager nm = (NotificationManager) getActivity().getSystemService(NOTIFICATION_SERVICE);\r\n\t\t\t\t\tIntent openIntent = new Intent(getActivity(),FullscreenActivity.class);\r\n\t\t\t\t\tPendingIntent contentIntent = PendingIntent.getActivity(getActivity(), 0, openIntent, 0);\r\n\t\t\t\t\tint icon = R.drawable.preferences_desktop_notification;\r\n\t\t\t\t\tNotification n = new Notification(icon,\"通知来了\",System.currentTimeMillis());\r\n\t\t\t\t\tn.flags |= Notification.FLAG_AUTO_CANCEL;//自动消失\r\n\t\t\t\t\tn.defaults = Notification.DEFAULT_SOUND;//声音默认\r\n\t\t\t\t\tn.setLatestEventInfo(getActivity(), \"通知标题\", \"通知正文\", contentIntent);\r\n\t\t\t\t\tnm.notify(0,n);\r\n\t\t\t\t}",
"public Notification (){\n //Calendar cal = Calendar.getInstance();\n //cal.setTimeInMillis(0);\n //cal.set(year, month, day, hours, minutes, seconds);\n\n }",
"private Notification getActivityNotification(String title, String text){\n Intent main = getApplicationContext().getPackageManager().getLaunchIntentForPackage(getApplicationContext().getPackageName());\n main.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 1000, main, PendingIntent.FLAG_UPDATE_CURRENT);\n\n int icon = R.drawable.star_big_on;\n int normalIcon = getResources().getIdentifier(\"icon\", \"drawable\", getPackageName());\n int notificationIcon = getResources().getIdentifier(\"notificationicon\", \"drawable\", getPackageName());\n if(notificationIcon != 0) {\n Log.d(TAG, \"Found Custom Notification Icon!\");\n icon = notificationIcon;\n }\n else if(normalIcon != 0) {\n Log.d(TAG, \"Found normal Notification Icon!\");\n icon = normalIcon;\n }\n\n Notification.Builder builder = new Notification.Builder(this);\n builder.setContentTitle(title);\n builder.setContentText(text);\n builder.setSmallIcon(icon);\n builder.setContentIntent(pendingIntent);\n Notification notification;\n if (android.os.Build.VERSION.SDK_INT >= 16) {\n notification = buildForegroundNotification(builder);\n } else {\n notification = buildForegroundNotificationCompat(builder);\n }\n notification.flags |= Notification.FLAG_ONGOING_EVENT | Notification.FLAG_FOREGROUND_SERVICE | Notification.FLAG_NO_CLEAR;\n return notification;\n }",
"private void showEndOfTripNotification() {\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(\"End of trip\")\n .setContentText(\"Notification text has been sent to \" + myFriendObject.getName());\n int mNotificationId = 001;\n NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n manager.notify(mNotificationId, mBuilder.build());\n }",
"public void buildNotificationSingle(){\n if(arraylisted.size() ==1){\n Product contact = arraylisted.get(0);\n\n String userDept = arraylisted.get(0).getDept();\n String userName = arraylisted.get(0).getName();\n String userLevel = arraylisted.get(0).getLevel();\n String userID = arraylisted.get(0).getuserID();\n String str = notifyliste.get(0).getEmail();\n if(str.length() >=200){\n int k = str.length() / 2;\n str = str.substring(0,k) + \" ...\";\n }\n String prep = userName + System.getProperty(\"line.separator\") + userLevel + \" Level - \" + userDept;\n byte[] userPics = arraylisted.get(0).getBLOB();\n\n //build the actviity intents\n Intent notificationIntent = new Intent(getApplicationContext(),viewNamsn.class);\n\n notificationIntent.putExtra(\"userName\", userName);\n notificationIntent.putExtra(\"userLevel\", userLevel);\n notificationIntent.putExtra(\"userDept\", userDept);\n notificationIntent.putExtra(\"userID\", userID);\n notificationIntent.putExtra(\"userPics\", userPics);\n\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY | Intent.FLAG_ACTIVITY_NEW_TASK);\n PendingIntent pend = PendingIntent.getActivity(getApplicationContext(),0,notificationIntent,PendingIntent.FLAG_UPDATE_CURRENT);\n\n //mBuilder = buildNotification(userPics,prep);\n //design the new custom view\n RemoteViews notificationView = new RemoteViews(\n getApplicationContext().getPackageName(),\n R.layout.activity_custom_notification\n );\n Bitmap bitmap = BitmapFactory.decodeByteArray(userPics,0,userPics.length);\n // notificationView.setImageViewResource(R.id.imagenotileft,R.mipmap.ic_launcher);\n notificationView.setImageViewBitmap(R.id.imagenotileft,bitmap);\n // Locate and set the Text into customnotificationtext.xml TextViews\n notificationView.setTextViewText(R.id.title, (getString(R.string.app_name)));\n notificationView.setTextViewText(R.id.text, prep);\n // notificationView.setTextViewText(R.id.qoute, str);\n\n //go and build the notification\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(getApplicationContext());\n mBuilder.setContentIntent(pend);\n mBuilder.setContentTitle(getString(R.string.app_name));\n mBuilder.setContentText(userName + \" Recently Joined ATBU 37 NAMSSN ELITE E-YEAR BOOK !!!\");\n mBuilder.setTicker(userName + \" Recently Joined ATBU 37 NAMSSN ELITE E-YEAR BOOK !!!\");\n mBuilder.setAutoCancel(true);\n mBuilder.setContent(notificationView);\n mBuilder.setSmallIcon(R.mipmap.ic_app);\n mBuilder.setPriority(2);\n Uri alarmsound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n mBuilder.setSound(alarmsound);\n mBuilder.setLights(Color.RED, 3000, 3000);\n mBuilder.setVibrate(new long[]{1000, 1000, 1000, 1000, 1000 });\n //display the notification\n\n NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n notificationManager.notify(0123,mBuilder.build());\n }\n // arraylisted.clear();\n }",
"private void showNotification() {\n\n NotificationCompat.Builder mBuilder =\n new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.food_icon2)\n .setContentTitle(\"Let's eat\")\n .setContentText(\"Good morning, It's time to take your Breakfast :)\");\n\n int mNotificationId = 001;\n\n\n Intent contentIntent = new Intent(this, RecommendationActivity.class);\n contentIntent.putExtra(\"dePagi\", \"pagigan\");\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n stackBuilder.addParentStack(RecommendationActivity.class);\n stackBuilder.addNextIntent(contentIntent);\n\n PendingIntent resultPendingIntent =\n stackBuilder.getPendingIntent(\n 0,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n mBuilder.setContentIntent(resultPendingIntent);\n\n mBuilder.setVibrate(new long[] { 1000, 1000, 1000, 1000, 1000 });\n mBuilder.setLights(Color.YELLOW, 3000, 3000);\n\n mBuilder.setAutoCancel(true);\n\n mNM =(NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n mNM.notify(mNotificationId, mBuilder.build());\n\n stopSelf();\n\n }",
"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 }",
"private void displayNotification(final String id, final String name, final String detail, String title, final String url) {\n\n NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n Notification notification = new Notification(R.drawable.noti, name + \" ตอนใหม่\", System.currentTimeMillis());\n notification.defaults |= Notification.DEFAULT_SOUND;\n notification.flags |= Notification.FLAG_AUTO_CANCEL;\n\n // The PendingIntent will launch activity if the user selects this notification\n Intent browserIntent = null;\n/*\t\tbrowserIntent = new Intent(Intent.ACTION_VIEW);\n\t\tUri data = Uri.parse(url+\"#story_body\");\n\t\tbrowserIntent.setData(data);*/\n if (Setting.getArrowSelectSetting(context).equals(\"0\")) {\n browserIntent = new Intent(Intent.ACTION_VIEW);\n Uri data = Uri.parse(url + \"#story_body\");\n browserIntent.setData(data);\n } else if (Setting.getArrowSelectSetting(context).equals(\"1\")) {\n browserIntent = new Intent(this, DekdeeBrowserActivity.class);\n browserIntent.putExtra(\"id\", id);\n browserIntent.putExtra(\"url\", url);\n browserIntent.putExtra(\"title\", name);\n } else {\n browserIntent = new Intent(this, TextReadActivity.class);\n browserIntent.putExtra(\"url\", url);\n }\n System.out.println(\"moti \" + url);\n\n //PendingIntent contentIntent = PendingIntent.getActivity(context, REQUEST_CODE,browserIntent, 0);\n PendingIntent contentIntent = PendingIntent.getActivity(getApplicationContext(), REQUEST_CODE, browserIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n notification.contentIntent = contentIntent;\n //notification.contentView = contentView;\n if (title.contains(\":\")) {\n title = \":\" + title;\n }\n if (title.indexOf(\":\") + 2 < title.length()) {\n notification.setLatestEventInfo(context, name, title.substring(title.indexOf(\":\") + 2) + \" (\" + detail + \")\", contentIntent);\n } else if (title.indexOf(\":\") + 1 < title.length()) {\n notification.setLatestEventInfo(context, name, title.substring(title.indexOf(\":\") + 1) + \" (\" + detail + \")\", contentIntent);\n } else if ((!title.contains(\":\")) && (title.indexOf(\":\") < title.length())) {\n notification.setLatestEventInfo(context, name, title.substring(title.indexOf(\":\")) + \" (\" + detail + \")\", contentIntent);\n } else {\n notification.setLatestEventInfo(context, name, title + \" (\" + detail + \")\", contentIntent);\n }\n manager.notify(REQUEST_CODE, notification);\n }",
"private Notification buildForegroundNotification() {\n //registerNotifChnnl(this.context);\n\n Intent stopIntent = new Intent(this.context, BackgroundIntentService.class);\n //stopIntent.setAction(context.getString(R.string.intent_action_turnoff));\n\n PendingIntent pendingIntent = PendingIntent.getService(this.context,0, stopIntent, 0);\n\n NotificationCompat.Builder b=new NotificationCompat.Builder(this.context,CHANNEL_ID);\n\n b.setOngoing(true)\n .setContentTitle(\"WifiHotSpot is On\")\n// .addAction(new NotificationCompat.Action(\n// R.drawable.turn_off,\n// \"TURN OFF HOTSPOT\",\n// pendingIntent\n// ))\n .setPriority(NotificationCompat.PRIORITY_LOW)\n .setCategory(Notification.CATEGORY_SERVICE);\n // .setSmallIcon(R.drawable.notif_hotspot_black_24dp);\n\n\n return(b.build());\n }",
"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 }"
] | [
"0.7519725",
"0.69568664",
"0.69370955",
"0.6842326",
"0.6834191",
"0.67940456",
"0.67887145",
"0.67752737",
"0.67599523",
"0.673967",
"0.66829085",
"0.6648302",
"0.66276497",
"0.66265374",
"0.6617892",
"0.65964663",
"0.6578223",
"0.65667367",
"0.65512806",
"0.64955854",
"0.6461429",
"0.6434332",
"0.64290327",
"0.6409473",
"0.6403088",
"0.6401909",
"0.63929224",
"0.63649255",
"0.63551927",
"0.63504875",
"0.63350683",
"0.6323015",
"0.63195646",
"0.63100207",
"0.63074315",
"0.63035154",
"0.6302018",
"0.62911797",
"0.62823224",
"0.6281284",
"0.62805104",
"0.62677217",
"0.6254734",
"0.62493587",
"0.6231741",
"0.6228114",
"0.6188558",
"0.61638427",
"0.6163433",
"0.61625665",
"0.61608005",
"0.6129428",
"0.61267734",
"0.6125134",
"0.6118076",
"0.6115109",
"0.6110196",
"0.610467",
"0.61009663",
"0.60960215",
"0.60911316",
"0.6079496",
"0.6079203",
"0.6061383",
"0.60583144",
"0.60563886",
"0.6050681",
"0.6048277",
"0.6045635",
"0.60411096",
"0.6038138",
"0.60373276",
"0.60347027",
"0.60304564",
"0.6023227",
"0.6017592",
"0.60174125",
"0.60140485",
"0.6009607",
"0.59964013",
"0.59894246",
"0.5972365",
"0.5971814",
"0.59695745",
"0.5969275",
"0.59658396",
"0.59590447",
"0.59573257",
"0.5952642",
"0.5952108",
"0.59461826",
"0.5945397",
"0.59330106",
"0.5930434",
"0.5928835",
"0.59286606",
"0.59280545",
"0.58960706",
"0.58909565",
"0.5887205",
"0.5885674"
] | 0.0 | -1 |
This method runs on the UI thread, it receives progress updates from the background thread and publishes them to the status bar mNotificationHelper.progressUpdate(fileName,progress[0]); | protected void onProgressUpdate(String fileName, Integer... progress) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void update() {\n Thread t = new Thread(new Runnable() {\n @Override\n public void run() {\n List<File> list = getContents(NOT_TRASHED + \" and \" + NOT_FOLDER + \" and \" + SUPPORTED_FILES);\n List<File> filteredList = new ArrayList<File>();\n \n // filters out shared drive files\n for (File f : list) {\n if(!f.getShared()) {\n filteredList.add(f);\n }\n }\n\n numDownloading = filteredList.size();\n Log.e(\"START NUM\", \"\" + numDownloading);\n updateMax = numDownloading;\n \n // notification progress bar\n String note = getResources().getString(R.string.notification_message);\n nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n mBuilder = new NotificationCompat.Builder(mContext);\n mBuilder.setContentTitle(note)\n .setSmallIcon(android.R.drawable.stat_sys_download)\n .setTicker(note);\n\n // main progress bar\n mProgress = (ProgressBar) findViewById(R.id.progressBar1);\n new Thread(new Runnable() {\n @Override\n public void run() {\n while (numDownloading > 0) {\n mHandler.post(new Runnable() {\n @Override\n public void run() {\n int progress = 100 * (updateMax - numDownloading) / updateMax; \n mProgress.setProgress(progress);\n if (numDownloading <= 0) {\n back();//finish();\n }\n } \n });\n }\n }\n }).start();\n\n if (!targetDir.exists())\n targetDir.mkdirs();\n getDriveContents();\n }\n });\n t.start();\n }",
"public void setProgressNotification(View view){\n //Add \"10\" to notifications - a progress notification\n currentNotifications.add(10);\n\n //setup the notification manager\n final NotificationManager mNotifyManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n //Build a notification\n final NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this);\n mBuilder.setContentTitle(\"RAM Download\")\n .setContentText(\"Download in progress\")\n .setSmallIcon(R.drawable.memory);\n\n // Start a lengthy operation in a background thread\n new Thread(\n new Runnable() {\n @Override\n public void run() {\n int incr;\n // Do the \"lengthy\" operation 20 times\n\n for (incr = 0; incr <= 500; incr+=5) {\n // Sets the progress indicator to a max value, the\n // current completion percentage, and \"determinate\"\n // state\n mBuilder.setProgress(100, incr, false);\n\n // Displays the progress bar for the first time.\n mNotifyManager.notify(10, mBuilder.build());\n\n // Sleeps the thread, simulating an operation\n // that takes time\n try {\n // Sleep for 1/10 a second\n Thread.sleep(100);\n } catch (InterruptedException e) {\n }\n }\n\n // When the loop is finished, updates the notification\n mBuilder.setContentText(\"Download complete\")\n\n // Removes the progress bar\n .setProgress(0,0,false);\n mNotifyManager.notify(10, mBuilder.build());\n }\n }\n\n // Starts the thread by calling the run() method in its Runnable\n ).start();\n\n }",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n ProgressBar pbFileIO = (ProgressBar)findViewById(R.id.pbFileIO);\n pbFileIO.setProgress(progress[0]);\n }",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n //Shows the ProgressDialog and sets the progress/message shown\n progressDialog.show();\n progressDialog.setTitle(\"Uploading\");\n progressDialog.setProgress(progress[0]);\n progressDialog.setMessage(String.valueOf(progress[0]) + \"%\");\n }",
"@Override\n protected void onProgressUpdate(String... values) {\n setUiDuringBackgroundTask(values[0]);\n }",
"@Override\n protected void onProgressUpdate(String... values) {\n setUiDuringBackgroundTask(values[0]);\n }",
"public static void updateProgressBar() {\r\n mHandler.postDelayed(mUpdateTime, 100);\r\n }",
"public void run() {\n\t\t\t\tMessage msg = new Message();\n\t\t\t\tmsg.what = Msg_SetProgress;\n\t\t\t\tmHandler.sendMessage(msg);\n\t\t\t}",
"public void startDownloadNotification(Context context) {\r\n mNotifyManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\r\n mBuilder = new NotificationCompat.Builder(context);\r\n mBuilder.setContentTitle(\"Files Downloading From PC\").setContentText(\"Download progress\").setSmallIcon(android.R.drawable.stat_sys_download_done);\r\n }",
"private void updateProgressBar() {\n\t\tdouble current = model.scannedCounter;\n\t\tdouble total = model.fileCounter;\n\t\tdouble percentage = (double)(current/total);\n\t\t\n\t\t//Update Progress indicators\n\t\ttxtNumCompleted.setText((int) current + \" of \" + (int) total + \" Completed (\" + Math.round(percentage*100) + \"%)\");\n\t\tprogressBar.setProgress(percentage);\n\t}",
"void notifyProgress(MessageSnapshot snapshot);",
"@Override\n\tprotected void onProgressUpdate(Integer... values) {\n\t\tint len = progressBar.getProgress() + values[0];\n\t\tprogressBar.setProgress(len);\n\t\tString str = progressBar.getProgress() * 100 / progressBar.getMax()\n\t\t\t\t+ \"%\";\n\t\ttv.setText(\"下载完成\" + str);\n\t\tsuper.onProgressUpdate(values);\n\t}",
"private void notifyTaskProgress(int action, int status, int progress) {\n Intent intent = new Intent(LocalAction.ACTION_BACKUP_SERVICE_RUNNING);\n intent.putExtra(ACTION, action);\n intent.putExtra(PROGRESS_STATUS, status);\n intent.putExtra(PROGRESS_VALUE, progress);\n intent.putExtra(CALLER_ID, mCallerId);\n mBroadcastManager.sendBroadcast(intent);\n // update the notification if required\n if (mNotificationBuilder != null) {\n mNotificationBuilder.setContentText(getNotificationContentText(status));\n mNotificationBuilder.setProgress(100, progress, false);\n startForeground(NotificationContract.NOTIFICATION_ID_BACKUP_PROGRESS, mNotificationBuilder.build());\n }\n }",
"protected void onProgressUpdate(String...strings) {\n String strReceived = strings[0].trim();\n\n /*\n Checking if the string is received successfully.\n */\n if(strReceived.equals(\"\") || strReceived.equals(null))\n Log.d(\"data not received\", \"String sent not received...\");\n else\n Log.d(\"data received\", \"String received successfully..\");\n\n // Writing the received message from the remote connection into the TextView\n tv.append(strReceived + \"\\t\\n\");\n // Writing the message sent into the TextView\n\n\n /*\n * The following code creates a file in the AVD's internal storage and stores a file.\n *\n * For more information on file I/O on Android, please take a look at\n * http://developer.android.com/training/basics/data-storage/files.html\n */\n /**\n * Inserting the values as a local store using content provider\n * Here sequence number is the key of the key-value store\n */\n try {\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"key\", Integer.toString(seq));\n contentValues.put(\"value\",strReceived );\n getApplicationContext().getContentResolver().insert(mUri, contentValues);\n seq = seq + 1;\n }\n catch (Exception e)\n {\n Log.e(\"error saving data\", \"Data cannot be saved in the content view\");\n }\n\n return;\n }",
"@Override\n protected void onProgressUpdate(String... values) {\n labelStatus.setText(values[0]);\n }",
"@Override\n\t\t/*\n\t\t * UI线程执行\n\t\t */\n\t\tprotected void onProgressUpdate(Integer... values) {\n\t\t\tsuper.onProgressUpdate(values);\n\t\t\t// 取出发布进度的值\n\t\t\tint value = values[0];\n\t\t\t// 设置给Button\n\t\t\tbtn.setText(\"\" + value);\n\t\t\tpb.setProgress(value);\n\t\t}",
"@Override\n protected void onProgressUpdate(String... values) {\n super.onProgressUpdate(values);\n String message = values[0];\n dialog.setMessage(waitMsg + message);\n displayProgress(message);\n }",
"@Override\n\t\tprotected void onProgressUpdate(Integer... progress) {\n\t\t\tprogressBar.setVisibility(View.VISIBLE);\n\n\t\t\t// updating progress bar value\n\t\t\tprogressBar.setProgress(progress[0]);\n\n\t\t\t// updating percentage value\n\t\t\ttxtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n\t\t}",
"@Override\n protected void onProgressUpdate(String... progress) {\n }",
"public void run() {\n\t\t\t\t\tmHandler.post(new Runnable() {\r\n\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\tprogressbar.setProgress(Integer\r\n\t\t\t\t\t\t\t\t\t.parseInt(tvsp.progress));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t}",
"@Override\n\tpublic void onProgressUpdate() {\n\n\t}",
"protected void onProgressUpdate(Integer... progress){\n\t Utils.logThreadSignature(this.tag);\n\t this.reportThreadSignature();\n\n\t //will be called multiple times\n\t //triggered by onPostExecute\n\t Integer i = progress[0];\n\t r.reportBack(tag, \"Progress:\" + i.toString());\n\t pd.setProgress(i);\n }",
"@Override\n\tpublic void handleDownloadThreadUpdate(final DownloadTask dt) {\n\t\t// we want to modify the progress bar so we need to do it from the UI thread \n\t\t// how can we make sure the code runs in the UI thread? use the handler!\n\t\thandler.post(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tint total = downloadThread.getTotalQueued();\n\t\t\t\tint completed = downloadThread.getTotalCompleted();\n\n\t\t\t\t//System.out.println(\"progress so far: \" + completed + \" / \" + total);\n\n\t\t\t\tif(dt instanceof NfcTagServerTask)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\thandleBusStop((String) dt.getResult());\n\t\t\t\t\tsetProgressBarVisible(false);\n\t\t\t\t}\n\n\n\n\n\t\t\t}\n\t\t});\n\t}",
"private void primarySeekBarProgressUpdater() {\n seekBarProgress.setProgress((int) (((float) mediaPlayer.getCurrentPosition() / mediaFileLengthInMilliseconds) * 100)); // This math construction give a percentage of \"was playing\"/\"song length\"\n if (mediaPlayer.isPlaying()) {\n Runnable notification = new Runnable() {\n public void run() {\n primarySeekBarProgressUpdater();\n }\n };\n handler.postDelayed(notification, 1000);\n }\n }",
"private void notifyUploadSuccess() {\n numberOfDone++;\n notificationBuilder.setContentText(getNotificationContent());\n notificationManger.notify(0, notificationBuilder.build());\n }",
"@Override\n protected void onProgressUpdate(Integer... values) {\n progressBar.setProgress(values[0]);\n }",
"@Override\n protected void onProgressUpdate(Integer... values) {\n progressBar.setProgress(values[0]);\n }",
"@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n\n\n // Do things like update the progress bar\n }",
"@Override\n\t\tprotected void onProgressUpdate(String... values) {\n\t\t\tlong total = Long.parseLong(values[0]);\n\t\t\tdialog.setProgress((int) ((total * 100) / lengthOfFile));\n\t\t\tdialog.setMessage((total / (1024 * 1014)) + \"MB/\"\n\t\t\t\t\t+ (lengthOfFile / (1024 * 1024)) + \"MB\");\n\t\t\tsuper.onProgressUpdate(values);\n\t\t}",
"@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }",
"@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }",
"@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }",
"@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }",
"private void primarySeekBarProgressUpdater() {\n \tseekBarProgress.setProgress((int)(((float)mediaPlayer.getCurrentPosition()/mediaFileLengthInMilliseconds)*100)); // This math construction give a percentage of \"was playing\"/\"song length\"\n\t\tif (mediaPlayer.isPlaying()) {\n\t\t\tRunnable notification = new Runnable() {\n\t\t public void run() {\n\t\t \tprimarySeekBarProgressUpdater();\n\t\t\t\t}\n\t\t };\n\t\t handler.postDelayed(notification,1000);\n \t}\n }",
"@Override\r\n\tpublic void updateProgress(int arg0) {\n\t\t System.out.println(\"arg0.progress=\" + arg0);\r\n\t\tmHandler.obtainMessage(100, arg0, arg0).sendToTarget();\r\n\t}",
"@Override\n\t\t\tpublic void onProgress(ProgressMessage msg) {\n\n\t\t\t}",
"private void setFinalNotification() {\n //finished downloading all files\n // update notification\n String note = getResources().getString(R.string.update_complete);\n mBuilder.setContentTitle(note)\n .setContentText(\"\")\n .setSmallIcon(R.drawable.ic_launcher_mp)\n .setTicker(note)\n .setProgress(0, 0, false);\n nm.notify(0, mBuilder.build());\n }",
"public void updateDownloadProgress(final String msg, final int progress)\n {\n if(mDownloadProgress == null || !mDownloadProgress.isShowing())\n {\n return;\n }\n mDownloadProgress.setMessage(msg);\n mDownloadProgress.setProgress(progress);\n }",
"@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t Toast.makeText(getBaseContext(),\"Task Completed\",Toast.LENGTH_LONG).show();\n\t progressStatus=0; \n\t myProgress=0;\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"@Override\r\n\tprotected void onProgressUpdate(String... s) {\r\n\t\tactivity.addToGUI(s[0]);\r\n\t}",
"public void run() {\n updateSyncStats();\n\n double d = uploadCounter.calculateCurrentKBS();\n if (getController().getTransferManager().countActiveUploads() == 0)\n {\n // Hide KB/s when not active uploads\n d = 0;\n }\n if (Double.compare(d, 0) == 0) {\n uploadsLine.setNormalLabelText(Translation\n .getTranslation(\"status_tab.files_uploads\"));\n } else {\n String s = Format.formatDecimal(d);\n uploadsLine.setNormalLabelText(Translation.getTranslation(\n \"status_tab.files_uploads_active\", s));\n }\n d = downloadCounter.calculateCurrentKBS();\n if (getController().getTransferManager().countActiveDownloads() == 0)\n {\n // Hide KB/s when no active downloads\n d = 0;\n }\n if (Double.compare(d, 0) == 0) {\n downloadsLine.setNormalLabelText(Translation\n .getTranslation(\"status_tab.files_downloads\"));\n } else {\n String s = Format.formatDecimal(d);\n downloadsLine.setNormalLabelText(Translation.getTranslation(\n \"status_tab.files_downloads_active\", s));\n }\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\twhile(progressStatus<100)\n\t\t\t\t{\n\t\t\t\t\tprogressStatus=performTask();\n\t\t\t\t\tmyHandler.post(new Runnable()\n\t\t\t\t\t{\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\tprogressBar.setProgress(progressStatus);\n\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\tmyHandler.post(new Runnable() {\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t Toast.makeText(getBaseContext(),\"Task Completed\",Toast.LENGTH_LONG).show();\n\t progressStatus=0; \n\t myProgress=0;\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}",
"@Override\n public void onProgress(long downloaded, long total) {\n int progress = (int) (downloaded / total * 100);\n bar.setProgress(progress);\n }",
"protected void onProgressUpdate(String... progress) {\n\t\t\t\t\t\t// Set progress percentage\n\t\t\t\t\t\tprgDialog.setProgress(Integer.parseInt(progress[0]));\n\t\t\t\t\t}",
"protected void onProgressUpdate(Integer... progress) {\n\t\t}",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n if (mProgressDialog != null) {\n mProgressDialog.setProgress(progress[0]);\n }\n }",
"@Override protected void onProgressUpdate(Integer... vals) {\n updateProgressBar(vals[0].intValue());\n }",
"@Override\n protected void onProgressUpdate(String... progress) {\n }",
"@Override\n public void onProgress(long downloaded,\n long total) {\n int progress = (int) (downloaded / total * 100);\n bar.setProgress(progress);\n }",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n progressBar.setVisibility(View.VISIBLE);\n\n // updating progress bar value\n progressBar.setProgress(progress[0]);\n\n // updating percentage value\n txtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n }",
"@Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n double progress = (100.0 * taskSnapshot.getBytesTransferred()) / taskSnapshot.getTotalByteCount();\n progressDialog.setMessage(\"Uploaded \" + ((int) progress) + \"%...\");\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tMessage msg=new Message();\n\t\t\t\tBundle bundle=new Bundle();\n\t\t\t\tbundle.putInt(\"percent\",(int) (100*downLoadFileSize/totalsize));\n\t\t\t\tmsg.setData(bundle);\n\t\t\t\thandler.sendMessage(msg);\n\t\t\t\n\t\t\t}",
"protected void onProgressUpdate(String... strings) {\n String strReceived = strings[0].trim();\n /*\n * Inserting the message into the content provider\n */\n ContentValues cv = new ContentValues();\n cv.put(\"key\", Integer.toString(messageCounter));\n cv.put(\"value\",strReceived);\n getContentResolver().insert(appStoreURI, cv);\n messageCounter++; //Incrementing the value of the message counter by one\n\n Log.d(\"Str Recvd\",strReceived);\n TextView textView = (TextView) findViewById(R.id.textView1);\n textView.append(strReceived+\"\\t\\n\");\n }",
"@Override\n\t protected void onProgressUpdate(Void... values) {\n\t }",
"@Override\n \t\tprotected Void doInBackground(Void... params) \n \t\t{\n \t\t\ttry \n \t\t\t{\n \t\t\t\twhile(m_progress < 100) {\n \t\t\t\t\t//Get the current thread's token\n \t\t\t\t\tsynchronized (this) \n \t\t\t\t\t{\n \t\t\t\t\t\tthis.wait();\n \t\t\t\t\t\t//Set the current progress. \n \t\t\t\t\t\t//This value is going to be passed to the onProgressUpdate() method.\n \t\t\t\t\t\tpublishProgress(m_progress);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t} \n \t\t\tcatch (InterruptedException e) \n \t\t\t{\n \t\t\t\te.printStackTrace();\n \t\t\t}\n \t\t\treturn null;\n \t\t}",
"@Override\n public void onProgress(\n UploadTask.TaskSnapshot taskSnapshot) {\n double progress\n = (100.0\n * taskSnapshot.getBytesTransferred()\n / taskSnapshot.getTotalByteCount());\n progressDialog.setMessage(\n \"Uploaded \"\n + (int) progress + \"%\");\n }",
"@Override\n public void onProgress(\n UploadTask.TaskSnapshot taskSnapshot) {\n double progress\n = (100.0\n * taskSnapshot.getBytesTransferred()\n / taskSnapshot.getTotalByteCount());\n progressDialog.setMessage(\n \"Uploaded \"\n + (int) progress + \"%\");\n }",
"@Override\r\n protected void onProgressUpdate(String... updateString) {\n Log.d( TAG, \"Progress update: \" + updateString );\r\n progressDialog.setMessage( updateString[0] );\r\n }",
"@Override\n public void onProgress(String requestId, long bytes, long totalBytes) {\n Double progress = (double) bytes / totalBytes;\n // post progress to app UI (e.g. progress bar, notification)\n // example code ends here\n mProgressbar.setVisibility(View.VISIBLE);\n if(!networkConnection.isNetworkConnected(getContext())){\n mProgressbar.setVisibility(View.GONE);\n mBtnLayout2A2.setVisibility(View.VISIBLE);\n showMessage(\"Internet Connection Failed\");\n }\n\n }",
"@Override\n public void onProgress(String requestId, long bytes, long totalBytes) {\n Double progress = (double) bytes / totalBytes;\n // post progress to app UI (e.g. progress bar, notification)\n // example code ends here\n mProgressbar.setVisibility(View.VISIBLE);\n if(!networkConnection.isNetworkConnected(getContext())){\n mProgressbar.setVisibility(View.GONE);\n mBtnLayout2A2.setVisibility(View.VISIBLE);\n showMessage(\"Internet Connection Failed\");\n }\n\n }",
"@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tmpProgress = ProgressDialog.show(mContext,\n\t\t\t\t\t\t\t\"Downloading data\",\n\t\t\t\t\t\t\t\"Please wait for a moment...\");\n\t\t\t\t}",
"@Override\n protected void onProgressUpdate(Long... progress)\n {\n\n if (mActivity != null)\n {\n mActivity.onProgressUpdate(progress[0], progress[1]);\n\n //if (wait)\n //{\n // waitFor(mPrefPauseTime);\n // playNextSong();\n //}\n }\n }",
"@Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n double progress = (100.0 * taskSnapshot.getBytesTransferred() / taskSnapshot.getTotalByteCount());\n progressDialog.setMessage(\"Uploaded \" + (int) progress + \"%\");\n }",
"@Override\r\n protected void onProgressUpdate(Integer... progress) {\n }",
"@Override\n\t\t\t\tpublic void onProgress(int progress) {\n\t\t\t\t\tmProgressBar.setProgress(progress);\n\t\t\t\t}",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n }",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n }",
"@Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n double progress = (100.0 * taskSnapshot.getBytesTransferred()) / taskSnapshot.getTotalByteCount();\n progressDialog.setMessage(\"Uploaded \" + ((int) progress) + \"%...\");\n }",
"protected void onPreExecute() {\n mNotificationHelper.createNotification(context.getResources().getString(R.string.upload));\r\n }",
"@Override\n\t\tprotected void onProgressUpdate(Object... values) {\n\t\t}",
"@Override\n public void onProgress(String requestId, long bytes, long totalBytes) {\n Double progress = (double) bytes / totalBytes;\n // post progress to app UI (e.g. progress bar, notification)\n // example code ends here\n mProgressbar.setVisibility(View.VISIBLE);\n if (!networkConnection.isNetworkConnected(getContext())) {\n mBtnLayout2A2.setVisibility(View.GONE);\n mProgressbar.setVisibility(View.VISIBLE);\n showMessage(\"Internet Connection Failed\");\n }\n\n }",
"private void updateProgress(int progress) {\n if (myHost != null) {\n myHost.updateProgress(progress);\n } else {\n System.out.println(\"Progress: \" + progress + \"%\");\n }\n }",
"@Override\n\t\tprotected void onProgressUpdate(Integer... progress) {\n\t\t\tsuper.onProgressUpdate(progress);\n\n\t\t\tdialog.setProgress(progress[0]);\n\t\t}",
"@Override\n public void onProgress(String requestId, long bytes, long totalBytes) {\n Double progress = (double) bytes / totalBytes;\n // post progress to app UI (e.g. progress bar, notification)\n // example code ends here\n mProgressbar.setVisibility(View.VISIBLE);\n if (!networkConnection.isNetworkConnected(getContext())) {\n mBtnLayout2A2.setVisibility(View.VISIBLE);\n mProgressbar.setVisibility(View.GONE);\n showMessage(\"Internet Connection Failed\");\n }\n\n }",
"@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n\n progressBar.setProgress(values[0].intValue());\n\n }",
"@Override\n public void run() {\n Message uiMSG;\n //Create message with only SHOW_ORIGINAL_COLOR argument\n uiMSG = BackgroundThread.this.uiHandler.obtainMessage(BidirectionalMessageActivity.SHOW_ORIGINAL_COLOR, 0, 0, null);\n BackgroundThread.this.uiHandler.sendMessage(uiMSG); //Send start message to UI thread\n\n fillProgressbar(progressBar); //Fill progress bar as a long time operation\n //Message with information SHOW_NEW_COLOR as a end of long time operation\n uiMSG = BackgroundThread.this.uiHandler.obtainMessage(BidirectionalMessageActivity.SHOW_NEW_COLOR, 0, 0, null);\n BackgroundThread.this.uiHandler.sendMessage(uiMSG); //Message with end result is sent\n }",
"@Override\n\tprotected void onProgressUpdate(String... values) {\n\t\tsuper.onProgressUpdate(values);\n\t}",
"protected void onProgressUpdate(Integer... progress) {\n }",
"@Override\r\n public void onUIProgressStart(long totalBytes) {\r\n super.onUIProgressStart(totalBytes);\r\n\r\n }",
"void onProgress(Context context , int progressLevel , int warningLevel);",
"@Override\n public void onProgress(long bytesWritten, long totalSize) {\n super.onProgress(bytesWritten, totalSize);\n int count = (int) ((bytesWritten * 1.0 / totalSize) * 100);\n // 下载进度显示\n// progress.setProgress(count);\n Log.e(\"下载 Progress>>>>>\", bytesWritten + \" / \" + totalSize);\n\n }",
"public static void startUpdate(Context context, String url, String fileName, OnProgressListener progressListener) {\n mProgressListener = progressListener;\n Intent intent = new Intent(context, AppUpdateService.class);\n intent.setAction(ACTION_UPDATE);\n intent.putExtra(EXTRA_URL, url);\n intent.putExtra(EXTRA_FILE_NAME, fileName);\n context.startService(intent);\n }",
"@Override\r\n protected void onProgressUpdate(Void... values) {\n \tsuper.onProgressUpdate(values);\r\n }",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n pDialog.setProgress(progress[0]);\n\n // updating percentage value\n //txtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n }",
"@Override\n public void progress(FileStatus status) {\n progressReporter.progress();\n }",
"@Override\n public void update(final Progress progress) {\n SwingUtilities.invokeLater(new Runnable() {\n\n @Override\n public void run() {\n progressBar.setValue(progress.getIntPercentage());\n progressField.setText(roundToSingleDigit(progress.getPercentage()) + \"%\");\n }\n });\n }",
"@Override\n \tpublic void updateProgress(int messageId) {\n \t}",
"@Override\r\n protected void onProgressUpdate(Void... values) {\n super.onProgressUpdate(values);\r\n }",
"protected void onProgressUpdate(String... strings) {\n String strReceived = strings[0].trim();\n TextView textView = (TextView) findViewById(R.id.textView1);\n textView.append(strReceived + \"\\n\");\n\n }",
"public void handlerDownloadProgress(int progress) {\n if (TvApplication.DEBUG_LOG) {\n JLog.d(TAG, \"deal download progress in UpdateClient, progress=\" + progress);\n }\n }",
"@Override\n\t public Void doInBackground() throws FileNotFoundException, IOException {\n\t boolean done1 = false;\n\t int i = 0;\n\t GUIinteractor guii = new GUIinteractor();\n\t guii.upload(file_uplo, language, type_file);\n\t //System.out.println(\"aaya\");\n\t progressBar.setVisible(false);\n progressBar.setString(\"Document Uploaded\");\n progressBar.setIndeterminate(false);\n progressBar.setStringPainted(false);\n JOptionPane.showOptionDialog(null, \"Document Uploaded\",\"Success\", JOptionPane.DEFAULT_OPTION,JOptionPane.INFORMATION_MESSAGE, null, new Object[]{\"Ok\"}, null);\n \n\t return null;\n\t }",
"public void working(final String fileName) {\n Intent intent = new Intent(Constant.ACTION_IMPORTING_EXPORING);\n WorkingState workState = isExport() ? WorkingState.EXPORTING : WorkingState.IMPORTING;\n intent.putExtra(\"workingstate\", workState.ordinal());\n intent.putExtra(\"workingname\", fileName);\n mContext.sendBroadcast(intent);\n // showNotification(fileName);\n mHandler.post(new Runnable() {\n @Override\n public void run() {\n showProgressDlg(fileName);\n }\n });\n }",
"@Override\n public void onProgress(String requestId, long bytes, long totalBytes) {\n Double progress = (double) bytes / totalBytes;\n // post progress to app UI (e.g. progress bar, notification)\n // example code ends here\n mAvi1.setVisibility(View.VISIBLE);\n }",
"@Override\n public void onProgress(String requestId, long bytes, long totalBytes) {\n Double progress = (double) bytes / totalBytes;\n // post progress to app UI (e.g. progress bar, notification)\n // example code ends here\n mAvi1.setVisibility(View.VISIBLE);\n }",
"private void showUploadFinishedNotification(@Nullable Uri downloadUrl, @Nullable Uri fileUri) {\n Intent intent = new Intent(this, FirebaseActivity.class)\n .putExtra(EXTRA_DOWNLOAD_URL, downloadUrl)\n .putExtra(EXTRA_FILE_URI, fileUri)\n .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);\n\n // Make PendingIntent for notification\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* requestCode */, intent,\n PendingIntent.FLAG_UPDATE_CURRENT);\n\n // Set message and icon based on success or failure\n boolean success = downloadUrl != null;\n String message = success ? \"Upload finished\" : \"Upload failed\";\n int icon = success ? R.drawable.ic_menu_gallery : R.drawable.ic_menu_gallery;\n\n NotificationCompat.Builder builder = (NotificationCompat.Builder) new NotificationCompat.Builder(this)\n .setSmallIcon(icon)\n .setContentTitle(getString(R.string.app_name))\n .setContentText(message)\n .setAutoCancel(true)\n .setContentIntent(pendingIntent);\n\n NotificationManager manager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n manager.notify(NOTIF_ID_DOWNLOAD, builder.build());\n }",
"private void showNotificationWhileDownloading(long max, long progress){\n\t\tmRemoteView.setTextViewText(ResourceUtil.getId(this, \"lgsdk_download_notification_content\"), \"升级下载中\" + (int)(progress * 100 / max) + \"%\");\n\t\tmRemoteView.setProgressBar(ResourceUtil.getId(this, \"lgsdk_download_notification_progressbar\"), (int)max, (int)progress, false);\n\t\tmNotification.contentView = mRemoteView;\n\t\tmNotification.contentIntent = PendingIntent.getService(this, 0, new Intent(), PendingIntent.FLAG_CANCEL_CURRENT);\n\t\tmNotiManager.notify(NOTIFICATION_ID, mNotification);\n\t}",
"@Override\n public void handleMessage(final Message msg) {\n super.handleMessage(msg);\n if (msg.what == UpdateConfig.NET_MSG_GETLENTH) {\n\n if (mNotify != null && msg.arg2 > 0) {\n int progress = (int) (msg.arg1 * 100L / msg.arg2);\n mNotify.contentView.setProgressBar(R.id.progress, 100, progress, false);\n StringBuffer buffer = new StringBuffer(20);\n buffer.append(String.valueOf(msg.arg1 / 1000));\n buffer.append(\"K/\");\n buffer.append(String.valueOf(msg.arg2 / 1000));\n buffer.append(\"K\");\n mNotify.contentView.setTextViewText(R.id.schedule, buffer);\n mNotificationManager.notify(UpdateConfig.NOTIFY_DOWNLOADING_ID, mNotify);\n }\n } else if (msg.what == 1) {\n UpgradeData data = (UpgradeData) msg.obj;\n if (data != null) {\n // BdUtilHelper.install_apk(BBApplication.getInst(),\n // UpdateConfig.FILE_NAME);\n }\n stopSelf();\n }\n }",
"private void updateProgress(String progressLabel, int progress) {\n if (myHost != null) {\n myHost.updateProgress(progressLabel, progress);\n } else {\n System.out.println(progressLabel + \" \" + progress + \"%\");\n }\n }",
"@Override\n\t\tprotected void onProgressUpdate(Integer... values) {\n\t\t\tsuper.onProgressUpdate(values);\n\t\t\t\n\t\t\tLog.d(TAG, \" posting\");\n\t\t}",
"@Override\n\t\tprotected void onProgressUpdate(Integer... values) {\n\t\t\tsuper.onProgressUpdate(values);\n\t\t\t\n\t\t\tLog.d(TAG, \" posting\");\n\t\t}"
] | [
"0.7192002",
"0.68868166",
"0.6880282",
"0.6789096",
"0.67374617",
"0.67374617",
"0.6688721",
"0.6556904",
"0.6497024",
"0.6496116",
"0.64680016",
"0.63981634",
"0.63915855",
"0.63763803",
"0.6374738",
"0.63641804",
"0.6338955",
"0.6327186",
"0.63251364",
"0.6310086",
"0.63053286",
"0.6292939",
"0.62869096",
"0.62740046",
"0.6266371",
"0.6233323",
"0.6233323",
"0.6233165",
"0.6232166",
"0.62198573",
"0.62198573",
"0.62198573",
"0.62198573",
"0.62054914",
"0.61911875",
"0.6179326",
"0.61788684",
"0.6177613",
"0.6174915",
"0.61730915",
"0.6168928",
"0.6158213",
"0.6155858",
"0.6153043",
"0.61471254",
"0.6110431",
"0.60961235",
"0.6094622",
"0.6090019",
"0.6088202",
"0.60837686",
"0.6069798",
"0.6058909",
"0.6044494",
"0.6042773",
"0.6036246",
"0.6036246",
"0.60253286",
"0.6023946",
"0.6023946",
"0.6017567",
"0.60129887",
"0.60124946",
"0.60098696",
"0.5999471",
"0.5980161",
"0.5980161",
"0.59757656",
"0.59648037",
"0.59578115",
"0.59569407",
"0.5948481",
"0.5944355",
"0.5940731",
"0.5933822",
"0.59222716",
"0.5916793",
"0.5916506",
"0.59154713",
"0.59150714",
"0.590648",
"0.5905876",
"0.59057784",
"0.5902983",
"0.58984643",
"0.5892617",
"0.58912474",
"0.5889627",
"0.5888974",
"0.5882857",
"0.58824575",
"0.58705264",
"0.5870391",
"0.5870391",
"0.5860917",
"0.58600616",
"0.5859847",
"0.5856969",
"0.58563983",
"0.58563983"
] | 0.6764624 | 4 |
The task is complete, tell the status bar about it | protected void onPostExecute(Void result) {
mNotificationHelper.completed();
// msc.connect();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void onTaskComplete(){\n findViewById(R.id.downloadend).setVisibility(View.VISIBLE);\n findViewById(R.id.finito).setBackgroundResource(R.drawable.ok);\n }",
"public void completeTask() {\n completed = true;\n }",
"protected void done() {\n\t\ttry {\n\t\t\t// get the result of doInBackground and display it\n\t\t\tresultJLabel.setText(get().toString());\n\t\t} // end try\n\t\tcatch (InterruptedException ex) {\n\t\t\tresultJLabel.setText(\"Interrupted while waiting for results.\");\n\t\t} // end catch\n\t\tcatch (ExecutionException ex) {\n\t\t\tresultJLabel.setText(\"Error encountered while performing calculation.\");\n\t\t} // end catch\n\t}",
"@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t Toast.makeText(getBaseContext(),\"Task Completed\",Toast.LENGTH_LONG).show();\n\t progressStatus=0; \n\t myProgress=0;\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"private void showFinishMsg() {}",
"@Override\n public void done() {\n Toolkit.getDefaultToolkit().beep();\n enableMenusItens();\n \n if ( !erro ) {\n \tprogressBar.setValue(100);\n \ttaskOutput.append(\"Feito!\\n\");\n \ttaskOutput.append(\"Arquivo gerado com sucesso em \" + excelFileName);\n }\n }",
"@Override\n\tpublic void onComplete() {\n\t\tSystem.out.println(\"Its Done!!!\");\n\t}",
"@Override\n\tprotected void done() {\n\t\t//close the monitor \n\t\tprogressMonitorReporter.closeMonitor();\n\t\t\n\t\t//Inform application that operation isn't being in progress. \n\t\tapplicationInteractor.setOperationInProgress(false);\n\t}",
"public void taskComplete() {\n mTasksLeft--;\n if ((mTasksLeft==0) & mHasCloRequest){\n onAllTasksCompleted();\n }\n }",
"@Override\n\tprotected void done() {\n\t\tif (isCancelled()) {\n\t\t\tSystem.out.printf(\"%s: Has been canceled\\n\", name);\n\t\t} else {\n\t\t\tSystem.out.printf(\"%s: Has finished\\n\", name);\n\t\t}\n\t}",
"@Override\n public String markComplete() {\n if (this.isDone) {\n return Ui.getTaskAlrCompletedMessage(this);\n } else {\n this.isDone = true;\n return Ui.getMarkCompleteEventMessage(this);\n }\n }",
"public static void printDoneLoading() {\n System.out.println(Message.DONE_LOADING);\n }",
"public void complete()\n {\n isComplete = true;\n }",
"public String markAsDone() {\n this.isComplete = true;\n return Ui.getTaskDoneMessage(this);\n }",
"public void completeTask() {\r\n int selected = list.getSelectedIndex();\r\n if (selected >= 0) {\r\n Task task = myTodo.getTaskByIndex(selected + 1);\r\n myTodo.getTodo().get(task.getHashKey()).setComplete(true);\r\n showCompleted = true;\r\n playSound(\"c1.wav\");\r\n }\r\n todoListGui();\r\n }",
"public void run()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(mAPICallManager.getTasksCount()==0) showActionBarProgress(false);\n\t\t\t\t\t\t}",
"public void run()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(mAPICallManager.getTasksCount()==0) showActionBarProgress(false);\n\t\t\t\t\t\t}",
"public void CompleteTask() {\n\t\tCompletionDate = new Date();\n\t}",
"public void completeTask()\n throws NumberFormatException, NullPointerException, IndexOutOfBoundsException {\n System.out.println(LINEBAR);\n try {\n int taskNumber = Integer.parseInt(userIn.split(\" \")[TASK_NUMBER]);\n\n int taskIndex = taskNumber - 1;\n\n tasks.get(taskIndex).markAsDone();\n storage.updateFile(tasks.TaskList);\n System.out.println(\"Bueno! The following task is marked as done: \\n\" + tasks.get(taskIndex));\n } catch (NumberFormatException e) {\n ui.printNumberFormatException();\n } catch (NullPointerException e) {\n ui.printNullPtrException();\n } catch (IndexOutOfBoundsException e) {\n ui.printIndexOOBException();\n }\n System.out.println(LINEBAR);\n }",
"public void notifyFinish() {\n setBackground(getResources().getDrawable(R.drawable.fs_gesture_finish_bg, (Resources.Theme) null));\n this.mTitleView.setVisibility(4);\n this.mSummaryView.setTranslationY(this.mSummaryView.getTranslationX() - 15.0f);\n this.mSummaryView.setText(R.string.fs_gesture_finish);\n this.mSkipView.setVisibility(8);\n }",
"private void downloadFinished() {\n downloadFinished = true;\n editor.getProgressBar().setVisible(false);\n editor.getProgressBarLabel().setVisible(false);\n editor.setOkEnabled(true);\n editor.getProgressBar().setValue(editor.getProgressBar().getMaximum());\n }",
"public void completed(final Status status);",
"@Override\n\tpublic void completed() {\n\t\tSystem.out.println(\"Message Completed: \" + toString());\n\t\tscheduler.putResourceIdle();\n\t\ttry {\n\t\t\tscheduler.applyScheduling();\n\t\t} catch (Exception e) {\n\t\t\t// this should be logged or on a GUI show a dialog of the error\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void complete() {\n\t}",
"boolean completed();",
"public void finishTask() {\n\t\t\n\t}",
"public void run()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(mAPICallManager.getTasksCount()==0) showActionBarProgress(false);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// toast\n\t\t\t\t\t\t\tToast.makeText(getActivity(), \"Successfully logged out.\", Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t}",
"@Override\n protected void onPreExecute()\n {\n taskCompleted = false;\n\n //display the progress dialog\n showProgressDialog();\n }",
"public void showComplete() {\r\n showCompleted = !showCompleted;\r\n todoListGui();\r\n }",
"public void setCompleted(){\r\n\t\tisCompleted = true;\r\n\t}",
"void onComplete(String status);",
"@Override\n\tprotected void done(){\n\t\tString[] s= fileName.split(\"/\");\n\t\tthis.statuslbl.setText(\"Sucessfully created \"+s[s.length-1]+\"!\");\n\t\tprogressBar.setValue(500);\n\t\t\n\t}",
"@Override\n\t\tpublic void onComplete() {\n\t\t\tSystem.out.println(\"onComplete\");\n\t\t}",
"public void onComplete() {\r\n\r\n }",
"@Override\n\tpublic void eventFinished() {\n\t\tstatus=EventCompleted;\n\t}",
"@Override\n protected void onPostExecute(String result) {\n if (result.equals(\"SUCCESS\")) {\n\n }\n // Do things like hide the progress bar or change a TextView\n }",
"public void run()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(mAPICallManager.getTasksCount()==0) showActionBarProgress(false);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// toast\n\t\t\t\t\t\t\tToast.makeText(getActivity(), R.string.global_server_fail_toast, Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t}",
"public void run()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(mAPICallManager.getTasksCount()==0) showActionBarProgress(false);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// toast\n\t\t\t\t\t\t\tToast.makeText(getActivity(), R.string.global_server_fail_toast, Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t}",
"public void run()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(mAPICallManager.getTasksCount()==0) showActionBarProgress(false);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// toast\n\t\t\t\t\t\t\tToast.makeText(getActivity(), R.string.global_server_fail_toast, Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t}",
"public void run()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(mAPICallManager.getTasksCount()==0) showActionBarProgress(false);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// toast\n\t\t\t\t\t\t\tToast.makeText(getActivity(), R.string.global_server_fail_toast, Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t}",
"public void run()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(mAPICallManager.getTasksCount()==0) showActionBarProgress(false);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// toast\n\t\t\t\t\t\t\tToast.makeText(getActivity(), R.string.global_server_fail_toast, Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t}",
"public void run()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(mAPICallManager.getTasksCount()==0) showActionBarProgress(false);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// toast\n\t\t\t\t\t\t\tToast.makeText(getActivity(), R.string.global_server_fail_toast, Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t}",
"public void run()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(mAPICallManager.getTasksCount()==0) showActionBarProgress(false);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// toast\n\t\t\t\t\t\t\tToast.makeText(getActivity(), R.string.global_server_fail_toast, Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t}",
"public void run()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(mAPICallManager.getTasksCount()==0) showActionBarProgress(false);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// toast\n\t\t\t\t\t\t\tToast.makeText(getActivity(), R.string.global_server_fail_toast, Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t}",
"public void run()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(mAPICallManager.getTasksCount()==0) showActionBarProgress(false);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// toast\n\t\t\t\t\t\t\tToast.makeText(getActivity(), R.string.global_server_fail_toast, Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t}",
"public void run()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(mAPICallManager.getTasksCount()==0) showActionBarProgress(false);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// toast\n\t\t\t\t\t\t\tif(e.getMessage()!=null) Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t}",
"public void run()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(mAPICallManager.getTasksCount()==0) showActionBarProgress(false);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// toast\n\t\t\t\t\t\t\tif(e.getMessage()!=null) Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t}",
"public void run()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(mAPICallManager.getTasksCount()==0) showActionBarProgress(false);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// toast\n\t\t\t\t\t\t\tif(e.getMessage()!=null) Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t}",
"@Override\r\n\tpublic void done() {\n\t\tSystem.out.println(\"done\");\r\n\t}",
"private void doMarkTaskAsCompleted() {\n System.out.println(\n \"Select the task you would like to mark as complete by entering the appropriate index number.\");\n int index = input.nextInt();\n todoList.markTaskAsCompleted(index);\n System.out.println(\"The selected task has been marked as complete. \");\n }",
"@Override\n public void onComplete(@NonNull Task<Void> task) {\n if (progressDialog.isShowing()) {\n progressDialog.dismiss();\n }\n\n // Finish this activity.\n finish();\n\n }",
"private void showUploadFinishMessage() {\n if (loopDir.isEmpty()) {\n if (filesUnderFolder == 0) {\n if (rootFolderUploaded) {\n SC.say(\"Your folder is uploaded.\");\n } else {\n if (isAlreadyExist) {\n SC.say(\"Upload file is already exists.\");\n } else {\n SC.say(\"Your file is uploaded.\");\n }\n }\n } else {\n if (isAlreadyExist) {\n SC.say(\"Your folder is uploaded. Some files already exists.\");\n } else {\n SC.say(\"Your folder is uploaded.\");\n }\n }\n if (\"yellow\".equals(leftLayout.getBackgroundColor())) {\n leftLayout.setBackgroundColor(\"white\");\n }\n }\n }",
"void onComplete();",
"public void done(Integer percentDone) {\n if (percentDone == 100) {\n mApp.updateDialogProgress(percentDone, \"Finishing..\");\n } else {\n mApp.updateDialogProgress(percentDone, \"Uploading: \" + percentDone + \"%\");\n }\n }",
"public synchronized void setComplete() {\n status = Status.COMPLETE;\n }",
"@Override\n protected void onPostExecute(BackgroundTaskResult result)\n {\n taskCompleted = true;\n dismissProgressDialog();\n notifyTaskCompletion(result);\n }",
"@Override\n public void onComplete() {\n System.out.println (\"Suree onComplete\" );\n }",
"void complete();",
"void complete();",
"@Override\n protected void onPostExecute(String s) {\n super.onPostExecute(s);\n dialog.dismiss(); // to stop showing the progressbar After process is completed\n tvResult.setText(s);\n tvResult.setVisibility(View.VISIBLE);\n Toast.makeText(MainActivity.this, \"Process Done\", Toast.LENGTH_SHORT).show();\n\n }",
"void showTarProgressMessage(String msg);",
"@Override\r\n protected void onPostExecute(String message) {\n this.progressDialog.dismiss();\r\n Toast.makeText(getApplicationContext(),\r\n message, Toast.LENGTH_LONG).show();\r\n }",
"public void run() {\n\t\t\t\t\tif (_uiContainer.isDisposed()) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tsetStatusMessage(UI.EMPTY_STRING);\r\n\t\t\t\t}",
"@Override\n public boolean completed() {\n return false;\n }",
"@Override\r\n\tprotected void progressFinished() {\n\t}",
"void completeJob();",
"public void setCompleted() {\n this.completed = true;\n }",
"public void done() {\n isDone = true;\n }",
"private void updateTaskActivityLabel()\r\n {\r\n setLabelValue(\"Tile Downloads \" + myActiveQueryCounter.intValue());\r\n setProgress(myDoneQueryCounter.doubleValue() / myTotalSinceLastAllDoneCounter.doubleValue());\r\n }",
"@Override\n\tpublic void complete()\n\t{\n\t}",
"@Override\n public void handleMessage(Message msg) {\n Toast.makeText(context, \"complete!!!\", Toast.LENGTH_LONG);\n }",
"@Override\n protected void complete()\n {\n // Log the result of the script execution(s)\n logScriptCompletionStatus(associations, isBad);\n\n // Enable the calling dialog's controls\n dialog.setControlsEnabled(true);\n }",
"public void completeJob(View v) {\n // FIXME save that it is completed somehow\n Log.w(\"MA\", \"completeJob\");\n setContentView(R.layout.activity_sitter_page);\n allJobsList();\n }",
"@Override\r\n public void tasksFinished()\r\n {\n }",
"protected void updateProgress(Progress prog) {\r\n \t// if this is called then ensure the no tasks msg is not also displayed\r\n \tshowNoTaskMsg(false);\r\n \t\r\n\t\tint done = prog.getWork();\r\n\t\tString status = getStatusDesc(prog);\r\n\r\n\t\tfinal ProgressUIControl progressUIControl = findOrCreateUIControl(prog);\r\n\t\tprogressUIControl.showMsg(status);\r\n\t\tprogressUIControl.showPercent(done);\r\n\t\t\r\n\t\tif (prog.isFinished() && !progressUIControl.isFinishNotified) {\r\n\t\t\tLog.i(TAG, \"Job finished:\"+prog.getJobName());\r\n\t\t\tprogressUIControl.isFinishNotified = true;\r\n\t\t\tjobFinished(prog);\r\n\t\t}\r\n }",
"void whenComplete();",
"public static void printDoneSuccess(Task chosenTask) {\r\n CmdUx.printHBars(\"Nice! I've marked this task as done: \\n\"\r\n + \" \" + Checkbox.TICK.icon + \" \" + chosenTask.getTaskName());\r\n }",
"void TaskFinished(Task task) {\n\n repository.finishTask(task);\n }",
"public void done() {\r\n\t Toolkit.getDefaultToolkit().beep();\r\n\t jtaResultado.append(\"Fet!\\n\");\r\n\t }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\twhile(progressStatus<100)\n\t\t\t\t{\n\t\t\t\t\tprogressStatus=performTask();\n\t\t\t\t\tmyHandler.post(new Runnable()\n\t\t\t\t\t{\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\tprogressBar.setProgress(progressStatus);\n\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\tmyHandler.post(new Runnable() {\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t Toast.makeText(getBaseContext(),\"Task Completed\",Toast.LENGTH_LONG).show();\n\t progressStatus=0; \n\t myProgress=0;\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}",
"boolean complete();",
"private void handleNow() {\n Log.d(TAG, \"Short lived task is done.\");\n }",
"private void handleNow() {\n Log.d(TAG, \"Short lived task is done.\");\n }",
"public String showDone(Task t) {\n String doneMessage = \"YEEEEE-HAW!!! You've completed this task!\\n\" + t;\n return doneMessage;\n }",
"@Override\n protected void onPostExecute(String message) {\n this.progressDialog.dismiss();\n\n // Display File path after downloading\n Toast.makeText(context,\n message, Toast.LENGTH_LONG).show();\n }",
"@Override\n\tprotected void onCancelled(BackgroundTaskResult result)\n\t{\n\t\ttaskCompleted = true;\n\t\tdismissProgressDialog();\n\t\tnotifyTaskCancelled(result);\n\t}",
"@Override\n\tprotected void onPostExecute(Void result) {\n\t\tsuper.onPostExecute(result);\n\t\tstatus.setText(debug);\n\t}",
"public void markAsDone() {\r\n this.isDone = true;\r\n }",
"@Override\n\t\t\t\t\t\tpublic void finish() {\n\t\t\t\t\t\t\tSystem.out.println(\"下载成功\");\n\t\t\t\t\t\t}",
"public String showDone(Task task) {\n String response = \"\";\n response += showLine();\n response += \"Nice! I've marked this task as done:\" + System.lineSeparator();\n response += \" \" + task + System.lineSeparator();\n response += showLine();\n return response;\n }",
"public Status waitUntilFinished();",
"public static void printTaskAlreadyDoneMessage() {\n botSpeak(Message.TASK_ALREADY_DONE_MESSAGE);\n }",
"@Override\n\tpublic void onTaskDone(String result) {\n\t\t\n\t}",
"public void markAsDone() {\n this.isDone = true;\n\n }",
"public void markAsDone() {\n this.isDone = true;\n }",
"public void markAsDone() {\n this.isDone = true;\n }",
"public void markAsDone() {\n this.isDone = true;\n }",
"public void onFinish() {\n progressBar.setSecondaryProgress(PROGRESSBAR_TIME_MS);\n\n Toast.makeText(getApplicationContext(), \"FINISHED TIME\", Toast.LENGTH_SHORT).show();\n\n //Enable button again\n btnBegin.setEnabled(true);\n }",
"@Override\n protected void done() {\n files = new ArrayList<String>();\n flist = new ArrayList<File>();\n setCursor(Cursor.getDefaultCursor());\n textArea.setText(textArea.getText() + \"\\nDone!\\n\");\n progressBar.setIndeterminate(false);\n startButton.setEnabled(true);\n }",
"@Override\n public void onTaskComplete(String result) {\n\n //TODO\n\n }",
"public void finished();"
] | [
"0.7363384",
"0.732368",
"0.7212328",
"0.7205916",
"0.7062889",
"0.70579296",
"0.7055114",
"0.70192736",
"0.6947093",
"0.6876818",
"0.68738395",
"0.6814217",
"0.67731917",
"0.6756822",
"0.6740454",
"0.6733362",
"0.6733362",
"0.6731012",
"0.66943085",
"0.6685397",
"0.66438335",
"0.6589603",
"0.6586348",
"0.65397483",
"0.6501553",
"0.65006423",
"0.647973",
"0.64774567",
"0.64771324",
"0.6444886",
"0.6440128",
"0.6435927",
"0.6426308",
"0.64175683",
"0.640571",
"0.6391429",
"0.6390481",
"0.6390481",
"0.6390481",
"0.6390481",
"0.6390481",
"0.6390481",
"0.6390481",
"0.6390481",
"0.6390481",
"0.6386037",
"0.6386037",
"0.6386037",
"0.63792735",
"0.6368563",
"0.6349519",
"0.63338596",
"0.633012",
"0.6315982",
"0.6310126",
"0.63075256",
"0.6305699",
"0.6301913",
"0.6301913",
"0.6298666",
"0.6282867",
"0.6276421",
"0.6271907",
"0.6254843",
"0.6252848",
"0.6250339",
"0.62456393",
"0.62439084",
"0.6234684",
"0.6217643",
"0.62110287",
"0.62074715",
"0.62074417",
"0.61978805",
"0.6189433",
"0.6187668",
"0.61866295",
"0.6183951",
"0.61733395",
"0.6166264",
"0.6164376",
"0.6160867",
"0.6160867",
"0.6152262",
"0.61475205",
"0.61448026",
"0.6144228",
"0.61426806",
"0.6135966",
"0.61295587",
"0.6126688",
"0.6125331",
"0.6113794",
"0.6112651",
"0.6101881",
"0.6101881",
"0.6101881",
"0.61004275",
"0.60904944",
"0.6088075",
"0.6087213"
] | 0.0 | -1 |
Checks if either side has won if they have returns a 1 | public int checkWin() {
int diagSum1 = 0;
int diagSum2 = 0;
int colSum = 0;
int rowSum = 0;
int j = 0;
String winner = "";
diagSum1 = buttons[0][2].getValue() + buttons[1][1].getValue() + buttons[2][0].getValue();
diagSum2 = buttons[0][0].getValue() + buttons[1][1].getValue() + buttons[2][2].getValue();
if(diagSum1 == 3 || diagSum2 == 3) {
winner = "computer";
message.setText("COMPUTER WINS!");
setPanelEnabled(board, false);
aiscore.setText(Integer.toString(computerscore+=2));
restart.setVisible(true);
j=1;
}
if(diagSum1 == -3 || diagSum2 == -3) {
winner = "you win";
setPanelEnabled(board, false);
message.setText("YOU WIN");
humanscore.setText(Integer.toString(playerscore+=2));
restart.setVisible(true);
j=1;
}
for(int x = 0; x<3; x++) {
for(int y = 0; y<3; y++) {
rowSum += buttons[x][y].getValue();
colSum += buttons[y][x].getValue();
}
if(rowSum == 3 || colSum == 3 && winner.equals("")) {
setPanelEnabled(board, false);
restart.setVisible(true);
// frame.add(better);
winner = "Computer wins!";
message.setText("COMPUTER WINS!");
aiscore.setText(Integer.toString(computerscore+=2));
j=1;
}
else if(rowSum == -3 || colSum == -3 && winner.equals("")) {
setPanelEnabled(board, false);
// frame.add(restart);
winner = "You win";
message.setText("YOU WIN");
humanscore.setText(Integer.toString(playerscore+=2));
restart.setVisible(true);
// frame.add(better);
j=1;
}
rowSum = 0;
colSum = 0;
}
if(clicks >= 9 && winner.equals("")) {
winner = "draw";
setPanelEnabled(board, false);
restart.setVisible(true);
// frame.add(better);
message.setText("IT'S A DRAW!");
humanscore.setText(Integer.toString(playerscore+=1));
aiscore.setText(Integer.toString(computerscore+=1));
j=1;
}
return j;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean gameOver() {\n return player1Wins() || player2Wins();\n }",
"private boolean player2Wins() {\n\n boolean p2inTriangle = false;\n int target[] = new int[]{0, 1, 2, 3, 9, 10, 11, 18, 19, 27};\n for (int i : target) {\n if (board[i] == 0)\n return false;\n if (board[i] == 2)\n p2inTriangle = true;\n }\n\n return p2inTriangle;\n }",
"void checkWinner() {\n\t}",
"public boolean winner(){\n\t\treturn goals1 > goals2;\n\t}",
"private boolean player1Wins() {\n\n boolean p1inTriangle = false;\n int target[] = new int[]{53, 61, 62, 69, 70, 71, 77, 78, 79, 80};\n for (int i : target) { \n if (board[i] == 0)\n return false;\n if (board[i] == 1)\n p1inTriangle = true;\n }\n\n return p1inTriangle;\n }",
"public boolean meWin(){\n return whitePieces.size() > blackPieces.size() && isWhitePlayer;\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 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 }",
"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 static void checkResult() {\n\t\tint sum = PlayerBean.PLAYERONE - PlayerBean.PLAYERTWO;\n\n\t\tif (sum == 1 || sum == -2) {\n\t\t\tScoreBean.addWin();\n\t\t\tresult = \"player one wins\";\n\t\t} else {\n\t\t\tScoreBean.addLoss();\n\t\t\tresult = \"player two wins\";\n\t\t}\n\t}",
"public boolean topPlayerWon() {\n return winner == 2;\n }",
"boolean gameOver() {\n return piecesContiguous(BP) || piecesContiguous(WP);\n }",
"public boolean gameOver(){\r\n if(isGame) return (currentPlayer.getChecks() == 0 || nextPlayer.getChecks() == 0 || currentPlayer.getQueens() == 4 || nextPlayer.getQueens() == 4 || (currentPlayer.cantMove() && nextPlayer.cantMove()));\r\n return getNumChecks(WHITE) == 0 || getNumChecks(BLACK) == 0 || getNumQueens(WHITE) == 4 || getNumQueens(BLACK) == 4;\r\n }",
"@Override\n\tpublic boolean checkWinner( int player) {\n\t\t\n\t\treturn didWin(player, -1, 0) ||\n\t\t\t\tdidWin(player, 0, -1) ||\n didWin(player, -1, -1) ||\n didWin(player, 1, -1);\n\t}",
"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}",
"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 static boolean checkIfGameDone(){\nboolean a=checkDiagonal();\r\nboolean b=false;\r\nif(a==false)\r\n\t b = checkSides(0)||checkSides(1)||checkSides(2);\r\n\treturn a||b;\t\r\n}",
"public void checkWin() {\n if (rockList.isEmpty() && trackerRockList.isEmpty() && bigRockList.isEmpty() && bossRockList.isEmpty()) {\n if (ship.lives < 5) {\n ship.lives++;\n }\n Level++;\n LevelIntermission = true;\n LevelIntermissionCount = 0;\n }\n }",
"public boolean GameOver() {\r\n if(Main.player1.SuaVida()==0 || Main.player2.SuaVida()==0)\r\n return true;\r\n return false;\r\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 boolean amIWinning(){\n if (playerScore > oppoScore) {\n return true;\n } else {\n return false;\n }\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 boolean isWon() {\r\n\t\tif (winner(CROSS) || winner(NOUGHT))\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}",
"private boolean isOver() {\r\n return players.size() == 1;\r\n }",
"public int winner() {\n if (player1Wins())\n return 1;\n if (player2Wins())\n return 2;\n return -1; // No one has won\n }",
"public void checkWin(){\n boolean result = false;\n if(game.getTurn() > 3){\n Player currentPlayer = game.getPlayerTurn();\n int playernumber = currentPlayer.getPlayericon();\n result = game.winChecker(game.getBored(),playernumber);\n if(result == true) {\n setWinMsgBox(currentPlayer.getPlayerName() + \" Is victorious :)\",\"WIN\");\n }else if(game.getTurn() == 8 && result == false){\n setWinMsgBox(\"Too bad it is a draw, No one out smarted the other -_-\",\"DRAW\");\n }else{}\n }else{\n result = false;\n }\n }",
"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 static boolean isGameWon() {\r\n\t\tboolean gameWon = false;\r\n\t\t\r\n\t\t//Game won for three handed game.\r\n\t\tif (Main.isThreeHanded){\r\n\t\t\tif (Utils.stringToInt(Main.player1Score) >= Main.winScoreNumb ||\r\n\t\t\t\t\tUtils.stringToInt(Main.player2Score) >= Main.winScoreNumb ||\r\n\t\t\t\t\tUtils.stringToInt(Main.player3Score) >= Main.winScoreNumb) {\r\n\t\t\t\tgameWon = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Game won for four handed single player game.\r\n\t\tif (Main.isFourHandedSingle){\r\n\t\t\tif (Utils.stringToInt(Main.player1Score) >= Main.winScoreNumb ||\r\n\t\t\t\t\tUtils.stringToInt(Main.player2Score) >= Main.winScoreNumb ||\r\n\t\t\t\t\tUtils.stringToInt(Main.player3Score) >= Main.winScoreNumb ||\r\n\t\t\t\t\tUtils.stringToInt(Main.player4Score) >= Main.winScoreNumb) {\r\n\t\t\t\tgameWon = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Game won for four handed team game.\r\n\t\tif (Main.isFourHandedTeams){\r\n\t\t\tif (Utils.stringToInt(Main.team1Score) >= Main.winScoreNumb ||\r\n\t\t\t\t\tUtils.stringToInt(Main.team2Score) >= Main.winScoreNumb) {\r\n\t\t\t\tgameWon = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Set Main variable.\r\n\t\tMain.isGameWon = gameWon;\r\n\t\t\r\n\t\treturn gameWon;\r\n\t}",
"boolean gameOver() {\n return piecesContiguous(BLACK) || piecesContiguous(WHITE);\n }",
"public boolean oWins() {\n\t\tif (checkWinner(LETTER_O) == 1)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"public boolean gameOver()\n {\n boolean over = false;\n if (player1Hand.isEmpty()||player2Hand.isEmpty())\n {\n over = true;\n }\n return over;\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 static boolean checkSides(int i){\n\tif(gamebd[i][0]==gamebd[i][1]&&gamebd[i][1]==gamebd[i][2]&&gamebd[i][0]>0){\r\n\t\tif(gamebd[i][0]==player1)\r\n\t\t\tSystem.out.println(\"Player 1 won\");\r\n\t\telse\r\n\t\t\tSystem.out.println(\"Player 2 won\");\r\n\treturn true;\t\r\n\t}\r\n\t if(gamebd[0][i]==gamebd[1][i]&&gamebd[2][i]==gamebd[1][i]&&gamebd[0][i]>0){\r\n\t\tif(gamebd[0][i]==player1)\r\n\t\t\tSystem.out.println(\"Player 1 won\");\r\n\t\telse\r\n\t\t\tSystem.out.println(\"Player 2 won\");\r\n\treturn true;\t\r\n\t}\r\n\treturn false;\r\n}",
"private boolean isOver() {\n for (Player player : players) {\n if (player.getHand().length == 0) {\n System.out.println(\"Player '\" + player.getName() + \"' won!\");\n winner = player.getID();\n return true;\n }\n }\n\n return false;\n }",
"private boolean checkGameStatus() {\n int res = model.getWinner();\n if (res == Model.DRAW) {\n draw();\n return false;\n } else if (res == Model.WHITE) {\n whiteScore++;\n view.getPrompt().setText(whiteName + \" win!\");\n prepareRestart();\n return false;\n } else if (res == Model.BLACK) {\n blackScore++;\n view.getPrompt().setText(blackName + \" win!\");\n prepareRestart();\n return false;\n }\n return true;\n }",
"public boolean gameOver()\n {\n return checkmate()||draw()!=NOT_DRAW;\n }",
"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 }",
"public int winner() {\n if(humanPlayerHits == 17) {\n return 1;\n }\n if(computerPlayerHits == 17){\n return 2;\n }\n return 0;\n }",
"boolean isWinner() {\n if(checkTopLeftDownDiag('X') || checkTopLeftDownDiag('O')) {\n return true;\n } else if (checkBottomLeftUpDiag('X') || checkBottomLeftUpDiag('O')) {\n return true;\n } else if (checkRows('X') || checkRows('O')){\n return true;\n }\n else if (checkColumns('X') || checkColumns('O')){\n return true;\n }\n\n return false;\n }",
"public boolean hasWon(){\n boolean winStatus = false;\n if(balance >= 3000){\n winStatus = true;\n }\n return winStatus;\n }",
"public void win() {\n if (turn == 1) {\n p1.incrementLegs();\n if (p1.getLegs() == 5) {\n p1.incrementSets();\n p1.setLegs(0);\n p2.setSets(0);\n\n }\n if (p1LastScore > p1.getHighout()) {\n p1.setHighout(p1LastScore);\n\n }\n\n if (p1.getHighout() > OVERALL_HIGH_OUT) {\n OVERALL_HIGH_OUT = p1.getHighout();\n }\n } else if (turn == 2) {\n p2.incrementLegs();\n if (p2.getLegs() == 5) {\n p2.incrementSets();\n p2.setLegs(0);\n p1.setSets(0);\n\n }\n if (p2LastScore > p2.getHighout()) {\n p2.setHighout(p2LastScore);\n }\n\n if (p2.getHighout() > OVERALL_HIGH_OUT) {\n OVERALL_HIGH_OUT = p2.getHighout();\n }\n\n\n\n }\n changeFirstTurn();\n win = true;\n\n\n\n }",
"public boolean isGameOver() {\n if (!isFirstTurn) {\n if (state.score().totalPoints(TeamId.TEAM_1)>=Jass.WINNING_POINTS||state.score().totalPoints(TeamId.TEAM_2)>=Jass.WINNING_POINTS) {\n return true;\n }\n else {\n return false;\n }\n } \n else {return false;}\n }",
"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 }",
"private boolean checkGameOver() {\n\t\tboolean singlePlayerWon = otherPlayer.getLife() == 0;\n\t\tboolean otherPlayerWon = singlePlayer.getLife() == 0;\n\n\t\tif (singlePlayerWon || otherPlayerWon) {\n\t\t\tthis.singlePlayer.createEndButton(singlePlayerWon);\n\t\t\tthis.singlePlayer.onGameOver();\n\t\t\tthis.otherPlayer.onGameOver();\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public boolean checkWin (int totalPieces){\n\t\treturn isFull();\n\t}",
"public boolean oneRound (){\r\n\r\n\t if(this.isOver()){\r\n\t\t return false;\r\n\t }\r\n\t \r\n\t //\r\n\t int p= trick.pick(player1);\r\n\t int p2=trick.pick(player2);\r\n\t \r\n\t while(p==p2){\r\n\r\n\t\tfor(int i=0; i<2; i++){\r\n\t\t\t\r\n\r\n\t\t\t if(this.isOver()){\r\n\t\t\t\t \r\n\t\t\t\t p=trick.pick(player1);\r\n\t\t\t\t p2=trick.pick(player2);\r\n\t\t\t\t return false;\r\n\t\t\t }\r\n\t\t\t \r\n\t\t}\r\n\t\tif(p>p2){\r\n\t\t\t\r\n\t\t\tplayer1.pickAll(trick);\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tplayer2.pickAll(trick);\r\n\t\t\t\r\n\t\t}\r\n\t }\r\n\treturn true;\r\n\t \r\n }",
"private boolean checkIfGameIsWon() {\n\n //loop through rows\n for(int i = 0; i < NUMBER_OF_ROWS; i++) {\n //gameIsWon = this.quartoBoard.checkRow(i);\n if (this.quartoBoard.checkRow(i)) {\n System.out.println(\"Win via row: \" + (i) + \" (zero-indexed)\");\n return true;\n }\n\n }\n //loop through columns\n for(int i = 0; i < NUMBER_OF_COLUMNS; i++) {\n //gameIsWon = this.quartoBoard.checkColumn(i);\n if (this.quartoBoard.checkColumn(i)) {\n System.out.println(\"Win via column: \" + (i) + \" (zero-indexed)\");\n return true;\n }\n\n }\n\n //check Diagonals\n if (this.quartoBoard.checkDiagonals()) {\n System.out.println(\"Win via diagonal\");\n return true;\n }\n\n return false;\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 boolean gameOver() {\n return winner() != null;\n }",
"public void checkIfWinOrDraw() {\r\n\t\tif (theModel.getIsDraw() == true) {\r\n\t\t\tDrawNum++;\r\n\t\t\tactivePlayer = winningPlayer;\r\n\t\t\t// cards go to communalPile\r\n\r\n\t\t} else {\r\n\t\t\ttheModel.winningCard(winningPlayer);\r\n\t\t\ttheModel.transferWinnerCards(winningPlayer);\r\n\t\t}\r\n\r\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 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 }",
"private boolean playerWin(Board board)\n {\n return check(board, PLAYER);\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 }",
"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 boolean checkIfGameIsWon() {\n\t\t//loop through rows\n\t\tfor (int i = 0; i < NUMBER_OF_ROWS; i++) {\n\t\t\t//gameIsWon = this.quartoBoard.checkRow(i);\n\t\t\tif (this.quartoBoard.checkRow(i)) {\n\t\t\t\tSystem.out.println(\"Win via row: \" + (i) + \" (zero-indexed)\");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//loop through columns\n\t\tfor (int i = 0; i < NUMBER_OF_COLUMNS; i++) {\n\t\t\t//gameIsWon = this.quartoBoard.checkColumn(i);\n\t\t\tif (this.quartoBoard.checkColumn(i)) {\n\t\t\t\tSystem.out.println(\"Win via column: \" + (i) + \" (zero-indexed)\");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//check Diagonals\n\t\tif (this.quartoBoard.checkDiagonals()) {\n\t\t\tSystem.out.println(\"Win via diagonal\");\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\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 }",
"private static boolean checkWinner(Player playerA, Player playerB) {\n\t\tboolean gameOver = false;\n\t\tif (playerA.getShips().isEmpty()) {\n\t\t\tSystem.out.println(playerB.getName() + \" Won the Battle\");\n\t\t\tgameOver = true;\n\t\t} else if (playerB.getShips().isEmpty()) {\n\t\t\tSystem.out.println(playerA.getName() + \" Won the Battle\");\n\t\t\tgameOver = true;\n\t\t} else if (playerA.getTargetList().isEmpty() && playerB.getTargetList().isEmpty()) {\n\t\t\tSystem.out.println(\"peace\");\n\t\t\tgameOver = true;\n\t\t}\n\t\treturn gameOver;\n\t}",
"public boolean hasAnyoneLost()\n {\n gameOver = false;\n if(dw.isEmpty() || de.isEmpty())\n gameOver = true;\n \n return gameOver;\n }",
"public boolean gameOver(){\n\t\treturn this.lives < 1;\n\t}",
"@Test\r\n\tpublic void gameWinCheckCallsCorrectWinner() {\r\n\t\tBowl bowl = new Bowl();\r\n\t\tvar answer = bowl.gameWinCheck();\r\n\t\tassertEquals(-1,answer);\r\n\t\tbowl = setupGame(bowl);\r\n\t\tanswer = bowl.gameWinCheck();\r\n\t\tassertEquals(1,answer);\r\n\t\tbowl.getNeighbor(6).passTheft(49);\r\n\t\tanswer = bowl.getNeighbor(2).gameWinCheck();\r\n\t\tassertEquals(0,answer);\r\n\t}",
"public boolean playerWonGame(Player player) {\n if (playerWonGameWithDiagonalLine(player) || playerWonGameWithHorizontalLine(player)\n || playerWonGameWithVerticalLine(player)) {\n return true; \n }\n return false; \n \n }",
"public boolean xWins() {\n\t\tif (checkWinner(LETTER_X) == 1)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"public boolean playerTwoWin()\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}",
"boolean isPossible() {\n return (sideOne + sideTwo > sideThree) && (sideTwo + sideThree > sideOne) && (sideThree + sideOne > sideTwo);\n }",
"public boolean won()\n {\n if (currentScore >= PigGame.GOAL)\n {\n return true;\n }\n \n else\n {\n return false;\n }\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 isCheckMate() {\n if (whitePlayer.getOccupiedSet().isEmpty()) {\n System.out.println(\"BLACK PLAYER WINS\");\n return true;\n }\n else if (blackPlayer.getOccupiedSet().isEmpty()) {\n System.out.println(\"WHITE PLAYER WINS\");\n return true;\n }\n else return false;\n }",
"public boolean meTurn(){\n return (isWhite && isWhitePlayer) || (!isWhite && !isWhitePlayer);\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 }",
"public void winGame() {\n this.isWinner = true;\n }",
"public int checkWin(Piece piece) {\n\t\t//check winning and losing\n\t\tint color=piece.getColor();\n\t\tif(piece.isRabbit()) {\n\t\t\tif(((Rabbit)piece).isOtherSide()) {\n\t\t\t\treturn color;\n\t\t\t}\n\t\t}\n\t\tif(rabbitcount[color]<=0) {\n\t\t\treturn 3-color;//the opponent wins\n\t\t}\n\t\treturn 0;\n\t}",
"public boolean hasHeWon(int player) {\n if ((board[0][0] == board[1][1] && board[0][0] == board[2][2] && board[0][0] == player) ||\n (board[0][2] == board[1][1] && board[0][2] == board[2][0] && board[0][2] == player)) {\n return true;\n }\n for (int i = 0; i < 3; i++) {\n // check for row i\n if (board[i][0] == board[i][1] && board[i][0] == board[i][2] && board[i][0] == player) {\n return true;\n } else\n // check for column i\n if (board[0][i] == board[1][i] && board[0][i] == board[2][i] && board[0][i] == player) {\n return true;\n }\n }\n return false;\n }",
"private void winCondition(){\n if(cleared==(int)grid.clearedToWin){\n winGame();\n }\n }",
"@Override\n public boolean gameOver() {\n //true if the board full or a winner has been found\n return getWinner() != EMPTY || isBoardFull();\n }",
"private static void winner()\n {\n if ((board[1] == userLetter && board[2] == userLetter && board[3] == userLetter) ||\n (board[4] == userLetter && board[5] == userLetter && board[6] == userLetter) ||\n (board[7] == userLetter && board[8] == userLetter && board[9] == userLetter) ||\n (board[1] == userLetter && board[5] == userLetter && board[9] == userLetter) ||\n (board[3] == userLetter && board[5] == userLetter && board[7] == userLetter))\n {\n showBoard();\n System.out.println(\"Player win the game\");\n System.exit(0);\n }\n }",
"private boolean colWin(){ \r\n\t\tfor (int i=0; i<3; i++){ \r\n\t\t\tif (checkValue (board[0][i], board[1][i], board[2][i]))\r\n\t\t\t\treturn true; \r\n\t\t}\r\n\t\treturn false; \r\n\t}",
"private boolean diagWin(){ \r\n\t\treturn ((checkValue (board[0][0],board[1][1],board[2][2]) == true) || \r\n\t\t\t\t(checkValue (board[0][2], board[1][1], board[2][0]) == true)); \r\n\t}",
"private void checkGameCondition(int x, int y) {\n int player = this.gameField.getValue(x, y);\n if (this.cellsClosed == this.gameField.length() * this.gameField.length()) {\n this.gameOver = true;\n }else if (horizontalMatches(player, y) || verticalMatches(player, x)\n || diagonalMatches(player, true)\n || diagonalMatches(player, false)) {\n this.gameOver = true;\n this.winnerId = player;\n }\n }",
"public boolean winner(){ \r\n\t\tif (rowWin() || colWin() || diagWin()){ \r\n\t\t\tchangeTurn(); \r\n\t\t\tSystem.out.println(\"Winner: \" + playerToString(currentTurn) + \"!\"); \r\n\t\t\treturn true; \r\n\t\t}\r\n\t\telse if (tie()){\r\n\t\t\tSystem.out.println(\"There is a tie.\");\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse{ \r\n\t\t\tSystem.out.println(\"No winner yet.\\n\"); \r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}",
"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 }",
"@Test\r\n\tpublic final void testIsWon() {\r\n\t\tassertTrue(gameStatistics.isWon());\r\n\t\tassertFalse(gameStatisticsLoss.isWon());\r\n\t}",
"@Test\n public final void testPlayer2Win() {\n checkPlayerWin(player2);\n }",
"public boolean playerLoses(){\n return (curPlayerRow == curTrollRow && curPlayerCol == curTrollCol);\n }",
"public Boolean gameIsOver(){\n\n if(playerShipDead || enemyShipDead){\n if(enemyShipDead && !(deathTriggered)){\n deathTriggered = true;\n playerScore += scoreToGain; //This will depend on the enemyShip's score amount. Only affects the display.\n playerGoldAmount += goldToGain;\n //playerShip.setPointsWorth(playerScore); // Doesn't work.\n }\n return true;\n } else {\n return false;\n }\n }",
"private boolean isWinner(byte player) {\n for (int row = 0; row <= 2; row++) {\n if (board[row][0] == player && board[row][1] == player && board[row][2] == player) {\n return true;\n }\n }\n for (int column = 0; column <= 2; column++) {\n if (board[0][column] == player && board[1][column] == player && board[2][column] == player) {\n return true;\n }\n }\n if (board[0][0] == player && board[1][1] == player && board[2][2] == player) {\n return true;\n } else if (board[0][2] == player && board[1][1] == player && board[2][0] == player) {\n return true;\n } else {\n return false;\n }\n }",
"public boolean isWin(Player player, Point p) {\n if (p.getX() == 0 && p.getY() == 0) {\n return false;\n }\n if (player == P1) {\n if (p.getY() >= 9) {\n winner = P1;\n return true;\n }\n return false;\n }\n else {\n if (p.getY() <= 1) {\n winner = P2;\n return true;\n }\n return false;\n }\n }",
"public boolean isOtherPlayerReady(int[] details)throws RemoteException{\n if(details[1] == 0){\n return sd.getGames().get(details[0]).getPlayers()[1].isReady();\n } return sd.getGames().get(details[0]).getPlayers()[0].isReady();\n }",
"public boolean checkForVictory() {\n // keep track of whether we have seen any pieces of either color.\n boolean anyWhitePieces = false;\n boolean anyRedPieces = false;\n // iterate through each row\n for (Row row : this.redBoard) {\n // whether we iterate through the red or white board does not matter; they contain the same pieces, just\n // in a different layout\n // iterate through each space in a row\n for (Space space : row) {\n // if there is a piece on this space\n if (space.getPiece() != null) {\n if (space.getPiece().getColor() == Piece.COLOR.RED) {\n // and if it's red, we have now seen at least one red piece\n anyRedPieces = true;\n } else if (space.getPiece().getColor() == Piece.COLOR.WHITE) {\n // and if it's white, we have now seen at least one white piece\n anyWhitePieces = true;\n }\n }\n }\n }\n // if we haven't seen any pieces of a color, then the other player has won\n if (!anyRedPieces) {\n // white player has won\n markGameAsDone(getWhitePlayer().getName() + \" has captured all the pieces.\");\n return true;\n } else if (!anyWhitePieces) {\n // red player has won\n markGameAsDone(getRedPlayer().getName() + \" has captured all the pieces.\");\n return true;\n }\n return false;\n }",
"public int checkChasingPlayer()\n {\n if(stunCountdown > 0)\n {\n chasingPlayer = false;\n return stunCountdown;\n }\n if(Game.getInstance().getPlayer().getCurrentRoom().isControlRoom())\n {\n chasingPlayer = false;\n return(-1);\n }\n else\n {\n List<Exit> neighbors = getCurrentRoom().getCollectionOfExits();\n for(Exit neighbor : neighbors)\n {\n if(getCurrentRoom().getExit(neighbor).equals(Game.getInstance().getPlayer().getCurrentRoom()) && neighbor.isOperating())\n {\n chasingPlayer = true;\n return(5 + (int) Math.floor(Math.random() * 6));\n }\n }\n chasingPlayer = false;\n return(-1);\n }\n }",
"public boolean playerWins(){\n return playerFoundTreasure(curPlayerRow, curPlayerCol);\n }",
"private void checkWinner() {\n\t\tif(player.getHandVal() == BLACKJACK && dealer.getHandVal() == BLACKJACK) {\n\t\t\tSystem.out.println(\"Both players have Blackjack!\\n\");\n\t\t\tresult = \"TIE\";\n\t\t}\n\t\telse if (player.getHandVal() == BLACKJACK) {\n\t\t\tSystem.out.println(\"The Player has Blackjack!\\n\");\n\t\t\tresult = \"PLAYER\";\n\t\t}\n\t\telse if (dealer.getHandVal() == BLACKJACK) {\n\t\t\tSystem.out.println(\"The Dealer has Blackjack!\\n\");\n\t\t\tresult = \"DEALER\";\n\t\t}\n\t\telse if(player.getHandVal() > BLACKJACK && dealer.getHandVal() > BLACKJACK) {\n\t\t\tSystem.out.println(\"Both players bust!\\n\");\n\t\t\tresult = \"DEALER\";\n\t\t}\n\t\telse if(player.getHandVal() > BLACKJACK) {\n\t\t\tSystem.out.println(\"The Player has busted!\\n\");\n\t\t\tresult = \"DEALER\";\n\t\t}\n\t\telse if(dealer.getHandVal() > BLACKJACK) {\n\t\t\tSystem.out.println(\"The Dealer has busted!\\n\");\n\t\t\tresult = \"PLAYER\";\n\t\t}\n\t\telse if(player.getHandVal() > dealer.getHandVal()) {\n\t\t\tSystem.out.println(\"The Player has a higher score!\\n\");\n\t\t\tresult = \"PLAYER\";\n\t\t}\n\t\telse if(player.getHandVal() < dealer.getHandVal()){\n\t\t\tSystem.out.println(\"The dealer has a higher score!\\n\");\n\t\t\tresult = \"DEALER\";\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Both players have the same score!\\n\");\n\t\t\tresult = \"TIE\";\n\t\t}\n\t}",
"public boolean gameIsOver() {return revealedShips >= 4;}",
"boolean isPlayerTurn();",
"public boolean gameWon(){\n\t\treturn Game.gameWon;\n\t}",
"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}",
"boolean hasWin();",
"public boolean isGameOver(){\n return checkKingReachedEnd() || checkNoDragonsLeft() || checkIfKingSurrounded();\n }",
"private boolean isWinning(Piece[] arr) {\n if (arr[0] == X) {\n for (Piece piece : arr) {\n if (piece != X) {\n return false;\n }\n }\n }\n else {\n for (Piece piece : arr) {\n if (piece != O) {\n return false;\n }\n }\n }\n return true;\n }",
"public void gameOverCheck() {\n //users\n if (tankTroubleMap.getUsers().size() != 0) {\n tankTroubleMap.setWinnerGroup(tankTroubleMap.getUsers().get(0).getGroupNumber());\n for (int i = 1; i < tankTroubleMap.getUsers().size(); i++) {\n if (tankTroubleMap.getUsers().get(i).getGroupNumber() != tankTroubleMap.getWinnerGroup())\n return;\n }\n }\n //bots\n int firstBot = 0;\n if (tankTroubleMap.getBots().size() != 0) {\n if (tankTroubleMap.getWinnerGroup() == -1) {\n firstBot = 1;\n tankTroubleMap.setWinnerGroup(tankTroubleMap.getBots().get(0).getGroupNumber());\n }\n for (int i = firstBot; i < tankTroubleMap.getBots().size(); i++) {\n if (tankTroubleMap.getBots().get(i).getGroupNumber() != tankTroubleMap.getWinnerGroup())\n return;\n }\n }\n tankTroubleMap.setGameOver(true);\n }",
"public boolean gameOver() {\r\n return didPlayerLose() || didPlayerWin();\r\n }"
] | [
"0.7212567",
"0.7083001",
"0.7082945",
"0.7042619",
"0.70309806",
"0.6985292",
"0.6959491",
"0.694541",
"0.6916814",
"0.68991745",
"0.6890836",
"0.6888026",
"0.68306494",
"0.67942536",
"0.67824703",
"0.67524815",
"0.67497844",
"0.6716305",
"0.6687658",
"0.6676511",
"0.6676015",
"0.6648069",
"0.66319835",
"0.66102654",
"0.66044676",
"0.6593121",
"0.6591711",
"0.6585761",
"0.6578013",
"0.6570623",
"0.6553033",
"0.6551916",
"0.6527598",
"0.65227765",
"0.6500447",
"0.64905787",
"0.6480074",
"0.64661014",
"0.6461555",
"0.6458006",
"0.6440954",
"0.6426884",
"0.64231604",
"0.64187145",
"0.6418195",
"0.641483",
"0.6413837",
"0.6410424",
"0.64026886",
"0.6395499",
"0.63861406",
"0.6385292",
"0.6381731",
"0.63795567",
"0.6378427",
"0.6369959",
"0.636921",
"0.6368574",
"0.63461375",
"0.6345069",
"0.6343403",
"0.63423413",
"0.63365704",
"0.63352865",
"0.632733",
"0.6322085",
"0.63214034",
"0.630959",
"0.62935895",
"0.62893426",
"0.62827975",
"0.6271807",
"0.62641025",
"0.6260683",
"0.625426",
"0.62519866",
"0.6251792",
"0.6248032",
"0.6244659",
"0.6242265",
"0.6224738",
"0.6221345",
"0.6221073",
"0.62173146",
"0.6215369",
"0.6204767",
"0.62039936",
"0.61968446",
"0.6185079",
"0.61850774",
"0.61848176",
"0.6184651",
"0.6181349",
"0.61802644",
"0.61699325",
"0.6169738",
"0.61665297",
"0.61609674",
"0.6160911",
"0.6159317",
"0.61554223"
] | 0.0 | -1 |
////////////////////////////////if either button clicked | public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("Play Another Game")){
restart.setVisible(false);
randint = rand.nextInt(2);
board.removeAll();
board.setBounds(50, 20, 199, 199);
board.setLayout(new GridLayout(3,3,2,2));
board.setBackground(Color.black);
for (int x=0; x<3; x++) {
for (int y=0; y<3; y++) {
//JButton btn = new JButton();
buttons[x][y] = new BoardButton(x,y);
buttons[x][y].setBounds(0+(68*y), 0+(68*y),66 , 66);
board.add(buttons[x][y]);
buttons[x][y].setBackground(Color.WHITE);
buttons[x][y].setFont(new Font("Brush Script MT", Font.ITALIC, 40));
buttons[x][y].addActionListener(new BoardListener());
buttons[x][y].setValue(0);
}
}
board.revalidate();
board.repaint();
// frame.remove(restart);
clicks = 0;
//checkWin();
message.setText("");
if(randint == 1 ) {clicks++;AiChoice();message.setText(Integer.toString(clicks) + Integer.toString(pattern));}
}
else if (e.getActionCommand().equals("Want Better?")) {
try {
URI uri= new URI("https://www.google.com/search?safe=strict&rlz=1C1CHBF_enIE772IE772&sxsrf=ALeKk02SwFT95oiUpQTwq4tov5PfCWJeYw%3A1586973543968&ei=Z0uXXqTWOoGl1fAP7rq56Ag&q=tictactoe&oq=tictactoe&gs_lcp=CgZwc3ktYWIQAzIECCMQJzIECCMQJzIECAAQQzIECAAQCjIECAAQCjIECAAQCjIECAAQCjIECAAQCjIECAAQCjIECAAQCjoECAAQR0oNCBcSCTktNzlnMGcxMkoLCBgSBzktMWcwZzJQ_hNY_hNg5RVoAHACeACAAUOIAUOSAQExmAEAoAEBqgEHZ3dzLXdpeg&sclient=psy-ab&ved=0ahUKEwjkpeySgevoAhWBUhUIHW5dDo0Q4dUDCAw&uact=5");
java.awt.Desktop.getDesktop().browse(uri);
}
catch (Exception j) {
j.printStackTrace();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public void actionPerformed(ActionEvent e) {\r\n\r\n if (e.getActionCommand() == \"button1\"){\r\n JOptionPane.showMessageDialog(null,\"Button1 hit\");\r\n }else {\r\n JOptionPane.showMessageDialog(null,\"Button2 hit\");\r\n }\r\n\r\n }",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif (e.getSource() == btn2) {\n\t\t\t\t\tchucnang(txt1.getText(), btn1);\n\t\t\t\t}\n\t\t\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\tif(arg0.getSource() == button1){\n\t\tSystem.out.println(\"Why did the chicken cross the road.\");\n\t\t}\n\t\tif(arg0.getSource() == button2){\n\t\t\tSystem.out.println(\"`because he was to dumb to realize the grosrey store was the other way.\");\n\t\t\t}\n\t}",
"@Override\n\tpublic void onClick(View arg0) {\n \t\t\n \t\t\n \t\t\n \t\tswitch(arg0.getId())\n \t\t{\n \t\tcase R.id.button1 : result();\n \t\t\t\t\t\t\tbreak;\n \t\tcase R.id.button2 : clr1();\n \t\t\t\t\t\t\tbreak;\n \t\t}\t\t\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tJButton buttonPressed = (JButton) e.getSource();\n\t\tif (buttonPressed == buttonOne) {\n\t\t\tSystem.out.println(\"button 1 pressed\");\n\t\t} else if (buttonPressed == buttonTwo) {\n\t\t\tSystem.out.println(\"button 2 pressed\");\n\t\t}\n\t}",
"public void onYesButtonClicked() {\n changeAfterClientPick();\n }",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tButton button = (Button)e.getSource();\n\t\t\n\t\t/* Filter / Periksa komponen sesuai button event-nya masing2 */\n\t\tif(b == button)\n\t\t\tSystem.out.println(\"Button b\");\n\t\t\n\t\tif(c == button)\n\t\t\tSystem.out.println(\"Button c\");\n\n\t}",
"public void buttonClicked();",
"@FXML\n\tvoid mainMenuBtnClicked(ActionEvent event) {\n\t\t// if submitted before exam time ends ask the user if he sure of that\n\t\tif (flag1 && flag2) {\n\t\t\tAlert alert = new Alert(AlertType.CONFIRMATION);\n\t\t\talert.setTitle(\"Warning\");\n\t\t\talert.setHeaderText(\"Leaving the exam means you submitting a blank exam\");\n\t\t\talert.setContentText(\"Are you sure you want to do that?\");\n\t\t\tOptional<ButtonType> result = alert.showAndWait();\n\t\t\tif (result.get() == ButtonType.OK) {\n\t\t\t\tsummbitBlank();\n\t\t\t\ttry {\n\t\t\t\t\tFXMLutil.swapScene(event, window.StudentMenu.toString());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tFXMLutil.swapScene(event, window.StudentMenu.toString());\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\t\t}\n\t}",
"protected void dopositiveClick2() {\n\n }",
"@Override\n\t\tpublic void onClick(View arg0) {\n\t\t\tbuttonToLeft.setImageDrawable(getResources().getDrawable(R.drawable.toleft));\n\t\t\tbuttonToRight.setImageDrawable(getResources().getDrawable(R.drawable.toright1));\n\t\t\taction.removeAllViews();\n\t\t\taction.addView(second);\n//\t\t\tdraw.setDrawItem(list);\n\t\t\tdraw.setDrawView();\n\t\t\t\n//\t\t\tshowInf = (TextView)findViewById(R.id.InfTextView);\n// \t\tshowInf.setText(\"您输入的选项为:\"+s);\n\t\t}",
"public void submit_intsatpos(View button) {\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n if(e.getSource().equals(btnQuayLai)){\n btnquaylaiclick();}\n }",
"public void buttonClicked() {\n mSanitizorGame.buttonClicked();\n }",
"@Override\n\tpublic void onClick(View p1)\n\t{\n\t\tswitch(p1.getId()){\n\t\t\tcase R.id.btn_look:\n\t\t\t\tlook();\n\t\t\t\tbreak;\n\t\t\tcase R.id.btn_save:\n\t\t\t\tsave();\n\t\t\t\tbreak;\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public void onClick(Widget sender) {\n if(sender.equals(this.deleteButton)) {\n\t\t\tthis.removeObject();\n\t\t} else if(sender.equals(this.backButton)) {\n\t\t\tthis.backObject();\n\t\t} else if(sender.equals(this.frontButton)) {\n\t\t\tthis.frontObject();\n\t\t} else if(sender.equals(this.saveButton)) {\n\t\t\tthis.saver.saveDocument(this.canvas);\n }else if(sender.equals(this.selectButton)) {\n this.action.setAction(Action.SELECT);\n\t\t} else if(sender.equals(this.pencilButton)) {\n this.unSelect();\n this.action.setAction(Action.PENCIL);\n\t\t} else if(sender.equals(this.lineButton)) {\n this.unSelect();\n this.action.setAction(Action.LINE);\n\t\t} else if(sender.equals(this.rectButton)) {\n this.unSelect();\n this.action.setAction(Action.RECTANGLE);\n\t\t} else if(sender.equals(this.circleButton)) {\n this.unSelect();\n this.action.setAction(Action.CIRCLE);\n\t\t} else if(sender.equals(this.ellipseButton)) {\n this.unSelect();\n this.action.setAction(Action.ELLIPSE);\n\t\t} else if(sender.equals(this.polylineButton)) {\n this.unSelect();\n this.action.setAction(Action.POLYLINE);\n } else if(sender.equals(this.textButton)) {\n this.unSelect();\n this.action.setAction(Action.TEXTBOX);\n } else if(sender.equals(this.strokeButton)) {\n this.showPopUpStroke();\n\t\t} else if(sender.equals(this.fill)) {\n this.showPopupColorFill(true);\n } else if(sender.equals(this.stroke)) {\n this.showPopupColorFill(false);\n }\n\t\t\n\t}",
"public void onButtonBPressed();",
"private void button1MouseClicked(MouseEvent e) {\n\t}",
"public void buttonPress(ActionEvent event) {\r\n Button clickedButton = (Button) event.getSource();\r\n String selectedButton = clickedButton.getId();\r\n System.out.print(selectedButton);\r\n \r\n // If the user correctly guesses the winning button\r\n if (correctButtonName.equals(selectedButton)) {\r\n \r\n //Displays a popup alerting the user that they won the game.\r\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\r\n alert.setTitle(\"You Win!\");\r\n alert.setHeaderText(\"Congratulations, you found the treasure!\");\r\n alert.setContentText(\"Would you like to play again?\");\r\n ButtonType okButton = new ButtonType(\"Play again\");\r\n ButtonType noThanksButton = new ButtonType(\"No Thanks!\");\r\n alert.getButtonTypes().setAll(okButton, noThanksButton);\r\n Optional<ButtonType> result = alert.showAndWait();\r\n \r\n //If the user selects \"Play again\" a new button will be randomly selected\r\n if (result.get() == okButton ){\r\n //Chooses a random button from the list of buttons\r\n correctButtonName = buttonList[(int)(Math.random() * buttonList.length)];\r\n }\r\n //If the user does not select \"Play again\", the application will be closed\r\n else {System.exit(0);}\r\n \r\n }\r\n \r\n //If the user chooses any button except for the winning button\r\n else if (!selectedButton.equals(correctButtonName)) {\r\n \r\n //Displays a popup alerting the user that they did not find the treasure.\r\n Alert alert2 = new Alert(Alert.AlertType.INFORMATION);\r\n alert2.setTitle(\"No treasure!\");\r\n alert2.setHeaderText(\"There was no treasure found on that island\");\r\n alert2.setContentText(\"Would you like to continue searching for treasure?\");\r\n ButtonType ayeCaptain = new ButtonType (\"Continue Searching\");\r\n ButtonType noCaptain = new ButtonType (\"Quit\");\r\n alert2.getButtonTypes().setAll(ayeCaptain,noCaptain);\r\n Optional<ButtonType> result2 = alert2.showAndWait();\r\n \r\n if (result2.get() == ayeCaptain){\r\n //The search for treasure continues!\r\n }\r\n else{ \r\n System.exit(0);\r\n }\r\n }\r\n }",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[0])){\n\t\t\tperformButton(0);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[1])){\n\t\t\tperformButton(1);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[2])){\n\t\t\tperformButton(2);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[3])){\n\t\t\tperformButton(3);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[4])){\n\t\t\tperformButton(4);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[5])){\n\t\t\tperformButton(5);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[6])){\n\t\t\tperformButton(6);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[7])){\n\t\t\tperformButton(7);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[8])){\n\t\t\tperformButton(8);\n\t\t}\n\t}",
"public void settingBtnClick() {\n\t}",
"@Override\n public void onClick(View view) {\n if (view == buttonChoose) {\n showFileChooser();\n }\n //if the clicked button is upload\n else if (view == buttonUpload)\n {\n\n\n\n uploadFile();\n\n\n }\n }",
"void buttonGo_actionPerformed(ActionEvent e) {\n\n\n }",
"void okButtonClicked();",
"public void onClickButton1(View view) {\n\n if (turn%2 == 0 && button1.getText()==\"·\"){\n button1.setText(\"O\");\n turn++;\n }\n else if (button1.getText()==\"·\"){\n button1.setText(\"X\");\n turn++;\n }\n\n }",
"void buttonPressed(ButtonType type);",
"@Override\n public void onClick(View view) {\n if (view == imageView) {\n showFileChooser();\n }\n //if the clicked button is upload\n else if (view == btnPost) {\n uploadFile();\n\n }\n }",
"@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\tif(e.getButton()==MouseEvent.BUTTON1)\n\t\t\t\t{\n\t\t\t\t\tif(Conf.isbegin==1)\n\t\t\t\t\t{\n\t\t\t\t\t\tConf.isbegin=0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tConf.isbegin=1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(e.getButton()==MouseEvent.BUTTON3)\n\t\t\t\t{\n\t\t\t\t\tif(Conf.isreplay==1)\t\n\t\t\t\t\t{\n\t\t\t\t\t\tConf.isreplay=0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tConf.isreplay=1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t\n\t\t\t}",
"public void onClickButton2(View view) {\n\n if (turn%2 == 0 && button2.getText()==\"·\"){\n button2.setText(\"O\");\n turn++;\n }\n else if (button2.getText()==\"·\"){\n button2.setText(\"X\");\n turn++;\n }\n\n }",
"@Override\n public void onClick(View view) {\n // Opens the next page (left)\n //=================================\n if (!leftIsEmpty) {\n Intent nextIntent = new Intent(GlobalPageActivity.this,GlobalPageActivity.class);\n nextIntent.putExtra(\"nextpage\", mThisPage.getNextLeft());\n nextIntent.putExtra(\"MyUserId\", iUserId);\n startActivity(nextIntent);\n finish();\n return;\n }\n\n //=================================\n // Edits the button (left) or\n // denies you access if being worked on\n //=================================\n if (mainIsEmpty){\n Toast.makeText(GlobalPageActivity.this, getResources().getString(R.string.draw_picture_first), Toast.LENGTH_SHORT).show();\n } else {\n if (!mThisPage.getLeftUser().equals(iUserId) && !mThisPage.getRightUser().equals(iUserId) && !mThisPage.getUser().equals(iUserId)) {\n createLeftDialog();\n } else {\n Toast.makeText(GlobalPageActivity.this, getResources().getString(R.string.done_something_already), Toast.LENGTH_SHORT).show();\n }\n }\n }",
"@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t\tif(arg0==button){\r\n\t\t\t\tbutton.setText(\"进入\");\r\n\t\t\t\tAnotherRightFragment frag = new AnotherRightFragment();\r\n\t\t\t\tFragmentManager manager = getFragmentManager();\r\n\t\t\t\tFragmentTransaction transaction = manager.beginTransaction();\r\n\t\t\t\ttransaction.replace(R.id.right_layout1, frag);\r\n\t\t\t\ttransaction.addToBackStack(null); //将碎片放入栈中\r\n\t\t\t\ttransaction.commit();\r\n\t\t\t}\r\n\t\t}",
"public void clickYes ();",
"@Override\n public void onClick(View whichbtn) {\n\n switch (whichbtn.getId()) {\n case R.id.bt_ssspp:\n intent.setClass(ShowBranchAndBound.this, BranchAndBoundSSSPPActivity.class);\n startActivity(intent);\n break;\n case R.id.bt_loading_prob:\n intent.setClass(ShowBranchAndBound.this, BranchAndBoundLoadingProbActivity.class);\n startActivity(intent);\n break;\n case R.id.bt_0and1k_pro:\n intent.setClass(ShowBranchAndBound.this, BranchAndBound0And1KProbActivity.class);\n startActivity(intent);\n break;\n }\n }",
"@Override\n\t\tpublic void onClick(View arg0) {\n\t\t\tbuttonToLeft.setImageDrawable(getResources().getDrawable(R.drawable.toleft1));\n\t\t\tbuttonToRight.setImageDrawable(getResources().getDrawable(R.drawable.toright));\n\t\t\taction.removeAllViews();\n\t\t\taction.addView(first);\n//\t\t\tshowInf = (TextView)findViewById(R.id.InfTextView);\n// \t\tshowInf.setText(\"您输入的选项为:\"+s);\n\t\t}",
"boolean getButtonRelease(Buttons but);",
"public void VerifyButtons(){\n if (currentTurn.getSiguiente() == null){\n next_turn.setEnabled(false);\n } else{\n next_turn.setEnabled(true);\n }\n if (currentTurn.getAnterior() == null){\n prev_turn.setEnabled(false);\n } else{\n prev_turn.setEnabled(true);\n }\n if (current.getSiguiente() == null){\n next_game.setEnabled(false);\n } else{\n next_game.setEnabled(true);\n }\n if (current.getAnterior() == null){\n prev_game.setEnabled(false);\n } else{\n prev_game.setEnabled(true);\n }\n }",
"@FXML\n private void handleButtonAction(MouseEvent event)\n {\n\n if(event.getTarget() == btn_bcconfig)\n {\n pane_bcconf.setVisible(false);\n pane_rtread.setVisible(false);\n gp_bc.setVisible(false);\n }\n else if (event.getTarget() == btn_bcread)\n {\n pane_bcconf.setVisible(true);\n pane_rtread.setVisible(false);\n if (cb_bcrt.isSelected() == true)\n {\n gp_bc.setVisible(true);\n }\n else\n {\n \t gp_bc.setVisible(false);\n }\n }\n else if (event.getTarget() == btn_rtread)\n {\n pane_bcconf.setVisible(false);\n pane_rtread.setVisible(true);\n }\n }",
"@Override\n\tprotected void on_button_pressed(String button_name) {\n\n\t}",
"@Override\n public void onClick(View v) {\n String checkBoulder = (String) completeBoulder.getText();\n // if button says \"Topped out!\"\n if (checkBoulder.equals(getResources().getString(R.string.topout_complete))){\n //do nothing\n }\n else {\n tries_title.setBackgroundColor(getResources().getColor(R.color.colorGreen));\n tries_title.setText(R.string.good_job);\n showTriesBox();\n }\n }",
"@Override\n public void onClick(View view) {\n Button trykket = null;\n for (int i = 0; i < 30 ; i++) {\n if (view==buttons.get(i)){\n trykket=buttons.get(i);\n }\n }\n assert trykket != null;\n gæt(trykket);\n\n //vi afslutter spiller hvis det er slut eller vundet.\n if(logik.erSpilletSlut()){\n if(logik.erSpilletTabt()){\n // die.start();\n slutspilllet(false);\n }\n if(logik.erSpilletVundet()) slutspilllet(true);\n }\n\n }",
"protected void mouseClicked(int par1, int par2, int par3)\n {\n if (this.buttonId >= 0)\n {\n \t// no setting minimap keybinds to mouse button. Can do so if wanted if I change ZanMinimap to not send every input to Keyboard for processing. Check if it's mouse first\n // this.options.setKeyBinding(this.buttonId, -100 + par3);\n // ((GuiButton)this.controlList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId);\n this.buttonId = -1;\n // KeyBinding.resetKeyBindingArrayAndHash();\n }\n else\n {\n super.mouseClicked(par1, par2, par3);\n }\n }",
"@Override\n public void onClick(View view) {\n // Opens the next page (right)\n //=================================\n if (!rightIsEmpty) {\n Intent nextIntent = new Intent(GlobalPageActivity.this,GlobalPageActivity.class);\n nextIntent.putExtra(\"nextpage\", mThisPage.getNextRight());\n nextIntent.putExtra(\"MyUserId\", iUserId);\n startActivity(nextIntent);\n finish();\n return;\n }\n\n //=================================\n // Edits the button (right) or\n // denies you access if being worked on\n //=================================\n if (mainIsEmpty){\n Toast.makeText(GlobalPageActivity.this, getResources().getString(R.string.draw_picture_first), Toast.LENGTH_SHORT).show();\n } else {\n if (!mThisPage.getLeftUser().equals(iUserId) && !mThisPage.getRightUser().equals(iUserId) && !mThisPage.getUser().equals(iUserId)) {\n createRightDialog();\n } else {\n Toast.makeText(GlobalPageActivity.this, getResources().getString(R.string.done_something_already), Toast.LENGTH_SHORT).show();\n }\n }\n }",
"void bsButtonHandling(){\n\n Boolean checkFlag = false;\n for(int i = 0; i < 4; ++i){\n if(operatorButtonClicked[i]){\n checkFlag = true;\n break;\n }\n }\n\n // -----------------------------------------------------\n // if an operator button was clicked then ignore BS\n if(checkFlag == false){\n numberOnDisplay = Integer.parseInt(display.getText().toString());\n numberOnDisplay = numberOnDisplay/10;\n display.setText(Integer.toString(numberOnDisplay));\n numberOnDisplay = 0;\n }\n }",
"public boolean isClicked() {\n\n// Cycles through all menu cursors\n for (MenuCursor cursor : Main.cursors) {\n\n// If the cursor has a controller and the select button is clicked, return true\n if (cursor.controller != null) {\n if (Main.contains(Main.recentButtons.get(cursor.controller), ControllerButtons.A)) {\n if (isCursorOver(cursor)) {\n this.cursor = cursor;\n return true;\n }\n }\n\n// Otherwise, if the cursor is using a keyboard and the select button is pressed, return true\n } else {\n if (Gdx.input.isKeyJustPressed(Keys.MENU_SELECT)) {\n if (isCursorOver(cursor)) {\n this.cursor = cursor;\n return true;\n }\n }\n }\n }\n// If none of these events occur, return false\n return false;\n }",
"protected abstract void pressedOKButton( );",
"@Override\npublic void actionPerformed(ActionEvent arg0) {\n\t if (arg0.getSource() == btNewClient){\n\t\t\n\t }\n\t if (arg0.getSource() == btEdit){\n\t \n\t }\n\t\n}",
"@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int button) {\n\t\t\t}",
"public void ButtonStatusToOneWay() throws InterruptedException {\n\n Thread.sleep(10000);\n //action=new Actions(this.driver);\n if (oneWayButton.isSelected()) {\n System.out.println(\"One way Button is already selected\");\n } else {\n wait.until(ExpectedConditions.elementSelectionStateToBe(oneWayButton,false));\n oneWayButton.click();\n System.out.println(\"one way button is clicked\");\n }\n\n\n }",
"public void onClick(DialogInterface arg0, int arg1) {\r\n\t\t\t\tStaticStore.LogPrinter('i',\"StaticStore.isSearchAndRegister On Cancel ==> \"+StaticStore.isSearchAndRegister);\r\n\t\t\t\tStaticStore.isSearchAndRegister = true;\r\n\t\t\t\tStaticStore.menuDesc[82][7] = \"\";\r\n\t\t\t\tStaticStore.index = 139;\r\n\t\t\t\tStaticStore.FromListScreen = false;\r\n\t\t\t\tStaticStore.midlet.startFragment(getActivity(),new Intent(getActivity(),\r\n\t\t\t\t\t\tDynamicCanvas.class));\t\r\n\t\t\t\targ0.dismiss();\r\n\t\t\t}",
"protected abstract boolean onOkClicked();",
"private void checkButton(ActionEvent e) {\n List<PuzzleButton> selectedButtons = buttons.stream()\n .filter(PuzzleButton::isSelectedButton)\n .collect(Collectors.toList());\n PuzzleButton currentButton = (PuzzleButton) e.getSource();// getting current button\n currentButton.setSelectedButton(true);\n int currentButtonIndex = buttons.indexOf(currentButton);\n //if no button are selected, do not update collection of PuzzleButton\n if (selectedButtons.size() == 1) {\n int lastClickedButtonIndex = 0;\n\n for (PuzzleButton button : buttons) {\n if (button.isSelectedButton() && !button.equals(currentButton)) {\n lastClickedButtonIndex = buttons.indexOf(button);\n }\n }\n Collections.swap(buttons, lastClickedButtonIndex, currentButtonIndex);\n updateButtons();\n }\n }",
"private void buttonEventClicked(MouseEvent evt) {\n if (!frameSearch.getTpDataBase().getTbBaseDate().getSelectionModel().isSelectionEmpty()) {\n String aux = frameSearch.getTpDataBase().getTbBaseDate().getModel().getValueAt(frameSearch.getTpDataBase().getTbBaseDate().getSelectedRow(), 0).toString();\n int aux2 = Integer.parseInt(aux);\n frameSearch.getPnSearch().getTxLocation().setText(cm.get(aux2).getPath());\n frameSearch.getPnSearch().getTxtOwner().setText(cm.get(aux2).getOwner());\n frameSearch.getPnSearch().getTxSearch().setText(cm.get(aux2).getFileName());\n frameSearch.getPnSearch().getChFolder().setSelected(cm.get(aux2).isFolder());\n if (cm.get(aux2).isKeySensitive()) {\n frameSearch.getPnSearch().getChKeySensitive().setSelected(false);\n } else {\n frameSearch.getPnSearch().getChKeySensitive().setSelected(true);\n }\n\n frameSearch.getPnSearch().getChFileHidden().setSelected(cm.get(aux2).isHidden());\n frameSearch.getPnSearch().getChReadOnly().setSelected(cm.get(aux2).isReadOnly());\n frameSearch.getPnSearch().getChContent().setSelected(cm.get(aux2).isCheckContent());\n frameSearch.getPnSearch().getChOwner().setSelected(cm.get(aux2).isCheckOwner());\n frameSearch.getPnSearch().getTxtContent().setText(cm.get(aux2).getContent());\n this.setExtencion(cm.get(aux2).getExtencionAux());\n frameSearch.getPnSearch().getChSearchText().setSelected(cm.get(aux2).isExtensionEnable());\n frameSearch.getPnAdvanced().getChFechas().setSelected(cm.get(aux2).isCheckMod());\n frameSearch.getPnAdvanced().getChCreation().setSelected(cm.get(aux2).isCheckCre());\n frameSearch.getPnAdvanced().getChAccess().setSelected(cm.get(aux2).isChecAccess());\n this.setSelectedDates(cm.get(aux2).getIniModFile(), cm.get(aux2).getFinModFile(), cm.get(aux2).getIniAccessFile(), cm.get(aux2).getFinAccessFile(),\n cm.get(aux2).getIniCreationFile(), cm.get(aux2).getFinCreationFile());\n frameSearch.getPnAdvanced().getJcbSize().setSelectedIndex(this.setSelectedValue(frameSearch.getPnAdvanced().getJcbSize(), cm.get(aux2).getTypeSize()));\n frameSearch.getPnAdvanced().getCbSize().setSelectedIndex(this.setSelectedValue(frameSearch.getPnAdvanced().getCbSize(), cm.get(aux2).getSignSize()));\n frameSearch.getPnAdvanced().getTxSize().setText(String.valueOf(cm.get(aux2).getSize()));\n frameSearch.getPnAdvanced().getChsSize().setSelected(cm.get(aux2).isCheckSize());\n frameSearch.getPnAdvanced().getChAttributes().setSelected(cm.get(aux2).isCheckMulti());\n frameSearch.getPnAdvanced().getChTerm().setSelected(cm.get(aux2).isCheckDuration());\n frameSearch.getPnAdvanced().getJcbSizeDuration().setSelectedIndex(this.setSelectedValue(frameSearch.getPnAdvanced().getJcbSizeDuration(), cm.get(aux2).getOperator()));\n frameSearch.getPnAdvanced().getCbTerm().setSelectedIndex(this.setSelectedValue(frameSearch.getPnAdvanced().getCbTerm(), cm.get(aux2).getScale()));\n frameSearch.getPnAdvanced().getTxTerm().setText(String.valueOf(cm.get(aux2).getCantMulti()));\n this.setExtencionMulti(cm.get(aux2).getFormatsMulti());\n frameSearch.getPnAdvanced().getCbFrameRate().setSelectedIndex(this.setSelectedValue(frameSearch.getPnAdvanced().getCbFrameRate(), cm.get(aux2).getFrameRate()));\n frameSearch.getPnAdvanced().getCbVideoCode().setSelectedIndex(this.setSelectedValue(frameSearch.getPnAdvanced().getCbVideoCode(), cm.get(aux2).getVideoCode()));\n frameSearch.getPnAdvanced().getCbResolution().setSelectedIndex(this.setSelectedValue(frameSearch.getPnAdvanced().getCbResolution(), cm.get(aux2).getResolution()));\n frameSearch.getTpDataBase().getTxBdata().setText(cm.get(aux2).getNameOwnwe());\n }\n }",
"public void actionPerformed(ActionEvent e) {\n // Ask the event which button was the source that generated it\n if (e.getActionCommand().equals(\"Press Me\"))\n System.out.println(\"That felt good!\");\n else\n System.out.println(\"Ouch! Stop that!\");\n }",
"@Override\r\n\tpublic void onClick(View v) {\n\t\tint id = v.getId();\r\n\t\tif (R.id.leave_date == id || R.id.back_date == id) {\r\n\t\t\tshowDatePicker(id);\r\n\t\t} else if (R.id.submit_btn == id) {\r\n\t\t\tsubmit();\r\n\t\t}\r\n\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tJButton source = (JButton) e.getSource();\r\n\t\tif (source.equals(btn_them)) {\r\n\t\t\tclickThem = true;\r\n\t\t\tdisablePanelInput();\r\n\t\t\tlbl_status.setText(\"Clicked Button Them\");\r\n\t\t} else if (source.equals(btn_nhap)) {\r\n\t\t\tclickThem = false;\r\n\t\t\tSinhVien mSinhVien = new SinhVien(txt_mssv.getText(),\r\n\t\t\t\t\ttxt_hoten.getText(), (String) comboSex.getSelectedItem(),\r\n\t\t\t\t\t(Date) txt_ntns.getValue());\r\n\t\t\tif (mSinhViens.contains(mSinhVien)) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null,\r\n\t\t\t\t\t\t\"Không thể lưu 2 sinh viên có cùng MSSV\",\r\n\t\t\t\t\t\t\"Lỗi nhập dữ liệu\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t\tmSinhViens.add(mSinhVien);\r\n\t\t\trefreshTable();\r\n\t\t\tdisablePanelInput();\r\n\t\t\tlbl_status.setText(\"Clicked Button Nhap\");\r\n\t\t} else if (source.equals(btn_sapxep)) {\r\n\t\t\tif (list_sort.getSelectedIndex() == 0) { // sap xep theo MSSV\r\n\t\t\t\tTreeSet<SinhVien> temp = new TreeSet<SinhVien>(\r\n\t\t\t\t\t\tnew MssvComperator());\r\n\t\t\t\ttemp.addAll(mSinhViens);\r\n\t\t\t\tmSinhViens = temp;\r\n\t\t\t\trefreshTable();\r\n\t\t\t\tlbl_status.setText(\"Sap xep theo MSSV\");\r\n\t\t\t} else if (list_sort.getSelectedIndex() == 1) { // sap xep theo Ho\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Ten\r\n\t\t\t\tTreeSet<SinhVien> temp = new TreeSet<SinhVien>(\r\n\t\t\t\t\t\tnew HoTenComperator());\r\n\t\t\t\ttemp.addAll(mSinhViens);\r\n\t\t\t\tmSinhViens = temp;\r\n\t\t\t\trefreshTable();\r\n\t\t\t\tlbl_status.setText(\"Sap xep theo Ho Ten\");\r\n\t\t\t} else {\r\n\t\t\t\tTreeSet<SinhVien> temp = new TreeSet<SinhVien>(\r\n\t\t\t\t\t\tnew NTNSComperator());\r\n\t\t\t\ttemp.addAll(mSinhViens);\r\n\t\t\t\tmSinhViens = temp;\r\n\t\t\t\trefreshTable();\r\n\t\t\t\tlbl_status.setText(\"Sap xep theo NTNS\");\r\n\t\t\t}\r\n\t\t} else if (source.equals(btn_save)) {\r\n\r\n\t\t\tint reValue = fc.showSaveDialog(GUI2.this);\r\n\t\t\tif (reValue == JFileChooser.APPROVE_OPTION) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tFile f = fc.getSelectedFile();\r\n\t\t\t\t\tObjectOutputStream os = new ObjectOutputStream(\r\n\t\t\t\t\t\t\tnew BufferedOutputStream(new FileOutputStream(f)));\r\n\t\t\t\t\tos.writeObject(mSinhViens);\r\n\t\t\t\t\tos.flush();\r\n\t\t\t\t\tos.close();\r\n\t\t\t\t\tlbl_status.setText(\"Saved\");\r\n\t\t\t\t} catch (Exception e2) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\te2.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (source.equals(btn_load)) {\r\n\t\t\tint reValue = fc.showOpenDialog(GUI2.this);\r\n\t\t\tif (reValue == JFileChooser.APPROVE_OPTION) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tFile f = fc.getSelectedFile();\r\n\t\t\t\t\tObjectInputStream ois = new ObjectInputStream(\r\n\t\t\t\t\t\t\tnew BufferedInputStream(new FileInputStream(f)));\r\n\t\t\t\t\tmSinhViens = (TreeSet<SinhVien>) ois.readObject();\r\n\t\t\t\t\tois.close();\r\n\t\t\t\t\trefreshTable();\r\n\t\t\t\t\tlbl_status.setText(\"Loaded\");\r\n\t\t\t\t} catch (Exception e2) {\r\n\t\t\t\t\te2.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (source.equals(btn_xoa)) {\r\n\t\t\tint[] index = mTable.getSelectedRows();\r\n\t\t\tStringBuilder mBuilder = new StringBuilder();\r\n\t\t\tDefaultTableModel mModel = (DefaultTableModel) mTable.getModel();\r\n\t\t\tfor (int i : index) {\r\n\t\t\t\t/*\r\n\t\t\t\t * mBuilder.append(i + \",\"); String mssv = (String)\r\n\t\t\t\t * mModel.getValueAt(i, 0); String hoten = (String)\r\n\t\t\t\t * mModel.getValueAt(i, 1); String gioitinh = (String)\r\n\t\t\t\t * mModel.getValueAt(i, 2); Date ntns = (Date)\r\n\t\t\t\t * mModel.getValueAt(i, 3); mSinhViens.remove(new SinhVien(mssv,\r\n\t\t\t\t * hoten, gioitinh, ntns));\r\n\t\t\t\t */\r\n\t\t\t\tIterator<SinhVien> it = mSinhViens.iterator();\r\n\t\t\t\tint j = 0;\r\n\t\t\t\twhile (j < i) {\r\n\t\t\t\t\tit.next();\r\n\t\t\t\t\tj++;\r\n\t\t\t\t}\r\n\t\t\t\tit.remove();\r\n\t\t\t}\r\n\t\t\trefreshTable();\r\n\t\t\tlbl_status.setText(\"Xoa cac dong : \" + mBuilder.toString());\r\n\t\t}\r\n\t}",
"protected abstract boolean up(int button);",
"@Override\n\t\t\t\tpublic void onClick(DialogInterface p1, int p2)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t}",
"@Override\n\t\t\t\tpublic void onClick(DialogInterface dialog, int button) {\n\t\t\t\t}",
"@Override\n public void actionPerformed(ActionEvent e) {\n Object o = e.getSource();\n if (o == add) {\n btn_Add.doClick();\n }\n if (o == details) {\n btn_Details.doClick();\n }\n if (o == edit) {\n btn_Edit.doClick();\n }\n if (o == delete) {\n btn_Delete.doClick();\n }\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\n\t\t\t\toptb=btnoptb.getText().toString();\n\t\t\t\tCheckAns(optb,currentPosition);\n\t\t\t\t//Log.e(\"ans\", optb);\n\n\t\t\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t\tJButton orange = (JButton) e.getSource();\n\n\t\tif (orange == buttonOne) {\n\n\t\t\tshowDucks();\n\n\t\t} else if (orange == buttonTwo) {\n\n\t\t\tshowFrog();\n\n\t\t} else if (orange == buttonThree) {\n\n\t\t\tshowFluffyUnicorns();\n\n\t\t}\n\n\t}",
"@Override\r\n\t\t\t public void onClick(View v) {\n\t\t\t\t bFlagZhaopin = !bFlagZhaopin;\r\n\t\t\t\t zhaopin_btn.setChecked(bFlagZhaopin);\r\n\t\t\t }",
"@Override\n public void onClick(View v) {\n if (one.isChecked()){\n scoreCounter += 1 ;\n }\n buttonSubmit ();\n }",
"@Override\n\t\tpublic void onClick(View arg0) {\n\t\t\tswitch (arg0.getId()) {\n\n\t\t\tcase R.id.iv_title_left:// 返回\n\t\t\t\tCustomApplication.app\n\t\t\t\t\t\t.finishActivity(LessonFlashCardOpActivity.this);\n\t\t\t\tbreak;\n\n\t\t\tcase R.id.iv_title_right://\n\t\t\t\tshowPopupWindowMenu();\n\t\t\t\tbreak;\n\n\t\t\tcase R.id.btn_remember:\n\t\t\t\tlin_is_gorget.setVisibility(View.GONE);\n\t\t\t\tlin_remember_level.setVisibility(View.VISIBLE);\n\t\t\t\tlin_forgot_level.setVisibility(View.GONE);\n\t\t\t\tbreak;\n\n\t\t\tcase R.id.btn_forget:\n\t\t\t\tlin_is_gorget.setVisibility(View.GONE);\n\t\t\t\tlin_remember_level.setVisibility(View.GONE);\n\t\t\t\tlin_forgot_level.setVisibility(View.VISIBLE);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"private void devBtnActionPerformed(ActionEvent evt) {\n }",
"@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tToast.makeText(getApplicationContext(), \"Button 1\", Toast.LENGTH_SHORT).show();\n\t\t\t}",
"@Override\n public void actionPerformed(ActionEvent e) {\n\n Object clicked = e.getSource();\n\n if (clicked == next_turn){\n NextTurn();\n }\n if (clicked == next_game){\n NextGame();\n }\n if (clicked == go_back){\n GoBack();\n }\n if (clicked == prev_game){\n PrevGame();\n }\n if (clicked == prev_turn){\n PrevTurn();\n }\n }",
"@Override\n\tpublic void LeftButtonClick() {\n\t\t\n\t}",
"protected boolean hasPositiveButton() {\n return false;\n }",
"private void doButtons()\n {\n if (scopes.size()>1) addButtons();\n else hideButtons();\n }",
"@Override\n\tpublic void RightButtonClick() {\n\t\t\n\t}",
"@Override\n\tpublic void RightButtonClick() {\n\t\t\n\t}",
"public void onClick(View arg0) {\n\t\tboolean isSTART = false;\n\t\tButton stopBtn = null;\n\t\tint command = 0;\n\t\tif (arg0.getId() == mBtn1Start.getId()) {\t\t\t\n\t\t\tcommand = TEST_SE0_NAK;\n\t\t\tisSTART = true;\n\t\t\tstopBtn = mBtn1Stop;\n\t\t} else if (arg0.getId() == mBtn2Start.getId()) {\n\t\t\tcommand = TEST_J;\n\t\t\tisSTART = true;\n\t\t\tstopBtn = mBtn2Stop;\n\t\t}else if (arg0.getId() == mBtn3Start.getId()) {\n\t\t\tcommand = TEST_K;\n\t\t\tisSTART = true;\n\t\t\tstopBtn = mBtn3Stop;\n\t\t}else if (arg0.getId() == mBtn4Start.getId()) {\n\t\t\tcommand = TEST_PACKET;\n\t\t\tisSTART = true;\n\t\t\tstopBtn = mBtn4Stop;\n\t\t}else if (arg0.getId() == mBtn5Start.getId()) {\n\t\t\tcommand = SUSPEND_RESUME;\n\t\t\tisSTART = true;\n\t\t\tstopBtn = mBtn5Stop;\n\t\t}else if (arg0.getId() == mBtn6Start.getId()) {\n\t\t\tcommand = GET_DESCRIPTOR;\n\t\t\tisSTART = true;\n\t\t\tstopBtn = mBtn6Stop;\n\t\t}else if (arg0.getId() == mBtn7Start.getId()) {\n\t\t\tcommand = SET_FEATURE;\n\t\t\tisSTART = true;\n\t\t\tstopBtn = mBtn7Stop;\n\t\t}\n\t\t\n\t\telse if (arg0.getId() == mBtn1Stop.getId()) {\t\t\t\t\n\t\t\tcommand = TEST_SE0_NAK;\n\t\t\tisSTART = false;\n\t\t} else if (arg0.getId() == mBtn2Stop.getId()) {\n\t\t\tcommand = TEST_J;\n\t\t\tisSTART = false;\n\t\t}else if (arg0.getId() == mBtn3Stop.getId()) {\n\t\t\tcommand = TEST_K;\n\t\t\tisSTART = false;\n\t\t}else if (arg0.getId() == mBtn4Stop.getId()) {\n\t\t\tcommand = TEST_PACKET;\n\t\t\tisSTART = false;\n\t\t}else if (arg0.getId() == mBtn5Stop.getId()) {\n\t\t\tcommand = SUSPEND_RESUME;\n\t\t\tisSTART = false;\n\t\t}else if (arg0.getId() == mBtn6Stop.getId()) {\n\t\t\tcommand = GET_DESCRIPTOR;\n\t\t\tisSTART = false;\n\t\t}else if (arg0.getId() == mBtn7Stop.getId()) {\n\t\t\tcommand = SET_FEATURE;\n\t\t\tisSTART = false;\n\t\t}\n\t\telse{\n\t\t\tShowDialog(\"Error\", \"Unknown button is pressed.\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(isSTART)\n\t\t{\n\t\t\tif(task != null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tTaskThread thr = new TaskThread();\n\t\t\tthr.setParam(command);\n\t\t\tthr.start();\n\t\t\t\n\t\t\tmakeOneBtnEnable(stopBtn);\n\t\t\ttask = new TaskRunnable();\n\t\t\ttask.start();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(task != null)\n\t\t\t{\t\t\n\t\t\t\ttask.mRun = false;\t\t\t\t\t\n\t\t\t\tif(!UsbIF.NativeStopTest(command))\n\t\t\t\t{\n\t\t\t\t\tShowDialog(\"Error\", \"NativeStopTest Fail.\");\n\t\t\t\t\tUsbIF.NativeCleanMsg();\n\t\t\t\t}\t\t\t\t\n\t\t\t\ttask = null;\t\n\t\t\t\tupdateAllBtn(true);\n\t\t\t}\n\t\t}\n\t}",
"public void onClick(View v) {\r\n if (v == cv_clean) {\r\n CleanInputs();\r\n }else if(v == btn_back){\r\n BackToMenu();\r\n }else if(v == cv_scan){\r\n ScanWarehouse();\r\n }else if(v == cv_send){\r\n SendDataBarcode();\r\n }\r\n }",
"private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {\n }",
"private void button1MouseClicked(MouseEvent e) {\n }",
"@Override\n\t\t\t\t\tpublic void onClick(DialogInterface p1, int p2)\n\t\t\t\t\t{\n\n\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onClick(DialogInterface p1, int p2)\n\t\t\t\t\t{\n\n\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onClick(DialogInterface p1, int p2)\n\t\t\t\t\t{\n\n\t\t\t\t\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t\tif (e.getSource() == b1) {\n\n\t\t\tJOptionPane.showMessageDialog(null, \"why did the chicken cross the road?\");\n\t\t\tb2.setEnabled(true);\n\t\t\tb1.setOpaque(false);\n\t\t\tb2.setBackground(Color.GREEN);\n\t\t\t\n\t\t\t\n\t\t} else if (e.getSource() == b2) {\n\t\t\t\n\t\t\tJOptionPane.showMessageDialog(null, \"to get to the other side\");\n\t\t\tb2.setOpaque(false);\n\t\t\t\n\t\t}\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\tsecuencia = button.getSecuencia();\r\n\t\tporcentaje = Float.parseFloat(button.getPorcentaje().getText());\r\n\t\tcorrect = false;\r\n\t\tif (button.getTypeN().isSelected()) {\r\n\t\t\ttype = 'n';\r\n\t\t} else {\r\n\t\t\ttype = 'p';\r\n\t\t}\r\n\r\n\t\twhile (correct) {\r\n\t\t\tif (button.getSecuencia() == null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tbutton.getResult().setText(\"No se ha introducido una secuencia\");\r\n\t\t\t\t\tcorrect = false;\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tSystem.out.print(\"Error en la pantalla: \" + e.toString());\r\n\t\t\t\t}\r\n\t\t\t} else if (button.getPorcentaje().getText() == null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tbutton.getResult().setText(\"No se ha introducido el porcentaje\");\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tSystem.out.print(\"Error en la pantalla: \" + e.toString());\r\n\t\t\t\t\tcorrect = false;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tcorrect = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!correct) {\r\n\t\t\tBlastController bCnt = new BlastController();\r\n\t\t\ttry {\r\n\t\t\t\tString result = bCnt.blastQuery(type, dataBaseFile, dataBaseIndexes, (float) porcentaje, secuencia);\r\n\t\t\t\tbutton.printResult(result);\r\n\t\t\t} catch (Exception exc) {\r\n\t\t\t\tSystem.out.println(\"Error en la llamada: \" + exc.toString());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"@Override\n public void actionPerformed(ActionEvent e) {\n CheckOperation(calButtons.super.getText());\n }",
"@Override\n\t\tpublic void onClick(Widget sender) {\n\t\t\t\n\t\t}",
"void onUpOrBackClick();",
"private void clickOn() {\n\t\tll_returnbtn.setOnClickListener(new OnClickListener() {\n\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\tfinish();\n\t\t\t}\n\t\t});\n\t}",
"public abstract void onRightButtonClick();",
"public void buttonShowIncomplete(ActionEvent actionEvent) {\n }",
"private void afegirButtonPressed(){\n Toaster toaster = new Toaster(getContext());\n if(Afegir.getCurrentTextColor() == ResourcesCompat.getColor(getResources(), R.color.solidGray, null))\n //Cas d'error: es preten referenciar a una definició inexistent.\n toaster.standardToast(getText(R.string.err_equ_not_match).toString());\n\n else if(WordText.getText().toString().isEmpty() ||\n TranText.getText().toString().isEmpty() ||\n Categories.getText().toString().isEmpty() ||\n (Equival.isChecked() &&\n (!(EquWord.isChecked() || EquTran.isChecked()) ||\n InfoText.getText().toString().isEmpty()))){\n\n //Cas d'error: no poden ser buits, ja que la base de dades ho requereix axi.\n toaster.standardToast(getText(R.string.err_empty_elements).toString());\n }\n\n else insertOrUpdateItem();\n }",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\nif(e.getSource().equals(buttonOne)){\n\t\tplaySound(\"27137__zippi1__fart4.wav\");\n\t\t\n}else if(e.getSource().equals(buttonTwo)){\n\tplaySound(\"61047__timtube__fart.wav\");\n\t\n}\n\t\t\n\t}",
"public void onClick(View v) {\r\n if (b1.isPressed()) {\r\n Intent j = new Intent(getApplicationContext(), MainActivity.class);\r\n startActivity(j);\r\n setContentView(R.layout.activity_main);\r\n }\r\n\r\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\n\t\t\t\topta=btnopta.getText().toString();\n\t\t\t\tCheckAns(opta,currentPosition);\n\t\t\t\t \n\n\t\t\t}",
"public void onClicked();",
"@Override\r\n public void onClick(View v) {\n switch (v.getId()) {\r\n case R.id.btn_u_one:\r\n startTest(ONE);\r\n break;\r\n case R.id.btn_u_two:\r\n startTest(TWO);\r\n break;\r\n }\r\n }",
"@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tms.start();\n\t\t\t\tbutton3.setText(R.string.Value3);\n\t\t\t\tif(second){\n\t\t\t\t\tif(prev==2){\n\t\t\t\t\t\ttext = \"Match!\";\n\t\t\t\t\t\tcontext = getApplicationContext(); \n\t\t\t\t\t\ttoast = Toast.makeText(context, text, duration) ;\n\t\t\t\t\t\ttoast.show();\n\t\t\t\t\t\tsecond = false;\n\t\t\t\t\t\tcountScr++;\n\t\t\t\t\t\t//score.setText(\"SCORE: \"+score);\n\t\t\t\t\t\t//if(countScr>countHgh)highscore.setText(\"HIGHSCORE: \"+ countHgh);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tsecond = false;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tsecond = true;\n\t\t\t\t\tprev = 3;\n\t\t\t\t}\n\t\t\t}",
"@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tSystem.out.println(e.getSource());\n\t\t\tif(e.getSource() == Jbutton1) {\n\t\t\t\tCuteness.showDucks();\n\t\t\t\tSystem.out.println(\"Hi\");\n\t\t\t}\n\t\t\telse if(e.getSource() == Jbutton2) {\n\t\t\t\tCuteness.showFrog();\n\t\t\t\tSystem.out.println(\"Hi\");\n\t\t\t}\n\t\t\telse if(e.getSource() == Jbutton3) {\n\t\t\t\tCuteness.showFluffyUnicorns();\n\t\t\t}\n\t\t\t\n\t\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tbutton1.setText(R.string.Value1);\n\t\t\t\tms.start();\n\t\t\t\tif(second){\n\t\t\t\t\tif(prev==4){\n\t\t\t\t\t\ttext = \"Match!\";\n\t\t\t\t\t\tcontext = getApplicationContext(); \n\t\t\t\t\t\ttoast = Toast.makeText(context, text, duration) ;\n\t\t\t\t\t\ttoast.show();\n\t\t\t\t\t\tsecond = false;\n\t\t\t\t\t\tcountScr++;\n\t\t\t\t\t\t//score.setText(\"SCORE: \"+score);\n\t\t\t\t\t\t//if(countScr>countHgh)highscore.setText(\"HIGHSCORE: \"+ countHgh);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tsecond = false;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t//button1.setText(R.string.Value1);\n\t\t\t\t\tsecond = true;\n\t\t\t\t\tprev = 1;\n\t\t\t\t}\n\t\t\t}",
"private void designBtnActionPerformed(ActionEvent evt) {\n }"
] | [
"0.7212542",
"0.6926875",
"0.68205893",
"0.6746623",
"0.67157936",
"0.6713803",
"0.67041796",
"0.66067183",
"0.65448713",
"0.65364635",
"0.6516568",
"0.65120006",
"0.64994454",
"0.6498072",
"0.64976025",
"0.64750713",
"0.64721894",
"0.6464272",
"0.64462376",
"0.64436966",
"0.6424911",
"0.64242023",
"0.64063984",
"0.6404551",
"0.63970596",
"0.6391379",
"0.6390611",
"0.6387897",
"0.63876724",
"0.638246",
"0.63821644",
"0.63764536",
"0.63646185",
"0.6361738",
"0.63561344",
"0.63521796",
"0.6343586",
"0.63422763",
"0.63361967",
"0.6325422",
"0.6319416",
"0.63122386",
"0.6311101",
"0.6309027",
"0.6307082",
"0.6306289",
"0.63030887",
"0.63021517",
"0.6301219",
"0.6300213",
"0.628948",
"0.62824553",
"0.627966",
"0.62768805",
"0.6258919",
"0.6258175",
"0.6254368",
"0.62500894",
"0.6248571",
"0.6242385",
"0.62384665",
"0.6238312",
"0.6233999",
"0.62331665",
"0.62306285",
"0.62286645",
"0.6220928",
"0.6220201",
"0.6210063",
"0.62095875",
"0.620535",
"0.620535",
"0.6203418",
"0.6200917",
"0.619686",
"0.61944073",
"0.6192318",
"0.6192318",
"0.6192318",
"0.61859334",
"0.61831355",
"0.618006",
"0.61773187",
"0.61758345",
"0.61747575",
"0.6169222",
"0.61677474",
"0.61624515",
"0.616158",
"0.61612767",
"0.61597383",
"0.6157001",
"0.6151573",
"0.61493355",
"0.61488146",
"0.61488146",
"0.61488146",
"0.6146929",
"0.6145096",
"0.61443156",
"0.61423177"
] | 0.0 | -1 |
//////////////////////////////////////// Decides what ai does. Theres a few patterns that help ai win mostly for when ai goes first. //////////////////////////////////////// if ai cant win. it sets pattern 20 which if it can win it wins if person can win it blocks it. //////////////////////////////////////// or else it puts down a random legal move. I think its unbeatable i havent been able to beat it yet. | public void AiChoice(){
/*
int [][]box;
for (int x=0; x<3; x++) {
for (int y=0; y<3; y++) {
box[x][y]=buttons[x][y].getValue();
}
}
*/
// message.setText(Integer.toString(clicks));
// clicks++;
// message.setText(Integer.toString(clicks));
//////////////////////////////////////patterns
if(clicks==1) {
pattern = 1;
buttons[0][0].setText("O");
buttons[0][0].setForeground(Color.black);
buttons[0][0].setValue(1);
buttons[0][0].setState(true);
return;
}
if(clicks==2) {
if (buttons[1][1].getValue()==0) {
buttons[1][1].setText("O");
buttons[1][1].setForeground(Color.black);
buttons[1][1].setValue(1);
buttons[1][1].setState(true);
pattern = 20;
}
else {
buttons[0][0].setText("O");
buttons[0][0].setForeground(Color.black);
buttons[0][0].setValue(1);
buttons[0][0].setState(true);
pattern = 20;
}
return;
}
if(pattern == 1) {
if (buttons[0][1].getValue()==-1 || buttons[0][1].getValue()==-1) {
buttons[1][1].setText("O");
buttons[1][1].setForeground(Color.black);
buttons[1][1].setValue(1);
buttons[1][1].setState(true);
pattern = 3;
}
else if(buttons[2][2].getValue()==0) {
buttons[2][2].setText("O");
buttons[2][2].setForeground(Color.black);
buttons[2][2].setValue(1);
buttons[2][2].setState(true);
pattern = 5;
}
else {
buttons[2][0].setText("O");
buttons[2][0].setForeground(Color.black);
buttons[2][0].setValue(1);
buttons[2][0].setState(true);
pattern=4;
}
return;
}
if(pattern == 3) {
if(buttons[2][2].getValue()==0) {
buttons[2][2].setText("O");
buttons[2][2].setForeground(Color.black); ////win
buttons[2][2].setValue(1);
buttons[2][2].setState(true);
}
if (buttons[0][1].getValue()==-1) {
buttons[2][0].setText("O");
buttons[2][0].setForeground(Color.black);
buttons[2][0].setValue(1);
buttons[2][0].setState(true);
pattern=6;
}
else {
buttons[0][2].setText("O");
buttons[0][2].setForeground(Color.black);
buttons[0][2].setValue(1);
buttons[0][2].setState(true);
pattern = 7;
}
return;
}
if(pattern == 6) {
if (buttons[1][0].getValue()==0) {
buttons[1][0].setText("O");
buttons[1][0].setForeground(Color.black); /////Win
buttons[1][0].setValue(1);
buttons[1][0].setState(true);
}
else {
buttons[0][2].setText("O");
buttons[0][2].setForeground(Color.black); /////Win
buttons[0][2].setValue(1);
buttons[0][2].setState(true);
}
return;
}
if(pattern == 7) {
if (buttons[2][0].getValue()==0) {
buttons[2][0].setText("O");
buttons[2][0].setForeground(Color.black); /////Win
buttons[2][0].setValue(1);
buttons[2][0].setState(true);
}
else {
buttons[0][1].setText("O");
buttons[0][1].setForeground(Color.black); /////Win
buttons[0][1].setValue(1);
buttons[0][1].setState(true);
}
return;
}
if(pattern == 4) {
if (buttons[1][0].getValue()==0) {
buttons[1][0].setText("O");
buttons[1][0].setForeground(Color.black); /////Win
buttons[1][0].setValue(1);
buttons[1][0].setState(true);
}
else {
buttons[0][2].setText("O");
buttons[0][2].setForeground(Color.black);
buttons[0][2].setValue(1);
buttons[0][2].setState(true);
pattern = 8;
}
return;
}
if(pattern == 8) {
if (buttons[1][1].getValue()==0) {
buttons[1][1].setText("O");
buttons[1][1].setForeground(Color.black); /////Win
buttons[1][1].setValue(1);
buttons[1][1].setState(true);
}
else {
buttons[0][1].setText("O");
buttons[0][1].setForeground(Color.black); /////Win
buttons[0][1].setValue(1);
buttons[0][1].setState(true);
}
return;
}
if(pattern == 5) {
if (buttons[1][0].getValue()==-1 || buttons[0][1].getValue()==-1 || buttons[1][2].getValue()==-1 || buttons[2][1].getValue()==-1 ) {
pattern=20;
}
else if(buttons[0][2].getValue()==0) {
buttons[0][2].setText("O");
buttons[0][2].setForeground(Color.black);
buttons[0][2].setValue(1);
buttons[0][2].setState(true);
pattern = 20;
return;
}
else {
buttons[2][0].setText("O");
buttons[2][0].setForeground(Color.black);
buttons[2][0].setValue(1);
buttons[2][0].setState(true);
pattern = 20;
return;
}
}
if(pattern == 20) {
int randx=0,randy=0,j=0;
int diagSum1 = 0;
int diagSum2 = 0;
int colSum = 0;
int rowSum = 0;
//////////////////just edited version of check win method checks if ai can win if so it places down and wins
diagSum1 = buttons[0][2].getValue() + buttons[1][1].getValue() + buttons[2][0].getValue();
diagSum2 = buttons[0][0].getValue() + buttons[1][1].getValue() + buttons[2][2].getValue();
if(diagSum2 == 2 ) {
for(int y = 0; y<3; y++) {
if (buttons[y][y].getValue()==0) {
buttons[y][y].setText("O");
buttons[y][y].setForeground(Color.black);
buttons[y][y].setValue(1);
buttons[y][y].setState(true);
j=1;
return;
}
}
}
if(diagSum1 == 2) {
if (buttons[0][2].getValue()==0) {
buttons[0][2].setText("O");
buttons[0][2].setForeground(Color.black);
buttons[0][2].setValue(1);
buttons[0][2].setState(true);
j=1;
}
if (buttons[1][1].getValue()==0) {
buttons[1][1].setText("O");
buttons[1][1].setForeground(Color.black);
buttons[1][1].setValue(1);
buttons[1][1].setState(true);
j=1;
}
if (buttons[2][0].getValue()==0) {
buttons[2][0].setText("O");
buttons[2][0].setForeground(Color.black);
buttons[2][0].setValue(1);
buttons[2][0].setState(true);
j=1;
}
return;
}
for(int x = 0; x<3; x++) {
for(int y = 0; y<3; y++) {
rowSum += buttons[x][y].getValue();
colSum += buttons[y][x].getValue();
}
if (colSum == 2 && j == 0) {
for(int y = 0; y<3; y++) {
if (buttons[y][x].getValue()==0) {
buttons[y][x].setText("O");
buttons[y][x].setForeground(Color.black);
buttons[y][x].setValue(1);
buttons[y][x].setState(true);
j=1;
return;
}
}
}
else if(rowSum == 2 && j == 0) {
for(int y = 0; y<3; y++) {
if (buttons[x][y].getValue()==0) {
buttons[x][y].setText("O");
buttons[x][y].setForeground(Color.black);
buttons[x][y].setValue(1);
buttons[x][y].setState(true);
j=1;
return;
}
}
}
rowSum = 0;
colSum = 0;
}
/////////////same as above except checks if plays about to win then blocks
for(int x = 0; x<3; x++) {
for(int y = 0; y<3; y++) {
rowSum += buttons[x][y].getValue();
colSum += buttons[y][x].getValue();
}
if ( colSum == -2 && j == 0) {
for(int y = 0; y<3; y++) {
if (buttons[y][x].getValue()==0) {
buttons[y][x].setText("O");
buttons[y][x].setForeground(Color.black);
buttons[y][x].setValue(1);
buttons[y][x].setState(true);
j=1;
return;
}
}
}
else if( rowSum == -2 && j == 0) {
for(int y = 0; y<3; y++) {
if (buttons[x][y].getValue()==0) {
buttons[x][y].setText("O");
buttons[x][y].setForeground(Color.black);
buttons[x][y].setValue(1);
buttons[x][y].setState(true);
j=1;
return;
}
}
}
rowSum = 0;
colSum = 0;
}
if(diagSum1 == -2 ) {
if (buttons[0][2].getValue()==0) {
buttons[0][2].setText("O");
buttons[0][2].setForeground(Color.black);
buttons[0][2].setValue(1);
buttons[0][2].setState(true);
j=1;
}
if (buttons[1][1].getValue()==0) {
buttons[1][1].setText("O");
buttons[1][1].setForeground(Color.black);
buttons[1][1].setValue(1);
buttons[1][1].setState(true);
j=1;
}
if (buttons[2][0].getValue()==0) {
buttons[2][0].setText("O");
buttons[2][0].setForeground(Color.black);
buttons[2][0].setValue(1);
buttons[2][0].setState(true);
j=1;
}
return;
}
if( diagSum2 == -2) {
for(int y = 0; y<3; y++) {
if (buttons[y][y].getValue()==0) {
buttons[y][y].setText("O");
buttons[y][y].setForeground(Color.black);
buttons[y][y].setValue(1);
buttons[y][y].setState(true);
j=1;
return;
}
}
}
//////////////messes up strategy that ai uses to make it unbeatable
if (buttons[2][1].getValue()==0) {
buttons[2][1].setText("O");
buttons[2][1].setForeground(Color.black);
buttons[2][1].setValue(1);
buttons[2][1].setState(true);
j=1;
return;
}
///////////////random move only really used if play is an idiot
while(j == 0) {
randx=rand.nextInt(3);
randy=rand.nextInt(3);
if (buttons[randx][randy].getValue()==0) {
buttons[randx][randy].setText("O");
buttons[randx][randy].setForeground(Color.black);
buttons[randx][randy].setValue(1);
buttons[randx][randy].setState(true);
j++;
}
}
return;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void aiMove(int turn)\n\t{\n\t\tint row = 0;\n\t\tint col = 0;\n\t\tint choice = 0;\n\t\t/*\n\t\t * Picks a random move on the first turn\n\t\t */\n\t\tif (turn == 0 )\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\trow = (int) (Math.random() * 3);\n\t\t\t\tcol = (int) (Math.random() * 3);\n\t\t\t\tchoice = (int) (Math.random() * (ai.size()-1));\n\t\t\t\tif (board[row][col] == 0) \n\t\t\t\t{\t\t// valid move (empty slot)\n\t\t\t\t\tboard[row][col] = ai.get(choice);\n\t\t\t\t\tdraw.drawMove(col, row,ai.get(choice));\n\t\t\t\t\tai.remove(choice);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * Otherwise checks every number, and every square for a winning move\n\t\t */\n\t\telse\n\t\t{\n\t\t\tboolean madeMove = false;\n\t\t\twhile (true) \t\t\t\t\t\t\t\t\t\n\t\t\t{\n\t\t\t\tif (madeMove == true)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfor (int a = 0; a <ai.size(); a++)\n\t\t\t\t{\n\t\t\t \t\tfor (int x = 0; x < 3; x++)\t\t\t\t\t//loops through all squares and checks if free\n\t\t\t \t\t{\n\t\t\t \t\t\tfor ( int y = 0; y < 3; y++)\n\t\t\t \t\t\t{\n\t\t\t \t\t\t\tif (madeMove == false)\n\t\t\t \t\t\t\t{\n\t\t\t\t \t\t\t\tif( board[x][y] == 0)\n\t\t\t\t \t\t\t\t{\n\t\t\t\t \t\t\t\t\tif (((x == 0 && y == 0)\t\t\t\t\t//checks for first diagonal and then if it is the winning move\n\t\t\t\t \t\t\t\t\t\t|| (x == 1 && y == 1) \n\t\t\t\t \t\t\t\t\t\t|| (x == 2 && y == 2)))\n\t\t\t\t \t\t\t\t\t{\n\t\t\t\t \t\t\t\t\t\tif (Math.abs(board[0][0] + board[1][1] + board[2][2]) + ai.get(a) == 15)\n\t\t\t\t \t\t\t\t\t\t{\n\t\t\t\t \t\t\t\t\t\t\trow = x;\n\t\t\t\t \t\t\t\t\t\t\tcol = y;\n\t\t\t\t \t\t\t\t\t\t\tboard[x][y] = ai.get(a);\n\t\t\t\t \t\t\t\t\t\t\tmadeMove = true;\n\t\t\t\t \t\t\t\t\t\t\tdraw.drawMove(col, row, ai.get(a));\n\t\t\t\t \t\t\t\t\t\t\tai.remove(a);\n\t\t\t\t \t\t\t\t\t\t\tbreak;\n\t\t\t\t \t\t\t\t\t\t}\n\t\t\t\t \t\t\t\t\t}\n\t\t\t\t \t\t\t\t\tif (((x == 0 && y == 2) \t\t\t//checks second diagonal for winning move\n\t\t\t\t\t \t\t\t\t\t\t|| (x == 1 && y == 1) \n\t\t\t\t\t \t\t\t\t\t\t|| (x == 2 && y == 0)))\n\t\t\t\t\t \t\t\t\t{\n\t\t\t\t \t\t\t\t\t\tif (Math.abs(board[0][2] + board[1][1] + board[2][0]) + ai.get(a) == 15)\n\t\t\t\t \t\t\t\t\t\t{\n\t\t\t\t \t\t\t\t\t\t\trow = x;\n\t\t\t\t \t\t\t\t\t\t\tcol = y;\n\t\t\t\t \t\t\t\t\t\t\tboard[x][y] = ai.get(a);\n\t\t\t\t \t\t\t\t\t\t\tmadeMove = true;\n\t\t\t\t \t\t\t\t\t\t\tdraw.drawMove(col, row, ai.get(a));\n\t\t\t\t \t\t\t\t\t\t\tai.remove(a);\n\t\t\t\t \t\t\t\t\t\t\tbreak;\n\t\t\t\t \t\t\t\t\t\t}\n\t\t\t\t\t \t\t\t\t}\n\t\t\t\t \t\t\t\t\telse if ((Math.abs(board[x][0] + board[x][1] + board[x][2]) + ai.get(a) == 15))\t//checks for winning row\n\t\t\t\t \t\t\t\t\t{\n\t\t\t\t \t\t\t\t\t\trow = x;\n\t\t\t \t\t\t\t\t\t\tcol = y;\n\t\t\t \t\t\t\t\t\t\tboard[x][y] = ai.get(a);\n\t\t\t \t\t\t\t\t\t\tmadeMove = true;\n\t\t\t \t\t\t\t\t\t\tdraw.drawMove(col, row, ai.get(a));\n\t\t\t \t\t\t\t\t\t\tai.remove(a);\n\t\t\t \t\t\t\t\t\t\tbreak;\n\t\t\t\t \t\t\t\t\t}\n\t\t\t\t \t\t\t\t\telse if ((Math.abs(board[0][y] + board[1][y] + board[2][y]) + ai.get(a) == 15)) //checks for winning column\n\t\t\t\t \t\t\t\t\t{\n\t\t\t\t \t\t\t\t\t\trow = x;\n\t\t\t \t\t\t\t\t\t\tcol = y;\n\t\t\t \t\t\t\t\t\t\tboard[x][y] = ai.get(a);\n\t\t\t \t\t\t\t\t\t\tmadeMove = true;\n\t\t\t \t\t\t\t\t\t\tdraw.drawMove(col, row, ai.get(a));\n\t\t\t \t\t\t\t\t\t\tai.remove(a);\n\t\t\t \t\t\t\t\t\t\tbreak;\n\t\t\t\t \t\t\t\t\t}\n\t\t\t\t \t\t\t\t}\n\t\t\t \t\t\t\t}\n\t\t\t\t \t\t}\n\t\t\t\t \t}\n\t\t\t \t\tif (madeMove == false)\t\t\t\t\t\t//if a winning move can't be found, a random one is made\n\t \t\t\t\t{\n\t\t\t\t\t\tchoice = (int) (Math.random() * (ai.size()-1));\n\t \t\t\t\t\trow = (int) (Math.random() * 3);\n\t \t\t\t\t\tcol = (int) (Math.random() * 3);\n\t \t\t\t\t\tif (board[row][col] == 0) \n\t \t\t\t\t\t{\t\t\t// valid move (empty slot)\n\t \t\t\t\t\t\tboard[row][col] = ai.get(choice);\n\t \t\t\t\t\t\tdraw.drawMove(col, row, ai.get(choice));\n\t \t\t\t\t\t\tai.remove(choice);\n\t \t\t\t\t\t\tmadeMove = true;\n\t \t\t\t\t\t\tbreak;\n\t \t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t \t\telse\n\t\t\t \t\t{\n\t\t\t \t\t\tbreak;\n\t\t\t \t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Override\r\n public void makeLogicMove() {\r\n\r\n this.printThoughts();\r\n this.printMessages();\r\n \r\n // If dead, don't make a move //\r\n if (this.isDead()) {\r\n return;\r\n } \r\n \r\n if (this.getVerbose()) {\r\n System.err.println(\"Making logic move for aibotscorer - \" + this.getMoves().size());\r\n }\r\n \r\n final AIBotScoreModel scores = scoreAllDirections();\r\n if (this.getVerbose()) {\r\n System.err.println(scores);\r\n }\r\n if (this.getMoves().size() <= 3) {\r\n super.makeLogicMove();\r\n return;\r\n }\r\n \r\n if (this.getMoves().size() == 26) {\r\n this.addMessages(\"-5000-AI: using default move, on 30 clause\");\r\n super.makeLogicMove();\r\n return;\r\n }\r\n \r\n final int randomMoveFlag = random.nextInt(16);\r\n if (randomMoveFlag == 1) {\r\n this.addMessages(\"-4000-AI: using default move, random case\");\r\n super.makeLogicMove();\r\n return;\r\n }\r\n \r\n final Move lastMove = this.getLastMoveNull();\r\n if (lastMove == null) {\r\n this.addMessages(\"-3000-AI: using default move, last move null\");\r\n // Revert back to the default move\r\n super.makeLogicMove();\r\n return;\r\n }\r\n \r\n final Move north = lastMove.decy();\r\n final Move south = lastMove.incy();\r\n final Move east = lastMove.incx();\r\n final Move west = lastMove.decx();\r\n \r\n final LinkedHashMap<Double, Move> map = new LinkedHashMap<Double, Move>();\r\n map.put(new Double(scores.getScoreNorth()), north);\r\n map.put(new Double(scores.getScoreSouth()), south);\r\n map.put(new Double(scores.getScoreEast()), east);\r\n map.put(new Double(scores.getScoreWest()), west);\r\n final LinkedHashMap<Double, Move> scoreMap = BotUtilityMap.sortMapByKey(map);\r\n \r\n if (this.getVerbose()) {\r\n System.err.println(scoreMap);\r\n }\r\n \r\n final boolean validScoreCheck = this.makeLogicMoveAIValidateScores(scoreMap);\r\n if (!validScoreCheck) {\r\n // If on the valid case, the move has already been made \r\n super.makeLogicMove();\r\n return;\r\n } // End of if //\r\n }",
"public void initMission() {\n\t\tinitNumOfMoves();\t//reset counter\n\t\t//Begin by creating a random board.\n\t\t/* 1st parameter: is the cell at (0,0) always empty?\n\t\t * 2nd parameter: will this board be accessed by the AI?\n\t\t * See the constructor comments in Board.java for more details. */\n\n\t\tboard = new Board(this.options.toUpperCase().contains(\"00\") ? true : false, false);\n\n\t\t//TODO OPTIONAL: instead of spawning a random board, we can customize\n\t\t//our own board! Just un-comment any of the below boards or paste your own!\n\n\t\t//Wastes to the right AND to the south! Watch how the AI would react.\n\t\t//try one-player AI version (aggressive or not, doesn't matter)\n//\t\tboard = new Board(new String[][]\n//\t\t\t\t{{\"\", \"P\", \"W\", \"\", \"\", \"\"},\n//\t\t\t\t {\"W\", \"\", \"\", \"\", \"G\", \"\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"P\", \"\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t {\"\", \"\", \"P\", \"\", \"\", \"\"},\n//\t\t\t\t});\n\t\t//What's the most efficient way for the AI to find the victim?\n\t\t//Note there are no wastes or fire pits in this scenario.\n//\t\t\tboard = new Board(new String[][]\n//\t\t\t\t{{\" \", \" \", \" \", \" \", \" \", \" \" },\n//\t\t\t\t{\" \", \" \", \" \", \" \", \" \", \" \" },\n//\t\t\t\t{\" \", \" \", \" \", \" \", \" \", \" \" },\n//\t\t\t\t{\" \", \" \", \"G\", \" \", \" \", \" \" },\n//\t\t\t\t{\" \", \" \", \" \", \" \", \" \", \" \" },\n//\t\t\t\t{\" \", \" \", \" \", \" \", \" \", \" \" }\n//\t\t\t\t});\n\n\t\t//Impossible one. Useful for explaining probability during presentation.\n//\t\t\t\t\t\tboard = new Board(new String[][]\n//\t\t\t\t\t\t\t\t{{\"\", \"\", \"P\", \"\", \"\", \"\"},\n//\t\t\t\t\t\t\t\t{\"\", \"P\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t\t\t\t\t{\"P\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t\t\t\t\t{\"W\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t\t\t\t\t{\"\", \"\", \"\", \"W\", \"\", \"\"},\n//\t\t\t\t\t\t\t\t{\"\", \"G\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t\t\t\t\t});\n\n\t\t/* Very tough board, but the AI is up to the task. */\n//\t\tboard = new Board(new String[][]\n//\t\t\t\t{{\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t {\"\", \"P\", \"P\", \"\", \"\", \"\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t {\"W\", \"\", \"P\", \"\", \"\", \"\"},\n//\t\t\t\t {\"G\", \"\", \"\", \"W\", \"\", \"\"},\n//\t\t\t\t});\n\n\t\t//tough tough tough. The victim is surrounded by a wall of fire!\n\t\t//try it with 2 AI's, starting in random cell. One of them might die!\n//\t\tboard = new Board(new String[][]\n//\t\t\t\t{{\"\", \"P\", \"\", \"G\", \"\", \"\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"P\", \"W\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t {\"\", \"W\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"\", \"P\"},\n//\t\t\t\t {\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t});\n\n\t\t//with aggressiveModeOn set to true, the AI will disinfect both wastes.\n\t\t//if set to false, the AI will disinfect only one.\n\t\t//Either way, AI gets the victim.\n\t\t//\t\t\t\tboard = new Board(new String[][]\n\t\t//\t\t\t\t\t\t{{\"\", \"\", \"\", \"\", \"\", \"\"},\n\t\t//\t\t\t\t\t\t{\"\", \"\", \"\", \"P\", \"\", \"\"},\n\t\t//\t\t\t\t\t\t{\"\", \"W\", \"\", \"\", \"\", \"\"},\n\t\t//\t\t\t\t\t\t{\"\", \"W\", \"\", \"G\", \"\", \"P\"},\n\t\t//\t\t\t\t\t\t{\"\", \"\", \"\", \"\", \"\", \"\"},\n\t\t//\t\t\t\t\t\t{\"P\", \"\", \"\", \"\", \"\", \"\"},\n\t\t//\t\t\t\t\t\t});\n\n\n\t\t//RARE situation (one-player mode) where setting aggressiveModeOn to true will result in death.\n\t\t//Non-aggressive mode will get the victim. Start at cell (0,0).\n//\t\tboard = new Board(new String[][]\n//\t\t\t\t{{\"\", \"\", \"\", \"P\", \"G\", \"P\"},\n//\t\t\t\t{\"\", \"\", \"P\", \"W\", \"W\", \"\"},\n//\t\t\t\t{\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t{\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t{\"\", \"\", \"\", \"P\", \"P\", \"\"},\n//\t\t\t\t{\"P\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t});\n\n\n\t\t//Very rare instance. if both players are AI and start at cell (0,0),\n\t\t//they will BOTH die. However, note that it's not the AI's fault.\n\t\t//The AI still managed to MINIMIZE risk. They just got unlucky.\n//\t\tboard = new Board(new String[][]\n//\t\t\t\t{{\"\", \"\", \"\", \"\", \"P\", \"\"},\n//\t\t\t\t{\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t{\"\", \"W\", \"P\", \"\", \"\", \"\"},\n//\t\t\t\t{\"W\", \"\", \"\", \"\", \"G\", \"\"},\n//\t\t\t\t{\"P\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t{\"\", \"\", \"\", \"\", \"\", \"\"},\n//\t\t\t\t});\n\n\t\t/* Use custom method in Board class to print the board to the console and save it to a text file.\n\t\t * See the method comments in Board.java class for more details. */\n\t\tboard.printBoard();\n\n\t\t/* Initialize the cell in which the players will start the mission. */\n\t\tCell startRoom;\n\t\tCellAsPerceivedByAI startRoomAI;\n\t\tCell[] startRooms = this.setStartRoomAndBoardAI(this.options.toUpperCase().contains(\"00\"));\n\t\tstartRoom = startRooms[0];\n\t\tstartRoomAI = (CellAsPerceivedByAI)startRooms[1];\n\n\t\tthis.createPlayers(startRoom, startRoomAI, this.p1Name, this.p2Name,\n\t\t\t\tthis.options.toUpperCase().contains(\"A1\"), this.options.toUpperCase().contains(\"A2\"), this.options.toUpperCase().contains(\"S\"),\n\t\t\t\tthis.options.toUpperCase().contains(\"H\") ? \"H\" : this.options.toUpperCase().contains(\"R\") ? \"R\" : \"B\");\t//create players\n\n\t\tthis.hideAllPics();\n\t\tgreyOutCell(startRoomAI.getX(), startRoomAI.getY());\n\t\trepaint();\n\t}",
"private void decideMakeAutomaicMove(){\n\t\t\r\n\t\tif (playerMode != PlayerMode.manual){\r\n\t\t\tif (playerMode == PlayerMode.random) makeRandomMove();\r\n\t\t\telse makeSmartMove();\r\n\t\t}\r\n\t}",
"public boolean whatNow (String action, player friday, player you){ // Method which will allow the ia to choose his action\n\t\tString testAction = \"Tank\"; // Create a String we will use a lot to test other string\n\t\tint actionIa; // If the ia is a Tank, forbid him to use his special attack. The purpose is to prevent him from useless turns\n\t\tif (friday.getName().equals(testAction)){ // If the name of the ia's class is Tank\n\t\t\t actionIa = (int)(Math.random() * 2); // His random will be between 0 or 1\n\t\t}\n\t\t\n\t\telse {\n\t\t\t actionIa = (int)(Math.random() * 3); // Else, his random will be between 0, 1 and 2\n\t\t}\n\t\t\n\t\ttestAction = \"attack\"; // Will be use to test if you attacked\n\t\t\n\t\t\n\t\tswitch (actionIa){ // Test ia's action\n\t\t\tcase 0: // 0, the enemy attack\n\t\t\t\tfriday.setSprite(\"attack\");\n\t\t\t\tSystem.out.println(\"The enemy attack\\n\"); // Warns the user\n\t\t\t\ttestAction = \"block\"; // Will be use to test if you block\n\t\t\t\tif (action.equals(testAction)){ // If you block\n\t\t\t\t\tSystem.out.println(\"You blocked the enemy's attack.\"); // Warns the user\n\t\t\t\t\tyou.setHp(you.getHp() - you.getDp()); // You loose as much hp as your dp\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\tyou.setHp(you.getHp() - friday.getAp()); // Else, you loose as much hp as your enemy's ap\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 1: // 1, the enemy block\n\t\t\t\tfriday.setSprite(\"block\");\n\t\t\t\tif (action.equals(testAction)){ // If you attacked\n\t\t\t\t\tfriday.setHp(friday.getHp() - friday.getDp()); // The enemy loose as much hp as his dp\n\t\t\t\t\taction = \"\"; // Prevent you from attack a second time\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"The enemy blocked your attack\\n\"); // Warns the user\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 2: // 2, the enemy use his special power if he isn't a tank\n\t\t\t\tfriday.setSprite(\"special\");\n\t\t\t\tSystem.out.println(\"The enemy uses his special power.\"); // Warns the user\n\t\t\t\tfriday.special(); // Execute ia's special attack\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t}\n\t\t\n\t\ttestAction = \"attack\"; // Reset testAction\n\t\t\n\t\tif (action.equals(testAction)){ // If you attacked\n\t\t\tfriday.setHp(friday.getHp() - you.getAp()); // The enemy loose as much hp as your ap\n\t\t} // Nota Bene : if the enemy blocked your attack, this won't be executed because 'action = \"\";'\n\t\t\n\t\tSystem.out.println(\"You have \" + you.getHp() + \" HP left.\"); // Warns the user\n\t\tSystem.out.println(\"The ennemy have \" + friday.getHp() + \" HP left.\\n\"); // Warns the user\n\t\t\n\t\tif(you.getHp() <= 0){ // If you or the ia has no hp left, warn the system that the fight is over by setting 'end' on true and tell who died\n\t\t\tend = true;\n\t\t\tSystem.out.println(\"You died!\");\n\t\t\tyou.setSprite(\"dead\");\n\t\t}\n\t\t\n\t\telse if(friday.getHp() <= 0){\n\t\t\tend = true;\n\t\t\tSystem.out.println(\"You killed the ennemy!\");\n\t\t\tfriday.setSprite(\"dead\");\n\t\t}\n\t\t\n\t\telse { // Else, it just asks you what you want to do\n\t\t\tSystem.out.println(\"What do you want to do, attack, block or use your special power ?\"); // Asks what you want to do\n\t\t}\n\t\treturn end;\n\t}",
"public void doAi(){\n\t\t\tif(MathHelper.getRandom(0, Game.FRAMERATE * 5) == 5){\n\t\t\t\tsetScared(true);\n\t\t\t}\n\t\t\n\t\t//Update rectangle\n\t\tsetRectangle(getX(), getY(), getTexture().getWidth(), getTexture().getHeight());\n\t\t\n\t\trect = new Rectangle(getDestinationX(), getDestinationY(), 10, 10);\n\t\t\n\t\tif(rect.intersects(getRectangle())){\n\t\t\t\n\t\t\tif(StateManager.getState() == StateManager.STATE_BOSSTWO){\n\t\t\t\t\n\t\t\t\t\tsetDestinationX(StateGame.player.getX());\n\t\t\t\t\t\n\t\t\t\t\tsetDestinationY(StateGame.player.getY());\n\t\t\t\t\t\n\t\t\t\t\trect = new Rectangle(getDestinationX(), getDestinationY(), 10, 10);\n\t\t\t\t\treachedDestination = (true);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Check for collision with jelly\n\t\tint checkedJelly = (0);\n\t\twhile(checkedJelly < EntityJelly.JELLY.size() && EntityJelly.JELLY.get(checkedJelly) != null){\n\t\t\tif(EntityJelly.JELLY.get(checkedJelly).getDead() == false){\n\t\t\t\tif(getRectangle().intersects(EntityJelly.JELLY.get(checkedJelly).getRectangle())){\n\t\t\t\t\tsetHealth(getHealth() - 2);\n\t\t\t\t\tif(MathHelper.getRandom(1, 10) == 10){\n\t\t\t\t\tAnnouncer.addAnnouncement(\"-2\", 60, EntityJelly.JELLY.get(checkedJelly).getX(), EntityJelly.JELLY.get(checkedJelly).getY());\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tcheckedJelly++;\n\t\t}\n\t\t\n\t\t//If we're out of health, kill the entity\n\t\tif(getHealth() < 0){\n\t\t\tsetDead(true);\n\t\t}\n\t\t\n\t\tif(StateManager.getState() == StateManager.STATE_BOSSTWO){\n\t\t\tif(reachedDestination == true){\n\t\t\t\tif(getScared() == false){\n\t\t\t\tsetY(getY() + getSpeed());\n\t\t\t\t}else{\n\t\t\t\t\tsetY(getY() - getSpeed() * 3);\n\t\t\t\t\tsetX(getX() - getSpeed() * 3);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(getScared() == false){\n\t\t\t\tif(getX() < getDestinationX())\n\t\t\t\t\tsetX(getX() + getSpeed());\n\t\t\t\tif(getX() > getDestinationX())\n\t\t\t\t\tsetX(getX() - getSpeed());\n\t\t\t\tif(getY() < getDestinationY())\n\t\t\t\t\tsetY(getY() + getSpeed());\n\t\t\t\tif(getY() > getDestinationY())\n\t\t\t\t\tsetY(getY() - getSpeed());\n\t\t\t\t}else{\n\t\t\t\t\t\tsetY(getY() - getSpeed() * 3);\n\t\t\t\t\t\tsetX(getX() - getSpeed() * 3);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"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 void playAI (int actualAI) {\n }",
"public int makeAIMove(Player player) {\n\t\tint input = -1;\n\t\tboolean validMove = false;\n\n\t\tSystem.out.println(\"Current player is: \" + player.color);\n\n\t\t// Get all the valid moves if there are any\n\t\tArrayList<ArrayList<Integer>> validMoves = getValidMoves(board, player.color);\n\t\tprintValidMoves(validMoves, board);\n\t\t// As long as the input isn't correct, this will loop\n\t\twhile (validMove == false) {\n\t\t\t// Check if there are any possible moves\n\t\t\tif (!validMoves.isEmpty()) {\n\t\t\t\t// Als er een blocking move gedaan kan worden, wordt dit gedaan. Dit heeft\n\t\t\t\t// nummer 1 prioriteit.\n\t\t\t\tint blockMove = player.ai.blockingMove(validMoves, board, player);\n\t\t\t\tif (blockMove != -1) {\n\t\t\t\t\tinput = blockMove;\n\t\t\t\t\t// Random zet, gebeurt op dit moment nooit\n\t\t\t\t} else if (turn < 0) {\n\t\t\t\t\tinput = player.ai.random(board, player);\n\t\t\t\t\t// Zet gebaseerd op boardweight, gebeurt op dit moment nooit\n\t\t\t\t} else if (turn < 0) {\n\t\t\t\t\tinput = player.ai.boardWeighting(board, player);\n\t\t\t\t\t// Minimax, 8 diep, gebeurt tussen beurt 0 en 30\n\t\t\t\t} else if (turn < 30) {\n\t\t\t\t\tinput = player.ai.minimaxAvailableMoves(board, player, 0, 8, 0, 0, Integer.MIN_VALUE,\n\t\t\t\t\t\t\tInteger.MAX_VALUE, 0);\n\t\t\t\t\t// Minimax, 9 diep, gebeurt tussen beurt 30 en 40\n\t\t\t\t} else if (turn < 40) {\n\t\t\t\t\tinput = player.ai.minimaxAvailableMoves(board, player, 0, 9, 0, 0, Integer.MIN_VALUE,\n\t\t\t\t\t\t\tInteger.MAX_VALUE, 0);\n\t\t\t\t\t// Minimax, 10 diep, gebeurt tussen beurt 40 en 45\n\t\t\t\t} else if (turn < 45) {\n\t\t\t\t\tinput = player.ai.minimaxAvailableMoves(board, player, 0, 10, 0, 0, Integer.MIN_VALUE,\n\t\t\t\t\t\t\tInteger.MAX_VALUE, 0);\n\t\t\t\t\t// Minimax, 16 diep, gebeurt tussen beurt 45 en 60\n\t\t\t\t} else {\n\t\t\t\t\tinput = player.ai.minimaxTest(board, player, 0, 16, 0, 0, Integer.MIN_VALUE, Integer.MAX_VALUE, 0);\n\t\t\t\t}\n\n\t\t\t\t// Voer de move die gevonden is uit.\n\t\t\t\tvalidMove = setMove(input, validMoves, player.color, board);\n\n\t\t\t\tif (validMove == true) {\n\t\t\t\t\tturn++;\n\t\t\t\t}\n\t\t\t\t// Reset noWinnerCount\n\t\t\t\tnoWinnerCount = 0;\n\t\t\t} else {\n\t\t\t\t// 1 player can't move, if this counter reaches 2, that means both players can't\n\t\t\t\t// move and the game will end\n\t\t\t\tnoWinnerCount++;\n\t\t\t\tSystem.out.println(\"Out of moves + Count = \" + noWinnerCount);\n\t\t\t\tvalidMove = true;\n\t\t\t}\n\t\t}\n\n\t\t// Input is last player player\n\t\tArrayList<ArrayList<Integer>> validMovesOpponent = getValidMoves(board, player.opponent);\n\t\tif (validMovesOpponent.size() > 0) {\n\t\t\tswitchTurn(player);\n\t\t}\n\n\t\treturn input;\n\t}",
"public void startAi(int num){\n int times = num;\n int test = 0;\n while(test < times){\n\n if (currentRoom.containsEnemy())\n {\n int eHealth = currentRoom.getEnemyHealth();\n int pHealth = player.getHealth();\n int pAD = player.getAttackDamage();\n int eAD = currentRoom.getEnemyDamage();\n ai.fightMath(eHealth, pHealth, pAD, eAD);\n player.setHealthExact(ai.getHealth());\n if (player.getHealth() > 0)\n {\n currentRoom.removeEnemy();\n System.out.println(\"\\n\" + \"AI defeated an enemy. Current health: \" + player.getHealth() + \"\\n\");\n }\n else{\n times = 0;\n }\n\n }\n \n else if(currentRoom.equals(prison))\n {\n ai.scheduleCommand(\"go\", \"up\", null);\n processCommand(command); \n test++;\n }\n\n else if(currentRoom.equals(promenade)){\n currentRoom = promenade;\n player.setRoom(currentRoom);\n ai.scheduleCommand(\"take\", \"wood\", \"sword\");\n processCommand(command);\n ai.scheduleCommand(\"take\", \"rope\", null);\n processCommand(command);\n ai.scheduleCommand(\"go\", \"up\", \"sword\"); \n processCommand(command);\n test++; \n } \n \n else if(currentRoom.equals(ossuary)){\n currentRoom = ossuary;\n player.setRoom(currentRoom);\n ai.scheduleCommand(\"open\", \"chest\", null);\n processCommand(command);\n ai.scheduleCommand(\"drop\", \"wood\", \"sword\");\n player.dropWeapon(command);\n ai.scheduleCommand(\"take\", \"silver\", \"sword\");\n processCommand(command);\n ai.scheduleCommand(\"take\", \"potion\", null);\n processCommand(command); \n ai.scheduleCommand(\"go\", \"straight\", null);\n processCommand(command);\n test++;\n\n }\n else if(currentRoom.equals(crypt))\n {\n currentRoom = crypt;\n player.setRoom(currentRoom);\n ai.scheduleCommand(\"take\", \"shovel\", null);\n processCommand(command); \n ai.scheduleCommand(\"go\", \"up\", null);\n processCommand(command);\n test++;\n }\n else if(currentRoom.equals(graveyard))\n {\n currentRoom = graveyard;\n player.setRoom(currentRoom);\n ai.scheduleCommand(\"go\", \"right\", null);\n processCommand(command);\n test++;\n }\n else if(currentRoom.equals(forest))\n {\n currentRoom = forest;\n player.setRoom(currentRoom);\n ai.runRope(player.getInventory());\n processCommand(command);\n ai.setCommand(\"go\", \"up\", null);\n processCommand(command);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n test++;\n\n\n }\n \n else if(currentRoom.equals(tower))\n {\n currentRoom = tower;\n player.setRoom(currentRoom);\n ai.setCommand(\"take\", \"potion\", null);\n processCommand(command);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n ai.setCommand(\"go\", \"straight\", null);\n processCommand(command);\n }\n else if(currentRoom.equals(ramparts))\n {\n currentRoom = ramparts;\n player.setRoom(currentRoom);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n ai.setCommand(\"go\", \"straight\", null);\n processCommand(command);\n\n\n }\n else if(currentRoom.equals(castle))\n {\n currentRoom = castle;\n player.setRoom(currentRoom);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n ai.setCommand(\"open\", \"chest\", null);\n processCommand(command);\n ai.setCommand(\"take\", \"potion\", null);\n processCommand(command);\n \n\n\n }\n\n else if(currentRoom.equals(throne))\n {\n currentRoom = throne;\n player.setRoom(currentRoom);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n }\n\n else if(currentRoom.equals(sewers))\n {\n currentRoom = sewers;\n player.setRoom(currentRoom);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n ai.setCommand(\"go\", \"down\", null);\n processCommand(command);\n\n }\n else if(currentRoom.equals(depths))\n {\n currentRoom = depths;\n player.setRoom(currentRoom);\n ai.setCommand(\"go\", \"right\", null);\n processCommand(command);\n }\n else if(currentRoom.equals(crypt))\n {\n currentRoom = crypt;\n player.setRoom(currentRoom);\n ai.setCommand(\"go\", \"up\", null);\n processCommand(command);\n\n }\n else if(currentRoom.equals(graveyard))\n {\n currentRoom = graveyard;\n player.setRoom(currentRoom);\n ai.setCommand(\"go\", \"straight\", null);\n processCommand(command);\n }\n else if(currentRoom.equals(bridge))\n {\n currentRoom = bridge;\n player.setRoom(currentRoom);\n ai.setCommand(\"go\", \"up\", null);\n processCommand(command);\n }\n\n \n } \n }",
"public void makeRandomMove() {\n\t\ttry{\r\n\t\t\tif (playerId == game.getState().getTurn()){\r\n\t\t\t\tgame.execute(randPlayer.requestAction(game.getState()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalArgumentException e){\r\n\t\t\t\r\n\t\t}\r\n\t}",
"private void randomMove() {\n }",
"protected void makeAmove(Board b, Player p){\r\n\t\tthis.setMove(0);\t\t\r\n\t\tif (this.winnable(b) != 0)\r\n\t\t\tthis.setMove(this.winnable(b));\r\n\t\telse if (p.winnable(b) != 0)\r\n\t\t\tthis.setMove(p.winnable(b));\r\n\t\telse if (b.getTile(5) == ' ')\r\n\t\t\tthis.setMove(5);\r\n\t\telse{\r\n\t\t\tRandom tile = new Random();\r\n\t\t\tdo{\r\n\t\t\t\tthis.move = (tile.nextInt(9) + 1);\r\n\t\t\t\t// int 0-8 inclusive and adding 1 makes it 1-9 incl\r\n\t\t\t}while ((b.getTile(this.getMove())=='O') || \r\n\t\t\t\t\t(b.getTile(this.getMove())=='X'));\r\n\t\t\t// just checks to see if it's is a valid move\r\n\t\t\t// empty and within the bounds of 1-9\r\n\t\t}\r\n\t\tb.setTile(this.getMove(), this.getSymbol());\r\n\t\tSystem.out.println(\"Player \"+this.ID+\" (computer) chooses position \"+this.getMove());\r\n\t}",
"private void randomBehavior() {\n\t\trandom = rand.nextInt(50);\n\t\tif (random == 0) {\n\t\t\trandom = rand.nextInt(4);\n\t\t\tswitch (random) {\n\t\t\t\tcase 0:\n\t\t\t\t\tchangeFacing(ACTION.DOWN);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tchangeFacing(ACTION.RIGHT);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tchangeFacing(ACTION.UP);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tchangeFacing(ACTION.LEFT);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"private void random() {\n GameState gs = cc.getGameState();\n ArrayList<int[]> moves = cc.getPlayerMoves(player);\n ArrayList<GameState> states = nextStates(moves, gs);\n for (int[] m : moves) {\n GameState next = checkMove(m, cc);\n states.add(next);\n }\n Random rand = new Random(System.nanoTime());\n int i = rand.nextInt(states.size());\n cc.setAIMove(states.get(i));\n }",
"private void AISelect() {\n\t\tRandom generator = new Random();\n\t\tcurrentPlayer = AI;\n\t\tint guessAttempts = 0;\n\t\tboolean paint = true;//If it remains true then the board will be repainted. Turns false when the AI can't move.\n\t\t\n\t\tif (!gameWon){\n\t\tdo {\n\t\t\t//Logic for next AI Guess\n\t\t\tint playerBoxes = 0;\n\t\t\tint aiBoxes = 0;\n\t\t\tint nextGuessRow = 0;\n\t\t\tint nextGuessColumn = 0;\n\t\t\tint boxesLeft = 0;\n\t\t\tint xGuessWin = -1;\n\t\t\tint yGuessWin = -1;\n\n\t\t\txGuess = generator.nextInt(DIVISIONS);\n\t\t\tyGuess = generator.nextInt(DIVISIONS);\n\t\t\t\n\t\t\t//Check whether any row has all but 1 box filled in all by either player. Moves at the empty space if so.\n\t\t\t\n\t\t\tfor (int i = 0; i<DIVISIONS; i++){//Column\n\t\t\t\tfor (int j = 0; j<DIVISIONS; j++){//Row\n\t\t\t\t\tif (gameArray[i][j] == USER){\n\t\t\t\t\t\t//Add up user's boxes\n\t\t\t\t\t\tplayerBoxes++;\n\t\t\t\t\t}\n\t\t\t\t\tif (gameArray[i][j] == AI){\n\t\t\t\t\t\t//Add up AI's boxes\n\t\t\t\t\t\taiBoxes++;\n\t\t\t\t\t}\n\t\t\t\t\tif (gameArray[i][j] == NEITHER){\n\t\t\t\t\t\t//Add up empty boxes and store the empty spot\n\t\t\t\t\t\tboxesLeft++;\n\t\t\t\t\t\tnextGuessRow = j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (playerBoxes == DIVISIONS - 1 && boxesLeft >0){\n\t\t\t\t\t//Guess to block the user\n\t\t\t\t\txGuess = i;\n\t\t\t\t\tyGuess = nextGuessRow;\n\t\t\t\t}\n\t\t\t\tif (aiBoxes == DIVISIONS - 1 && boxesLeft >0){\n\t\t\t\t\t//Guess to win the game\n\t\t\t\t\txGuessWin = i;\n\t\t\t\t\tyGuessWin = nextGuessRow;\n\t\t\t\t}\n\t\t\t\tplayerBoxes = 0;\n\t\t\t\taiBoxes = 0;\n\t\t\t\tboxesLeft = 0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//Check whether any column has all but 1 box filled in all by either player. Moves there if so.\n\t\t\tfor (int j = 0; j<DIVISIONS; j++){//Row\n\t\t\t\tfor (int i = 0; i<DIVISIONS; i++){//Column\n\t\t\t\t\tif (gameArray[i][j] == USER){\n\t\t\t\t\t\t//Add up user boxes in that column\n\t\t\t\t\t\tplayerBoxes++;\n\t\t\t\t\t}\n\t\t\t\t\tif (gameArray[i][j] == AI){\n\t\t\t\t\t\taiBoxes++;\n\t\t\t\t\t}\n\t\t\t\t\tif (gameArray[i][j] == NEITHER){\n\t\t\t\t\t\tboxesLeft++;\n\t\t\t\t\t\tnextGuessColumn = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (playerBoxes == DIVISIONS - 1 && boxesLeft >0){\n\t\t\t\t\t//Guess to block\n\t\t\t\t\txGuess = nextGuessColumn;\n\t\t\t\t\tyGuess = j;\n\t\t\t\t}\n\t\t\t\tif (aiBoxes == DIVISIONS - 1 && boxesLeft >0){\n\t\t\t\t\t//Guess to win the game\n\t\t\t\t\txGuessWin = nextGuessColumn;\n\t\t\t\t\tyGuessWin = j;\n\t\t\t\t}\n\t\t\t\tplayerBoxes = 0;\n\t\t\t\taiBoxes = 0;\n\t\t\t\tboxesLeft = 0;\n\t\t\t}\n\t\t\t\n\t\t\t//Check whether the top left to lower right diagonal has all but 1 box filled in\n\t\t\tfor (int i = 0; i<DIVISIONS; i++){\n\t\t\t\tif (gameArray[i][i] == USER){\n\t\t\t\t\tplayerBoxes++;\n\t\t\t\t}\n\t\t\t\tif (gameArray[i][i] == AI){\n\t\t\t\t\taiBoxes++;\n\t\t\t\t}\n\t\t\t\tif (gameArray[i][i] == NEITHER){\n\t\t\t\t\tboxesLeft++;\n\t\t\t\t\tnextGuessRow = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (playerBoxes == DIVISIONS - 1 && boxesLeft >0){\n\t\t\t\txGuess = nextGuessRow;\n\t\t\t\tyGuess = nextGuessRow;\n\t\t\t}\n\t\t\tif (aiBoxes == DIVISIONS - 1 && boxesLeft >0){\n\t\t\t\txGuessWin = nextGuessRow;\n\t\t\t\tyGuessWin = nextGuessRow;\n\t\t\t}\n\t\t\tplayerBoxes = 0;\n\t\t\taiBoxes = 0;\n\t\t\tboxesLeft = 0;\n\t\t\t\n\t\t\t//Check whether the top left to lower right diagonal has all but 1 box filled in\n\t\t\tfor (int i = 0; i<DIVISIONS; i++){\n\t\t\t\tif (gameArray[i][(DIVISIONS - 1)-i] == USER){\n\t\t\t\t\tplayerBoxes++;\n\t\t\t\t}\n\t\t\t\tif (gameArray[i][(DIVISIONS - 1)-i] == AI){\n\t\t\t\t\taiBoxes++;\n\t\t\t\t}\n\t\t\t\tif (gameArray[i][(DIVISIONS - 1)-i] == NEITHER){\n\t\t\t\t\tboxesLeft++;\n\t\t\t\t\tnextGuessRow = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (playerBoxes == DIVISIONS - 1 && boxesLeft >0){\n\t\t\t\txGuess = nextGuessRow;\n\t\t\t\tyGuess = 2-nextGuessRow;\n\t\t\t}\n\t\t\tif (aiBoxes == DIVISIONS - 1 && boxesLeft >0){\n\t\t\t\txGuessWin = nextGuessRow;\n\t\t\t\tyGuessWin = (DIVISIONS - 1)-nextGuessRow;\n\t\t\t}\n\t\t\tplayerBoxes = 0;\n\t\t\taiBoxes = 0;\n\t\t\tboxesLeft = 0;\n\t\t\t\n\t\t\tif (yGuessWin != -1 && xGuessWin != -1){\n\t\t\t\txGuess = xGuessWin;\n\t\t\t\tyGuess = yGuessWin;\n\t\t\t}\n\t\t\n\t\t\tguessAttempts++;//Iterate guess count. Acts as a failsafe to avoid perma-while looping. Results in a tie.\n\t\t\tif (guessAttempts >= DIVISIONS*DIVISIONS){\n\t\t\t\tpaint = false;\n\t\t\t\tgameTie = true;\n\t\t\t}\n\t\t\t} while (gameArray[xGuess][yGuess] != 0 && (guessAttempts <= (DIVISIONS * DIVISIONS)));\n\t\t\t\n\t\t\t//When the AI makes a guess, update the array and repaint the game board.\n\t\t\tif (paint){\n\t\t\t\tgameArray[xGuess][yGuess] = AI;\n\t\t\t}\n\t\t\tguessAttempts = 0;\n\t\t\t}\n\t\t\n\t\t\tcheckVictory();//Checks whether the AI won.\n\t\t\trepaint();\n\t}",
"public void makeBestMove(String method, double angle, String who){\n\t\tif (method==\"avoid\"){\n\t\t\tif (!blocked1){\n\t\t\t\tthis.convertToMotion(move1x,move1y, who);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif (!blocked2){\n\t\t\t\t\tthis.convertToMotion(move2x,move2y, who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif (!blocked3){\n\t\t\t\t\t\tthis.convertToMotion(move3x,move3y, who);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tif (!blocked4){\n\t\t\t\t\t\t\tthis.convertToMotion(move4x,move4y, who);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//Dependent on most dominant vector component. Else, NPC stays put.\n\t\tif (method==\"freeze\"){\n\t\t\tif (!blocked1){\n\t\t\t\tthis.convertToMotion(move1x,move1y, who);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif (who==\"Trainer\"){\n\t\t\t\t\tif(move1x==0 && move1y==1){\n\t\t\t\t\t\tthis._movingTrainers.get(_thisTrainer).faceDown();\n\t\t\t\t\t\tthis._movingTrainers.get(_thisTrainer).setNextDir(1+4);\n\t\t\t\t\t\t}\n\t\t\t\t\telse if(move1x==0 && move1y==-1){\n\t\t\t\t\t\tthis._movingTrainers.get(_thisTrainer).faceUp();\n\t\t\t\t\t\tthis._movingTrainers.get(_thisTrainer).setNextDir(0+4);\n\t\t\t\t\t\t}\n\t\t\t\t\telse if(move1x==1 && move1y==0){\n\t\t\t\t\t\tthis._movingTrainers.get(_thisTrainer).faceRight();\n\t\t\t\t\t\tthis._movingTrainers.get(_thisTrainer).setNextDir(2+4);\n\t\t\t\t\t\t}\n\t\t\t\t\telse if(move1x==-1 && move1y==0){\n\t\t\t\t\t\tthis._movingTrainers.get(_thisTrainer).faceLeft();\n\t\t\t\t\t\tthis._movingTrainers.get(_thisTrainer).setNextDir(3+4);\n\t\t\t\t\t\t}\n\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t\n\t\t\t\t\tthis.repaint();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(method==\"vert\"){\n\t\t\tint moveVx=0;\n\t\t\tint moveVy=0;\n\t\t\tint xIndex;\n\t\t\tint yIndex;\n\t\t\t\n\t\t\tif (who==\"Trainer\"){\n\t\t\t\txIndex=this._movingTrainers.get(_thisTrainer).getXIndex();\n\t\t\t\tyIndex=this._movingTrainers.get(_thisTrainer).getYIndex();\n\t\t\t}\n\t\t\telse{\n\t\t\t\txIndex=this._xIndex;\n\t\t\t\tyIndex=this._yIndex;\n\t\t\t}\n\t\t\tboolean blockedV=false;\n\t\t\t\n\t\t\tif (angle>0 && angle<180){\n\t\t\t\tmoveVy=1;\n\t\t\t\tmoveVx=0;\n\t\t\t}\n\t\t\tif (angle>180 && angle<360){\n\t\t\t\tmoveVy=-1;\n\t\t\t\tmoveVx=0;\n\t\t\t}\n\t\t\tif (angle==0 || angle==360){\n\t\t\t\tmoveVx=-1;\n\t\t\t\tmoveVy=0;\n\t\t\t}\n\t\t\tif (angle==180){\n\t\t\t\tmoveVx=1;\n\t\t\t\tmoveVy=0;\n\t\t\t}\t\n\t\t\t\n\t\t\t\n\t\t\tif((!_gbs.getPlayer().isIgnoring() && who == \"Player\") || who == \"Trainer\"){\n\t\t\t\tif(xIndex + moveVx<=this._room.getX() && yIndex + moveVy<=this._room.getY() && xIndex + moveVx>=0 && yIndex + moveVy>=0){\n\t\t\t\t\t char nextV=this._room._roomGrid[xIndex + moveVx][yIndex + moveVy];\n\t\t\t\t\t if(nextV==NO || nextV==TRAINER || nextV == CUT || nextV==VERTICAL || nextV == RIGHT_LEDGE || nextV == LEFT_LEDGE|| ((nextV==DOOR || nextV== SEAMLESS) && !this._approachTimer.isRunning())|| (nextV== SURF && !this._movingTrainers.get(_thisTrainer).canSurf()) || ((nextV== FREE || nextV == GRASS) && this._movingTrainers.get(_thisTrainer).canSurf()) || (xIndex + moveVx ==this.xObs && yIndex+moveVy==this.yObs)){\n\t\t\t\t blockedV=true;\n\t\t\t\t }\n\t\t\t\t\t for(int j=0; j<this._movingTrainers.size();j++){\n\t\t\t\t\t\t if(xIndex + moveVx ==this._movingTrainers.get(_thisTrainer).getXIndex() && yIndex + moveVy ==this._movingTrainers.get(_thisTrainer).getYIndex()){\n\t\t\t\t\t\t\t if(this._movingTrainers.get(j).isDefeated() && this._movingTrainers.get(j).getVanishing()){}\n\t\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t blockedV=true;\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\tblockedV=true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!blockedV){\n\t\t\t\tthis.convertToMotion(moveVx,moveVy, who);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\tif(xIndex + moveVx==_xIndex && yIndex + moveVy==_yIndex){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).facePlayer(this._xIndex, this._yIndex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(method==\"horiz\"){\n\t\t\tint moveHx=0;\n\t\t\tint moveHy=0;\n\t\t\tint xIndex;\n\t\t\tint yIndex;\n\t\t\t\n\t\t\tif (who==\"Trainer\"){\n\t\t\txIndex=this._movingTrainers.get(_thisTrainer).getXIndex();\n\t\t\tyIndex=this._movingTrainers.get(_thisTrainer).getYIndex();\n\t\t\t}\n\t\t\telse{\n\t\t\t\txIndex=this._xIndex;\n\t\t\t\tyIndex=this._yIndex;\n\t\t\t}\n\t\t\t\n\t\t\tboolean blockedH=false;\n\n\t\t\tif (angle>90 && angle<270){\n\t\t\t\tmoveHy=0;\n\t\t\t\tmoveHx=1;\n\t\t\t}\n\t\t\tif ((angle>270 && angle <=360)||(angle>=0 && angle<90)){\n\t\t\t\tmoveHy=0;\n\t\t\t\tmoveHx=-1;\n\t\t\t}\t\n\t\t\tif (angle==90){\n\t\t\t\tmoveHx=0;\n\t\t\t\tmoveHy=1;\n\t\t\t}\n\t\t\tif (angle==270){\n\t\t\t\tmoveHx=0;\n\t\t\t\tmoveHy=-1;\n\t\t\t}\n\n\t\t\t\n\t\t\tif((!_gbs.getPlayer().isIgnoring() && who == \"Player\") || who == \"Trainer\"){\n\t\t\t\tif(xIndex + moveHx<=this._room.getX() && yIndex + moveHy<=this._room.getY() && xIndex + moveHx>=0 && yIndex + moveHy>=0){\n\t\t\t\t\t char nextH=this._room._roomGrid[xIndex + moveHx][yIndex + moveHy];\n\t\t\t\t\t if(nextH==NO || nextH==TRAINER || nextH == CUT || nextH==VERTICAL || nextH == RIGHT_LEDGE || nextH == LEFT_LEDGE|| ((nextH==DOOR || nextH== SEAMLESS) && !this._approachTimer.isRunning())|| (nextH== SURF && !this._movingTrainers.get(_thisTrainer).canSurf()) || ((nextH== FREE || nextH == GRASS) && this._movingTrainers.get(_thisTrainer).canSurf()) || (xIndex + moveHx ==this.xObs && yIndex+moveHy==this.yObs)){\n\t\t\t\t blockedH=true;\n\t\t\t\t }\n\t\t\t\t\t for(int j=0; j<this._movingTrainers.size();j++){\n\t\t\t\t\t\t if(xIndex + moveHx ==this._movingTrainers.get(_thisTrainer).getXIndex() && yIndex + moveHy ==this._movingTrainers.get(_thisTrainer).getYIndex()){\n\t\t\t\t\t\t\t if(this._movingTrainers.get(j).isDefeated() && this._movingTrainers.get(j).getVanishing()){}\n\t\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t blockedH=true;\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\tblockedH=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (!blockedH){\n\t\t\t\tthis.convertToMotion(moveHx,moveHy, who);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(method==\"drunk\"){\n\t\t\tRandom r = new Random();\n\t\t\tint rand = r.nextInt(100);\n\t\t\t\n\t\t\t//Probabilities:\n\t\t\t//Best move = 50%\n\t\t\tint p1=50;\n\t\t\t//Second best = 15%\n\t\t\tint p2=65;\n\t\t\t//Third best = 10%\n\t\t\tint p3=75;\n\t\t\t//Worst move = 10%\n\t\t\tint p4=85;\n\t\t\t//Doesn't move at all. = 15%\n\t\t\tint p5=100;\n\t\t\t\n\t\t\tif(rand<=p1){\n\t\t\t\tif(!blocked1){\n\t\t\t\t\tthis.convertToMotion(move1x, move1y,who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(rand<=p2){\n\t\t\t\tif(!blocked2){\n\t\t\t\t\tthis.convertToMotion(move2x, move2y, who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(rand<=p3){\n\t\t\t\tif(!blocked3){\n\t\t\t\t\tthis.convertToMotion(move3x, move3y,who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(rand<=p4){\n\t\t\t\tif(!blocked4){\n\t\t\t\t\tthis.convertToMotion(move4x, move4y,who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(rand<=p5){\n\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(method==\"wander\"){\n\t\t\tRandom r = new Random();\n\t\t\tint rand = r.nextInt(100);\n\t\t\t\n\t\t\t//Probabilities:\n\t\t\t//Best move = 65%\n\t\t\tint p1=65;\n\t\t\t//Second best = 10%\n\t\t\tint p2=75;\n\t\t\t//Third best = 5%\n\t\t\tint p3=80;\n\t\t\t//Worst move = 5%\n\t\t\tint p4=85;\n\t\t\t//Doesn't move at all. = 15%\n\t\t\tint p5=100;\n\t\t\t\n\t\t\tif(rand<=p1){\n\t\t\t\tif(!blocked1){\n\t\t\t\t\tthis.convertToMotion(move1x, move1y,who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(rand<=p2){\n\t\t\t\tif(!blocked2){\n\t\t\t\t\tthis.convertToMotion(move2x, move2y, who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(rand<=p3){\n\t\t\t\tif(!blocked3){\n\t\t\t\t\tthis.convertToMotion(move3x, move3y,who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(rand<=p4){\n\t\t\t\tif(!blocked4){\n\t\t\t\t\tthis.convertToMotion(move4x, move4y,who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(rand<=p5){\n\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\n\t}",
"public abstract void randomMoves();",
"@Override\n protected Move makeDecision() {\n myTurn = index();\n /* block the nearest + most effective player (as in, people who arent blocked) */\n ArrayList<Move> pathMoves = new ArrayList<>();\n ArrayList<Move> playMoves = new ArrayList<>();\n ArrayList<Move> discardMoves = new ArrayList<>();\n Map<Integer, Card> destroyCards = new HashMap<Integer, Card>();\n Map<Integer, Card> repairCards = new HashMap<Integer, Card>();\n Map<Integer, Card> blockCards = new HashMap<Integer, Card>();\n Map<Integer, Card> pathCards = new HashMap<Integer, Card>();\n Set<Position> reachable = game().board().getReachable();\n canSee=false;\n canMove=false;\n canBlock=false;\n canRockfall=false;\n canRepair=false;\n int len = hand().size();\n for (int i = 0; i < len; ++i) {\n Card c = hand().get(i);\n if (c instanceof PathCard && !isSabotaged()) {\n pathCards.put(i,c);\n// pathMoves.addAll(generatePossiblePaths(i, (PathCard) c));\n canMove = true;\n }\n if (c instanceof PlayerActionCard) {\n// playMoves.addAll(generatePossiblePlayerActions(i, (PlayerActionCard) c));\n if(c.type()== Card.Type.BLOCK) {\n blockCards.put(i, c);\n canBlock=true;\n }\n else if(c.type()== Card.Type.REPAIR) {\n repairCards.put(i, c);\n canRepair=true;\n }\n }\n if (c.type() == Card.Type.MAP) {\n// playMoves.addAll(generatePossibleMap(i));\n mapIndex = i;\n canSee = true;\n }\n if (c.type() == Card.Type.ROCKFALL) {\n destroyCards.put(i,c);\n// playMoves.addAll(generatePossibleRockfall(i));\n canRockfall = true;\n }\n discardMoves.add(Move.NewDiscardMove(index(), i));\n }\n\n if(canSee) {\n //sum of all heuristics\n double sumGoal[] = new double[3];\n for (Position h : reachable) {\n sumGoal[0]+=(9-(8-h.x)+ 5-(4-h.y));\n sumGoal[1]+=(9-(8-h.x)+ 5-(2-h.y));\n sumGoal[2]+=(9-(8-h.x)+ 5-(-h.y));\n }\n //update goldProb\n for(int i=0; i<3; i++) {\n int seenSum=0;\n for(int j=0; j<numPlayers; j++) {\n if(j!=myTurn) {\n if(haveSeen.get(j)[i]==1) seenSum++;\n }\n }\n goldProb[i] = (i==1?0.5:1)*(1-haveSeen.get(myTurn)[i])*(mapRate*(seenSum/numPlayers)+(sumGoal[i]/10));\n }\n }\n\n// System.out.println(hand());\n// System.out.println(pathMoves);\n\n\n if (role() == Role.GOLD_MINER) {\n //Path\n if(canSee && !goldFound) {\n int selection=0;\n double maxProb=goldProb[0];\n for(int i=0; i<3; i++) {\n if(goldProb[i]>maxProb) {\n maxProb = goldProb[i];\n selection=i;\n }\n }\n Move look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n switch(selection) {\n case 0:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n break;\n case 1:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.MIDDLE);\n break;\n case 2:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.BOTTOM);\n break;\n }\n return look;\n }\n if(canMove) {\n int globalIndex = 0;\n double maxH = 0;\n double oldH;\n Position bp = new Position(0,0);\n boolean rotate = false;\n //Find best path to place;\n Board board = game().board().copy();\n oldH = getClosest(board);\n// System.out.print(getClosest(board)+\" : \");\n for( Map.Entry<Integer, Card> p : pathCards.entrySet()) {\n int index = p.getKey();\n Card path = p.getValue();\n ((PathCard)path).setRotated(false);\n Set<Position> placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n rotate=false;\n }\n }\n ((PathCard) path).setRotated(true);\n placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(simulated);\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n rotate=true;\n maxH = cH;\n }\n }\n }\n// System.out.println(oldH+\": \"+maxH+\" (\"+abs(maxH-oldH)+\")\");\n oldBoard = game().board().copy();\n if(maxH>0 && abs(maxH-oldH)>0.01)\n return Move.NewPathMove(index(), globalIndex, bp.x, bp.y, rotate);\n }\n //Unblock\n if(canRepair) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for(int i=0; i<numPlayers; i++) {\n //heal self\n if(i == myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n// System.out.println(Arrays.toString(game().playerAt(index()).sabotaged()));\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(index()).isRepairable(repair.effects())) {\n return Move.NewPlayerActionMove(index(),index, index());\n }\n }\n }\n else if(i!=myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n// System.out.println(Arrays.toString(game().playerAt(i).sabotaged()));\n if (game().playerAt(i).isRepairable(repair.effects())) {\n //calculate the should i repair? function\n double shouldIBlockMore = Probability[i]+(0.03*(numPlayers-i));\n if(blockMore<shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.75 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Block Enemy\n if(canBlock) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for (int i = 0; i < numPlayers; i++) {\n if (i != myTurn) {\n for (Map.Entry<Integer, Card> b : blockCards.entrySet()) {\n int index = b.getKey();\n PlayerActionCard block = (PlayerActionCard) b.getValue();\n if (game().playerAt(i).isSabotageable(block.effects()[0])) {\n //calculate the should i repair? function\n double shouldIBlockMore = (1 - Probability[i]) * ((1 - Probability[i]) + 0.2 * (numPlayers - i));\n if (blockMore < shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.6 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Fix (Rockfall)\n if(canRockfall) {\n int globalIndex = 0;\n double maxH = 0.0;\n Position bp = new Position(0,0);\n //Find best path to place;\n Board board = game().board().copy();\n for( Map.Entry<Integer, Card> d : destroyCards.entrySet()) {\n int index = d.getKey();\n Set<Position> destroyable = game().board().getDestroyable();\n for (Position h : destroyable) {\n Board simulated = board.simulateRemoveCardAt(h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0)\n return Move.NewRockfallMove(index(), globalIndex, bp.x, bp.y);\n }\n //See map\n\n //Conserve (Find the best card to discard)\n\n //calculate the heuristics and adjust accordingly,\n //choose between playing a card or discarding.\n } else if (role() == Role.SABOTEUR) {\n //See map\n if(canSee && !goldFound) {\n int selection=0;\n //specific for saboteurs\n double maxProb=goldProb[0];\n for(int i=0; i<3; i++) {\n if(goldProb[i]>maxProb) {\n maxProb = goldProb[i];\n selection=i;\n }\n }\n Move look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n switch(selection) {\n case 0:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n break;\n case 1:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.MIDDLE);\n break;\n case 2:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.BOTTOM);\n break;\n }\n return look;\n }\n //Path\n if(canMove) {\n int globalIndex = 0;\n double maxH = 0.0;\n Position bp = new Position(0,0);\n boolean rotate = false;\n //Find best path to place;\n Board board = game().board().copy();\n double oldH = getClosestSabotage(board);\n for( Map.Entry<Integer, Card> p : pathCards.entrySet()) {\n int index = p.getKey();\n Card path = p.getValue();\n ((PathCard)path).setRotated(false);\n Set<Position> placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n rotate=false;\n }\n }\n ((PathCard) path).setRotated(true);\n placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(simulated);\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n rotate=true;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0 && abs(maxH-oldH)>0.01)\n return Move.NewPathMove(index(), globalIndex, bp.x, bp.y, rotate);\n }\n //Unblock Friend\n if(canRepair) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for(int i=0; i<numPlayers; i++) {\n if(i == myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(myTurn).isRepairable(repair.effects())) {\n return Move.NewPlayerActionMove(index(),index, index());\n }\n }\n }\n else if(i!=myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(i).isRepairable(repair.effects())) {\n //calculate the should i repair? function\n double shouldIBlockMore = (1-Probability[i])+(0.03*(numPlayers-i));\n if(blockMore<shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.75 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Block Enemy\n if(canBlock) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for (int i = 0; i < numPlayers; i++) {\n if (i != myTurn) {\n for (Map.Entry<Integer, Card> b : blockCards.entrySet()) {\n int index = b.getKey();\n PlayerActionCard block = (PlayerActionCard) b.getValue();\n if (game().playerAt(i).isSabotageable(block.effects()[0])) {\n //calculate the should i repair? function\n double shouldIBlockMore = (Probability[i]) * ((Probability[i]) + 0.2 * (numPlayers - i));\n if (blockMore < shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.6 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Sabotage (Rockfall)\n if(canRockfall) {\n int globalIndex = 0;\n double maxH = 0;\n Position bp = new Position(0,0);\n //Find best path to place;\n Board board = game().board().copy();\n for( Map.Entry<Integer, Card> d : destroyCards.entrySet()) {\n int index = d.getKey();\n Set<Position> destroyable = game().board().getDestroyable();\n for (Position h : destroyable) {\n Board simulated = board.simulateRemoveCardAt(h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0)\n return Move.NewRockfallMove(index(), globalIndex, bp.x, bp.y);\n }\n //Conserve (Find the best card to discard\n\n //calculate the heuristics and adjust accordingly,\n //choose between playing a card or discarding.\n }\n return discardMoves.get(0);\n }",
"public static void battle(int choice) {\n \t\tboolean monsterHeal = false;\r\n \t\tboolean monsterDefend = false;\r\n \t\tboolean monsterAttack = false;\r\n \t\tboolean playerDefend = false;\r\n \t\tboolean playerAttack = false;\r\n \t\tboolean playerHeal = false;\r\n \t\t\r\n \t\t//Get the move the monster will make\r\n \t\tint monsterAi = monster.getAiChoice();\r\n \t\t\r\n \t\t//Check what input the player has given\r\n \t\tif(choice == 1) {\r\n \t\t\t//Set the booleans according to the input for attack\r\n \t\t\tplayerAttack = true;\r\n \t\t\tplayerDefend = false;\r\n \t\t\tplayerHeal = false;\r\n \t\t} else if(choice == 2) {\r\n \t\t\t//Set the booleans according to the input for defend\r\n \t\t\tplayerDefend = true;\r\n \t\t\tplayerAttack = false;\r\n \t\t\tplayerHeal = false;\r\n \t\t} else if(choice == 3) {\r\n \t\t\t//Set the booleans according to the input for heal\r\n \t\t\tplayerAttack = false;\r\n \t\t\tplayerDefend = false;\r\n \t\t\tplayerHeal = true;\r\n \t\t} else {\r\n \t\t\t//Set the player not to do anything if the input is wrong\r\n \t\t\tplayerAttack = false;\r\n \t\t\tplayerDefend = false;\r\n \t\t\tplayerHeal = false;\r\n \t\t}\r\n \t\t\r\n \t\t//Link the monster AI choice to a move\r\n \t\tif(monsterAi == 1) {\r\n \t\t\t//Set the booleans according to the AI for attack\r\n \t\t\tmonsterAttack = true;\r\n \t\t\tmonsterDefend = false;\r\n \t\t\tmonsterHeal = false;\r\n \t\t} else if(monsterAi == 2) {\r\n \t\t\t//Set the booleans according to the AI for defend\r\n \t\t\tmonsterAttack = true;\r\n \t\t\tmonsterDefend = false;\r\n \t\t\tmonsterHeal = false;\r\n \t\t} else if(monsterAi == 3) {\r\n \t\t\t//Set the booleans according to the AI for heal\r\n \t\t\tmonsterAttack = false;\r\n \t\t\tmonsterDefend = false;\r\n \t\t\tmonsterHeal = true;\r\n \t\t}\r\n \t\t\r\n \t\tString pFirst = \"\";\r\n \t\tString mFirst = \"\";\r\n \t\tString mAttack = \"\";\r\n \t\tString pAttack = \"\";\r\n \t\tString pLife = \"\";\r\n \t\tString mLife = \"\";\r\n \t\t\r\n \t\t//Player moves\r\n \t\tif(playerHeal) {\r\n \t\t\t//Heal the player by 10 life\r\n \t\t\tplayer.Heal(10);\r\n \t\t\t//Show a message saying the player was healed\r\n \t\t\tpFirst = player.name + \" healed 10 life! \\n\";\r\n \t\t} else if(playerDefend) {\r\n \t\t\t//Set the monster not to attack (do damage)\r\n \t\t\tmonsterAttack = false;\r\n \t\t\t//Shows a message that the player has defended\r\n \t\t\tpFirst = player.name + \" defended and has got 0 damage from \" + monster.name + \"\\n\";\r\n \t\t} else if(!playerAttack && !playerDefend && !playerHeal) {\r\n \t\t\t//Show a message that the player did not do anything\r\n \t\t\tpFirst = player.name + \" did nothing. \\n\";\r\n \t\t} \r\n \t\t\r\n \t\t//Monster moves\r\n \t\tif(monsterHeal) {\r\n \t\t\t//heal the monster by 10 life\r\n \t\t\tmonster.Heal(10);\r\n \t\t\t//Show a message that the monster was healed\r\n \t\t\tmFirst = (monster.name + \" healed 10 life! \\n\");\r\n \t\t} else if(monsterDefend) {\r\n \t\t\t//Set the player not to attack (do damage)\r\n \t\t\tplayerAttack = false;\r\n \t\t\t//Show a message that the monster has defended\r\n \t\t\tmFirst = monster.name + \" defended and has got 0 damage from \" + player.name + \"\\n\";\r\n \t\t}\r\n \t\t\r\n \t\t//Attack moves\r\n \t\tif(playerAttack) {\r\n \t\t\t//Lower the monsters life by the players power\r\n \t\t\tmonster.life -= player.strength;\r\n \t\t} \r\n \t\t\r\n \t\tif(monsterAttack) {\r\n \t\t\t//Lower the players life by the monsters power\r\n \t\t\tplayer.life -= monster.strength;\r\n \t\t}\r\n \t\tif(playerAttack) {\r\n \t\t\t//Show a message that the player has attacked\r\n \t\t\tpAttack = player.name + \" hit \" + monster.name + \" for \" + player.strength + \" damage. \\n\";\r\n \t\t}\r\n \t\tif(monsterAttack) {\r\n \t\t\t//Show a message that the monster has attacked\r\n \t\t\tmAttack = monster.name + \" hit \" + player.name + \" for \" + monster.strength + \" damage. \\n\";\r\n \t\t}\r\n \t\t\r\n \t\t//Show the current life for the player and the monster\r\n \t\tpLife = player.name + \" does now have \" + player.life + \" life left. \\n\";\r\n \t\tmLife = monster.name + \" does now have \" + monster.life + \" life left. \\n\";\r\n \t\t\r\n \t\t//Print the moves message\r\n \t\tMainGame.display.disp(pFirst + mFirst + pAttack + mAttack + pLife + mLife);\r\n \t\t\r\n\t\t//Check if the player is still alive\r\n \t\tif(player.life <= 0) {\r\n \t\t\t\r\n \t\t\t//If the player has no life left, show him that he has lost\r\n \t\t\tMainGame.display.disp(\"Too bad! You lost!\" + \"\\n\" + \"Play again?\");\r\n \t\t\t\r\n \t\t\t//Show the option to play again\r\n \t\t\tMainGame.display.Enable(MainGame.display.playAgain);\r\n \t\t}\r\n \t\t\r\n\t\t//Check if the monster is still alive\r\n \t\tif(monster.life <= 0) {\r\n \t\t\t\r\n \t\t\tplayer.xp += monster.giveXp;\r\n \t\t\tMainGame.display.disp(\"You beat \" + monster.name + \"! \\n\" + \"You got \" + monster.giveXp + \" XP!\" + \"\\n\" + \"You now have \" + player.xp + \" XP!\");\r\n \t\t\t\r\n \t\t\tMainGame.display.Enable(MainGame.display.continueStage);\r\n \t\t}\r\n \t\t\r\n\t\tMainGame.display.Enable(MainGame.display.continueFight);\r\n \t\r\n \t}",
"@Override\n public void doAction() {\n String move = agent.getBestMove(currentPosition);\n execute(move);\n\n //Location of the player\n int cX = w.getPlayerX();\n int cY = w.getPlayerY();\n\n if (w.hasWumpus(cX, cY)) {\n System.out.println(\"Wampus is here\");\n w.doAction(World.A_SHOOT);\n } else if (w.hasGlitter(cX, cY)) {\n System.out.println(\"Agent won\");\n w.doAction(World.A_GRAB);\n } else if (w.hasPit(cX, cY)) {\n System.out.println(\"Fell in the pit\");\n }\n\n// //Basic action:\n// //Grab Gold if we can.\n// if (w.hasGlitter(cX, cY)) {\n// w.doAction(World.A_GRAB);\n// return;\n// }\n//\n// //Basic action:\n// //We are in a pit. Climb up.\n// if (w.isInPit()) {\n// w.doAction(World.A_CLIMB);\n// return;\n// }\n//\n// //Test the environment\n// if (w.hasBreeze(cX, cY)) {\n// System.out.println(\"I am in a Breeze\");\n// }\n// if (w.hasStench(cX, cY)) {\n// System.out.println(\"I am in a Stench\");\n// }\n// if (w.hasPit(cX, cY)) {\n// System.out.println(\"I am in a Pit\");\n// }\n// if (w.getDirection() == World.DIR_RIGHT) {\n// System.out.println(\"I am facing Right\");\n// }\n// if (w.getDirection() == World.DIR_LEFT) {\n// System.out.println(\"I am facing Left\");\n// }\n// if (w.getDirection() == World.DIR_UP) {\n// System.out.println(\"I am facing Up\");\n// }\n// if (w.getDirection() == World.DIR_DOWN) {\n// System.out.println(\"I am facing Down\");\n// }\n//\n// //decide next move\n// rnd = decideRandomMove();\n// if (rnd == 0) {\n// w.doAction(World.A_TURN_LEFT);\n// w.doAction(World.A_MOVE);\n// }\n//\n// if (rnd == 1) {\n// w.doAction(World.A_MOVE);\n// }\n//\n// if (rnd == 2) {\n// w.doAction(World.A_TURN_LEFT);\n// w.doAction(World.A_TURN_LEFT);\n// w.doAction(World.A_MOVE);\n// }\n//\n// if (rnd == 3) {\n// w.doAction(World.A_TURN_RIGHT);\n// w.doAction(World.A_MOVE);\n// }\n }",
"void move()\n {\n Random rand = new Random();\n int moveOrNot = rand.nextInt(2);//50% chance\n if(moveOrNot == 1)\n super.move();\n }",
"private MoveAction wanderRandomly() {\n\t\tint intDir = rand.nextInt(8) + 1;\n\t\tDirection direction = Direction.fromInt(intDir);\n\t\treturn moveInDirection(direction);\n\t}",
"private void castSpellByAI() {\n\t\tboolean spellIsNotActivated = true;\n\t\tboolean[] spellsFlags = new boolean[3];\n\t\tChampion AI = currentTask.getCurrentChamp();\n\t\tArrayList<Spell> spells = ((Wizard)AI).getSpells();\n\t\twhile(spellIsNotActivated){\n\t\t\t\n\t\t\tint randomAction = (int) (Math.random()*2);\n\t\t\tSpell spell = null;\n\t\t\t\n\t\t\tswitch(randomAction){\n\t\t\tcase 0: if(spellsFlags[0]==false) {spell = spells.get(0); spellsFlags[0]=true; break;}\n\t\t\tcase 1:\tif(spellsFlags[1]==false) {spell = spells.get(1); spellsFlags[1]=true; break;}\n\t\t\tdefault: if(spellsFlags[2]==false) {spell = spells.get(2); spellsFlags[2] =true;}\n\t\t\t}\n\t\t\t\n\t\t\tif(spell instanceof HealingSpell){\n\t\t\t\tcastHealingSpell(spell);\n\t\t\t}else if(spell instanceof DamagingSpell){\n\t\t\t\tDirection direction;\n\t\t\t\tint randomDirection = (int) (Math.random()*3);\n\t\t\t\tswitch(randomDirection){\n\t\t\t\tcase 0: direction = Direction.BACKWARD;\n\t\t\t\tcase 1: direction = Direction.FORWARD;\n\t\t\t\tcase 2: direction = Direction.LEFT;\n\t\t\t\tdefault: direction = Direction.RIGHT;\n\t\t\t\t}\n\t\t\t\tspellInAction = spell;\n\t\t\t\tdirectionsInAction = new ArrayList<Direction>();\n\t\t\t\tdirectionsInAction.add(direction);\n\t\t\t\tcastDamagingSpell();\n\t\t\t}else if(spell instanceof RelocatingSpell){\n\t\t\t\tDirection direction1;\n\t\t\t\tint randomDirection1 = (int) (Math.random()*3);\n\t\t\t\tswitch(randomDirection1){\n\t\t\t\tcase 0: direction1 = Direction.BACKWARD;\n\t\t\t\tcase 1: direction1 = Direction.FORWARD;\n\t\t\t\tcase 2: direction1 = Direction.LEFT;\n\t\t\t\tdefault: direction1 = Direction.RIGHT;\n\t\t\t\t}\n\t\t\t\tDirection direction2;\n\t\t\t\tint randomDirection2 = (int) (Math.random()*3);\n\t\t\t\tswitch(randomDirection2){\n\t\t\t\tcase 0: direction2 = Direction.BACKWARD;\n\t\t\t\tcase 1: direction2 = Direction.FORWARD;\n\t\t\t\tcase 2: direction2 = Direction.LEFT;\n\t\t\t\tdefault: direction2 = Direction.RIGHT;\n\t\t\t\t}\n\t\t\t\tspellInAction = spell;\n\t\t\t\tdirectionsInAction = new ArrayList<Direction>();\n\t\t\t\tdirectionsInAction.add(direction1);\n\t\t\t\tdirectionsInAction.add(direction2);\n\t\t\t\t\n\t\t\t\tint randomRange = (int) (Math.random()*((RelocatingSpell)spell).getRange()) + 1;\n\t\t\t\tcastRelocatingSpell(randomRange);\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tspellIsNotActivated = false;\n\t\t\t}\n\t\t\tif(AI != currentTask.getCurrentChamp()){\n\t\t\t\tspellIsNotActivated = false;\n\t\t\t}\n\t\t}\n\n\t\t\n\t\t\n\t}",
"private void goAdventure() {\n\n\t\tint experience = playern.getExp();\n\t\tint random = randomHelper.randomten();\n\n\t\t/**\n\t\t * Random part that starts with 10% occurance when user chooses goAdventuring()\n\t\t */\n\t\tif (random == 0) {\n\t\t\tSystem.out.println(\"You see nothing but unicorns running in the swaying grass..\");\n\t\t\tSystem.out.println(\"[press enter to continue]\");\n\t\t\tsc.nextLine();\n\t\t}\n\n\t\t/**\n\t\t * Chooses storyboard and battle depending on experience level\n\t\t */\n\t\tif (experience >= 40) {\n\t\t\tStoryboardTwo.leveltwo();\n\t\t\tbattleSpider();\n\t\t}else {\n\t\t\tStoryboard.intro();\n\t\t\tbattleVampire();\n\t\t}\n\t\t}",
"public static void Random() {\n\t\tRandom ran =new Random();\r\n\t\trandom=ran.nextInt(6)+1;\r\n\t\t//random=1;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tif((ch[who].status)>0) {\r\n\t\t\tch[who].location=(ch[who].location)+random;\r\n\t\t\tch[who].status=(ch[who].status)-1;\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\r\n\t}",
"public PentagoMove alphabetaw(PentagoBoardState boardState){\n PentagoBoardState pbs = (PentagoBoardState) boardState.clone();\n ArrayList<PentagoMove> legalmoves = pbs.getAllLegalMoves();\n\n PentagoMove bestmove = legalmoves.get(0);\n PentagoMove bestopponentmove = new PentagoMove(0,0,0,0,0);\n int bestmovescore = -9999999;\n int bestwhitescore = 0;\n //ArrayList<Integer> scores = new ArrayList<Integer>();\n for(int i = 0;i<legalmoves.size()-1;i++){\n\n PentagoBoardState newboard = (PentagoBoardState) pbs.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove next = legalmoves.get(i);\n\n newboard.processMove(next);\n\n int score = evaluate(newboard);\n //scores.add(score);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n\n if(score > 100000){\n newboard.getWinner();\n newboard.printBoard();\n System.out.println(\"FOUND A WINNER\" + score);\n return next;\n }\n\n\n PentagoMove currentopponentmove;\n ArrayList<PentagoMove> opponentlegalmoves = newboard.getAllLegalMoves();\n if (opponentlegalmoves.size()!=0){\n currentopponentmove = opponentlegalmoves.get(0);\n }\n\n int minopponentmovescore = 999999;\n int thismovescore = -9999;\n ArrayList<PentagoMove> bestopponentmoves = new ArrayList<PentagoMove>();\n PentagoMove currentbestopponentmove = new PentagoMove(0,0,0,0,0);\n\n for(int a = 0;a<opponentlegalmoves.size()-1;a++){\n\n PentagoBoardState pbsopponent = (PentagoBoardState) newboard.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove opponentnext = opponentlegalmoves.get(a);\n\n pbsopponent.processMove(opponentnext);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n //pbs.printBoard();\n\n int opponentscore = evaluate(pbsopponent);\n\n\n\n\n\n if (minopponentmovescore>opponentscore){\n //currentopponentmove = opponentnext;\n minopponentmovescore = opponentscore;\n bestopponentmoves.add(opponentnext);\n currentbestopponentmove = opponentnext;\n }\n\n\n }\n bestopponentmove = currentbestopponentmove;\n //lvl 3\n /*\n\n int lvl3minscore =99999;\n PentagoMove currentmaxmove;\n for (int r = 0;r<bestopponentmoves.size()-1;r++) {\n PentagoBoardState pbsopponent = (PentagoBoardState) newboard.clone();\n pbsopponent.processMove(bestopponentmoves.get(r));\n\n ArrayList<PentagoMove> maxlegalmoves = pbsopponent.getAllLegalMoves();\n if (maxlegalmoves.size() != 0) {\n currentmaxmove = maxlegalmoves.get(0);\n }\n int opponentscore = evaluate(pbsopponent);\n int findminmaxmovescore = -99999;\n for (int s = 0; s < maxlegalmoves.size() - 1; s++) {\n\n PentagoBoardState maxboard = (PentagoBoardState) pbsopponent.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove maxnext = maxlegalmoves.get(s);\n\n maxboard.processMove(maxnext);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n //pbs.printBoard();\n\n int maxnextscore = evaluate(pbsopponent);\n if (findminmaxmovescore < maxnextscore) {\n currentmaxmove = maxnext;\n findminmaxmovescore = maxnextscore;\n }\n }\n if (thismovescore<findminmaxmovescore){\n //currentopponentmove = opponentnext;\n thismovescore = findminmaxmovescore;\n }\n\n //opponentscore = maxmovescore;\n }\n\n //end experiment\n\n\n\n\n if (mycolour ==1){\n lvl3minscore =minopponentmovescore;\n }\n */\n if (minopponentmovescore>bestmovescore){//minopponentmovescore\n System.out.println(\"max player move score: \"+score + \"Min : \" + minopponentmovescore);\n bestmovescore = minopponentmovescore;\n bestmove = next;\n bestwhitescore = score;\n\n }\n else if (minopponentmovescore == bestmovescore){\n if (score > bestwhitescore){\n System.out.println(\"max player move score: \"+score + \"Min : \" + minopponentmovescore);\n bestmovescore = minopponentmovescore;\n bestmove = next;\n bestwhitescore = score;\n }\n\n\n\n }\n\n\n }\n System.out.println(\"final max player move score: \"+ bestmovescore + \"\\n My best move: \"+bestmove.toPrettyString() + \"\\n My best move: \"+ bestopponentmove.toPrettyString());\n return bestmove;\n }",
"public void randomMove(){\n ArrayList<Hole> availableHoles = availableMoves(nextToPlay);\n int holeIndex = (int)(Math.random() * (((availableHoles.size()-1) - 0) + 1)) + 0;\n ArrayList<Korgool> korgools = availableHoles.get(holeIndex).getKoorgools();\n while(korgools.size() == 0){\n holeIndex = (int)(Math.random() * (((availableHoles.size()-1) - 0) + 1)) + 0;\n korgools = availableHoles.get(holeIndex).getKoorgools();\n }\n redistribute(availableHoles.get(holeIndex).getHoleIndex());\n }",
"private void wander(){\n\t\tmonster.moveRandom();\r\n\t\tsaveMove();\r\n\t}",
"public void simulation(){\n GameInformation gi = this.engine.getGameInformation();\n Point ball = gi.getBallPosition();\n Player playerSelected;\n int xTemp;\n team = gi.getTeam(ball.x , ball.y);\n\n //Attack\n if(team == gi.activeActor){\n selectAttackerPlayer(gi.getPlayerTeam(gi.activeActor));\n doAttackMoove(playerOne.getPosition(), gi.cells[(int) playerOne.getPosition().getX()][(int) playerOne.getPosition().getY()].playerMoves);\n selectProtectPlayer(gi.getPlayerTeam(gi.activeActor));\n doProtectMoove(playerTwo.getPosition(), playerOne.getPosition() ,gi.cells[(int) playerTwo.getPosition().getX()][(int) playerTwo.getPosition().getY()].playerMoves);\n playerOne = null;\n playerTwo = null;\n this.engine.next();\n }\n else{//Defense\n selectCloserPlayer(gi.getPlayerTeam(gi.activeActor));\n doDefenseMoove(playerOne.getPosition(), this.engine.getGameInformation().getBallPosition() ,gi.cells[(int) playerOne.getPosition().getX()][(int) playerOne.getPosition().getY()].playerMoves);\n selectCloserPlayer(gi.getPlayerTeam(gi.activeActor));\n doDefenseMoove(playerOne.getPosition(), this.engine.getGameInformation().getBallPosition() ,gi.cells[(int) playerOne.getPosition().getX()][(int) playerOne.getPosition().getY()].playerMoves);\n TacklAction tackl = new TacklAction();\n tackl.setSource(playerOne.getPosition());\n VisualArea[] area;\n if ( area = tackl.getVisualArea(this.engine.getGameInformation() ) != null ){\n tackl.setDestination(area[0]);\n this.engine.performAction( tackl );\n }\n\n tackl.setSource(playerTwo.getPosition());\n\n if ( area = tackl.getVisualArea(this.engine.getGameInformation() ) != null ){\n tackl.setDestination(area[0]);\n this.engine.performAction( tackl );\n }\n playerOne = null;\n playerTwo = null;\n }\n }",
"public void AI()\r\n\t{\r\n\t\tRandom random = new Random();\r\n\t\tspeed = random.nextInt(2) + 1;\r\n\t\tif (canMove)\r\n\t\t{\r\n\t\t\tif (randomAxis == 1)\r\n\t\t\t{\r\n\t\t\t\tif (xDestination < this.x)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.x -= this.speed;\r\n\t\t\t\t\tthis.hitBox.addX(-(this.speed));\r\n\t\t\t\t\tdirection = KeysDefiner.LEFT;\r\n\t\t\t\t}\r\n\t\t\t\telse if (xDestination > this.x)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.x += this.speed;\r\n\t\t\t\t\tthis.hitBox.addX(this.speed);\r\n\t\t\t\t\tdirection = KeysDefiner.RIGHT;\r\n\t\t\t\t}\r\n\t\t\t\telse if (xDestination == this.x)\r\n\t\t\t\t\trandomAxis = 2;\r\n\t\t\t}\r\n\t\t\telse if (randomAxis == 2)\r\n\t\t\t{\r\n\t\t\t\tif (yDestination < this.y)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.y -= this.speed;\r\n\t\t\t\t\tthis.hitBox.addY(-(this.speed));\r\n\t\t\t\t\tdirection = KeysDefiner.UP;\r\n\t\t\t\t}\r\n\t\t\t\telse if (yDestination > this.y)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.y += this.speed;\r\n\t\t\t\t\tthis.hitBox.addY(this.speed);\r\n\t\t\t\t\tdirection = KeysDefiner.DOWN;\r\n\t\t\t\t}\r\n\t\t\t\telse if (yDestination == this.y)\r\n\t\t\t\t\trandomAxis = 1;\r\n\t\t\t}\r\n\t\t\tif (yDestination == this.y && xDestination == this.x)\r\n\t\t\t{\r\n\t\t\t\tif (spotsNumber == 1)\r\n\t\t\t\t{\r\n\t\t\t\t\txDestination = random.nextInt(SCREEN_W / 2) * 2;\r\n\t\t\t\t\tyDestination = random.nextInt(SCREEN_H / 2) * 2;\r\n\t\t\t\t\tspotsNumber++;\r\n\t\t\t\t}\r\n\t\t\t\telse if (spotsNumber == 2)\r\n\t\t\t\t{\r\n\t\t\t\t\txDestination = -(SCREEN_W / 21);\r\n\t\t\t\t\tyDestination = -(SCREEN_H / 12);\r\n\t\t\t\t\tspotsNumber++;\r\n\t\t\t\t}\r\n\t\t\t\telse lastDestinationReached = true;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void goAdventuring() {\n\n game.createRandomMonster(4);\n if(RandomClass.getRandomTenPercent() == 5) {\n System.out.println(\"Your are walking down the road... Everything looks peaceful and calm.. Hit enter to continue!\");\n sc.nextLine();\n\n } else {\n game.battle();\n p.checkXp();\n }\n }",
"@Override\n public void logic() throws PogamutException {\n /*\n * Step:\n * 1. find the bot and approach him (get near him ... distance < 200)\n * 2. greet him by saying \"Hello!\"\n * 3. upon receiving reply \"Hello, my friend!\"\n * 4. answer \"I'm not your friend.\"\n * 5. and fire a bit at CheckerBot (do not kill him, just a few bullets)\n * 6. then CheckerBot should tell you \"COOL!\"\n * 7. then CheckerBot respawns itself\n * 8. repeat 1-6 until CheckerBot replies with \"EXERCISE FINISHED\"\n */\n Location loc = new Location(0, 0, 0);\n weaponry.changeWeapon(UT2004ItemType.ASSAULT_RIFLE);\n switch (state) {\n case 0: // navigate to random point\n if (!navigation.isNavigating())\n navigation.navigate(this.navPoints.getRandomNavPoint());\n if (players.canSeePlayers()) {\n loc = players.getNearestVisiblePlayer().getLocation();\n navigation.navigate(loc);\n log.info(\"Bot see player on \" + loc.toString());\n }\n if (loc.getDistance(bot.getLocation()) < 190) {\n navigation.stopNavigation();\n log.info(\"Bot is close enough\");\n state = 1;\n }\n if (congrats_receive) {\n log.info(\"Received info about success\");\n state = 7;\n }\n break;\n case 1: // nearby player\n this.sayGlobal(\"Hello!\");\n resetTimeout();\n state = 2;\n break;\n case 2: //waiting for answer\n tickTimeout();\n if (received.equals(\"Hello, my friend!\")) {\n log.info(\"Answer received\");\n state = 3;\n }\n else if (receiveTimeout) {\n log.warning(\"Answer didn't received, repeating.\");\n navigation.navigate(navPoints.getRandomNavPoint());\n state = 0;\n }\n break;\n case 3: // say back\n this.sayGlobal(\"I'm not your friend.\");\n state = 4;\n break;\n case 4:\n if (players.getNearestVisiblePlayer() == null) {\n log.warning(\"Resetting because no player in view\");\n state = 0;\n } else {\n shoot.shoot(players.getNearestVisiblePlayer());\n log.info(\"Start shooting at the enemy\");\n resetTimeout();\n state = 5;\n }\n break;\n case 5:\n tickTimeout();\n if (damaged) {\n shoot.stopShooting();\n damaged = false;\n resetTimeout();\n log.info(\"Enemy damaged\");\n state = 6;\n } else if (receiveTimeout) {\n log.warning(\"Resetting because not damage to the enemy\");\n state = 0;\n }\n break;\n case 6:\n tickTimeout();\n if (cool_received){\n log.info(\"Success in the turn, repeating\");\n cool_received = false;\n resetTimeout();\n state = 0;\n }\n else if(receiveTimeout) {\n log.warning(\"No final answer, repeating\");\n state = 0;\n }\n break;\n case 7:\n sayGlobal(\"I solved the exercise.\");\n }\n }",
"public abstract void makeBestMove();",
"public boolean startBattle()\n {\n if(a.getHealth() <= 0) //if the health is 0 then you lose\n {\n return false; //lose\n }\n if(b.getHealth() <= 0) //if AI is 0 you when\n {\n return true; //win\n }\n if(gotAway)\n {\n return false;\n }\n if(!init) //first time\n {\n System.out.println(\"Go \" + a.getName() + \"!\");\n init = true; //sets it so its not first time anymore\n }\n System.out.println(\"What will \" + a.getName() + \" do?\");\n System.out.println(\"1. Fight 2. Run\");\n Scanner scanner = new Scanner(System.in); //scan for user input, fight or run\n int choice = scanner.nextInt();\n switch(choice) //switch for choices of options\n {\n case 1:\n {\n // Display move options\n System.out.println(\"Fight!\");\n for(int i = 1; i < a.actions.length + 1; i++) //print out all of the possible moves\n {\n System.out.println(i + \". \" + a.actions[i - 1]);\n }\n int fightSelection = scanner.nextInt();\n if(fightSelection < 1 || fightSelection > 4) //keeps the selection within boundaries\n {\n System.out.println(\"INVALID CHOICE\");\n startBattle();\n } else\n {\n Actions current = a.actions[fightSelection - 1];\n if(hit(current.getAccuracy())) //if the attack hits\n {\n b.subtractHealth(current.getPower()); //AIHealth - power\n current.subtractPp(1); //-PP\n //Display stats\n System.out.println(a.getName() + \" used \" + current.getName());\n System.out.println(a.getName() + \" Health: \" + a.getHealth());\n System.out.println(b.getName() + \" Health: \" + b.getHealth());\n if(a.getHealth() <= 0)\n {\n return false;\n }\n if(b.getHealth() <= 0)\n {\n return true;\n }\n break;\n } else\n {\n System.out.println(a.getName() + \" missed!\");\n System.out.println(a.getName() + \" Health: \" + a.getHealth());\n System.out.println(b.getName() + \" Health: \" + b.getHealth());\n current.subtractPp(1);\n if(a.getHealth() <= 0)\n {\n return false;\n }\n if(b.getHealth() <= 0)\n {\n return true;\n }\n break;\n }\n }\n break;\n }\n case 2:\n {\n // Run\n if(hit(75))\n {\n // Run away successful\n System.out.println(\"Got away safely\");\n gotAway = true;\n break;\n } else\n {\n System.out.println(\"Can't escape!\");\n gotAway = false;\n break;\n }\n\n }\n default:\n {\n System.out.println(\"Please choose a valid choice.\");\n startBattle();\n }\n }\n if(a.getHealth() <= 0)\n {\n return false;\n }\n if(b.getHealth() <= 0)\n {\n return true;\n }\n\n if(!gotAway)\n {\n // AI Turn\n Random random = new Random();\n int move = random.nextInt(4);\n int counter = 0;\n while(b.actions[move].getPp() <= 0 && counter < 50)\n {\n move = random.nextInt(4); //picks a random move\n counter++;\n }\n Actions aiAction = b.actions[move];\n if(hit(aiAction.getAccuracy()))\n {\n a.subtractHealth(aiAction.getPower());\n aiAction.subtractPp(1);\n System.out.println(b.getName() + \" used \" + aiAction.getName());\n System.out.println(a.getName() + \" Health: \" + a.getHealth());\n System.out.println(b.getName() + \" Health: \" + b.getHealth());\n if(a.getHealth() <= 0)\n {\n return false;\n }\n if(b.getHealth() <= 0)\n {\n return true;\n }\n } else\n {\n System.out.println(b.getName() + \" missed!\");\n System.out.println(a.getName() + \" Health: \" + a.getHealth());\n System.out.println(b.getName() + \" Health: \" + b.getHealth());\n aiAction.subtractPp(1);\n if(a.getHealth() <= 0)\n {\n return false;\n }\n if(b.getHealth() <= 0)\n {\n return true;\n }\n }\n startBattle();\n return false;\n }\n return false;\n }",
"public void think_blocking()\r\n/* 37: */ {\r\n/* 38: 33 */ Scanner in = new Scanner(System.in);\r\n/* 39: */ Object localObject;\r\n/* 40:143 */ for (;; ((Iterator)localObject).hasNext())\r\n/* 41: */ {\r\n/* 42: 38 */ System.out.print(\"Next action ([move|land|attk] id; list; exit): \");\r\n/* 43: */ \r\n/* 44: 40 */ String[] cmd = in.nextLine().split(\" \");\r\n/* 45: */ \r\n/* 46: 42 */ System.out.print(\"Processing command... \");\r\n/* 47: 43 */ System.out.flush();\r\n/* 48: */ \r\n/* 49: 45 */ this.game.updateSimFrame();\r\n/* 50: */ \r\n/* 51: */ \r\n/* 52: */ \r\n/* 53: */ \r\n/* 54: */ \r\n/* 55: */ \r\n/* 56: 52 */ MapView<Integer, Base.BasicView> bases = this.game.getAllBases();\r\n/* 57: 53 */ MapView<Integer, Plane.FullView> planes = this.game.getMyPlanes();\r\n/* 58: 54 */ MapView<Integer, Plane.BasicView> ennemy_planes = this.game.getEnnemyPlanes();\r\n/* 59: */ \r\n/* 60: 56 */ List<Command> coms = new ArrayList();\r\n/* 61: */ try\r\n/* 62: */ {\r\n/* 63: 59 */ boolean recognized = true;\r\n/* 64: 60 */ switch ((localObject = cmd[0]).hashCode())\r\n/* 65: */ {\r\n/* 66: */ case 3004906: \r\n/* 67: 60 */ if (((String)localObject).equals(\"attk\")) {}\r\n/* 68: */ break;\r\n/* 69: */ case 3127582: \r\n/* 70: 60 */ if (((String)localObject).equals(\"exit\")) {\r\n/* 71: */ break label914;\r\n/* 72: */ }\r\n/* 73: */ break;\r\n/* 74: */ case 3314155: \r\n/* 75: 60 */ if (((String)localObject).equals(\"land\")) {\r\n/* 76: */ break;\r\n/* 77: */ }\r\n/* 78: */ break;\r\n/* 79: */ case 3322014: \r\n/* 80: 60 */ if (((String)localObject).equals(\"list\")) {}\r\n/* 81: */ case 3357649: \r\n/* 82: 60 */ if ((goto 793) && (((String)localObject).equals(\"move\")))\r\n/* 83: */ {\r\n/* 84: 64 */ if (cmd.length != 2) {\r\n/* 85: */ break label804;\r\n/* 86: */ }\r\n/* 87: 66 */ int id = Integer.parseInt(cmd[1]);\r\n/* 88: 67 */ Base.BasicView b = (Base.BasicView)bases.get(Integer.valueOf(id));\r\n/* 89: 68 */ Coord.View c = null;\r\n/* 90: 70 */ if (b == null)\r\n/* 91: */ {\r\n/* 92: 71 */ if (this.game.getCountry().id() != id)\r\n/* 93: */ {\r\n/* 94: 73 */ System.err.println(\"This id isn't corresponding neither to a base nor your country\");\r\n/* 95: */ break label804;\r\n/* 96: */ }\r\n/* 97: 77 */ c = this.game.getCountry().position();\r\n/* 98: */ }\r\n/* 99: */ else\r\n/* 100: */ {\r\n/* 101: 79 */ c = b.position();\r\n/* 102: */ }\r\n/* 103: 81 */ for (Plane.FullView p : planes.valuesView()) {\r\n/* 104: 82 */ coms.add(new MoveCommand(p, c));\r\n/* 105: */ }\r\n/* 106: */ break label804;\r\n/* 107: 87 */ int id = Integer.parseInt(cmd[1]);\r\n/* 108: 88 */ Base.BasicView b = (Base.BasicView)bases.get(Integer.valueOf(id));\r\n/* 109: 89 */ AbstractBase.View c = null;\r\n/* 110: 91 */ if (b == null)\r\n/* 111: */ {\r\n/* 112: 92 */ if (this.game.getCountry().id() != id)\r\n/* 113: */ {\r\n/* 114: 94 */ System.err.println(\"You can't see this base, move around it before you land\");\r\n/* 115: */ break label804;\r\n/* 116: */ }\r\n/* 117: 98 */ c = this.game.getCountry();\r\n/* 118: */ }\r\n/* 119: */ else\r\n/* 120: */ {\r\n/* 121:100 */ c = b;\r\n/* 122: */ }\r\n/* 123:102 */ for (Plane.FullView p : planes.valuesView()) {\r\n/* 124:103 */ coms.add(new LandCommand(p, c));\r\n/* 125: */ }\r\n/* 126: */ break label804;\r\n/* 127:108 */ Plane.BasicView ep = (Plane.BasicView)ennemy_planes.get(Integer.valueOf(Integer.parseInt(cmd[1])));\r\n/* 128:109 */ if (ep == null)\r\n/* 129: */ {\r\n/* 130:111 */ System.err.println(\"Bad id, this plane does not exists\");\r\n/* 131: */ }\r\n/* 132: */ else\r\n/* 133: */ {\r\n/* 134:114 */ for (Plane.FullView p : planes.valuesView()) {\r\n/* 135:115 */ coms.add(new AttackCommand(p, ep));\r\n/* 136: */ }\r\n/* 137: */ break label804;\r\n/* 138:118 */ System.out.println();\r\n/* 139:119 */ System.out.println(\">> My planes:\");\r\n/* 140:120 */ for (Plane.FullView p : planes.valuesView()) {\r\n/* 141:121 */ System.out.println(p);\r\n/* 142: */ }\r\n/* 143:122 */ System.out.println(\">> Ennemy planes:\");\r\n/* 144:123 */ for (Plane.BasicView p : ennemy_planes.valuesView()) {\r\n/* 145:124 */ System.out.println(p);\r\n/* 146: */ }\r\n/* 147:125 */ System.out.println(\">> Visible bases :\");\r\n/* 148:126 */ for (Base.FullView b : this.game.getVisibleBase().valuesView()) {\r\n/* 149:127 */ System.out.println(b);\r\n/* 150: */ }\r\n/* 151:128 */ System.out.println(\">> Your Country\");\r\n/* 152:129 */ System.out.println(this.game.getCountry());\r\n/* 153: */ }\r\n/* 154: */ }\r\n/* 155:130 */ break;\r\n/* 156: */ }\r\n/* 157:132 */ recognized = false;\r\n/* 158:133 */ System.err.println(\"Unrecognized command!\");\r\n/* 159: */ label804:\r\n/* 160:135 */ if (recognized) {\r\n/* 161:136 */ System.out.println(\"Processed\");\r\n/* 162: */ }\r\n/* 163: */ }\r\n/* 164: */ catch (IllegalArgumentException e)\r\n/* 165: */ {\r\n/* 166:139 */ System.out.println(\"Command failed: \" + e);\r\n/* 167:140 */ System.err.println(\"Command failed: \" + e);\r\n/* 168: */ }\r\n/* 169:143 */ localObject = coms.iterator(); continue;Command c = (Command)((Iterator)localObject).next();\r\n/* 170:144 */ this.game.sendCommand(c);\r\n/* 171: */ }\r\n/* 172: */ label914:\r\n/* 173:148 */ in.close();\r\n/* 174:149 */ this.game.quit(0);\r\n/* 175: */ }",
"public static void play(){\r\n System.out.println(\"Please enter your name:\");\r\n Scanner in = new Scanner(System.in);\r\n String userName = in.nextLine();\r\n System.out.println(\"Hello \"+userName+\"! Are you ready to play?\");\r\n System.out.println(\"Please enter the dimension of your board:\");\r\n while(!in.hasNextInt()){\r\n System.out.println(\"Please enter the dimension of your board:\");\r\n in = new Scanner(System.in);\r\n }\r\n int n = in.nextInt();\r\n char[][] a = createBoard(n);\r\n int toss = (int)(2*Math.random());\r\n if (toss == 0){\r\n System.out.println(\"The result of the coint toss is: \"+ toss);\r\n System.out.println(\"You have the first move\");\r\n }\r\n else if (toss == 1){\r\n System.out.println(\"The result of the coint toss is: \"+ toss);\r\n System.out.println(\"The AI has the first move\");\r\n }\r\n //user first\r\n if (toss==0){\r\n while(checkForWinner(a)==' '&& stillSpace(a) == true){\r\n System.out.println(\"Please enter your move:\");\r\n getUserMove(a);\r\n displayBoard(a);\r\n if(checkForWinner(a)!= ' '){\r\n System.out.println(\"GAME OVER!\");\r\n System.out.println(\"You won\");\r\n return;\r\n }\r\n if (stillSpace(a)){\r\n System.out.println(\"The AI made its move:\");\r\n getAIMove(a);\r\n displayBoard(a);\r\n if(checkForWinner(a)!= ' '){\r\n System.out.println(\"GAME OVER!\");\r\n System.out.println(\"You lost\");\r\n return;\r\n }\r\n }\r\n }\r\n System.out.println(\"No one wins\");\r\n return;\r\n }\r\n //AI first\r\n if (toss == 1){\r\n System.out.println(\"The AI made its move:\");\r\n getAIMove(a);\r\n displayBoard(a);\r\n while(checkForWinner(a)==' '&& stillSpace(a) == true){\r\n System.out.println(\"Please enter your move:\");\r\n getUserMove(a);\r\n displayBoard(a);\r\n if(checkForWinner(a)!= ' '){\r\n System.out.println(\"GAME OVER!\");\r\n System.out.println(\"You won\");\r\n return;\r\n }\r\n if (stillSpace(a)){\r\n System.out.println(\"The AI made its move:\");\r\n getAIMove(a);\r\n displayBoard(a);\r\n if(checkForWinner(a)!= ' '){\r\n System.out.println(\"GAME OVER!\");\r\n System.out.println(\"You lost\");\r\n return;\r\n }\r\n }\r\n }\r\n System.out.println(\"No one wins\");\r\n return;\r\n } \r\n }",
"private void unintelligentDecideMove() {\n\t\twander();\r\n\t}",
"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 }",
"@Override\r\n protected boolean checkApiLogic(Player ai, SpellAbility sa) {\n if (sa.isEntwine()) {\r\n return true;\r\n } \r\n\r\n final int num = Integer.parseInt(sa.hasParam(\"CharmNum\") ? sa.getParam(\"CharmNum\") : \"1\");\r\n final int min = sa.hasParam(\"MinCharmNum\") ? Integer.parseInt(sa.getParam(\"MinCharmNum\")) : num;\r\n boolean timingRight = sa.isTrigger(); //is there a reason to play the charm now?\r\n\r\n // Reset the chosen list otherwise it will be locked in forever by earlier calls\r\n sa.setChosenList(null);\r\n List<AbilitySub> choices = CharmEffect.makePossibleOptions(sa);\r\n List<AbilitySub> chosenList;\r\n \r\n if (!ai.equals(sa.getActivatingPlayer())) {\r\n // This branch is for \"An Opponent chooses\" Charm spells from Alliances\r\n // Current just choose the first available spell, which seem generally less disastrous for the AI.\r\n //return choices.subList(0, 1);\r\n chosenList = choices.subList(1, choices.size());\r\n } else if (\"Triskaidekaphobia\".equals(ComputerUtilAbility.getAbilitySourceName(sa))) {\r\n chosenList = chooseTriskaidekaphobia(choices, ai);\r\n } else {\r\n /*\r\n * The generic chooseOptionsAi uses canPlayAi() to determine good choices\r\n * which means most \"bonus\" effects like life-gain and random pumps will\r\n * usually not be chosen. This is designed to force the AI to only select\r\n * the best choice(s) since it does not actually know if it can pay for\r\n * \"bonus\" choices (eg. Entwine/Escalate).\r\n * chooseMultipleOptionsAi() uses \"AILogic$Good\" tags to manually identify\r\n * bonus choice(s) for the AI otherwise it might be too hard to ever fulfil\r\n * minimum choice requirements with canPlayAi() alone.\r\n */\r\n chosenList = min > 1 ? chooseMultipleOptionsAi(choices, ai, min)\r\n : chooseOptionsAi(choices, ai, timingRight, num, min, sa.hasParam(\"CanRepeatModes\"));\r\n }\r\n\r\n if (chosenList.isEmpty()) {\r\n if (timingRight) {\r\n // Set minimum choices for triggers where chooseMultipleOptionsAi() returns null\r\n chosenList = chooseOptionsAi(choices, ai, true, num, min, sa.hasParam(\"CanRepeatModes\"));\r\n } else {\r\n return false;\r\n }\r\n }\r\n sa.setChosenList(chosenList);\r\n\r\n // prevent run-away activations - first time will always return true\r\n return MyRandom.getRandom().nextFloat() <= Math.pow(.6667, sa.getActivationsThisTurn());\r\n }",
"public void go(){\n \n turn = true;\n \n // if AI, do computery things\n if(type==\"AI\"){\n \n //let user know that AI is going\n System.out.print(\"\\tThe computer will now make a move..\");\n delay(1000, TicTacToe.game.gridSize); //take a second to go to make it appear as if computer is thinking\n \n while(turn){\n //AI selects a random empty cell and places corrosponding mark\n index = (int)Math.round((TicTacToe.game.gridSize*TicTacToe.game.gridSize-1)*Math.random());\n move(index, TicTacToe.game);\n }\n \n } else {\n //if human, do human stuff\n \n System.out.println(\"\\tPlease place an X on the grid. You can\");\n TicTacToe.user_input = TicTacToe.getInput(\"\\tdo this by typing 1A, 1B, 1C, 2A, etc.: \");\n\n //while it's the player's turn...\n while(turn) {\n \n //validate user input\n if(valid_input(TicTacToe.user_input)){\n \n if(TicTacToe.user_input.length()==2){\n \n column = Integer.parseInt(TicTacToe.user_input.substring(0,1));\n row = letterToNumber(TicTacToe.user_input.substring(1,2));\n \n } else {\n \n column = Integer.parseInt(TicTacToe.user_input.substring(0,2));\n row = letterToNumber(TicTacToe.user_input.substring(2,3));\n \n }\n \n index = TicTacToe.game.gridSize*(row-1)+(column-1);\n \n if(index > (TicTacToe.game.gridSize*TicTacToe.game.gridSize)-1 || index < 0){\n \n TicTacToe.user_input = TicTacToe.getInput(\"That's not a valid spot! Please choose another spot: \");\n } else {\n \n //if valid input, and cell isn't taken already,\n //place mark in selected cell and end turn\n move(index, TicTacToe.game);\n \n if(turn){\n \n TicTacToe.user_input = TicTacToe.getInput(\"That space is already in play! Please choose another spot: \");\n }\n \n }\n \n } else {\n \n TicTacToe.user_input = TicTacToe.getInput(\"That's not valid input. Please choose another spot: \");\n }\n }\n }\n }",
"private void activateTraitByAI() {\n\t\tChampion AI = currentTask.getCurrentChamp();\n\t\t\n\t\tif(AI instanceof GryffindorWizard){\n\t\t\tactivateGryffindorTrait();\n\t\t\t\n\t\t}else if(AI instanceof HufflepuffWizard){\n\t\t\tactivateHufflepuffTrait();\n\t\t\t\n\t\t}else if(AI instanceof SlytherinWizard){\n\t\t\tint randomDirection = (int) (Math.random()*3);\n\t\t\tDirection direction;\n\t\t\tswitch(randomDirection){\n\t\t\tcase 0: direction = Direction.FORWARD; break;\n\t\t\tcase 1: direction = Direction.BACKWARD; break;\n\t\t\tcase 2: direction = Direction.RIGHT; break;\n\t\t\tdefault: direction = Direction.LEFT;\n\t\t\t}\n\t\t\tdirectionsInAction = new ArrayList<Direction>();\n\t\t\tdirectionsInAction.add(direction);\n\t\t\tactivateSlytherinTrait();\n\t\t\n\t\t}else if(AI instanceof RavenclawWizard){\n\t\t\tactivateRavenclawTrait();\t\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public void abstractUpdateAI()\n {\n player.setClock(player.getClock()+1);\n \n if (player.getClock() > 15 && player.getAlive()) { \n updateAI();\n } \n }",
"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}",
"public void standardBattleHandling()\n\t{\n\t\n\t\tif(activePlayerOneCard.isEqual(activePlayerTwoCard))\n\t\t{\n\t\t\twarBattleHandling();\n\t\t}\n\t\telse if(activePlayerOneCard.greaterThan(activePlayerTwoCard))\n\t\t{\n\t\t\tplayer1.winHandling(playedCards);\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tplayer2.winHandling(playedCards);\n\t\t}\n\t\t\n\t}",
"AttackResult randomAttack();",
"private static void decisionWhenAttacking() {\n\t\tif (isNewAttackState()) {\n\t\t\tchangeStateTo(STATE_ATTACK_PENDING);\n\n\t\t\t// We will try to define place for our army where to attack. It\n\t\t\t// probably will be center around a crucial building like Command\n\t\t\t// Center. But what we really need is the point where to go, not the\n\t\t\t// unit. As long as the point is defined we can attack the enemy.\n\n\t\t\t// If we don't have defined point where to attack it means we\n\t\t\t// haven't yet decided where to go. So it's the war's very start.\n\t\t\t// Define this assault point now. It would be reasonable to relate\n\t\t\t// it to a particular unit.\n\t\t\t// if (!isPointWhereToAttackDefined()) {\n\t\t\tStrategyManager.defineInitialAttackTarget();\n\t\t\t// }\n\t\t}\n\n\t\t// Attack is pending, it's quite \"regular\" situation.\n\t\tif (isGlobalAttackInProgress()) {\n\n\t\t\t// Now we surely have defined our point where to attack, but it can\n\t\t\t// be so, that the unit which was the target has been destroyed\n\t\t\t// (e.g. just a second ago), so we're standing in the middle of\n\t\t\t// wasteland.\n\t\t\t// In this case define next target.\n\t\t\t// if (!isSomethingToAttackDefined()) {\n\t\t\tdefineNextTarget();\n\t\t\t// }\n\n\t\t\t// Check again if continue attack or to retreat.\n\t\t\tboolean shouldAttack = decideIfWeAreReadyToAttack();\n\t\t\tif (!shouldAttack) {\n\t\t\t\tretreatsCounter++;\n\t\t\t\tchangeStateTo(STATE_RETREAT);\n\t\t\t}\n\t\t}\n\n\t\t// If we should retreat... fly you fools!\n\t\tif (isRetreatNecessary()) {\n\t\t\tretreat();\n\t\t}\n\t}",
"@Override\n public void noteNewTurn()\n {\n if ( traceStats && stateMachine.getInstanceId() == 1 )\n {\n ForwardDeadReckonLegalMoveInfo[] masterList = stateMachine.getFullPropNet().getMasterMoveList();\n for(int i = 0; i < bestResponseScores.length; i++)\n {\n float best = -Float.MAX_VALUE;\n float bestFollow = -Float.MAX_VALUE;\n int bestIndex = -1;\n int bestFollowIndex = -1;\n for(int j = 0; j < bestResponseScores.length; j++)\n {\n if ( responseSampleSize[i][j] > 0 )\n {\n float score = bestResponseScores[i][j]/responseSampleSize[i][j];\n if ( masterList[i].mRoleIndex != masterList[j].mRoleIndex)\n {\n if ( score > best )\n {\n best = score;\n bestIndex = j;\n }\n }\n else\n {\n if ( score > bestFollow )\n {\n bestFollow = score;\n bestFollowIndex = j;\n }\n }\n }\n }\n\n LOGGER.info(\"Best response to \" + masterList[i].mInputProposition + \": \" + (bestIndex == -1 ? \"NONE\" : masterList[bestIndex].mInputProposition + \" (\" + (100*best) + \"% [\" + responseSampleSize[i][bestIndex] + \"] )\"));\n LOGGER.info(\"Best follow-on to \" + masterList[i].mInputProposition + \": \" + (bestFollowIndex == -1 ? \"NONE\" : masterList[bestFollowIndex].mInputProposition + \" (\" + (100*bestFollow) + \"% [\" + responseSampleSize[i][bestFollowIndex] + \"] )\"));\n if ( bestIndex != -1 && opponentEquivalent[bestIndex] != bestFollowIndex )\n {\n int bestDeny = opponentEquivalent[bestIndex];\n LOGGER.info(\"Best denial to \" + masterList[i].mInputProposition + \": \" + (bestDeny == -1 ? \"NONE\" : masterList[bestDeny].mInputProposition + \" (\" + (100*(bestResponseScores[i][bestDeny]/responseSampleSize[i][bestDeny])) + \"% [\" + responseSampleSize[i][bestDeny] + \"] )\"));\n }\n }\n }\n\n // Reset the stats\n for(int i = 0; i < bestResponseScores.length; i++)\n {\n for(int j = 0; j < bestResponseScores.length; j++)\n {\n bestResponseScores[i][j] /= 2;\n responseSampleSize[i][j] /= 2;\n }\n }\n }",
"public AgentAction getNextMove(GameTile [][] visibleMap) {\r\n\t\t//Possible things to add to your moves\r\n//\t\tnextMove = AgentAction.doNothing;\r\n//\t\tnextMove = AgentAction.moveDown;\r\n//\t\tnextMove = AgentAction.moveUp;\r\n//\t\tnextMove = AgentAction.moveUp;\r\n//\t\tnextMove = AgentAction.moveLeft;\r\n//\t\tnextMove = AgentAction.pickupSomething;\r\n//\t\tnextMove = AgentAction.declareVictory;\r\n//\r\n//\t\tnextMove = AgentAction.shootArrowNorth;\r\n//\t\tnextMove = AgentAction.shootArrowSouth;\r\n//\t\tnextMove = AgentAction.shootArrowEast;\r\n//\t\tnextMove = AgentAction.shootArrowWest;\r\n//\t\tnextMove = AgentAction.quit\r\n\t\t\r\n\t\t\r\n\r\n\t\t//Ideally you would remove all this code, but I left it in so the keylistener would work\r\n\t\tif(keyboardPlayOnly) {\r\n\t\t\tif(nextMove == null) {\r\n\t\t\t\treturn AgentAction.doNothing;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tAgentAction tmp = nextMove;\r\n\t\t\t\tnextMove = null;\r\n\t\t\t\treturn tmp;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//This code plays 5 \"games\" and then quits\r\n\t\t\t//Just does random things\r\n\t\t\tif(numGamesPlayed > 19) {\r\n\t\t\t\treturn AgentAction.quit;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(nextMoves.isEmpty()) {\r\n\t\t\t\t\tsetStartingPosition(visibleMap);\r\n//\t\t\t\t\tfindWumpus(visibleMap);\r\n//\t\t\t\t\tfindWumpus(visibleMap);\r\n//\t\t\t\t\tWumpusState currentState = huntTheWumpus(visibleMap);\r\n//\t\t\t\t\tSystem.out.println(wumpusHunted);\r\n//\t\t\t\t\tif(wumpusHunted) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\t\taddToNextMoves(currentState);\r\n//\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//this is the code to collect the gold\r\n//\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\tcurrentState = findTheGold(currentState);\r\n//\t\t\t\t\tif(currentState.getGoldCollected()) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\t\taddToNextMoves(currentState);\r\n//\t\t\t\t\t}\r\n\t\t\t\t\tif(!goldCollected) {\r\n\t\t\t\t\t\twellItsDarkNow(visibleMap);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(goldCollected) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n\t\t\t\t\t\taddToNextMoves(visibleMap);\r\n//\t\t\t\t\t\tgoldCollected = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tif(!nextMoves.isEmpty()) {\r\n\t\t\t\t\tSystem.out.println(nextMoves.peek());\r\n\t\t\t\t\tsetNextMove(nextMoves.remove());\r\n//\t\t\t\t\tSystem.out.println(nextMove);\r\n//\t\t\t\t\treturn nextMove;\r\n\t\t\t\t}\r\n\t\t\t\treturn nextMove;\r\n//\t\t\t\tcurrentNumMoves++;\r\n//\t\t\t\tif(currentNumMoves < 20) {\r\n//\t\t\t\t\treturn AgentAction.randomAction();\r\n//\t\t\t\t}\r\n//\t\t\t\telse {\r\n//\t\t\t\t\treturn AgentAction.declareVictory;\r\n//\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"@Test\n public void humanAttacksAfterMoving() 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 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 List<Player> players = new ArrayList<Player>(party.getMembers()\n .keySet());\n Player player1 = players.get(0);\n player1.setIdentity(human);\n\n matchController.initMatch(partyController);\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 ActionRequest action = new ActionRequest(ActionType.ATTACK, null, null);\n // eseguo l'azione\n Attack atk = new Attack();\n atk.initAction(matchController, action);\n // verifico gli esiti\n assertFalse(atk.isValid());\n }",
"protected void wander() {\n\t\tfor(int i=3;i>0;){\n\t\t\tfindChest();\n\t\t\tint num = ((int) (Math.random()*100)) % 4;\n\t\t\tswitch (num+1){\n\t\t\t\tcase 1 :\n\t\t\t\t\tif(!(character.xOfFighter-1==game.getXofplayer()&&character.yOfFighter==game.getYofplayer())\n\t\t\t\t\t\t\t&&game.getPlayingmap().npcMove(character.xOfFighter,character.yOfFighter,character.xOfFighter-1,character.yOfFighter)){\n\t\t\t\t\t\tcharacter.xOfFighter = character.xOfFighter-1;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2 :\n\t\t\t\t\tif(!(character.xOfFighter==game.getXofplayer()&&character.yOfFighter-1==game.getYofplayer())&&\n\t\t\t\t\t\t\tgame.getPlayingmap().npcMove(character.xOfFighter,character.yOfFighter,character.xOfFighter,character.yOfFighter-1)){\n\t\t\t\t\t\tcharacter.yOfFighter = character.yOfFighter-1;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3 :\n\t\t\t\t\tif(!(character.xOfFighter+1==game.getXofplayer()&&character.yOfFighter==game.getYofplayer())&&\n\t\t\t\t\t\t\tgame.getPlayingmap().npcMove(character.xOfFighter,character.yOfFighter,character.xOfFighter+1,character.yOfFighter)){\n\t\t\t\t\t\tcharacter.xOfFighter = character.xOfFighter+1;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4 :\n\t\t\t\t\tif(!(character.xOfFighter==game.getXofplayer()&&character.yOfFighter+1==game.getYofplayer())&&\n\t\t\t\t\t\t\tgame.getPlayingmap().npcMove(character.xOfFighter,character.yOfFighter,character.xOfFighter,character.yOfFighter+1)){\n\t\t\t\t\t\tcharacter.yOfFighter = character.yOfFighter+1;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfindChest();\n\t}",
"public void act() \r\n {\r\n if (startTime > 0) {\r\n startTime--;\r\n }\r\n else {\r\n if (isScared()) {\r\n doScareMode();\r\n }\r\n else {\r\n if (counter == 0 || !canMove(currDirectionStr)) {\r\n counter = CELL_SIZE * 4;\r\n prevDirection = currDirection;\r\n do {\r\n currDirection = (int)(Math.random() * 10);\r\n if (currDirection == 0) {\r\n currDirectionStr = \"up\";\r\n }\r\n else if (currDirection == 1) {\r\n currDirectionStr = \"left\";\r\n }\r\n else if (currDirection == 2) {\r\n currDirectionStr = \"down\";\r\n }\r\n else if (currDirection == 3) {\r\n currDirectionStr = \"right\";\r\n }\r\n } while (!canMove(currDirectionStr));\r\n }\r\n \r\n if (canMove(currDirectionStr)) {\r\n move(currDirectionStr);\r\n }\r\n counter--;\r\n } \r\n }\r\n }",
"public void actionPerformed(ActionEvent e) {\n timer.stop();\n //get all the available moves\n ArrayList<Point> possibleMoves = getCurrentlyValidMoves();\n canLastPlayerMove = false;\n try {\n //check if we can move\n if( possibleMoves.size() == 0 ){\n return;\n }\n //make an array to store the best moves available\n ArrayList<Point> bestMoves = new ArrayList<Point>();\n //the lower the level, the higher priority is assigned to the move\n //a move of level 10 is the absolute lowest\n //this heuristic follows the strategy I use, omitting situation-specific content\n int level = 10;\n for (Point p : possibleMoves) {\n int x = (int) p.getX();\n int y = (int) p.getY();\n if ((x == 0 || x == 7) && (y == 0 || y == 7)) {\n if (level > 0) {\n bestMoves.clear();\n level = 0;\n }\n bestMoves.add( p );\n } else if (level >= 1 && (x == 0 || y == 0 || x == 7 || y == 7)) {\n if (level > 1) {\n bestMoves.clear();\n level = 1;\n }\n bestMoves.add( p );\n } else if (level >= 2 && (x > 2 && x < 6 && y > 2 && y < 6)) {\n if ( level > 2) {\n bestMoves.clear();\n level = 2;\n }\n bestMoves.add( p );\n } else if (level >= 3 && x != 1 && x != 6 && y != 1 && y != 6) {\n if (level > 3) {\n bestMoves.clear();\n level = 3;\n }\n bestMoves.add(p);\n } else if (level >= 4) {\n bestMoves.add(p);\n }\n }\n //for debugging purposes, output the level of move chosen by the ai\n System.out.println(level);\n //select a random move from the pool of best moves\n Point move = bestMoves.get((int) (Math.random() * bestMoves.size()));\n int aix = (int) move.getX();\n int aiy = (int) move.getY();\n //move there\n attemptMove(aix, aiy);\n gamepieces[aix][aiy] = currentPlayer;\n //the ai moved, so this is true\n canLastPlayerMove = true;\n } finally { //if the ai moved or if it didn't\n //change the player\n currentPlayer = Color.WHITE;\n gameFrame.repaint();\n //if the human player has no moves left\n if( getCurrentlyValidMoves().size() == 0 ){\n if( canLastPlayerMove ){ //... and the ai could move\n //switch players, enable the ai to move again in 1 second\n currentPlayer = Color.BLACK;\n timer.start();\n }else{ //... and the ai couldn't move\n gameOver();\n }\n }\n }\n }",
"@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 static void main(String args[]) throws IOException {\n Character Jill = new Character(\"red\", \"brown:\", \"female\", \"green\", \"Jill\");\n Character Sean = new Character(\"red\", \"green\", \"male\", \"green\", \"Sean\");\n Character Becky = new Character(\"brown\", \"brown\", \"female\", \"blue\", \"Becky\");\n Character Tom = new Character(\"brown\", \"green\", \"male\", \"blue\", \"Tom\");\n Character Caroline = new Character(\"blonde\", \"blue\", \"female\", \"blue\", \"Caroline\");\n Character Curtis = new Character(\"brown\", \"blue\", \"male\", \"red\", \"Curtis\");\n Character Steph = new Character(\"brown\", \"brown\", \"female\", \"red\", \"Steph\");\n\n //Add characters to ArrayList\n Roster people = new Roster();\n people.addChar(Jill);\n people.addChar(Sean);\n people.addChar(Becky);\n people.addChar(Tom);\n people.addChar(Caroline);\n people.addChar(Curtis);\n people.addChar(Steph);\n\n //create AI Object and copy Roster\n Roster possChars = new Roster();\n possChars.addChar(Jill);\n possChars.addChar(Sean);\n possChars.addChar(Becky);\n possChars.addChar(Tom);\n possChars.addChar(Caroline);\n possChars.addChar(Curtis);\n possChars.addChar(Steph);\n AI aibot = new AI(possChars);\n\n //create gameplay loop\n boolean noWinner = true;\n\n //create turn loop\n boolean turn = true;\n\n //Create Random number from array for user and computer\n Random rand = new Random();\n int computerNum = rand.nextInt(people.getSize());\n int userNum = rand.nextInt(people.getSize());\n\n //Set random number from array to specific character\n //call to isPlayer and isComputer from Character class to\n // set boolean switch to true to indicate if it belongs to user or computer\n people.getChar(computerNum).setAsComputer();\n people.getChar(userNum).setAsPlayer();\n\n //These values are for the buffered reader input for AI response\n String q = \"\";\n int answer = 2;\n\n\n //Create Menu and character names\n System.out.println(\"Welcome to Guess Who!\");\n System.out.println(\"You will be assigned a random character from the list of created characters\");\n System.out.println(\"You can either guess who the computer has, or ask a question\");\n System.out.println(\"Once you have either made a guess or asked a question, you turn ends and the computer will go\");\n System.out.println(\"Your goal is to guess who the computer has before it guesses your character first!\");\n System.out.println(\"Good Luck!\\n\");\n System.out.println(\"\\nYour character is: \" + people.getChar(userNum).toString());\n\n //System.out.println(\"//test this is the computer's character//\");\n //System.out.println(people.getChar(computerNum).toString());\n\n\n while (noWinner) {\n printMenu();\n do {\n String s = in.readLine().trim();\n int i = Integer.parseInt(s);\n\n switch (i) {\n //Ask question\n case 1:\n displayQuestions();\n\n String t = in.readLine().trim();\n int j = Integer.parseInt(t);\n\n\n switch (j) {\n case 1:\n //male?\n if (people.getChar(computerNum).isGender(\"male\")) {\n System.out.println(\"Yes!\");\n } else {\n System.out.println(\"No\");\n }\n turn = false;\n break;\n case 2:\n //female?\n if (people.getChar(computerNum).isGender(\"female\")) {\n System.out.println(\"Yes!\");\n } else {\n System.out.println(\"No\");\n }\n turn = false;\n break;\n case 3:\n //red hair?\n if (people.getChar(computerNum).isHair(\"brown\")) {\n System.out.println(\"Yes!\");\n } else {\n System.out.println(\"No\");\n }\n turn = false;\n break;\n case 4:\n //brown hair?\n if (people.getChar(computerNum).isHair(\"red\")) {\n System.out.println(\"Yes!\");\n } else {\n System.out.println(\"No\");\n }\n turn = false;\n break;\n case 5:\n //blonde hair?\n if (people.getChar(computerNum).isHair(\"blonde\")) {\n System.out.println(\"Yes!\");\n } else {\n System.out.println(\"No\");\n }\n turn = false;\n break;\n case 6:\n //brown eyes?\n if (people.getChar(computerNum).isEye(\"green\")) {\n System.out.println(\"Yes!\");\n } else {\n System.out.println(\"No\");\n }\n turn = false;\n break;\n case 7:\n //green eyes?\n if (people.getChar(computerNum).isEye(\"blue\")) {\n System.out.println(\"Yes!\");\n } else {\n System.out.println(\"No\");\n }\n turn = false;\n break;\n case 8:\n //blue eyes?\n if (people.getChar(computerNum).isEye(\"brown\")) {\n System.out.println(\"Yes!\");\n } else {\n System.out.println(\"No\");\n }\n turn = false;\n break;\n case 9:\n //green shirt?\n if (people.getChar(computerNum).isShirt(\"green\")) {\n System.out.println(\"Yes!\");\n\n } else {\n System.out.println(\"No\");\n }\n turn = false;\n break;\n case 10:\n //blue shirt?\n if (people.getChar(computerNum).isShirt(\"blue\")) {\n System.out.println(\"Yes!\");\n } else {\n System.out.println(\"No\");\n }\n\n turn = false;\n break;\n case 11:\n //red shirt?\n if (people.getChar(computerNum).isShirt(\"red\")) {\n\n System.out.println(\"Yes!\");\n } else {\n System.out.println(\"No\");\n }\n turn = false;\n break;\n default:System.out.println(\"Please enter a valid number\");\n }\n\n break;\n //Guess computer's character\n case 2:\n System.out.println(\"Input the character that you believe the AI has\\n First letter capitalized Please :)\");\n String guess = in.readLine().trim();\n if (people.getChar(computerNum).isName(guess)) {\n System.out.println(\"Congratulations! You guessed correctly!\\n You win!!!\\nThanks for Playing :D\");\n noWinner = false;\n } else {\n System.out.println(\"No, try again.\");\n }\n break;\n //See list of playable characters\n\n case 3:\n System.out.println(people.toString());\n\n break;\n //see ALL characters' attributes\n case 4:\n System.out.println(people.getAttributes());\n break;\n //See User's character and their attributes\n case 5:\n System.out.println(people.getMyCharacter(userNum));\n break;\n //Quit game\n case 6:\n System.out.println(\"Goodbye!\");\n turn = false;\n noWinner = false;\n break;\n default:System.out.println(\"Please enter a valid number\");\n }\n } while (turn);\n\n //AI takes turn\n //check for lowest h value in Hashmap to ask question\n //If yes, remove appropriate characters from aiRoster\n //Delete question from Hashmap\n //get traits from remaining characters and update question values\n //If no, do same, but with opposite answers\n if (turn == false) {\n\n if (aibot.aiRoster.getSize() == 1) {\n System.out.println(\"Your character is \" + aibot.aiRoster.getChar(0));\n noWinner = false;\n }\n else {\n String quest = aibot.bestQuestion();\n System.out.println(\"Is \" + quest + \" true?\" + \"\\nType '1' for yes, '0' for no, and 2 to see your Character's attributes\");\n\n do {\n q = in.readLine().trim();\n answer = Integer.parseInt(q);\n\n\n if (answer == 1) {\n aibot.activateBrain(1, quest);\n turn = true;\n } else if (answer == 0) {\n aibot.activateBrain(0, quest);\n turn = true;\n } else if(answer == 2){\n System.out.println(people.getMyCharacter(userNum));\n }\n else {\n System.out.println(\"Please enter a '1' or '0' to answer\");\n }\n } while(turn == false);\n\n }\n\n }\n }\n }",
"public void play()\r\n\t{\r\n \r\n\t\tupdateMessage(\"Starting \" + name + \" between \"+ agent[0].name+ \" and \"+ agent[1].name+\".\");\r\n random = new Random(System.currentTimeMillis());\r\n\t\tint turn = random.nextInt(2);\r\n first=turn;\r\n\t\tint dimension=8;\r\n\t\t//System.out.println(agent[turn].name+ \" makes the first move.\");\r\n\t\t//initialize(false,dimension,dimension);\r\n set(agent[first].role);\r\n agent[0].setAvailable(agent[first].role, dimension);\r\n agent[1].setAvailable(agent[first].role, dimension);\r\n \r\n \r\n\t\t//showGameState();\r\n \r\n\t\twhile(!isFinished())\r\n\t\t{\r\n\t\t\tupdateMessage(agent[turn].name+ \"'s turn. \");\r\n\t\t\tagent[turn].makeMove(this);\r\n agent[(turn+1)%2].off(agent[turn].newx,agent[turn].newy );\r\n agent[(turn+1)%2].setNew((OTHELLO)this);\r\n \r\n \r\n\t\t\tshowGameState();\r\n\t\t\t\r\n\t\t\tturn = (turn+1)%2;\r\n\t\t}\r\n\t\t\r\n // System.out.println(\" final winner role: \"+winner.role+\" agent[0]: \"+agent[0].role+\" agent[1]: \"+agent[1].role);\r\n \r\n\t\t\r\n\t\tif(draw)\t\r\n\t\t\tupdateMessage(\"Game drawn!!\");\r\n else updateMessage(winner.name+ \" wins!!!\");\r\n\t\t\r\n\t}",
"public synchronized String computeMove() {\n if (game == null) {\n System.err.println(\"CODE ERROR: AI is not attached to a game.\");\n return \"0,0\";\n }\n\n char[] board = (char[]) game.getStateAsObject();\n\n //Choose a smart move if that AI is set to \"Smart\" or if the random value equals 2\n if (aiType == 1) {\n if(useHeat && ((int) (Math.random() * heat)) == 2){\n return \"\" + getRandomMove(board);\n }\n else{\n return \"\" + getSmartMove(board);\n }\n } else {\n return \"\" + getRandomMove(board);\n }\n }",
"@Test\n public void isMoveActionLegalFor()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final List<Agent> agents = createAgents(injector);\n final CheckersEnvironment environment = createEnvironment(injector, agents);\n final CheckersAdjudicator adjudicator = injector.injectAdjudicator();\n\n // Agent white can move his token to an adjacent empty space.\n assertTrue(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P13));\n\n // Agent white cannot move backwards.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P05));\n\n // Agent white cannot move to an occupied space.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P04,\n CheckersPosition.P08));\n\n // Agent white cannot move a red token.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P21,\n CheckersPosition.P17));\n\n // Agent white cannot move too far.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P18));\n }",
"@Test\n public void humanAttacksBeforeMoving() 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 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 List<Player> players = new ArrayList<Player>(party.getMembers()\n .keySet());\n Player player1 = players.get(0);\n player1.setIdentity(human);\n\n matchController.initMatch(partyController);\n Turn turn = new Turn(player1, matchController.getMatch().getTurnCount());\n matchController.getTurnController().setTurn(turn);\n HexPoint point = HexPoint.fromOffset(1, 1);\n Sector sec = new Sector(null, point);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player1, sec);\n ActionRequest action = new ActionRequest(ActionType.ATTACK, null, null);\n // eseguo l'azione\n Attack atk = new Attack();\n atk.initAction(matchController, action);\n // verifico gli esiti\n assertFalse(atk.isValid());\n }",
"public Engine(Draw draw, int[][] board, ArrayList<Integer> human)\n\t{\n\t\tthis.human = human;\n\t\tthis.board = board;\n\t\tthis.draw = draw;\n\t\tai.add(1);\n\t\tai.add(3);\n\t\tai.add(5);\n\t\tai.add(7);\n\t\tai.add(9);\n\t\t/*\n\t\t * Repeating turns\n\t\t */\n\t\tint turn = 0;\n\t\twhile (turn < 9)\n\t\t{\n\t\t\tSystem.out.println(turn);\n\t\t\tif (turn%2 == 0)\n\t\t\t{\n\t\t\t\taiMove(turn);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tplayerMove();\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\t * Checks for a win\n\t\t\t */\n\t\t\tif ((Math.abs(board[0][0] + board[0][1] + board[0][2]) == 15)\n\t\t\t\t\t|| (Math.abs(board[1][0] + board[1][1] + board[1][2]) == 15)\n\t\t\t\t\t|| (Math.abs(board[2][0] + board[2][1] + board[2][2]) == 15)\n\t\t\t\t\t|| (Math.abs(board[0][0] + board[1][0] + board[2][0]) == 15)\n\t\t\t\t\t|| (Math.abs(board[0][1] + board[1][1] + board[2][1]) == 15)\n\t\t\t\t\t|| (Math.abs(board[0][2] + board[1][2] + board[2][2]) == 15)\n\t\t\t\t\t|| (Math.abs(board[0][0] + board[1][1] + board[2][2]) == 15)\n\t\t\t\t\t|| (Math.abs(board[0][2] + board[1][1] + board[2][0]) == 15))\n\t\t\t\tbreak;\n\t\t\tturn++;\n\t\t}\n\t\tdraw.endGame(turn);\n\t}",
"@Test\n\tpublic void AC2() {\n\t\tGame g1 = Game.createMockGame(createMazeAndEnemiesGoal(), \"\"\n\t\t\t+ \"PSE!\\n\"\n\t\t);\n\t\t\n\t\tg1.movePlayer(Direction.RIGHT);\n\t\tg1.movePlayer(Direction.RIGHT);\n\n\t\tassertFalse(g1.getHasWon());\n\t\t\n\t\tg1.swingSword(Direction.RIGHT);\n\t\t\n\t\tassertTrue(g1.getHasWon());\n\t\t\n\t\tGame g2 = Game.createMockGame(createMazeAndEnemiesGoal(), \"\"\n\t\t\t+ \"PSEEE!\\n\"\n\t\t);\n\t\t\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.RIGHT);\n\n\t\tassertFalse(g2.getHasWon());\n\t\t\n\t\tg2.swingSword(Direction.RIGHT);\n\t\t\n\t\tassertTrue(g2.getHasWon());\n\t\t\n\t}",
"private void fight()\n {\n boolean fighting = true;\n int turn = 1;\n while(fighting)\n {\n //System.out.println(\"Just started\");\n \n switch(turn)\n {\n case 1:\n Collections.shuffle(army1);\n Collections.shuffle(army2);\n if(army1.size() > 0 && army2.size() > 0)\n {\n army2.get(0).takeDamage(army1.get(0).damage());\n if(army2.get(0).isDead())\n {\n army2.remove(0);\n }\n turn = 2;\n }\n else\n {\n turn = 3;\n }\n \n break;\n case 2:\n Collections.shuffle(army1);\n Collections.shuffle(army2);\n if (army2.size() > 0 && army1.size() > 0)\n {\n army1.get(0).takeDamage(army2.get(0).damage());\n if(army1.get(0).isDead())\n {\n army1.remove(0);\n }\n turn = 1;\n }\n else\n {\n turn = 3;\n }\n \n break;\n default:\n fighting = false;\n if(army2.size() > 0 && army1.size() <= 0)\n System.out.println(\"army2 wins\");\n if(army2.size() <= 0 && army1.size() > 0)\n System.out.println(\"army1 wins\");\n break; \n }\n \n \n \n \n }\n \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}",
"public void act(){\n\t\tTile[] possibleMoves = game.getAllNeighbours(currentPosition);\r\n\t\tTile targetTile = possibleMoves[rng.nextInt(4)];\r\n\t\tmove(targetTile);\r\n\t}",
"static void red_fight() {\n monsterchoices_y_r = arenafight_r.nextInt(4);\n if(monsterchoices_y_r == 0){\n System.out.println(\"You encountered a gigantic ape...\");\n gigantic_ape();\n System.out.println(\"\\n\");\n }else if(monsterchoices_y_r == 1) {\n System.out.println(\"You encountered a hungry gorilla...\");\n gorilla();\n System.out.println(\"\\n\");\n }else if(monsterchoices_y_r == 2) {\n System.out.println(\"You encountered a bloodthristy pack of wolves...\");\n pack_of_wolves();\n System.out.println(\"\\n\");\n }else if (monsterchoices_y_r == 3) {\n System.out.println(\"You encountered a King Snake...\");\n rattle_snake();\n System.out.println(\"\\n\");\n }\n }",
"public static void main(String[] args) {\n\t\t\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\t\r\n\t\tint input = 0;\r\n\t\tint ai = 0;\r\n\t\tint win = 0;\r\n\t\tint defeat = 0;\r\n\t\tint draw = 0;\r\n\t\t\r\n\t\tString me = \"\";\r\n\t\tString com = \"\";\r\n\t\tSystem.out.println(\"★☆★☆★☆★☆가위바위보 게임입니다!★☆★☆★☆★☆\");\r\n\t\tfor(int i = 1 ; i < 4 ; i++) {\r\n\t\t\tSystem.out.println(\"\\t\\t\\t\\t\\t 최대횟수/남은횟수\");\r\n\t\t\tSystem.out.println(\"가위(1), 바위(2), 보(3) 중 하나를 입력하세요>>>\\t\\t3 / \" + i);\r\n\t\t\tinput = scan.nextInt();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tai = (int)(Math.random()*3) + 1;\r\n\t\t\t\r\n\t\t\tif (input == 1) me = \"가위\";\r\n\t\t\telse if (input == 2) me = \"바위\";\r\n\t\t\telse if (input == 3) me = \"보\";\r\n\t\t\telse System.out.println(\"잘못 입력하셨습니다\");\r\n\t\t\tif (ai == 1) com = \"가위\";\r\n\t\t\telse if (ai == 2) com = \"바위\";\r\n\t\t\telse if (ai == 3) com = \"보\";\r\n\t\t\t\r\n\t\t\tif(me != \"\") {\r\n\t\t\t\tSystem.out.println(\"컴퓨터도 선택 했습니다.\");\r\n\t\t\t\tSystem.out.println(\"당신은 \\\"\" + me + \"\\\" 상대는 \\\"\" + com + \"\\\" 을 선택했습니다\");\r\n\t\t\t\r\n\t\t\t\tswitch (input - ai) {\r\n\t\t\t\tcase -1 : case 2 : \r\n\t\t\t\t\tSystem.out.println(\"★☆저런~~ 졌네요★☆\\n\"); defeat += 1; \r\n\t\t\t\t\tSystem.out.println(\"전적 => 승리 [ \" + win + \" ]\\t패배 [ \" + defeat + \" ]\\t무승부 [ \" + draw + \" ]\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase -2 : case 1 : \r\n\t\t\t\t\tSystem.out.println(\"★☆오~~ 이겼네요★☆\\n\"); win += 1; \r\n\t\t\t\t\tSystem.out.println(\"전적 => 승리 [ \" + win + \" ]\\t패배 [ \" + defeat + \" ]\\t무승부 [ \" + draw + \" ]\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 0 : \r\n\t\t\t\t\tSystem.out.println(\"★☆이런! 비겼네요★☆\\n\"); draw += 1;\r\n\t\t\t\t\tSystem.out.println(\"전적 => 승리 [ \" + win + \" ]\\t패배 [ \" + defeat + \" ]\\t무승부 [ \" + draw + \" ]\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault : System.out.println(\"오류 입니다\"); \r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(win==defeat) {\r\n\t\t\tSystem.out.println(\"최종 결과 => 무승부 입니다\");\r\n\t\t} else if(win > defeat) {\r\n\t\t\tSystem.out.println(\"최종 결과 => 당신의 승리입니다\");\r\n\t\t} else if(win < defeat) {\r\n\t\t\tSystem.out.println(\"최종 결과 => 당신의 패배입니다\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"오류 입니다\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"public void win() {\n if (turn == 1) {\n p1.incrementLegs();\n if (p1.getLegs() == 5) {\n p1.incrementSets();\n p1.setLegs(0);\n p2.setSets(0);\n\n }\n if (p1LastScore > p1.getHighout()) {\n p1.setHighout(p1LastScore);\n\n }\n\n if (p1.getHighout() > OVERALL_HIGH_OUT) {\n OVERALL_HIGH_OUT = p1.getHighout();\n }\n } else if (turn == 2) {\n p2.incrementLegs();\n if (p2.getLegs() == 5) {\n p2.incrementSets();\n p2.setLegs(0);\n p1.setSets(0);\n\n }\n if (p2LastScore > p2.getHighout()) {\n p2.setHighout(p2LastScore);\n }\n\n if (p2.getHighout() > OVERALL_HIGH_OUT) {\n OVERALL_HIGH_OUT = p2.getHighout();\n }\n\n\n\n }\n changeFirstTurn();\n win = true;\n\n\n\n }",
"public void enemymoveAri(){\n\t\tint YEari = 0;\n\t\tint XEari = 0;\n\t\tfor(int i = 0 ; i < this.Ari.length;i++){\n\t\t\tfor(int p = 0; p < this.Ari.length;p++){\n\t\t\t\tif(this.Ari[i][p] == 1){\n\t\t\t\t\tYEari = i;\n\t\t\t\t\tXEari = p;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint move = fate.nextInt(4);// 0 is left, 1 is right , 2 is up , 3 is down\n\t\tswitch(move){//first block is up and down second block is left and right\n\t\t\tcase 0:\n\t\t\t\tif(this.area[YEari][XEari-1] != \"[ ]\"){\n\t\t\t\t\tthis.Ari[YEari][XEari-1] = 1;//to turn left\n\t\t\t\t\tthis.Ari[YEari][XEari] = 0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tif(this.area[YEari][XEari+1] != \"[ ]\"){\n\t\t\t\t\tthis.Ari[YEari][XEari+1] = 1;//to turn right\n\t\t\t\t\tthis.Ari[YEari][XEari] = 0;\n\t\t\t\t}\n\t\t\t\tbreak; \n\t\t\tcase 2:\n\t\t\t\tif(this.area[YEari-1][XEari] != \"[ ]\"){\n\t\t\t\t\tthis.Ari[YEari-1][XEari] = 1;//to turn up\n\t\t\t\t\tthis.Ari[YEari][XEari] = 0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tif(this.area[YEari+1][XEari] != \"[ ]\"){\n\t\t\t\t\tthis.Ari[YEari +1][XEari] = 1;//to turn down\n\t\t\t\t\tthis.Ari[YEari][XEari] = 0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}//end of switch\n\t}",
"public void doAction()\n {\n \n //Location of the player\n int cX = w.getPlayerX();\n int cY = w.getPlayerY();\n \n //Basic action:\n //Grab Gold if we can.\n if (w.hasGlitter(cX, cY))\n {\n w.doAction(World.A_GRAB);\n return;\n }\n \n //Basic action:\n //We are in a pit. Climb up.\n if (w.isInPit())\n {\n w.doAction(World.A_CLIMB);\n return;\n }\n //Test the environment\n /*if (w.hasBreeze(cX, cY))\n {\n System.out.println(\"I am in a Breeze\");\n }\n if (w.hasStench(cX, cY))\n {\n System.out.println(\"I am in a Stench\");\n }\n if (w.hasPit(cX, cY))\n {\n System.out.println(\"I am in a Pit\");\n }\n if (w.getDirection() == World.DIR_RIGHT)\n {\n System.out.println(\"I am facing Right\");\n }\n if (w.getDirection() == World.DIR_LEFT)\n {\n System.out.println(\"I am facing Left\");\n }\n if (w.getDirection() == World.DIR_UP)\n {\n System.out.println(\"I am facing Up\");\n }\n if (w.getDirection() == World.DIR_DOWN)\n {\n System.out.println(\"I am facing Down\");\n }\n */\n \n //decide next move\n if(w.hasStench(cX, cY)&&w.hasArrow())//Wumpus can be shot if located\n {\n if((w.hasStench(cX, cY+2))||(w.hasStench(cX-1, cY+1)&&w.isVisited(cX-1, cY))||(w.hasStench(cX+1, cY+1)&&w.isVisited(cX+1, cY)))//Condition for checking wumpus location\n {\n turnTo(World.DIR_UP);\n w.doAction(World.A_SHOOT);\n }\n else if((w.hasStench(cX+2, cY))||(w.hasStench(cX+1, cY-1)&&w.isVisited(cX, cY-1))||(w.hasStench(cX+1, cY+1)&&w.isVisited(cX, cY+1)))//Condition for checking wumpus location\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_SHOOT);\n }\n else if((w.hasStench(cX, cY-2))||(w.hasStench(cX-1, cY-1)&&w.isVisited(cX-1, cY))||(w.hasStench(cX+1, cY-1)&&w.isVisited(cX+1, cY)))//Condition for checking wumpus location\n {\n turnTo(World.DIR_DOWN);\n w.doAction(World.A_SHOOT);\n }\n else if((w.hasStench(cX-2, cY))||(w.hasStench(cX-1, cY+1)&&w.isVisited(cX, cY+1))||(w.hasStench(cX-1, cY-1)&&w.isVisited(cX, cY-1)))//Condition for checking wumpus location\n {\n turnTo(World.DIR_LEFT);\n w.doAction(World.A_SHOOT);\n }\n else if(cX==1&&cY==1) //First tile. Shoot North. If wumpus still alive, store its location as (2,1) to avoid it\n {\n turnTo(World.DIR_UP);\n w.doAction(World.A_SHOOT);\n if(w.hasStench(cX, cY))\n {\n wumpusLoc[0] = 2;\n wumpusLoc[1] = 1;\n }\n }\n else if(cX==1&&cY==4) //Condition for corner\n {\n if(w.isVisited(1, 3))\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_SHOOT);\n }\n if(w.isVisited(2, 4))\n {\n turnTo(World.DIR_DOWN);\n w.doAction(World.A_SHOOT);\n }\n \n }\n else if(cX==4&&cY==1) //Condition for corner\n {\n if(w.isVisited(3, 1))\n {\n turnTo(World.DIR_UP);\n w.doAction(World.A_SHOOT);\n }\n if(w.isVisited(4, 2))\n {\n turnTo(World.DIR_LEFT);\n w.doAction(World.A_SHOOT);\n }\n \n }\n else if(cX==4&&cY==4) //Condition for corner\n {\n if(w.isVisited(3, 4))\n {\n turnTo(World.DIR_DOWN);\n w.doAction(World.A_SHOOT);\n }\n if(w.isVisited(4, 3))\n {\n turnTo(World.DIR_LEFT);\n w.doAction(World.A_SHOOT);\n }\n \n }\n else if((cX==1)&&(w.isVisited(cX+1, cY-1))) //Condition for edge\n {\n \n turnTo(World.DIR_UP);\n w.doAction(World.A_SHOOT);\n }\n else if((cX==4)&&(w.isVisited(cX-1, cY-1))) //Condition for edge\n {\n turnTo(World.DIR_UP);\n w.doAction(World.A_SHOOT);\n }\n else if((cY==1)&&(w.isVisited(cX-1, cY+1))) //Condition for edge\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_SHOOT);\n }\n else if((cY==4)&&(w.isVisited(cX-1, cY-1))) //Condition for edge\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_SHOOT);\n }\n else //Can't locate wumpus, go back to safe location\n {\n turnTo((w.getDirection()+2)%4);\n w.doAction(World.A_MOVE);\n }\n }\n else // No stench. Explore \n {\n if(w.isValidPosition(cX, cY-1)&&!w.isVisited(cX, cY-1)&&isSafe(cX, cY-1)) \n {\n turnTo(World.DIR_DOWN);\n w.doAction(World.A_MOVE);\n }\n else if(w.isValidPosition(cX+1, cY)&&!w.isVisited(cX+1, cY)&&isSafe(cX+1, cY))\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_MOVE);\n }\n else if(w.isValidPosition(cX-1, cY)&&!w.isVisited(cX-1, cY)&&isSafe(cX-1,cY))\n {\n turnTo(World.DIR_LEFT);\n w.doAction(World.A_MOVE);\n }\n else\n {\n if(w.isValidPosition(cX, cY+1))\n {\n turnTo(World.DIR_UP);\n w.doAction(World.A_MOVE);\n }\n else if(w.isValidPosition(cX+1, cY))\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_MOVE);\n }\n else if(w.isValidPosition(cX-1, cY))\n {\n turnTo(World.DIR_LEFT);\n w.doAction(World.A_MOVE);\n }\n }\n }\n \n }",
"public void AIMakeMove() {\n\t\t\n\t\tRandom randomizer = new Random();\n\t\tint index = randomizer.nextInt(AIPossibleMoves.size());\n\t\tMove move = AIPossibleMoves.get(index);\n\t\tChecker checker = model.findChecker(move.getxOrigin(), move.getyOrigin());\n\t\tint xChange = (move.getxOrigin() - move.getxMove());\n\t\tint yChange = (move.getyOrigin() - move.getyMove());\n\t\t\n\t\tint xMoveNew = 0;\n\t\tint yMoveNew = 0;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tif(board.getBoard()[move.getyMove()][move.getxMove()] == 0) {\n\t\t\t//do nothing\n\t\t} else {\n\t\t\t//moving down\n\t\t\tif(yChange < 0) {\n\t\t\t\t//moving right\n\t\t\t\tif(xChange < 0) {\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() + 1;\n\t\t\t\t\tyMoveNew = move.getyMove() + 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t//moving left\n\t\t\t\t\t\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() - 1;\n\t\t\t\t\tyMoveNew = move.getyMove() + 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//moving up\n\t\t\t\tif(xChange < 0) {\n\t\t\t\t\t//moving right\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() + 1;\n\t\t\t\t\tyMoveNew = move.getyMove() - 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t} else {\n\t\t\t\t\t//moving left \n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() - 1;\n\t\t\t\t\tyMoveNew = move.getyMove() - 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t//System.out.println(\"New Move is: \" + xMoveNew + \",\" + yMoveNew);\n\t\tif(canBeKing(checker, move)) {\n\t\t\tchecker = convertToKing(checker, move);\n\t\t\tmodel.updateChecker(move, checker, 2);\n\t\t\t\n\t\t\tprintBoard();\n\t\t\tmodel.moves.add(move);\n\t\t\treturn;\n\t\t}\n\t\tmodel.updateChecker(move, checker, 2);\n\t//\tSystem.out.println(\"AI - DEBUGGING\");\n\t//\tSystem.out.println(\"Origin Piece: \" + move.getxOrigin() + \",\" + move.getyOrigin());\n\t//\tSystem.out.println(\"Move Position: \" + move.getxMove() + \",\" + move.getyMove());\n\t\tupdateBoard(move);\n\t\tmodel.moves.add(move);\n\t\tprintBoard();\n\t\t\n\t}",
"private String easyMove() {\n int randomHole = evaluate();\n while (!isValidMove(randomHole)) {\n randomHole = evaluate();\n }\n\n return super.makeAMove(randomHole);\n }",
"public String autoPlayAdvanced(int sign) {\n boolean validTurn = false;\n int temp1 = 0;\n int temp2 = 0;\n int sign2 = 0;\n //copy the board\n TicTacToe TTTemp = new TicTacToe(TTT.getSize());\n for (int i = 0; i < TTTemp.getSize(); i++) {\n for (int j = 0; j < TTTemp.getSize(); j++) {\n TTTemp.setTile(TTT.getTile(i, j), i, j);\n }\n }\n\n //player turn finding\n if (sign == 1) {\n sign2 = 2;\n } else {\n sign2 = 1;\n }\n\n int done = 0;\n //cycle to determine \"best\" or random move\n while (!validTurn) {\n switch (done) {\n case 0: //Win condition check\n loop:\n for (int i = 0; i < TTTemp.getSize(); i++) {\n for (int j = 0; j < TTTemp.getSize(); j++) {\n if (TTTemp.getTile(i, j) == 0) {\n TTTemp.setTile(sign, i, j);\n\n //if after changing empty tile to your sign...\n switch (TTTemp.check(sign)) {\n case \"Not won\":\n TTTemp.setTile(-1, i, j);\n done = 1;\n break;\n case \"Tie\":\n done = 1;\n break loop;\n default: //won in any way\n temp1 = i;\n temp2 = j;\n validTurn = TTT.safeChangeTile(sign, i, j);\n done = 2;\n break loop;\n }\n }\n }\n }\n break;\n case 1: //Player win condition check\n //copy board again\n for (int i = 0; i < TTTemp.getSize(); i++) {\n for (int j = 0; j < TTTemp.getSize(); j++) {\n TTTemp.setTile(TTT.getTile(i, j), i, j);\n }\n }\n\n loop:\n for (int i = 0; i < TTTemp.getSize(); i++) {\n for (int j = 0; j < TTTemp.getSize(); j++) {\n if (TTTemp.getTile(i, j) == 0) {\n TTTemp.setTile(sign2, i, j);\n\n //if after changing empty tile to player sign...\n switch (TTTemp.check(sign2)) {\n case \"Not won\":\n TTTemp.setTile(-1, i, j);\n done = 2;\n break;\n case \"Tie\":\n done = 2;\n break loop;\n default: //player might win\n temp1 = i;\n temp2 = j;\n validTurn = TTT.safeChangeTile(sign, i, j);\n done = 2;\n break loop;\n }\n }\n\n }\n }\n break;\n default: //if \"best\" move wasn't found mark a random tile\n temp1 = new Random().nextInt(TTT.getSize());\n temp2 = new Random().nextInt(TTT.getSize());\n validTurn = TTT.safeChangeTile(sign, temp1, temp2);\n break;\n }\n }\n\n // return selected tile\n return temp1 + \" \" + temp2;\n }",
"public static boolean createBattle(String race, String role, String name, String answer, String gameOver) {\n InputStreamReader sr = new InputStreamReader(System.in);\n BufferedReader br = new BufferedReader(sr);\n String action = null;\n try {\n\n // for humanWAR\n while (true) {\n action = br.readLine();\n if ((race.equalsIgnoreCase(\"человек\")) && (role.equalsIgnoreCase(\"воин\"))\n && (action.equalsIgnoreCase(\"атака\"))) {\n System.out.println(\n \"*Недолго думая, прикрывшись щитом от атаки клыками, Вы выхватываете меч из ножен и, \\n \"\n + \"сделав небольшой поворот корпуса, не без труда, вонзаете меч в тушу по самую рукоять.*\");\n System.out.println(\" . . .\");\n System.out.println(\n \" - Поздравляю! Этого оказалось достаточно, чтобы добыть себе сытный ужин и поднять уровень! Что значит \\'какой\\'? Высокий! Ну, скажем, восьмидесятый. Вот... \\n\"\n + \"Отныне герой \" + name.toUpperCase() + \" \" + role.toUpperCase()\n + \" 80-го уровня!\");\n return true;\n }\n if ((race.equalsIgnoreCase(\"человек\")) && (role.equalsIgnoreCase(\"воин\"))\n && (action.equalsIgnoreCase(\"отступить\"))) {\n System.out.println(\n \"*Вы пытаетесь тактически маневрировать, но предательский корень позади, торчащий из земли и незамеченный ранее, делает подножку. Вы посрамлены и втоптаны в землю.*\");\n System.out.println(gameOver);\n break;\n }\n if ((race.equalsIgnoreCase(\"человек\")) && (role.equalsIgnoreCase(\"воин\"))\n && (action.equalsIgnoreCase(\"кубик\")) && (answer.equalsIgnoreCase(\"ОСМОТРЕТЬ\"))) {\n System.out.println(\n \"- Знаешь, это крайне странное решение в сложившейся ситуации, но, безусловно, выбор твой. Только как это помо... \\n\"\n + \"*После броска кубика, Вы успели заметить \\'5\\' на верхней грани двадцатигранного кубика и тень.\\n\"\n + \" Тень стремительно приближающегося кабанчика. Удар. Blackout.*\");\n System.out.println(gameOver);\n break;\n }\n\n\n // for humanMAGE\n if ((race.equalsIgnoreCase(\"человек\")) && (role.equalsIgnoreCase(\"маг\"))\n && (action.equalsIgnoreCase(\"атака\"))) {\n System.out.println(\"- Давай! Испепели! Заморозь! РАЗУПЛОТНИ!\");\n System.out.println(\n \"*Вы воздели посох над головой и начали произносить на распев, повышая голос и укрепляя заклинание, слова \\\"наследованиеИнкАпсулЯцияПОЛИМОРФИЗМ!\\n\"\n + \"*Раздался гром, искры из посоха превратились в ослепительный поток света, земля задрожала, а мгоновение спустя все стихло. \\n\"\n + \" На месте кабанчика оказалась лишь полянка выжженой земли и горстка пепла.* \\n \");\n System.out.println(\" . . .\");\n System.out.println(\n \" - Поздравляю! Этого оказалось достаточно, чтобы испепелить свой ужин и поднять уровень! Что значит \\'какой\\'? Высокий! Ну, скажем, восьмидесятый. Вот... \\n\"\n + \"- Отныне герой \" + name.toUpperCase() + \" - \" + role.toUpperCase()\n + \" 80-го уровня!\");\n return true;\n }\n if ((race.equalsIgnoreCase(\"человек\")) && (role.equalsIgnoreCase(\"маг\"))\n && (action.equalsIgnoreCase(\"отступить\"))) {\n System.out.println(\n \"*Вы пытаетесь тактически маневрировать, но предательский корень позади, торчащий из земли и незамеченный ранее, делает подножку. Вы посрамлены и втоптаны в землю.*\");\n System.out.println(gameOver);\n break;\n }\n if ((race.equalsIgnoreCase(\"человек\")) && (role.equalsIgnoreCase(\"маг\"))\n && (action.equalsIgnoreCase(\"кубик\")) && (answer.equalsIgnoreCase(\"ОСМОТРЕТЬ\"))) {\n System.out.println(\n \"- Знаешь, это крайне странное решение в сложившейся ситуации, но, безусловно, выбор твой. Только как это помо... \\n\"\n + \"*После броска кубика, Вы успели заметить \\'2\\' на верхней грани двадцатигранного кубика и тень.\\n\"\n + \" Тень стремительно приближающегося кабанчика. Удар. Blackout.*\");\n System.out.println(gameOver);\n break;\n }\n\n\n // for humanROGUE\n if ((race.equalsIgnoreCase(\"человек\")) && (role.equalsIgnoreCase(\"разбойник\"))\n && (action.equalsIgnoreCase(\"атака\"))) {\n System.out.println(\"*Кувырок! Перекат! Влево! Вправо! \\n\"\n + \"Клинки сверкают как молнии! Да, стразики делают свое дело. \\n \" + \"Перекат! Еще удар! \\n\"\n + \"Ваша атака была такой стремительной, что кабанчки даже не успел сдвинуться с места.*\");\n System.out.println(\" . . .\");\n System.out.println(\n \" - Поздравляю! Этого оказалось достаточно, чтобы подготовить рубленный фарш к ужину и поднять уровень! Что значит \\'какой\\'? Высокий! Ну, скажем, восьмидесятый. Вот... \\n\"\n + \"- Отныне герой \" + name.toUpperCase() + \" - \" + role.toUpperCase()\n + \" 80-го уровня!\");\n return true;\n\n }\n if ((race.equalsIgnoreCase(\"человек\")) && (role.equalsIgnoreCase(\"разбойник\"))\n && (action.equalsIgnoreCase(\"отступить\"))) {\n System.out.println(\n \"*Плавно скользя словно тень, с кошачьей грацией Вы уклоняетесь от неистовой атаки черной, как уголь, кабанчиковой туши. \\n\"\n + \"Кабанчик пронесся мимо и застыл в недоумении водя рылом в поисках жертвы. \\n\"\n + \"Воспользовавшись секундой свиного замешательства Вы нанесли серию ударов.\");\n System.out.println(\" . . .\");\n System.out.println(\n \" - Поздравляю! Этого оказалось достаточно, чтобы подготовить рубленый фарш к ужину и поднять уровень! Что значит \\'какой\\'? Высокий! Ну, скажем, восьмидесятый. Вот... \\n\"\n + \"- Отныне герой \" + name.toUpperCase() + \" - \" + role.toUpperCase()\n + \" 80-го уровня!\");\n return true;\n }\n if ((race.equalsIgnoreCase(\"человек\")) && (role.equalsIgnoreCase(\"разбойник\"))\n && (action.equalsIgnoreCase(\"кубик\")) && (answer.equalsIgnoreCase(\"ОСМОТРЕТЬ\"))) {\n System.out.println(\n \"- Знаешь, это крайне странное решение в сложившейся ситуации, но, безусловно, выбор твой. Только как это помо... \\n\"\n + \"*После броска кубика, Вы успели заметить \\'5\\' на верхней грани двадцатигранного кубика и тень.\\n\"\n + \" Тень стремительно приближающегося кабанчика. Удар. Blackout.*\");\n System.out.println(gameOver);\n break;\n }\n\n\n // for elfWAR\n if ((race.equalsIgnoreCase(\"эльф\")) && (role.equalsIgnoreCase(\"воин\"))\n && (action.equalsIgnoreCase(\"атака\"))) {\n System.out.println(\n \"*Испустив боевой визг, Вы попытались извлечь меч из ножен, но что-то пошло не так: \\n \"\n + \"то ли меч застрял, то ли его вес был слишком большой для тонких эльфийский рук. \\n\"\n + \" В любом случае, Вы так и не поняли, что же так громко звякнуло.*\");\n System.out.println(gameOver);\n break;\n }\n if ((race.equalsIgnoreCase(\"эльф\")) && (role.equalsIgnoreCase(\"воин\"))\n && (action.equalsIgnoreCase(\"отступить\"))) {\n System.out.println(\n \"*Вы пытаетесь броситься наутек, в сторону или куда-нибудь, но тяжесть доспехов, щита и меча, заставили Вас врасти в землю. \\n\"\n + \" Удар! Звон металла! Довольный хрюк! Занавес.\");\n System.out.println(gameOver);\n break;\n }\n if ((race.equalsIgnoreCase(\"эльф\")) && (role.equalsIgnoreCase(\"воин\"))\n && (action.equalsIgnoreCase(\"кубик\")) && (answer.equalsIgnoreCase(\"ОСМОТРЕТЬ\"))) {\n System.out.println(\n \"- Знаешь, это крайне странное решение в сложившейся ситуации, но, безусловно, выбор твой. Только как это помо... \\n\"\n + \"*После броска кубика, Вы успели заметить \\'2\\' на верхней грани двадцатигранного кубика и тень.\\n\"\n + \" Тень стремительно приближающегося кабанчика. Удар. Blackout.*\");\n System.out.println(gameOver);\n break;\n }\n\n\n // for elfMAGE\n if ((race.equalsIgnoreCase(\"эльф\")) && (role.equalsIgnoreCase(\"маг\"))\n && (action.equalsIgnoreCase(\"атака\"))) {\n System.out.println(\n \"*Выкрик \\'encapsulation!\\': посох вырвался из ваших рук и повис в воздухе перед Вами. \\n\"\n + \"Вы раскинули руки в стороны. Выкрик \\'inheritance!\\': на кончиках пальцев заплясали разноцветные искры. \\n\"\n + \"Выкрик \\'polymorphism!\\': свет вокруг пальцев начал тянуться к верхушке парящего посоха и формироваться в сферу, на поверхности которой рябью пробегали единички и нолики. \\n\"\n + \"Крик, заглушающий гул потоков магии и ветра \\'ABSTARCTIOOOON!\\': хлопок руками перед собой, сфера сорвалась с верхушки посоха и устремилась молнией в бегущего кабанчика. \\n\"\n + \"ВСПЫШКА! ... Тишина. Когда свет стал естественным и пыль улягась, Вы обнаружили вместо кабанчика связку чудесных свиных сосисок. \");\n\n System.out.println(\" . . .\");\n System.out.println(\n \"- Это было великолепно! Я даже не представляю что это было за кунг-фу такое, но этого, конечно же, достаточно чтобы поднять уровень и даже больше! Вот... \\n\"\n + \"- Отныне герой \" + name.toUpperCase() + \" - \" + race.toUpperCase()\n + \" 80-го уровня! \\n\" + \"- А также, герой \" + name.toUpperCase() + \" теперь \"\n + role.toUpperCase() + \" 100-го уровня!\");\n return true;\n }\n if ((race.equalsIgnoreCase(\"эльф\")) && (role.equalsIgnoreCase(\"маг\"))\n && (action.equalsIgnoreCase(\"отступить\"))) {\n System.out.println(\n \"*Направив верхушку посоха в сторону бегущего на Вас кабанчика, Вы крикнули \\'piggyIsEmpty()!\\' \\n \"\n + \"и свирепое животное, в мгновении ока, начало истончаться и испаряться, оставляя шлейф из еле заметных единичек и ноликов\");\n System.out.println(\" . . .\");\n System.out.println(\n \" - Поздравляю! Этого оказалось достаточно, чтобы разуплотнить Ваш ужин и поднять уровень! Что значит \\'какой\\'? Высокий! Ну, скажем, восьмидесятый. Вот... \\n\"\n + \"- Отныне герой \" + name.toUpperCase() + \" - \" + role.toUpperCase()\n + \" 80-го уровня!\");\n return true;\n }\n if ((race.equalsIgnoreCase(\"эльф\")) && (role.equalsIgnoreCase(\"маг\"))\n && (action.equalsIgnoreCase(\"кубик\")) && (answer.equalsIgnoreCase(\"ОСМОТРЕТЬ\"))) {\n System.out.println(\n \"- Знаешь, это крайне странное решение в сложившейся ситуации, но, безусловно, выбор твой. Только как это помо... \\n\"\n + \"*После броска кубика, Вы успели заметить \\'2\\' на верхней грани двадцатигранного кубика и тень.\\n\"\n + \" Тень стремительно приближающегося кабанчика. Удар. Blackout.*\");\n System.out.println(gameOver);\n break;\n }\n if ((race.equalsIgnoreCase(\"эльф\")) && (role.equalsIgnoreCase(\"маг\"))\n && (action.equalsIgnoreCase(\"кубик\"))) {\n System.out.println(\"Что? Какой кубик? КАБАНЧИК АТАКУЕТ! \\n\"\n + \"*Вы так и не успели понять суть своих действий. Атака кабанчика была яростной и стремительной.*\");\n System.out.println(gameOver);\n break;\n }\n\n // for elfROGUE\n if ((race.equalsIgnoreCase(\"эльф\")) && (role.equalsIgnoreCase(\"разбойник\"))\n && (action.equalsIgnoreCase(\"атака\"))) {\n System.out.println(\n \"*Вы прекрасно двигаетесь. Грация и легкость, точность и скорость. Но вот чего действительно не хватает, так это силы, чтобы пробить кинжалами толстую кабанчиковую кожу.\");\n System.out.println(gameOver);\n break;\n }\n if ((race.equalsIgnoreCase(\"эльф\")) && (role.equalsIgnoreCase(\"разбойник\"))\n && (action.equalsIgnoreCase(\"отступить\"))) {\n System.out.println(\n \"*Прекрасный пируэт! Еще па и враг снова пронесся мимо. Вы готовы кружиться в этом танце вечность, но внезапно закончилась выносливость.\");\n System.out.println(gameOver);\n break;\n }\n if ((race.equalsIgnoreCase(\"эльф\")) && (role.equalsIgnoreCase(\"разбойник\"))\n && (action.equalsIgnoreCase(\"кубик\")) && (answer.equalsIgnoreCase(\"ОСМОТРЕТЬ\"))) {\n System.out.println(\n \"- Знаешь, это крайне странное решение в сложившейся ситуации, но, безусловно, выбор твой. Только как это помо... \\n\"\n + \"*После броска кубика, Вы успели заметить \\'5\\' на верхней грани двадцатигранного кубика и тень.\\n\"\n + \" Тень стремительно приближающегося кабанчика. Удар. Blackout.*\");\n System.out.println(gameOver);\n break;\n }\n\n\n // for orcWar\n if ((race.equalsIgnoreCase(\"орк\")) && (role.equalsIgnoreCase(\"воин\"))\n && (action.equalsIgnoreCase(\"атака\"))) {\n System.out.println(\n \"*Отбросив щит, перехватив меч поудобнее, одним точным, уверенным движением Вы разрубили свирепое животное на три... о, погодите-ка, на четыре части!\");\n System.out.println(\" . . .\");\n System.out.println(\n \" - Поздравляю! Этого оказалось достаточно, чтобы приготовить сочных стейков к ужину и поднять уровень! Что значит \\'какой\\'? Высокий! Ну, скажем, восьмидесятый. Вот... \\n\"\n + \"- Отныне герой \" + name.toUpperCase() + \" - \" + role.toUpperCase()\n + \" 80-го уровня!\");\n return true;\n }\n if ((race.equalsIgnoreCase(\"орк\")) && (role.equalsIgnoreCase(\"воин\"))\n && (action.equalsIgnoreCase(\"отступить\"))) {\n System.out.println(\n \"*Отступить? Что за вздор? Издав боевой клич древних предков \\'FUS-RO-DAH!\\', Вы бросились на атакующего Вас кабанчика. Даже голыми руками вы с легкостью одолели врага.*\");\n System.out.println(\" . . .\");\n System.out.println(\n \" - Поздравляю! Этого оказалось достаточно, чтобы приготовить сочные отбивные к ужину и поднять уровень! Что значит \\'какой\\'? Высокий! Ну, скажем, восьмидесятый. Вот... \\n\"\n + \"- Отныне герой \" + name.toUpperCase() + \" - \" + role.toUpperCase()\n + \" 80-го уровня!\");\n return true;\n }\n if ((race.equalsIgnoreCase(\"орк\")) && (role.equalsIgnoreCase(\"воин\"))\n && (action.equalsIgnoreCase(\"кубик\")) && (answer.equalsIgnoreCase(\"ОСМОТРЕТЬ\"))) {\n System.out.println(\n \"- Знаешь, это крайне странное решение в сложившейся ситуации, но, безусловно, выбор твой. Только как это помо... \\n\"\n + \"*После броска кубика, Вы успели заметить \\'2\\' на верхней грани двадцатигранного кубика и тень.\\n\"\n + \" Тень стремительно приближающегося кабанчика. Удар. Blackout.*\");\n System.out.println(gameOver);\n break;\n }\n\n\n // for orcMAGE\n if ((race.equalsIgnoreCase(\"орк\")) && (role.equalsIgnoreCase(\"маг\"))\n && (action.equalsIgnoreCase(\"атака\"))) {\n System.out.println(\n \"*Размахивая магическим посохом как палкой и выкрикивая, определенно, не заклинания, Вы ринулись в атаку. \\n\"\n + \" Как результат, посох-палка разлетелся в щепки при первом же ударе. Высвобожденная энергия стихий сдетонировала и очистила обширную территорию от любой флоры и фауны.\");\n System.out.println(gameOver);\n break;\n }\n if ((race.equalsIgnoreCase(\"орк\")) && (role.equalsIgnoreCase(\"маг\"))\n && (action.equalsIgnoreCase(\"отступить\"))) {\n System.out.println(\n \"Успешно маневрируя Вы отступаете. Все идет как надо, вот-вот Вы выйдете из боя целым и невредимым.\\n\"\n + \" Но вдруг, кабанчик резко меняет тактику и заходит с фланга! Вы профессионально блокируете удар посохом. \\n.\"\n + \" Слышится треск ломаемой древесины. Это посох, не выдержав натиска, разлетелся в щепки. \\n \"\n + \"Высвобожденная энергия стихий сдетонировала и очистила обширную территорию от любой флоры и фауны\");\n\n System.out.println(gameOver);\n break;\n }\n if ((race.equalsIgnoreCase(\"орк\")) && (role.equalsIgnoreCase(\"маг\"))\n && (action.equalsIgnoreCase(\"кубик\")) && (answer.equalsIgnoreCase(\"ОСМОТРЕТЬ\"))) {\n System.out.println(\n \"- Знаешь, это крайне странное решение в сложившейся ситуации, но, безусловно, выбор твой. Только как это помо... \\n\"\n + \"*После броска кубика, Вы успели заметить \\'2\\' на верхней грани двадцатигранного кубика и тень.\\n\"\n + \" Тень стремительно приближающегося кабанчика. Удар. Blackout.*\");\n System.out.println(\" . . .\");\n System.out.println(gameOver);\n break;\n }\n\n\n // for orcROGUE\n if ((race.equalsIgnoreCase(\"орк\")) && (role.equalsIgnoreCase(\"разбойник\"))\n && (action.equalsIgnoreCase(\"атака\"))) {\n System.out.println(\n \"*С криками о родословной кабанчика, Вы бросаетесь в атаку. Хватило одного удара, чтобы кабанчик сдался\");\n System.out.println(\" . . .\");\n System.out.println(\n \" - Поздравляю! Этого оказалось достаточно, чтобы нарубить сочных стейков к ужину и поднять уровень! Что значит \\'какой\\'? Высокий! Ну, скажем, восьмидесятый. Вот... \\n\"\n + \"- Отныне герой \" + name.toUpperCase() + \" - \" + role.toUpperCase()\n + \" 80-го уровня!\");\n return true;\n }\n if ((race.equalsIgnoreCase(\"орк\")) && (role.equalsIgnoreCase(\"разбойник\"))\n && (action.equalsIgnoreCase(\"отступить\"))) {\n System.out.println(\n \"*Вы попытались профессионально отпрыгнуть в сторону, но, с грацией мешка картошки, просто повалилсь на землю.\");\n System.out.println(gameOver);\n break;\n }\n if ((race.equalsIgnoreCase(\"орк\")) && (role.equalsIgnoreCase(\"разбойник\"))\n && (action.equalsIgnoreCase(\"кубик\")) && (answer.equalsIgnoreCase(\"ОСМОТРЕТЬ\"))) {\n System.out.println(\n \"- Знаешь, это крайне странное решение в сложившейся ситуации, но, безусловно, выбор твой. Только как это помо... \\n\"\n + \"*После броска кубика, Вы успели заметить \\'5\\' на верхней грани двадцатигранного кубика и тень.\\n\"\n + \" Тень стремительно приближающегося кабанчика. Удар. Blackout.*\");\n System.out.println(gameOver);\n break;\n } else {\n System.out.println(\n \"- Тестировщик, штоле? Тебя вот-вот выпотрошит кабанчик, а ты ищешь баги? В другой раз.\");\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return false;\n }",
"public void act() \r\n {\r\n move(5);\r\n if(isAtEdge())\r\n turn(4);\r\n if(Greenfoot.getRandomNumber(35) < 34)\r\n turn(10);\r\n if(Greenfoot.getRandomNumber(20)<5)\r\n turn(-15);\r\n }",
"@Override\r\n\tpublic void runBehaviors() throws GameActionException {\r\n\t\tID = player.myIntel.getArchonID();\r\n\t\tarchonList = player.myIntel.getArchonList();\r\n\t\tmyLoc = player.myRC.getLocation();\r\n\t\tmyX = myLoc.getX();\r\n\t\tmyY = myLoc.getY();\r\n\t\tmyDir = player.myRC.getDirection();\r\n\t\tswitch(state) {\r\n\t\tcase 0:\r\n\t\t\tdir = spreadDirection();\r\n\t\t\tif (dir != Direction.NONE) state = 1;\r\n\t\t\tbreak;\r\n\t\tcase 1:\r\n\t\t\tif (myDir.equals(dir)) state = 2;\r\n\t\t\telse {\r\n\t\t\t\tplayer.myRC.setDirection(dir);\r\n\t\t\t\tstate = 2;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tif (player.myRC.getRoundsUntilMovementIdle()==0 && player.myRC.hasActionSet()==false) {\r\n\t\t\t\tif (player.myRC.canMove(myDir)) {\r\n\t\t\t\t\tplayer.myRC.moveForward();\r\n\t\t\t\t\tmoveCounter++;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tplayer.myRC.setDirection(myDir.rotateRight());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif (moveCounter >= AMOUNT_TO_SPREAD) state = 3;\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\t\r\n\t\t\tif (player.myRC.getRoundsUntilMovementIdle()==0 && player.myRC.hasActionSet()==false) {\r\n\t\t\t\tif (player.myRC.senseTerrainTile(myLoc.add(myDir)).getType() != TerrainType.LAND) {\r\n\t\t\t\t\tlandFinder();\r\n\t\t\t\t\tif (landSquares == 0) {\r\n\t\t\t\t\t\tplayer.myRC.setDirection(player.myUtils.randDir());\r\n\t\t\t\t\t\tstate = 2;\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t\tplayer.myRC.setDirection(turnDir);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//STRATEGY TRANSITION\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\tplayer.myRC.setIndicatorString(2, dir.toString());\r\n\t}",
"public void go()\n {\n\tSystem.out.println(_board.toString());\n\tboolean legalMove;\n\tScanner sc = new Scanner(System.in);\n\n\tSystem.out.println(\"Press 1 to turn on HeisenGo, Press any other number to proceed normally.\");\n\t_heisen = (sc.nextInt() == 1);\n\n\twhile(true)\n\t {\n\t\tint x, y;\n\n\t\tSystem.out.println(\"Enter X coodinate, enter -1 to quit and 0 to pass\");\n\t\tx = sc.nextInt();\n\t\tif(x == 0)\n\t\t _passes++;\n\t\telse if(x == -1)\n\t\t break;\n\t\telse\n\t\t _passes = 0;\n\n\t\tif(_passes == 2)\n\t\t break;\n\n\t\tif(x != 0)\n\t\t {\n\t\t\tSystem.out.println(\"Enter Y coordinate\");\n\t\t\ty = sc.nextInt();\n\n\t\t\tif(_heisen)\n\t\t\t {\n\t\t\t\tint distance = 0 ;\n\t\t\t\tint dx;\n\t\t\t\tint dy;\n\t\t\t\tboolean legal = false;\n\n\t\t\t\twhile(!legal)\n\t\t\t\t {\n\t\t\t\t\tdouble temp = (Math.random()*(64.2 + 13.1*4 + 4.2*8 + 0.2*12));\n\t\t\t\t\tif(temp > 64.2 + 13.1*4 + 4.2*8 + 0.2*12 - 0.0001)\n\t\t\t\t\t {\n\t\t\t\t\t\tdistance = 0;\n\t\t\t\t\t\tx = (int)(Math.random()*20);\n\t\t\t\t\t\ty = (int)(Math.random()*20);\n\t\t\t\t\t }\n\t\t\t\t\telse if(temp > (64.2 + 13.1*4 + 4.2*8))\n\t\t\t\t\t distance = 3;\n\t\t\t\t\telse if(temp > (64.2 + 13.1*4))\n\t\t\t\t\t distance = 2;\n\t\t\t\t\telse if(temp > 64.2)\n\t\t\t\t\t distance = 1;\n\t\t\t\t\tif(distance > 0)\n\t\t\t\t\t {\n\t\t\t\t\t\tdx = (int)(Math.random()*distance + 1);\n\t\t\t\t\t\tdy = distance - dx;\n\t\t\t\t\t\tif(Math.random() > 0.5)\n\t\t\t\t\t\t x = x + dx;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t x = x - dx;\n\t\t\t\t\t\tif(Math.random() > 0.5)\n\t\t\t\t\t\t y = y + dy;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t y = y - dy;\n\t\t\t\t\t }\n\t\t\t\t\tif(_turns%2 == 0)\n\t\t\t\t\t legal = _board.playStone(Affiliation.BLACK, x, y);\n\t\t\t\t\telse\n\t\t\t\t\t legal = _board.playStone(Affiliation.WHITE, x, y);\n\n\t\t\t\t }\n\t\t\t }\n\n\t\t\tif(!_heisen)\n\t\t\t {\n\t\t\t\tif(_turns%2 == 0)\n\t\t\t\t legalMove = _board.playStone(Affiliation.BLACK, x, y);\n\t\t\t\telse\n\t\t\t\t legalMove = _board.playStone(Affiliation.WHITE, x, y);\n\n\t\t\t\twhile(legalMove == false)\n\t\t\t\t {\n\t\t\t\t\tSystem.out.println(\"Illegal Move try again\");\n\n\t\t\t\t\tSystem.out.println(\"Enter X coodinate\");\n\t\t\t\t\tx = sc.nextInt();\n\t\t\t\t\tif(x == 9000)\n\t\t\t\t\t break;\n\t\t\t\t\tSystem.out.println(\"Enter Y coordinate\");\n\t\t\t\t\ty = sc.nextInt();\n\t\t\t\t\tif(_turns%2 == 0)\n\t\t\t\t\t legalMove = _board.playStone(Affiliation.BLACK, x, y);\n\t\t\t\t\telse\n\t\t\t\t\t legalMove = _board.playStone(Affiliation.WHITE, x, y);\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t_turns++;\n\t\tSystem.out.println(_board.toString());\n\t }\n\tif(_passes == 2)\n\t {\n\t\tSystem.out.println(endGame());\n\t\tSystem.out.println(_board.toString());\n\t }\n }",
"private void wanderingBehavior() {\n\t\tif (moving) {\n\t\t\tupdatePixels(action);\n\t\t\tremainingSteps -= speed;\n\t\t\tif (remainingSteps == 0) {\n\t\t\t\tmoving = false;\n\t\t\t\tcurrentImage = stopAnimation(action);\n\t\t\t\tupdateCoordinate(facing, false);\n\t\t\t}\n\t\t} else if (remainingSteps > 0) {\n\t\t\tremainingSteps -= speed;\n\t\t} else {\n\t\t\trandom = rand.nextInt(100);\n\t\t\tif (Math.abs(random) < 2) {\n\t\t\t\trandom = rand.nextInt(4);\n\t\t\t\t{\n\t\t\t\t\tswitch (random) {\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tchangeFacing(ACTION.DOWN);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tchangeFacing(ACTION.RIGHT);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tchangeFacing(ACTION.UP);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tchangeFacing(ACTION.LEFT);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\trandom = rand.nextInt(3);\n\t\t\t\t\tremainingSteps = STEP_SIZE * 2;\n\t\t\t\t\tif (random != 0 && validMoveEh(facing) && validWanderEh(facing)) {\n\t\t\t\t\t\tremainingSteps -= STEP_SIZE;\n\t\t\t\t\t\taction = facing;\n\t\t\t\t\t\tcurrentImage = startAnimation(action);\n\t\t\t\t\t\tmoving = true;\n\t\t\t\t\t\tupdateCoordinate(facing, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void roam(){\r\n Random rand = new Random();\r\n String aniName = this.getName();\r\n String aniType = this.getAniType();\r\n //Chance will be a number between 1 and 100\r\n int chance = rand.nextInt(100) + 1;\r\n //25% chance that the pachyderm will charge\r\n if (chance <= 25){\r\n System.out.println(aniName + \" the \" + aniType + \" charges.\");\r\n }\r\n //75% chance the method works as originally intended.\r\n else{\r\n System.out.println(aniName + \" the \" + aniType + \" roams.\");\r\n }\r\n }",
"@Override\n public void takeTurn(CombatCharacter agent) {\n this.agent=agent;\n while(agent.attributes.getAP()>0){\n StrategySkill s =getBestMove();\n if(s!=null) s.useSkill();\n else return;\n }\n }",
"abstract public boolean performNextAttack();",
"public interface AI {\n\n /**\n * Sets the new enemy position.\n * @param pos the new enemy position\n */\n void setEnemyPos(Point2D pos);\n\n /**\n * Returns the new position for the enemy to\n * move to.\n * @param target the position that wants to be tracked\n * @param pursuit the state in which the enemy is in\n * @param map\n * @return the position to move to\n */\n Point2D getNextMove(Point2D target, boolean pursuit, Set<Point2D> map);\n\n /**\n * Returns the new enemy rotation based on the\n * state in which the enemy is in.\n * @param target the position that wants to be tracked\n * @param pursuit the state in which the enemy is in\n * @return the angle that the enemy should face\n */\n double getRotation(Point2D target, boolean pursuit);\n\n /**\n * Returns if the enemy is in pursuit of the target\n * by calculating if the noise radius overlap with the\n * two.\n * @param target the position that wants to be tracked\n * @param noise the radius of the noise made by a player action\n * @return the state in which the enemy will be in\n * @see Player\n */\n boolean isInPursuit(Point2D target, double noise);\n\n /**\n * Returns if the enemy has the {@code target} in line of\n * sight and is close enough to get the enemy attention\n * to shoot.\n * @param target the position that wants to be tracked\n * @return the action that should be performed by the enemy\n */\n boolean isShooting(Point2D target);\n\n /**\n * Returns the collection of all position to check\n * if target is obscured by a wall used to JUnit\n * tests purpose.\n * @return the collections of all wall objects position\n */\n Set<Point2D> getWallSet();\n\n}",
"public static void main(String[] args)\n {\n heroCreation();\n \n while (action != 9) {\n //Random monster creation with pre determined stats\n monsterCreation();\n //Assigning original variables to variables that will be changed\n statTransition();\n \n //Declare variable that will be used for retry answer\n int answer;\n \n \n \n while (action != 9) { \n //Printing of combat information\n combatInfo();\n action = 0;\n //While Action is neither 1, 2, 3, and 4 OR while Action is 2 without having 3 or more mana\n while ((action != 1 && action != 2 && action != 3 && action != 4) || (action == 2 && heroMagic < 3)) {\n //Combat loop method\n combatLoop1();\n }\n combatLoop2(); \n } \n } \n }",
"@Test\n\tpublic void testIfForbriddenSelfKillAdvanced(){\n\t\tboard.commitMove(new Point(2,1), 1);\n\t\tboard.commitMove(new Point(3,1), 1);\n\t\tboard.commitMove(new Point(4,2), 1);\n\t\tboard.commitMove(new Point(3,3), 1);\n\t\tboard.commitMove(new Point(3,4), 1);\n\t\tboard.commitMove(new Point(2,5), 1);\n\t\tboard.commitMove(new Point(1,4), 1);\n\t\tboard.commitMove(new Point(1,3), 1);\n\t\tboard.commitMove(new Point(1,2), 1);\n\t\t\n\t\tboard.commitMove(new Point(2,4), 0);\n\t\tboard.commitMove(new Point(2,3), 0);\n\t\tassertEquals(0, board.commitMove(new Point(2,2), 0));\n\t\tassertNotEquals(0,board.commitMove(new Point(3,2), 0));\n//\t\tboard.printBoard();\n\t}",
"void think() {\n //get the output of the neural network\n decision = brain.output(vision);\n\n if (decision[0] > 0.8) {//output 0 is boosting\n boosting = true;\n } else {\n boosting = false;\n }\n if (decision[1] > 0.8) {//output 1 is turn left\n spin = -0.08f;\n } else {//cant turn right and left at the same time\n if (decision[2] > 0.8) {//output 2 is turn right\n spin = 0.08f;\n } else {//if neither then dont turn\n spin = 0;\n }\n }\n //shooting\n if (decision[3] > 0.8) {//output 3 is shooting\n shoot();\n }\n }",
"public static void main(String[] args) {\n\t\t\n\t//2. create an array of 5 robots.\n\tRobot[] robs = new Robot[5];\n\t//3. use a for loop to initialize the robots.\n\tfor (int i = 0; i < robs.length; i++) {\n\t\t\trobs[i] = new Robot();\n\t\t\trobs[i].setX(100 * i + 100);\n\t\t\trobs[i].setY(500);\n\t\t\trobs[i].setSpeed(10);\n\t}\n\t\t//4. make each robot start at the bottom of the screen, side by side, facing up\n\t\t\n\t//5. use another for loop to iterate through the array and make each robot move \n\t// a random amount less than 50.\n\tfor (int i = 0; i < robs.length; i++) {\n\t\tRandom rnd = new Random();\n\t\trobs[i].move(rnd.nextInt(50)+1);\n\t}\n\t//6. use a while loop to repeat step 5 until a robot has reached the top of the screen.\n\tboolean notwon = true;\n\tint winner = -250;\n\twhile(notwon) {\n\t\tfor (int i = 0; i < robs.length; i++) {\n\t\t\tRandom rnd = new Random();\n\t\t\trobs[i].move(rnd.nextInt(50)+1);\n\t\t}\n\t\tfor (int i = 0; i < robs.length; i++) {\n\t\t\tif (notwon && winner == -250 && robs[i].getY() <= 72) {\n\t\t\t\twinner = i;\n\t\t\t\tnotwon = false;\n\t\t\t}\n\t\t}\n\t}\n\t\n\trobs[winner].sparkle();\n\t//7. declare that robot the winner and throw it a party!\n\t\n\t//8. try different races with different amounts of robots.\n\n\t//9. make the robots race around a circular track.\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 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 }",
"private boolean gameOver()\n {\n \t//lose case\n \tif (guess_number == 0)\n \t{\n \t\twin = false;\n \t\treturn true;\n \t}\n \t//win case\n \tif (mask.compareTo(word) == 0)\n \t{\n \t\twin = true;\n \t\treturn true;\n \t}\n \t\n \treturn false;\n }",
"@Test\n public void alienAttacksNoone() throws FileNotFoundException,\n URISyntaxException, 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 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 sendTurnViewModel() {\n }\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 List<Player> players = new ArrayList<Player>(party.getMembers()\n .keySet());\n Player player1 = players.get(0);\n player1.setIdentity(alien);\n\n matchController.initMatch(partyController);\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.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.getMatch().getDeadPlayer().size() == 0);\n }",
"public int decideRandomMove() {\n return (int) (Math.random() * 4);\n }",
"static void yellow_fight () {\n monsterchoices_y_r = arenafight_y.nextInt(4);\n if (monsterchoices_y_r == 0) {//if integer is zero, you will fight a spider\n System.out.println(\"You encountered a giant spider.\");//#enemyobject-enemy that player tries to defeat\n spider_fight();\n }else if(monsterchoices_y_r == 1) {//if integer is 1 you would fight a goblin\n System.out.println(\"You encountered a goblin.\");//#enemyobject-enemy that player tries to defeat\n goblin_fights(); \n }else if(monsterchoices_y_r == 2) { //if integer is 2, you would fight a golbat\n System.out.println(\"You encountered a golbat.\");//#enemyobject-enemy that player tries to defeat\n golbat_fights();\n }else if(monsterchoices_y_r == 3) { //if the integer is 3, you would fight a witch\n System.out.println(\"You encountered a witch.\");//#enemyobject-enemy that player tries to defeat\n witch_fights();\n }\n \n }",
"private boolean learning()\r\n\t{\r\n\t\tint temp = (int) (Math.random() * 100);\t\t//generate a random int between 0-100\r\n\t\tif(temp<=intelligence)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}",
"public static Move openingStrategy(PentagoBoardState boardState, int player) {\n\t Move firstMoveOne = new PentagoMove(1, 0, Quadrant.BL, Quadrant.BR, player);\r\n\t Move firstMoveTwo = new PentagoMove(1, 3, Quadrant.BL, Quadrant.BR, player);\r\n\t Move moveThree = new PentagoMove(0, 1, Quadrant.BL, Quadrant.TR, player);\r\n\t Move moveFour = new PentagoMove(0, 4, Quadrant.TL, Quadrant.BR, player);\r\n\t Move moveFive = new PentagoMove(3, 1, Quadrant.BL, Quadrant.TL, player);\r\n\t Move moveSix = new PentagoMove(3, 4, Quadrant.TL, Quadrant.TR, player);\r\n\t Move moveSeven = new PentagoMove(2, 2, Quadrant.TL, Quadrant.TR, player);\r\n\t Move moveEight = new PentagoMove(2, 5, Quadrant.TL, Quadrant.BR, player);\r\n\t Move moveNine = new PentagoMove(5, 2, Quadrant.BL, Quadrant.TL, player);\r\n\t Move moveTen = new PentagoMove(5, 5, Quadrant.TL, Quadrant.TR, player);\r\n\t \r\n\t //First turn as either Black or White\r\n\t if(boardState.getTurnNumber() == 0 || boardState.getTurnNumber() == 1) {\r\n\t if(boardState.isLegal((PentagoMove) firstMoveOne)) {\r\n\t \treturn firstMoveOne;\r\n\t }\r\n\t else if(boardState.isLegal((PentagoMove) firstMoveTwo)) {\r\n\t \treturn firstMoveTwo;\r\n\t }\r\n\t else {\r\n\t \t/* If something goes awry, play the first legal move (will place pieces in TL quadrant usually).\r\n\t \t * Same error condition for the following moves as well.\r\n\t \t **/\r\n\t \tArrayList<PentagoMove> legalMoves = boardState.getAllLegalMoves();\r\n\t \treturn legalMoves.get(0);\r\n\t }\r\n\t }\r\n\t else if(boardState.getTurnNumber() == 2 || boardState.getTurnNumber() == 3) {\r\n\t \t//White player turn 2 & 3 set up\r\n\t \tif(player == 0) {\r\n\t\t \tif(boardState.isLegal((PentagoMove) moveThree) && boardState.getPieceAt(1, 0).toString().equals(\"w\")) {\r\n\t\t \treturn moveThree;\r\n\t\t }\r\n\t\t \tif(boardState.isLegal((PentagoMove) moveFour) && boardState.getPieceAt(1, 3).toString().equals(\"w\")) {\r\n\t\t \t\treturn moveFour;\r\n\t\t \t}\r\n\t\t \tif(boardState.isLegal((PentagoMove) moveFive) && boardState.getPieceAt(4, 0).toString().equals(\"w\")) {\r\n\t\t \treturn moveFive;\r\n\t\t }\r\n\t\t \tif(boardState.isLegal((PentagoMove) moveSix) && boardState.getPieceAt(4, 3).toString().equals(\"w\")) {\r\n\t\t \t\treturn moveSix;\r\n\t\t \t}\r\n\t\t \tif(boardState.getPieceAt(0, 1).toString().equals(\"b\") && boardState.getPieceAt(1, 0).toString().equals(\"w\")\t\r\n\t\t \t\t\t&& boardState.isLegal((PentagoMove) moveSeven)) {\r\n\t\t \treturn moveSeven;\r\n\t\t }\r\n\t\t \tif(boardState.getPieceAt(0, 4).toString().equals(\"b\") && boardState.getPieceAt(1, 3).toString().equals(\"w\")\r\n\t\t \t\t\t&& boardState.isLegal((PentagoMove) moveEight)) {\r\n\t\t \t\treturn moveEight;\r\n\t\t \t}\r\n\t\t \tif(boardState.getPieceAt(3, 1).toString().equals(\"b\") && boardState.getPieceAt(4, 0).toString().equals(\"w\")\r\n\t\t \t\t\t&& boardState.isLegal((PentagoMove) moveNine)) {\r\n\t\t \treturn moveNine;\r\n\t\t }\r\n\t\t \tif(boardState.getPieceAt(3, 4).toString().equals(\"b\") && boardState.getPieceAt(4, 3).toString().equals(\"w\")\r\n\t\t \t\t\t&& boardState.isLegal((PentagoMove) moveTen)) {\r\n\t\t \t\treturn moveTen;\r\n\t\t \t}\r\n\t\t else {\r\n\t\t \tArrayList<PentagoMove> legalMoves = boardState.getAllLegalMoves();\r\n\t\t \treturn legalMoves.get(0);\r\n\t\t }\r\n\t \t} \r\n\t \t//Black player turn 2 & 3 set up\r\n\t \telse {\r\n\t \t\tif(boardState.isLegal((PentagoMove) moveThree) && boardState.getPieceAt(1, 0).toString().equals(\"b\")) {\r\n\t\t \treturn moveThree;\r\n\t\t }\r\n\t \t\tif(boardState.isLegal((PentagoMove) moveFour) && boardState.getPieceAt(1, 3).toString().equals(\"b\")) {\r\n\t\t \treturn moveFour;\r\n\t\t }\r\n\t \t\tif(boardState.isLegal((PentagoMove) moveFive) && boardState.getPieceAt(4, 0).toString().equals(\"b\")) {\r\n\t\t \treturn moveFive;\r\n\t\t }\r\n\t \t\tif(boardState.isLegal((PentagoMove) moveSix) && boardState.getPieceAt(4, 3).toString().equals(\"b\")) {\r\n\t\t \treturn moveSix;\r\n\t\t }\r\n\t \t\tif(boardState.getPieceAt(0, 1).toString().equals(\"w\") && boardState.getPieceAt(1, 0).toString().equals(\"b\")\r\n\t \t\t\t\t&& boardState.isLegal((PentagoMove) moveSeven)) {\r\n\t\t \treturn moveSeven;\r\n\t\t }\r\n\t\t \tif(boardState.getPieceAt(0, 4).toString().equals(\"w\") && boardState.getPieceAt(1, 3).toString().equals(\"b\")\r\n\t\t \t\t\t&& boardState.isLegal((PentagoMove) moveEight)) {\r\n\t\t \t\treturn moveEight;\r\n\t\t \t}\r\n\t\t \tif(boardState.getPieceAt(3, 1).toString().equals(\"w\") && boardState.getPieceAt(4, 0).toString().equals(\"b\")\r\n\t\t \t\t\t&& boardState.isLegal((PentagoMove) moveNine)) {\r\n\t\t \treturn moveNine;\r\n\t\t }\r\n\t\t \tif(boardState.getPieceAt(3, 4).toString().equals(\"w\") && boardState.getPieceAt(4, 3).toString().equals(\"b\")\r\n\t\t \t\t\t&& boardState.isLegal((PentagoMove) moveTen)) {\r\n\t\t \t\treturn moveTen;\r\n\t\t \t}\r\n\t\t else {\r\n\t\t \tArrayList<PentagoMove> legalMoves = boardState.getAllLegalMoves();\r\n\t\t \treturn legalMoves.get(0);\r\n\t\t }\r\n\t \t}\t \r\n\t }\r\n\t else {\r\n\t \t//If we are past Player's Turn 3, start using MiniMax with a-b pruning\r\n\t \tMiniMaxABPruning instc = new MiniMaxABPruning();\r\n\t \treturn instc.abPruningStrategy(boardState, boardState.getTurnPlayer());\r\n\t }\r\n\t}",
"@Test\n public void alienAttacksBeforeMoving() 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 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 List<Player> players = new ArrayList<Player>(party.getMembers()\n .keySet());\n Player player1 = players.get(0);\n player1.setIdentity(alien);\n\n matchController.initMatch(partyController);\n Turn turn = new Turn(player1, matchController.getMatch().getTurnCount());\n matchController.getTurnController().setTurn(turn);\n HexPoint point = HexPoint.fromOffset(1, 1);\n Sector sec = new Sector(null, point);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player1, 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 atk.initAction(matchController, action);\n // verifico gli esiti\n assertFalse(atk.isValid());\n }",
"private void move()\r\n {\r\n int num = Game.random(4);\r\n String direction;\r\n if (num == 0)\r\n direction = \"north\";\r\n else if (num == 1)\r\n direction = \"east\";\r\n else if (num == 2)\r\n direction = \"south\";\r\n else //num == 3\r\n direction = \"west\";\r\n Room nextRoom = room.nextRoom(direction);\r\n if (nextRoom != null)\r\n {\r\n changeRoom(nextRoom);\r\n \r\n //Monster or Robot greets everyone was already in the room\r\n ArrayList<Person> peopleList = new ArrayList<Person>();\r\n \r\n peopleList = nextRoom.getPeople();\r\n peopleList.remove(name);\r\n \r\n String greetings =\"Hey \";\r\n for (int i=0; i<peopleList.size(); i++)\r\n \tgreetings += peopleList.get(i).getName() + \", \";\r\n\r\n if (!(peopleList.size()==0))\r\n \tsay(greetings);\r\n } \r\n \r\n }",
"private void humanTurn() \n {\n \n playTurn();\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 void warBattleHandling()\n\t{\n\t\tplayedCards.add(player1.draw());\n\t\tplayedCards.add(player2.draw());\n\t\t\n\t\tactivePlayerOneCard = player1.draw();\n\t\tactivePlayerTwoCard = player2.draw();\n\t\t\n\t\tplayedCards.add(activePlayerOneCard);\n\t\tplayedCards.add(activePlayerTwoCard);\n\t\t\n\t\tif(activePlayerOneCard.isEqual(activePlayerTwoCard))\n\t\t{\n\t\t\twarBattleHandling();\n\t\t}\n\t\tif(activePlayerOneCard.greaterThan(activePlayerTwoCard))\n\t\t{\n\t\t\tplayer1.winHandling(playedCards);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tplayer2.winHandling(playedCards);\n\t\t}\n\t\t\n\t}",
"@Override\n public void chooseAction(){\n healthDecay = getHealth() - 5;\n //now scan for Nazguls\n\n if(healthDecay == 0){\n death(this);\n }\n int scan_result = scan();\n\n if(scan_result == 1){\n move();\n }\n\n if(scan_result == 0 && healthDecay < 75){\n stay();\n }\n\n if(scan_result == 0 && hobbitCounter == 15){\n replicate();\n hobbitCounter = 0;\n }\n\n else{\n move();\n \n }\n hobbitCounter = hobbitCounter + 1;\n }",
"static void archon() throws GameActionException {\n \tboolean isFirstArchon = true;\n \tMapLocation homeBase = robot.getLocation();\n\t\tSignal[] signals = robot.emptySignalQueue();\n\t\tfor (Signal signal : signals)\n\t\t\tif (signal.getTeam() == robot.getTeam())\n\t\t\t\tif (signal.getMessage()[0] == SUMMON_ARCHONS) {\n\t\t\t\t\tint x = signal.getMessage()[1] >> 16;\n\t\t\t\t\tint y = signal.getMessage()[1] & 0xFFFF;\n\t\t\t\t\tisFirstArchon = false;\n\t\t\t\t\thomeBase = new MapLocation(x, y);\n\t\t\t\t}\n\t\t\n\t\tif (isFirstArchon) {\n\t\t\tint value = (homeBase.x << 16) | homeBase.y;\n\t\t\trobot.broadcastMessageSignal(SUMMON_ARCHONS, value, 1000);\n\t\t\tfor (Direction dir : oddDirection) {\n\t\t\t\twhile (!robot.isCoreReady())\n\t\t\t\t\tClock.yield();\n\t\t\t\twhile (!robot.hasBuildRequirements(RobotType.TURRET))\n\t\t\t\t\tClock.yield();\n\t\t\t\tif (robot.canBuild(dir, RobotType.TURRET)) {\n\t\t\t\t\trobot.build(dir, RobotType.TURRET);\n\t\t\t\t\tClock.yield();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tint attempts = 0;\n\t\t\tMapLocation current = robot.getLocation();\n\t\t\twhile (9 < current.distanceSquaredTo(homeBase) && attempts < 50) {\n\t\t\t\twhile (!robot.isCoreReady())\n\t\t\t\t\tClock.yield();\n\t\t\t\ttryMove(current.directionTo(homeBase));\n\t\t\t\tcurrent = robot.getLocation();\n\t\t\t\tClock.yield();\n\t\t\t\tattempts++;\n\t\t\t}\n\t\t\twhile (((current.x - homeBase.x) + (current.y - homeBase.y)) % 2 != 0) {\n\t\t\t\twhile (!robot.isCoreReady())\n\t\t\t\t\tClock.yield();\n\t\t\t\ttryMove(evenDirection[random.nextInt(4)]);\n\t\t\t\tcurrent = robot.getLocation();\n\t\t\t\tClock.yield();\n\t\t\t}\n\t\t}\n\t\t\n\t\twhile (true) {\n\t\t\tif (robot.isCoreReady()) {\n\t\t\t\tif (random.nextDouble() < 0.33 && robot.hasBuildRequirements(RobotType.TURRET)) {\n\t\t\t\t\tdouble rnd = random.nextDouble();\n\t\t\t\t\tDirection dir = evenDirection[random.nextInt(4)];\n\t\t\t\t\tif (rnd < 0.6) {\n\t\t\t\t\t\tif (robot.canBuild(dir, RobotType.TURRET)) {\n\t\t\t\t\t\t\trobot.build(dir, RobotType.TURRET);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (robot.canBuild(dir, RobotType.SCOUT)) {\n\t\t\t\t\t\t\trobot.build(dir, RobotType.SCOUT);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tClock.yield();\n\t\t\t\t}\n\t\t\t}\n\t\t\tClock.yield();\n\t\t}\n }",
"@Test\n public void isActionLegal()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final List<Agent> agents = createAgents(injector);\n final Agent agentWhite = agents.get(1);\n final CheckersEnvironment environment = createEnvironment(injector, agents);\n final Adjudicator adjudicator = injector.injectAdjudicator();\n\n // Agent white can move his token to an adjacent empty space.\n {\n final CheckersMoveAction action = new CheckersMoveAction(environment, agentWhite, CheckersPosition.P09,\n CheckersPosition.P13);\n assertTrue(adjudicator.isActionLegal(action));\n }\n\n // Agent white cannot move backwards.\n assertFalse(adjudicator.isActionLegal(new CheckersMoveAction(environment, agentWhite, CheckersPosition.P09,\n CheckersPosition.P05)));\n\n // Agent white cannot move to an occupied space.\n assertFalse(adjudicator.isActionLegal(new CheckersMoveAction(environment, agentWhite, CheckersPosition.P04,\n CheckersPosition.P08)));\n\n // Agent white cannot move a red token.\n assertFalse(adjudicator.isActionLegal(new CheckersMoveAction(environment, agentWhite, CheckersPosition.P21,\n CheckersPosition.P17)));\n\n // Agent white cannot move too far.\n assertFalse(adjudicator.isActionLegal(new CheckersMoveAction(environment, agentWhite, CheckersPosition.P09,\n CheckersPosition.P18)));\n }"
] | [
"0.69313467",
"0.6844472",
"0.6578195",
"0.6564898",
"0.6452153",
"0.641328",
"0.635678",
"0.6343398",
"0.6279893",
"0.62661517",
"0.6225503",
"0.62204295",
"0.6197245",
"0.6180998",
"0.6174119",
"0.6168808",
"0.61555886",
"0.6134762",
"0.6105877",
"0.6037386",
"0.6011391",
"0.60047877",
"0.59847766",
"0.5945126",
"0.59449154",
"0.5939169",
"0.59120214",
"0.59079593",
"0.589581",
"0.5894723",
"0.58872545",
"0.5884496",
"0.5883306",
"0.5878729",
"0.5877943",
"0.587721",
"0.58731765",
"0.5866547",
"0.58640987",
"0.58619636",
"0.5848513",
"0.58432627",
"0.5837059",
"0.58339375",
"0.58290154",
"0.582827",
"0.58199024",
"0.5817102",
"0.5812629",
"0.58018976",
"0.5800738",
"0.57867867",
"0.57801807",
"0.57795554",
"0.5779151",
"0.5777258",
"0.5775663",
"0.57733476",
"0.5770051",
"0.5769426",
"0.5768634",
"0.57682616",
"0.5756877",
"0.5756539",
"0.5756303",
"0.57526195",
"0.5752048",
"0.57516414",
"0.57436514",
"0.57412523",
"0.57403713",
"0.57378864",
"0.57357746",
"0.57341504",
"0.57331514",
"0.573205",
"0.57297534",
"0.5722232",
"0.57178247",
"0.57126987",
"0.5685926",
"0.5676718",
"0.5675244",
"0.5664464",
"0.566202",
"0.5658308",
"0.565742",
"0.5656358",
"0.5654471",
"0.56512773",
"0.5645259",
"0.56407905",
"0.5632528",
"0.5631176",
"0.56277984",
"0.56215733",
"0.55998445",
"0.55958253",
"0.5591296",
"0.5586471",
"0.55859923"
] | 0.0 | -1 |
Runs a command on a given repository | public int runCommand(String folder, String[] args) {
System.gc();
GeogitCLI cli = new GeogitCLI(consoleReader) {
@Override
public synchronized ProgressListener getProgressListener() {
if (super.progressListener == null) {
super.progressListener = new DefaultProgressListener() {
@Override
public void setDescription(String s) {
GeogitPy4JEntryPoint.this.listener.setProgressText(s);
}
@Override
public synchronized void progress(float percent) {
GeogitPy4JEntryPoint.this.listener.setProgress(percent);
}
};
}
return super.progressListener;
}
};
cli.tryConfigureLogging();
DefaultPlatform platform = new DefaultPlatform();
platform.setWorkingDir(new File(folder));
cli.setPlatform(platform);
String command = Joiner.on(" ").join(args);
os.clear();
System.out.print("Running command: " + command);
int ret = cli.processCommand(args);
cli.close();
if (ret == 0) {
System.out.println(" [OK]");
} else {
System.out.println(" [Error]");
}
return ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract void execute(GitTool opts) throws Exception;",
"public abstract void doCommand(String command);",
"protected abstract void runCommand(AlluxioURI path, CommandLine cl)\n throws AlluxioException, IOException;",
"public static void commandHelper(String[] args) {\n String command = args[0];\n int numOperands = args.length - 1;\n if (numOperands == 0) {\n switch (command) {\n case \"log\":\n Gitlet.log();\n break;\n case \"global-log\":\n Gitlet.globalLog();\n break;\n case \"status\":\n Gitlet.status();\n break;\n default:\n System.out.print(\"Incorrect operands.\");\n System.exit(0);\n }\n } else if (numOperands == 1) {\n String operand = args[1];\n if (operand == null) {\n System.out.print(\"Incorrect operands.\");\n System.exit(0);\n }\n if (_oneArgCommands.keySet().contains(command)) {\n try {\n _oneArgCommands.get(command).doCommand(operand);\n } catch (GitletException e) {\n System.out.print(e.getMessage());\n }\n } else {\n System.out.print(\"Incorrect operands.\");\n System.exit(0);\n }\n } else if (numOperands == 2) {\n String operand = args[2];\n if (command.equals(\"checkout\") && args[1].equals(\"--\")) {\n try {\n Gitlet.checkoutFile(operand);\n } catch (GitletException e) {\n System.out.print(e.getMessage());\n }\n } else {\n System.out.print(\"Incorrect operands.\");\n System.exit(0);\n }\n } else if (numOperands == 3) {\n String commitID = args[1];\n String fileName = args[3];\n if (args[0].equals(\"checkout\") && args[2].equals(\"--\")) {\n try {\n Gitlet.checkoutFileFromCommit(commitID, fileName);\n } catch (GitletException e) {\n System.out.print(e.getMessage());\n }\n } else {\n System.out.print(\"Incorrect operands.\");\n System.exit(0);\n }\n }\n }",
"public Issue githubIssue(String commander, String command) throws Exception {\n MkStorage storage = new MkStorage.InFile();\n Github commanderGh = new MkGithub(storage, commander);\n RepoCreate repoCreate = new RepoCreate(commander + \".github.io\", false);\n commanderGh.repos().create(repoCreate);\n Coordinates repoCoordinates = new Coordinates.Simple(commander, commander + \".github.io\");\n Issue issue = commanderGh.repos().get(repoCoordinates).issues().create(\"Test issue for commands\", \"test body\");\n issue.comments().post(command);\n Github agentGh = new MkGithub(storage, \"charlesmike\");\n return agentGh.repos().get(repoCoordinates).issues().get(issue.number());\n \n }",
"public void doCommand(String command) {\n Command c;\n try {\n c = Parser.commandLine(command);\n c.execute(tasks, members, storage);\n if (c.isExit()) {\n System.exit(0);\n }\n } catch (DukeException e) {\n Ui.print(e.getMessage());\n }\n }",
"public static void main(String[] args) throws IOException {\n Validate.command(args);\n\n String firstArg = args[0];\n switch(firstArg) {\n /** 1. Calls the repository set up initializing method which creates a .gitlet directory */\n case \"init\":\n Validate.numArgs(args, 1);\n Validate.reInit();\n Repository.init();\n break;\n case \"add\":\n Validate.numArgs(args, 2);\n Validate.initialization();\n String filename = args[1];\n Repository.add(filename);\n break;\n case \"commit\":\n Validate.noCommitMessage(args);\n Validate.initialization();\n String message = args[1];\n Repository.commit(message);\n break;\n case \"rm\":\n Validate.numArgs(args, 2);\n Validate.initialization();\n filename = args[1];\n Repository.rm(filename);\n break;\n case \"log\":\n Validate.numArgs(args, 1);\n Validate.initialization();\n Repository.log();\n break;\n case \"global-log\":\n Validate.numArgs(args, 1);\n Validate.initialization();\n Repository.globalLog();\n break;\n case \"find\":\n Validate.numArgs(args, 2);\n Validate.initialization();\n message = args[1];\n Repository.find(message);\n break;\n case \"status\":\n Validate.numArgs(args, 1);\n Validate.initialization();\n Repository.status();\n break;\n case \"checkout\":\n Validate.numArgs(args, 2,4);\n Validate.initialization();\n Repository.checkout(args);\n break;\n case \"branch\":\n Validate.numArgs(args, 2);\n Validate.initialization();\n String name = args[1];\n Repository.branch(name);\n break;\n case \"rm-branch\":\n Validate.numArgs(args, 2);\n Validate.initialization();\n name = args[1];\n Repository.rmBranch(name);\n break;\n case \"reset\":\n Validate.numArgs(args, 2);\n Validate.initialization();\n name = args[1];\n Repository.reset(name);\n break;\n case \"merge\":\n Validate.numArgs(args, 2);\n Validate.initialization();\n name = args[1];\n Repository.merge(name);\n break;\n default:\n Validate.noExistingCmd();\n }\n }",
"public static void main(String[] args) {\n\t\tSystem.out.println(\" commit\");\n\t\tSystem.out.println(\"3rd commit\");\n\t\tSystem.out.println(\"final commit\");\n\t\tSystem.out.println(\"pull\");\n\t}",
"boolean executeCommand(ICommand _command) throws Exception;",
"private void executeArchetypeCommand() {\n /*\n * Maven embedder:doit\n *\n */\n\n String[] commands = {\"mvn\",\"archetype:create\",\n \"-DarchetypeGroupId=org.appfuse\",\n \"-DarchetypeArtifactId=appfuse-archetype-basic-struts\",\n \"-DarchetypeVersion=1.0-m2\",\n \"-DgroupId=\" + data.getPackageName(),\n \"-DartifactId=\" + data.getApplicationName(),\n \"-DremoteRepositories=http://oss.sonatype.org/content/repositories/appfuse-releases\"};\n\n\n String path = PropertyUtility.getInstance().getSystemProperties().getProperty(\"user.dir\");\n log.info(path);\n \n runCommand(commands, null, new File(\"../\"));\n\n //buffer.append(\"firefox http://localhost/mediawiki\");\n\n }",
"<T extends Command> T execute(T command);",
"public void execute(Command command){\n command.run(field);\n }",
"void fetch(String repository, String refspec) throws GitException, InterruptedException;",
"public State execute(int command, State state);",
"public void execute() throws IOException, ParseException, GitAPIException {\n \t\tfinal int[][] pix = readPixels();\n \t\treadContributions();\n \t\tcomputeTargetContrib(pix);\n \n \t\tif (debug) {\n \t\t\tdebug(asciiImage(true));\n \t\t\tprintContrib();\n \t\t}\n \n \t\tinitGitRepository();\n \n \t\tif (showGUI) showProgressWindow();\n \n \t\tint i = 0;\n \t\tfor (int x = 0; x < CAL_WIDTH; x++) {\n \t\t\tfor (int y = 0; y < CAL_HEIGHT; y++) {\n \t\t\t\tif (contrib[y][x] == null) continue;\n \t\t\t\twhile (contrib[y][x].current < contrib[y][x].target) {\n \t\t\t\t\tcontrib[y][x].current++;\n \t\t\t\t\tif (git != null) doCommit(y, x);\n \t\t\t\t\ti++;\n \t\t\t\t\tif (showGUI) updateProgress(i);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\tprogressFrame.dispose();\n \n \t\tif (debug) System.out.println(\"Complete!\");\n \t}",
"public Builder repository(String repository) {\n command.repository(repository);\n return this;\n }",
"public interface CommandRepository<T> {\n\n void execute(T commandkey) throws ExecutionCommandException;\n\n void execute(T commandkey, CommandParams commandParams) throws ExecutionCommandException;\n\n}",
"public static void main(String[] args) {\nSystem.out.println(\"day one example how to use git\");\r\n\t}",
"void execute(String projectDir, Paths paths) throws CommandExecutionException;",
"public void checkout(String configuration, String repository, String workspace) throws IOException {\n String[] command = {SVN, CHECKOUT, REVISION, configuration, repository, workspace};\n// String[] command = {SVN, CHECKOUT, REVISION, configuration, NON_INTERACTIVE, repository, workspace};\n\n long before = System.currentTimeMillis();\n run(command, null, null, null);\n long after = System.currentTimeMillis();\n\n }",
"CommandResult execute(String commandText) throws Exception;",
"private static void processRepository(File repo) {\n System.out.println(\"Processing repository: \" + repo);\n for (File fileOrDir : repo.listFiles()) {\n if (fileOrDir.isDirectory()) {\n processModule(fileOrDir);\n }\n }\n }",
"@RequestMapping(value = \"/{id}\", method = RequestMethod.GET)\n @Override\n public Command command(@PathVariable String id) {\n try {\n Command cmd = repos.findOne(id);\n if (cmd == null)\n throw new NotFoundException(Command.class.toString(), id);\n return cmd;\n } catch (NotFoundException nfE) {\n throw nfE;\n } catch (Exception e) {\n logger.error(\"Error getting command: \" + e.getMessage());\n throw new ServiceException(e);\n }\n }",
"public ImagePull repository(String repository) {\n getParameters().put(\"repository\", repository);\n return this;\n }",
"void deleteRepository(URL repositoryUrl);",
"@Override\n\tpublic void execute(String[] command) throws SLogoException {\n\t\tString filteredString = filterComments(command);\n\t\tcodeReader = new Scanner(filteredString);\n\t\twhile (codeReader.hasNext()) {\n\t\t\tCommand c = parseCommand(codeReader.next());\n\t\t\tc.run();\n\t\t}\n\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"trying git\"); \r\n\t\tSystem.out.println(\"Getting there\");\r\n\t\t//Faisel\r\n\t}",
"private void pull(FederationModel registration) throws Exception {\n\t\tMap<String, RepositoryModel> repositories = FederationUtils.getRepositories(registration,\n\t\t\t\ttrue);\n\t\tString registrationFolder = registration.folder.toLowerCase().trim();\n\t\t// confirm valid characters in server alias\n\t\tCharacter c = StringUtils.findInvalidCharacter(registrationFolder);\n\t\tif (c != null) {\n\t\t\tlogger.error(MessageFormat\n\t\t\t\t\t.format(\"Illegal character ''{0}'' in folder name ''{1}'' of federation registration {2}!\",\n\t\t\t\t\t\t\tc, registrationFolder, registration.name));\n\t\t\treturn;\n\t\t}\n\t\tFile repositoriesFolder = gitblit.getRepositoriesFolder();\n\t\tFile registrationFolderFile = new File(repositoriesFolder, registrationFolder);\n\t\tregistrationFolderFile.mkdirs();\n\n\t\t// Clone/Pull the repository\n\t\tfor (Map.Entry<String, RepositoryModel> entry : repositories.entrySet()) {\n\t\t\tString cloneUrl = entry.getKey();\n\t\t\tRepositoryModel repository = entry.getValue();\n\t\t\tif (!repository.hasCommits) {\n\t\t\t\tlogger.warn(MessageFormat.format(\n\t\t\t\t\t\t\"Skipping federated repository {0} from {1} @ {2}. Repository is EMPTY.\",\n\t\t\t\t\t\trepository.name, registration.name, registration.url));\n\t\t\t\tregistration.updateStatus(repository, FederationPullStatus.SKIPPED);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Determine local repository name\n\t\t\tString repositoryName;\n\t\t\tif (StringUtils.isEmpty(registrationFolder)) {\n\t\t\t\trepositoryName = repository.name;\n\t\t\t} else {\n\t\t\t\trepositoryName = registrationFolder + \"/\" + repository.name;\n\t\t\t}\n\n\t\t\tif (registration.bare) {\n\t\t\t\t// bare repository, ensure .git suffix\n\t\t\t\tif (!repositoryName.toLowerCase().endsWith(DOT_GIT_EXT)) {\n\t\t\t\t\trepositoryName += DOT_GIT_EXT;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// normal repository, strip .git suffix\n\t\t\t\tif (repositoryName.toLowerCase().endsWith(DOT_GIT_EXT)) {\n\t\t\t\t\trepositoryName = repositoryName.substring(0,\n\t\t\t\t\t\t\trepositoryName.indexOf(DOT_GIT_EXT));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// confirm that the origin of any pre-existing repository matches\n\t\t\t// the clone url\n\t\t\tString fetchHead = null;\n\t\t\tRepository existingRepository = gitblit.getRepository(repositoryName);\n\n\t\t\tif (existingRepository == null && gitblit.isCollectingGarbage(repositoryName)) {\n\t\t\t\tlogger.warn(MessageFormat.format(\"Skipping local repository {0}, busy collecting garbage\", repositoryName));\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (existingRepository != null) {\n\t\t\t\tStoredConfig config = existingRepository.getConfig();\n\t\t\t\tconfig.load();\n\t\t\t\tString origin = config.getString(\"remote\", \"origin\", \"url\");\n\t\t\t\tRevCommit commit = JGitUtils.getCommit(existingRepository,\n\t\t\t\t\t\torg.eclipse.jgit.lib.Constants.FETCH_HEAD);\n\t\t\t\tif (commit != null) {\n\t\t\t\t\tfetchHead = commit.getName();\n\t\t\t\t}\n\t\t\t\texistingRepository.close();\n\t\t\t\tif (!origin.startsWith(registration.url)) {\n\t\t\t\t\tlogger.warn(MessageFormat\n\t\t\t\t\t\t\t.format(\"Skipping federated repository {0} from {1} @ {2}. Origin does not match, consider EXCLUDING.\",\n\t\t\t\t\t\t\t\t\trepository.name, registration.name, registration.url));\n\t\t\t\t\tregistration.updateStatus(repository, FederationPullStatus.SKIPPED);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// clone/pull this repository\n\t\t\tCredentialsProvider credentials = new UsernamePasswordCredentialsProvider(\n\t\t\t\t\tConstants.FEDERATION_USER, registration.token);\n\t\t\tlogger.info(MessageFormat.format(\"Pulling federated repository {0} from {1} @ {2}\",\n\t\t\t\t\trepository.name, registration.name, registration.url));\n\n\t\t\tCloneResult result = JGitUtils.cloneRepository(registrationFolderFile, repository.name,\n\t\t\t\t\tcloneUrl, registration.bare, credentials);\n\t\t\tRepository r = gitblit.getRepository(repositoryName);\n\t\t\tRepositoryModel rm = gitblit.getRepositoryModel(repositoryName);\n\t\t\trepository.isFrozen = registration.mirror;\n\t\t\tif (result.createdRepository) {\n\t\t\t\t// default local settings\n\t\t\t\trepository.federationStrategy = FederationStrategy.EXCLUDE;\n\t\t\t\trepository.isFrozen = registration.mirror;\n\t\t\t\trepository.showRemoteBranches = !registration.mirror;\n\t\t\t\tlogger.info(MessageFormat.format(\" cloning {0}\", repository.name));\n\t\t\t\tregistration.updateStatus(repository, FederationPullStatus.MIRRORED);\n\t\t\t} else {\n\t\t\t\t// fetch and update\n\t\t\t\tboolean fetched = false;\n\t\t\t\tRevCommit commit = JGitUtils.getCommit(r, org.eclipse.jgit.lib.Constants.FETCH_HEAD);\n\t\t\t\tString newFetchHead = commit.getName();\n\t\t\t\tfetched = fetchHead == null || !fetchHead.equals(newFetchHead);\n\n\t\t\t\tif (registration.mirror) {\n\t\t\t\t\t// mirror\n\t\t\t\t\tif (fetched) {\n\t\t\t\t\t\t// update local branches to match the remote tracking branches\n\t\t\t\t\t\tfor (RefModel ref : JGitUtils.getRemoteBranches(r, false, -1)) {\n\t\t\t\t\t\t\tif (ref.displayName.startsWith(\"origin/\")) {\n\t\t\t\t\t\t\t\tString branch = org.eclipse.jgit.lib.Constants.R_HEADS\n\t\t\t\t\t\t\t\t\t\t+ ref.displayName.substring(ref.displayName.indexOf('/') + 1);\n\t\t\t\t\t\t\t\tString hash = ref.getReferencedObjectId().getName();\n\n\t\t\t\t\t\t\t\tJGitUtils.setBranchRef(r, branch, hash);\n\t\t\t\t\t\t\t\tlogger.info(MessageFormat.format(\" resetting {0} of {1} to {2}\", branch,\n\t\t\t\t\t\t\t\t\t\trepository.name, hash));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tString newHead;\n\t\t\t\t\t\tif (StringUtils.isEmpty(repository.HEAD)) {\n\t\t\t\t\t\t\tnewHead = newFetchHead;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnewHead = repository.HEAD;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tJGitUtils.setHEADtoRef(r, newHead);\n\t\t\t\t\t\tlogger.info(MessageFormat.format(\" resetting HEAD of {0} to {1}\",\n\t\t\t\t\t\t\t\trepository.name, newHead));\n\t\t\t\t\t\tregistration.updateStatus(repository, FederationPullStatus.MIRRORED);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// indicate no commits pulled\n\t\t\t\t\t\tregistration.updateStatus(repository, FederationPullStatus.NOCHANGE);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// non-mirror\n\t\t\t\t\tif (fetched) {\n\t\t\t\t\t\t// indicate commits pulled to origin/master\n\t\t\t\t\t\tregistration.updateStatus(repository, FederationPullStatus.PULLED);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// indicate no commits pulled\n\t\t\t\t\t\tregistration.updateStatus(repository, FederationPullStatus.NOCHANGE);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// preserve local settings\n\t\t\t\trepository.isFrozen = rm.isFrozen;\n\t\t\t\trepository.federationStrategy = rm.federationStrategy;\n\n\t\t\t\t// merge federation sets\n\t\t\t\tSet<String> federationSets = new HashSet<String>();\n\t\t\t\tif (rm.federationSets != null) {\n\t\t\t\t\tfederationSets.addAll(rm.federationSets);\n\t\t\t\t}\n\t\t\t\tif (repository.federationSets != null) {\n\t\t\t\t\tfederationSets.addAll(repository.federationSets);\n\t\t\t\t}\n\t\t\t\trepository.federationSets = new ArrayList<String>(federationSets);\n\n\t\t\t\t// merge indexed branches\n\t\t\t\tSet<String> indexedBranches = new HashSet<String>();\n\t\t\t\tif (rm.indexedBranches != null) {\n\t\t\t\t\tindexedBranches.addAll(rm.indexedBranches);\n\t\t\t\t}\n\t\t\t\tif (repository.indexedBranches != null) {\n\t\t\t\t\tindexedBranches.addAll(repository.indexedBranches);\n\t\t\t\t}\n\t\t\t\trepository.indexedBranches = new ArrayList<String>(indexedBranches);\n\n\t\t\t}\n\t\t\t// only repositories that are actually _cloned_ from the origin\n\t\t\t// Gitblit repository are marked as federated. If the origin\n\t\t\t// is from somewhere else, these repositories are not considered\n\t\t\t// \"federated\" repositories.\n\t\t\trepository.isFederated = cloneUrl.startsWith(registration.url);\n\n\t\t\tgitblit.updateConfiguration(r, repository);\n\t\t\tr.close();\n\t\t}\n\n\t\tIUserService userService = null;\n\n\t\ttry {\n\t\t\t// Pull USERS\n\t\t\t// TeamModels are automatically pulled because they are contained\n\t\t\t// within the UserModel. The UserService creates unknown teams\n\t\t\t// and updates existing teams.\n\t\t\tCollection<UserModel> users = FederationUtils.getUsers(registration);\n\t\t\tif (users != null && users.size() > 0) {\n\t\t\t\tFile realmFile = new File(registrationFolderFile, registration.name + \"_users.conf\");\n\t\t\t\trealmFile.delete();\n\t\t\t\tuserService = new ConfigUserService(realmFile);\n\t\t\t\tfor (UserModel user : users) {\n\t\t\t\t\tuserService.updateUserModel(user.username, user);\n\n\t\t\t\t\t// merge the origin permissions and origin accounts into\n\t\t\t\t\t// the user accounts of this Gitblit instance\n\t\t\t\t\tif (registration.mergeAccounts) {\n\t\t\t\t\t\t// reparent all repository permissions if the local\n\t\t\t\t\t\t// repositories are stored within subfolders\n\t\t\t\t\t\tif (!StringUtils.isEmpty(registrationFolder)) {\n\t\t\t\t\t\t\tif (user.permissions != null) {\n\t\t\t\t\t\t\t\t// pulling from >= 1.2 version\n\t\t\t\t\t\t\t\tMap<String, AccessPermission> copy = new HashMap<String, AccessPermission>(user.permissions);\n\t\t\t\t\t\t\t\tuser.permissions.clear();\n\t\t\t\t\t\t\t\tfor (Map.Entry<String, AccessPermission> entry : copy.entrySet()) {\n\t\t\t\t\t\t\t\t\tuser.setRepositoryPermission(registrationFolder + \"/\" + entry.getKey(), entry.getValue());\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\t// pulling from <= 1.1 version\n\t\t\t\t\t\t\t\tList<String> permissions = new ArrayList<String>(user.repositories);\n\t\t\t\t\t\t\t\tuser.repositories.clear();\n\t\t\t\t\t\t\t\tfor (String permission : permissions) {\n\t\t\t\t\t\t\t\t\tuser.addRepositoryPermission(registrationFolder + \"/\" + permission);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// insert new user or update local user\n\t\t\t\t\t\tUserModel localUser = gitblit.getUserModel(user.username);\n\t\t\t\t\t\tif (localUser == null) {\n\t\t\t\t\t\t\t// create new local user\n\t\t\t\t\t\t\tgitblit.addUser(user);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// update repository permissions of local user\n\t\t\t\t\t\t\tif (user.permissions != null) {\n\t\t\t\t\t\t\t\t// pulling from >= 1.2 version\n\t\t\t\t\t\t\t\tMap<String, AccessPermission> copy = new HashMap<String, AccessPermission>(user.permissions);\n\t\t\t\t\t\t\t\tfor (Map.Entry<String, AccessPermission> entry : copy.entrySet()) {\n\t\t\t\t\t\t\t\t\tlocalUser.setRepositoryPermission(entry.getKey(), entry.getValue());\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\t// pulling from <= 1.1 version\n\t\t\t\t\t\t\t\tfor (String repository : user.repositories) {\n\t\t\t\t\t\t\t\t\tlocalUser.addRepositoryPermission(repository);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlocalUser.password = user.password;\n\t\t\t\t\t\t\tlocalUser.canAdmin = user.canAdmin;\n\t\t\t\t\t\t\tgitblit.reviseUser(localUser.username, localUser);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (String teamname : gitblit.getAllTeamNames()) {\n\t\t\t\t\t\t\tTeamModel team = gitblit.getTeamModel(teamname);\n\t\t\t\t\t\t\tif (user.isTeamMember(teamname) && !team.hasUser(user.username)) {\n\t\t\t\t\t\t\t\t// new team member\n\t\t\t\t\t\t\t\tteam.addUser(user.username);\n\t\t\t\t\t\t\t\tgitblit.updateTeamModel(teamname, team);\n\t\t\t\t\t\t\t} else if (!user.isTeamMember(teamname) && team.hasUser(user.username)) {\n\t\t\t\t\t\t\t\t// remove team member\n\t\t\t\t\t\t\t\tteam.removeUser(user.username);\n\t\t\t\t\t\t\t\tgitblit.updateTeamModel(teamname, team);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// update team repositories\n\t\t\t\t\t\t\tTeamModel remoteTeam = user.getTeam(teamname);\n\t\t\t\t\t\t\tif (remoteTeam != null) {\n\t\t\t\t\t\t\t\tif (remoteTeam.permissions != null) {\n\t\t\t\t\t\t\t\t\t// pulling from >= 1.2\n\t\t\t\t\t\t\t\t\tfor (Map.Entry<String, AccessPermission> entry : remoteTeam.permissions.entrySet()){\n\t\t\t\t\t\t\t\t\t\tteam.setRepositoryPermission(entry.getKey(), entry.getValue());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tgitblit.updateTeamModel(teamname, team);\n\t\t\t\t\t\t\t\t} else if (!ArrayUtils.isEmpty(remoteTeam.repositories)) {\n\t\t\t\t\t\t\t\t\t// pulling from <= 1.1\n\t\t\t\t\t\t\t\t\tteam.addRepositoryPermissions(remoteTeam.repositories);\n\t\t\t\t\t\t\t\t\tgitblit.updateTeamModel(teamname, team);\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}\n\t\t} catch (ForbiddenException e) {\n\t\t\t// ignore forbidden exceptions\n\t\t} catch (IOException e) {\n\t\t\tlogger.warn(MessageFormat.format(\n\t\t\t\t\t\"Failed to retrieve USERS from federated gitblit ({0} @ {1})\",\n\t\t\t\t\tregistration.name, registration.url), e);\n\t\t}\n\n\t\ttry {\n\t\t\t// Pull TEAMS\n\t\t\t// We explicitly pull these even though they are embedded in\n\t\t\t// UserModels because it is possible to use teams to specify\n\t\t\t// mailing lists or push scripts without specifying users.\n\t\t\tif (userService != null) {\n\t\t\t\tCollection<TeamModel> teams = FederationUtils.getTeams(registration);\n\t\t\t\tif (teams != null && teams.size() > 0) {\n\t\t\t\t\tfor (TeamModel team : teams) {\n\t\t\t\t\t\tuserService.updateTeamModel(team);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (ForbiddenException e) {\n\t\t\t// ignore forbidden exceptions\n\t\t} catch (IOException e) {\n\t\t\tlogger.warn(MessageFormat.format(\n\t\t\t\t\t\"Failed to retrieve TEAMS from federated gitblit ({0} @ {1})\",\n\t\t\t\t\tregistration.name, registration.url), e);\n\t\t}\n\n\t\ttry {\n\t\t\t// Pull SETTINGS\n\t\t\tMap<String, String> settings = FederationUtils.getSettings(registration);\n\t\t\tif (settings != null && settings.size() > 0) {\n\t\t\t\tProperties properties = new Properties();\n\t\t\t\tproperties.putAll(settings);\n\t\t\t\tFileOutputStream os = new FileOutputStream(new File(registrationFolderFile,\n\t\t\t\t\t\tregistration.name + \"_\" + Constants.PROPERTIES_FILE));\n\t\t\t\tproperties.store(os, null);\n\t\t\t\tos.close();\n\t\t\t}\n\t\t} catch (ForbiddenException e) {\n\t\t\t// ignore forbidden exceptions\n\t\t} catch (IOException e) {\n\t\t\tlogger.warn(MessageFormat.format(\n\t\t\t\t\t\"Failed to retrieve SETTINGS from federated gitblit ({0} @ {1})\",\n\t\t\t\t\tregistration.name, registration.url), e);\n\t\t}\n\n\t\ttry {\n\t\t\t// Pull SCRIPTS\n\t\t\tMap<String, String> scripts = FederationUtils.getScripts(registration);\n\t\t\tif (scripts != null && scripts.size() > 0) {\n\t\t\t\tfor (Map.Entry<String, String> script : scripts.entrySet()) {\n\t\t\t\t\tString scriptName = script.getKey();\n\t\t\t\t\tif (scriptName.endsWith(\".groovy\")) {\n\t\t\t\t\t\tscriptName = scriptName.substring(0, scriptName.indexOf(\".groovy\"));\n\t\t\t\t\t}\n\t\t\t\t\tFile file = new File(registrationFolderFile, registration.name + \"_\"\n\t\t\t\t\t\t\t+ scriptName + \".groovy\");\n\t\t\t\t\tFileUtils.writeContent(file, script.getValue());\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (ForbiddenException e) {\n\t\t\t// ignore forbidden exceptions\n\t\t} catch (IOException e) {\n\t\t\tlogger.warn(MessageFormat.format(\n\t\t\t\t\t\"Failed to retrieve SCRIPTS from federated gitblit ({0} @ {1})\",\n\t\t\t\t\tregistration.name, registration.url), e);\n\t\t}\n\t}",
"Optional<String> execute(String command, List<String> args);",
"static public void doCommand(Object plugin, String command, Context con, Modules mods, IRCInterface irc)\n {\n System.out.println(\"Calling method command\" + command);\n callFunc(plugin, \"command\" + command,con,mods,irc);\n }",
"public void execute(Command command) {\n\t\texecute(command.getLabel(), command);\n\t}",
"protected UpdateScmResult executeUpdateCommand( ScmProviderRepository repo, ScmFileSet files, String tag )\n throws ScmException\n {\n PerforceCheckOutCommand command = new PerforceCheckOutCommand();\n command.setLogger( getLogger() );\n CommandParameters params = new CommandParameters();\n params.setString( CommandParameter.TAG, tag );\n \n CheckOutScmResult cosr = (CheckOutScmResult) command.execute( repo, files, params );\n \n UpdateScmResult usr = new UpdateScmResult( cosr.getCommandLine(), cosr.getProviderMessage(), cosr\n .getCommandOutput(), cosr.isSuccess() );\n usr.setChanges( cosr.getCheckedOutFiles() );\n return usr;\n }",
"void execute() throws CommandExecutionException;",
"void fetch() throws GitException, InterruptedException;",
"@Override\n\t\t\tpublic void run(@Nonnull ProgressIndicator indicator)\n\t\t\t{\n\t\t\t\tLOG.info(\"Creating GitHub repository\");\n\t\t\t\tindicator.setText(\"Creating GitHub repository...\");\n\t\t\t\tfinal String url = createGithubRepository(project, githubInfo.getAuthData(), name, description,\n\t\t\t\t\t\tisPrivate);\n\t\t\t\tif(url == null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tLOG.info(\"Successfully created GitHub repository\");\n\n\t\t\t\t// creating empty git repo if git is not initialized\n\t\t\t\tLOG.info(\"Binding local project with GitHub\");\n\t\t\t\tif(!gitDetected)\n\t\t\t\t{\n\t\t\t\t\tLOG.info(\"No git detected, creating empty git repo\");\n\t\t\t\t\tindicator.setText(\"Creating empty git repo...\");\n\t\t\t\t\tif(!createEmptyGitRepository(project, root, indicator))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tGitRepositoryManager repositoryManager = GitUtil.getRepositoryManager(project);\n\t\t\t\tfinal GitRepository repository = repositoryManager.getRepositoryForRoot(root);\n\t\t\t\tLOG.assertTrue(repository != null, \"GitRepository is null for root \" + root);\n\n\t\t\t\tfinal String remoteUrl = GithubUrlUtil.getGitHost() + \"/\" + githubInfo.getUser().getLogin() + \"/\" +\n\t\t\t\t\t\tname + \".git\";\n\t\t\t\tfinal String remoteName = finalExternalRemoteDetected ? \"github\" : \"origin\";\n\n\t\t\t\t//git remote add origin git@github.com:login/name.git\n\t\t\t\tLOG.info(\"Adding GitHub as a remote host\");\n\t\t\t\tindicator.setText(\"Adding GitHub as a remote host...\");\n\t\t\t\tif(!addGithubRemote(project, root, remoteName, remoteUrl, repository))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// create sample commit for binding project\n\t\t\t\tif(!performFirstCommitIfRequired(project, root, repository, indicator, name, url))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//git push origin master\n\t\t\t\tLOG.info(\"Pushing to github master\");\n\t\t\t\tindicator.setText(\"Pushing to github master...\");\n\t\t\t\tif(!pushCurrentBranch(project, repository, remoteName, remoteUrl, name, url))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tGithubNotifications.showInfoURL(project, \"Successfully shared project on GitHub\", name, url);\n\t\t\t}",
"void setRepository(Repository repository);",
"public static void repoClone() throws IOException, InvalidRemoteException, TransportException, GitAPIException {\n\t\tFile localPath = new File(\"testRuby\");\n\t\tboolean directoryExist = localPath.exists();\n\t\tlocalPath.delete();\n\t\t// then clone\n\t\tSystem.out.println(\"Cloning from \" + REMOTE_URL + \" to \" + localPath);\n\t\tFileRepositoryBuilder builder = new FileRepositoryBuilder();\n\t\tRepository repository = builder.setWorkTree(localPath).readEnvironment().build();\n\t\tGit git = new Git(repository);\n\t\tif (!directoryExist) {\n\t\t\ttry (Git result = git.cloneRepository().setURI(REMOTE_URL).setDirectory(localPath).call()) {\n\t\t\t\t// Note: the call() returns an opened repository already which\n\t\t\t\t// needs to be closed to avoid file handle leaks!\n\t\t\t\tSystem.out.println(\"Having repository: \" + result.getRepository().getDirectory());\n\t\t\t}\n\t\t} else {\n\t\t\tPullResult pullresult=git.pull().call();\n\t\t\t// Note: the call() returns an opened repository already which needs\n\t\t\t// to be closed to avoid file handle leaks!\n\t\t\tSystem.out.println(\"pulled repository: \" + pullresult.isSuccessful());\n\n\t\t}\n\t}",
"public void setRepository(String repository) {\n this.repository = repository;\n }",
"public void setRepository(String repository) {\n this.repository = repository;\n }",
"public void execute(String label, Command command) {\n\t\texecuteViaUndoManager(label, command);\n\t}",
"public void execute(Command command, T component);",
"void process(Document document, Repository repository) throws Exception;",
"public interface IRepo {\r\n\t//current state of the repository\r\n\tPrgState getCurrentState() throws RepoException;\r\n\t\r\n\t//writes log of execution to log file\r\n\tvoid logPrgStateExec() throws FileNotFoundException, IOException;\r\n}",
"@Override\r\n public void execute(Command command) {\n\r\n }",
"CommandResult execute(String commandText) throws CommandException, ParseException;",
"CommandResult execute(String commandText) throws CommandException, ParseException;",
"CommandResult execute(String commandText) throws CommandException, ParseException;",
"@Test(expected = RepositoryNotFoundException.class)\n public void testNonExistingRepository() throws AuthorCommitsFailedException,\n IOException{\n EasyMock.expect(mockManager.openRepository(new Project.NameKey(\"abcdefg\")))\n .andReturn(\n RepositoryCache.open(FileKey.lenient(new File(\n \"../../review_site/git\", \"abcdefg.git\"), FS.DETECTED)));\n EasyMock.expect(mockUser.getCapabilities()).andReturn(mockCapability);\n EasyMock.expect(mockCapability.canListAuthorCommits()).andReturn(true);\n replay(mockUser, mockCapability, mockManager);\n cmd_test.setCommits(new Project.NameKey(\"abcdefg\"), \"kee\");\n }",
"public interface Command {\n /**\n * Executes command, which reads from inputStream, with given arguments.\n *\n * @param args list of arguments for the command.\n * @param inputStream InputStream where Command reads from.\n * @param environment Shell environment with all current variables.\n *\n * @return result of command execution as InputStream.\n */\n InputStream execute(List<String> args, InputStream inputStream, Environment environment)\n throws SyntaxErrorException, IOException;\n}",
"public abstract boolean doCommand() throws Exception;",
"public void execute(final Command command) {\n\n command.execute();\n }",
"CommandResult execute(String commandText) throws CommandException, ParseException, UnmappedPanelException;",
"void push(RemoteConfig repository, String revspec) throws GitException, InterruptedException;",
"abstract protected void execute(String dir);",
"public static void main(String[] args) {\nSystem.out.println(\"This is for git\");\n\t}",
"private void createRepository(URL repository) throws IOException, ProcessingException {\n if(repository.getPath().equals(\"/\"))\n throw new ProcessingException(\"Illegal repository name\");\n try {\n exec(buildSvnWithUsername(\"proplist \"+repository),new File(\".\"),\"N/A\");\n } catch (ProcessingException e) {\n // directory doesn't exist\n URL parent;\n if(repository.getPath().endsWith(\"/\"))\n parent = new URL(repository, \"..\");\n else\n parent = new URL(repository, \".\");\n createRepository(parent);\n\n listener.info(repository+\" doesn't exist. creating\");\n exec(buildSvnWithUsername(\"mkdir -m \\\"\"+commitMessage+\"\\\" \"+repository),new File(\".\"),\"Failed to create directory\");\n }\n }",
"static Repository getRepositoryFromArguments(String[] args)\n {\n File dataDir = new File(args[args.length - 2]);\n \n Repository rep = new SailRepository(new NativeStore(dataDir));\n \n try\n {\n rep.initialize();\n }\n catch (RepositoryException e)\n {\n System.err.println(\"Repository could not be initialized!\");\n System.exit(1);\n }\n \n return rep;\n }",
"TArea checkout(TCommit commit, TRepo repo, AreaFactory<TContent, TArea> areaFactory, ContentFactory<TContent> contentFactory);",
"public interface Command {\n\t\n\tint execute(int number);\n}",
"String repoUrl();",
"public void push(TaskMonitor aTM) throws Exception\n{\n // Get repository and git\n Git git = getGit();\n \n // Get push\n PushCommand push = git.push();\n push.setProgressMonitor(getProgressMonitor(aTM));\n if(getCD()!=null) push.setCredentialsProvider(getCD());\n for(PushResult pr : push.call())\n System.out.println(\"Pushed: \" + pr);\n}",
"public static void main(String[] args) {\n\t\t\tSystem.out.println(\"git_test!\");\n\t}",
"private void runCommand(String command) {\r\n\r\n String commandString = command;\r\n if (!command.startsWith(\"cov-\")) {\r\n throw new BuildException(\r\n \"Coverity task can run only coverity prevent tool commands.\");\r\n }\r\n\r\n ExecTask task = new ExecTask();\r\n task.setProject(getProject());\r\n task.setTaskName(this.getTaskName());\r\n task.setFailonerror(failOnError);\r\n task.setError(this.error);\r\n if (this.output != null) {\r\n task.setOutput(this.output);\r\n }\r\n task.setAppend(isAppend());\r\n task.setExecutable(command);\r\n task.setDir(new File(this.dir));\r\n\r\n for (VariableSet coverityArg : coverityOptions) {\r\n \r\n for (MappedVariable variable : coverityArg.getVariables()) {\r\n if (variable.getName().equals(\"--password\") || variable.getName().equals(\"-pa\")) {\r\n commandString += \" \" + variable.getName() + \" ********\";\r\n } else {\r\n commandString += \" \" + variable.getName() + \" \" + variable.getValue();\r\n }\r\n }\r\n task.createArg().setLine(coverityArg.getParameter(\" \"));\r\n \r\n }\r\n for (VariableImpl coverityArg : coverityArgs) {\r\n if (coverityArg.getName().equals(\"--password\") || coverityArg.getName().equals(\"-pa\")) {\r\n commandString += \" \" + coverityArg.getName() + \" ********\";\r\n } else {\r\n commandString += \" \" + coverityArg.getName() + \" \" + coverityArg.getValue();\r\n }\r\n task.createArg().setLine(coverityArg.getParameter(\" \"));\r\n }\r\n\r\n try {\r\n log(\"run command: \" + commandString);\r\n if (execute) {\r\n task.execute();\r\n }\r\n } catch (BuildException be) {\r\n if (failOnError) {\r\n throw new BuildException(\"exception during coverity command '\"\r\n + command + \"' execution:\", be);\r\n }\r\n }\r\n\r\n }",
"protected int run(Commandline cmd) {\n try {\n Project aProj = getProject();\n Execute exe = new Execute(\n new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN));\n exe.setAntRun(aProj);\n exe.setWorkingDirectory(aProj.getBaseDir());\n exe.setCommandline(cmd.getCommandline());\n return exe.execute();\n } catch (IOException e) {\n throw new BuildException(e, getLocation());\n }\n }",
"Git getGit();",
"public void testGitHub() {\n\t}",
"public void gitThis(){\n\t}",
"public Repository repository(String owner, String repo, EditRepoOption repository) {\n return apiClient.deserialize(apiClient.patch(String.format(\"/repos/%s/%s\", owner, repo), repository), Repository.class);\n }",
"protected String execCommand(String command) {\n\t\treturn executor.execCommand(command);\n\t}",
"public static void processCommand(String command) {\n instance.doCommand(command);\n }",
"public interface CommandService {\n\n /**\n * Executes given command remotely and synchronously and returns the similar object as executed, but changed on the remote\n * side.\n */\n <T extends Command> T execute(T command);\n}",
"CommandResult execute();",
"private void deleteRepository() {\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tint opt = JOptionPane.showConfirmDialog(this, \"Delete entire Repository (all change sets) at \"+ repURLFld.getText()+\" ?\", \"Delete All\", JOptionPane.YES_NO_OPTION);\r\n\t\t\tif (opt == JOptionPane.NO_OPTION) return;\r\n\t\t\t\r\n\t\t\t// delete repository header\r\n\t\t\tif (repHeaderLoc!=null) {\r\n\t\t\t\tclient.delete(this.repHeaderLoc);\r\n\t\t\t\tSystem.out.println(\"Deleted Repository Header at \" + repHeaderLoc);\r\n\t\t\t}\r\n\t\t\telse System.out.println(\"URL location of Repository Header not known\");\r\n\t\t\t\r\n\t\t\t// delete all commits at Version Controlled Repository\r\n\t\t\tfor (int ctr=1; ctr<=this.headVersionNumber; ctr++) {\r\n\t\t\t\tURL loc = null;\r\n\t\t\t\tif (versionNodes[ctr]!=null) {\r\n\t\t\t\t\tloc = versionNodes[ctr].location;\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tURI versionURI = new URI(this.repositoryURI.toString()+\"#\"+String.valueOf(ctr));\r\n\t\t\t\t\tSet versionSet = client.findAnnotations(versionURI);\r\n\t\t\t\t\tloc = ((Description) versionSet.iterator().next()).getLocation();\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tclient.delete(loc);\r\n\t\t\t\tSystem.out.println(\"Deleted Version at \"+loc);\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\tcatch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t}",
"@Test\n\tpublic void execute() {\n\t\tcommand.execute(request);\n\t}",
"public static void showStatus() {\n\t\tSystem.out.println(\"Copy and paste a repo from above you would like to expand the status of:\");\n\n\t\ttry {\n\t\t BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));\n\t\t String s = bufferRead.readLine();\n\n\t\t ProcessBuilder p1 = new ProcessBuilder(\"/usr/bin/git\",\"status\");\n\t\t\t\n\t\t\t// then change working directory to s with p.directory command\n\t\t\tp1.directory(new File(s));\n\n\t\t\tProcess process = p1.start();\n\t\t\tint errCode = process.waitFor();\n\t\t\t// find out if there was an error\n\t\t\t//System.out.println(\"Any errors? \" + (errCode == 0 ? \"No\" : \"Yes\"));\n\n\t\t\t// stringbuilder to take in the output from git status\n\t\t\tStringBuilder sb2 = new StringBuilder();\n\n\t\t\t// bufferreader to take in the output from git status\n\t\t\tBufferedReader reader = \n\t\t\t\tnew BufferedReader(new InputStreamReader(process.getInputStream()));\n\n\t\t\t// while loop to build string of output\n\t\t\tString line = \"\";\t\t\t\n\t\t\t\twhile ((line = reader.readLine())!= null) {\t\t \n\t\t\t\t\tsb2.append(line + \"\\n\");\n\t\t\t\t}\n\n\t\t\tString status = sb2.toString();\n\t\t\t// print out the status\n\t\t\tSystem.out.println(\"\\n**************************************************************\\n\");\n\t\t\tSystem.out.println(status);\n\n\t\t\t// recursion to restart process\n\t\t\texpand(true);\n\n\t\t} // try\n\t\t\n\t\tcatch(IOException e) {\n\t\t\t//e.printStackTrace();\n\t\t\tSystem.out.println(\"\\n**************************************************************\\n\");\n\t\t\tSystem.out.println(\"Invalid working directory path! \\nPlease try again\\nIf you are wondering why you should expand a repository, its because its so much fun! :D\\n\");\n\t\t\texpand(true);\n\n\t\t} // catch\n\t\tcatch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t} // catch\n\n\t}",
"public final CompletableFuture<GetRepositoryResponse> getRepository(\n\t\t\tFunction<GetRepositoryRequest.Builder, ObjectBuilder<GetRepositoryRequest>> fn) throws IOException {\n\t\treturn getRepository(fn.apply(new GetRepositoryRequest.Builder()).build());\n\t}",
"ArtifactRepository getRepository();",
"public interface ShellCommand {\n\n\t/**\n\t * Executes the command.\n\t * \n\t * @param env\n\t * environment in which the shell is executed\n\t * @param arguments\n\t * arguments of the command entered\n\t * @throws IOException\n\t * thrown in case of I/O error\n\t * @return shell status after executing command\n\t */\n\tShellStatus executeCommand(Environment env, String arguments) throws IOException;\n\n\t/**\n\t * Returns command name.\n\t * \n\t * @return command name\n\t */\n\tString getCommandName();\n\n\t/**\n\t * Returns command description.\n\t * \n\t * @return command description\n\t */\n\tList<String> getCommandDescription();\n\n}",
"WrappedAnswer execute(WrappedCommand aWrappedCommand);",
"protected int execute(String command) {\n\t\treturn 0; //TODO let shell execute this\n\t}",
"public void openRepository( String repositoryName ) throws MetaStoreException {\n gitSpoonMenuController.openRepo( repositoryName );\n }",
"public static void main(String[] ignored) {\n try {\n ArtifactoryClientConfiguration clientConfiguration = createArtifactoryClientConfiguration();\n ArtifactoryManagerBuilder artifactoryManagerBuilder = new ArtifactoryManagerBuilder().setClientConfiguration(clientConfiguration, clientConfiguration.resolver);\n ArtifactoryClientConfiguration.PackageManagerHandler packageManagerHandler = clientConfiguration.packageManagerHandler;\n ArtifactoryClientConfiguration.GoHandler goHandler = clientConfiguration.goHandler;\n GoRun goRun = new GoRun(\n packageManagerHandler.getArgs(),\n Paths.get(packageManagerHandler.getPath() != null ? packageManagerHandler.getPath() : \".\"),\n packageManagerHandler.getModule(),\n artifactoryManagerBuilder,\n clientConfiguration.resolver.getRepoKey(),\n clientConfiguration.resolver.getUsername(),\n clientConfiguration.resolver.getPassword(),\n clientConfiguration.getLog(),\n clientConfiguration.getAllProperties()\n );\n goRun.executeAndSaveBuildInfo(clientConfiguration);\n } catch (RuntimeException e) {\n ExceptionUtils.printRootCauseStackTrace(e, System.out);\n System.exit(1);\n }\n }",
"private interface Command {\n public void execute();\n }",
"public void command(byte[] cmdMessage) throws SAPIException{\r\n\t\t\t\t//sends command to RBNB\r\n\t\t\t\t\r\n\t\t\t\tsrcMap.PutDataAsByteArray(srcMap.GetIndex(getParameterToStringById(\"sourceChannelCommandName\")), cmdMessage); //cmds channel\t \t\r\n\t \tsrc.Flush(srcMap); \t\r\n\t\t}",
"void execute(Executable executable);",
"public static void main(String... args) {\n\n if (args.length == 0){\n System.out.println(\"Please enter a command\");\n return;\n }\n\n // load commit-tree if .gitlet initialized\n Main program = new Main();\n program.setTree_(program.loadTree());\n\n if (program.getTree_() == null && !args[0].equals(\"init\")){\n System.out.println(\"Not in an initialized gitlet directory.\");\n return;\n }\n\n String command = args[0];\n switch (command){\n\n case \"init\":\n\n checkNumArgs(1, args);\n boolean created = program.createGitletDirectory();\n if (created){\n program.setTree_(CommitTree.initCommitTree());\n }\n break;\n\n case \"add\":\n\n checkNumArgs(2, args);\n program.getTree_().add(args[1]);\n break;\n\n case \"commit\":\n\n checkNumArgs(2, args);\n program.getTree_().commit(args[1]);\n break;\n\n case \"rm\":\n\n checkNumArgs(2, args);\n program.getTree_().removeFile(args[1]);\n break;\n\n case \"log\":\n\n checkNumArgs(1, args);\n program.getTree_().log();\n break;\n\n case \"global-log\":\n\n checkNumArgs(1, args);\n program.getTree_().globalLog();\n break;\n\n case \"find\":\n\n checkNumArgs(2, args);\n program.getTree_().find(args[1]);\n break;\n\n case \"status\":\n\n checkNumArgs(1, args);\n program.getTree_().status();\n break;\n\n case \"checkout\":\n\n // check arguments and invoke specific checkout command\n program.checkoutArgs(args);\n break;\n\n case \"branch\":\n\n checkNumArgs(2, args);\n program.getTree_().branch(args[1]);\n break;\n\n case \"rm-branch\":\n\n checkNumArgs(2, args);\n program.getTree_().removeBranch(args[1]);\n break;\n\n case \"reset\":\n\n checkNumArgs(2, args);\n program.getTree_().reset(args[1]);\n break;\n\n case \"merge\":\n\n checkNumArgs(2, args);\n program.getTree_().merge(args[1]);\n break;\n\n default:\n\n System.out.println(\"No command with that name exists.\");\n break;\n }\n\n // save commit-tree to disk\n program.SaveTree();\n }",
"public void getGitUrlWithAutoInit(@Nonnull final ProjectDescriptor project, final AsyncCallback<String> callback) {\n if (!GitRepositoryInitializer.isGitRepository(project)) {\n initGitRepository(project, new AsyncCallback<Void>() {\n @Override\n public void onSuccess(Void result) {\n Notification notification = new Notification(gitLocale.initSuccess(), Notification.Type.INFO);\n notificationManager.showNotification(notification);\n getGitUrlWithAutoInit(appContext.getCurrentProject().getRootProject(), callback);\n }\n\n @Override\n public void onFailure(Throwable throwable) {\n callback.onFailure(throwable);\n }\n });\n\n return;\n }\n\n gitService.getGitReadOnlyUrl(project,\n new AsyncRequestCallback<String>(new StringUnmarshaller()) {\n @Override\n protected void onSuccess(String result) {\n callback.onSuccess(result);\n }\n\n @Override\n protected void onFailure(Throwable exception) {\n callback.onFailure(exception);\n }\n });\n }",
"private void runGitJob(GitRunBean run) throws InterruptedException, IOException {\n\t\tPath localRepoPath = Files.createTempDirectory(\"local-repo\");\n\t\t\n\t\ttry {\n\t\t\tremoteGitRepository.copyToLocal(run, localRepoPath);\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tlog.info(\"Git clone fails: {}\", e.getMessage());\n\t\t\trun.setStatus(RunStatus.FAIL);\n\t\t\trun.setErrorMessage(\"Git clone fails: \\n\"+e.getMessage());\n\t\t\treturn;\n\t\t\t/*\n\t\t\t * TODO:\n\t\t\t * Should we define error code, error short name, and\n\t\t\t * then pass in error message?\n\t\t\t */\n\t\t}\n\t\t\n\t\tRunConfigBean runConfig;\n\t\ttry {\n\t\t\trunConfig = remoteGitRepository.getConfigFromFilepath(run, localRepoPath);\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tlog.info(\"Git job error getting config file: {}\", e.getMessage());\n\t\t\trun.setStatus(RunStatus.FAIL);\n\t\t\trun.setErrorMessage(\"Error getting config file: \\n\"+e.getMessage());\n\t\t\treturn;\n\t\t}\n\t\tcatch (YAMLException e) {\n\t\t\tlog.info(\"Git job config YAML parsing error: {}\", e.getMessage());\n\t\t\trun.setStatus(RunStatus.FAIL);\n\t\t\trun.setErrorMessage(\"Config YAML parsing error: \\n\"+e.getMessage());\n\t\t\treturn;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tlog.info(\"Save configuration file\");\n\t\t\tPath configFilepath = remoteGitRepository.getConfigFilepath(run, localRepoPath);\n\t\t\tString runConfigurationObjectReferral = minioRepository.putRunConfigurationAndReturnObjectName(\n\t\t\t\t\tnew FileInputStream(configFilepath.toFile()), run.getDefaultRunConfigurationObjectReferral());\n\t\t\trun.setRunConfigurationObjectReferral(runConfigurationObjectReferral);\n\t\t} \n\t\tcatch (MinioException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t/*\n\t\t * For Docker desktop on Mac, need to edit `Library/Group\\ Containers/group.com.docker/settings.json`\n\t\t * to add `/var/folders`. Otherwise unit test (execute on Mac / not inside of container) error:\n\t\t * > com.github.dockerjava.api.exception.InternalServerErrorException: Mounts denied: \n\t\t * > The path /var/folders/kp/fz7j3bln4m11rc197xrj4dvc0000gq/T/junit5099823135583804007/results\n\t\t * > is not shared from OS X and is not known to Docker.\n\t\t * > You can configure shared paths from Docker -> Preferences... -> File Sharing.\n\t\t * > See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.\n\t\t * \n\t\t * Notice that both `@TempDir` and `Files.createTempDirectory` \n\t\t * are using `/var/folders` (Mac) or `/tmp` (linux) to save the file.\n\t\t */\n\t\tMap<RunConfigBean.RunConfigResultBean, File> mounts = new HashMap<RunConfigBean.RunConfigResultBean, File>();\n\t\tfor (RunConfigBean.RunConfigResultBean result : runConfig.getResults()) {\n\t\t\t\n\t\t\t/*\n\t\t\t * Note:\n\t\t\t * \n\t\t\t * In actual run inside of the container, this temporary folder created\n\t\t\t * by `Files.createTempDirectory` is created inside of the docker container.\n\t\t\t * As docker container uses Alpine, it is under `/tmp`.\n\t\t\t * \n\t\t\t * However, as for container docker we pass in socket `-v /var/run/docker.sock:/var/run/docker.sock`\n\t\t\t * when we use volume mount to pass the result out inside of `DockerExec`,\n\t\t\t * the result will be sent to `/tmp` in hosting machine where \n\t\t\t * the docker application is running.\n\t\t\t * \n\t\t\t * Therefore, to actually see the result/docker volume change in the\n\t\t\t * Java application inside of the container, we'll need to not only\n\t\t\t * `-v /var/run/docker.sock:/var/run/docker.sock` but also `-v /tmp:/tmp`.\n\t\t\t * Otherwise we'll see empty content under this folder:\n\t\t\t * > slave-agent_1 | 2020-04-19 04:05:47.812 INFO 1 --- [in-0.runqueue-1] r.slave.service.DockerRunServiceImpl : Zip run result: /result\n\t\t\t * > slave-agent_1 | Content: [] temperarily saved at /tmp/result-4099381032373732624\n\t\t\t * and zip error:\n\t\t\t * > nested exception is org.zeroturnaround.zip.ZipException: Given directory \n\t\t\t * > '/tmp/result-966542229242736184' doesn't contain any files!\n\t\t\t * \n\t\t\t * When this error raises, Spring will reload the message and retry\n\t\t\t * multiple (~3) times before showing the error.\n\t\t\t * \n\t\t\t * TODO:\n\t\t\t * Consider using a directory other than the default of `Files.createTempDirectory`,\n\t\t\t * so we don't need to volume mount `/tmp` which is used by a lot of other\n\t\t\t * applications both in host machine and inside of the container.\n\t\t\t */\n\t\t\tmounts.put(result, Files.createTempDirectory(\"result-\").toFile());\n\t\t}\n\t\t\n\t\t/*\n\t\t * TODO:\n\t\t * If sidecars can support build from Dockerfile, we'll need to build sidecars as well.\n\t\t */\n\t\t\n\t\tList<String> sidecarIds = new ArrayList<String>();\t\n\t\ttry {\n\t\t\tfor (RunConfigBean.RunConfigSidecarBean sidecar : runConfig.getSidecars()) {\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tdockerExec.pullImage(sidecar.getImage());\n\t\t\t\t}\n\t\t\t\tcatch (NotFoundException e) {\n\t\t\t\t\tlog.info(\"Git job pulling sidecar image error: {}\", e.getMessage());\n\t\t\t\t\trun.setStatus(RunStatus.FAIL);\n\t\t\t\t\trun.setErrorMessage(\"Pulling sidecar image error: \\n\"+e.getMessage());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsidecarIds.add(\n\t\t\t\t\t\tdockerExec.createSidecar(\n\t\t\t\t\t\t\t\tsidecar.getImage(), \n\t\t\t\t\t\t\t\tsidecar.getName(), \n\t\t\t\t\t\t\t\tnetworkName,\n\t\t\t\t\t\t\t\tsidecar.getCommand(),\n\t\t\t\t\t\t\t\tsidecar.getEnvironment()));\n\t\t\t}\n\t\t\t\n\t\t\tString imageId;\n\t\t\tif (runConfig.getExecutor().getImage() != null) {\n\t\t\t\timageId = runConfig.getExecutor().getImage();\n\t\t\t\ttry {\n\t\t\t\t\tdockerExec.pullImage(imageId);\n\t\t\t\t}\n\t\t\t\tcatch (NotFoundException e) {\n\t\t\t\t\tlog.info(\"Git job pulling main image error: {}\", e.getMessage());\n\t\t\t\t\trun.setStatus(RunStatus.FAIL);\n\t\t\t\t\trun.setErrorMessage(\"Pulling main image error: \\n\"+e.getMessage());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttry {\n\t\t\t\t\timageId = dockerExec.buildImageAndGetId(localRepoPath, runConfig);\n\t\t\t\t}\n\t\t\t\tcatch (BadRequestException | IllegalArgumentException e) {\n\t\t\t\t\tlog.info(\"Git job docker build error: {}\", e.getMessage());\n\t\t\t\t\trun.setStatus(RunStatus.FAIL);\n\t\t\t\t\trun.setErrorMessage(\"Docker build error: \\n\"+e.getMessage());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\tRunCommandDTO runDTO = dockerExec.runCommand(\n\t\t\t\t\t\timageId, \n\t\t\t\t\t\tmainContainerName,\n\t\t\t\t\t\tnetworkName,\n\t\t\t\t\t\trunConfig.getCommand(), \n\t\t\t\t\t\tgetEnvVars(runConfig, run),\n\t\t\t\t\t\tmounts,\n\t\t\t\t\t\trun.getDefaultRunOutputObjectReferral());\n\t\t\t\t\n\t\t\t\trunDTO.updateRunBean(run);\n\t\t\t}\n\t\t\tcatch (BadRequestException e) {\n\t\t\t\tlog.info(\"Git job invalid command: {}\", e.getMessage());\n\t\t\t\trun.setStatus(RunStatus.FAIL);\n\t\t\t\trun.setErrorMessage(\"Invalid command: \\n\"+e.getMessage());\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\tfor (String sidecarId : sidecarIds) {\n\t\t\t\tdockerExec.killSidecar(sidecarId);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (Map.Entry<RunConfigBean.RunConfigResultBean, File> entry : mounts.entrySet()) {\n\t\t\t\n\t\t\tlog.info(\n\t\t\t\t\t\"Zip run result: {}\\n\"\n\t\t\t\t\t+ \"Content: {} temperarily saved at {}\", \n\t\t\t\t\tentry.getKey().getPath(), \n\t\t\t\t\tArrays.toString(entry.getValue().list()), \n\t\t\t\t\tentry.getValue());\n\t\t\tFile zipFile = Files.createTempFile(\"result\", \".zip\").toFile();\n\t\t\tZipUtil.pack(entry.getValue(), zipFile);\n\t\t\t\n\t\t\tRunResultBean runResult = new RunResultBean();\n\t\t\t\n\t\t\ttry {\n\t\t\t\trunResult.setContainerPath(entry.getKey().getPath());\n\t\t\t\trunResult.setType(entry.getKey().getType());\n\t\t\t\tString runResultObjectReferral = minioRepository.putRunResultAndReturnObjectName(\n\t\t\t\t\t\tnew FileInputStream(zipFile), runResult.getDefaultObjectReferral());\n\t\t\t\trunResult.setObjectReferral(runResultObjectReferral);\n\t\t\t} \n\t\t\tcatch (MinioException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tlog.info(\"Save run result: {}\", entry.getKey().getPath());\n\t\t\trunResult.setRun(run);\n\t\t\t/*\n\t\t\t * No need to do it, as we are saving by `runResultRepository` rather\n\t\t\t * than `runRepository`.\n\t\t\t * \n\t\t\t * This also help us to avoid the need of loading all results belong\n\t\t\t * to the same run. \n\t\t\t */\n\t\t\trun.getRunResults().add(runResult);\n\t\t}\n\t}",
"interface OneArgCommand {\n void doCommand(String a);\n }",
"void excuteCommand(Command commandToExecute, String [] params);",
"public void setRepository(Repository repo) {\n\t\tthis.repo = repo;\n\t}",
"@TaskAction\n public void configureRepository() throws IOException {\n GitHub github = GitHub.connect(null, getGithubToken());\n String user = github.getMyself().getLogin();\n GHRepository repository = null;\n\n try {\n repository = github.getRepository(user + \"/\" + getRepositoryName());\n }\n catch (FileNotFoundException e) {\n GHCreateRepositoryBuilder repositoryCreator = github.createRepository(getRepositoryName());\n repository = repositoryCreator.create();\n }\n\n String description = getRepositoryDescription();\n\n if (description != null && !description.equals(repository.getDescription())) {\n repository.setDescription(description);\n }\n }",
"public interface Command {\n\tvoid execute();\n}",
"public Result executeCommand(Command command) {\n return command.execute(this.taskList, this.parser, this.aliasStorage, this.taskStorage, ui);\n }",
"public void runCommand(String commandToRun) {\n // parses the command with regex to a list of strings\n // if command starts with quote, end command at the next quote\n String[] parsedLine = commandToRun.split(\n \" (?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\", -1);\n\n //gets command from commandlist\n ReplUsable command = commands.get(parsedLine[0]);\n\n //if command isn't in the hash print command not found.\n if (command == null) {\n System.out.println(\"ERROR: Command [\" + parsedLine[0] + \"] not found.\");\n } else {\n //if the command was found, run the command.\n try {\n command.run(parsedLine);\n } catch (RuntimeException e) {\n System.out.println(\"ERROR: \" + e.getMessage());\n }\n\n }\n }",
"public void handleCommand(String command);",
"TRepo createRepo();",
"@Test\n public void testUpdateRepo() throws IOException, DuplicateRepoNameException, RepositoryNotFoundException {\n ConfigDatabase.instance().addRepo(testRepo1);\n ConfigDatabase.instance().updateRepo(testRepo1);\n }",
"public interface Command\n{\n void doCommand(List<String> args) throws Exception;\n}",
"private static void doFsCommand(final FsShell shell, final String [] args)\n throws Exception {\n int errcode = shell.run(args);\n if (errcode != 0) throw new IOException(\"Failed put; errcode=\" + errcode);\n }"
] | [
"0.6328718",
"0.56505436",
"0.56456196",
"0.56083584",
"0.55922997",
"0.55518574",
"0.54751176",
"0.5415823",
"0.54025584",
"0.5378796",
"0.5373695",
"0.53454715",
"0.53437924",
"0.5326747",
"0.5317229",
"0.5316949",
"0.5309152",
"0.5284193",
"0.5281994",
"0.52722037",
"0.5266546",
"0.5251535",
"0.5213284",
"0.51890415",
"0.5141482",
"0.5129712",
"0.5112884",
"0.5092763",
"0.5083747",
"0.5056526",
"0.50563914",
"0.50536585",
"0.50444627",
"0.50430626",
"0.50384897",
"0.50142455",
"0.50110614",
"0.49944463",
"0.49944463",
"0.49929398",
"0.4991837",
"0.49913734",
"0.4977347",
"0.49689144",
"0.49604094",
"0.49604094",
"0.49604094",
"0.4955199",
"0.49458966",
"0.49433097",
"0.493605",
"0.49337605",
"0.49231917",
"0.49223456",
"0.4915679",
"0.491385",
"0.4912746",
"0.49024984",
"0.48975357",
"0.48975307",
"0.48841625",
"0.48799142",
"0.48791578",
"0.48750877",
"0.48747543",
"0.4871657",
"0.48504224",
"0.48489314",
"0.48285684",
"0.48193553",
"0.4805824",
"0.47974244",
"0.47896582",
"0.47885928",
"0.47869724",
"0.4780138",
"0.4778946",
"0.47787222",
"0.4776269",
"0.4766542",
"0.47613138",
"0.47565365",
"0.47511467",
"0.47475788",
"0.4740767",
"0.47385532",
"0.47318822",
"0.47221226",
"0.47174916",
"0.4713333",
"0.47080004",
"0.46980256",
"0.46928206",
"0.46867105",
"0.46767306",
"0.46765974",
"0.46712336",
"0.46662503",
"0.4661839",
"0.4653768"
] | 0.527223 | 19 |
Returns the output of the last command | public String lastOutput() throws IOException {
stream.flush();
os.flush();
return os.asString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getLastCommand() {\n return lastCommand;\n }",
"final Commands getLastCommand() {\n\t\t// retornamos el ultimo comando enviado\n\t\treturn this.lastCommand;\n\t}",
"public String getResult() {\n\t\treturn bashCommand.getStdOutString();\n\t}",
"public process get_last() {\n\t\treturn queue.getLast();\n\t}",
"public DrawingCommand getLastCommand() {\r\n\t\tint i = this.commands.size() - 1;\r\n\t\tif (i >= 0) {\r\n\t\t\treturn this.commands.get(this.commands.size() - 1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"private String getLastCommands(int numberOfCommands, Resource r) {\n String finalResult = \"\";\n ArrayList<String> inputLog = r.getInputLog();\n\n int upperLimit = inputLog.size();\n int begin = inputLog.size() - numberOfCommands;\n if (begin < 0) {\n begin = 0;\n }\n for (int i = begin; i < upperLimit; i++) {\n finalResult += ((i + 1) + \" \" + inputLog.get(i)) + \"\\n\";\n }\n\n return finalResult;\n }",
"public static int getLastCommandOrigin() {\n\n return m_iLastCommandOrigin;\n\n }",
"public String getNextCommandString() {\n if (this.history.size() == 0) {\n return \"\";\n }\n\n if ((this.currIndex + 1) >= this.history.size()) {\n this.currIndex = this.history.size();\n return \"\";\n }\n\n this.currIndex += 1;\n return this.history.get(this.currIndex);\n }",
"public String getLastText() {\n\t\treturn lastText;\n\t}",
"public String getLast()\n {\n return lastItem;\n }",
"public T getLast(){\n\treturn _end.getCargo();\n }",
"public Operation getLastOp() {\n\t\treturn ops.get(ops.size() - 1);\n\t}",
"public int getLast() {\n\t\treturn last;\n\t}",
"private ShellStatus getCmdOutput() {\n ShellStatus status = RUNNING;\n\n while (!stdOut.buffer.isEmpty()) {\n String line = stdOut.buffer.remove(0);\n LOG.trace(String.format(\"lockId=%s, shell line:=%s \", lockId, line));\n\n if (\"END_OF_SCRIPT\".equals(line)) {\n if (!hasErrors()) {\n status = SUCCESS;\n } else {\n status = PSSHELL_ERROR;\n }\n } else {\n command.addOutputLine(line);\n }\n }\n\n if (!stdErr.buffer.isEmpty()) {\n while (!stdErr.buffer.isEmpty()) {\n String errorLine = stdErr.buffer.remove(0);\n LOG.trace(\"CallerId: \" + lockId + \" error line: \" + errorLine);\n command.addErrorLine(errorLine);\n }\n status = PSSHELL_ERROR;\n }\n\n command.setReturnCode(status);\n return status;\n }",
"public String getLastItem();",
"public int getLast() {\n\treturn _last;\n }",
"private Line getLastLine() {\n\t\treturn doily.lines.get(doily.lines.size()-1);\n\t}",
"public String getLastMsg() {\n String s = msgs.peekTail();\n return s == null ? \"\" : s;\n }",
"public String getLastMessage() {\n return lastMessage;\n }",
"public T getLast() {\n\t\t//return the data in the last node\n\t\treturn getLastNode().getData();\n\t}",
"public T getLast()\n\t{\n\t\treturn getLastNode().getData();\n\t}",
"public T getLast()\n\t{\n\t\treturn getLastNode().getData();\n\t}",
"@Override\r\n\tpublic T last() {\n\t\treturn tail.content;\r\n\t}",
"public abstract String getLastAnswer();",
"public XBMCInfo getLastXBMC() {\n\t\treturn xbmcInfoManager.getLastXBMC();\n\t}",
"public String getLastMove() {\n\t\treturn lastMove;\r\n\t}",
"public T getLast();",
"public T getLast();",
"public String getCommandReturned() {\n return commandReturned;\n }",
"public String getOutput() {\n\t\treturn results.getOutput() ;\n\t}",
"public String getLastUpdate() {\n return lastUpdate;\n }",
"public String getResult() {\r\n\t\treturn getText(0, commandIndex - commandMode.length());\r\n\t}",
"public String getLastP() {\n\t\treturn lastFieldP.getText();\n\t}",
"public byte[] getLastResponse() {\n return Arrays.copyOf(lastResponse, lastResponse.length);\n }",
"public StatusLine getLastStatus() {\r\n return lastStatusLine;\r\n }",
"public String getLastLogged()\n {\n return lastLogged;\n }",
"@Override\r\n\tpublic Object last(){\r\n\t\tcheck();\r\n\t\treturn tail.value;\r\n\t}",
"public State getLastState() {\n\t\treturn endState;\r\n\t}",
"public String getLastChange() {\n return lastChange;\n }",
"private AbstractBuild<?, ?> getLastFinishedBuild() {\n AbstractBuild<?, ?> lastBuild = m_project.getLastBuild();\n while (lastBuild != null && (lastBuild.isBuilding() || lastBuild.getAction(AbstractBuildReport.class) == null)) {\n lastBuild = lastBuild.getPreviousBuild();\n }\n return lastBuild;\n }",
"public java.lang.String getLast_processstatus() {\n return last_processstatus;\n }",
"public String getCommand() {\n\t\tString[] lines = commandLine.getText().split(\"\\n\");\n\t\treturn lines[commandLine.getLineCount() - 2];\n\t}",
"public String getLastCommit() {\n return getCellContent(LAST_COMMIT);\n }",
"public static String getLastDir() {\n return getProperty(\"lastdir\");\n }",
"@Override\r\n\tprotected void doLast() {\n\t\t\r\n\t}",
"public String getLastLocation() {\n return lastLocation;\n }",
"public String getLastPassword() {\n\t\treturn lastPassword;\n\t}",
"public TypeHere getLast() {\n return items[size - 1];\n }",
"public String getLastOperation()\n {\n if (!getCvpOperation().isNull())\n {\n com.sybase.afx.json.JsonObject cvpOperation = (com.sybase.afx.json.JsonObject)(com.sybase.afx.json.JsonReader.parse(__cvpOperation.getValue()));\n return (String)cvpOperation.get(\"cvp_name\");\n }\n if (getPendingChange() == 'C')\n {\n }\n else if (getPendingChange() == 'D')\n {\n }\n else if (getPendingChange() == 'U')\n {\n }\n return null;\n }",
"public int last() {\n\t\tif (bufferIndex == bufferLast)\n\t\t\treturn -1;\n\t\tsynchronized (buffer) {\n\t\t\tint outgoing = buffer[bufferLast - 1];\n\t\t\tbufferIndex = 0;\n\t\t\tbufferLast = 0;\n\t\t\treturn outgoing;\n\t\t}\n\t}",
"public void setLastCommand(String lastCommand) {\n this.lastCommand = lastCommand;\n }",
"public String[] getLastMove() {\n return lastMove;\n }",
"@Override\n\tpublic String problemOutput() {\n\t\treturn reverseFirstLast();\n\t}",
"java.lang.String getCurrentrun();",
"public Object last()throws ListExeption;",
"public String getUnprocessedCommand() {\n if (currentIndex == 0) {\n // Not necessary but saves initialising a redundant string object\n return command;\n }\n if (isComplete()) {\n /* If there's no remaining command, return an empty string. This allows us to use the String\n * pool and avoid StringIndexOutOfBoundsExceptions. */\n return \"\";\n }\n return command.substring(currentIndex);\n }",
"static String getLastCheckpointAsString() {\n HashMap<String, String> checkpoint = getLastCheckpoint();\n if (checkpoint == null) {\n return \"0 \";\n } else {\n StringBuilder sb = new StringBuilder();\n sb.append(checkpoint.size()).append(\" \");\n for (String name : checkpoint.keySet()) {\n sb.append(name).append(\"#####\");\n sb.append(checkpoint.get(name)).append(\"#####\");\n }\n return sb.toString();\n }\n }",
"public String getOutput() throws TavernaException, ProcessException{\n if (outputFile == null){\n return saveOutput();\n }\n try {\n return runner.getOutput();\n } catch (InterruptedException ex) {\n throw new TavernaException (\"Workflow was interrupted.\", ex);\n }\n }",
"public java.lang.String getLast_version() {\n return last_version;\n }",
"public Move getLastMove() {\n return lastMove;\n }",
"public synchronized String getLastWord() {\n\t\treturn lastWord;\n\t}",
"public String readCommand() {\n return scanner.nextLine();\n }",
"public String getNextCommand() {\n System.out.println(\"Left, Right, Advance <n>, Quit , Help: \");\n return scanner.nextLine();\n }",
"public String getPrevCommandString() {\n if (this.history.size() == 0) {\n return \"\";\n }\n\n if (this.currIndex <= 0) {\n return this.history.get(0);\n }\n\n this.currIndex -= 1;\n return this.history.get(this.currIndex);\n }",
"public static String getLastFileName()\r\n\t{\r\n\t\treturn _outputFileName;\r\n\t}",
"public T getLast() {\n return this.getHelper(this.indexCorrespondingToTheLatestElement).data;\n }",
"public String getLastUpdatedString() {\n return lastUpdated.toString();\n }",
"public Item getLast() {\n return items[size - 1];\n }",
"java.lang.String getOutput();",
"int getPenultimateOutputSize() {\n\t\treturn lastStrLen[0];\n\t}",
"public String getLastUpdateString() {\r\n return getLastUpdateString(lastUpdatedTime);\r\n }",
"public TestOut getOutput() {\n\treturn(output);\n }",
"public int getLastPack() {\n return packs.last().getNumber();\n }",
"public Integer getAfterResult() {\r\n return afterResult;\r\n }",
"public Node getLast()\n {\n return this.last;\n }",
"public E getLast(){\n return tail.getPrevious().getElement();\n }",
"public SUDecision getlastChoice() {\r\n\t\treturn m_lastChoice;\r\n\t}",
"public List<Info> getLastInfo() {\n\t\treturn dao.getLastInfo();\n\t}",
"char getLastMove() {\n int length = this.prevMoves.length();\n if (length > 0) {\n return prevMoves.charAt(length - 1);\n }\n return ' ';\n }",
"String getOutput();",
"T last();",
"public String getLast() {\n if(first == null) return null;\n int i = 0;\n Node x = first;\n for(x = first; i < n - 1; x = x.next) {\n i++;\n }\n return x.data;\n }",
"public T getLast() {\n if (this.getSize() > 0) {\n return buffer[index];\n }\n return null;\n }",
"public String getName() {\n return \"last\";\n }",
"public Item getLast();",
"public Object last() {\r\n\t\treturn elements.get(size() - 1);\r\n\t}",
"public E getLast();",
"public Node getLast() {\r\n\t\treturn getNode(this.size());\r\n\t}",
"public String lastAsSlot();",
"public String getOutput() {\n return output.toString();\n }",
"public String getLastReport()\n {\n return null;\n }",
"public String getOutput() {\n myLock.lock();\n try {\n return myOutput.toString();\n }\n finally {\n myLock.unlock();\n }\n }",
"public SeleniumQueryObject last() {\n\t\treturn LastFunction.last(this, this.elements);\n\t}",
"public char lastChar() {\n\t\tif (bufferIndex == bufferLast)\n\t\t\treturn (char) (-1);\n\t\treturn (char) last();\n\t}",
"public String getFinishClor() {\n return (String)getAttributeInternal(FINISHCLOR);\n }",
"public Instant getLastCompletion() {\n\t\treturn Last;\n\t}",
"public String getLastC() {\n\t\treturn lastFieldC.getText();\n\t}",
"public Node<T> getLast() {\r\n\t\treturn last;\r\n\t}",
"public long getLastPlayed ( ) {\n\t\treturn extract ( handle -> handle.getLastPlayed ( ) );\n\t}",
"public long getLastUpdate() {\n return this.lastUpdate;\n }"
] | [
"0.74213386",
"0.72474617",
"0.6727334",
"0.66485137",
"0.6609325",
"0.64872384",
"0.6287733",
"0.6217288",
"0.6211626",
"0.61605936",
"0.6113301",
"0.61118746",
"0.6031845",
"0.6012492",
"0.6004792",
"0.60042495",
"0.59772545",
"0.5950037",
"0.5902261",
"0.5901664",
"0.58927",
"0.58927",
"0.5884429",
"0.5882352",
"0.58769983",
"0.58692336",
"0.5834932",
"0.5834932",
"0.5788689",
"0.5777613",
"0.576309",
"0.5746914",
"0.574625",
"0.5689688",
"0.5689538",
"0.56685925",
"0.566735",
"0.5665727",
"0.56486887",
"0.5637038",
"0.5626325",
"0.5625098",
"0.56121236",
"0.5610125",
"0.56079054",
"0.560548",
"0.55941075",
"0.5570982",
"0.5566614",
"0.5565318",
"0.5561149",
"0.5560323",
"0.55529785",
"0.55502003",
"0.5544941",
"0.5540921",
"0.55400157",
"0.5537964",
"0.55237657",
"0.55225444",
"0.5522213",
"0.5522095",
"0.55214864",
"0.5521447",
"0.5513838",
"0.5500935",
"0.54968697",
"0.5496483",
"0.5491131",
"0.5483937",
"0.54764783",
"0.5461449",
"0.5458366",
"0.5455331",
"0.5446541",
"0.5443629",
"0.5434666",
"0.54298127",
"0.54249126",
"0.54192364",
"0.5416242",
"0.5414579",
"0.5406731",
"0.5405865",
"0.53988",
"0.5397366",
"0.53944975",
"0.5387731",
"0.53866035",
"0.53744805",
"0.5371759",
"0.53711545",
"0.5368465",
"0.53662",
"0.5358066",
"0.5355611",
"0.53555936",
"0.53508484",
"0.53502184",
"0.53440535"
] | 0.7347168 | 1 |
Sets the progress listener that will receive progress updates | public void setProgressListener(GeoGitPy4JProgressListener listener) {
this.listener = listener;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addProgressListener(ProgressListener pl);",
"public void setUpdateProgressListener(UpdateProgressListener listener) {\n UpdateService.this.setUpdateProgressListener(listener);\n }",
"public void addProgressListener(ProgressListener pol);",
"@Override\n\t\t\t\tpublic void onProgress(int progress) {\n\t\t\t\t\tmProgressBar.setProgress(progress);\n\t\t\t\t}",
"public void setProgressViewUpdateListener(CircleProgressUpdateListener listener){\n this.updateListener = listener;\n }",
"public synchronized void addProgressListener (ProgressListener lsnr) {\n if (listeners == null) {\n listeners = new java.util.Vector();\n }\n listeners.addElement(lsnr);\n }",
"void onProgress(float progress);",
"void setProgress(float progress);",
"public static interface ProgressListener {\n\n\t\tpublic void onProgress(float progress);\n\n\t}",
"@Override\n\t\t\tpublic void onProgressChanged(int progress) {\n\n\t\t\t}",
"void setProgress(int progress);",
"void setProgress(int progress);",
"public void setProgress(int progress) {\n \t\t\tsynchronized (this) {\n \t\t\t\tm_progress = progress;\n \t\t\t\tthis.notify();\n \t\t\t}\n \t\t}",
"public void setBugReportProgressListener(BugReportProgressListener listener) {\n mBugReportProgressListener = listener;\n }",
"public void setSwipeProgressListener(@Nullable SwipeProgressListener listener) {\n\t\tmProgressListener = listener;\n\t}",
"public void onProgress(Object progress, Object max) {\n\t\t\t\t\t}",
"public interface OnProgressListener {\n void onProgress(int progress);\n}",
"public void setProgress(int value);",
"public void setProgress(BigValue progress) {\n this.progress = progress;\n this.checkProgress();\n }",
"public void onProgress(int pos);",
"public void setProgressCallBack(ProgressEvent progressCallBack)\r\n\t{\r\n\t\tthis.progressCallBack = progressCallBack;\r\n\t}",
"public interface ProgressListener\n{\n\t/**\n\t * Set the progress level to a new value, which must be between 0.0f and 1.0f\n\t * (including both of these values).\n\t * You should not call this method with a value lower than any value you've set\n\t * before.\n\t * However, this is not checked.\n\t * @param progress the degree of progress as a value between 0.0f and 1.0f\n\t * @throws IllegalArgumentException if the float argument is not in the mentioned interval\n\t */\n\tvoid setProgress(float progress);\n\n\t/**\n\t * Sets a new progress level.\n\t * If an operation consists of totalItems steps, which are numbered from 0 to\n\t * totalItems - 1, this method can be called after the completion of each step.\n\t * <p>\n\t * Example: if there are three steps and the first one is done, the parameters\n\t * must be 0 and 3, which will indicated 33% completion.\n\t * Parameters 1 and 3 mean 66%, 2 and 3 100%.\n\t * If you use 3 and 3, an IllegalArgumentException will be thrown.\n\t * <p>\n\t * Computes <code>(float)(zeroBasedIndex + 1) / (float)totalItems</code> and calls\n\t * {@link #setProgress(float)} with that value.\n\t *\n\t * @param zeroBasedIndex the index of the step that was just completed\n\t * @param totalItems the number of steps in this operation\n\t * @throws IllegalArgumentException if the parameters don't match the above criteria\n\t */\n\tvoid setProgress(int zeroBasedIndex, int totalItems);\n}",
"public interface OnProgressChangeListener {\n void onProgressChange(float smoothProgress, float targetProgress);\n }",
"protected void onProgressUpdate(String... progress) {\n\t\t\t\t\t\t// Set progress percentage\n\t\t\t\t\t\tprgDialog.setProgress(Integer.parseInt(progress[0]));\n\t\t\t\t\t}",
"void setProgress(@FloatRange(from = 0, to = 1) float progress);",
"public abstract void onProgress(short percentage, long downloadedSoFar);",
"protected void onProgressUpdate(Integer... progress) {\n\t\t}",
"private void setSeekBarListener() {\n\t\tseekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){\n\t\t\tint progress = 0;\n\n\t\t\t/**\n\t\t\t * When the SeekBar's progress changes, log it and print a Toast saying that the progress changed.\n\t\t\t */\n\t\t\t@Override\n\t\t\tpublic void onProgressChanged(SeekBar seekBar, int progressValue, boolean fromUser){\n\t\t\t\tprogress = progressValue;\n\t\t\t\ttextView.setText(\"Skill Level: \" + progress + \"/\" + seekBar.getMax());\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * When the user touches the SeekBar, print a Toast.\n\t\t\t */\n\t\t\t@Override\n\t\t\tpublic void onStartTrackingTouch(SeekBar seekBar){\n\t\t\t\t// do nothing\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * When the user stops touching the SeekBar, change the text above it to show the selected value.\n\t\t\t */\n\t\t\t@Override\n\t\t\tpublic void onStopTrackingTouch(SeekBar seekBar){\n\t\t\t\tLog.v(LOG_TAG, \"Selected skill level \" + progress);\n\t\t\t}\n\t\t});\n\t}",
"public void action (ProgressListener progressListener) throws Exception;",
"@Override\n\t\tprotected void onProgressUpdate(Integer... progress) {\n\t\t\tsuper.onProgressUpdate(progress);\n\n\t\t\tdialog.setProgress(progress[0]);\n\t\t}",
"@Override\n\t\t\tpublic void onProgressChanged(SeekArc seekArc, int progress,\n\t\t\t\t\tboolean fromUser) {\n\t\t\t\tprog = progress;\n\t\t\t}",
"@Override\n public void onProgress(long downloaded,\n long total) {\n int progress = (int) (downloaded / total * 100);\n bar.setProgress(progress);\n }",
"@Override\n public void onProgress(long downloaded, long total) {\n int progress = (int) (downloaded / total * 100);\n bar.setProgress(progress);\n }",
"private void fireProgressListenerStep() {\n if (progress == null) {\n return;\n }\n progress.step(new ProgressEvent(this, ProgressEvent.STEP, 0, ++stepCounter));\n }",
"@SuppressWarnings(\"unused\")\n public void setOnRangeSeekBarChangeListener(OnRangeSeekBarChangeListener<T> listener) {\n this.listener = listener;\n }",
"@Override\n\t\tprotected void onProgressUpdate(Integer... progress) {\n\t\t\tprogressBar.setVisibility(View.VISIBLE);\n\n\t\t\t// updating progress bar value\n\t\t\tprogressBar.setProgress(progress[0]);\n\n\t\t\t// updating percentage value\n\t\t\ttxtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n\t\t}",
"@Override\n public void onProgressChanged(SeekBar seekBar, int progressValue, boolean fromUser) {\n progress = progressValue;\n }",
"void onProgress(long bytesTransferred);",
"public void onProgressChanged(SeekBar arg0, int progress, boolean fromUser) {\n }",
"public void setProgress(int progress) {\r\n\t\tif (mProgress != progress) {\r\n\t\t\tmProgress = progress;\r\n\t\t\tif (mOnCircularSeekBarChangeListener != null) {\r\n\t\t\t\tmOnCircularSeekBarChangeListener.onProgressChanged(this, progress, false);\r\n\t\t\t}\r\n\r\n\t\t\trecalculateAll();\r\n\t\t\tinvalidate();\r\n\t\t}\r\n\t}",
"protected void onProgressUpdate(Integer... progress) {\n }",
"public interface ProgressListener {\n /**\n * @param current 已经读取的字节数\n * @param total 响应总长度\n * @param done 是否读取完毕\n */\n void onProgress(long current, long total, int progress, boolean done);\n}",
"public void setOnSeekChangeListener(OnSeekChangeListener listener) {\n this.mSeekChangeListener = listener;\n }",
"public interface ProgressListener {\n\n void progress(long bytesRead, long contentLength, boolean done);\n\n}",
"public void installProgress(Status status) {\r\n if (listener != null) {\r\n listener.onInstallProgress(status);// .onStatus(status);\r\n }\r\n }",
"public void onProgressChanged(SeekBar seekBar, int progress,\n\t\t\tboolean fromUser) {\n\t}",
"private void setSeekbarListener(){\n mTempSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n\n @Override\n public void onStopTrackingTouch(SeekBar seekBar) { }\n\n @Override\n public void onStartTrackingTouch(SeekBar seekBar) { }\n\n @Override\n public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser) {\n if(progress<=100 && progress>=0){\n // change display temp based on seekbar progress and update the view\n display_temp = Tools.roundToHalf((32-9)*progress/100.0+9);\n Log.v(TAG, \"onProgressChanged: temp:\"+display_temp+\"seekbar progress=\"+progress);\n updateControlView();\n // update the mercury of the thermometer\n ClipDrawable mMercuryClip = (ClipDrawable) mMercuryImg.getDrawable();\n mMercuryClip.setLevel(progress*100);\n }\n }\n });\n }",
"@NonNull\n @Override\n public StorageTask<ResultT> addOnProgressListener(\n @NonNull OnProgressListener<? super ResultT> listener) {\n Preconditions.checkNotNull(listener);\n progressManager.addListener(null, null, listener);\n return this;\n }",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n ProgressBar pbFileIO = (ProgressBar)findViewById(R.id.pbFileIO);\n pbFileIO.setProgress(progress[0]);\n }",
"@Override\n protected void onProgressUpdate(Integer... values) {\n progressBar.setProgress(values[0]);\n }",
"@Override\n protected void onProgressUpdate(Integer... values) {\n progressBar.setProgress(values[0]);\n }",
"@Override protected void onProgressUpdate(Integer... vals) {\n updateProgressBar(vals[0].intValue());\n }",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n if (mProgressDialog != null) {\n mProgressDialog.setProgress(progress[0]);\n }\n }",
"void setListener(Listener listener);",
"@Override\n\tpublic void onProgressUpdate() {\n\n\t}",
"@Override\n public void onProgressChanged(SeekBar bar, int progress, boolean fromuser) {\n mProgress = progress;\n mSeekBarFromUser = fromuser;\n }",
"@Override\r\n protected void onProgressUpdate(Integer... progress) {\n }",
"private void setListener() {\n\t}",
"public void onProgressUpdate(int numRouleau,String prochain);",
"public interface ProgressListener {\n void update(String url, long bytesRead, long contentLength, boolean done);\n}",
"public void setProgress(float progress) {\n currentProgress = progress;\n callback.onPercentChanged(progress);\n for (StateOfViews it : mappedViews) {\n it.startV.setX(it.origDimens.x + (it.endV.getX() - it.origDimens.x) * progress);\n it.startV.setY(it.origDimens.y + (it.endV.getY() - it.origDimens.y) * progress);\n it.startV.getLayoutParams().width = (int) (it.origDimens.width + ((it.endV.getWidth() - it.origDimens.width) * progress));\n it.startV.getLayoutParams().height = (int) (it.origDimens.height + ((it.endV.getHeight() - it.origDimens.height) * progress));\n it.startV.requestLayout();\n }\n }",
"public void onDownloadProgress(int current, int total);",
"public void setProgress(int progress) {\n\n this.percent = progress;\n percentdraw = 0;\n start = true;\n anim();\n invalidate();\n }",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n }",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n }",
"@Override\n public void onProgressChanged(int id, long bytesCurrent, long bytesTotal) {\n }",
"public void setProgress(String progress) {\n this.progress = progress;\n }",
"public interface IProgressListener {\n public void onDownloadSize(int type, int step, int doneFlag, int fileCount, int curFile,\n int total, int cur, int curFileSize, int status);\n}",
"@Override\n public void onProgressUpdate(Integer... progress)\n {\n _dialog.setProgress(progress[0]);\n }",
"public void run() {\n\t\t\t\tMessage msg = new Message();\n\t\t\t\tmsg.what = Msg_SetProgress;\n\t\t\t\tmHandler.sendMessage(msg);\n\t\t\t}",
"public void changed(ProgressEvent event) {\n\t\t\t}",
"@Override\n\t\tpublic void onProgressChanged(SeekBar seekBar, int progress,\n\t\t\t\tboolean fromUser) {\n\t\t\tcustomPercent = progress / 100.0;\n\t\t\tupdateCustom();\n\t\t\t\n\t\t}",
"@Override\n\t\t\tpublic void onProgress(ProgressMessage msg) {\n\n\t\t\t}",
"void execute(DetailedProgressListener listener);",
"static public interface ProgressListener {\n /**\n * Deve retornar um valor entre 0 e 100 informando o percentual do progresso\n * alcançado.\n * @return Deve retornar um valor entre 0 e 100 informando o percentual do \n * progresso alcançado.\n */\n public byte onProgress();\n }",
"public interface ProgressListener\n{\n\n public abstract void progressChanged(ProgressEvent progressevent);\n}",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n progressBar.setVisibility(View.VISIBLE);\n\n // updating progress bar value\n progressBar.setProgress(progress[0]);\n\n // updating percentage value\n txtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n }",
"public void setProgressDialog(Progress pb)\n {\n progressBar = pb;\n }",
"@Override\n\t\t\t\t\tpublic void onProgressChanged(SeekBar seekBar,\n\t\t\t\t\t\t\tint progress, boolean fromUser) {\n\t\t\t\t\t}",
"public static void setStatusListener(StatusListener listener) {\n statusListener = listener;\n }",
"@Override\n\tprotected void setListener() {\n\n\t}",
"@Override\n\tprotected void setListener() {\n\n\t}",
"@Override\n\tpublic void setListener() {\n\n\t}",
"public void seekBarListener() {\n seekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n int progressChangedValue = 0;\n\n public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n progressChangedValue = progress;\n }\n\n public void onStartTrackingTouch(SeekBar seekBar) {\n // TODO Auto-generated method stub\n }\n\n public void onStopTrackingTouch(SeekBar seekBar) {\n progressTextView.setText(\"Your current progress is \" + progressChangedValue);\n Toast.makeText(MainActivity.this, \"Seek bar progress is :\" + progressChangedValue,\n Toast.LENGTH_SHORT).show();\n }\n });\n }",
"protected void onProgressUpdate(String fileName, Integer... progress) {\n }",
"@Override public void onInitProgress(int pctComplete) {\n publishProgress(Integer.valueOf(pctComplete));\n }",
"public void setProgress(int percent) {\n setProgress((float) percent / 100);\n }",
"public void setProgress(int progress) {\n\t\tif (progress > mMax || progress < 0) {\n\t\t\tthrow new IllegalArgumentException(String.format(\"Progress (%d) must be between %d and %d\", progress, 0, mMax));\n\t\t}\n\t\tmProgress = progress;\n\t\tinvalidate();\n\t}",
"public interface OnBaseProgressListener {\r\n void onDownloading(boolean done, long total, long current);\r\n}",
"@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n\n progressBar.setProgress(values[0].intValue());\n\n }",
"void onShowProgress();",
"private void updateProgress(int progress) {\n if (myHost != null && progress != previousProgress) {\n myHost.updateProgress(progress);\n }\n previousProgress = progress;\n }",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n pDialog.setProgress(progress[0]);\n\n // updating percentage value\n //txtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n }",
"@Override\n\t\t\tpublic void onProgressChanged(SeekBar skb, int prog, boolean fromUser) {\n\t\t\t\tMySurfaceView.redVal = prog;\n\t\t\t}",
"@Override\r\n\tpublic void setListener() {\n\r\n\t}",
"@Override\r\n\tpublic void setListener() {\n\r\n\t}",
"@Override\n\t\t\tpublic void onProgressChanged(SeekBar seekBar, int progress,\n\t\t\t\t\tboolean fromUser) {\n\t\t\t}",
"@Override\n\t\t\tpublic void onProgressChanged(SeekBar seekBar, int progress,\n\t\t\t\t\tboolean fromUser) {\n\t\t\t}",
"@Override\n\t\t\tpublic void onProgressChanged(SeekBar seekBar, int progress,\n\t\t\t\t\tboolean fromUser) {\n\t\t\t}",
"@Override\n\t\tprotected void onProgressUpdate(Integer... values) {\n\t\t\tloadingView.setProgress(values[0]);\n\t\t}"
] | [
"0.7866971",
"0.7670488",
"0.7650094",
"0.7341353",
"0.7229759",
"0.7079568",
"0.70461994",
"0.70073664",
"0.70052034",
"0.69595426",
"0.69498324",
"0.69498324",
"0.67887974",
"0.67759794",
"0.67449045",
"0.67310405",
"0.6728688",
"0.6695328",
"0.66750634",
"0.6665718",
"0.6638237",
"0.66228545",
"0.66132003",
"0.6602131",
"0.65787643",
"0.6565869",
"0.6559697",
"0.65489143",
"0.6526792",
"0.65180033",
"0.6506999",
"0.649421",
"0.64906293",
"0.64891565",
"0.6460605",
"0.6453834",
"0.6435628",
"0.64243907",
"0.6420766",
"0.64062077",
"0.63976496",
"0.6379635",
"0.6373031",
"0.63560116",
"0.6355389",
"0.6349016",
"0.63476473",
"0.63459367",
"0.63418645",
"0.63258976",
"0.63258976",
"0.6323752",
"0.63169324",
"0.6315429",
"0.6302641",
"0.62963164",
"0.6295389",
"0.6290494",
"0.62877446",
"0.6280369",
"0.62797976",
"0.6275662",
"0.62738067",
"0.6262208",
"0.6262208",
"0.6259707",
"0.6256147",
"0.6247351",
"0.62406635",
"0.6236035",
"0.6206685",
"0.6198061",
"0.6192381",
"0.6191542",
"0.6181981",
"0.6170707",
"0.616682",
"0.61581284",
"0.6146465",
"0.6146408",
"0.6143323",
"0.6143323",
"0.61348873",
"0.6124782",
"0.61208993",
"0.61133045",
"0.61096305",
"0.6107423",
"0.6098049",
"0.60964704",
"0.6093649",
"0.60910785",
"0.6088438",
"0.6088411",
"0.608508",
"0.608508",
"0.6080153",
"0.6080153",
"0.6080153",
"0.6079228"
] | 0.73143876 | 4 |
Removes the progress listener, if set | public void removeProgressListener() {
this.listener = new SilentProgressListener();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void removeProgressListener(ProgressListener pol);",
"public synchronized void removeProgressListener (ProgressListener lsnr) {\n if (listeners == null) {\n return;\n }\n listeners.removeElement(lsnr);\n }",
"private void fireProgressListenerStop() {\n if (progress == null) {\n return;\n }\n progress.stop(new ProgressEvent(this, ProgressEvent.STOP));\n }",
"public void removeBugReportProgressListener() {\n mBugReportProgressListener = null;\n }",
"@Override\n public void removeListener() {\n this.mListener = null;\n }",
"public void removeSeekListener(SeekListener listener){\r\n super.removeSeekListener(listener);\r\n\r\n if (listenerList.getListenerCount(SeekListener.class) == 0){\r\n setDGState(Datagram.DG_SEEK, false);\r\n setDGState(Datagram.DG_SEEK_REMOVED, false);\r\n\r\n source.lastSeekListenerRemoved();\r\n }\r\n }",
"public void removeAllListeners() {\n mCircularBar.removeAllListeners();\n }",
"public void removeRatioListener(IRatioListener listener)\r\n {\r\n ratioListeners.remove(listener);\r\n }",
"@Override\n public void removeListener(StreamListener listener) {\n streamListeners.remove(listener);\n }",
"public boolean removeListener(Animator.AnimatorListener listener) {\n return mCircularBar.removeListener(listener);\n }",
"public synchronized void removeCompletionListener(ActionListener l) {\n completionListeners.removeElement(l); //remove listeners\n }",
"public void removeNPTListener(NPTListener l) {}",
"public void removeListener(T listener);",
"public void removeCompletionListener(Runnable listener) {\n\t\tcompletionListeners.remove(listener);\n\t}",
"public void unregisterListener() {\n\t\tthis.listener = null;\n\t}",
"public void goneProgress(){\n mProgressBar.setVisibility(View.GONE);\n }",
"public void removeHideListener() {\n this.eventEmitter.off(\"progress\", this.progressListenerToken);\n this.eventEmitter.off(EventType.AD_PROGRESS, this.adProgressListenerToken);\n this.eventEmitter.off(EventType.AD_BREAK_STARTED, this.adBreakStartedListenerToken);\n this.eventEmitter.off(EventType.DID_SEEK_TO, this.didSeekToListenerToken);\n this.eventEmitter.off(EventType.CUE_POINT, this.cuePointListenerToken);\n this.eventEmitter.off(EventType.WILL_INTERRUPT_CONTENT, this.willInterruptContentListenerToken);\n this.eventEmitter.off(EventType.ACTIVITY_STOPPED, this.activityStoppedListenerToken);\n this.eventEmitter.off(EventType.FRAGMENT_STOPPED, this.fragmentStoppedListenerToken);\n this.eventEmitter.off(EventType.REMOVE_VIDEO_STILL, this.removeVideoStillListenerToken);\n }",
"void removeListener(RiakFutureListener<V,T> listener);",
"public void removeListener(TransferListener listener) {\n listeners.remove(listener);\n }",
"public void removeListener(GrillEventListener listener);",
"public void removeListener(final IMemoryViewerSynchronizerListener listener) {\n m_listeners.removeListener(listener);\n }",
"public void removeListener(RepaintRequestListener listener) {\n }",
"public void removeEnumerateCallback(OctaveReference listener) {\n\t\tlistenerEnumerate.remove(listener);\n\t}",
"public void stopProgressAnimation(){\n if(progressAnimator!=null){\n progressAnimator.cancel();\n progressAnimator = null;\n }\n }",
"public void removeListener(ValueChangedListener listener) {\n\t\t_listenerManager.removeListener(listener);\n\t}",
"void removeCompletedEventListener(IGameStateListener listener);",
"@Override\n public void removeListener(DisplayEventListener listener) {\n listenerList.remove(DisplayEventListener.class, listener);\n }",
"public void removeAllListener() {\r\n listeners.clear();\r\n }",
"public void removeMonoflopDoneListener(MonoflopDoneListener listener) {\n\t\tlistenerMonoflopDone.remove(listener);\n\t}",
"@Override\r\n public void removeNotify() {\r\n // remove listener\r\n component.getResults().removeLabTestListener(this);\r\n \r\n super.removeNotify();\r\n }",
"public void removeScrollingListener() {\n this.onWheelListener = null;\n }",
"public void removeChangeListener(ChangeListener<BufferedImage> listener) {\n observer.remove(listener);\n }",
"protected void uninstallListeners() {\n spinner.removePropertyChangeListener(propertyChangeListener); }",
"public void removeAllRatioListeners()\r\n {\r\n ratioListeners.clear();\r\n }",
"public void removeDisconnectedCallback(OctaveReference listener) {\n\t\tlistenerDisconnected.remove(listener);\n\t}",
"public void removeListener(StatisticsListener listener)\r\n\t{\r\n\t\tlisteners.remove(listener);\r\n\t}",
"public void removePrintJobListener(PrintJobListener listener);",
"public synchronized void removeEventListener(InputListener listener) {\n\t\tlisteners.remove(listener);\n\t}",
"public void removeChangeListener(ChangeListener l) {\n\t\t//do nothing\n\t}",
"void removeListener(ChangeListener<? super T> listener);",
"void removeListener(GraphListener listener);",
"public void cleanUp() { listener = null; }",
"public void removeListeners() {\n if ( listeners != null ) {\n listeners.clear();\n }\n }",
"default void removeListener(Runnable listener) {\n\t\tthis.getItemListeners().remove(listener);\n\t}",
"void stopListener()\n {\n\n locationManager.removeUpdates(RetriveLocation.this);\n isListening = false;\n }",
"void removeListener(BotListener l);",
"void removeContinuousQueryListener(ContinuousQueryListener<K, ?> listener);",
"void hideProgress();",
"public void removeReadingPointListener(ReadingPointListener l) {\n\t\tlisteners.remove(l);\n\t}",
"private void hideProgress() {\n if (dialogProgress != null) {\n dialogProgress.dismiss();\n dialogProgress = null;\n }\n }",
"public void remove(Object listener) {\n if (!type.isInstance(listener)) {\n return;\n }\n if (listener.equals(logger.getDelegate())) {\n logger = noOpLogger;\n }\n handlers.remove(listener);\n }",
"private void removeListeners() {\n \t\tlistenToTextChanges(false);\n \t\tfHistory.removeOperationHistoryListener(fHistoryListener);\n \t\tfHistoryListener= null;\n \t}",
"public void removeListener(LineListener listener) {\n\t\tplayer.removeListeners(listener);\n\t}",
"public ChannelProgressivePromise removeListener(GenericFutureListener<? extends Future<? super Void>> listener)\r\n/* 81: */ {\r\n/* 82:113 */ super.removeListener(listener);\r\n/* 83:114 */ return this;\r\n/* 84: */ }",
"void hideProgress() {\n removeProgressView();\n removeScreenshotView();\n }",
"private void removeProgressView() {\n if (progressView == null) return;\n\n removeView(progressView);\n TurbolinksLog.d(\"Progress view removed\");\n }",
"public void removePropertyChangeListener(PropertyChangeListener listener)\n {\n }",
"public void removePropertyChangeListener(PropertyChangeListener listener) {\n\n\t}",
"public void removeChangeListener(ChangeListener listener) { _changeListeners.remove(listener); }",
"@Override\n public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {\n if (listeners != null) {\n listeners.removePropertyChangeListener(listener);\n }\n }",
"@Override\n\tpublic void removeTextProcessListener(TextProcessStatusListener listener) {\n\n\t\tlisteners.remove(TextProcessStatusListener.class, listener);\n\t}",
"private void hideProgress() {\n \tif(mProgress!=null){\n \t\tmProgress.dismiss();\n \tmProgress=null;\n \t}\n }",
"public void removeTuioListener(TuioListener listener)\n\t{\n\t\tlistenerList.removeElement(listener);\t\n\t}",
"private void stopAudioLevelPoll() {\n handler.removeCallbacks(audioPoller);\n volumeBar.setProgress(0);\n }",
"public void unregisterListeners(){\n listeners.clear();\n }",
"public void removeListener(ILabelProviderListener listener) {\n \t\t\r\n \t}",
"@Override\n\tpublic void removePropertyChangeListener(PropertyChangeListener l) {\n\t\t//do nothing\n\t}",
"@Override\n public void removeListener(InvalidationListener listener) {\n }",
"public void removePainter(CanvasType.PaintListener listener)\r\n\t{\n\t}",
"public void removeTrackerListener(IXArchRelativePathTrackerListener listener) {\n listeners.remove(listener);\n }",
"public void removeDownloadListener(DownloadListener aListener) {\n\t\tmListeners.remove(aListener);\n\t}",
"public void removePropertyChangeListener(PropertyChangeListener listener);",
"private void unregisterListener() {\n mSensorManager.unregisterListener(this);\n }",
"public void unregisterListener(PPGListener listener){\n listeners.remove(listener);\n }",
"void removeListener(\n ReaderSettingsListenerType l);",
"public void detachListener()\n {\n m_localInstance.detachListener();\n }",
"void removeOutputListener(TextOutputListener o){\n observers.remove(o);\n }",
"void removeCalcValueListener(CalcValueListener l);",
"@Override\n\tpublic void hideProgress() {\n\t\tprogress.dismiss();\n\t}",
"@Override\n public void removeListener(ResourceListener listener) {\n }",
"private void unregisterListener() {\n\t\tif (!mHasStarted || mSensorManager == null) {\n\t\t\treturn;\n\t\t}\n\t\tmHasStarted = false;\n\t\tmSensorManager.unregisterListener(mAccListener);\n\t}",
"public void removeConnectedCallback(OctaveReference listener) {\n\t\tlistenerConnected.remove(listener);\n\t}",
"@Override\n public void removePropertyChangeListener(PropertyChangeListener listener) {\n\n }",
"public void removeListener(ILabelProviderListener listener) {\n\t\t\t\r\n\t\t}",
"protected void removeListeners() {\n }",
"public void removeUpdates(LocationListener listener){\n\t\tlocationListeners.remove(listener);\n\t\tif(locationListeners.size() == 0){\n\t\t\tlocyNavigatorThread.interrupt();\n\t\t\tlocyNavigator.stop();\n\t\t}\n\t}",
"public void removePropertyChangeListener(PropertyChangeListener l);",
"void removeListener( AvailabilityListener listener );",
"public void removePropertyChangeListener (PropertyChangeListener l)\n { pcs.removePropertyChangeListener (l); }",
"public void removeListener(ILabelProviderListener listener) {\n\t}",
"public void removeOnDataChangedListener(OnDataChangedListener listener) {\n dataChangedListeners.remove(listener);\n }",
"public void removeAmplitudeListener(IDualAmplitudeListener listener)\r\n {\r\n amplitudeListeners.remove(listener);\r\n }",
"public void removeONDEXListener(ONDEXListener l) {\n listeners.remove(l);\n }",
"void removeListener(MediaQueryListListener listener);",
"public void removeAnimatorListener(Listener aListener) { removeListener(Listener.class, aListener); }",
"@Override\n public void onDetach() {\n if (progressDialog != null && progressDialog.isShowing()) {\n progressDialog.dismiss();\n }\n super.onDetach();\n }",
"@Override\n\tpublic void removeGraphChangeListener(GraphChangeListener<N, ET> listener)\n\t{\n\t\tgcs.removeGraphChangeListener(listener);\n\t}",
"@Override\n\tpublic void removeActionListener(ActionListener listener) {\n\t\tlisteners.add(listener);\n\t}",
"void removeTextListener(TextListener l);",
"public void removePropertyChangeListener (PropertyChangeListener l) {\n pcs.removePropertyChangeListener (l);\n }"
] | [
"0.8414192",
"0.7565383",
"0.74170005",
"0.7215641",
"0.71316683",
"0.6801752",
"0.6751375",
"0.6702456",
"0.66282094",
"0.6606806",
"0.659767",
"0.659427",
"0.65728134",
"0.6571376",
"0.65678",
"0.6552496",
"0.65395886",
"0.6463994",
"0.6447132",
"0.6444041",
"0.6383791",
"0.63737106",
"0.63623345",
"0.63441384",
"0.6336267",
"0.63233554",
"0.6319809",
"0.63144946",
"0.63094866",
"0.63034934",
"0.6298675",
"0.6296228",
"0.6292502",
"0.6275115",
"0.62595975",
"0.62581074",
"0.62535185",
"0.6243936",
"0.62330323",
"0.6218875",
"0.6217497",
"0.6213962",
"0.62115914",
"0.62091357",
"0.61982137",
"0.61845005",
"0.61825335",
"0.6180574",
"0.616711",
"0.61663705",
"0.6164637",
"0.6161161",
"0.6160438",
"0.615952",
"0.6157619",
"0.6152121",
"0.6149686",
"0.61456144",
"0.6134252",
"0.6130465",
"0.61220425",
"0.61131287",
"0.61107755",
"0.61029065",
"0.61025673",
"0.61015964",
"0.6098251",
"0.6092431",
"0.6091958",
"0.6084041",
"0.60839546",
"0.6077495",
"0.6076913",
"0.60753375",
"0.60726136",
"0.6069945",
"0.6061191",
"0.6056025",
"0.6048568",
"0.604847",
"0.6046541",
"0.6044035",
"0.6040436",
"0.60364974",
"0.6026781",
"0.6026677",
"0.601766",
"0.60171133",
"0.6014218",
"0.60122806",
"0.60106146",
"0.60075915",
"0.59952044",
"0.5995121",
"0.5986357",
"0.59823567",
"0.5974624",
"0.5964716",
"0.59599495",
"0.5958525"
] | 0.86465645 | 0 |
/ Return as array two pairs of numbers in the array that their sum will be equal to target number sumOfTwo([1, 2, 3, 4, 5], 4) > [1, 3] sumOfTwo([7, 7, 4, 3, 8], 7) > [4, 3] sumOfTwo([13, 43, 2, 71], 84) > [13, 71] | public static int[] sumOfTwo(int[] numArr, int target) {
int[] res = new int[2];
myOuterLabel:
for (int i = 0; i < numArr.length; i++) {
for (int j = i + 1; j < numArr.length; j++) {
if (numArr[i] + numArr[j] == target) {
res[0] = numArr[i];
res[1] = numArr[j];
return res;
// break myOuterLabel;
}
}
}
return res;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int[] twoSum(int[] numbers, int target) {\n int output [] = new int [2];\n for(int i = 0; i < numbers.length; i++){\n for(int j = 0; j < numbers.length; j++){\n if(i == j) continue;\n if (numbers[i] + numbers[j] == target){\n output[0] = i+1;\n output[1] = j+1;\n return output;\n }\n }\n }\n return null;\n \n }",
"public int[] twoSum(int[] numbers, int target) {\n int pointerA = 0;\n int pointerB = numbers.length - 1;\n int[] result = new int[2];\n while (pointerA <= pointerB) {\n int sum = numbers[pointerA] + numbers[pointerB];\n if (sum > target) {\n pointerB--;\n } else if (sum < target) {\n pointerA++;\n } else { // (sum == target)\n result[0] = pointerA + 1;\n result[1] = pointerB + 1;\n return result;\n }\n }\n return result;\n }",
"public int[] twoSum(int[] numbers, int target) { // beats 99.27%\n if (numbers == null || numbers.length == 0) {\n return new int[2];\n }\n int start = 0;\n int end = numbers.length - 1;\n while (start < end) {\n if (numbers[start] + numbers[end] == target) {\n return new int[]{start + 1, end + 1};\n } else if (numbers[start] + numbers[end] > target) {\n // move end forward to the last value that numbers[end] <= target - numbers[start]\n end = largestSmallerOrLastEqual(numbers, start, end, target - numbers[start]);\n } else {\n // move start backward to the first value that numbers[start] >= target - numbers[end]\n start = smallestLargerOrFirstEqual(numbers, start, end, target - numbers[end]);\n }\n }\n return new int[2];\n }",
"private static int[] twoSum(int[] nums, int target){\n int ans[] = {0, 0};\n for (int i = 0; i < nums.length; i++){\n for (int j = i + 1; j < nums.length; j++){\n if (nums[i] + nums[j] == target){\n ans[0] = i;\n ans[1] = j;\n return ans;\n }\n }\n }\n throw new IllegalArgumentException(\"No two sum solution\");\n }",
"public int[] twoSum2(int[] numbers, int target) {\n HashMap<Integer, Integer> hm = new HashMap<>();\n int[] result = null;\n for (int i = 0; i < numbers.length; i++) {\n if (hm.containsKey(target - numbers[i])) {\n int j = hm.get(target - numbers[i]);\n if (i != j) {\n result = new int[] {j + 1, i + 1};\n return result;\n }\n }\n hm.put(numbers[i], i);\n }\n return result;\n }",
"public int[] twoSum(int[] numbers, int target) {\n\t\tHashMap<Integer, Integer> map = new HashMap<>();\n\t\t\n\t\t//go thru the array\n\t\tfor(int i = 0; i < numbers.length; i++) {\n\t\t\t//if the map contains the other number\n\t\t\tif(map.containsKey(target - numbers[i])) {\n\t\t\t\treturn new int[] { map.get(target-numbers[i]) + 1, i + 1};\n\t\t\t}\n\t\t\t//if not then put\n\t\t\tmap.put(numbers[i], i);\n\t\t}\n\t\t\n\t\tthrow new IllegalArgumentException(\"No two sum solution\");\n\t}",
"public static int[] twoSum(int[] numbers, int target) {\n // Start typing your Java solution below\n // DO NOT write main() function\n int[] aux = new int[numbers.length];\n HashMap<Integer, Integer> valueToIndex = new HashMap<Integer, Integer>();\n for (int i = 0; i < numbers.length; i++) {\n valueToIndex.put(numbers[i], i);\n aux[i] = numbers[i];\n }\n \n int i = 0, j = numbers.length - 1;\n boolean found = false;\n \n Arrays.sort(aux);\n \n while (i != j) {\n if (aux[i] + aux[j] < target) i++;\n else if (aux[i] + aux[j] > target) j--;\n else {\n found = true;\n break;\n }\n }\n \n if (!found) return null;\n \n int[] result = new int[2];\n if (aux[i] == aux[j]) { /* Handle duplicates */\n int first = -1, second = -1;\n for (int k = 0; k < numbers.length; k++) {\n if (numbers[k] == aux[i]) {\n if (first == -1) {\n first = k;\n } else if (second == -1) {\n second = k;\n break;\n }\n }\n }\n result[0] = first + 1;\n result[1] = second + 1;\n return result;\n }\n \n \n if (valueToIndex.get(aux[i]) < valueToIndex.get(aux[j])) {\n result[0] = valueToIndex.get(aux[i]) + 1;\n result[1] = valueToIndex.get(aux[j]) + 1;\n } else {\n result[0] = valueToIndex.get(aux[j]) + 1;\n result[1] = valueToIndex.get(aux[i]) + 1;\n }\n return result;\n }",
"public int[] twoSum(int[] numbers, int target) {\n\t\tint[] ans = { 0, 0 };\n\t\tint left = 0;\n\t\tint right = numbers.length - 1;\n\t\tquickSort(numbers, left, right);\n\t\twhile (left < right) {\n\t\t\tif (numbers[left] + numbers[right] == target) {\n\t\t\t\tans[0] = left + 1;\n\t\t\t\tans[1] = right + 1;\n\t\t\t\tbreak;\n\t\t\t} else if (numbers[left] + numbers[right] > target) {\n\t\t\t\tright--;\n\t\t\t} else {\n\t\t\t\tleft++;\n\t\t\t}\n\t\t}\n\t\treturn ans;\n\t}",
"public int[] twoSum(int[] numbers, int target) {\n\t\tif (numbers.length == 0) {\n\t\t\treturn null;\n\t\t}\n\t\tHashtable<Integer, Integer> hash = new Hashtable<Integer, Integer>();\n\t\tint[] result = new int[2];\n\t\tint small = 0;\n\t\tint big = 0;\n\t\tfor (int i = 0; i < numbers.length; i++) {\n\t\t\tif (!hash.containsKey(numbers[i])) {\n\t\t\t\thash.put(target - numbers[i], i);\n\t\t\t} else {\n\t\t\t\tsmall = i < hash.get(numbers[i]) ? i : hash.get(numbers[i]);\n\t\t\t\tbig = small == i ? hash.get(numbers[i]) : i;\n\n\t\t\t}\n\t\t}\n\t\tresult[0] = small + 1;\n\t\tresult[1] = big + 1;\n\t\treturn result;\n\n\t}",
"public int[] twoSum3(int[] numbers, int target) {\n int[] result = new int[2];\n for (int i = 0; i < numbers.length; i++) {\n for (int j = 1; j < numbers.length; j++) {\n if (numbers[i] + numbers[j] == target && i != j) {\n result[0] = i + 1;\n result[1] = j + 1;\n return result;\n }\n }\n }\n return result;\n }",
"public int[] twoSum(int[] numbers, int target) {\n if(numbers.length == 0){\n //empty array\n return new int[0];\n }\n HashMap<Integer,Integer> hashmapHelper = new HashMap<Integer,Integer>();\n for(int i = 0; i < numbers.length; i++){\n hashmapHelper.put(numbers[i],i+1);//put index value into hashtable\n }\n int i = 0;\n while(i<numbers.length){\n if(hashmapHelper.containsKey(target - numbers[i])){\n \n int index1 = i+1;\n int index2 = hashmapHelper.get(target - numbers[i]);\n if(index1 < index2){\n \tint[] index = {index1,index2};\n \treturn index;\n }\n else{\n int[] index = {index2,index1};\n return index;\n }\n }\n i++;\n }\n return new int[0];\n }",
"public int[] twoSum(int[] numbers, int target) {\n int left = 0, right = numbers.length - 1;\n while (left < right) {\n int sum = numbers[left] + numbers[right];\n // we need to return the index starting from 1\n if (sum == target) return new int[]{left+1,right+1};\n if (sum > target) right--;\n else left++;\n }\n return null;\n }",
"public int[] twoSum(int[] nums, int target) {\n Map<Integer, Integer> map = new HashMap<>();\n for (int a = 0; a < nums.length; a++) {\n int other = target - nums[a];\n if (map.containsKey(other)) {\n int[] solution = new int[2];\n solution[0] = map.get(other);\n solution[1] = a;\n return solution;\n }\n else {\n map.put(nums[a], a);\n }\n }\n return new int[2];\n }",
"public int[] twoSum2(int[] nums, int target) {\n int[] res = new int[2];\n int n = nums.length;\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < n; i++) {\n map.put(nums[i], i);\n }\n for (int i = 0; i < n; i++) {\n int key = target - nums[i];\n if (map.containsKey(key) && map.get(key) != i) {\n res[0] = i;\n res[1] = map.get(key);\n return res;\n }\n }\n return res;\n }",
"static public int[] twoSum(int[] nums, int target) {\n\n\t\tint[] output=new int[2];\n\t\tArrays.fill(output, -1);\n\n\t\tif(nums.length<=1)\n\t\t\treturn output;\n\n\t\tint n=nums.length;\n\t\tMap<Integer, Integer> map=new HashMap<>();\n\n\n\t\tfor(int i=0; i<n; i++)\n\t\t\tmap.put(nums[i], i);\n\n\t\tfor(int j=0; j<n; j++){\n\t\t\tint a=nums[j];\n\t\t\tif(map.containsKey(target-a)){\n\t\t\t\tif(j != map.get(target-a)){\n\t\t\t\t\toutput[0]=j;\n\t\t\t\t\toutput[1]=map.get(target-a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn output;\n\t}",
"public static int[] twoSum(int[] nums, int target) {\n for (int i = 0; i < nums.length; i++) {\n for (int j = i + 1; j < nums.length; j++) {\n if (nums[j] == target - nums[i]) {\n return new int[] { i, j };\n }\n }\n }\n throw new IllegalArgumentException(\"No two sum solution\");\n\n }",
"public static int[] twoNumberSum(int[] array, int targetSum) {\n\t\t\n\t\tHashSet<Integer> lookup = new HashSet<Integer>();\n\t\t\n\t\tfor (int j = 0; j < array.length; j++) {\n\t\t\tint cand = targetSum - array[j];\n\t\t\tif (lookup.contains(cand)) {\n\t\t\t\treturn new int[]{cand, array[j]};\n\t\t\t} else {\n\t\t\t\tlookup.add(array[j]);\n\t\t\t}\n\t\t}\n\t\t\n return new int[]{};\n }",
"public static int[] twoSumBetter(int[] numbers, int target) {\n int[] aux = new int[numbers.length];\n for (int i = 0; i < numbers.length; i++) {\n aux[i] = numbers[i];\n }\n \n int i = 0, j = numbers.length - 1;\n boolean found = false;\n \n Arrays.sort(aux);\n \n while (i != j) {\n if (aux[i] + aux[j] < target) i++;\n else if (aux[i] + aux[j] > target) j--;\n else {\n found = true;\n break;\n }\n }\n \n if (!found) return null;\n int firstTarget = aux[i], secondTarget = aux[j];\n \n int[] result = new int[2];\n boolean foundOne = false;\n int leftOver = -1;\n for (int k = 0; k < numbers.length; k++) {\n \n if (foundOne) {\n if (numbers[k] == leftOver) {\n result[1] = k + 1;\n return result;\n }\n }\n \n if (numbers[k] == firstTarget || numbers[k] == secondTarget) {\n \n foundOne = true;\n leftOver = numbers[k] == firstTarget ? secondTarget : firstTarget;\n result[0] = k + 1;\n }\n }\n \n return result;\n \n }",
"public int[] twoSumSorted(int[] numbers, int target) {\n \t\n\t\tint len = numbers.length;\n\t\tif (len < 2) \n\t\t\treturn null;\n\n\t\tint left = 0, right = len - 1;\n\t\twhile(left < right){\n\t\t\tint tmp = numbers[left] + numbers[right];\n\t\t\tif (tmp == target) {\n\t\t\t\treturn new int[] {left + 1, right + 1};\n\t\t\t} else if (tmp > target) {\n\t\t\t\tright--;\n\t\t\t} else {\n\t\t\t\tleft++;\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n \t}",
"public static int[] twoSum(int[] nums, int target) {\n HashMap<Integer, Integer> map = new HashMap<>();\n\n //initialize map with first entry of array\n int[] resultPair = {0,0};\n map.put(nums[0], 0);\n int index = 1;\n\n while (index < nums.length) {\n\n int complement = target - nums[index];\n if(map.containsKey(complement)) {\n resultPair[0] = map.get(complement);\n resultPair[1] = index;\n }\n\n map.put(nums[index], index);\n index++;\n }\n return resultPair;\n }",
"public static int[] twoNumberSum_sol2(int[] array, int targetSum) {\n\n\t\tSet<Integer> nums = new HashSet<Integer>();\n\t\tfor (int num : array) {\n\t\t\tint potentialMatch = targetSum - num;\n\t\t\tif (nums.contains(potentialMatch)) {\n\t\t\t\treturn new int[] { num, potentialMatch };\n\t\t\t} else {\n\t\t\t\tnums.add(num);\n\t\t\t}\n\t\t}\n\n\t\treturn new int[0];\n\n\t}",
"public int[] twoSum(int[] nums, int target) {\n // create a hashtable\n HashMap<Integer, Integer> hashMap = new HashMap<>();\n for (int i = 0; i < nums.length; i++) {\n // add the element plus corresponding index to the hashtable\n hashMap.put(nums[i], i);\n }\n for (int i = 0; i < nums.length; i++) {\n int compl = target - nums[i];\n // check if the complement exists in our hashtable && its value ins't the index corresponding to nums[i] i.e not a repeat of nums[i]\n if (hashMap.containsKey(compl) && hashMap.get(compl) != i) {\n return new int[] {i, hashMap.get(compl)};\n }\n }\n return new int[]{-1, -1};\n }",
"public static int[] twoSum_2(int[] example, int target) {\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < example.length; i++) {\n map.put(example[i], i);\n }\n for (int i = 0; i < example.length; i++) {\n int complement = target - example[i];\n if (map.containsKey(complement) && map.get(complement) != i) {\n return new int[]{i, map.get(complement)};\n }\n }\n throw new IllegalArgumentException(\"No two sum solution\");\n }",
"public static int[] twoSum(int[] nums, int target) {\n\t\tint[] value = { 0, 0 };\n\t\tif (nums.length > 2) {\n\n\t\t\tint[][] nums2 = Sort.bubbleSort(nums, true);\n\t\t\t// One Counter starts from one side.\n\t\t\tfor (int i = nums2.length - 1; i > 0; i--) {\n\t\t\t\t// The other from the other side with a max of i-1\n\n\t\t\t\t// If the Current Counter Loop Number is > target, then the sum\n\t\t\t\t// any other other number won't be greater than this\n\t\t\t\tif (Utils.sumCheck(target, nums2[i][0]) > 1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = checkRecursive(nums2, target, 0, i - 1, i);\n\t\t\t\t\tif (value[0] != 0 || value[1] != 0) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn value;\n\t}",
"public static void main(String[] args){\n // To hold the nums input [array]\n int nums [] = {2,7,11,15};\n // input two {1, 3, 4, 11, 15, 7, 2};\n\n // To hold target (expected sum of two nums)\n int target = 9;\n\n //To return indices which is array[0,1]\n // (If we don't print Arrays.toString we will be given garbage)\n System.out.println(Arrays.toString(twoSums(nums, target)));\n\n sumArray(nums);\n }",
"public int[] twoSum(int[] nums, int target) {\n int max = nums[0];\n int min = max;\n // get rank\n for (int e : nums) {\n if (e > max) {\n max = e;\n }\n if (e < min) {\n min = e;\n }\n }\n // show up table\n Integer[] showUpMap = new Integer[max - min + 1];\n Integer[] indicesMap = new Integer[max - min + 1];\n for (int i = 0; i < nums.length; i++) {\n showUpMap[nums[i] - min] = 1;\n indicesMap[nums[i] - min] = i;\n }\n for (int i = 0; i < showUpMap.length; i++) {\n boolean show = showUpMap[i] == 1;\n if (show) {\n int a = i + min;\n int need = target - a;\n if (showUpMap[need - min] == 1) {\n return new int[] {indicesMap[i], indicesMap[need - min]};\n }\n }\n }\n return null;\n }",
"static int [] twoSums(int [] num, int targets) {\n // Equation with variables: nums[i] + nums[j] == target (return the indices)\n // Visualize an array indices {0,1,2,3,4} my i = nums.length\n // Visualize another array J = i+1 {1,2,3,4};\n // nums [2,7,11,15];\n // NOTE: Visualize J = i + 1; When i=0, j will start at 1\n // The if statement is used to check if the condition matches the target\n\n for(int i=0; i < num.length; i++) {\n for(int j= i+1; j<num.length; j++) {\n if (num[i] + num[j] == targets){\n // return new int array because the return type is Array.toString\n return new int [] {i,j};\n }\n }\n }\n return null;\n }",
"public static void main(String[] args) {\n int nums[] = { 2, 7, 11, 15 };\n int target = 9;\n int result[] = solution.twoSum(nums, target);\n System.out.println(\"Expected: [0, 1]\");\n System.out.printf(\"Output: [%d, %d]\\n\", result[0], result[1]);\n\n int nums_1[] = { 3, 2, 4 };\n int target_1 = 6;\n int result_1[] = solution.twoSum(nums_1, target_1);\n System.out.println(\"Expected: [1, 2]\");\n System.out.printf(\"Output: [%d, %d]\\n\", result_1[0], result_1[1]);\n }",
"public int[] twoSum(int[] numbers, int target) {\n HashMap<Integer,Integer> map = new HashMap<>();\n\n for(int i = 0; i < numbers.length; i++){\n if(map.get(numbers[i]) != null){\n int[] res = {map.get(numbers[i]),i};\n return res;\n }\n map.put(target-numbers[i],i);\n }\n\n int[] res={};\n return res;\n}",
"public int[] twoSumForce(int[] nums, int target) {\n for (int i = 0; i < nums.length; i++) {\n for (int j = i + 1; j < nums.length; j++) {\n if (nums[j] == target - nums[i]) {\n return new int[] { i, j };\n }\n }\n }\n throw new IllegalArgumentException(\"No two sum solution\");\n }",
"public int[] twoSum(int[] nums, int target) {\n\t\tHashMap<Integer, Integer> tracker = new HashMap<Integer, Integer>();\n\t\tint len = nums.length;\n\n\t\tfor (int i = 0; i < len; i++) {\n\t\t\tif (tracker.containsKey(nums[i])) {\n\t\t\t\tint left = tracker.get(nums[i]);\n\t\t\t\treturn new int[] { left, i };\n\t\t\t} else {\n\t\t\t\ttracker.put(target - nums[i], i);\n\t\t\t}\n\t\t}\n\n\t\treturn new int[2];\n\t}",
"public int[] twosum(int[] nums, int target){\n for(int i = 0; i < nums.length; i++){\n for(int j = i + 1; j < nums.length; j++){\n if(nums[j] == target - nums[i]){\n return new int[]{i, j};\n }\n }\n }\n throw new IllegalArgumentException(\"no two sum solution\");\n }",
"private static int[] twoSumMap(int[] nums, int target){\n Map<Integer, Integer> map = new HashMap<>(); //the size of the map expanded as\n //the input take place\n for (int i = 0; i < nums.length; i++){\n map.put(nums[i], i);\n }\n\n for (int i = 0; i < nums.length; i++){\n int complement = target - nums[i];\n if (map.keySet().contains(complement) && map.get(complement) != i){\n return new int[] {i, map.get(complement)};\n }\n }\n\n throw new IllegalArgumentException(\"No two sum solution\");\n\n }",
"public int[] twoSum_1(int[] nums, int target) {\n Map<Integer, Integer> map = new HashMap<>();\n int[] result = new int[2];\n for (int i = 0; i < nums.length; i++) {\n if (map.containsKey(target - nums[i])) {\n result[0] = map.get(target - nums[i]);\n result[1] = i;\n return result;\n } else {\n map.put(nums[i], i);\n }\n }\n return result;\n }",
"public int[] twoSum(int[] nums, int target) {\n Map<Integer, Integer> temp = new HashMap<>();\n int sub;\n //loop the int array\n for(int i=0, len=nums.length; i<len; i++){\n //calculate the sub value\n sub = target - nums[i];\n if(temp.containsKey(sub)){ // if the map contains the sub value, then return the index value into new int array\n return new int[]{temp.get(sub), i};\n }\n //if the map not contains the sub values, then store data into map\n temp.put(nums[i], i);\n }\n return new int[]{};\n }",
"public static int[] twoSum(int[] nums, int target) {\n\n HashMap<Integer, Integer> complementsByIndex = new HashMap<>();\n for (int i = 0; i < nums.length; i++) {\n if (complementsByIndex.containsKey(nums[i])) {\n Integer complementIndex = complementsByIndex.get(nums[i]);\n return new int[]{complementIndex, i};\n } else\n complementsByIndex.put(target - nums[i], i);\n }\n\n return new int[]{};\n }",
"public static int[] twoNumberSum_sol1(int[] array, int targetSum) {\n\n\t\tfor (int i = 0; i < array.length - 1; i++) {\n\t\t\tint firstElement = array[i];\n\t\t\tfor (int j = i + 1; j < array.length; j++) {\n\t\t\t\tif (targetSum == firstElement + array[j]) {\n\t\t\t\t\treturn new int[] { firstElement, array[j] };\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn new int[0];\n\n\t}",
"public int[] twoSum(int[] nums, int target)\r\n\t{\r\n\t\t// Create a complement set to store complements\r\n\t\tMap<Integer, Integer> comp = new HashMap<>();\r\n\t\t// Loop over the array\r\n\t\tfor (int i = 0; i < nums.length; i++)\r\n\t\t{\r\n\t\t\t// Build up the complement set as you go\r\n\t\t\t\r\n\t\t\tif (comp.containsKey(nums[i]))\r\n\t\t\t{\r\n\t\t\t\t// if we find the complement again but in our array,\r\n\t\t\t\t// that means we have a solution!\r\n\t\t\t\treturn new int[] { comp.get(nums[i]), i};\r\n\t\t\t}\r\n\t\t\tcomp.put(target - nums[i], i);\r\n\t\t}\r\n\t\t// If we didn't find anything, return null array.\r\n\t\treturn new int[0];\r\n\t}",
"public int[] twoSum2(int[] nums, int target) {\n int max = nums[0];\n int min = max;\n // get rank\n for (int e : nums) {\n if (e > max) {\n max = e;\n }\n if (e < min) {\n min = e;\n }\n }\n // show up table\n Integer[] showUpMap = new Integer[max - min + 1];\n LinkedList[] indicesMap = new LinkedList[max - min + 1];\n for (int i = 0; i < nums.length; i++) {\n showUpMap[nums[i] - min] = 1;\n if (indicesMap[nums[i] - min] == null) {\n indicesMap[nums[i] - min] = new LinkedList<Integer>();\n }\n indicesMap[nums[i] - min].add(i);\n }\n System.out.println(Arrays.toString(showUpMap));\n System.out.println(Arrays.toString(indicesMap));\n for (int i = 0; i < showUpMap.length; i++) {\n boolean show = showUpMap[i] != null;\n if (show) {\n int a = i + min;\n int need = target - a;\n if (need - min < showUpMap.length &&\n showUpMap[need - min] != null) {\n int ai = (int) indicesMap[i].get(0);\n int bi = (int) indicesMap[need - min].get(0);\n if (ai == bi) {\n bi = (int) indicesMap[need - min].get(1);\n }\n return new int[]{ai, bi};\n }\n }\n }\n return null;\n }",
"public static int[] twoSum_1(int[] example, int target) {\n for (int i = 0; i < example.length; i++) {\n for (int j = i + 1; j < example.length; j++) {\n if (example[j] == target - example[i]) {\n return new int[]{i, j};\n }\n }\n }\n throw new IllegalArgumentException(\"No two sum solution\");\n }",
"public static void targetSumPair(int[] arr, int target){\n //write your code here\n Arrays.sort(arr); // O(nlogn)\n int i=0, j=arr.length-1;\n while(i < j) {\n if(arr[i]+arr[j] < target) {\n i++;\n }\n else if(arr[i] + arr[j] > target)\n j--;\n else {\n System.out.println(arr[i] + \", \" + arr[j]);\n i++; j--;\n }\n }\n }",
"public int[] twoSum(int[] num, int sum)\n {\n int[] onlyOneValidAnswer = new int[]{-1,-1};\n for(int i = 0; i < num.length; i++)\n {\n for(int j = 0; j < num.length; j++)\n {\n if(num[i] != num[j])\n {\n if((num[i] + num[j]) == sum)\n {\n onlyOneValidAnswer[0] = j;\n onlyOneValidAnswer[1] = i;\n }\n }\n }\n }\n\n return onlyOneValidAnswer;\n }",
"public static int[] twoSum3(int[] nums, int target){\n Map<Integer, Integer> map = new HashMap<>();\n\n for (int i = 0; i < nums.length; i++){\n int complement = target - nums[i];\n if (map.containsKey(complement) && map.get(complement) != i){\n return new int[] {map.get(complement), i};\n }\n map.put(nums[i], i);\n }\n\n throw new IllegalArgumentException(\"No two sum solution.\");\n\n }",
"public int[] twoSum3(int[] nums, int target) {\n int[] res = new int[2];\n int n = nums.length;\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < n; i++) {\n int key = target - nums[i];\n if (map.containsKey(key) && map.get(key) != i) {\n res[0] = map.get(key);\n res[1] = i;\n return res;\n }\n map.put(nums[i], i);\n }\n return res;\n }",
"public static List<List<Integer>> combinationSum2(int[] nums, int target) {\n List<List<Integer>> answer = new ArrayList<>();\n // Arrays.sort(nums); // return answer in sorted order\n recurseCombinationSum2(answer, new ArrayList<>(), nums, target, 0);\n return answer;\n }",
"public static void main(String[] args) {\n\n\t\tint[] inputArray={3,2,4};\n\t\tint targetSum=6;\n\n\t\tint[] result=twoSum(inputArray, targetSum);\n\n\t\tSystem.out.println(Arrays.toString(result));\n\t}",
"public int[] twoSumST(int[] nums, int target) {\n HashMap<Integer, Integer> result = new HashMap<>();\n for (int i = 0; i < nums.length; i++) {\n int complement = target - nums[i];\n if (!result.containsKey(complement)) {\n result.put(nums[i], i);\n }\n else {\n return new int[] { result.get(complement), i};\n }\n }\n throw new IllegalArgumentException(\"No solution\");\n }",
"public static void findSumArrayWithGivenSum2(int[] arr, int target) {\n\n\t\tHashMap<Integer, Integer> hm = new HashMap<>();\n\n\t\tint currSum = 0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\n\t\t\tcurrSum += arr[i];\n\n\t\t\tif (currSum == target) {\n\t\t\t\tSystem.out.println(0 + \"--\" + i);\n\t\t\t}\n\n\t\t\tif (hm.containsKey(currSum - target)) {\n\t\t\t\tSystem.out.println((hm.get(currSum - target) + 1) + \"--\" + i);\n\t\t\t}\n\n\t\t\thm.put(currSum, i);\n\t\t}\n\t}",
"public static ArrayList<int[]> pairsThatEqualSum(int[] inputArray, int targetSum) {\n\t\tArrays.sort(inputArray);\n\t\tint start = 0;\n\t\tint end = inputArray.length - 1;\n\t\tArrayList<int[]> arr = new ArrayList<>();\n\t\twhile (start < end) {\n\t\t\tif (inputArray[start] + inputArray[end] == targetSum) {\n\t\t\t\tint[] array = { start, end };\n\t\t\t\tarr.add(array);\n\t\t\t\tstart++;\n\t\t\t\tend--;\n\t\t\t}\n\t\t\tif (inputArray[start] + inputArray[end] < targetSum) {\n\t\t\t\tstart++;\n\t\t\t} else if (inputArray[start] + inputArray[end] > targetSum) {\n\t\t\t\tend--;\n\t\t\t}\n\n\t\t}\n\t\treturn arr;\n\t}",
"public ArrayList<ArrayList<Integer>> fourSum(int[] num, int target) {\n //Create the dictionary of sum and list of pairs of indexes\n HashMap<Integer, ArrayList<ArrayList<Integer>>> dict = new HashMap<>();\n for (int i = 0; i < num.length - 1; i++) {\n for (int j = i + 1; j < num.length; j++) {\n int sum = num[i] + num[j];\n ArrayList<Integer> pair = new ArrayList<>();\n pair.add(i);\n pair.add(j);\n if (!dict.containsKey(sum)) {\n ArrayList<ArrayList<Integer>> value = new ArrayList<ArrayList<Integer>>();\n value.add(pair);\n dict.put(sum, value);\n } else {\n ArrayList<ArrayList<Integer>> value = dict.get(sum);\n value.add(pair);\n }\n }\n }\n //Use HashSet to prevent duplicate result.\n HashSet<ArrayList<Integer>> set = new HashSet<>();\n for (Integer sumA : dict.keySet()) {\n if (dict.containsKey(target - sumA)) {\n \n ArrayList<ArrayList<Integer>> pairsA = dict.get(sumA);\n ArrayList<ArrayList<Integer>> pairsB = dict.get(target - sumA);\n \n \n for (ArrayList<Integer> pair1 : pairsA) {\n for (ArrayList<Integer> pair2 : pairsB) {\n \n //Make sure there is no same element in two pairs.\n if (pair1.contains(pair2.get(0)) || pair1.contains(pair2.get(1)))\n continue;\n \n ArrayList<Integer> tmpResult = new ArrayList<>(4);\n tmpResult.add(num[pair1.get(0)]);\n tmpResult.add(num[pair1.get(1)]);\n tmpResult.add(num[pair2.get(0)]);\n tmpResult.add(num[pair2.get(1)]);\n //Sort the list and add it into the set.\n Collections.sort(tmpResult);\n set.add(tmpResult);\n }\n }\n }\n }\n ArrayList<ArrayList<Integer>> ret = new ArrayList<ArrayList<Integer>>();\n ret.addAll(set); // from hashset to arraylist \n return ret;\n }",
"public int[] twoSum1(int[] nums, int target)\n\t{\n\t\tMap<Integer, Integer> map = new HashMap<>();\n\t\tfor(int i = 0 ; i< nums.length ; i++)\n\t\t{\n\t\t\tint compliment = target - nums[i];\n\t\t\tif(map.containsKey(compliment))\n\t\t\t{\n\t\t\t\treturn new int[] {map.get(compliment),i};\n\t\t\t}\n\t\t\t\n\t\t\tmap.put(nums[i], i);\n\t\t}\n\t\t\n\t\t\n\t\treturn null;\n\t}",
"private void twoSum(int[] nums, int i, int j, int target) {\n while(i < j) {\n \n int diff = nums[i] + nums[j] - target;\n if(Math.abs(minDiff) > Math.abs(diff)) {\n minDiff = diff;\n }\n \n if(diff == 0) {\n break;\n } else if (diff > 0) {\n j--;\n } else {\n i++;\n }\n }\n }",
"public static void main(String[] args) {\n List<Integer> nums1 = Arrays.asList(1,2,2);\n List<Integer> nums2 = Arrays.asList(2,2);\n\n List<int[]> pairs = nums1.stream().flatMap(\n i-> nums2.stream().map(j -> new int[] {i,j})\n ).collect(Collectors.toList());\n\n pairs.stream().map(Arrays::toString).forEach(System.out::println);\n System.out.println(\"*********************************************\");\n //return only pairs whose sum is divisible by 3\n List<int[]> pairs2 = nums1.stream().flatMap(\n i-> nums2.stream().filter(j -> (i+j)%3==0)\n .map(j -> new int[]{i,j})\n ).collect(Collectors.toList());\n pairs2.stream().map(Arrays::toString).forEach(System.out::println);\n System.out.println(\"*********************************************\");\n //return pairs whose sum is equal to 6\n List<int []> pairs3 = nums1.stream().flatMap(\n i -> nums2.stream().filter(j -> (i+j)==4).map(j -> new int[]{i,j})\n ).collect(Collectors.toList());\n pairs3.stream().map(Arrays::toString).forEach(System.out::println);\n }",
"public int twoSumSmaller(int[] array, int target) {\n if (array == null || array.length == 0) {\n return 0;\n }\n Arrays.sort(array);\n int left = 0;\n int right = array.length - 1;\n int count = 0;\n\n while (left < right) {\n int sum = array[left] + array[right];\n if (sum < target) {\n // all the pair that right in the range (left, right]\n // will be smaller than target\n count += right - left;\n left++;\n } else {\n right--;\n }\n }\n return count;\n }",
"public static int[] twoNumberSum_sol3(int[] array, int targetSum) {\n\n\t\tArrays.sort(array);\n\t\tint left = 0;\n\t\tint right = array.length - 1;\n\t\t\n\t\twhile (left < right) {\n\t\t\tint currentSum = array[left] + array[right];\n\t\t\t\n\t\t\tif (currentSum == targetSum) {\n\t\t\t\treturn new int[] { array[left], array[right] };\n\t\t\t} else if (currentSum < targetSum) {\n\t\t\t\tleft++;\n\t\t\t} else if (currentSum > targetSum) {\n\t\t\t\tright--;\n\t\t\t}\n\n\t\t}\n\n\t\treturn new int[0];\n\n\t}",
"public int[] twoSumOneHash(int[] nums, int target) {\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < nums.length; i++) {\n int complement = target - nums[i];\n if (map.containsKey(complement)) {\n return new int[] { map.get(complement), i };\n }\n map.put(nums[i], i);\n }\n throw new IllegalArgumentException(\"No two sum solution\");\n }",
"private static int pairwise(int[] input, int target) {\n\n Set<Integer> set = new HashSet<>();\n int indicesSum = 0;\n for(int i = 0; i < input.length; i++) {\n for(int j = i+1; j < input.length; j++) {\n if(isUseful(input, target, set, i, j)) {\n indicesSum += i + j;\n set.add(i);\n set.add(j);\n }\n }\n }\n return indicesSum;\n }",
"public ArrayList<Integer> twoSum(final List<Integer> A, int B) {\n HashMap<Integer, List<Integer>> hm = new HashMap<>();\n ArrayList<Integer> solution = new ArrayList<Integer>();\n int smallestIndex2 = A.size() - 1;\n int smallestIndex1 = A.size() - 1;\n boolean containsPair = false;\n \n for (int i = 0; i < A.size(); i++) {\n if (hm.containsKey(A.get(i))) {\n List<Integer> entry = hm.get(A.get(i));\n entry.add(i);\n hm.put(A.get(i), entry);\n } else {\n List<Integer> entry = new ArrayList<>();\n entry.add(i);\n hm.put(A.get(i), entry);\n }\n }\n \n for (Map.Entry<Integer, List<Integer>> entry : hm.entrySet()) {\n int number = entry.getKey();\n List<Integer> list = entry.getValue();\n int desiredNum = B - number;\n \n if (hm.containsKey(desiredNum)) {\n List<Integer> desiredList = hm.get(desiredNum);\n Collections.sort(desiredList); // grab minimum indices\n Collections.sort(list);\n \n int desIndex = desiredList.get(0);\n int listIndex = list.get(0);\n \n if (list.size() == 1 && number*2 == B) {\n continue;\n } else {\n if (desIndex == listIndex) { // if both refer to the same index\n desIndex = desiredList.get(1);\n }\n }\n \n if (desIndex > listIndex) {\n if (desIndex < smallestIndex2) {\n smallestIndex2 = desIndex;\n smallestIndex1 = listIndex;\n } else if (desIndex == smallestIndex2) {\n if (listIndex < smallestIndex1) {\n smallestIndex1 = listIndex;\n smallestIndex2 = desIndex;\n }\n }\n } else {\n if (listIndex < smallestIndex2) {\n smallestIndex2 = listIndex;\n smallestIndex1 = desIndex;\n } else if (listIndex == smallestIndex2) {\n if (desIndex < smallestIndex1) {\n smallestIndex1 = desIndex;\n smallestIndex2 = listIndex;\n }\n }\n }\n \n containsPair = true;\n }\n }\n \n if (containsPair) {\n solution.add(smallestIndex1 + 1);\n solution.add(smallestIndex2 + 1);\n }\n \n return solution;\n }",
"public static void main(String[] args) {\n\t\tint[] nums = {2, 7, 11, 15};\n\t\tint target = 9;\n\t\t\n\t\tSystem.out.println(Arrays.toString(twoSum(nums, target)));\n\t}",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tint n =scan.nextInt();\r\n\t\tint[] nums = new int[n];\r\n\t\tfor(int i=0;i<n;i++){\r\n\t\t\tnums[i] =scan.nextInt();\r\n\t\t}\r\n\t\tSystem.out.println(\"Enter Target Value..:\");\r\n\t\tint target = scan.nextInt();\r\n\t\tint[] result = twoSum(nums, target);\r\n\t\tfor(int k=0;k<result.length;k++){\r\n\t\tSystem.out.println(result[k]); }\r\n\t}",
"private static int[] getPairUsingHasing(int[] arr, int target) {\n Set<Integer> hashSet = new HashSet<>();\n int[] result = new int[2];\n for(int ele : arr) {\n if(hashSet.contains(target-ele)) {\n result[0] = ele;\n result[1] = target - ele;\n } else hashSet.add(ele);\n\n }\n return result;\n }",
"public static int[] sum2(int[] nums,int target){\n\t\tHashMap<Integer,Integer> a=new HashMap<Integer,Integer>();\n\t\tfor(int i=0;i<nums.length;i++){\n\t\t\tif(a.get(nums[i])==null){\n\t\t\t\ta.put(target-nums[i], i);\n\t\t\t}else{\n\t\t\t\treturn new int[]{a.get(nums[i]),i};\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn new int[]{-1,-1};\n\t}",
"public static int[] twoSum_3(int[] example, int target) {\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < example.length; i++) {\n int complement = target - example[i];\n if (map.containsKey(complement)) {\n return new int[]{map.get(complement), i};\n }\n map.put(example[i], i);\n }\n throw new IllegalArgumentException(\"No two sum solution\");\n }",
"public static int TwoSum_bruteForce(int[] a,int lo, int hi, int x)\r\n\t{\r\n\t\tint count = 0;\r\n\t\tfor (int i = lo; i < hi; ++i)\r\n\t\t{\r\n\t\t\tfor (int j = i+1; j < a.length; ++j)\r\n\t\t\t{\r\n\t\t\t\tif (a[i]+a[j] == x)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Pair: (\" + a[i] + \",\" + a[j] + \")\");\r\n\t\t\t\t\t++count;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}",
"static boolean sumOfTwo(int[] a, int[] b, int v) {\r\n for (int i = 0; i < a.length; i++) {\r\n for (int j = 0; j < b.length; j++) {\r\n if (a[i] + b[j] == v) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }",
"public static int[] twoNumbersAddToN(int[] arr, int n){\n\n int[] result = new int[2];\n int pointerA = 0, pointerB = 0;\n\n while(pointerB < arr.length && pointerA < arr.length){\n if(arr[pointerA] + arr[pointerB] == n && pointerA != pointerB){\n break;\n }\n if(pointerB == arr.length-1){\n pointerA++;\n pointerB = pointerA;\n }else {\n pointerB++;\n }\n }\n\n if(arr[pointerA] + arr[pointerB] != n){\n return result;\n }\n\n result[0] = arr[pointerA];\n result[1] = arr[pointerB];\n\n return result;\n }",
"@Test\n public void pairNumbers_passTwoListsNumbers_returnListOfPairs() {\n List<int[]> output = Java8Streams.pairNumbers(new ArrayList<>(Arrays.asList(1, 2, 3)), new ArrayList<>(Arrays.asList(3, 4)));\n assertThat(output).containsExactly(new int[]{1, 3}, new int[]{1, 4}, new int[]{2, 3}, new int[]{2, 4}, new int[]{3, 3}, new int[]{3, 4});\n }",
"public static int sumOfTwoLargestElements2(int[] a) {\n int firstNum = Integer.MIN_VALUE;\n int secondNum = Integer.MIN_VALUE;\n int thirdNum = Integer.MIN_VALUE;\n for (int num : a){\n if(num>firstNum){\n secondNum = firstNum;\n thirdNum = secondNum;\n firstNum = num;\n }else if (num>secondNum){\n thirdNum = secondNum;\n secondNum = num;\n }else if(num>thirdNum){\n thirdNum =num;\n }\n }\n return firstNum+secondNum+thirdNum;\n }",
"public static int findSumOfTwoNumbers(int[] input, int numToFind)\n {\n return 0;\n }",
"static void findTwoSum(List<List<Integer>> list, int[] nums, int k) {\n \tint target = 0 - nums[k]; // 7 -> check a + b = 7 (target)\n int fi = 0;\n int la = k - 1;\n\n while (fi < la) {\n if (nums[fi] + nums[la] == target) {\n list.add(Arrays.asList(nums[fi], nums[la], nums[k]));\n while (fi < nums.length - 1 && nums[fi] == nums[fi + 1]) {\n \tfi++;\n }\n fi++;\n }\n else if (nums[fi] + nums[la] < target)\n fi++;\n else\n la--;\n }\n }",
"private static int[] getPairUsingSorting(int[] arr, int target) {\n Arrays.sort(arr);\n int low = 0;\n int high = arr.length-1;\n int[] result = new int[2];\n while(low <= high) {\n if(arr[low] + arr[high] == target) {\n result[0] = arr[low++];\n result[1] = arr[high--];\n } else if(arr[low] + arr[high] > target) {\n high--;\n } else {\n low++;\n }\n }\n return result;\n }",
"public List<List<Integer>> foursum(int[] nums, int target) {\n List<List<Integer>> result = new ArrayList<>();\n if(nums == null || nums.length < 4) {\n return result;\n }\n Arrays.sort(nums);\n for(int idx1=0; idx1<nums.length-3; idx1++) {\n if(idx1 != 0 && nums[idx1] == nums[idx1-1]) {continue;}\n for(int idx2=idx1+1; idx2 < nums.length -2; idx2++) {\n if(idx2 != idx1+1 && nums[idx2] == nums[idx2-1]) {continue;}\n int lp=idx2+1, rp = nums.length-1;\n while(lp < rp) {\n int sum = nums[idx1] + nums[idx2] + nums[lp] + nums[rp];\n if(sum == target) {\n result.add(Arrays.asList(nums[idx1],nums[idx2],nums[lp],nums[rp]));\n lp++; rp--;\n while(lp < rp && (nums[lp] == nums[lp-1])) {lp++;}\n while(lp < rp && (nums[rp] == nums[rp+1])) {rp--;}\n } else if(sum < target) {\n lp++;\n } else {\n rp--;\n }\n }\n }\n }\n return result;\n }",
"public static void twoSumForFourSum(int[] nums, int target, int low, int high, ArrayList<List<Integer>> fourSumList,\n int z1, int z2) {\n\n if (low >= high)\n return;\n\n if (2 * nums[low] > target || 2 * nums[high] < target)\n return;\n\n int i = low, j = high, sum, x;\n while (i < j) {\n sum = nums[i] + nums[j];\n if (sum == target) {\n fourSumList.add(Arrays.asList(z1, z2, nums[i], nums[j]));\n\n x = nums[i];\n while (++i < j && x == nums[i]) // avoid duplicate\n ;\n x = nums[j];\n while (i < --j && x == nums[j]) // avoid duplicate\n ;\n }\n if (sum < target)\n i++;\n if (sum > target)\n j--;\n }\n return;\n}",
"public static int TwoSum_scan(int[] a, int lo, int hi, int x)\r\n\t{\r\n\t\tint count = 0;\r\n\t\tArrays.sort(a);\r\n\t\tfor (int i = lo, j = hi-1; i < j ; )\r\n\t\t{\r\n\t\t\tif (a[i] + a[j] == x)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Pair: (\" + a[i] + \",\" + a[j] + \")\");\r\n\t\t\t\t++i;\r\n\t\t\t\t--j;\r\n\t\t\t\t++count;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (a[i] + a[j] > x)\r\n\t\t\t{\r\n\t\t\t\t--j;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (a[i] + a[j] < x)\r\n\t\t\t{\r\n\t\t\t\t++i;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}",
"public static int sumOfTwoLargestElements(int[] a) {\n int firstNum = Integer.MIN_VALUE;\n int secondNum = Integer.MIN_VALUE;\n\n\n for (int i = 0; i < a.length; i++) {\n if(firstNum==a[i])continue;\n if (firstNum < a[i]) {\n secondNum = firstNum;\n firstNum = a[i];\n } else if (secondNum < a[i]) {\n secondNum = a[i];\n }\n }\n return firstNum + secondNum;\n }",
"static int[] find2(int a[]){\r\n int sum = a[0];\r\n int pro = a[0];\r\n for(int i=1;i<a.length;i++){\r\n sum += a[i];\r\n pro += a[i]*a[i];\r\n }\r\n int s = (n*(n+1))/2 - sum;\r\n int p = (n*(n+1)*(2*n+1))/6 - pro;\r\n return solveSP(s, p);\r\n }",
"public static List<List<Integer>> combinationSum2(int[] candidates, int target) {\n Arrays.sort(candidates);\n List<List<List<Integer>>> dp = new ArrayList<>();\n Map<Integer, Integer> candMap = new HashMap<>();\n for (int i = 0; i < candidates.length; i++) {\n if (candidates[i] > target) break;\n if(candMap.containsKey(candidates[i])) candMap.put(candidates[i], candMap.get(candidates[i]) + 1);\n else candMap.put(candidates[i], 1);\n }\n for (int i = 1; i <= target; i++) {\n Set<List<Integer>> subCand = new HashSet<>();\n for (int j = 0; j < candidates.length && candidates[j] <= i; j++) {\n if (candidates[j] == i) subCand.add(Arrays.asList(i));\n else for (List<Integer> l : dp.get(i - 1 - candidates[j])) {\n if (candidates[j] <= l.get(0)) {\n List<Integer> cl = new ArrayList<>();\n cl.add(candidates[j]);\n cl.addAll(l);\n int cnt = 1;\n for (int a : l) {\n if(a == candidates[j]) cnt++;\n else break;\n }\n if(cnt <= candMap.get(candidates[j])) subCand.add(cl);\n }\n }\n }\n List<List<Integer>> subCandList = new ArrayList<>();\n subCandList.addAll(subCand);\n dp.add(subCandList);\n }\n return dp.get(target - 1);\n }",
"public static void main(String[] args) {\n\t\tint[] nums = {3,3,3};\n\t\tint target = 6;\n\t\tint[] resultArr = new TwoSum().twoSumImpl(nums, target);\n\t\t\tfor(int intVal : resultArr) {\n\t\t\t\tSystem.out.println(intVal);\n\t\t\t}\n\t\t\n\t}",
"public int arrayPairSum(int[] nums) {\n\t Arrays.sort(nums);\n\t int sum = 0;\n\t for (int i=0; i+1<nums.length; i += 2) {\n\t sum += nums[i];\n\t }\n\t return sum;\n\t }",
"public static void pairSum(int[] input, int x){\n \tint n = input.length;\n\t\tint a, b;\n\t\tfor (int i = 0; i < n - 1; i++) { \n\t\t\tfor (int j = i + 1; j < n; j++) { \n\t\t\t\tif (input[i] + input[j] == x) {\n\t\t\t\t\tif(input[j] < input[i]) {\n\t\t\t\t\t\ta = input[j];\n\t\t\t\t\t\tb = input[i];\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ta = input[i];\n\t\t\t\t\t\tb = input[j];\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(a + \" \" + b); \n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t\t\n\t}",
"public static Optional<Pair<Integer, Integer>> twoPointers(List<Integer> sorted, int targetSum) {\n return twoPointers(sorted, targetSum, 0, sorted.size() - 1);\n }",
"protected static void printPairsEqualToSum(int[] arr1, int[] arr2, int sum) {\n\t\t\r\n\t\tint count = 0; \r\n\t \r\n\t\t// creating an arraylist from first array to use the contains() method\r\n\t ArrayList<Integer> as = new ArrayList<Integer>(); \r\n\t \r\n\t // insert all the elements \r\n\t // of 1st array in the arraylist \r\n\t // table(unordered_set 'as') \r\n\t for (int i = 0; i < arr1.length; i++) {\r\n\t as.add(arr1[i]); \r\n\t }\r\n\t // for each element of arr2[] \r\n\t for (int j = 0; j < arr2.length; j++) {\r\n\t \r\n\t // find all cases where(x - arr2[j]) in 'as' \r\n\t if (as.contains(sum - arr2[j])) { // if pair element is found in array 1\r\n\t for (int k: as) { // repeat print for duplicate entries in the arraylist as\r\n\t \tif (k == sum - arr2[j]) { \r\n\t \tcount++; \r\n\t \tSystem.out.println(\"[\"+ (sum-arr2[j]) + \",\" + arr2[j] + \"]\"); //display in paired form\r\n\t \t}\r\n\t }\r\n\t }\r\n\t }\r\n\t \r\n\t if (count == 0) { // if no combos are found\r\n\t \tSystem.out.println(\"No pairs found.\");\r\n\t }\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\nint[] array1 = {5,2,8,23,14};\nint[] array2 = {67,32,7,4,61};\nint add = array1[0];\nint [] second = new int [5];\nfor(int i = 0; i<=second.length-1;i++) {\n\tsecond[i] = (array1[i] + array2[i]);\n\tSystem.out.println(second[i]);\n\t}\n}",
"public List<List<Integer>> fourSum_optimization(int[] nums, int target) {\n int len = nums.length;\n Arrays.sort(nums);\n if (len < 4)\n return Collections.emptyList();\n List<List<Integer>> arr = new ArrayList<>();\n\n for (int i = 0; i < len - 1; i++) {\n for (int j = i + 1; j < len - 1; j++) {\n int Left = j + 1;\n int Right = len - 1;\n int left_target_sum = target - nums[i] + nums[j];\n\n while (Left < Right) {\n int two_sum = nums[Left] + nums[Right];\n if (two_sum < left_target_sum)\n Left++;\n else if (two_sum > left_target_sum)\n Right--;\n else {\n List<Integer> arr2 = new ArrayList<>();\n if (left_target_sum + two_sum == target) {\n arr2.add(nums[i]);\n arr2.add(nums[j]);\n arr2.add(nums[Left]);\n arr2.add(nums[Right]);\n arr.add(arr2);\n }\n while (Left < Right && nums[Left] == arr2.get(2))\n ++Left;\n while (Left < Right && nums[Right] == arr2.get(3))\n --Right;\n }\n }\n while (i + 1 < len && nums[i + 1] == nums[i])\n ++i;\n while (j + 1 < len && nums[j + 1] == nums[j])\n ++j;\n }\n }\n\n return arr;\n }",
"public ArrayList<ArrayList<Integer>> fourSum(int[] num, int target) {\n\t\tint n = num.length;\n\t\tArrays.sort(num);\n\t\tSet<String> set = new HashSet<String>();\n\t\tfor (int i = 0; i < n - 3; i++) {\n\t\t\tfor (int j = i + 1; j < n - 2; j++) {\n\t\t\t\tint expect = target - num[i] - num[j];\n\t\t\t\tint l = j + 1;\n\t\t\t\tint r = n - 1;\n\t\t\t\twhile (l < r) {\n\t\t\t\t\tint tmp = num[l] + num[r];\n\t\t\t\t\tif (tmp == expect) {\n\t\t\t\t\t\tset.add(String.valueOf(num[i]) + \"|\"\n\t\t\t\t\t\t\t\t+ String.valueOf(num[j])\n\t\t\t\t\t\t\t\t+ \"|\"\n\t\t\t\t\t\t\t\t+ String.valueOf(num[l])\n\t\t\t\t\t\t\t\t+ \"|\"\n\t\t\t\t\t\t\t\t+ String.valueOf(num[r]));\n\t\t\t\t\t\tl++;\n\t\t\t\t\t\tr--;\n\t\t\t\t\t} else if (tmp < expect) {\n\t\t\t\t\t\tl++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tr--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tArrayList<ArrayList<Integer>> array = new ArrayList<ArrayList<Integer>>();\n\t\tfor (String s : set) {\n\t\t\tString[] arr = s.split(\"\\\\|\");\n\t\t\tArrayList<Integer> tmp = new ArrayList<Integer>();\n\t\t\tfor (int i = 0; i < 4; i++) {\n\t\t\t\ttmp.add(Integer.parseInt(arr[i]));\n\t\t\t}\n\t\t\tarray.add(tmp);\n\t\t}\n\t\treturn array;\n\t}",
"public static void main(String[] args) {\n\t\tList<List<Integer>> res = combinationSum2(new int[]{1,1,2,2,4,5,5,6,7,8,9}, 17);\n\t\t//expected:<[[8, 9], [1, 7, 9], [2, 6, 9], [2, 7, 8], [4, 5, 8], [4, 6, 7], [5, 5, 7], \n\t\t//[1, 1, 6, 9], [1, 1, 7, 8], [1, 2, 5, 9], [1, 2, 6, 8], [1, 4, 5, 7], [1, 5, 5, 6], \n\t\t//[2, 2, 4, 9], [2, 2, 5, 8], [2, 2, 6, 7], [2, 4, 5, 6], [1, 1, 2, 4, 9], [1, 1, 2, 5, 8], \n\t\t//[1, 1, 2, 6, 7], [1, 1, 4, 5, 6], [1, 2, 2, 4, 8], [1, 2, 2, 5, 7], [1, 2, 4, 5, 5], [1, 1, 2, 2, 4, 7], \n\t\t//[1, 1, 2, 2, 5, 6]]>\n\t\t//but was:\n\t\tfor (int i = 0; i < res.size(); i++) {\n\t\t\tfor (int num : res.get(i)) {\n\t\t\t\tSystem.out.print(num + \", \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"public ArrayList<ArrayList<Integer>> fourSum(int[] num, int target) {\n ArrayList<ArrayList<Integer>> rst = new ArrayList<ArrayList<Integer>>();\n Arrays.sort(num);\n \n for (int i = 0; i < num.length - 3; i++) {\n if (i != 0 && num[i] == num[i - 1]) {\n continue;\n }\n \n for (int j = i + 1; j < num.length - 2; j++) {\n if (j != i + 1 && num[j] == num[j - 1])\n continue;\n \n int left = j + 1;\n int right = num.length - 1;\n while (left < right) {\n int sum = num[i] + num[j] + num[left] + num[right];\n if (sum < target) {\n left++;\n } else if (sum > target) {\n right--;\n } else {\n ArrayList<Integer> tmp = new ArrayList<Integer>();\n tmp.add(num[i]);\n tmp.add(num[j]);\n tmp.add(num[left]);\n tmp.add(num[right]);\n rst.add(tmp);\n left++;\n right--;\n while (left < right && num[left] == num[left - 1]) {\n left++;\n }\n while (left < right && num[right] == num[right + 1]) {\n right--;\n }\n }\n }\n }\n }\n \n return rst;\n }",
"public static void main(String[] args) {\n TwoPointers tp = new TwoPointers();\n int[] x = tp.threeSumSorted(new int[] {1, 2, 4, 5, 12}, 19);\n for (int i : x) System.out.println(i);\n int[] y = tp.sqEach(new int[] {-4, -3, 1, 2, 3});\n for (int i : y) System.out.println(i);\n }",
"public static void main(String[] args) {\n\n\t\tint[] nums= {2,7,11,15};\n\t\tint target = 9;\n\t\tint[] output = twoSum(nums,target);\n\t\tfor(int i:output) {\n\t\t\tSystem.out.print(i + \" \");\n\t\t\t\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t}",
"public static void main(String[] args) {\n\n\t\tint[] nums = { 2, 7, 11, 15 };\n\t\tint target = 26;\n\n\t\tSolution01 solution01 = new Solution01();\n\t\tint[] answer=solution01.twoSum(nums, target);\n\t\tSystem.out.println(Arrays.toString(answer));\n\n\t}",
"public static void main(String[] args) {\n int[] nums = {3,2,4};\n solution s = new solution();\n System.out.println(Arrays.toString(s.twoSum(nums,6)));\n }",
"private int numOfPairs(int[] nums, int start, int end, int target){\n int res = 0;\n while(start < end){\n int sum = nums[start] + nums[end];\n if(sum < target){\n res += end - start;\n start++;\n }\n else{\n end--;\n }\n }\n return res;\n }",
"public void twoSumForFourSum(int[] nums, int target, int low, int high, ArrayList<List<Integer>> fourSumList,\n\t\t\tint z1, int z2) {\n\n\t\tif (low >= high)\n\t\t\treturn;\n\n\t\tif (2 * nums[low] > target || 2 * nums[high] < target)\n\t\t\treturn;\n\n\t\tint i = low, j = high, sum, x;\n\t\twhile (i < j) {\n\t\t\tsum = nums[i] + nums[j];\n\t\t\tif (sum == target) {\n\t\t\t\tfourSumList.add(Arrays.asList(z1, z2, nums[i], nums[j]));\n\n\t\t\t\tx = nums[i];\n\t\t\t\twhile (++i < j && x == nums[i]) // avoid duplicate\n\t\t\t\t\t;\n\t\t\t\tx = nums[j];\n\t\t\t\twhile (i < --j && x == nums[j]) // avoid duplicate\n\t\t\t\t\t;\n\t\t\t}\n\t\t\tif (sum < target)\n\t\t\t\ti++;\n\t\t\tif (sum > target)\n\t\t\t\tj--;\n\t\t}\n\t\treturn;\n\t}",
"public void twoSumForFourSum(int[] nums, int target, int low, int high, ArrayList<List<Integer>> fourSumList,\n\t\t\tint z1, int z2) {\n\n\t\tif (low >= high)\n\t\t\treturn;\n\n\t\tif (2 * nums[low] > target || 2 * nums[high] < target)\n\t\t\treturn;\n\n\t\tint i = low, j = high, sum, x;\n\t\twhile (i < j) {\n\t\t\tsum = nums[i] + nums[j];\n\t\t\tif (sum == target) {\n\t\t\t\tfourSumList.add(Arrays.asList(z1, z2, nums[i], nums[j]));\n\n\t\t\t\tx = nums[i];\n\t\t\t\twhile (++i < j && x == nums[i]) // avoid duplicate\n\t\t\t\t\t;\n\t\t\t\tx = nums[j];\n\t\t\t\twhile (i < --j && x == nums[j]) // avoid duplicate\n\t\t\t\t\t;\n\t\t\t}\n\t\t\tif (sum < target)\n\t\t\t\ti++;\n\t\t\tif (sum > target)\n\t\t\t\tj--;\n\t\t}\n\t\treturn;\n\t}",
"public List<List<Integer>> fourSum(int[] nums, int target) {\n HashSet<List<Integer>> set = new HashSet<>();\n Arrays.sort(nums);\n if (nums.length < 4)\n Collections.emptyList();\n for (int i = 0; i < nums.length - 1; i++) {\n for (int j = i + 1; j < nums.length - 1; j++) {\n\n int mid = j + 1;\n int high = nums.length - 1;\n\n while (mid < high) {\n int sum = nums[i] + nums[j] + nums[mid] + nums[high];\n if (sum == target) {\n List<Integer> arr2 = new ArrayList<>();\n arr2.add(nums[i]);\n arr2.add(nums[j]);\n arr2.add(nums[mid]);\n arr2.add(nums[high]);\n set.add(arr2);\n }\n if (sum < target)\n mid++;\n else\n high--;\n }\n }\n\n }\n // return new ArrayList(set);\n return Collections.emptyList();\n }",
"public static IntArrayStack[] returnTwo(){\n\t\t\n\t\t\n\t\tIntArrayStack output1 = new IntArrayStack(10);\n\t\tIntArrayStack output2 = new IntArrayStack(10);\n\t\t\n\t\toutput1.push(10);\n\t\toutput1.push(20);\n\t\t\n\t\toutput2.push(30);\n\t\toutput2.push(40);\n\t\t\n\t\tIntArrayStack[] output = new IntArrayStack[2];\n\t\toutput[0] = output1;\n\t\toutput[1] = output2;\n\t\t\n\t\treturn output;\n\t\t\n\t}",
"public List<List<Integer>> combinationSum2(int[] candidates, int target) {\n Arrays.sort(candidates);\n List<List<Integer>> result = new ArrayList<>();\n List<Integer> current = new ArrayList<>();\n dfs2(candidates ,target, 0 ,0, current , result);\n return result;\n }",
"private boolean checkTwoSum(List<Integer> a, int twoSum, int start) {\n\t\t\n\t\tfor (int i = start, j = a.size() - 1; i <=j;) {\n\t\t\tif (a.get(i) + a.get(i) == twoSum || \n\t\t\t\ta.get(j) + a.get(j) == twoSum ||\n\t\t\t\ta.get(i) + a.get(j) == twoSum) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif (a.get(i) + a.get(j) > twoSum) {\n\t\t\t\t\tj--;\n\t\t\t\t} else if (a.get(i) + a.get(j) < twoSum) {\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public List<List<Integer>> fourSum(int[] nums, int target) {\n Arrays.sort(nums); // sort\n List<List<Integer>> res = new ArrayList<>();\n if (nums.length < 4) return res;\n\n for (int i = 0; i < nums.length - 3; i++) {\n if (i == 0 || (i > 0 && nums[i] != nums[i - 1])) { // dedupe\n int sum1 = target - nums[i];\n for (int j = i + 1; j < nums.length - 2; j++) {\n if (j == i + 1 || (j > i + 1 && nums[j] != nums[j - 1])) {\n int newTarget = sum1;\n int left = j + 1, right = nums.length - 1, sum2 = newTarget - nums[j];\n while (left < right) {\n if (nums[left] + nums[right] == sum2) {\n res.add(new ArrayList<>(Arrays.asList(nums[i],\n nums[j], nums[left], nums[right])));\n\n while (left < right && nums[left] == nums[left + 1])\n left++; // dedupe\n while (left < right && nums[right] == nums[right - 1])\n right--; // dedupe\n\n left++; right--;\n }\n else if (nums[left] + nums[right] < sum2)\n left++;\n else right--;\n }\n }\n }\n }\n }\n return res;\n }",
"public List<List<Integer>> threeSum2(int[] nums) {\n Arrays.sort(nums);\n\n List<List<Integer>> result = new ArrayList<>();\n for (int i = 0; i < nums.length - 2; i++) {\n if (i > 0 && nums[i - 1] == nums[i]) { // Common trick to bypass duplicate. Better than a nested while loop!\n continue; // But it's quite annoying to bypass in nested loop. eg.[-2,0,0,2,2]\n }\n int target = 0 - nums[i];\n int left = i + 1, right = nums.length - 1;\n while (left < right) {\n if (nums[left] + nums[right] < target || (left > i + 1 && nums[left - 1] == nums[left])) {\n left++;\n } else if (nums[left] + nums[right] > target || (right < nums.length - 1 && nums[right] == nums[right + 1])) {\n right--;\n } else {\n result.add(Arrays.asList(nums[i], nums[left], nums[right]));\n left++;\n right--;\n }\n }\n }\n return result;\n }"
] | [
"0.7988719",
"0.78604454",
"0.7679086",
"0.7678756",
"0.76678157",
"0.76248765",
"0.7591873",
"0.7576564",
"0.7570018",
"0.75676686",
"0.7539294",
"0.7530551",
"0.75204873",
"0.74729615",
"0.7467005",
"0.7443849",
"0.74331754",
"0.73881394",
"0.7376312",
"0.724328",
"0.7196322",
"0.7180178",
"0.71689606",
"0.7157652",
"0.7128699",
"0.7051689",
"0.7038136",
"0.7028209",
"0.7028019",
"0.7025842",
"0.6969446",
"0.6963618",
"0.6939165",
"0.6924116",
"0.69210184",
"0.687206",
"0.6856491",
"0.6772997",
"0.6771887",
"0.6762304",
"0.66382986",
"0.65981543",
"0.65959543",
"0.6586976",
"0.65585554",
"0.6556879",
"0.6537667",
"0.65342855",
"0.65201426",
"0.6471037",
"0.6450788",
"0.6442519",
"0.6420844",
"0.6411961",
"0.6391597",
"0.6356561",
"0.6316575",
"0.6292789",
"0.62913465",
"0.62738925",
"0.62656355",
"0.62620634",
"0.6254122",
"0.6249366",
"0.6248332",
"0.62075406",
"0.6199979",
"0.61996865",
"0.61795443",
"0.61484265",
"0.6144454",
"0.6142253",
"0.61176544",
"0.61143154",
"0.6110069",
"0.60899323",
"0.6080754",
"0.60726386",
"0.605167",
"0.6049287",
"0.6017449",
"0.60164607",
"0.6016034",
"0.60068256",
"0.60021996",
"0.59829646",
"0.5980099",
"0.59799474",
"0.59793556",
"0.5978406",
"0.5971632",
"0.59531033",
"0.5925208",
"0.5925208",
"0.59071285",
"0.5906841",
"0.58966005",
"0.58903426",
"0.5883441",
"0.5879254"
] | 0.7724789 | 2 |
/ We can say two strings are anagram when all the letter in one string exist in the another one and opposite. isAnagram("abc", "bca"); > true isAnagram("abc", "cba"); > true isAnagram("abc", "dba"); > false isAnagram("abc", "bcae"); > false | public static boolean isAnagram(String str, String str1) {
if (str.length() != str1.length()) {
return false;
}
char[] strChArr = str.toCharArray();
char[] str1ChArr = str1.toCharArray();
// System.out.println(Arrays.toString(strChArr));
// System.out.println(Arrays.toString(str1ChArr));
Arrays.sort(strChArr);
Arrays.sort(str1ChArr);
// System.out.println(Arrays.toString(strChArr));
// System.out.println(Arrays.toString(str1ChArr));
// for (int i = 0; i < strChArr.length; i++) {
// if(strChArr[i] != str1ChArr[i]) {
// return false;
// }
// }
// return true;
return Arrays.equals(strChArr, str1ChArr);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean anagram(char [] a, char [] b);",
"static boolean areAnagram(char[] str1, char[] str2)\n\t{\n\t\t// Get lengths of both strings\n\t\tint n1 = str1.length;\n\t\tint n2 = str2.length;\n\n\t\t// If length of both strings is not same,\n\t\t// then they cannot be anagram\n\t\tif (n1 != n2)\n\t\t\treturn false;\n\n\t\t// Sort both strings\n\t\tArrays.sort(str1);\n\t\tArrays.sort(str2);\n\n\t\t// Compare sorted strings\n\t\tfor (int i = 0; i < n1; i++)\n\t\t\tif (str1[i] != str2[i])\n\t\t\t\treturn false;\n\n\t\treturn true;\n\t}",
"public static boolean isAnagram(char[]s1, char[]s2)\r\n{\n\t if(s1.length!=s2.length)\r\n\t\t return false; \r\n\t \r\n\t //sort both strings using Arrays sort method\r\n\t Arrays.sort(s1); \r\n\t Arrays.sort(s2);\r\n\t \r\n\t for(int i=0; i<s1.length;i++)\r\n\t if(s1[i]!=s2[i])\r\n\t\t return false; \r\n\t\r\n\treturn true; \r\n\t \r\n}",
"public static boolean isAnagramImperApproach(char[] str1, char[] str2) {\n int n1 = str1.length;\n int n2 = str2.length;\n\n if (n1 != n2) return false;\n\n Arrays.sort(str1);\n Arrays.sort(str2);\n\n for (int i = 0; i < n1; i++) {\n if (str1[i] != str2[i]) {\n return false;\n }\n }\n return true;\n }",
"public boolean checkAnagram(char[] str1, char[] str2)\n {\n// Finding lengths of strings\n int len1 = str1.length;\n int len2 = str2.length;\n// If lengths do not match then they cannot be anagrams\n if (len1 != len2)\n return false;\n// Sort both strings\n Arrays.sort(str1);\n Arrays.sort(str2);\n// Comparing the strings which are sorted earlier\n for (int i = 0; i < len1; i++)\n if (str1[i] != str2[i])\n return false;\n return true;\n }",
"private static boolean isAnagram(String a, String b) {\n\t\tint[] charsA = new int[26];\n\t\tint[] charsB = new int[26];\n\t\t\n\t\tfor(int i = 0 ; i < a.length(); i++)\n\t\t\tcharsA[a.charAt(i) - 'a']++;\n\t\tfor(int i = 0 ; i < b.length(); i++)\n\t\t\tcharsB[b.charAt(i) - 'a']++;\n\t\t\n\t\tfor(int i = 0 ; i < 26 ; i++) \n\t\t\tif(charsA[i] != charsB[i])\n\t\t\t\treturn false;\n\t\treturn true;\n\t}",
"public static boolean isAnagramFuncApproach(String str1, String str2) {\n List<String> list1 = str1.chars()\n .sorted()\n .mapToObj(c -> Character.valueOf((char) c))\n .map(object -> Objects.toString(object, null))\n .collect(Collectors.toList());\n\n List<String> list2 = str2.chars()\n .sorted()\n .mapToObj(c -> Character.valueOf((char) c))\n .map(object -> Objects.toString(object, null))\n .collect(Collectors.toList());\n\n return list1.equals(list2);\n }",
"public static boolean isAnagram(String str1, String str2) {\n\t\tif(str1.length() != str2.length())\n\t\t\treturn false;\n\t\t/* count chars for each string */ \n\t\tint[] charSet1 = countChar(str1);\n\t\tint[] charSet2 = countChar(str2);\n\t\t/* compare two char set to see if anagram */\n\t\tfor(int i = 0; i < charSet1.length; i++) {\n\t\t\tif(charSet1[i] != charSet2[i])\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public static boolean isAnagram(String strOne, String strTwo) throws IllegalArgumentException {\n if (strOne == null || strTwo == null)\n throw new IllegalArgumentException(\"One or both strings is null\");\n\n /**\n * Replace spaces and lower case the strings, note that we could\n * do this check while building up the map, but this is somewhat simpler\n * to understand/read, and it also allows us to not have to check to index\n * out of bounds issues when iterating through characters\n */\n String strOneCopy = strOne.replaceAll(\"\\\\s\", \"\").toLowerCase();\n String strTwoCopy = strTwo.replaceAll(\"\\\\s\", \"\").toLowerCase();\n\n if (strOne.isEmpty() || strTwo.isEmpty())\n return false;\n\n int strOneLen = strOneCopy.length();\n int strTwoLen = strTwoCopy.length();\n\n // If the strings aren't the same length they cannot be anagrams\n if (strOneLen != strTwoLen)\n return false;\n\n HashMap<Character, Integer> charCount = new HashMap<Character, Integer>();\n\n\n /**\n * Build a map of the counts of each character.\n *\n * The count will be positive if a character appears in first string one or more\n * times more than it appears in the second string\n *\n * The count will be negative if a character appears in second string one or more\n * times more than it appears in the first string\n */\n for (int i = 0; i < strOneLen; i++) {\n\n /**\n * Get the character from string one, we're not worried about out of bound index issues here\n * as we've already checked that the strings are the same length so there should\n * be characters at every index here for both strings\n */\n char charValKey = strOneCopy.charAt(i);\n\n int charKeyCount = 0;\n\n // Check if we've already seen this character and get the existing count if so\n if (charCount.containsKey(charValKey))\n charKeyCount = charCount.get(charValKey);\n\n // Increment the count\n charCount.put(charValKey, ++charKeyCount);\n\n\n /**\n * Get the character from string two, we're not worried about out of bound index issues here\n * as we've already checked that the strings are the same length so there should\n * be characters at every index here for both strings\n */\n charValKey = strTwoCopy.charAt(i);\n charKeyCount = 0;\n\n // Check if we've already seen this character and get the existing count if so\n if (charCount.containsKey(charValKey))\n charKeyCount = charCount.get(charValKey);\n\n // Decrement the count\n charCount.put(charValKey, --charKeyCount);\n\n }\n\n\n for (int value : charCount.values()) {\n if (value != 0)\n return false;\n }\n\n return true;\n }",
"public static boolean anagram() {\n\t\tboolean isAnagram = false;\n\t\tScanner scanner = new Scanner(System.in);\n\n\t\tSystem.out.println(\"enter first string\");\n\t\tString string1 = scanner.nextLine();\n\t\tSystem.out.println(\"enter second string\");\n\t\tString string2 = scanner.nextLine();\n\t\tString space1 = string1.replaceAll(\" \",\"\");\n\t\tString space2 = string2.replaceAll(\" \",\"\");\n\t\tString lower1 = string1.toLowerCase();\n\t\tString lower2 = string2.toLowerCase();\n\t\tchar[] array1 = space1.toCharArray();\n\t\tchar[] array2 = space2.toCharArray();\n\t\t\n\t\t\n\t\tif (array1.length == array2.length) \n\t\t{\n\t\t\tfor (int i = 0; i < array1.length; i++) {\n\t\t\t\tfor (int j = i+1; j < array1.length; j++) {\n\t\t\t\t\tif (array1[i] > array1[j]) {\n\t\t\t\t\t\tchar temp = array1[i];\n\t\t\t\t\t\tarray1[i] = array1[j];\n\t\t\t\t\t\tarray1[j] = temp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < array1.length; i++) {\n\t\t\t\tfor (int j = i+1; j < array1.length; j++) {\n\t\t\t\t\tif (array2[i] > array2[j]) {\n\t\t\t\t\t\tchar temp = array2[i];\n\t\t\t\t\t\tarray2[i] = array2[j];\n\t\t\t\t\t\tarray2[j] = temp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < array1.length; i++) {\n\t\t\t\tfor (int j = i; j <=i; j++) {\n\t\t\t\t\tif (array1[i] == array2[j]) {\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (count == array1.length) {\n\t\t\t\tisAnagram=true;\n\n\t\t\t} \n\t\t\telse {\n\t\t\t\tisAnagram = false;\n\n\t\t\t}\n\t\t} \n\t\telse \n\t\t{\n\t\t\tisAnagram = false;\n\t\t}\n\t\treturn isAnagram;\n\t}",
"boolean isAnagram(String str1, String str2){\n\t\tString s1 = str1.replaceAll(\"\\\\s\",\"\");\n\t\tString s2 = str2.replaceAll(\"\\\\s\",\"\");\n\t\t\n\t\t//\n\t\tboolean check = true;\n\t\tif(s1.length()!=s2.length())\n\t\t{\n\t\t\tcheck = false;\n\t\t}\n\t\telse{\n\t\t\ts1=sortArray(s1);\n\t\t\ts2=sortArray(s2);\n\t\t\tcheck = s1.equalsIgnoreCase(s2);\n\t\t}\n\treturn check;\n\t}",
"public boolean isAnagram(String a, String b) {\n if (a.length() != b.length()) {\n return false;\n }\n\n HashMap<Character, Integer> aTable = new HashMap<>();\n\n //Store the counts of all the characters of the first string in a hashmap\n for (int i = 0; i < a.length(); i++) {\n Character currChar = a.charAt(i);\n if (aTable.containsKey(currChar)) {\n aTable.put(currChar, aTable.get(currChar) + 1);\n } else {\n aTable.put(currChar, 1);\n }\n }\n\n //Now iterate through the second string and decrement the count of the characters\n for (int j = 0; j < b.length(); j++) {\n Character currChar = b.charAt(j);\n if (!aTable.containsKey(currChar)) {\n return false;\n } else if (aTable.get(currChar) == 0) {\n return false;\n } else if (aTable.get(currChar) > 0) {\n aTable.put(currChar, aTable.get(currChar) - 1);\n }\n\n }\n\n return true;\n\n\n }",
"public boolean checkAnagram(String s1, String s2) {\n if (s1.length() != s2.length()) {\n return false;\n }\n char[] stringArr1 = s1.toCharArray();\n char[] stringArr2 = s2.toCharArray();\n Arrays.sort(stringArr1);\n Arrays.sort(stringArr2);\n\n for (int i = 0; i < stringArr1.length; i++) {\n if (stringArr1[i] != stringArr1[i]) {\n return false;\n }\n }\n return true;\n }",
"public static boolean isAnagram (String word1, String word2){\n boolean check = false;\n String one = \"\";\n String two = \"\";\n int counter =0;\n int counter1 =0;\n for(int i=0; i<word1.length(); i++){\n counter=0;\n for(int k=0; k<word2.length(); k++){\n if(word1.charAt(i) == word2.charAt(k) ){\n counter++;\n }\n }\n if(counter ==1){\n counter1++;\n }\n }\n if (counter1 == word1.length() && counter1 == word2.length() ){\n check = true;\n }\n return check;\n }",
"public static void main(String[] args) {\nScanner sc=new Scanner(System.in);\r\nString s1=sc.nextLine();\r\nString s2=sc.nextLine();\r\ns1=s1.replaceAll(\"\\\\s\",\"\");\r\ns2=s2.replaceAll(\"\\\\s\",\"\");\r\ns1=s1.toLowerCase();\r\ns2=s2.toLowerCase();\r\nchar str1[]=s1.toCharArray();\r\nchar str2[]=s2.toCharArray();\r\nArrays.sort(str1);\r\nArrays.sort(str2);\r\nboolean k=true;\r\nif(s1.length()!=s2.length())\r\n\tk=false;\r\nelse\r\n{\r\nk=Arrays.equals(str1,str2);\t\r\n}\r\nif(k==false)\r\n\tSystem.out.print(\"not annagram\");\r\nelse\r\n\tSystem.out.print(\"annagram\");\r\n\t}",
"private boolean isAnagrams(String s1, String s2) {\n char[] ss1 = s1.toCharArray();\n \n char[] ss2 = s2.toCharArray();\n \n Arrays.sort(ss1);\n Arrays.sort(ss2);\n return ss1.equals(ss2);\n\n }",
"public static boolean checkForAnagram(final String a, final String b) {\n boolean isAnagram = false;\n\n if(a == null || b == null){\n throw new IllegalArgumentException(\"Invalid input\");\n }\n if(a.length() != b.length()){\n return isAnagram;\n }\n char [] lowerCaseA = a.trim().toLowerCase().toCharArray();\n String upperCaseB= b.trim().toLowerCase();\n boolean check =true;\n for(int i =0; i<lowerCaseA.length ; i++){\n Character c = lowerCaseA[i];\n int n = c;\n if(c >=95 && c <=122){\n if(! upperCaseB.contains(c.toString())){\n check=false;\n break;\n }\n }\n else {\n continue;\n }\n }\n if(check){\n isAnagram =true;\n }\n\n return isAnagram;\n }",
"public static boolean isAnagram(String first, String second) {\n first = first.toLowerCase();\n second = second.toLowerCase();\n // Two strings can't be anagrams if they're not the same length\n if (first.length() != second.length()){\n return false;\n }\n HashMap<Character, Integer> firstWord = new HashMap<Character, Integer>();\n HashMap<Character, Integer> secondWord = new HashMap<Character, Integer>();\n\n // Count character occurences in 1st word\n for(int i = 0; i < first.length(); i++){\n char key = first.charAt(i);\n firstWord.put(key, firstWord.getOrDefault(key, 0)+1);\n }\n // Count character occurrences in 2nd word\n for(int i = 0; i < second.length(); i++){\n char key = second.charAt(i);\n secondWord.put(key, secondWord.getOrDefault(key, 0)+1);\n }\n return firstWord.equals(secondWord);\n }",
"private static void anagramDetection(char[] firstArray, char[] secondArray) {\n int count = 0;\n for (int i = 0; i < firstArray.length; i++) {\n for (int j = 0; j < firstArray.length; j++) {\n if (firstArray[i] == secondArray[j]) {\n count += 1;\n }\n }\n }\n if (count == firstArray.length){\n System.out.println(\"Both strings are anagram\");\n }else {\n System.out.println(\"Both strings are not anagram\");\n }\n\n }",
"public static boolean isAnagram1(String s1, String s2) {\r\n int[] arr = new int[256]; //Number of Ascii Values\r\n\r\n for (int i = 0; i < s1.length(); i++) {\r\n arr[s1.charAt(i)]++;\r\n arr[s2.charAt(i)]--;\r\n }\r\n\r\n for (int i = 0; i < arr.length; i++) {\r\n if (arr[i] != 0) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }",
"private static boolean anagramWord(String first, String second) {\n\t\tif(first.length()!=second.length())return false;\n\t\tint matches = 0;\n\t\tchar[] a = first.toLowerCase().toCharArray();\n\t\tchar[] b = second.toLowerCase().toCharArray();\n\t\tfor(int i=0; i<a.length; i++){\n\t\t\tfor(int j=0; j<b.length; j++){\n\t\t\t\tif(a[i]==b[j])matches++;\n\t\t\t}\n\t\t}\n\t\tif( matches==a.length && matches==b.length )return true;\n\t\treturn false;\n\t}",
"public static void main(String[] args) {\n Scanner sc=new Scanner(System.in);\n String s1,s2;\n s1=sc.nextLine();\n s2=sc.nextLine();\n s1=s1.toLowerCase();\n s2=s2.toLowerCase();\n if(s1.length()!=s2.length()) \n System.out.println(\"Not an anagram\");\n char[] c1=s1.toCharArray();\n char[] c2=s2.toCharArray();\n Arrays.sort(c1);\n Arrays.sort(c2);\n \tif(Arrays.equals(c1, c2))\n System.out.println(\"anagram\");\n \telse\n System.out.println(\"Not an anagram\");\n }",
"public void checkAnagram(String s, String s1) {\r\n\t\tint count=0;\r\n\t\tif(s.length()==s1.length()){\r\n\t\t\tfor(int i=0;i<s.length();i++){\r\n\t\t\t\tfor(int j=0;j<s1.length();j++){\r\n\t\t\t\t\tif(s.charAt(i)==s1.charAt(j)){\r\n\t\t\t\t\t\tcount++;\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\tif(count==s.length()){\r\n\t\t\tSystem.out.println(\"anagram\");\r\n\t\t}else\r\n\t\t\tSystem.out.println(\"not anagram\");\r\n\t}",
"public static boolean isAnagram2(String s1, String s2) {\r\n List<Character> list = new ArrayList<>();\r\n\r\n for (char c : s1.toCharArray()) {\r\n list.add(c);\r\n }\r\n\r\n for (char c : s2.toCharArray()) {\r\n list.remove(new Character(c));\r\n }\r\n\r\n return (list.isEmpty());\r\n }",
"public static void main(String[] args) {\n String firstString = \"abcd\";\n String secondString = \"dcba\";\n\n // two string may be anagram of they are same in length, character wise.\n if (firstString.length() != secondString.length()) {\n System.out.println(\"Both string are not anagram\");\n }else {\n char[] firstArray = firstString.toCharArray();\n char[] secondArray = secondString.toCharArray();\n\n anagramDetection(firstArray, secondArray);\n }\n }",
"public static void main(String[] args) {\n\t\tString str=\"army\";\n\t\tString str1=\"mary\";\n\t\tchar arr[]=str.toLowerCase().toCharArray();\n\t\tchar arr1[]=str1.toLowerCase().toCharArray();\n\t\tArrays.sort(arr);\n\t\tArrays.sort(arr1);\n\t\tif(Arrays.equals(arr, arr1))\n\t\t{\n\t\t\tSystem.out.println(\"given strings are anagrams\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"given strings are not anagram\");\n\t\t}\n\t\t\n\n\t}",
"static void isAnagram(String s1, String s2) {\n\n String copyOfs1 = s1.replaceAll(\"s\", \"\");\n\n String copyOfs2 = s2.replaceAll(\"s\", \"\");\n\n //Initially setting status as true\n\n boolean status = true;\n\n if (copyOfs1.length() != copyOfs2.length()) {\n //Setting status as false if copyOfs1 and copyOfs2 doesn't have same length\n\n status = false;\n } else {\n //Changing the case of characters of both copyOfs1 and copyOfs2 and converting them to char array\n\n char[] s1Array = copyOfs1.toLowerCase().toCharArray();\n\n char[] s2Array = copyOfs2.toLowerCase().toCharArray();\n\n //Sorting both s1Array and s2Array\n\n Arrays.sort(s1Array);\n\n Arrays.sort(s2Array);\n\n //Checking whether s1Array and s2Array are equal\n\n status = Arrays.equals(s1Array, s2Array);\n }\n\n //Output\n\n if (status) {\n System.out.println(s1 + \" and \" + s2 + \" are anagrams\");\n } else {\n System.out.println(s1 + \" and \" + s2 + \" are not anagrams\");\n }\n }",
"@Override\n\tpublic boolean checkAnagram(String firstString, String secondString) {\n\t\tchar[] characters = firstString.toCharArray();\n\t\tStringBuilder sbSecond = new StringBuilder(secondString);\n\n\t\tfor(char ch : characters){\n\t\t\tint index = sbSecond.indexOf(\"\" + ch);\n\t\t\tif(index != -1){\n\t\t\t\tsbSecond.deleteCharAt(index);\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"int main() \n{\n string s1,s2;\n cin>>s1>>s2;\n int freq[128]={0},i;\n for(i=0;i<s1.length();i++)\n freq[s1[i]]++;\n for(i=0;i<s2.length();i++)\n freq[s2[i]]--;\n for(i=0;i<128;i++)\n {\n if(freq[i]!=0)\n {\n cout<<\"Not anagrams\";\n return 0;\n }\n }\n cout<<\"Anagram\";\n}",
"public static void main(String[] args) {\n String str1 = \"listen\";\n String str2 = \"silent\";\n for (int i = 0; i < str1.length(); i++) {\n str2 = str2.replaceFirst(\"\" + str1.charAt(i), \"\");\n }\n System.out.println(str2.isEmpty() ? \"Anagram\" : \"NOT Anagram\");\n\n/*\n //Approach Two:\n String str1 = \"listen\";\n String str2 = \"silent\";\n String str11 = \"\";\n String str22 = \"\";\n char[] ch1 = str1.toCharArray();\n char[] ch2 = str2.toCharArray();\n Arrays.sort(ch1);\n Arrays.sort(ch2);\n for (char each:ch1) {\n str11+=each;\n }\n for (char each:ch2) {\n str22+=each;\n }\n System.out.println(str11.equalsTo(str22)? \"Anagram\" : \"NOT Anagram\");\n\n */\n/*\n\n //Approach Three:\n public static boolean Same(String str12, String str2) {\n str1 = new TreeSet<String>(Arrays.asList( str1.split(\"\") ) ).toString( );\n str2 = new TreeSet<String>(Arrays.asList( str2.split(\"\") ) ).toString( );\n return str1.equals(str2); }\n*/\n }",
"static boolean areAnagram(String sa, String sb) {\n\n // **** populate character arrays ****\n char[] aa = sa.toCharArray();\n char[] ab = sb.toCharArray();\n\n // **** sort character arrays ****\n Arrays.sort(aa);\n Arrays.sort(ab);\n\n // **** traverse arrays checking for mismatches ****\n for (int i = 0; i < aa.length; i++) {\n if (aa[i] != ab[i]) {\n return false;\n }\n }\n\n // **** strings are anagrams ****\n return true;\n }",
"public boolean isAnagram(String s, String t) {\n HashMap<Character, Integer> map = new HashMap<>();\n\n // Return false if the strings are of different length\n if (s.length() != t.length()) {\n return false;\n }\n\n /**\n * Loop through the string and update the count in the hashmap in the following\n * way Increment the counter for the character from string1 Decrement the\n * counter for the character from string2\n */\n\n for (int i = 0; i < s.length(); i++) {\n map.put(s.charAt(i), map.getOrDefault(s.charAt(i), 0) + 1);\n map.put(t.charAt(i), map.getOrDefault(t.charAt(i), 0) - 1);\n }\n\n /**\n * Check if all characters in the hashmap as 0, if yes, return true, \n * else return false, as it isn't a valid anagram\n */\n\n for (Map.Entry mapElement : map.entrySet()) {\n\n if ((int) mapElement.getValue() != 0) {\n return false;\n }\n\n }\n\n return true;\n }",
"public static boolean findStringAnagram(char[] str1Arr, char[] str2Arr) {\r\n\t\tif (str1Arr.length != str2Arr.length) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\tArrays.sort(str1Arr);\r\n\t\t\tArrays.sort(str2Arr);\r\n\t\t\tfor (int i = 0; i < str1Arr.length; i++) {\r\n\t\t\t\tif (str1Arr[i] != str2Arr[i]) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t}",
"private static boolean isAnagram(String str, String anagram) {\n\n\t\tchar[] string = str.toCharArray();\n\t\tchar[] anag = anagram.toCharArray();\n\n\t\tArrays.sort(string);\n\t\tArrays.sort(anag);\n\n\t\treturn Arrays.equals(string, anag);\n\n\t}",
"@Test\n public void isAnagram() {\n\n Assert.assertEquals(true,Computation.isAnagram(\"read\",\"dear\"));\n Assert.assertEquals(false,Computation.isAnagram(\"read\",\"deard\"));\n Assert.assertEquals(false,Computation.isAnagram(\"read\",\"reaaad\"));\n Assert.assertEquals(false,Computation.isAnagram(\"readd\",\"reaad\"));\n }",
"public static boolean areAnagramStringsUsingOneFrequencyArray(String word1, String word2) {\n if (word1.length() != word2.length()) {\n return false;\n }\n int[] f = new int[256];\n\n for (int i = 0; i < word1.length(); i++) {\n f[word1.charAt(i)]++;\n f[word2.charAt(i)]--;\n }\n\n for (int i = 0; i < f.length; i++) {\n if (f[i] != 0) {\n return false;\n }\n\n }\n return true;\n\n }",
"public static boolean areAnagramsSlow(String a, String b) {\n\t\tif (a.length() != b.length()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tboolean areAnagrams = false;\n\t\t\n\t\tStringBuilder secondWord = new StringBuilder(b.toLowerCase());\n\n\t\tfor(int i = 0; i < a.length(); i++) {\n\t\t\tchar firstChar = a.charAt(i);\n\n\t\t\tfor(int j = 0; j < secondWord.length(); j++) {\n\t\t\t\tchar secondChar = secondWord.charAt(j);\n\t\t\t\tif (firstChar == secondChar) {\n\t\t\t\t\tsecondWord.deleteCharAt(j);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (secondWord.length() == 0) {\n\t\t\tareAnagrams = true;\n\t\t}\n\t\t\n\t\treturn areAnagrams;\n\t}",
"public static void main(String[] args) {\r\n\t\tString s1 = \"ababab\";\r\n\t\tString s2 = \"bababa\";\r\n\t\tif(s1.length()!= s2.length()){\r\n\t\t\tSystem.out.println(\"not a anagram\");\r\n\t\t}else{\r\n\t\t\tchar[] c1 = s1.toCharArray();\r\n\t\t\tchar[] c2 = s2.toCharArray();\r\n\t\t//\tusingHashMap(c1, c2);\r\n\t\t\tusingArrays(c1,c2);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"public boolean isAnagrams(String inputA, String inputB) {\n String one = inputA.toLowerCase();\n String two = inputB.toLowerCase();\n return sameLength(one, two) && sameLetters(one, two) && sameLetterCounts(one, two);\n }",
"public static boolean isAnagram(String s, String t) {\n int a = 0;\n for(int i=0;i<s.length();i++){\n a = a^s.charAt(i);\n }\n for(int i=0;i<t.length();i++){\n a = a^t.charAt(i);\n }\n return a == 0;\n\n }",
"public boolean isAnagram(String s, String t) {\n if (s.length() != t.length()) {\n return false;\n }\n char[] sChars = s.toCharArray();\n Arrays.sort(sChars);\n char[] tChars = t.toCharArray();\n Arrays.sort(tChars);\n\n return new String(sChars).equals(new String(tChars));\n }",
"public static boolean areAnagrams(String firstWord, String secondWord) {\n\t\tif (firstWord.length() != secondWord.length()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tStringBuilder firstSequence = new StringBuilder(firstWord.toLowerCase());\n\t\tStringBuilder secondSequence = new StringBuilder(secondWord.toLowerCase());\n\t\t\n\t\tSort.quickSort(firstSequence);\n\t\tSort.quickSort(secondSequence);\n\t\n\t\tfor (int i = 0; i < firstSequence.length(); i++) {\n\t\t\tif (firstSequence.charAt(i) != secondSequence.charAt(i)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public boolean isAnagram(String s, String t) {\n if(s.length() != t.length()) return false;\n char[] chs = s.toCharArray();\n char[] cht = t.toCharArray();\n Arrays.sort(chs);\n Arrays.sort(cht);\n String ss = String.valueOf(chs);\n String tt = String.valueOf(cht);\n return ss.equals(tt);\n }",
"static int makeAnagram(String a, String b) {\n int[] letters = new int[26];\n\n for (char c: a.toCharArray()){\n letters[c-'a']++;\n }\n\n for (char c: b.toCharArray()){\n letters[c-'a']--;\n }\n\n int sum = 0;\n\n for (int x:letters){\n sum+=Math.abs(x);\n }\n return sum;\n\n }",
"public static void main(String[] args) {\n\t\t\n\t\tString str1 =\"army\";\n\t\tString str2 = \"mary\";\n\t\t\n\t\tSystem.out.println(isAnagram2(str1,str2));\n\n\t}",
"public boolean isAnagram(String s, String t) {\n if (s.length() != t.length()) return false; // O(1)\n int[] charFrequency = new int[26]; // O(1)\n\n for (char c : s.toCharArray()) { // O(N)\n int index = c - 'a'; // O(1)\n charFrequency[index]++; // O(1)\n }\n\n for (char c : t.toCharArray()) { // O(N)\n int index = c - 'a'; // O(1)\n if (charFrequency[index] == 0) return false; // O(1)\n charFrequency[index]--; // O(1)\n }\n\n for (int i : charFrequency) { // O(26) -> O(1)\n if (i > 0) return false; // O(1)\n }\n\n return true; // O(1)\n }",
"public boolean checkForAnagrams(String inp) {\n return (new StringBuffer(inp).reverse().toString().equals(inp));\n }",
"static int makeAnagram(String a, String b) {\n List<String> arr = new ArrayList<>(Arrays.asList(a.split(\"(?<!^)\")));\n List<String> arr2 = new ArrayList<>(Arrays.asList(b.split(\"(?<!^)\")));\n Iterator<String> iter = arr.iterator();\n \n while (iter.hasNext()) {\n String s = iter.next();\n\n if (arr2.contains(s)) {\n arr2.remove(arr2.indexOf(s));\n iter.remove();\n }\n }\n\n return (arr.size()) + (arr2.size());\n }",
"static int makeAnagram(String a, String b) {\n int[] arr1 = new int[26];\n int[] arr2 = new int[26];\n\n for (int i = 0; i < a.length() ; i++) {\n arr1[a.charAt(i) - 'a']++;\n }\n\n for (int i = 0; i < b.length(); i++)\n arr2[b.charAt(i) - 'a']++;\n\n int times = 0;\n for (int i = 0; i < 26; i++)\n times += Math.abs(arr1[i] - arr2[i]);\n\n\n return times;\n }",
"private static boolean isAnagram2(String str, String anagram) {\n\n\t\tchar[] chararray = str.toCharArray();\n\n\t\tStringBuilder sb = new StringBuilder(anagram);\n\n\t\tfor (char ch : chararray) {\n\t\t\t\n\t\t\tint index = sb.indexOf(\"\" + ch);\n\n\t\t\tif (index != -1) {\n\n\t\t\t\tsb.deleteCharAt(index);\n\t\t\t} else {\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn sb.length() == 0 ? true : false;\n\t}",
"public static boolean isAnagram2(String word, String anagram) {\r\n\t\tchar[] charFromWord = word.toCharArray();\r\n\t\tchar[] charFromAnagram = anagram.toCharArray();\r\n\t\tArrays.sort(charFromWord);\r\n\t\tArrays.sort(charFromAnagram);\r\n\t\t\r\n\t\treturn Arrays.equals(charFromWord, charFromAnagram);\r\n\t}",
"static int makeAnagram(String a, String b) {\r\n int[] charCount = new int[26];\r\n int deletions = 0;\r\n\r\n for(char c : a.toCharArray()) {\r\n charCount[c-'a'] += 1;\r\n }\r\n for(char c : b.toCharArray()) {\r\n charCount[c-'a'] -= 1;\r\n }\r\n for(int count : charCount) {\r\n deletions += Math.abs(count);\r\n }\r\n return deletions;\r\n }",
"public static boolean IsAnagram(String word, String anagram) {\r\n\t\t//We ensure that the length are the same.\r\n\t\tif(word.length() != anagram.length()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tchar[] chars = word.toCharArray();\r\n\t\t\r\n\t\tfor(char c : chars) {\r\n\t\t\tint index = anagram.indexOf(c);\r\n\t\t\tif(index != -1) {\r\n\t\t\t\tanagram = anagram.substring(0, index) + anagram.substring(index +1, anagram.length());\r\n\t\t\t}else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn anagram.isEmpty();\r\n\t}",
"static int makeAnagram(String a, String b) {\n \n \tchar arr[] = a.toCharArray();\n char brr[] = b.toCharArray();\n Arrays.sort(arr);\n Arrays.sort(brr);\n Map<Character, Integer> aMap = new HashMap<>();\n Map<Character, Integer> bMap = new HashMap<>();\n for(int i =0 ;i <arr.length;i++){\n \tif(!aMap.containsKey(arr[i])){\n \t\taMap.put(arr[i], 1);\n \t}else{\n \t\taMap.put(arr[i], aMap.get(arr[i])+1);\n \t}\n }\n for(int i =0 ;i <brr.length;i++){\n \tif(!bMap.containsKey(brr[i])){\n \t\tbMap.put(brr[i], 1);\n \t}else{\n \t\tbMap.put(brr[i], bMap.get(brr[i])+1);\n \t}\n }\n int removeCharCount = 0;\n \n for(char ch = 'a'; ch<='z';ch++){\n \tif(aMap.containsKey(ch) && bMap.containsKey(ch)){\n \t\tif(aMap.get(ch) > bMap.get(ch)){\n \t\t\tint count = aMap.get(ch) - bMap.get(ch);\n \t\t\tremoveCharCount+=count;\n \t\t\taMap.put(ch, aMap.get(ch) - count);\n \t\t}else if(aMap.get(ch) < bMap.get(ch)){\n \t\t\tint count = bMap.get(ch) - aMap.get(ch);\n \t\t\tremoveCharCount+=count;\n \t\t\taMap.put(ch, bMap.get(ch) - count);\n \t\t}\n \t}else if(aMap.containsKey(ch) && !bMap.containsKey(ch)){\n \t\tint count = aMap.get(ch);\n \t\tremoveCharCount+=count;\n \t\taMap.remove(ch);\n \t}else if(!aMap.containsKey(ch) && bMap.containsKey(ch)){\n \t\tint count = bMap.get(ch);\n \t\tremoveCharCount+=count;\n \t\tbMap.remove(ch);\n \t}\n }\n /* if(removeCharCount == Math.min(arr.length, brr.length)){\n \treturn 0;\n }*/\n return removeCharCount;\n }",
"public boolean isAnagram1(String s, String t) {\n if (s.length() != t.length()) return false;\n Function<String, Integer> countCode = str -> {\n int code = 0;\n for (int i = 0; i < str.length(); i++)\n code ^= str.charAt(i);\n return code;\n };\n return countCode.apply(s).equals(countCode.apply(t));\n }",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n String input1 = scanner.next();\n String input2 = scanner.next();\n\n scanner.close();\n boolean ret = isAnagram(input1, input2);\n System.out.println((ret) ? \"Anagrams\" : \"NotAnagrams\");\n }",
"public static boolean areAnagramsUsingTwoFrequencyArrays(String firstString, String secondString) {\n if (firstString.length() != secondString.length()) {\n return false;\n }\n\n int[] f1 = new int[256];\n int[] f2 = new int[256];\n\n for (int i = 0; i < firstString.length(); i++) {\n f1[firstString.charAt(i)]++;\n }\n for (int i = 0; i < secondString.length(); i++) {\n f2[secondString.charAt(i)]++;\n }\n\n for (int i = 0; i < f1.length; i++) {\n for (int j = 0; j < f2.length; j++) {\n if (f1[i] != f2[i]) {\n return false;\n }\n }\n\n }\n return true;\n }",
"public static int isAnagram(String st,String st1) {\n\t\tint k=0;\n\t\tString str=remove(st);\n\t\tString str1=remove(st1);\n\t\t/*if(str.length()!=str1.length()){\n\t\t\tk=1;\n\t\t\treturn k;\n\t\t}*/\n\t\tchar[] c=toLowercase(str);\n\t\tchar[] c1=toLowercase(str1);\n\t\tchar[] stt=sort(c);\n\t\tchar[] stt1=sort(c1);\n\t\t/*for(int i=0;i<stt.length;i++)\n\t\t\tSystem.out.print(stt[i]);\n\t\tSystem.out.println();\n\t\tfor(int i=0;i<stt1.length;i++)\n\t\t\tSystem.out.print(stt1[i]);\n\t\tSystem.out.println();*/\n\t\tfor(int i=0;i<stt1.length;i++){\n\t\tif(stt[i]==stt1[i])\n\t\t\tk=1;\n\t\t}\n\t\treturn k;\n\t}",
"public boolean isAnagram(String firstWord, String secondWord) {\n HashMap<Character, Integer> charactersNoOccurrences = new HashMap<Character, Integer>();\n\n //Put that stuff in the hash map.\n for (char character: firstWord.toCharArray()) {\n int currentNoOccurrences = charactersNoOccurrences.containsKey(character) ?\n charactersNoOccurrences.get(character) : 0;\n\n charactersNoOccurrences.put(character, currentNoOccurrences + 1);\n }\n\n //Go through the hash map now to and retrieve occurrences, we want to finish with an empty map.\n for (char character: secondWord.toCharArray()) {\n if (!charactersNoOccurrences.containsKey(character)) {\n return false;\n }\n\n int remainingNoOccurrences = charactersNoOccurrences.get(character) - 1;\n\n if (remainingNoOccurrences < 1) {\n charactersNoOccurrences.remove(character);\n } else {\n charactersNoOccurrences.put(character, remainingNoOccurrences);\n }\n }\n\n return charactersNoOccurrences.isEmpty();\n }",
"public static boolean compare (TreeMap<Character, Integer> m1, TreeMap<Character, Integer> m2) {\n if (m1.keySet().size() != m2.keySet().size()) {\n return false; // Words do not contain the same number of variants of characters\n } else {\n for (char c : m1.keySet()) {\n if (!m2.containsKey(c)) {\n return false; // Words do not have the same characters\n } else {\n if (m1.get(c) != m2.get(c)) {\n return false; // Words do not have the same number of the same characters\n }\n }\n }\n }\n\n return true; // The word is an anagram\n }",
"static int makeAnagram(String a, String b) {\n int[] frequencyA = countFrequency(a);\n int[] frequencyB = countFrequency(b);\n\n int count = 0;\n\n for (int i = 0; i < frequencyA.length; i++) {\n count += Math.abs(frequencyA[i] - frequencyB[i]);\n }\n return count;\n }",
"public boolean containsAnagram(String s, String t) {\n\t\tint[] tmap = new int[26];\n\t\tfor (char c : t.toCharArray())\n\t\t\ttmap[c - 'A']++;\n\t\tint p1 = 0, p2 = 0;\n\t\tint minimumLen = Integer.MAX_VALUE;\n\t\tint expandedLength = t.length();\n\t\twhile (p1 < s.length() && p1 < s.length()) {\n\t\t\tif (tmap[s.charAt(p2++) - 'A']-- > 0) expandedLength--;\n\t\t\twhile (expandedLength == 0) {\n\t\t\t\tif (p2 - p1 < minimumLen) {\n\t\t\t\t\tminimumLen = p2 - p1;\n\t\t\t\t\tif (minimumLen == t.length()) return true;\n\t\t\t\t}\n\t\t\t\tif (p1 >= s.length()) break;\n\t\t\t\t// Exists in t.\n\t\t\t\tif (tmap[s.charAt(p1++) - 'A']++ == 0) expandedLength++;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"static int anagram(String s){\n // Complete this function\n int len = s.length();\n if(len%2 != 0){\n return -1;\n }\n String a=s.substring(0,(len/2));\n StringBuilder b = new StringBuilder(s.substring((len/2),len)); \n //System.out.println(\"a: \" + a);\n //System.out.println(\"b: \" + b);\n //char[] aChar = a.toCharArray();\n //char[] bChar = b.toCharArray();\n //Arrays.sort(aChar);\n //Arrays.sort(bChar);\n int count =0;\n for(int i=0;i<len/2;i++){\n int j = b.indexOf(String.valueOf(a.charAt(i)));\n if(j > -1){\n b.deleteCharAt(j); \n }else{\n count++;\n }\n }\n return count;\n }",
"static int makeAnagram1(String a, String b) {\n int count = 0;\n Map<Character, Integer> mapA = initMap(a);\n Map<Character, Integer> mapB = initMap(b);\n\n Iterator<Character> it = mapA.keySet().iterator();\n while (it.hasNext()) {\n char c = it.next();\n int frequencyA = mapA.get(c);\n if (mapB.containsKey(c)) {\n int frequencyB = mapB.get(c);\n count += Math.abs(frequencyA - frequencyB);\n int min = Math.min(frequencyA, frequencyB);\n mapA.put(c, min);\n mapB.put(c, min);\n } else {\n count += frequencyA;\n }\n }\n\n it = mapB.keySet().iterator();\n while (it.hasNext()) {\n char c = it.next();\n int frequencyB = mapB.get(c);\n if (mapA.containsKey(c)) {\n int frequencyA = mapA.get(c);\n count += Math.abs(frequencyA - frequencyB);\n int min = Math.min(frequencyA, frequencyB);\n mapA.put(c, min);\n mapB.put(c, min);\n } else {\n count += frequencyB;\n }\n }\n return count;\n }",
"public boolean isIsomorphic(String str1, String str2) {\r\n if(str1.length() != str2.length()) return false;\r\n \r\n int[] arr1 = new int[256];\r\n int[] arr2 = new int[256];\r\n \r\n Arrays.fill(arr1, -1);\r\n Arrays.fill(arr2, -1);\r\n \r\n for(int i=0;i<str1.length();i++){\r\n int value1 = str1.charAt(i);\r\n int value2 = str2.charAt(i);\r\n if(arr1[value1]== -1){\r\n arr1[value1] = value2;\r\n } else {\r\n if(arr1[value1] != value2) return false;\r\n }\r\n \r\n if(arr2[value2]== -1){\r\n arr2[value2] = value1;\r\n } else {\r\n if(arr2[value2] != value1) return false;\r\n }\r\n \r\n }\r\n return true;\r\n \r\n}",
"@Test\n public void testNormalAnagrams() {\n AnagramFinderImpl anagramFinderObj = new AnagramFinderImpl();\n boolean inputNormalAnagrams = anagramFinderObj.areAnagrams(\"aba\", \"aba\");\n assertTrue(\"true\", inputNormalAnagrams);\n }",
"public static void main(String[] args) {\n\n\t\tString a = \"aabbbc\", b =\"cbad\";\n\t\t// a=abc\t\t\t\tb=cab\n\t\t\n\t\t\n\t\tString a1 =\"\" , b1 = \"\"; // to store all the non duplicated values from a\n\t\t\n\t\tfor(int i=0; i<a.length();i++) {\n\t\t\tif(!a1.contains(a.substring(i,i+1)))\n\t\t\t\ta1 += a.substring(i,i+1);\n\t\t}\n\t\t\n\t\tfor(int i=0; i<b.length();i++) {\n\t\t\tif(!b1.contains(b.substring(i,i+1)))\n\t\t\t\tb1 += b.substring(i,i+1);\n\t\t}\n\t\t\t\t\n\t\tchar[] ch1 = a1.toCharArray();\n\t\tSystem.out.println(Arrays.toString(ch1));\n\t\t\n\t\tchar[] ch2 = b1.toCharArray();\n\t\tSystem.out.println(Arrays.toString(ch2));\n\t\t\n\t\tArrays.sort(ch1);\n\t\tArrays.sort(ch2);\n\t\t\n\t\tSystem.out.println(\"=====================================================\");\n\t\t\n\t\tSystem.out.println(Arrays.toString(ch1));\n\t\tSystem.out.println(Arrays.toString(ch2));\n\t\t\n\t\tString str1 = Arrays.toString(ch1);\n\t\tString str2 = Arrays.toString(ch2);\n\t\t\n\t\tif(str1.contentEquals(str2)) {\n\t\t\tSystem.out.println(\"true, they build out of same letters\");\n\t\t}else { \n\t\t\tSystem.out.println(\"fasle, there is something different\");\n\t\t}\n\t\t\n\n\t\t\n\t\t// SHORTER SOLUTION !!!!!!!!!!!!!!!!!!!!\n\t\t\n//\t\tString Str1 = \"aaaabbbcc\", Str2 = \"cccaabbb\";\n//\t\t\n//\t\tStr1 = new TreeSet<String>( Arrays.asList(Str1.split(\"\"))).toString();\n//\t\tStr2 = new TreeSet<String>( Arrays.asList(Str2.split(\"\"))).toString();\n//\t\tSystem.out.println(Str1.equals(Str2));\n//\t\t\n//\t\t\n\t\t\n}",
"public static void main(String[] args) {\n\t\n\tString a = \"aabbbc\", b= \"cabbbac\";\n\t// a = abc, b=cab\n\t//we will remove all dublicated values from \"a\"\n\tString a1 = \"\"; //store all the non duplicated values from \"a\"\n\t\n\tfor (int j=0; j<a.length();j++) //this method is with nested loop\n\tfor (int i=0; i<a.length();i++) {\n\t\tif (!a1.contains(a.substring(j, j+1))) {\n\t\t\ta1 += a.substring(j, j+1);\n\t\t}\n\t\t\t\n\t}\n\tSystem.out.println(a1);\n\t//we will remove all duplicated values from \"b\"\n\tString b1 = \"\"; //store all the non duplicated values from \"b\"\n\tfor(int i=0; i<b.length();i++) { //this is with simple loop\n\t\tif(!b1.contains(b.substring(i, i+1))) {\n\t\t\t // \"\"+b.charAt(i)\n\t\t\tb1 += b.substring(i, i+1);\n\t\t\t// \"\"+b.charAt(i);\n\t\t}\n\t}\n\tSystem.out.println(b1);\n\t\n\t\n\t//a1 = \"acb\", b1 = \"cab\"\n\tchar[] ch1 = a1.toCharArray();\n\tSystem.out.println(Arrays.toString(ch1));\n\t\n\tchar[] ch2 = b1.toCharArray();\n\tSystem.out.println(Arrays.toString(ch2));\n\t\n\tArrays.sort(ch1);\n\tArrays.sort(ch2);\n\t\n\tSystem.out.println(\"========================\");\n\tSystem.out.println(Arrays.toString(ch1));\n\tSystem.out.println(Arrays.toString(ch2));\n\t\n\t\n\tString str1 = Arrays.toString(ch1);\n\tString str2 = Arrays.toString(ch2);\n\t\n\tif(str1.equals(str2)) {\n\t\tSystem.out.println(\"true, they are same letters\");\n\t}else {\n\t\tSystem.out.println(\"false, they are contain different letters\");\n\t}\n\t\n\t\n\t// solution 2:\n\t\t\t String Str1 = \"cccccaaaabbbbccc\" , Str2 = \"cccaaabbb\";\n\t\t\t \n\t\t\t Str1 = new TreeSet<String>( Arrays.asList( Str1.split(\"\"))).toString();\n\t\t\t Str2 = new TreeSet<String>( Arrays.asList( Str2.split(\"\"))).toString();\n\t\t\t \n\t\t\t System.out.println(Str1.equals(Str2));\n\t\t\t\t \n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n}",
"public static void main(String[] args) {\n\t\tStringBuilder sb=new StringBuilder();\n\t\tString str=\"xheixhixhi\";\n\t\tint x=0;\n\t\tfor(int i=0;i<str.length();i++)\n\t\t{\n\t\t\tif(str.charAt(i)=='x')\n\t\t\t\tx++;\n\t\t\n\t\t\telse\n\t\t\t\tsb.append(str.charAt(i));\n\t\t}\n\t\tfor(int i=0;i<x;i++)\n\t\t\tsb.append('x');\n\t\tSystem.out.println(sb);\n\t\t\n\t\tString str1=\"xxxyyy\";\n\t\tStringBuffer sb1=new StringBuffer(str1);\n\t\tSystem.out.println(sb1.toString());\n\t\tfor(int i=0;i<(str1.length());i++)\n\t\t{\n\t\t\tif(sb1.charAt(i)==sb1.charAt(i+1))\n\t\t\t{\n\t\t\t\tSystem.out.println(i);\n\t\t\t\tsb1.insert(++i,'*');\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\tSystem.out.println(sb1.toString());\n\t\t\n\t\t//anagram\n\t\tString s1=\"niveda\";\n\t\tString s2=\"Nivedas\";\n\t\tString s4=s2.toLowerCase();\n\t\tchar[] s3=s1.toCharArray();\n\t\tchar[] s5=s4.toCharArray();\n\t\tArrays.sort(s3);\n\t\tArrays.sort(s5);\n\t\tboolean result=Arrays.equals(s3, s5);\n\t\tSystem.out.println(\"result is \"+result);\n\t\t\n\t\t//check all digits\n\t\tString s=\"09779\";\n\t\tif (s.isEmpty())\n\t\t\tSystem.out.println(\"empty\");;\n\n\t\tfor (int i = 0; i < s.length(); i++) {\n\t\tint temp = s.charAt(i) - (int)'0';\n\t\tSystem.out.println(temp);\n\t\tif (temp < 0 || temp > 9)\n\t\t\tSystem.out.println(\"false\");\n\t\t\n\t\t}\n\n\t\tSystem.out.println(\"true\");\n\n\t\t//reverse a string\n\t\tString s6=\"niveda is\";\n\t\tString sb4=new StringBuffer(s6).reverse().toString();\n\t\tSystem.out.println(sb4);\n\t\t\n\t\tStringBuilder s7=new StringBuilder();\n\t\tchar[] c1=s6.toCharArray();\n\t\tfor(int i=c1.length-1;i>=0;i--)\n\t\t{\n\t\t\ts7.append(c1[i]);\n\t\t}\n\t\tSystem.out.println(s7);\n\t\t\n\t\t//replace with space\n\t\tString str5=\"xxx yyy\";\n\t\tStringBuilder sb6=new StringBuilder(str5);\n\t\tSystem.out.println(sb6.toString());\n\t\tfor(int i=0;i<(str5.length());i++)\n\t\t{\n\t\t\tif(sb6.charAt(i)==32)\n\t\t\t{\n\t\t\t\tSystem.out.println(i);\n\t\t\t\tsb6.replace(i,i+1,\"%20\");\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\tSystem.out.println(sb6.toString());\n\t\t\n\t\tString sentence=\"my name is niveda\";\n\t\tList< String> words = Arrays.asList(sentence.split(\"\\\\s\")); \n\t\tCollections.reverse(words); \n\t\t\n\t\tSystem.out.println(words);\n\t\tStringBuilder sb8 = new StringBuilder(sentence.length()); \n\t\t\n\t\tfor (int i = 0; i <=words.size() - 1; i++)\n\t\t{ \n\t\t\tsb8.append(words.get(i)); \n\t\t\t\n\t\tsb8.append(' ');\n\t\t}\n\t\tSystem.out.println(sb8.toString().trim());\n\t\t\n\t\tStringBuffer sb9=new StringBuffer(sentence);\n\t\tString sb10=sb9.reverse().toString();\n\t\tSystem.out.println(\"old \"+sb10.toString().trim());\n\t\t\n\t\tStringBuilder reverse = new StringBuilder(); \n\t\tString[] sa = sentence.trim().split(\"\\\\s\"); \n\t\tString newest=\"\";\n\t\tfor (int i = sa.length - 1; i >= 0; i--) \n\t\t{ \n\t\t\tString newword=sa[i]; \n\t\t\t//reverse.append(' '); \n\t\t\tString newstring=\"\";\n\t\t\tfor(int n=newword.length()-1;n>=0;n--)\n\t\t\t{\n\t\t\t\tnewstring=newstring+newword.charAt(n);\n\t\t\n\t\t\t}\n\t\t\tnewest=newest+newstring+\" \";\n\t\t} \n\t\tSystem.out.println( reverse.toString().trim());\n\t\tSystem.out.println(\"newest \"+newest);\n\t\tSystem.out.println(\"number of words in the string \"+sa.length);\n\n\t\t\n\t\t//reverse chars in the word in place\n\t\tString s11=\"my name is niveda\";\n\t\tString reversestring=\"\";\n\t\tString[] c11=s11.trim().split(\"\\\\s\");\n\t\tfor(int k=0;k<c11.length;k++)\n\t\t{\n\t\t\tString word=c11[k];\n\t\t\tString reverseword=\"\";\n\t\t\tfor(int m=word.length()-1;m>=0;m--)\n\t\t\t{\n\t\t\t\t\n\t\t\treverseword=reverseword+word.charAt(m);\n\t\t\t}\n\t\t\treversestring=reversestring+reverseword+\" \";\n\t\t}\n\t\t\n\t\tSystem.out.println( reversestring);\n\t}",
"@Test\n\tvoid testValidAnagram() {\n\t\t// Test for ValidAnagram\n\t\tValidAnagram tester = new ValidAnagram();\n\t\tassertTrue(tester.isAnagram(\"anagram\", \"nagaram\"));\n\t\tassertFalse(tester.isAnagram(\"rat\", \"car\"));\n\t\tassertTrue(tester.isAnagram(\"\", \"\"));\n\t\t\n\t\t// Test for ValidAnagram2\n\t\tValidAnagram2 tester2 = new ValidAnagram2();\n\t\tassertTrue(tester2.isAnagram(\"anagram\", \"nagaram\"));\n\t\tassertFalse(tester2.isAnagram(\"rat\", \"car\"));\n\t\tassertTrue(tester2.isAnagram(\"\", \"\"));\n\t}",
"public boolean isAPermutation(String st1, String st2) {\n\t\tif(st1.length() != st2.length() || st1.length() == 0 || st2.length() == 0) return false;\n\t\t\n\t\tHashMap<Character, Integer> cc1 = charactersCount(st1);\n\t\tHashMap<Character, Integer> cc2 = charactersCount(st2);\n\t\t\n\t\treturn sameCharactersCount(cc1, cc2);\n\t}",
"static boolean isPermutation_2(String a, String b){\n boolean isPermutation = true;\n //lets store every char in an array of boolean\n int[] charCount = new int[256];\n for(char c:a.toCharArray()){\n charCount[c]++;\n }\n //now verify the count in another string and subtract the count\n for(char c:b.toCharArray()){\n charCount[c]--;\n }\n //now check if any count is non-zero then the two string have unequal count of that char\n for(int i=0;i<charCount.length;i++)\n if(charCount[i]!=0)\n return false;\n \n return isPermutation;\n }",
"static String abbreviation(String a, String b) {\r\n \r\n HashSet<Character> aSet = new HashSet<>();\r\n\r\n for(int i = 0 ; i< a.length() ; i++){\r\n aSet.add(a.charAt(i));\r\n }\r\n \r\n for(int i = 0 ; i < b.length() ; i++){\r\n \r\n if(aSet.contains(b.charAt(i)) ){\r\n aSet.remove(b.charAt(i));\r\n }\r\n else if(aSet.contains(Character.toLowerCase(b.charAt(i)))){\r\n aSet.remove(Character.toLowerCase(b.charAt(i)));\r\n }\r\n else{\r\n return \"NO\";\r\n }\r\n \r\n\r\n }\r\n\r\n Iterator<Character> it = aSet.iterator();\r\n while(it.hasNext()){\r\n\r\n if(!isLowerCase(it.next())){\r\n return \"NO\";\r\n }\r\n }\r\n return \"YES\";\r\n \r\n /*\r\n String regex = \"\";\r\n for(int i = 0 ; i < b.length() ; i++){\r\n regex += \"[a-z]*\" + \"[\" + b.charAt(i) + \"|\" + Character.toLowerCase(b.charAt(i)) + \"]\";\r\n }\r\n regex += \"[a-z]*\";\r\n Pattern ptrn = Pattern.compile(regex);\r\n Matcher matcher = ptrn.matcher(a);\r\n\r\n return matcher.matches() ? \"YES\" : \"NO\";\r\n*/\r\n \r\n /*\r\n int aPtr = 0;\r\n\r\n //b e F g H\r\n // E F H\r\n for(int i = 0 ; i < b.length() ; i++){\r\n\r\n if(aPtr + 1 >= a.length())\r\n return \"NO\";\r\n //if(aPtr + 1 == a.length() && i + 1 == b.length())\r\n // return \"YES\";\r\n\r\n System.out.println(b.charAt(i) + \" \" + a.charAt(aPtr));\r\n if(b.charAt(i) == a.charAt(aPtr)){\r\n aPtr++;\r\n }else if(b.charAt(i) == Character.toUpperCase(a.charAt(aPtr)) && isLowerCase(a.charAt(aPtr))){\r\n aPtr++;\r\n\r\n } else if(b.charAt(i) != a.charAt(aPtr) && !isLowerCase(a.charAt(aPtr))){\r\n return \"NO\";\r\n }else if(b.charAt(i) != a.charAt(aPtr) && isLowerCase(a.charAt(aPtr))){\r\n aPtr++;\r\n i--;\r\n }\r\n\r\n\r\n\r\n }\r\n for(int i = aPtr ; i < a.length() ; i++){\r\n if(!isLowerCase(a.charAt(i)))\r\n return \"NO\";\r\n }\r\n\r\n return \"YES\";\r\n */\r\n\r\n }",
"public static void main(String[] args) {\n\tScanner scanner=new Scanner(System.in);\n\tSystem.out.println(\"enter the first string\");\n\tString firstString=scanner.nextLine();\n\tSystem.out.println(\"enter the second string\");\n\tString secondString=scanner.nextLine();\n\t/*\n\t * function call\n\t * to check the anagram or not\n\t * \n\t */\n\tUtility.isAnagram(firstString, secondString);\n\tscanner.close();\n}",
"private static boolean isEnglishAlphabetPermutation(String str1, String str2) {\r\n if (!validate(str1, str2)) {\r\n return false;\r\n }\r\n if (str1.isEmpty() && str2.isEmpty()) { // simple case\r\n return true;\r\n }\r\n str1 = str1.toLowerCase();\r\n str2 = str2.toLowerCase();\r\n\r\n // we can use array instead of hash map\r\n // because we definitely know amount of characters\r\n int[] counter = new int[CHARS_AMOUNT];\r\n int startCode = Character.codePointAt(\"a\", 0);\r\n for (int i = 0; i < str1.length(); i++) {\r\n int idx = str1.codePointAt(i) - startCode;\r\n if (idx < 0 || idx >= CHARS_AMOUNT) {\r\n throw new IllegalArgumentException(\"Unsupported character.\");\r\n }\r\n counter[idx]++;\r\n }\r\n // no need to create another array for checking\r\n for (int i = 0; i < str2.length(); i++) {\r\n int idx = str2.codePointAt(i) - startCode;\r\n if (idx < 0 || idx >= CHARS_AMOUNT) {\r\n throw new IllegalArgumentException(\"Unsupported character.\");\r\n }\r\n int checkValue = --counter[idx];\r\n if (checkValue < 0) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"private boolean alphabCheck(String first, String second) {\n\t\tif (first.length() == 1 || second.length() == 1) {\n\t\t\tif (first.compareTo(second) < 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (first.substring(0, 1).compareTo(second.substring(0,1)) < 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (first.substring(0, 1).compareTo(second.substring(0,1)) == 0) {\n\t\t\t\t\treturn alphabCheck(first.substring(1, first.length()),second.substring(1,second.length()));\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"static boolean isPermutation_1(String a, String b){\n //get the sorted format of a string\n String sorted_A = sortString(a);\n String sorted_B = sortString(b);\n return sorted_A.equals(sorted_B);\n }",
"public static void main(String[] args) {\n System.out.println(isAnagram(\"dog\", \"cat\"));\n }",
"public static void main(String[] args) {\n\t\tString str = \"Nitin\";\n\t\tSystem.out.println(str.indexOf(\"i\"));\n\t\tSystem.out.println(str.substring(0,3));\n\t\tboolean s =str.endsWith(\"i\");\n\t\tSystem.out.println(s);\n\t\t//change to char array\n\t\tchar[] arr = str.toCharArray();\n\t\t//intialize another array of same length\n\t\tchar[] arr_new = new char[str.length()];\n\t\t//now reverse the string and store into new array\n\t\tint j = 0;\n\t\tfor(int i =str.length()-1;i>=0;i--) {\n\t\t\tarr_new[j++] = arr[i];\n\t\t\t\n\t\t}\n\t\t//now convert the new array into String\n\t\tString str_new = new String(arr_new);\n\t\t\n\t\t//Logic to compare the strings\n\t\tif(str.equalsIgnoreCase(str_new)) {\n\t\t\tSystem.out.print(\"Anagram\" + str);}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Not Anagram\" + str);\n\t\t\t\t\n\t\t\t}\n\t\t}",
"static int makingAnagrams(String s1, String s2){\n // Complete this function\n StringBuilder b = new StringBuilder(s2);\n int delCount =0;\n for(int i=0;i<s1.length();i++){\n int index = b.indexOf(String.valueOf(s1.charAt(i)));\n if(index == -1){\n delCount++;\n }else{\n b.deleteCharAt(index);\n } \n }\n return delCount + b.length();\n }",
"static int sherlockAndAnagrams(String s) {\n\n // **** initialize count of anagrams ****\n int count = 0;\n\n // **** loop once per grouping of characters [1 : s.length() - 1] ****\n for (int g = 1; g < s.length(); g++) {\n\n // **** generate the base sub string ****\n for (int i = 0; i < s.length() - g; i++) {\n\n // **** starting string ****\n String bs = s.substring(i, i + g);\n\n // **** generate sub strings ****\n for (int j = i + 1; j <= s.length() - g; j++) {\n\n // **** generate current sub string ****\n String cs = s.substring(j, j + g);\n\n // **** check if anagram ****\n if (areAnagram(bs, cs)) {\n count++;\n }\n }\n }\n }\n\n // **** count of anagrams ****\n return count;\n }",
"boolean checkPermutation(String a, String b) {\r\n\r\n if (a == null || b == null) {\r\n throw new NullPointerException();\r\n }\r\n\r\n if (a.length() != b.length()) {\r\n return false;\r\n }\r\n\r\n Map<Character, Integer> frequencies = getFrequency(a);\r\n\r\n for (int i = 0; i < b.length(); i++) {\r\n char c = b.charAt(i);\r\n\r\n if (frequencies.containsKey(c)) {\r\n int count = frequencies.get(c);\r\n if (count == 0) {\r\n return false;\r\n }\r\n\r\n frequencies.replace(c, count - 1);\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }",
"public boolean isARotation(String s1, String s2) {\n\t\tif(s1.length() != s2.length()) return false;\n\t\t\n\t\tStringBuilder stb = new StringBuilder();\n\t\tint i = 0;\n\t\twhile(i < s1.length()) {\n\t\t\tif(s1.charAt(i) == s1.charAt(i)) {\n\t\t\t\treturn subString(s1.substring(0, i), s2) \n\t\t\t\t\t\t&& stb.toString().compareTo(s2.substring(i, s2.length()-1)) == 0;\n\t\t\t}\n\t\t\ti++;\n\t\t\tstb.append(s1.charAt(i));\n\t\t}\n\t\treturn false;\n\t}",
"public static boolean isPermuted(String str1, String str2) {\n if (str1.length() != str2.length())\n return false;\n\n Map<Character, Integer> str1CountMap = new HashMap<>();\n for (char c : str1.toCharArray()) {\n str1CountMap.put(c, str1CountMap.getOrDefault(c, 0) + 1);\n }\n\n for (char c : str2.toCharArray()) {\n if (!str1CountMap.containsKey(c) || str1CountMap.get(c) <= 0)\n return false;\n str1CountMap.put(c, str1CountMap.get(c) - 1);\n }\n\n return true;\n }",
"public static void main(String[] args) {\n\t\t\n\t\t\n\t\tAnagramCheck();\n\t\tSet<Character> se = new HashSet<Character>();\n\t\tSet<Character> se1 = new HashSet<Character>();\n\t\t\n\t\tStringBuffer sb = new StringBuffer();\n\t\tStringBuffer sb1 = new StringBuffer();\n\t\tString str =\"javav\";\n\t\t\n\t\tfor(int i =0; i <str.length();i++)\n\t\t{\n\t\t\tCharacter ch = str.charAt(i);\n\t\t\t\n\t\t\tif(!se.contains(ch))\n\t\t\t{\n\t\t\t\tse.add(ch);\n\t\t\t\tsb.append(ch);\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tse1.add(ch);\n\t\t\t\tsb1.append(ch);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"The duplicates after removed \"+sb.toString());\n\t\t\n\t\tSystem.out.println(\"The duplicate item is \"+sb1.toString());\n\t}",
"public boolean checkPermutaionOfStr(String str1, String str2){\n\tArrayList<Integer> word_cnt1 = new ArrayList<Integer>();\n\tArrayList<Integer> word_cnt2 = new ArrayList<Integer>();\n\t\n\tif(str1.length() != str2.length())\n\t\treturn false;\n\tfor(int i = 0; i< 256; i++){\n\t\tword_cnt1.add(0);\n\t\tword_cnt2.add(0);\n\t}\n\t\n\tfor(int i = 0; i< str1.length(); i++){\n\t\tcntStrChar(str1, word_cnt1, i);\n\t\tcntStrChar(str2, word_cnt2, i);\n\t}\n\t\n\tfor(int i = 0; i< 256; i++){\n\t\tif (word_cnt1.get(i) != word_cnt2.get(i) )\n\t\t\treturn false;\n\t}\n\treturn true;\n}",
"public static boolean checkPermutation(String str1, String str2) {\n if (str1.length() != str2.length()) // imediate check if string is not the same length, obviously false\n return false;\n // null check as well\n int[] arr = new int[256]; // ascii\n for (int i = 0; i < str1.length(); i++) { // for all chars in the first list\n char temp = str1.charAt(i); // get the char at the index\n int index = temp; // get the int val for the char\n arr[index] = arr[index] + 1; // increase an array at that index by 1\n }\n for (int i = 0 ; i < str1.length(); i++) { // for all values in the second string\n char temp = str2.charAt(i); // get the char at the index\n int index = temp; // get the val for that char\n arr[index] = arr[index] - 1; // decrement the array at the index by 1\n if (arr[index] < 0) // if the string has incorrect amount of letters,\n return false; // the array should have -1, which will return false\n }\n return true; // else return true\n }",
"@Test\n\tvoid testFindAllAnagramsInAString() {\n\t\tList<Integer> actual = new FindAllAnagramsInAString().findAnagrams(\"cbaebabacd\", \"abc\");\n\t\tList<Integer> expected = Arrays.asList(0, 6);\n\t\tassertEquals(expected.size(), actual.size());\n\t\tassertEquals(new HashSet<Integer>(expected), new HashSet<Integer>(actual));\n\n\t\tactual = new FindAllAnagramsInAString().findAnagrams(\"abab\", \"ab\");\n\t\texpected = Arrays.asList(0, 1, 2);\n\t\tassertEquals(expected.size(), actual.size());\n\t\tassertEquals(new HashSet<Integer>(expected), new HashSet<Integer>(actual));\n\n\t\tactual = new FindAllAnagramsInAString().findAnagrams(\"\", \"abc\");\n\t\texpected = Arrays.asList();\n\t\tassertEquals(expected.size(), actual.size());\n\t\tassertEquals(new HashSet<Integer>(expected), new HashSet<Integer>(actual));\n\n\t\tactual = new FindAllAnagramsInAString().findAnagrams(\"baa\", \"aa\");\n\t\texpected = Arrays.asList(1);\n\t\tassertEquals(expected.size(), actual.size());\n\t\tassertEquals(new HashSet<Integer>(expected), new HashSet<Integer>(actual));\n\n\t\tactual = new FindAllAnagramsInAString().findAnagrams(\"baa\", \"aa\");\n\t\texpected = Arrays.asList(1);\n\t\tassertEquals(expected.size(), actual.size());\n\t\tassertEquals(new HashSet<Integer>(expected), new HashSet<Integer>(actual));\n\n\t\tactual = new FindAllAnagramsInAString().findAnagrams(\"bpaa\", \"aa\");\n\t\texpected = Arrays.asList(2);\n\t\tassertEquals(expected.size(), actual.size());\n\t\tassertEquals(new HashSet<Integer>(expected), new HashSet<Integer>(actual));\n\t}",
"public static boolean areAnagrams(String anagram, String compare) {\n String sortedAnagram = AnagramUtil.sort(anagram);\n String sortedCompare = AnagramUtil.sort(compare);\n return sortedAnagram.equals(sortedCompare);\n }",
"private static boolean isPermutation(String str1, String str2) {\r\n if (!validate(str1, str2)) {\r\n return false;\r\n }\r\n if (str1.isEmpty() && str2.isEmpty()) { // simple case\r\n return true; // empty strings are permutation of each other\r\n }\r\n\r\n return fillCounter(str1).equals(fillCounter(str2));\r\n }",
"private static boolean equalityTest4(String a, String b)\n {\n if(a.length() == 0 && b.length() == 0)\n {\n return true;\n }\n else\n {\n if(a.length() == 0 || b.length() == 0)\n {\n return false;\n }\n if(a.charAt(0) == b.charAt(0))\n {\n return equalityTest4(a.substring(1), b.substring(1));\n }\n else\n {\n return false;\n }\n }\n }",
"public static boolean isPermutation(String str1, String str2)\r\n\t{\r\n\t\t if(str1.length() != str2.length()) return false;\r\n\t\t char[] charset1 = str1.toCharArray();\r\n\t\t char[] charset2 = str2.toCharArray();\r\n\t\t HashMap<Character, Integer> hashmap = new HashMap<Character, Integer>();\r\n\t\t \r\n\t\t for(char c : charset1)\r\n\t\t {\r\n\t\t\t if(!hashmap.containsKey(c)) hashmap.put(c, 1);\r\n\t\t\t else hashmap.put(c, hashmap.get(c) + 1);\r\n\t\t }\r\n\t\t \r\n\t\t for(char c : charset2)\r\n\t\t {\r\n\t\t\t if(!hashmap.containsKey(c) || hashmap.get(c) == 0) return false; \r\n\t\t\t hashmap.put(c, hashmap.get(c) - 1);\r\n\t\t }\r\n\t\t \r\n\t\t return true;\r\n\t}",
"public static boolean permuteCompare(String strA, String strB) {\n\t\tif(strA == null || strB == null)\n\t\t\treturn false;\n\t\t\n\t\t/*\n\t\t * Step 2: Check if the length of both strings is not equal, then they will not match\n\t\t */\n\t\tif(strA.length() != strB.length()) \n\t\t\treturn false;\n\t\t\n\t\t/*\n\t\t * Step 3: Convert both strings to ArrayList (split method looks like not a elegant way, but works)\n\t\t */\n\t\tList<String> strAList = new ArrayList<String>(Arrays.asList(strA.split(\"\")));\n\t\tList<String> strBList = new ArrayList<String>(Arrays.asList(strB.split(\"\")));\n\t\t\n\t\t/*\n\t\t * Step 4: Sort both ArrayList using Collections\n\t\t */\n\t\tCollections.sort(strAList);\n\t\tCollections.sort(strBList);\n\t\t\n\t\t/*\n\t\t * Step 5: Compare them using equals that will compare size and each element value (Ref: https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#equals-java.lang.Object-)\n\t\t */\n\t\tif(!strAList.equals(strBList))\n\t\t\treturn false;\n\n\t\treturn true;\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(IsAnagrams(\"ACT\", \"TAC\"));\n\n\t}",
"public static void main(String[] args) {\n\t\tString str1,str2;\r\n\t\tScanner sc=new Scanner(System.in);\r\n\t\tCheckAnagram obj=new CheckAnagram();\r\n\t\t\r\n\t\tSystem.out.println(\"Enter first string:\");\r\n\t\tstr1=sc.nextLine();\r\n\t\tSystem.out.println(\"Enter second string:\");\r\n\t\tstr2=sc.nextLine();\r\n\t\t\r\n\t\t\tSystem.out.println(obj.checkAnagram(str1,str2));\r\n\t}",
"public static boolean checkPermutation(String input1, String input2) {\n\n\t\tchar[] inputArray1 = input1.toCharArray();\n\t\tchar[] inputArray2 = input2.toCharArray();\n\n\t\tArrays.sort(inputArray1);\n\t\tArrays.sort(inputArray2);\n\n\t\tSystem.out.println(inputArray1);\n\t\tSystem.out.println(inputArray2);\n\n\t\treturn new String(inputArray1).equals(new String(inputArray2));\n\t}",
"public boolean isScramble(String s1, String s2) {\n int lena = s1.length();\n int lenb = s2.length();\n if(lena != lenb) return false;\n if(lena == 0||s1.equals(s2)) return true;\n char[] crr1 = s1.toCharArray();\n char[] crr2 = s2.toCharArray();\n Arrays.sort(crr1);\n Arrays.sort(crr2);\n if(!Arrays.equals(crr1,crr2)) return false;\n \n int i = 1; \n while(i< lena){\n String a1 = s1.substring(0,i);\n String b1 = s1.substring(i);\n String a2 = s2.substring(0,i);\n String b2 = s2.substring(i);\n if(isScramble(a1,a2) && isScramble(b1,b2)) return true;\n String a3 = s2.substring(lenb - i);\n String b3 = s2.substring(0, lenb-i);\n if(isScramble(a1,a3) && isScramble(b1,b3)) return true;\n i++;\n }\n return false;\n }",
"public static List<String> getAnagrams(List<String> strings)\n {\n /*Each character 'a'-'z' can be mapped to the nth prime number, where n is the index of\n the character in the alphabet. E.g. 'a': prime(0)=2, 'b': prime(1)=3, 'c': prime(2)=5, etc.\n Compute the product of the prime number mappings of the characters in s. Anagrams will have\n the same character product. Thus we can use the product as a key to a set of anagrams.*/\n\n Map<Long, Set<String>> map = new HashMap<Long, Set<String>>();\n\n for (String s : strings)\n {\n long prod = 1;\n for (char c : s.toCharArray())\n {\n prod *= (long) getCharToPrimeMap().get(c);\n }\n if (!map.containsKey(prod))\n {\n /*Key-value pair doesn't exist, so for the new key, create a new HashSet instance\n * for the new word (not yet an anagram match)*/\n map.put(prod, new HashSet<String>());\n }\n map.get(prod).add(s);\n }\n\n /*Add only the sets in the mapping with 2 or more elements (anagram match exists) to the result list*/\n List<String> result = new ArrayList<String>(map.size());\n for (Set<String> set : map.values())\n {\n if (set.size() > 1) result.addAll(set);\n }\n\n return result;\n }",
"public boolean isScramble(String s1, String s2) {\n if (s1.equals(s2)) return true;\n\n int[] letters = new int[26];\n for (int i = 0; i < s1.length(); i++) {\n letters[s1.charAt(i) - 'a']++;\n letters[s2.charAt(i) - 'a']--;\n }\n for (int i = 0; i < 26; i++) if (letters[i] != 0) return false;\n\n for (int i = 1; i < s1.length(); i++) {\n if (isScramble(s1.substring(0, i), s2.substring(0, i))\n && isScramble(s1.substring(i), s2.substring(i))) return true;\n if (isScramble(s1.substring(0, i), s2.substring(s2.length() - i))\n && isScramble(s1.substring(i), s2.substring(0, s2.length() - i))) return true;\n }\n return false;\n }",
"private static boolean isIsomorphic(String s, String t) {\n // quick check: diff len => cannot match\n if (s.length() != t.length()) {\n return false;\n }\n\n // record mapping of chars s -> t\n Map<Character, Character> map = new HashMap<>();\n // mark chars that has been mapped\n Set<Character> set = new HashSet<>();\n\n for (int i = 0; i < s.length(); ++i) {\n char sc = s.charAt(i);\n char tc = t.charAt(i);\n // check and map s[i] and t[i]\n if (map.containsKey(sc)) {\n if (map.get(sc) != tc) {\n // a is mapped to b & c\n return false;\n }\n } else {\n if (set.contains(tc)) {\n // cannot map a -> c\n // since there exist b -> c\n return false;\n }\n // map sc -> tc\n map.put(sc, tc);\n set.add(tc);\n }\n }\n\n return true;\n }"
] | [
"0.86265796",
"0.8569042",
"0.8498102",
"0.846856",
"0.8401846",
"0.84014297",
"0.8369838",
"0.83038855",
"0.82454264",
"0.8229323",
"0.8221364",
"0.8220733",
"0.8151944",
"0.81374675",
"0.8085419",
"0.80726063",
"0.80046135",
"0.7985494",
"0.79776156",
"0.7968501",
"0.7963051",
"0.79616773",
"0.78874093",
"0.7878927",
"0.7875751",
"0.7849222",
"0.7842453",
"0.78289974",
"0.78034955",
"0.77807343",
"0.77758694",
"0.77303225",
"0.7709146",
"0.7708178",
"0.76247406",
"0.7612558",
"0.75887114",
"0.75620764",
"0.755494",
"0.7510945",
"0.7466172",
"0.7421136",
"0.7406946",
"0.7401281",
"0.7398884",
"0.73970115",
"0.7379181",
"0.7373768",
"0.73381066",
"0.73349833",
"0.73076123",
"0.72861856",
"0.72215575",
"0.7184742",
"0.7177002",
"0.71160835",
"0.7106526",
"0.70878804",
"0.70706034",
"0.70669204",
"0.70657146",
"0.70573497",
"0.70365655",
"0.6990819",
"0.69721264",
"0.69714874",
"0.69101137",
"0.689648",
"0.68511087",
"0.68511075",
"0.6840608",
"0.68378913",
"0.6814225",
"0.6778593",
"0.6771549",
"0.67488426",
"0.674551",
"0.6718813",
"0.67178535",
"0.6686913",
"0.6602034",
"0.652098",
"0.6460003",
"0.64428407",
"0.6440028",
"0.6395469",
"0.63941",
"0.63932467",
"0.6383415",
"0.6371332",
"0.6355993",
"0.6343255",
"0.63303316",
"0.6328641",
"0.6315911",
"0.6300669",
"0.6290234",
"0.6264954",
"0.6258075",
"0.62371737"
] | 0.77101713 | 32 |
getting movieid's rated by user using userId | @GetMapping("/{userId}")
public ResponseEntity<?> getMovieRatingsByUserId(@PathVariable int userId)
{
UserRatingResponse ratingSrviceReponse=restTemplateClient.getForObject("http://movie-rating-service/ratings/"+userId,UserRatingResponse.class);
List<MovieRating> movieRatingList=ratingSrviceReponse.getMovieRatingList();
//getting movie descriptions
List<MovieRatingMapping> mapping=movieRatingList.stream().map(movieRating -> {
Movie movie=restTemplateClient.getForObject("http://movie-info-service/movies/"+movieRating.getMovieId(), Movie.class);
return new MovieRatingMapping(movie.getName(),movie.getDescription(),movieRating.getRating(),movie.getId());
}).collect(Collectors.toList());
RatingResponse response=new RatingResponse(mapping);
return new ResponseEntity<RatingResponse>(response, HttpStatus.OK);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"List<MovieRating> findAllByUserId(Long userId);",
"public double getRating(int userID, int movieID) {\n\t\tUser x = null;\n\t\tint ind = Collections.binarySearch(users, new User(userID));\n\t\tif(ind >= 0)\n\t\t\tx = users.get(ind);\n\t\telse\n\t\t\treturn -1;\n\n\t\tint ind2 = Collections.binarySearch(x.getRatings(), new Rating(userID, movieID));\n\t\tif(ind2 >=0)\n\t\t\treturn x.getRatings().get(ind2).getRating();\n\n\t\treturn -1;\n\t}",
"public double guessRating(int userID, int movieID) {\n\t\tMovie movie = null;\n\t\tUser user = null;\n\t\tdouble avgRating = 0;\n\t\tfor(Rating r : ratings) {\n\t\t\tavgRating += r.getRating();\n\t\t}\n\t\tavgRating /= ratings.size();\n\t\tfor(Movie m : movies) {\n\t\t\tif(m.getId() == movieID) {\n\t\t\t\tmovie = m;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor(User m : users) {\n\t\t\tif(m.getId() == userID) {\n\t\t\t\tuser = m;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tdouble movieAvg = movie.getAverageRating();\n\t\tdouble userAvg = user.getAverageRating();\n\t\tdouble userStdDeviationFromAvg = user.standardDeviationFromAvg();\n\n\t\tdouble userGenreAvg = 0;\n\t\tint count = 0;\n\t\tfor(Genre g : movie.getGenres()) {\n\t\t\tdouble x = user.genreAvgRating(g);\n\t\t\tif(x != 0) {\n\t\t\t\tuserGenreAvg += x;\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\tif(count != 0)\n\t\t\tuserGenreAvg /= count;\n\t\telse\n\t\t\tuserGenreAvg = userAvg;\n\n\n\t\tArrayList<User> similar = findSimilarUsers(user);\n\t\tif(similar.size() > 20) {\n\t\t\tdouble similarAvg = 0;\n\t\t\tint divisor = 0;\n\t\t\tfor(User u : similar) {\n\t\t\t\tArrayList<Rating> rates = u.getRatings();\n\t\t\t\tint ind = Collections.binarySearch(rates, new Rating(u.getId(), movie.getId()));\n\t\t\t\tif(ind >= 0) {\n\t\t\t\t\tsimilarAvg += rates.get(ind).getRating();\n\t\t\t\t\tdivisor++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(divisor > 20) {\n\t\t\t\t//\t\t\t\t0.7101228845726688\n\t\t\t\tsimilarAvg /= divisor;\n\t\t\t\treturn similarAvg;\n\t\t\t}\n\t\t}\n\n\t\tdouble rating1 = userStdDeviationFromAvg + movieAvg;\n\t\tdouble rating2 = userGenreAvg;\n\n\t\tif(rating1 < 1)\n\t\t\trating1 = 1;\n\t\telse if(rating1 > 5)\n\t\t\trating1 = 5;\n\n\t\tdouble finalRating = 0.3 * rating1 + 0.7 * rating2;\n\t\t//\t\tSystem.out.println(finalRating);\n\n\n\t\treturn finalRating;\n\t}",
"void getGivenUserRating(String uidRater, final RatingListResult result);",
"public int recommendMovie(int userID) {\n\t\tint ind = Collections.binarySearch(users, new User(userID));\n\t\tif(ind >= 0) {\n\t\t\tUser user = users.get(ind);\n\t\t\tif(ind >= 0) {\n\t\t\t\tArrayList<User> similar = findSimilarGenreUsers(user);\n\t\t\t\tif(similar.size() != 0)\n\t\t\t\t\treturn similar.get((int)(Math.random() * (similar.size()-1))).getTopMovie().getId();\n\t\t\t}\n\n\t\t\tArrayList<Genre> genres = user.getTopGenres();\n\t\t\tMovie x = findMovieOverlap(3, genres);\n\t\t\tif(x!= null)\n\t\t\t\treturn x.getId();\t\t\n\t\t\tx = findMovieOverlap(2.5, genres);\n\t\t\tif(x!= null)\n\t\t\t\treturn x.getId();\n\t\t}\n\t\treturn movies.get((int)(Math.random()*(movies.size()-1))).getId();\n\t}",
"@RequestMapping(\"/{userId}\")\n\tpublic ListRating getMovies(@PathVariable(\"userId\") String userId){\n\t\tSystem.out.println(\"Enter in getMovies, userId: \"+userId);\n\t\tList<Rating> movieRatings=new ArrayList<Rating>();\n\t\tmovieRatings.add(new Rating(\"1\", 3));\n\t\tmovieRatings.add(new Rating(\"2\", 5));\n\t\tmovieRatings.add(new Rating(\"3\", 2));\n\t\tmovieRatings.add(new Rating(\"4\", 1));\t\n\t\tListRating lR=new ListRating();\n\t\tlR.setListRating(movieRatings);\n\t\treturn lR;\n\t}",
"@PostMapping(\"/{userId}\")\n public ResponseEntity<?> getMovieRatingsByUserId(@PathVariable int userId,@RequestBody MovieRating movieRating)\n {\n try {\n restTemplateClient.getForEntity(\"http://movie-info-service/movies/\" + movieRating.getMovieId(), Movie.class);\n }catch (HttpClientErrorException e)\n {\n if(e.getStatusCode()==HttpStatus.NOT_FOUND)\n return new ResponseEntity<String>(\"required movie is not yet added\",HttpStatus.OK);\n }\n\n //if movieid present insert into rating service\n restTemplateClient.postForObject(\"http://movie-rating-service/ratings/\"+userId,movieRating,MovieRating.class);\n return new ResponseEntity<MovieRating>(movieRating,HttpStatus.OK);\n }",
"void getUserRatings(String uidRated, final RatingListResult result);",
"public ShelfItem getUserMovieByMovieId(String username, Long movie);",
"@GetMapping(\"/users/{userId}\")\r\n public UserRating getUserRating(@PathVariable(\"userId\") String userId) {\r\n List<Rating> ratings = Arrays.asList(\r\n new Rating(\"120\", 4),\r\n new Rating(\"35\", 3)\r\n );\r\n return new UserRating(ratings);\r\n }",
"public List<Rating> findRatingByMovie(String movieID);",
"Vote getWithUserAndRestaurant(int id, int userId);",
"public static Rating getRating(long id, User user)\n throws EnvoyServletException\n {\n try\n {\n return ServerProxy.getVendorManagement().getRatingById(user, id);\n }\n catch (Exception e)\n {\n throw new EnvoyServletException(e);\n }\n }",
"@Transactional\n\tpublic List<UserReview> getReviewByUserAndMovie(UserDetail userDetail, Movie movie) {\n\t\treturn userReviewRepopsitory.findByUserDetailAndMovie(userDetail, movie);\n\t}",
"public void getSimilarity(){\r\n\t\tfor(Integer i : read.rateMap.keySet()){\r\n\t\t\tif(i != this.userID){\r\n\t\t\t\t//Calculate the average rate.\r\n\t\t\t\tdouble iAverage = average.get(i);\r\n\t\t\t\tdouble a = 0.0;\r\n\t\t\t\tdouble b = 0.0;\r\n\t\t\t\tdouble c = 0.0;\r\n\t\t\t\t//Set a flag by default meaning the user does not have common rate with this user.\r\n\t\t\t\tboolean intersection = false;\r\n\t\t\t\tArrayList<Map.Entry<String, Double>> list = read.rateMap.get(i);\r\n\t\t\t\tfor(int j = 0; j < list.size(); j++){\r\n\t\t\t\t\tdouble userRate = 0;\r\n\t\t\t\t\tif(ratedID.contains(list.get(j).getKey())){\r\n\t\t\t\t\t\t//The user has common rated movies with this user\r\n\t\t\t\t\t\tintersection = true;\r\n\t\t\t\t\t\tfor(int k = 0; k < read.rateMap.get(userID).size(); k++){\r\n\t\t\t\t\t\t\tif(read.rateMap.get(userID).get(k).getKey().equals(list.get(j).getKey())){\r\n\t\t\t\t\t\t\t\tuserRate = read.rateMap.get(userID).get(k).getValue();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ta += (list.get(j).getValue() - iAverage) * (userRate- this.userAverageRate);\r\n\t\t\t\t\t\tb += (list.get(j).getValue() - iAverage) * (list.get(j).getValue() - iAverage);\r\n\t\t\t\t\t\tc += (userRate - this.userAverageRate) * (userRate - this.userAverageRate);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//Check if this user rated all the movies with the same rate.\r\n\t\t\t\tif(intersection && c == 0){\r\n\t\t\t\t\tfuckUser = true;//really bad user.\r\n\t\t\t\t\treturn;\r\n\t\t\t\t} \r\n\t\t\t\t//Check if current user rated all the movies with the same rate. If so, just set similarity as 0.\r\n\t\t\t\tif(intersection && b != 0){\r\n\t\t\t\t\tdouble s = a / (Math.sqrt(b) * Math.sqrt(c));\r\n\t\t\t\t\tsimilarity.put(i, s);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdouble s = 0;\r\n\t\t\t\t\tsimilarity.put(i, s);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Create a heap storing the similarity pairs in a descending order.\r\n\t\tthis.heap = new ArrayList<Map.Entry<Integer, Double>>();\r\n\t\tIterator<Map.Entry<Integer, Double>> it = similarity.entrySet().iterator();\r\n\t\twhile(it.hasNext()){\r\n\t\t\tMap.Entry<Integer, Double> newest = it.next();\r\n\t\t\theap.add(newest);\r\n\t\t}\r\n\t\tCollections.sort(this.heap, new Comparator<Map.Entry<Integer, Double>>() {\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(Map.Entry<Integer, Double> a, Map.Entry<Integer, Double> b){\r\n\t\t\t\treturn -1 * (a.getValue().compareTo(b.getValue()));\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"Movie getMovieById(final int movieId);",
"Vote get(int id, int userId);",
"public List<MovieDTO> getRecommendations(final long thisUserId, final int maxSize) {\n\n\t\tisTrue(thisUserId >= 0, \"The user id cannot be negative.\");\n\t\tisTrue(maxSize >= 0, \"The maximum recommendations size cannot be negative.\");\n\n\n\t\tfinal Map<Long, Double> otherSimilarUsers = userProfiler.getSimilarUsers(thisUserId);\n\n\t\tLOGGER.debug(\"Found [\" + otherSimilarUsers.size() +\"] similar users ...\");\n\n\n\t\tfinal double thisUserAverageRating = ratingRepository.findAverageByUserId(thisUserId);\n\n\t\tfinal Map<Long, MovieEntity> movieEntities = movieRepository.findAllNotViewedByThisUserButViewedByOtherUsers(thisUserId, newLinkedList(otherSimilarUsers.keySet()))\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.parallelStream()\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.collect(toMap(MovieEntity::getId, identity()));\n\n\t\tLOGGER.debug(\"Found [\" + movieEntities.size() +\"] candidate recommended movies ...\");\n\n\n\t\tfinal Map<Long, Double> predictedRatings = newHashMap();\n\n\n\t\tfor (final Long movieId : movieEntities.keySet()) {\n\n\t\t\tdouble numerator = 0D;\n\t\t\tdouble denominator = 0D;\n\n\n\t\t\tfor (final Long otherUserId : otherSimilarUsers.keySet()) {\n\n\t\t\t\tdouble matchScore = otherSimilarUsers.get(otherUserId);\n\n\n\t\t\t\tfinal Optional<RatingEntity> optionalRatingEntity = ratingRepository.findByUserIdAndMovieId(otherUserId, movieId);\n\n\t\t\t\tif (optionalRatingEntity.isPresent()) {\n\n\t\t\t\t\tfinal double otherUserMovieRating = optionalRatingEntity.get().getRating();\n\n\t\t\t\t\tfinal double otherUserAverageRating = ratingRepository.findAverageByUserId(otherUserId);\n\n\n\t\t\t\t\tnumerator += matchScore * (otherUserMovieRating - otherUserAverageRating);\n\n\t\t\t\t\tdenominator += abs(matchScore);\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tdouble predictedRating = 0D;\n\n\t\t\tif (denominator > 0D) {\n\n\t\t\t\tpredictedRating = thisUserAverageRating + (numerator / denominator);\n\n\n\t\t\t\tif (predictedRating > MAX_RATING_SCORE) {\n\n\t\t\t\t\tpredictedRating = MAX_RATING_SCORE;\n\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tLOGGER.debug(\"MovieId: [\" + movieId + \"] - predicted rating: [\" + predictedRating + \"]\");\n\n\t\t\tpredictedRatings.put(movieId, predictedRating);\n\t\t}\n\n\n\t\tfinal Map<Long, Double> recommendationsSorted = newTreeMap(new MapValueComparator(predictedRatings));\n\n\t\trecommendationsSorted.putAll(predictedRatings);\n\n\n\t\tLOGGER.debug(\"Returning the top-most [\" + maxSize + \"] recommended movies ...\");\n\n\t\treturn recommendationsSorted\n\t\t\t\t\t\t\t\t.entrySet()\n\t\t\t\t\t\t\t\t\t.stream()\n\t\t\t\t\t\t\t\t\t\t.limit(maxSize)\n\t\t\t\t\t\t\t\t\t\t.map(entry -> new MovieDTO( movieEntities.get(entry.getKey()).getPlainTitle(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgetMovieDescription(theMovieDBClient, movieEntities.get(entry.getKey())\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\t\t\t.getPlainTitle()\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\t\t\t\t.replaceAll(\".*?\\\\(.*?\\\\).*?\",\"\")\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\t\t\t\t.replace(\",\", \"\")),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmovieEntities.get(entry.getKey()).getYear(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmovieEntities.get(entry.getKey()).getRating()))\n\t\t\t\t\t\t\t\t\t\t.collect(toList());\n\t}",
"public Integer getSingleMovieItemBelonging(String username, Long movie);",
"void getRating(String rid, final RatingResult result);",
"public boolean likeMovie(int userId, int movieId) {\n\t\treturn false;\n\t}",
"public Rating findById(String ratingId);",
"private double getAverageByID(String id, int minimalRaters){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n RaterDatabase database = new RaterDatabase();\n database.initialize(ratingsfile);\n \n double avg_rating = 0.0;\n double running_total = 0.0;\n int count = 0;\n \n for (Rater rater : database.getRaters()){ \n \n if(rater.getItemsRated().contains(id)){\n \n double movie_rating = rater.getRating(id);\n \n running_total += movie_rating;\n \n count += 1;\n \n //System.out.println(movie_rating);\n\n }\n }\n\n if(count >= minimalRaters){\n avg_rating = running_total / count;\n }\n\n \n return avg_rating; \n \n }",
"public boolean isRatingGivenByUserExist(long movieId){\n SQLiteDatabase sqLiteDatabase = this.getReadableDatabase();\n String query = \"SELECT \" + MoviesDetailsEntry.COLUMN_USER_RATING + \" FROM \" + MoviesDetailsEntry.TABLE_NAME + \" WHERE \" +\n MoviesDetailsEntry._ID + \" = \" + movieId;\n Cursor cursor = sqLiteDatabase.rawQuery(query,null);\n if (cursor.getCount()<=0){\n cursor.close();\n return false;\n } else {\n cursor.close();\n return true;\n }\n }",
"@Override\n\tpublic Resident getResidentById(int user_id) {\n\t\tCriteria c=getSession().createCriteria(Resident.class);\n\t\tc.add(Restrictions.eq(\"user_id\",user_id));\n\t\tResident resident=(Resident) c.uniqueResult();\n\t\treturn resident;\n\t}",
"@Transactional\n\tpublic List<UserReview> getReviewByMovie(Movie movie) {\n\t\treturn userReviewRepopsitory.findByMovie(movie);\n\t}",
"public int findUser(int userIndex) {\n return this.usersRatings.find(userIndex);\n }",
"public ArrayList<String> getTimeLine(int userID){\n ArrayList<String> timeLine = new ArrayList<String>();\n ResultSet rs = null;\n String query = \"SELECT title, rating FROM movies, user_ratedmovies as r \"\n + \"WHERE id=movieID AND userID=\" + userID + \" \"\n + \"ORDER BY r.date_year, r.date_month, r.date_day, r.date_hour,\"\n + \" r.date_minute, r.date_second ASC\";\n try{\n con = ConnectionFactory.getConnection();\n stmt = con.createStatement();\n rs = stmt.executeQuery(query);\n while(rs.next()){\n String title = rs.getString(\"title\").trim();\n double rating = rs.getDouble(\"rating\");\n timeLine.add(title + \"\\t\" + rating);\n }\n }\n catch(SQLException e){\n e.printStackTrace();\n }\n return timeLine;\n }",
"@Repository\npublic interface RatingRepository extends JpaRepository<MovieRating, Long> {\n\n /**\n * Native Query that returns the current highest userId\n * @return highest User Id\n */\n @Query(value = \"select max(user_id) from tbl_rating\", nativeQuery = true)\n Long getHighestId();\n\n /**\n * Get all ratings of a certain user\n * @param userId id of the user\n * @return list of ratings\n */\n List<MovieRating> findAllByUserId(Long userId);\n}",
"public RateMovieResponse rateMovie(int movieId, RateMovieRequest rateMovieRequest, String guestSessionId, String sessionId) {\n // /movie/{movie_id}/rating\n String path = String.format(\"/movie/%s/rating\", movieId);\n Map<String, Object> requestParams = new HashMap<>();\n requestParams.put(\"guest_session_id\", guestSessionId);\n requestParams.put(\"session_id\", sessionId);\n return restClient.post(path, requestParams, new TypeReference<>() {\n\n\n }\n , rateMovieRequest);\n }",
"int getVoteValue(UserId userId, QuestionId questionId);",
"public double getRating(){\n\t\treturn this.user_rating;\n\t}",
"public double getRatingAt(int pos) {\n return this.usersRatings.get(pos).getRating();\n }",
"@Override\n public Iterable<Rating> findRatingsByUser(CafeteriaUser user) {\n return match(e -> e.user().equals(user));\n }",
"UserRepresentation getUserRepresentation(final String userId);",
"@Override\n\tpublic Exam_User getUserResultByUserExam(int userId, int examId) {\n\t\treturn examResultRepo.getExamReSultByUserExam(examId, userId);\n\n\t}",
"@Secured({\"ROLE_USER\", \"ROLE_ADMIN\"}) \r\n\tMovie findByMovieID(Long movieID);",
"public abstract VisitorProfile findByUserId(String userId);",
"@GET\n @Path(value = \"user\")\n public List<JsonMovie> getAllWithParams(@Context HttpServletRequest request, \n\t\t\t@QueryParam(\"from\") int from, @QueryParam(\"limit\") int limit,\n\t\t\t@QueryParam(\"orderBy\") String orderBy, @QueryParam(\"orderDir\") String orderDir,\n\t\t\t@QueryParam(\"userId\") Integer userId) {\n\t\tList<JsonMovie> movies = movieDao.getUserMovies(from, limit, orderBy, orderDir, userId);\n \tLOGGER.info(\"find \"+movies.size()+\" movies in the database\");\n\t\tString artistName = \"\";\n\t\tInteger artistId = 0;\n\t\tList<Movieartist> martists = null;\n \tfor (JsonMovie m : movies) {\n\t\t\tmartists = movieDao.getMovieArtists(m.getId());\n\t\t\tif (!martists.isEmpty()) {\n\t\t\t\tartistName = martists.get(0).getArtistBean()\n\t\t\t\t\t\t.getName()\n\t\t\t\t\t\t+ \" \"\n\t\t\t\t\t\t+ martists.get(0).getArtistBean()\n\t\t\t\t\t\t\t\t.getFirstname();\n\t\t\t\tartistId = martists.get(0).getArtistBean().getId();\n\t\t\t} else {\n\t\t\t\tartistName = \"\";\n\t\t\t\tartistId = 0;\n\t\t\t}\n\t\t\tm.setRealisator(artistName);\n\t\t\tm.setRealisatorId(artistId);\n \t}\n \treturn movies;\n }",
"public Object queryObject(String userId) {\n\t\tUserInfoQuery userInfoQuery = new UserInfoQuery();\n\t\tuserInfoQuery.setUserId(userId);\n\t\tList<UserInfo> userInfos = userInfoManager.queryList(userInfoQuery);\n\t\tUserInfo userInfo = userInfos.get(0);\n\t\tif(RoleIdEnums.AUTHOR.getCode().equals(userInfo.getRoleId())){\n\t\t\tAuthorInfoQuery authorInfoQuery= new AuthorInfoQuery();\n\t\t\tauthorInfoQuery.setAuthorId(userInfo.getRefId());\n\t\t\tList<AuthorInfo> authorInfos= authorInfoManager.queryList(authorInfoQuery);\n\t\t\tAuthorInfo authorInfo = authorInfos.get(0);\n\t\t\treturn authorInfo;\n\t\t}else if(RoleIdEnums.READER_P.getCode().equals(userInfo.getRoleId()) || RoleIdEnums.READER_E.getCode().equals(userInfo.getRoleId())){\n\t\t\t//TODO:\n\t\t\tReaderInfoQuery readerInfoQuery= new ReaderInfoQuery();\n\t\t\treaderInfoQuery.setReaderId(userInfo.getRefId());\n\t\t\tList<ReaderInfo> readerInfos= readerInfoManager.queryList(readerInfoQuery);\n\t\t\tReaderInfo readerInfo = readerInfos.get(0);\n\t\t\treturn readerInfo;\n\t\t}\n\t\treturn null;\n\t}",
"@PostMapping(value = \"/readMediaRuleByUserId\")\n\tpublic @ResponseBody ResultVO readMediaRuleByUserId(HttpServletRequest req) {\n\t\tResultVO resultVO = new ResultVO();\n\t\tString userId = req.getParameter(\"userId\");\n\t\ttry {\n\t\t\tif (userId != null && userId.trim().length() > 0) {\n\t\t\t\tResultVO userRoleInfo = userService.getUserConfIdByUserId(userId);\n\t\t\t\tif (GPMSConstants.MSG_SUCCESS.equals(userRoleInfo.getStatus().getResult())) {\n\t\t\t\t\tUserRoleVO vo = (UserRoleVO) userRoleInfo.getData()[0];\n\t\t\t\t\tif (vo.getMediaRuleId() != null && vo.getMediaRuleId().length() > 0) {\n\t\t\t\t\t\tresultVO = getMediaRuleByRoleId(vo.getMediaRuleId(), GPMSConstants.RULE_GRADE_USER);\n\t\t\t\t\t\treturn resultVO;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// get role by deptCd in user\n\t\t\t\tuserRoleInfo = userService.getUserConfIdByDeptCdFromUserId(userId);\n\t\t\t\tif (GPMSConstants.MSG_SUCCESS.equals(userRoleInfo.getStatus().getResult())) {\n\t\t\t\t\tUserRoleVO vo = (UserRoleVO) userRoleInfo.getData()[0];\n\t\t\t\t\tif (vo.getMediaRuleId() != null && vo.getMediaRuleId().length() > 0) {\n\t\t\t\t\t\tresultVO = getMediaRuleByRoleId(vo.getMediaRuleId(), GPMSConstants.RULE_GRADE_DEPT);\n\t\t\t\t\t\treturn resultVO;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tresultVO = getMediaRuleByRoleId(null, GPMSConstants.RULE_GRADE_DEFAULT);\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"error in readMediaRuleByUserId : {}, {}, {}\", GPMSConstants.CODE_SYSERROR,\n\t\t\t\t\tMessageSourceHelper.getMessage(GPMSConstants.MSG_SYSERROR), ex.toString());\n\t\t\tif (resultVO != null) {\n\t\t\t\tresultVO.setStatus(new StatusVO(GPMSConstants.MSG_FAIL, GPMSConstants.CODE_SYSERROR,\n\t\t\t\t\t\tMessageSourceHelper.getMessage(GPMSConstants.MSG_SYSERROR)));\n\t\t\t}\n\t\t}\n\n\t\treturn resultVO;\n\t}",
"public double predictRatings(long userId, long itemId) throws TasteException{\n\t\tFastIDSet items = null;\n\t\tif(model.getItemIDsFromUser(userId) != null)\n\t\titems = model.getItemIDsFromUser(userId);\n\t\telse\n\t\t\treturn 0.0;\n\t\t\n\t\tLongPrimitiveIterator iter = items.iterator();\n\t\tdouble total=0.0,totalWeight = 0.0, sim = 0.0;\n\t\twhile(iter.hasNext()){\n\t\t\tlong ratedItem = iter.nextLong();\n\t\t\tfloat rating = model.getPreferenceValue(userId, ratedItem);\n\n\t\t\tsim = sim1.itemSimilarity(itemId, ratedItem);\n\t\t\tif(sim < 0.0 || Double.isNaN(sim))\n\t\t\t\tsim = 0.0;\n\t\t\t\n\t\t\ttotal = total + sim * rating;\n\t\t\ttotalWeight = totalWeight + sim;\n\t\t}\n\t\tif(totalWeight > 0.0)\n\t\ttotal = total / totalWeight;\n\t\telse\n\t\t\ttotal = 0.0;\n\t\tif(total > 5.0)\n\t\t\ttotal = 5.0;\n\t\treturn total;\n\t}",
"@Override\n public ContentWatched retrieveContentWatchedRecordsByUserId(String userId) {\n logger.debug(\"retrieveContentWatchedRecordsByUserId called\");\n return repository.findById(userId).orElse(new ContentWatched());\n }",
"@Override\n\tpublic void getFavorit(int idUser) {\n\t\t\n\t}",
"Optional<TurRating> findByTurIdAndCustomerId(Integer turId, Integer customerId);",
"public static Object getUserDetails(int user_id)\r\n {\r\n Fisher f = DatabaseController.selectFisherRecord(user_id);\r\n\r\n if(f != null)\r\n {\r\n return f;\r\n }\r\n else\r\n {\r\n Intermediary i = DatabaseController.selectIntermediaryRecord(user_id);\r\n return i;\r\n }\r\n }",
"public List<Rider> getAllUsersRides(int userId) {\n\t\tList<Rider> allUsersRides = new ArrayList<Rider>();\n\t\tList<Rider> allRides = this.getAllRiders();\n\t\tfor(Rider r: allRides)\n\t\t\tif(r.getUserId()==userId)\n\t\t\t\tallUsersRides.add(r);\n\t\treturn allUsersRides;\n\t}",
"public sust.bookshelves.entity.Rating getRating(java.lang.Integer id) throws GenericBusinessException {\n sust.bookshelves.hibernatehelper.HibernateQueryHelper hibernateTemplate = new sust.bookshelves.hibernatehelper.HibernateQueryHelper();\n try {\n Rating bean = (Rating) hibernateTemplate.get(Rating.class, id);\n return bean;\n } finally {\n log.debug(\"finished getRating(java.lang.Integer id)\");\n }\n }",
"public List<ImageFile> getUserImage(int userID) {\n List<ImageFile> listOfImages = null;\n Session session = sessionFactory.openSession();\n // Try to return the user by the given nickname\n try {\n session.beginTransaction();\n \n // if mode equals MINE then get just users ID\n Criteria criteria = session.createCriteria(ImageFile.class);\n criteria.add(Restrictions.eq(\"ownerUser.userID\", userID));\n listOfImages = (List<ImageFile>) criteria.list();\n \n session.getTransaction().commit();\n session.flush();\n } \n catch (HibernateException e) { e.printStackTrace(); return null;} \n finally { session.close(); }\n // Return userID if seted\n return listOfImages;\n }",
"@Override\n\tpublic Image findImageByUserIdAndImageId(int userid, int imageid) {\n\t\treturn new ImageDaoImpl().findImageByUserIdAndImageId(userid,imageid);\n\t}",
"@Override\n\tpublic List<Movie> getMovieByRate(Ratings rating) {\n\t\treturn movieRepository.getMovieByRating(rating);\n\t}",
"public RateMovieResponse rateMovie(int movieId, RateMovieRequest requestBody) {\n return rateMovie(movieId, requestBody, null, null);\n }",
"public List<UsersRobots> findByUserId(int idUser){\n return (List<UsersRobots>) entityManager.createQuery(\"SELECT ur FROM UsersRobots ur where ur.idUser = :idUser\").setParameter(\"idUser\",idUser).getResultList();\n }",
"private List<Review> getUserReviews(String user_ID) {\n\t\tList<Review> Reviews = new ArrayList<Review>();\n\t\tfor (Review review : reviews) {\n\t\t\tif (user_ID.equals(review.getUserID())) {\n\t\t\t\tReviews.add(review);\n\t\t\t}\n\t\t}\n\n\t\treturn Reviews;\n\t}",
"@Override\r\n\tpublic RIdDto getRidFromUserId(String userId) throws Exception {\n\t\treturn null;\r\n\t}",
"public ArrayList<String> getGenreBreakdown(int userID){\n ArrayList<String> breakdown = new ArrayList<String>();\n String query = \"SELECT genre, round(count(*)/(SELECT count(*) \"\n + \"FROM user_ratedmovies \"\n + \"WHERE userID=\" + userID + \")*100) as percentage \"\n + \"FROM user_ratedmovies, movie_genres \"\n + \"WHERE userID=\" + userID + \" \"\n + \"AND user_ratedmovies.movieID=movie_genres.movieID \"\n + \"GROUP BY genre \"\n + \"ORDER BY percentage DESC\";\n ResultSet rs = null;\n try{\n con = ConnectionFactory.getConnection();\n stmt = con.createStatement();\n rs = stmt.executeQuery(query);\n while(rs.next()){\n String tag = rs.getString(\"genre\").trim();\n int percentage = rs.getInt(\"percentage\");\n breakdown.add(tag + \"\\t\" + percentage + \"%\");\n }\n }\n catch(SQLException e){\n e.printStackTrace();\n }\n return breakdown;\n }",
"public abstract ArrayList<Integer> getRecommendations(final Integer userId, final DatasetReader reader);",
"@Override\r\n\tpublic User_Detail getUserDetail(int userId) {\n\t\treturn sessionFactory.getCurrentSession().get(User_Detail.class, Integer.valueOf(userId));\r\n\t}",
"public User getUser(Long userId);",
"double getRating();",
"public int getMovieFlexRatings(String uuid);",
"private long calculateAvaregeRating(long curentUserRating) {\n long totalStars = 0;\n for (int x = 1; x < 6; x++) {\n totalStars = totalStars + ((long) documentSnapshot.get(x + \"_star\")) * x;\n }\n totalStars = totalStars + curentUserRating;\n return totalStars / ((long) documentSnapshot.get(\"total_rating\") + 1);\n }",
"public int getUserAt(int pos) {\n return this.usersRatings.get(pos).getIndex();\n }",
"private void UpdateRating(final String userId, long rating, long amtOfRatings, int ratingAsInt, final String rideType){\n final long amtOfRatingsIncludingThis = amtOfRatings + 1;\n final long ratingToAddToDB;\n final float ratingBeforeRounding;\n final long accumulatedRating;\n\n //if the rating is -1 then the driver has never been rated\n //need to check for this as calc is different\n if(rating == -1){\n ratingToAddToDB = ratingAsInt / 1;\n }else{\n accumulatedRating = amtOfRatings * rating;\n ratingBeforeRounding = ((float)ratingAsInt + (float)accumulatedRating) / (float)amtOfRatingsIncludingThis;\n ratingToAddToDB = Math.round(ratingBeforeRounding);\n }\n\n //submit the rating to the db and remove it from the passenger using firebase db methods\n DocumentReference userRef = dataStore.collection(\"users\").document(userId);\n userRef.get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {\n @Override\n public void onComplete(@NonNull Task<DocumentSnapshot> returnedTask) {\n if (returnedTask.isSuccessful()) {\n DocumentSnapshot userDoc = returnedTask.getResult();\n if (userDoc.exists()) {\n Map<String, Object> userMap = new HashMap<>();\n userMap.put(\"rating\", ratingToAddToDB);\n userMap.put(\"amountOfRatings\", amtOfRatingsIncludingThis);\n\n dataStore.collection(\"users\").document(userId)\n .update(userMap)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void v) {\n Log.d(TAG, \"USER RATINGS UPDATED\");\n DeleteRideFromUser(rideType);\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.w(TAG, \"Failed to update in UpdateRating();\", e);\n }\n });\n } else {\n Log.d(TAG, \"Couldnt find the user\");\n }\n } else {\n Log.d(TAG, \"Exception: \", returnedTask.getException());\n }\n }\n });\n }",
"public User getUserById(Long userId);",
"@Override\n\tpublic UserStatistics fetchByPrimaryKey(long userId) {\n\t\treturn fetchByPrimaryKey((Serializable)userId);\n\t}",
"public int predictRating(User theUser, Video theVideo) throws NullPointerException;",
"User getUserDetails(int userId);",
"public long getResponsedByUserId();",
"@Override\n public Movie getFromId (Integer id) {return this.movies.get(id);}",
"@Override\n\tpublic ERSUser getUser(int userId) {\n\t\treturn userDao.selectUserById(userId);\n\t}",
"List<Movie> getMovie(String movieId);",
"public static List<Image> findImagesByUserId(Integer userId){\n return finder.where().eq(\"user_id\", userId).findList();\n }",
"public double getAverageByID(String movieID,int minimalRaters){\n double runsum=0.0;\n int numOfRaters=0;\n ArrayList<Rater> list=RaterDatabase.getRaters();\n for(int k=0;k<list.size();k++)\n {\n double currating=list.get(k).getRating(movieID);\n if(currating!=-1)\n {\n runsum+=currating;\n numOfRaters++;\n }\n }\n\n if(numOfRaters>=minimalRaters)\n {\n return runsum/numOfRaters;\n }\n else{\n return 0.0;\n }\n }",
"public int getRating();",
"public String getUserRating() {\n return userRating;\n }",
"@Override\n public User getUser(String userId){\n return userDAO.getUser(userId);\n }",
"@Override\n\tpublic User getUserById(int userId){\n\t\treturn userRepository.findById(userId).orElseThrow(()->new BookException (HttpStatus.NOT_FOUND,\"Invalid User id\"));\n\t}",
"private ArrayList<Rating> getSimilarities(String id){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n RaterDatabase database = new RaterDatabase();\n database.initialize(ratingsfile);\n \n ArrayList<Rating> dot_list = new ArrayList<Rating>();\n \n Rater me = database.getRater(id);\n \n for (Rater rater : database.getRaters()){\n \n if(rater != me){\n \n double dot_product = dotProduct(me, rater);\n \n if (dot_product >= 0.0){\n \n Rating new_rating = new Rating(rater.getID() , dot_product);\n \n dot_list.add(new_rating);\n }\n \n }\n \n }\n \n Collections.sort(dot_list , Collections.reverseOrder());\n \n return dot_list;\n \n }",
"List<TurRating> findByTurId(Integer turId);",
"@Override\n public List<VoteAnswer> findAllVotesFromUserId(int id) {\n return template.query(\"SELECT * FROM \" + tableName + \" WHERE user = ?\", rowMapper, id);\n }",
"@Override\n\tpublic Resident searchResident(int user_id) {\n\t\tCriteria c=getSession().createCriteria(Resident.class);\n\t\tc.add(Restrictions.eq(\"user_id\",user_id));\n\t\tResident resident=(Resident) c.uniqueResult();\n\t\treturn resident;\n\t}",
"@Override\r\n\tpublic void getById(String userId) {\n\t\t\r\n\t}",
"public void getAverageRatingOneMovie() {\n String shortMovieCsv = \"C:/Users/greg/IdeaProjects/capstone-coursera/data/ratedmovies_short.csv\";\n //String shortRatingsCsv = \"/home/greg/IdeaProjects/capstone-coursera/data/ratings_short.csv\";\n String shortRatingsCsv = \"C:/Users/greg/IdeaProjects/capstone-coursera/data/ratings_short.csv\";\n //String bigMovieCsv = \"/home/greg/IdeaProjects/capstone-coursera/data/ratedmoviesfull.csv\";\n //String bigRatingsCsv = \"/home/greg/IdeaProjects/capstone-coursera/data/ratings.csv\";\n //String bigRatingsCsv = \"/home/greg/IdeaProjects/capstone-coursera/data/ratings_file_test.csv\";\n\n SecondRatings secondRatings = new SecondRatings(shortMovieCsv, shortRatingsCsv);\n //SecondRatings secondRatings = new SecondRatings(bigMovieCsv, bigRatingsCsv);\n\n String movieId = secondRatings.getID(\"Vacation\");\n ArrayList<Rating> ratingArrayList = secondRatings.getAverageRatings(1);\n for (Rating rating : ratingArrayList) {\n if (rating.getItem().contains(movieId)) {\n System.out.println(secondRatings.getTitle(movieId) + \" has average rating: \" + rating.getValue());\n }\n }\n }",
"User getUser(String userId);",
"public static void getRatings(List<Long> propIDs, String userID,\r\n\t\t\tMap<Long, Integer> results) {\r\n\r\n\t\t// first build a list of rating ids based on the userID and the propID\r\n\t\tList<String> ratingIDs = new ArrayList<String>(propIDs.size());\r\n\t\tfor (Long id : propIDs) {\r\n\t\t\tratingIDs.add(buildID(userID, id));\r\n\t\t}\r\n\r\n\t\t// then batch get the rating objects\r\n\t\tMap<String, Rating> ratings = ofy.get(Rating.class, ratingIDs);\r\n\r\n\t\t// then build a return map of the integer rating and the proposition id\r\n\t\tfor (Rating rating : ratings.values()) {\r\n\t\t\tresults.put(rating.propID, rating.eval);\r\n\t\t}\r\n\t}",
"@GetMapping(path = \"userId\")\r\n\tpublic List<CatalogItem> getCatalog(@RequestParam String userId) {\r\n\r\n\t\tUserRating ratings = restTemplate.getForObject(\"http:localhost:8765//ratings-data-service/ratingsData/users?userId=\" + userId,\r\n\t\t\t\tUserRating.class);\r\n\t\treturn ratings.getUserRating().stream().map(rating -> {\r\n\t\t\t//for each movie Id, call movie info service and get details.\r\n\t\t\tMovie movie = restTemplate\r\n\t\t\t\t\t.getForObject(\"http:localhost:8765//movie-info-service/movies/movieId?movieId=\" + rating.getMovieId(), Movie.class);\r\n/*\t\t\t//using webClient\r\n\t\t\tMovie movie = webClientBuilder.build()\r\n\t\t\t\t\t.get()\r\n\t\t\t\t\t.uri(\"http://localhost:8082/movies/movieId?movieId=\"+rating.getMovieId())\r\n\t\t\t\t\t.retrieve()\r\n\t\t\t\t\t.bodyToMono(Movie.class)\r\n\t\t\t\t\t.block();\t*/\r\n\t\t\t//put them all together\r\n\t\t\treturn new CatalogItem(movie.getName(), \"Desc\", rating.getRating());\r\n\t\t}).collect(Collectors.toList());\r\n\t\t// return Collections.singletonList(new CatalogItem(\"Bhahubali\", \"War\", 8));\r\n\t}",
"@HystrixCommand(fallbackMethod = \"getRatingsFallback\", commandProperties = {\r\n // if the the service does not get a response for 2 sec, enable the circuit breaker\r\n @HystrixProperty(name=\"execution.isolation.thread.timeoutInMilliseconds\", value=\"2000\"),\r\n // maximum percentage of error that is allowed in a request volume of '20' requests,\r\n // if this happened fire the circuit breaker for 5 sec, and then switch it off again and continue receiving requests\r\n @HystrixProperty(name=\"circuitBreaker.errorThresholdPercentage\", value=\"20\"),\r\n @HystrixProperty(name=\"circuitBreaker.requestVolumeThreshold\", value=\"20\"),\r\n @HystrixProperty(name=\"circuitBreaker.sleepWindowInMilliseconds\", value=\"5000\"),\r\n })\r\n public Mono<Ratings> getRatings(int userId){\r\n\r\n return webClient\r\n .build()\r\n .get()\r\n .uri(ratingDataServiceUrl+\"/ratings/{userId}\", userId)\r\n .retrieve()\r\n .bodyToMono(Ratings.class);\r\n }",
"@Override\n public List<VoteAnswer> findAllVotesTowardsUserId(int userId) {\n return template.query(\"SELECT * FROM \" + tableName + \" WHERE vote_recipient = ?\", rowMapper, userId);\n }",
"public User getUserFromId(int userId){\n for (int i = 0; i < regUsers.size(); i++){\n if (regUsers.get(i).getUserId() == userId){\n return regUsers.get(i);\n }\n }\n\n for (int i = 0; i < adminUsers.size(); i++){\n if (adminUsers.get(i).getUserId() == userId){\n return adminUsers.get(i);\n }\n }\n return null;\n }",
"public User(int id) {\n\t\tthis.id = id;\n\t\tratings = new HashMap<Movie, Rating>();\n\t\tavgR = new Genre[19];\n\t\tfor(int i = 0; i < avgR.length; i++) {\n\t\t\tavgR[i] = new Genre(Genre.AVAILGENRES[i]);\n\t\t}\n\t}",
"private double getAverageByID(String movieId, int minimalRaters) {\r\n\t\tdouble average = 0, total = 0;\r\n\t\tint totalRaters = 0;\r\n\r\n\t\tArrayList<Rater> myRaters = RaterDatabase.getRaters();\r\n\r\n\t\tfor (Rater rater : myRaters) {\r\n\t\t\tif (rater.hasRating(movieId)) {\r\n\t\t\t\ttotalRaters++;\r\n\t\t\t\ttotal = total + rater.getRating(movieId);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (totalRaters >= minimalRaters) {\r\n\t\t\taverage = total / totalRaters;\r\n\t\t} else {\r\n\t\t\taverage = 0.0;\r\n\t\t}\r\n\t\treturn average;\r\n\t}",
"List<UserReward> getUserRewards(String userName) throws UserNotFoundException;",
"@RequestMapping(\"/{userId}\")\n public List<CatalogItem> getCatalog(@PathVariable(\"userId\") String userId){\n\n List<Rating> ratings = Arrays.asList(\n new Rating( \"1234\", 4),\n new Rating( \"5678\", 5)\n );\n\n //For each movieId, call movie info Service and get details\n /*return ratings.stream().map(rating -> new CatalogItem(\"Tranformers\", \"Test\", 4))\n .collect(Collectors.toList());*/\n return ratings.stream().map( rating -> {\n Movie movie = restTemplate.getForObject( \"http://localhost:8083/movies/\" + rating.getMovieId(), Movie.class);\n return new CatalogItem( movie.getName(), \"Test\", rating.getRating() );\n })\n .collect(Collectors.toList() );\n\n //Put them all together\n /*return Collections.singletonList(\n //new CatalogItem(\"Tranformers\", \"Test\", 4)\n );*/\n\n \n }",
"public Map<String, Rating> getUserRatings(String username) {\n Map<String, Rating> result = new HashMap<String, Rating>();\n Session session = sessionFactory.openSession();\n Transaction tx = null;\n\n try {\n tx = session.beginTransaction();\n\n DaoFactory daoFactory = new HibernateDaoFactory(session);\n UserDao userDao = daoFactory.getUserDao();\n RatingDao ratingDao = daoFactory.getRatingDao();\n\n User user = userDao.findByUsername(username);\n\n if(user == null) {\n throw new RuntimeException(\"No user found for id \" + username); //$NON-NLS-1$\n } else {\n List<Rating> ratings = ratingDao.findByUser(user);\n\n for (Rating rating : ratings) {\n result.put(rating.getTransformationActivity().getId(), rating);\n }\n }\n\n tx.commit();\n } catch (Exception e) {\n if (tx != null) {\n tx.rollback();\n }\n throw new RuntimeException(e);\n } finally {\n session.close();\n }\n\n return result;\n }",
"public static Task<QuerySnapshot> getTripSummaries(String userId) {\n return FirebaseFirestore.getInstance()\n .collection(Const.USERS_COLLECTION)\n .document(userId)\n .collection(Const.USER_TRIPS_COLLECTION)\n .get();\n }",
"@Override\n public Boolean bookMovie(User user, Movie movie, Theatre theatre) {\n Optional<Movie> requestedMovie = movieDao.findById(movie.getMovieId());\n if(!requestedMovie.isPresent())\n return false;\n\n //Check whether the user is valid.\n Map<String,String> userUriMap = new HashMap<>();\n userUriMap.put(\"id\",String.valueOf(user.getUserId()));\n User receivedUser = restTemplate.getForObject(userAppUrl,User.class,userUriMap);\n if(receivedUser==null)\n return false;\n\n\n return true;\n }",
"public double prediction(String itemID){\r\n\t\tif(fuckUser){\r\n\t\t\treturn this.userAverageRate;\r\n\t\t}\r\n\t\tArrayList<Map.Entry<Integer, Double>> neighbor = this.getNeighbor(itemID);\r\n\t\t//If this user is the bad user, just give the prediction with the same rate as the others which the user has been rated.\r\n\t\tif(neighbor.size() == 0){\r\n\t\t\treturn this.userAverageRate;\r\n\t\t}\r\n\t\tdouble a = 0.0;\r\n\t\tdouble b = 0.0;\r\n\t\tfor(int i = 0; i < neighbor.size(); i++){\r\n\t\t\tdouble neighborRate = 0;\r\n\t\t\tint neighborID = neighbor.get(i).getKey();\r\n\t\t\tdouble neighborAver = average.get(neighbor.get(i).getKey());\r\n\t\t\tfor(int j = 0; j < read.rateMap.get(neighborID).size(); j++){\r\n\t\t\t\tif(read.rateMap.get(neighborID).get(j).getKey().equals(itemID)){\r\n\t\t\t\t\tneighborRate = read.rateMap.get(neighborID).get(j).getValue();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ta += neighbor.get(i).getValue() * (neighborRate - neighborAver);\r\n\t\t\tb += Math.abs(neighbor.get(i).getValue());\r\n\t\t}\r\n\t\tdouble res = this.userAverageRate + a / b;\r\n\t\treturn res;\r\n\t}",
"@Override\r\n\tpublic User queryUserById(String userId) {\n\t\tUser user = userMapper.queryUserById(userId);\r\n\t\treturn user;\r\n\t}",
"public Short getUserRating() {\r\n return userRating;\r\n }"
] | [
"0.77417296",
"0.6939589",
"0.6821434",
"0.67231196",
"0.6641771",
"0.6615858",
"0.66049314",
"0.65348643",
"0.6501669",
"0.64954597",
"0.64617556",
"0.6454764",
"0.6146778",
"0.60585225",
"0.5997459",
"0.58779687",
"0.58726674",
"0.58681726",
"0.57845294",
"0.57813627",
"0.5769679",
"0.5763498",
"0.5727917",
"0.5716796",
"0.5684998",
"0.565325",
"0.5645655",
"0.5640691",
"0.563901",
"0.5621326",
"0.55904967",
"0.5587662",
"0.55783033",
"0.55733633",
"0.55513775",
"0.55473614",
"0.55417436",
"0.5455243",
"0.54431826",
"0.5442321",
"0.54112285",
"0.540623",
"0.5396958",
"0.5390563",
"0.5337232",
"0.5334036",
"0.53289115",
"0.5327978",
"0.53267807",
"0.5310582",
"0.53083366",
"0.5288863",
"0.52826273",
"0.528097",
"0.5278713",
"0.5275739",
"0.52637005",
"0.52631885",
"0.5262128",
"0.525228",
"0.5245004",
"0.52449733",
"0.5231585",
"0.5217915",
"0.5213872",
"0.52043015",
"0.5203232",
"0.5187485",
"0.51821953",
"0.51766896",
"0.51676935",
"0.51661205",
"0.51645106",
"0.51613694",
"0.5160869",
"0.51599294",
"0.5156733",
"0.515596",
"0.51509154",
"0.51454824",
"0.5142818",
"0.51385224",
"0.51380026",
"0.51319605",
"0.5129504",
"0.51245815",
"0.5121353",
"0.5112853",
"0.51066816",
"0.5096621",
"0.50921726",
"0.5088109",
"0.5082581",
"0.5082495",
"0.50824726",
"0.50802535",
"0.5068774",
"0.5068693",
"0.5064381",
"0.50610256"
] | 0.6569849 | 7 |
check moive id is present or not | @PostMapping("/{userId}")
public ResponseEntity<?> getMovieRatingsByUserId(@PathVariable int userId,@RequestBody MovieRating movieRating)
{
try {
restTemplateClient.getForEntity("http://movie-info-service/movies/" + movieRating.getMovieId(), Movie.class);
}catch (HttpClientErrorException e)
{
if(e.getStatusCode()==HttpStatus.NOT_FOUND)
return new ResponseEntity<String>("required movie is not yet added",HttpStatus.OK);
}
//if movieid present insert into rating service
restTemplateClient.postForObject("http://movie-rating-service/ratings/"+userId,movieRating,MovieRating.class);
return new ResponseEntity<MovieRating>(movieRating,HttpStatus.OK);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasID();",
"boolean hasID();",
"boolean hasID();",
"boolean hasID();",
"boolean hasID();",
"boolean hasID();",
"boolean hasID();",
"boolean hasID();",
"boolean hasID();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasId();",
"boolean hasMachineId();",
"boolean hasUnitId();",
"boolean hasResMineID();",
"boolean hasFromId();",
"boolean isSetID();",
"public boolean checkId(String id){\r\n\t\treturn motorCycleDao.checkId(id);\r\n\t}",
"boolean hasPlayerId();",
"@Override\n\tpublic boolean existId(String id) {\n\t\treturn false;\n\t}",
"boolean hasRecognitionId();",
"boolean hasServerId();",
"boolean hasMonsterID();",
"boolean hasMonsterID();",
"boolean hasHeroId();",
"boolean isSetId();",
"boolean hasContentId();",
"private boolean CheckID(String id) {\n\t\tif ((!id.matches(\"([0-9])+\") || id.length() != 9) && (!id.matches(\"S([0-9])+\") || id.length() != 10)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"boolean hasReceiverid();",
"boolean hasAdId();",
"static boolean verifyID(String id)\r\n\t{\r\n\t\tfor(int i = 0; i < id.length(); i++)\r\n\t\t{\r\n\t\t\tchar c = id.charAt(i);\r\n\t\t\tif((c <= 'Z' && c >= 'A') || (c >= 'a' && c <= 'z')) //isAlpha\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse if(c >= '0' && c <= '9' || c == '_' || c == '-') //is digit or _ or -\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse if(c == ' ')\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\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn id.length() > 0;\r\n\t}",
"boolean hasWorldid();",
"boolean hasWorldid();",
"boolean hasMessageInfoID();",
"boolean hasMessageID();",
"boolean hasResMineInstanceID();",
"public boolean validateID() {\n\t\tif (this.id == null || this.id.length() < 1)\n\t\t\treturn false;\n\t\ttry {\n\t\t\tInteger.parseInt(this.id);\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"boolean hasReceiverID();",
"public boolean isIdExist(int projectId) throws EmployeeManagementException;",
"public boolean isSetId()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(ID$6) != null;\n }\n }",
"public abstract boolean isNatureExist(long id);",
"boolean hasUid();",
"boolean hasUid();",
"boolean hasSendid();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"boolean hasMapID();",
"public boolean isSetID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(ID$24) != null;\n }\n }",
"boolean hasSteamID();",
"boolean hasTerminalId();",
"boolean hasParkingId();",
"boolean hasParkingId();",
"boolean hasParkingId();",
"boolean isNilID();",
"boolean hasMsgID();",
"boolean hasMsgID();",
"public boolean isSetID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(ID$12) != null;\n }\n }",
"public boolean isSetID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(ID$12) != null;\n }\n }",
"boolean hasMsgid();",
"public boolean hasId(long id)\r\n \t{ \r\n \t\tlogger.debug(\"calling hasId(\"+id+\") was called...\");\r\n \t\treturn(externalFileMgrDao.hasId(id));\r\n \t}",
"boolean hasPrerequisiteId();",
"boolean hasPokerId();",
"boolean hasMoneyID();",
"boolean hasMoneyID();",
"boolean hasMoneyID();"
] | [
"0.7217519",
"0.7217519",
"0.7217519",
"0.7217519",
"0.7217519",
"0.7217519",
"0.7217519",
"0.7217519",
"0.7217519",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.6975335",
"0.69098526",
"0.6853471",
"0.68473107",
"0.6787849",
"0.67692846",
"0.67535543",
"0.6746797",
"0.6737572",
"0.6546187",
"0.65031016",
"0.6480873",
"0.6480873",
"0.64640486",
"0.64327234",
"0.6407694",
"0.63983184",
"0.6379425",
"0.63747",
"0.6364164",
"0.63536286",
"0.63536286",
"0.6347383",
"0.63392377",
"0.63341725",
"0.63269144",
"0.63199127",
"0.6314309",
"0.6309566",
"0.6290405",
"0.6289403",
"0.6289403",
"0.6280782",
"0.6278902",
"0.6278902",
"0.6278902",
"0.6278902",
"0.6278902",
"0.6278902",
"0.6278902",
"0.6278902",
"0.6278902",
"0.6278902",
"0.6278902",
"0.6278902",
"0.6278902",
"0.62633586",
"0.6258799",
"0.62549955",
"0.62499946",
"0.62499946",
"0.62499946",
"0.6245503",
"0.62363976",
"0.62363976",
"0.6235458",
"0.6235458",
"0.6235117",
"0.62317216",
"0.6231402",
"0.6225436",
"0.6215221",
"0.6215221",
"0.6215221"
] | 0.0 | -1 |
////////////////////////////////////////////////////////////////////////// CONSTRUCTORS ////////////////////////////////////////////////////////////////////////// Default constructor. | public SIASES() {
super();
m_iChunkSize = 10;
m_sLastUser = EMPTY_STR;
m_sLastGroup = EMPTY_STR;
m_bIsDriverLoaded = false;
it = null;
if (isDebug == true) {
log.debug("Construtor: <valor m_iChunkSize: " + m_iChunkSize
+ "> <valor m_sLastUser: " + m_sLastUser
+ "> <m_sLastGroup: " + m_sLastGroup);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Constructor() {\r\n\t\t \r\n\t }",
"public Constructor(){\n\t\t\n\t}",
"defaultConstructor(){}",
"private Default()\n {}",
"@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }",
"public PSRelation()\n {\n }",
"void DefaultConstructor(){}",
"public CSSTidier() {\n\t}",
"public Basic() {}",
"public SgaexpedbultoImpl()\n {\n }",
"ConstructorPractice () {\n\t\tSystem.out.println(\"Default Constructor\");\n\t}",
"public Curso() {\r\n }",
"private Instantiation(){}",
"private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}",
"public CyanSus() {\n\n }",
"public Overview() {\n\t\t// It will work whenever i create object with using no parameter const\n\t\tSystem.out.println(\"This is constructor\");\n\t}",
"private Rekenhulp()\n\t{\n\t}",
"public Orbiter() {\n }",
"public Pitonyak_09_02() {\r\n }",
"public Aanbieder() {\r\n\t\t}",
"public Demo() {\n\t\t\n\t}",
"private TMCourse() {\n\t}",
"public Odontologo() {\n }",
"public Pasien() {\r\n }",
"private SingleObject()\r\n {\r\n }",
"public Tbdtokhaihq3() {\n super();\n }",
"public Libro() {\r\n }",
"public Generic(){\n\t\tthis(null);\n\t}",
"public Clade() {}",
"private NfkjBasic()\n\t\t{\n\t\t\t\n\t\t}",
"public Livro() {\n\n\t}",
"public Coche() {\n super();\n }",
"public Lanceur() {\n\t}",
"private MApi() {}",
"public Chick() {\n\t}",
"private Main() {\n\n super();\n }",
"public Anschrift() {\r\n }",
"private Composite() {\n }",
"public Cohete() {\n\n\t}",
"public DefaultNashRequestImpl() {\n\t\t\n\t}",
"public Factory() {\n\t\tsuper();\n\t}",
"public Main() {\n\t\tsuper();\n\t}",
"public Instance() {\n }",
"public SpeakerSerivceImpl() {\n\t\tSystem.out.println(\"No args in constructor\");\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"public Zeffit()\n {\n // TODO: initialize instance variable(s)\n }",
"public Chauffeur() {\r\n\t}",
"public HGDClient() {\n \n \t}",
"protected Asignatura()\r\n\t{}",
"public JSFOla() {\n }",
"public Main() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\r\n\t}",
"public Implementor(){}",
"public Connection() {\n\t\t\n\t}",
"public XCanopusFactoryImpl()\r\n {\r\n super();\r\n }",
"public OreAPI() {\n\t\tthis(DEFAULT_URL, null);\n\t}",
"@Override\r\n\tpublic void init() {}",
"private UI()\n {\n this(null, null);\n }",
"private Converter()\n\t{\n\t\tsuper();\n\t}",
"@Override public void init()\n\t\t{\n\t\t}",
"public CMN() {\n\t}",
"private Marinator() {\n }",
"private Marinator() {\n }",
"@Override\n\t\tpublic void init() {\n\t\t}",
"public Book() {\n\t\t// Default constructor\n\t}",
"@Override\n public void init() {}",
"public SlanjePoruke() {\n }",
"protected Betaling()\r\n\t{\r\n\t\t\r\n\t}",
"private Node() {\n\n }",
"public Ov_Chipkaart() {\n\t\t\n\t}",
"public Soil()\n\t{\n\n\t}",
"private Sequence() {\n this(\"<Sequence>\", null, null);\n }",
"public Model() {\n\t}",
"public Model() {\n\t}",
"public Phl() {\n }",
"private SingleObject(){}",
"private Aliyun() {\n\t\tsuper();\n\t}",
"public Data() {\n \n }",
"public Mannschaft() {\n }",
"private Singleton()\n\t\t{\n\t\t}",
"public Component() {\n }",
"public Alojamiento() {\r\n\t}",
"protected Approche() {\n }",
"private Util()\n {\n // Empty default ctor, defined to override access scope.\n }",
"public Resource() {\n }",
"public Resource() {\n }",
"public Parser()\n {\n //nothing to do\n }",
"public Documento() {\n\n\t}",
"protected Product() {\n\t\t\n\t}",
"public mapper3c() { super(); }",
"public API() {}",
"private HTTPSession ()\n\t{\n\t\tthis (null, false, null);\n\t}",
"private Ognl() {\n }",
"public RngObject() {\n\t\t\n\t}",
"public Data() {\n }",
"public Data() {\n }",
"public Content() {\n\t}",
"private Public() {\n super(\"public\", null);\n }",
"public Carrinho() {\n\t\tsuper();\n\t}",
"public StudentChoresAMImpl() {\n }",
"public Mitarbeit() {\r\n }",
"public ObjectFactory() {\n\t}"
] | [
"0.7992066",
"0.7774946",
"0.7702424",
"0.7700439",
"0.75166476",
"0.7439433",
"0.7438481",
"0.7370378",
"0.73698735",
"0.73466665",
"0.73288876",
"0.7323208",
"0.72811985",
"0.7259329",
"0.72437793",
"0.72421014",
"0.72338724",
"0.7227503",
"0.72069645",
"0.72018063",
"0.7189413",
"0.71877354",
"0.71862715",
"0.71526784",
"0.7139211",
"0.71347964",
"0.7132376",
"0.7127737",
"0.7126106",
"0.7105497",
"0.71036464",
"0.71018225",
"0.7095489",
"0.70871997",
"0.7074993",
"0.707162",
"0.70636547",
"0.7046425",
"0.70368683",
"0.70309234",
"0.7026001",
"0.7025348",
"0.70244306",
"0.70205235",
"0.6997783",
"0.6993573",
"0.6990189",
"0.6988452",
"0.69778144",
"0.6967857",
"0.6963731",
"0.69616103",
"0.6956574",
"0.6954292",
"0.69489056",
"0.6947769",
"0.69433695",
"0.6939843",
"0.69395596",
"0.69324964",
"0.69313693",
"0.69313693",
"0.6931365",
"0.6929047",
"0.6923572",
"0.69224834",
"0.6918287",
"0.69134444",
"0.69129634",
"0.69124925",
"0.6909778",
"0.6907886",
"0.6907886",
"0.69070107",
"0.6903943",
"0.6898646",
"0.6895877",
"0.68907285",
"0.6890199",
"0.6890035",
"0.68863016",
"0.6883916",
"0.6883804",
"0.68820244",
"0.68820244",
"0.68812627",
"0.687834",
"0.6877853",
"0.6877325",
"0.68721575",
"0.687199",
"0.6869966",
"0.68644345",
"0.6862139",
"0.6862139",
"0.6859227",
"0.6855417",
"0.6854266",
"0.6852569",
"0.6852043",
"0.68513817"
] | 0.0 | -1 |
Constructor for an OpenConnectorSample. | public SIASES(ConnectorConfig config, openconnector.Log log)
throws Exception {
super(config, log);
m_iChunkSize = 10;
m_sLastUser = EMPTY_STR;
m_sLastGroup = EMPTY_STR;
m_bIsDriverLoaded = false;
it = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected GaConnector() {\n }",
"default void init() {\n System.out.println(\"Init connector object...\");\n }",
"public Connector()\n\t{\n\t\tconn = null;\n\t}",
"public HttpConnector(){\n super();\n }",
"public LiveConnectDemo() {\n }",
"public HVConnect () {\n super();\n // TODO Auto-generated constructor stub\n }",
"public DBAO(Connection connect) {\r\n\r\n this.connector = connect;\r\n }",
"public BrowseOffenceAMClient() {\r\n }",
"public ConnectorDataSource() {\n super(CONNECTOR_BEAN_NAME, CONNECTOR_TABLE_NAME);\n }",
"public Sample()\n {\n inputs = new ArrayList<>();\n outputs = new ArrayList<>();\n numberOfInputs = 0;\n numberOfOutputs = 0;\n comment = \"\";\n }",
"public ConnectionMonitorSource() {\n }",
"public HttpConnector(JsonSystem system) {\r\n super(system);\r\n }",
"public Open() {\n //creates a new open instance\n }",
"public FBSimpleDataSource() {\n super();\n }",
"public OIDCProviderEndpointMetadata() {\n }",
"public UConnecte() {\n\t\tsuper();\n\t}",
"public CommonDataServiceForAppsSink() {}",
"public Connection() {\n\t\t\n\t}",
"public Os() {\n osBO = new OsBO();\n }",
"public HRModuleClient() {\n }",
"public JNDIConnector() {\n super();\n }",
"public OBOMapper() {\n this(true);\n }",
"public HGDClient() {\n \n \t}",
"public ServerConnecter() {\r\n\r\n\t}",
"public OLWMTSSource(){\n\t\tsuper();\n\t}",
"public OVChipkaart() {\n\n }",
"public LpsClient() {\n super();\n }",
"public TurnoVOClient() {\r\n }",
"public VOCSesame () {\n }",
"public ConnectorTestCase( String testName ) {\n super( testName );\n }",
"public Curso() {\r\n }",
"private HYCOM() {\n }",
"public ExampleModuleClient() {\r\n }",
"@SuppressWarnings(\"OverridableMethodCallInConstructor\")\n public Connect() {\n initComponents();\n setLocationRelativeTo(null);\n setResizable(false);\n setTitle(\"Connection to Data Base\");\n }",
"public TestCaseSocket() {\n\t}",
"public OpenlabReader() {\n super(\"Openlab LIFF\", new String[] {\"liff\", \"lif\"});\n }",
"protected PKCS11Connector() { /* left empty intentionally */\n }",
"public OpenClusterManagementAppsSchema() {\n }",
"public OMLBase(String oml_app_name) {\n\t\tthis(oml_app_name, System.getenv(\"OML_EXP_ID\").toString(), System\n\t\t\t\t.getenv(\"OML_NAME\").toString(), System.getenv(\"OML_SERVER\")\n\t\t\t\t.toString());\n\t}",
"public SQLCMDMeta(ConnectionFactory connector) {\r\n super();\r\n this.connector = connector;\r\n }",
"public TopologyLib() {\n }",
"public SocketChannelTarantoolConnection() {\n\t\tthis(\"localhost\", 33013);\n\t}",
"public OreAPI() {\n\t\tthis(DEFAULT_URL, null);\n\t}",
"public Orbiter() {\n }",
"Constructor() {\r\n\t\t \r\n\t }",
"public EventoWS() {\n }",
"public MSACWrapperSdk() {}",
"private Connection() {\n \n }",
"public BasicDriveTeleOp() {\n\n }",
"protected void initialize() { \n param1 = SmartDashboard.getNumber(\"param1\");\n param2 = SmartDashboard.getNumber(\"param2\");\n param3 = SmartDashboard.getNumber(\"param3\");\n param4 = SmartDashboard.getNumber(\"param4\");\n command = new C_DriveBasedOnEncoderWithTwist(param1, param2, param3);\n }",
"@Override\r\n public void initialize(URL url, ResourceBundle rb) {\r\n // TODO\r\n pBO = new ProdutoBO();\r\n }",
"public WebhookDecoderSample() {\n\n }",
"public OpcDeviceTest(String name)\n {\n super(name);\n }",
"public OpenFlowMeterProvider() {\n super(new ProviderId(\"of\", \"org.onosproject.provider.meter\"));\n }",
"public AvroRide() {}",
"public BasicSensor() {}",
"@Override public void init()\n\t\t{\n\t\t}",
"public ConnectedMap() {\n }",
"public LpsClient(String accessKey, String secretKey) {\n super(accessKey, secretKey);\n }",
"public TrackCoach() {\n\n\t}",
"public EO_ClientsImpl() {\n }",
"public XMLDatabaseConnector(String URI)\n\t{\n\t\tsetURI(URI);\n\t}",
"public OpDesc() {\n\n }",
"public PSO() {\r\n initialiseNetwork();\r\n initialisePSO();\r\n }",
"public Twitter() {\n }",
"public IRODSProtocol() {\n\t\tsuper(IRODS_PROTOCOL_NAME, IRODS_PROTOCOL_HELP);\n\t\tmetaDataSet = new IRODSMetaDataSet(this);\n\t}",
"public ConsulterOffres() {\n initComponents();\n }",
"public IRSensorSubsystem() {\n\n }",
"public JsonpConnectionInfo() {\n }",
"public Overview() {\n\t\t// It will work whenever i create object with using no parameter const\n\t\tSystem.out.println(\"This is constructor\");\n\t}",
"public DefaultConnectionProvider() {\n loadProperties();\n }",
"private CorrelationClient() { }",
"public BotDao(DBConnector dbConnector) {\n this.dbConnector = dbConnector;\n }",
"public SensorData() {\n\n\t}",
"public NetworkSource() {\n }",
"public OServerConfiguration() {}",
"public Constructor(){\n\t\t\n\t}",
"public JsonHttpChannel() {\n this.defaultConstructor = new JsonHttpEventFactory();\n }",
"public Ov_Chipkaart() {\n\t\t\n\t}",
"public SwimConnectionFactory() {\n\t\tsuper();\n\t}",
"public AbstractConnection() {\n }",
"public AccessPoint() {\n }",
"public LinkedIntegrationRuntimeRequest() {\n }",
"@Override\r\n\tpublic void init(EndpointConfig arg0) {\n\t\t\r\n\t}",
"@DataBoundConstructor\n public PluginTest(String servername, String address, String username, String password, String shareduser ,String sharedpasswd, String sharedpath, String mxpath, Boolean scenario) {\n this.servername = servername;\n this.address = address;\n this.username = username;\n this.password = password;\n this.sharedpasswd = sharedpasswd;\n this.shareduser = shareduser;\n this.mxpath = mxpath;\n this.sharedpath = sharedpath;\n this.scenario=scenario;\n }",
"public Odontologo() {\n }",
"private Connection() {\n\t\tSystem.out.println(\">> Connection Object Constructed at \"+this);\n\t}",
"public OracleDataSourceFactory()\n {\n super();\n System.out.println(\"Constructed OracleDataSourceFactory\");\n }",
"@Override\n public void init() {\n logger.info(\"Initializing Sample TAL adapter\");\n\n // In order to get ticket updates from Symphony adapter must subscribe to this explicitly here\n // After subscription is done, all updates will come to this adapter instance via calls to syncTalTicket method\n talProxy.subscribeUpdates(accountId, this);\n\n try {\n // obtain adapter configuration\n setConfig(talConfigService.retrieveTicketSystemConfig(accountId));\n } catch (Exception e) {\n throw new RuntimeException(\"SampleTalAdapterImpl was unable to retrieve \" +\n \"configuration from TalConfigService: \" + e.getMessage(), e);\n }\n\n // subscribe for getting adapter configuration updates\n talConfigService.subscribeForTicketSystemConfigUpdate(accountId,\n (ticketSystemConfig) -> setConfig(ticketSystemConfig));\n }",
"@Override\n\tpublic void init() {\n\t\t// Nothing to do in this example\n\t}",
"public TTL_CIL_Communicator()\n {\n }",
"public Communicator() {\n\t}",
"private CassandraIoSDK(APIConnection apiConnection, String apiUrl){\n\t\tthis.apiConnection = apiConnection;\n\t\tthis.apiUrl = apiUrl;\n\t}",
"@Override\n public void init() {}",
"public mapper3c() { super(); }",
"public Provider() {\n\t\t\tsuper(SCHEME);\n\t\t}",
"@Override\n\tpublic void init(EndpointConfig arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void init(EndpointConfig arg0) {\n\t\t\n\t}",
"public PSProviderCatalogHandler()\n {\n super();\n }",
"public SynapseNotebookActivity() {}",
"public Communicator() {\n }"
] | [
"0.65921307",
"0.64065444",
"0.61756915",
"0.6168526",
"0.60937315",
"0.6060505",
"0.6045708",
"0.5996157",
"0.5978848",
"0.59492975",
"0.56899875",
"0.56422293",
"0.5603214",
"0.55612856",
"0.55540013",
"0.55503696",
"0.55380994",
"0.5532132",
"0.55255294",
"0.5514",
"0.5511331",
"0.5507583",
"0.55051166",
"0.5504371",
"0.54991233",
"0.5495732",
"0.5478152",
"0.5471092",
"0.54610103",
"0.5459198",
"0.5457674",
"0.5431985",
"0.54237276",
"0.54233855",
"0.5416333",
"0.5406081",
"0.5389585",
"0.5380121",
"0.5359396",
"0.5355771",
"0.5353789",
"0.53506315",
"0.53484786",
"0.5336941",
"0.53298783",
"0.5313923",
"0.53128767",
"0.5296257",
"0.5290003",
"0.5284226",
"0.5281561",
"0.5281078",
"0.52793175",
"0.5258222",
"0.5255675",
"0.5254791",
"0.5248221",
"0.5246103",
"0.52451503",
"0.5243792",
"0.5242923",
"0.5233174",
"0.5230415",
"0.5227202",
"0.5221546",
"0.52211887",
"0.52196467",
"0.52185386",
"0.5218532",
"0.5215939",
"0.5210287",
"0.52041596",
"0.5204068",
"0.5198209",
"0.51976067",
"0.5192596",
"0.5185562",
"0.5181089",
"0.51795346",
"0.5177456",
"0.51741195",
"0.5168996",
"0.51657385",
"0.5165738",
"0.5163986",
"0.51621044",
"0.5150981",
"0.5150672",
"0.51505387",
"0.5148606",
"0.51479524",
"0.51473296",
"0.5145094",
"0.5145021",
"0.5143489",
"0.51432556",
"0.51402867",
"0.51402867",
"0.51340264",
"0.5133819",
"0.51300526"
] | 0.0 | -1 |
////////////////////////////////////////////////////////////////////////// CONNECTOR CAPABILITIES ////////////////////////////////////////////////////////////////////////// Return the list of Features that are supported for the given object type. If a Feature is returned, the corresponding method should not throw an UnsupportedOperationException for the given object type. | public List<Feature> getSupportedFeatures(String objectType) {
return Arrays.asList(Feature.values());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"List<Feature> getFeatures();",
"Collection<StructuralFeature> getTypedFeatures();",
"java.util.List<iet.distributed.telemetry.Feature> \n getFeatureList();",
"java.util.List<org.landxml.schema.landXML11.FeatureDocument.Feature> getFeatureList();",
"java.util.List<org.landxml.schema.landXML11.FeatureDocument.Feature> getFeatureList();",
"List<IFeature> getFeatureList();",
"public Collection<String> getProvideFeature();",
"List<String> getFeatures();",
"public abstract List<QualifiedName> getAffectedFeatureTypes();",
"java.util.List<? extends iet.distributed.telemetry.FeatureOrBuilder> \n getFeatureOrBuilderList();",
"java.util.List<java.lang.String> getFeaturesList();",
"ImmutableList<SchemaOrgType> getAccessibilityFeatureList();",
"List<PolicyEngineFeatureApi> getFeatureProviders();",
"public static String supportedFeatures() {\n\t\tStringBuilder buf = new StringBuilder(\"Filesystem features: \");\n\n\t\tClass<Feature> c = Feature.class;\n\t\tfor (Method m : c.getDeclaredMethods()) {\n\t\t\tint mod = m.getModifiers();\n\t\t\tString name = m.getName();\n\n\t\t\tif (!name.equals(\"supportedFeatures\") && Modifier.isStatic(mod) && Modifier.isPublic(mod)) {\n\t\t\t\ttry {\n\t\t\t\t\tboolean ret = (Boolean)m.invoke(null);\n\t\t\t\t\tif (ret) {\n\t\t\t\t\t\tbuf.append(m.getName());\n\t\t\t\t\t\tbuf.append(\" \");\n\t\t\t\t\t}\n\t\t\t\t} catch (IllegalArgumentException ignored) {\n\t\t\t\t} catch (IllegalAccessException ignored) {\n\t\t\t\t} catch (InvocationTargetException ignored) {\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tbuf.append(\"\\n\");\n\t\treturn buf.toString();\n\t}",
"@Nonnull\r\n public Set<Feature> getFeatures() {\r\n return features;\r\n }",
"public List<String> getFeatures() {\n return features;\n }",
"public List<String> getSupportedObjectTypes() {\n\n\t\tList<String> types = super.getSupportedObjectTypes();\n\t\ttypes.add(OBJECT_TYPE_GROUP);\n\t\treturn types;\n\t}",
"public java.lang.Boolean getFeatureCapabilitiesSupported() {\r\n return featureCapabilitiesSupported;\r\n }",
"@Override\n public synchronized Set<FeatureType> getFeatures() {\n return features = nonNullSet(features, FeatureType.class);\n }",
"public Set<String> getFeatures();",
"java.util.List<org.landxml.schema.landXML11.PlanFeatureDocument.PlanFeature> getPlanFeatureList();",
"@Override\n public int[] ll_getAppropriateFeatures(int typecode) {\n if (!isType(typecode)) {\n return null;\n }\n return types.get(typecode).getFeaturesAsStream().mapToInt(FeatureImpl::getCode).toArray();\n }",
"public List<String> allCoreFeatures(Map<String,String> stats) throws OperationNotSupportedException, FMReasoningException {\n\t\tthrow new OperationNotSupportedException(\"Reasoning Operation Not Supported\");\n\t}",
"Set<String> listCapabilities();",
"public abstract List<AbstractCapability> getCapabilities();",
"public FeatureSet getFeatures() {\n\treturn features;\n }",
"@UML(identifier=\"featureType\", obligation=OPTIONAL, specification=ISO_19139)\n Collection<? extends LocalName> getFeatureTypes();",
"public java.util.List getFeature() \n {\n \tModelFacade instance = ModelFacade.getInstance(this.refOutermostPackage().refMofId());\n \tif (instance != null && \n \t\tinstance.isRepresentative(this.refMofId())&&\n \t\tinstance.hasRefObject(this.refMofId()))\n \t{ \t\n \t\tList list = instance.getFeature(this.refMofId());\n \t\tlist.addAll(super_getFeature());\n \t\t\n \t\treturn list; \t\t\n \t}\n \n \treturn super_getFeature();\n }",
"protected void addFeaturesPropertyDescriptor(Object object) {\n itemPropertyDescriptors.add\n (createItemPropertyDescriptor\n (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n getResourceLocator(),\n getString(\"_UI_Reference_features_feature\"),\n getString(\"_UI_PropertyDescriptor_description\", \"_UI_Reference_features_feature\", \"_UI_Reference_type\"),\n NoSQLSchemaPackage.Literals.REFERENCE__FEATURES,\n true,\n false,\n true,\n null,\n null,\n null));\n }",
"public Iterator<SimpleFeature> getFeatures() {\n \treturn this.iterator();\n }",
"public WebServiceFeature[] getFeatures() {\n\t\treturn null;\n\t}",
"public Collection<Resolver> getSupports() {\r\n return Collections.unmodifiableCollection(supports);\r\n }",
"Feature getFeature();",
"Feature getFeature();",
"public Collection<String> getRequireFeature();",
"String [] getSupportedTypes();",
"public java.util.List<org.landxml.schema.landXML11.FeatureDocument.Feature> getFeatureList()\r\n {\r\n final class FeatureList extends java.util.AbstractList<org.landxml.schema.landXML11.FeatureDocument.Feature>\r\n {\r\n public org.landxml.schema.landXML11.FeatureDocument.Feature get(int i)\r\n { return SurfaceImpl.this.getFeatureArray(i); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature set(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = SurfaceImpl.this.getFeatureArray(i);\r\n SurfaceImpl.this.setFeatureArray(i, o);\r\n return old;\r\n }\r\n \r\n public void add(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n { SurfaceImpl.this.insertNewFeature(i).set(o); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature remove(int i)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = SurfaceImpl.this.getFeatureArray(i);\r\n SurfaceImpl.this.removeFeature(i);\r\n return old;\r\n }\r\n \r\n public int size()\r\n { return SurfaceImpl.this.sizeOfFeatureArray(); }\r\n \r\n }\r\n \r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return new FeatureList();\r\n }\r\n }",
"boolean isFeatureSupported(String feature);",
"public Map<Class<?>, Class<?>[]> getCapabilities();",
"public List<String> allFreeFeatures(Map<String,String> stats) throws OperationNotSupportedException, FMReasoningException {\n\t\tthrow new OperationNotSupportedException(\"Reasoning Operation Not Supported\");\n\t}",
"com.google.protobuf.Struct getCustomFeatures();",
"public Feature[] getFeatures() throws JsonMappingException, IOException {\n \tfinal String uri = \"http://localhost:12300/featureflags\";\n RestTemplate restTemplate = new RestTemplate();\n HttpHeaders headers = new HttpHeaders();\n headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));\n HttpEntity<String> entity = new HttpEntity<String>(\"parameters\", headers);\n ResponseEntity<String> result = restTemplate.exchange(uri, HttpMethod.GET, entity, String.class);\n String body = result.getBody();\n ObjectMapper mapper = new ObjectMapper();\n Feature[] features = mapper.readValue(body, Feature[].class);\n return features;\n }",
"boolean hasFeaturesUsed();",
"boolean supports(Object descriptor);",
"List<CmdType> getSupportedTypes();",
"org.landxml.schema.landXML11.FeatureDocument.Feature[] getFeatureArray();",
"org.landxml.schema.landXML11.FeatureDocument.Feature[] getFeatureArray();",
"Set<ICapability> getAllCapabilities();",
"public org.pentaho.pms.cwm.pentaho.meta.core.CwmStructuralFeature getFeature();",
"public IDataSet extractFeatures(String featureType);",
"public java.util.List<org.landxml.schema.landXML11.FeatureDocument.Feature> getFeatureList()\r\n {\r\n final class FeatureList extends java.util.AbstractList<org.landxml.schema.landXML11.FeatureDocument.Feature>\r\n {\r\n public org.landxml.schema.landXML11.FeatureDocument.Feature get(int i)\r\n { return IntersectionImpl.this.getFeatureArray(i); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature set(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = IntersectionImpl.this.getFeatureArray(i);\r\n IntersectionImpl.this.setFeatureArray(i, o);\r\n return old;\r\n }\r\n \r\n public void add(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n { IntersectionImpl.this.insertNewFeature(i).set(o); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature remove(int i)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = IntersectionImpl.this.getFeatureArray(i);\r\n IntersectionImpl.this.removeFeature(i);\r\n return old;\r\n }\r\n \r\n public int size()\r\n { return IntersectionImpl.this.sizeOfFeatureArray(); }\r\n \r\n }\r\n \r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return new FeatureList();\r\n }\r\n }",
"List<FeatureDistribution> asFeatureDistributions();",
"public final native GEFeatureContainer getFeatures() /*-{\r\n\t\treturn this.getFeatures();\r\n\t}-*/;",
"public Set<SimpleFeature> getFeatures(Name name) throws Exception {\n\t\tif (typeNameIndex.get(name)==null) throw new Exception(\"Type not found\");\n\t\treturn typeNameIndex.get(name);\n\t}",
"private List<WebServiceFeature> getFeatures(AssertionSet alternative) {\n return Collections.emptyList();\n }",
"public java.util.List<org.landxml.schema.landXML11.FeatureDocument.Feature> getFeatureList()\r\n {\r\n final class FeatureList extends java.util.AbstractList<org.landxml.schema.landXML11.FeatureDocument.Feature>\r\n {\r\n public org.landxml.schema.landXML11.FeatureDocument.Feature get(int i)\r\n { return GPSSetupImpl.this.getFeatureArray(i); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature set(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = GPSSetupImpl.this.getFeatureArray(i);\r\n GPSSetupImpl.this.setFeatureArray(i, o);\r\n return old;\r\n }\r\n \r\n public void add(int i, org.landxml.schema.landXML11.FeatureDocument.Feature o)\r\n { GPSSetupImpl.this.insertNewFeature(i).set(o); }\r\n \r\n public org.landxml.schema.landXML11.FeatureDocument.Feature remove(int i)\r\n {\r\n org.landxml.schema.landXML11.FeatureDocument.Feature old = GPSSetupImpl.this.getFeatureArray(i);\r\n GPSSetupImpl.this.removeFeature(i);\r\n return old;\r\n }\r\n \r\n public int size()\r\n { return GPSSetupImpl.this.sizeOfFeatureArray(); }\r\n \r\n }\r\n \r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return new FeatureList();\r\n }\r\n }",
"@SuppressWarnings(\"rawtypes\")\n\tfinal public List<Class<? extends Feature>> getFeatureClasses(String name) {\n\t\treturn this.featureClasses.get(name);\n\t}",
"@Override\n public synchronized Set<FeatureType> getFeatureInstances() {\n return featureInstances = nonNullSet(featureInstances, FeatureType.class);\n }",
"List<ResourceSkuCapabilities> capabilities();",
"public List<Optype> getOptypeList() throws Exception {\n\t\treturn mapper.getOptypeList();\n\t}",
"public Object getUnderlyingObject() {\n return feature;\n }",
"public List<String> getCapabilities() {\n if (capabilities == null) {\n return new ArrayList<>();\n }\n return capabilities;\n }",
"com.google.protobuf.ByteString getFeaturesBytes(int index);",
"@Override\n protected boolean supports(Class<?> type) {\n return true;\n }",
"Set<Capability> getAvailableCapability();",
"public ArrayList getCapabilities() {\n\treturn _capabilities;\n }",
"@HTTP(\n method = \"GET\",\n path = \"/apis/config.openshift.io/v1/featuregates\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesListCall<FeatureGateList, FeatureGate> listFeatureGate();",
"public org.landxml.schema.landXML11.FeatureDocument.Feature[] getFeatureArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n java.util.List targetList = new java.util.ArrayList();\r\n get_store().find_all_element_users(FEATURE$6, targetList);\r\n org.landxml.schema.landXML11.FeatureDocument.Feature[] result = new org.landxml.schema.landXML11.FeatureDocument.Feature[targetList.size()];\r\n targetList.toArray(result);\r\n return result;\r\n }\r\n }",
"public org.landxml.schema.landXML11.FeatureDocument.Feature[] getFeatureArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n java.util.List targetList = new java.util.ArrayList();\r\n get_store().find_all_element_users(FEATURE$6, targetList);\r\n org.landxml.schema.landXML11.FeatureDocument.Feature[] result = new org.landxml.schema.landXML11.FeatureDocument.Feature[targetList.size()];\r\n targetList.toArray(result);\r\n return result;\r\n }\r\n }",
"public org.landxml.schema.landXML11.FeatureDocument.Feature[] getFeatureArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n java.util.List targetList = new java.util.ArrayList();\r\n get_store().find_all_element_users(FEATURE$14, targetList);\r\n org.landxml.schema.landXML11.FeatureDocument.Feature[] result = new org.landxml.schema.landXML11.FeatureDocument.Feature[targetList.size()];\r\n targetList.toArray(result);\r\n return result;\r\n }\r\n }",
"public SupportedCapabilities supportedCapabilities() {\n return this.supportedCapabilities;\n }",
"@RequestLine(\"GET /v1/users/{userId}/features/enabled\")\n @Headers({\n \"Accept: */*\",\n })\n void listEnabledFeaturesUsers(@Param(\"userId\") String userId);",
"boolean hasCustomFeatures();",
"public ObservableSet<FirstClassModel> getSupports() {\n\t\treturn supports;\n\t}",
"final List<Feature<T, ?>> getFeatures(FunctionDescriptor descriptor, @SuppressWarnings(\"rawtypes\") Class<? extends Feature> featureClass, FunctionDescriptor topLevelDescriptor) {\n\t\tif (featureClass==null)\n\t\t\tthrow new FeatureSyntaxException(\"No class provided for\", descriptor, topLevelDescriptor);\n\t\t\n\t\tList<Feature<T,?>> features = new ArrayList<Feature<T,?>>();\n\t\tint i = 0;\n\t\tList<List<Object>> argumentLists = new ArrayList<List<Object>>();\n\t\tList<Object> initialArguments = new ArrayList<Object>();\n\t\targumentLists.add(initialArguments);\n\t\t\n\t\tfor (FunctionDescriptor argumentDescriptor : descriptor.getArguments()) {\n\t\t\tList<List<Object>> newArgumentLists = new ArrayList<List<Object>>();\n\t\t\tfor (List<Object> arguments : argumentLists) {\n\t\t\t\tif (!argumentDescriptor.isFunction()) {\n\t\t\t\t\tObject literal = argumentDescriptor.getObject();\n\t\t\t\t\tObject convertedObject = literal;\n\t\t\t\t\tif (literal instanceof String) {\n\t\t\t\t\t\tStringLiteralFeature<T> stringLiteralFeature = new StringLiteralFeature<T>((String) literal);\n\t\t\t\t\t\tconvertedObject = stringLiteralFeature;\n\t\t\t\t\t} else if (literal instanceof Boolean) {\n\t\t\t\t\t\tBooleanLiteralFeature<T> booleanLiteralFeature = new BooleanLiteralFeature<T>((Boolean) literal);\n\t\t\t\t\t\tconvertedObject = booleanLiteralFeature;\n\t\t\t\t\t} else if (literal instanceof Double) {\n\t\t\t\t\t\tDoubleLiteralFeature<T> doubleLiteralFeature = new DoubleLiteralFeature<T>((Double) literal);\n\t\t\t\t\t\tconvertedObject = doubleLiteralFeature;\n\t\t\t\t\t} else if (literal instanceof Integer) {\n\t\t\t\t\t\tIntegerLiteralFeature<T> integerLiteralFeature = new IntegerLiteralFeature<T>((Integer) literal);\n\t\t\t\t\t\tconvertedObject = integerLiteralFeature;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// do nothing - this was some sort of other object added by getModifiedDescriptors that should\n\t\t\t\t\t\t// be handled as is.\n\t\t\t\t\t}\n\t\t\t\t\targuments.add(convertedObject);\n\t\t\t\t\tnewArgumentLists.add(arguments);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tList<Feature<T,?>> featureArguments = this.parseInternal(argumentDescriptor, topLevelDescriptor);\n\t\t\t\t\t// a single argument descriptor could produce multiple arguments\n\t\t\t\t\t// e.g. when a function with an array argument is mapped onto multiple function calls\n\t\t\t\t\tfor (Feature<T,?> featureArgument : featureArguments) {\n\t\t\t\t\t\tList<Object> newArguments = new ArrayList<Object>(arguments);\n\t\t\t\t\t\tnewArguments.add(featureArgument);\n\t\t\t\t\t\tnewArgumentLists.add(newArguments);\n\t\t\t\t\t}\n\t\t\t\t} // function or object?\n\n\t\t\t} // next argument list (under construction from original arguments)\n\t\t\targumentLists = newArgumentLists;\n\t\t} // next argument\n\t\t\n\t\tfor (List<Object> originalArgumentList : argumentLists) {\n\t\t\t// add the argument types (i.e. classes)\n\t\t\t// and convert arrays to multiple constructor calls\n\t\t\tList<Object[]> argumentsList = new ArrayList<Object[]>();\n\t\t\targumentsList.add(new Object[originalArgumentList.size()]);\n\t\t\t\n\t\t\tClass<?>[] argumentTypes = new Class<?>[originalArgumentList.size()];\n\t\t\tList<Object[]> newArgumentsList = new ArrayList<Object[]>();\n\t\t\tfor (i=0;i<originalArgumentList.size();i++) {\n\t\t\t\tObject arg = originalArgumentList.get(i);\n\t\t\t\t\n\t\t\t\tif (arg.getClass().isArray()) {\n\t\t\t\t\t// arrays represent multiple constructor calls\n\t\t\t\t\tObject[] argArray = (Object[]) arg;\n\t\t\t\t\tfor (Object oneArg : argArray) {\n\t\t\t\t\t\tfor (Object[] arguments : argumentsList) {\n\t\t\t\t\t\t\tObject[] newArguments = arguments.clone();\n\t\t\t\t\t\t\tnewArguments[i] = oneArg;\n\t\t\t\t\t\t\tnewArgumentsList.add(newArguments);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\targumentTypes[i] = arg.getClass().getComponentType();\n\t\t\t\t} else {\n\t\t\t\t\tfor (Object[] myArguments : argumentsList) {\n\t\t\t\t\t\tnewArgumentsList.add(myArguments);\n\t\t\t\t\t\tmyArguments[i] = arg;\n\t\t\t\t\t}\n\t\t\t\t\targumentTypes[i] = arg.getClass();\n\t\t\t\t}\n\t\t\t\targumentsList = newArgumentsList;\n\t\t\t\tnewArgumentsList = new ArrayList<Object[]>();\n\t\t\t} // next argument\n\t\t\t\n\t\t\t@SuppressWarnings(\"rawtypes\")\n\t\t\tConstructor<? extends Feature> constructor = null;\n\t\t\tMONITOR.startTask(\"findContructor\");\n\t\t\ttry {\n\t\t\t\tconstructor = ConstructorUtils.getMatchingAccessibleConstructor(featureClass, argumentTypes);\n\t\t\t\t\t\t\t\t\n\t\t\t\tif (constructor==null) {\n\t\t\t\t\tConstructor<?>[] constructors = featureClass.getConstructors();\n\t\t\t\t\t\n\t\t\t\t\t// check if there's a variable argument constructor\n\t\t\t\t\tfor (Constructor<?> oneConstructor : constructors) {\n\t\t\t\t\t\tClass<?>[] parameterTypes = oneConstructor.getParameterTypes();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (parameterTypes.length>=1 && argumentsList.size()==1 && argumentsList.get(0).length>=parameterTypes.length) {\n\t\t\t\t\t\t\tObject[] arguments = argumentsList.get(0);\n\t\t\t\t\t\t\tClass<?> parameterType = parameterTypes[parameterTypes.length-1];\n\t\t\t\t\t\t\tif (parameterType.isArray()) {\n\t\t\t\t\t\t\t\t// assume it's a variable-argument constructor\n\t\t\t\t\t\t\t\t// build the argument for this constructor\n\t\t\t\t\t\t\t\t// find a common type for all of the arguments.\n\t\t\t\t\t\t\t\tObject argument = arguments[parameterTypes.length-1];\n\t\t\t\t\t\t\t\tClass<?> clazz = null;\n\t\t\t\t\t\t\t\tif (argument instanceof StringFeature)\n\t\t\t\t\t\t\t\t\tclazz = StringFeature.class;\n\t\t\t\t\t\t\t\telse if (argument instanceof BooleanFeature)\n\t\t\t\t\t\t\t\t\tclazz = BooleanFeature.class;\n\t\t\t\t\t\t\t\telse if (argument instanceof DoubleFeature)\n\t\t\t\t\t\t\t\t\tclazz = DoubleFeature.class;\n\t\t\t\t\t\t\t\telse if (argument instanceof IntegerFeature)\n\t\t\t\t\t\t\t\t\tclazz = IntegerFeature.class;\n\t\t\t\t\t\t\t\telse if (argument instanceof StringCollectionFeature)\n\t\t\t\t\t\t\t\t\tclazz = StringFeature.class;\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t// no good, can't make arrays of this type\n\t\t\t\t\t\t\t\t\tcontinue;\n\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\tObject[] argumentArray = (Object[]) Array.newInstance(clazz, (arguments.length-parameterTypes.length)+1);\n\t\t\t\t\t\t\t\tint j = 0;\n\t\t\t\t\t\t\t\tfor (int k=parameterTypes.length-1; k<arguments.length; k++) {\n\t\t\t\t\t\t\t\t\tObject oneArgument = arguments[k];\n\t\t\t\t\t\t\t\t\tif (oneArgument instanceof StringCollectionFeature) {\n\t\t\t\t\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\t\t\t\t\t\tStringCollectionFeature<T> stringCollectionFeature = (StringCollectionFeature<T>) oneArgument;\n\t\t\t\t\t\t\t\t\t\tStringCollectionFeatureProxy<T> proxy = new StringCollectionFeatureProxy<T>(stringCollectionFeature);\n\t\t\t\t\t\t\t\t\t\toneArgument = proxy;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (!clazz.isAssignableFrom(oneArgument.getClass())) {\n\t\t\t\t\t\t\t\t\t\tthrow new FeatureSyntaxException(\"Mismatched array types: \" + clazz.getSimpleName() + \", \" + oneArgument.getClass().getSimpleName(), descriptor, topLevelDescriptor);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\targumentArray[j++] = oneArgument;\n\t\t\t\t\t\t\t\t} // next argument\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tClass<?>[] argumentTypesWithArray = new Class<?>[parameterTypes.length];\n\t\t\t\t\t\t\t\tfor (int k=0;k<parameterTypes.length-1;k++) {\n\t\t\t\t\t\t\t\t\tObject oneArgument = arguments[k];\n\t\t\t\t\t\t\t\t\targumentTypesWithArray[k] = oneArgument.getClass();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\targumentTypesWithArray[argumentTypesWithArray.length-1] = argumentArray.getClass();\n\t\t\t\t\t\t\t\tconstructor = ConstructorUtils.getMatchingAccessibleConstructor(featureClass, argumentTypesWithArray);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (constructor!=null) {\n\t\t\t\t\t\t\t\t\targumentsList = new ArrayList<Object[]>();\n\t\t\t\t\t\t\t\t\tObject[] argumentsWithArray = new Object[parameterTypes.length];\n \t\t\t\t\t\t\t\t\tfor (int k=0;k<parameterTypes.length-1;k++) {\n\t\t\t\t\t\t\t\t\t\tObject oneArgument = arguments[k];\n\t\t\t\t\t\t\t\t\t\targumentsWithArray[k] = oneArgument;\n\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\targumentsWithArray[parameterTypes.length-1] = argumentArray;\n\t\t\t\t\t\t\t\t\targumentsList.add(argumentsWithArray);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} // constructor takes an array\n\t\t\t\t\t\t} // exactly one parameter for constructor\n\t\t\t\t\t} // next constructor\n\t\t\t\t\t\n\t\t\t\t\tif (constructor==null) {\n\t\t\t\t\t\t// See if various conversions allow us to find a constructor\n\t\t\t\t\t\t// Integer to Double\n\t\t\t\t\t\t// StringCollectionFeature to StringFeature\n\t\t\t\t\t\tfor (Constructor<?> oneConstructor : constructors) {\n\t\t\t\t\t\t\tClass<?>[] parameterTypes = oneConstructor.getParameterTypes();\n\t\t\t\t\t\t\tboolean isMatchingConstructor = false;\n\t\t\t\t\t\t\tList<Integer> intParametersToConvert = new ArrayList<Integer>();\n\t\t\t\t\t\t\tList<Integer> stringCollectionParametersToConvert = new ArrayList<Integer>();\n\t\t\t\t\t\t\tList<Integer> customParametersToConvert = new ArrayList<Integer>();\n\t\t\t\t\t\t\tif (parameterTypes.length==argumentTypes.length) {\n\t\t\t\t\t\t\t\tint j=0;\n\t\t\t\t\t\t\t\tisMatchingConstructor = true;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor (Class<?> parameterType : parameterTypes) {\n\t\t\t\t\t\t\t\t\tif (parameterType.isAssignableFrom(argumentTypes[j])&& !StringCollectionFeature.class.isAssignableFrom(argumentTypes[j])) {\n\t\t\t\t\t\t\t\t\t\t// nothing to do here\n\t\t\t\t\t\t\t\t\t} else if (parameterType.equals(DoubleFeature.class) && IntegerFeature.class.isAssignableFrom(argumentTypes[j])) {\n\t\t\t\t\t\t\t\t\t\tintParametersToConvert.add(j);\n\t\t\t\t\t\t\t\t\t} else if ((parameterType.equals(StringFeature.class)||parameterType.equals(Feature.class)) && StringCollectionFeature.class.isAssignableFrom(argumentTypes[j])) {\n\t\t\t\t\t\t\t\t\t\tstringCollectionParametersToConvert.add(j);\n\t\t\t\t\t\t\t\t\t} else if (this.canConvert(parameterType, argumentTypes[j])) {\n\t\t\t\t\t\t\t\t\t\tcustomParametersToConvert.add(j);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tisMatchingConstructor = false;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isMatchingConstructor) {\n\t\t\t\t\t\t\t\t@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\t\t\t\t\t\t\t\tConstructor<? extends Feature> matchingConstructor = (Constructor<? extends Feature>) oneConstructor;\n\t\t\t\t\t\t\t\tconstructor = matchingConstructor;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor (Object[] myArguments : argumentsList) {\n\t\t\t\t\t\t\t\t\tfor (int indexToConvert : intParametersToConvert) {\n\t\t\t\t\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\t\t\t\t\t\tIntegerFeature<T> integerFeature = (IntegerFeature<T>) myArguments[indexToConvert];\n\t\t\t\t\t\t\t\t\t\tIntegerToDoubleFeature<T> intToDoubleFeature = new IntegerToDoubleFeature<T>(integerFeature);\n\t\t\t\t\t\t\t\t\t\tmyArguments[indexToConvert] = intToDoubleFeature;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tfor (int indexToConvert : stringCollectionParametersToConvert) {\n\t\t\t\t\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\t\t\t\t\t\tStringCollectionFeature<T> stringCollectionFeature = (StringCollectionFeature<T>) myArguments[indexToConvert];\n\t\t\t\t\t\t\t\t\t\tStringCollectionFeatureProxy<T> proxy = new StringCollectionFeatureProxy<T>(stringCollectionFeature);\n\t\t\t\t\t\t\t\t\t\tmyArguments[indexToConvert] = proxy;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tfor (int indexToConvert : customParametersToConvert) {\n\t\t\t\t\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\t\t\t\t\t\tFeature<T,?> argumentToConvert = (Feature<T, ?>) myArguments[indexToConvert];\n\t\t\t\t\t\t\t\t\t\tFeature<T,?> customArgument = this.convertArgument(parameterTypes[indexToConvert], argumentToConvert);\n\t\t\t\t\t\t\t\t\t\tmyArguments[indexToConvert] = customArgument;\n\t\t\t\t\t\t\t\t\t\tcustomArgument.addArgument(argumentToConvert);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} // found a matching constructor\n\t\t\t\t\t\t} // next possible constructor\n\t\t\t\t\t} // still haven't found a constructor, what next?\n\t\t\t\t} // didn't find a constructor yet\n\t\t\t} finally {\n\t\t\t\tMONITOR.endTask(\"findContructor\");\n\t\t\t}\n\t\t\t\n\t\t\tif (constructor==null)\n\t\t\t\tthrow new NoConstructorFoundException(\"No constructor found for \" + descriptor.getFunctionName() + \" (\" + featureClass.getName() + \") matching the arguments provided\", descriptor, topLevelDescriptor);\t\t\t\n\t\t\t\n\t\t\tfor (Object[] myArguments : argumentsList) {\n\t\t\t\t@SuppressWarnings(\"rawtypes\")\n\t\t\t\tFeature feature;\n\t\t\t\ttry {\n\t\t\t\t\tfeature = constructor.newInstance(myArguments);\n\t\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t} catch (InstantiationException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t} catch (IllegalAccessException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t} catch (InvocationTargetException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\tFeature<T,?> genericFeature = (Feature<T,?>) feature;\n\t\t\t\tthis.injectDependencies(feature);\n\t\t\t\tif (genericFeature instanceof ExternalResourceFeature) {\n\t\t\t\t\tif (this.getExternalResourceFinder()==null) {\n\t\t\t\t\t\tthrow new JolicielException(\"No external resource finder set.\");\n\t\t\t\t\t}\n\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\tExternalResourceFeature<T> externalResourceFeature = (ExternalResourceFeature<T>) genericFeature;\n\t\t\t\t\texternalResourceFeature.setExternalResourceFinder(this.getExternalResourceFinder());\n\t\t\t\t} else if (genericFeature instanceof ExternalResourceDoubleFeature) {\n\t\t\t\t\tif (this.getExternalResourceFinder()==null) {\n\t\t\t\t\t\tthrow new JolicielException(\"No external resource finder set.\");\n\t\t\t\t\t}\n\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\tExternalResourceDoubleFeature<T> externalResourceFeature = (ExternalResourceDoubleFeature<T>) genericFeature;\n\t\t\t\t\texternalResourceFeature.setExternalResourceFinder(this.getExternalResourceFinder());\n\t\t\t\t} else if (genericFeature instanceof MultivaluedExternalResourceFeature) {\n\t\t\t\t\tif (this.getExternalResourceFinder()==null) {\n\t\t\t\t\t\tthrow new JolicielException(\"No external resource finder set.\");\n\t\t\t\t\t}\n\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\tMultivaluedExternalResourceFeature<T> externalResourceFeature = (MultivaluedExternalResourceFeature<T>) genericFeature;\n\t\t\t\t\texternalResourceFeature.setExternalResourceFinder(this.getExternalResourceFinder());\n\t\t\t\t} \n\n\t\t\t\t// add this feature's arguments\n\t\t\t\tfor (Object argument : myArguments) {\n\t\t\t\t\tif (argument instanceof Feature[]) {\n\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\t\tFeature<T,?>[] featureArray = (Feature<T,?>[]) argument;\n\t\t\t\t\t\tfor (Feature<T,?> oneFeature : featureArray) {\n\t\t\t\t\t\t\tgenericFeature.addArgument(oneFeature);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\t\tFeature<T,?> featureArgument = (Feature<T,?>) argument;\n\t\t\t\t\t\tgenericFeature.addArgument(featureArgument);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tFeature<T,?> convertedFeature = this.convertFeature(genericFeature);\n\t\t\t\tfeatures.add(convertedFeature);\n\t\t\t} // next internal argument list\n\t\t} // next argument list\n\t\treturn features;\n\t}",
"FTCommand getFeature();",
"long getFeaturesUsed();",
"private static List<IFeature> parseFeatures(WMElement features) {\n List<IFeature> trainingFeatures = new ArrayList<>();\n for (int i = 0; i < features.ConvertToIdentifier().GetNumberChildren(); i++) {\n IFeature res;\n WMElement curFeatureType = features.ConvertToIdentifier().GetChild(i);\n WMElement curFeature = curFeatureType.ConvertToIdentifier().GetChild(0);\n String featureName = curFeature.GetAttribute();\n String featureVal = curFeature.GetValueAsString();\n double featureValNumerical = -1.0;\n try {\n featureValNumerical = Double.parseDouble(featureVal);\n } catch (Exception e) {\n if (featureVal.equalsIgnoreCase(\"true\")) {\n featureValNumerical = 1.0;\n } else if (featureVal.equalsIgnoreCase(\"false\")) {\n featureValNumerical = 0.0;\n }\n }\n\n switch (curFeatureType.GetAttribute()) {\n case \"boolean\":\n res = new BooleanFeature(featureName, featureValNumerical);\n break;\n case \"numerical\":\n res = new NumericalFeature(featureName, featureValNumerical);\n break;\n case \"categorical\":\n res = new CategoricalFeature(featureName, featureVal);\n break;\n default:\n throw new IllegalArgumentException(\"Given feature type is not supported.\");\n }\n\n trainingFeatures.add(res);\n }\n return trainingFeatures;\n }",
"List getOperationDescriptors() throws RemoteException;",
"public List<? extends IFlexoOntologyFeatureAssociation<TA>> getStructuralFeatureAssociations();",
"@ApiModelProperty(value = \"The features of the OS that the artifact applys to\")\n public List<String> getOsFeatures() {\n return osFeatures;\n }",
"@Override\n public Class<? extends Feature> getFeatureClass() {\n\treturn VersionFeatures.class;\n }",
"public long getSupports();",
"private String[] detectFeatures() {\n \t\t\tchangeStampIsValid = false;\n \t\t\tfeaturesChangeStampIsValid = false;\n \t\t\tparent.changeStampIsValid = false;\n \t\t\tparent.featuresChangeStampIsValid = false;\n \n \t\t\tfeatures = new ArrayList();\n \n \t\t\tif (!supportsDetection(resolvedURL))\n \t\t\t\treturn new String[0];\n \n \t\t\t// locate feature entries on site\n \t\t\tFile siteRoot = new File(resolvedURL.getFile().replace('/', File.separatorChar));\n \t\t\tFile root = new File(siteRoot, FEATURES);\n \n \t\t\tString[] list = root.list();\n \t\t\tString path;\n \t\t\tFile plugin;\n \t\t\tfor (int i = 0; list != null && i < list.length; i++) {\n \t\t\t\tpath = list[i] + File.separator + FEATURE_XML;\n \t\t\t\tplugin = new File(root, path);\n \t\t\t\tif (!plugin.exists()) {\n \t\t\t\t\tcontinue;\n \t\t\t\t}\n \t\t\t\tfeatures.add(FEATURES + \"/\" + path.replace(File.separatorChar, '/')); //$NON-NLS-1$\n \t\t\t}\n \t\t\tif (DEBUG) {\n \t\t\t\tdebug(resolvedURL.toString() + \" located \" + features.size() + \" feature(s)\"); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\t}\n \n \t\t\treturn (String[]) features.toArray(new String[0]);\n \t\t}",
"@View( value = VIEW_MANAGE_FEATURES, defaultView = true )\r\n public String getManageFeatures( HttpServletRequest request )\r\n {\r\n _feature = null;\r\n\r\n List<Feature> listFeatures = (List<Feature>) FeatureHome.getFeaturesList( );\r\n Map<String, Object> model = getPaginatedListModel( request, MARK_FEATURE_LIST, listFeatures, JSP_MANAGE_FEATURES );\r\n\r\n return getPage( PROPERTY_PAGE_TITLE_MANAGE_FEATURES, TEMPLATE_MANAGE_FEATURES, model );\r\n }",
"public Feature[] getFeatures() {\n Feature[] features = new Feature[rows.size()];\n for(int i=0;i<features.length;i++){\n features[i] = (Feature)rows.elementAt(i);\n }\n return features;\n }",
"@RequestLine(\"GET /v1/courses/{courseId}/features/enabled\")\n @Headers({\n \"Accept: */*\",\n })\n void listEnabledFeaturesCourses(@Param(\"courseId\") String courseId);",
"com.google.protobuf.StructOrBuilder getCustomFeaturesOrBuilder();",
"public List<FeatureDataBean> getAllFeatures() throws GenericDatabaseException {\n List<String> ids = new ArrayList<>();\n ids.add(UMFeatureDao.PARENT);\n \n Map<String,Object> equals=new HashMap<>();\n equals.put(UMFeatureDao.IS_ACTIVE, Boolean.TRUE);\n \n Map<QueryOperators, Object> criteria = new HashMap<>();\n criteria.put(QueryOperators.IS_NULL, ids);\n criteria.put(QueryOperators.EQUAL, equals);\n \n return (convertFeatureDataBeanToFeatureModel(featureService.retrieveFeatures(null, criteria, null)));\n }",
"public List getTypeSpecifiers() {\n return member.getTypeSpecifiers();\n }",
"public List<String> capabilities() {\n return this.capabilities;\n }",
"@Override\n public Map<String, Integer> getFeatures(List<String> objects) {\n\n HashMap<String, Integer> features = new HashMap<>();\n\n for (String cCategory : objects) {\n //Create feature name by add \n //language + the prefix boolean + the feature name to Lower Case + true/false\n String[] tmpSplit = cCategory.toLowerCase().split(\":\");\n String featureName = tmpSplit[0].trim();\n\n String featureTrue\n = language\n + \".boolean.\"\n + featureName\n + \".true\";\n\n String featureFalse\n = language\n + \".boolean.\"\n + featureName\n + \".false\";\n\n if (Boolean.parseBoolean(tmpSplit[1])) {\n //Add featureTrue ton Map with value 1\n features.put(featureTrue, 1);\n //Add featureFalse ton Map with value 1\n features.put(featureFalse, 0);\n } else {\n //Add featureTrue ton Map with value 1\n features.put(featureTrue, 0);\n //Add featureFalse ton Map with value 1\n features.put(featureFalse, 1);\n }\n }\n\n return features;\n }",
"public com.google.protobuf.ProtocolStringList\n getClientFeaturesList() {\n return clientFeatures_;\n }",
"String getFeature();",
"String getFeature();",
"@DISPID(1611006044) //= 0x6006005c. The runtime will prefer the VTID if present\n @VTID(119)\n boolean contextualFeaturesSelectableAtCreation();",
"List<FeatureController<MODEL>> getFeatureControllers() {\n return featureItems.getFeatureControllers();\n }",
"@RequestLine(\"GET /v1/accounts/{accountId}/features/enabled\")\n @Headers({\n \"Accept: */*\",\n })\n void listEnabledFeaturesAccounts(@Param(\"accountId\") String accountId);",
"public WebServiceFeature[] getFeatures(List<QName> requestedIntents) {\n List<WebServiceFeature> features = new LinkedList<WebServiceFeature>();\n if (requestedIntents.contains(MayProvideIntents.MESSAGE_OPTIMIZATION)) {\n features.add(new MTOMFeature());\n }\n resolveBinding(requestedIntents, features);\n features.add(new AddressingFeature());\n WebServiceFeature[] webServiceFeatures = new WebServiceFeature[features.size()];\n webServiceFeatures = features.toArray(webServiceFeatures);\n return webServiceFeatures;\n }",
"public FeatureElements getFeatureAccess() {\n\t\treturn pFeature;\n\t}"
] | [
"0.6941605",
"0.6714534",
"0.6490852",
"0.6464107",
"0.6464107",
"0.64365166",
"0.6366906",
"0.63583434",
"0.63270694",
"0.6196089",
"0.61769575",
"0.6134234",
"0.6131711",
"0.61033237",
"0.6091133",
"0.6089443",
"0.6081679",
"0.606768",
"0.6033931",
"0.60214543",
"0.6017856",
"0.5937765",
"0.5931994",
"0.5922194",
"0.59175783",
"0.5863411",
"0.5834049",
"0.58271366",
"0.5808238",
"0.5758646",
"0.5750863",
"0.5739336",
"0.5717366",
"0.5717366",
"0.566655",
"0.5665817",
"0.56353813",
"0.56166506",
"0.56045085",
"0.5574656",
"0.5560912",
"0.5560663",
"0.55501544",
"0.5535284",
"0.550298",
"0.5502584",
"0.5502584",
"0.5492859",
"0.54815775",
"0.54783183",
"0.5477467",
"0.5477101",
"0.54522586",
"0.54322815",
"0.5426715",
"0.5420059",
"0.5392236",
"0.5389719",
"0.53862464",
"0.53791267",
"0.53785676",
"0.5374838",
"0.5363404",
"0.53611267",
"0.5360638",
"0.535849",
"0.5349178",
"0.53426677",
"0.53426677",
"0.53403026",
"0.5331937",
"0.5326335",
"0.53229123",
"0.5312198",
"0.53120524",
"0.5298476",
"0.52929056",
"0.529256",
"0.52871203",
"0.52727425",
"0.527149",
"0.52611583",
"0.5250307",
"0.52496827",
"0.5247366",
"0.52366054",
"0.5228485",
"0.522007",
"0.5213864",
"0.51995957",
"0.51938283",
"0.517098",
"0.5170756",
"0.51669055",
"0.51669055",
"0.51629335",
"0.51574725",
"0.5154505",
"0.5152855",
"0.51391935"
] | 0.75612575 | 0 |
Return a list of the object types supported by this connector. This list can contain any of the OBJECT_TYPE_ constants or any arbitrary type that is supported by the connector. | public List<String> getSupportedObjectTypes() {
List<String> types = super.getSupportedObjectTypes();
types.add(OBJECT_TYPE_GROUP);
return types;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Set<String> getAvailableTypes() {\n return ApiSpecificationFactory.getTypes();\n }",
"List<CmdType> getSupportedTypes();",
"String [] getSupportedTypes();",
"public List<TypeObjet> getTypesObjets() {\n\t\treturn null;\n\t}",
"public String[] getTypes() {\n return impl.getTypes();\n }",
"public List<__Type> getTypes() {\n return (List<__Type>) get(\"types\");\n }",
"public List<String> getMBeanTypes() {\n\n\t\treturn Collections.unmodifiableList(new ArrayList<String>(this.mbeanMap.keySet()));\n\t}",
"public List<Feature> getSupportedFeatures(String objectType) {\n\t\treturn Arrays.asList(Feature.values());\n\t}",
"public java.util.List<String> getInstanceTypes() {\n if (instanceTypes == null) {\n instanceTypes = new com.amazonaws.internal.SdkInternalList<String>();\n }\n return instanceTypes;\n }",
"List<ObjectType> getObjectTypes() throws AccessDeniedException;",
"public List<String> getAllDocumentTypes() {\n\t\tList<String> toReturn = new ArrayList<String>();\n\n\t\tint size = combBoxDocumentTypes.getItemCount();\n\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\ttoReturn.add((String) combBoxDocumentTypes.getItemAt(i));\n\t\t}\n\n\t\treturn toReturn;\n\t}",
"public List<String> getAvailableDataTypes() {\n Set<String> typeSet = new TreeSet<String>();\n\n ITimer timer = TimeUtil.getTimer();\n timer.start();\n\n try {\n for (Provider provider : DataDeliveryHandlers.getProviderHandler()\n .getAll()) {\n\n for (ProviderType type : provider.getProviderType()) {\n typeSet.add(type.getDataType().toString());\n }\n }\n } catch (RegistryHandlerException e) {\n statusHandler.handle(Priority.PROBLEM,\n \"Unable to retrieve the provider list.\", e);\n }\n\n List<String> typeList = new ArrayList<String>(typeSet);\n timer.stop();\n\n return typeList;\n }",
"public List<ResourceBase> listTypes() throws ResourceException;",
"public List<TypeInfo> getTypes() {\r\n return types;\r\n }",
"public List<CWLType> getTypes() {\n return types;\n }",
"public List<MediaType> getContentTypes() {\n\t\treturn this.contentTypes;\n\t}",
"public Set<Class<?>> getTypes() {\r\n\t\treturn dataTypes;\r\n\t}",
"public Set<Class<?>> getTypes() {\r\n\t\treturn dataTypes;\r\n\t}",
"public Set<Class<?>> getTypes() {\r\n\t\treturn dataTypes;\r\n\t}",
"public Set<Class<?>> getTypes() {\n\t\treturn dataTypes;\n\t}",
"public Set<Class<?>> getTypes() {\n\t\treturn dataTypes;\n\t}",
"public java.util.List<CodeableConcept> type() {\n return getList(CodeableConcept.class, FhirPropertyNames.PROPERTY_TYPE);\n }",
"public Set<Class<? extends RealmModel>> getDBTableTypes(){\n try {\n if (this.realmConfiguration == null) {\n this.realmConfiguration = DatabaseUtilities\n .buildRealmConfig(context, null, null, null);\n }\n } catch (Exception e){\n e.printStackTrace();\n }\n\n if(realmConfiguration == null){\n return null;\n }\n return realmConfiguration.getRealmObjectClasses();\n }",
"public java.util.List<CodeableConcept> type() {\n return getList(CodeableConcept.class, FhirPropertyNames.PROPERTY_TYPE);\n }",
"public List<String> getDataPointTypes() {\n Object[] dpTypes = (Object[])configMap.get(DATA_POINT_TYPES);\n List<String> types = Utility.downcast( dpTypes );\n return types;\n }",
"@Override\n public Class<Object> getObjectType() {\n return Object.class;\n }",
"public List<Class<? extends Resource>> getAvailableTypes(OgemaLocale locale);",
"@GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getAllPlatformTypes\")\n List<JsonType> types();",
"public List<InstanceType> listInstanceTypes() throws IOException,\n\t\t\tClassNotFoundException {\n\t\treturn list(InstanceType.class);\n\t}",
"@Override\n\tpublic Collection<ComponentTypeInfo> getComponentTypes() {\n\t\treturn Arrays.asList(activityComponentType, timelineComponentType, decisionComponentType , scenarioComponentType );\n\t}",
"public native JsArrayString getTypes()/*-{\n\t\tvar jso = this.@com.ait.toolkit.core.client.JsObject::getJsObj()();\n\t\treturn jso.types;\n }-*/;",
"public java.util.List<google.maps.fleetengine.v1.TripType> getSupportedTripTypesList() {\n return new com.google.protobuf.Internal.ListAdapter<\n java.lang.Integer, google.maps.fleetengine.v1.TripType>(supportedTripTypes_, supportedTripTypes_converter_);\n }",
"public List<Optype> getOptypeList() throws Exception {\n\t\treturn mapper.getOptypeList();\n\t}",
"UsedTypes getTypes();",
"public List<String> getResourceTypes(){\n\t\treturn jtemp.queryForList(\"SELECT resource_type_id||' '||resource_type_name FROM resource_type\", String.class);\n\t}",
"public Collection<String> getSupportedRecordTypes() {\n\t\tif (this.supportedRecordTypes == null){ this.supportedRecordTypes=new ArrayList<>();}\n\t\treturn supportedRecordTypes;\n\t}",
"public List<String> getRemoteTypes() {\n return getByList(GET_REMOTE_TYPES_PATH);\n }",
"@java.lang.Override\n public java.util.List<google.maps.fleetengine.v1.TripType> getSupportedTripTypesList() {\n return new com.google.protobuf.Internal.ListAdapter<\n java.lang.Integer, google.maps.fleetengine.v1.TripType>(supportedTripTypes_, supportedTripTypes_converter_);\n }",
"public List<String> getTableTypes()\r\n throws Exception\r\n {\r\n List<String> list = new ArrayList<String>();\r\n \r\n list.add(TYPE_TABLES);\r\n \r\n return list;\r\n }",
"@Override\n\tpublic List<String> getIncomingConnectionTypes() {\n\t\treturn null;\n\t}",
"@Override\n public List<String> getIncomingConnectionTypes() {\n if (getStepManager().numIncomingConnections() == 0) {\n return Arrays.asList(StepManager.CON_INSTANCE, StepManager.CON_CHART);\n }\n\n return new ArrayList<String>();\n }",
"public String getContentTypes() {\n return contentTypes;\n }",
"public List<TypeMetadata> getTypeMetadata() {\n return types;\n }",
"public List<DocumentType> getAllDocumentTypes() throws ContestManagementException {\n return null;\r\n }",
"public List<DocumentType> getAllDocumentTypes() throws ContestManagementException {\n return null;\r\n }",
"public final CompositeType[] getCompositeTypes()\n {\n CompositeType[] names = new CompositeType[listModel.size()];\n\tfor(int i=0; i<names.length; i++) {\n\t names[i] = (CompositeType) listModel.elementAt(i);\n\t}\n\treturn names;\n }",
"public Set<MediaType> getSupportedMediaTypes();",
"public Class<?> getObjectType() {\n return objectType;\n }",
"public ObjType getType () {\n\t\tif (type == null) {\n\t\t\ttype = Virtue.getInstance().getConfigProvider().getObjTypes().list(id);\n\t\t}\n\t\treturn type;\n\t}",
"List <Connector.Type> getConnectors();",
"private List<String> getObjectsByType(String typeName) throws SQLException {\n return jdbcTemplate.queryForStringList(\"SELECT OBJECT_NAME FROM ALL_OBJECTS WHERE OWNER = ? AND OBJECT_TYPE = ?\",\n name, typeName);\n }",
"public List<ComponentType> getComponentsType() {\r\n\t\treturn ctDao.findAll();\r\n\t}",
"public List<ContentTypeMappingValue> getContentTypes() {\r\n\t\treturn contentTypes;\r\n\t}",
"public Set<TypeDescriptor> getAllRelatedTypes() {\n final var types = getTypeParameters().stream()\n .flatMap(type -> type.getAllRelatedTypes().stream())\n .collect(Collectors.toCollection(HashSet::new));\n\n types.add(this);\n return types;\n }",
"public String getObjectTypeId();",
"@Override\n public Class<?> getObjectType() {\n return this.type;\n }",
"@Override\r\n\tpublic List<Type> getTypes() {\n\t\treturn (List<Type>)BaseDao.select(\"select * from type\", Type.class);\r\n\t}",
"protected IResolvedTypes getResolvedTypes(EObject obj) {\n\t\treturn this.typeResolver.resolveTypes(obj);\n\t}",
"@Override\n public String toString() {\n return metaObject.getType().toString();\n }",
"static String[] getAllTypeNames()\n\t{\n\t\treturn new String[] {\"String\", \"int\", \"double\", \"long\", \"boolean\", \"String[]\", \"int[]\", \"double[]\", \"long[]\"};\n\t}",
"public List<OperationType> getOperationTypeList() {\r\n List<OperationType> operationType = new ArrayList<OperationType>();\r\n \r\n try{\r\n init();\r\n \r\n // Start UOC\r\n OperationTypeDao operationTypeDao = new OperationTypeDao(conn);\r\n operationType = operationTypeDao.searchAll();\r\n // End UOC\r\n\r\n } catch (Exception e) {\r\n handleException(e);\r\n } finally {\r\n finish();\r\n }\r\n \r\n return operationType;\r\n }",
"@GET\n\t@Path(\"types\")\n public Response getDeviceTypes() {\n List<DeviceType> deviceTypes;\n try {\n deviceTypes = DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes();\n return Response.status(Response.Status.OK).entity(deviceTypes).build();\n } catch (DeviceManagementException e) {\n String msg = \"Error occurred while fetching the list of device types.\";\n log.error(msg, e);\n return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();\n }\n }",
"public java.util.List<java.lang.Integer>\n getSupportedTripTypesValueList() {\n return java.util.Collections.unmodifiableList(supportedTripTypes_);\n }",
"public List<Type> getTypeList() {\n\t\treturn sm.selectList(\"com.lanzhou.entity.Longpay.getTypeList\");\n\t}",
"public List<Class<?>> getKnownClasses();",
"public List<CarrierType> all() throws EasyPostException {\n String endpoint = \"carrier_types\";\n\n CarrierType[] response = Requestor.request(RequestMethod.GET, endpoint, null, CarrierType[].class, client);\n return Arrays.asList(response);\n }",
"@Override\n public Set<String> validTypes() {\n return factory.validTypes();\n }",
"public ResultFormat[] getTypes() {\n\n if (types == null) {\n types = loadFormats();\n }\n return types.clone();\n }",
"public java.lang.String getSobjectType() {\r\n return sobjectType;\r\n }",
"public Collection<DasType> getTypes() throws DataSourceException {\n Collection<DasType> types = new ArrayList<DasType>(5);\n types.add(new DasType(\"gene\", \"gene\", \"Gene description\"));\n types.add(new DasType(\"efv\", \"efv\", \"Experiment factor value\"));\n types.add(new DasType(\"exp\", \"exp\", \"Experiment\"));\n return types;\n }",
"public List getTypeSpecifiers() {\n return member.getTypeSpecifiers();\n }",
"public NotificationType[] getAllNotificationTypes() throws ResourceManagementException {\r\n return this.port.getAllNotificationTypes();\r\n }",
"public List<DataType> listDataTypes() throws IOException,\n\t\t\tClassNotFoundException {\n\t\treturn list(DataType.class);\n\t}",
"public List<URI> getType();",
"default List<TypeInfo> allTypes() {\n List<TypeInfo> allTypes = new LinkedList<>();\n allTypes.add(this);\n allTypes.addAll(Arrays.asList(interfaces()));\n allTypes.addAll(superClass().stream().flatMap(s -> s.allTypes().stream()).collect(Collectors.toList()));\n return allTypes;\n }",
"public String[] getTypes() {\n/* 388 */ return getStringArray(\"type\");\n/* */ }",
"public Type[] types();",
"@GET\n @Path(\"/typesByPlugin\")\n public Map<Long, List<PluginType>> getTypesByPlugin() {\n return definitionsService.getTypesByPlugin();\n }",
"@java.lang.Override\n public java.util.List<java.lang.Integer>\n getSupportedTripTypesValueList() {\n return supportedTripTypes_;\n }",
"@Override\n public List<String> getOutgoingConnectionTypes() {\n return new ArrayList<String>();\n }",
"public List<Type> getDownloadableType() {\n\t\tList<Type> types = typeManager.getAllAvailable();\n\t\tList<Type> result = new ArrayList<Type>();\n\t\tfor(Type type : types){\n\t\t\tif(type.getBasePackages() != null && type.getBasePackages().size() != 0){\n\t\t\t\tresult.add(type);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"public List<String> getSupportedCreditCardTypes() {\n return mSupportedCreditCardTypes;\n }",
"public Collection getSupportedUIDTypes() {\n return null;\r\n }",
"public List<SecTyp> getAllTypes();",
"public ModbusObjectType getObjectType() {\r\n\t\treturn objectType;\r\n\t}",
"@SuppressWarnings(\"unchecked\")\n\tpublic Class getObjectType()\n\t{\n\t\tObject obj = getObject();\n\t\tif (obj == null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\treturn obj.getClass();\n\t}",
"public List<VOPaymentType> getAvailablePaymentTypesForCreation() {\n return paymentInfoBean.getAvailablePaymentTypesForCreation(\n model.getService().getKey(), getAccountingService());\n }",
"List<Type> getAllTypeList();",
"public final ArrayList<Class<? extends IResource>> getSelectableResourceTypes() {\n\treturn mSelectableResourceTypes;\n}",
"public Type<O> getObjectType()\n\t{\n\t\treturn this.getSettings().getObjectType();\n\t}",
"public List<APageComponentsType> getAPageComponentsTypes() {\r\n\t\treturn apctDao.findAll();\r\n\t}",
"@Override\n\tpublic List<Type> listType() {\n\t\treturn goodsDao.listType();\n\t}",
"public List<PrizeType> getAllPrizeTypes() throws ContestManagementException {\n return null;\r\n }",
"public List<PrizeType> getAllPrizeTypes() throws ContestManagementException {\n return null;\r\n }",
"public LinkedList<String> getFileSystemTypes() {\r\n return fileSystemTypes;\r\n }",
"ImmutableList<SchemaOrgType> getInteractivityTypeList();",
"public List<ModelType> findAllModelTypes() {\r\n\t\t// sparql\r\n\t\tString sparql = \"SELECT ?modelType WHERE {?modelType rdfs:subClassOf onto:ModelType.}\";\r\n\t\t// test\r\n\t\tString jsonString = findJsonResult(sparql);\r\n\t\tSystem.out.println(\"findAllModelTypes:\" + jsonString);\r\n\t\t// result\r\n\t\tJSONObject json;\r\n\t\ttry {\r\n\t\t\tjson = new JSONObject(jsonString);\r\n\t\t\tJSONArray jsonArray = json.getJSONObject(\"results\").getJSONArray(\"bindings\");\r\n\t\t\tList<ModelType> list = new ArrayList<ModelType>();\r\n\t\t\tfor (int i = 0; i < jsonArray.length(); i++) {\r\n\t\t\t\tJSONObject jsonObject = (JSONObject) jsonArray.get(i);\r\n\t\t\t\tModelType modelType = new ModelType();\r\n\t\t\t\tif (jsonObject.has(\"modelType\")) {\r\n\t\t\t\t\tmodelType.setModelTypeName(jsonObject.getJSONObject(\"modelType\").getString(\"value\").split(\"#\")[1]);\r\n\t\t\t\t}\r\n\t\t\t\tlist.add(modelType);\r\n\t\t\t}\r\n\t\t\treturn list;\r\n\t\t} catch (JSONException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public Class[] getTypes() {\n Class[] types = new Class[elements.size()];\n\n for (int i = 0; i < elements.size(); i++) {\n Object value = elements.get(i);\n\n if (value != null)\n types[i] = value.getClass();\n }\n\n return types;\n }",
"private Class[] getClasses(ArrayList objectList) {\n Class []classTypes = new Class[objectList.size()];\n for(int i=0; i<objectList.size(); ++i) {\n Object obj = objectList.get(i);\n if(obj instanceof Double) classTypes[i] = Double.TYPE;\n else if(obj instanceof Float) classTypes[i] = Float.TYPE;\n else classTypes[i] = obj.getClass();\n }\n return classTypes;\n }",
"public List<IStreamDataExporterDescriptor> getDataExporters(Collection<Class<?>> objectTypes)\n {\n List<IStreamDataExporterDescriptor> editors = new ArrayList<IStreamDataExporterDescriptor>();\n for (DataExporterDescriptor descriptor : dataExporters) {\n boolean supports = true;\n for (Class objectType : objectTypes) {\n if (!descriptor.appliesToType(objectType)) {\n supports = false;\n break;\n }\n }\n if (supports) {\n editors.add(descriptor);\n }\n }\n return editors;\n }"
] | [
"0.6689503",
"0.6413615",
"0.6370266",
"0.62799144",
"0.6278672",
"0.62713635",
"0.6233396",
"0.6169369",
"0.60981125",
"0.6071122",
"0.605088",
"0.6032376",
"0.60288525",
"0.601806",
"0.5999716",
"0.5936026",
"0.5908614",
"0.5908614",
"0.5908614",
"0.58959264",
"0.58959264",
"0.5884014",
"0.5869549",
"0.5866238",
"0.5850847",
"0.58382803",
"0.5836233",
"0.58296525",
"0.5788226",
"0.57720166",
"0.5771829",
"0.57557654",
"0.57539743",
"0.5734976",
"0.5733914",
"0.57178074",
"0.5687605",
"0.5685097",
"0.5675822",
"0.5629979",
"0.5628111",
"0.56104374",
"0.55915004",
"0.55787",
"0.55787",
"0.5574437",
"0.55670494",
"0.55658317",
"0.55559814",
"0.55490637",
"0.55444854",
"0.5542718",
"0.5537622",
"0.5522063",
"0.5521581",
"0.54992986",
"0.5498267",
"0.54891944",
"0.5465167",
"0.54601467",
"0.5456329",
"0.5444311",
"0.54216903",
"0.54040515",
"0.540071",
"0.53966075",
"0.5384339",
"0.53730685",
"0.5372137",
"0.5369193",
"0.5369034",
"0.53661865",
"0.53656954",
"0.5358559",
"0.5348194",
"0.53443354",
"0.53439415",
"0.53384775",
"0.5330518",
"0.5323309",
"0.5321224",
"0.532086",
"0.5317296",
"0.53115004",
"0.53084975",
"0.5307991",
"0.53010017",
"0.5299958",
"0.5299294",
"0.52949905",
"0.527041",
"0.52681655",
"0.5265454",
"0.5265454",
"0.52586615",
"0.5245508",
"0.5239716",
"0.5236749",
"0.52319205",
"0.52317315"
] | 0.7892317 | 0 |
////////////////////////////////////////////////////////////////////////// CONNECTOR DIAGNOSTICS ////////////////////////////////////////////////////////////////////////// Test the configured to see if a connection can be made. This should throw exceptions if the configuration is not complete, has invalid values, the resource cannot be contacted. If the connection succeeds, no exceptions are thrown. | public void testConnection() {
try {
init();
} catch (Exception e) {
if (log.isDebugEnabled())
log.error("Erro teste Conexao ", e);
throw new ConnectorException("Falha no teste de conexao : "
+ e.getMessage() + ". Check os detalhes da conexao.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void testConnecitonFails() {\n\t\ttry {\n\t\t\t@SuppressWarnings(\"unused\")\n\t\t\tConnection c = new Connection(\"localhost\", 4444, this, this);\n\t\t\t// this connection should fail... wait for that:\n\t\t\tfor (int i=0; i<10; i++) {\n\t\t\t\t// if we have a result before our max-wait-time, break\n\t\t\t\tif (connectionStatus != null)\n\t\t\t\t\tbreak;\n\t\t\t\tThread.sleep(500);\n\t\t\t}\n\t\t\t\n\t\t\tassertTrue(connectionStatus != null && connectionStatus.booleanValue() == false);\n\t\t} catch (Exception e) {\n\t\t\tassertTrue(\"should not get an exception\", false);\n\t\t}\n\t}",
"private static void checkConfiguration() {\n try {\n ClientManager.rebuildSocket();\n ClientManager.closeSocket();\n } catch (IOException e) {\n new NetworkNotAvailableErrorStarter(NetworkNotAvailableError.class, null);\n }\n }",
"private boolean validateConnection() {\n boolean success = _vcVlsi.testConnection();\n if (!success) {\n _log.log(Level.WARNING, \"Found VC connection dropped; reconnecting\");\n return connect();\n }\n return success;\n }",
"public boolean checkConnection() {\n\treturn getBoolean(ATTR_CONNECTION, false);\n }",
"private void checkConnectivity() throws NotConnected\n\t{\n\t\tif (!s_ctx.isConnected())\n\t\t{\n\t\t\tthrow new NotConnected(\"Cannot operate: not conected to context\");\n\t\t}\n\t}",
"public boolean testConnection(){\n\t\tboolean connected = false;\n\t\ttry {\t\t\t\n\t\t\tmMysqlConnection = DriverManager\n\t\t\t\t.getConnection(getConnectionURI());\n\t\t\t\n\t\t\tconnected = true;\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.severe(\"!EXCEPTION: \" + e.getMessage());\n\t\t}\n\n\t\treturn connected;\n\t}",
"private boolean checkConnection() {\n return isConnected = ConnectionReceiver.isConnected();\n }",
"private boolean checkConnection() {\n return isConnected = ConnectionReceiver.isConnected();\n }",
"@Test\n public void testConnectToInvalidService()\n throws IOException\n {\n final boolean availability = ConnectionChecker.checkServiceAvailability(\"localhost\", 65534, 3000);\n\n assertFalse(availability);\n }",
"public boolean validate_connection() {\n throw new NO_IMPLEMENT(reason);\n }",
"private static void checkConn() {\n try {\n if (conns.isClosed()) conns = Connect.getConnect();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"public static boolean testConn() {\r\n\t\tboolean bool = false;\r\n\t\ttry (Connection conn = DataSource.getConnection()) {\r\n\t\t\tbool = conn.isValid(0);\r\n\t\t\tif (bool == true){\r\n\t\t\t\tdbStatus = \"ONLINE\";\r\n\t\t\t}\r\n\t\t\telse dbStatus = \"OFFLINE\";\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\treturn bool;\r\n\t}",
"protected synchronized boolean checkConnectivity() {\n return this.connect();\n }",
"boolean supportsConnects();",
"boolean hasAvailableConnection();",
"public boolean createConnection() throws CommunicationException;",
"public boolean testConnection()\r\n { \r\n try {\r\n myConn = DriverManager.getConnection(getconn + \"?user=\" + user + \"&password=\" + pass);\r\n //Connection successfully connected check sourced from Stack Overflow\r\n //Source: https://stackoverflow.com/questions/7764671/java-jdbc-connection-status\r\n if (!myConn.isClosed() || myConn != null)\r\n return true;\r\n return false;\r\n //End borrowed code\r\n } catch (SQLException ex) {\r\n ex.printStackTrace();\r\n //Logger.getLogger(SQLConnector.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return false;\r\n }",
"@Test\r\n\tpublic void testChooseConnection() throws Exception {\n\t}",
"static void checkConnection(AssertableApplicationContext ctx) throws JMSException {\n\t\tConnection con = ctx.getBean(ConnectionFactory.class).createConnection();\n\t\ttry {\n\t\t\tcon.setExceptionListener(exception -> {\n\t\t\t});\n\t\t\tassertThat(con.getExceptionListener().getClass().getName())\n\t\t\t\t\t.startsWith(\"brave.jms.TracingExceptionListener\");\n\t\t}\n\t\tfinally {\n\t\t\tcon.close();\n\t\t}\n\t}",
"@Override\n public void testIfConnected() {\n }",
"@Test\n public void testGetConnection() {\n System.out.println(\"getConnection\");\n Connection result = instance.getConnection();\n assertTrue(result!=null);\n \n }",
"public boolean testConnection() {\r\n boolean toReturn = true;\r\n\r\n String[] paramFields = {};\r\n SocketMessage request = new SocketMessage(\"admin\", \"ping\", SocketMessage.PriorityType.EMERGENCY, SocketMessage.TransferType.BI_WAY, \"\", paramFields);\r\n SocketMessage response = handleMessage(request);\r\n if (isSuccessful(response)) {\r\n toReturn = true;\r\n } else {\r\n toReturn = false;\r\n }\r\n\r\n return toReturn;\r\n }",
"@WebMethod(operationName = \"CheckConnection\")\n public boolean CheckConnection() {\n return true;\n }",
"public boolean checkConnection() {\n\t\ttry {\n\t\t\tif (con.isClosed() || !isAlive) {\n\t\t\t\treturn connect();\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (SQLException e) {\n\t\t\treturn false;\n\t\t}\n\t}",
"public void CheckConnection() {\n\t\tconn = SqlConnection.DbConnector();\n\t\tif (conn == null) {\n\t\t\tSystem.out.println(\"Connection Not Successful\");\n\t\t\tSystem.exit(1);\n\t\t} else {\n\t\t\tSystem.out.println(\"Connection Successful\");\n\t\t}\n\t}",
"public void verifyConnectivity() {\n\n // Attempt to make a valid request to the VPLEX management server.\n URI requestURI = _baseURI.resolve(VPlexApiConstants.URI_CLUSTERS);\n ClientResponse response = null;\n try {\n response = get(requestURI);\n String responseStr = response.getEntity(String.class);\n s_logger.info(\"Verify connectivity response is {}\", responseStr);\n if (responseStr == null || responseStr.equals(\"\")) {\n s_logger.error(\"Response from VPLEX was empty.\");\n throw VPlexApiException.exceptions.connectionFailure(_baseURI.toString());\n }\n int responseStatus = response.getStatus();\n if (responseStatus != VPlexApiConstants.SUCCESS_STATUS) {\n s_logger.info(\"Verify connectivity response status is {}\", responseStatus);\n if (responseStatus == VPlexApiConstants.AUTHENTICATION_STATUS) {\n // Bad user name and/or password.\n throw VPlexApiException.exceptions.authenticationFailure(_baseURI.toString());\n } else {\n // Could be a 404 because the IP was not that for a VPLEX.\n throw VPlexApiException.exceptions.connectionFailure(_baseURI.toString());\n }\n }\n } catch (VPlexApiException vae) {\n throw vae;\n } catch (Exception e) {\n // Could be a java.net.ConnectException for an invalid IP address\n // or a java.net.SocketTimeoutException for a bad port.\n throw VPlexApiException.exceptions.connectionFailure(_baseURI.toString());\n } finally {\n if (response != null) {\n response.close();\n }\n }\n }",
"@Test\n\tpublic void testConnectionsExistOnPoolCreation() {\n\t\tAssert.assertTrue(pool.totalConnections() > 0); \n\t}",
"private boolean canConnect() {\n \t\treturn (currentlyConnectingSockets.get() < maxConnectingSockets)\n \t\t\t\t&& (currentlyOpenSockets.get() < maxOpenSockets);\n \t}",
"private void checkOpened() throws ConnectException {\n if (!opened) throw new ConnectException(\"Client connection not opened\");\n }",
"public boolean isConnectable(){\n\t\tif((System.currentTimeMillis() - this.lastTry) > retryBackoff){\n\t\t\tthis.lastTry = System.currentTimeMillis();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"protected void checkConnectionProvider() {\n\t\tfinal Connection connection = connectionProvider.getConnection();\n\t\ttry {\n\t\t\tfinal DatabaseMetaData databaseMetaData = connection.getMetaData();\n\t\t\tfinal String name = databaseMetaData.getDatabaseProductName();\n\t\t\tfinal String version = databaseMetaData.getDatabaseProductVersion();\n\n\t\t\tif (log.isInfoEnabled()) {\n\t\t\t\tlog.info(\"Connected to database: \" + name + \" v\" + version);\n\t\t\t}\n\t\t} catch (final SQLException sex) {\n\t\t\tlog.error(\"DB connection failed: \", sex);\n\t\t} finally {\n\t\t\tconnectionProvider.closeConnection(connection);\n\t\t}\n\t}",
"protected boolean internalTestConnection(Subject subject)\n {\n boolean result = false;\n ConnectionListener cl = null;\n try\n {\n if (((PoolStatisticsImpl)getStatistics()).getAvailableCount(true) > 0)\n {\n cl = getConnection(null, subject, null);\n result = true;\n }\n }\n catch (Throwable ignored)\n {\n // Ignore\n }\n finally\n {\n if (cl != null)\n {\n try\n {\n returnConnection(cl, false);\n }\n catch (ResourceException ire)\n {\n // Ignore\n }\n }\n }\n\n return result;\n }",
"@Override\n public void checkConfiguration() {\n }",
"boolean hasConfigConnectorConfig();",
"public boolean configurationIsValid() {\n\t\tif (this.maxThreadNumberResourceWorker + this.maxThreadNumberSeedWorker != this.maxThreadNumber) {\n\t\t\tlog.error(Logging.format(\"Confirguation error: Thread number configuration is wrong.\"));\n\t\t\treturn false;\n\t\t} else if (seedList == null || seedList.size() == 0) {\n\t\t\tlog.error(Logging.format(\"Confirguation error: Seed list is empty.\"));\n\t\t\treturn false;\n\t\t} else if (StringUtils.isEmpty(workspacePath)) {\n\t\t\tlog.error(Logging.format(\"Confirguation error: Workspace path is not set correctly.\"));\n\t\t\treturn false;\n\t\t} else if (!Files.exists(runtimeBasePath)) {\n\t\t\tlog.error(Logging.format(\"Confirguation error: Runtime directory ({}) does not exist.\", runtimeBasePath));\n\t\t\treturn false;\n\t\t}\n\t\tlog.info(Logging.format(\"Configuration check is passed.\"));\n\t\treturn true;\n\t}",
"public IllegalConnectionCheck() {\n listener = new LinkedHashSet<CheckListener>();\n active = true;\n }",
"@Test\n public void testIsConnected() throws MainException {\n System.out.println(\"isConnected\");\n LinkingDb instance = new LinkingDb(new ConfigurazioneTO(\"jdbc:hsqldb:file:database/\",\n \"ADISysData\", \"asl\", \"\"));\n instance.connect();\n boolean expResult = true;\n boolean result = instance.isConnected();\n assertEquals(expResult, result);\n instance.disconnect();\n result = instance.isConnected();\n assertEquals(false, result);\n\n }",
"private void checkConnection(){\n NetworkInfo activeNetwork = connectivityManager.getActiveNetworkInfo();\n\n // if activeNetwork is not null, and a network connection is detected,\n // isConnected is true\n boolean isConnected = activeNetwork != null &&\n activeNetwork.isConnectedOrConnecting();\n\n // prepare output to indicate connection status\n String message = isConnected ? \"Connection Detected!\" : \"No Connection Detected!\";\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n }",
"@Override\n\tpublic boolean canConnect() {\n return false;\n }",
"public boolean connect(){\n try{\n conn = DriverManager.getConnection(uri, user, password);\n }catch (SQLException sqle){\n DLException dle = new DLException(sqle, \"Unable to conclude this operation\");\n return false;\n }\n return true;\n }",
"private void checkConfiguration() throws ConfigurationException\n {\n CombinedConfiguration compositeConfiguration = (CombinedConfiguration) factory\n .getConfiguration();\n\n assertEquals(\"Number of configurations\", 3, compositeConfiguration\n .getNumberOfConfigurations());\n assertEquals(PropertiesConfiguration.class, compositeConfiguration\n .getConfiguration(0).getClass());\n assertEquals(XMLPropertiesConfiguration.class, compositeConfiguration\n .getConfiguration(1).getClass());\n assertEquals(XMLConfiguration.class, compositeConfiguration\n .getConfiguration(2).getClass());\n\n // check the first configuration\n PropertiesConfiguration pc = (PropertiesConfiguration) compositeConfiguration\n .getConfiguration(0);\n assertNotNull(\"Make sure we have a fileName: \" + pc.getFileName(), pc\n .getFileName());\n\n // check some properties\n checkProperties(compositeConfiguration);\n }",
"@Test\n public void shouldConnect() throws Exception {\n assertThat(acceptor.connect(Arrays.asList(TestHelper.generateTempFileFromResource(this.getClass(), \"remote.yaml\", \".tmp\").getAbsolutePath())).toString(), startsWith(\"Connected - \"));\n }",
"private boolean isConnect(ConnectionSpec connectionSpec) {\r\n\t\tif (connectionSpec == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tJRedis jredis = new JRedisClient(connectionSpec.getAddress().getHostAddress(), connectionSpec.getPort());\r\n\t\ttry {\r\n\t\t\tjredis.ping();\r\n\t\t\tjredis.quit();\r\n\t\t} catch (Exception e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"private boolean checkConnection() {\n return InternetConnectivityReceiver.isConnected();\n }",
"private boolean managingConnections() {\n\n if (configWrapper.getConfig().getConnectionInfo().getDataSource() == null) {\n return false;\n }\n\n return true;\n\n }",
"public void testNotReady() throws Exception {\n Properties props = new Properties();\n props.setProperty(LockssRepositoryImpl.PARAM_CACHE_LOCATION, tempDirPath);\n props\n\t.setProperty(ConfigManager.PARAM_PLATFORM_DISK_SPACE_LIST, tempDirPath);\n props.setProperty(SqlDbManager.PARAM_DATASOURCE_CLASSNAME, \"java.lang.String\");\n ConfigurationUtil.setCurrentConfigFromProps(props);\n\n startService();\n assertEquals(false, sqlDbManager.isReady());\n\n Connection conn = null;\n try {\n conn = sqlDbManager.getConnection();\n } catch (SQLException sqle) {\n }\n assertNull(conn);\n\n }",
"abstract public boolean createConnection();",
"private void attemptToConnect() {\n LOG.warn(\"Attempting to connect....\");\n \n if (// No connection configuration\n getConnectionConfiguration() == null &&\n (getServerHostname() == null || getServerPort() == 0 ||\n getServiceName() == null || getFromAddress() == null ||\n getPassword() == null || getResource() == null)\n \n ||\n \n // Already logged in.\n getConnection() != null && getConnection().isAuthenticated()) {\n \n return;\n }\n \n try {\n if (getConnectionConfiguration() == null) {\n setConnectionConfiguration(new ConnectionConfiguration(\n getServerHostname(), getServerPort(), getServiceName()));\n }\n\n connect();\n }\n catch (Throwable t) {\n LOG.error(t);\n }\n }",
"@Test\n\tpublic void testGetConnection() throws SQLException {\n\t\tint count = pool.idleConnectionsCount();\n\t\tConnection connection = pool.getConnection(config.getConnectionTimeout());\n\t\tAssert.assertEquals(((ConnectionItem) connection).state().get() , ConnectionItem.STATE_IN_USE);\n\t\tAssert.assertEquals(count - 1 , pool.idleConnectionsCount());\n\t}",
"protected abstract boolean isConnected();",
"private void ensureConnection() {\n Objects.requireNonNull(connection);\n }",
"@Test\n public void testConnect() throws MainException {\n System.out.println(\"connect\");\n LinkingDb instance = new LinkingDb(new ConfigurazioneTO(\"jdbc:hsqldb:file:database/\",\n \"ADISysData\", \"asl\", \"\"));\n Connection result = instance.connect();\n assertNotNull(result);\n boolean expResult = true;\n assertEquals(instance.isConnected(), expResult);\n }",
"@Override\n public boolean verifyJobDatabase() {\n try (Connection conn = getConnection()) {\n } catch (Exception e) {\n LOG.error(\"Failed to verify connection to the Job Database. \", e);\n return false;\n }\n return true;\n }",
"@Test\n\tpublic void testGetConnection() throws SQLException\n\t{\n\t\tassertTrue(DatabaseGateway.getConnection() != null);\n\t}",
"public boolean canStartConnection(ICreateConnectionContext context) {\n if (getFlowNode(context.getSourceAnchor()) != null) {\r\n return true;\r\n }\r\n return false;\r\n }",
"static void checkTopicConnection(AssertableApplicationContext ctx)\n\t\t\tthrows JMSException {\n\t\tTopicConnection con = ctx.getBean(TopicConnectionFactory.class)\n\t\t\t\t.createTopicConnection();\n\t\ttry {\n\t\t\tcon.setExceptionListener(exception -> {\n\t\t\t});\n\t\t\tassertThat(con.getExceptionListener().getClass().getName())\n\t\t\t\t\t.startsWith(\"brave.jms.TracingExceptionListener\");\n\t\t}\n\t\tfinally {\n\t\t\tcon.close();\n\t\t}\n\t}",
"boolean isConnected();",
"boolean isConnected();",
"boolean isConnected();",
"boolean isConnected();",
"boolean isConnected();",
"boolean isConnected();",
"boolean isConnected();",
"boolean isConnected();",
"private boolean checkEssentialConnects() {\r\n\t\treturn (animalsHash != null && questionChooser != null);\r\n\t}",
"public boolean ConnectionCheck(){\n ConnectivityManager cm =\n (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);\n\n NetworkInfo activeNetwork = cm.getActiveNetworkInfo();\n isConnected = activeNetwork != null &&\n activeNetwork.isConnectedOrConnecting();\n return isConnected;\n }",
"void connectFailed();",
"public void testGetConnection() {\r\n \r\n }",
"public static boolean hasConnection() {\n \t\treturn connPool.getConnectionCount() > 0;\n \t}",
"public void connect() throws ConnectionFailedException\n {\n isConnected = true;\n }",
"boolean hasConnProps();",
"@Test\n public void testIsConnected()\n {\n assertEquals(MarkovModel.util.isConnected(P1), true);\n assertEquals(MarkovModel.util.isConnected(P2), false);\n assertEquals(MarkovModel.util.isConnected(P3), false);\n }",
"private boolean hasTooManyConnections()\n\t{\n\t\treturn (config.getMaxConnections() > -1 && \n\t\t\t\tgetNumberOfConnections() >= config.getMaxConnections());\n\t}",
"@Override\r\n public void checkConfiguration() throws ContestServicesConfigurationException {\r\n super.checkConfiguration();\r\n ServicesHelper.checkConfigObject(upcomingContestsManager, \"upcomingContestsManager\");\r\n }",
"private boolean isConnected() {\n try {\n return (conn != null) && conn.isValid(0);\n } catch (SQLException ex) {\n Logger.getLogger(DB.class.getName()).log(Level.SEVERE, null, ex);\n }\n return false;\n }",
"public abstract boolean isDataConnectionAsDesired();",
"public boolean isConnected();",
"public boolean isConnected();",
"public boolean isConnected();",
"public boolean isConnected();",
"public boolean isConnected();",
"private void assertConnected() throws IllegalStateException\n {\n if (provider == null)\n throw new IllegalStateException(\n \"The provider must be non-null and signed on the \"\n + \"service before being able to communicate.\");\n if (!provider.isRegistered())\n throw new IllegalStateException(\n \"The provider must be signed on the service before \"\n + \"being able to communicate.\");\n }",
"@Test(timeout = 4000)\n public void test046() throws Throwable {\n try { \n DBUtil.connect(\"SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE\", (String) null, \"SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE\", (String) null, true);\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // Connecting SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE failed: \n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }",
"@Override\n public boolean init()\n {\n \tFile file = new File(\"err.txt\");\n\t\tFileOutputStream fos;\n\t\ttry {\n\t\t\tfos = new FileOutputStream(file);\n\t\t\tPrintStream ps = new PrintStream(fos);\n\t\t\tSystem.setErr(ps);\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n if (connected)\n {\n System.out.println(\"Client connection already initialized.\");\n return true;\n }\n properties = getProperties();\n String driver = properties.getProperty(DRIVER_CLASS, DRIVER_CLASS_DEFAULT);\n String url = properties.getProperty(CONNECTION_URL, CONNECTION_URL_DEFAULT);\n String user = properties.getProperty(CONNECTION_USER, CONNECTION_USER_DEFAULT);\n String passwd = properties.getProperty(CONNECTION_PASSWD, CONNECTION_PASSWD_DEFAULT);\n try\n {\n if (driver != null)\n {\n Class.forName(driver);\n }\n connection = DriverManager.getConnection(url, user, passwd);\n System.out.println(\"Connection established successfully!\");\n connected = true;\n newCachedStatements = new ConcurrentHashMap<>();\n return true;\n }\n catch (ClassNotFoundException | SQLException ex)\n {\n Logger.getLogger(WindowsAzureClientInit.class.getName()).log(Level.SEVERE, null, ex);\n System.out.println(\"Error in creating a connection with the database!\");\n return false;\n }\n }",
"boolean testConnection(RemoteService service);",
"@Override\n public void check(Connection connection) throws RemotingException {\n\n }",
"public boolean checkConnected() {\n boolean isClosed = true;\n boolean isValid = false;\n boolean exists = (connection != null);\n\n // If we're waiting for server to recover then leave early\n if (nextReconnectTimestamp > 0 && nextReconnectTimestamp > System.nanoTime()) {\n return false;\n }\n\n if (exists) {\n try {\n isClosed = connection.isClosed();\n }\n catch (SQLException e) {\n isClosed = true;\n e.printStackTrace();\n printErrors(e);\n }\n\n if (!isClosed) {\n try {\n isValid = connection.isValid(VALID_TIMEOUT);\n }\n catch (SQLException e) {\n // Don't print stack trace because it's valid to lose idle connections to the server and have to restart them.\n isValid = false;\n }\n }\n }\n\n // Leave if all ok\n if (exists && !isClosed && isValid) {\n // Housekeeping\n nextReconnectTimestamp = 0;\n reconnectAttempt = 0;\n return true;\n }\n\n // Cleanup after ourselves for GC and MySQL's sake\n if (exists && !isClosed) {\n try {\n connection.close();\n }\n catch (SQLException ex) {\n // This is a housekeeping exercise, ignore errors\n }\n }\n\n // Try to connect again\n connect();\n\n // Leave if connection is good\n try {\n if (connection != null && !connection.isClosed()) {\n // Schedule a database save if we really had an outage\n if (reconnectAttempt > 1) {\n new SQLReconnectTask().runTaskLater(Assassin.p, 5);\n }\n nextReconnectTimestamp = 0;\n reconnectAttempt = 0;\n return true;\n }\n }\n catch (SQLException e) {\n // Failed to check isClosed, so presume connection is bad and attempt later\n e.printStackTrace();\n printErrors(e);\n }\n\n reconnectAttempt++;\n nextReconnectTimestamp = (long) (System.nanoTime() + Math.min(MAX_WAIT, (reconnectAttempt * SCALING_FACTOR * MIN_WAIT)));\n return false;\n }",
"@Test\n public final void testValidate() {\n final CmdConfiguration config = new CmdConfiguration();\n try {\n config.validate();\n fail();\n } catch (RuntimeException e) {\n // expected because configuration is incomplete\n assertNotNull(e);\n }\n }",
"@Override\r\n public void checkConfiguration() throws ContestServicesConfigurationException {\r\n super.checkConfiguration();\r\n ServicesHelper.checkConfigObject(searchContestsManager, \"searchContestsManager\");\r\n }",
"public void checkConnections() {\n Boolean updateCanvas = false;\n\n // Find new connections set within a node and creates them\n for (DrawableNode node : nodes) {\n if (node instanceof LogicNode) {\n String src = ((LogicNode) node).getLogic().getLogic();\n\n for (DrawableNode endNode : getNodes()) {\n int nodeConnectionType = NodeConnection.NO_CONNECTION;\n\n // Here we are checked to see if any connections are linked from this LogicNode\n if (src.contains(\"run(\\\"\" + endNode.getContainedText() + \"\\\"\") ||\n src.contains(\"runAndWait(\\\"\" + endNode.getContainedText() + \"\\\"\") ||\n src.contains(\"runAndJoin(\\\"\" + endNode.getContainedText() + \"\\\"\")) {\n nodeConnectionType = NodeConnection.DYNAMIC_CONNECTION;\n } else if (src.contains(\"getNode(\\\"\" + endNode.getContainedText() + \"\\\"\")) {\n nodeConnectionType = NodeConnection.GET_NODE_CONNECTION;\n }\n\n // If we find a possible connection and it doesn't already exist, we create that connection with the correct type\n if (!connectionExists(node, endNode) && nodeConnectionType != -1) {\n NodeConnection newConnection = new NodeConnection(node, endNode, nodeConnectionType);\n connections.add(newConnection);\n updateCanvas = true;\n }\n }\n } else if (node instanceof TestCaseNode) {\n String src = ((TestCaseNode) node).getLogic().getLogic();\n\n for (DrawableNode endNode : getNodes()) {\n int nodeConnectionType = NodeConnection.NO_CONNECTION;\n\n // Here we are checked to see if any connections are linked from this TestCaseNode\n if (src.contains(\"run(\\\"\" + endNode.getContainedText() + \"\\\"\") ||\n src.contains(\"runAndWait(\\\"\" + endNode.getContainedText() + \"\\\"\") ||\n src.contains(\"runAndJoin(\\\"\" + endNode.getContainedText() + \"\\\"\")) {\n nodeConnectionType = NodeConnection.DYNAMIC_CONNECTION;\n } else if (src.contains(\"getNode(\\\"\" + endNode.getContainedText() + \"\\\"\")) {\n nodeConnectionType = NodeConnection.GET_NODE_CONNECTION;\n }\n\n // If we find a possible connection and it doesn't already exist, we create that connection with the correct type\n if (!connectionExists(node, endNode) && nodeConnectionType != -1) {\n NodeConnection newConnection = new NodeConnection(node, endNode, nodeConnectionType);\n connections.add(newConnection);\n updateCanvas = true;\n }\n }\n } else if (node instanceof SwitchNode) {\n List<Switch> aSwitches = ((SwitchNode) node).getSwitches();\n\n for (DrawableNode endNode : getNodes()) {\n Boolean createConnection = false;\n Boolean enabledConnection = false;\n\n for (Switch aSwitch : aSwitches) {\n if ((aSwitch.getTarget().equals(endNode.getContainedText()))) {\n enabledConnection = aSwitch.isEnabled();\n createConnection = true;\n }\n }\n\n if (createConnection && !connectionExists(node, endNode)) {\n Integer connectionType = NodeConnection.DYNAMIC_CONNECTION;\n if (!enabledConnection) {\n connectionType = NodeConnection.DISABLED_CONNECTION;\n }\n\n NodeConnection newConnection = new NodeConnection(node, endNode, connectionType);\n connections.add(newConnection);\n updateCanvas = true;\n }\n }\n } else if (node instanceof TriggerNode) {\n List<Trigger> triggers = ((TriggerNode) node).getTriggers();\n\n for (Trigger trigger : triggers) {\n String watchName = trigger.getWatch();\n\n for (DrawableNode endNode : getNodes()) {\n Boolean createConnection = false;\n\n if (watchName.equals(endNode.getContainedText())) {\n createConnection = true;\n }\n\n // This connection has the start and end the other way around, the target is specified in the trigger but\n // we want it to look like the watched node is connecting to the trigger as that is the order that they are run\n if (createConnection && !connectionExists(endNode, node)) {\n NodeConnection newConnection = new NodeConnection(endNode, node, NodeConnection.TRIGGER_CONNECTION);\n connections.add(newConnection);\n updateCanvas = true;\n }\n }\n }\n }\n\n // Find connection that are set using the Next node input box\n if (node != null && !node.getNextNodeToRun().isEmpty()) {\n for (DrawableNode endNode : getNodes()) {\n if (node.getNextNodeToRun().equals(endNode.getContainedText())) {\n if (!connectionExists(node, endNode)) {\n NodeConnection newConnection = new NodeConnection(node, endNode, NodeConnection.MAIN_CONNECTION);\n connections.add(newConnection);\n updateCanvas = true;\n }\n }\n }\n }\n }\n\n // Checks old connections and removes ones that don't exist\n List<NodeConnection> listToRemove = new ArrayList<>();\n List<NodeConnection> connectionsLoopTemp = new ArrayList<>(); // We make a copy the list here so that we can the original while iterating over this one\n connectionsLoopTemp.addAll(connections);\n for (NodeConnection nodeConnection : connectionsLoopTemp) {\n if (nodeConnection.getConnectionType().equals(NodeConnection.DYNAMIC_CONNECTION)) {\n if (nodeConnection.getConnectionStart() instanceof LogicNode) {\n if (!((LogicNode) nodeConnection.getConnectionStart()).getLogic().getLogic().contains(\"run(\\\"\" + nodeConnection.getConnectionEnd().getContainedText() + \"\\\"\")) {\n if (!((LogicNode) nodeConnection.getConnectionStart()).getLogic().getLogic().contains(\"runAndWait(\\\"\" + nodeConnection.getConnectionEnd().getContainedText() + \"\\\"\")) {\n if (!((LogicNode) nodeConnection.getConnectionStart()).getLogic().getLogic().contains(\"runAndJoin(\\\"\" + nodeConnection.getConnectionEnd().getContainedText() + \"\\\"\")) {\n if (!((LogicNode) nodeConnection.getConnectionStart()).getLogic().getLogic().contains(\"getNode(\\\"\" + nodeConnection.getConnectionEnd().getContainedText() + \"\\\"\")) {\n listToRemove.add(nodeConnection);\n updateCanvas = true;\n }\n }\n }\n }\n } else if (nodeConnection.getConnectionStart() instanceof TestCaseNode) {\n if (!((TestCaseNode) nodeConnection.getConnectionStart()).getLogic().getLogic().contains(\"run(\\\"\" + nodeConnection.getConnectionEnd().getContainedText() + \"\\\"\")) {\n if (!((TestCaseNode) nodeConnection.getConnectionStart()).getLogic().getLogic().contains(\"runAndWait(\\\"\" + nodeConnection.getConnectionEnd().getContainedText() + \"\\\"\")) {\n if (!((TestCaseNode) nodeConnection.getConnectionStart()).getLogic().getLogic().contains(\"runAndJoin(\\\"\" + nodeConnection.getConnectionEnd().getContainedText() + \"\\\"\")) {\n if (!((TestCaseNode) nodeConnection.getConnectionStart()).getLogic().getLogic().contains(\"getNode(\\\"\" + nodeConnection.getConnectionEnd().getContainedText() + \"\\\"\")) {\n listToRemove.add(nodeConnection);\n updateCanvas = true;\n }\n }\n }\n }\n } else if (nodeConnection.getConnectionStart() instanceof SwitchNode) {\n List<Switch> aSwitches = ((SwitchNode) nodeConnection.getConnectionStart()).getSwitches();\n String endContainedText = nodeConnection.getConnectionEnd().getContainedText();\n Integer removeCount = 0;\n for (Switch aSwitch : aSwitches) {\n if ((!aSwitch.getTarget().equals(endContainedText) || !aSwitch.isEnabled())) {\n removeCount++;\n }\n }\n\n if (removeCount.equals(aSwitches.size())) {\n // Create a disabled connection between these two nodes to give appearance of toggling\n NodeConnection newConnection = new NodeConnection(nodeConnection.getConnectionStart(), nodeConnection.getConnectionEnd(), NodeConnection.DISABLED_CONNECTION);\n connections.add(newConnection);\n\n listToRemove.add(nodeConnection);\n updateCanvas = true;\n }\n }\n } else if (nodeConnection.getConnectionType().equals(NodeConnection.TRIGGER_CONNECTION)) {\n if (nodeConnection.getConnectionEnd() instanceof TriggerNode) { // Here the start and end connections are reversed\n List<Trigger> triggers = ((TriggerNode) nodeConnection.getConnectionEnd()).getTriggers();\n String endContainedText = nodeConnection.getConnectionStart().getContainedText();\n Integer removeCount = 0;\n for (Trigger trigger : triggers) {\n if ((!trigger.getWatch().equals(endContainedText))) {\n removeCount++;\n }\n }\n\n if (removeCount.equals(triggers.size())) {\n listToRemove.add(nodeConnection);\n updateCanvas = true;\n }\n }\n } else if (nodeConnection.getConnectionType().equals(NodeConnection.GET_NODE_CONNECTION)) {\n if (nodeConnection.getConnectionStart() instanceof LogicNode) {\n if (!((LogicNode) nodeConnection.getConnectionStart()).getLogic().getLogic().contains(\"getNode(\\\"\" + nodeConnection.getConnectionEnd().getContainedText() + \"\\\"\")) {\n listToRemove.add(nodeConnection);\n updateCanvas = true;\n }\n } else if (nodeConnection.getConnectionStart() instanceof TestCaseNode) {\n if (!((TestCaseNode) nodeConnection.getConnectionStart()).getLogic().getLogic().contains(\"getNode(\\\"\" + nodeConnection.getConnectionEnd().getContainedText() + \"\\\"\")) {\n listToRemove.add(nodeConnection);\n updateCanvas = true;\n }\n }\n } else if (nodeConnection.getConnectionType().equals(NodeConnection.DISABLED_CONNECTION)) {\n if (nodeConnection.getConnectionStart() instanceof SwitchNode) {\n List<Switch> aSwitches = ((SwitchNode) nodeConnection.getConnectionStart()).getSwitches();\n String endContainedText = nodeConnection.getConnectionEnd().getContainedText();\n Integer removeCount = 0;\n for (Switch aSwitch : aSwitches) {\n if ((!aSwitch.getTarget().equals(endContainedText) || aSwitch.isEnabled())) {\n removeCount++;\n }\n }\n\n if (removeCount.equals(aSwitches.size())) {\n // Create an enabled connection between these two nodes to give appearance of toggling\n NodeConnection newConnection = new NodeConnection(nodeConnection.getConnectionStart(), nodeConnection.getConnectionEnd(), NodeConnection.DYNAMIC_CONNECTION);\n connections.add(newConnection);\n\n listToRemove.add(nodeConnection);\n updateCanvas = true;\n }\n }\n }\n\n if (nodeConnection.getConnectionType().equals(NodeConnection.MAIN_CONNECTION)) {\n if (!nodeConnection.getConnectionStart().getNextNodeToRun().equals(nodeConnection.getConnectionEnd().getContainedText())) {\n listToRemove.add(nodeConnection);\n updateCanvas = true;\n }\n }\n }\n\n connections.removeAll(listToRemove);\n if (updateCanvas) {\n Controller.getInstance().updateCanvasControllerLater();\n }\n }",
"private boolean configuredNetwork(Context context, WifiConfiguration config) {\n boolean connResult = false;\n if (config != null) {\n connResult = Wifi.connectToConfiguredNetwork(context, mWifiManager, config, false);\n }\n return connResult;\n }",
"@Test\r\n public void testInternetConnection(){\r\n CheckConnection checkConnection = new CheckConnection();\r\n checkConnection.checkURL();\r\n }",
"static void checkXAConnection(AssertableApplicationContext ctx) throws JMSException {\n\t\tXAConnection con = ctx.getBean(XAConnectionFactory.class).createXAConnection();\n\t\ttry {\n\t\t\tcon.setExceptionListener(exception -> {\n\t\t\t});\n\t\t\tassertThat(con.getExceptionListener().getClass().getName())\n\t\t\t\t\t.startsWith(\"brave.jms.TracingExceptionListener\");\n\t\t}\n\t\tfinally {\n\t\t\tcon.close();\n\t\t}\n\t}",
"public void connect() throws QualificationTimeoutException {\n Qualification qualificator = new Qualification(config);\n connectivityStatus = ConnectivityStatus.Starting;\n try {\n qualificator.run();\n } catch (QualificationTimeoutException e) {\n connectivityStatus = ConnectivityStatus.Offline;\n throw e;\n }\n connectivityStatus = ConnectivityStatus.Connected;\n myExternalAddress = qualificator.getMappedAddress();\n Inet6Address teredoPrefix = qualificator.getTeredoPrefix();\n myTeredoAddress = new TeredoAddress(teredoPrefix,\n config.getServerIp(),\n myExternalAddress);\n coneNat = qualificator.isConeNat();\n }",
"@Test\n public void testCreateConnections() {\n Element element = mock(Element.class);\n View<?> content = mock(View.class);\n Bounds bounds = Bounds.create(0d, 0d, 10d, 20d);\n when(element.getContent()).thenReturn(content);\n when(content.getBounds()).thenReturn(bounds);\n MagnetConnection c1 =\n ConnectionAcceptorControlImpl.createConnection(element);\n assertEquals(5,\n c1.getLocation().getX(),\n 0);\n assertEquals(10,\n c1.getLocation().getY(),\n 0);\n assertEquals(MagnetConnection.MAGNET_CENTER,\n c1.getMagnetIndex().getAsInt());\n assertFalse(c1.isAuto());\n\n // New default connection for wires.\n WiresConnection wiresConnection = mock(WiresConnection.class);\n when(wiresConnection.isAutoConnection()).thenReturn(true);\n WiresMagnet wiresMagnet = mock(WiresMagnet.class);\n when(wiresMagnet.getX()).thenReturn(122d);\n when(wiresMagnet.getY()).thenReturn(543d);\n when(wiresMagnet.getIndex()).thenReturn(7);\n MagnetConnection c2 =\n (MagnetConnection) ConnectionAcceptorControlImpl.createConnection(wiresConnection,\n wiresMagnet);\n assertEquals(122,\n c2.getLocation().getX(),\n 0);\n assertEquals(543,\n c2.getLocation().getY(),\n 0);\n assertEquals(7,\n c2.getMagnetIndex().getAsInt());\n assertTrue(c2.isAuto());\n\n // Asset connections to concrete locations, when no concrete magnets assigned.\n when(wiresConnection.getPoint()).thenReturn(new Point2D(122d, 543d));\n final Connection pointConnection = ConnectionAcceptorControlImpl.createConnection(wiresConnection, null);\n assertEquals(122d, pointConnection.getLocation().getX(), 0);\n assertEquals(543d, pointConnection.getLocation().getY(), 0);\n\n // Connections (view magnets) can be nullified.\n assertNull(ConnectionAcceptorControlImpl.createConnection(null));\n assertNull(ConnectionAcceptorControlImpl.createConnection(null,\n null));\n }",
"@Test\n public void testValidateObjectLowersActiveFlagIfConnectionHasBeenBoundButAutoBindIsNotSet() {\n expect(conn.isBindAttempted()).andReturn(true);\n // we assume autoBind defaults to false (we'd rather not go through the\n // whole process of mocking up the connection manager again)\n conn.setActive(false);\n expectLastCall().once();\n replay(conn);\n assertFalse(factory.validateObject(conn));\n }",
"public void testConstrution() {\n try {\n // No storage running should result in an exception\n new StorageValidationFilter(conf);\n fail(\"Exception is expected\");\n } catch (IOException e) {\n // expected\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Not expected to throw exception when creating configuration\");\n }\n try {\n storage = new RMIStorageProxy(conf);\n assertNotNull(storage);\n StorageValidationFilter storageValidationFilter = \n new StorageValidationFilter(conf);\n // Expected\n assertNotNull(storageValidationFilter);\n } catch (IOException e) {\n e.printStackTrace();\n fail(\"No exception is expected here\");\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Not expected to fail when creating configuratino\");\n }\n }",
"final void checkEnsure() {\r\n\t\t\r\n\t\ttry {\r\n\t\t\tif (this.conn == null || this.conn.isClosed()) {\r\n\t\t\t\tthis.conn = this.ci.createConnection();\r\n\t\t\t\tthis.databaseType = ConnectionHolder.DT_UNKNOWN;\r\n\t\t\t\tthis.loops = this.ci.connectionMaxLoops();\r\n\t\t\t\tthis.date = System.currentTimeMillis() + this.ci.connectionTimeToLive();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (--this.loops < 0 || this.date < System.currentTimeMillis()) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.conn.close();\r\n\t\t\t\t} catch (final Throwable t) {\r\n\t\t\t\t\t// ignore\r\n\t\t\t\t}\r\n\t\t\t\tthis.conn = this.ci.createConnection();\r\n\t\t\t\tthis.databaseType = ConnectionHolder.DT_UNKNOWN;\r\n\t\t\t\tthis.loops = this.ci.connectionMaxLoops();\r\n\t\t\t\tthis.date = System.currentTimeMillis() + this.ci.connectionTimeToLive();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (this.databaseType == ConnectionHolder.DT_UNKNOWN) {\r\n\t\t\t\tthis.databaseType = this.conn.getMetaData().getDatabaseProductName().toUpperCase().indexOf(\"ORACLE\") == -1\r\n\t\t\t\t\t? ConnectionHolder.DT_NORMAL\r\n\t\t\t\t\t: ConnectionHolder.DT_ORACLE;\r\n\t\t\t}\r\n\t\t\ttry (final Statement st = this.conn.createStatement()) {\r\n\t\t\t\t/** Do not use it here, may be unsupported? */\r\n\t\t\t\ttry {\r\n\t\t\t\t\tst.setQueryTimeout(10);\r\n\t\t\t\t} catch (final Throwable t) {\r\n\t\t\t\t\t// ignore\r\n\t\t\t\t}\r\n\t\t\t\tst.execute(\r\n\t\t\t\t\t\tthis.databaseType == ConnectionHolder.DT_ORACLE\r\n\t\t\t\t\t\t\t? \"SELECT 5 FROM DUAL\"\r\n\t\t\t\t\t\t\t: \"SELECT 5\");\r\n\t\t\t}\r\n\t\t} catch (final SQLException e) {\r\n\t\t\tif (this.conn != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.conn.close();\r\n\t\t\t\t} catch (final Throwable t) {\r\n\t\t\t\t\t// ignore\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.conn = this.ci.createConnection();\r\n\t\t\tthis.databaseType = ConnectionHolder.DT_UNKNOWN;\r\n\t\t\tthis.loops = this.ci.connectionMaxLoops();\r\n\t\t\tthis.date = System.currentTimeMillis() + this.ci.connectionTimeToLive();\r\n\t\t}\r\n\t}",
"public String getDatabaseConnectionPoolShouldValidate(){\n \t\treturn getProperty(\"org.sagebionetworks.pool.connection.validate\");\n \t}",
"boolean hasConfiguration();"
] | [
"0.6847103",
"0.6761942",
"0.6745093",
"0.6601394",
"0.659594",
"0.65412605",
"0.65103656",
"0.65103656",
"0.6478054",
"0.6477164",
"0.6437835",
"0.64198554",
"0.6403387",
"0.6387774",
"0.6346396",
"0.63181454",
"0.6254739",
"0.6250643",
"0.6213546",
"0.61894614",
"0.6187476",
"0.6170321",
"0.616352",
"0.61275667",
"0.609565",
"0.6095176",
"0.6072759",
"0.60450673",
"0.6019475",
"0.6006204",
"0.5998685",
"0.59635556",
"0.5962103",
"0.5935464",
"0.59252214",
"0.59249794",
"0.59244",
"0.59214485",
"0.59140056",
"0.5880956",
"0.58803356",
"0.5879158",
"0.5875629",
"0.58680284",
"0.5862362",
"0.58511007",
"0.5823",
"0.58163685",
"0.58126825",
"0.57969594",
"0.579678",
"0.5794759",
"0.5749267",
"0.57296765",
"0.57295525",
"0.5724981",
"0.56947404",
"0.56947404",
"0.56947404",
"0.56947404",
"0.56947404",
"0.56947404",
"0.56947404",
"0.56947404",
"0.5686293",
"0.5685902",
"0.5674286",
"0.56729186",
"0.56703174",
"0.5664707",
"0.56511027",
"0.564497",
"0.56397724",
"0.5639246",
"0.5635325",
"0.5631121",
"0.5630758",
"0.5630758",
"0.5630758",
"0.5630758",
"0.5630758",
"0.56286156",
"0.5623134",
"0.56176853",
"0.5601968",
"0.5576897",
"0.5570155",
"0.55578065",
"0.5557005",
"0.55551106",
"0.5554821",
"0.5545347",
"0.5544952",
"0.55429417",
"0.55386186",
"0.55327004",
"0.55308485",
"0.5530041",
"0.5504854",
"0.54997015"
] | 0.632187 | 15 |
Return an iterator over the objects of the configured object type that match the given filter (or all objects if no filter is specified). | public Iterator<Map<String, Object>> iterate(Filter filter)
throws ConnectorException, UnsupportedOperationException {
debug();
if (isDebug == true) {
log.debug("===== Iterate ====");
}
it = null;
if (isDebug == true) {
log.debug("Iterator " + filter + ">");
}
try {
_filter = filter;
it = new ArrayList<Map<String, Object>>(getObjectsMap().values())
.iterator();
} catch (Exception e) {
if (isDebug == true) {
log.debug("Exception occured Interator" + e + ">");
}
throw new ConnectorException("ERRO AO LER AO UTILIZAR O INTERATE");
}
return new PagingIterator(it);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@SuppressWarnings(\"unchecked\")\n private static <T> Stream<T> all(Class<T> type, Iterator<Object> i) {\n requireNonNull(type);\n requireNonNull(i);\n \n return all(i).filter(o -> type.isAssignableFrom(o.getClass()))\n .map(o -> (T) o);\n }",
"@Nonnull\n @jakarta.annotation.Nonnull\n CloseableIterator<Obj> scanAllObjects(\n @Nonnull @jakarta.annotation.Nonnull Set<ObjType> returnedObjTypes);",
"public abstract AbstractObjectIterator<LocalAbstractObject> getAllObjects();",
"<E extends CtElement> List<E> getElements(Filter<E> filter);",
"static List getObjectsOfCandidateType(final ExecutionContext ec, final HBaseManagedConnection mconn,\r\n Class candidateClass, boolean subclasses, boolean ignoreCache, FetchPlan fetchPlan, Filter filter, StoreManager storeMgr)\r\n {\r\n List<AbstractClassMetaData> cmds = MetaDataUtils.getMetaDataForCandidates(candidateClass, subclasses, ec);\r\n if (NucleusLogger.DATASTORE_NATIVE.isDebugEnabled())\r\n {\r\n NucleusLogger.DATASTORE_NATIVE.debug(\"Retrieving objects for candidate=\" + candidateClass.getName() +\r\n (subclasses ? \" and subclasses\" : \"\") + (filter != null ? (\" with filter=\" + filter) : \"\"));\r\n }\r\n\r\n List results = new ArrayList();\r\n for (AbstractClassMetaData cmd : cmds)\r\n {\r\n if (cmd instanceof ClassMetaData && ((ClassMetaData)cmd).isAbstract())\r\n {\r\n // Omit any classes that are not instantiable (e.g abstract)\r\n }\r\n else\r\n {\r\n results.addAll(getObjectsOfType(ec, mconn, cmd, ignoreCache, fetchPlan, filter, storeMgr));\r\n }\r\n }\r\n\r\n return results;\r\n }",
"static private List getObjectsOfType(final ExecutionContext ec, final HBaseManagedConnection mconn,\r\n final AbstractClassMetaData cmd, boolean ignoreCache, FetchPlan fp, final Filter filter, final StoreManager storeMgr)\r\n {\r\n List results = new ArrayList();\r\n\r\n StoreData sd = storeMgr.getStoreDataForClass(cmd.getFullClassName());\r\n if (sd == null)\r\n {\r\n storeMgr.manageClasses(ec.getClassLoaderResolver(), cmd.getFullClassName());\r\n sd = storeMgr.getStoreDataForClass(cmd.getFullClassName());\r\n }\r\n final Table table = sd.getTable();\r\n final String tableName = table.getName();\r\n final int[] fpMembers = fp.getFetchPlanForClass(cmd).getMemberNumbers();\r\n try\r\n {\r\n final ClassLoaderResolver clr = ec.getClassLoaderResolver();\r\n\r\n Scan scan = new Scan();\r\n if (filter != null)\r\n {\r\n scan.setFilter(filter);\r\n }\r\n\r\n // Retrieve all fetch-plan fields\r\n for (int i=0; i<fpMembers.length; i++)\r\n {\r\n AbstractMemberMetaData mmd = cmd.getMetaDataForManagedMemberAtAbsolutePosition(fpMembers[i]);\r\n RelationType relationType = mmd.getRelationType(clr);\r\n if (relationType != RelationType.NONE && MetaDataUtils.getInstance().isMemberEmbedded(ec.getMetaDataManager(), clr, mmd, relationType, null))\r\n {\r\n if (RelationType.isRelationSingleValued(relationType))\r\n {\r\n // 1-1 embedded\r\n List<AbstractMemberMetaData> embMmds = new ArrayList<AbstractMemberMetaData>();\r\n embMmds.add(mmd);\r\n addColumnsToScanForEmbeddedMember(scan, embMmds, table, ec);\r\n }\r\n }\r\n else\r\n {\r\n MemberColumnMapping mapping = table.getMemberColumnMappingForMember(mmd);\r\n int numCols = mapping.getNumberOfColumns();\r\n for (int colNo=0;colNo<numCols;colNo++)\r\n {\r\n Column col = mapping.getColumn(colNo);\r\n byte[] familyName = HBaseUtils.getFamilyNameForColumn(col).getBytes();\r\n byte[] qualifName = HBaseUtils.getQualifierNameForColumn(col).getBytes();\r\n scan.addColumn(familyName, qualifName);\r\n }\r\n }\r\n }\r\n\r\n VersionMetaData vermd = cmd.getVersionMetaDataForClass();\r\n if (cmd.isVersioned() && vermd.getMemberName() == null)\r\n {\r\n // Add version column\r\n byte[] familyName = HBaseUtils.getFamilyNameForColumn(table.getSurrogateColumn(SurrogateColumnType.VERSION)).getBytes();\r\n byte[] qualifName = HBaseUtils.getQualifierNameForColumn(table.getSurrogateColumn(SurrogateColumnType.VERSION)).getBytes();\r\n scan.addColumn(familyName, qualifName);\r\n }\r\n if (cmd.hasDiscriminatorStrategy())\r\n {\r\n // Add discriminator column\r\n byte[] familyName = HBaseUtils.getFamilyNameForColumn(table.getSurrogateColumn(SurrogateColumnType.DISCRIMINATOR)).getBytes();\r\n byte[] qualifName = HBaseUtils.getQualifierNameForColumn(table.getSurrogateColumn(SurrogateColumnType.DISCRIMINATOR)).getBytes();\r\n scan.addColumn(familyName, qualifName);\r\n }\r\n if (cmd.getIdentityType() == IdentityType.DATASTORE)\r\n {\r\n // Add datastore identity column\r\n byte[] familyName = HBaseUtils.getFamilyNameForColumn(table.getSurrogateColumn(SurrogateColumnType.DATASTORE_ID)).getBytes();\r\n byte[] qualifName = HBaseUtils.getQualifierNameForColumn(table.getSurrogateColumn(SurrogateColumnType.DATASTORE_ID)).getBytes();\r\n scan.addColumn(familyName, qualifName);\r\n }\r\n\r\n org.apache.hadoop.hbase.client.Table htable = mconn.getHTable(tableName);\r\n ResultScanner scanner = htable.getScanner(scan);\r\n if (ec.getStatistics() != null)\r\n {\r\n // Add to statistics\r\n ec.getStatistics().incrementNumReads();\r\n }\r\n Iterator<Result> it = scanner.iterator();\r\n\r\n // Instantiate the objects\r\n if (cmd.getIdentityType() == IdentityType.APPLICATION)\r\n {\r\n while (it.hasNext())\r\n {\r\n final Result result = it.next();\r\n Object obj = getObjectUsingApplicationIdForResult(result, cmd, ec, ignoreCache, fpMembers, tableName, storeMgr, table);\r\n if (obj != null)\r\n {\r\n results.add(obj);\r\n }\r\n }\r\n }\r\n else if (cmd.getIdentityType() == IdentityType.DATASTORE)\r\n {\r\n while (it.hasNext())\r\n {\r\n final Result result = it.next();\r\n Object obj = getObjectUsingDatastoreIdForResult(result, cmd, ec, ignoreCache, fpMembers, tableName, storeMgr, table);\r\n if (obj != null)\r\n {\r\n results.add(obj);\r\n }\r\n }\r\n }\r\n else\r\n {\r\n while (it.hasNext())\r\n {\r\n final Result result = it.next();\r\n Object obj = getObjectUsingNondurableIdForResult(result, cmd, ec, ignoreCache, fpMembers, tableName, storeMgr, table);\r\n if (obj != null)\r\n {\r\n results.add(obj);\r\n }\r\n }\r\n }\r\n }\r\n catch (IOException e)\r\n {\r\n throw new NucleusDataStoreException(e.getMessage(), e.getCause());\r\n }\r\n return results;\r\n }",
"PropertiedObjectFilter<O> getFilter();",
"public synchronized <T extends EnvironmentalObject> Iterable<T> getEnvironmentalObjects(int x, int y, Class<T> type) {\n\t\treturn new FilteringIterable<>(type, this.grid.getObjects(x, y));\n\t}",
"public interface ObjectFilter<In, Out> {\n\n\t/**\n\t * Return an object of <code>Out</code> type initialized with the specified <code>In</code> object. \n\t * This object is displayed or is given to the next ObjectFilter of the chain. \n\t * @param value the specified object\n\t * @return an object of <code>Out</code> type or <code>null</code> (in this case, the filter chains ends) \n\t */\n public abstract Out apply(In value);\n \n}",
"public IterableIterator<T> queryByExample(T obj);",
"public abstract Filter<T> filter();",
"private <T> List<T> filterList(Iterable<?> iterable, Class<T> clazz) {\n List<T> result = new ArrayList<>();\n for (Object object : iterable) {\n if (clazz.isInstance(object)) {\n @SuppressWarnings(\"unchecked\")\n // Checked using clazz.isInstance\n T tObject = (T) object;\n result.add(tObject);\n }\n }\n return result;\n }",
"List<Receta> getAll(String filter);",
"public Iterator<Activity> getActivitiesIterator(Filter<Activity> filter){\n\t\treturn activities.iterator(filter);\n\t}",
"Collection<T> doFilter(RepositoryFilterContext context);",
"<T> IList<T> getObjects(Class<T> type);",
"public List<PedidoIndividual> filtrar(PedidoIndividual filtro);",
"public RTTIClass select(ClassFilter filter);",
"ObjectDeclaration objects( Predicate<? super ObjectAssembly> specification );",
"boolean accept(T filteredObject);",
"Iterable<T> findAll();",
"public static final Iterator iter (Object ... objects) {\r\n return new ObjectIterator(objects);\r\n }",
"public List<T> search(Filter filter) throws DAOException {\n Helper.checkNull(filter, \"filter\");\n EqualToFilter equalToFilter = new EqualToFilter(\"deleted\", new Boolean(\n false));\n AndFilter resultedFilter = new AndFilter(filter, equalToFilter);\n return searchByFilterUtility.search(resultedFilter);\n }",
"public Iterable<Object> getObjects(String key);",
"@Override\n\tpublic List<T> getLimitedFilteredResult(Bson filter, int limit) {\n\t\tGson gson = new GsonBuilder().create();\n\t\tList<T> innerList = new ArrayList<>();\n\t\tcollection.find(filter).limit(limit).forEach((Block<Document>) document -> {\n\t\t\tinnerList.add(gson.fromJson(document.toJson(), entityClass));\n\t\t});\n\t\treturn innerList;\n\n\t}",
"<T> ObjectIterator<T> execute(Class<T> clazz);",
"@objid (\"17c23aa1-9083-11e1-81e9-001ec947ccaf\")\n Collection<? extends MObject> findByClass(MClass cls, IMObjectFilter filter);",
"@Override\n\tpublic List<T> findAll(Class<T> obj) {\n\t\tSession session=this.sessionFactory.getCurrentSession();\n\t\tCriteria crit=session.createCriteria(obj);\n\t\treturn crit.list();\n\t}",
"@Test\r\n void filterMethod() {\r\n\t\tStream<TransactionBean> transactionBeanStream = transactions.stream().filter(t -> t.getType() == Transaction.GROCERY);\r\n\t\tList<TransactionBean> afterStreamList = transactionBeanStream.peek(System.out::println).collect(Collectors.toCollection(ArrayList::new));\r\n\t\tassertSame(\"wrong type\", Transaction.GROCERY, afterStreamList.get(0).getType());\r\n\t\tassertSame(\"wrong type\", Transaction.GROCERY, afterStreamList.get(1).getType());\r\n }",
"public Iterator<Type> iterator();",
"public Iterator<ODocument> getAllAsList(@Generic(\"T\") final Class<?> type) {\n return getAll(type);\n }",
"final <E, T extends Collection<E>> T filter(\n Class<?>[] arr, Class<?> from, T c, int type, T prototype\n ) {\n T ret = null;\n\n\n// optimistic strategy expecting we will not need to filter\nTWICE: \n for (;;) {\n Iterator<E> it = c.iterator();\nBIG: \n while (it.hasNext()) {\n E res = it.next();\n\n if (!isObjectAccessible(arr, from, res, type)) {\n if (ret == null) {\n // we need to restart the scanning again \n // as there is an active filter\n ret = prototype;\n continue TWICE;\n }\n\n continue BIG;\n }\n\n if (ret != null) {\n // if we are running the second round from TWICE\n ret.add(res);\n }\n }\n\n // ok, processed\n break TWICE;\n }\n\n return (ret != null) ? ret : c;\n }",
"default Set<StackKey> findAll(Predicate<ItemStack> filter) {\n Set<StackKey> items = new HashSet<>();\n for (IInventoryAdapter inventoryObject : this) {\n for (IInvSlot slot : InventoryIterator.get(inventoryObject)) {\n ItemStack stack = slot.getStack();\n if (!InvTools.isEmpty(stack) && filter.test(stack)) {\n stack = stack.copy();\n InvTools.setSize(stack, 1);\n items.add(StackKey.make(stack));\n }\n }\n }\n return items;\n }",
"public List<HQ> buscaPorFiltro(TipoFiltro tipoFiltro, String filtro){\n\t\tif(tipoFiltro.equals(TipoFiltro.TITULO)) {\n\t\t\tlogger.info(\"Buscando por filtro de titulo :\"+filtro);\n\t\t\treturn itemRepository.filtraPorTitulo(UserServiceImpl.authenticated().getId(), filtro);\n\t\t}\n\t\t\n\t\telse if (tipoFiltro.equals(TipoFiltro.UNIVERSO)) {\n\t\t\tlogger.info(\"Buscando por filtro de universo: \"+filtro);\n\t\t\treturn itemRepository.filtraPorUniverso(UserServiceImpl.authenticated().getId(), filtro);\n\t\t}\n\t\t\n\t\telse if (tipoFiltro.equals(TipoFiltro.EDITORA)) {\n\t\t\tlogger.info(\"Buscando por filtro de editora: \"+filtro);\n\t\t\treturn itemRepository.filtraPorEditora(UserServiceImpl.authenticated().getId(), filtro);\n\t\t}\n\t\t\n\t\treturn itemRepository.findAll(UserServiceImpl.authenticated().getId());\n\t}",
"public JodeList search(Predicate<Jode> filter) {\n List<Node> ret = new ArrayList<>();\n if (filter.test(this)) {\n ret.add(this.extend());\n }\n for (Jode j : this.children()) {\n JodeList subResult = j.search(filter);\n for (Jode subJ : subResult) {\n ret.add(subJ.extend());\n }\n }\n return new JodeList(ret);\n }",
"void setFilter(final PropertiedObjectFilter<O> filter);",
"@objid (\"2c133f02-d778-4c15-874c-c08e507222c0\")\n <T extends Event> List<T> getEOccurence(java.lang.Class<T> filterClass);",
"public List<StudentRecord> filter(IFilter filter) {\n\t\tList<StudentRecord> temporaryList = new ArrayList<>();\n\n\t\tfor (StudentRecord studentRecord : studentRecords) {\n\t\t\tif (filter.accepts(studentRecord)) {\n\t\t\t\ttemporaryList.add(studentRecord);\n\t\t\t}\n\t\t}\n\t\treturn temporaryList;\n\t}",
"@Override\r\n public Page<T> filter(U filter)\r\n {\r\n Class<T> T = returnedClass();\r\n CriteriaBuilder cb = getEm().getCriteriaBuilder();\r\n CriteriaQuery<T> criteriaQuery = cb.createQuery(T);\r\n CriteriaQuery<Long> criteriaQueryCount = cb.createQuery(Long.class);\r\n Root<T> entity = criteriaQuery.from(T);\r\n criteriaQueryCount.select(cb.count(entity));\r\n criteriaQuery.select(entity);\r\n \r\n // collect all filters relevant for affected entity\r\n List<Object> filters = new ArrayList<Object>();\r\n getPreFilters(filters, T, filter);\r\n \r\n filters.add(filter);\r\n List<Hint> hints = new ArrayList<Hint>();\r\n \r\n if (!filters.isEmpty()) {\r\n List<Predicate> filterPredicates = new ArrayList<Predicate>();\r\n for (Object queryCriteria : filters) {\r\n \r\n List<Predicate> orPredicates = new ArrayList<Predicate>();\r\n List<Predicate> andPredicates = new ArrayList<Predicate>();\r\n FilterContextImpl<T> filterContext = new FilterContextImpl<T>(entity, criteriaQuery, getEm(), queryCriteria);\r\n hints.addAll(filterContext.getHints());\r\n \r\n List<Field> fields = AbstractFilteringRepository.getInheritedPrivateFields(queryCriteria.getClass());\r\n for (Field field : fields) {\r\n // I want to skip static fields and fields which are cared of in different(specific way)\r\n if (!Modifier.isStatic(field.getModifiers()) && !ignoredFields.contains(field.getName())) {\r\n if (!field.isAccessible()) {\r\n field.setAccessible(true);\r\n }\r\n \r\n /**\r\n * Determine field path\r\n */\r\n // anottaion specified path has always highest priority, so is processed in the first place processing\r\n FieldPath fieldPathAnnotation = field.getAnnotation(FieldPath.class);\r\n Field f;\r\n if (fieldPathAnnotation != null && StringUtils.isNotBlank(fieldPathAnnotation.value())) {\r\n f = FieldUtils.getField(T, StringUtils.substringBefore(fieldPathAnnotation.value(), FieldPath.FIELD_PATH_SEPARATOR), true);\r\n } else {\r\n f = FieldUtils.getField(T, StringUtils.substringBefore(field.getName(), StructuredPathFactory.FILTER_PATH_SEPARATOR), true);\r\n }\r\n \r\n // tries to find CustmoProcessor annotation or some annotation metaannotated by custom processor\r\n CustomProcessor processor = field.getAnnotation(CustomProcessor.class);\r\n if (processor == null) {\r\n processor = getMetaAnnotation(CustomProcessor.class, field);\r\n }\r\n \r\n ProcessorContext<T> processorContext = filterContext.getProcessorContext(andPredicates, orPredicates, field);\r\n Object filterFieldValue = getFilterFieldValue(field, queryCriteria);\r\n if (processor == null && f != null) {\r\n processTypes(filterFieldValue, processorContext);\r\n // If field is not pressent in Entity, it needs special care\r\n } else {\r\n Class<CustomFieldProcessor<T, ?>> processorClass = null;\r\n if (processor != null) {\r\n processorClass = (Class<CustomFieldProcessor<T, ?>>) processor.value();\r\n processCustomFields(filterFieldValue, processorContext, processorClass);\r\n } else {\r\n if (!processCustomTypes(filterFieldValue, processorContext)) {\r\n if (shouldCheck(processorContext.getField())) {\r\n LOG.info(\"Field \\'\" + processorContext.getField().getName() + \"\\' from \"\r\n + processorContext.getField().getDeclaringClass().getSimpleName()\r\n + \" wasn't handled. \");\r\n throw new UnsupportedOperationException(\"Custom filter fields not supported in \"\r\n + processorContext.getField().getDeclaringClass().getSimpleName()\r\n + \", required field: \" + processorContext.getField().getName());\r\n } else {\r\n LOG.info(\"Field \\'\" + processorContext.getField().getName() + \"\\' from \"\r\n + processorContext.getField().getDeclaringClass().getSimpleName()\r\n + \" marked with @Unchecked annotation wasn't handled. \");\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (!andPredicates.isEmpty() || !orPredicates.isEmpty()) {\r\n Predicate filterPredicate = null;\r\n if (!andPredicates.isEmpty()) {\r\n Predicate andPredicate = cb.and(andPredicates.toArray(new Predicate[1]));\r\n filterPredicate = andPredicate;\r\n }\r\n if (!orPredicates.isEmpty()) {\r\n Predicate orPredicate = cb.or(orPredicates.toArray(new Predicate[1]));\r\n if (filterPredicate != null) {\r\n filterPredicate = cb.and(filterPredicate, orPredicate);\r\n } else {\r\n filterPredicate = orPredicate;\r\n }\r\n }\r\n filterPredicates.add(filterPredicate);\r\n }\r\n }\r\n if (!filterPredicates.isEmpty()) {\r\n Predicate finalPredicate = cb.and(filterPredicates.toArray(new Predicate[1]));\r\n criteriaQuery.where(finalPredicate);\r\n criteriaQueryCount.where(finalPredicate);\r\n }\r\n }\r\n \r\n \r\n TypedQuery<T> query = getEm().createQuery(criteriaQuery);\r\n TypedQuery<Long> queryCount = getEm().createQuery(criteriaQueryCount);\r\n if (filter != null && filter.getPageSize() > 0) {\r\n query = query.setFirstResult(filter.getOffset());\r\n query = query.setMaxResults(filter.getPageSize());\r\n }\r\n // add hints\r\n if (!hints.isEmpty()) {\r\n for (Hint hint : hints) {\r\n query.setHint(hint.getName(), hint.getValue());\r\n queryCount.setHint(hint.getName(), hint.getValue());\r\n }\r\n }\r\n \r\n \r\n PageImpl<T> result = new PageImpl<T>(query.getResultList(), filter, queryCount.getSingleResult().intValue());\r\n return result;\r\n }",
"public void retractAll(ObjectFilter filter) {\n LOGGER.info(\"Retracting all facts matching filter...\");\n for (FactHandle handle : getFactHandles(filter)) {\n retract(handle);\n }\n }",
"@Override\n public Iterator<NFetchMode> iterator() {\n return Arrays.asList(all).iterator();\n }",
"private static List<Car> getCarsByCriteria(Iterable<Car> iter, CarCriteria criteria) {\n List<Car> returnCars = new ArrayList<>();\n\n for (Car c : iter) {\n\n //Passing the criteria based on the users input\n if (criteria.test(c)) {\n returnCars.add(c);\n }\n }\n return returnCars;\n }",
"Set<Customer> getCustomers(final CustomerQueryFilter filter);",
"public List<T> findAll() {\n\n\t\tConnection dbConnection = ConnectionFactory.getConnection();\n\t\tPreparedStatement findStatement = null;\n\t\tResultSet rs = null;\n\t\tString findStatementString = \"SELECT * FROM \" + type.getSimpleName();\n\n\t\ttry {\n\t\t\tfindStatement = dbConnection.prepareStatement(findStatementString);\n\t\t\trs = findStatement.executeQuery();\n\t\t\treturn createObjects(rs);\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.log(Level.WARNING, type.getName() + \"DAO:findAll\" + e.getMessage());\n\t\t} finally {\n\t\t\tConnectionFactory.close(rs);\n\t\t\tConnectionFactory.close(findStatement);\n\t\t\tConnectionFactory.close(dbConnection);\n\t\t}\n\t\treturn null;\n\t}",
"private static Stream<?> all(Iterator<Object> i) {\n requireNonNull(i);\n final Iterable<Object> it = () -> i;\n return StreamSupport.stream(it.spliterator(), false);\n }",
"@Override\n public AbstractObjectIterator<LocalAbstractObject> provideObjects() {\n return getAllObjects();\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic static List<Filter> getFilters(AgentContext ctx) {\n\t\tString filtrs = ConfigurationManager.getProperty(Agent.getPropertyName(AGENT_GROUP_NAME, \"list\"));\n\t\tif (filtrs == null) \n {\n filtrs = DEFAULT_FILTERS;\n log.info(LogManager.getHeader(null, \"Filters is null!!!\", null));\n }\n else\n log.info(LogManager.getHeader(null, \"Filters is NOT null!!!\", null));\n\t\tList<String> filters = Arrays.asList(filtrs.split(\",\"));\n\t\tList<Filter> list = new ArrayList<Filter>();\n\t\tfor (String string : filters) {\n\t\t\ttry {\n\t\t\t log.info(LogManager.getHeader(null,\"Get Filters #\",string));\n Class cls = Class.forName(string.trim());\n\t\t\t\tObject obj = cls.newInstance();\n\t\t\t\tif (obj instanceof Filter) {\n\t\t\t\t\tFilter m = (Filter) obj;\n\t\t\t\t\tm.setContext(ctx);\n\t\t\t\t\tlist.add(m);\n\t\t\t\t}\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\tlog.info(LogManager.getHeader(null, \"oaidriver_error\",\n \"Class \"+string.trim()+\" not found\"),e);\n\t\t\t} catch (InstantiationException e) {\n\t\t\t\tlog.info(LogManager.getHeader(null, \"oaidriver_error\",\n\t\t\t\t\t\t\"Impossible to create instance of \"+string.trim()),e);\n\t\t\t} catch (IllegalAccessException e) {\n\t\t\t\tlog.info(LogManager.getHeader(null, \"oaidriver_error\",\n\t\t\t\t\t\t\"Class \"+string.trim()+\" doesn't have empty constructor\"),e);\n\t\t\t}\n\t\t}\n\t\treturn list;\n }",
"public List<Filme> getAll(String filtro) throws SQLException {\r\n\t\tString sql = \"SELECT F.*, G.Descricao as genero FROM filme F\"\r\n\t\t\t\t+ \" JOIN genero G on f.idGenero = g.idGenero \";\r\n\r\n\t\tif (filtro != null)\r\n\t\t\tsql += \"WHERE nome LIKE '%\" + filtro + \"%'\";\r\n\t\tsql += \" ORDER BY F.idFilme \";\r\n\r\n\t\tPreparedStatement stmt = Conexao.getConexao().prepareStatement(sql);\r\n\t\tResultSet rs = stmt.executeQuery();\r\n\r\n\t\tList<Filme> result = new ArrayList<Filme>();\r\n\r\n\t\twhile (rs.next()) {\r\n\t\t\tFilme dados = criaFilme(rs);\r\n\t\t\tresult.add(dados);\r\n\t\t}\r\n\t\trs.close();\r\n\t\tstmt.close();\r\n\t\treturn result;\r\n\t}",
"public static BookFilter getAll()\n {\n return new AllBookFilter();\n }",
"public interface Filter<T> {\n boolean filter(T item);\n}",
"public interface QueryFilter {\n\t\tpublic void apply(Query<? extends PersistentObject> qbe);\n\t}",
"@SuppressWarnings(\"unchecked\")\n\t// caused by instanceof simulation\n\tprivate <T extends EObject> List<T> allSubobjectsOfKind(EObject rootObject,\n\t\t\tClass<T> type) {\n\t\tList<T> result = new LinkedList<T>();\n\t\tTreeIterator<EObject> iterator = rootObject.eAllContents();\n\t\twhile (iterator.hasNext()) {\n\t\t\tEObject eObj = iterator.next();\n\t\t\tif (eObj.getClass() == type) { // simulates instanceof\n\t\t\t\tresult.add((T) eObj);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"public UserType[] searchUserTypes(Filter filter) throws DataAccessException {\n return userTypeDao.searchUserTypes(filter);\n }",
"Results processFilter(FilterSpecifier filter) throws SearchServiceException;",
"List<?> query(Object inputObject, Settings settings);",
"public static <T> Iterable<T> filter(Iterable<T> baseIterable, FilterFunction<T> filter) {\n return new FilterIterable<T>(baseIterable, filter);\n }",
"public Iterator<Filter> getFilters() {\n final Filter filter = privateConfig.loggerConfig.getFilter();\n if (filter == null) {\n return Collections.emptyIterator();\n } else if (filter instanceof CompositeFilter) {\n return ((CompositeFilter) filter).iterator();\n } else {\n final List<Filter> filters = new ArrayList<>();\n filters.add(filter);\n return filters.iterator();\n }\n }",
"public void getAllAttributeTypes(List<IAttributeType<?>> all, ItemFilter<IAttributeType<?>> filter);",
"private List<Thing> filter(List<Thing> source, List<WeatherType> weatherTypes, List<Gender> genders) {\n List<Thing> filtered = new ArrayList<>();\n for (Thing thing : source) {\n if (hasAnyWeatherType(thing, weatherTypes) && belongsTo(thing, genders)) {\n filtered.add(thing);\n }\n }\n return filtered;\n }",
"public interface ImportFilter<T> {\r\n\r\n public boolean doFilter(T object);\r\n\r\n}",
"@Override\n public List runFilter(String filter) {\n return runFilter(\"\", filter);\n }",
"@ServiceMethod(returns = ReturnType.COLLECTION)\n public PagedIterable<Device> getAllDevices(String filter) {\n return this.serviceClient.getAllDevices(filter);\n }",
"private List<String> getObjectsByType(String typeName) throws SQLException {\n return jdbcTemplate.queryForStringList(\"SELECT OBJECT_NAME FROM ALL_OBJECTS WHERE OWNER = ? AND OBJECT_TYPE = ?\",\n name, typeName);\n }",
"public Iterator<T> iterator(T instance, M matchCondition);",
"public List<Cuenta> buscarCuentasList(Map filtro);",
"public abstract void filter();",
"public interface CollectionFilter<T> {\n Collection<Product> filter(Collection<T> toFilter);\n}",
"@Override\n public <T> Iterator<Entry<T>> typedIterator(Class<T> clazz) {\n List<Entry<T>> entries = new ArrayList();\n for (Iterator<Entry> it = this.iterator(); it.hasNext(); ) {\n final Entry e = it.next();\n if (e.getKey().valueType.equals(clazz)) {\n entries.add(e);\n }\n }\n return entries.iterator();\n }",
"protected Collection getObjectsOfType(Collection allTypes, Collection curTypes) {\n Collection objectsOfType = new ArrayList();\n Iterator itA = allTypes.iterator();\n while (itA.hasNext()) {\n Object objAT = itA.next();\n if (objAT == null)\n continue;\n Iterator itB = curTypes.iterator();\n while (itB.hasNext()) {\n Object objCT = itB.next();\n if (objAT.equals(objCT))\n objectsOfType.add(objCT);\n } // while itB\n } // while itA\n return objectsOfType; \n }",
"public static ArticleFilter all() {\n return new ArticleFilter() {\n @Override public boolean testArticle(PubmedArticle article) {\n return true;\n };\n };\n }",
"default Stream<T> filter(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Boolean> predicate) {\n\n return filter(null, predicate);\n }",
"@objid (\"41478043-fa77-40f4-a16f-953b85cd578a\")\n <T extends BpmnDataAssociation> List<T> getSourceOfDataAssociation(java.lang.Class<T> filterClass);",
"public static Iterator iterator(Object o) {\r\n checkSmartContainer(o);\r\n SmartContainer sc = (SmartContainer) o;\r\n return new SmartIterator(sc.getIterator(), VersionableFilters.ALL);\r\n }",
"public Collection<FactHandle> getFactHandles(ObjectFilter filter) {\n return mKsession.getFactHandles(filter);\n }",
"List<ObjectInformation> filter(\n\t\t\tfinal GetObjectInformationParameters params)\n\t\t\tthrows WorkspaceCommunicationException {\n\t\tfinal int querysize = params.getLimit() < 100 ? 100 :\n\t\t\t\tparams.getLimit();\n\t\tfinal PermissionSet pset = params.getPermissionSet();\n\t\tif (pset.isEmpty()) {\n\t\t\treturn new LinkedList<ObjectInformation>();\n\t\t}\n\t\tfinal DBObject verq = buildQuery(params);\n\t\tfinal DBObject projection = buildProjection(params);\n\t\tfinal DBObject sort = buildSortSpec(params);\n\t\tfinal DBCursor cur = buildCursor(verq, projection, sort);\n\t\t\n\t\t//querying on versions directly so no need to worry about race \n\t\t//condition where the workspace object was saved but no versions\n\t\t//were saved yet\n\t\t\n\t\tfinal List<ObjectInformation> ret = new LinkedList<>();\n\t\twhile (cur.hasNext() && ret.size() < params.getLimit()) {\n\t\t\tfinal List<Map<String, Object>> verobjs = new ArrayList<>();\n\t\t\twhile (cur.hasNext() && verobjs.size() < querysize) {\n\t\t\t\ttry {\n\t\t\t\t\tverobjs.add(QueryMethods.dbObjectToMap(cur.next()));\n\t\t\t\t} catch (MongoException me) {\n\t\t\t\t\tthrow new WorkspaceCommunicationException(\n\t\t\t\t\t\t\t\"There was a problem communicating with the database\", me);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinal Map<Map<String, Object>, ObjectInformation> objs =\n\t\t\t\t\tgenerateObjectInfo(pset, verobjs, params.isShowHidden(),\n\t\t\t\t\t\t\tparams.isShowDeleted(), params.isShowOnlyDeleted(),\n\t\t\t\t\t\t\tparams.isShowAllVersions(), params.asAdmin()\n\t\t\t\t\t\t\t);\n\t\t\t//maintain the ordering \n\t\t\tfinal Iterator<Map<String, Object>> veriter = verobjs.iterator();\n\t\t\twhile (veriter.hasNext() && ret.size() < params.getLimit()) {\n\t\t\t\tfinal Map<String, Object> v = veriter.next();\n\t\t\t\tif (objs.containsKey(v)) {\n\t\t\t\t\tret.add(objs.get(v));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}",
"public List<? extends BaseClassInfo> getClasses(HasMetricsFilter filter) {\n if (classLookup == null) {\n buildClassLookupMap();\n }\n List<BaseClassInfo> result = newArrayList();\n for (BaseClassInfo classInfo : classLookup.values()) {\n if (filter.accept(classInfo)) {\n result.add(classInfo);\n }\n }\n return result;\n }",
"@Test\r\n void multiLevelFilter() {\r\n\t\tStream<TransactionBean> transactionBeanStream = transactions.stream().filter(t -> t.getType() == Transaction.GROCERY).filter(t -> \"r3\".equals(t.getValue()));\r\n\t\tList<TransactionBean> afterStreamList = transactionBeanStream.peek(System.out::println).collect(Collectors.toCollection(ArrayList::new));\r\n\t\tassertSame(\"wrong type\", Transaction.GROCERY, afterStreamList.get(0).getType());\r\n\t\tassertSame(\"wrong value\", \"r3\", afterStreamList.get(0).getValue());\r\n }",
"@Override\r\n\tpublic List<Filtering> selectByAll() {\n\t\treturn filteringMapper.selectByAll();\r\n\t}",
"@ServiceMethod(returns = ReturnType.COLLECTION)\n public PagedIterable<Device> getAllDevices(String filter, Context context) {\n return this.serviceClient.getAllDevices(filter, context);\n }",
"@objid (\"c8f09e68-aa31-4979-af01-1efd506d638e\")\n <T extends DataFlow> List<T> getDOccurence(java.lang.Class<T> filterClass);",
"public abstract Query<T> buildFilter(Query<T> builder, T exampleObj);",
"public Collection findPartnerFunctions(IDataFilter filter)\n throws FindEntityException, SystemException, RemoteException;",
"Collection<T> findAll();",
"ObservableList<Person> getFilteredPersonList();",
"public static Entity[] getFilteredEntities(final ISpecification filter, final SortType sortType) {\n // Get the repository.\n IRepository repository = ServiceProvider.getRepository();\n Map<String, Object> map = null;\n if (filter != null) {\n // If the filter is not null, then use it.\n map = repository.get(filter);\n } else {\n // Otherwise, get all the entities.\n map = repository.getAll();\n }\n Entity[] entities = map.values().toArray(new Entity[0]);\n if (sortType == SortType.NONE) {\n return entities;\n }\n\n // Sort the list of entities.\n int i, j;\n int numEntities = entities.length;\n for (i = 1; i < numEntities; i++) {\n Entity temp = entities[i];\n for (j = i; j > 0; j--) {\n String tempName = temp.getDisplayName();\n String itemName = entities[j - 1].getDisplayName();\n if (tempName.compareTo(itemName) < 0) {\n entities[j] = entities[j - 1];\n } else {\n break;\n }\n }\n entities[j] = temp;\n }\n // Return the filtered results an an entity array.\n return entities;\n }",
"public Iterable<M> iterateAll();",
"public interface FileObjectFilter {\n\n /** constant representing answer "do not traverse the folder" */\n public static final int DO_NOT_TRAVERSE = 0;\n /** constant representing answer "traverse the folder" */\n public static final int TRAVERSE = 1;\n /**\n * constant representing answer "traverse the folder and all its direct\n * and indirect children (both files and subfolders)"\n */\n public static final int TRAVERSE_ALL_SUBFOLDERS = 2;\n\n /**\n * Answers a question whether a given file should be searched.\n * The file must be a plain file (not folder).\n *\n * @return <code>true</code> if the given file should be searched;\n * <code>false</code> if not\n * @exception java.lang.IllegalArgumentException\n * if the passed <code>FileObject</code> is a folder\n */\n public boolean searchFile(FileObject file)\n throws IllegalArgumentException;\n\n /**\n * Answers a questions whether a given folder should be traversed\n * (its contents searched).\n * The passed argument must be a folder.\n *\n * @return one of constants {@link #DO_NOT_TRAVERSE},\n * {@link #TRAVERSE},\n * {@link #TRAVERSE_ALL_SUBFOLDERS};\n * if <code>TRAVERSE_ALL_SUBFOLDERS</code> is returned,\n * this filter will not be applied on the folder's children\n * (both direct and indirect, both files and folders)\n * @exception java.lang.IllegalArgumentException\n * if the passed <code>FileObject</code> is not a folder\n */\n public int traverseFolder(FileObject folder)\n throws IllegalArgumentException;\n\n}",
"public static AxisIterator filteredSingleton(NodeInfo node, NodeTest nodeTest) {\n if (node != null && nodeTest.matches(node)) {\n return SingletonIterator.makeIterator(node);\n } else {\n return EmptyIterator.getInstance();\n }\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic List<Cidadao> filtrados(FiltroServidor filtro) \n\t{\n\t\tCriteria criteria = criarCriteriaParaFiltro(filtro);\n\t\t\n\t\tcriteria.setFirstResult(filtro.getPrimeiroRegistro());\n\t\tcriteria.setMaxResults(filtro.getQuantidadeRegistros());\n\t\t\n\t\tif (filtro.isAscendente() && filtro.getPropriedadeOrdenacao() != null) \n\t\t{\n\t\t\tcriteria.addOrder(Order.asc(filtro.getPropriedadeOrdenacao()));\n\t\t} \n\t\telse if (filtro.getPropriedadeOrdenacao() != null) \n\t\t{\n\t\t\tcriteria.addOrder(Order.desc(filtro.getPropriedadeOrdenacao()));\n\t\t}\n\t\t\n\t\treturn criteria.list();\n\t}",
"@objid (\"a7278f67-4bb6-43b3-b137-cb7f649fd404\")\n <T extends TagType> List<T> getDefinedTagType(java.lang.Class<T> filterClass);",
"public void filter(Filter filter) throws NoTestsRemainException {\n childrenLock.lock();\n try {\n List<T> children = new ArrayList<T>(getFilteredChildren());\n for (Iterator<T> iter = children.iterator(); iter.hasNext(); ) {\n T each = iter.next();\n if (shouldRun(filter, each)) {\n try {\n filter.apply(each);\n } catch (NoTestsRemainException e) {\n iter.remove();\n }\n } else {\n iter.remove();\n }\n }\n filteredChildren = Collections.unmodifiableCollection(children);\n if (filteredChildren.isEmpty()) {\n throw new NoTestsRemainException();\n }\n } finally {\n childrenLock.unlock();\n }\n }",
"public T iterator();",
"@SuppressWarnings(\"unchecked\")\r\n public Iterator<Tuple<T>> iterator() {\n Iterator<Tuple<T>> fi = (Iterator<Tuple<T>>) new FilteredIterator<T>(resultTable.iterator(), filterOn);\r\n return fi;\r\n }",
"List<T> findAll(Class<T> clazz, int first, int count);",
"List<JSONObject> getFilteredItems();",
"public String searchByFilter() {\n if (selectedFilter.size() != 0) {\n for (Genre filterOption : selectedFilter) {\n searchTerm = searchResultTerm;\n searchBook();\n\n System.out.println(\"CURRENT NUMBER OF BOOKS: \" + books.size());\n\n BookCollection temp = this.db.getCollectionByGenre(filterOption);\n System.out.println(\"GETTING COLLECTION FOR FILTERING: \" + temp.getCollectionName() + \" NUM OF BOOKS: \"\n + temp.getCollectionBooks().size());\n filterBookList(temp.getCollectionBooks());\n System.out.println(\"UPDATED NUMBER OF BOOKS: \" + books.size());\n }\n } else {\n searchTerm = searchResultTerm;\n searchBook();\n }\n\n return \"list.xhtml?faces-redirect=true\";\n }",
"List<ObjectMessage> getObjects(long stream, long version, ObjectType... types);",
"public <T> List<T> findAll(Class<T> entityClass);",
"@Override\n\tpublic Page<Movie> findAnyMatching(Optional<String> filter, Pageable pageable) {\n\t\treturn null;\n\t}",
"public Collection<T> filter(Query query) throws DataAccessException;"
] | [
"0.62955546",
"0.6026056",
"0.60093296",
"0.5990234",
"0.5771995",
"0.5735629",
"0.5678512",
"0.5675082",
"0.56223994",
"0.5614519",
"0.5597485",
"0.55415434",
"0.5529784",
"0.54811716",
"0.5441575",
"0.53871983",
"0.5325764",
"0.52535486",
"0.5244191",
"0.5233939",
"0.5203477",
"0.5195794",
"0.51897895",
"0.51685005",
"0.51615936",
"0.5149807",
"0.51380163",
"0.51336503",
"0.5131903",
"0.5105827",
"0.51033586",
"0.51003295",
"0.51002604",
"0.50800526",
"0.50714844",
"0.50694954",
"0.50683874",
"0.5052364",
"0.5043165",
"0.5026033",
"0.50195235",
"0.49930057",
"0.4988621",
"0.49697712",
"0.496872",
"0.4943927",
"0.49387604",
"0.4930716",
"0.49193528",
"0.49170402",
"0.49065226",
"0.49041998",
"0.490244",
"0.48950988",
"0.48943934",
"0.48909828",
"0.488826",
"0.48796",
"0.48746446",
"0.48732594",
"0.4873215",
"0.48699942",
"0.48688278",
"0.48657486",
"0.4861075",
"0.48359066",
"0.48347118",
"0.48343986",
"0.48214093",
"0.47650757",
"0.47590366",
"0.47521812",
"0.4739521",
"0.47348154",
"0.47208184",
"0.4718791",
"0.47121584",
"0.47022656",
"0.4683438",
"0.46812832",
"0.46806687",
"0.4673528",
"0.46642217",
"0.46581724",
"0.4655121",
"0.4642644",
"0.46399197",
"0.4638179",
"0.46325117",
"0.46156624",
"0.46151248",
"0.46088082",
"0.4601822",
"0.4594015",
"0.45936412",
"0.45886412",
"0.45868653",
"0.45835853",
"0.4579703",
"0.45713854"
] | 0.653215 | 0 |
Create an object of the currently configured type on the resource. | @SuppressWarnings({ "rawtypes", "unchecked" })
public Result create(String nativeIdentifier, List<Item> items)
throws ConnectorException, ObjectAlreadyExistsException {
debug();
if (isDebug == true) {
log.debug("===== CREATE ====");
}
Result result = new Result();
try {
String codSistema = "", codUsuario = "", nomUsuario = "", icStatu = "", icType = "", codSenha = "", numPerfil = "", passwordLimpo = "", sistemaPerfis = "";
int operacao = 0;
ArrayList<String> arrayPerfilSistema = new ArrayList<String>();
codUsuario = nativeIdentifier;
IC_STATUS_ACESSO = "0";
if (isDebug == true) {
log.debug("CREATE <codUsuario: " + codUsuario + ">");
}
for (openconnector.Item item : items) {
String name = item.getName();
String value = item.getValue().toString();
if (name.equalsIgnoreCase(noUsuario)) {
nomUsuario = value;
}
if (name.equalsIgnoreCase(coSenhaAcesso)) {
passwordLimpo = value;
encripta(passwordLimpo);
codSenha = passowrdCriptografada;
}
if (name.equalsIgnoreCase(this.icTipo)) {
icType = value;
}
if (name.equalsIgnoreCase(sisPerfil)) {
ArrayList valueList = new ArrayList();
if (item.getValue() instanceof String) {
valueList.add(item.getValue());
} else {
valueList = (ArrayList) item.getValue();
}
if (valueList.size() > 1) {
for (Object sistemaPerfil : valueList) {
String sitemPerf = sistemaPerfil.toString();
String[] array = sitemPerf.split("/");
String sistema = array[0];
for (Object sistemaPerfil2 : valueList) {
String sitemPerf2 = sistemaPerfil2.toString();
String[] array2 = sitemPerf2.split("/");
String sistema2 = array2[0];
if (sistema.equals(sistema2)) {
result = new Result(Result.Status.Failed);
result.add("TIPO APP SIASES Create"
+ "O sistema não permite adicionar mais de um perfil.");
if (isDebug == true) {
log.debug("O sistema não permite adicionar mais de um perfil.");
}
throw new ConnectorException(
"CREATE - O sistema não permite adicionar mais de um perfil");
}
}
arrayPerfilSistema.add(sitemPerf);
}
} else {
sistemaPerfis = valueList.get(0).toString();
arrayPerfilSistema.add(sistemaPerfis);
}
}
}
icStatu = "0";
operacao = 1;
for (String sistemPerfis : arrayPerfilSistema) {
String[] array = sistemPerfis.split("/");
String sistema = array[0];
String perfil = array[1];
try {
dadosPerfil(sistema, perfil);
} catch (ClassNotFoundException e) {
e.printStackTrace();
result = new Result(Result.Status.Failed);
result.add("ERRO SIASE CREATE");
if (isDebug == true) {
log.debug("ERRO CREATE SIASE USER: " + codUsuario);
}
throw new ConnectorException(
"CREATE - ERRO CREATE USUARIO " + e);
} catch (SQLException e) {
e.printStackTrace();
result = new Result(Result.Status.Failed);
if (isDebug == true) {
log.debug("ERRO CREATE SIASE USER: " + codUsuario);
}
throw new ConnectorException(
"CREATE - ERRO CREATE USUARIO " + e);
}
numPerfil = nuPerfil;
codSistema = sistema;
if (isDebug == true) {
log.debug("Create " + "<CodUsuario: " + codUsuario
+ "> <CodSistema: " + codSistema
+ "> <nomUsuario: " + nomUsuario + "> <icStatu: "
+ icStatu + "> <icType: " + icType
+ "> <codSenha: " + codSenha + "> <numPerfil: "
+ numPerfil + "> <operacao> " + operacao + ">");
}
createUser(codSistema, codUsuario, nomUsuario, icStatu, icType,
codSenha, numPerfil, operacao);
result = new Result(Result.Status.Committed);
}
} catch (Exception e) {
result = new Result(Result.Status.Failed);
result.add("TIPO APP SIASES CREATE ");
if (isDebug == true) {
log.debug("Exception occured CREATE ", e);
}
String message = "Exception occured while creating the entity";
result.add(message);
if (isDebug == true) {
log.debug("ERRO CREATE SIASE " + e);
}
throw new ConnectorException("CREATE - ERRO CREATE USUARIO " + e);
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"E create(Resource data);",
"public abstract T create(T obj);",
"Resource create(Session session, IRI identifier, IRI type);",
"public abstract String createNewObject(OwResource resource_p, String strObjectClassName_p, OwPropertyCollection properties_p, OwPermissionCollection permissions_p, OwContentCollection content_p, OwObject parent_p, String strMimeType_p,\r\n String strMimeParameter_p) throws Exception;",
"public abstract <T> T create(Object object, Class<T> clazz);",
"public void create(){}",
"ObjectResource createObjectResource();",
"For createFor();",
"Type createType();",
"Type createType();",
"Type createType();",
"ResourceInstance createResource(String type) {\n Map<Resource.Type, String> mapIds = new HashMap<>();\n mapIds.put(Resource.Type.Cluster, clusterName);\n mapIds.put(Resource.Type.ClusterKerberosDescriptor, type);\n return createResource(Resource.Type.ClusterKerberosDescriptor, mapIds);\n }",
"ObjectTypeDefinition createObjectTypeDefinition();",
"Resource createResource();",
"private ConfigurationObject createObject(String name, String type) throws Exception {\r\n ConfigurationObject object = new DefaultConfigurationObject(name);\r\n object.setPropertyValue(PROPERTY_TYPE, type);\r\n\r\n return object;\r\n }",
"public <T extends RefObject> T createObject(Class<T> type) throws CreationException {\n\t\treturn this.<T>createObject(null, type, new Field[] {});\n\t}",
"public abstract String createNewObject(boolean fPromote_p, Object mode_p, OwResource resource_p, String strObjectClassName_p, OwPropertyCollection properties_p, OwPermissionCollection permissions_p, OwContentCollection content_p,\r\n OwObject parent_p, String strMimeType_p, String strMimeParameter_p) throws Exception;",
"HarvestType createHarvestType();",
"T crear(T obj);",
"OBJECT createOBJECT();",
"@Override\r\n\tpublic void create() {\n\t\t\r\n\t}",
"T create();",
"T create();",
"<U extends T> U create(String name, Class<U> type) throws InvalidUserDataException;",
"private Object createInstance() throws InstantiationException, IllegalAccessException {\n\t\treturn classType.newInstance();\n\t}",
"RentalObject createRentalObject();",
"ConceptType createConceptType();",
"@Override\n\tpublic void create() {\n\n\t}",
"@Override\r\n\tpublic T createInstance() {\r\n\t\ttry {\r\n\t\t\treturn getClassType().newInstance();\r\n\t\t} catch (Exception e) {\r\n\t\t\tLogger.getLogger(AbstractCRUDBean.class.getSimpleName()).log(Level.ALL, e.getMessage());\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"private Object createObject(ObjectFactory objectFactory, String objectKey, Class<?> type)\r\n throws CockpitConfigurationException {\r\n try {\r\n Object obj = objectFactory.createObject(objectKey);\r\n\r\n if (!type.isInstance(obj)) {\r\n throw new CockpitConfigurationException(\"The configured object for key [\" + objectKey\r\n + \"] is not an instance of \" + type.getName());\r\n }\r\n\r\n return obj;\r\n } catch (InvalidClassSpecificationException e) {\r\n throw new CockpitConfigurationException(\r\n \"InvalidClassSpecificationException occurs while creating object with key [\" + objectKey\r\n + \"] using object factory\", e);\r\n }\r\n }",
"public abstract String createNewObject(boolean fPromote_p, Object mode_p, OwResource resource_p, String strObjectClassName_p, OwPropertyCollection properties_p, OwPermissionCollection permissions_p, OwContentCollection content_p,\r\n OwObject parent_p, String strMimeType_p, String strMimeParameter_p, boolean fKeepCheckedOut_p) throws Exception;",
"public void createNewObject(Representation entity) throws ResourceException {\r\n\t\tT entry = createObjectFromHeaders(null, entity);\r\n\t\texecuteUpdate(entity, entry, createUpdateObject(entry));\r\n\r\n\t}",
"public <T extends RefObject> T createObject(String mPackage, Class<T> type) throws CreationException {\n\t\treturn this.<T>createObject(mPackage, type, new Field[] {});\n\t}",
"@Override\n\tpublic void create() {\n\t\t\n\t}",
"public abstract void create(T t);",
"void create(T t);",
"public abstract void create();",
"interface Create {}",
"public void create() {\n\t\t\n\t}",
"T createEntity();",
"protected abstract Object createObjectInternal(ObjectInformation objectInformation) throws FillingException;",
"protected Object createBeanMatchingType(MappingContext mappingContext) {\n // clazz is never null given the only path that leads to this method already performs that check\n final Class<?> clazz = mappingContext.getTypeInformation().getSafeToWriteClass();\n try {\n return clazz.getDeclaredConstructor().newInstance();\n } catch (ReflectiveOperationException e) {\n throw new ConfigMeMapperException(mappingContext, \"Could not create object of type '\"\n + clazz.getName() + \"'. It is required to have a default constructor\", e);\n }\n }",
"ConceptsType createConceptsType();",
"void create(T entity);",
"public Object makeResource();",
"<U extends T> U create(String name, Class<U> type, Action<? super U> configuration) throws InvalidUserDataException;",
"Entity createEntity();",
"@Override\n\tpublic void create () {\n\n\t}",
"InformationResource createInformationResource();",
"ResourceAPI createResourceAPI();",
"RESTElement createRESTElement();",
"@POST( CONTROLLER )\n VersionedObjectKey createObject( @Body CreateObjectRequest request );",
"@Override\r\n\tpublic boolean create(Jeu obj) {\n\t\treturn false;\r\n\t}",
"@Override\r\n\tpublic void create() {\n\r\n\t}",
"public ODocument create(@Generic(\"T\") final Class<?> type) {\n dbProvider.get();\n return new ODocument(type.getSimpleName());\n }",
"Device_Resource createDevice_Resource();",
"Service_Resource createService_Resource();",
"E create(E entity);",
"E create(E entity);",
"WithCreate withKind(String kind);",
"@SuppressWarnings(\"unused\")\n private CreateOrUpdateObjectTypeResult() {\n }",
"public abstract T getCreatedResource();",
"<U extends T> U maybeCreate(String name, Class<U> type) throws InvalidUserDataException;",
"public Object create( DataWrapper data) {\n return LoadManager.getItem(data.getString(\"type\"),data.getName());\n }",
"PhysicalThing createPhysicalThing();",
"private Object createInstanceOfType(Class<?> propertyType)\n\t{\n\t\tObject typeInstance = null;\n\t\tif (propertyType.isArray())\n\t\t{\n\t\t\ttypeInstance = createArray(propertyType);\n\t\t}\n\t\telse if (propertyType.isPrimitive())\n\t\t{\n\t\t\ttypeInstance = primitiveTypeFactory.create(propertyType);\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttypeInstance = knownTypeFactory.create(propertyType);\n\t\t}\n\t\treturn typeInstance;\n\t}",
"public abstract Object create(ElementMapping elementMapping, ReadContext context);",
"protected abstract IModel<T> createModel(T object);",
"Instance createInstance();",
"public boolean create(ModelObject obj);",
"CategoryType createCategoryType();",
"Object create(Object source);",
"public T create(T object) throws SQLException;",
"public void create(T e);",
"Thing createThing();",
"WallType createWallType();",
"protected abstract T newObject(Handle<T> paramHandle);",
"protected Object createObjectFromObjectInformation(ObjectInformation objectInformation) throws FillingException {\n\n AbstractCreatorStrategy strategy = getStrategyManager().getStrategyFor(objectInformation);\n\n return strategy.createObject(objectInformation);\n }",
"TypeDefinition createTypeDefinition();",
"SettingType createSettingType();",
"PropertyType createPropertyType();",
"InstanceModel createInstanceOfInstanceModel();",
"com.exacttarget.wsdl.partnerapi.ObjectDefinition addNewObjectDefinition();",
"void create(E entity);",
"public synchronized Resource createResource(QName str) throws ModelException {\n\n // check whether we have it in the registry\n Resource r = (Resource)rmap.get(str);\n // System.err.println(\"Creating resource: \" + str + \", in rmap=\" + r);\n\n if(r == null) {\n r = new ResourceImpl(/*getUnusedNodeID(),*/ str);\n rmap.put(str, r);\n }\n return r;\n }",
"void create(T instance) throws IOException;",
"On_Device_Resource createOn_Device_Resource();",
"private static JSONObject buildResourceObject(String type, Resource resource) throws JSONException, IllegalArgumentException {\n if (resource == null) {\n throw new IllegalArgumentException(\"Missing Resource\");\n }\n if (type == null) {\n throw new IllegalArgumentException(\"Missing resource type\");\n }\n if (resource.getId() == null) {\n throw new IllegalArgumentException(\"Missing resource id\");\n }\n\n JSONObject jsonResource = new JSONObject();\n jsonResource.put(KEY_ID, resource.getId());\n jsonResource.put(KEY_TYPE, type);\n jsonResource.put(KEY_ATTRIBUTES, new JSONObject());\n return jsonResource;\n }",
"@Override\n public boolean create(Revue objet) {\n return false;\n }",
"Foco createFoco();",
"CsticModel createInstanceOfCsticModel();",
"public ExperimentCatResource create(ResourceType type) throws RegistryException {\n ExperimentCatResource result = null;\n switch (type) {\n case PROJECT:\n org.apache.airavata.registry.core.experiment.catalog.resources.ProjectResource projectResource = new org.apache.airavata.registry.core.experiment.catalog.resources.ProjectResource();\n projectResource.setWorker(this);\n projectResource.setGatewayId(gatewayId);\n result = projectResource;\n break;\n case EXPERIMENT:\n ExperimentResource experimentResource = new ExperimentResource();\n experimentResource.setUserName(user);\n experimentResource.setGatewayExecutionId(gatewayId);\n result = experimentResource;\n break;\n default:\n logger.error(\"Unsupported resource type for worker resource.\", new IllegalArgumentException());\n throw new IllegalArgumentException(\"Unsupported resource type for worker resource.\");\n\n }\n return result;\n }",
"public Device createObject(String brand, String model, Integer price, String photo, String date);",
"private TypeDb createTypeInstance(long id, String nameEn) {\n TypeDb typeDb = new TypeDb();\n typeDb.setId(id);\n typeDb.setTypeNameEn(nameEn);\n typeDb.setTypeNameRu(new TypeMapper().toRu(nameEn));\n return typeDb;\n }",
"WithCreate withSourceType(SourceType sourceType);",
"protected Object createObject( final String objectName, final String type )\n throws AntException\n {\n try\n {\n final Class clazz = Class.forName( objectName );\n return clazz.newInstance();\n }\n catch( final IllegalAccessException iae )\n {\n throw new AntException( \"Non-public constructor for \" + type + \" \" + objectName, \n iae );\n }\n catch( final InstantiationException ie )\n {\n throw new AntException( \"Error instantiating class for \" + type + \" \" + objectName, \n ie );\n }\n catch( final ClassNotFoundException cnfe )\n {\n throw new AntException( \"Could not find the class for \" + type + \" \" + objectName, \n cnfe );\n }\n }",
"DataType createDataType();",
"public Object createObject() {\n return klass.__call__().__tojava__(interfaceType);\n }",
"T create() throws PersistException;",
"protected abstract ENTITY createEntity();",
"Information createInformation();"
] | [
"0.6955582",
"0.6822233",
"0.6722192",
"0.65424424",
"0.6535013",
"0.6523855",
"0.64704096",
"0.64463603",
"0.64012647",
"0.64012647",
"0.64012647",
"0.6391733",
"0.63769794",
"0.6363968",
"0.6352487",
"0.63457525",
"0.6214417",
"0.6182341",
"0.6178419",
"0.6169773",
"0.61687165",
"0.61583054",
"0.61583054",
"0.6136711",
"0.6135098",
"0.6126288",
"0.6116809",
"0.6109397",
"0.6105166",
"0.6090341",
"0.6086278",
"0.60345376",
"0.60294396",
"0.602942",
"0.60124516",
"0.6006368",
"0.59950936",
"0.5991903",
"0.5989564",
"0.59832585",
"0.5972468",
"0.59705573",
"0.59586614",
"0.59496534",
"0.5941278",
"0.5941258",
"0.5935917",
"0.5926405",
"0.5926283",
"0.59184617",
"0.5874462",
"0.5869611",
"0.58677214",
"0.5863461",
"0.5850865",
"0.5848837",
"0.58433473",
"0.584151",
"0.584151",
"0.5834864",
"0.58329475",
"0.58166283",
"0.58052707",
"0.58047664",
"0.5802143",
"0.57998604",
"0.5794898",
"0.5794761",
"0.5793963",
"0.5792142",
"0.57700896",
"0.5757496",
"0.575719",
"0.5754059",
"0.5743423",
"0.5740168",
"0.5721586",
"0.5718156",
"0.5717771",
"0.57171196",
"0.5703019",
"0.5697852",
"0.56944776",
"0.5675537",
"0.56722796",
"0.5670412",
"0.5666187",
"0.5663393",
"0.5652236",
"0.564919",
"0.5644461",
"0.56423116",
"0.5636927",
"0.56265116",
"0.56254154",
"0.56172925",
"0.56147575",
"0.56099534",
"0.56052667",
"0.56039065",
"0.56026477"
] | 0.0 | -1 |
Update the object of the given type using the given item list. | @SuppressWarnings({ "unchecked", "rawtypes" })
public Result update(String nativeIdentifier, List<Item> items)
throws ConnectorException, ObjectNotFoundException {
debug();
if (isDebug == true) {
log.debug("===== UPDATE ====");
}
Result result = new Result();
String codSistema = "", codUsuario = "", nomUsuario = "", icStatu = "", icType = "", codSenha = "", numPerfil = "";
int operacao = 0;
ArrayList<String> arrayPerfilSistema = new ArrayList<String>();
codUsuario = nativeIdentifier;
IC_STATUS_ACESSO = "0";
if (items != null) {
for (Item item : items) {
String name = item.getName();
// String value = item.getValue().toString();
Item.Operation op = item.getOperation();
ArrayList valueList = new ArrayList();
if (item.getValue() instanceof String) {
valueList.add(item.getValue());
} else {
valueList = (ArrayList) item.getValue();
}
if (valueList.size() > 1) {
for (Object sistemaPerfil : valueList) {
String sitemPerf = sistemaPerfil.toString();
String[] array = sitemPerf.split("/");
String sistema = array[0];
for (Object sistemaPerfil2 : valueList) {
String sitemPerf2 = sistemaPerfil2.toString();
String[] array2 = sitemPerf2.split("/");
String sistema2 = array2[0];
if (sistema.equals(sistema2) && op.equals("Add")) {
result = new Result(Result.Status.Failed);
result.add("TIPO APP SIASES UPDATE"
+ "O sistema não permite adicionar mais de um perfil.");
return result;
}
}
}
}
if (isDebug == true) {
log.debug("UPDATE - <Nome Item: " + name
+ ">\n <Valor Item: " + valueList.get(0).toString()
+ ">\n <Operation: " + op + ">");
}
switch (op) {
case Add: {
try {
if (name.equalsIgnoreCase(sisPerfil)) {
for (Object sistemaPerfil : valueList) {
String sistemaPerfis = sistemaPerfil.toString();
arrayPerfilSistema.add(sistemaPerfis);
}
}
dadosUsuario(codUsuario);
} catch (ClassNotFoundException e1) {
e1.printStackTrace();
result = new Result(Result.Status.Failed);
result.add("TIPO APP SIASES UPDATE ADD");
if (isDebug == true) {
log.debug("ERRO UPDATE ADD SIASE USER: "
+ codUsuario);
}
throw new ConnectorException(
"ERRO UPDATE ADD SIASE USER: " + e1);
} catch (SQLException e1) {
e1.printStackTrace();
result = new Result(Result.Status.Failed);
result.add("TIPO APP SIASES UPDATE");
if (isDebug == true) {
log.debug("ERRO UPDATE ADD SIASE USER: "
+ codUsuario);
}
throw new ConnectorException(
"ERRO UPDATE ADD SIASE USER: " + e1);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
if (isDebug == true) {
log.debug("ERRO UPDATE ADD SIASE USER: "
+ codUsuario);
}
throw new ConnectorException(
"ERRO UPDATE ADD SIASE USER: " + e);
}
nomUsuario = noUsuario;
icStatu = icStatus;
icType = icTipo;
codSenha = coSenhaAcesso;
operacao = 1;
for (String sistemaPerfis : arrayPerfilSistema) {
String[] array = sistemaPerfis.split("/");
String sistema = array[0];
String perfil = array[1];
try {
dadosPerfil(sistema, perfil);
} catch (ClassNotFoundException e) {
e.printStackTrace();
result = new Result(Result.Status.Failed);
result.add("TIPO APP SIASES UPDATE" + e);
if (isDebug == true) {
log.debug("ERRO UPDATE ADD SIASE USER: "
+ codUsuario);
}
throw new ConnectorException(
"ERRO UPDATE ADD SIASE USER: " + e);
} catch (SQLException e) {
e.printStackTrace();
result = new Result(Result.Status.Failed);
result.add("TIPO APP SIASES UPDATE" + e);
if (isDebug == true) {
log.debug("ERRO UPDATE ADD SIASE USER: "
+ codUsuario);
}
throw new ConnectorException(
"ERRO UPDATE ADD SIASE USER: " + e);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
if (isDebug == true) {
log.debug("ERRO UPDATE ADD SIASE USER: "
+ codUsuario);
}
throw new ConnectorException(
"ERRO UPDATE ADD SIASE USER: " + e);
}
numPerfil = nuPerfil;
codSistema = sistema;
try {
if (isDebug == true) {
log.debug("UPDADE ADD - <CodUsuario: "
+ codUsuario + "> <CodSistema: "
+ codSistema + "> <nomUsuario: "
+ nomUsuario + "> <icStatu: " + icStatu
+ "> <icType: " + icType
+ "> <codSenha: " + codSenha
+ "> <numPerfil: " + numPerfil
+ "> <operacao: " + operacao + ">");
}
createUser(codSistema, codUsuario, nomUsuario,
icStatu, icType, codSenha, numPerfil,
operacao);
result = new Result(Result.Status.Committed);
} catch (Exception e) {
e.printStackTrace();
result = new Result(Result.Status.Failed);
result.add("TIPO APP SIASES UPDATE" + e);
if (isDebug == true) {
log.debug("ERRO UPDATE ADD SIASE USER: "
+ codUsuario);
}
throw new ConnectorException(
"ERRO UPDATE ADD SIASE USER: " + e);
}
}
}
break;
case Remove: {
if (isDebug == true) {
log.debug("UPDATE - REMOVE");
}
if (name.equalsIgnoreCase(sisPerfil)) {
for (Object sistemaPerfil : valueList) {
String sistemaPerfis = sistemaPerfil.toString();
arrayPerfilSistema.add(sistemaPerfis);
}
try {
for (String sistemaPerfis : arrayPerfilSistema) {
String[] array = sistemaPerfis.split("/");
String sistema = array[0];
codSistema = sistema;
if (isDebug == true) {
log.debug("UPDADE - REMOVER <"
+ "CodUsuario: " + codUsuario
+ "> <CodSistema: " + codSistema
+ ">");
}
desvincularGrupo(codSistema, codUsuario);
result = new Result(Result.Status.Committed);
}
} catch (Exception e) {
e.printStackTrace();
result = new Result(Result.Status.Failed);
result.add("TIPO APP SIASES " + e);
if (isDebug == true) {
log.debug("ERRO UPDATE REMOVE SIASE USER: "
+ codUsuario);
}
throw new ConnectorException(
"ERRO UPDATE REMOVE SIASE USER: " + e);
}
}
}
break;
case Set: {
// existing.put(name, valueList.get(0).toString());
}
break;
default:
throw new IllegalArgumentException("Unknown operation: "
+ op);
}
}
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void update(Type type);",
"Item update(Item item);",
"@Test\r\n public void testUpdate() {\r\n TestingTypeList test = new TestingTypeList();\r\n test.addTestingType(\"TestType\", \"test\");\r\n TestingType testValue = test.getTestingTypeAt(0);\r\n test.update(testValue, testValue);\r\n TestingType notInList = new TestingType(\"NotInList\", \"notinlist\", \"notinlist\");\r\n test.update(notInList, notInList);\r\n assertEquals(1, test.size());\r\n }",
"void update(T objectToUpdate);",
"private void updateItems()\n\t{\t\n\t\tupdatePizzaTypes(items);\n\t\tupdateSidesTypes(items);\n\t\tupdateDrinksTypes(items);\n\t}",
"public void updateList(List<T> ListObject) throws DaoException;",
"@Override\n public void updateItem(P_CK t) {\n \n }",
"void updateList(ShoppingList _ShoppingList);",
"public void updateList(List<?> listOfObjects){\n this.radioObjects = listOfObjects;\n }",
"public void mapListUpdate(List<Map<Integer, String>> list, int item, String methodType, String updateValue)\n\t{\n\t\tfor(int i=0; i<list.size(); i++)\n\t\t{\n\t\t\tif (methodType.equals(\"PREVIOUSADD\")) \tlist.get(i).put(item, updateValue + list.get(i).get(item));\n\t\t\tif (methodType.equals(\"BACKADD\")) \tlist.get(i).put(item, list.get(i).get(item) + updateValue);\n\t\t\tif (methodType.equals(\"FULLCHANGE\")) \tlist.get(i).put(item, updateValue + list.get(i).get(item));\n\t\t}\n\t}",
"public void update(int updateType);",
"public void update(T ob) throws ToDoListException;",
"@Override\r\n\tpublic void updateShoppingList(ShoppingList sl) throws IllegalArgumentException {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tshoppingListMapper.update(sl);\r\n\t}",
"void updateItem(IDAOSession session, Item item);",
"UpdateType updateType();",
"T update(T object);",
"void update(List<E> list, E o, E n) {\n\t\tint index = list.indexOf(o);\n\t\tlist.set(index, n);\n\t}",
"public abstract <T> T update(Object object, Class<T> clazz);",
"@Override\n\tpublic void modifyItem(Object toUpdated) {}",
"public void updateItemInList(Item item, ShoppingList list) {\r\n \t\tif (item == null || item.getId() == null || list == null)\r\n \t\t\tthrow new IllegalArgumentException(\"null is not allowed\");\r\n \r\n \t\tList<Item> items = persistenceManager.getItems(list);\r\n\t\tif (!items.contains(item))\r\n \t\t\treturn;\r\n \t\t\r\n \t\tpersistenceManager.save(item, list);\r\n \t}",
"public void updateItemsList(List<Image> list) {\n\n\t\tthis.itemsList = list;\n\n\t}",
"@Override\n public void itemRPClassUpdate(RPObject entity) {\n }",
"void update(ObjectType object)\n throws GuacamoleException;",
"public abstract void setList(List<T> items);",
"public void update(BoardItemVersion object) {\n\n\t}",
"public void updateItem(Item item) {\n\t\taddItem(item);\n\t}",
"@Override\n\tpublic boolean update(Item obj) {\n\t\ttry{\n\t\t\tString query=\"UPDATE items SET title = ?, start_date = ?, end_date = ?, type = ? WHERE id = ?\";\n\t\t\tPreparedStatement state = conn.prepareStatement(query,ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n\t\t\tstate.setString(1, obj.getTitle());\n\t\t\tstate.setDate(2, obj.getStartDate());\n\t\t\tstate.setDate(3, obj.getEndDate());\n\t\t\tstate.setInt(4, obj.getItemType().getIndex());\n\t\t\tstate.setInt(5, obj.getIndex());\n\t\t\t\n\t\t\t// Run the query\n\t\t\tstate.executeUpdate();\n\n\t\t\tstate.close();\n\t\t\t\n\t\t\t// Notify the Dispatcher on a suitable channel.\n\t\t\tthis.publish(EntityEnum.ITEM.getValue());\n\t\t\t\n\t\t\treturn true;\n\t\t} catch (SQLException e){\n\t\t\tJOptionPane jop = new JOptionPane();\n\t\t\tjop.showMessageDialog(null, e.getMessage(),\"PostgreSQLItemDao.update -- ERROR!\",JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t} catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}",
"@Override\n\tpublic void update(Unidade obj) {\n\n\t}",
"public void updateByObject()\r\n\t{\n\t}",
"void update(Seller obj);",
"void update(Seller obj);",
"public void setItem (Object anObject)\r\n {\r\n // TODO: implement (?)\r\n }",
"public void update(int location, Object o)\n {\n notifyItemChanged(location);\n }",
"private void updateItem(JsonNode json) {\n }",
"public void update(RtnListVO rtnListVO);",
"public void updateItemList(int position) {\n \t\n \tString temp[] = currentTaskItems.get(position);\n \tString[] temp2 = getCurrentItemTypes();\n \t\n \tIntent intent = new Intent(this, CreateItem.class);\n \tintent.putExtra(ITEM, temp);\n \tintent.putExtra(TYPES, temp2);\n \tintent.putExtra(EDIT, \"yes\");\n \tstartActivityForResult(intent, 2); \t \t\t\t\t\t\n }",
"@Override\r\n\tpublic void update(PartyType entity) {\n\t\t\r\n\t}",
"public abstract void update(Object obj) ;",
"@Override\n\tpublic void update(T obj) throws Exception {\n\t\t\n\t}",
"public boolean update(New object);",
"@Override\n\tpublic void update(EmpType entity) {\n\t\t\n\t}",
"void updateItem(E itemElementView);",
"public static void updateItems(List<Item> items)\n\t{\n\t\tfor (int indexInItemList = 0; indexInItemList < items.size(); indexInItemList++)\n\t\t\tupdateAllItems(items.get(indexInItemList));\n\t}",
"@Override\r\n\tpublic void update(Object object) {\n\t\t\r\n\t}",
"public void doUpdate(T objectToUpdate) throws SQLException;",
"@PUT(\"items\")\n Call<Void> updateReadAllItems(@Body ItemStateWrapper wrapper);",
"@Override\n public void updateLists(ItemList userItemList, ItemList auctionItemList) {\n this.auctionItemList = auctionItemList;\n this.userItemList = userItemList;\n updateJList();\n }",
"public void update(InterfaceBean object) {\n\t\t\n\t}",
"public Iterable<String> updateDataList(SaveType type);",
"void update ( priorizedListObject v ) throws DAOException;",
"@Override\n public void update(News item) {\n }",
"public void update(ItemsPk pk, Items dto) throws ItemsDaoException;",
"public abstract int update(T item) throws RepositoryException;",
"public void set(List<Item> items) {\n if (mUseIdDistributor) {\n IdDistributor.checkIds(items);\n }\n\n //first collapse all items\n getFastAdapter().collapse();\n\n //get sizes\n int newItemsCount = items.size();\n int previousItemsCount = mItems.size();\n int itemsBeforeThisAdapter = getFastAdapter().getItemCount(getOrder());\n\n //make sure the new items list is not a reference of the already mItems list\n if (items != mItems) {\n //remove all previous items\n if (!mItems.isEmpty()) {\n mItems.clear();\n }\n\n //add all new items to the list\n mItems.addAll(items);\n }\n\n //map the types\n mapPossibleTypes(items);\n\n //now properly notify the adapter about the changes\n if (newItemsCount > previousItemsCount) {\n if (previousItemsCount > 0) {\n getFastAdapter().notifyAdapterItemRangeChanged(itemsBeforeThisAdapter, previousItemsCount);\n }\n getFastAdapter().notifyAdapterItemRangeInserted(itemsBeforeThisAdapter + previousItemsCount, newItemsCount - previousItemsCount);\n } else if (newItemsCount > 0 && newItemsCount < previousItemsCount) {\n getFastAdapter().notifyAdapterItemRangeChanged(itemsBeforeThisAdapter, newItemsCount);\n getFastAdapter().notifyAdapterItemRangeRemoved(itemsBeforeThisAdapter + newItemsCount, previousItemsCount - newItemsCount);\n } else if (newItemsCount == 0) {\n getFastAdapter().notifyAdapterItemRangeRemoved(itemsBeforeThisAdapter, previousItemsCount);\n } else {\n getFastAdapter().notifyAdapterDataSetChanged();\n }\n }",
"@Override\r\n protected void updateObject(SimpleBody object, Entity e) {\n }",
"@Override\r\n protected void updateObject(SimpleBody object, Entity e) {\n }",
"protected void updateTypeList() {\n\t sequenceLabel.setText(\"Sequence = \" + theDoc.theSequence.getId());\n\t typeList.setListData(theDoc.theTypes);\n\t signalList.setListData(nullSignals);\n\t valueField.setEnabled(false);\n\t valueList.setEnabled(false);\n }",
"@Override\n\tpublic void update(Object o) {\n\n\t}",
"@Override\n\tpublic void update(Object o) {\n\n\t}",
"public void update(Object obj) throws HibException;",
"public void updateItemList(SegmentType formType, SegmentType elementType, int elementIdList) {\n switch (formType) {\n case Change:\n switch (elementType) {\n case Artifact:\n for (Change segment : dataModel.getChanges()) {\n editChangeArtifact(segment, elementIdList);\n\n }\n }\n break;\n case Configuration:\n switch (elementType) {\n case Committed_Configuration:\n for (Configuration segment : dataModel.getConfigurations()) {\n editConfigurationCommittedConfiguration(segment, elementIdList);\n }\n }\n case Phase:\n switch (elementType) {\n case Configuration:\n for (Phase segment : dataModel.getPhases()) {\n editPhaseConfiguration(segment, elementIdList);\n }\n break;\n }\n break;\n case Iteration:\n switch (elementType) {\n case Configuration:\n for (Iteration segment : dataModel.getIterations()) {\n editIterationConfiguration(segment, elementIdList);\n }\n break;\n }\n break;\n default:\n }\n\n }",
"@Override\n\tpublic void update(Room ob) {\n\t\tConnection cn = ConnectionPool.getInstance().getConnection();\n\t\ttry {\n\t\t\tPreparedStatement ps = cn.prepareStatement(\"UPDATE room SET id_room_type = ? WHERE id_room = ?\");\n\t\t\tps.setInt(1, ob.getIdRoomType());\n\t\t\tps.setInt(2, ob.getIdRoom());\n\n\t\t\tps.execute();\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tConnectionPool.getInstance().closeConnection(cn);\n\t\t}\n\t}",
"void update(T obj) throws PersistException;",
"public void setItem(T item) {\n this.item = item;\n }",
"void update(T entity);",
"void update(T entity);",
"public void setNewList(List<Item> items) {\n if (mUseIdDistributor) {\n IdDistributor.checkIds(items);\n }\n mItems = new ArrayList<>(items);\n mapPossibleTypes(mItems);\n getFastAdapter().notifyAdapterDataSetChanged();\n }",
"@Override\r\n\tpublic void update(List<GroupMember> list) {\n\t\tif(list == null) return;\r\n\t\tfor(int i=0;i<list.size();i++)\r\n\t\t\tupdate(list.get(i));\r\n\t}",
"public void update(L l);",
"public synchronized void update(String updatedItem, ArrayList<Integer> update){\n if(updatedItem.equals(\"marketplace\")){\n ArrayList<Integer> updateToSend = new ArrayList<>();\n updateToSend.add(4);\n updateToSend.addAll(update);\n broadcast(updateToSend);\n }\n\n else if(updatedItem.equals(\"developmentGrid\")){\n ArrayList<Integer> updateToSend = new ArrayList<>();\n updateToSend.add(5);\n updateToSend.addAll(update);\n broadcast(updateToSend);\n }\n\n else if (updatedItem.equals(\"actionTile\")) {\n ArrayList<Integer> updateToSend = new ArrayList<>();\n updateToSend.add(6);\n updateToSend.addAll(update);\n broadcast(updateToSend);\n }\n\n else {\n Player toUpdate = players.get(updatedItem);\n ArrayList<Integer> updateToSend = new ArrayList<>();\n updateToSend.add(toUpdate.getOrder());\n updateToSend.addAll(update);\n broadcast(updateToSend);\n }\n }",
"@Override\n\tpublic void update(Object entidade) {\n\t\t\n\t}",
"public void updateRecord(Record object);",
"protected void update(T item) {\n\t\tSession session = null;\n\t\ttry {\n\t\t\tsession = mDbHelper.beginTransaction();\n\t\t\tsession.update(item);\n\t\t\tmDbHelper.endTransaction(session);\n\t\t} catch (Exception e) {\n\t\t\tmDbHelper.cancelTransaction(session);\n\t\t\tAppLogger.error(e, \"Failed to execute update\");\n\t\t}\n\t}",
"void update( ExperimentDTO item );",
"public void updateLista(Persona updated, int index) {\r\n\t\t\tlista.update(updated, index);\r\n\t}",
"@Test(description = \"update interface with all types for existing interface with one type\")\n public void updateAllTypes4ExistingType()\n throws Exception\n {\n final DataCollection data = new DataCollection(this);\n final TypeData type = data.getType(\"TestType\");\n final InterfaceData inter = data.getInterface(\"TestInterface\").addType(type);\n data.create();\n\n inter.addAllTypes();\n this.update(inter);\n\n Assert.assertEquals(this.mql(\"print interface '\" + inter.getName() + \"' select type dump\"),\n \"all\",\n \"check that only all type is defined\");\n }",
"Boolean updateList(List<Customer> list);",
"public void setItem(Item[] param) {\r\n validateItem(param);\r\n\r\n localItemTracker = true;\r\n\r\n this.localItem = param;\r\n }",
"<T> void update(T persistentObject);",
"public static void updateUserBookList(BookList bookList) {\n PrivateUser user = loadUser();\n\n for (String type : user.getBookLists().keySet()) {\n if (bookList.getType().getName().equals(type)) {\n user.getBookLists().put(type, bookList);\n\n break;\n }\n }\n\n saveUser(user);\n }",
"@Override\n\tpublic Item update() {\n\t\t\n\t\treadAll();\n\t\n\t\tLOGGER.info(\"State the shoe name you wish to update\");\n\t\tString name = util.getString().toLowerCase();;\n\t\tLOGGER.info(\"State the size you wish to update\");\n\t\tdouble size = util.getDouble();\n\t\tLOGGER.info(\"Change price\");\n\t\tdouble price = util.getDouble();\n\t\tLOGGER.info(\"Change amount in stock\");\n\t\tlong stock = util.getLong();\n\t\tLOGGER.info(\"\\n\");\n\t\treturn itemDAO.update(new Item(name,size,price,stock));\n\t\t\n\t\t\n\t\t\n\t}",
"@Override\r\n\tpublic void update(Cidade obj) {\n\r\n\t}",
"public void setItem(Object item, int i)\n {\n items.setElementAt(item, i);\n }",
"@Test(description = \"update interface with one type for existing interface with all types\")\n public void updateOneType4ExistingAllTypes()\n throws Exception\n {\n final DataCollection data = new DataCollection(this);\n final TypeData type = data.getType(\"TestType\");\n final InterfaceData inter = data.getInterface(\"TestInterface\").addAllTypes();\n data.create();\n\n inter.removeTypes()\n .addType(type);\n this.update(inter);\n\n Assert.assertEquals(this.mql(\"print interface '\" + inter.getName() + \"' select type dump\"),\n type.getName(),\n \"check that only one type is defined\");\n }",
"public static void updateIndex(final List<Entity> entity) {\n }",
"void updateCards(List<CardEntity> data);",
"@Override\n\tpublic void updateFromFlashlist(FlashlistType flashlistType, JsonNode flashlistRow) {\n\n\t\t/* ignore data from RU flashlist for EVM */\n\t\tif (isEVM && flashlistType == FlashlistType.RU)\n\t\t\treturn;\n\t\t\n\t\t/**\n\t\t * For dispatching Flashlist RU to RU objects and flashist EVM to EVM\n\t\t * objects see {@link FlashlistDispatcher}\n\t\t */\n\t\tif (flashlistType == FlashlistType.RU || flashlistType == FlashlistType.EVM) {\n\t\t\t// direct values\n\n\t\t\tthis.setStateName(flashlistRow.get(\"stateName\").asText());\n\t\t\tthis.setErrorMsg(flashlistRow.get(\"errorMsg\").asText());\n\t\t\tthis.requests = flashlistRow.get(\"eventCount\").asInt();\n\t\t\tthis.rate = flashlistRow.get(\"eventRate\").asInt();\n\t\t\tthis.eventsInRU = flashlistRow.get(\"eventsInRU\").asInt();\n\t\t\tthis.eventCount = flashlistRow.get(\"eventCount\").asLong();\n\t\t\tthis.fragmentsInRU = flashlistRow.get(\"fragmentCount\").asInt();\n\t\t\tthis.superFragmentSizeMean = flashlistRow.get(\"superFragmentSize\").asInt();\n\t\t\tthis.superFragmentSizeStddev = flashlistRow.get(\"superFragmentSizeStdDev\").asInt();\n\t\t\tthis.incompleteSuperFragmentCount = flashlistRow.get(\"incompleteSuperFragmentCount\").asInt();\n\n\t\t\t// derived values\n\t\t\tthis.throughput = rate * superFragmentSizeMean;\n\n\t\t}\n\t}",
"public void refresh(List<T> list) {\n this.items = list;\n notifyDataSetChanged();\n }",
"public void testUpdate() {\n TUpdate_Input[] PriceLists_update_in = new TUpdate_Input[] { PriceList_update };\n TUpdate_Return[] PriceLists_update_out = priceListService.update(PriceLists_update_in);\n // test if update was successful\n assertEquals(\"update result set\", 1, PriceLists_update_out.length);\n\n TUpdate_Return PriceList_update_out = PriceLists_update_out[0];\n assertNoError(PriceList_update_out.getError());\n assertEquals(\"updated?\", true, PriceList_update_out.getUpdated());\n }",
"void update(T transientObject);",
"public void updated(ServerList list);",
"@Override\n\t@RequestMapping(value=ZuelControllerValue.Manage+\"updateItem\")\n\tpublic ZuelResult updateItem(TbItem item) throws Exception {\n\t\treturn service.updateItem(item);\n\t}",
"public void setItem(Item item) throws Exception {\n\t\tfor(int i = 0; i < last; ++i)\n\t\t\tif(list[i].getCode() == item.getCode()) {\n\t\t\t\tlist[i].increment(item.getCount());\n\t\t\t\treturn;\n\t\t\t}\n\t\tif(last < size)\n\t\t\tlist[last++] = item;\n\t\telse\n\t\t\tthrow new Exception(\"list full\");\n\t}",
"public void updateItemList(SegmentType formType, SegmentType elementType, ArrayList<Integer> elementIdList) {\n if (elementIdList == null) {\n return;\n }\n switch (formType) {\n case Work_Unit:\n updateWUListItem(elementType, elementIdList);\n break;\n case Milestone:\n switch (elementType) {\n case Criterion:\n for (Milestone segment : dataModel.getMilestones()) {\n int i = 0;\n for (CriterionList list : segment.getCriteriaIndexs()) {\n updateElementListFromSegment(elementIdList, list.getCriterions());\n if (list.getCriterions().size() == 0) {\n segment.getCriteriaIndicator().remove(i);\n }\n i++;\n }\n }\n break;\n default:\n }\n break;\n case Person:\n for (Person segment : dataModel.getPersons()) {\n editPersonRoleType(segment, elementIdList);\n }\n\n break;\n case Config_Person_Relation:\n switch (elementType) {\n case Person:\n for (ConfigPersonRelation segment : dataModel.getConfigPersonRelations()) {\n editCPRPerson(segment, elementIdList);\n }\n break;\n default:\n }\n break;\n case Artifact:\n switch (elementType) {\n case Person:\n for (Artifact segment : dataModel.getArtifacts()) {\n editArtifactPerson(segment, elementIdList);\n }\n break;\n default:\n }\n break;\n case Phase:\n switch (elementType) {\n case Milestone:\n for (Phase segment : dataModel.getPhases()) {\n editPhaseMilestone(segment, elementIdList);\n }\n break;\n case Work_Unit:\n for (Phase segment : dataModel.getPhases()) {\n int i = 0;\n for (WorkUnitList list : segment.getWorkUnits()) {\n updateElementListFromSegment(elementIdList, list.getWorkUnits());\n if (list.getWorkUnits().size() == 0) {\n segment.getWorkUnitsIndicator().remove(i);\n }\n i++;\n }\n }\n break;\n default:\n }\n break;\n case Iteration:\n switch (elementType) {\n case Configuration:\n for (Iteration segment : dataModel.getIterations()) {\n editIterationConfiguration(segment, elementIdList);\n }\n break;\n case Work_Unit:\n for (Iteration segment : dataModel.getIterations()) {\n int i = 0;\n for (WorkUnitList list : segment.getWorkUnits()) {\n updateElementListFromSegment(elementIdList, list.getWorkUnits());\n if (list.getWorkUnits().size() == 0) {\n segment.getWorkUnitsIndicator().remove(i);\n }\n i++;\n }\n }\n break;\n }\n break;\n case Activity:\n for (Activity segment : dataModel.getActivities()) {\n int i = 0;\n for (WorkUnitList list : segment.getWorkUnits()) {\n updateElementListFromSegment(elementIdList, list.getWorkUnits());\n if (list.getWorkUnits().size() == 0) {\n segment.getWorkUnitsIndicator().remove(i);\n }\n i++;\n }\n }\n break;\n case Commit:\n switch (elementType) {\n\n }\n break;\n case Configuration:\n configurationEdit(elementType, elementIdList);\n break;\n default:\n\n }\n }",
"@Override\n public void modifyPost(List<Post> posts, int type) {\n\n\t}",
"public void setData(GenericItemType data) {\n this.data = data;\n }",
"public <T> T update(T entity);",
"@Override\n public void update(Restriction object) throws Exception {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"public void update(E entity);",
"public void update(List<Drawable> items) {\r\n\t\tnetPaintClient.update(items);\r\n\t}",
"private void updateList(int index, User updateUser)\n\t{\n\t\tthis.usersList.get(index).setUsername(updateUser.getUsername());\n\t\tthis.usersList.get(index).setPassword(updateUser.getPassword());\n\t\tthis.usersList.get(index).setEmail(updateUser.getEmail());\n\t\tthis.usersList.get(index).setName(updateUser.getName());\n\t\tthis.usersList.get(index).setPhone(updateUser.getPhone());\n\t}"
] | [
"0.6823402",
"0.66925895",
"0.6650131",
"0.663962",
"0.65199167",
"0.64889234",
"0.6427234",
"0.6395097",
"0.6364188",
"0.63241976",
"0.6304689",
"0.6301964",
"0.629464",
"0.62509793",
"0.62490857",
"0.62052834",
"0.6104294",
"0.605778",
"0.605391",
"0.6040709",
"0.6005613",
"0.59882647",
"0.5967408",
"0.5963757",
"0.5953315",
"0.5897766",
"0.58577317",
"0.58524275",
"0.58457524",
"0.58379465",
"0.58379465",
"0.5833177",
"0.5828231",
"0.58260536",
"0.58036256",
"0.5801296",
"0.5797652",
"0.5793821",
"0.5761193",
"0.5714781",
"0.57089657",
"0.5694782",
"0.5694538",
"0.5668896",
"0.56640047",
"0.5656408",
"0.56419903",
"0.56403995",
"0.5633343",
"0.56290346",
"0.56079197",
"0.56055385",
"0.5594576",
"0.55690217",
"0.55548704",
"0.55548704",
"0.55433387",
"0.5543169",
"0.5543169",
"0.55356514",
"0.55151695",
"0.55147487",
"0.5510728",
"0.55027944",
"0.54800844",
"0.54800844",
"0.54613876",
"0.5458455",
"0.54418814",
"0.54376763",
"0.54340994",
"0.54318124",
"0.5411184",
"0.54077125",
"0.54021394",
"0.5392354",
"0.5388691",
"0.5388375",
"0.5388051",
"0.53681445",
"0.535322",
"0.5350835",
"0.53429455",
"0.5338723",
"0.533784",
"0.5331425",
"0.5331055",
"0.53304327",
"0.5327566",
"0.53238356",
"0.5321767",
"0.5311819",
"0.52984184",
"0.52976465",
"0.5296421",
"0.5295306",
"0.52923304",
"0.52699494",
"0.5268271",
"0.526467",
"0.5264159"
] | 0.0 | -1 |
Delete the object of the configured object type that has the given native identifier. | public Result delete(String nativeIdentifier, Map<String, Object> options)
throws ConnectorException, ObjectNotFoundException {
debug();
if (isDebug == true) {
log.debug("===== DELETE ====");
}
Result result = new Result();
try {
String codUsuario = "";
codUsuario = nativeIdentifier;
if (isDebug == true) {
log.debug("DELETE " + "<CodUsuario " + codUsuario + ">");
}
deletaUser(codUsuario);
result = new Result(Result.Status.Committed);
} catch (Exception e) {
e.printStackTrace();
result = new Result(Result.Status.Failed);
result.add("TIPO APP SIASES " + e);
if (isDebug == true) {
log.debug("ERRO DELETE SIASE USER: " + e);
}
throw new ConnectorException("ERRO DELETE SIASE USER: " + e);
}
Map<String, Object> obj = read(nativeIdentifier);
if (null == obj) {
throw new ObjectNotFoundException(nativeIdentifier);
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static native void delete(long nativeObj);",
"private static native void delete(long nativeObj);",
"private static native void delete(long nativeObj);",
"private static native void delete(long nativeObj);",
"private static native void delete(long nativeObj);",
"private static native void delete(long nativeObj);",
"private static native void delete(long nativeObj);",
"private static native void delete(long nativeObj);",
"public void deleteObject(String id) {\n\t\t\n\t}",
"public abstract LocalAbstractObject deleteObject(UniqueID objectID) throws NoSuchElementException, BucketStorageException;",
"<T> void delete(T persistentObject);",
"void delete(T persistentObject);",
"void delete(String typeName, String id);",
"@Override\r\n\tpublic void delete(Object object) {\n\t\t\r\n\t}",
"public abstract boolean delete(Object obj) ;",
"@Override\n\tpublic void delete(Unidade obj) {\n\n\t}",
"int deleteByPrimaryKey(String objId);",
"int deleteByPrimaryKey(String objId);",
"public void deleteObject() {\n\n\t}",
"@Override\n\tpublic int deleteObject(Evaluate entity) {\n\t\treturn evaluateMapper.deleteObject(entity);\n\t}",
"@Override\r\n\tpublic void delete(ObjectWithId objectToDelete) {\n\r\n\t}",
"@Override\n\tpublic void delete(T obj) throws Exception {\n\t\t\n\t}",
"void delete(T obj) throws PersistException;",
"public abstract Object remove(String oid) throws OIDDoesNotExistException, LockNotAvailableException;",
"@Override\n\tpublic int delete(Object object) {\n\t\treturn 0;\n\t}",
"public Integer deletePaymentType(PaymentTypeObject paymentTypeObject) throws AppException;",
"public boolean delete(Object obj) throws Exception;",
"boolean delete(Long id, Class<T> type);",
"public abstract boolean delete(String oid) throws OIDDoesNotExistException, LockNotAvailableException;",
"@Override\r\n\tpublic Ngo delete(Ngo obj) {\n\t\treturn null;\r\n\t}",
"void delete(Object aObject);",
"void delete(Object entity);",
"void delete(String identifier) throws IOException;",
"void delete(T obj);",
"@Override\n\tpublic boolean delete(Dynamic object) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic void delete(Object o) {\n\t}",
"int deleteByPrimaryKey(String detailId);",
"public void doDelete(T objectToDelete) throws SQLException;",
"@Override\n\tpublic void deleteByOid(int oaId) {\n\t\tdesignMapper.deleteByOid(oaId);\n\t}",
"public T removeObject(int key, int identifier) throws PersistenceException {\n return super.removeObjectInKey(key, identifier);\n }",
"public void delById(Serializable id) ;",
"public boolean delete(@SuppressWarnings(\"rawtypes\") Class type, String key);",
"int deleteByPrimaryKey(Integer typeiId);",
"@Override\n\tpublic void delete(Object entidade) {\n\t\t\n\t}",
"public void remove(int objectId) throws SQLException;",
"public void deleteObjectFromUID(String s) throws UIDException {\n \r\n }",
"public static native void deleteNative(long j);",
"@Override\n\tpublic void delete(Integer rno) throws Exception {\n\t\tSystem.out.println(\"gogog\");\n\t\tsession.delete(namespace+\".delete4\",rno);\n\t}",
"boolean removeObject(String id);",
"void delete(int metaTagId);",
"@Override\n\tpublic int deleteObjectById(Integer id) {\n\t\treturn evaluateMapper.deleteObjectById(id);\n\t}",
"void delete( Long id );",
"boolean removeObject(int ID) throws DatabaseNotAccessibleException;",
"public com.google.protobuf.Empty deleteDevice(org.thethingsnetwork.management.proto.HandlerOuterClass.DeviceIdentifier request);",
"int deleteByPrimaryKey(ApplicationDOKey key);",
"public int delete(o dto);",
"void delete(K id);",
"void delete(K id);",
"public void deleteNsIdentifier(String s) throws MethodNotImplementedException, NotExistingEntityException, FailedOperationException {\r\n log.info(\"Received call to deleteNsIdentifier, parameter {}.\", s);\r\n throw new MethodNotImplementedException(\"not supported in SM.\");\r\n }",
"public void delete(K id);",
"@Override\n\tpublic void delete(Serializable id) {\n\t\t\n\t}",
"@Override\n\tpublic int deleteById(Integer pk) {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic int deleteById(Integer pk) {\n\t\treturn 0;\n\t}",
"int deleteByPrimaryKey(Integer oId);",
"public void delete(Object object)\n{\n\t// remove the object\n\tobjects.remove(object);\n}",
"int deleteByPrimaryKey(String card);",
"void delete( Integer id );",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);",
"void delete(Long id);"
] | [
"0.6739499",
"0.6739499",
"0.6739499",
"0.6739499",
"0.6739499",
"0.6739499",
"0.6739499",
"0.6739499",
"0.6554911",
"0.65440917",
"0.6514068",
"0.65023375",
"0.64869976",
"0.6466659",
"0.6460085",
"0.6428065",
"0.6413959",
"0.6413959",
"0.6341147",
"0.6325653",
"0.628714",
"0.6262698",
"0.6259111",
"0.6244778",
"0.62363005",
"0.6227917",
"0.62231565",
"0.6222569",
"0.62032855",
"0.61976755",
"0.61911434",
"0.61360157",
"0.611345",
"0.6083838",
"0.6059797",
"0.60509366",
"0.5996666",
"0.59943247",
"0.5983631",
"0.5967733",
"0.59623355",
"0.59557664",
"0.59324604",
"0.59308535",
"0.59231484",
"0.59170955",
"0.5897932",
"0.5888968",
"0.5881478",
"0.5866791",
"0.58653826",
"0.58633363",
"0.58580977",
"0.58559805",
"0.58451784",
"0.58383024",
"0.58382654",
"0.58382654",
"0.58369815",
"0.58303505",
"0.5822536",
"0.58158576",
"0.58158576",
"0.5802151",
"0.579303",
"0.5782293",
"0.5773969",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906",
"0.5770906"
] | 0.6130721 | 32 |
Enable the object of the configured object type that has the given native identifier. | public Result enable(String nativeIdentifier, Map<String, Object> options)
throws ConnectorException, ObjectNotFoundException {
debug();
if (isDebug == true) {
log.debug("===== ENABLE ====");
}
Result result = new Result();
try {
String codSistema = "", codUsuario = "", nomUsuario = "", icStatu = "", icType = "", codSenha = "", numPerfil = "";
int operacao = 0;
codUsuario = nativeIdentifier;
IC_STATUS_ACESSO = "0";
if (isDebug == true) {
log.debug("ENABLE USUARIO " + "<CodUsuario " + codUsuario + ">");
}
dadosConexoes(codUsuario);
numPerfil = nuPerfil;
codSistema = coSistema;
dadosUsuario(codUsuario);
nomUsuario = noUsuario;
icStatu = "0";
icType = icTipo;
operacao = 2;
if (isDebug == true) {
log.debug("ENABLE" + "<CodUsuario: " + codUsuario
+ "> <CodSistema: " + codSistema + "> <nomUsuario: "
+ nomUsuario + "> <icStatu: " + icStatu + "> <icType: "
+ icType + "> <codSenha: " + codSenha
+ "> <numPerfil: " + numPerfil + "> <operacao: "
+ operacao + ">");
}
createUser(codSistema, codUsuario, nomUsuario, icStatu, icType,
codSenha, numPerfil, operacao);
result = new Result(Result.Status.Committed);
} catch (Exception e) {
e.printStackTrace();
result = new Result(Result.Status.Failed);
result.add("TIPO APP SIASES ENABLE " + e);
if (isDebug == true) {
log.debug("ERRO ENABLE SIASE USER: " + e);
}
throw new ConnectorException("ERRO ENABLE SIASE USER: " + e);
}
Map<String, Object> obj = read(nativeIdentifier);
if (null == obj) {
throw new ObjectNotFoundException(nativeIdentifier);
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void enable(String id) throws Exception {\n\t\t\n\t}",
"public void registerObject(NetObject object);",
"public native void setIdentifier (String identifier);",
"@Override\r\n\tpublic void setAddNewObjectIdentifier(String arg0, Long arg1)\r\n\t{\n\r\n\t}",
"protected abstract void enable();",
"public void sendShortEnable(short objCode, boolean enable) {\n\t\tsendShortEnable(objCode, enable, clientNames);\n\t}",
"private synchronized native void nativeEnable( int image, String tooltip ) \n throws UnsatisfiedLinkError;",
"@Override\n\t\tpublic void activateObject(Object key, Object obj) throws Exception {\n\t\t}",
"public void enableClient(){\r\n try{\r\n oos.writeObject(new DataWrapper(DataWrapper.CTCODE, new ControlToken(ControlToken.ENABLECODE)));\r\n oos.flush();\r\n } catch(IOException ioe) {\r\n ioe.printStackTrace();\r\n }\r\n }",
"public void associate(Object obj, Class type);",
"public void setNativeObject(Object nativeObject) {\r\n this.nativeObject = nativeObject;\r\n }",
"void setObjectKey(String objectKey);",
"public void setObject(XSerial obj);",
"public void registerObject(NetObject object, String channel);",
"public void enable();",
"public void enable() {\r\n m_enabled = true;\r\n }",
"public abstract Object put(String oid, Object obj) throws OIDAlreadyExistsException, ObjectNotSupportedException;",
"public void enable()\r\n\t{\r\n\t\tenabled = true;\r\n\t}",
"public void inAClass(AClass node) {\n TIdentifier id = node.getIdentifier();\n \n if (node.getExtension() == null && \n ! id.getText().equals(\"Object\")) {\n node.setExtension(\n new AExtension(new TIdentifier(\"Object\",id.getLine(),id.getPos())));\n }\n }",
"public void enable ( ) {\r\n\t\tenabled = true;\r\n\t}",
"public void sendByteEnable(byte objCode, boolean enable) {\n\t\tsendByteEnable(objCode, enable, clientNames);\n\t}",
"protected void install(PatientIdentifierTypeDescriptor d) {\n install(CoreConstructors.patientIdentifierType(d.name(), d.description(), d.format(), d.formatDescription(), d.validator(), d.locationBehavior(), d.required(), d.uuid()));\n }",
"public void sendShortEnable(short objCode, boolean enable, List<String> clientNames) {\n\t\tServerMessage serverMessage = new ServerMessage(getId(), SpaceProtocol.SHORT_ENABLE);\n\t\tserverMessage.put(objCode);\n\t\tserverMessage.put(enable);\n\t\tDGSLogger.log(\"Space.sendShortEnable objcode: \" + objCode + \" enable: \" + enable);\n\t\tserverMessage.sendClientMessage(clientNames);\n\t}",
"@Override\n\tpublic void registerPrimaryTypes() {\n\t\tobjectType = registerJavaType(getBuilder().getName(), ClassType.CLASS);\n\t}",
"protected abstract void setId(P object, Long id);",
"public abstract void setId(T obj, long id);",
"public void enable() {\n \t\t\tsetEnabled(true);\n \t\t}",
"public EnableMaterial(ResourceUrn materialUrn) {\n this.materialUrn = materialUrn;\n this.material = getMaterial(materialUrn);\n }",
"boolean lockDigitalObject(String uuid, Long id, String description) throws DatabaseException;",
"public void register(GameObject gameObject) {\r\n\t\tsuper.register((Object)gameObject);\r\n\t}",
"void enable();",
"@Override\r\n public void setObject(String object) {\n }",
"public void activate(ObjectId oxID, Object obj, MarshaledOX extState) throws Exception {\n\t\tfor (int i = 0; i < oclass.length; i++) {\n\t\t\tString adress = ExehdaUtil.getWorb().exportService(obj, oclass[i], objectClass + oxID.toString() + i);\n\t\t\tcontactAddress.addElement(adress);\n\t\t}\n\n\t\t// update the ox meta-attribute 'contact'\n\t\tOXHandle oxh = ExehdaUtil.getOXManager().createHandle(oxID);\n\t\tfor (int i = 0; i < interfaceClass.length; i++) {\n\t\t\toxh.setAttribute(ATT_WORB_CONTACT + interfaceClass[i], contactAddress.elementAt(i));\n\t\t}\n\n\t\tif ((obj instanceof Runnable) && (run)) {\n\t\t\tnew Thread((Runnable) obj).start();\n\t\t}\n\t}",
"public void markNodeAsRegistered(String nodeId);",
"private static native void registerIdsN();",
"private void addPluginStatusForObject(OwObject object_p, OwPluginEntry pluginEntry_p, boolean isEnabled_p)\r\n {\r\n try\r\n {\r\n String key = createKey(object_p, pluginEntry_p);\r\n m_object2PluginStatusMap.put(key, isEnabled_p ? Boolean.TRUE : Boolean.FALSE);\r\n }\r\n catch (Exception e)\r\n {\r\n //nothing to do, just log\r\n LOG.error(\"Cannot add plugin status for object: \" + object_p + \" and for plugin entry: \" + pluginEntry_p, e);\r\n }\r\n\r\n }",
"public void enable() {\n\t\tif (!permanent) {\n\t\t\tenabled = true;\n\t\t\trect.setColor(c);\n\t\t}\n\t}",
"public void enable(CommonPlugin plugin);",
"private void setIdentifiedPlatform(ControllerType identfiedPlatformType) {\r\n\t\tthis.identifiedControllerType = identfiedPlatformType;\r\n\r\n\t}",
"public void enablePropertyVolume()\n {\n iPropertyVolume = new PropertyUint(new ParameterUint(\"Volume\"));\n addProperty(iPropertyVolume);\n }",
"void setObject(String id, Object data);",
"public void fromNative() {\n fromNative(nativeType);\n }",
"public void enableAdvertisingIdCollection(boolean enabled) {\n tracker.enableAdvertisingIdCollection(enabled);\n }",
"public void enable() {\n TalonHelper.configNeutralMode(Arrays.asList(armMotor, armMotorSlave), NeutralMode.Brake);\n }",
"public synchronized void registerObject(String name, Object object)\r\n throws IllegalArgumentException,\r\n NullPointerException\r\n {\r\n if (containsSubString(name, TIGHT_BINDING))\r\n {\r\n // user has used the wrong method to register this object.\r\n registerObject(object, name);\r\n }\r\n else\r\n {\r\n // check that name doesn't contain illegal characters\r\n if (!isValidName(name))\r\n {\r\n throw new IllegalArgumentException(\"ResourceManager.registerObject(): \"+\r\n \"name '\" +name+ \"' can not contain \"+\r\n \"the whitespace, or the characters \" +\r\n \" '\"+LOOSE_BINDING+\"', '\"+\r\n SINGLE_MATCH+ \"'\");\r\n }\r\n\r\n if (object == null)\r\n {\r\n throw new NullPointerException(\"ResourceManager.registerObject(): \"+\r\n \"object is null\");\r\n }\r\n\r\n // store this mapping\r\n storeObject(name, object);\r\n }\r\n }",
"@Override\n public boolean isDisableIdentifierField() {\n return false;\n }",
"void enableDigital();",
"public void enable() {\n\t\tenabled = true;\n\t\t//System.out.println(\"Enabled Controller\");\n\t}",
"public void enable(){\r\n\t\tthis.activ = true;\r\n\t}",
"private void activate(final Object object) {\n\t\tdatabase.activate(object, Integer.MAX_VALUE);\n\t}",
"@Override\n\tpublic void activateEntityRelationship(Long id) {\n\t\tentityRelationshipTypeRepository.activateEntityRelationship(id);\n\t}",
"protected abstract void setEnable(E entry, boolean enable)\n\t\t\tthrows ALEException;",
"public void enable() {\n\t\tm_enabled = true;\n\t\tm_controller.reset();\n\t}",
"@Override\n public void enableFeature(String feature) throws RemoteException {\n Database.enableFeature(\n getApplicationContext(),\n feature,\n null\n );\n JID_VERIFICATION_CACHE.clear();\n }",
"public void enabled(int id) {\n\t\tAccount account=userDao.getAccount(id);\r\n\t\tStatus status=userDao.getStatus(\"ÆôÓÃ\");\r\n\t\taccount.setStatus(status);\r\n\t\tuserDao.updateAccount(account);\r\n\t}",
"@SuppressWarnings(\"unused\")\n private void setIndoorEnabled(final JSONArray args, final CallbackContext callbackContext) throws JSONException {\n Boolean isEnabled = args.getBoolean(1);\n map.setIndoorEnabled(isEnabled);\n this.sendNoResult(callbackContext);\n }",
"protected void addIdentifierPropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_Requirement_identifier_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_Requirement_identifier_feature\", \"_UI_Requirement_type\"),\n\t\t\t\t Y3853992Package.Literals.REQUIREMENT__IDENTIFIER,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}",
"public void setObjectId(String objectId);",
"public void sendShortEnables(short[] objCodes, boolean enable) {\n\t\tsendShortEnables(objCodes, enable, clientNames);\n\t}",
"private static native void setMode_0(long nativeObj, int mode);",
"private void enablePlugIn(WebSocketConnector aConnector, Token aToken) {\n\t\tif (mService == null) {\n\t\t\tmService = new AdminPlugInService(NS_ADMIN, mNumberOfDays, getServer());\n\t\t}\n\n\t\tif (mLog.isDebugEnabled()) {\n\t\t\tmLog.debug(\"Processing 'enablePlugIn'...\");\n\t\t}\n\n\t\tgetServer().sendToken(aConnector, mService.enablePlugIn(aConnector, aToken));\n\t}",
"public void enablePropertyVolumeUnity()\n {\n iPropertyVolumeUnity = new PropertyUint(new ParameterUint(\"VolumeUnity\"));\n addProperty(iPropertyVolumeUnity);\n }",
"public void enableClassName(boolean enable) {\r\n className = enable;\r\n }",
"public void register(T o);",
"@Override\n public void register(Context context, DSpaceObject dso, String identifier)\n {\n try\n {\n createNewIdentifier(context, dso, identifier);\n if (dso instanceof Item)\n {\n Item item = (Item) dso;\n populateHandleMetadata(context, item, identifier);\n }\n }\n catch (Exception e)\n {\n logger.error(LogManager.getHeader(context,\n \"Error while attempting to create handle\", \"Item id: \"\n + dso.getID()), e);\n throw new RuntimeException(\n \"Error while attempting to create identifier for Item id: \"\n + dso.getID(), e);\n }\n }",
"public void enable(int priority)\n {\n // Verify service is connected\n assertService();\n \n try {\n \tmLedService.enable(mBinder, mName, priority);\n } catch (RemoteException e) {\n Log.e(TAG, \"enable failed\");\n }\n }",
"final public void setEnabled(int value) {\n enabledType = value;\n }",
"public void setEnable(Boolean enable) {\n this.enable = enable;\n }",
"public abstract void onEnable();",
"public void enablePropertyUnityGain()\n {\n iPropertyUnityGain = new PropertyBool(new ParameterBool(\"UnityGain\"));\n addProperty(iPropertyUnityGain);\n }",
"protected void addIdentifierPropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add(createItemPropertyDescriptor(\n\t\t\t\t((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),\n\t\t\t\tgetString(\"_UI_ApplicationLoadBalancerBuilder_elasticloadbalancingv2_identifier_feature\"),\n\t\t\t\tgetString(\"_UI_PropertyDescriptor_description\",\n\t\t\t\t\t\t\"_UI_ApplicationLoadBalancerBuilder_elasticloadbalancingv2_identifier_feature\",\n\t\t\t\t\t\t\"_UI_ApplicationLoadBalancerBuilder_elasticloadbalancingv2_type\"),\n\t\t\t\tAwsworkbenchPackage.Literals.APPLICATION_LOAD_BALANCER_BUILDER_ELASTICLOADBALANCINGV2__IDENTIFIER, true,\n\t\t\t\tfalse, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));\n\t}",
"public void sendByteEnable(byte objCode, boolean enable, List<String> clientNames) {\n\t\tServerMessage serverMessage = new ServerMessage(getId(), SpaceProtocol.BYTE_ENABLE);\n\t\tserverMessage.put(objCode);\n\t\tserverMessage.put(enable);\n\t\tDGSLogger.log(\"Space.sendByteEnable objcode: \" + objCode + \" enable: \" + id);\n\t\tserverMessage.sendClientMessage(clientNames);\n\t}",
"public void onEnable() {\n }",
"public abstract Object update(String oid, Object obj)\n\t\t\tthrows OIDDoesNotExistException, ObjectNotSupportedException, LockNotAvailableException;",
"@Override\n public void enableFeatureForJid(String jid, String feature)\n throws RemoteException {\n Database.enableFeature(\n getApplicationContext(),\n jid,\n feature,\n null\n );\n JID_VERIFICATION_CACHE.remove(jid);\n }",
"public void bindObjectID(String oidStr, int index) {\n bindParameter(new ExternalObjectIdentifier(oidStr), index);\n }",
"public void setEnable(Boolean enable) {\n this.enable = enable;\n }",
"public abstract void setEnabled(Context context, boolean enabled);",
"public void registerNewPlayer(int playerObjId)\n\t{\n\t\t// create a new array\n\t\tInteger[] array = new Integer[PROTECTEDACTIONSIZE];\n\t\tfor (int i = 0; i < array.length; i++)\n\t\t\tarray[i] = 0;\n\n\t\t// register the player with an empty array\n\t\t_floodClient.put(playerObjId, array);\n\t}",
"@Override\n\tpublic void onEnable() {\n\t}",
"public void setEnable(boolean enable) {\n this.enable = enable;\n }",
"public void onEnable(){\n instance = this;\n kitHandler = new KitHandler();\n arcadeHandler = ArcadeHandler.getInstance();\n state = GameState.LOBBY;\n\n PluginManager pm = Bukkit.getPluginManager();\n pm.registerEvents(new PlayerListener(), this);\n }",
"public void jvnRegisterObject(String jon, JvnObject jo) throws jvn.JvnException {\n\t\t// to be completed \n\t\ttry {\n\t\t\tthis.jRCoordonator.jvnRegisterObject(jon, jo, js);\n\t\t} catch (RemoteException e) {\n\t\t\tSystem.out.println(\"Error creation object : \" + e.getMessage());\n\t\t}\n\t}",
"public void enablePropertyAlive()\n {\n iPropertyAlive = new PropertyBool(new ParameterBool(\"Alive\"));\n addProperty(iPropertyAlive);\n }",
"public void setEnable(Boolean enable) {\n this.enable = enable;\n }",
"public void enablePropertyMute()\n {\n iPropertyMute = new PropertyBool(new ParameterBool(\"Mute\"));\n addProperty(iPropertyMute);\n }",
"public void setEnabled (boolean enabled) {\r\n\tcheckWidget ();\r\n\tint topHandle = topHandle ();\r\n\tint flags = enabled ? 0 : OS.Pt_BLOCKED | OS.Pt_GHOST;\r\n\tOS.PtSetResource (topHandle, OS.Pt_ARG_FLAGS, flags, OS.Pt_BLOCKED | OS.Pt_GHOST);\r\n}",
"protected void enableActionSetVolume()\n {\n Action action = new Action(\"SetVolume\");\n action.addInputParameter(new ParameterRelated(\"Value\", iPropertyVolume));\n iDelegateSetVolume = new DoSetVolume();\n enableAction(action, iDelegateSetVolume);\n }",
"public void setEnablementParameter(YParameter parameter) {\n if (YParameter.getTypeForEnablement().equals(parameter.getDirection())) {\n if (null != parameter.getName()) {\n _enablementParameters.put(parameter.getName(), parameter);\n } else if (null != parameter.getElementName()) {\n _enablementParameters.put(parameter.getElementName(), parameter);\n }\n } else {\n throw new RuntimeException(\"Can only set enablement type param as such.\");\n }\n }",
"@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic void activateObject(Object arg0, Object arg1) throws Exception {\r\n\t\t//log.info(\"激活对象\");\r\n\t\tsuper.activateObject(arg0, arg1);\r\n\t}",
"public void setEnabled(boolean enabled) {\n synchronized (mBinder) {\n if (mEnabled == enabled) {\n return;\n }\n\n mEnabled = enabled;\n }\n\n ILocationProviderManager manager = mManager;\n if (manager != null) {\n try {\n manager.onSetEnabled(mEnabled);\n } catch (RemoteException | RuntimeException e) {\n Log.w(mTag, e);\n }\n }\n }",
"void update(Serializable objectId);",
"@JsonIgnore\r\n public void setKnownType(AlternateIdType knownType) {\r\n this.type = knownType == null ? null : new TypeReference<AlternateIdType>(knownType);\r\n }",
"public void setNative(boolean on) {\n if (on)\n setAccessFlags(getAccessFlags() | Constants.ACCESS_NATIVE);\n else\n setAccessFlags(getAccessFlags() & ~Constants.ACCESS_NATIVE);\n }",
"public void bindObjectID(byte[] oidBytes, int index) {\n bindParameter(new ExternalObjectIdentifier(oidBytes),index);\n }",
"void setObjectType(String objectType);",
"protected abstract void onPluginEnable();",
"public void xsetOID(org.apache.xmlbeans.XmlString oid)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.XmlString target = null;\r\n target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(OID$12);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(OID$12);\r\n }\r\n target.set(oid);\r\n }\r\n }",
"public void setObjtype(short newValue) {\n\tthis.objtype = newValue;\n}",
"public abstract boolean oidExists(String oid);"
] | [
"0.6108031",
"0.5673135",
"0.5491972",
"0.54405063",
"0.5311601",
"0.52837485",
"0.52538335",
"0.5202868",
"0.5165599",
"0.5165484",
"0.5140275",
"0.5138967",
"0.5131677",
"0.5130475",
"0.50870174",
"0.50685316",
"0.5052533",
"0.5025939",
"0.49517307",
"0.49494264",
"0.49018282",
"0.48576397",
"0.48501676",
"0.48465246",
"0.48179585",
"0.48167577",
"0.48055047",
"0.47961256",
"0.47793087",
"0.4766368",
"0.476232",
"0.47562",
"0.475174",
"0.4750672",
"0.47491857",
"0.4746212",
"0.4741828",
"0.47271964",
"0.47236043",
"0.47155103",
"0.4712556",
"0.46945664",
"0.46933514",
"0.46867064",
"0.46514076",
"0.46484265",
"0.46324545",
"0.46263754",
"0.46260682",
"0.4625626",
"0.4623995",
"0.46162063",
"0.4613967",
"0.46120316",
"0.46117607",
"0.4607767",
"0.460616",
"0.4605724",
"0.46040758",
"0.4598916",
"0.45960078",
"0.45951182",
"0.45948645",
"0.45947835",
"0.45939657",
"0.45914263",
"0.45913884",
"0.4585936",
"0.45828617",
"0.45755115",
"0.4573171",
"0.45717734",
"0.45630834",
"0.45619977",
"0.45541778",
"0.45453084",
"0.45389745",
"0.45362636",
"0.4533789",
"0.4525928",
"0.45159456",
"0.4510226",
"0.45064008",
"0.4503259",
"0.45023358",
"0.4493645",
"0.44894207",
"0.4488904",
"0.44860002",
"0.44741207",
"0.44717184",
"0.44669184",
"0.4458904",
"0.44545916",
"0.44545007",
"0.44536328",
"0.4453435",
"0.4450112",
"0.44466376",
"0.44437885"
] | 0.5763995 | 1 |
Disable the object of the configured object type that has the given native identifier. | public Result disable(String nativeIdentifier, Map<String, Object> options)
throws ConnectorException, ObjectNotFoundException {
debug();
if (isDebug == true) {
log.debug("===== DISABLE ====");
}
Result result = new Result();
try {
String codSistema = "", codUsuario = "", nomUsuario = "", icStatu = "", icType = "", codSenha = "", numPerfil = "";
int operacao = 0;
codUsuario = nativeIdentifier;
IC_STATUS_ACESSO = "1";
if (isDebug == true) {
log.debug("DISABLE" + "<CodUsuario: " + codUsuario + ">");
}
dadosConexoes(codUsuario);
numPerfil = nuPerfil;
codSistema = coSistema;
dadosUsuario(codUsuario);
nomUsuario = noUsuario;
icStatu = "1";
icType = icTipo;
operacao = 2;
if (isDebug == true) {
log.debug("DISABLE " + "<CodUsuario: " + codUsuario
+ "> <CodSistema: " + codSistema + "> <nomUsuario: "
+ nomUsuario + "> <icStatu: " + icStatu + "> <icType: "
+ icType + "> <codSenha: " + codSenha
+ "> <numPerfil: " + numPerfil + "> <operacao: "
+ operacao + ">");
}
createUser(codSistema, codUsuario, nomUsuario, icStatu, icType,
codSenha, numPerfil, operacao);
result = new Result(Result.Status.Committed);
} catch (Exception e) {
e.printStackTrace();
result = new Result(Result.Status.Failed);
result.add("TIPO APP SIASES DISABLE" + e);
if (isDebug == true) {
log.debug("ERRO DISABLE SIASE " + e);
}
throw new ConnectorException("ERRO DISABEL SIASE " + e);
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void disable(String id) throws Exception {\n\t\t\n\t}",
"public void disable();",
"protected abstract void disable();",
"@Override\n public boolean isDisableIdentifierField() {\n return false;\n }",
"void disable();",
"void disable();",
"public void disable()\r\n\t{\r\n\t\tenabled = false;\r\n\t}",
"public void disable ( ) {\r\n\t\tenabled = false;\r\n\t}",
"void disable() {\n }",
"public void disableComponent(String name);",
"public abstract void onDisable();",
"@Override\n public void onDisable() {\n }",
"@Override\n\tpublic void onDisable() {\n\t\t\n\t}",
"public void disable() {\n \t\t\tsetEnabled(false);\n \t\t}",
"@Override\n\tpublic void onDisable() {\n\n\t}",
"@Override\r\n\tpublic void onDisable() {\n\t}",
"@Override\r\n\tpublic void setDisabled(boolean arg0) throws NotesApiException {\n\r\n\t}",
"default void onDisable() {}",
"public void disable()\n {\n openGate = null;\n }",
"public void onDisable() {\r\n }",
"public void onDisable() {\n }",
"public void onDisable() {\n }",
"public void onDisable() {\n }",
"void disableMod();",
"public void disable(){\r\n\t\tthis.activ = false;\r\n\t}",
"public void onDisable()\n {\n }",
"public void disableClient(){\r\n try{\r\n oos.writeObject(new DataWrapper(DataWrapper.CTCODE, new ControlToken(ControlToken.DISABLECODE)));\r\n oos.flush();\r\n } catch(IOException ioe) {\r\n ioe.printStackTrace();\r\n }\r\n }",
"public void disable(CommonPlugin plugin);",
"private native void nativeProviderError(boolean isDisabled, long object);",
"@DISPID(36)\r\n\t// = 0x24. The runtime will prefer the VTID if present\r\n\t@VTID(41)\r\n\tboolean globalDisable();",
"public void disable()\n {\n // Verify service is connected\n assertService();\n \n try {\n \tmLedService.disable(mBinder);\n } catch (RemoteException e) {\n Log.e(TAG, \"disable failed\");\n }\n }",
"void disableCmdlet(long cmdletID) throws IOException;",
"@Override\n\tpublic void onDisable() {\n\t\tArduinoInstruction.getInst().disable();\n\t}",
"boolean unlockDigitalObject(String uuid) throws DatabaseException;",
"public void disable(boolean b) {\n\t\tif (b) permanent = true;\n\t\tenabled = false;\n\t\trect.setColor(disabledColor);\n\t}",
"void unsetIdentifier();",
"public void disable() {\n parent.setDefaultEnabled(false);\n }",
"public abstract Object remove(String oid) throws OIDDoesNotExistException, LockNotAvailableException;",
"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 }",
"public abstract void Disabled();",
"void disableDevice(Device device, String token) throws AuthenticationException;",
"@DISPID(78)\r\n\t// = 0x4e. The runtime will prefer the VTID if present\r\n\t@VTID(76)\r\n\tboolean globalDisable();",
"void disableAgentSelectionControl();",
"public void disableReader() {\n active = false;\n deregisterBroadcastReceiver();\n }",
"public JsStatement disable()\n\t{\n\t\treturn new JsQuery(getComponent()).$().chain(\"draggable\", \"'disable'\");\n\t}",
"void disableUpgrade(NodeType type);",
"public void disableStudent(Student student) {\n\t\t\r\n\t}",
"public abstract void wgb_onDisable();",
"public interface Disabler<M extends Disabled> {\n\n\tvoid disable(M entiry);\n}",
"@Override\n public void onDisabled() {\n }",
"public void disable() {\n disabled = true;\n circuit.disable();\n updateSign(true);\n notifyChipDisabled();\n }",
"public void disable() {\n TalonHelper.configNeutralMode(Arrays.asList(armMotor, armMotorSlave), NeutralMode.Coast);\n }",
"public void disable() {\n operating = false;\n }",
"public void disable() {\r\n cardOne.setEnabled(false);\r\n cardTwo.setEnabled(false);\r\n cardThree.setEnabled(false);\r\n cardFour.setEnabled(false);\r\n cardFive.setEnabled(false);\r\n }",
"@Override\n\tpublic boolean disablePartner(Partner partner) {\n\t\treturn false;\n\t}",
"public void disableMonsters(){\n enabled = false;\n }",
"public void setDisabled(EventType ore, boolean d) {\r\n\t\tif (d) disabled |= 1L << ore.ordinal();\r\n\t\telse disabled &= ~(1L << ore.ordinal());\r\n\t}",
"void disable(final Op op);",
"public FXMLPropertiesDisabler() {\n this(OS.get());\n }",
"public JsonFactory disable(Feature f)\n/* */ {\n/* 549 */ this._factoryFeatures &= (f.getMask() ^ 0xFFFFFFFF);\n/* 550 */ return this;\n/* */ }",
"public void setDisabled() {\n\t\tdisabled = true;\n\t}",
"@Override\r\n\tpublic boolean isDisabled() throws NotesApiException {\n\t\treturn false;\r\n\t}",
"void unsetIsManaged();",
"public JsonFactory disable(JsonGenerator.Feature f)\n/* */ {\n/* 644 */ this._generatorFeatures &= (f.getMask() ^ 0xFFFFFFFF);\n/* 645 */ return this;\n/* */ }",
"@Override\n\tpublic void disabled(AbstractHardware<? extends AbstractHardwareListener> hardware) {\n\t}",
"public void disable(){\n if(criticalStop) return;\n getModel().setStatus(false);\n }",
"public void disableUser(String userId) {\n\t\t\r\n\t}",
"public jpuppeteer.util.XFuture<?> disable() {\n return connection.send(\"Security.disable\", null);\n }",
"public void disable(int timeout) throws Exception {\n session.send(\"HeadlessExperimental.disable\", null, timeout);\n }",
"@Override\n public void onDisable() {\n super.onDisable();\n running = false;\n }",
"@Override\r\n\tpublic void disable() {\n\t\tcurrentState.disable();\r\n\t}",
"void unsetCryptProviderTypeExt();",
"public void unsetExtendable()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(EXTENDABLE$22);\r\n }\r\n }",
"public void disable() {\r\n m_enabled = false;\r\n useOutput(0, 0);\r\n }",
"@Override\n\t\tpublic void onProviderDisabled(String provider) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void onProviderDisabled(String provider) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void onProviderDisabled(String provider) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void onProviderDisabled(String provider) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void onProviderDisabled(String provider) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void onProviderDisabled(String provider) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void onProviderDisabled(String provider) {\n\t\t\t\n\t\t}",
"@FXML\n\tpublic void disableType(ActionEvent event) {\n\t\tif (!txtNameDisableProductType.getText().equals(\"\")) {\n\t\t\tProductType productType = restaurant.returnProductType(txtNameDisableProductType.getText());\n\t\t\tif (productType != null) {\n\t\t\t\ttry {\n\t\t\t\t\tproductType.setCondition(Condition.INACTIVE);\n\t\t\t\t\ttypeOptions.remove(productType.getName());\n\t\t\t\t\trestaurant.saveProductTypeData();\n\t\t\t\t\tDialog<String> dialog = createDialog();\n\t\t\t\t\tdialog.setContentText(\"El tipo de producto ha sido deshabilitado\");\n\t\t\t\t\tdialog.setTitle(\"Tipo de producto Deshabilitado\");\n\t\t\t\t\tdialog.show();\n\t\t\t\t\ttxtNameDisableProductType.setText(\"\");\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tDialog<String> dialog = createDialog();\n\t\t\t\t\tdialog.setContentText(\"No se ha podido guardar el nuevo estado del tipo de producto\");\n\t\t\t\t\tdialog.setTitle(\"Error al guardar datos\");\n\t\t\t\t\tdialog.show();\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tDialog<String> dialog = createDialog();\n\t\t\t\tdialog.setContentText(\"Este tipo de producto no existe\");\n\t\t\t\tdialog.setTitle(\"Error, objeto no existente\");\n\t\t\t\tdialog.show();\n\t\t\t}\n\n\t\t} else {\n\t\t\tDialog<String> dialog = createDialog();\n\t\t\tdialog.setContentText(\"Todos los campos deben de ser llenados\");\n\t\t\tdialog.setTitle(\"Error al guardar datos\");\n\t\t\tdialog.show();\n\t\t}\n\t}",
"private void disablePhotoEditing() {\r\n isEditingPhotos = false;\r\n }",
"protected abstract void switchOffCustom();",
"public void onProviderDisabled(String provider) {\n\t\t\t\n\t\t}",
"public void onProviderDisabled(String provider) {\n\t\t\t\n\t\t}",
"public void onProviderDisabled(String provider) {\n\t\t\t\n\t\t}",
"@Override\n\tpublic String disable() throws Throwable {\n\t\treturn null;\n\t}",
"public void disableCtxMonitoring(CtxAttributeValueType type);",
"void unsetType();",
"@Override\r\n public void onDisabled(Context context) {\n }",
"@Override\r\n public void onDisabled(Context context) {\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}",
"@Override\n\tpublic void onProviderDisabled(String provider) {\n\t\t\n\t}",
"@Override\n\tpublic void onProviderDisabled(String provider) {\n\t\t\n\t}",
"@Override\n\tpublic void onProviderDisabled(String provider) {\n\t\t\n\t}",
"public void disable() {\n\t\tm_enabled = false;\n\t\tuseOutput(0);\n\t}",
"protected void onDisabled() {\n // Do nothing.\n }",
"@Override\n\t public void onProviderDisabled(String provider) \n\t {\n\t \n\t }",
"@Override\r\n\t\tpublic void onProviderDisabled(String provider) {\n\t\t\t\r\n\t\t}"
] | [
"0.6523921",
"0.62238073",
"0.61662656",
"0.5992816",
"0.59595144",
"0.59595144",
"0.58198434",
"0.5815531",
"0.5812521",
"0.57935363",
"0.56790996",
"0.5672179",
"0.5669162",
"0.5662062",
"0.56510514",
"0.5643484",
"0.5604626",
"0.559174",
"0.55483276",
"0.55461365",
"0.55327153",
"0.55327153",
"0.5529868",
"0.5518728",
"0.54955834",
"0.5486358",
"0.54810786",
"0.54407954",
"0.5431991",
"0.5399185",
"0.5387809",
"0.53151864",
"0.52606636",
"0.52444005",
"0.5232003",
"0.5225429",
"0.5200924",
"0.5199998",
"0.51969576",
"0.5195965",
"0.5191846",
"0.5190909",
"0.5190247",
"0.5183789",
"0.5180194",
"0.5171489",
"0.51682484",
"0.5165787",
"0.51389587",
"0.508407",
"0.5082793",
"0.5081697",
"0.50810325",
"0.5080068",
"0.507516",
"0.506839",
"0.5061275",
"0.50376296",
"0.5024394",
"0.50140154",
"0.501206",
"0.50117964",
"0.50088936",
"0.5008198",
"0.5000185",
"0.5000094",
"0.49922502",
"0.49836",
"0.49735457",
"0.4967243",
"0.493705",
"0.4929599",
"0.49284178",
"0.49000612",
"0.48975605",
"0.48975605",
"0.48975605",
"0.48975605",
"0.48975605",
"0.48975605",
"0.48975605",
"0.4895435",
"0.48949075",
"0.48943627",
"0.4893024",
"0.4893024",
"0.4893024",
"0.48891258",
"0.48844483",
"0.4877502",
"0.48723158",
"0.48723158",
"0.4868916",
"0.48678192",
"0.48678192",
"0.48678192",
"0.48645464",
"0.4860799",
"0.48596147",
"0.48594254"
] | 0.57550704 | 10 |
Unlock the object of the configured object type that has the given native identifier. An account is typically locked due to excessive invalid login attempts, whereas a disable is usually performed on accounts that are no longer in use. | public Result unlock(String nativeIdentifier, Map<String, Object> options)
throws ConnectorException, ObjectNotFoundException,
UnsupportedOperationException {
Result result = new Result(Result.Status.Committed);
Map<String, Object> obj = read(nativeIdentifier);
if (null == obj) {
throw new ObjectNotFoundException(nativeIdentifier);
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean unlockDigitalObject(String uuid) throws DatabaseException;",
"public abstract boolean unlock(String oid, String lockKey) throws OIDDoesNotExistException, InvalidLockException;",
"void unlock(Object obj, Object owner)\r\n throws LockNotReleasedException, ClassCastException, ChannelException;",
"void unlock(Object obj, Object owner, boolean releaseMultiLocked)\r\n throws LockNotReleasedException, ClassCastException, ChannelException, LockMultiLockedException;",
"@Override\n public void unlock(int myId) {\n Y = -1; \n flag[myId] = false;\n \n }",
"public abstract void unlock();",
"@Override\n public void unlock() {\n }",
"@Override\n\tpublic void unlock() {\n\t\t\n\t}",
"public void unlock(int key);",
"public abstract Object remove(String oid) throws OIDDoesNotExistException, LockNotAvailableException;",
"public Result disable(String nativeIdentifier, Map<String, Object> options)\n\t\t\tthrows ConnectorException, ObjectNotFoundException {\n\n\t\tdebug();\n\n\t\tif (isDebug == true) {\n\t\t\tlog.debug(\"===== DISABLE ====\");\n\t\t}\n\n\t\tResult result = new Result();\n\n\t\ttry {\n\n\t\t\tString codSistema = \"\", codUsuario = \"\", nomUsuario = \"\", icStatu = \"\", icType = \"\", codSenha = \"\", numPerfil = \"\";\n\t\t\tint operacao = 0;\n\n\t\t\tcodUsuario = nativeIdentifier;\n\n\t\t\tIC_STATUS_ACESSO = \"1\";\n\n\t\t\tif (isDebug == true) {\n\t\t\t\tlog.debug(\"DISABLE\" + \"<CodUsuario: \" + codUsuario + \">\");\n\t\t\t}\n\n\t\t\tdadosConexoes(codUsuario);\n\n\t\t\tnumPerfil = nuPerfil;\n\t\t\tcodSistema = coSistema;\n\n\t\t\tdadosUsuario(codUsuario);\n\n\t\t\tnomUsuario = noUsuario;\n\t\t\ticStatu = \"1\";\n\t\t\ticType = icTipo;\n\t\t\toperacao = 2;\n\n\t\t\tif (isDebug == true) {\n\t\t\t\tlog.debug(\"DISABLE \" + \"<CodUsuario: \" + codUsuario\n\t\t\t\t\t\t+ \"> <CodSistema: \" + codSistema + \"> <nomUsuario: \"\n\t\t\t\t\t\t+ nomUsuario + \"> <icStatu: \" + icStatu + \"> <icType: \"\n\t\t\t\t\t\t+ icType + \"> <codSenha: \" + codSenha\n\t\t\t\t\t\t+ \"> <numPerfil: \" + numPerfil + \"> <operacao: \"\n\t\t\t\t\t\t+ operacao + \">\");\n\t\t\t}\n\n\t\t\tcreateUser(codSistema, codUsuario, nomUsuario, icStatu, icType,\n\t\t\t\t\tcodSenha, numPerfil, operacao);\n\n\t\t\tresult = new Result(Result.Status.Committed);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tresult = new Result(Result.Status.Failed);\n\t\t\tresult.add(\"TIPO APP SIASES DISABLE\" + e);\n\n\t\t\tif (isDebug == true) {\n\t\t\t\tlog.debug(\"ERRO DISABLE SIASE \" + e);\n\t\t\t}\n\n\t\t\tthrow new ConnectorException(\"ERRO DISABEL SIASE \" + e);\n\n\t\t}\n\n\t\treturn result;\n\t}",
"void unlock(Portal portal);",
"public abstract Object remove(String oid, String lockKey) throws OIDDoesNotExistException, InvalidLockException;",
"@Modifying\n\t@Transactional\n\t@Query(value = \"UPDATE classes cl SET cl.locked = :unlock WHERE(cl.class_id = :classId)\", nativeQuery = true)\n\tpublic void unlockClass(@Param(\"classId\") int classId, @Param(\"unlock\") boolean unlock);",
"public final void deactivateAccount() {\n\t\tthis.setIsAccountLocked(true);\n\t}",
"void unlockWriteInOMRequest();",
"public void unlock(String stateName) throws ProcessManagerException {\r\n try {\r\n State state = processModel.getState(stateName);\r\n ((UpdatableProcessInstanceManager) Workflow.getProcessInstanceManager())\r\n .unlock(currentProcessInstance, state, currentUser);\r\n } catch (WorkflowException e) {\r\n throw new ProcessManagerException(\"SessionController\",\r\n \"processManager.ERR_LOCK_FAILED\", e);\r\n }\r\n }",
"public void unlockSimcard() {\n // if sim is locked by Pin , need to unlock it\n Xlog.d(TAG,\"unlockSimcard() ,mITelephony \" + mITelephony);\n try {\n if (mITelephony != null) {\n int simState = FeatureOption.MTK_GEMINI_SUPPORT ?\n (mITelephonyEx.getSimIndicatorState(mSlotId))\n : (mITelephony.getSimIndicatorState());\n if (PhoneConstants.SIM_INDICATOR_LOCKED == simState) {\n mCellConnMgr.handleCellConn(mSlotId, GeminiUtils.PIN1_REQUEST_CODE);\n Xlog.d(TAG,\"Data enable check change request pin , mSlotId \" + mSlotId);\n }\n }\n } catch (RemoteException e) {\n Xlog.e(TAG, \"RemoteException\");\n } catch (NullPointerException ex) {\n Xlog.e(TAG, \"NullPointerException\");\n }\n \n }",
"public static void unlockUser(long matricola) {\n\t\tRequestContent rp = new RequestContent();\n\t\trp.parameters = new Object[] { matricola };\n\t\trp.type = RequestType.UNLOCK_USER;\n\t\tsend(rp);\n\t}",
"@Override\n\tpublic void unlock() {\n\t\tSystem.out.println(\"Card in ATM1 is unlocked !\");\n\t}",
"public void unlock() {\n islandLocked = false;\n }",
"@Override\n\tprotected void unLockNbr() {\n\t\t\n\t}",
"public Response unlock(UriInfo uriInfo, String uuid) {\n try {\n BE entity = getEntityService().getByUuid(uuid);\n if (entity == null) {\n throw new NotFoundException(getString(\"error.entity.notlocked\"));\n }\n lockingService.unlockEntity(entity, true);\n } catch (LockedException ex) {\n throw processLocked(ex);\n }\n // Should be 'no content'??\n return Response.noContent().build();\n }",
"public void unlock() {\n int id = ThreadID.get();\n \n this.levels[id].set(0);\n\n }",
"@Override\n\tpublic void unlockAccount(String username, Map<String, User> map) {\n\t\tUser u = map.get(username);\n\t\tu.setTries(3);\n\t\tuserdata.open();\n\t\tuserdata.updateUser(u);\n\t\tuserdata.close();\n\t}",
"protected void unlockEntry(PersistentEntity persistentEntity, Serializable id) {\n // do nothing\n }",
"public abstract String lock(String oid) throws OIDDoesNotExistException, LockNotAvailableException;",
"private void unlock(APDU apdu) {\r\n\t\tcheckState(STATE_PIN_LOCKED);\r\n\t\tapdu.setIncomingAndReceive();\r\n\t\t// must be secured\r\n\t\tif (!apdu.isSecureMessagingCLA())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// Secured\r\n\t\tprocessSecureMessage(apdu);\r\n\t\t// updating PIN. mPIN transitions to ACTIVE state\r\n\t\tmPIN.update(apdu.getBuffer(), apdu.getOffsetCdata(),\r\n\t\t\t\t(byte) apdu.getIncomingLength());\r\n\t\t// Applet transitions to PERSONALIZED state\r\n\t\tstate = STATE_PERSONALIZED;\r\n\t}",
"public FORCE_UNLOCK_PROPOSAL(String id) { super(id); }",
"@Override\n\tpublic void unLock() {\n\t\t\n\t}",
"void disableDevice(Device device, String token) throws AuthenticationException;",
"private void unlock(UserInputDto inputDto) {\n // Deserialize treadmill status from token\n TreadmillStatus treadmillStatus = deserializeByToken(inputDto.getToken());\n\n // Treadmill is unlocked already\n if (TreadmillStatusEnum.UNLOCKED.getValue().equals(treadmillStatus.getLockStatus())) {\n throw new BizException(\"error.unlocked.already\", \"该跑步机已解锁\");\n }\n\n // Update treadmill status\n treadmillStatus.setAuthType(CommonConstants.DEFAULT_AUTH_TYPE);\n treadmillStatus.setLockStatus(TreadmillStatusEnum.UNLOCKED.getValue());\n treadmillStatus.setCurrentUsrId(CommonConstants.DEFAULT_USERID);\n // Unlock time\n treadmillStatus.setStartTime(new Date());\n treadmillStatus.setDuration(CommonConstants.DEFAULT_DURATION);\n\n // Update redis cache todo Not completed\n redisDbDao.setexBySerialize(TOKEN_PREFIX + inputDto.getToken(), CommonConstants.DEFAULT_DURATION, treadmillStatus);\n }",
"protected void onBSUnlock() {\n\n }",
"@Override\n\tpublic void disable(String id) throws Exception {\n\t\t\n\t}",
"public void unlock(){\n logger.log(Level. INFO,\"unlock() \"+lockState+\".\");\n this.lock.lock();\n logger.log(Level. INFO,\"unlock taking mutex :\"+lockState+\".\");\n switch(this.lockState){\n \t\t\tcase RLT:\n \t\t\tlockState = State.RLC;\n \t\t\tbreak;\n \t\t\tcase WLT:\n \t\t\tlockState = State.WLC;\n \t\t\tcase RLT_WLC:\n \t\t\tlockState = State.WLC;\t\n break;\n default:\n logger.log(Level.WARNING,\"Unlock with : \"+lockState+\".\");\n break;\n \t\t}\n this.available.signal();\t\n logger.log(Level.WARNING,\"SIGNAL\");\n this.lock.unlock();\n \t}",
"void unlockWrite(long stamp);",
"@Override\n public void onUnlock(Myo myo, long timestamp) {\n //mLockStateView.setText(R.string.unlocked);\n }",
"@Override\n public void unlock() {\n Preconditions.checkState(connection != null);\n checkThread();\n unlockLatency.record(() -> {\n if (locked) {\n try {\n Transaction tnx = session.beginTransaction();\n try {\n DbLockRecord record = fetch(session, false, true);\n if (record == null) {\n throw new LockException(\n String.format(\"[%s][%s][%s] Lock record not found.\",\n id().getNamespace(), id().getName(), threadId()));\n }\n if (record.isLocked() && instanceId().compareTo(record.getInstanceId()) == 0) {\n record.setLocked(false);\n record.setInstanceId(null);\n record.setTimestamp(-1);\n\n session.save(record);\n } else {\n long delta = System.currentTimeMillis() - lockedTime;\n if (delta > lockExpiryTimeout()) {\n throw new LockException(\n String.format(\"[%s][%s] Lock expired. [thread=%d]\",\n id().getNamespace(), id().getName(), threadId()));\n }\n throw new LockException(\n String.format(\"[%s][%s] Lock not held by current thread. [thread=%d]\",\n id().getNamespace(), id().getName(), threadId()));\n }\n locked = false;\n tnx.commit();\n } catch (Throwable t) {\n tnx.rollback();\n throw new LockException(t);\n } finally {\n locked = false;\n lockedTime = 0;\n session.clear();\n super.unlock();\n }\n } catch (Exception ex) {\n throw new LockException(ex);\n }\n } else {\n throw new LockException(\n String.format(\"[%s][%s] Lock not held by current thread. [thread=%d]\",\n id().getNamespace(), id().getName(), threadId()));\n }\n });\n }",
"void unsetAccountNumber();",
"public void closeAccount() {}",
"public void closeAccount() {}",
"public static native void unexport(int pin) throws RuntimeException;",
"public boolean unlock(java.lang.String passwordIn)\r\n\t{\r\n\t\tif (password.equals(passwordIn))\r\n\t\t{\r\n\t\t\tlocked = false;\r\n\t\t}\r\n\t\telse \r\n\t\t\tlocked = true;\r\n\t\treturn locked;\r\n\t\t\t\r\n\t}",
"void unlock(String name) {\n executeLockFree(connection -> doUnlock(name, connection));\n }",
"@Override\n\tpublic String unLockAccount(UserModel model, String pwd) {\n\t\tif (userRepo.existsByEmail(model.getEmail())) {\n\t\t\tUserEntity user = userRepo.findByEmail(model.getEmail());\n\t\t\tif (model.getPassword().trim().equals(AESEncyptionAndDecryption.decrypt(user.getPassword()))) {\n\n\t\t\t\tuser.setStatus(ATSConstants.UN_LOCKED);\n\t\t\t\tuser.setPassword(AESEncyptionAndDecryption.encrypt(pwd));\n\t\t\t\tBeanUtils.copyProperties(user, model);\n\t\t\t\tsaveDtls(model);\n\n\t\t\t\treturn ATSConstants.UNLOCKED_SUCCESS;\n\t\t\t}\n\t\t\treturn ATSConstants.TEMP_PWD_INCORRECT;\n\t\t}\n\t\treturn ATSConstants.LOGIN_WRONG_EMAIL;\n\t}",
"public void closeLock(){\n /*Code to send the locking signal to the physical device Gate*/\n }",
"void dispose(Long id) throws RemoteException;",
"public void declinePermission(String objectId, User user) throws UserManagementException;",
"void unlockDoor() {\n }",
"public void unblockBankCard(BankCardTO bankCardTO) throws Exception {\r\n BankCardDAO bankCardDAO = new BankCardDAO();\r\n bankCardTO.setBlockedFlag(0);\r\n bankCardDAO.updateBlockFlag(bankCardTO);//password check here\r\n bankCardDAO.close();\r\n }",
"boolean lockDigitalObject(String uuid, Long id, String description) throws DatabaseException;",
"protected void unlockScreenPinningTest() {\n Parcel data = Parcel.obtain();\n Parcel reply = Parcel.obtain();\n try {\n if (getHWStatusBarService() != null) {\n IBinder statusBarServiceBinder = getHWStatusBarService().asBinder();\n if (statusBarServiceBinder != null) {\n Log.d(TAG, \"Transact unlockScreenPinningTest to status bar service!\");\n data.writeInterfaceToken(\"com.android.internal.statusbar.IStatusBarService\");\n statusBarServiceBinder.transact(111, data, reply, 0);\n }\n }\n reply.recycle();\n data.recycle();\n } catch (RemoteException e) {\n Log.e(TAG, \"transactToStatusBarService->threw remote exception\");\n } catch (Throwable th) {\n reply.recycle();\n data.recycle();\n }\n }",
"public void unlock() {\n setLock.unlock(this);\n }",
"boolean unregister(String identity);",
"public void unlockDevice() {\n ((AndroidDriver) getDriver()).pressKey(new KeyEvent().withKey(AndroidKey.HOME));\n }",
"public void wifiLockUnlock(Context context, boolean unlock)\n {\n\n WifiManager.WifiLock wifiLock = ((WifiManager) context.getSystemService(Context.WIFI_SERVICE))\n .createWifiLock(WifiManager.WIFI_MODE_FULL, \"radioLock\");\n\n if (unlock) {\n if (wifiLock.isHeld()) {\n wifiLock.release();\n }\n } else {\n wifiLock.acquire();\n }\n }",
"public abstract boolean isLocked(String oid);",
"@Override//sinifi olustururken cikan error'a cift tiklayinca otomatik implement ediyor. Tabi parent class abstarct yapildiysa.\n\t\t\tpublic void unlockPhone() {\n\t\t\t\tSystem.out.println(\"to unlock phone we can use faceID or fingerprint\");\n\t\t\t}",
"public abstract void closeAccount();",
"public abstract void Unlock(long offset, long len)\n\t\tthrows IOException, SMBException;",
"@Override\r\n\tpublic ResponseEntity<String> unlockEmployee(int employeeId,String authToken) throws ManualException{\r\n\t\tfinal\tSession session=sessionFactory.openSession();\r\n\t\t\r\n\t\tResponseEntity<String> responseEntity=new ResponseEntity<String>(HttpStatus.BAD_REQUEST);\r\n\t\t\r\n\t\t/* check for authToken of admin */\r\n\t\tsession.beginTransaction();\r\n\t\ttry{\r\n\t\t\tAuthTable authtable=session.get(AuthTable.class, authToken);\r\n\t\t\tUser userAdmin=session.get(User.class, authtable.getUser().getEmpId());\r\n\t\t\tif(userAdmin.getUsertype().equals(\"Admin\")){\r\n\t\t\t\tUser user = session.get(User.class, employeeId);\r\n\t\t\t\tif(user!=null){\r\n\t\t\t\t\tif(!user.getLockStatus().equals(\"unlock\")){\r\n\t\t\t\t\t\tuser.setLockStatus(\"unlock\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t/* entry in operation table */\r\n\t\t\t\t\t\tOperationImpl operationImpl= new OperationImpl();\r\n\t\t\t\t\t\toperationImpl.addOperation(session, userAdmin, \"Unlocked employee \"+user.getName());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tresponseEntity=new ResponseEntity<String>(HttpStatus.OK);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tresponseEntity=new ResponseEntity<String>(HttpStatus.ALREADY_REPORTED);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tresponseEntity=new ResponseEntity<String>(HttpStatus.NOT_FOUND);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tresponseEntity=new ResponseEntity<String>(HttpStatus.UNAUTHORIZED);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tresponseEntity=null;\r\n\t\t}\r\n\t\tfinally{\r\n\t\t\tsession.getTransaction().commit();\r\n\t\t\tsession.close();\r\n\t\t\treturn responseEntity;\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void unlock(Lock lock) {\n\t\tBluetoothLock bluetoothLock=(BluetoothLock)lock;\n\t\t\n\t\tString out=String.format(\"%s%s蓝牙开锁,搜索MAC为%s,pwd:%ssecretKey:%s\", \n\t\t\t\tbluetoothLock.getCompany(),bluetoothLock.getSysCode(),\n\t\t\t\tbluetoothLock.getMac(),bluetoothLock.getPwd(),bluetoothLock.getSecretKey());\n\t\t\n\t\tSystem.out.println(out);\n\t}",
"public abstract boolean delete(String oid) throws OIDDoesNotExistException, LockNotAvailableException;",
"public static void RegUnlock(TargetCode nowTargetCode) {\n\t\tMethodTable mt = nowTargetCode.getMethodTable();\n\t\tint paramReg = mt.getRegNum()-mt.getParamLength();\n\t\tfor (int j = 0; j < nowTargetCode.codeSize(); j++) {\n\t\t\tCode code = nowTargetCode.getCodeByIndex(j);\n\t\t\tfor (String key: ISA.getRegKey(code)) {\n\t\t\t\tString value = code.getParamTable().get(key);\n\t\t\t\tif (value != null && !TypeChange.isInt(value)) {\n\t\t\t\t\tif (value.equals(\"this\")) {\n\t\t\t\t\t\tcode.getParamTable().put(key, paramReg-1+\"\");\n\t\t\t\t\t\tmt.setThisRegisterNumber(paramReg-1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tint paramIdx;\n\t\t\t\t\t\tfor (paramIdx = 0; paramIdx < mt.getParamLength(); paramIdx++) {\n\t\t\t\t\t\t\tif (mt.getParamType(paramIdx).getVarName().equals(value)) break;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmt.getParamType(paramIdx).setReg(paramReg+paramIdx+\"\");\n\t\t\t\t\t\tcode.getParamTable().put(key, paramReg+paramIdx+\"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"UnlockCommand(String door, String key){\r\n this.key = key;\r\n this.door = door;\r\n }",
"void unlock(String resourceName) throws InterruptedException;",
"public void unlockDoor(nodePositions side) {\n lockedDoors[side.getNumVal()] = false;\n }",
"public void unRegister(GameObject gameObject) {\r\n\t\tsuper.unRegister((Object)gameObject);\r\n\t}",
"void setAccountNonLocked(boolean accountNonLocked);",
"@Override\n\tpublic void unlockAchievementGPGS(String achievementId) {\n\t}",
"public void unlockSkill() {\n int i = 0;\n while (skills.get(i).isUnlocked()) {\n i = i + 1;\n }\n skills.get(i).unlock();\n }",
"public final void unlockObjects(ArrayList<String> ids) {\n lockedActorIDs.removeAll(ids);\n }",
"void unlockLastInode();",
"public void setScreenUnlockSecurityNone() {\n // try {\n // new LockPatternUtils(mContext).clearLock();\n // } catch (Exception e) {\n // // e.printStackTrace();\n // }\n }",
"public void unlock() {\n try {\n if (lock != null)\n lock.release();\n if (channel != null)\n channel.close();\n }\n catch (Exception e) {\n throw new ReviewedStingException(\"An error occurred while unlocking file\", e);\n }\n }",
"void unlockRead(long stamp);",
"public void disable()\n {\n openGate = null;\n }",
"public void service(HttpServletRequest request,\r\n HttpServletResponse response, DavisSession davisSession)\r\n throws ServletException, IOException {\r\n LockManager lockManager = getLockManager();\r\n if (lockManager == null) {\r\n response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED,\r\n DavisUtilities.getResource(DefaultUnlockHandler.class,\r\n \"noLockManager\", null, request.getLocale()));\r\n return;\r\n }\r\n IRODSFile file = getIRODSFile(request, davisSession);\r\n Log.log(Log.DEBUG, \"UNLOCK Request for resource \\\"{0}\\\".\", file);\r\n int result = checkLockOwnership(request, file);\r\n if (result != HttpServletResponse.SC_OK) {\r\n response.sendError(result);\r\n return;\r\n }\r\n result = checkConditionalRequest(request, davisSession, file);\r\n if (result != HttpServletResponse.SC_OK) {\r\n response.setStatus(result);\r\n response.flushBuffer();\r\n return;\r\n }\r\n String lockToken = request.getHeader(\"Lock-Token\");\r\n if (lockToken == null || !((lockToken = lockToken.trim()).startsWith(\r\n \"<\") && lockToken.endsWith(\">\"))) {\r\n Log.log(Log.INFORMATION,\r\n \"Invalid lock token presented to UNLOCK: {0}\", lockToken);\r\n response.setStatus(HttpServletResponse.SC_BAD_REQUEST);\r\n response.flushBuffer();\r\n return;\r\n }\r\n lockToken = lockToken.substring(1, lockToken.length() - 1);\r\n try {\r\n lockManager.unlock(file, getPrincipal(request), lockToken);\r\n response.setStatus(HttpServletResponse.SC_NO_CONTENT);\r\n } catch (LockException ex) {\r\n response.setStatus(ex.getStatus());\r\n }\r\n response.flushBuffer();\r\n }",
"public void unlockCashDrawer(CashDrawer cd, String documentId);",
"public int overrideUnlock(EntityPlayer player) {\n return 0;\n }",
"public abstract boolean delete(String oid, String lockKey) throws OIDDoesNotExistException, InvalidLockException;",
"public void switchOff() throws RemoteHomeConnectionException {\n m.sendCommand(parseDeviceIdForMultipleDevice(getRealDeviceId()), \"l\"+getSubDeviceNumber()+\"f\");\n setCurrentState(false);\n }",
"private native void nativeUnregisterTexture(long j, long j2);",
"public void onUnblock();",
"public void unlockSpecials() {\n\t\tif (specialUnlocked) {\n\t\t\treturn;\n\t\t}\n\t\tList<ItemType> items = new ArrayList<>();\n\t\t// Adding all the defined special items in SpecialType enumerate class\n\t\tfor (SpecialType spec : SpecialType.values()) {\n\t\t\titems.add(spec);\n\t\t}\n\t\tthis.specialUnlocked = true;\n\t\tupdateShop(items, 0);\n\t}",
"private static native void delete(long nativeObj);",
"private static native void delete(long nativeObj);",
"private static native void delete(long nativeObj);",
"private static native void delete(long nativeObj);",
"private static native void delete(long nativeObj);",
"private static native void delete(long nativeObj);",
"private static native void delete(long nativeObj);",
"private static native void delete(long nativeObj);",
"void releaseLock(QName lockQName, String lockToken);",
"void unlockDoor(String s) {\n }",
"public void unlockArmours(int level) {\n\t\tif (level <= armourLevel) {\n\t\t\treturn;\n\t\t}\n\t\tList<ItemType> items = new ArrayList<>();\n\t\t// Adding all the defined weapons in WeaponType enumerate class\n\t\tfor (ArmourType armour : ArmourType.values()) {\n\t\t\titems.add(armour);\n\t\t}\n\t\tupdateShop(items, level);\n\t\tarmourLevel = level;\n\t}",
"@Override\n\t\tpublic void onUnblock(User arg0, User arg1) {\n\t\t\t\n\t\t}",
"public void leaveBridge() {\n lock.unlock();\n }",
"private static void j_unlock() {\r\n\t\tFileChannel channel = globalFileChannel;\r\n\t\tFileLock lock = globalFileLock;\r\n\t\tglobalFileChannel = null;\r\n\t\tglobalFileLock = null;\r\n\t\ttry {\r\n\t\t\tlock.release();\r\n\t\t} catch (Throwable t) {\r\n\t\t\t;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tchannel.close();\r\n\t\t} catch (Throwable t) {\r\n\t\t\t;\r\n\t\t}\r\n\t}",
"private PluginResult releaseWakeLock() {\n PluginResult result = null;\n\n if( this.wakeLock != null ) {\n this.wakeLock.release();\n this.wakeLock = null;\n\n result = new PluginResult(PluginResult.Status.OK, \"OK\");\n }\n else {\n result = new PluginResult(PluginResult.Status.ILLEGAL_ACCESS_EXCEPTION, \"No WakeLock active - acquire first\");\n }\n\n return result;\n }"
] | [
"0.66902167",
"0.6660836",
"0.62975156",
"0.60808474",
"0.5923382",
"0.5856983",
"0.5669027",
"0.55878705",
"0.55745685",
"0.5564483",
"0.55553377",
"0.55327314",
"0.55036867",
"0.54879254",
"0.5442751",
"0.54049",
"0.53852826",
"0.534574",
"0.5298095",
"0.5296095",
"0.5283089",
"0.5250277",
"0.5248929",
"0.52038807",
"0.5178789",
"0.51717883",
"0.515579",
"0.5127898",
"0.5120331",
"0.5105581",
"0.5058461",
"0.50446963",
"0.50412196",
"0.50310975",
"0.5014361",
"0.50067544",
"0.4991215",
"0.49848896",
"0.49822605",
"0.49669343",
"0.49669343",
"0.49641386",
"0.49573916",
"0.49474522",
"0.4926428",
"0.4920865",
"0.49194607",
"0.48833042",
"0.4883206",
"0.4872393",
"0.48701224",
"0.4859182",
"0.48591682",
"0.48570845",
"0.48485518",
"0.4846611",
"0.48332995",
"0.4830658",
"0.48273626",
"0.4813181",
"0.4812074",
"0.48096785",
"0.48026428",
"0.4793792",
"0.4777527",
"0.47740763",
"0.47713977",
"0.4754989",
"0.47460645",
"0.47419116",
"0.474008",
"0.47371897",
"0.4732012",
"0.472752",
"0.47213203",
"0.47125906",
"0.47079098",
"0.46982348",
"0.46901116",
"0.46884674",
"0.4686781",
"0.46726644",
"0.466309",
"0.46485275",
"0.46408972",
"0.463935",
"0.463935",
"0.463935",
"0.463935",
"0.463935",
"0.463935",
"0.463935",
"0.463935",
"0.46344876",
"0.46309268",
"0.46234244",
"0.46169183",
"0.4616577",
"0.46013063",
"0.4599809"
] | 0.65222096 | 2 |
Set the password for the given object to the newPassword. The current password may be passed in, but is not typically required. If available, the current password should be passed in, since some resources require this for full behavior around password policy checking, password history, etc... | @SuppressWarnings("static-access")
public Result setPassword(String nativeIdentifier, String newPassword,
String currentPassword, Date expiration, Map<String, Object> options)
throws ConnectorException, ObjectNotFoundException {
debug();
if (isDebug == true) {
log.debug("===== SETPASSWORD ====");
}
Result result = new Result();
try {
String codSistema = "", codUsuario = "", nomUsuario = "", icStatu = "", icType = "", codSenha = "", numPerfil = "", clearPassword = "";
int operacao = 0;
clearPassword = newPassword;
IC_STATUS_ACESSO = "0";
encripta(clearPassword);
codSenha = passowrdCriptografada;
codUsuario = nativeIdentifier;
// session.destroySession(session);
dadosConexoes(codUsuario);
numPerfil = nuPerfil;
codSistema = coSistema;
dadosUsuario(codUsuario);
nomUsuario = noUsuario;
icStatu = "0";
icType = icTipo;
operacao = 2;
if (isDebug == true) {
log.debug("SET PASSWORD" + "<CodUsuario: " + codUsuario
+ "> <CodSistema: " + codSistema + "> <nomUsuario: "
+ nomUsuario + "> <icStatu: " + icStatu + "> <icType: "
+ icType + "> <SenhaCripto: " + codSenha
+ "> <numPerfil: " + numPerfil + "> <operacao: "
+ operacao + ">");
}
createUser(codSistema, codUsuario, nomUsuario, icStatu, icType,
codSenha, numPerfil, operacao);
result = new Result(Result.Status.Committed);
} catch (Exception e) {
e.printStackTrace();
result = new Result(Result.Status.Failed);
result.add("TIPO APP SIASES SET PASSWORD " + e.getMessage());
}
Map<String, Object> obj = read(nativeIdentifier);
if (null == obj) {
throw new ObjectNotFoundException(nativeIdentifier);
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setPassword(java.lang.String newPassword);",
"void setPassword(Password newPassword, String plainPassword) throws NoUserSelectedException;",
"public void setUserPassword(String newPassword) {\n profile.setPassword(currentUser, newPassword);\n }",
"public void setPassword(String newPassword) {\n this.password = newPassword;\n \n //make the changes in the database\n db.updateUserProperty(username, Property.PASSWORD, newPassword);\n }",
"private void setNewPassword(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n newPassword_ = value;\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 setPassword(String password)\r\n/* 26: */ {\r\n/* 27:42 */ this.password = password;\r\n/* 28: */ }",
"@Override\n\tpublic boolean setNewPassword(BigInteger tUserFId,String password) {\n\t\tint res = accountManageDao.updateApplyPwdWithMainUser(tUserFId,password);\n\t\treturn res>0?true:false;\n\t}",
"public void updatePassword(String newPassword) throws SQLException {\n updatePassword(digestPassword(newPassword));\n }",
"public Builder setNewPassword(\n String value) {\n copyOnWrite();\n instance.setNewPassword(value);\n return this;\n }",
"public final void setPwd(final String pwdNew) {\n this.pwd = pwdNew;\n }",
"@Override\r\n\tpublic void modifyPassword(String username, String password, String confirmPassword, String oldPassword) {\n\t}",
"void setPassword(String password);",
"void setPassword(String password);",
"void setPassword(String password);",
"void changePassword(String userName, @Nullable String oldPassword, @Nullable String newPassword) throws PasswordNotMatchException;",
"private void setNewPasswordBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n newPassword_ = value.toStringUtf8();\n }",
"public void changePassword(String passwordChange){\n\t this.password = passwordChange;\n\t}",
"public void updatePassword(String account, String password);",
"public PasswordChangeDTO(String currentPassword, String newPassword) {\n\t\tthis.currentPassword = currentPassword;\n\t\tthis.newPassword = newPassword;\n\t}",
"public void setPassword(String pass);",
"public boolean setPassword(String oldPass, String newPass){\r\n if (oldPass.equals(this.password)){\r\n this.password = newPass;\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }",
"public Builder setPassword(\n String value) {\n copyOnWrite();\n instance.setPassword(value);\n return this;\n }",
"public Builder setPassword(\n String value) {\n copyOnWrite();\n instance.setPassword(value);\n return this;\n }",
"@Override\n\tpublic void updatePassword(Account a, String newPassword) throws SQLException, IllegalArgumentException {\n\t\tif (!isValidAccount(a))\n\t\t\treturn;\n\t\t\n\t\t// Create account, to test it follows proper syntax\n\t\t@SuppressWarnings(\"unused\")\n\t\tAccount tempAccount = new Account(a.getId(), a.getUsername(), newPassword, a.getEmail());\n\t\t\n\t\t// If password is too long, throw error\n\t\tif (newPassword.length() > Account.getMaxString())\n\t\t\tthrow new IllegalArgumentException(\"The password \" + newPassword + \" is too long (\" + newPassword.length() + \" characters), should be less than \" + Account.getMaxString() + \" characters\");\n\n\t\t// Prepare SQL line\n\t\tString sqlQuery = \"UPDATE account \"\n\t\t\t\t+ \"SET password = ? \"\n\t\t\t\t+ \"WHERE id = ?\";\n\t\tPreparedStatement statement = dbConnection.prepareStatement(sqlQuery);\n\t\tstatement.setString(1, newPassword);\n\t\tstatement.setInt(2, a.getId());\n\n\t\t// Execute, throws error if failed\n\t\tstatement.executeUpdate();\n\t\tstatement.close();\n\t}",
"@Override\n\tpublic void setPassword(String password) {\n\n\t}",
"public void enterPasswordInNewPassword(String newPassword) throws UIAutomationException{\r\n\t\r\n\t\telementController.requireElementSmart(fileName,\"New Password Text Field\",GlobalVariables.configuration.getAttrSearchList(), \"New Password\");\r\n\t\tUIActions.click(fileName,\"New Password Text Field\",GlobalVariables.configuration.getAttrSearchList(), \"New Password\");\r\n\t\tUIActions.clearTextBox(fileName,\"New Password Text Field\",GlobalVariables.configuration.getAttrSearchList(), \"New Password\");\r\n\t\tUIActions.enterValueInTextBox(newPassword,fileName,\"New Password Text Field\",GlobalVariables.configuration.getAttrSearchList(), \"New Password\");\r\n\t\tUIActions.enterKey(Keys.TAB);\r\n\t\r\n\t}",
"@Override\n\tpublic void setPassword(String password) {\n\t\tgetInnerObject().setPassword(password);\n\t\t\n\t}",
"public void setPassword(String pw)\n {\n this.password = pw;\n }",
"public ChangePasswordOperation(String username, String newPassword) throws LDAPException {\r\n super(\"1.3.6.1.4.1.4203.1.11.1\", null);\r\n setValue(getEncodedValue(username, newPassword));\r\n }",
"@Override\r\n\tpublic void updatePassword(Integer id, String password) {\n\t\t\r\n\t}",
"public void setPassword(String password)\n {\n _password = password;\n }",
"public void changePassword(String password) {\n userRepository.findOneByLogin(SecurityUtils.getCurrentUserLogin()).ifPresent(user -> {\n String encryptedPassword = passwordEncoder.encode(password);\n user.setPassword(encryptedPassword);\n log.debug(\"Changed password for User: {}\", user);\n });\n }",
"public void updatePassword(byte[] newPassword) throws SQLException {\n boolean success = false;\n Connection conn = null;\n PreparedStatement stmt = null;\n String sqlUpdate = \"UPDATE Member set password=? where LoginName =?\";\n if (log.isInfoEnabled()) log.info(sqlUpdate.toString());\n try {\n conn = PoolManager.getConnection();\n stmt = conn.prepareStatement(sqlUpdate);\n stmt.setBytes(1, newPassword);\n stmt.setString(2, loginName);\n stmt.execute();\n } catch (SQLException se) {\n if (log.isErrorEnabled()) log.error(\"Sql Error on Update Members password\", se);\n throw se;\n } finally {\n try {\n if (stmt != null) {\n stmt.close();\n stmt = null;\n }\n } catch (SQLException se) {\n }\n try {\n if (conn != null) {\n PoolManager.freeConnection(conn);\n conn = null;\n }\n } catch (SQLException se) {\n }\n }\n }",
"public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n password_ = value;\n onChanged();\n return this;\n }",
"public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n password_ = value;\n onChanged();\n return this;\n }",
"public 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 }",
"@Override\n public void changePassword(String oldPassword, String newPassword) {\n debugLogger.finest(\"enter\");\n\n userLogger.info(ErrorPkg.getMessage(\"reconfigure.pw.change.init\", new String[] {\"<<old>>\", \"<<new>>\"},\n new String[] {oldPassword, newPassword}));\n\n sessionPool.empty();\n\n try {\n Session session = SessionFactory.newInstance(properties.getSessionProperties());\n session.changePassword(newPassword);\n // Attempts to get a session between changePassword and setClientPW\n // will fail if the password was successfully changed. It is the\n // application's responsibility to handle transaction failures\n // during a change of password. This is expected to occur very\n // infrequently.\n properties.getSessionProperties().setClientPW(newPassword);\n } catch (Exception ex) {\n userLogger.severe(ex.getMessage());\n userLogger.severe(ErrorPkg.getMessage(\"reconfigure.pw.change.fail\"));\n }\n\n debugLogger.finest(\"exit\");\n }",
"void setPassword(String ps) {\n this.password = ps;\n }",
"void updateUserPassword(User user);",
"@Override\r\n public void changePassword(String password) {\r\n this.studente.setPassword(password);\r\n this.studenteFacade.edit(this.studente);\r\n }",
"public void changePassword(String newPassword, String oldPassword) throws InvalidPasswordException {\n try {\n if (this.password.equals(oldPassword))\n this.password = newPassword;\n else\n throw new InvalidPasswordException();\n }\n catch(InvalidPasswordException e) {\n System.out.println(\"invalid password\"); //mainly for testing purposes\n }\n }",
"public void updatePassword(String newPass, String tablename) {\n \t\ttry {\n\t\t\t\tmyCon.execute(\"UPDATE \" + tablename + \" SET Password= '\" + newPass + \"';\");\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n }",
"public void setPassword2(String password2);",
"public void setPassword(final String password){\n mPassword = password;\n }",
"public String getNewPassword() {\n return newPassword_;\n }",
"public void setAccountPassword(String value) {\n this.accountPassword = value;\n }",
"@Override\r\n\tpublic void upadatePassword(String newPassword, ForgetBean forget) {\r\n\t\tSession session = factory.openSession();\r\n\t\tTransaction txn = session.getTransaction();\r\n\r\n\t\tString sql = \"UPDATE account SET password = '\" + newPassword + \"' WHERE email='\" + forget.getEmail() + \"'\";\r\n\r\n\t\tSQLQuery query = session.createSQLQuery(sql);\r\n\t\tquery.executeUpdate();\r\n\r\n\t}",
"public void setPassword(String p)\n\t{\n\t\tpassword = p;\n\t}",
"public void setPassword(java.lang.String param) {\r\n localPasswordTracker = param != null;\r\n\r\n this.localPassword = param;\r\n }",
"public synchronized void modifyPassword(String userName, String currentUserPassword, String newPassword) throws AmbariException {\n\n SecurityContext securityContext = SecurityContextHolder.getContext();\n String currentUserName = securityContext.getAuthentication().getName();\n if (currentUserName == null) {\n throw new AmbariException(\"Authentication required. Please sign in.\");\n }\n\n UserEntity currentUserEntity = userDAO.findLocalUserByName(currentUserName);\n\n //Authenticate LDAP admin user\n boolean isLdapAdmin = false;\n if (currentUserEntity == null) {\n currentUserEntity = userDAO.findLdapUserByName(currentUserName);\n try {\n ldapAuthenticationProvider.authenticate(\n new UsernamePasswordAuthenticationToken(currentUserName, currentUserPassword));\n isLdapAdmin = true;\n } catch (BadCredentialsException ex) {\n throw new AmbariException(\"Incorrect password provided for LDAP user \" +\n currentUserName);\n }\n }\n\n UserEntity userEntity = userDAO.findLocalUserByName(userName);\n\n if ((userEntity != null) && (currentUserEntity != null)) {\n if (isLdapAdmin || passwordEncoder.matches(currentUserPassword, currentUserEntity.getUserPassword())) {\n userEntity.setUserPassword(passwordEncoder.encode(newPassword));\n userDAO.merge(userEntity);\n } else {\n throw new AmbariException(\"Wrong password provided\");\n }\n\n } else {\n userEntity = userDAO.findLdapUserByName(userName);\n if (userEntity != null) {\n throw new AmbariException(\"Password of LDAP user cannot be modified\");\n } else {\n throw new AmbariException(\"User \" + userName + \" not found\");\n }\n }\n }",
"public void changePassword(String account_name, String newPassword){\n //hashe the password\n newPassword = hashPassword(newPassword);\n try {\n statement = connection.createStatement();\n statement.executeUpdate(\"UPDATE members SET password='\"+newPassword+\"' WHERE\" +\n \" name='\"+account_name+\"'\");\n }catch (SQLException ex){ex.printStackTrace();}\n }",
"public void setPassword(String password)\n {\n _password = password;\n }",
"@ApiOperation(\n value = \"${swagger.operations.set-new-password.description}\"\n )\n @ApiResponses({\n @ApiResponse(code = 503, message = \"Service Unavailable Error (AWS Cognito)\"),\n @ApiResponse(code = 500, message = \"Internal Server Error / No message available\"),\n @ApiResponse(code = 422, message = \"Password update failed.\"),\n @ApiResponse(code = 400, message = \"Invalid parameters or missing correlation ID\"),\n @ApiResponse(code = 204, message = \"Password successfully updated\")\n })\n @ApiImplicitParams({\n @ApiImplicitParam(name = X_CORRELATION_ID_HEADER,\n required = true,\n value = \"UUID formatted string to track the request through the enquiries stack\",\n paramType = \"header\"),\n })\n @PutMapping(PasswordController.SET_PATH)\n ResponseEntity<Void> setPassword(@RequestBody SetPasswordRequest setPasswordRequest);",
"public Builder setPassword(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n password_ = value;\n onChanged();\n return this;\n }",
"public void setPassword(String p) {\n\t\tpassword = p;\n\t}",
"public void setPassword(String password) {\n this.password = password;\n saveProperties();\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}",
"public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n onChanged();\n return this;\n }",
"public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n onChanged();\n return this;\n }",
"public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n onChanged();\n return this;\n }",
"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 }",
"private void changePassword(String newPassword) {\n FirebaseUser firebaseUser = mAuth.getCurrentUser();\n firebaseUser.updatePassword(newPassword).addOnCompleteListener(this, new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Toast.makeText(ProfileSettingsActivity.this, PASSWORD_CHANGED_SUCCESSFUL, Toast.LENGTH_LONG).show();\n }\n }\n });\n }",
"public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n password_ = value;\n onChanged();\n return this;\n }",
"public void setPassword(String password) throws SQLException\r\n\t{\r\n\t\tif (password == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tString SQL_USER = \"UPDATE user SET password =? WHERE id=?;\";\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//Prepare the statement\r\n\t\t\tPreparedStatement statement = this.getConn().prepareStatement(SQL_USER);\r\n\r\n\t\t\t//Bind the variables\r\n\t\t\tstatement.setString(1, password);\r\n\t\t\tstatement.setInt(2, userId);\r\n\r\n\t\t\t//Execute the update\r\n\t\t\tstatement.executeUpdate();\r\n\r\n\t\t} catch (SQLException e)\r\n\t\t{\r\n\t\t\tGWT.log(\"Error in SQL: Student->setPassword(String \"+ password+ \")\", e);\r\n\t\t\tthis.getConn().rollback();\r\n\t\t\tthrow e;\t\r\n\t\t}\r\n\t\t\r\n\t\t//commit change\r\n\t\tDatabase.get().commit();\r\n\t}",
"public void setPasswordField(final JPasswordField pwPasswordParam) {\n this.pwPassword = pwPasswordParam;\n }",
"public void setPassword(java.lang.String param) {\n localPasswordTracker = true;\n\n this.localPassword = param;\n }",
"public void changePasswort(String newpassword) {\n\n\t\ttry {\n\t\t\tchatConnection.changePassword(newpassword);\n\t\t\tconnectionconfig.setPasswd(newpassword);\n\t\t\t\n\t\t} catch (Exception e) {\n\n\t\t\t//System.out.println(e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\t\n\t}",
"public void setOldPassword(String oldPassword) {\n this.oldPassword = oldPassword;\n }",
"private void clearNewPassword() {\n \n newPassword_ = getDefaultInstance().getNewPassword();\n }",
"public Builder setNewPasswordBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setNewPasswordBytes(value);\n return this;\n }",
"public void setPassword(String password){\n this.password = encryptPassword(password);\n checkRep();\n }",
"public void setPassword(String password)\n \t{\n \t\tthis.password = password;\n \t}",
"public void setPassword(String paramPasswd) {\n\tstrPasswd = paramPasswd;\n }",
"public String setPassword(Long id, String password){\n return newUserCreator.setPassword(id, password);\n }",
"public void setPassword(String password) {\n this.password.set(password);\n }",
"public void setPassword(String password){\r\n this.password = password;\r\n }",
"@Override\n\tpublic void setPlainPassword(String arg0) {\n\t\t\n\t}",
"@Test\n public void testAccountSetPassword() {\n try {\n Account newAcc = new Account(1, \"holder\", \"holder\", Credential.ADMIN);\n newAcc.setPassword(\"newPasswordForHolder\");\n Assert.assertEquals(\"Incorrect updated password for account after changing\",\n \"newPasswordForHolder\", newAcc.getPassword());\n } catch (Exception e) {\n Assert.fail(\"Set account password should not have failed here\");\n e.printStackTrace();\n }\n }",
"public void setUserPassword(String login, String oldPassword, String newPassword) throws EOSForbiddenException,\n\t\t\tEOSUnauthorizedException, EOSValidationException;",
"public void update() {\n user.setNewPassword(newPassword.getText().toString());\n user.setPassword(password.getText().toString());\n reauthenticate();\n }",
"public void setPassword(String strPassword){\n\t\tdriver.findElement(password99Guru).sendKeys(strPassword);\n\t}",
"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 }",
"private void changePassword(final String password) throws ParseException{\n executeRequest((BoxRequestItem)getCreatedSharedLinkRequest().setPassword(password));\n }",
"public void setPassword(String password)\n {\n this.password = password;\n }",
"@Test\n\tpublic void testSetPassword() {\n\t\tUser user = new User();\n\t\tuser.setPassword(\"TuEsOuPassword\");\n\t\tassertEquals(\"TuEsOuPassword\", user.getPassword());\n\t}",
"public void setPassword(String text) {\n txtPassword().setText(text);\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 {\r\n this.password = password;\r\n }",
"public void setPassword(String strPassword){\n \t \n \tdriver.findElement(By.cssSelector(inputPassword)).sendKeys(strPassword);\n \n \n }",
"public void changePassword(final String newPassword, final String currentPassword){\n new Thread(){\n @Override\n public void run() {\n super.run();\n AccountIOT accountIOT = new AccountIOT(ChangePasswordActivity.this);\n try {\n boolean result = accountIOT.checkPassword(currentPassword, newPassword);\n\n //Create data send to MainActivity\n Bundle bundle = new Bundle();\n bundle.putBoolean(\"changed\", result);\n\n Message message = Message.obtain();\n message.setData(bundle);\n\n handler.sendMessage(message);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }\n }.start();\n }",
"public void setPassword (java.lang.String password) {\r\n\t\tthis.password = password;\r\n\t}",
"public void setPassword(String password)\n {\n this.password = password;\n }",
"public void setPassword(String password)\n {\n this.password = password;\n }",
"public Password(String password) {\n if (isValid(password)) {\n this.password = password;\n //this.date =date;\n\n this.setActive(true);\n } else {\n this.password = null;\n }\n }"
] | [
"0.81835973",
"0.8052253",
"0.7658924",
"0.7541517",
"0.7402248",
"0.7324799",
"0.7229032",
"0.7220429",
"0.7143196",
"0.7122566",
"0.7077429",
"0.70550907",
"0.70520526",
"0.70520526",
"0.70520526",
"0.69945943",
"0.6971595",
"0.6918752",
"0.68960005",
"0.6892403",
"0.68498147",
"0.6811995",
"0.6798102",
"0.6798102",
"0.6755838",
"0.6743088",
"0.67203087",
"0.6702771",
"0.66831344",
"0.66511923",
"0.664322",
"0.66355485",
"0.66301244",
"0.65879726",
"0.6582214",
"0.6582214",
"0.6561391",
"0.6543796",
"0.6543462",
"0.6543461",
"0.65358025",
"0.651784",
"0.65166485",
"0.65165824",
"0.65155315",
"0.6503876",
"0.64981985",
"0.6493883",
"0.64852095",
"0.6475117",
"0.64734584",
"0.64719784",
"0.64632875",
"0.6450063",
"0.64467376",
"0.64429253",
"0.64378107",
"0.642681",
"0.6421535",
"0.6421535",
"0.6421419",
"0.6421419",
"0.6421419",
"0.64180744",
"0.64180744",
"0.64114726",
"0.63986355",
"0.63978505",
"0.6396885",
"0.6394359",
"0.6392169",
"0.6389995",
"0.6389583",
"0.63797915",
"0.63788617",
"0.6373225",
"0.63718486",
"0.6356684",
"0.63481694",
"0.6345011",
"0.6343646",
"0.6343252",
"0.6339233",
"0.63347983",
"0.6332721",
"0.632837",
"0.632837",
"0.63268024",
"0.63183206",
"0.631445",
"0.63120204",
"0.6310827",
"0.6310827",
"0.6308744",
"0.62964755",
"0.629533",
"0.6294328",
"0.6294276",
"0.6294276",
"0.6292027"
] | 0.65946627 | 33 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.