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
Moving on the x axis.
@Override public void keyPressed(KeyEvent e) { if((e.getKeyCode() == KeyEvent.VK_D) || e.getKeyCode() == (KeyEvent.VK_RIGHT)) pl.moveXspeed += pl.accelXspeed; else if(e.getKeyCode() == (KeyEvent.VK_A) || e.getKeyCode() == (KeyEvent.VK_LEFT)) pl.moveXspeed -= pl.accelXspeed; // Moving on the y axis. if(e.getKeyCode() == (KeyEvent.VK_W) || e.getKeyCode() == (KeyEvent.VK_UP)) pl.moveYspeed -= pl.accelYspeed; else if(e.getKeyCode() == (KeyEvent.VK_S) || e.getKeyCode() == (KeyEvent.VK_DOWN)) pl.moveYspeed += pl.accelYspeed; else { } if (GameOn == true){ } else if (GameOn == false ) { repaint(); Data = " Number of rockets remaining: " + pl.NumRockets + "Number of bullets remaining: " +pl.NumBullets + " Remaining health: " +pl.Health +" Number of runway enemies: " + RunAwayEnemies + " Number of destroyed enemies: " +DestroyedEnemies; Email = new EmailGUI(Data); } /* else if (WinsState == true ) { repaint(); //*******************stoip game here and send email with game details Data = " Number of rockets remaining: " + pl.NumRockets +"," + " Number of bullets remaining: " +pl.NumBullets+"," + " Remaining health: " +pl.Health+"," + " Number of destroyed enemies: " +DestroyedEnemies+"," +" Number of runway enemies: " + RunAwayEnemies; Email = new EmailGUI(Data); }*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void moveX() {\n\t\tsetX( getX() + getVx() );\n\t}", "default void setX(double x)\n {\n getAxis().setX(x);\n }", "@Override\n\tpublic void move_x() {\n\t\tif(mX < 0){\n\t \tdirection *= -1 ;\n\t \t setScale(-1, 1);\n\t }else if (mX > activity.getCameraWidth()-64){\n\t \tdirection *= -1 ;\n\t \tsetScale(1, 1);\n\t } \n\t\tmove_x(direction);\n\t}", "public void setXPos(int x) {\n // from MoveEventHandler\n // convert to real x coord\n // x = xP * (xmaxr - xminR) / (xmaxP - xminP)\n double tmp = config.getMaximumRealX() + (x - config.getMaximumPixelX())*(config.getMaximumRealX() - config.getMinimumRealX())/(config.getMaximumPixelX() - config.getMinimumPixelX());\n xpos.setText(formatter.format(tmp));\n }", "private void setXAxis() {\n XAxis xAxis = mChart.getXAxis();\n xAxis.setGranularity(1f);\n xAxis.setGranularityEnabled(true);\n xAxis.setCenterAxisLabels(false);\n xAxis.setDrawGridLines(false);\n xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);\n xAxis.setValueFormatter(new IndexAxisValueFormatter(getXAxisValues()));\n xAxis.setLabelCount(30);\n }", "public void setXPosition(double x)\n\t{\n\t\tthis.xPosition = x;\n\t}", "public void setX(int x) {\n synchronized (this.xLock) {\n this.movementComposer.setXPosition(x);\n }\n }", "public void moveLeft() {\r\n\t\tif (x > 0) x--; \r\n\t}", "@Override\n\tpublic void setX(int x) {\n\t\txPos = x;\n\t}", "public void checkXAxis ()\n {\n if (player.getX() >= 599)\n {\n player.setLocation (0, player.getY());\n }\n else if (player.getX() <= 0)\n {\n player.setLocation (598, player.getY());\n }\n }", "public void moveX(double x) {\n this.x += x;\n }", "public final MotionUpdateEvent setX(double x) {\n pos.setX(x);\n return this;\n }", "public void setxPos(int xPos) {\r\n \tthis.xPos = xPos;\r\n }", "public void setX(int x)\n\t{\n\t\tgetWorldPosition().setX(x);\n\t}", "public void moveLeft() {\n this.accelerateXL();\n this.moveX(this.getxSpeed());\n this.setPicX(0);\n this.setPicY(141);\n this.setLoopCells(true);\n }", "private void move(double newXPos){\n this.setX(newXPos);\n }", "public void moveLeft()\n {\n if (!this.search_zone.isLeftBorder(this.x_position))\n {\n this.x_position = (this.x_position - 1);\n }\n }", "public void setXPos(int xPos) {\r\n\t\tthis.xPos = xPos;\r\n\t}", "public void moveLeft()\n {\n if (xPos == 0)\n {\n movementY = 0;\n movementX = 0;\n }\n\n // Set the movement factor - negative X because we are moving LEFT! \n movementX = -0.5;\n movementY = 0;\n }", "public void moveLeft() {\n\t\tsetPosX(getPosX() - steps);\n\t}", "@Override\n public void moveX(int delta, int direction) {\n this.setX(this.getX() + delta * BIKE_SPEED * direction);\n }", "private void moveLeft(){\n \n setGlobalLocation(getGlobalX() - speed, getGlobalY());\n animationSpeedLeft();\n }", "public void moveLeft() {\n this.x -= 10;\n repaint();\n }", "public void setPositionX(float x) {\n\t\tthis.position.set(x, this.position.y, 0);\n\t}", "public void moveLeft() {\n if (xcoor >= movingSpeed) {\n xcoor = xcoor - movingSpeed * 2;\n }\n }", "public void setX(float x) {\r\n\t\tleft = x - width / 2;\r\n\t}", "public void moveLeft()\n\t{\n\t\tx = x - STEP_SIZE;\n\t}", "public void setXPos(int xPos) {\n\t\tthis.xPos=xPos;\n\t}", "public void translateX(float x) {\n if (collides((int) (this.x + x), (int) y)) return;\n this.x += x;\n this.model.setX(this.x);\n }", "@Override\r\n\tpublic void setX(float x) {\n\t\t\r\n\t}", "void setX(int x) {\n position = position.setX(x);\n }", "void moveLeft() {\n\t\tsetX(x-1);\r\n\t\tdx=-1;\r\n\t\tdy=0;\r\n\t}", "public void setxPos(int xPos) {\n\t\tthis.xPos = xPos;\n\t}", "public void setxPos(int xPos) \n\t{\n\t\tthis.xPos = xPos;\n\t}", "void setX(int newX) {\n this.xPos = newX;\n }", "public void setxPosition(int xPosition) {\n\t\tthis.xPosition = xPosition;\n\t}", "@Override\n public void mouseMoved(MouseEvent e) {\n mouseXPosition = e.getX();\n }", "public void moveHorizontal(int x)\n {\n wall.moveHorizontal(x);\n roof.moveHorizontal(x);\n window.moveHorizontal(x);\n }", "public void setStartX(double x)\n {\n startxcoord=x; \n }", "public void setX(Float x) {\n\t\tthis.x = x;\n\t}", "public void setX(int x)\n\t{\n\t\tthis.x = x;\t\t\t\t\t\t\t\t\t\t\t\t\t// Update point's x-coordinate\n\t}", "public void setX(float x) {\r\n\t\tthis.x = x;\r\n\t}", "@Override\n\tpublic void setX(float x) {\n\n\t}", "public void setX( int x ) {\n\t\t//not checking if x is valid because that depends on the coordinate system\n\t\tthis.x = x;\n\t}", "void moveX(float x) {\n _x += x;\n }", "public void setMovementX(int directionX) {\r\n movementX = directionX;\r\n }", "@Override\n\tpublic void setX(float x) \n\t{\n\t\t_x = x;\n\t}", "public void setX(double value) {\n origin.setX(value);\n }", "@Override\n\tpublic void moveXUnder(XAxisNode newXParent) {\n\t}", "public void moveLeft() {\n\t\tposX -= speed;\n\t}", "public void setXCoordinate(int newValue)\n {\n x = newValue;\n }", "public void scrollToXPos(int x) {\n horizontalScroll = x;\n repaint();\n }", "public void move()\n\t{\n\t\tx = x + dx;\n\t}", "public void move()\n\t{\n\t\tx = x + logDx;\n\t}", "public void setXLeft(int left) {\n this.xLeft = left;\n }", "public float getPositionX() {return this.position.getX();}", "public void moveLeft() {\r\n\t\t\r\n\t\tint leftSteps=10;\r\n\t\t\ttopX-= leftSteps;\r\n\t}", "public void setX() {\n m_frontLeft.setDesiredState(new SwerveModuleState(0, Rotation2d.fromDegrees(45)));\n m_frontRight.setDesiredState(new SwerveModuleState(0, Rotation2d.fromDegrees(-45)));\n m_rearLeft.setDesiredState(new SwerveModuleState(0, Rotation2d.fromDegrees(-45)));\n m_rearRight.setDesiredState(new SwerveModuleState(0, Rotation2d.fromDegrees(45)));\n }", "public void xDelta(float x_delta)\n {\n super.setX(super.getX() + x_delta);\n }", "public void setX(float x)\n {\n getBounds().offsetTo(x - positionAnchor.x, getBounds().top);\n notifyParentOfPositionChange();\n conditionallyRelayout();\n }", "public void setX(float x) {\n this.x = x;\n }", "public void setX(int xpos) {\r\n this.xpos = xpos;\r\n }", "public void resetXMovement() {\n this.xVel = 0;\n this.xTargetSpeed = 0;\n }", "public void setPosX(double posX) {\n\t\tthis.PosX = posX;\r\n\t}", "public void setStartX(float startX) {this.startX = startX;}", "public void setX(double value) {\n\t\t\t\tthis.x = value;\n\t\t\t}", "public void setXPosition( int xCoordinate ) {\n xPosition = xCoordinate;\n }", "public void setxBegin(Float xBegin) {\r\n this.xBegin = xBegin;\r\n }", "public void setPosX(float posX) {\n this.posX = posX;\n }", "public void setXOffset(float xOffset) {\n pos.x = xOffset;\n invalidate();\n }", "public void updatePlayerXPos(){\n\t\tif(goRight&&Player.getxPlayerLoc()<=(screenWidth - (Player.getPlayerImage().getWidth()* Player.getPlayerScale() ) ) ){\n\t\t\tPlayer.updateXPos(true);\n\t\t\tPlayer.setPlayerImage(true);\n\t\t\t\n\t\t}\n\t\tif(goLeft&&Player.getxPlayerLoc() >=( (Player.getPlayerImage().getWidth() / 2) * Player.getPlayerScale() ) ){\n\t\t\tPlayer.updateXPos(false);\n\t\t\tPlayer.setPlayerImage(false);\n\t\t}\n\t}", "void setPlayerXRelative(int x) {\n }", "public void move() {\r\n\t\tx = x + speed;\r\n\t}", "public void setX(double x)\r\n\t{\t\r\n\t\tvirtualDxfPoint.setTransformationX(x);\r\n\t\tAnchor.setX(x);\r\n\t}", "@Override\n\tpublic float getX() {\n\t\treturn lilyPosX;\n\t}", "public boolean incrementX()\n {\n return setPosition(this.position.getXPosition() + 1, this.position.getYPosition());\n }", "public void resetX() {this.startX = 0f;}", "public PlotPosition setX( double x )\n {\n return setX( x, 1 );\n }", "private void inc_x()\n {\n synchronized(mLock_IndexX) { set_x(get_x() + 1); }\n }", "public Builder setPositionX(double value) {\n bitField0_ |= 0x00000004;\n positionX_ = value;\n onChanged();\n return this;\n }", "@Override\r\n\tpublic void tick() {\r\n\t\tx+=speed;\r\n\t}", "@Override\r\n\tpublic void setPositionX(int x) {\n\t\tif (!(x >= 0))\r\n\t\t\tthrow new PreConditionError(\"Error PreCondition: x >= 0\");\r\n\r\n\t\tcheckInvariant();\r\n\r\n\t\tsuper.setPositionX(x);\r\n\r\n\t\tcheckInvariant();\r\n\r\n\t\t// post: getPositionX() == x\r\n\t\tif (!(getPositionX() == x))\r\n\t\t\tthrow new PostConditionError(\"Error PostCondition: getPositionX() == x\");\r\n\t}", "public void moveX(){\n\t\tfor(int i = 0; i < level.solids.size(); i++){\n\t\t\tBlock solid = level.solids.get(i);\n\t\t\tif(solid != this && isColliding(solid, x, y)){\n\t\t\t\tif(solid.type.equals(\"Projectile\") && this.type.equals(\"Projectile\")){\n\t\t\t\t\tPlayer parent = ((Projectile)this).parent;\n\t\t\t\t\tPlayer other = ((Projectile)solid).parent;\n\n\t\t\t\t\tif(parent != other){ \n\t\t\t\t\t\tstun(parent);\n\t\t\t\t\t\tstun(other);\n\t\t\t\t\t}\n\n\t\t\t\t\tlevel.solids.remove(this);\n\t\t\t\t\tlevel.solids.remove(solid);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(solid.type.equals(\"Hitbox\")){\n\t\t\t\t\tif(solid != parent.hitbox){\n\t\t\t\t\t\tdouble dist = Math.abs(solid.x - this.x);\n\t\t\t\t\t\tfor(int n = 1; n <= dist && !isColliding(solid, x + Math.signum(velX), y) && Math.signum(velX) != 0; n++){\n\t\t\t\t\t\t\tx += Math.signum(velX);\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\trelativeX += velX;\n\t\tvelX += accelX;\n\t\tx = (float) (parent.x + parent.hitbox.width / 2.0 + relativeX); //start it at the center of the player's hitbox, then move to its relative x\n\t}", "public void setX(int position) {\r\n\t\tif(position<5 && position>=0) {\r\n\t\t\tthis.xcoord = position;\r\n\t\t}\r\n\t\telse {\r\n\t\t\trandomX();\r\n\t\t}\r\n\t}", "public void moveLeft() {\n Coordinate leftCoord = new Coordinate(getX() - 1, getY());\n handleMove(leftCoord, InteractionHandler.LEFT);\n }", "public final float getPositionX() {\r\n\t\treturn getState(false).getPositionX();\r\n\t}", "public void setX(double value) {\n\t\tthis.x = value;\n\t}", "public Builder setPositionX(double value) {\n bitField0_ |= 0x00000008;\n positionX_ = value;\n onChanged();\n return this;\n }", "public void moveX(int dir) { velocity.add(PVector.mult(right, speed * dir)); }", "public float getxPosition() {\n return xPosition;\n }", "public void onTranslateHorizontal(float xPos) {\n float xOffset = xPos - fptStart.x;\n translate(xOffset, 0);\n }", "public void move() {\r\n\r\n\t\tif(x < 0) {\r\n\t\t\tx = 400;\r\n\t\t}\r\n\r\n\t\t// factor for speed increase\r\n\t\tx -= 1 * factor;\r\n\t}", "public double getPositionX() {\n return positionX_;\n }", "public double getPositionX() {\n return positionX_;\n }", "public double getPositionX() {\n return positionX_;\n }", "public Builder setPositionX(double value) {\n bitField0_ |= 0x00000040;\n positionX_ = value;\n onChanged();\n return this;\n }", "public void setX(double x) {\n\t\tthis.x = x;\n\t}", "protected void setX(final Number x) {\n this.xCoordinate = x;\n }", "public void moveLeft() {\n locX = locX - 1;\n }", "public void inertia_x() {\n if (!isMovingLeft && !isMovingRight) {\n if (Math.abs(speedX) < acceleration) speedX = 0;\n else if (speedX < 0) speedX += acceleration;\n else speedX -= acceleration;\n }\n }", "public double getPositionX() {\n return positionX_;\n }" ]
[ "0.74132025", "0.7226093", "0.6941805", "0.68606496", "0.6853636", "0.6844175", "0.67547977", "0.6725182", "0.6714239", "0.67106324", "0.6660837", "0.6659342", "0.6559533", "0.65507406", "0.6527701", "0.65116286", "0.6496821", "0.6489641", "0.64865863", "0.64838403", "0.6471744", "0.64705193", "0.646762", "0.64579153", "0.64445984", "0.6444304", "0.6444091", "0.6413846", "0.6410397", "0.6404147", "0.6394643", "0.638969", "0.63893896", "0.63628674", "0.6353435", "0.6353356", "0.63510644", "0.6333467", "0.6324295", "0.6315651", "0.6312996", "0.63114434", "0.63063204", "0.6302162", "0.62977403", "0.62955433", "0.6278517", "0.627741", "0.6269136", "0.6268379", "0.62631965", "0.62613046", "0.6260756", "0.625511", "0.6247566", "0.62329525", "0.622843", "0.62283975", "0.6222908", "0.6222219", "0.62189025", "0.62180513", "0.62159246", "0.6215191", "0.6194063", "0.61858267", "0.617388", "0.6166696", "0.6165629", "0.6151982", "0.6141652", "0.6137106", "0.61351204", "0.6130176", "0.61255914", "0.6123246", "0.6114597", "0.6107119", "0.61062086", "0.60923225", "0.60909534", "0.6088984", "0.60861796", "0.60850686", "0.6082273", "0.6078007", "0.6077993", "0.6076397", "0.60761225", "0.60757667", "0.6072253", "0.6071458", "0.60712767", "0.60712767", "0.6068953", "0.60686165", "0.60645676", "0.6055764", "0.60553414", "0.60511166", "0.6049142" ]
0.0
-1
actions performed when mouse button 1 is pressed
@Override public void mouseClicked(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { if (pl.NumBullets > 0) { //creates shoot and adds the to the list pl.Shoot(); BulletFired = true; bul = new Bullet(pl.GetXCoord() + 240,pl.GetYCoord() + 70); BulletList.add(bul); } else if (pl.NumBullets <= 0) { GameOn = false; } } //actions performed when mouse button 2 is pressed if (e.getButton() == MouseEvent.BUTTON3) { if (pl.NumRockets > 0) { //creates rockets and adds the to the list pl.FireRocket(); RocketFired = true; rock = new Rocket(pl.GetXCoord() + 200,pl.GetYCoord() + 60); RocketList.add(rock); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void button1MousePressed(MouseEvent e) {\n }", "private void button1MouseClicked(MouseEvent e) {\n\t}", "private void button1MouseClicked(MouseEvent e) {\n }", "@Override\r\n\tpublic void mousePressed(MouseEvent me) {\r\n\t\tbuttonType = me.getButton();\r\n\t\tselect(me.getX(), me.getY());\r\n\t}", "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 }", "private void pressed(MouseEvent e)\r\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 mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "public void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "private void cs1() {\n\t\t\tctx.mouse.click(675,481,true);\n\t\t\t\n\t\t}", "@Override\n public void mousePressed(MouseEvent e){\n String boton = W.detClick( e.getButton() );\n \n //System.out.println(\"->Mouse: Presionando Click \" + boton );\n }", "public void mousePressed() {\n }", "private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {\n }", "@Override\r\n\tpublic void mousePressed(MouseEvent event ) {\n\t\t\r\n\t\tint whichButton =event.getButton();\r\n\t\tmsg=\"\";\r\n\t\tmsg =\"You Pressed Mouse \" ;\r\n\t\t\r\n\t\tif(whichButton==MouseEvent.BUTTON1)\r\n\t\t\tmsg+=\" BUTTON 1\";\r\n\t\telse if(whichButton==MouseEvent.BUTTON2)\r\n\t\t\tmsg+=\"Button 2\";\r\n\t\telse\r\n\t\t\tmsg+=\"Button 3\";\r\n\t\t\r\n\t\tmsg+=\"You are at position \"+\"<X \"+event.getX()+\" Y \"+event.getY()+\">\";\r\n\t\t\r\n\t\tif(event.getClickCount()==2)\r\n\t\t{\r\n\t\t\tmsg+=\" You double Clicked\";\r\n\t\t}\r\n\t\telse\r\n\t\t\tmsg+=\" You singel-Clicked\";\r\n\t\t\r\n\t\tlabel.setText(msg);\r\n\t\t\r\n\t}", "public void mousePressed(MouseEvent e) {}", "public void mousePressed(MouseEvent e) {}", "public void mousePressed(MouseEvent e) {}", "@Override\r\n public void mouseClicked(MouseEvent e) {\n System.out.println(e.getButton());\r\n\r\n // MouseEvent.BUTTON3 es el boton derecho\r\n }", "public void mousePressed (MouseEvent event) {}", "public void mousePressed(MouseEvent e) {\n \t\t\r\n \t}", "public void mousePressed( MouseEvent event ){}", "public void mousePressed(MouseEvent e) {\n }", "public void mousePressed(MouseEvent e) {\n\t\t\t\t\t\tswitch(num){\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tright.setIcon(right1);\n\t\t\t\t\t\t\t//右移\n\t\t\t\t\t\t\tRightMove();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tsearchButton.setIcon(search1);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "public void mousePressed(MouseEvent e) {\n\t\t\t\n\t\t}", "public void mousePressed(MouseEvent e) {\n\t\t\t\n\t\t}", "public void mousePressed(MouseEvent e) {\n\t\t\t\n\t\t}", "public void mousePressed(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent arg0) {\n\t\t\t\t\n\t\t\t}", "private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {\n }", "@Override\r\n public boolean mousePressed(MouseEvent e) {\r\n state = 2;\r\n return true;\r\n }", "public void mouseClicked(int ex, int ey, int button) {\r\n\t}", "@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\tl1.setText(\"You pressed the mouse\");\r\n\t}", "public void mousePressed(MouseEvent e) {\n\t\t\t\t\t\tswitch(num){\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tright.setIcon(right1);\n\t\t\t\t\t\t\t//右移\n\t\t\t\t\t\t\tRightMove();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tconfirm.setIcon(confirm1);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "public void mousePressed(MouseEvent arg0) {\n\n }", "public void mousePressed(MouseEvent arg0) {\n\n }", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "public void mousePressed(MouseEvent arg0) {\n\t\t\t\n\t\t}", "public void mousePressed(MouseEvent e) {\r\n }", "@Override\n public void mouseDown(MouseEvent me) {\n if (me.button > 3) {\n return;\n }\n OldFXCanvas.this.sendMouseEventToFX(me, AbstractEvents.MOUSEEVENT_PRESSED);\n }", "public void mousePressed(MouseEvent event)\r\n {\n }", "@Override\r\n\t\t\tpublic void mousePressed(MouseEvent arg0) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void mousePressed(MouseEvent arg0) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void mousePressed(MouseEvent arg0) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void mousePressed(MouseEvent arg0) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void mousePressed(MouseEvent e) {\n\n\t\t\n\t\t\n\t}", "@Override\n\t\tpublic void mousePressed(MouseEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mousePressed(MouseEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mousePressed(MouseEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mousePressed(MouseEvent arg0) {\n\t\t\t\n\t\t}", "@Override\r\n\t\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}", "@Override\n\t\tpublic void mousePressed(MouseEvent e) {}", "@Override\n\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n public void mousePressed(MouseEvent evt) {\n }", "public void mousePressed(MouseEvent e) {\n\t\t\r\n\t}", "@Override\n\t\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "@Override\n\tpublic void mousePressed(MouseEvent event) {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbutton_press.playSound(BUTTON_PRESS);\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbutton_press.playSound(BUTTON_PRESS);\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbutton_press.playSound(BUTTON_PRESS);\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbutton_press.playSound(BUTTON_PRESS);\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbutton_press.playSound(BUTTON_PRESS);\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}", "public void mousePressed(MouseEvent e) {\r\n\t\tmouseMoved(e);\r\n\t\tmenuControl();\r\n\t\t\r\n\t}", "private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {\n }", "private void jButton4MouseClicked(java.awt.event.MouseEvent evt) {\n }", "private void jButton4MouseClicked(java.awt.event.MouseEvent evt) {\n }", "public void mousePressed(MouseEvent e) {\n\t\t\n\t}", "public void mousePressed(MouseEvent e) {\n\t\t\n\t}" ]
[ "0.80218303", "0.7982676", "0.77292126", "0.7695602", "0.7628193", "0.7597237", "0.7515748", "0.75007385", "0.75007385", "0.7494752", "0.74668676", "0.74613297", "0.7456509", "0.7437708", "0.74164355", "0.74164355", "0.74164355", "0.73991287", "0.7389358", "0.73861754", "0.7384568", "0.737753", "0.7371633", "0.7364577", "0.7364577", "0.7364577", "0.7364577", "0.73643804", "0.73643804", "0.73643804", "0.7358724", "0.7346363", "0.7344397", "0.73388195", "0.7333402", "0.7313679", "0.7313679", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.73107684", "0.7306066", "0.7301192", "0.7290718", "0.7290056", "0.72686714", "0.72686714", "0.72686714", "0.72686714", "0.726742", "0.72654796", "0.72654796", "0.72654796", "0.72654796", "0.7263538", "0.7263538", "0.7261268", "0.725586", "0.725586", "0.7249117", "0.7249117", "0.7249117", "0.7249117", "0.7249117", "0.7249117", "0.72482944", "0.7245345", "0.72444206", "0.72398233", "0.723774", "0.723774", "0.723774", "0.723774", "0.723774", "0.7236628", "0.7236628", "0.72313225", "0.72300786", "0.72293675", "0.72293675", "0.72281504", "0.72281504" ]
0.0
-1
creates an instance of the enemy
private void createEnemyHelicopter() { RandNum = 0 + (int)(Math.random()*700); int xCoordinate = 1400; int yCoordinate = RandNum; eh = new Enemy(xCoordinate,yCoordinate); // Add created enemy to the list of enemies. EnemyList.add(eh); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createEnemy()\n {\n scorpion = new Enemy(\"Giant Scorpion\", 5, 10); \n rusch = new Enemy(\"Mr. Rusch\", 10, 1000);\n skeleton = new Enemy(\"Skeleton\", 10, 50);\n zombie = new Enemy(\"Zombie\", 12, 25);\n ghoul = new Enemy(\"Ghoul\", 15, 45);\n ghost = new Enemy(\"Ghost\", 400, 100);\n cthulu = new Enemy(\"Cthulu\", 10000000, 999999);\n concierge = new Enemy(\"Concierge\", 6, 100);\n wookie = new Enemy(\"Savage Wookie\", 100, 300);\n }", "public Enemy() {\n createModel();\n enemyCounter++;\n }", "void generateEnemy(){\n\t\tEnemy e = new Enemy((int)(Math.random()*\n\t\t\t(cp.getWidthScreen() - (ss.getWidth()/2)))\n\t\t\t,ss.getHeight(), cp.getHieghtScreen());\t\t\t\t//Enemy (int x, int y, int heightScreen)\n\t\tcp.shapes.add(e);\n\t\tenemies.add(e);\n\t}", "public void enemyCreator() { // Creates enemies\n \tif(createFrame >= createTime) {\n \t\tfor(int i = 0; i < enemies.length; i++) {\n \t\t\tif(!enemies[i].isAlive) { // If the enemy is no longer alive\n \t\t\t\tenemies[i].Create(0); // Create a new one\n \t\t\t\tbreak;\n \t\t\t} \t\t\t\t\n \t\t}\n \t\tcreateFrame = 0;\n \t}\n \telse\n \t\tcreateFrame += 1;\n \t\n \tif(killCount == 10){ // Every ten enemies\n \t\tkillCount = 0;\n \t\tif(createTime > 700)\n \t\t\tcreateTime -= 275; // Increase spawn rate\n \t\t\n \t\tif(Enemy.moveSpeed > 8)\t\n \t\t\t\tEnemy.moveSpeed -= 2; // Increase enemy movement speed\n \t\tif(killed > 100)\n \t\t\tBlock.healthTime += 25; // Increase enemy health\n \t\telse if(killed > 200)\n \t\t\tBlock.healthTime += 30;\n \t\telse\n \t\t\tBlock.healthTime += 20;\n \t}\n }", "public TestEnemy(Vector2 spawnPoint) {\n super(spawnPoint);\n this.health = MAX_HEALTH;\n this.speed = MAX_SPEED;\n this.damage = DAMAGE;\n this.moneyOnKill = MONEY_ON_KILL;\n this.bounds = new Circle(spawnPoint, RADIUS);\n this.ai = new RunnerAi(this);\n }", "public Enemy(Texture tex) \r\n\t{\r\n\t\tsuper(tex);\r\n\t\tm_type = \"enemy\";\r\n\t\tm_controller = new IAController();\r\n\t\tm_weapon = new AttackEmitter();\r\n\t\t\r\n\t\tm_lifeBar.setScale(new Vector2(0.3f,0.3f));\r\n\t\t\r\n\t\tm_speed = 50;\r\n\t\tm_life = 4;\r\n\t\t\r\n\t}", "public static Enemy createEnemy(String str)\n\t{\n\t\t\n\t\tString []arr=str.split(\",\");\n\t\tint x=Integer.parseInt(arr[2]);\n\t\tint y=Integer.parseInt(arr[3]);\n\t\tint w=Integer.parseInt(arr[4]);\n\t\tint h=Integer.parseInt(arr[5]);\n\t\tImageIcon img = ElementLoad.getElementLoad().getMap().get(arr[0]);\n\t\tEnemy enemy=null;\n\t\tswitch(arr[0])\n\t\t{\n\t\tcase \"enemyA\":\n\t\t\tenemy=new EnemyLeftToRight(x,y,w,h,img);\n\t\t\tbreak;\n\t\tcase \"enemyB\":\n\t\t\tenemy=new EnemyRightToLeft(x,y,w,h,img);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tenemy=new Enemy(x,y,w,h,img);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn enemy;//(x,y,w,h,img);\n\t}", "public static void enemy(){\n\t\tenemy = null;\n\t\twhile(enemy == null){\n\t\t spawnEnemy();\n\t\t}\n\t}", "Enemy(int x, int y, Bitmap image) {\n super(x, y, image);\n }", "protected Enemy spawn(Class enemyClass, final ArrayList<Enemy> enemies, final int spawnRadius, final int escapeRadius) {\n // at a random angle\n double theta = Math.random() * 2 * Math.PI;\n // pick a random point from 10% spawn radius to 100% spawn radius\n double radius = (Math.random() * 0.9 + 0.1) * spawnRadius;\n\n GameUtils.Position p = GameUtils.radialLocation(radius, theta);\n\n Enemy newEnemy = null;\n if (enemyClass == BasicEnemy.class) {\n newEnemy = new BasicEnemy(p.x, p.y, escapeRadius);\n } else if (enemyClass == ShootEnemy.class) {\n newEnemy = new ShootEnemy(p.x, p.y, escapeRadius);\n } else if (enemyClass == LaserEnemy.class) {\n newEnemy = new LaserEnemy(p.x, p.y, escapeRadius);\n } else if (enemyClass == BombEnemy.class) {\n newEnemy = new BombEnemy(p.x, p.y, escapeRadius);\n } else if (enemyClass == Kraken.class) {\n newEnemy = new Kraken(escapeRadius, spawnRadius);\n } else if (enemyClass == ArcEnemy.class) {\n int rotateSide = (int)Math.round(Math.random());\n newEnemy = new ArcEnemy(p.x, p.y, escapeRadius, rotateSide);\n } else if (enemyClass == ArcShootEnemy.class) {\n int rotateSide = (int)Math.round(Math.random());\n newEnemy = new ArcShootEnemy(p.x, p.y, escapeRadius, rotateSide);\n }\n\n if(newEnemy == null) {\n System.err.println(\"Stage cannot spawn enemy of type \" + enemyClass);\n }\n\n return newEnemy;\n }", "protected abstract void defineEnemy();", "Enemy(float xx, float yy, float dd, ImageLoader iL, PApplet p, int type) {\n x = xx;\n y = yy;\n speed = dd;\n this.iL = iL;\n\n this.p = p;\n this.type = type;\n }", "private void createBasicEnemies() {\n\t\tint xTemp1 = (int) app.random(60, 500);\n\t\tint xTemp2 = (int) app.random(650, 1140);\n\t\tint yTemp = -60;\n\t\t\n\t\t//Contador para crear enemigo cada cierto tiempo\n\t\tapp.frameRate(80);\n\t\t\n\t\t//Agregar enemigos basicos\n\t\tif (app.frameCount%120 == 0) {\n\t\t\tbasicEnemies1.add(new BasicEnemy(app, xTemp1, yTemp));\n\t\t\tbasicEnemies2.add(new BasicEnemy(app, xTemp2, yTemp));\n\t\t}\n\t\t\n\t\t//Agregar enemigos que disparan\t\t\n\t\tif (app.frameCount%250 == 0) {\n\t\t\thardEnemies1.add(new HardEnemy(app, xTemp1, yTemp));\n\t\t\thardEnemies2.add(new HardEnemy(app, xTemp2, yTemp));\n\t\t}\n\t}", "public Enemy getEnemy(String enemyType)\n {\n if(enemyType == null)\n {\n return null;\n }\n if(enemyType.equalsIgnoreCase(\"SquareEnemy\"))\n {\n return new SquareEnemy();\n }\n else if(enemyType.equalsIgnoreCase(\"CircleEnemy\"))\n {\n return new CircleEnemy();\n }\n else if(enemyType.equalsIgnoreCase(\"TriangleEnemy\"))\n {\n return new TriangleEnemy();\n }\n return null;\n }", "private void generateEnemies(){\n\t\tint coordX = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tint coordY = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tEnemy enemy = new Enemy(coordX,coordY);\n\t\tenemies.put(0, enemy);\n\t\tcoordX = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tcoordY = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tenemy = new Enemy(coordX,coordY);\n\t\tenemies.put(1, enemy);\n\t}", "private void generateEnemies() {\n for(int i =0; i < currentEnemies.length; i++) {\n Attributes a = genAttributes();\n double[] healthSpeed = genHealthAndSpeed();\n LinkedList<Pathing> paths = map.getPathings();\n this.currentEnemies[i] = new Enemy(determineImage(a, healthSpeed[0]), healthSpeed[0], healthSpeed[1], 10+currentDifficulty/20, a, paths);\n }\n\n }", "public void spawnEnemy(){\n\t\tint initTile = 0;\n\t\n\t\tfor(int i=0; i<screen.maps[screen.currentMap].path.getHeight(); i++){\n\t\t\tif(screen.maps[screen.currentMap].path.getCell(0, i).getTile().getProperties().containsKey(\"ground\") == true){\n\t\t\t\tinitTile = i;\n\t\t\t}\n\t\t}\n\t\t\n\t\txCoor = 2;\n\t\tyCoor = (initTile)*64 + 2;\n\t\tbound = new Circle(xCoor+30, yCoor+30, 30);\n\t\tinGame = true;\n\t}", "private void spawnEnemy() {\n float randomEnemy = (float) Math.random();\n\n if (round == 1) {\n addActorFunction.accept(new SimpleEnemy(tileSet));\n } else {\n float speedMultiplier = 1 + (0.08f * round);\n float healthMultiplier = 1 + (0.01f * round * round);\n\n if (randomEnemy < (round - 1) * 0.1) {\n addActorFunction.accept(new HeavyEnemy(tileSet, speedMultiplier, healthMultiplier));\n } else {\n addActorFunction.accept(new SimpleEnemy(tileSet, speedMultiplier, healthMultiplier));\n }\n }\n }", "public DumbEnemy(){\n setImage(new GreenfootImage(SPRITE_W,SPRITE_H));\n }", "public Player(Game game, float x, float y, Enemy enemy) {\n\t\tsuper(game,x,y);\n\t\tthis.enemy = enemy;\n\t\tthis.spawnX = (int) x;\n\t\tthis.spawnY = (int) y;\n\t}", "Enemy(Bitmap image) {\n super(image);\n }", "public SoldierEnemy(int health) {\n super(health);\n }", "public EnemyGroup(){\r\n\t\t\r\n\t}", "public DwarfEnemy()\r\n\t{\r\n\t\tdamagePower = GameStatics.Enemies.Dwarf.damagePower;\r\n\t\tspeed = GameStatics.Enemies.Dwarf.speed;\r\n\t\thp = GameStatics.Enemies.Dwarf.initHp;\r\n\t}", "public SmartTargetingEnemy(int xPos, int yPos) {\n\t\tsuper(xPos, yPos);\n\t}", "public Enemy(int setX, int setY, int setHealth, int setDamage) {\n\t\tsuper(setHealth, setDamage,16,18,0, 4);\n\t\tenemy.setScaleX(2.5);\n\t\tenemy.setScaleY(2.5);\n\t\tenemy.setLayoutX(setX);\n\t\tenemy.setLayoutY(setY);\n\t\t\n\t\tCore.addSolid(enemy);\n\n\t\tenemy.setId(\"enemy\");\n\t\tenemy.setViewport(enemyport);\n\t}", "public static AbstractEnemy produceEnemy(GameModelInterface game, Vector2 position, AbstractEnemy.entity_type enemyType) {\n\t\tif (enemyType == AbstractEnemy.entity_type.archer) {\n return new ShootingEnemy(game.getWorld(),game.getPlayer(),position);\n\t\t} else if (enemyType == AbstractEnemy.entity_type.slime) {\n\t\t\tSlime2 slime = new Slime2(game.getWorld(),game.getPlayer(),position);\n\t\t\t//to allow the slime to dynamically add itself at runtime\n\t\t\tslime.provideGameModel(game);\n\t\t\treturn slime;\n\t\t}\n\t\telse if (enemyType == AbstractEnemy.entity_type.spikeblock) {\n return new SpikeBlock(game.getWorld(),game.getPlayer(),position);\n\t\t}\n\t\telse if (enemyType == AbstractEnemy.entity_type.rogue) {\n return new Rogue(game.getWorld(),game.getPlayer(),position);\n\t\t}\n\t\telse if (enemyType == AbstractEnemy.entity_type.boss1) {\n\t\t\tBoss1V2 b = new Boss1V2(game.getWorld(),game.getPlayer(),position);\n\t\t\tb.provideGameModel(game);\n\t\t\treturn b ;\n\t\t}\n\t\treturn null;\n\t}", "public Enemy(int x, int y, int width, int height, int hp, Handler handler) {\n\t\tsuper(x, y, ID.Enemy, width, height, hp);\n\t\tvelX = 3;\n\t\tvelY = 3;\n\t\t//velY = 20;\n\t\tthis.handler = handler;\n\t}", "BossEnemy(){\n super();\n totallyDied = true;\n }", "private void setEnemy(){\n depths.setEnemy(scorpion);\n throne.setEnemy(rusch);\n ossuary.setEnemy(skeleton);\n graveyard.setEnemy(zombie);\n ramparts.setEnemy(ghoul);\n bridge.setEnemy(concierge);\n deathRoom1.setEnemy(ghost);\n deathRoom2.setEnemy(cthulu);\n deathRoom3.setEnemy(wookie); \n }", "protected Enemy copy()\r\n\t{\r\n\t\treturn new DwarfEnemy();\r\n\t}", "public void enemySpawner(){\n\t\tif (spawnFrame >= spawnTime){\n\t\t\tfor(int i =0;i<enemies.size();i++){\n\t\t\t\tif (!enemies.get(i).getInGame()){\n\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy);\n\t\t\t\t\tbreak;\n\t\t\t\t\t/*if (enemies.get(i).getNum()==1){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (enemies.get(i).getNum()==2){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy2);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (enemies.get(i).getNum()==3){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy3);\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\n\t\t\t\t}\n\t\t\t}\n\t\t\tspawnFrame=0;\n\t\t} else{\n\t\t\tspawnFrame+=1;\n\t\t}\n\t}", "public void spawnEnemy(Location location) {\r\n\t\t\tlocation.addNpc((Npc) this.getNpcSpawner().newObject());\r\n\t\t}", "public PlayerFighter create(GamePlayer player);", "Actor createActor();", "public BossEnemy(double xCoord, double yCoord){\r\n super(xCoord, yCoord, 0, 0, 40, 20, 100);\r\n velocity = 6;\r\n }", "public Battle(Player player, Enemy enemy) {\n\n this.player = player;\n this.enemy = enemy;\n System.out.println(\"While walking into the room, you encounter \" + enemy.getName() + \". He looks angry! Get ready to fight.\");\n System.out.println(\"Your options are: Attack, Eat, Inspect, Run\");\n }", "public Enemy getEnemy(){\n return enemy;\n }", "@Override\r\n\tpublic EnemySprites getEnemy(int level) {\r\n \tint enemyCount = 3;\r\n \tRandom rand = new Random();\r\n \tint enemyNum = rand.nextInt(enemyCount);\r\n \tswitch(enemyNum){\r\n \tcase 0:\r\n \t\t//return new goblin(level);\r\n \t\tbreak;\r\n \tcase 1:\r\n \t\t//return new kobold(level);\r\n \t\tbreak;\r\n \tcase 2:\r\n \t\t//return new Bandit(level);\r\n \t\tbreak;\r\n \tdefault:\r\n \t\treturn null; \t\t\r\n \t}\r\n \treturn null;\r\n }", "public Heroes(int x, int y,int tamanioX, int tamanioY,String nombre, boolean spawned,boolean alive, int HP, int velocidad) {//inicio de el constructor por paramteros que recibe si esta vivo, la vida, velocidad\r\n\t\t\tsuper(x,y,tamanioX,tamanioY,nombre,spawned,alive,HP,velocidad);\r\n\t\r\n\t\t}", "public Enemy01(Resources res, float x, float y) {\n this.x = x;\n this.y = y;\n enemy = BitmapFactory.decodeResource(res, R.mipmap.enemy01);\n curImage = enemy;\n width = curImage.getWidth();\n height = curImage.getHeight();\n dpi = res.getDisplayMetrics().densityDpi;\n screenHeight = res.getDisplayMetrics().heightPixels;\n screenWidth = res.getDisplayMetrics().widthPixels;\n }", "public void setEnemy(Enemy enemy){\n this.enemy = enemy;\n enemy.setXGrid(getXGrid());\n enemy.setYGrid(getYGrid());\n setEntity(enemy);\n }", "public BasicEnemyMovement(Entity player) {\n super(Family.all(BasicEnemyComponent.class, ActivatedComponent.class).get());\n bodyM = ComponentMapper.getFor(BodyComponent.class);\n velocityM = ComponentMapper.getFor(VelocityComponent.class);\n positionM = ComponentMapper.getFor(PositionComponent.class);\n aggroM = ComponentMapper.getFor(AggressiveComponent.class);\n this.player = player;\n }", "public Actor(GameEngine e) {\r\n\t\tvelocity = new Point2D.Float(0, 0); // speed in pixels/s\r\n\t\tcenter = new Point2D.Float(0, 0);\r\n\t\tsize = new Point2D.Float(0, 0);\r\n\t\tacceleration = new Point2D.Float(0, 0);\r\n\t\tmaxVelocity = new Point2D.Float(Integer.MAX_VALUE, Integer.MAX_VALUE);\r\n\t\tdeath = false;\r\n\t\tengine = e;\r\n\t\tbasePoly = new Polygon();\r\n\t\thealth = 0;\r\n\t\tdir = 0;\r\n\t\tmaxHealth = 0;\r\n\t\t_checkInvariant();\r\n\t}", "private void makeBoss()\r\n {\r\n maxHealth = 1000;\r\n health = maxHealth;\r\n \r\n weapon = new Equip(\"Claws of Death\", Equip.WEAPON, 550);\r\n armor = new Equip(\"Inpenetrable skin\", Equip.ARMOR, 200);\r\n }", "public void dispara()\r\n {\r\n BulletEnemy bala = new BulletEnemy();\r\n getWorld().addObject(bala,getX(),getY()+25);\r\n }", "public Agent createNewAgent() throws MaceException{\r\n\t\tAgent agent = new Agent(\"n\" + maxAgentId, Agent.AGENT_BUYER);\r\n\t\taddAgent(agent);\r\n\t\tmaxAgentId++;\r\n\t\treturn agent;\r\n\t}", "public Enemy(Image i, int xPos, int yPos, int winWidth) {\n\t\tsuper(i, xPos, yPos, winWidth);\n\t}", "public EnemySpawner(String mapName) {\n\n map = new Map(mapName);\n enemiesLeft = new int[]{0};\n }", "void spawnEntityAt(String typeName, int x, int y);", "public static NPC createNPC(){\n\t\treturn new NPC();\n\t}", "public MyAgent(World world)\n {\n w = world; \n }", "public void addEnemy(Enemy enem)\r\n\t{\r\n\t\tenemy.add(new Enemy(enem));\r\n\t}", "public ArrayList<Enemy> getNewEnemies()\r\n\t{\r\n\t\tArrayList<Enemy> enemyList = new ArrayList<Enemy>();\r\n\t\tfor (Enemy enem : enemy)\r\n\t\t{\r\n\t\t\tenemyList.add(new Enemy(enem));\r\n\t\t}\r\n\t\treturn enemyList;\r\n\t}", "public SniperEnemy()\n { \n scoreBoost = 15;\n moneyBoost = 300;\n healthPoints = 500; \n fireRate = 45; \n movementCounter = 20;\n movementMod = 20;\n }", "Hero createHero();", "public Enemy(Juego _j, int _id){\n\t\tthis.juego = _j;\n\t\tthis.id = _id;\n\t}", "@Override\n public void run() {\n// handler.addObject(new Enemy(rnd.nextInt(Game.WIDTH), rnd.nextInt(200), ID.Trump));\n// handler.addObject(new Enemy(rnd.nextInt(Game.WIDTH), rnd.nextInt(200), ID.Trump));\n int rnd_x = rnd.nextInt(Game.WIDTH);\n handler.addObject(new Enemy(getX() + 30, y, ID.Trump, 0));\n handler.addObject(new Enemy(getX() -30, y, ID.Trump, 0));\n handler.addObject(new Enemy(getX() , y+30, ID.Trump, 0));\n handler.addObject(new Enemy(getX() , y-30, ID.Trump, 0));\n\n\n }", "private void createAgent() {\n logger.info(\"Creating agent\");\n iteration = 0;\n aiManager = new AIManager(configDialogInfo);\n aiManager.getAgent().addObserver(\"gameEngine\", this);\n AIBirth.generate(aiManager.getAgent());\n aiManager.start();\n }", "@SuppressWarnings(\"unused\")\n void spawn(Entity entity);", "private void addEnemies() {\n\t\tred_ghost = new Enemy();\r\n\t\tthis.add(red_ghost);\r\n\t\tenemies.add(red_ghost);\r\n\t\t\r\n\t}", "public Hero(int x, int y) {\r\n this.centerX = x;\r\n this.centerY = y;\r\n this.currentHealth = 100;\r\n rect1 = new FloatRect (100,630,80,110);\r\n imgTexture = new Texture ();\r\n try {\r\n imgTexture.loadFromFile (Paths.get (ImageFile));\r\n } catch (IOException ex) {\r\n ex.printStackTrace ();\r\n }\r\n imgTexture.setSmooth (true);\r\n\r\n img = new Sprite (imgTexture);\r\n img.setOrigin (Vector2f.div (new Vector2f (imgTexture.getSize ()), 2));\r\n img.setPosition (x, y);\r\n // Store references to object and key methods\r\n obj = img;\r\n setPosition = img::setPosition;\r\n\r\n background = new Sprite (bg.loadTextures ());\r\n background.setOrigin(Vector2f.div(new Vector2f(bg.getTexture1 ()), 1000000));\r\n background.setPosition (0,0);\r\n }", "private void spawnMediumEnemy(IEnemyService spawner, World world, GameData gameData) {\r\n if (spawner != null) {\r\n spawner.createMediumEnemy(world, gameData, new Position(randomIntRange(1600, 3200), gameData.getGroundHeight()));\r\n spawner.createMediumEnemy(world, gameData, new Position(randomIntRange(-600, -2000), gameData.getGroundHeight()));\r\n }\r\n }", "public Defender(double x, double y) {\n\t\tsuper(x, y);\n\t\t// initially alive\n\t\tthis.isAlive = true;\n\t\t\n\t}", "public ActorNPC() {\r\n }", "public Hero createHero() {\r\n\t\t// Creates hero with the defines statistics\r\n\t\tHero hero = new Hero(getTotalHealth(), getIllusion(), getHealing(), getHaggling());\r\n\t\t\r\n\t\treturn hero;\r\n\t\t\r\n\t}", "public EnemyShip(EnemyType enemyType, EnemyPattern pattern, boolean spawnRight, boolean large, float height, Sprite sprite, GameScreen screen) {\r\n\t\tsuper(sprite, screen);\r\n\t\tthis.spawnRight = spawnRight;\r\n\t\tthis.enemyType = enemyType;\r\n\t\tenemyPattern = pattern;\r\n\t\tthis.large=large;\r\n\t\tif(large)\r\n\t\tsprite.setSize(60,60);\r\n\r\n\t\tswitch (enemyType) {\r\n\t\tcase DOWN:\r\n\t\t\tsprite.setTexture(new Texture(\"downenemy.png\"));\r\n\t\t\tbreak;\r\n\t\tcase LEFT:\r\n\t\t\tsprite.setTexture(new Texture(\"leftenemy.png\"));\r\n\t\t\tbreak;\r\n\t\tcase RIGHT:\r\n\t\t\tsprite.setTexture(new Texture(\"rightenemy.png\"));\r\n\t\t\tbreak;\r\n\t\tcase UP:\r\n\t\t\tsprite.setTexture(new Texture(\"upenemy.png\"));\r\n\t\t\tbreak;\r\n\r\n\t\t}\r\n\r\n\t\t\r\n\t\tspeed = 150;\r\n\t\tamplitude = 70;\r\n\t\tthis.height = height;\r\n\t\t\r\n\t}", "public Engine(){\n name = \"Basic Engine\";\n moveDeduction = 1;\n }", "public void attack(){\n activity = CreatureActivity.ATTACK;\n createWeapon();\n endAttack = new CountDown(20); //100\n endAnimationAttack = new CountDown(100);\n }", "public Boss() {\n\t\tlife = 3;\n\t\timage = new Image(\"/Model/boss3.png\", true);\n\t\tboss = new ImageView(image);\n\t\tRandom r = new Random();\n\t\tboss.setTranslateX(r.nextInt(900));\n\t\tboss.setTranslateY(0);\n\t\tisAlive = true;\n\t}", "public Enemy summon() {\n\t\treturn null;\n\t}", "public static Action spawn(final Class<?> e) {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.isFacingValidLocation() && a.getFacing() == null) {\n if(a.energy >= getCost()) {\n try {\n Actor b = (Actor) e.newInstance();\n b.putSelfInGrid(a.getGrid(), a.getLocation().getAdjacentLocation(a.getDirection()));\n } catch(InstantiationException r) {\n r.printStackTrace();\n } catch(IllegalAccessException r) {\n r.printStackTrace();\n }\n a.energy = a.energy - 400;\n }\n }\n }\n\n @Override\n public int getCost() {\n return 400;\n }\n\n @Override\n public boolean isExclusive() {\n return true;\n }\n\n @Override\n public Object getData() {\n return e;\n }\n\n @Override\n public String toString() {\n return \"Spawn(\" + (e != null ? e.toString() : \"null\") + \")\";\n }\n };\n }", "public void spawn(Integer spawnSize) {\n for (Integer i = 0; i < spawnSize; i++) {\n Enemy enemy = new Enemy(mainPlayerPosX, mainPlayerPosY);\n enemies.put(i, enemy);\n }\n initEnemiesSpawned = spawnSize;\n enemiesSize = spawnSize;\n }", "public GiantWarrior(float x, float y, boolean enemy, int level) {\r\n\t\tsuper(x, y, (int) Data.GIANTWARRIOR_STATS[0], (int) Data.GIANTWARRIOR_STATS[1],\r\n\t\t\t\t(int) Data.GIANTWARRIOR_STATS[2], Data.GIANTWARRIOR_STATS[3],\r\n\t\t\t\t(int) (Data.GIANTWARRIOR_STATS[4] * Math.pow(1.1, level - 1)), enemy, Data.GIANTWARRIOR_ICON,\r\n\t\t\t\tData.GIANTWARRIOR_ATTACK_ICON);\r\n\t}", "public Enemy getEnemy(int whichEnemy);", "public void spawnCreature(){\n\t\tif(spawnType.equalsIgnoreCase(\"worm\")){\n\t\t\tRuntimeObjectFactory.getObjectFromPool(\"worm\"+spawnId);\n\t\t}else if(spawnType.equalsIgnoreCase(\"antorc\")){\n\t\t\tGdx.app.debug(TamerGame.LOG, this.getClass()\n\t\t\t\t\t.getSimpleName() + \" :: Ant entered\");\t\t\t\n\t\t\t//CHANGE SPAWNING IMPLEMENTATION\n\t\t\tAntOrc orc = new AntOrc();\n\t\t\torc.setPosition(getPosition());\n\t\t\torc.setWaypoint(waypoint);\n\t\t\tenvironment.addNewObject(orc);\n\t\t\tEventPool.addEvent(new tEvent(this,\"spawnCreature\",sleepTime,1));\n\t\t}\n\t\t\t\n\t}", "Player createPlayer();", "Elevage createElevage();", "private void addEnemy(int e_num){\n\t\tRandom r_gen = new Random();\n\t\t\n\t\tenemy_num = e_num;\n\t\tenemy = new int[enemy_num][3];\n\t\tfor(int i=0;i<enemy_num;i++){\n\t\t\tenemy[i][0] = r_gen.nextInt(1000)+20;\n\t\t\tenemy[i][1] = r_gen.nextInt(750)+20;\n\t\t\n\t\t}\n\t\tenemy_arrows = new int[e_num][30][4];\n\t\tenemy_arrow_num = new int[e_num];\n\t\tfor(int i=0;i<e_num;i++){\n\t\t\tenemy_arrow_num[i] = 0;\n\t\t}\n\t\tenemy_choose_player();\n\t\n\t}", "ShooterExplosion(int x, int y) {\n super(x, y);\n }", "@Override\n public void create () {\n batch = new SpriteBatch();\n height = Gdx.graphics.getHeight();\n width = Gdx.graphics.getWidth();\n\n bullets = new ArrayList<Bullet>();\n fondo = new Texture(\"background.png\");\n nave = new Texture(\"space-ship-24px.png\");\n\n spaceship = new SpaceShip();\n Enemy = new Enemy();\n //Enemy = new Sprite(nave);\n //spaceship.setPosition(348, 50);\n Enemy.setPosition(348, 300);\n System.out.println(x);\n }", "public EnemyShipBody(World world, Ship obj) {\n super(world, obj);\n\n float density = 0.1f, friction = 0.2f, restitution = 0.5f;\n int width = 200, height = 166;\n\n // Body\n createFixture(body, new float[]{\n 74,24, 96,8, 106,8, 125,24, 120,79, 100,86, 80,79\n }, width, height, density, friction, restitution, ENEMY_SHIP_BODY, (short) (USER_SHIP_BODY| USER_BULLET_BODY));\n\n // Right Wing\n createFixture(body, new float[]{\n 126,29, 152,37, 158,32, 176,63, 163,157, 147,150, 143,75, 118,78\n }, width, height, density, friction, restitution, ENEMY_SHIP_BODY, (short) (USER_SHIP_BODY| USER_BULLET_BODY));\n\n // Left Wing\n createFixture(body, new float[]{\n 74,29, 48,37, 41,32, 24,63, 37,157, 53,150, 57,75, 83, 78\n }, width, height, density, friction, restitution, ENEMY_SHIP_BODY, (short) (USER_SHIP_BODY| USER_BULLET_BODY));\n\n\n }", "Enemy(int floor, int position, String n, int l, int m){\r\n\t\tname = n;\r\n\t\talive = true;\r\n\t\tmovetype = m;\r\n\t\tlevel = l;\r\n\t\thealth = 10*level;\r\n\t\tleftImage = new ImageIcon(getClass().getClassLoader().getResource(n +\"Left.png\"));\r\n\t\trightImage = new ImageIcon(getClass().getClassLoader().getResource(n +\"Right.png\"));\r\n\t\tsetIcon(rightImage);\r\n\r\n\t\t\ty = floor - 100;\r\n\t\t\tx = position;\r\n\t\t\tsetSize(50, 100);\r\n\t\t\tsetLocation(x,y);\r\n\t\t\tsetBackground(Color.red);\r\n\r\n\r\n\t\t}", "Hero()\n\t{\n\t\t\n\t\tsuper(152,500,97,124);\n\t\tlife = 3;\n\t\tdoubleFire = 0;\n\t\t\n\t}", "public Program7()\n { \n _tc = new TravelingCreature( 200, 200 );\n }", "private Hero createHeroObject(){\n return new Hero(\"ImageName\",\"SpiderMan\",\"Andrew Garfield\",\"6 feet 30 inches\",\"70 kg\",\n \"Webs & Strings\",\"Fast thinker\",\"Webs & Flexible\",\n \"200 km/hour\",\"Very fast\",\"Spiderman - Super Hero saves the world\",\n \"SuperHero saves the city from all the villians\");\n }", "public Level3(Game game)\n {\n super(game);\n \n // set game var\n g = game;\n \n // set world\n world = game.getWorld();\n //set player\n player = game.getPlayer();\n // set default enemy exists state\n enemyExist = true;\n // set frame\n frame = g.getFrame();\n\n }", "public Game() \n {\n parser = new Parser();\n name = new String();\n player = new Player();\n ai = new AI();\n createRooms();\n rand = -1;\n enemyPresent = false;\n wantToQuit = false;\n alive = true;\n createItems();\n createWeapons();\n createEnemy();\n setEnemy();\n setItems();\n setWeapons();\n setExits();\n }", "@Override\n public int getType() {\n return Enemy.TYPEA;\n }", "public Enemy(String name, int health, String description, int minHit, int maxHit) {\n maxHealth = health; // set the max health\n healthPoints = health; // set the current health (to max)\n enemyName = name; // set the health\n this.description = description; // set the description\n this.maxHit = maxHit; // set the max hit\n this.minHit = minHit; // set the min hit\n }", "public static void spawnEnemy(){\n RNG.D100();\n if(PlayerStats.LVL <= 2){\n if(RNG.num <= 90){\n enemy = \"imp\";\n }else{\n enemy = \"IMP LORD\";\n }\n }else if(PlayerStats.LVL > 2 && PlayerStats.LVL <= 3){\n if(RNG.num <= 20){\n enemy = \"imp\";\n }else if(RNG.num > 20 && RNG.num <= 90){\n enemy = \"toadman\";\n }else{\n enemy = \"IMP LORD\";\n }\n }else if(PlayerStats.LVL > 3 && PlayerStats.LVL <= 5){\n if(RNG.num <= 10){\n enemy = \"toadman\";\n }else if(RNG.num > 10 && RNG.num <= 90){\n enemy = \"giant spider\";\n }else{\n enemy = \"BROODMOTHER\";\n }\n }else if (PlayerStats.LVL > 5 && PlayerStats.LVL <= 8){\n if(RNG.num <= 30){\n enemy = \"goblin sorceror\";\n }else if(RNG.num > 30 && RNG.num <= 60){\n enemy = \"goblin warrior\";\n }else if(RNG.num >60 && RNG.num <= 90){\n enemy = \"goblin archer\";\n }else if(RNG.num > 90 && RNG.num <= 100){\n enemy = \"GOBLIN CHIEFTAN\"; \n }\n } \n }", "private void spawnBigEnemy(IEnemyService spawner, World world, GameData gameData) {\r\n if (spawner != null) {\r\n spawner.createBigEnemy(world, gameData, new Position(randomIntRange(1600, 3200), gameData.getGroundHeight()));\r\n spawner.createBigEnemy(world, gameData, new Position(randomIntRange(-600, -2000), gameData.getGroundHeight()));\r\n }\r\n }", "SpawnController createSpawnController();", "void setEnemyPos(Point2D pos);", "public void spawnNew() {\n\t\tif (tier> 1) {\n\t\t\ttier--;\n\t\t\thealth = tier;\n\t\t\tdamage = tier;\n\t\t\tspeed = 5;\n\t\t\timg = getImage(updateImage(tier)); // converted getImage to protected b/c it wasn't accessible by Balloon class (child class)\n\t\t}\n\t\telse {\n\t\t\tisAlive = false;\n\t\t\tdeletePath();\t\t\t\n\t\t}\n\t}", "@Override\n\tpublic void create() {\n\t\tGdx.app.setLogLevel(Application.LOG_DEBUG);\n\t\t\n\t\t//Load assets\n\t\tAssets.instance.init(new AssetManager());\n\t\t\n\t\t//initialize controller and renderer\n\t\tworldController = new WorldController();\n\t\tworldRenderer= new WorldRenderer(worldController);\n\t\t\n\t\t//The world is not paused on start\n\t\tpaused = false;\n\t}", "@Test\n public void testIsCreatable()throws Exception{\n\n NormalDefender nd = new NormalDefender(new Position(0,0),\n generateLevel.getAttackersList());\n assertFalse(generateLevel.isCreatable(nd));\n }", "public Hero(float x, float y, int controlType) {\n\t\tgraphic = new Graphic(\"HERO\");\n\t\tspeed = 0.12f;\n\t\tthis.controlType = controlType;\n\t\tgraphic.setPosition(x,y);\n\t}", "public ShotEnemy(int x, int y, ID id, int health, int speed) {\n super(x, y, id);\n loader = new BufferedImageLoader();\n bulletImage = loader.loadImage(\"../Assets/Bullet.png\");\n left = Game.getInstance(15).getEnemySprites().get(70);\n right = Game.getInstance(16).getEnemySprites().get(71);\n this.hp += health;\n this.speed = speed;\n }", "@Spawns(\"Background\")\r\n\tpublic Entity spawnEnemyBullet(SpawnData data) {\n\t\treturn Entities.builder().from(data).type(SpritesTypes.BACKGROUND).viewFromNode(FXGL.getAssetLoader().loadTexture(\"bg.png\"))\r\n\t\t\t\t.renderLayer(RenderLayer.BACKGROUND).build();\r\n\t}" ]
[ "0.8206479", "0.7490035", "0.74602467", "0.7180185", "0.70509255", "0.6965897", "0.6909685", "0.68582785", "0.6767977", "0.6741716", "0.6739295", "0.6671588", "0.66391003", "0.6630459", "0.6575376", "0.65281844", "0.64888036", "0.64882606", "0.64787024", "0.646625", "0.64282715", "0.6366969", "0.63536566", "0.6319941", "0.6319412", "0.6299222", "0.62880355", "0.6248037", "0.6211979", "0.6207824", "0.6198888", "0.6184381", "0.6172574", "0.61294985", "0.6110308", "0.60940295", "0.60912573", "0.60870504", "0.60407555", "0.6032391", "0.6017828", "0.60003597", "0.6000067", "0.5996093", "0.5988276", "0.59726304", "0.59553903", "0.59406614", "0.59381056", "0.5936901", "0.59091777", "0.58865064", "0.5883068", "0.5880741", "0.5864677", "0.5864236", "0.5848594", "0.5846161", "0.5837593", "0.5836967", "0.582993", "0.5807512", "0.580729", "0.5802863", "0.57975113", "0.57932764", "0.5791549", "0.57877916", "0.57789564", "0.577476", "0.5769953", "0.57694453", "0.57476526", "0.57399094", "0.57359904", "0.5732549", "0.57265425", "0.5724661", "0.5718432", "0.57168776", "0.5703129", "0.5693216", "0.56826174", "0.5677704", "0.5676089", "0.567343", "0.56697553", "0.5661402", "0.56605947", "0.5655064", "0.5654979", "0.5654268", "0.56460124", "0.56424886", "0.56379473", "0.562124", "0.5616765", "0.560791", "0.56065655", "0.5604292" ]
0.74084705
3
Updates all enemies. Move the enemy and checks if it has left the screen. Checks whether enemy was destroyed. Checks whether any enemy collided with player.
private void updateEnemies() { for(int i = 0; i < EnemyList.size(); i++) { //get and update enemy for the enemy list Enemy eh = EnemyList.get(i); eh.Update(); //checks for enemy and player crashes Rectangle playerRectangel = new Rectangle(pl.xCoord, pl.yCoord, pl.PlayerImage.getWidth(), pl.PlayerImage.getHeight()); Rectangle enemyRectangel = new Rectangle(eh.xCoord, eh.yCoord, eh.EnemyHelicopterImage.getWidth(), eh.EnemyHelicopterImage.getHeight()); if(playerRectangel.intersects(enemyRectangel)){ //set player health to zero pl.Health = 0; // Remove helicopter from the list. EnemyList.remove(i); //creates new explosion coordinates enExplosionX = eh.xCoord; enExplosionY = eh.yCoord; plExplosionX = pl.xCoord+120; plExplosionY = pl.yCoord; GameOn = false; } // Check health. if(eh.Health <= 0){ // Increase the number of destroyed enemies and removes a helicopter froma list. DestroyedEnemies++; if(DestroyedEnemies == 10) { //WinsState = true; } EnemyList.remove(i); } // If the current enemy has left the scree it is removed from the list and the number of runAwayEnemies is increased. if(eh.HasLeftScreen()) { EnemyList.remove(i); RunAwayEnemies++; } if(RunAwayEnemies > 5) { GameOn = false; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateEnemies() {\n for (Map.Entry<Integer, Enemy> entry :enemies.entrySet()) {\n entry.getValue().update(mainPlayerPosX, mainPlayerPosY);\n if (entry.getValue().isDead()) {\n enemiesSize--;\n }\n }\n }", "void updateEnemies() {\n getEnemies().forEach(e -> {\n if (!e.isAlive()) {\n e.die();\n SoundPlayer.play(SoundPlayer.enemyDestroyed);\n }\n });\n objectsInMap.removeIf(o -> o instanceof Enemy && !(((Enemy) o).isAlive()));//Removing Dead Enemies\n getEnemies().forEach(e -> e.setTarget(objectsInMap.stream().filter(p -> p.identifier.contains(\"PlayerTank0.\") &&\n p.isBlocking && ((Tank) p).isVisible()).collect(Collectors.toList())));//Giving Possible target to enemies to decide\n }", "private void moveEnemies(){\n \t\tdouble dirX = 0;\n\t\tdouble dirY = 0;\n \t\tdouble length = 99999;\n \t\tint speed = 2;\n\n\t\tfor(int i=0;i<enemy_num;i++){\n\t\t\tdirX = players[enemy[i][2]][1] - enemy[i][0];\n\t\t\tdirY = players[enemy[i][2]][2] - enemy[i][1];\n\t\t\tlength = Math.sqrt(dirX*dirX + dirY*dirY);\n\t\t\tdirX /= length;\n\t\t\tdirY /= length;\n\t\t\tdirX *= speed;\n\t\t\tdirY *= speed;\n\t\t\tenemy[i][0] += dirX;\n\t\t\tenemy[i][1] += dirY;\n\t\t\n\t\t}\n\t\n\t}", "private void moveInvaders() {\n\t\tfor (ArrayList<Invader> row : enemyArray) {\n\t\t\tfor (Invader a : row) {\n\t\t\ta.move();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (ArrayList<Invader> row : enemyArray) {\n\t\t\tfor (Invader a : row) {\n\t\t\t\tif (a.getVisibility()) {\n\t\t\t\t\t\n\t\t\t\t\tcheckLeftWall(a);\n\t\t\t\t\tcheckRightWall(a);\n\t\t\t\t\t\n\t\t\t\t\tif ((a.getY() + PLAYER_WIDTH) >= HEIGHT) {\n\t\t\t\t\t\trunning = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private static void checkForEnemies() throws GameActionException {\n //No need to hijack code for structure\n if (rc.isWeaponReady()) {\n // basicAttack(enemies);\n HQPriorityAttack(enemies, attackPriorities);\n }\n \n //Old splash damage code\n //Preserve because can use to improve current splash damage code\n //But not so simple like just checking directions, since there are many more \n //locations to consider hitting.\n /*if (numberOfTowers > 4) {\n //can do splash damage\n RobotInfo[] enemiesInSplashRange = rc.senseNearbyRobots(37, enemyTeam);\n if (enemiesInSplashRange.length > 0) {\n int[] enemiesInDir = new int[8];\n for (RobotInfo info: enemiesInSplashRange) {\n enemiesInDir[myLocation.directionTo(info.location).ordinal()]++;\n }\n int maxDirScore = 0;\n int maxIndex = 0;\n for (int i = 0; i < 8; i++) {\n if (enemiesInDir[i] >= maxDirScore) {\n maxDirScore = enemiesInDir[i];\n maxIndex = i;\n }\n }\n MapLocation attackLoc = myLocation.add(directions[maxIndex],5);\n if (rc.isWeaponReady() && rc.canAttackLocation(attackLoc)) {\n rc.attackLocation(attackLoc);\n }\n }\n }//*/\n \n }", "private void enemyEncounter()\n {\n currentEnemies = currentRoom.getEnemies();\n \n if(currentEnemies.size() > 0)\n {\n for(Enemy e : currentEnemies)\n {\n System.out.println(\"\\n\" + \"A \" + e.getName() + \" stares menacingly!\" + \"\\n\");\n enemyName = e.getName();\n \n }\n enemyPresent = true;\n clearExits();\n }\n else{\n setExits(); \n }\n }", "private void update(){\n boolean bumped = false;\n\n // Has the player lost\n boolean lost = false;\n\n // Move the player's ship\n defender.update(fps);\n\n // Update the invaders if visible\n for(int i = 0; i < numInvaders; i++){\n\n if(invaders[i].getVisibility()) {\n // Move the next invader\n invaders[i].update(fps);\n\n // Does he want to take a shot?\n if(invaders[i].takeAim(defender.getX(),\n defender.getLength())){\n\n // If so try and spawn a bullet\n if(invadersBullets[nextBullet].shoot(invaders[i].getX() + invaders[i].getLength() / 2, invaders[i].getY(), bullet.DOWN)) {\n soundPool.play(invaderShootID, 1, 1, 0, 0, 1);\n\n // Shot fired\n // Prepare for the next shot\n nextBullet++;\n\n // Loop back to the first one if we have reached the last\n if (nextBullet == maxInvaderBullets) {\n // This stops the firing of another bullet until one completes its journey\n // Because if bullet 0 is still active shoot returns false.\n nextBullet = 0;\n }\n }\n }\n // If that move caused them to bump the screen change bumped to true\n if (invaders[i].getX() > screenX - ExcessX - invaders[i].getLength()\n || invaders[i].getX() < ExcessX){\n\n bumped = true;\n }\n }\n }\n\n // Update all the invaders bullets if active\n for(int i = 0; i < invadersBullets.length; i++){\n if(invadersBullets[i].getStatus()) {\n invadersBullets[i].update(fps);\n }\n }\n\n // Did an invader bump into the edge of the screen\n if(bumped){\n\n // Move all the invaders down and change direction\n for(int i = 0; i < numInvaders; i++){\n invaders[i].dropDownAndReverse();\n // Have the invaders landed\n if(invaders[i].getY() > screenY - screenY / 10){\n lost = true;\n }\n }\n\n // Increase the menace level\n // By making the sounds more frequent\n menaceInterval = menaceInterval - 80;\n }\n\n if(lost){\n prepareLevel();\n }\n\n // Update the players bullet\n if(bullet.getStatus()){\n bullet.update(fps);\n }\n\n // Has the player's bullet hit the top of the screen\n if(bullet.getImpactPointY() < 0){\n bullet.setInactive();\n }\n\n // Has an invaders bullet hit the bottom of the screen\n for(int i = 0; i < invadersBullets.length; i++){\n if(invadersBullets[i].getImpactPointY() > screenY){\n invadersBullets[i].setInactive();\n }\n }\n\n // Has the player's bullet hit an invader\n if(bullet.getStatus()) {\n for (int i = 0; i < numInvaders; i++) {\n if (invaders[i].getVisibility()) {\n if (RectF.intersects(bullet.getRect(), invaders[i].getRect())) {\n invaders[i].setInvisible();\n explosionAnimation = true;\n explosionX = invaders[i].getX() - invaders[i].getLength()/2;\n explosionY = invaders[i].getY() - invaders[i].getHeight()/2;\n soundPool.play(invaderExplodeID, 1, 1, 0, 0, 1);\n bullet.setInactive();\n score = (10 * level) * multiplier;\n totalScore = totalScore + score;\n cash = cash + 10;\n invadersLeft = invadersLeft - 1;\n\n // Has the player won\n if(invadersLeft == 0){\n shields = shields + 1;\n cash = cash + (10 * multiplier);\n totalScore = totalScore + ((100 * level) * multiplier);\n level = level + 1;\n noHitStreak = noHitStreak + 1;\n if (noHitStreak > 0) {\n multiplier = noHitStreak * 2;\n if (multiplier > 16) {\n multiplier = 16;\n }\n } else {\n multiplier = 1;\n }\n noHitStreak = noHitStreak + 1;\n openUpgradesMenu = true;\n prepareLevel();\n }\n }\n }\n }\n }\n\n // Has an invader bullet hit the player ship\n for(int i = 0; i < invadersBullets.length; i++){\n if(invadersBullets[i].getStatus()){\n if(RectF.intersects(defender.getRect(), invadersBullets[i].getRect())){\n invadersBullets[i].setInactive();\n damageAnimation = true;\n if (shields == 0) {\n alive = false;\n } else if (shields == 1) {\n soundPool.play(severeDamageID, 1, 1, 0, 0, 1);\n shields = shields - 1;\n } else {\n shields = shields - 1;\n }\n soundPool.play(shieldImpactID, 1, 1, 0, 0, 1);\n noHitStreak = 0;\n multiplier = 1;\n\n // Is it game over?\n if(!alive){\n soundPool.play(playerExplodeID, 1, 1, 0, 0, 1);\n wavesSurvived = level-1;\n finalScore = totalScore;\n shields = 3;\n alive = true;\n cash = 0;\n multiplier = 1;\n totalScore = 0;\n level = 1;\n invadersColumn = 5 ;\n invadersRow = 3;\n openGameOverMenu = true;\n prepareLevel();\n }\n }\n }\n }\n }", "public void tick() {\n\t\tif (Math.abs(disToPlayerX()) > Math.abs(disToPlayerY())) {\r\n\t\t\tif (disToPlayerX()<0) {\r\n\t\t\t\tx -= speed;\t//moves enemy to the left\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tx += speed; //moves enemy to the right\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (disToPlayerY()<0) {\r\n\t\t\t\ty-=speed; //moves enemy up\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ty+=speed; //moves enemy down\r\n\t\t\t}\r\n\t\t}\r\n\t\tenemyRectangle.setLocation((int)x,(int) y); //updates hitbox of enemy\r\n\r\n\t\t//checks all enemies and see if they run into player\r\n\t\tfor (int i=0;i<c.getEnemys().size();i++) {\r\n\t\t\tif (enemyRectangle.getBounds().intersects(player.getRectangle().getBounds())) {\r\n\t\t\t\tkillEnemy(); //removes the enemy\r\n\t\t\t\tPlayer.health -=10; //removes 10 health\r\n\t\t\t\tbreak; //doesn't work without this BREAK. DO NOT REMOVE\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//checks all bullets if they hit an enemy\r\n\t\tfor (int i = 0;i<c.getBullets().size();i++) {\r\n\t\t\tif (enemyRectangle.getBounds().intersects(c.getBullets().get(i).getRect().getBounds())) {\r\n\t\t\t\tkillEnemy(); //removes enemy\r\n\t\t\t\tc.removeBullet(c.getBullets().get(i)); //removes the bullet\r\n\t\t\t\tPlayer.score += 50; //adds 50 to the score\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void enemyMove() {\n\t\tArrayList<EnemySprite> enemylist = this.model.getEnemy();\n\t\tfor(EnemySprite sp :enemylist) {\n\t\t\tif(sp instanceof NormalEnemySprite) {\n\t\t\t\t\n\t\t\t\t((NormalEnemySprite)sp).move();\n\t\t\t}\n\t\t\t\n\t\t\telse if(sp instanceof PatrollingEnemySprite) {\n\t\t\t\t\n\t\t\t\t((PatrollingEnemySprite) sp).move();\n\t\t\t\t\n\t\t\t} \n\t\t\t\n\t\t\telse if (sp instanceof BigEnemySprite) {\n\t\t\t\t((BigEnemySprite)sp).move();\n\t\t\t}\n\t\t\t\n\t\t\telse if (sp instanceof PatrollingBigEnemySprite) {\n\t\t\t\t((PatrollingBigEnemySprite) sp).move();\n\t\t\t}\n\t\t\t\n\t\t\telse if (sp instanceof CircleBigEnemySprite) {\n\t\t\t\t((CircleBigEnemySprite) sp).move();\n\t\t\t}\n\t\t}\n\t\t\n\t\t\t\t\n\t}", "private void UpdateBullets()\n\t {\n\t for(int i = 0; i < BulletList.size(); i++)\n\t {\n\t Bullet bullet = BulletList.get(i);\n\t \n\t // Move the bullet.\n\t bullet.Update();\n\t \n\t // checks if the bullet has it left the screen\n\t if(bullet.HasLeftScreen()){\n\t BulletList.remove(i);\n\t \n\t continue;\n\t }\n\t \n\t // checks if the bullet hit the enemy\n\t Rectangle BulletRectangle = new Rectangle((int)bullet.xCoord, (int)bullet.yCoord, bullet.BulletImage.getWidth(), bullet.BulletImage.getHeight());\n\t // Go trough all enemies.\n\t for(int j = 0; j < EnemyList.size(); j++)\n\t {\n\t Enemy eh = EnemyList.get(j);\n\n\t \n\t Rectangle EnemyRectangel = new Rectangle(eh.xCoord, eh.yCoord, eh.EnemyHelicopterImage.getWidth(), eh.EnemyHelicopterImage.getHeight());\n\n\t // Checks whether the the bullet has hit the enemy\n\t if(BulletRectangle.intersects(EnemyRectangel))\n\t {\n\t // Bullet hit the enemy so we reduce his health.\n\t eh.Health -= Bullet.DamagePower;\n\t \n\t // Bullet was also destroyed so we remove it.\n\t BulletList.remove(i);\n\t \n\t \n\t }\n\t }\n\t }\n\t }", "public void checkEnemy() {\n\t\tif (enemy != null)\n\t\tif (Integer.parseInt(getCurrentPositionX()) == enemy.getCurrentPositionX() && Integer.parseInt(getCurrentPositionY()) == enemy.getCurrentPositionY()) {\n\t\t\tx = spawnX;\n\t\t\ty = spawnY;\n\t\t}\n\t}", "void update() {\n for (int i = 0; i < bullets.size(); i++) {//if any bullets expires remove it\n if (bullets.get(i).off) {\n bullets.remove(i);\n i--;\n }\n }\n move();//move everything\n checkPositions();//check if anything has been shot or hit\n }", "private void tick() {\n\n if (StateManager.getState() != null) {\n StateManager.getState().tick();\n }\n this.backgroundFrames--;\n if (this.backgroundFrames == 0) {\n this.backgroundFrames = Const.TOTAL_BACKGROUND_FRAMES;\n }\n//Check all changed variables for the player\n player.tick();\n long elapsed = (System.nanoTime() - time) / (Const.DRAWING_DELAY - (4000 * Enemy.getDifficulty()));\n//Check if enough time is passed to add new enemy or if spawnSpot is available\n if (elapsed > (this.delay - Enemy.getDifficulty() * 300)&& Road.isSpotAvailable()) {\n enemies.add(new Enemy());\n time = System.nanoTime();\n }\n//Loop for checking all changed variables for the enemies and check if they intersects with the player\n for (int j = 0; j < enemies.size(); j++) {\n enemies.get(j).tick();\n if(enemies.get(j).getY() > Const.ROAD_BOTTOM_BORDER + 200){\n Road.getOccupiedSpawnPoints()[Const.SPAWN_POINTS.indexOf(enemies.get(j).getX())] = false;\n player.setScore(player.getScore() + 50);\n enemies.remove(j);\n continue;\n }\n enemyBoundingBox = enemies.get(j).getEnemyRectangle();\n if (player.getBoundingBox().intersects(enemyBoundingBox)) {\n reset();\n if(player.getLives() == 0){\n gameOver();\n }\n break;\n }\n }\n }", "@Override\n\tpublic void update() {\n\t\tif(isMove) {\n\t\t\tspriteMoveToPoint(player, (int) mouseX, (int) mouseY);\n\t\t}\n\t\t\n\t\t//bullet\n\t\tfor(int i = 0; i < bulletList.size(); i++) {\n\t\t\tMoveSprite bullet = bulletList.get(i);\n\t\t\tspriteMoveToPoint(bullet, bullet.getX(), bullet.getY() - bullet.getVelocity());\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < bulletList.size(); i++) {\n\t\t\tMoveSprite bullet = bulletList.get(i);\n\t\t\t\tif(bullet.getY() < 10) {\n\t\t\t\t\tremoveBullet(bullet);\n\t\t\t\t}\n\t\t}\n\t\t\n\t\t//enemy\n\t\tfor(int i = 0; i < enemyList.size(); i++) {\n\t\t\tMoveSprite enemy = enemyList.get(i);\n\t\t\tspriteMoveToPoint(enemy, enemy.getX(), enemy.getY() + enemy.getVelocity());\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < enemyList.size(); i++) {\n\t\t\tMoveSprite enemy = enemyList.get(i);\n\t\t\tif(enemy.getY() > layerheight) {\n\t\t\t\tremoveEnemy(enemy);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < enemyList.size(); i++) {\n\t\t\tEnemy enemy = enemyList.get(i);\n\t\t\tfor(int j = 0; j < bulletList.size(); j++) {\n\t\t\t\tBullet bullet = bulletList.get(j);\n\t\t\t\tcollisionCheckForBulletAndEnemy(enemy, bullet);\n\t\t\t}\n\t\t}\n\t}", "public void tick()\n{\n y+=speed;\n\n for(int i=0; i<game.ea.size(); i++)\n {\n EntityA tempEnt= game.ea.get(i);\n if(Physics.Coliision(this,tempEnt))\n {\n c.removeEntity(tempEnt); //zeby po trafieniu znikal pocisk\n c.removeEntity(this);\n game.setEnemy_killed(game.getEnemy_killed()+1);\n\n }\n }\n\n/*\n* If Enemy is out of bounds player get - points\n* and loses some stamina.\n*\n* Enemies are removed from list after disapears\n */\n\n if(y>(App.getHEIGHT()-20)*2)\n {\n App.addHealth(-10);\n App.addPOINTS(-3);\n c.removeEntity(this);\n }\n\n anim.runAnimation();\n\n /*\n * If App is not in game state it doesn't\n * need to have any enemies\n */\n\n if(App.State != App.STATE.GAME)\n {\n delEnemies();\n\n }\n}", "public static void enemy(){\n\t\tenemy = null;\n\t\twhile(enemy == null){\n\t\t spawnEnemy();\n\t\t}\n\t}", "@Override\r\n\tpublic void update() {\n\t\tAlly.update();\r\n\t\tEnemy.update();\r\n\t\tfor(int i = 0 ; i < GroundList.size();i++){\r\n\t\t\tif(GroundList.get(i).kill) {\r\n\t\t\t\tGroundList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < BarelList.size(); i++) {\r\n\t\t\tif(BarelList.get(i).kill) {\r\n\t\t\t\tBarelList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < WoodList.size(); i++) {\r\n\t\t\tif(WoodList.get(i).kill) {\r\n\t\t\t\tWoodList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < FireBallList.size(); i++) {\r\n\t\t\tif(FireBallList.get(i).kill) {\r\n\t\t\t\tFireBallList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < BulletList.size(); i++) {\r\n\t\t\tif(BulletList.get(i).kill) {\r\n\t\t\t\tBulletList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i = 0 ; i < GroundList.size();i++){\r\n\t\t\tGroundList.get(i).update();\r\n\t\t}\r\n\t\tfor(int i = 0 ; i < BarelList.size(); i++) {\r\n\t\t\tBarelList.get(i).update();\r\n\t\t}\r\n\t\tfor(int i = 0; i < BulletList.size(); i++) {\r\n\t\t\tBulletList.get(i).update();\r\n\t\t}\r\n\t\tfor(int i = 0; i < FireBallList.size(); i++) {\r\n\t\t\tFireBallList.get(i).update();\r\n\t\t}\r\n\t\tfor(int i = 0; i < WoodList.size(); i++) {\r\n\t\t\tWoodList.get(i).update();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(GamePanel.updateTimes%60 == 0) {\r\n\t\t\tEnemy.PushEntity(2, new Vector2f(width*1/2, height/4),enemy);\r\n\t\t}\r\n\t\tfor(int i = 0; i < AllyDeadList.size(); i++) {\r\n\t\t\tAlly.entityList.remove(AllyDeadList.get(i)-i);\r\n\t\t}\r\n\t\tfor(int i = 0; i < EnemyDeadList.size(); i++) {\r\n\t\t\tEnemy.entityList.remove(EnemyDeadList.get(i)-i);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tAllyDeadList.clear();\r\n\t\tEnemyDeadList.clear();\r\n\t\tfor(int i = 0; i < Ally.entityList.size(); i++) {\r\n\t\t\tif(Ally.entityList.get(i).returnHealth() <= 0) {\r\n\t\t\t\tAllyDeadList.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < Enemy.entityList.size(); i++) {\r\n\t\t\tif(Enemy.entityList.get(i).returnHealth() <= 0) {\r\n\t\t\t\tEnemyDeadList.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void drawEnemies(){\n for (Object e : world.getEnemies()) {\n Enemy enemy = (Enemy) e;\n if (enemy instanceof EnemyPistol) {\n spriteBatch.draw(enemyPistolTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }else if (enemy instanceof EnemyAwp){\n spriteBatch.draw(enemyAWPTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }else if (enemy instanceof EnemyStalker){\n spriteBatch.draw(enemyStalkerTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }else if (enemy instanceof EnemyBoss){\n spriteBatch.draw(enemyBossTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }\n }\n }", "public void update(){\n if(clearing) {\n attacks.clear();\n attacksToAdd.clear();\n attacksToDelete.clear();\n playerAttackCount = 0;\n clearing = false;\n } else {\n for (AttackObject attack : attacks) {\n attack.update();\n checkAttackCollisionsFor(attack);\n checkAttackReachedEnd(attack);\n if (attack.wasDestroyed()) {\n onAttackDestroyed(attack);\n }\n }\n deleteAttacks();\n addAttacks();\n }\n }", "public void updateScoreEnemies(int enemiesDestroyed) {\n\t\tscore = (int) (score + (enemiesDestroyed * VALUE_ENEMY));\n\t}", "public static void makeEnemyMove() { //all players after index 1 are enemies\n if (gameMode == EARTH_INVADERS) {//find leftmost and rightmost vehicle columns to see if we need to move down\n int leftMost = board[0].length;\n int rightMost = 0;\n int lowest = 0;\n for (int i = FIRST_VEHICLE; i < players.length; i++) {//find left-most, right-most and lowest most vehicles (non aircraft/train) to determine how formation should move\n Player curr = players[i];\n if (curr == null)\n continue;\n String name = curr.getName();\n if (name.equals(\"NONE\") || curr.isFlying() || name.startsWith(\"TRAIN\") || (curr instanceof Monster))\n continue;\n if (curr.getCol() < leftMost)\n leftMost = curr.getCol();\n if (curr.getCol() > rightMost)\n rightMost = curr.getCol();\n if (curr.getRow() > lowest)\n lowest = curr.getRow();\n curr.setHeadDirection(DOWN);\n }\n for (int i = FIRST_VEHICLE; i < players.length; i++) {//***move aircraft and trains\n Player curr = players[i];\n if (curr == null)\n continue;\n String name = curr.getName();\n if (name.equals(\"NONE\") || curr.isFlying() || name.startsWith(\"TRAIN\") || (curr instanceof Monster)) {\n if (curr.isMoving())\n continue;\n ArrayList<Integer> dirs = new ArrayList(); //array of preferred directions - everything but the reverse of their body position\n int bodyDir = curr.getBodyDirection();\n curr.clearDirections();\n int r = curr.getRow();\n int c = curr.getCol();\n if (bodyDir == UP) {\n if (isValidMove(curr, r - 1, c))\n dirs.add(UP);\n if (isValidMove(curr, r, c + 1))\n dirs.add(RIGHT);\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r, c - 1))\n dirs.add(LEFT);\n }\n } else if (bodyDir == RIGHT) {\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r - 1, c))\n dirs.add(UP);\n }\n if (isValidMove(curr, r, c + 1))\n dirs.add(RIGHT);\n if (isValidMove(curr, r + 1, c))\n dirs.add(DOWN);\n } else if (bodyDir == DOWN) {\n if (isValidMove(curr, r + 1, c))\n dirs.add(DOWN);\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r, c + 1))\n dirs.add(RIGHT);\n }\n if (isValidMove(curr, r, c - 1))\n dirs.add(LEFT);\n } else //if(curr.getBodyDirection()==LEFT)\n {\n if (isValidMove(curr, r - 1, c))\n dirs.add(UP);\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r + 1, c))\n dirs.add(DOWN);\n }\n if (isValidMove(curr, r, c - 1))\n dirs.add(LEFT);\n }\n int rand = 0;\n if (dirs.size() > 0)\n rand = dirs.get((int) (Math.random() * dirs.size()));\n if (curr.isFlying()) { //if aircraft is flying in the visible board, don't change direction\n if (r == 1 && (c == 0 || c == board[0].length - 1)) //we are in the first row but behind a border\n { //we only want aircraft to appear in row 1 in EARTH INVADERS (like the UFO in space invaders)\n if (bodyDir == LEFT || bodyDir == RIGHT) {\n rand = UP;\n if (Math.random() < .5)\n rand = DOWN;\n } else if (c == 0)\n rand = RIGHT;\n else if (c == board[0].length - 1)\n rand = LEFT;\n else\n //if(dirs.contains(bodyDir))\n rand = bodyDir;\n } else if (r == 0 || c == 0 || r == board.length - 1 || c == board[0].length - 1) {\n rand = bodyDir;\n if (r == 0 && c == 0) {\n rand = RIGHT;\n if (Math.random() < .5)\n rand = DOWN;\n } else if (r == 0 && c == board[0].length - 1) {\n rand = LEFT;\n if (Math.random() < .5)\n rand = DOWN;\n } else if (r == board.length - 1 && c == 0) {\n rand = RIGHT;\n if (Math.random() < .5)\n rand = UP;\n } else if (r == board.length - 1 && c == board[0].length - 1) {\n rand = LEFT;\n if (Math.random() < .5)\n rand = UP;\n }\n } else if (/*dirs.contains(bodyDir) && */(r > 0 && c > 0 && r < board.length - 1 && c < board[0].length - 1))\n rand = bodyDir; //make it so aircraft prefer to keep going the same direciton\n\n } else if (name.startsWith(\"TRAIN\")) {//make it so trains prefer to follow the right wall\n for (int j = 0; j < dirs.size(); j++)\n if (dirs.get(j) != bodyDir) {\n rand = dirs.get(j);\n break;\n }\n }\n curr.setDirection(rand);\n curr.setBodyDirection(rand);\n }\n }//***end aircraft/train movement\n if (leftMost == 1) //move vehicles down and start them moving right\n {\n if (EI_moving == LEFT) {\n EI_moving = DOWN;\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (lowest < board.length - 3 && !curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setRow(curr.getRow() + 1);\n }\n } else if (EI_moving == DOWN) {\n EI_moving = RIGHT;\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\")) {\n curr.setDirection(RIGHT);\n curr.setBodyDirection(RIGHT);\n }\n }\n } else if (EI_moving == RIGHT)\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setDirection(RIGHT);\n }\n }//***end leftmost is first col\n else if (rightMost == board[0].length - 2) //move vehicles down and start them moving left\n {\n if (EI_moving == RIGHT) {\n EI_moving = DOWN;\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (lowest < board.length - 3 && !curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setRow(curr.getRow() + 1);\n }\n } else if (EI_moving == DOWN) {\n EI_moving = LEFT;\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\")) {\n curr.setDirection(LEFT);\n curr.setBodyDirection(LEFT);\n }\n }\n } else if (EI_moving == LEFT)\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setDirection(LEFT);\n }\n }//***end rightmost is last col\n else if (EI_moving == LEFT)\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setDirection(LEFT);\n }\n else if (EI_moving == RIGHT)\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setDirection(RIGHT);\n }\n return;\n }//***end EARTH INVADERS enemy movements\n for (int i = 2; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n String name = curr.getName();\n int r = curr.getRow();\n int c = curr.getCol();\n if (r > 0 && c > 0 && r < board.length - 1 && c < board[0].length - 1 && (curr instanceof Vehicle))\n ((Vehicle) (curr)).setOnField(true);\n\n if (curr.isFlying() && webs[panel].size() > 0) {\n int x = curr.findX(cellSize);\n int y = curr.findY(cellSize);\n for (int p = 0; p < webs[panel].size(); p++) {\n int[] ray = webs[panel].get(p);\n if (Utilities.isPointOnRay(x, y, ray[0], ray[1], ray[2], ray[3])) {\n explosions.add(new Explosion(\"BIG\", x, y, explosionImages, animation_delay));\n Ordinance.radiusDamage(-1, x, y, 25, panel, .5);\n Spawner.resetEnemy(i);\n webs[panel].remove(p);\n p--;\n Structure str1 = structures[ray[4]][ray[5]][panel];\n Structure str2 = structures[ray[6]][ray[7]][panel];\n if (str1 != null)\n str1.setWebValue(0);\n if (str2 != null)\n str2.setWebValue(0);\n Utilities.updateKillStats(curr);\n break;\n }\n }\n }\n //reset any ground vehicle that ended up in the water\n //reset any train not on tracks - we need this because a player might change panels as a vehicle spawns\n if (name.startsWith(\"TRAIN\")) {\n Structure str = structures[r][c][panel];\n if (str != null && str.getName().equals(\"hole\") && str.getHealth() != 0) {\n explosions.add(new Explosion(\"BIG\", curr.getX() - (cellSize / 2), curr.getY() - (cellSize / 2), puffImages, animation_delay));\n Utilities.updateKillStats(curr);\n Spawner.resetEnemy(i);\n continue;\n } else if (board[r][c][panel].startsWith(\"~\")) {\n explosions.add(new Explosion(\"BIG\", curr.getX() - (cellSize / 2), curr.getY() - (cellSize / 2), puffImages, animation_delay));\n Spawner.resetEnemy(i);\n continue;\n } else if (!board[r][c][panel].startsWith(\"T\")) {\n explosions.add(new Explosion(\"SMALL\", curr.getX() - (cellSize / 2), curr.getY() - (cellSize / 2), puffImages, animation_delay));\n Spawner.resetEnemy(i);\n continue;\n }\n } else //ground vehicles\n if (!curr.isFlying() && !curr.getName().startsWith(\"BOAT\") && (curr instanceof Vehicle)) {\n\n if (((Vehicle) (curr)).getStunTime() > numFrames) //ground unit might be stunned by WoeMantis shriek\n continue;\n if (board[r][c][panel].startsWith(\"~\")) {\n explosions.add(new Explosion(\"SMALL\", curr.getX() - (cellSize / 2), curr.getY() - (cellSize / 2), puffImages, animation_delay));\n Spawner.resetEnemy(i);\n continue;\n }\n } else //reset any water vehicle that ended up on land\n if (name.startsWith(\"BOAT\")) {\n if (!board[r][c][panel].startsWith(\"~\")) {\n explosions.add(new Explosion(\"SMALL\", curr.getX() - (cellSize / 2), curr.getY() - (cellSize / 2), puffImages, animation_delay));\n Spawner.resetEnemy(i);\n continue;\n }\n } else if (curr.getHealth() <= 0) {\n Spawner.resetEnemy(i);\n continue;\n }\n\n //if a ground unit has been on the playable field and leaves it, respawn them\n if (!curr.isFlying() && !name.startsWith(\"TRAIN\") && (curr instanceof Vehicle)) {\n if ((r == 0 || c == 0 || r == board.length - 1 || c == board[0].length - 1) && ((Vehicle) (curr)).getOnField()) {\n ((Vehicle) (curr)).setOnField(false);\n Spawner.resetEnemy(i);\n continue;\n }\n }\n if (name.endsWith(\"nukebomber\")) {//for the nukebomber, set the detonation coordinates so nuke fires when the plane exits the field\n int dr = curr.getDetRow();\n int dc = curr.getDetCol();\n int bd = curr.getBodyDirection();\n int dd = curr.getDetDir();\n if (bd == dd && (((bd == LEFT || bd == RIGHT) && c == dc) || (bd == UP || bd == DOWN) && r == dr)) {\n Ordinance.nuke();\n curr.setDetRow(-1);\n curr.setDetCol(-1);\n }\n }\n\n if (curr.isMoving())\n continue;\n int bodyDir = curr.getBodyDirection();\n curr.clearDirections();\n int[] target = isMonsterInSight(curr);\n int mDir = target[0]; //direction of the monster, -1 if none\n int monsterIndex = target[1]; //index of the monster in the players array, -1 if none\n ArrayList<Integer> dirs = new ArrayList(); //array of preferred directions - everything but the reverse of their body position\n if (bodyDir == UP) {\n if (isValidMove(curr, r - 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == UP) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(UP);\n }\n if (isValidMove(curr, r, c + 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == RIGHT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(RIGHT);\n }\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r, c - 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == LEFT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(LEFT);\n }\n }\n } else if (bodyDir == RIGHT) {\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r - 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == UP) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(UP);\n }\n }\n if (isValidMove(curr, r, c + 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == RIGHT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(RIGHT);\n }\n if (isValidMove(curr, r + 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == DOWN) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(DOWN);\n }\n } else if (bodyDir == DOWN) {\n if (isValidMove(curr, r + 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == DOWN) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(DOWN);\n }\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r, c + 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == RIGHT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(RIGHT);\n }\n }\n if (isValidMove(curr, r, c - 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == LEFT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(LEFT);\n }\n } else //if(curr.getBodyDirection()==LEFT)\n {\n\n if (isValidMove(curr, r - 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == UP) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(UP);\n }\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r + 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == DOWN) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(DOWN);\n }\n }\n if (isValidMove(curr, r, c - 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == LEFT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(LEFT);\n }\n }\n\n if (dirs.size() > 0) {\n if (curr instanceof Monster) {//***MONSTER AI*******************\n double headTurnProb = 0.25;\n double stompProb = 0.5;\n int vDir = isVehicleInSight(curr);\n if (vDir >= 0) {\n boolean airShot = false;\n int vD = vDir;\n if (vD >= 10) {\n airShot = true;\n vD -= 10;\n }\n if (curr.head360() || !Utilities.oppositeDirections(vD, curr.getHeadDirection())) {\n curr.setHeadDirection(vD);\n if ((curr.getName().startsWith(\"Gob\") || curr.getName().startsWith(\"Boo\")) && numFrames >= curr.getLastShotTime() + curr.getReloadTime()) {\n Bullet temp = null;\n if (curr.getName().startsWith(\"Boo\")) {\n temp = new Bullet(curr.getName() + vD, curr.getX(), curr.getY(), 50, beamImages, SPEED, \"BEAM\", SPEED * 10, airShot, i, -1, -1);\n } else if (curr.getName().startsWith(\"Gob\")) {\n temp = new Bullet(\"flame\" + vD, curr.getX(), curr.getY(), 15, monsterFireImages, SPEED, \"FIRE\", SPEED * 4, airShot, i, -1, -1);\n }\n if (temp != null) {\n temp.setDirection(vD);\n bullets.add(temp);\n curr.setLastShotTime(numFrames);\n continue;\n }\n }\n }\n } else if (Math.random() < headTurnProb) {\n String hd = \"right\";\n if (Math.random() < .5)\n hd = \"left\";\n Utilities.turnHead(curr, hd);\n }\n Structure str = structures[r][c][panel];\n if (str != null && str.getHealth() > 0 && str.isDestroyable() && !str.getName().startsWith(\"FUEL\") && Math.random() < stompProb)\n playerMove(KeyEvent.VK_SPACE, i);\n else {\n int dir = dirs.get((int) (Math.random() * dirs.size()));\n if (dir == UP) {\n if (curr.getBodyDirection() != UP) {\n curr.setBodyDirection(UP);\n curr.setHeadDirection(UP);\n } else {\n if (!curr.isSwimmer() && board[r - 1][c][panel].equals(\"~~~\") && !board[r][c][panel].equals(\"~~~\")) {\n continue;\n }\n if (r - 1 >= 1) {\n str = structures[r - 1][c][panel]; //don't walk into a fire\n if (str != null && str.onFire())\n continue;\n }\n playerMove(KeyEvent.VK_UP, i);\n }\n } else if (dir == DOWN) {\n if (curr.getBodyDirection() != DOWN) {\n curr.setBodyDirection(DOWN);\n curr.setHeadDirection(DOWN);\n } else {\n if (!curr.isSwimmer() && board[r + 1][c][panel].equals(\"~~~\") && !board[r][c][panel].equals(\"~~~\")) {\n continue;\n }\n if (r + 1 <= structures.length - 1) {\n str = structures[r + 1][c][panel]; //don't walk into a fire\n if (str != null && str.onFire())\n continue;\n }\n playerMove(KeyEvent.VK_DOWN, i);\n }\n } else if (dir == LEFT) {\n if (curr.getBodyDirection() != LEFT) {\n curr.setBodyDirection(LEFT);\n curr.setHeadDirection(LEFT);\n } else {\n if (!curr.isSwimmer() && board[r][c - 1][panel].equals(\"~~~\") && !board[r][c][panel].equals(\"~~~\")) {\n continue;\n }\n if (c - 1 >= 1) {\n str = structures[r][c - 1][panel]; //don't walk into a fire\n if (str != null && str.onFire())\n continue;\n }\n playerMove(KeyEvent.VK_LEFT, i);\n }\n } else if (dir == RIGHT) {\n if (curr.getBodyDirection() != RIGHT) {\n curr.setBodyDirection(RIGHT);\n curr.setHeadDirection(RIGHT);\n } else {\n if (!curr.isSwimmer() && board[r][c + 1][panel].equals(\"~~~\") && !board[r][c][panel].equals(\"~~~\")) {\n continue;\n }\n if (c + 1 <= board[0].length - 1) {\n str = structures[r][c + 1][panel]; //don't walk into a fire\n if (str != null && str.onFire())\n continue;\n }\n playerMove(KeyEvent.VK_RIGHT, i);\n }\n }\n }\n continue;\n }//end monster AI movement\n else //shoot at a target\n if (name.endsWith(\"troops\") || name.endsWith(\"jeep\") || name.endsWith(\"police\") || name.startsWith(\"TANK\") || name.endsWith(\"coastguard\") || name.endsWith(\"destroyer\") || name.endsWith(\"fighter\") || name.equals(\"AIR bomber\")) {\n boolean airShot = false;\n if (gameMode == EARTH_INVADERS) //we don't want vehicles to shoot each other\n {\n airShot = true;\n curr.setHeadDirection(DOWN);\n }\n if (monsterIndex >= 0 && monsterIndex < players.length && players[monsterIndex].isFlying())\n airShot = true;\n if (curr.getName().endsWith(\"fighter\"))\n curr.setDirection(bodyDir); //keep moving while shooting\n if (mDir != -1 && curr.getRow() > 0 && curr.getCol() > 0 && curr.getRow() < board.length - 1 && curr.getCol() < board[0].length - 1) { //don't shoot from off the visible board\n if ((mDir == bodyDir || ((curr.getName().startsWith(\"TANK\") || curr.getName().endsWith(\"jeep\") || name.equals(\"AIR bomber\")) && (mDir == curr.getHeadDirection() || name.equals(\"AIR bomber\")))) && numFrames >= curr.getLastShotTime() + curr.getReloadTime()) { //AIR bomber needs to be able to drop bombs if they see the monster in front of them or behind them, so we need to check the name in two conditions\n Bullet temp;\n if (name.endsWith(\"jeep\") || name.endsWith(\"coastguard\")) {\n channels[0].programChange(instr[GUNSHOT].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 6) + 65, (int) (Math.random() * 10) + 30);\n temp = new Bullet(\"jeep\" + mDir, curr.getX(), curr.getY(), 5, machBulletImages, SPEED, \"BULLET\", SPEED * 6, airShot, i, -1, -1);\n } else if (name.endsWith(\"troops\") || name.endsWith(\"police\")) {\n channels[0].programChange(instr[GUNSHOT].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 6) + 70, (int) (Math.random() * 10) + 20);\n temp = new Bullet(\"troops\" + mDir, curr.getX(), curr.getY(), 3, bulletImages, SPEED, \"BULLET\", SPEED * 6, airShot, i, -1, -1);\n } else if (name.endsWith(\"destroyer\") || name.endsWith(\"artillery\")) {\n channels[0].programChange(instr[GUNSHOT].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 6) + 45, (int) (Math.random() * 10) + 85);\n temp = new Bullet(\"destroyer\" + mDir, curr.getX(), curr.getY(), 15, shellImages, SPEED, \"SHELL\", SPEED * 3, true, i, players[monsterIndex].findX(cellSize), players[monsterIndex].findY(cellSize));\n } else if (name.endsWith(\"fighter\")) {\n channels[0].programChange(instr[TAIKO].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 10) + 5, (int) (Math.random() * 10) + 40);\n temp = new Bullet(\"fighter\" + mDir, curr.getX(), curr.getY(), 30, rocketImages, SPEED, \"SHELL\", SPEED * 8, true, i, players[monsterIndex].findX(cellSize), players[monsterIndex].findY(cellSize));\n } else if (name.endsWith(\"missile\")) {\n temp = new Bullet(\"missile\" + mDir, curr.getX(), curr.getY(), 50, rocketImages, SPEED, \"SHELL\", SPEED * 3, true, i, players[monsterIndex].findX(cellSize), players[monsterIndex].findY(cellSize));\n channels[0].programChange(instr[TAIKO].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 10) + 5, (int) (Math.random() * 10) + 40);\n } else if (name.endsWith(\"flame\")) {\n temp = new Bullet(\"flame\" + mDir, curr.getX(), curr.getY(), 15, monsterFireImages, SPEED, \"FIRE\", SPEED * 4, airShot, i, -1, -1);\n channels[0].programChange(instr[TAIKO].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 10) + 5, (int) (Math.random() * 10) + 40);\n } else if (name.equals(\"AIR bomber\")) {\n temp = null;\n if (!DISABLE_BOMBERS) {\n int mR = players[PLAYER1].getRow(); //main player row & col\n int mC = players[PLAYER1].getCol();\n int mR2 = -99; //possible 2nd monster row & col\n int mC2 = -99;\n if (p1partner) {\n mR2 = players[PLAYER2].getRow();\n mC2 = players[PLAYER2].getCol();\n }\n if (players[PLAYER1].getHealth() > 0 && (Math.abs(r - mR) <= 2 || Math.abs(c - mC) <= 2 || Math.abs(r - mR2) <= 2 || Math.abs(c - mC2) <= 2)) {//our bomber is in the same row & col as a monster + or - 1\n if (bodyDir == UP && r < board.length - 1) {\n Ordinance.bigExplosion(curr.getX(), curr.getY() + (cellSize * 2), panel);\n Ordinance.radiusDamage(-1, curr.getX(), curr.getY() + (cellSize * 2), 50, panel, .25);\n } else if (bodyDir == DOWN && r > 1) {\n Ordinance.bigExplosion(curr.getX(), curr.getY() - (cellSize * 2), panel);\n Ordinance.radiusDamage(-1, curr.getX(), curr.getY() - (cellSize * 2), 50, panel, .25);\n } else if (bodyDir == RIGHT && c < board[0].length - 1) {\n Ordinance.bigExplosion(curr.getX() - (cellSize * 2), curr.getY(), panel);\n Ordinance.radiusDamage(-1, curr.getX() - (cellSize * 2), curr.getY(), 50, panel, .25);\n } else if (bodyDir == LEFT && c > 1) {\n Ordinance.bigExplosion(curr.getX() + (cellSize * 2), curr.getY(), panel);\n Ordinance.radiusDamage(-1, curr.getX() + (cellSize * 2), curr.getY(), 50, panel, .25);\n }\n }\n }\n } else {\n channels[0].programChange(instr[GUNSHOT].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 6) + 45, (int) (Math.random() * 10) + 85);\n temp = new Bullet(\"\" + mDir, curr.getX(), curr.getY(), 15, shellImages, SPEED, \"SHELL\", SPEED * 5, airShot, i, -1, -1);\n }\n if (temp != null)\n temp.setDirection(mDir);\n\n if (name.endsWith(\"troops\") || name.endsWith(\"police\") && Math.random() < .5) //make the police move towards the monster half the time\n {\n if (mDir == UP && isValidMove(curr, curr.getRow() - 1, curr.getCol()))\n curr.setDirection(UP);\n else if (mDir == DOWN && isValidMove(curr, curr.getRow() + 1, curr.getCol()))\n curr.setDirection(DOWN);\n else if (mDir == LEFT && isValidMove(curr, curr.getRow(), curr.getCol() - 1))\n curr.setDirection(LEFT);\n else if (mDir == RIGHT && isValidMove(curr, curr.getRow(), curr.getCol() + 1))\n curr.setDirection(RIGHT);\n else\n curr.setDirection(-1);\n }\n if (temp != null && players[PLAYER1].getHealth() > 0) {\n if (gameMode == EARTH_INVADERS && !curr.isFlying()) {\n } else {\n if (numFrames >= ceaseFireTime + ceaseFireDuration || gameMode == EARTH_INVADERS) {\n bullets.add(temp);\n curr.setLastShotTime(numFrames);\n continue;\n }\n }\n }\n } else //change to face the monster to line up a shot\n {\n if (name.endsWith(\"troops\") || name.endsWith(\"police\") || name.endsWith(\"destroyer\") || name.endsWith(\"coastguard\") || name.endsWith(\"artillery\")) {\n curr.setDirection(-1); //stop to shoot\n curr.setBodyDirection(mDir);\n } else if (curr.getName().startsWith(\"TANK\") || curr.getName().endsWith(\"jeep\"))\n curr.setHeadDirection(mDir);\n continue;\n }\n }\n }\n int rand = dirs.get((int) (Math.random() * dirs.size()));\n if (curr.isFlying() && (r > 0 && c > 0 && r < board.length - 1 && c < board[0].length - 1)) {\n rand = bodyDir; //make it so aircraft prefer to keep going the same direciton\n } else if (name.startsWith(\"TRAIN\")) {//make it so trains prefer to follow the right wall\n for (int j = 0; j < dirs.size(); j++)\n if (dirs.get(j) != bodyDir) {\n rand = dirs.get(j);\n break;\n }\n }\n curr.setDirection(rand);\n curr.setBodyDirection(rand);\n\n continue;\n }\n //if no preferred direction, include the option to turn around\n //civilians should prefer to turn around rather than approach the monster\n if (name.endsWith(\"civilian\") || name.endsWith(\"bus\")) {\n if (bodyDir == mDir) //if we are facing the same direction as the monster, turn around\n {\n if (bodyDir == UP && isValidMove(curr, curr.getRow() + 1, curr.getCol())) {\n curr.setDirection(DOWN);\n curr.setBodyDirection(DOWN);\n continue;\n } else if (bodyDir == DOWN && isValidMove(curr, curr.getRow() - 1, curr.getCol())) {\n curr.setDirection(UP);\n curr.setBodyDirection(UP);\n continue;\n } else if (bodyDir == LEFT && isValidMove(curr, curr.getRow(), curr.getCol() + 1)) {\n curr.setDirection(RIGHT);\n curr.setBodyDirection(RIGHT);\n continue;\n } else if (bodyDir == RIGHT && isValidMove(curr, curr.getRow(), curr.getCol() - 1)) {\n curr.setDirection(LEFT);\n curr.setBodyDirection(LEFT);\n continue;\n }\n }\n }\n int rand = (int) (Math.random() * 4);\n if (rand == UP && isValidMove(curr, curr.getRow() - 1, curr.getCol())) {\n curr.setDirection(UP);\n curr.setBodyDirection(UP);\n continue;\n }\n if (rand == DOWN && isValidMove(curr, curr.getRow() + 1, curr.getCol())) {\n curr.setDirection(DOWN);\n curr.setBodyDirection(DOWN);\n continue;\n }\n if (rand == LEFT && isValidMove(curr, curr.getRow(), curr.getCol() - 1)) {\n curr.setDirection(LEFT);\n curr.setBodyDirection(LEFT);\n continue;\n }\n if (rand == RIGHT && isValidMove(curr, curr.getRow(), curr.getCol() + 1)) {\n curr.setDirection(RIGHT);\n curr.setBodyDirection(RIGHT);\n continue;\n }\n\n }\n }", "public void enemySpawner(){\n\t\tif (spawnFrame >= spawnTime){\n\t\t\tfor(int i =0;i<enemies.size();i++){\n\t\t\t\tif (!enemies.get(i).getInGame()){\n\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy);\n\t\t\t\t\tbreak;\n\t\t\t\t\t/*if (enemies.get(i).getNum()==1){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (enemies.get(i).getNum()==2){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy2);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (enemies.get(i).getNum()==3){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy3);\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\n\t\t\t\t}\n\t\t\t}\n\t\t\tspawnFrame=0;\n\t\t} else{\n\t\t\tspawnFrame+=1;\n\t\t}\n\t}", "public boolean update() {\r\n\t\tboolean erase = false;\r\n\t\tif (game.searchInPosition(x+1, y)) {\r\n\t\t\tgame.damageFromEnemy(x+1, y);\r\n\t\t\terase = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\terase = move();\r\n\t\t}\r\n\t\treturn erase;\r\n\t}", "public void killedByPlayer() {\r\n\t\tscreen.enemiesKilled++;\r\n\t\tMazeCrawler mc = screen.mazeHandler.mazeCrawler;\r\n\t\tint n = 2; //if enemy is large do movement n+1 times\r\n\t\tswitch (enemyType) {\r\n\t\tcase DOWN:\r\n\t\t\tmc.moveDown();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveDown();}\r\n\t\t\tbreak;\r\n\t\tcase LEFT:\r\n\t\t\tmc.moveLeft();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveLeft();}\r\n\t\t\tbreak;\r\n\t\tcase RIGHT:\r\n\t\t\tmc.moveRight();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveRight();}\r\n\t\t\tbreak;\r\n\t\tcase UP:\r\n\t\t\tmc.moveUp();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveUp();}\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tscreen.enemyDeath.play(.5f);\r\n\t\tdestroy();\r\n\t}", "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 update(){\n if(newPlayer.getRunning()) {\n\n if (botborder.isEmpty())\n {\n newPlayer.setRunning(false);\n return;\n }\n if (topborder.isEmpty())\n {\n newPlayer.setRunning(false);\n return;\n }\n\n background.update();\n newPlayer.update();\n\n\n //A threshold that the border can have based on the score\n maxBorderHeight = 30+newPlayer.getScore()/difficulty;\n if (maxBorderHeight > height/4){\n maxBorderHeight = height/4;\n minBorderHeight = 5+newPlayer.getScore()/difficulty;\n }\n\n for (int i = 0; i < topborder.size(); i++){\n if (collision(topborder.get(i), newPlayer)){\n newPlayer.setRunning(false);\n }\n }\n for (int i = 0; i < botborder.size(); i++){\n if (collision(botborder.get(i), newPlayer)){\n newPlayer.setRunning(false);\n }\n }\n\n this.updateTopBorder();\n //Create the borders\n this.updateBotBorder();\n\n //Adds smoke from spaceship from the timer\n long timeElapsed = (System.nanoTime() - outTimer)/1000000;\n if(timeElapsed > 120){\n effect.add(new Effects(newPlayer.getX(), newPlayer.getY()+30)); //Balls will appear out of backside of spaceship.\n outTimer = System.nanoTime();\n }\n for (int i = 0; i < effect.size(); i++){\n //Go through every ball and then update\n effect.get(i).update();\n if (effect.get(i).getX()<-10){\n effect.remove(i); //Removes the balls that are off the screen\n }\n }\n\n //Adds enemies in, first one in middle, rest are random\n long enemyElapsed = (System.nanoTime()- enemyStart)/1000000;\n //Higher the score is, the less delay there is\n if (enemyElapsed> (1500 - newPlayer.getScore()/4)){\n\n if (enemy.size() == 0){\n enemy.add(new Enemy(BitmapFactory.decodeResource(getResources(),R.drawable.enemy1), width+10, height + 50,25, 30, 30, 1));\n }\n else {\n enemy.add(new Enemy(BitmapFactory.decodeResource(getResources(),R.drawable.enemy1), width + 10, (int) (rng.nextDouble()*(height-(maxBorderHeight*2))+maxBorderHeight),25,30, newPlayer.getScore(), 1));\n }\n //Reset Timer\n enemyStart = System.nanoTime();\n\n }\n\n long shipElapsed = (System.nanoTime()-secondaryTimer)/1000000;\n\n\n if (newPlayer.getScore() == 150){\n level = 2;\n }\n\n //Randomised spot for secondary enemy\n if (newPlayer.getScore()%150==0) {\n if (newEnemy.size() == 0) {\n newEnemy.add(new secondaryEnemy(BitmapFactory.decodeResource(getResources(), R.drawable.enemy2), width + 5, (int) (rng.nextDouble() * (height - (maxBorderHeight * 2)) + maxBorderHeight), 32, 26, 5, 1));\n newEnemy.add(new secondaryEnemy(BitmapFactory.decodeResource(getResources(), R.drawable.enemy2), width + 5, (int) (rng.nextDouble() * (height - (maxBorderHeight * 2)) + maxBorderHeight), 32, 26, 5, 1));\n }\n\n secondaryTimer = System.nanoTime();\n }\n\n long thirdElapsed = (System.nanoTime()- tertiaryTimer)/1000000;\n\n if (newPlayer.getScore() == 300){\n level = 3;\n }\n if (level == 3) {\n if (enemyElapsed> (1500 - newPlayer.getScore()/4))\n\n //CHANGE THIS YOU PLEB!!!!\n if (thirdEnemy.size() == 0) {\n thirdEnemy.add(new thirdShip(BitmapFactory.decodeResource(getResources(), R.drawable.longship), width + 10, (int) (rng.nextDouble() * (height - (maxBorderHeight * 2)) + maxBorderHeight), 31, 49, 45, 1));\n } else {\n thirdEnemy.add(new thirdShip(BitmapFactory.decodeResource(getResources(), R.drawable.longship), width + 10, (int) (rng.nextDouble() * (height - (maxBorderHeight * 2)) + maxBorderHeight), 31, 49, newPlayer.getScore()/4, 1));\n }\n\n //Reset Timer\n tertiaryTimer = System.nanoTime();\n }\n\n //Go through every enemy and collision will check if two game objects are colliding.\n for (int i = 0; i < enemy.size(); i++){\n enemy.get(i).update();\n if(collision(enemy.get(i), newPlayer)){\n enemy.remove(i);\n newPlayer.setRunning(false);\n break;\n }\n if (enemy.get(i).getX()<-100){\n enemy.remove(i);\n break;\n }\n }\n\n for (int i = 0; i < newEnemy.size(); i++) {\n newEnemy.get(i).update();\n if (collision(newEnemy.get(i), newPlayer)) {\n newEnemy.remove(i);\n newPlayer.setRunning(false);\n break;\n }\n if (newEnemy.get(i).getX() < -100) {\n newEnemy.remove(i);\n break;\n }\n }\n\n for (int i = 0; i < thirdEnemy.size(); i++) {\n thirdEnemy.get(i).update();\n if (collision(thirdEnemy.get(i), newPlayer)) {\n thirdEnemy.remove(i);\n newPlayer.setRunning(false);\n break;\n }\n if (thirdEnemy.get(i).getX() < -100) {\n thirdEnemy.remove(i);\n break;\n }\n }\n\n }\n else {\n //Reset the acceleration of the player, if not reset then the start death animation will occur and everything will reset\n newPlayer.resetAcceleration();\n if (!reset){\n gamenew = false;\n startDeath = System.nanoTime();\n reset = true;\n disappear = true;\n death = new deathAnimation(BitmapFactory.decodeResource(getResources(),R.drawable.damage), newPlayer.getX(),newPlayer.getY()-30,329,137,1);\n level = 1;\n }\n death.update();\n\n long timeElapsed = (System.nanoTime()-startDeath)/1000000;\n\n //If time has passed and there is no new game yet, then create a new game.\n if (timeElapsed > 2500 && !gamenew){\n newGame();\n }\n\n }\n }", "public void update(){\n\n // advance player and entity loader\n player.advance();\n entityloader.advance();\n\n // if the player is shooting\n if (player.isShooting){\n player.nextBullet--;\n if (player.nextBullet < 0){\n audioloader.play(\"plshoot\"); // play audio\n for (int i = -1; i <= 1; ++i){\n playerBullets.add(new Projectile<RectangleHitbox>(player.getCenterX(), player.getCenterY(), 500, 0, 270 + 2.5 * i, 0, 0, false, 1.5, true, 0,\n player.bulletSprite.getRectangleHitbox(player.bulletSize), player.bulletSprite.img.getScaledInstance(player.bulletSize, player.bulletSize, 1), 0, 0, this));\n } \n player.nextBullet = (int)(FPS / player.bulletsPerSecond);\n }\n }\n\n // Player bullets\n for (Projectile<RectangleHitbox> bullet : playerBullets){\n if (bullet.advance()){\n nextPlayerBullets.add(bullet);\n }\n }\n playerBullets.clear();\n for (Projectile<RectangleHitbox> bullet : nextPlayerBullets){\n playerBullets.add(bullet);\n }\n nextPlayerBullets.clear();\n\n // Circle Enemies\n for (Projectile<CircleHitbox> enemy : circleEnemies){\n if (player.invulnerableTime <= 0 && enemy.getHitbox().intersects(player.getHitbox())){\n loseLife();\n }\n if (!enemy.isBullet){ // if enemy is not a bullet, check if it is being hit by player bullets\n boolean hit = false; // each enemy can only be hit once each frame\n for (Projectile<RectangleHitbox> bullet : playerBullets){\n hit |= bullet.getHitbox().intersects(enemy.getHitbox());\n if (hit)\n break;\n }\n if (hit){\n enemy.damageTaken += enemy.originalLifetime * enemy.percentDamage;\n }\n }\n if (enemy.advance()){ // if enemy lifetime is not up\n nextCircleEnemies.add(enemy); // add to next frame\n } else if (enemy.id != 0) { // if lifetime is up\n // tell entity loader enemy with that id is removed\n entityloader.setUnactive(enemy.id);\n }\n }\n circleEnemies.clear();\n for (Projectile<CircleHitbox> enemy : nextCircleEnemies){ // swap nextCircleEnemies with circleEnemies\n circleEnemies.add(enemy);\n }\n nextCircleEnemies.clear();\n\n // Rectangle Enemies\n for (Projectile<RectangleHitbox> enemy : rectangleEnemies){\n if (player.invulnerableTime <= 0 && enemy.getHitbox().intersects(player.getHitbox())){\n loseLife();\n }\n if (enemy.advance()){ // if enemy lifetime is not up\n nextRectangleEnemies.add(enemy); // add to next frame\n } else if (enemy.id != 0) { // if lifetime is up\n // tell entity loader enemy with that id is removed\n entityloader.setUnactive(enemy.id);\n }\n }\n rectangleEnemies.clear();\n for (Projectile<RectangleHitbox> enemy : nextRectangleEnemies){ // swap nextRectangleEnemies with rectangleEnemies\n rectangleEnemies.add(enemy);\n }\n nextRectangleEnemies.clear();\n\n }", "private void handleCollisions() {\n\t\t\n\t\tfor (ArrayList<Invader> row : enemyArray) {\n\t\t\tfor (Invader a : row) {\n\t\t\t\tcheckInvaderDeath(a);\n\t\t\t\tcheckPlayerDeath(a);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (Shot s : enemyShotList) {\n\t\t\t\n\t\t\tif (s.detectDownwardCollision(player.getX(), player.getY())) {\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tcollectPowerUp(armorPiercing);\n\t\tcollectPowerUp(explosive);\n\t}", "public void updatePosition()\r\n\t{\r\n\t\tsuper.updatePosition();\r\n\t\t\r\n\t\t// Update the bomb's position\r\n\t\tPoint nextPosition = getPath().getLocation(t++);\r\n\t\tsetX(nextPosition.x + startX);\r\n\t\tint nextY = nextPosition.y + startY;\r\n\t\tsetY(nextY);\r\n\t\t\r\n\t\t// Blow the bomb up after it reaches mid screen\r\n\t\tif (t > 120 || (nextY < (Global.WINDOW_HEIGHT >> 1) && t > 30))\r\n\t\t{\r\n\t\t\tbombSound.stop();\r\n\t\t\tsuper.remove();\r\n\t\t\tGamePanel.makeExplosion(getX(), getY());\r\n\t\t\t\r\n\t\t\t// Injure all the enemies on the screen\r\n\t\t\t\r\n\t\t\tArrayList<Sprite> sprites = GamePanel.getSprites();\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < sprites.size(); i++)\r\n\t\t\t{\r\n\t\t\t\tif (sprites.get(i) instanceof Enemy)\r\n\t\t\t\t{\r\n\t\t\t\t\tEnemy enemy = (Enemy) sprites.get(i);\r\n\t\t\t\t\t\r\n\t\t\t\t\tint currentYTop = GamePanel.getLevel().getCurrentY() +\r\n\t\t\t\t\t\tBLOCKS_PER_Y - 1;\r\n\t\t\t\t\tboolean visibleX = enemy.getX() + enemy.getWidth() >= 0 &&\r\n\t\t\t\t\t\tenemy.getX() <= Global.WINDOW_WIDTH;\r\n\t\t\t\t\tboolean yOnScreen = enemy.getY() <= Global.WINDOW_HEIGHT +\r\n\t\t\t\t\t\t100;\r\n\t\t\t\t\tboolean visibleY = enemy.getYBlock() >= currentYTop &&\r\n\t\t\t\t\t\tyOnScreen;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (visibleX && visibleY && enemy.isAlive())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tenemy.offsetHealth(-300);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (enemy.getHealth() <= 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tenemy.remove();\r\n\t\t\t\t\t\t\tGamePanel.offsetNumLevelPoints(100);\r\n\t\t\t\t\t\t\tGamePanel.makeExplosion(enemy.getX(), enemy.getY());\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}\r\n\t}", "public void playEnemy(){\n // System.out.println(\"staaaaaaaaaaaaaaaaaaaaar\"+character.getBlock());\n for(int i = 0 ; i < enemyController.getSize() ; i++){\n if (! enemies.get(i).isDead())\n effectHandler.playEnemy( i );\n }\n for( int i = 0 ; i < enemyController.getSize() ; i++){\n if (! enemies.get(i).isDead())\n effectHandler.endEnemyTurn(i);\n }\n\n }", "private void removeDeadEnemies() {\n ArrayList<Entity> deadEnemies = getAllEnemiesDead();\n if (deadEnemies.size() > 0) {\n for (Entity enemy : deadEnemies) {\n enemiesInCombat.remove(enemy);\n }\n }\n isStillInCombat();\n }", "public void checkCollision(){\n\r\n for(int i = 0; i < enemies.size(); i++){\r\n \r\n // Player and Enemy collision\r\n \r\n if(collide(this.player, enemies.get(i)) && this.player.isVisible() && enemies.get(i).isVisible()){\r\n System.out.println(\"Collide\");\r\n this.player.setHealth(this.player.getHealth() - 100);\r\n }\r\n\r\n // Player and Enemy bullet collision\r\n \r\n for(int j =0; j < enemies.get(i).getBullets().size(); j++){\r\n\r\n if(collide(this.player, enemies.get(i).getBullets().get(j)) && this.player.isVisible() && enemies.get(i).getBullets().get(j).isVisible()){\r\n\r\n enemies.get(i).getBullets().get(j).setVisible(false);\r\n this.player.setHealth(this.player.getHealth() - enemies.get(i).getBullets().get(j).getDamage());\r\n\r\n }\r\n }\r\n\r\n }\r\n //time = DEFAULT_TIME_DELAY;\r\n// }\r\n\r\n\r\n\r\n for(int i = 0; i < player.getBullets().size(); i++){\r\n\r\n\r\n // Player bullet and enemy collision\r\n\r\n for(int j = 0; j < enemies.size(); j++) {\r\n if (collide(enemies.get(j), player.getBullets().get(i)) && enemies.get(j).isVisible() && player.getBullets().get(i).isVisible()) {\r\n\r\n if (enemies.get(j).getHealth() < 0) {\r\n enemies.get(j).setVisible(false);\r\n score.addScore(100);\r\n }\r\n\r\n enemies.get(j).setHealth(enemies.get(j).getHealth() - player.getBullets().get(i).getDamage());\r\n // enemies.get(j).setColor(Color.RED);\r\n player.getBullets().get(i).setVisible(false);\r\n\r\n\r\n }\r\n }\r\n\r\n\r\n // Boss collision & player bullet collision\r\n\r\n if(collide(player.getBullets().get(i), this.boss1) && player.getBullets().get(i).isVisible() && boss1.isVisible()){\r\n\r\n if(boss1.getHealth() < 0){\r\n boss1.setVisible(false);\r\n score.addScore(1000);\r\n state = STATE.WIN;\r\n }\r\n this.boss1.setHealth(this.boss1.getHealth() - player.getBullets().get(i).getDamage());\r\n // this.boss1.setHealth(0);\r\n player.getBullets().get(i).setVisible(false);\r\n\r\n }\r\n\r\n }\r\n\r\n // Bullet vs Bullet Collision\r\n\r\n for(int k = 0 ; k < player.getBullets().size(); k++){\r\n\r\n if(player.getBullets().get(k).isVisible()) {\r\n for (int i = 0; i < enemies.size(); i++) {\r\n\r\n if(enemies.get(i).isVisible()) {\r\n for (int j = 0; j < enemies.get(i).getBullets().size(); j++) {\r\n\r\n if (collide(player.getBullets().get(k), enemies.get(i).getBullets().get(j)) && enemies.get(i).getBullets().get(j ).isVisible()) {\r\n\r\n\r\n System.out.println(\"bullets colliding\");\r\n\r\n player.getBullets().get(k).setVisible(false);\r\n enemies.get(i).getBullets().get(j).setColor(Color.yellow);\r\n enemies.get(i).getBullets().get(j).deflect(this.player.getX() + this.player.getW()/2, this.player.getY() + this.player.getH()/2);\r\n\r\n player.getBullets().add(enemies.get(i).getBullets().get(j));\r\n\r\n enemies.get(i).getBullets().remove(enemies.get(i).getBullets().get(j)); //removes bullet\r\n\r\n\r\n k++;\r\n j--;\r\n //enemies.get(i).getBullets().get(j).setVisible(false);\r\n }\r\n }\r\n }\r\n }\r\n\r\n\r\n for(int i = 0; i < boss1.getBullets().size(); i++) {\r\n\r\n\r\n if (collide(player.getBullets().get(k), boss1.getBullets().get(i)) && boss1.getBullets().get(i).isVisible()) {\r\n\r\n System.out.println(\"boss bullets colliding\");\r\n player.getBullets().get(k).setVisible(false);\r\n boss1.getBullets().get(i).setColor(Color.yellow);\r\n boss1.getBullets().get(i).deflect(this.player.getX() + this.player.getW()/2, this.player.getY() + this.player.getH()/2);\r\n player.getBullets().add(boss1.getBullets().get(i));\r\n boss1.getBullets().remove(boss1.getBullets().get(i));\r\n k++;\r\n i--;\r\n\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Boss bullet and player collision\r\n\r\n for(Bullet b : boss1.getBullets() ){\r\n\r\n\r\n if(collide(player, b) && player.isVisible() && b.isVisible()){\r\n b.setVisible(false);\r\n player.setHealth(player.getHealth() - b.getDamage());\r\n }\r\n }\r\n\r\n\r\n // Power up collision\r\n\r\n for(PowerUp p : powerUps){\r\n\r\n if(collide(player, p) && p.isVisible()){\r\n\r\n p.executeEffect(this.player);\r\n p.setVisible(false);\r\n }\r\n }\r\n\r\n\r\n\r\n // Deleting out of bound bullets\r\n for(int i = 0; i < player.getBullets().size(); i++){\r\n if(player.getBullets().get(i).getY() < 0 || player.getBullets().get(i).getY() > GameWorld.SCREEN_H ||\r\n player.getBullets().get(i).getX()< 0 || player.getBullets().get(i).getX() > GameWorld.SCREEN_W) {\r\n\r\n player.getBullets().remove(player.getBullets().get(i));\r\n }\r\n }\r\n\r\n }", "public void prisonerUpdate(){\r\n\t\t//check if a enemy has been spotted\r\n\t\tif (checkSight()){\r\n\t\t\tseen = true;\r\n\t\t} if (seen) {\r\n\t\t\tcreature.setSpeed(1.5);\r\n\t\t\tchaseEnemy(seenEnemy, 5);\r\n\t\t\treturn; //if player has been spotted end method here\r\n\t\t}\r\n\t\t//if no enemy has been spotted\r\n\t\tcreature.setSpeed(1);\r\n\t\tcreature.setAttacking(false);\r\n\t\troamArea();\r\n\t\tif (!checkCollision(x, y)) {\r\n\t\tgoToLocation(x, y);\r\n\t\t}\r\n\t}", "public void update() {\n if (player.getPlaying()) { //if player alive\n bg.update(); //update background\n player.update(); //update player\n //player collision detection, if player hits any baddies or their bullets is playing sets to false\n for (int i = 0; i < gargants.size(); i++) {\n if (collision(gargants.get(i), player)) {\n //gargants.remove(i);\n player.setPlaying(false);\n\n }\n for (int j = 0; j < demons.size(); j++) {\n if (collision(demons.get(j), player)) {\n //demons.remove(j);\n player.setPlaying(false);\n\n }\n for (int k = 0; k < dragons.size(); k++) {\n if (collision(dragons.get(k), player)) {\n //dragons.remove(k);\n player.setPlaying(false);\n\n }\n for (int l = 0; l < demonShots.size(); l++) {\n if (collision(demonShots.get(l), player)) {\n //demonShots.remove(l);\n player.setPlaying(false);\n\n }\n\n }\n }\n }\n }\n\n for (int i = 0; i < bullets.size(); i++) { //for each bullet\n bullets.get(i).update(); //update them\n if (bullets.get(i).getX() > WIDTH + 10) {\n bullets.remove(i); //if off screen delete\n }\n }\n\n for (int i = 0; i < demonShots.size(); i++) { // for each demon bullet\n demonShots.get(i).update(); //update them\n if (demonShots.get(i).getX() < -100) {\n demonShots.remove(i); //if off screen delete\n }\n }\n\n long gargantElapseTime = (System.nanoTime() - gargantStartTime) / 1000000;\n if (gargantElapseTime > (1200 - player.getScore() / 3)) { //as score increases, more will spawn\n gargants.add(new Gargant(BitmapFactory.decodeResource(getResources(), R.drawable.gargant), WIDTH + 10, (int) (rand.nextDouble() * (HEIGHT)), 64, 64, 8));\n if (gargants.size() >= 13) { //limit amount of this enemy to 13\n gargants.remove(gargants.size() - 1);\n }\n gargantStartTime = System.nanoTime();\n }\n for (int i = 0; i < gargants.size(); i++) { // for each gargant\n gargants.get(i).update(); //update them\n for (int j = 0; j < bullets.size(); j++) {\n if (collision(gargants.get(i), bullets.get(j))) {\n //when shot remove enemy and bullet\n gargants.remove(i);\n bullets.remove(j);\n player.addScore(10); //10 score for these guys\n break;\n }\n }\n if (gargants.get(i).getX() < -100) {\n gargants.remove(i); //if off screen remove\n }\n }\n\n if (level >= 3) { //only spawn demon above level 3\n long demonElapseTime = (System.nanoTime() - demonStartTime) / 1000000;\n if (demonElapseTime > (12000 - player.getScore() / 3)) { //as score increases, more will spawn\n demons.add(new Demon(BitmapFactory.decodeResource(getResources(), R.drawable.demon), WIDTH + 10, (int) (rand.nextDouble() * (HEIGHT)), 64, 64, 8));\n if (demons.size() >= 10) { //limit amount of this enemy to 10\n demons.remove(demons.size() - 1);\n }\n demonStartTime = System.nanoTime();\n }\n for (int i = 0; i < demons.size(); i++) { //for each demon\n demons.get(i).update(); //update them\n int n = rand.nextInt(1001); //random int between 1 and 1000\n if (n > 980) { //if random int > 980 shoot demon bullet\n demonShots.add(new HellFire(BitmapFactory.decodeResource(getResources(), R.drawable.hellfire_0), demons.get(i).getX(), demons.get(i).getY(), 64, 64));\n }\n for (int j = 0; j < bullets.size(); j++) {\n if (collision(demons.get(i), bullets.get(j))) {\n demonHitCount++; //each hit with bullet increases hitcount\n bullets.remove(j);\n if (demonHitCount >= 10) { //when hit more than 10 times it dies\n demonHitCount = 0;\n demons.remove(i);\n bullets.remove(j);\n player.addScore(100); //100 score for these big bois\n }\n }\n }\n if (demons.get(i).getX() < -100) {\n demons.remove(i); //if off screen delete\n }\n }\n }\n\n\n if (level >= 2) { //only spawn dragon above level 3\n long dragonElapseTime = (System.nanoTime() - dragonStartTime) / 1000000;\n if (dragonElapseTime > (6000 - player.getScore() / 3)) { //as score increases, more will spawn\n dragons.add(new Dragon(BitmapFactory.decodeResource(getResources(), R.drawable.dragon), WIDTH + 10, (int) (rand.nextDouble() * (HEIGHT)), 128, 128, 8));\n if (dragons.size() >= 5) { //dragons limitted to only 5\n dragons.remove(dragons.size() - 1);\n }\n dragonStartTime = System.nanoTime();\n }\n for (int i = 0; i < dragons.size(); i++) {\n dragons.get(i).update();\n for (int j = 0; j < bullets.size(); j++) {\n if (collision(dragons.get(i), bullets.get(j))) {\n dragonHitCount++; //if hit increase hitcount\n bullets.remove(j);\n if (dragonHitCount >= 4) { //when hit 4 times it dies\n dragonHitCount = 0;\n dragons.remove(i);\n bullets.remove(j);\n player.addScore(25); //25 score for dragons\n }\n break;\n }\n }\n if (dragons.get(i).getX() < -100) {\n dragons.remove(i); //when off screen remove\n }\n }\n }\n }\n }", "public void tick(){\r\n scoreKeep++;\r\n if(scoreKeep >= 500){\r\n scoreKeep = 0;\r\n hud.setLevel(hud.getLevel()+1);\r\n // continuous addition of enemies at each new level\r\n if(game.diff == 0) {\r\n \tif((hud.getLevel() >= 2 && hud.getLevel() <= 3)||(hud.getLevel() >= 7 && hud.getLevel() <= 9))\r\n \thandler.addObject(new BasicEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.BasicEnemy, handler));\r\n if(hud.getLevel() == 4 || hud.getLevel() == 6)\r\n handler.addObject(new FastEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.FastEnemy, handler));\r\n if(hud.getLevel() == 5)\r\n \thandler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n if(hud.getLevel() == 10){\r\n handler.clearEnemies();\r\n handler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n handler.addObject(new BossEnemy((Game.width/2)-48, -100, ID.BossEnemy, handler));\r\n }\r\n }else if(game.diff == 1) {\r\n \tif((hud.getLevel() >= 2 && hud.getLevel() <= 3)||(hud.getLevel() >= 7 && hud.getLevel() <= 9))\r\n \thandler.addObject(new HardEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.BasicEnemy, handler));\r\n if(hud.getLevel() == 4 || hud.getLevel() == 6)\r\n handler.addObject(new FastEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.FastEnemy, handler));\r\n if(hud.getLevel() == 5)\r\n \thandler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n if(hud.getLevel() == 10){\r\n handler.clearEnemies();\r\n handler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n handler.addObject(new BossEnemy((Game.width/2)-48, -100, ID.BossEnemy, handler));\r\n }\r\n }\r\n }\r\n }", "public void update()\n\t{\n\t\tgameTime++;\n\t\tfor(int i = 0; i<gameObj.length; i++)\n\t\t{\n\t\t\tfor(int j = 0; j < gameObj[i].size(); j++)\n\t\t\t{\n\t\t\t\t/*If the object implements movable\n\t\t\t\t * call the move method in each object\n\t\t\t\t */\n\t\t\t\tif(gameObj[i].get(j) instanceof Imovable)\n\t\t\t\t\t((MovableObject)gameObj[i].get(j)).move();\n\t\t\t\t/*call CheckBlink() method in SpaceStation\n\t\t\t\t * if the time % blinkRate == 0\n\t\t\t\t * the visibility with be switched\n\t\t\t\t */\n\t\t\t\tif(gameObj[i].get(j) instanceof SpaceStation)\n\t\t\t\t\t((SpaceStation)gameObj[i].get(j)).checkBlink(gameTime);\n\t\t\t\t/*check if missiles are out of fuel\n\t\t\t\tand remove if fuel = 0\n\t\t\t\t*/\n\t\t\t\tif(gameObj[i].get(j) instanceof Missile)\n\t\t\t\t\tif(((Missile)gameObj[i].get(j)).getFuel() <= 0)\n\t\t\t\t\t\tgameObj[i].remove(j);\n\t\t\t}\n\t\t}\t\t\n\t\tSystem.out.println(\"World updated\");\n\t}", "public void update(Rectangle floor, ArrayList<Enemy> enemies, Player player) {\n\t\tfor(int i = 0; i < pBullets.size(); ++i) {\t\t\t\n\t\t\tBullet b = pBullets.get(i);\n\t\t\t\n\t\t\tb.update();\n\t\t\t\n\t\t\t\n\t\t\t/* elimina/rimuove il proiettile se avviene un collisione \n\t\t\t * con le mura o con un nemico, nel secondo caso decrementa anche \n\t\t\t * la vita del nemico*/\n\t\t\tif(!floor.contains(b))\n\t\t\t\tpBullets.remove(i);\n\t\t\telse {\n\t\t\t\t/* scorro i nemici*/\n\t\t\t\tfor(Enemy e: enemies) {\n\t\t\t\t\tif( e.contains(b) ){\n\t\t\t\t\t\te.damage(b.getDamage());\n\t\t\t\t\t\tpBullets.remove(i);\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* controllo collisioni proiettili Enemy */\n\t\tfor(int i = 0; i < eBullets.size(); ++i) {\n\t\t\tBullet b = eBullets.get(i);\n\t\t\tb.update();\n\t\t\t\n\t\t\tif(!floor.contains(b))\n\t\t\t\teBullets.remove(i);\n\t\t\t\n\t\t\telse if(player.contains(b)) {\n\t\t\t\tplayer.damage(b.getDamage());\n\t\t\t\teBullets.remove(i);\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void battleEnemyAttack() {\n if(battleEnemy != null){ // If all enemies have attacked, they cannot attack anymore for this round\n\n MovingEntity target = battleEnemy.getAttackPreference(targetAllies);\n if(target == null){\n target = targetAlly;\n }\n\n battleEnemy.attack(target, targetEnemies, targetAllies);\n //System.out.println(battleEnemy.getID() + \" is attacking \" + target.getID() + \" remaining hp: \" + target.getCurrHP());\n if (updateTarget(target) == false) {\n // if target still alive, check if its still friendly incase of zombify\n targetAlly = checkSideSwap(targetAlly, false, battleEnemies, targetEnemies, battleAllies, targetAllies);\n }\n\n battleEnemy = nextAttacker(battleEnemy, battleEnemies);\n\n }\n }", "public void update(Array<Enemy> enemies, Ship player, Array<Token> tokens)\n\t{\n\t\tthis.es = enemies;\n\t\tthis.ts = tokens;\n\t\tthis.player = player;\n\t}", "public void enemyShoot()\r\n\t{\r\n\t\tfor (Enemy enemies : enemy)\r\n\t\t{\r\n\t\t\tif (enemies.getHasFired())\r\n\t\t\t{\r\n\t\t\t\tBullet enemyPew = enemies.shoot();\r\n\t\t\t\tif (enemyPew != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tbullets.add(enemyPew);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void setEnemy(){\n depths.setEnemy(scorpion);\n throne.setEnemy(rusch);\n ossuary.setEnemy(skeleton);\n graveyard.setEnemy(zombie);\n ramparts.setEnemy(ghoul);\n bridge.setEnemy(concierge);\n deathRoom1.setEnemy(ghost);\n deathRoom2.setEnemy(cthulu);\n deathRoom3.setEnemy(wookie); \n }", "public void update(MazeEventEnemyWalkedKilled e) {\r\n }", "boolean collidesEnemy() {\n for(int i = 0; i < barrage.size(); i++) {\n // establish a rectangle for the laser\n Rectangle blaster = new Rectangle((int)barrage.get(i).getX(), (int)barrage.get(i).getY(), WIDTH, HEIGHT);\n \n // determine if the laser intersects an enemy\n for (int q = 0; q < fleet.size(); q++) {\n Rectangle enemy = new Rectangle((int)fleet.get(q).getX(), (int)fleet.get(q).getY(), 40, 36); \n \n // if blaster hits a ship, remove it\n if (blaster.intersects(enemy) && fleet.get(q).getCount() == 0) {\n fleet.get(q).hit = true; // set the enemy hit\n barrage.remove(barrage.get(i));\n score += 100; // add to score\n return true; // hit\n }\n }\n }\n return false; // miss\n }", "public void update(MazeEventEnemyWalked e) {\r\n }", "public void collision() {\n for (int i = 0; i < friendlyBullets.size(); i++) {\n\n friendlyBullets.get(i).tick();\n\n if (friendlyBullets.get(i).getImgY() <= 40) {\n friendlyBullets.get(i).bulletImage.delete();\n friendlyBullets.remove(friendlyBullets.get(i));\n i--;\n continue;\n }\n\n for (int j = 0; j < enemies.size(); j++) {\n\n if (friendlyBullets.get(i).getHitbox().intersects(enemies.get(j).getHitbox())) {\n\n friendlyBullets.get(i).hit();\n friendlyBullets.remove(friendlyBullets.get(i));\n i--;\n\n enemies.get(j).hit();\n\n if (enemies.get(j).getHp() <= 0) {\n enemies.remove(enemies.get(j));\n score.setScore(50);\n j--;\n }\n //end this loop\n j = enemies.size();\n }\n }\n\n }\n\n ///////////////////////////////////////////////////////////////////////////////////////\n\n\n // Enemy out of bounds\n for (int i = 0; i < enemies.size(); i++) {\n\n enemies.get(i).tick();\n\n // Out of bounds\n if (enemies.get(i).getEnemyImage().getY() >= 750) {\n enemies.get(i).getEnemyImage().delete();\n enemies.remove(enemies.get(i));\n\n if (enemies.size() > 1) {\n i--;\n }\n }\n }\n\n\n //////////////////////////////////////////////////////////////////////////\n\n //powerUps out of bounds and collision with spaceships\n for (int i = 0; i < powerUps.size(); i++) {\n\n powerUps.get(i).tick();\n\n if (powerUps.get(i).getImgY() >= 745) {\n\n powerUps.get(i).powerUpImage.delete();\n powerUps.remove(powerUps.get(i));\n\n i--;\n continue;\n }\n\n for (int j = 0; j < spaceShips.size(); j++) {\n\n if (spaceShips.get(j).getHitbox().intersects(powerUps.get(i).getHitbox())) {\n\n\n spaceShips.get(j).powerUp(powerUps.get(i).getPowerUpType());\n powerUps.get(i).hit();\n powerUps.remove(powerUps.get(i));\n\n //if it collides with one leave the for loop\n i--;\n j = spaceShips.size();\n }\n }\n\n }\n\n }", "public void moveEnemy() {\n int moveDirection = randomGenerator(0, 3);\n int enemyAmount = snakeEnemyPartList.size();\n for(int i = 0; i < enemyAmount; i++) {\n\n int rowsNew = snakeEnemyPartList.get(i).getSnakeEnemyPartRowsNew();\n int collsNew = snakeEnemyPartList.get(i).getSnakeEnemyPartCollsNew();\n\n switch (moveDirection) {\n case 0:\n if(board[rowsNew-1][collsNew] == 'S'){\n keepMoving = false;\n System.out.println(\"ENEMY HAS EATEN YOU!\");\n }\n else if(board[rowsNew-1][collsNew] == ' '){\n snakeEnemyPartList.get(i).moveEnemy('w');\n } else {\n moveEnemy();\n }\n break;\n\n case 1:\n if(board[rowsNew][collsNew-1] == 'S'){\n keepMoving = false;\n System.out.println(\"ENEMY HAS EATEN YOU!\");\n }\n else if(board[rowsNew][collsNew-1] == ' '){\n snakeEnemyPartList.get(i).moveEnemy('a');\n }else {\n moveEnemy();\n }\n\n break;\n\n case 2:\n if(board[rowsNew+1][collsNew] == 'S'){\n keepMoving = false;\n System.out.println(\"ENEMY HAS EATEN YOU!\");\n }\n else if(board[rowsNew+1][collsNew] == ' '){\n snakeEnemyPartList.get(i).moveEnemy('s');\n }else {\n moveEnemy();\n }\n\n break;\n\n case 3:\n if(board[rowsNew][collsNew+1] == 'S'){\n keepMoving = false;\n System.out.println(\"ENEMY HAS EATEN YOU!\");\n }\n else if(board[rowsNew][collsNew+1] == ' '){\n snakeEnemyPartList.get(i).moveEnemy('d');\n }else {\n moveEnemy();\n }\n \n break;\n }\n }\n \n }", "public void popEnemies() {\n\t\t\n\t\tEnemyList.add(orc);\n\t\tEnemyList.add(goblin);\n\t\tEnemyList.add(necromancer);\n\t\tEnemyList.add(troll);\n\t\tEnemyList.add(minotaur);\n\t\tEnemyList.add(hydra);\n\t\tEnemyList.add(zombie);\n\t\tEnemyList.add(thrall);\n\t\tEnemyList.add(demon);\n\t\tEnemyList.add(witch);\n\t\tEnemyList.add(boss);\n\t}", "public void cleanupBattle(List<Enemy> defeatedEnemies){\r\n Character character = world.getCharacter();\r\n updateAllies();\r\n\r\n ArrayList<MovingEntity> deadFriendlies = new ArrayList<MovingEntity>();\r\n for (MovingEntity friendly: world.getFriendlyEntities()) {\r\n if (friendly.getCurrHP() <= 0) {\r\n deadFriendlies.add(friendly);\r\n friendly.destroy();\r\n }\r\n }\r\n world.getFriendlyEntities().removeAll(deadFriendlies);\r\n\r\n \r\n //ArrayList<Enemy> defeatedEnemies = battle.getDefeated();\r\n for(Enemy defeatedEnemy : defeatedEnemies) {\r\n killEnemy(defeatedEnemy);\r\n }\r\n\r\n if (character.getCurrHP() <= 0) {\r\n world.setGameStateLose();\r\n }\r\n }", "public void guardUpdate(){\r\n\t\t//check if a enemy has been spotted\r\n\t\tif (checkSight()){\r\n\t\t\tseen = true;\r\n\t\t} if (seen) {\r\n\t\t\tcreature.setSpeed(1.5);\r\n\t\t\tchaseEnemy(seenEnemy, 5);\r\n\t\t\treturn; //if player has been spotted end method here\r\n\t\t}\r\n\t\t//if no enemy has been spotted\r\n\t\tcreature.setSpeed(1);\r\n\t\tif (creature.getCreature().equals(CreatureType.PGuard) || creature.getCreature().equals(CreatureType.SGuard)){ //Patrol Guards and Stationary Guards\r\n\t\t\tif (index > checkpoints.size()-1){\r\n\t\t\t\tindex = 0;\r\n\t\t\t}\r\n\t\t\tgoToLocation (checkpoints.get(index));\r\n\t\t} else if(creature.getCreature().equals(CreatureType.RGuard)){ //Roaming Guards\r\n\t\t\troamArea();\r\n\t\t} if (!checkCollision(x, y)) {\r\n\t\t\tgoToLocation(x, y);\r\n\t\t}\r\n\t}", "public void clearEnemies() {\n\t\tIterator<Entity> it = entities.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tEntity e = it.next();\n\t\t\t//Skip playerfish\n\t\t\tif (e instanceof PlayerFish) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t//Kill and remove the entity\n\t\t\te.kill();\n\t\t\tit.remove();\n\t\t}\n\t\t\n\t\t//Remove all non playerfish from collidables\n\t\tcollidables.removeIf(c -> !(c instanceof PlayerFish));\n\t\tdrawables.removeIf(c -> !(c instanceof PlayerFish));\n\t}", "public void processEnemyHitsAndDeaths(AbstractEnemy enemy) {\n this.scoreCounter.changeScore(2000, '+'); // This was put here to see all objectives being met\n this.gameState.updateScoreGoals(this.scoreCounter);\n this.gameState.updateEnemyHitGoals(enemy.getEnemyType());\n this.killCount += 1; \n }", "public void movement(){\n\t\t\n\t\tdelayCounter++;\n\t\t\n\t\tif(direction == Direction.RIGHT){\n\t\t\txCoor += 1;\n\t\t\tbound.x = xCoor+30;\n\t\t\t\n\t\t\tif ( image == Assets.enemySprite[0] && delayCounter >= delay ){\n\t\t\t\timage = Assets.enemySprite[1];\n\t\t\t\tdelayCounter = 0;\n\t\t\t}\n\t\t\telse if ( image == Assets.enemySprite[1] && delayCounter >= delay ){\n\t\t\t\timage = Assets.enemySprite[2];\n\t\t\t\tdelayCounter = 0;\n\t\t\t}\n\t\t\telse if ( image == Assets.enemySprite[2] && delayCounter >= delay ){\n\t\t\t\timage = Assets.enemySprite[0];\n\t\t\t\tdelayCounter = 0;\n\t\t\t}\n\t\t}\n\t\tif(direction == Direction.LEFT){\n\t\t\txCoor -= 1;\n\t\t\tbound.x = xCoor+30;\n\t\t\t\n\t\t\tif ( image == Assets.enemySprite[3] && delayCounter >= delay ){\n\t\t\t\timage = Assets.enemySprite[4];\n\t\t\t\tdelayCounter = 0;\n\t\t\t}\n\t\t\telse if ( image == Assets.enemySprite[4] && delayCounter >= delay ){\n\t\t\t\timage = Assets.enemySprite[5];\n\t\t\t\tdelayCounter = 0;\n\t\t\t}\n\t\t\telse if ( image == Assets.enemySprite[5] && delayCounter >= delay ){\n\t\t\t\timage = Assets.enemySprite[3];\n\t\t\t\tdelayCounter = 0;\n\t\t\t}\n\t\t}\n\t\telse if(direction == Direction.UPWARD){\n\t\t\tyCoor += 1;\n\t\t\tbound.y = yCoor+30;\n\t\t\t\n\t\t\tif ( image == Assets.enemySprite[10] && delayCounter >= delay ){\n\t\t\t\timage = Assets.enemySprite[11];\n\t\t\t\tdelayCounter = 0;\n\t\t\t}\n\t\t\telse if ( image == Assets.enemySprite[11] && delayCounter >= delay ){\n\t\t\t\timage = Assets.enemySprite[10];\n\t\t\t\tdelayCounter = 0;\n\t\t\t}\n\t\t}\n\t\telse if(direction == Direction.DOWNWARD){\n\t\t\tyCoor -= 1;\n\t\t\tbound.y = yCoor+30;\n\t\t\t\n\n\t\t\tif ( image == Assets.enemySprite[6] && delayCounter >= delay ){\n\t\t\t\timage = Assets.enemySprite[7];\n\t\t\t\tdelayCounter = 0;\n\t\t\t}\n\t\t\telse if ( image == Assets.enemySprite[7] && delayCounter >= delay ){\n\t\t\t\timage = Assets.enemySprite[8];\n\t\t\t\tdelayCounter = 0;\n\t\t\t}\n\t\t\telse if ( image == Assets.enemySprite[8] && delayCounter >= delay ){\n\t\t\t\timage = Assets.enemySprite[6];\n\t\t\t\tdelayCounter = 0;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tenemyWalk += 1;\n\t\t\n\t\t//This parts checks to see if the enemy has to turn or not.\n\t\tif(enemyWalk == screen.maps[screen.currentMap].path.getTileWidth()){\n\t\t\tint x = xCoor;\n\t\t\tint y = yCoor;\n\t\t\t\n\t\t\tif(direction == Direction.RIGHT){\n\t\t\t\tx = xCoor + 1;\n\t\t\t\tprevious = direction;\n\t\t\t}\n\t\t\tif(direction == Direction.LEFT){\n\t\t\t\tx = xCoor - 1;\n\t\t\t\tprevious = direction;\n\t\t\t}\n\t\t\tif(direction == Direction.UPWARD){\n\t\t\t\ty = yCoor + 1;\n\t\t\t\tprevious = direction;\n\t\t\t}\n\t\t\tif(direction == Direction.DOWNWARD){\n\t\t\t\ty = yCoor - 1;\n\t\t\t\tprevious = direction;\n\t\t\t}\n\t\t\t\n\t\t\tint tileBlockX = (int) (x/screen.maps[screen.currentMap].path.getTileWidth());\n\t\t\tint tileBlockY = (int) (y/screen.maps[screen.currentMap].path.getTileHeight());\n\t\t\t\n\t\t\t//As long as the enemy has not gone the opposite direction, the enemy will continue to move in the direction is was going originally.\n\t\t\tif(tileBlockX < screen.maps[screen.currentMap].path.getWidth()-1 && tileBlockX > 0){\n\t\t\t\tif(tileBlockY < screen.maps[screen.currentMap].path.getHeight()-1 && tileBlockY > 0){\n\t\t\t\t\tif(screen.maps[screen.currentMap].path.getCell(tileBlockX, tileBlockY + 1).getTile().getProperties().containsKey(\"ground\") == true && previous != Direction.DOWNWARD){\n\t\t\t\t\t\tdirection = Direction.UPWARD;\n\t\t\t\t\t\timage = Assets.enemySprite[10];\n\t\t\t\t\t}\n\t\t\t\t\tif(screen.maps[screen.currentMap].path.getCell(tileBlockX, tileBlockY - 1).getTile().getProperties().containsKey(\"ground\") == true && previous != Direction.UPWARD){\n\t\t\t\t\t\tdirection = Direction.DOWNWARD;\n\t\t\t\t\t\timage = Assets.enemySprite[6];\n\t\t\t\t\t}\n\t\t\t\t\tif(screen.maps[screen.currentMap].path.getCell(tileBlockX + 1, tileBlockY).getTile().getProperties().containsKey(\"ground\") == true && previous != Direction.LEFT){\n\t\t\t\t\t\tdirection = Direction.RIGHT;\n\t\t\t\t\t\timage = Assets.enemySprite[0];\n\t\t\t\t\t}\n\t\t\t\t\tif(screen.maps[screen.currentMap].path.getCell(tileBlockX - 1, tileBlockY).getTile().getProperties().containsKey(\"ground\") == true && previous != Direction.RIGHT){\n\t\t\t\t\t\tdirection = Direction.LEFT;\n\t\t\t\t\t\timage = Assets.enemySprite[3];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//If the enemy makes it to the end, it is no longer in game.\n\t\t\tif(screen.maps[screen.currentMap].path.getCell(tileBlockX, tileBlockY).getTile().getProperties().containsKey(\"finish\") == true){\n\t\t\t\tinGame = false;\n\t\t\t\tscreen.playerHealth--;\n\t\t\t}\n\t\t\t\n\t\t\tenemyWalk = 0;\n\t\t}\n\t}", "@Override\n public void update() {\n for (Integer i : arrAttack) {\n //System.out.println(scene.entityManager.getEntityByID(i).getName());\n\n //if the weapon has not a -1\n if (scene.entityManager.getEntityComponentInstance(i, Tool.class).currentActive != - 1) {\n\n ArrayList<AttackCollider> arrColliders = scene.entityManager.getEntityComponentInstance(i, attackComponent.getClass()).arrColliders;\n\n //Check if it collides with a collidable entity\n for (Integer j : arrCollidable) {\n //if they are not the same and i is not a weapon of j, and if j is alive\n if (!Objects.equals(i, j) && !isWeaponOf(i, j) && scene.entityManager.getEntityComponentInstance(j, Playable.class).isAlive) {\n\n //for each collider that collides with the entity\n for (AttackCollider k : checkAttack(i, j)) {\n //Do something to the collidable entity\n executeAttack(i, j);\n }\n }\n }\n }\n }\n initializeEntities();\n }", "public void updateFrame() {\n if (level != null) {\n for (GameEntity entity : entities) entity.update(this);\n pacman.update(this);\n checkCollisions();\n }\n }", "public void killAll() {\n for (Map.Entry<Integer, Enemy> entry :enemies.entrySet()) {\n if (!!!entry.getValue().isDead()) {\n entry.getValue().setHealth(0);\n }\n }\n }", "public int isSafe(){\n int nbEnnemies = 0;\n List<Player> players = state.getPlayers();\n Player currentPlayer = state.getCurrentPlayer();\n for(Player p : players){\n if(!p.equals(currentPlayer)) {\n nbEnnemies += currentPlayerReachable(state.getCurrentPlayer(), p);\n //nbEnnemies += manhattan(currentPlayer, p); //naive version\n }\n }\n return nbEnnemies;\n }", "public void checkGameEndState() {\n\t\tfor(MapCharacter c : friendlyMissionCriticals) {\n\t\t\tif(!friendlies.contains(c))\n\t\t\t\tthrow new PlayerLosesException();\n\t\t}\n\t\tif(getEnemies().size() == 0)\n\t\t\tthrow new PlayerWinsException();\n\t}", "public void update(){\n\t\tupdatePlayerPosition();\n\t\thandleCollisions();\n\t}", "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}", "public void collisionVS() {\n for (int i = 0; i < enemyBullets.size(); i++) {\n\n enemyBullets.get(i).tick();\n\n if (enemyBullets.get(i).getImgY() >= 750 || enemyBullets.get(i).getImgY() <= 40) {\n\n enemyBullets.get(i).bulletImage.delete();\n enemyBullets.remove(enemyBullets.get(i));\n i--;\n continue;\n }\n\n for (int j = 0; j < spaceShips.size(); j++) {\n\n if (spaceShips.get(j).getHitbox().intersects(enemyBullets.get(i).getHitbox())) {\n\n spaceShips.get(j).hit();\n enemyBullets.get(i).hit();\n enemyBullets.remove(enemyBullets.get(i));\n\n if (spaceShips.get(j).getHp() <= 0) {\n spaceShips.remove(spaceShips.get(j));\n }\n\n //if it collides with one leave the for loop\n i--;\n j = spaceShips.size();\n }\n }\n }\n\n //////////////////////////////////////////////////////////////////////////////////////////////\n\n // SPACESHIPS WITH ENEMIES AND ENEMY BULLETS\n for (int i = 0; i < spaceShips.size(); i++) {\n spaceShips.get(i).tick();\n\n // WITH ENEMIES\n for (int j = 0; j < enemies.size(); j++) {\n if (spaceShips.get(i).getHitbox().intersects(enemies.get(j).getHitbox())) {\n\n spaceShips.get(i).hit();\n enemies.get(j).hit(20);\n enemies.remove(enemies.get(j));\n\n if (spaceShips.get(i).getHp() <= 0) {\n spaceShips.remove(spaceShips.get(i));\n }\n\n //if it collides with one leave the for loop\n j = enemies.size();\n }\n }\n }\n }", "public void update(float dt, EnemyManager em)\n {\n if (!active)\n return;\n\n CheckHealth(em);\n\n // Simply fly downwards\n basicShooter.pos.y -= dt * movementSpeed;\n\n // Once this enemy hits the bottom, it will be set to inactive,\n // and EnemyManager's enemy count is decremented\n if (basicShooter.pos.y <= 0)\n {\n active = false;\n --em.curEnemyCount;\n }\n }", "@Override\n public void update(ArrayList<String> pressedKeys) {\n\n\n super.update(pressedKeys);\n// if(!backgroundMusic.play && x==0){\n// x=1;\n// backgroundMusic.playMusic(\"resources/oceanOperator.mp3\");\n// }\n\n if (state == STATE.MENU) {\n\n }\n\n //moveGameY(1);\n\n else if (state == STATE.GAME) {\n if (player != null && !player.isDead) {\n player.update(pressedKeys);\n }\n if (player.getLifeCount() <= 0) {\n complete = true;\n player.isDead = true;\n }\n\n\n if (transitionYCurrent < transitionY) {\n moveGameY(transitionYSpeed);\n transitionYCurrent += transitionYSpeed;\n }\n\n if(complete && !player.isDead){\n System.out.println(\"you won!\");\n state = STATE.COMPLETE;\n\n\n }\n\n if (player != null && !player.isDead) {\n// for (int i = 0; i < enemies.size(); i++) {\n// if (player.playerCollidesWith(enemies.get(i)) && enemies.get(i).dead == false && player.canGetHurt()) {\n// damageThePlayer();\n// }\n// }\n\n for (int i = 0; i < currentRoom.getSpikeList().size(); i++) {\n SpikeTile spikes = currentRoom.getSpikeList().get(i);\n if (player.feetCollideWith(spikes) && spikes.getStateName() == \"idle up\" && player.canGetHurt()) {\n damageThePlayer();\n }\n }\n\n\n if (player.playerCollidesWith(coin)) {\n coin.handleEvent(collidedEvent);\n myQuestManager.handleEvent(PickedUpEvent);\n }\n player.update();\n checkCollisions(player);\n\n\n for (int i = 0; i < player.playerBullets.size(); i++) {\n Bullet bul = player.playerBullets.get(i);\n bul.update(pressedKeys);\n if (bul.getShotTimer() >= bul.getShotCap()) {\n\n player.playerBullets.remove(i);\n }\n }\n\n TweenJuggler.getInstance().nextFrame();\n\n boolean pickpocketTrigger = false;\n for (int i = 0; i < enemies.size(); i++) {\n\n Enemy enemy = enemies.get(i);\n if (player.getHitBox().intersects(enemy.getPickpocketRect())) {\n pickpocketTrigger = true;\n pickpocketEnemy = enemy;\n }\n\n }\n pickpocket = pickpocketTrigger;\n if (!pickpocket)\n pickpocketEnemy = null;\n }\n if (pressedKeys.contains(KeyEvent.getKeyText(KeyEvent.VK_W))) {\n for (int i = 0; i < currentRoom.getDoors().size(); i++) {\n if (player.getHitBox().intersects(currentRoom.getDoors().get(i).getDoorCollider()) && currentRoom.getDoors().get(i).stateName == \"door_open\" && transitionPhase == false) {\n transitionPhase = true;\n currentRoom.fadeOut();\n queuedRoom = currentRoom.getDoors().get(i).getNextRoom();\n queuedRoom.fadeIn();\n transitionYCurrent = 0;\n enemies = new ArrayList<>();\n pressedKeys.remove(KeyEvent.getKeyText(KeyEvent.VK_W));\n }\n }\n\n }\n\n if (pressedKeys.contains(KeyEvent.getKeyText(KeyEvent.VK_E))) {\n if (pickpocket == true && pickpocketEnemy != null) {\n keyCount += pickpocketEnemy.pickpocketKeys();\n int knives = pickpocketEnemy.pickpocketKnives();\n knifeCount += knives;\n System.out.println(knives);\n// int n = rand.nextInt(3) + 1;\n// if (n == 1) {\n//\n// itemString = \"You found a knife!\";\n// } else if (n == 2) {\n// keyCount++;\n// itemString = \"You found a key!\";\n//\n// } else if (n == 3) {\n// itemString = \"No items found.\";\n// }\n }\n\n\n for (int i = 0; i < currentRoom.getDoors().size(); i++) {\n\n if (player.getHitBox().intersects(currentRoom.getDoors().get(i).getDoorCollider()) && currentRoom.getDoors().get(i).stateName == \"door_closed\") {\n if (keyCount > 0) {\n soundEffects.playSoundEffect(\"resources/chains.wav\",0);\n currentRoom.getDoors().get(i).setAnimationState(\"door_opening\", \"door_open\");\n itemString = \"Door unlocked\";\n keyCount--;\n } else {\n soundEffects.playMusic(\"resources/door_locked.wav\");\n }\n } else if (player.getHitBox().intersects(currentRoom.getDoors().get(i).getDoorCollider()) && currentRoom.getDoors().get(i).stateName == \"door_open\" && transitionPhase == false) {\n transitionPhase = true;\n currentRoom.fadeOut();\n queuedRoom = currentRoom.getDoors().get(i).getNextRoom();\n queuedRoom.fadeIn();\n transitionYCurrent = 0;\n enemies = new ArrayList<>();\n }\n }\n\n for (int i = 0; i < currentRoom.getChests().size(); i++) {\n TreasureChest chest = currentRoom.getChests().get(i);\n if (player.feetCollideWith(chest) && chest.getStateName() == \"closed\") {\n chest.setAnimationState(\"open\", \"\");\n if (chest.getItem().equals(\"key\")) {\n keyCount++;\n } else if (chest.getItem().equals(\"knife\")) {\n knifeCount++;\n }\n }\n }\n\n\n pressedKeys.remove(KeyEvent.getKeyText(KeyEvent.VK_E));\n }\n\n if (pressedKeys.contains(KeyEvent.getKeyText(KeyEvent.VK_P))) {\n if (complete == true) {\n removeAll();\n complete = false;\n currentLevel = 0;\n\n\n tutorial = new TutorialLevel1(\"Tutorial\");\n tutorial.run();\n addChild(tutorial);\n\n\n myLevel = new Level0(\"Room1\");\n myLevel.run();\n addChild(myLevel);\n\n\n myLevel1 = new Level1(\"Room2\");\n myLevel1.run();\n myLevel1.hide();\n addChild(myLevel1);\n\n myLevel2 = new ahmedslevel(\"Room3\", player);\n myLevel2.run();\n myLevel2.hide();\n addChild(myLevel2);\n\n myLevel3 = new BrighamLevel(\"Room4\");\n myLevel3.run();\n myLevel3.hide();\n addChild(myLevel3);\n\n level4 = new AlternatingSpikesLevel(\"Room6\");\n level4.run();\n level4.hide();\n addChild(level4);\n\n\n bossLevel = new BossLevel(\"Room5\", player);\n bossLevel.run();\n bossLevel.hide();\n addChild(bossLevel);\n\n\n tutorial.mapDoorToRoom(0,myLevel);\n myLevel.mapDoorToRoom(0, myLevel1);\n myLevel1.mapDoorToRoom(0, myLevel2);\n myLevel2.mapDoorToRoom(0, myLevel3);\n myLevel3.mapDoorToRoom(0, level4);\n level4.mapDoorToRoom(0, bossLevel);\n currentRoom = tutorial;\n\n enemies = currentRoom.enemies;\n\n player.isDead = false;\n player.setLifeCount(3);\n player.setPositionX(550);\n player.setPositionY(700);\n knifeCount = 4;\n keyCount = 0;\n backgroundMusic.stop();\n backgroundMusic.playSoundEffect(\"resources/oceanOperator.wav\", 100);\n } else {\n state = STATE.PAUSE;\n\n }\n }\n for (int i = 0; i < enemies.size(); i++) {\n Enemy currentEnemy = enemies.get(i);\n currentEnemy.update();\n if (!currentEnemy.dead) {\n if (currentEnemy.enemyBullet != null) {\n currentEnemy.enemyBullet.update(pressedKeys);\n if (currentEnemy.enemyBullet.getShotTimer() >= currentEnemy.enemyBullet.getShotCap()) {\n currentEnemy.enemyBullet = null;\n }\n }\n if (currentEnemy.isInView(player, currentRoom.coverList)) {\n// System.out.println(currentRoom.coverList.get(0));\n if (complete == false) {\n if (currentEnemy.enemyBullet == null) {\n currentEnemy.enemyBullet = new Bullet(\"bullet\", \"knife.png\", 0.4);\n currentEnemy.enemyBullet.setStart(currentEnemy.getPositionX() + currentEnemy.getUnscaledWidth() / 2, currentEnemy.getPositionY() + currentEnemy.getUnscaledHeight() / 2);\n currentEnemy.enemyBullet.setEnd(player.getPositionX(), player.getPositionY());\n TweenTransitions enemyBulletPath = new TweenTransitions(\"linearTransition\");\n Tween enemyBulletmovement = new Tween(currentEnemy.enemyBullet, enemyBulletPath);\n enemyBulletmovement.animate(TweenableParams.X, currentEnemy.enemyBullet.startValX, currentEnemy.enemyBullet.endValX, 0.4);\n enemyBulletmovement.animate(TweenableParams.Y, currentEnemy.enemyBullet.startValY, currentEnemy.enemyBullet.endValY, 0.4);\n TweenJuggler.getInstance().add(enemyBulletmovement);\n currentEnemy.handleEvent(throwKnife);\n }\n }\n if (currentEnemy.enemyBullet != null) {\n// System.out.println(currentEnemy.enemyBullet.getShotTimer());\n if (currentEnemy.enemyBullet.collidesWith(player) && player.canGetHurt()) {\n damageThePlayer();\n currentEnemy.enemyBullet = null;\n break;\n }\n for (int j = 0; j < currentRoom.collisionArray.size(); j++) {\n if (currentEnemy.enemyBullet.collidesWith(currentRoom.collisionArray.get(j))) {\n currentEnemy.enemyBullet = null;\n break;\n }\n }\n\n }\n }\n\n\n for (int j = 0; j < player.playerBullets.size(); j++) {\n Bullet bul = player.playerBullets.get(j);\n// for (int k = 0; k < currentRoom.collisionArray.size(); k++) {\n// if (bul.collidesWith(currentRoom.collisionArray.get(k))) {\n// player.playerBullets.remove(j);\n// break;\n// }\n// }\n if (bul != null) {\n if (bul.collidesWith(enemies.get(i))) {\n enemies.get(i).dead = true;\n enemies.get(i).enemyBullet = null;\n if (enemies.get(i).getStateName().contains(\"right\")) {\n enemies.get(i).setDelay(90);\n enemies.get(i).setAnimationState(\"dying right\", \"dead right\");\n } else {\n enemies.get(i).setDelay(90);\n enemies.get(i).setAnimationState(\"dying left\", \"dead left\");\n }\n if (player.playerBullets.size() > j)\n player.playerBullets.remove(j);\n }\n\n }\n }\n }\n }\n\n for (int j = 0; j < player.playerBullets.size(); j++) {\n Bullet bul = player.playerBullets.get(j);\n for (int k = 0; k < currentRoom.collisionArray.size(); k++) {\n if (bul.collidesWith(currentRoom.collisionArray.get(k))) {\n player.playerBullets.remove(j);\n break;\n }\n }\n }\n\n currentRoom.update();\n\n if (queuedRoom != null) {\n queuedRoom.update();\n\n if (queuedRoom.getDoneFading() && currentRoom.getDoneFading()) {\n\n queuedRoom.setDoneFading(false);\n currentRoom.setDoneFading(false);\n if(queuedRoom == bossLevel){\n backgroundMusic.stop();\n bossLevel.intro();\n }\n currentRoom = queuedRoom;\n enemies = currentRoom.enemies;\n queuedRoom = null;\n transitionPhase = false;\n currentQuestObjective = 0;\n }\n }\n }\n if (keyCount > 0){\n currentQuestObjective = 1;\n }\n else if(currentRoom == bossLevel){\n currentQuestObjective = 2;\n }\n\n if(bossLevel != null) {\n if (bossLevel.endgame == true) {\n state = STATE.COMPLETE;\n System.out.println(\"you won!\");\n quitButton.setPositionX(300);\n\n }\n }\n }", "public void update(long absNanoTime, Point towerPosition, java.util.List<Enemy> enemiesOnLayer){\n long deltaNanoTime = absNanoTime - currentTime;\n nextAttack = Math.max(nextAttack - deltaNanoTime, 0);\n currentTime = absNanoTime;\n shoot(nextAttack == 0, filterEnemies(enemiesOnLayer, towerPosition));\n }", "private void handleStandardGameplay(float deltaTime) {\n\t\t// Decrease time to next revived enemy\n\t\tmSpawnTime--;\n\n\t\t// Accumulate time elapsed while playing\n\t\tmRoundTimeElapsed += deltaTime;\n\n\t\t/**\n\t\t * Input Handling\n\t\t * When the screen is touched, kill touched attackers\n\t\t */\n\t\tif(Gdx.input.justTouched()) {\n\t\t\t// Grab the touch position, saved as a Vector3\n\t\t\tmLastTouch.set(Gdx.input.getX(), Gdx.input.getY(), 0);\n\t\t\tmCamera.unproject(mLastTouch); // Translates to game world coordinates\n\n\t\t\t// Find the first attacker located at the touch position, if any\n\t\t\tint indexOfAttacker = getFirstAttackerAt(mLastTouch.x, mLastTouch.y);\n\t\t\t// If the index is greater than negative one, kill the attacker and add points\n\t\t\tif(indexOfAttacker > -1){\n\t\t\t\tmAttackers[indexOfAttacker].kill();\n\t\t\t\tmLivingAttackerCount--;\n\t\t\t\tmMonsterHouseSpawn--;\n\t\t\t\tmRoundScore += 100f;\n\t\t\t\tif(indexOfAttacker > ATTACKER_HALF_SIZE - 1)\n\t\t\t\t\tmRoundScore += 150f; // 150 Bonus points for killing a knight\n\t\t\t}\n\t\t}\n\n\t\t// Spawns a new enemy once the respawn timer hits less than 0\n\t\tif(mSpawnTime <0) {\n\t\t\t// Revive an attacker\n\t\t\treviveAttacker();\n\n\t\t\t// Randomly select a new respawn timer within min and max bounds\n\t\t\tmSpawnTime = mRandom.nextInt(mSpawnTimeMax - mSpawnTimeMin + 1) + mSpawnTimeMin;\n\t\t}\n\n\t\t//spawns a row of enemy units if player is doing well\n\t\tif(mMonsterHouseSpawn <0) {\n\t\t\tint monsterHouseRush = 3;\n\t\t\twhile(monsterHouseRush > 0) {\n\t\t\t\tfor (float i = 0; i < 5f; i++) {\n\t\t\t\t\treviveAttacker();\n\t\t\t\t}\n\t\t\t\tmonsterHouseRush--;\n\t\t\t}\n\t\t\tmMonsterHouseSpawn = 10;\n\t\t}\n\n\t\t// Loop through the array of attackers and update each (dead attackers' update does nothing)\n\t\tfor (int i = 0; i < ATTACKER_ARRAY_SIZE; i++) {\n\t\t\tAttacker a = mAttackers[i];\n\t\t\ta.update(deltaTime);\n\n\t\t\tif(a.getX() > MIN_STOP_X) {\n\t\t\t\t// Play the attacker's \"attack\" animation\n\t\t\t\ta.play(\"attack\", true);\n\t\t\t\t// The attacker stops at the castle and the castle begins losing health\n\t\t\t\ta.setPosition(MIN_STOP_X, a.getY());\n\t\t\t\tmCastleHealth -= a.getHitDamage();\n\t\t\t\t// Only bother checking castle damage stage here - only when damage is being dealt\n\t\t\t\tfloat percentDamage = (mCastleMaxHealth - mCastleHealth) / mCastleMaxHealth;\n\t\t\t\tif(percentDamage < 0.5f) {\n\t\t\t\t\tmCastleDamageStage = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmCastleDamageStage = 1;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.15f) {\n\t\t\t\t\tmCastleDamageStage = 2;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.35f) {\n\t\t\t\t\tmCastleDamageStage = 3;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.65f) {\n\t\t\t\t\tmCastleDamageStage = 4;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.85f) {\n\t\t\t\t\tmCastleDamageStage = 5;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check if the game is over, where mCastleHealth <= 0\n\t\tif(mCastleHealth <= 0) {\n\t\t\t// The castle has fallen to the attackers\n\t\t\t// Currently, the game will pause and add text that states the game is over\n\t\t\tmCastleHealth = 0f;\n\t\t\tmHealthText = \"Castle Strength: \" + mCastleHealth;\n\t\t\tmGameState = STATE_GAME_OVER;\n\t\t\thideAllButtons();\n\t\t}\n\n\t\t// If the round time is up, end the round and go to a new state\n\t\tif(mRoundTimeElapsed > mRoundMaxTime) {\n\t\t\tmGameState = STATE_ROUND_OVER;\n\t\t\tmTotalScore += mRoundScore;\n\t\t\tmRoundNumber++;\n\t\t\thideAllButtons();\n\t\t}\n\t}", "public void update(float delta) {\n\t\tfor(DefenseTower tower : world.getDefenseTowers()) {\n\t\t for(Enemy enemy : world.getEnemies()) {\n\t\t\t if(tower.isPowered() == true && tower.inRange(enemy)) {\n\t\t\t\t\ttower.fireBullets(enemy, delta);\n\t\t\t\t\t//enemy.takeHit(tower.POWER*delta);\n\t\t\t\t\tif(!enemy.isAlive()) {\n\t\t\t\t\t world.getEnemies().removeValue(enemy, false);\n\t\t\t\t\t}\n\t\t\t } \n\t\t\t}\n\t\t}\n\t\n\t\t// Towncentre actions goes here. It shoots enemies here.\n\t\tTownCentre tCentre = world.getTownCentre();\n\t for(Enemy enemy : world.getEnemies()) {\n\t\t if(tCentre.inRange(enemy)) {\n\t\t\t\ttCentre.fireBullets(enemy, delta);\n\t\t\t\t//enemy.takeHit(tCentre.POWER*delta);\n\t\t\t\tif(!enemy.isAlive()) {\n\t\t\t\t world.getEnemies().removeValue(enemy, false);\n\t\t\t\t}\n\t\t } \n\t\t}\n\t \n\t // Soldiers attack enemies here.\n\t for(Soldier s: InstanceManager.getInstance().getSoldiers()) {\n\t \t//s.attackEveryEnemy(delta, InstanceManager.getInstance().getDefenseTowers());\n\t }\n\t\n\t /*for(Enemy enemy : world.getEnemies()) {\n\t\t\tfor(Tower tower : world.getTowers()) {\n\t\t\t if(enemy.inRange(tower)) {\n\t\t\t\t tower.takeHit(enemy.STRENGTH*delta);\n\t\t\t\t //System.out.println(\"tower \" + tower.UID + \"strength is \" + tower.STRENGTH);\n\t\t\t\t if(!tower.isAlive) {\n\t\t\t\t\t \tif(world.getTowers().indexOf(tower, false) !=-1)\n\t\t\t\t\t \t\tactiveTower=-1;\n\t\t\t\t\t world.getTowers().removeValue(tower, false);\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t\t// This makes townCentre take the hit.\n\t\t\tif(enemy.inRange(tCentre) && tCentre.isAlive) {\n\t\t\t\ttCentre.takeHit(enemy.STRENGTH*delta);\n\t\t\t\t //System.out.println(\"TownCenter \" + tCentre.UID + \"strength is \" + tCentre.STRENGTH);\n\t\t\t}\n\t }*/\n\t\t\n\t // Steams attackers attack towers and links here\n\t sAttackers.AttackTowersAndLinks(delta);\n\t\t\n\t\tfor(Tower tower : world.getTowers()) {\n\t\t tower.update(delta);\n\t\t}\n\t\t\n\t\tfor(Enemy enemy : world.getEnemies()) {\n\t\t enemy.update(delta);\n\t\t if(enemy.getPosition().x > 21 && enemy.getPosition().y > 14)\n\t\t \tworld.getEnemies().removeValue(enemy, false);\n\t\t}\n\t\t\n\t\tfor(Person p: InstanceManager.getInstance().getPeople()) {\n\t\t\tp.update(delta);\n\t\t}\n\t\t\n\t\tfor(Soldier s : InstanceManager.getInstance().getSoldiers()) {\n\t\t\ts.update(delta);\n\t\t}\n\t\t\n\t\t// A lot happens here.\n\t\tInstanceManager.getInstance().update(delta);\n\t\t\n\t\tfor(DefenseTower tower : world.getDefenseTowers()) {\n\t\t\ttower.update(delta);\n\t\t}\n\t\t// If game slows down you can limit updation timing here.\n\t\ttCentre.update(delta);\n\t\tgManager.update(delta);\n\t\tworld.update(delta);\n\t\tsController.update();\n\t\t\n }", "public static void enemyWonInc(){\r\n\t\t_enemyWon++;\r\n\t}", "@Override\n public void render(float delta) {\n\n long time = TimeUtils.timeSinceMillis(lastTimeCountedRound);\n lastTimeCountedRound = TimeUtils.millis();\n // Time since last round for spawning enemies\n sinceChangeTime += time;\n\n //Standard settings\n Gdx.gl.glClearColor(0, 0, 0, 1);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\n renderer.setView(cam);\n renderer.render();\n cam.update();\n\n game.batch.setProjectionMatrix(cam.combined);\n\n game.batch.begin();\n // show shop if b is pressed\n if(Gdx.input.isKeyJustPressed(Input.Keys.B)){\n showShop = !showShop;\n }\n // if enemies are gone the round is over\n if (enemies.isEmpty()) {\n isDone = true;\n showTime = true;\n if(!moneyAdded){\n money += 180;\n }\n }\n\n //removing enemies\n for (Iterator<PositionsMap02> iter = enemies.iterator(); iter.hasNext(); ) {\n PositionsMap02 it = iter.next();\n if (it.isPositionEnd() || it.getEnemyType().isDead()) {\n\n iter.remove();\n }\n }\n //show turrets\n for (TurretType turretType: turrets) {\n showTurrets(turretType);\n }\n\n // After the round\n if (!isDone) {\n for (PositionsMap02 enemy : enemies) {\n showEnemy(enemy);\n sinceChangeTime = 0;\n }\n } else {\n if(sinceChangeTime > 1){\n moneyAdded = true;\n }\n if (sinceChangeTime > 10000) {\n round++;\n sinceChangeTime = 0;\n isDone = false;\n showTime = false;\n createNewEnemies((int) (round*50));\n moneyAdded = false;\n }\n }\n // if turret is chosen\n if(isTurretChosen){\n hoverTurret();\n }\n //showing fps\n showFPS();\n //shows fps\n font.draw(game.batch, (int) frameRate + \" fps\", 3, Gdx.graphics.getHeight() - 10);\n //shows HP\n font.draw(game.batch, BaseHealth + \" hp\", 160, Gdx.graphics.getHeight() - 10);\n if(showTime){\n font.draw(game.batch, Math.round(sinceChangeTime/1000) + \" s\", Gdx.graphics.getWidth()-300, Gdx.graphics.getHeight() - 10);\n }\n game.batch.end();\n\n // showing Shop if enabled\n if(showShop){\n showShop();\n }\n\n\n }", "private void advanceInvaders() {\n\t\tfor (ArrayList<Invader> row : enemyArray) {\n\t\t\tfor (Invader i : row) {\n\t\t\t\ti.setY(i.getY() + 4);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void loadEnemies() {\n\t\t\n\t}", "@Override\n\t public void actionPerformed(ActionEvent e) {\n\t\t isPlayerDead();\n\t\t isGameRunning();\n\n\t updatePlayer();\n\t updateCentipede();\n\t updateMissiles();\n\t\t updateMushrooms();\n\t updateSpider();\n\n\t checkCollisions();\n\t repaint();\n\t }", "private boolean isEnemyOccupied(int x, int y) {\n for (int i = 0; i < player.own.length; i++) {\n if (player.enemy[i].x == x && player.enemy[i].y == y) {\n System.out.println(\"enemy occupied:\" + i);\n return true;\n }\n }\n return false;\n }", "@Override\r\n public void update() {\r\n super.update();\r\n hero.checkForTileCollision(getXOverlap(hero.oldx,hero.oldx+width,hero.x,hero.x+width), getYOverlap(hero.oldy,hero.oldy+hero.height,hero.y, hero.y+hero.height));\r\n int i = 0;\r\n\r\n while (turningPoints[i]!= null)\r\n {\r\n if (intersects(turningPoints[i].x,turningPoints[i].y, turningPoints[i].width,turningPoints[i].height))\r\n {\r\n vx = -vx;\r\n vy = -vy;\r\n }\r\n i++;\r\n }\r\n }", "public static void checkTurnEnd(){\n\t\tboolean end = true;\n\t\tfor (int i = 0; i < heroList.length && end; i++) {\n\t\t\t\n\t\t\tif (heroList[i].isAlive()){\n\t\t\t\tif (heroList[i].getOtherAction()){\n\t\t\t\t\tend = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (checkVictory()) {\n\t\t\tinBattle = false;\n\t\t\t//screenNumber = ID_POST_BATTLE_CUTSCENE;\n\t\t\t//gui.setScreenID(screenNumber);\n\t\t\tscreenNumber = ID_POST_BATTLE_CUTSCENE;\n\t\t\tCutscene.loadCutscene(player.getCurLevel(), false);\n\t\t\tgui.setScreenID(screenNumber);\n\t\t\tgui.initializeCutscene();\n\t\t\tplayer.setCurLevel(player.getCurLevel()+1);\n\t\t}\n\t\t\n\t\tif (end) {\n\t\t\tai.play();\n\t\t\tgui.setEnemyPath(ai.getMoveCommands());\n\t\t\t\n\t\t\ttotalEnemyAttacks = 0;\n\t\t\tcurEnemyAttacker = -1;\n\t\t\t\n\t\t\tfor (int i = 0; i < enemyList.length; i++){\n\t\t\t\t\n\t\t\t\tif (ai.getAttackCommands(i) != null){\n\t\t\t\t\ttotalEnemyAttacks++;\n\t\t\t\t\t\n\t\t\t\t\tif (curEnemyAttacker == -1){\n\t\t\t\t\t\tcurEnemyAttacker = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (totalEnemyAttacks > 0){\n\t\t\t\tgui.setEnemyHasAttackCommand(true);\n\t\t\t\tscreenNumber = ID_POST_BATTLE_CUTSCENE;\n\t\t\t\tisEnemyAttacking = true;\n\t\t\t\t//gui.setScreenID(screenNumber);\n\t\t\t\tString message = ((Enemy)enemyList[curEnemyAttacker]).getEnemyType() + \" did \" + ai.getAttackCommandsDamage(curEnemyAttacker) + \" damage to \" + ((Hero)ai.getAttackCommands(curEnemyAttacker)).getName() + \"!\";\n\t\t\t\tCutscene.loadAttackCutscene(((Enemy)enemyList[curEnemyAttacker]).getEnemyID() * -1 - 1, ai.getAttackCommands(curEnemyAttacker).getUnitID(), message, map.getTileNumber(enemyList[curEnemyAttacker].getCoordinate()));\n\t\t\t\t\n\t\t\t\tcurEnemyAttack = 1;\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tplayer.resetAllHeroes();\n\t\t\t}\n\n\t\t}\n\t}", "public void run()\n {\n List<Entity> ms = new LinkedList<Entity>(monsters);\n for (Entity e : ms)\n if (e.isDead())\n monsters.remove(e);\n \n // Compare the current size with the previous size.\n if (monsters.size() < spawnThread.getPreviousSize() || spawnThread.getPreviousSize() == 0 || bossWave != null)\n {\n resetIdleTimer();\n return;\n }\n \n // Clear all player inventories, and \"kill\" all players.\n List<Player> ps = new LinkedList<Player>(arenaPlayers);\n for (Player p : ps)\n {\n MAUtils.clearInventory(p);\n MAUtils.tellPlayer(p, Msg.FORCE_END_IDLE);\n playerDeath(p);\n }\n }", "@Override\n\tprotected void simpleUpdate() {\n\t\tif(danks.isEmpty()){\n\t\t\tdanks.clear();\n\t\t\tnewDanks();\n\t\t}\n\n\t\tArrayList<Projectiles> projs = hero.getArray();\n\t\tIterator<Dank> enemIt = danks.iterator();\n\n\t\twhile(enemIt.hasNext()){\n\t\t\tDank e = enemIt.next();\n\t\t\tif(hero.getBounds().intersects(e.getBounds())){\n\t\t\t\tif(!isPaused)\n\t\t\t\t\tisPaused = !isPaused;\n\t\t\t\tgameOver = true;\n\t\t\t\tprojs.clear();\n\t\t\t}\n\t\t\t\n\t\t\tfor(int j = 0; j < projs.size(); j++){\n\t\t\t\tif(e.getBounds().intersects(projs.get(j).getBounds())){\n\t\t\t\t\tscore += e.getSpeed();\n\t\t\t\t\tenemIt.remove();\n\t\t\t\t\tprojs.remove(j);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\te.move();\n\t\t}\n\t}", "public ArrayList<Enemy> getEnemies()\r\n\t{\r\n\t\treturn enemy;\r\n\t}", "private void checkForDeaths() {\n Iterator<Entity> entityIter = this.entities.iterator();\n\n //geht alle teilnehmer durch\n while ( entityIter.hasNext() ) {\n Entity entity = entityIter.next();\n\n //und entfernt sie wenn sie tot sind aus der liste und der engine\n if ( this.combatMapper.get(entity).curHealth <= 0 ) {\n entityIter.remove();\n\n //alle actions der entity entfernen, können ja nichts machen wenn sie tot sind\n Iterator<IAction> actionIter = this.actions.iterator();\n\n while ( actionIter.hasNext() ) {\n if ( actionIter.next().getOwner().equals(entity) ) {\n actionIter.remove();\n }\n }\n\n this.combatExp += this.combatMapper.get(entity).level * 5; //TODO\n\n EventSystem.getInstance().commitEvent(new Event(EventSystem.EventType.KILL_EVENT, entity));\n\n this.combatSystem.getEngine().removeEntity(entity);\n }\n }\n }", "public void update() {\r\n\t\tif (!isPaused && !noclip)\r\n\t\t\tcollision();\r\n\t\tif (!isPaused)\r\n\t\t\tsideScroll();\r\n\r\n\t\t/*\r\n\t\t * Call the update , act(), method from each individual object if game\r\n\t\t * is not paused\r\n\t\t */\r\n\t\tif (!isPaused) {\r\n\t\t\tfor (CosmosEntity obj : level.getLevelEnemyObjects())\r\n\t\t\t\tif (obj.isAlive())\r\n\t\t\t\t\tobj.act(); // act if object is alive\r\n\r\n\t\t\tfor (CosmosEntity obj : level.getLevelInteractiveObjects())\r\n\t\t\t\tif (obj.isAlive())\r\n\t\t\t\t\tobj.act();\r\n\r\n\t\t\tfor (CosmosEntity obj : level.getLevelTextureObjects())\r\n\t\t\t\tobj.act();\r\n\r\n\t\t}\r\n\r\n\t\tfor (CosmosEntity anim : level.getlevelConstantObjects())\r\n\t\t\tif (anim.isAlive())\r\n\t\t\t\tanim.act();\r\n\r\n\t\tif (!isPaused)\r\n\t\t\tplayer.act(); // calls player act method, results in animation\r\n\r\n\t}", "@Override\n public void update(@NotNull GameVariables variables) {\n if (variables.getStep() % variables.getEnemyMovementDelay() == 0) {\n super.setCoordinates(x(), y() + variables.getEnemySpeed());\n }\n }", "public void update()\n\t{\n\t\tgrid.draw();\n\t\tmonsterSpawner.update();\n\t\tjewelSpawner.update();\n\t\t\n\t\tint numOnCenter = 0;\n\t\tfor (Player player : players)\n\t\t\tif (player.getSprite().onCenterArea())\n\t\t\t\tnumOnCenter++;\n\t\tfor (Player player : players) {\n\t\t\tif (numOnCenter < 2 && player.getSprite().onCenterArea())\n\t\t\t\tplayer.addScore(Clock.getSeconds());\n\t\t\tplayer.update();\n\t\t}\n\t\tfor (Iterator<Projectile> iterator = projectiles.iterator(); iterator.hasNext();) {\n\t\t\tProjectile projectile = iterator.next();\n\t\t\tif (!projectile.exists())\n\t\t\t\titerator.remove();\n\t\t\telse\n\t\t\t\tprojectile.update();\n\t\t}\n\t\t\n\t\tui.update();\n\t\tfor (int i = traps.size() - 1; i >= 0; i--)\n\t\t{\n\t\t\tTrap trap = traps.get(i);\n\t\t\ttrap.update();\n\t\t\tif (!trap.exists())\n\t\t\t{\n\t\t\t\ttraps.remove(i);\n\t\t\t\tgrid.removeEntity(trap.getCurrentTile());\n\t\t\t}\n\t\t}\n\t}", "public void updateCollisions() {\n\n\t\tfor(Sprite sprite : level.sprites()) {\n\t\t\tlevel.sprites().stream().forEach(sprite2 -> handleCollisions(sprite, sprite2));\n\t\t}\n\n\t}", "@Override\n\tpublic void run() {\n\t\ttry{\n\t\t\tList<Player> playerList = Game.getPlayers();\n\t\t\tList<Ship> temp_list = new ArrayList<Ship>();\n\t\t\twhile(Alpha.getGameRunning()){\n\t\t\t\tThread.sleep(100L);\n\t\t\t\t\n\t\t\t\t//iterates through the players\n\t\t\t\tfor(int i = 0; i<playerList.size(); i++){\n\t\t\t\t\ttemp_list.clear();\n\t\t\t\t\tList<Ship> shipList = playerList.get(i).getShips();\n\t\t\t\t\tplayerList.get(i).resetVisibleEnemies(); //makes sure there is no overadding visible ships\n\t\t\t\t\t\n\t\t\t\t\t//iterates through the players' ships\n\t\t\t\t\tfor(int j = 0; j<shipList.size(); j++){\n\t\t\t\t\t\tShip temp_ship = shipList.get(j);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//iterates through other players\n\t\t\t\t\t\tfor(int k = 0; k<playerList.size(); k++){\n\t\t\t\t\t\t\tif(k!=i){\n\t\t\t\t\t\t\t\tList<Ship> enemyList = playerList.get(k).getShips();\n\t\t\t\t\t\t\t\tint count = 0;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//iterates through other players' shiplist to find ships in range\n\t\t\t\t\t\t\t\tfor(int l = 0; l< enemyList.size(); l++){\n\t\t\t\t\t\t\t\t\tShip enemyShip = enemyList.get(l);\n\t\t\t\t\t\t\t\t\tdouble range = Game.findRangeBetween(temp_ship, enemyShip);\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Vision: Ship1 is \" + range + \" from Ship2\");\n\t\t\t\t\t\t\t\t\tif(range <= temp_ship.getSightRange()){\n\t\t\t\t\t\t\t\t\t\t//TODO: add it to sighted lists and set ship boolean to spotted\n\t\t\t\t\t\t\t\t\t\tif(!temp_list.contains(enemyShip)){\n\t\t\t\t\t\t\t\t\t\t\ttemp_list.add(enemyShip);\n\t\t\t\t\t\t\t\t\t\t\tenemyShip.setVisible(true);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else{\n\t\t\t\t\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} if(count==enemyList.size()){\n\t\t\t\t\t\t\t\t\ttemp_ship.setVisible(false);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tplayerList.get(i).setVisibleEnemies(temp_list);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch(InterruptedException e){\n\t\t\te.printStackTrace();\n\t\t} finally{\n\t\t\t\n\t\t}\n\n\t}", "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 }", "private void checkExplosionKill() {\n\t\t\n\t\texplosion.expand();\n\t\t\n\t\tfor (ArrayList<Invader> row : enemyArray) {\n\t\t\tfor (Invader a : row) {\n\t\t\t\tif (explosion.detectDownwardCollision(a.getX(), a.getY())) {\n\t\t\t\t\ta.setVisibility(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void update(float dt) {\n if (codeOn == true) {\n //do nothing\n } else {\n handleinput(dt);\n }\n //movedRight(dt);\n //takes 1 step in the physics simulation 60 times per second\n world.step(1 / 60f, 6, 2);\n player.update(dt);\n\n //if character dies, freeze the camera right where he died\n if (player.currentState != Adventurer.State.DEAD) {\n gamecam.position.x = player.b2body.getPosition().x;\n }\n\n hud.update(dt);\n\n for (Enemy enemy : creator.getDungeonMonster()) {\n enemy.update(dt);\n if (enemy.getX() < player.getX() + 220 / DefaultValues.PPM) {\n enemy.b2body.setActive(true);//activate goomba\n }\n }\n if (DefaultValues.questActivated == true) {\n quest1 = true;\n quest2 = false;\n DefaultValues.questActivated = false;\n stage.addActor(dialog);\n }\n\n if (DefaultValues.quest2Activated == true) {\n quest1 = false;\n quest2 = true;\n DefaultValues.quest2Activated = false;\n stage.addActor(dialog2);\n }\n\n if (touchedFinishline == true) {\n if (progressInsideTaskTwo == 100) {\n if (saveProcessor.checkAchievement() == true) {\n DungeonCoder.manager.get(\"UIElements/Animation/achievement.mp3\", Sound.class).play();\n }\n DungeonCoder.manager.get(\"UIElements/Animation/stagecomplete.mp3\", Sound.class).play();\n hud.stopMusic();\n touchedFinishline = false;\n saveProcessor.insClear();\n System.out.println(\"Total clear:\" + saveProcessor.getTotalCleared());\n System.out.printf(\"You have cleared %d instructional stages.\\n\", saveProcessor.getInsCleared());\n dispose();\n game.setScreen(new StageThreeComplete(game));\n } else {\n touchedFinishline = false;\n new Dialog(\"Dungeon Coder\", skin, \"dialog\") {\n protected void result(Object object) {\n }\n }.text(\"You have not fulfil the requirement to complete the stage!\").button(\" Ok \", true).show(stage);\n }\n }\n\n\n //update gamecam with correct corrdinates after changes\n gamecam.update();\n\n //tell renderer to draw only what our camera can see in our game world\n renderer.setView(gamecam);\n\n }", "public boolean enemyOutOfBounds() {\n return (position.x < 0\n || position.x + TYPE_A_WIDTH > World.WORLD_WIDTH\n || position.y < 0\n || position.y + TYPE_A_HEIGHT > World.WORLD_HEIGHT);\n }", "private void addUpdateablesToGameLoop(){\n GameLoop.getInstance().addUpdateables(playerController.getPlayers().get(0));\n for (Enemy e : enemyController.getEnemies()){\n GameLoop.getInstance().addUpdateables(e);\n }\n\n GameLoop.getInstance().addUpdateables(foodController.getFood().get(0));\n }", "public void reassignAllAgents() {\n\t\tPoint safePosition = null;\n\t\tfor(Player p : playerList) {\n\t\t\tif(p.getType() == PlayerType.Agent) {\n\t\t\t\tremovePosition(p.getPosition());\n\t\t\t\tsafePosition = getSafeTeleportPosition();\n\t\t\t\tp.setPosition(safePosition);\n\t\t\t\toccupiedPositions.add(safePosition);\n\t\t\t}\n\t\t}\n\t}", "public void paintEnemies(Graphics g)\n {\n for(Entity e: enemies)\n {\n if(inBounds(e))\n {\n if(e instanceof Enemy)\n {\n paintEntity(g, e);\n }\n else if(e instanceof Boss)\n {\n paintBoss(g, (Boss)e);\n }\n }\n }\n }", "private void iterateEnemyShots() {\n\t\tfor (Shot s : enemyShotList) {\n\t\t\tfor (ArrayList<Invader> row : enemyArray) {\n\t\t\t\tfor(Invader a : row) {\n\t\t\t\t\ta.shouldAttack(s);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "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 void addEnemies() {\n\t\tred_ghost = new Enemy();\r\n\t\tthis.add(red_ghost);\r\n\t\tenemies.add(red_ghost);\r\n\t\t\r\n\t}", "public void checkHits() {\n\t\t// your code here\n\t\tfor (int i = 0; i < enemyX.length; i++) {\n\t\t\tif (distance((int)xI, (int)yI, enemyX[i], enemyY[i]) <= DIAM_ENEMY/2 + DIAM_LAUNCHER/2) {\n\t\t\t}\n\t\t}\n\t}", "private void enemiesWillShoot(Graphics2D g2d, GameState state) {\n if (numOfRenderShoot == 75) {\n numOfRenderShoot = 0;\n for (int i = 0; i < state.getEnemyTanks().size(); i++) {\n if (state.getEnemyTanks().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyTanks().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyTanks().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyTanks().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyMissiles().add(new EnemyMissile(this, state, 10\n , state.getEnemyTanks().get(i)));\n state.getEnemyMissiles().get(state.getEnemyMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n for (int i = 0; i < state.getEnemyCars().size(); i++) {\n if (state.getEnemyCars().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyCars().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyCars().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyCars().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyBullets().add(new EnemyBullet(this, state, 20\n , state.getEnemyCars().get(i)));\n state.getEnemyBullets().get(state.getEnemyBullets().size() - 1).bulletDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n for (int i = 0; i < state.getEnemyWallTurrets().size(); i++) {\n if (state.getEnemyWallTurrets().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyWallTurrets().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyWallTurrets().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyWallTurrets().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyWallTurretMissiles().add(new EnemyWallTurretMissile(this, state, 15\n , state.getEnemyWallTurrets().get(i)));\n state.getEnemyWallTurretMissiles().get(state.getEnemyWallTurretMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n\n for (int i = 0; i < state.getEnemyTurrets().size(); i++) {\n if (state.getEnemyTurrets().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyTurrets().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyTurrets().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyTurrets().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyHomingMissiles().add(new EnemyHomingMissile(this, state, 15\n , state.getEnemyTurrets().get(i)));\n state.getEnemyHomingMissiles().get(state.getEnemyHomingMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n }\n for (EnemyMissile enemyMissile : state.getEnemyMissiles()) {\n enemyMissile.paint(g2d, state);\n }\n for (EnemyBullet enemyBullet : state.getEnemyBullets()) {\n enemyBullet.paint(g2d, state);\n }\n for (EnemyWallTurretMissile enemyWallTurretMissile : state.getEnemyWallTurretMissiles()) {\n enemyWallTurretMissile.paint(g2d, state);\n }\n for (EnemyHomingMissile enemyHomingMissile : state.getEnemyHomingMissiles()) {\n enemyHomingMissile.paint(g2d, state);\n }\n }", "@Override\n protected void update(Engine engine) {\n\t\trs = (GL4RenderSystem) engine.getRenderSystem();\n\t\t\n\t\telapsTime += engine.getElapsedTimeMillis();\n\t\telapsTimeSec = Math.round(elapsTime/1000.0f);\n\t\telapsTimeStr = Integer.toString(elapsTimeSec);\n\t\t\n\t\t//player.update(elapsTimeSec);\n\t\tSceneNode dragon = engine.getSceneManager().getSceneNode(\"dragonNPCNode\");\n\t\t\n\t\tdIter++;\n\t\t//if(dIter == 200)\n\t\t//{\n\t\t\t//dir = dir*-1;\n\t\t\t//dIter = 0;\n\t\t//}\n\t\tif(dIter <= 200)\n\t\tdragon.moveBackward(dir);\n\t\t\n\t\tif(dIter > 200 && dIter <= 400 )\n\t\t\tdragon.moveLeft(dir);\n\t\t\n\t\tif(dIter > 400 && dIter <= 600 )\n\t\t\tdragon.moveForward(dir);\n\t\t\n\t\tif(dIter > 600 && dIter <= 800 )\n\t\t\tdragon.moveRight(dir);\n\t\t\n\t\tif(dIter == 800 )\n\t\t\tdIter = 0;\n\t\t//SkeletalEntity dragonSE =\n\t\t\t\t//(SkeletalEntity) engine.getSceneManager().getEntity(\"dragonSkeleton\");\n\t\t//dragonSE.update();\n\t\t\n\t\tfloat time = engine.getElapsedTimeMillis();\n\t\t\n\t\tfloat playerFloat[] = player.getNode().getLocalTransform().toFloatArray();\n\t\t//playerFloat[7] = player.getNode().getLocalPosition().y();\n\t\tdouble playerMat[] = toDoubleArray(playerFloat);\n\t\tMatrix4 mat3;\n\t\tmat3 = Matrix4f.createFrom(toFloatArray(player.getNode().getPhysicsObject().getTransform()));\n\t\t//player.getNode().setLocalPosition(playerFloat[3],mat3.value(1,3), playerFloat[11]);\n\t\t//double playerMat[] = toDoubleArray(player.getNode().getLocalTransform().toFloatArray());\n\t\tplayerFloat = player.getNode().getLocalTransform().toFloatArray();\n\t\t//playerFloat[7] = player.getNode().getLocalPosition().y();\n\t\tplayerFloat[7] = mat3.value(1,3);//set y coordinate to physics world\n\t\tplayerMat = toDoubleArray(playerFloat);\n\t\tSystem.out.println(\"player.getNode().getLocalTransform(): \" + player.getNode().getLocalTransform());\n\t player.getNode().getPhysicsObject().setTransform(playerMat);\n\t \n\t player.update(elapsTimeSec);\n\t SkeletalEntity manSE =\n \t\t(SkeletalEntity) engine.getSceneManager().getEntity(\"knightSkeleton\");\n \t\tmanSE.update();\n\n\t \n\t\tif (running)\n\t\t{ \n\t\t\tMatrix4 mat;\n\t\t\tphysicsEng.update(time);\n\t\t\tfor (SceneNode s : engine.getSceneManager().getSceneNodes())\n\t\t\t{ \n\t\t\t\t//if (s.getPhysicsObject() != null && s.getName() != player.getNode().getName())\n\t\t\t\t//if (s.getPhysicsObject() != null /*&& s.getName() != player.getNode().getName()*/)\n\t\t\t\t{ \n\t\t\t\t\tmat = Matrix4f.createFrom(toFloatArray(s.getPhysicsObject().getTransform()));\n\t\t\t\t\ts.setLocalPosition(mat.value(0,3),mat.value(1,3), mat.value(2,3));\n\t\t\t\t} \n\t\t\t} \n\t\t}\n\n\t\tdispStr=\"Time = \" + elapsTimeStr + \" Score: \"+player.getScore();\n\t\trs.setHUD(dispStr, 15, 15);\n\t\tif(player.isBoostActive()) dispStr+=\" Boost Active!\";\n\t\tim.update(elapsTime);\n\t\tprocessNetworking(elapsTime);\n\t\t\n\t\tcheckForCollisions();\n\t\t//player.update(elapsTimeSec);\n\t\tSystem.out.println(\"ball transform: \" + ball2Node.getLocalTransform() );\n\t\tSystem.out.println(\"ball physycs object transform: \" + ball2Node.getPhysicsObject().getTransform()[0] + ',' \n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[1] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[2] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[3] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[4] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[5] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[6] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[7] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[8] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[9] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[10] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[11] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[12] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[13] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[14] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[15] + ',');\n\t\tSystem.out.println(\"ball linear velocity: \" + ball2Node.getPhysicsObject().getLinearVelocity());\n\t\tif(distanceTo(player.getNode().getLocalPosition(),ball2Node.getLocalPosition()) <= 4)\n\t\t{\n\t\t\tball2Node.setLocalPosition(0,10,0);\n\t\t\tfloat velocityArray[] = { 0, 5, 0};\n\t\t\tball2Node.getPhysicsObject().setLinearVelocity(velocityArray);\n\t\t\tfloat floTemp[] = ball2Node.getLocalTransform().toFloatArray();\n\t\t\tdouble dubTemp[] = {(double)floTemp[0], (double)floTemp[1], (double)floTemp[2], (double)floTemp[3], (double)floTemp[4],\n\t\t\t\t\t(double)floTemp[5],(double)floTemp[6],(double)floTemp[7], (double)floTemp[8], (double)floTemp[9], (double)floTemp[10], (double)floTemp[11]\n\t\t\t\t\t\t\t, (double)floTemp[12], (double)floTemp[13], (double)floTemp[14], (double)floTemp[15] };\n\t\t\t\n\t\t\tdouble dubTemp2[] = toDoubleArray(floTemp);\n\n\n\t\t\t Matrix4 mat2;\n\t\t\tball2Node.getPhysicsObject().setTransform(dubTemp2);\n\t\t\t\n\t\t\t//mat2 = Matrix4f.createFrom(toDoubleArray( ball2Node.getLocalTransform().toFloatArray()))\n\t\t\t//ball2Node.getPhysicsObject().setTransform(dubTemp2);\n\t\t\t//ball2Node.setPhysicsObject(ball2PhysObj);\n\t\t\t//ball2Node.getPhysicsObject().getTransform().\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t//player.playWalkAnimation();\n\t\t\n\t\t\n\t\t\n\t\t/*ball2Node.getPhysicsObject().setTransform(ball2Node.getLocalTransform());\n\t\t//ball2PhysObj.set\n\t\tphysicsEng.\n\t\ttemptf = toDoubleArray(ball1Node.getLocalTransform().toFloatArray());\n \tball1PhysObj = physicsEng.addSphereObject(physicsEng.nextUID(),\n \tmass, temptf, 2.0f);\n \tball1PhysObj.setBounciness(1.0f);\n \tball1Node.setPhysicsObject(ball1PhysObj);*/\n\t\t\n\t\t/* check if player jumped*/\n\t\t\n\t}", "public ArrayList<Actor> getEnemies() {\n return getGrid().getNeighbors(getLocation());\n }", "boolean allEnemyShipsAreDestroyed()\n\t{\n\t\tfor (int i = 0; i < targets.myShips.size(); i++) {\n\t\t\tif (targets.myShips.get(i).isAlive()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public void update(){\n\t\tthis.game.atacarZombies(this.x, this.y, this.damage, 1, false); //Misma fila\n\t\tthis.game.atacarZombies(this.x-1, this.y, this.damage, 1, false); //Fila arriba\n\t\tthis.game.atacarZombies(this.x+1, this.y, this.damage, 1, false); //Fila abajo\n\t\tthis.turno++;\n\t}", "private void updateGame() {\n\t\tif (levelStartTimer.isRunning() && !timer.isRunning())\n\t\t\ttimer.start();\n\t\tif (timer.isRunning()) {\n\t\t\tpacman.update();\n\t\t\tfor (Ghost ghost : ghosts)\n\t\t\t\tghost.update();\n\t\t\tupdateHighScore();\n\t\t\tupdatePacmansAnimation();\n\n\t\t\tfor (Ghost ghost : ghosts)\n\t\t\t\tif (ghost.isCollidedWithPacman(pacman)) {\n\t\t\t\t\tif (pacman.getNumberOfLives() > 0) {\n\t\t\t\t\t\tinitLevelAfterDeath();\n\t\t\t\t\t\tlogger.info(\"Pacman has died\");\n\t\t\t\t\t} else\n\t\t\t\t\t\tgameEnded();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t}\n\t\trepaint();\n\t}", "public boolean isGameOver(){\n if( character.getHp() <= 0 ){\n System.out.println(\"GAME IS OVER BECAUSE CHARACTER DEAD\");\n return true;\n }\n for (int i = 0 ; i < enemies.size() ; i++)\n {\n if(!enemies.get(i).isDead()){\n System.out.println(\"NOT ALL ENEMIES DEAD\");\n return false;\n }\n }\n if( !isGameOver ){\n endGame();\n isGameOver = true;\n }\n System.out.println(\"GAME IS OVER BECAUSE ALL ENEMIES ARE DEAD\");\n return true;\n }" ]
[ "0.7935792", "0.7682164", "0.7438727", "0.6774161", "0.6770253", "0.67663074", "0.67088705", "0.6684497", "0.66774225", "0.66383374", "0.66321033", "0.6631174", "0.65375674", "0.64812213", "0.64596885", "0.6459037", "0.64552885", "0.64360195", "0.638755", "0.6371865", "0.63394916", "0.6312331", "0.6269084", "0.6268393", "0.6195971", "0.6193597", "0.6184158", "0.61806256", "0.61744803", "0.6171231", "0.61347586", "0.6131373", "0.61078703", "0.6072288", "0.6050982", "0.60460925", "0.60322064", "0.6007904", "0.60028654", "0.5998805", "0.59934145", "0.5966591", "0.59621364", "0.5955603", "0.59485644", "0.59341294", "0.59298515", "0.59154266", "0.5915287", "0.59104484", "0.58964914", "0.58927673", "0.5890844", "0.58841246", "0.587244", "0.5861351", "0.58596873", "0.58489174", "0.5835827", "0.582371", "0.5817876", "0.5798757", "0.5796545", "0.57946193", "0.5749174", "0.5746882", "0.5741844", "0.5741239", "0.5741036", "0.57404935", "0.57216215", "0.5719342", "0.57116205", "0.5709565", "0.5709114", "0.57016814", "0.56998914", "0.56950456", "0.56877667", "0.56862247", "0.56828725", "0.56690097", "0.5663479", "0.5654353", "0.5653987", "0.5649683", "0.56475836", "0.56450826", "0.5638865", "0.56105745", "0.56068516", "0.56043553", "0.55998534", "0.5598626", "0.5583456", "0.55769265", "0.55635506", "0.55611145", "0.5559525", "0.55504864" ]
0.79611355
0
Update bullets. It moves bullets. Checks whether the bullet has left the screen. Checks whether the bullets hit an enemy or not.
private void UpdateBullets() { for(int i = 0; i < BulletList.size(); i++) { Bullet bullet = BulletList.get(i); // Move the bullet. bullet.Update(); // checks if the bullet has it left the screen if(bullet.HasLeftScreen()){ BulletList.remove(i); continue; } // checks if the bullet hit the enemy Rectangle BulletRectangle = new Rectangle((int)bullet.xCoord, (int)bullet.yCoord, bullet.BulletImage.getWidth(), bullet.BulletImage.getHeight()); // Go trough all enemies. for(int j = 0; j < EnemyList.size(); j++) { Enemy eh = EnemyList.get(j); Rectangle EnemyRectangel = new Rectangle(eh.xCoord, eh.yCoord, eh.EnemyHelicopterImage.getWidth(), eh.EnemyHelicopterImage.getHeight()); // Checks whether the the bullet has hit the enemy if(BulletRectangle.intersects(EnemyRectangel)) { // Bullet hit the enemy so we reduce his health. eh.Health -= Bullet.DamagePower; // Bullet was also destroyed so we remove it. BulletList.remove(i); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void update() {\n for (int i = 0; i < bullets.size(); i++) {//if any bullets expires remove it\n if (bullets.get(i).off) {\n bullets.remove(i);\n i--;\n }\n }\n move();//move everything\n checkPositions();//check if anything has been shot or hit\n }", "@Override\n\tpublic void update() {\n\t\tif(isMove) {\n\t\t\tspriteMoveToPoint(player, (int) mouseX, (int) mouseY);\n\t\t}\n\t\t\n\t\t//bullet\n\t\tfor(int i = 0; i < bulletList.size(); i++) {\n\t\t\tMoveSprite bullet = bulletList.get(i);\n\t\t\tspriteMoveToPoint(bullet, bullet.getX(), bullet.getY() - bullet.getVelocity());\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < bulletList.size(); i++) {\n\t\t\tMoveSprite bullet = bulletList.get(i);\n\t\t\t\tif(bullet.getY() < 10) {\n\t\t\t\t\tremoveBullet(bullet);\n\t\t\t\t}\n\t\t}\n\t\t\n\t\t//enemy\n\t\tfor(int i = 0; i < enemyList.size(); i++) {\n\t\t\tMoveSprite enemy = enemyList.get(i);\n\t\t\tspriteMoveToPoint(enemy, enemy.getX(), enemy.getY() + enemy.getVelocity());\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < enemyList.size(); i++) {\n\t\t\tMoveSprite enemy = enemyList.get(i);\n\t\t\tif(enemy.getY() > layerheight) {\n\t\t\t\tremoveEnemy(enemy);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < enemyList.size(); i++) {\n\t\t\tEnemy enemy = enemyList.get(i);\n\t\t\tfor(int j = 0; j < bulletList.size(); j++) {\n\t\t\t\tBullet bullet = bulletList.get(j);\n\t\t\t\tcollisionCheckForBulletAndEnemy(enemy, bullet);\n\t\t\t}\n\t\t}\n\t}", "public void trackBullets(){\n for (int i = 0; i < bullets.size(); i++){\n Bullet tempBullet = bullets.get(i);\n //update the position of the bullets\n tempBullet.update();\n tempBullet.drawBullet();\n //check if the bullet hit the boundary, remove the bullet from the list of the bullet\n if(tempBullet.detectBound()){\n bullets.remove(i);\n continue;\n }\n //detect if the bullet hit the boss and cause the damage if yes\n if(tempBullet.hitObject(Main.boss) && Main.boss.alive){\n Main.boss.decreaseHealth(attack);\n tempBullet.drawHit();\n bullets.remove(i);\n if(Main.boss.health <= 0){\n Main.boss.alive = false;\n Main.boss.deadTime = millis();\n Main.score += 100;\n }\n }\n //detect if the bullet hit the enemy and cause the damage if yes\n for(int j = 0; j < Main.enemies.size(); j++){\n Enemy tempEnemy = Main.enemies.get(j);\n if(tempBullet.hitObject(tempEnemy) && tempEnemy.alive){\n tempBullet.drawHit();\n tempEnemy.decreaseHealth(attack);\n // if enemy is totally hitted, wait one 1s, and then removed\n if(tempEnemy.health <= 0){\n tempEnemy.alive = false;\n tempEnemy.deadTime = millis();\n }\n bullets.remove(i);\n break;\n }\n }\n }\n }", "public void update(){\n\n // advance player and entity loader\n player.advance();\n entityloader.advance();\n\n // if the player is shooting\n if (player.isShooting){\n player.nextBullet--;\n if (player.nextBullet < 0){\n audioloader.play(\"plshoot\"); // play audio\n for (int i = -1; i <= 1; ++i){\n playerBullets.add(new Projectile<RectangleHitbox>(player.getCenterX(), player.getCenterY(), 500, 0, 270 + 2.5 * i, 0, 0, false, 1.5, true, 0,\n player.bulletSprite.getRectangleHitbox(player.bulletSize), player.bulletSprite.img.getScaledInstance(player.bulletSize, player.bulletSize, 1), 0, 0, this));\n } \n player.nextBullet = (int)(FPS / player.bulletsPerSecond);\n }\n }\n\n // Player bullets\n for (Projectile<RectangleHitbox> bullet : playerBullets){\n if (bullet.advance()){\n nextPlayerBullets.add(bullet);\n }\n }\n playerBullets.clear();\n for (Projectile<RectangleHitbox> bullet : nextPlayerBullets){\n playerBullets.add(bullet);\n }\n nextPlayerBullets.clear();\n\n // Circle Enemies\n for (Projectile<CircleHitbox> enemy : circleEnemies){\n if (player.invulnerableTime <= 0 && enemy.getHitbox().intersects(player.getHitbox())){\n loseLife();\n }\n if (!enemy.isBullet){ // if enemy is not a bullet, check if it is being hit by player bullets\n boolean hit = false; // each enemy can only be hit once each frame\n for (Projectile<RectangleHitbox> bullet : playerBullets){\n hit |= bullet.getHitbox().intersects(enemy.getHitbox());\n if (hit)\n break;\n }\n if (hit){\n enemy.damageTaken += enemy.originalLifetime * enemy.percentDamage;\n }\n }\n if (enemy.advance()){ // if enemy lifetime is not up\n nextCircleEnemies.add(enemy); // add to next frame\n } else if (enemy.id != 0) { // if lifetime is up\n // tell entity loader enemy with that id is removed\n entityloader.setUnactive(enemy.id);\n }\n }\n circleEnemies.clear();\n for (Projectile<CircleHitbox> enemy : nextCircleEnemies){ // swap nextCircleEnemies with circleEnemies\n circleEnemies.add(enemy);\n }\n nextCircleEnemies.clear();\n\n // Rectangle Enemies\n for (Projectile<RectangleHitbox> enemy : rectangleEnemies){\n if (player.invulnerableTime <= 0 && enemy.getHitbox().intersects(player.getHitbox())){\n loseLife();\n }\n if (enemy.advance()){ // if enemy lifetime is not up\n nextRectangleEnemies.add(enemy); // add to next frame\n } else if (enemy.id != 0) { // if lifetime is up\n // tell entity loader enemy with that id is removed\n entityloader.setUnactive(enemy.id);\n }\n }\n rectangleEnemies.clear();\n for (Projectile<RectangleHitbox> enemy : nextRectangleEnemies){ // swap nextRectangleEnemies with rectangleEnemies\n rectangleEnemies.add(enemy);\n }\n nextRectangleEnemies.clear();\n\n }", "private void checkForBulletCollisions() {\r\n\t\tbulletMoveOffScreen();\r\n\t\tbulletCollisionWithObject();\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\tAlly.update();\r\n\t\tEnemy.update();\r\n\t\tfor(int i = 0 ; i < GroundList.size();i++){\r\n\t\t\tif(GroundList.get(i).kill) {\r\n\t\t\t\tGroundList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < BarelList.size(); i++) {\r\n\t\t\tif(BarelList.get(i).kill) {\r\n\t\t\t\tBarelList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < WoodList.size(); i++) {\r\n\t\t\tif(WoodList.get(i).kill) {\r\n\t\t\t\tWoodList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < FireBallList.size(); i++) {\r\n\t\t\tif(FireBallList.get(i).kill) {\r\n\t\t\t\tFireBallList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < BulletList.size(); i++) {\r\n\t\t\tif(BulletList.get(i).kill) {\r\n\t\t\t\tBulletList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i = 0 ; i < GroundList.size();i++){\r\n\t\t\tGroundList.get(i).update();\r\n\t\t}\r\n\t\tfor(int i = 0 ; i < BarelList.size(); i++) {\r\n\t\t\tBarelList.get(i).update();\r\n\t\t}\r\n\t\tfor(int i = 0; i < BulletList.size(); i++) {\r\n\t\t\tBulletList.get(i).update();\r\n\t\t}\r\n\t\tfor(int i = 0; i < FireBallList.size(); i++) {\r\n\t\t\tFireBallList.get(i).update();\r\n\t\t}\r\n\t\tfor(int i = 0; i < WoodList.size(); i++) {\r\n\t\t\tWoodList.get(i).update();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(GamePanel.updateTimes%60 == 0) {\r\n\t\t\tEnemy.PushEntity(2, new Vector2f(width*1/2, height/4),enemy);\r\n\t\t}\r\n\t\tfor(int i = 0; i < AllyDeadList.size(); i++) {\r\n\t\t\tAlly.entityList.remove(AllyDeadList.get(i)-i);\r\n\t\t}\r\n\t\tfor(int i = 0; i < EnemyDeadList.size(); i++) {\r\n\t\t\tEnemy.entityList.remove(EnemyDeadList.get(i)-i);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tAllyDeadList.clear();\r\n\t\tEnemyDeadList.clear();\r\n\t\tfor(int i = 0; i < Ally.entityList.size(); i++) {\r\n\t\t\tif(Ally.entityList.get(i).returnHealth() <= 0) {\r\n\t\t\t\tAllyDeadList.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < Enemy.entityList.size(); i++) {\r\n\t\t\tif(Enemy.entityList.get(i).returnHealth() <= 0) {\r\n\t\t\t\tEnemyDeadList.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void checkCollision(){\n\r\n for(int i = 0; i < enemies.size(); i++){\r\n \r\n // Player and Enemy collision\r\n \r\n if(collide(this.player, enemies.get(i)) && this.player.isVisible() && enemies.get(i).isVisible()){\r\n System.out.println(\"Collide\");\r\n this.player.setHealth(this.player.getHealth() - 100);\r\n }\r\n\r\n // Player and Enemy bullet collision\r\n \r\n for(int j =0; j < enemies.get(i).getBullets().size(); j++){\r\n\r\n if(collide(this.player, enemies.get(i).getBullets().get(j)) && this.player.isVisible() && enemies.get(i).getBullets().get(j).isVisible()){\r\n\r\n enemies.get(i).getBullets().get(j).setVisible(false);\r\n this.player.setHealth(this.player.getHealth() - enemies.get(i).getBullets().get(j).getDamage());\r\n\r\n }\r\n }\r\n\r\n }\r\n //time = DEFAULT_TIME_DELAY;\r\n// }\r\n\r\n\r\n\r\n for(int i = 0; i < player.getBullets().size(); i++){\r\n\r\n\r\n // Player bullet and enemy collision\r\n\r\n for(int j = 0; j < enemies.size(); j++) {\r\n if (collide(enemies.get(j), player.getBullets().get(i)) && enemies.get(j).isVisible() && player.getBullets().get(i).isVisible()) {\r\n\r\n if (enemies.get(j).getHealth() < 0) {\r\n enemies.get(j).setVisible(false);\r\n score.addScore(100);\r\n }\r\n\r\n enemies.get(j).setHealth(enemies.get(j).getHealth() - player.getBullets().get(i).getDamage());\r\n // enemies.get(j).setColor(Color.RED);\r\n player.getBullets().get(i).setVisible(false);\r\n\r\n\r\n }\r\n }\r\n\r\n\r\n // Boss collision & player bullet collision\r\n\r\n if(collide(player.getBullets().get(i), this.boss1) && player.getBullets().get(i).isVisible() && boss1.isVisible()){\r\n\r\n if(boss1.getHealth() < 0){\r\n boss1.setVisible(false);\r\n score.addScore(1000);\r\n state = STATE.WIN;\r\n }\r\n this.boss1.setHealth(this.boss1.getHealth() - player.getBullets().get(i).getDamage());\r\n // this.boss1.setHealth(0);\r\n player.getBullets().get(i).setVisible(false);\r\n\r\n }\r\n\r\n }\r\n\r\n // Bullet vs Bullet Collision\r\n\r\n for(int k = 0 ; k < player.getBullets().size(); k++){\r\n\r\n if(player.getBullets().get(k).isVisible()) {\r\n for (int i = 0; i < enemies.size(); i++) {\r\n\r\n if(enemies.get(i).isVisible()) {\r\n for (int j = 0; j < enemies.get(i).getBullets().size(); j++) {\r\n\r\n if (collide(player.getBullets().get(k), enemies.get(i).getBullets().get(j)) && enemies.get(i).getBullets().get(j ).isVisible()) {\r\n\r\n\r\n System.out.println(\"bullets colliding\");\r\n\r\n player.getBullets().get(k).setVisible(false);\r\n enemies.get(i).getBullets().get(j).setColor(Color.yellow);\r\n enemies.get(i).getBullets().get(j).deflect(this.player.getX() + this.player.getW()/2, this.player.getY() + this.player.getH()/2);\r\n\r\n player.getBullets().add(enemies.get(i).getBullets().get(j));\r\n\r\n enemies.get(i).getBullets().remove(enemies.get(i).getBullets().get(j)); //removes bullet\r\n\r\n\r\n k++;\r\n j--;\r\n //enemies.get(i).getBullets().get(j).setVisible(false);\r\n }\r\n }\r\n }\r\n }\r\n\r\n\r\n for(int i = 0; i < boss1.getBullets().size(); i++) {\r\n\r\n\r\n if (collide(player.getBullets().get(k), boss1.getBullets().get(i)) && boss1.getBullets().get(i).isVisible()) {\r\n\r\n System.out.println(\"boss bullets colliding\");\r\n player.getBullets().get(k).setVisible(false);\r\n boss1.getBullets().get(i).setColor(Color.yellow);\r\n boss1.getBullets().get(i).deflect(this.player.getX() + this.player.getW()/2, this.player.getY() + this.player.getH()/2);\r\n player.getBullets().add(boss1.getBullets().get(i));\r\n boss1.getBullets().remove(boss1.getBullets().get(i));\r\n k++;\r\n i--;\r\n\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Boss bullet and player collision\r\n\r\n for(Bullet b : boss1.getBullets() ){\r\n\r\n\r\n if(collide(player, b) && player.isVisible() && b.isVisible()){\r\n b.setVisible(false);\r\n player.setHealth(player.getHealth() - b.getDamage());\r\n }\r\n }\r\n\r\n\r\n // Power up collision\r\n\r\n for(PowerUp p : powerUps){\r\n\r\n if(collide(player, p) && p.isVisible()){\r\n\r\n p.executeEffect(this.player);\r\n p.setVisible(false);\r\n }\r\n }\r\n\r\n\r\n\r\n // Deleting out of bound bullets\r\n for(int i = 0; i < player.getBullets().size(); i++){\r\n if(player.getBullets().get(i).getY() < 0 || player.getBullets().get(i).getY() > GameWorld.SCREEN_H ||\r\n player.getBullets().get(i).getX()< 0 || player.getBullets().get(i).getX() > GameWorld.SCREEN_W) {\r\n\r\n player.getBullets().remove(player.getBullets().get(i));\r\n }\r\n }\r\n\r\n }", "public void trackBullets(){\n // bossbullet control, if it hit the bound, remove the bullet\n for(int i = 0; i < bossBullets.size(); i++){\n Bullet tempBullet = bossBullets.get(i);\n tempBullet.update();\n tempBullet.drawBullet();\n // print (tempBullet.posX, tempBullet.posY,'\\n');\n if(tempBullet.detectBound()){\n bossBullets.remove(i);\n continue;\n }\n\n if(tempBullet.hitObject(Main.player) && !Main.player.invincible){\n Main.player.decreaseHealth(1);\n Main.player.posX = width / 2;\n Main.player.posY = height * 9 / 10;\n Main.player.invincible = true;\n Main.player.invincibleTime = millis();\n }\n\n }\n }", "public void drawBullets(){\n if(!world.getPlayer().getWeapon().getBullets().isEmpty()) {\n for (Bullet b : world.getPlayer().getWeapon().getBullets()) {\n spriteBatch.draw(bulletTexture, b.getPosition().x * ppuX, b.getPosition().y * ppuY,\n b.SIZE * ppuX, b.SIZE * ppuY);\n }\n }\n if(!world.getEnemies().isEmpty()) {\n for(Enemy e: world.getEnemies()){\n if(!e.getWeapon().getBullets().isEmpty()){\n for (Bullet b : e.getWeapon().getBullets()) {\n spriteBatch.draw(bulletTexture, b.getPosition().x * ppuX, b.getPosition().y\n * ppuY, b.SIZE * ppuX, b.SIZE * ppuY, 0, 0, bulletTexture.getWidth(),\n bulletTexture.getHeight(), false, true);\n }\n }\n }\n }\n if(!world.getBullets().isEmpty()) {\n for(Bullet b : world.getBullets()){\n spriteBatch.draw(bulletTexture, b.getPosition().x * ppuX, b.getPosition().y\n * ppuY, b.SIZE * ppuX, b.SIZE * ppuY, 0, 0, bulletTexture.getWidth(),\n bulletTexture.getHeight(), false, true);\n }\n }\n }", "private void update() {\n\t\t// checks to see if the w key is down\n\t\tif (wKeyDown) {\n\t\t\tplayer.setY((int) (player.getY() - 8));\n\t\t}\n\t\t// checks to see if the a key is down\n\t\tif (aKeyDown) {\n\t\t\tplayer.setX((int) (player.getX() - 8));\n\t\t}\n\t\t// checks to see if the s key is down\n\t\tif (sKeyDown) {\n\t\t\tplayer.setY((int) (player.getY() + 8));\n\t\t}\n\t\t// checks to see if the d key is down\n\t\tif (dKeyDown) {\n\t\t\tplayer.setX((int) (player.getX() + 8));\n\t\t}\n\t\t\n\t\t// checks to make sure the player is within the bounds\n\t\tcheckBounds();\n\t\t\n\t\t// checks to see if the left mouse button is clicked\n\t\tif (mouseDown) {\n\t\t\t// if doubleshot is activated\n\t\t\tif (doubleShot && bulletDelta > doubleShotShootingSpeed) {\n\t\t\t\t// plays the bullet shooting sound\n\t\t\t\tsound.get(\"shootEffect\").playAsSoundEffect(1.0f, 0.5f, false);\n\t\t\t\t\n\t\t\t\t// adds the first bullet\n\t\t\t\tbullet.add(new Bullet(this, \"bullet\", 0, 0, 100));\n\t\t\t\tBullet lastBullet = bullet.get(bullet.size() - 1);\n\t\t\t\t\n\t\t\t\t// sets the x and y coordinates of the bullet\n\t\t\t\tlastBullet.setX(player.getX() + sprite.get(\"playerSprite\").getWidth()\n\t\t\t\t\t\t- sprite.get(\"bulletSprite\").getWidth() / 2 + BULLET_X_OFFSET);\n\t\t\t\tlastBullet.setY(player.getY() + sprite.get(\"playerSprite\").getHeight()\n\t\t\t\t\t\t- sprite.get(\"bulletSprite\").getHeight() / 2 + BULLET_Y_OFFSET);\n\t\t\t\t\n\t\t\t\t// set the angle of the shot\n\t\t\t\tdouble xChange = Mouse.getX() - lastBullet.getX();\n\t\t\t\tdouble yChange = (displayHeight - Mouse.getY()) - lastBullet.getY();\n\t\t\t\tdouble magnitude = Math.sqrt(xChange * xChange + yChange * yChange);\n\t\t\t\txChange = xChange / magnitude * 20;\n\t\t\t\tyChange = yChange / magnitude * 20;\n\t\t\t\tlastBullet.setXChange((int) xChange);\n\t\t\t\tlastBullet.setYChange((int) yChange);\n\t\t\t\t\n\t\t\t\t// adds the second bullet\n\t\t\t\tbullet.add(new Bullet(this, \"bullet\", 0, 0, 100));\n\t\t\t\tlastBullet = bullet.get(bullet.size() - 1);\n\t\t\t\t\n\t\t\t\tlastBullet.setX(player.getX() + sprite.get(\"playerSprite\").getWidth()\n\t\t\t\t\t\t- sprite.get(\"bulletSprite\").getWidth() / 2 + BULLET2_X_OFFSET);\n\t\t\t\tlastBullet.setY(player.getY() + sprite.get(\"playerSprite\").getHeight()\n\t\t\t\t\t\t- sprite.get(\"bulletSprite\").getHeight() / 2 + BULLET2_Y_OFFSET);\n\t\t\t\t\n\t\t\t\t// set the angle of the shot\n\t\t\t\tdouble doubleshotXChange = Mouse.getX() - lastBullet.getX();\n\t\t\t\tdouble doubleshotYChange = (displayHeight - Mouse.getY()) - lastBullet.getY();\n\t\t\t\tdouble doubleshotMagnitude = Math.sqrt(xChange * xChange + yChange * yChange);\n\t\t\t\tdoubleshotXChange = xChange / doubleshotMagnitude * 20;\n\t\t\t\tdoubleshotYChange = yChange / doubleshotMagnitude * 20;\n\t\t\t\tlastBullet.setXChange((int) doubleshotXChange);\n\t\t\t\tlastBullet.setYChange((int) doubleshotYChange);\n\t\t\t\t\n\t\t\t\tDelta.setLastBullet(Delta.getTime());\n\t\t\t}\n\t\t\t// if a bullet is shot and the time since the last bullet is at least shootingSpeed\n\t\t\telse if (bulletShot && bulletDelta > bulletShootingSpeed) {\n\t\t\t\t// plays the bullet shooting sound\n\t\t\t\tsound.get(\"shootEffect\").playAsSoundEffect(1.0f, 0.5f, false);\n\t\t\t\t\n\t\t\t\t// adds the bullet\n\t\t\t\tbullet.add(new Bullet(this, \"bullet\", 0, 0, 100));\n\t\t\t\tBullet lastBullet = bullet.get(bullet.size() - 1);\n\t\t\t\t\n\t\t\t\t// sets the x and y coordinates of the bullet\n\t\t\t\tlastBullet.setX(player.getX() + sprite.get(\"playerSprite\").getWidth()\n\t\t\t\t\t\t- sprite.get(\"bulletSprite\").getWidth() / 2 + BULLET_X_OFFSET);\n\t\t\t\tlastBullet.setY(player.getY() + sprite.get(\"playerSprite\").getHeight()\n\t\t\t\t\t\t- sprite.get(\"bulletSprite\").getHeight() / 2 + BULLET_Y_OFFSET);\n\t\t\t\t\n\t\t\t\t// set the angle of the shot\n\t\t\t\tdouble xChange = Mouse.getX() - lastBullet.getX();\n\t\t\t\tdouble yChange = (displayHeight - Mouse.getY()) - lastBullet.getY();\n\t\t\t\tdouble magnitude = Math.sqrt(xChange * xChange + yChange * yChange);\n\t\t\t\txChange = xChange / magnitude * 20;\n\t\t\t\tyChange = yChange / magnitude * 20;\n\t\t\t\tlastBullet.setXChange((int) xChange);\n\t\t\t\tlastBullet.setYChange((int) yChange);\n\t\t\t\t\n\t\t\t\tDelta.setLastBullet(Delta.getTime());\n\t\t\t}\n\t\t\t// if a laser is shot\n\t\t\telse if (laserShot) {\n\t\t\t\tif (Delta.getTime() % 6 == 0) {\n\t\t\t\t\t// plays the laser shooting sound\n\t\t\t\t\tsound.get(\"laserEffect\").playAsSoundEffect(1.0f, 0.5f, false);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// adds the laser\n\t\t\t\tbullet.add(new Bullet(this, \"laser\", 0, 0, 20));\n\t\t\t\tBullet lastBullet = bullet.get(bullet.size() - 1);\n\t\t\t\t\n\t\t\t\t// sets the x and y coordinates of the laser\n\t\t\t\tlastBullet.setX(player.getX() + sprite.get(\"playerSprite\").getWidth()\n\t\t\t\t\t\t- sprite.get(\"laserSprite\").getWidth() / 2 + BULLET_X_OFFSET);\n\t\t\t\tlastBullet.setY(player.getY() + sprite.get(\"playerSprite\").getHeight()\n\t\t\t\t\t\t- sprite.get(\"laserSprite\").getHeight() + BULLET_Y_OFFSET);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Checks to see if the time since the last enemy is greater than the enemy interval\n\t\tif (!bossSpawned && enemyDelta > generateEnemyInterval()) {\n\t\t\tdouble enemyGenerate = randomGenerator.nextDouble();\n\t\t\tif (enemyGenerate >= 0.3 || Delta.getDelta(\"beginning\") <= 10000)\n\t\t\t\tenemy.add(new Enemy(this, \"green_box\", 0, 0, 300, Delta.getDelta(\"beginning\"), 300));\n\t\t\telse if (enemyGenerate < 0.3)\n\t\t\t\tenemy.add(new Enemy(this, \"red_box\", 0, 0, 400, Delta.getDelta(\"beginning\"), 400));\n\t\t\tEnemy lastEnemy = enemy.get(enemy.size() - 1);\n\t\t\t\n\t\t\tlastEnemy.setX(lastEnemy.generateEnemyX());\n\t\t\tlastEnemy.setY(-lastEnemy.getSprite().getHeight());\n\t\t\tDelta.setLastEnemy(Delta.getTime());\n\t\t}\n\t\t\n\t\tif (bossExplosionNum == 0) {\n\t\t\t// Checks to see if enemy bullets should be generated\n\t\t\tfor (int i = 0; i < enemy.size(); i++) {\n\t\t\t\tif (enemy.get(i).getName().equals(\"red_box\") && enemy.get(i).getTimeSinceLastBullet() >= 700) {\n\t\t\t\t\tenemy_bullet.add(new Bullet(this, \"enemy_bullet\", 0, 0, 100));\n\t\t\t\t\tenemy.get(i).setLastBulletTime(Delta.getDelta(\"beginning\"));\n\t\t\t\t\t\n\t\t\t\t\tBullet lastEnemyBullet = enemy_bullet.get(enemy_bullet.size() - 1);\n\t\t\t\t\tSprite enemySprite = enemy.get(i).getSprite();\n\t\t\t\t\tSprite enemyBulletSprite = lastEnemyBullet.getSprite();\n\t\t\t\t\t\n\t\t\t\t\tlastEnemyBullet.setX(enemy.get(i).getX() + enemySprite.getWidth() / 2\n\t\t\t\t\t\t\t- enemyBulletSprite.getWidth() / 2);\n\t\t\t\t\tlastEnemyBullet.setY(enemy.get(i).getY() + enemySprite.getHeight() / 2\n\t\t\t\t\t\t\t- enemyBulletSprite.getHeight() / 2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (enemy.get(i).getName().equals(\"boss\") && enemy.get(i).getTimeSinceLastBullet() >= 1000) {\n\t\t\t\t\tenemy_bullet.add(new Bullet(this, \"boss_bullet\", 0, 0, 100));\n\t\t\t\t\tenemy.get(i).setLastBulletTime(Delta.getDelta(\"beginning\"));\n\t\t\t\t\t\n\t\t\t\t\tBullet lastEnemyBullet = enemy_bullet.get(enemy_bullet.size() - 1);\n\t\t\t\t\tSprite enemySprite = enemy.get(i).getSprite();\n\t\t\t\t\tSprite enemyBulletSprite = lastEnemyBullet.getSprite();\n\t\t\t\t\t\n\t\t\t\t\tlastEnemyBullet.setX(enemy.get(i).getX() + enemySprite.getWidth() / 2\n\t\t\t\t\t\t\t- enemyBulletSprite.getWidth() / 2);\n\t\t\t\t\tlastEnemyBullet.setY(enemy.get(i).getY() + enemySprite.getHeight() / 2\n\t\t\t\t\t\t\t- enemyBulletSprite.getHeight() / 2);\n\t\t\t\t\t\n\t\t\t\t\t// set the angle of the shot\n\t\t\t\t\tdouble xChange = player.getX() - lastEnemyBullet.getX();\n\t\t\t\t\tdouble yChange = player.getY() - lastEnemyBullet.getY();\n\t\t\t\t\tdouble magnitude = Math.sqrt(xChange * xChange + yChange * yChange);\n\t\t\t\t\txChange = xChange / magnitude * 15;\n\t\t\t\t\tyChange = yChange / magnitude * 15;\n\t\t\t\t\tlastEnemyBullet.setXChange((int) xChange);\n\t\t\t\t\tlastEnemyBullet.setYChange((int) yChange);\n\t\t\t\t\t\n\t\t\t\t\tenemy_bullet.add(new Bullet(this, \"boss_bullet\", 0, 0, 100));\n\t\t\t\t\tenemy.get(i).setLastBulletTime(Delta.getDelta(\"beginning\"));\n\t\t\t\t\t\n\t\t\t\t\tlastEnemyBullet = enemy_bullet.get(enemy_bullet.size() - 1);\n\t\t\t\t\tenemySprite = enemy.get(i).getSprite();\n\t\t\t\t\tenemyBulletSprite = lastEnemyBullet.getSprite();\n\t\t\t\t\t\n\t\t\t\t\tlastEnemyBullet.setX(enemy.get(i).getX() + enemySprite.getWidth() / 2\n\t\t\t\t\t\t\t- enemyBulletSprite.getWidth() / 2);\n\t\t\t\t\tlastEnemyBullet.setY(enemy.get(i).getY() + enemySprite.getHeight() / 2\n\t\t\t\t\t\t\t- enemyBulletSprite.getHeight() / 2);\n\t\t\t\t\t\n\t\t\t\t\t// set the angle of the shot\n\t\t\t\t\txChange = player.getX() - lastEnemyBullet.getX() - 100;\n\t\t\t\t\tyChange = player.getY() - lastEnemyBullet.getY() - 100;\n\t\t\t\t\tmagnitude = Math.sqrt(xChange * xChange + yChange * yChange);\n\t\t\t\t\txChange = xChange / magnitude * 15;\n\t\t\t\t\tyChange = yChange / magnitude * 15;\n\t\t\t\t\tlastEnemyBullet.setXChange((int) xChange);\n\t\t\t\t\tlastEnemyBullet.setYChange((int) yChange);\n\t\t\t\t\t\n\t\t\t\t\tenemy_bullet.add(new Bullet(this, \"boss_bullet\", 0, 0, 100));\n\t\t\t\t\tenemy.get(i).setLastBulletTime(Delta.getDelta(\"beginning\"));\n\t\t\t\t\t\n\t\t\t\t\tlastEnemyBullet = enemy_bullet.get(enemy_bullet.size() - 1);\n\t\t\t\t\tenemySprite = enemy.get(i).getSprite();\n\t\t\t\t\tenemyBulletSprite = lastEnemyBullet.getSprite();\n\t\t\t\t\t\n\t\t\t\t\tlastEnemyBullet.setX(enemy.get(i).getX() + enemySprite.getWidth() / 2\n\t\t\t\t\t\t\t- enemyBulletSprite.getWidth() / 2);\n\t\t\t\t\tlastEnemyBullet.setY(enemy.get(i).getY() + enemySprite.getHeight() / 2\n\t\t\t\t\t\t\t- enemyBulletSprite.getHeight() / 2);\n\t\t\t\t\t\n\t\t\t\t\t// set the angle of the shot\n\t\t\t\t\txChange = player.getX() - lastEnemyBullet.getX() + 100;\n\t\t\t\t\tyChange = player.getY() - lastEnemyBullet.getY() + 100;\n\t\t\t\t\tmagnitude = Math.sqrt(xChange * xChange + yChange * yChange);\n\t\t\t\t\txChange = xChange / magnitude * 15;\n\t\t\t\t\tyChange = yChange / magnitude * 15;\n\t\t\t\t\tlastEnemyBullet.setXChange((int) xChange);\n\t\t\t\t\tlastEnemyBullet.setYChange((int) yChange);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// spawns the boss if 60 seconds has passed\n\t\tif (Delta.getDelta(\"beginning\") >= 60000 && !bossSpawned) {\n\t\t\tbossSpawned = true;\n\t\t\tenemy.add(new Enemy(this, \"boss\", 0, 0, 10000, Delta.getDelta(\"beginning\"), 500));\n\t\t\t\n\t\t\tEnemy boss = enemy.get(enemy.size() - 1);\n\t\t\tboss.setX(displayWidth / 2 - boss.getSprite().getWidth() / 2);\n\t\t\tboss.setY(-boss.getSprite().getHeight());\n\t\t}\n\t\t\n\t\t// checks for collisions\n\t\tif (bossExplosionNum == 0) {\n\t\t\tfor (int i = 0; i < enemy.size(); i++) {\n\t\t\t\tEntity entity1 = enemy.get(i);\n\t\t\t\t\n\t\t\t\t// if a bullet collides with an enemy\n\t\t\t\tfor (int j = 0; j < bullet.size(); j++) {\n\t\t\t\t\tEntity entity2 = bullet.get(j);\n\t\t\t\t\t\n\t\t\t\t\tif (entity1.collidesWith(entity2)) {\n\t\t\t\t\t\tentity1.collidedWith(entity2);\n\t\t\t\t\t\tentity2.collidedWith(entity1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tEntity entity2 = player;\n\t\t\t\t\n\t\t\t\t// if the player collides with an enemy\n\t\t\t\tif (entity1.collidesWith(entity2)) {\n\t\t\t\t\tentity1.collidedWith(entity2);\n\t\t\t\t\tentity2.collidedWith(entity1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tEntity entity1 = player;\n\t\t\t// if an enemy bullet collides with the player\n\t\t\tfor (int i = 0; i < enemy_bullet.size(); i++) {\n\t\t\t\tEntity entity2 = enemy_bullet.get(i);\n\t\t\t\t\n\t\t\t\tif (entity1.collidesWith(entity2)) {\n\t\t\t\t\tentity1.collidedWith(entity2);\n\t\t\t\t\tentity2.collidedWith(entity1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// if a powerup collides with the player\n\t\t\tfor (int i = 0; i < powerup.size(); i++) {\n\t\t\t\tEntity entity2 = powerup.get(i);\n\t\t\t\t\n\t\t\t\tif (entity1.collidesWith(entity2)) {\n\t\t\t\t\tentity1.collidedWith(entity2);\n\t\t\t\t\tentity2.collidedWith(entity1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// if the player has defeated the boss\n\t\tif (gameWon && bossSpawned) {\n\t\t\t// draw Congratulations\n\t\t\tString congrats = \"Congratulations! You were able to vanquish\";\n\t\t\tString congrats2 = \"all of your evil thoughts and achieve nirvana!\";\n\t\t\tcongratsFont.drawString(displayWidth / 2 - congratsFont.getWidth(congrats) / 2, displayHeight / 2\n\t\t\t\t\t- congratsFont.getHeight(congrats) / 2 - 50, congrats);\n\t\t\tcongratsFont.drawString(displayWidth / 2 - congratsFont.getWidth(congrats2) / 2, displayHeight\n\t\t\t\t\t/ 2 - congratsFont.getHeight(congrats2) / 2 - 15, congrats2);\n\t\t\t\n\t\t\t// draw the score\n\t\t\tscoreFont.drawString(displayWidth / 2 - scoreFont.getWidth(\"Score: \" + totalCash) / 2, displayHeight\n\t\t\t\t\t/ 2\n\t\t\t\t\t+ scoreFont.getHeight(\"Game Over!\")\n\t\t\t\t\t/ 2\n\t\t\t\t\t+ scoreFont.getHeight(\"Score: \" + totalCash)\n\t\t\t\t\t/ 2 + 10 - 50, \"Score: \" + totalCash);\n\t\t}\n\t}", "private void update(){\n boolean bumped = false;\n\n // Has the player lost\n boolean lost = false;\n\n // Move the player's ship\n defender.update(fps);\n\n // Update the invaders if visible\n for(int i = 0; i < numInvaders; i++){\n\n if(invaders[i].getVisibility()) {\n // Move the next invader\n invaders[i].update(fps);\n\n // Does he want to take a shot?\n if(invaders[i].takeAim(defender.getX(),\n defender.getLength())){\n\n // If so try and spawn a bullet\n if(invadersBullets[nextBullet].shoot(invaders[i].getX() + invaders[i].getLength() / 2, invaders[i].getY(), bullet.DOWN)) {\n soundPool.play(invaderShootID, 1, 1, 0, 0, 1);\n\n // Shot fired\n // Prepare for the next shot\n nextBullet++;\n\n // Loop back to the first one if we have reached the last\n if (nextBullet == maxInvaderBullets) {\n // This stops the firing of another bullet until one completes its journey\n // Because if bullet 0 is still active shoot returns false.\n nextBullet = 0;\n }\n }\n }\n // If that move caused them to bump the screen change bumped to true\n if (invaders[i].getX() > screenX - ExcessX - invaders[i].getLength()\n || invaders[i].getX() < ExcessX){\n\n bumped = true;\n }\n }\n }\n\n // Update all the invaders bullets if active\n for(int i = 0; i < invadersBullets.length; i++){\n if(invadersBullets[i].getStatus()) {\n invadersBullets[i].update(fps);\n }\n }\n\n // Did an invader bump into the edge of the screen\n if(bumped){\n\n // Move all the invaders down and change direction\n for(int i = 0; i < numInvaders; i++){\n invaders[i].dropDownAndReverse();\n // Have the invaders landed\n if(invaders[i].getY() > screenY - screenY / 10){\n lost = true;\n }\n }\n\n // Increase the menace level\n // By making the sounds more frequent\n menaceInterval = menaceInterval - 80;\n }\n\n if(lost){\n prepareLevel();\n }\n\n // Update the players bullet\n if(bullet.getStatus()){\n bullet.update(fps);\n }\n\n // Has the player's bullet hit the top of the screen\n if(bullet.getImpactPointY() < 0){\n bullet.setInactive();\n }\n\n // Has an invaders bullet hit the bottom of the screen\n for(int i = 0; i < invadersBullets.length; i++){\n if(invadersBullets[i].getImpactPointY() > screenY){\n invadersBullets[i].setInactive();\n }\n }\n\n // Has the player's bullet hit an invader\n if(bullet.getStatus()) {\n for (int i = 0; i < numInvaders; i++) {\n if (invaders[i].getVisibility()) {\n if (RectF.intersects(bullet.getRect(), invaders[i].getRect())) {\n invaders[i].setInvisible();\n explosionAnimation = true;\n explosionX = invaders[i].getX() - invaders[i].getLength()/2;\n explosionY = invaders[i].getY() - invaders[i].getHeight()/2;\n soundPool.play(invaderExplodeID, 1, 1, 0, 0, 1);\n bullet.setInactive();\n score = (10 * level) * multiplier;\n totalScore = totalScore + score;\n cash = cash + 10;\n invadersLeft = invadersLeft - 1;\n\n // Has the player won\n if(invadersLeft == 0){\n shields = shields + 1;\n cash = cash + (10 * multiplier);\n totalScore = totalScore + ((100 * level) * multiplier);\n level = level + 1;\n noHitStreak = noHitStreak + 1;\n if (noHitStreak > 0) {\n multiplier = noHitStreak * 2;\n if (multiplier > 16) {\n multiplier = 16;\n }\n } else {\n multiplier = 1;\n }\n noHitStreak = noHitStreak + 1;\n openUpgradesMenu = true;\n prepareLevel();\n }\n }\n }\n }\n }\n\n // Has an invader bullet hit the player ship\n for(int i = 0; i < invadersBullets.length; i++){\n if(invadersBullets[i].getStatus()){\n if(RectF.intersects(defender.getRect(), invadersBullets[i].getRect())){\n invadersBullets[i].setInactive();\n damageAnimation = true;\n if (shields == 0) {\n alive = false;\n } else if (shields == 1) {\n soundPool.play(severeDamageID, 1, 1, 0, 0, 1);\n shields = shields - 1;\n } else {\n shields = shields - 1;\n }\n soundPool.play(shieldImpactID, 1, 1, 0, 0, 1);\n noHitStreak = 0;\n multiplier = 1;\n\n // Is it game over?\n if(!alive){\n soundPool.play(playerExplodeID, 1, 1, 0, 0, 1);\n wavesSurvived = level-1;\n finalScore = totalScore;\n shields = 3;\n alive = true;\n cash = 0;\n multiplier = 1;\n totalScore = 0;\n level = 1;\n invadersColumn = 5 ;\n invadersRow = 3;\n openGameOverMenu = true;\n prepareLevel();\n }\n }\n }\n }\n }", "public void update(float delta) {\n rangeTimer++;//update bullet distance\n //delete bullet if hit collison or met ranged\n if (rangeTimer == RANGE) {\n bullet.setShoot(false);\n rangeTimer = 0;\n } else {\n //update bullet timings\n bullet.updateTimer(delta);\n //make bullet go to p x y - follows player to increase difficulty\n if (this.bullet.x < playerX + 1.5) {\n this.bullet.x += Gdx.graphics.getDeltaTime() * Bullet.SPEED;\n }\n if (this.bullet.x >playerX + 1.5) {\n this.bullet.x -= Gdx.graphics.getDeltaTime() * Bullet.SPEED;\n }\n if (this.bullet.y < playerY + 0.5) {\n this.bullet.y += Gdx.graphics.getDeltaTime() * Bullet.SPEED;\n }\n if (this.bullet.y > playerY + 1.5) {\n this.bullet.y -= Gdx.graphics.getDeltaTime() * Bullet.SPEED;\n }\n }\n }", "public void update() {\n if (player.getPlaying()) { //if player alive\n bg.update(); //update background\n player.update(); //update player\n //player collision detection, if player hits any baddies or their bullets is playing sets to false\n for (int i = 0; i < gargants.size(); i++) {\n if (collision(gargants.get(i), player)) {\n //gargants.remove(i);\n player.setPlaying(false);\n\n }\n for (int j = 0; j < demons.size(); j++) {\n if (collision(demons.get(j), player)) {\n //demons.remove(j);\n player.setPlaying(false);\n\n }\n for (int k = 0; k < dragons.size(); k++) {\n if (collision(dragons.get(k), player)) {\n //dragons.remove(k);\n player.setPlaying(false);\n\n }\n for (int l = 0; l < demonShots.size(); l++) {\n if (collision(demonShots.get(l), player)) {\n //demonShots.remove(l);\n player.setPlaying(false);\n\n }\n\n }\n }\n }\n }\n\n for (int i = 0; i < bullets.size(); i++) { //for each bullet\n bullets.get(i).update(); //update them\n if (bullets.get(i).getX() > WIDTH + 10) {\n bullets.remove(i); //if off screen delete\n }\n }\n\n for (int i = 0; i < demonShots.size(); i++) { // for each demon bullet\n demonShots.get(i).update(); //update them\n if (demonShots.get(i).getX() < -100) {\n demonShots.remove(i); //if off screen delete\n }\n }\n\n long gargantElapseTime = (System.nanoTime() - gargantStartTime) / 1000000;\n if (gargantElapseTime > (1200 - player.getScore() / 3)) { //as score increases, more will spawn\n gargants.add(new Gargant(BitmapFactory.decodeResource(getResources(), R.drawable.gargant), WIDTH + 10, (int) (rand.nextDouble() * (HEIGHT)), 64, 64, 8));\n if (gargants.size() >= 13) { //limit amount of this enemy to 13\n gargants.remove(gargants.size() - 1);\n }\n gargantStartTime = System.nanoTime();\n }\n for (int i = 0; i < gargants.size(); i++) { // for each gargant\n gargants.get(i).update(); //update them\n for (int j = 0; j < bullets.size(); j++) {\n if (collision(gargants.get(i), bullets.get(j))) {\n //when shot remove enemy and bullet\n gargants.remove(i);\n bullets.remove(j);\n player.addScore(10); //10 score for these guys\n break;\n }\n }\n if (gargants.get(i).getX() < -100) {\n gargants.remove(i); //if off screen remove\n }\n }\n\n if (level >= 3) { //only spawn demon above level 3\n long demonElapseTime = (System.nanoTime() - demonStartTime) / 1000000;\n if (demonElapseTime > (12000 - player.getScore() / 3)) { //as score increases, more will spawn\n demons.add(new Demon(BitmapFactory.decodeResource(getResources(), R.drawable.demon), WIDTH + 10, (int) (rand.nextDouble() * (HEIGHT)), 64, 64, 8));\n if (demons.size() >= 10) { //limit amount of this enemy to 10\n demons.remove(demons.size() - 1);\n }\n demonStartTime = System.nanoTime();\n }\n for (int i = 0; i < demons.size(); i++) { //for each demon\n demons.get(i).update(); //update them\n int n = rand.nextInt(1001); //random int between 1 and 1000\n if (n > 980) { //if random int > 980 shoot demon bullet\n demonShots.add(new HellFire(BitmapFactory.decodeResource(getResources(), R.drawable.hellfire_0), demons.get(i).getX(), demons.get(i).getY(), 64, 64));\n }\n for (int j = 0; j < bullets.size(); j++) {\n if (collision(demons.get(i), bullets.get(j))) {\n demonHitCount++; //each hit with bullet increases hitcount\n bullets.remove(j);\n if (demonHitCount >= 10) { //when hit more than 10 times it dies\n demonHitCount = 0;\n demons.remove(i);\n bullets.remove(j);\n player.addScore(100); //100 score for these big bois\n }\n }\n }\n if (demons.get(i).getX() < -100) {\n demons.remove(i); //if off screen delete\n }\n }\n }\n\n\n if (level >= 2) { //only spawn dragon above level 3\n long dragonElapseTime = (System.nanoTime() - dragonStartTime) / 1000000;\n if (dragonElapseTime > (6000 - player.getScore() / 3)) { //as score increases, more will spawn\n dragons.add(new Dragon(BitmapFactory.decodeResource(getResources(), R.drawable.dragon), WIDTH + 10, (int) (rand.nextDouble() * (HEIGHT)), 128, 128, 8));\n if (dragons.size() >= 5) { //dragons limitted to only 5\n dragons.remove(dragons.size() - 1);\n }\n dragonStartTime = System.nanoTime();\n }\n for (int i = 0; i < dragons.size(); i++) {\n dragons.get(i).update();\n for (int j = 0; j < bullets.size(); j++) {\n if (collision(dragons.get(i), bullets.get(j))) {\n dragonHitCount++; //if hit increase hitcount\n bullets.remove(j);\n if (dragonHitCount >= 4) { //when hit 4 times it dies\n dragonHitCount = 0;\n dragons.remove(i);\n bullets.remove(j);\n player.addScore(25); //25 score for dragons\n }\n break;\n }\n }\n if (dragons.get(i).getX() < -100) {\n dragons.remove(i); //when off screen remove\n }\n }\n }\n }\n }", "private void clearBullet()\n {\n if(playerBullets.size() > 0)\n {\n for(int i = 0; i < playerBullets.size(); ++i)\n {\n int x = playerBullets.get(i).getRectangle().centerX(), y = playerBullets.get(i).getRectangle().centerY();\n if (y <= 0 || y >= Constants.SCREEN_HEIGHT || x <= 0 || x >= Constants.SCREEN_WIDTH)\n {\n playerBullets.remove(i);\n --i;\n SFX_Manager.impact();\n }\n }\n }\n if(enemyBullets.size() > 0)\n {\n for(int i = 0; i < enemyBullets.size(); ++i)\n {\n int x = enemyBullets.get(i).getRectangle().centerX(), y = enemyBullets.get(i).getRectangle().centerY();\n if (y <= 0 || y >= Constants.SCREEN_HEIGHT || x <= 0 || x >= Constants.SCREEN_WIDTH)\n {\n enemyBullets.remove(i);\n --i;\n SFX_Manager.impact();\n }\n }\n }\n }", "public void setBulletsFired(ArrayList<Bullet> bullets) {\n if(!bulletsFired.isEmpty()) {\n //System.out.println(bullets.get(0).getxPos() != bulletsFired.get(0).getxPos());\n this.bulletsFired = bullets;\n }\n }", "@Override\n public void update(float dt) {\n //bulletUpdate(dt,b2body);\n stateTime += dt;\n bulletUpdate(b2body,bulletSprite1);\n bulletUpdate(b2body2,bulletSprite2);\n bulletUpdate(b2body3,bulletSprite3);\n\n\n\n }", "public void shoot() {\n\n //DOWN\n if (moveDown && shootDown) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), (5 + this.getySpeed()) * this.getBulletSpeedMulti());\n\n } else if (moveDown && shootUp) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), (-5 + this.getySpeed() / 2) * this.getBulletSpeedMulti());\n } else if (moveDown && shootLeft) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), -5 * this.getBulletSpeedMulti(), (this.getySpeed()) * this.getBulletSpeedMulti());\n } else if (moveDown && shootRight) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 5 * this.getBulletSpeedMulti(), (this.getySpeed()) * this.getBulletSpeedMulti());\n }\n\n //UP\n else if (moveUp && shootDown) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), (5 + this.getySpeed() / 2) * this.getBulletSpeedMulti());\n\n } else if (moveUp && shootUp) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), (-5 + this.getySpeed()) * this.getBulletSpeedMulti());\n\n } else if (moveUp && shootLeft) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), -5 * this.getBulletSpeedMulti(), (this.getySpeed()) * this.getBulletSpeedMulti());\n } else if (moveUp && shootRight) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 5 * this.getBulletSpeedMulti(), (this.getySpeed()) * this.getBulletSpeedMulti());\n }\n\n //LEFT \n else if (moveLeft && shootDown) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (this.getxSpeed()) * this.getBulletSpeedMulti(), (5) * this.getBulletSpeedMulti());\n } else if (moveLeft && shootUp) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (this.getxSpeed()) * this.getBulletSpeedMulti(), (-5) * this.getBulletSpeedMulti());\n } else if (moveLeft && shootLeft) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (-5 + this.getxSpeed()) * this.getBulletSpeedMulti(), (0) * this.getBulletSpeedMulti());\n } else if (moveLeft && shootRight) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (5 + this.getxSpeed() / 2) * this.getBulletSpeedMulti(), (0) * this.getBulletSpeedMulti());\n }\n\n //RIGHT\n else if (moveRight && shootDown) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (this.getxSpeed()) * this.getBulletSpeedMulti(), (5) * this.getBulletSpeedMulti());\n } else if (moveRight && shootUp) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (this.getxSpeed()) * this.getBulletSpeedMulti(), (-5) * this.getBulletSpeedMulti());\n } else if (moveRight && shootLeft) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (-5 + this.getxSpeed() / 2) * this.getBulletSpeedMulti(), (0) * this.getBulletSpeedMulti());\n } else if (moveRight && shootRight) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (5 + this.getxSpeed()) * this.getBulletSpeedMulti(), (0) * this.getBulletSpeedMulti());\n } //STANDING STILL\n \n \n if (shootDown && !moving) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), 5 * this.getBulletSpeedMulti());\n } else if (shootUp && !moving) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), -5 * this.getBulletSpeedMulti());\n\n } else if (shootLeft && !moving) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), -5 * this.getBulletSpeedMulti(), 0 * this.getBulletSpeedMulti());\n\n } else if (shootRight && !moving) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 5 * this.getBulletSpeedMulti(), 0 * this.getBulletSpeedMulti());\n\n }\n }", "private void checkBulletWallCollision() {\n\t\tArrayList<Missile> heroMissiles = hero.getMissiles();\n\t\tArrayList<Missile> hero2Missile = computer.getMissiles();\n\n\t\tdouble x1Wall, y1Wall, x2Wall, y2Wall, x1Bullet, y1Bullet, x2Bullet, y2Bullet;\n\t\tboolean left, right, top, bottom;\n\n\t\t// tank 1 bullets and wall collision\n\t\tfor (int i = 0; i < heroMissiles.size(); i++) {\n\t\t\tMissile m1 = heroMissiles.get(i);\n\t\t\tif (m1 == null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tRectangle r2b = m1.getBounds();\n\t\t\tfor (int j = 0; j < wallArray.size(); j++) {\n\t\t\t\tWall w1 = wallArray.get(j);\n\t\t\t\tRectangle r2w = w1.getBounds();\n\n\t\t\t\tx1Wall = r2w.getMinX();\n\t\t\t\ty1Wall = r2w.getMinY();\n\t\t\t\tx2Wall = r2w.getMaxX();\n\t\t\t\ty2Wall = r2w.getMaxY();\n\n\t\t\t\tx1Bullet = r2b.getMinX();\n\t\t\t\ty1Bullet = r2b.getMinY();\n\t\t\t\tx2Bullet = r2b.getMaxX();\n\t\t\t\ty2Bullet = r2b.getMaxY();\n\n\t\t\t\tleft = (x2Bullet < x1Wall);\n\t\t\t\tright = (x2Wall < x1Bullet);\n\t\t\t\ttop = (y2Bullet < y1Wall);\n\t\t\t\tbottom = (y2Wall < y1Bullet);\n\n\t\t\t\tif ((left && !right && top && !bottom) || (!left && right && top && !bottom)\n\t\t\t\t\t\t|| (left && !right && !top && bottom) || (!left && right && !top && bottom)) {\n\t\t\t\t} else if (left && !right && !top && !bottom) {\n\t\t\t\t\tdouble leftDist = x1Wall - x2Bullet;\n\t\t\t\t\tif (leftDist < 2) {\n\t\t\t\t\t\tm1.setAngle(180 - (m1.getAngle()));\n\t\t\t\t\t\tm1.setReflected(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else if (!left && right && !top && !bottom) {\n\t\t\t\t\tdouble rightDist = x1Bullet - x2Wall;\n\t\t\t\t\tif (rightDist < 2) {\n\t\t\t\t\t\tm1.setAngle(180 - (m1.getAngle()));\n\t\t\t\t\t\tm1.setReflected(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else if (!left && !right && top && !bottom) {\n\t\t\t\t\tdouble topDist = y1Wall - y2Bullet;\n\t\t\t\t\tif (topDist < 2) {\n\t\t\t\t\t\tm1.setAngle(-(m1.getAngle()));\n\t\t\t\t\t\tm1.setReflected(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else if (!left && !right && !top && bottom) {\n\t\t\t\t\tdouble bottomDist = y1Bullet - y2Wall;\n\t\t\t\t\tif (bottomDist < 2) {\n\t\t\t\t\t\tm1.setAngle(-(m1.getAngle()));\n\t\t\t\t\t\tm1.setReflected(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}\n\n\t\t// tank 2 bullets and wall collision\n\t\tfor (int i = 0; i < hero2Missile.size(); i++) {\n\t\t\tMissile m1 = hero2Missile.get(i);\n\t\t\tif (m1 == null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tRectangle r2b = m1.getBounds();\n\t\t\tfor (int j = 0; j < wallArray.size(); j++) {\n\t\t\t\tWall w1 = wallArray.get(j);\n\t\t\t\tRectangle r2w = w1.getBounds();\n\n\t\t\t\tx1Wall = r2w.getMinX();\n\t\t\t\ty1Wall = r2w.getMinY();\n\t\t\t\tx2Wall = r2w.getMaxX();\n\t\t\t\ty2Wall = r2w.getMaxY();\n\n\t\t\t\tx1Bullet = r2b.getMinX();\n\t\t\t\ty1Bullet = r2b.getMinY();\n\t\t\t\tx2Bullet = r2b.getMaxX();\n\t\t\t\ty2Bullet = r2b.getMaxY();\n\n\t\t\t\tleft = (x2Bullet < x1Wall);\n\t\t\t\tright = (x2Wall < x1Bullet);\n\t\t\t\ttop = (y2Bullet < y1Wall);\n\t\t\t\tbottom = (y2Wall < y1Bullet);\n\n\t\t\t\tif ((left && !right && top && !bottom) || (!left && right && top && !bottom)\n\t\t\t\t\t\t|| (left && !right && !top && bottom) || (!left && right && !top && bottom)) {\n\t\t\t\t} else if (left && !right && !top && !bottom) {\n\t\t\t\t\tdouble leftDist = x1Wall - x2Bullet;\n\t\t\t\t\tif (leftDist < 2) {\n\t\t\t\t\t\tm1.setAngle(180 - (m1.getAngle()));\n\t\t\t\t\t\tm1.setReflected(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else if (!left && right && !top && !bottom) {\n\t\t\t\t\tdouble rightDist = x1Bullet - x2Wall;\n\t\t\t\t\tif (rightDist < 2) {\n\t\t\t\t\t\tm1.setAngle(180 - (m1.getAngle()));\n\t\t\t\t\t\tm1.setReflected(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else if (!left && !right && top && !bottom) {\n\t\t\t\t\tdouble topDist = y1Wall - y2Bullet;\n\t\t\t\t\tif (topDist < 2) {\n\t\t\t\t\t\tm1.setAngle(-(m1.getAngle()));\n\t\t\t\t\t\tm1.setReflected(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else if (!left && !right && !top && bottom) {\n\t\t\t\t\tdouble bottomDist = y1Bullet - y2Wall;\n\t\t\t\t\tif (bottomDist < 2) {\n\t\t\t\t\t\tm1.setAngle(-(m1.getAngle()));\n\t\t\t\t\t\tm1.setReflected(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}\n\t}", "public void shoot(){\n int bulletPosX = posX;\n int bulletPosY = posY;\n int bulletVelX = 0;\n int bulletVelY = -9;\n //add the new bullets to the array of bullets\n bullets.add(new Bullet(bulletPosX,bulletPosY,bulletVelX,bulletVelY,0,attack));\n }", "@Override\n public void update(GameContainer gc, StateBasedGame stateBasedGame, int delta) throws SlickException {\n timeSinceStart += delta;\n rtimeSinceStart += delta;\n Input input = gc.getInput();\n int mouseX = input.getMouseX();\n int mouseY = input.getMouseY();\n\n\n basicbulletSheet.rotate(90f);\n basicbulletSheet.setCenterOfRotation(16, 16);\n\n // Move this bullet\n for (int i = 0; i < bulletList.size(); i++) {\n bullet = bulletList.get(i);\n bullet.move();\n }\n\n //Add this tower to the this towerList\n if (Tower.isBasicPlaced()) {\n basicTowers.add(new BasicTower());\n System.out.println(basicTowers);\n Tower.setBasicPlaced(false);\n }\n\n //Add this tower to the this towerList\n if (Tower.isBomberPlaced()) {\n bomberTowers.add(new BomberTower());\n System.out.println(bomberTowers);\n Tower.setBomberPlaced(false);\n }\n\n //Add this tower to the this towerList\n if (Tower.isSniperPlaced()) {\n sniperTowers.add(new SniperTower());\n System.out.println(sniperTowers);\n Tower.setSniperPlaced(false);\n }\n\n //Add this tower to the this towerList\n if (Tower.isQuickPlaced()) {\n quickTowers.add(new QuickTower());\n System.out.println(quickTowers);\n Tower.setQuickPlaced(false);\n }\n\n //For this tower, calculate how often this tower will shoot bullets\n for (BasicTower basicTower1 : basicTowers) {\n for (Enemy enemy : enemies) {\n enemy.Playrect = new Circle(enemy.getStartPosX() * w + r,\n enemy.getStartPosY() * w + r, 10);\n if (rtimeSinceStart > basicTower1.rcoolDown + basicTower1.rlastShot) {\n if (enemy.Playrect.intersects(basicTower1.Radius)) {\n basicTower1.basicClicked.setRotation((float) getTargetAngle(basicTower1.towerX,\n basicTower1.towerY, enemy.getStartPosX(), enemy.getStartPosY()));\n basicTower1.basicClicked.setCenterOfRotation(32, 32);\n basicTower1.rlastShot = rtimeSinceStart;\n }\n }\n if (timeSinceStart > basicTower1.coolDown + basicTower1.lastShot) {\n if (enemy.Playrect.intersects(basicTower1.Radius)) {\n addNewBullet2(basicTower1.towerX, basicTower1.towerY, enemy.getStartPosX(),\n enemy.getStartPosY(), 10);\n basicTower1.lastShot = timeSinceStart;\n }\n\n }\n }\n }\n\n //For this tower, calculate how often this tower will shoot bullets\n for (BomberTower bomberTower1 : bomberTowers) {\n for (Enemy enemy : enemies) {\n enemy.Playrect = new Circle(enemy.getStartPosX() * w + r,\n enemy.getStartPosY() * w + r, 10);\n if (rtimeSinceStart > bomberTower1.rcoolDown + bomberTower1.rlastShot) {\n if (enemy.Playrect.intersects(bomberTower1.Radius)) {\n bomberTower1.bomberClicked.setRotation((float) getTargetAngle(bomberTower1.bombertowerX,\n bomberTower1.bombertowerY, enemy.getStartPosX(), enemy.getStartPosY()));\n bomberTower1.bomberClicked.setCenterOfRotation(32, 32);\n bomberTower1.rlastShot = rtimeSinceStart;\n }\n }\n if (timeSinceStart > bomberTower1.coolDown + bomberTower1.lastShot) {\n if (enemy.Playrect.intersects(bomberTower1.Radius)) {\n addNewBullet2(bomberTower1.bombertowerX, bomberTower1.bombertowerY, enemy.getStartPosX(),\n enemy.getStartPosY(), 10);\n bomberTower1.lastShot = timeSinceStart;\n }\n }\n }\n }\n //For this tower, calculate how often this tower will shoot bullets\n for (SniperTower sniperTower1 : sniperTowers) {\n for (Enemy enemy : enemies) {\n enemy.Playrect = new Circle(enemy.getStartPosX() * w + r,\n enemy.getStartPosY() * w + r, 10);\n\n if (rtimeSinceStart > sniperTower1.rcoolDown + sniperTower1.rlastShot) {\n if (enemy.Playrect.intersects(sniperTower1.Radius)) {\n sniperTower1.sniperClicked.setRotation((float) getTargetAngle(sniperTower1.towerX,\n sniperTower1.towerY, enemy.getStartPosX(), enemy.getStartPosY()));\n sniperTower1.sniperClicked.setCenterOfRotation(32, 32);\n sniperTower1.rlastShot = rtimeSinceStart;\n }\n }\n\n if (timeSinceStart > sniperTower1.coolDown + sniperTower1.lastShot) {\n if (enemy.Playrect.intersects(sniperTower1.Radius)) {\n addNewBullet2(sniperTower1.towerX, sniperTower1.towerY, enemy.getStartPosX(),\n enemy.getStartPosY(), 50);\n sniperTower1.lastShot = timeSinceStart;\n }\n\n }\n }\n }\n //For this tower, calculate how often this tower will shoot bullets\n for (QuickTower quickTower1 : quickTowers) {\n for (Enemy enemy : enemies) {\n enemy.Playrect = new Circle(enemy.getStartPosX() * w + r,\n enemy.getStartPosY() * w + r, 10);\n\n if (rtimeSinceStart > quickTower1.rcoolDown + quickTower1.rlastShot) {\n if (enemy.Playrect.intersects(quickTower1.Radius)) {\n quickTower1.quickClicked.setRotation((float) getTargetAngle(quickTower1.towerX,\n quickTower1.towerY, enemy.getStartPosX(), enemy.getStartPosY()));\n quickTower1.quickClicked.setCenterOfRotation(32, 32);\n quickTower1.rlastShot = rtimeSinceStart;\n }\n }\n\n\n if (timeSinceStart > quickTower1.coolDown + quickTower1.lastShot) {\n if (enemy.Playrect.intersects(quickTower1.Radius)) {\n radiusVisited = true;\n addNewBullet2(quickTower1.towerX, quickTower1.towerY, enemy.getStartPosX(),\n enemy.getStartPosY(), 5);\n quickTower1.lastShot = timeSinceStart;\n }\n }\n\n }\n }\n\n //A spawn is in progress\n if (spawninProgress) {\n timePassedEnemy += delta;\n if (timePassedEnemy > 800) {\n enemies.add(new Enemy());\n enemySpawns++;\n timePassedEnemy = 0;\n }\n }\n //When enough enemies has spawned, stop the spawninProgress\n if (enemySpawns == enemyCounter) {\n spawninProgress = false;\n //hasbeenDead = false;\n enemySpawns = 0;\n enemyCounter++;\n }\n\n //When no more enemies on maps\n if (enemies.size() == 0) {\n waveinProgress = false;\n startWaveCount = 0;\n }\n\n //Start a new level when there's no more enemies on the map\n if (loadMap.MAP[mouseY / w][mouseX / w] == 16) {\n if (input.isMousePressed(0) && startWaveCount == 0 && !waveinProgress) {\n startWaveCount++;\n if (startWaveCount == 1 && enemies.size() == 0 && !waveinProgress) {\n waveinProgress = true;\n gc.resume();\n spawninProgress = true;\n currentLevel++;\n }\n }\n }\n\n //For each new level, increase the HP of each enemy\n if (currentLevel < currentLevel + 1 && !waveinProgress) {\n for (Enemy enemyHP : enemies) {\n if (enemyHP.getStartPosX() <= 0 && enemyHP.getHP() < enemyHP.startHP + currentLevel) {\n enemyHP.setHP(enemyHP.getHP() + currentLevel);\n }\n }\n }\n\n\n //For each enemies, if enemies has finished their way, decrease player HP\n //and set them inactive\n for (Enemy enemyList : enemies) {\n if (enemyList.counter >= enemyList.path.getLength() - 1) {\n player.decreaseLife();\n bulletCount = 0;\n enemyList.isActive = false;\n }\n\n //If enemies' hp is zero, set them inactive and remove from the list\n if (enemyList.getHP() <= 0) {\n enemyList.isActive = false;\n bulletCount = 0;\n player.addCredits(20);\n }\n enemyList.update(gc, stateBasedGame, delta);\n }\n for (int i = 0; i < enemies.size(); i++) {\n if (!enemies.get(i).isActive) {\n enemies.remove(enemies.get(i));\n }\n }\n\n //For all objects, update\n for (GameObject obj : objects)\n try {\n obj.update(gc, stateBasedGame, delta);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n //Go to Menu\n if (gc.getInput().isKeyPressed(Input.KEY_ESCAPE)) {\n gc.getInput().clearKeyPressedRecord();\n stateBasedGame.enterState(2);\n }\n\n\n }", "public void shootBullet( ){\n bulletsFired.add(new Bullet((short)(this.xPos + BOX_HEIGHT), (short)((this.getYPos() + (BOX_HEIGHT+15))), this.xPos, this.id, (byte) 0, (byte) 0, shootingDirection, currentWeapon.getKey()));\n\n byte weaponFired = currentWeapon.getKey();\n switch (weaponFired){\n case PISTOL_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(DEFAULT_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(DEFAULT_RANGE);\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.pistolSound);\n break;\n case MACHINEGUN_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(MACHINEGUN_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(MACHINEGUN_RANGE);\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.machineGunSound);\n break;\n case SHOTGUN_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(SHOTGUN_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(SHOTGUN_RANGE);\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.shotgunSound);\n break;\n case SNIPER_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(SNIPER_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(SNIPER_RANGE);\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.machineGunSound);\n break;\n case UZI_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(UZI_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(UZI_RANGE);\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.machineGunSound);\n break;\n case AI_WEAPON_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(AI_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(DEFAULT_RANGE);\n System.out.println(\"Bullet sound \" + audioHandler.getSoundEffectVolume());\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.pistolSound);\n break;\n default: bulletsFired.get(bulletsFired.size()-1).setDmg(DEFAULT_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(DEFAULT_RANGE);\n\n }\n }", "@SuppressWarnings(\"rawtypes\")\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t// Bullet //\r\n\t\t////////////\r\n\t\tArrayList msDOWN = GameCraft.getBulletDOWN();\r\n\t\tfor (int i = 0; i < msDOWN.size(); i++) {\r\n\t\t\tBulletDOWN m = (BulletDOWN) msDOWN.get(i);\r\n\t\t\tif (m.isVisible()) \r\n\t\t\t\tm.moveDOWN();\r\n\t\t\telse msDOWN.remove(i);\r\n\t\t}\r\n\r\n\t\tArrayList msUP = GameCraft.getBulletUP();\r\n\t\tfor (int i = 0; i < msUP.size(); i++) {\r\n\t\t\tBulletUP m = (BulletUP) msUP.get(i);\r\n\t\t\tif (m.isVisible()) \r\n\t\t\t\tm.moveUP();\r\n\t\t\telse msUP.remove(i);\r\n\t\t}\r\n\r\n\t\tArrayList msLEFT = GameCraft.getBulletLEFT();\r\n\t\tfor (int i = 0; i < msLEFT.size(); i++) {\r\n\t\t\tBulletLEFT m = (BulletLEFT) msLEFT.get(i);\r\n\t\t\tif (m.isVisible()) \r\n\t\t\t\tm.moveLEFT();\r\n\t\t\telse msLEFT.remove(i);\r\n\t\t}\r\n\r\n\t\tArrayList msRIGHT = GameCraft.getBulletRIGHT();\r\n\t\tfor (int i = 0; i < msRIGHT.size(); i++) {\r\n\t\t\tBulletRIGHT m = (BulletRIGHT) msRIGHT.get(i);\r\n\t\t\tif (m.isVisible()) \r\n\t\t\t\tm.moveRIGHT();\r\n\t\t\telse msRIGHT.remove(i);\r\n\t\t}\r\n\t\t\r\n\t\tArrayList msEnemys = GameCraft.getEnemys();\r\n\t\tif(moveamount >= 150){\r\n\t\t\tfor (int i = 0; i < msEnemys.size(); i++) {\r\n\t\t\t\tEnemys m = (Enemys) msEnemys.get(i);\r\n\t\t\t\tif (m.isVisible()){\r\n\t\t\t\t\tm.moveMe();\r\n\t\t\t\t}else{ \r\n\t\t\t\t\tmsEnemys.remove(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tmoveamount = 0;\r\n\t\t}\r\n\t\tmoveamount++;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tfor(int a = 0; a < msDOWN.size(); a++){\r\n\t\t\tfor(int b = 0; b < msEnemys.size(); b++){\r\n\t\t\t\tBulletDOWN bdown = (BulletDOWN) msDOWN.get(a);\r\n\t\t\t\tEnemys enemy = (Enemys) msEnemys.get(b);\r\n\t\t\t\tint xbul = bdown.getX();\r\n\t\t\t\tint ybul = bdown.getY();\r\n\t\t\t\tint xenemy = enemy.getX();\r\n\t\t\t\tint yenemy = enemy.getY();\r\n\t\t\t\t\r\n\t\t\t\tif((xbul - xenemy < 20 && xbul - xenemy > -20) && ( ybul - yenemy < 20 && xbul - yenemy > -20)){\r\n\t\t\t\t\tenemy.visible = false;\r\n\t\t\t\t\tscoreamount++;\r\n\t\t\t\t\t//GameCraft.SpawnEnemys();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor(int a = 0; a < msRIGHT.size(); a++){\r\n\t\t\tfor(int b = 0; b < msEnemys.size(); b++){\r\n\t\t\t\tBulletRIGHT bright = (BulletRIGHT) msRIGHT.get(a);\r\n\t\t\t\tEnemys enemy = (Enemys) msEnemys.get(b);\r\n\t\t\t\tint xbul = bright.getX();\r\n\t\t\t\tint ybul = bright.getY();\r\n\t\t\t\tint xenemy = enemy.getX();\r\n\t\t\t\tint yenemy = enemy.getY();\r\n\t\t\t\t\r\n\t\t\t\tif((xbul - xenemy < 20 && xbul - xenemy > -20) && ( ybul - yenemy < 20 && xbul - yenemy > -20)){\r\n\t\t\t\t\tenemy.visible = false;\r\n\t\t\t\t\tscoreamount++;\r\n\t\t\t\t\t//GameCraft.SpawnEnemys();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor(int a = 0; a < msLEFT.size(); a++){\r\n\t\t\tfor(int b = 0; b < msEnemys.size(); b++){\r\n\t\t\t\tBulletLEFT bleft = (BulletLEFT) msLEFT.get(a);\r\n\t\t\t\tEnemys enemy = (Enemys) msEnemys.get(b);\r\n\t\t\t\tint xbul = bleft.getX();\r\n\t\t\t\tint ybul = bleft.getY();\r\n\t\t\t\tint xenemy = enemy.getX();\r\n\t\t\t\tint yenemy = enemy.getY();\r\n\t\t\t\t\r\n\t\t\t\tif((xbul - xenemy < 20 && xbul - xenemy > -20) && ( ybul - yenemy < 20 && xbul - yenemy > -20)){\r\n\t\t\t\t\tenemy.visible = false;\r\n\t\t\t\t\tscoreamount++;\r\n\t\t\t\t\t//GameCraft.SpawnEnemys();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor(int a = 0; a < msUP.size(); a++){\r\n\t\t\tfor(int b = 0; b < msEnemys.size(); b++){\r\n\t\t\t\tBulletUP bup = (BulletUP) msUP.get(a);\r\n\t\t\t\tEnemys enemy = (Enemys) msEnemys.get(b);\r\n\t\t\t\tint xbul = bup.getX();\r\n\t\t\t\tint ybul = bup.getY();\r\n\t\t\t\tint xenemy = enemy.getX();\r\n\t\t\t\tint yenemy = enemy.getY();\r\n\t\t\t\t\r\n\t\t\t\tif((xbul - xenemy < 20 && xbul - xenemy > -20) && ( ybul - yenemy < 20 && xbul - yenemy > -20)){\r\n\t\t\t\t\tenemy.visible = false;\r\n\t\t\t\t\tscoreamount++;\r\n\t\t\t\t\t//GameCraft.SpawnEnemys();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\tEnemy 500 500\r\n\t\tBullet 510 510\r\n\t\t510 < 500 && 480 < 500 || 500 > 510 && 500 > 480\r\n\t\t500 > 320 && 500 > 380\r\n\t\t\r\n\t\t*/\r\n\t\t\r\n\t\t////////////\r\n\t\t// Bullet //\r\n\t\t////////////\r\n\t\tGameCraft.move();\r\n\t\trepaint(); \r\n\t}", "public void move()\r\n\t{\r\n\t\tfor (int a = 0; a < bullets.size(); a++)\r\n\t\t{\r\n\t\t\tBullet bullet = bullets.get(a);\r\n\t\t\tif (!bullet.move())\r\n\t\t\t{\r\n\t\t\t\tbullets.remove(a);\r\n\t\t\t\ta--;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void update() {\r\n super.update();\r\n life -= 1;\r\n if(life <= 0) {\r\n killBullet();\r\n }\r\n }", "public void update()\n {\n done = false;\n if(data.size()==0)\n {\n data.add('0');\n data.add('0');\n data.add('0');\n data.add('0');\n data.add('0');\n }\n\n boolean isPressed = shot;\n\n keyUP = data.get(0) == '1';\n keyDOWN = data.get(1) == '1';\n keyLEFT = data.get(2) == '1';\n keyRIGHT = data.get(3) == '1';\n shot = data.get(4) == '1';\n\n if(!shot && isPressed)\n {\n if (canShot)\n {\n status.setShot(true);\n if (getBulletType ().equals (\"Laser\"))\n {\n bullets.add (new LaserBulletMulti (getCanonStartX (), getCanonStartY (),\n getDegree (), System.currentTimeMillis (), walls, tanks,canonPower,this.code,kills));\n setBulletType (\"Normal\");\n } else\n {\n bullets.add (new BulletMulti (getCanonStartX (), getCanonStartY (),\n getDegree (), System.currentTimeMillis (), walls, tanks,canonPower,this.code,kills));\n }\n\n canShot = false;\n shot = true;\n new Thread (new Runnable () {\n @Override\n public void run () {\n try {\n Thread.sleep (100);\n shot = false;\n } catch (InterruptedException e) {\n e.printStackTrace ();\n }\n }\n }).start ();\n new Thread (new Runnable () {\n @Override\n public void run () {\n try {\n Thread.sleep (500);\n canShot = true;\n } catch (InterruptedException e) {\n e.printStackTrace ();\n }\n }\n }).start ();\n }\n }\n\n int forX = (int) (6 * Math.cos (Math.toRadians (this.getDegree ())));\n int forY = (int) (6 * Math.sin (Math.toRadians (this.getDegree ())));\n\n if(keyUP && canMove(forX , forY) && isEmpty(forX,forY,1))\n {\n this.addLocX(forX);\n this.addLocY(forY);\n }\n if(keyDOWN && canMove(-1*forX , -1*forY) && isEmpty(forX,forY,-1))\n {\n this.addLocX(-1*forX);\n this.addLocY(-1*forY);\n }\n\n checkPrize();\n\n if(keyRIGHT && !keyLEFT)\n this.increaseDegree();\n\n if(!keyRIGHT && keyLEFT)\n this.decreaseDegree();\n\n\n this.setLocX(Math.max(this.getLocX(), 0));\n this.setLocX(Math.min(this.getLocX(), GameFrameMulti.GAME_WIDTH - 30));\n this.setLocY(Math.max(this.getLocY(), 0));\n this.setLocY(Math.min(this.getLocY(), GameFrameMulti.GAME_HEIGHT - 30));\n done = true;\n }", "public void shoot(int bulletLeft) {\n float xValue = canon.getX();\n float yValue = canon.getY();\n bullets.get(bulletLeft).setVisibility(View.VISIBLE);\n shootingMotion(bullets.get(bulletLeft), xValue, yValue);\n\n }", "public void update(float dt) {\n\t\tIterator<Bullet> iter = bullets.iterator();\n\t\twhile(iter.hasNext()) {\n\t\t\tBullet b = iter.next();\n\t\t\t\n\t\t\tb.update(dt);\n\t\t\tif(b.getY() > 480 - bullet_size_h) iter.remove();\n\t\t}\n\t}", "@Override\n\tpublic void collideWith(Bullet bullet) {\n\t\tbulletMoveForward(bullet);\n\t}", "public void update() {\n double newAngle = angle - 90;\n Coordinate nextCenterPointCoordinate = new Coordinate(\n this.centerPointCoordinate.getXCoordinate() - (Constants.BULLET_SPEED * Math.cos(Math.toRadians(newAngle))),\n this.centerPointCoordinate.getYCoordinate() + (Constants.BULLET_SPEED * Math.sin(Math.toRadians(newAngle)))\n );\n\n\n ArrayList<Wall> walls = new ArrayList<>();\n walls.addAll(TankTroubleMap.getDestructibleWalls());\n walls.addAll(TankTroubleMap.getIndestructibleWalls());\n ArrayList<Coordinate> nextCoordinatesArrayList = makeCoordinatesFromCenterCoordinate(nextCenterPointCoordinate);\n Wall wallToCheck = null;\n for (Wall wall : walls) {\n if (TankTroubleMap.checkOverLap(wall.getPointsArray(), nextCoordinatesArrayList)) {\n wallToCheck = wall;\n }\n }\n\n if (wallToCheck != null) {\n if (horizontalCrash(wallToCheck)) { //if the bullet would only go over horizontal side of any walL\n nextCenterPointCoordinate = flipH();\n } else if (verticalCrash(wallToCheck)) { // if the bullet would only go over vertical side any wall\n nextCenterPointCoordinate = flipV();\n } else {// if the bullet would only go over corner of any wall\n int cornerCrashState = cornerCrash(wallToCheck);\n nextCenterPointCoordinate = flipCorner(cornerCrashState);\n }\n\n if (wallToCheck.isDestroyable()) {//crashing destructible\n //System.out.println(\"bullet damage:\"+ damage);\n //System.out.println(\"wall health:\"+ ((DestructibleWall) wallToCheck).getHealth());\n ((DestructibleWall) wallToCheck).receiveDamage(damage);\n if (((DestructibleWall) wallToCheck).getHealth() <= 0) {\n TankTroubleMap.getDestructibleWalls().remove(wallToCheck);\n }\n bulletsBlasted = true;\n tankTroubleMap.getBullets().remove(this);\n }\n }\n this.centerPointCoordinate = nextCenterPointCoordinate;\n updateArrayListCoordinates();\n\n // Tanks / users\n if (!bulletsBlasted) {\n for (int i = 0; i < tankTroubleMap.getUsers().size(); i++) {\n if (TankTroubleMap.checkOverLap(coordinates, tankTroubleMap.getUsers().get(i).getUserTank().getTankCoordinates())) {\n bulletsBlasted = true;\n for (Bullet bullet : tankTroubleMap.getBullets()) {\n if (bullet.bulletsBlasted) tankTroubleMap.getBullets().remove(bullet);\n break;\n }\n tankTroubleMap.getUsers().get(i).getUserTank().receiveDamage(damage);\n //System.out.println(\"health: \" + tankTroubleMap.getUsers().get(i).getUserTank().getHealth());\n if (tankTroubleMap.getUsers().get(i).getUserTank().getHealth() <= 0) {\n int finalI = i;\n Thread thread = new Thread(() -> {\n try {\n SoundsOfGame soundsOfGame = new SoundsOfGame(\"explosion\", false);\n soundsOfGame.playSound();\n tankTroubleMap.getUsers().get(finalI).getUserTank().setTankImage(ImageIO.read(new File(\"kit/explosion/Explosion_A.png\")));\n Thread.sleep(150);\n tankTroubleMap.getUsers().get(finalI).getUserTank().setTankImage(ImageIO.read(new File(\"kit/explosion/Explosion_B.png\")));\n Thread.sleep(150);\n tankTroubleMap.getUsers().get(finalI).getUserTank().setTankImage(ImageIO.read(new File(\"kit/explosion/Explosion_C.png\")));\n Thread.sleep(150);\n tankTroubleMap.getUsers().get(finalI).getUserTank().setTankImage(ImageIO.read(new File(\"kit/explosion/Explosion_D.png\")));\n Thread.sleep(150);\n tankTroubleMap.getUsers().get(finalI).getUserTank().setTankImage(ImageIO.read(new File(\"kit/explosion/Explosion_E.png\")));\n Thread.sleep(150);\n tankTroubleMap.getUsers().get(finalI).getUserTank().setTankImage(ImageIO.read(new File(\"kit/explosion/Explosion_F.png\")));\n Thread.sleep(150);\n tankTroubleMap.getUsers().get(finalI).getUserTank().setTankImage(ImageIO.read(new File(\"kit/explosion/Explosion_G.png\")));\n Thread.sleep(150);\n tankTroubleMap.getUsers().get(finalI).getUserTank().setTankImage(ImageIO.read(new File(\"kit/explosion/Explosion_H.png\")));\n Thread.sleep(150);\n tankTroubleMap.getUsers().remove(finalI);\n gameOverCheck();\n if (isUserTank) {\n tankTroubleMap.getUsers().get(tankIndex).getUserTank().setNumberOfDestroyedTank(tankTroubleMap.getUsers().get(tankIndex).getUserTank().getNumberOfDestroyedTank() + 1);\n }\n tankTroubleMap.getAudience().add(tankTroubleMap.getUsers().get(finalI));\n } catch (InterruptedException | IOException e) {\n e.printStackTrace();\n }\n });\n thread.start();\n }\n break;\n }\n }\n }\n\n // Tanks / bots\n if (!bulletsBlasted) {\n for (int i = 0; i < tankTroubleMap.getBots().size(); i++) {\n if (TankTroubleMap.checkOverLap(coordinates, tankTroubleMap.getBots().get(i).getAiTank().getTankCoordinates())) {\n bulletsBlasted = true;\n for (Bullet bullet : tankTroubleMap.getBullets()) {\n if (bullet.bulletsBlasted) tankTroubleMap.getBullets().remove(bullet);\n break;\n }\n tankTroubleMap.getBots().get(i).getAiTank().receiveDamage(damage);\n //System.out.println(\"health: \" + tankTroubleMap.getBots().get(i).getAiTank().getHealth());\n if (tankTroubleMap.getBots().get(i).getAiTank().getHealth() <= 0) {\n // System.out.println(\"Blasted Tank.......\");\n int finalI = i;\n Thread thread = new Thread(() -> {\n try {\n SoundsOfGame soundsOfGame = new SoundsOfGame(\"explosion\", false);\n soundsOfGame.playSound();\n tankTroubleMap.getBots().get(finalI).getAiTank().setTankImage(ImageIO.read(new File(\"kit/explosion/Explosion_A.png\")));\n Thread.sleep(150);\n tankTroubleMap.getBots().get(finalI).getAiTank().setTankImage(ImageIO.read(new File(\"kit/explosion/Explosion_B.png\")));\n Thread.sleep(150);\n tankTroubleMap.getBots().get(finalI).getAiTank().setTankImage(ImageIO.read(new File(\"kit/explosion/Explosion_C.png\")));\n Thread.sleep(150);\n tankTroubleMap.getBots().get(finalI).getAiTank().setTankImage(ImageIO.read(new File(\"kit/explosion/Explosion_D.png\")));\n Thread.sleep(150);\n tankTroubleMap.getBots().get(finalI).getAiTank().setTankImage(ImageIO.read(new File(\"kit/explosion/Explosion_E.png\")));\n Thread.sleep(150);\n tankTroubleMap.getBots().get(finalI).getAiTank().setTankImage(ImageIO.read(new File(\"kit/explosion/Explosion_F.png\")));\n Thread.sleep(150);\n tankTroubleMap.getBots().get(finalI).getAiTank().setTankImage(ImageIO.read(new File(\"kit/explosion/Explosion_G.png\")));\n Thread.sleep(150);\n tankTroubleMap.getBots().get(finalI).getAiTank().setTankImage(ImageIO.read(new File(\"kit/explosion/Explosion_H.png\")));\n Thread.sleep(150);\n tankTroubleMap.getBots().remove(finalI);\n gameOverCheck();\n } catch (InterruptedException | IOException e) {\n e.printStackTrace();\n }\n });\n thread.start();\n }\n break;\n }\n }\n }\n }", "@Override\r\n\tpublic void onCollisionWithBullet() {\n\t\t\r\n\t}", "public void fireBullet(int direction , int posX, int posY ){\n if ( clockBullet.getElapsedTime().asMilliseconds() > 100 ){\n int lowestbulletNo = 10;\n for( int i = 9; i > 0; i-- ){\n if ( bulletSpace.get(i).isEnabled() == false){\n lowestbulletNo = i;//find the first bullet in the gun barrol\n }\n }\n\n if ( lowestbulletNo < 10 ){\n bulletSpace.get(lowestbulletNo).setDirection(direction);\n bulletSpace.get(lowestbulletNo).setDistance(0);\n bulletSpace.get(lowestbulletNo).setPosX(posX - map.getX()) ;\n bulletSpace.get(lowestbulletNo).setPosY(posY - map.getY()) ;\n bulletSpace.get(lowestbulletNo).enabled(true);\n bulletSpace.get(lowestbulletNo).setRotation(direction+1);\n }\n }\n clockBullet.restart();\n }", "public void tick() {\n\t\tif (Math.abs(disToPlayerX()) > Math.abs(disToPlayerY())) {\r\n\t\t\tif (disToPlayerX()<0) {\r\n\t\t\t\tx -= speed;\t//moves enemy to the left\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tx += speed; //moves enemy to the right\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (disToPlayerY()<0) {\r\n\t\t\t\ty-=speed; //moves enemy up\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ty+=speed; //moves enemy down\r\n\t\t\t}\r\n\t\t}\r\n\t\tenemyRectangle.setLocation((int)x,(int) y); //updates hitbox of enemy\r\n\r\n\t\t//checks all enemies and see if they run into player\r\n\t\tfor (int i=0;i<c.getEnemys().size();i++) {\r\n\t\t\tif (enemyRectangle.getBounds().intersects(player.getRectangle().getBounds())) {\r\n\t\t\t\tkillEnemy(); //removes the enemy\r\n\t\t\t\tPlayer.health -=10; //removes 10 health\r\n\t\t\t\tbreak; //doesn't work without this BREAK. DO NOT REMOVE\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//checks all bullets if they hit an enemy\r\n\t\tfor (int i = 0;i<c.getBullets().size();i++) {\r\n\t\t\tif (enemyRectangle.getBounds().intersects(c.getBullets().get(i).getRect().getBounds())) {\r\n\t\t\t\tkillEnemy(); //removes enemy\r\n\t\t\t\tc.removeBullet(c.getBullets().get(i)); //removes the bullet\r\n\t\t\t\tPlayer.score += 50; //adds 50 to the score\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void fireBullet() {\n\r\n\t\tif (count > 0)\r\n\t\t\treturn;\r\n\t\t// ...and if all the bullets aren't currently in use...\r\n\t\tint slot = getAvailableBullet();\r\n\t\tif (slot < 0)\r\n\t\t\treturn;\r\n\t\t// ...then launch a new bullet\r\n\t\tbullets[slot].setLocation(locX, locY);\r\n\t\tbullets[slot].setDirection(angle);\r\n\t\tbullets[slot].reset();\r\n\t\t// Reset the timer\r\n\t\tcount = RELOAD;\r\n\t}", "void checkCol() {\n Player player = gm.getP();\n int widthPlayer = (int) player.getImg().getWidth();\n int heightPlayer = (int) player.getImg().getHeight();\n Bullet dummyBuullet = new Bullet();\n int widthBullet = (int) dummyBuullet.getImg().getWidth();\n int heightBullet = (int) dummyBuullet.getImg().getHeight();\n for (Bullet bullet : gm.getBulletList()) {\n // the bullet must be an enemy bullet\n if (bullet.isEnemyBullet() && bullet.isActive()) {\n // the condition when the bullet location is inside the rectangle of player\n if ( Math.abs( bullet.getX() - player.getX() ) < widthPlayer / 2\n && Math.abs( bullet.getY() - player.getY() ) < heightPlayer / 2 ) {\n // 1) destroy the bullet\n // 2) decrease the life of a player\n gm.getP().setHasShield(false);\n if(gm.getP().getCurDirection() == 0){\n try (FileInputStream inputStream = new FileInputStream(\"MediaFiles/spaceshipLeft4.png\")) {\n gm.getP().setImg(new Image(inputStream)) ;\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n if(gm.getP().getCurDirection() == 1){\n try (FileInputStream inputStream = new FileInputStream(\"MediaFiles/spaceshipRight4.png\")) {\n gm.getP().setImg(new Image(inputStream)) ;\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n bullet.setActive(false);\n if(gm.getP().getHasShield() == false)player.decreaseLife();\n break;\n }\n }\n }\n // 2'nd case\n // the enemy is hit with player bullet\n for (Enemy enemy : gm.getEnemyList()) {\n if (enemy.isActive()) {\n int widthEnemy = (int) enemy.getImg().getWidth();\n int heightEnemy = (int) enemy.getImg().getHeight();\n for (Bullet bullet : gm.getBulletList()) {\n if (!bullet.isEnemyBullet() && bullet.isActive()) {\n // the condition when the player bullet location is inside the rectangle of enemy\n if (Math.abs(enemy.getX() - bullet.getX()) < (widthBullet / 2 + widthEnemy / 2)\n && Math.abs(enemy.getY() - bullet.getY()) < (heightBullet / 2 + heightEnemy / 2)) {\n // 1) destroy the player bullet\n // 2) destroy the enemy\n if (destroyedEnemy % 3 == 0 && destroyedEnemy != 0) onlyOnce = 0;\n destroyedEnemy++;\n gm.increaseScore();\n enemy.setActive(false);\n\n\n if(enemy.hTitanium()) {\n gm.getTitaniumList()[gm.getTitaniumIndex()].setX(enemy.getX());\n gm.getTitaniumList()[gm.getTitaniumIndex()].setY(enemy.getY());\n gm.getTitaniumList()[gm.getTitaniumIndex()].setActive(true);\n gm.increaseTitaniumIndex();\n }\n\n if(enemy.hBonus()) {\n \tgm.getBonusList()[gm.getBonusIndex()].setX(enemy.getX());\n \tgm.getBonusList()[gm.getBonusIndex()].setY(enemy.getY());\n \tgm.getBonusList()[gm.getBonusIndex()].setActive(true);\n \tgm.increaseBonusIndex();\n }\n bullet.setActive(false);\n break;\n }\n }\n }\n }\n }\n\n // 3'rd case\n // the player collided with enemy ship\n for (Enemy enemy : gm.getEnemyList()) {\n if (enemy.isActive()) {\n int widthEnemy = (int) enemy.getImg().getWidth();\n int heightEnemy = (int) enemy.getImg().getHeight();\n // the condition when the enemy rectangle is inside the rectangle of player\n if (Math.abs(enemy.getX() - player.getX()) < (widthPlayer / 2 + widthEnemy / 2)\n && Math.abs(enemy.getY() - player.getY()) < (heightPlayer / 2 + heightEnemy / 2)) {\n // 1) destroy the enemy\n // 2) decrease the player's life\n if(gm.getP().getHasShield() == false)player.decreaseLife();\n gm.getP().setHasShield(false);\n if(gm.getP().getCurDirection() == 0){\n try (FileInputStream inputStream = new FileInputStream(\"MediaFiles/spaceshipLeft4.png\")) {\n gm.getP().setImg(new Image(inputStream)) ;\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n if(gm.getP().getCurDirection() == 1){\n try (FileInputStream inputStream = new FileInputStream(\"MediaFiles/spaceshipRight4.png\")) {\n gm.getP().setImg(new Image(inputStream)) ;\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n enemy.setActive(false);\n\n break;\n }\n }\n }\n\n for (Bonus bonus : gm.getBonusList()) {\n if (bonus.isActive()) {\n int widthBonus = (int) bonus.getImg().getWidth();\n int heightBonus = (int) bonus.getImg().getHeight();\n if (Math.abs(bonus.getX() - player.getX()) < (widthPlayer / 2 + widthBonus / 2)\n && Math.abs(bonus.getY() - player.getY()) < (heightPlayer / 2 + heightBonus / 2)) {\n bonus.setActive(false);\n if (bonus.getType() == 1) {\n if (player.getLives() < player.getMaxLives()) {\n player.setLives(player.getLives() + 1);\n }\n }\n else{\n superAttack = 1;\n }\n }\n }\n }\n\n for (Titanium titanium : gm.getTitaniumList()) {\n if (titanium.isActive()) {\n int widthBonus = (int) titanium.getImg().getWidth();\n int heightBonus = (int) titanium.getImg().getHeight();\n if (Math.abs(titanium.getX() - player.getX()) < (widthPlayer / 2 + widthBonus / 2)\n && Math.abs(titanium.getY() - player.getY()) < (heightPlayer / 2 + heightBonus / 2)) {\n titanium.setActive(false);\n gm.getP().increaseTitanium();\n }\n }\n }\n\n }", "public void collision() {\n for (int i = 0; i < friendlyBullets.size(); i++) {\n\n friendlyBullets.get(i).tick();\n\n if (friendlyBullets.get(i).getImgY() <= 40) {\n friendlyBullets.get(i).bulletImage.delete();\n friendlyBullets.remove(friendlyBullets.get(i));\n i--;\n continue;\n }\n\n for (int j = 0; j < enemies.size(); j++) {\n\n if (friendlyBullets.get(i).getHitbox().intersects(enemies.get(j).getHitbox())) {\n\n friendlyBullets.get(i).hit();\n friendlyBullets.remove(friendlyBullets.get(i));\n i--;\n\n enemies.get(j).hit();\n\n if (enemies.get(j).getHp() <= 0) {\n enemies.remove(enemies.get(j));\n score.setScore(50);\n j--;\n }\n //end this loop\n j = enemies.size();\n }\n }\n\n }\n\n ///////////////////////////////////////////////////////////////////////////////////////\n\n\n // Enemy out of bounds\n for (int i = 0; i < enemies.size(); i++) {\n\n enemies.get(i).tick();\n\n // Out of bounds\n if (enemies.get(i).getEnemyImage().getY() >= 750) {\n enemies.get(i).getEnemyImage().delete();\n enemies.remove(enemies.get(i));\n\n if (enemies.size() > 1) {\n i--;\n }\n }\n }\n\n\n //////////////////////////////////////////////////////////////////////////\n\n //powerUps out of bounds and collision with spaceships\n for (int i = 0; i < powerUps.size(); i++) {\n\n powerUps.get(i).tick();\n\n if (powerUps.get(i).getImgY() >= 745) {\n\n powerUps.get(i).powerUpImage.delete();\n powerUps.remove(powerUps.get(i));\n\n i--;\n continue;\n }\n\n for (int j = 0; j < spaceShips.size(); j++) {\n\n if (spaceShips.get(j).getHitbox().intersects(powerUps.get(i).getHitbox())) {\n\n\n spaceShips.get(j).powerUp(powerUps.get(i).getPowerUpType());\n powerUps.get(i).hit();\n powerUps.remove(powerUps.get(i));\n\n //if it collides with one leave the for loop\n i--;\n j = spaceShips.size();\n }\n }\n\n }\n\n }", "public void enemyShoot()\r\n\t{\r\n\t\tfor (Enemy enemies : enemy)\r\n\t\t{\r\n\t\t\tif (enemies.getHasFired())\r\n\t\t\t{\r\n\t\t\t\tBullet enemyPew = enemies.shoot();\r\n\t\t\t\tif (enemyPew != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tbullets.add(enemyPew);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "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}", "public void detectCollisionPerBullet() {\n//\t\tfor (Bullet bullet : bulletList) {\n\t\tfor (int i=0; i<bulletList.size(); i++) {\n\t\t\tBullet bullet = bulletList.get(i);\n\t\t\tif (bullet != null && !bullet.isDead()) {\n\t\t\t\tdetectCollision(bullet);\n\t\t\t}\n\t\t}\n\t}", "private void moveBullet() {\r\n\t\tif(bullet != null) {\r\n\t\t\tbullet.move(bulletVelocity, 0);\r\n\t\t}\r\n\t}", "@Override\n public void attack(){\n int xBullet=0,yBullet=0;\n switch(direction){\n case 0:\n xBullet=(int)(x+Sprite.python_left.getWidth()/3);\n yBullet=(int)(y+Sprite.python_left.getHeight()*3/4);\n break;\n case 1:\n xBullet=(int)(x+Sprite.python_left.getWidth()*3/4);\n yBullet=(int)(y+Sprite.python_left.getHeight()/4);\n break;\n case 2:\n xBullet=(int)(x+Sprite.python_left.getWidth()/3);\n yBullet=(int)(y+Sprite.python_left.getHeight()/4);\n break;\n case 3:\n xBullet=(int)(x+Sprite.python_left.getWidth()/4);\n yBullet=(int)(y+Sprite.python_left.getHeight()/4);\n break;\n }\n PythonBullet pythonBullet=new PythonBullet(xBullet,yBullet,board,Player.PLAYER_SPEED*1.5);\n pythonBullet.setDirection(direction);\n board.addBullets(pythonBullet);\n\n }", "public void moveBullets() {\n bController.increment();\n }", "public void shoot(ArrayList<Bullet> alienBullets)\r\n\t{\r\n\t\t//do nothing usually\r\n\t}", "private void updateRunning(List touchEvents, float deltaTime) {\n int len = touchEvents.size();\n updateAccelRunning(deltaTime);\n for (int i = 0; i < len; i++) {\n TouchEvent event = (TouchEvent) touchEvents.get(i);\n if (event.type == TouchEvent.TOUCH_DOWN) {\n\n if (inBounds(event, 15, 50, 450, 700)) {\n if ( madafacka.readyToFire) {\n madafacka.shoot();\n madafacka.readyToFire=false;\n }\n }\n }\n\n if (event.type == TouchEvent.TOUCH_UP) {\n\n if (inBounds(event, 0, 0, 5, 35)) {\n pause();\n }\n\n if (inBounds(event, 15, 50, 450, 700)){\n madafacka.readyToFire=true;\n }\n }\n\n }\n\n // 2. Check miscellaneous events like death:\n if (livesLeft == 0) {\n state = GameState.GameOver;\n }\n\n // 3. Call individual update() methods here.\n // This is where all the game updates happen.\n // For example, robot.update();\n madafacka.update();\n\n ArrayList<Bullet> bullets = madafacka.bullets;\n for (int i = 0; i < bullets.size(); i++) {\n Bullet b = (Bullet) bullets.get(i);\n if (b.visible) {\n b.update();\n } else {\n bullets.remove(i);\n }\n }\n\n updateTiles();\n for(int i=0; i<enemies.size(); i++){\n ((BasicInvader)enemies.get(i)).update();\n }\n bg1.update();\n bg2.update();\n animate();\n }", "@Override\n public void update(ArrayList<String> pressedKeys) {\n\n\n super.update(pressedKeys);\n// if(!backgroundMusic.play && x==0){\n// x=1;\n// backgroundMusic.playMusic(\"resources/oceanOperator.mp3\");\n// }\n\n if (state == STATE.MENU) {\n\n }\n\n //moveGameY(1);\n\n else if (state == STATE.GAME) {\n if (player != null && !player.isDead) {\n player.update(pressedKeys);\n }\n if (player.getLifeCount() <= 0) {\n complete = true;\n player.isDead = true;\n }\n\n\n if (transitionYCurrent < transitionY) {\n moveGameY(transitionYSpeed);\n transitionYCurrent += transitionYSpeed;\n }\n\n if(complete && !player.isDead){\n System.out.println(\"you won!\");\n state = STATE.COMPLETE;\n\n\n }\n\n if (player != null && !player.isDead) {\n// for (int i = 0; i < enemies.size(); i++) {\n// if (player.playerCollidesWith(enemies.get(i)) && enemies.get(i).dead == false && player.canGetHurt()) {\n// damageThePlayer();\n// }\n// }\n\n for (int i = 0; i < currentRoom.getSpikeList().size(); i++) {\n SpikeTile spikes = currentRoom.getSpikeList().get(i);\n if (player.feetCollideWith(spikes) && spikes.getStateName() == \"idle up\" && player.canGetHurt()) {\n damageThePlayer();\n }\n }\n\n\n if (player.playerCollidesWith(coin)) {\n coin.handleEvent(collidedEvent);\n myQuestManager.handleEvent(PickedUpEvent);\n }\n player.update();\n checkCollisions(player);\n\n\n for (int i = 0; i < player.playerBullets.size(); i++) {\n Bullet bul = player.playerBullets.get(i);\n bul.update(pressedKeys);\n if (bul.getShotTimer() >= bul.getShotCap()) {\n\n player.playerBullets.remove(i);\n }\n }\n\n TweenJuggler.getInstance().nextFrame();\n\n boolean pickpocketTrigger = false;\n for (int i = 0; i < enemies.size(); i++) {\n\n Enemy enemy = enemies.get(i);\n if (player.getHitBox().intersects(enemy.getPickpocketRect())) {\n pickpocketTrigger = true;\n pickpocketEnemy = enemy;\n }\n\n }\n pickpocket = pickpocketTrigger;\n if (!pickpocket)\n pickpocketEnemy = null;\n }\n if (pressedKeys.contains(KeyEvent.getKeyText(KeyEvent.VK_W))) {\n for (int i = 0; i < currentRoom.getDoors().size(); i++) {\n if (player.getHitBox().intersects(currentRoom.getDoors().get(i).getDoorCollider()) && currentRoom.getDoors().get(i).stateName == \"door_open\" && transitionPhase == false) {\n transitionPhase = true;\n currentRoom.fadeOut();\n queuedRoom = currentRoom.getDoors().get(i).getNextRoom();\n queuedRoom.fadeIn();\n transitionYCurrent = 0;\n enemies = new ArrayList<>();\n pressedKeys.remove(KeyEvent.getKeyText(KeyEvent.VK_W));\n }\n }\n\n }\n\n if (pressedKeys.contains(KeyEvent.getKeyText(KeyEvent.VK_E))) {\n if (pickpocket == true && pickpocketEnemy != null) {\n keyCount += pickpocketEnemy.pickpocketKeys();\n int knives = pickpocketEnemy.pickpocketKnives();\n knifeCount += knives;\n System.out.println(knives);\n// int n = rand.nextInt(3) + 1;\n// if (n == 1) {\n//\n// itemString = \"You found a knife!\";\n// } else if (n == 2) {\n// keyCount++;\n// itemString = \"You found a key!\";\n//\n// } else if (n == 3) {\n// itemString = \"No items found.\";\n// }\n }\n\n\n for (int i = 0; i < currentRoom.getDoors().size(); i++) {\n\n if (player.getHitBox().intersects(currentRoom.getDoors().get(i).getDoorCollider()) && currentRoom.getDoors().get(i).stateName == \"door_closed\") {\n if (keyCount > 0) {\n soundEffects.playSoundEffect(\"resources/chains.wav\",0);\n currentRoom.getDoors().get(i).setAnimationState(\"door_opening\", \"door_open\");\n itemString = \"Door unlocked\";\n keyCount--;\n } else {\n soundEffects.playMusic(\"resources/door_locked.wav\");\n }\n } else if (player.getHitBox().intersects(currentRoom.getDoors().get(i).getDoorCollider()) && currentRoom.getDoors().get(i).stateName == \"door_open\" && transitionPhase == false) {\n transitionPhase = true;\n currentRoom.fadeOut();\n queuedRoom = currentRoom.getDoors().get(i).getNextRoom();\n queuedRoom.fadeIn();\n transitionYCurrent = 0;\n enemies = new ArrayList<>();\n }\n }\n\n for (int i = 0; i < currentRoom.getChests().size(); i++) {\n TreasureChest chest = currentRoom.getChests().get(i);\n if (player.feetCollideWith(chest) && chest.getStateName() == \"closed\") {\n chest.setAnimationState(\"open\", \"\");\n if (chest.getItem().equals(\"key\")) {\n keyCount++;\n } else if (chest.getItem().equals(\"knife\")) {\n knifeCount++;\n }\n }\n }\n\n\n pressedKeys.remove(KeyEvent.getKeyText(KeyEvent.VK_E));\n }\n\n if (pressedKeys.contains(KeyEvent.getKeyText(KeyEvent.VK_P))) {\n if (complete == true) {\n removeAll();\n complete = false;\n currentLevel = 0;\n\n\n tutorial = new TutorialLevel1(\"Tutorial\");\n tutorial.run();\n addChild(tutorial);\n\n\n myLevel = new Level0(\"Room1\");\n myLevel.run();\n addChild(myLevel);\n\n\n myLevel1 = new Level1(\"Room2\");\n myLevel1.run();\n myLevel1.hide();\n addChild(myLevel1);\n\n myLevel2 = new ahmedslevel(\"Room3\", player);\n myLevel2.run();\n myLevel2.hide();\n addChild(myLevel2);\n\n myLevel3 = new BrighamLevel(\"Room4\");\n myLevel3.run();\n myLevel3.hide();\n addChild(myLevel3);\n\n level4 = new AlternatingSpikesLevel(\"Room6\");\n level4.run();\n level4.hide();\n addChild(level4);\n\n\n bossLevel = new BossLevel(\"Room5\", player);\n bossLevel.run();\n bossLevel.hide();\n addChild(bossLevel);\n\n\n tutorial.mapDoorToRoom(0,myLevel);\n myLevel.mapDoorToRoom(0, myLevel1);\n myLevel1.mapDoorToRoom(0, myLevel2);\n myLevel2.mapDoorToRoom(0, myLevel3);\n myLevel3.mapDoorToRoom(0, level4);\n level4.mapDoorToRoom(0, bossLevel);\n currentRoom = tutorial;\n\n enemies = currentRoom.enemies;\n\n player.isDead = false;\n player.setLifeCount(3);\n player.setPositionX(550);\n player.setPositionY(700);\n knifeCount = 4;\n keyCount = 0;\n backgroundMusic.stop();\n backgroundMusic.playSoundEffect(\"resources/oceanOperator.wav\", 100);\n } else {\n state = STATE.PAUSE;\n\n }\n }\n for (int i = 0; i < enemies.size(); i++) {\n Enemy currentEnemy = enemies.get(i);\n currentEnemy.update();\n if (!currentEnemy.dead) {\n if (currentEnemy.enemyBullet != null) {\n currentEnemy.enemyBullet.update(pressedKeys);\n if (currentEnemy.enemyBullet.getShotTimer() >= currentEnemy.enemyBullet.getShotCap()) {\n currentEnemy.enemyBullet = null;\n }\n }\n if (currentEnemy.isInView(player, currentRoom.coverList)) {\n// System.out.println(currentRoom.coverList.get(0));\n if (complete == false) {\n if (currentEnemy.enemyBullet == null) {\n currentEnemy.enemyBullet = new Bullet(\"bullet\", \"knife.png\", 0.4);\n currentEnemy.enemyBullet.setStart(currentEnemy.getPositionX() + currentEnemy.getUnscaledWidth() / 2, currentEnemy.getPositionY() + currentEnemy.getUnscaledHeight() / 2);\n currentEnemy.enemyBullet.setEnd(player.getPositionX(), player.getPositionY());\n TweenTransitions enemyBulletPath = new TweenTransitions(\"linearTransition\");\n Tween enemyBulletmovement = new Tween(currentEnemy.enemyBullet, enemyBulletPath);\n enemyBulletmovement.animate(TweenableParams.X, currentEnemy.enemyBullet.startValX, currentEnemy.enemyBullet.endValX, 0.4);\n enemyBulletmovement.animate(TweenableParams.Y, currentEnemy.enemyBullet.startValY, currentEnemy.enemyBullet.endValY, 0.4);\n TweenJuggler.getInstance().add(enemyBulletmovement);\n currentEnemy.handleEvent(throwKnife);\n }\n }\n if (currentEnemy.enemyBullet != null) {\n// System.out.println(currentEnemy.enemyBullet.getShotTimer());\n if (currentEnemy.enemyBullet.collidesWith(player) && player.canGetHurt()) {\n damageThePlayer();\n currentEnemy.enemyBullet = null;\n break;\n }\n for (int j = 0; j < currentRoom.collisionArray.size(); j++) {\n if (currentEnemy.enemyBullet.collidesWith(currentRoom.collisionArray.get(j))) {\n currentEnemy.enemyBullet = null;\n break;\n }\n }\n\n }\n }\n\n\n for (int j = 0; j < player.playerBullets.size(); j++) {\n Bullet bul = player.playerBullets.get(j);\n// for (int k = 0; k < currentRoom.collisionArray.size(); k++) {\n// if (bul.collidesWith(currentRoom.collisionArray.get(k))) {\n// player.playerBullets.remove(j);\n// break;\n// }\n// }\n if (bul != null) {\n if (bul.collidesWith(enemies.get(i))) {\n enemies.get(i).dead = true;\n enemies.get(i).enemyBullet = null;\n if (enemies.get(i).getStateName().contains(\"right\")) {\n enemies.get(i).setDelay(90);\n enemies.get(i).setAnimationState(\"dying right\", \"dead right\");\n } else {\n enemies.get(i).setDelay(90);\n enemies.get(i).setAnimationState(\"dying left\", \"dead left\");\n }\n if (player.playerBullets.size() > j)\n player.playerBullets.remove(j);\n }\n\n }\n }\n }\n }\n\n for (int j = 0; j < player.playerBullets.size(); j++) {\n Bullet bul = player.playerBullets.get(j);\n for (int k = 0; k < currentRoom.collisionArray.size(); k++) {\n if (bul.collidesWith(currentRoom.collisionArray.get(k))) {\n player.playerBullets.remove(j);\n break;\n }\n }\n }\n\n currentRoom.update();\n\n if (queuedRoom != null) {\n queuedRoom.update();\n\n if (queuedRoom.getDoneFading() && currentRoom.getDoneFading()) {\n\n queuedRoom.setDoneFading(false);\n currentRoom.setDoneFading(false);\n if(queuedRoom == bossLevel){\n backgroundMusic.stop();\n bossLevel.intro();\n }\n currentRoom = queuedRoom;\n enemies = currentRoom.enemies;\n queuedRoom = null;\n transitionPhase = false;\n currentQuestObjective = 0;\n }\n }\n }\n if (keyCount > 0){\n currentQuestObjective = 1;\n }\n else if(currentRoom == bossLevel){\n currentQuestObjective = 2;\n }\n\n if(bossLevel != null) {\n if (bossLevel.endgame == true) {\n state = STATE.COMPLETE;\n System.out.println(\"you won!\");\n quitButton.setPositionX(300);\n\n }\n }\n }", "boolean testMoveBullet(Tester t) {\n return t.checkExpect(bullet1.move(),\n new Bullet(2, Color.PINK, new MyPosn(250, 292), new MyPosn(0, -8), 1))\n && t.checkExpect(bullet2.move(),\n new Bullet(2, Color.PINK, new MyPosn(650, 650), new MyPosn(50, 50), 1));\n }", "public void tick() {\n boolean shouldHaltAfterTick = false;\n\n List<Pair<Movement, Bullet>> movements = new ArrayList<>();\n\n //Bullets on nodes\n Map<Coordinate, Bullet> capturedBullets = new HashMap<>(bullets);\n capturedBullets.keySet().retainAll(nodes.keySet());\n\n //Bullets not on nodes\n Map<Coordinate, Bullet> freeBullets = new HashMap<>(bullets);\n freeBullets.keySet().removeAll(capturedBullets.keySet());\n\n //Generate movements for free bullets\n for (Map.Entry<Coordinate, Bullet> entry : freeBullets.entrySet()) {\n Bullet bullet = entry.getValue();\n Coordinate coord = entry.getKey();\n Coordinate newCoord = entry.getKey().plus(bullet.getDirection()).wrap(width, height);\n movements.add(new Pair<>(new Movement(coord, newCoord), bullet));\n }\n\n //Update captured bullets\n for (Map.Entry<Coordinate, Bullet> entry : capturedBullets.entrySet()) {\n Coordinate coordinate = entry.getKey();\n INode node = nodes.get(coordinate);\n\n // special case\n if (node instanceof NodeHalt)\n shouldHaltAfterTick = true;\n\n //TODO this brings great shame onto my family\n Direction bulletDirection = entry.getValue().getDirection();\n Direction dir = Direction.UP;\n while (dir != node.getRotation()) {\n dir = dir.clockwise();\n bulletDirection = bulletDirection.antiClockwise();\n }\n Bullet bullet = new Bullet(bulletDirection, entry.getValue().getValue());\n\n Map<Direction, BigInteger> bulletParams = node.run(bullet);\n\n for (Map.Entry<Direction, BigInteger> newBulletEntry : bulletParams.entrySet()) {\n //TODO this too\n bulletDirection = newBulletEntry.getKey();\n dir = Direction.UP;\n while (dir != node.getRotation()) {\n dir = dir.clockwise();\n bulletDirection = bulletDirection.clockwise();\n }\n\n Bullet newBullet = new Bullet(bulletDirection, newBulletEntry.getValue());\n Coordinate newCoordinate = coordinate.plus(newBullet.getDirection()).wrap(width, height);\n Movement movement = new Movement(coordinate, newCoordinate);\n movements.add(new Pair<>(movement, newBullet));\n }\n }\n\n //Remove swapping bullets\n List<Movement> read = new ArrayList<>();\n Set<Coordinate> toDelete = new HashSet<>();\n for (Pair<Movement, Bullet> pair : movements) {\n Movement movement = pair.getKey();\n Coordinate from = movement.getFrom();\n Coordinate to = movement.getTo();\n boolean foundSwaps = read.stream().anyMatch(other -> from.equals(other.getTo()) && to.equals(other.getFrom()));\n if (foundSwaps) {\n toDelete.add(from);\n toDelete.add(to);\n }\n read.add(movement);\n }\n movements.removeIf(pair -> toDelete.contains(pair.getKey().getFrom()) || toDelete.contains(pair.getKey().getTo()));\n\n //Remove bullets that end in the same place\n read.clear();\n toDelete.clear();\n for (Pair<Movement, Bullet> pair : movements) {\n Movement movement = pair.getKey();\n Coordinate to = movement.getTo();\n boolean foundSameFinal = read.stream().anyMatch(other -> to.equals(other.getTo()));\n if (foundSameFinal) {\n toDelete.add(to);\n }\n read.add(movement);\n }\n movements.removeIf(pair -> toDelete.contains(pair.getKey().getTo()));\n\n //Move bullets\n Map<Coordinate, Bullet> newBullets = new HashMap<>();\n for (Pair<Movement, Bullet> pair : movements) {\n Movement movement = pair.getKey();\n Bullet bullet = pair.getValue();\n newBullets.put(movement.getTo(), bullet);\n }\n\n bullets.clear();\n bullets.putAll(newBullets);\n\n if (shouldHaltAfterTick)\n halt();\n }", "private void updateEnemies()\n\t \n\t {\n\t for(int i = 0; i < EnemyList.size(); i++)\n\t {\n\t \t//get and update enemy for the enemy list\n\t Enemy eh = EnemyList.get(i);\n\t eh.Update();\n\t \n\t //checks for enemy and player crashes \n\t Rectangle playerRectangel = new Rectangle(pl.xCoord, pl.yCoord, pl.PlayerImage.getWidth(), pl.PlayerImage.getHeight());\n\t Rectangle enemyRectangel = new Rectangle(eh.xCoord, eh.yCoord, eh.EnemyHelicopterImage.getWidth(), eh.EnemyHelicopterImage.getHeight());\n\t if(playerRectangel.intersects(enemyRectangel)){\n\t \n\t \t//set player health to zero\n\t \tpl.Health = 0;\n\t \n\t // Remove helicopter from the list.\n\t EnemyList.remove(i);\n\t \n\t //creates new explosion coordinates \n\t enExplosionX = eh.xCoord; \n\t enExplosionY = eh.yCoord; \n\t plExplosionX = pl.xCoord+120;\n\t plExplosionY = pl.yCoord;\n\t GameOn = false;\n\t \n\t }\n\t \n\t // Check health.\n\t if(eh.Health <= 0){\n\t \n\t // Increase the number of destroyed enemies and removes a helicopter froma list.\n\t DestroyedEnemies++;\n\t \n\t \n\t if(DestroyedEnemies == 10)\n\t {\n\t \t//WinsState = true; \n\t \t\n\t }\n\t EnemyList.remove(i);\n\t \n\t }\n\t \n\t // If the current enemy has left the scree it is removed from the list and the number of runAwayEnemies is increased.\n\t if(eh.HasLeftScreen())\n\t {\n\t \tEnemyList.remove(i);\n\t RunAwayEnemies++;\n\t }\n\t \n\t if(RunAwayEnemies > 5)\n\t {\n\t \tGameOn = false; \n\t \t\n\t }\n\t }\n\t \n\t }", "public void update(ArrayList<Bullet> projectileList, ArrayList<ZOrderableSprite> zOrderableSpriteList) {\n\n // Increment AI timer\n aiTimer += Gdx.graphics.getDeltaTime();\n aiTimer2 += Gdx.graphics.getDeltaTime();\n // Increment attack timer\n attackTimer += Gdx.graphics.getDeltaTime();\n // 0: Random Walking AI: the enemie will either stay idle or walk around randomly\n if(aiType == 0) {\n // hostile: false\n randomWalkingAI(false, null, null);\n }\n /*\n 1: Hostile random Walking AI: the enemie will attack the player is close enough,\n else the enemie will either stay idle or walk around randomly\n */\n else if(aiType == 1) {\n // Hostile\n randomWalkingAI(true, projectileList, zOrderableSpriteList);\n }\n\n // Update animations\n animation.update();\n\n // Update particles\n updateParticles();\n\n // Update enemie position\n updatePosition();\n\n // Update hp bar\n hpBar.update(currentHp, maximumHp, currentShield, maximumShield);\n hpBar.updatePosition(hitbox.getX(), hitbox.getY() - 7);\n\n // Enemie will shine red light when damaged\n\t\tif(colorValue < 1) {\n\t\t\tcolorValue += Gdx.graphics.getDeltaTime() * 2;\n\t\t}\n }", "public void draw() {\n if (you.health() > 0 | lives >= 0) {\n if (aliens.isEmpty()) {\n win();\n }\n if (you.health() <= 0 & lives >= 0) {\n die();\n }\n \n you.act();\n \n if (fire & you.getWeapon() == Weapon.WEAPON_GOD) {\n for (Dot d : you.fire()) {\n this.moreBullets(d);\n }\n }\n for (Dot d : lazers){d.update(); d.draw(page);}\n for (Dot d : bullets) {d.update(); d.draw(page);}\n for (Alien loop : aliens) {\n loop.act();\n if (Math.random() > .993) {\n for (Dot d : loop.fire())\n lazers.add(d);\n }\n loop.draw(page);\n }\n \n if (collisionCheck() | fl) {\n flash();\n fl = !fl;\n }\n \n int index1 = 0, index2 = 0, size1 = bullets.size(), size2 = aliens.size();\n for (Alien al : aliens) {\n index2 = 0;\n while (index2 < size1) {\n if (al.collide(bullets.get(index2))) {\n bullets.remove(index2);\n size1--;\n score += 10;\n }\n index2++;\n }\n }\n\n index1 = 0; size1 = aliens.size();\n while (index1 < size1) {\n if (aliens.get(index1).health() <= 0) {\n aliens.remove(index1);\n index1--;\n size1--;\n score += 25;\n }\n index1++;\n }\n \n for (Dot d : lazers) {\n if (d.getX() < 0 | d.getX() > 512 | d.getY() < 0 | d.getY() > 496) {\n d.deactivate();\n }\n }\n index1 = 0; size1 = lazers.size();\n while (index1 < size1) {\n if (!lazers.get(index1).isActive()) {\n lazers.remove(index1);\n size1--;\n index1--;\n }\n index1++;\n }\n \n for (Dot d : bullets) {\n if (d.getX() < 0 | d.getX() > 512 | d.getY() < 0 | d.getY() > 512) {\n d.deactivate();\n }\n }\n index1 = 0; size1 = bullets.size();\n while (index1 < size1) {\n if (!bullets.get(index1).isActive()) {\n bullets.remove(index1);\n size1--;\n index1--;\n }\n index1++;\n }\n \n for (int i = 0; i < lives; i++) {\n page.drawImage(you.getImage(), i*20, 496, 16, 16, null);\n }\n page.setColor(Color.white);\n page.drawString(\"\" + you.health(), 420, 509);\n page.drawString(\"\" + score, 450, 509);\n you.draw(page);\n }\n else {\n lose();\n }\n }", "private void enemiesWillShoot(Graphics2D g2d, GameState state) {\n if (numOfRenderShoot == 75) {\n numOfRenderShoot = 0;\n for (int i = 0; i < state.getEnemyTanks().size(); i++) {\n if (state.getEnemyTanks().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyTanks().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyTanks().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyTanks().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyMissiles().add(new EnemyMissile(this, state, 10\n , state.getEnemyTanks().get(i)));\n state.getEnemyMissiles().get(state.getEnemyMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n for (int i = 0; i < state.getEnemyCars().size(); i++) {\n if (state.getEnemyCars().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyCars().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyCars().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyCars().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyBullets().add(new EnemyBullet(this, state, 20\n , state.getEnemyCars().get(i)));\n state.getEnemyBullets().get(state.getEnemyBullets().size() - 1).bulletDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n for (int i = 0; i < state.getEnemyWallTurrets().size(); i++) {\n if (state.getEnemyWallTurrets().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyWallTurrets().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyWallTurrets().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyWallTurrets().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyWallTurretMissiles().add(new EnemyWallTurretMissile(this, state, 15\n , state.getEnemyWallTurrets().get(i)));\n state.getEnemyWallTurretMissiles().get(state.getEnemyWallTurretMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n\n for (int i = 0; i < state.getEnemyTurrets().size(); i++) {\n if (state.getEnemyTurrets().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyTurrets().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyTurrets().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyTurrets().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyHomingMissiles().add(new EnemyHomingMissile(this, state, 15\n , state.getEnemyTurrets().get(i)));\n state.getEnemyHomingMissiles().get(state.getEnemyHomingMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n }\n for (EnemyMissile enemyMissile : state.getEnemyMissiles()) {\n enemyMissile.paint(g2d, state);\n }\n for (EnemyBullet enemyBullet : state.getEnemyBullets()) {\n enemyBullet.paint(g2d, state);\n }\n for (EnemyWallTurretMissile enemyWallTurretMissile : state.getEnemyWallTurretMissiles()) {\n enemyWallTurretMissile.paint(g2d, state);\n }\n for (EnemyHomingMissile enemyHomingMissile : state.getEnemyHomingMissiles()) {\n enemyHomingMissile.paint(g2d, state);\n }\n }", "public void onHitByBullet() {\r\n\t\t// Move ahead 100 and in the same time turn left papendicular to the bullet\r\n\t\tturnAheadLeft(100, 90 - hitByBulletBearing);\r\n\t}", "private void multiBulletFire() {\n\n\t\tbulletArrayList.add(new Bullet(xPosition + ((width / 2) - bulletWidth / 2) + 20, bulletYPosition, bulletWidth,\n\t\t\t\tbulletHeight, \"Blue\"));\n\t\tbulletArrayList.add(new Bullet(xPosition + ((width / 2) - bulletWidth / 2) - 10, bulletYPosition, bulletWidth,\n\t\t\t\tbulletHeight, \"Blue\"));\n\t\tbulletArrayList.add(new Bullet(xPosition + ((width / 2) - bulletWidth / 2) + 50, bulletYPosition, bulletWidth,\n\t\t\t\tbulletHeight, \"Blue\"));\n\t}", "public void update(Rectangle floor, ArrayList<Enemy> enemies, Player player) {\n\t\tfor(int i = 0; i < pBullets.size(); ++i) {\t\t\t\n\t\t\tBullet b = pBullets.get(i);\n\t\t\t\n\t\t\tb.update();\n\t\t\t\n\t\t\t\n\t\t\t/* elimina/rimuove il proiettile se avviene un collisione \n\t\t\t * con le mura o con un nemico, nel secondo caso decrementa anche \n\t\t\t * la vita del nemico*/\n\t\t\tif(!floor.contains(b))\n\t\t\t\tpBullets.remove(i);\n\t\t\telse {\n\t\t\t\t/* scorro i nemici*/\n\t\t\t\tfor(Enemy e: enemies) {\n\t\t\t\t\tif( e.contains(b) ){\n\t\t\t\t\t\te.damage(b.getDamage());\n\t\t\t\t\t\tpBullets.remove(i);\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* controllo collisioni proiettili Enemy */\n\t\tfor(int i = 0; i < eBullets.size(); ++i) {\n\t\t\tBullet b = eBullets.get(i);\n\t\t\tb.update();\n\t\t\t\n\t\t\tif(!floor.contains(b))\n\t\t\t\teBullets.remove(i);\n\t\t\t\n\t\t\telse if(player.contains(b)) {\n\t\t\t\tplayer.damage(b.getDamage());\n\t\t\t\teBullets.remove(i);\n\t\t\t}\n\t\t}\n\t\t\n\t}", "private void bulletCollisionWithObject() {\r\n\t\tif(bullet != null) {\r\n\t\t\tGObject collider = getElementAt(bullet.getX() -1 , bullet.getY() + 1);\r\n\t\t\tif (dragon1 != null && collider == dragon1) {\r\n\t\t\t\thit(dragon1);\r\n\t\t\t}\r\n\t\t\tif(dragon2 != null && collider == dragon2) {\r\n\t\t\t\thit(dragon2);\r\n\t\t\t}\r\n\t\t\tif(mehran != null && collider == mehran && bullet.getY() > mehran.getY() + mehran.getHeight() / 2.0) {\r\n\t\t\t\thit(mehran);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void onBulletHit(BulletHitEvent event) {\n RobotReference hitRobot;\n hitRobot = robots.get(event.getName());\n\n if (hitRobot.isTeammate()) {\n setTurnRight(90);\n setAhead(400);\n setChargerTarget();\n }\n }", "public void update(int delta)\n\t{\n\t\tpause = Math.max(0, pause - 1);\n\t\tfor(int i = 0; i < bullets.size(); i++)\n\t\t{\n\t\t\tboolean shoot = bullets.get(i).updateBullet(delta);\n\t\t\tif(shoot)\n\t\t\t{\n\t\t\t\t//bullets.get(i).killInstance();\n\t\t\t\tbullets.remove(i);\n\t\t\t}\n\t\t}\n\t}", "public static void checkAvatarBulletCollision(List<Node> aB, Node fE, Node sE, Node tE, Node foE, Node fiE, Node siE, Node seE, Node eiE, Node niE, Node tenE, Node eleE, Node tweE, Node thE, Node fouE, Node fifE, Pane p)\r\n\t{\r\n\t\tfor(Node avatarBullet : aB)\r\n\t\t{\r\n\t\t\tif(fE.getBoundsInParent().intersects(avatarBullet.getBoundsInParent()))\r\n\t\t\t{\r\n\t\t\t\t//remove enemy\r\n\t\t\t\tfE.setTranslateX(-200);\r\n\t\t\t\tp.getChildren().remove(fE);\r\n\t\t\t\tsetEnemyOne(true);\r\n\t\t\t\tplayerScore++;\r\n\t\t\t}\r\n\t\t\tif(sE.getBoundsInParent().intersects(avatarBullet.getBoundsInParent()))\r\n\t\t\t{\r\n\t\t\t\tsE.setTranslateX(-200);\r\n\t\t\t\tp.getChildren().remove(sE);\r\n\t\t\t\tsetEnemyTwo(true);\r\n\t\t\t\tplayerScore++;\r\n\t\t\t}\r\n\t\t\tif(tE.getBoundsInParent().intersects(avatarBullet.getBoundsInParent()))\r\n\t\t\t{\r\n\t\t\t\ttE.setTranslateX(-200);\r\n\t\t\t\tp.getChildren().remove(tE);\r\n\t\t\t\tsetEnemyThree(true);\r\n\t\t\t\tplayerScore++;\r\n\t\t\t}\r\n\t\t\tif(foE.getBoundsInParent().intersects(avatarBullet.getBoundsInParent()))\r\n\t\t\t{\r\n\t\t\t\tfoE.setTranslateX(-200);\r\n\t\t\t\tp.getChildren().remove(foE);\r\n\t\t\t\tsetEnemyFour(true);\r\n\t\t\t\tplayerScore++;\r\n\t\t\t}\r\n\t\t\tif(fiE.getBoundsInParent().intersects(avatarBullet.getBoundsInParent()))\r\n\t\t\t{\r\n\t\t\t\tfiE.setTranslateX(-200);\r\n\t\t\t\tp.getChildren().remove(fiE);\r\n\t\t\t\tsetEnemyFive(true);\r\n\t\t\t\tplayerScore++;\r\n\t\t\t}\r\n\t\t\tif(siE.getBoundsInParent().intersects(avatarBullet.getBoundsInParent()))\r\n\t\t\t{\r\n\t\t\t\tsiE.setTranslateX(-200);\r\n\t\t\t\tp.getChildren().remove(siE);\r\n\t\t\t\tsetEnemyFive(true);\r\n\t\t\t\tplayerScore++;\r\n\t\t\t}\r\n\t\t\tif(seE.getBoundsInParent().intersects(avatarBullet.getBoundsInParent()))\r\n\t\t\t{\r\n\t\t\t\tseE.setTranslateX(-200);\r\n\t\t\t\tp.getChildren().remove(seE);\r\n\t\t\t\tsetEnemyFive(true);\r\n\t\t\t\tplayerScore++;\r\n\t\t\t}\r\n\t\t\tif(eiE.getBoundsInParent().intersects(avatarBullet.getBoundsInParent()))\r\n\t\t\t{\r\n\t\t\t\teiE.setTranslateX(-200);\r\n\t\t\t\tp.getChildren().remove(eiE);\r\n\t\t\t\tsetEnemyFive(true);\r\n\t\t\t\tplayerScore++;\r\n\t\t\t}\r\n\t\t\tif(niE.getBoundsInParent().intersects(avatarBullet.getBoundsInParent()))\r\n\t\t\t{\r\n\t\t\t\tniE.setTranslateX(-200);\r\n\t\t\t\tp.getChildren().remove(niE);\r\n\t\t\t\tsetEnemyFive(true);\r\n\t\t\t\tplayerScore++;\r\n\t\t\t}\r\n\t\t\tif(tenE.getBoundsInParent().intersects(avatarBullet.getBoundsInParent()))\r\n\t\t\t{\r\n\t\t\t\ttenE.setTranslateX(-200);\r\n\t\t\t\tp.getChildren().remove(tenE);\r\n\t\t\t\tsetEnemyFive(true);\r\n\t\t\t\tplayerScore++;\r\n\t\t\t}\r\n\t\t\tif(eleE.getBoundsInParent().intersects(avatarBullet.getBoundsInParent()))\r\n\t\t\t{\r\n\t\t\t\teleE.setTranslateX(-200);\r\n\t\t\t\tp.getChildren().remove(eleE);\r\n\t\t\t\tsetEnemyFive(true);\r\n\t\t\t\tplayerScore++;\r\n\t\t\t}\r\n\t\t\tif(tweE.getBoundsInParent().intersects(avatarBullet.getBoundsInParent()))\r\n\t\t\t{\r\n\t\t\t\ttweE.setTranslateX(-200);\r\n\t\t\t\tp.getChildren().remove(tweE);\r\n\t\t\t\tsetEnemyFive(true);\r\n\t\t\t\tplayerScore++;\r\n\t\t\t}\r\n\t\t\tif(thE.getBoundsInParent().intersects(avatarBullet.getBoundsInParent()))\r\n\t\t\t{\r\n\t\t\t\tthE.setTranslateX(-200);\r\n\t\t\t\tp.getChildren().remove(thE);\r\n\t\t\t\tsetEnemyFive(true);\r\n\t\t\t\tplayerScore++;\r\n\t\t\t}\r\n\t\t\tif(fouE.getBoundsInParent().intersects(avatarBullet.getBoundsInParent()))\r\n\t\t\t{\r\n\t\t\t\tfouE.setTranslateX(-200);\r\n\t\t\t\tp.getChildren().remove(fouE);\r\n\t\t\t\tsetEnemyFive(true);\r\n\t\t\t\tplayerScore++;\r\n\t\t\t}\r\n\t\t\tif(fifE.getBoundsInParent().intersects(avatarBullet.getBoundsInParent()))\r\n\t\t\t{\r\n\t\t\t\tfifE.setTranslateX(-200);\r\n\t\t\t\tp.getChildren().remove(fifE);\r\n\t\t\t\tsetEnemyFive(true);\r\n\t\t\t\tplayerScore++;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void updatePhysics()\n {\n HashMap<Integer, Spaceship> ships = this.game.getPlayers();\n Collection<Bullet> bullets = this.game.getBullets();\n Collection<Asteroid> asteroids = this.game.getAsteroids();\n\n asteroids.forEach(GameObject::nextStep);\n bullets.forEach(GameObject::nextStep);\n for (Spaceship ship : ships.values()) {\n if (ship.isDestroyed()) continue;\n ship.nextStep();\n\n if (ship.canFireWeapon()) {\n double direction = ship.getDirection();\n bullets.add(\n new Bullet(\n ship.getLocation().getX(),\n ship.getLocation().getY(),\n ship.getVelocity().x + Math.sin(direction) * 15,\n ship.getVelocity().y - Math.cos (direction) * 15\n )\n );\n ship.setFired();\n }\n }\n\n\n this.checkCollisions();\n this.removeDestroyedObjects();\n\n // Every 200 game ticks, try and spawn a new asteroid.\n if (this.updateCounter % 200 == 0 && asteroids.size() < this.asteroidsLimit) {\n this.addRandomAsteroid();\n }\n this.updateCounter++;\n }", "public void defensive_act()\r\n\t{\r\n\t\tBullet closestBullet = IMAGINARY_BULLET;\r\n\t//\tBullet secondClosestBullet = IMAGINARY_BULLET;\r\n\t\t\r\n\t\tActor machines;\r\n\t\tEnumeration<Actor> opponent = ((MachineInfo)data.get(TankFrame.PLAYER_1)).getHashtable().elements();\r\n\t\twhile(opponent.hasMoreElements())\r\n\t\t{\r\n\t\t\tmachines = (Actor) opponent.nextElement();\r\n\t\t\tif(machines instanceof Bullet)\r\n\t\t\t{\r\n\t\t\t\tif(machines.getPoint().distance(getPoint()) < MIN_SHOOT_DISTANCE)\r\n\t\t\t\t{\r\n\t\t\t\t\tclosestBullet = (Bullet)machines;\r\n\t\t\t\t\tLine2D aim = new Line2D.Double(getCenterX(), getCenterY(), closestBullet.getPosX(), closestBullet.getPosY() );\r\n\t\t\t\t\tSystem.out.println(aim.getP1().distance(aim.getP2()));\r\n\t\t\t\t\tif(hasClearPath(aim) && aim.getP1().distance(aim.getP2()) < MIN_SHOOT_DISTANCE)\r\n\t\t\t\t\t\taimAndShoot(aim);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t/*\tif(machines.getPoint().distance(getPoint()) > secondClosestBullet.getPoint().distance(getPoint()) \r\n\t\t\t\t\t&& machines.getPoint().distance(getPoint()) < closestBullet.getPoint().distance(getPoint()))\r\n\t\t\t\t\tsecondClosestBullet = (Bullet)machines;*/\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 * Find the line\r\n\t\t */\r\n\t\t/*if(!closestBullet.equals(IMAGINARY_BULLET))\r\n\t\t{\r\n\t\t\tLine2D bulletPath = new Line2D(getLeftPoint(), closestBullet.getPoint());\r\n\t\t\tLine2D aim = new Line2D(getCenterX(), getCenterY(), (bulletPath.getX2()+bulletPath.getX1())/2,(bulletPath.getY2()+bulletPath.getY1())/2 );\r\n\t\t\tif(hasClearPath(aim) && aim.getP1().distance(aim.getP2()) < MIN_SHOOT_DISTANCE)\r\n\t\t\t\taimAndShoot(aim);\r\n\t\t\t/*bulletPath = new Line2D(getRightPoint(), closestBullet.getPoint());\r\n\t\t\taim = new Line2D(posX, posY, (bulletPath.getX2()+bulletPath.getX1())/2,(bulletPath.getY2()+bulletPath.getY1())/2 );\r\n\t\t\tif(hasClearPath(aim))\r\n\t\t\t\taimAndShoot(aim);\r\n\t\t\tbulletPath = new Line2D(getPoint(), closestBullet.getPoint());\r\n\t\t\taim = new Line2D(posX, posY, (bulletPath.getX2()+bulletPath.getX1())/2,(bulletPath.getY2()+bulletPath.getY1())/2 );\r\n\t\t\tif(hasClearPath(aim))\r\n\t\t\t\taimAndShoot(aim);*/\r\n\t\t\t\r\n\t\t//}\r\n\t/*\tif(!secondClosestBullet.equals(IMAGINARY_BULLET))\r\n\t\t{\r\n\t\t\tLine2D bulletPath = new Line2D(getLeftPoint(), secondClosestBullet.getPoint());\r\n\t\t\tLine2D aim = new Line2D(posX, posY, (bulletPath.getX2()+bulletPath.getX1())/2,(bulletPath.getY2()+bulletPath.getY1())/2 );\r\n\t\t\tif(hasClearPath(aim))\r\n\t\t\t\taimAndShoot(aim);\r\n\t\t}*/\r\n\r\n\t}", "private static void checkCollisions() {\n ArrayList<Entity> bulletsArray = bullets.entities;\n ArrayList<Entity> enemiesArray = enemies.entities;\n for (int i = 0; i < bulletsArray.size(); ++i) {\n for (int j = 0; j < enemiesArray.size(); ++j) {\n if (j < 0) {\n continue;\n }\n if (i < 0) {\n break;\n }\n Entity currentBullet = bulletsArray.get(i);\n Entity currentEnemy = enemiesArray.get(j);\n if (Collision.boxBoxOverlap(currentBullet, currentEnemy)) {\n ++player.hiScore;\n if (currentBullet.collided(currentEnemy)) {\n --i;\n }\n if (currentEnemy.collided(currentBullet)) {\n --j;\n }\n }\n }\n }\n textHiScore.setString(\"HISCORE:\" + player.hiScore);\n\n // Check players with bonuses\n ArrayList<Entity> bonusArray = bonus.entities;\n for (int i = 0; i < bonusArray.size(); ++i) {\n Entity currentBonus = bonusArray.get(i);\n if (Collision.boxBoxOverlap(player, currentBonus)) {\n if (currentBonus.collided(player)) {\n --i;\n player.collided(currentBonus);\n }\n }\n }\n }", "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 }", "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 }", "private void killBullet() {\r\n this.dead = true;\r\n }", "private void bulletMoveOffScreen() {\r\n\t\tif(bullet != null && (bullet.getX() > getWidth() || bullet.getX() < 0)){\r\n\t\t\tremove(bullet);\r\n\t\t\tbullet = null;\r\n\t\t}\r\n\t}", "public void collisionVS() {\n for (int i = 0; i < enemyBullets.size(); i++) {\n\n enemyBullets.get(i).tick();\n\n if (enemyBullets.get(i).getImgY() >= 750 || enemyBullets.get(i).getImgY() <= 40) {\n\n enemyBullets.get(i).bulletImage.delete();\n enemyBullets.remove(enemyBullets.get(i));\n i--;\n continue;\n }\n\n for (int j = 0; j < spaceShips.size(); j++) {\n\n if (spaceShips.get(j).getHitbox().intersects(enemyBullets.get(i).getHitbox())) {\n\n spaceShips.get(j).hit();\n enemyBullets.get(i).hit();\n enemyBullets.remove(enemyBullets.get(i));\n\n if (spaceShips.get(j).getHp() <= 0) {\n spaceShips.remove(spaceShips.get(j));\n }\n\n //if it collides with one leave the for loop\n i--;\n j = spaceShips.size();\n }\n }\n }\n\n //////////////////////////////////////////////////////////////////////////////////////////////\n\n // SPACESHIPS WITH ENEMIES AND ENEMY BULLETS\n for (int i = 0; i < spaceShips.size(); i++) {\n spaceShips.get(i).tick();\n\n // WITH ENEMIES\n for (int j = 0; j < enemies.size(); j++) {\n if (spaceShips.get(i).getHitbox().intersects(enemies.get(j).getHitbox())) {\n\n spaceShips.get(i).hit();\n enemies.get(j).hit(20);\n enemies.remove(enemies.get(j));\n\n if (spaceShips.get(i).getHp() <= 0) {\n spaceShips.remove(spaceShips.get(i));\n }\n\n //if it collides with one leave the for loop\n j = enemies.size();\n }\n }\n }\n }", "public void onShootPressed(){\n if(player.getRechargeTimer()<=0) {\n playShootingSound();\n Bullet bullet = new Bullet();\n player.setRechargeTimer(shotRechargeTime);\n bullet.moveCentreTo(player.getCentreX(), player.getCentreY());\n bullet.setRotation(player.getRotation());\n bullet.setSpeed(new Point2D(15 * Math.cos(Math.toRadians(bullet.getRotation() - 90)), 15 * Math.sin(Math.toRadians(bullet.getRotation() - 90))));\n if(player.getTripleShotTimer()>0){\n Bullet bullet1 = new Bullet();\n bullet1.moveCentreTo(player.getCentreX(), player.getCentreY());\n bullet1.setRotation(player.getRotation()+15);\n bullet1.setSpeed(new Point2D(15 * Math.cos(Math.toRadians(bullet1.getRotation() - 90)), 15 * Math.sin(Math.toRadians(bullet1.getRotation() - 90))));\n Bullet bullet2 = new Bullet();\n bullet2.moveCentreTo(player.getCentreX(), player.getCentreY());\n bullet2.setRotation(player.getRotation()-15);\n bullet2.setSpeed(new Point2D(15 * Math.cos(Math.toRadians(bullet2.getRotation() - 90)), 15 * Math.sin(Math.toRadians(bullet2.getRotation() - 90))));\n }\n }\n }", "public void attack()\n {\n getWorld().addObject(new RifleBullet(player.getX(), player.getY(), 1, 6, true), getX(), getY()); \n }", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\tprivate void drawListEntity(ArrayList list) {\n\t\tArrayList listRemove = new ArrayList();\n\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\tEntity ent = (Entity) list.get(i);\n\t\t\t\n\t\t\tdrawEntity(ent);\n\t\t\t\n\t\t\t// if the entity is still in the screen, update its position\n\t\t\tif (ent.continueDrawing()) {\n\t\t\t\tif (ent instanceof Bullet) {\n\t\t\t\t\tif (((Bullet) ent).getName().equals(\"bullet\")) {\n\t\t\t\t\t\tent.setX(ent.getX() + ((Bullet) ent).getXChange());\n\t\t\t\t\t\tent.setY(ent.getY() + ((Bullet) ent).getYChange());\n\t\t\t\t\t}\n\t\t\t\t\tif (((Bullet) ent).getName().equals(\"enemy_bullet\")) {\n\t\t\t\t\t\tent.setY(ent.getY() + 8);\n\t\t\t\t\t}\n\t\t\t\t\tif (((Bullet) ent).getName().equals(\"laser\")) {\n\t\t\t\t\t\tlistRemove.add(list.get(i));\n\t\t\t\t\t}\n\t\t\t\t\tif (((Bullet) ent).getName().equals(\"boss_bullet\")) {\n\t\t\t\t\t\tent.setX(ent.getX() + ((Bullet) ent).getXChange());\n\t\t\t\t\t\tent.setY(ent.getY() + ((Bullet) ent).getYChange());\n\t\t\t\t\t}\n\t\t\t\t} else if (ent instanceof Enemy) {\n\t\t\t\t\tif (((Enemy) ent).getName().equals(\"green_box\")) {\n\t\t\t\t\t\tent.setY(ent.getY() + 5);\n\t\t\t\t\t}\n\t\t\t\t\tif (((Enemy) ent).getName().equals(\"red_box\")) {\n\t\t\t\t\t\tent.setY(ent.getY() + 3);\n\t\t\t\t\t}\n\t\t\t\t\tif (((Enemy) ent).getName().equals(\"boss\") && bossExplosionNum == 0) {\n\t\t\t\t\t\tif (ent.getX() <= 0)\n\t\t\t\t\t\t\tbossMovement = 3;\n\t\t\t\t\t\tif (ent.getX() >= displayWidth - ((Enemy) ent).getSprite().getWidth())\n\t\t\t\t\t\t\tbossMovement = -3;\n\t\t\t\t\t\tif (ent.getY() <= 30)\n\t\t\t\t\t\t\tent.setY(ent.getY() + 1);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tent.setX(ent.getX() + bossMovement);\n\t\t\t\t\t}\n\t\t\t\t} else if (ent instanceof Explosion) {\n\t\t\t\t\tif (((Explosion) ent).getName().equals(\"player_hit\")) {\n\t\t\t\t\t\tent.setX(((Explosion) ent).getEntity().getX());\n\t\t\t\t\t\tent.setY(((Explosion) ent).getEntity().getY());\n\t\t\t\t\t} else if (((Explosion) ent).getName().equals(\"enemy_hit\")) {\n\t\t\t\t\t\tent.setX(((Explosion) ent).getEntity().getX() - 5);\n\t\t\t\t\t\tent.setY(((Explosion) ent).getEntity().getY() - 5);\n\t\t\t\t\t}\n\t\t\t\t} else if (ent instanceof Powerup) {\n\t\t\t\t\tent.setY(ent.getY() + 4);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// else if the entity is outside of the screen, remove it\n\t\t\telse {\n\t\t\t\tlistRemove.add(list.get(i));\n\t\t\t\t\n\t\t\t\t// handles the boss explosions\n\t\t\t\thandleBossExplosions(list, listRemove, i);\n\t\t\t}\n\t\t\t\n\t\t\t// if the player is dead, notify the player of death\n\t\t\tif (stopDrawingPlayer || gameWon) {\n\t\t\t\tnotifyGameOver();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < listRemove.size(); i++) {\n\t\t\tlist.remove(listRemove.get(i));\n\t\t}\n\t\tlistRemove.clear();\n\t}", "private void tick() {\n\n if (StateManager.getState() != null) {\n StateManager.getState().tick();\n }\n this.backgroundFrames--;\n if (this.backgroundFrames == 0) {\n this.backgroundFrames = Const.TOTAL_BACKGROUND_FRAMES;\n }\n//Check all changed variables for the player\n player.tick();\n long elapsed = (System.nanoTime() - time) / (Const.DRAWING_DELAY - (4000 * Enemy.getDifficulty()));\n//Check if enough time is passed to add new enemy or if spawnSpot is available\n if (elapsed > (this.delay - Enemy.getDifficulty() * 300)&& Road.isSpotAvailable()) {\n enemies.add(new Enemy());\n time = System.nanoTime();\n }\n//Loop for checking all changed variables for the enemies and check if they intersects with the player\n for (int j = 0; j < enemies.size(); j++) {\n enemies.get(j).tick();\n if(enemies.get(j).getY() > Const.ROAD_BOTTOM_BORDER + 200){\n Road.getOccupiedSpawnPoints()[Const.SPAWN_POINTS.indexOf(enemies.get(j).getX())] = false;\n player.setScore(player.getScore() + 50);\n enemies.remove(j);\n continue;\n }\n enemyBoundingBox = enemies.get(j).getEnemyRectangle();\n if (player.getBoundingBox().intersects(enemyBoundingBox)) {\n reset();\n if(player.getLives() == 0){\n gameOver();\n }\n break;\n }\n }\n }", "private void shoot()\n\t{\n\t\t//Speed movement of the bullet\n\t\tint speed = 0;\n\t\t//Damage dealt by the bullet\n\t\tint damage = 0;\n\t\t//Angle used to shoot. Used only by the vulcan weapon\n\t\tdouble angle = 0;\n\t\t\n\t\tif(weapon == PROTON_WEAPON)\n\t\t{\n\t\t\tspeed = 15;\n\t\t\tdamage = 10;\n\t\t\tbulletPool.getBulletPool(weapon).getBullet(getX()+37, getY()-this.getHeight()+30, speed, damage, 0);\n\t\t\tSoundManager.getInstance().playSound(\"protonshoot\", false);\n\t\t}\t\n\t\telse if(weapon == VULCAN_WEAPON)\n\t\t{\n\t\t\tspeed = 15;\n\t\t\tdamage = 2;\n\t\t\tangle = 10;\n\t\t\t\n\t\t\tbulletPool.getBulletPool(weapon).getThreeBullets(getX() +27, getX()+37, getX()+47,\n\t\t\t\t\tgetY()-this.getHeight()+30, speed, damage, (int)angle);\n\t\t\tSoundManager.getInstance().playSound(\"vulcanshoot\", false);\n\t\t}\t\t\n\t\telse\n\t\t{\n\t\t\tspeed = 15;\n\t\t\tdamage = 15;\n\t\t\tangle = 0;\n\t\t\t\n\t\t\tbulletPool.getBulletPool(weapon).getBullet(getX()+37, getY()-this.getHeight()+30,\n\t\t\t\t\t\tspeed, damage, angle);\n\t\t\tSoundManager.getInstance().playSound(\"gammashoot\", false);\n\t\t}\t\n\t}", "void collisionDetection() {\n\t\tfor (int a = 0; a < botsList.size(); a++) {\r\n\t\t\tfor (int b = 0; b < botsList.size(); b++) {\r\n\r\n\t\t\t\tif (a == b) // Avoid checking if bot hits itself.\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\ttime = System.currentTimeMillis();\r\n\t\t\t\tif (time - botsList.get(a).enemy_last_detected > botsList.get(a).enemy_detect_timeout) {\r\n\t\t\t\t\tfor (int i = 0; i > botsList.get(b).bullets.size(); i++) {\r\n\t\t\t\t\t\tif (colides(botsList.get(a), botsList.get(b).bullets.get(i)))\r\n\t\t\t\t\t\t\tbotsList.get(a).loseLife();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (botsList.get(0).detect.intersects(botsList.get(1).body.getFrame())) {\r\n\t\t\tbotsList.get(0).enemyDetected(botsList.get(1).body);\r\n\t\t\tbot_1_detect = false;\r\n\t\t\tbot_1_detected = System.currentTimeMillis();\r\n\t\t}\r\n\t\tif (System.currentTimeMillis() - bot_1_detected > bot_1_detect_timeout)\r\n\t\t\tbot_1_detect = true;\r\n\t\t// and now same for bot 2\r\n\t\tif (botsList.get(1).detect.intersects(botsList.get(0).body.getFrame())) {\r\n\t\t\tbotsList.get(1).enemyDetected(botsList.get(0).body);\r\n\t\t\tbot_2_detect = false;\r\n\t\t\tbot_2_detected = System.currentTimeMillis();\r\n\t\t}\r\n\t\tif (System.currentTimeMillis() - bot_2_detected > bot_2_detect_timeout)\r\n\t\t\tbot_2_detect = true;\r\n\r\n\t\t// Bullets collision\r\n\t\t// See if bot_n hits the other bot with a bullet\r\n\t\tfor (int mainB = 0; mainB < botsList.size(); mainB++) {\r\n\t\t\tfor (int secB = 0; secB < botsList.size(); secB++) {\r\n\r\n\t\t\t\tif (secB == mainB)\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t// if player_2 collides with player 1's bullets\r\n\t\t\t\tfor (int i = 0; i < botsList.get(mainB).bullets.size(); i++) {\r\n\t\t\t\t\tif (colides(botsList.get(secB), botsList.get(mainB).bullets.get(i))) {\r\n\t\t\t\t\t\tSystem.out.println(\"Bot \" + 2 + \" intersects bullet nš \" + i);\r\n\t\t\t\t\t\tbotsList.get(mainB).bullets.remove(i);\r\n\t\t\t\t\t\tbotsList.get(secB).loseLife();\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 player_1 collides with player 2's bullets\r\n\t\tfor (int i = 0; i < botsList.get(1).bullets.size(); i++) {\r\n\t\t\tif (colides(botsList.get(0), botsList.get(1).bullets.get(i))) {\r\n\t\t\t\tSystem.out.println(\"Bot \" + 2 + \" intersects bullet nš \" + i);\r\n\t\t\t\tbotsList.get(1).bullets.remove(i);\r\n\t\t\t\tbotsList.get(0).loseLife();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "void update(List<IProjectile> projectilesList, float newAgle, boolean hasTarget);", "public void tick()\n{\n y+=speed;\n\n for(int i=0; i<game.ea.size(); i++)\n {\n EntityA tempEnt= game.ea.get(i);\n if(Physics.Coliision(this,tempEnt))\n {\n c.removeEntity(tempEnt); //zeby po trafieniu znikal pocisk\n c.removeEntity(this);\n game.setEnemy_killed(game.getEnemy_killed()+1);\n\n }\n }\n\n/*\n* If Enemy is out of bounds player get - points\n* and loses some stamina.\n*\n* Enemies are removed from list after disapears\n */\n\n if(y>(App.getHEIGHT()-20)*2)\n {\n App.addHealth(-10);\n App.addPOINTS(-3);\n c.removeEntity(this);\n }\n\n anim.runAnimation();\n\n /*\n * If App is not in game state it doesn't\n * need to have any enemies\n */\n\n if(App.State != App.STATE.GAME)\n {\n delEnemies();\n\n }\n}", "private void updateDelta() {\n\t\tbulletDelta = Delta.getDelta(\"bullet\");\n\t\tenemyDelta = Delta.getDelta(\"enemy\");\n\t}", "private void updateSprites() {\n\t\tpaddle1.setX(paddle1X);\r\n\t\tpaddle1.setY(paddle1Y);\r\n\r\n\t\tpaddle2.setX(paddle2X);\r\n\t\tpaddle2.setY(paddle2Y);\r\n\r\n\t\tball.setX(ballX);\r\n\t\tball.setY(ballY);\r\n\r\n\t\tscore.setVisible(paused);\r\n\t}", "public void update(){\n if(newPlayer.getRunning()) {\n\n if (botborder.isEmpty())\n {\n newPlayer.setRunning(false);\n return;\n }\n if (topborder.isEmpty())\n {\n newPlayer.setRunning(false);\n return;\n }\n\n background.update();\n newPlayer.update();\n\n\n //A threshold that the border can have based on the score\n maxBorderHeight = 30+newPlayer.getScore()/difficulty;\n if (maxBorderHeight > height/4){\n maxBorderHeight = height/4;\n minBorderHeight = 5+newPlayer.getScore()/difficulty;\n }\n\n for (int i = 0; i < topborder.size(); i++){\n if (collision(topborder.get(i), newPlayer)){\n newPlayer.setRunning(false);\n }\n }\n for (int i = 0; i < botborder.size(); i++){\n if (collision(botborder.get(i), newPlayer)){\n newPlayer.setRunning(false);\n }\n }\n\n this.updateTopBorder();\n //Create the borders\n this.updateBotBorder();\n\n //Adds smoke from spaceship from the timer\n long timeElapsed = (System.nanoTime() - outTimer)/1000000;\n if(timeElapsed > 120){\n effect.add(new Effects(newPlayer.getX(), newPlayer.getY()+30)); //Balls will appear out of backside of spaceship.\n outTimer = System.nanoTime();\n }\n for (int i = 0; i < effect.size(); i++){\n //Go through every ball and then update\n effect.get(i).update();\n if (effect.get(i).getX()<-10){\n effect.remove(i); //Removes the balls that are off the screen\n }\n }\n\n //Adds enemies in, first one in middle, rest are random\n long enemyElapsed = (System.nanoTime()- enemyStart)/1000000;\n //Higher the score is, the less delay there is\n if (enemyElapsed> (1500 - newPlayer.getScore()/4)){\n\n if (enemy.size() == 0){\n enemy.add(new Enemy(BitmapFactory.decodeResource(getResources(),R.drawable.enemy1), width+10, height + 50,25, 30, 30, 1));\n }\n else {\n enemy.add(new Enemy(BitmapFactory.decodeResource(getResources(),R.drawable.enemy1), width + 10, (int) (rng.nextDouble()*(height-(maxBorderHeight*2))+maxBorderHeight),25,30, newPlayer.getScore(), 1));\n }\n //Reset Timer\n enemyStart = System.nanoTime();\n\n }\n\n long shipElapsed = (System.nanoTime()-secondaryTimer)/1000000;\n\n\n if (newPlayer.getScore() == 150){\n level = 2;\n }\n\n //Randomised spot for secondary enemy\n if (newPlayer.getScore()%150==0) {\n if (newEnemy.size() == 0) {\n newEnemy.add(new secondaryEnemy(BitmapFactory.decodeResource(getResources(), R.drawable.enemy2), width + 5, (int) (rng.nextDouble() * (height - (maxBorderHeight * 2)) + maxBorderHeight), 32, 26, 5, 1));\n newEnemy.add(new secondaryEnemy(BitmapFactory.decodeResource(getResources(), R.drawable.enemy2), width + 5, (int) (rng.nextDouble() * (height - (maxBorderHeight * 2)) + maxBorderHeight), 32, 26, 5, 1));\n }\n\n secondaryTimer = System.nanoTime();\n }\n\n long thirdElapsed = (System.nanoTime()- tertiaryTimer)/1000000;\n\n if (newPlayer.getScore() == 300){\n level = 3;\n }\n if (level == 3) {\n if (enemyElapsed> (1500 - newPlayer.getScore()/4))\n\n //CHANGE THIS YOU PLEB!!!!\n if (thirdEnemy.size() == 0) {\n thirdEnemy.add(new thirdShip(BitmapFactory.decodeResource(getResources(), R.drawable.longship), width + 10, (int) (rng.nextDouble() * (height - (maxBorderHeight * 2)) + maxBorderHeight), 31, 49, 45, 1));\n } else {\n thirdEnemy.add(new thirdShip(BitmapFactory.decodeResource(getResources(), R.drawable.longship), width + 10, (int) (rng.nextDouble() * (height - (maxBorderHeight * 2)) + maxBorderHeight), 31, 49, newPlayer.getScore()/4, 1));\n }\n\n //Reset Timer\n tertiaryTimer = System.nanoTime();\n }\n\n //Go through every enemy and collision will check if two game objects are colliding.\n for (int i = 0; i < enemy.size(); i++){\n enemy.get(i).update();\n if(collision(enemy.get(i), newPlayer)){\n enemy.remove(i);\n newPlayer.setRunning(false);\n break;\n }\n if (enemy.get(i).getX()<-100){\n enemy.remove(i);\n break;\n }\n }\n\n for (int i = 0; i < newEnemy.size(); i++) {\n newEnemy.get(i).update();\n if (collision(newEnemy.get(i), newPlayer)) {\n newEnemy.remove(i);\n newPlayer.setRunning(false);\n break;\n }\n if (newEnemy.get(i).getX() < -100) {\n newEnemy.remove(i);\n break;\n }\n }\n\n for (int i = 0; i < thirdEnemy.size(); i++) {\n thirdEnemy.get(i).update();\n if (collision(thirdEnemy.get(i), newPlayer)) {\n thirdEnemy.remove(i);\n newPlayer.setRunning(false);\n break;\n }\n if (thirdEnemy.get(i).getX() < -100) {\n thirdEnemy.remove(i);\n break;\n }\n }\n\n }\n else {\n //Reset the acceleration of the player, if not reset then the start death animation will occur and everything will reset\n newPlayer.resetAcceleration();\n if (!reset){\n gamenew = false;\n startDeath = System.nanoTime();\n reset = true;\n disappear = true;\n death = new deathAnimation(BitmapFactory.decodeResource(getResources(),R.drawable.damage), newPlayer.getX(),newPlayer.getY()-30,329,137,1);\n level = 1;\n }\n death.update();\n\n long timeElapsed = (System.nanoTime()-startDeath)/1000000;\n\n //If time has passed and there is no new game yet, then create a new game.\n if (timeElapsed > 2500 && !gamenew){\n newGame();\n }\n\n }\n }", "public void update(){\n if(clearing) {\n attacks.clear();\n attacksToAdd.clear();\n attacksToDelete.clear();\n playerAttackCount = 0;\n clearing = false;\n } else {\n for (AttackObject attack : attacks) {\n attack.update();\n checkAttackCollisionsFor(attack);\n checkAttackReachedEnd(attack);\n if (attack.wasDestroyed()) {\n onAttackDestroyed(attack);\n }\n }\n deleteAttacks();\n addAttacks();\n }\n }", "public void updateCollisions() {\n\n\t\tfor(Sprite sprite : level.sprites()) {\n\t\t\tlevel.sprites().stream().forEach(sprite2 -> handleCollisions(sprite, sprite2));\n\t\t}\n\n\t}", "@Override\n\tpublic void update() {\n\t\tgetInput();\n\t\t\n\t\t//swap 2 guns\n\t\tif(handler.getKeyManager().q) {\n\t\t\tswap(next);\n\t\t\thandler.getKeyManager().q = false;\n\t\t}\n\t\t\n\t\tif(isMoving) {\n\t\t\tSoundEffect.playStep();\n\t\t\t\n\t\t\tanim_run_left.update();\n\t\t\tanim_run_right.update();\n\t\t\t\n\t\t\tif(!penetrating) move();\n\t\t\telse {\n\t\t\t\tx += xMove;\n\t\t\t\ty += yMove;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tanim_run_left.reset();\n\t\t\tanim_run_right.reset();\n\t\t\tSoundEffect.stopStep();\n\t\t}\n\t\t\n\t\t//check direction\n\t\theadingRight = (mouseX >= x - handler.getCamera().getxOffset() + getWidth() / 2);\n\t\t\n\t\trotateHands((double) (mouseX - (x - handler.getCamera().getxOffset() + getWidth() / 2)), \n\t\t\t\t (double) ((y - handler.getCamera().getyOffset() + getHeight() / 2) - mouseY));\n\t\t\n\t\t//atk speed\n\t\tif(timer < curr.getDelay()) {\n\t\t\ttimer += System.currentTimeMillis() - lastTime;\n\t\t}\n\t\telse {\n\t\t\ttimer = curr.getDelay();\n\t\t}\n\t\t\n\t\t//if there is no ammo left ==> force reload\n\t\tif (!curr.isShootable()) isReloading = true;\n\t\t\n\t\t//if reloading\n\t\tif(isReloading) {\n\t\t\t//if really need to reload\n\t\t\tif(curr.getCurrAmmo() < curr.getMaxAmmo()) {\n\t\t\t\tif(loading == 0) curr.playReloadSound();\n\t\t\t\t\n\t\t\t\tloading += System.currentTimeMillis() - lastTime;\n\t\t\t\tif(loading >= curr.getReloadTime()) {\n\t\t\t\t\treload();\n\t\t\t\t\tloading = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if full of ammo already ==> cancel reload\n\t\t\telse isReloading = handler.getKeyManager().r = false;\n\t\t}\n\t\t//if not reloading\n\t\telse {\n\t\t\t//if is shooting and able to shoot\n\t\t\tif(isShooting && timer == curr.getDelay()) {\n\t\t\t\tshoot();\n\t\t\t\ttimer = 0;\n\t\t\t}\n\t\t}\n\n\t\tlastTime = System.currentTimeMillis();\n\t\t\n\t\t//set focus\n\t\thandler.getCamera().focusOnEntity(this);\n\t}", "public void keyPressed(KeyEvent e) {\n char key = (char) e.getKeyCode(); //acquire the ascii value for the key pressed\r\n boolean redrawScreen = true; // create a boolean variable named redrawScreen to determine whether or not it is necessary to repaint the screen \r\n \r\n // player 2\r\n if (key == e.VK_LEFT) { //if the left arrow key is pressed\r\n player2.moveLeft(arrWalls); // player 2 moves left \r\n } else if (key == e.VK_RIGHT) { //if the right arrow key is pressed\r\n player2.moveRight(arrWalls, size); // player2 moves right \r\n } else if (key == e.VK_UP) { //if the right arrow key is pressed\r\n player2.moveUp(arrWalls); // player2 moves up \r\n } else if (key == e.VK_DOWN) { //if the right arrow key is pressed\r\n player2.moveDown(arrWalls, size); // player2 moves down\r\n } else if (key == 'M') { // if key \"M\" is pressed, player 2 shoots a bullet \r\n if (p2Bullet == null) { // if p2Bullet does not exist on the screen \r\n int x = player2.positionX; // define two temporary variables to store bullet position\r\n int y = player2.positionY;\r\n switch (player2.direction) { // adjust position values so that no matter which direction\r\n case Player.UP: // the player is facing, the bullet always comes out of \r\n y -= 35; // the tip of the gun \r\n x += 10;\r\n break;\r\n case Player.DOWN:\r\n y += 35;\r\n x += 10;\r\n break;\r\n case Player.LEFT:\r\n y += 10;\r\n x -= 35;\r\n break;\r\n case Player.RIGHT:\r\n y += 10;\r\n x += 35;\r\n break;\r\n }\r\n p2Bullet = new Bullet(x, y, player2.direction); // initialize p2Bullet in Bullet class\r\n }\r\n\r\n } \r\n\r\n // player 1\r\n else if (key == 'A') { // if the key \"A\" is pressed\r\n player1.moveLeft(arrWalls); // player 1 moves left\r\n } else if (key == 'D') {// if the key \"A\" is pressed\r\n player1.moveRight(arrWalls, size); // player 1 moves right \r\n } else if (key == 'W') {// if the key \"A\" is pressed\r\n player1.moveUp(arrWalls);// player 1 moves up\r\n } else if (key == 'S') {// if the key \"A\" is pressed\r\n player1.moveDown(arrWalls, size);// player 1 moves down\r\n } else if (key == e.VK_SPACE) { // if space bar is pressed \r\n if (p1Bullet == null) {\r\n int x = player1.positionX;\r\n int y = player1.positionY;\r\n switch (player1.direction) { // same process for player 1\r\n case Player.UP:\r\n y -= 35;\r\n x += 10;\r\n break;\r\n case Player.DOWN:\r\n y += 35;\r\n x += 10;\r\n break;\r\n case Player.LEFT:\r\n y += 10;\r\n x -= 35;\r\n break;\r\n case Player.RIGHT:\r\n y += 10;\r\n x += 35;\r\n break;\r\n }\r\n p1Bullet = new Bullet(x, y, player1.direction);\r\n }\r\n } else if (key == e.VK_ESCAPE || key == 'q') { // if esc is pressed \r\n System.exit(0); //quit the program\r\n } else { // if no key is pressed, nothing changes, thus no need to repaint hte screen \r\n redrawScreen = false;\r\n }\r\n if (redrawScreen) {\r\n repaint(); //refresh the frame\r\n }\r\n }", "@Override\n public void update() {\n for (Integer i : arrAttack) {\n //System.out.println(scene.entityManager.getEntityByID(i).getName());\n\n //if the weapon has not a -1\n if (scene.entityManager.getEntityComponentInstance(i, Tool.class).currentActive != - 1) {\n\n ArrayList<AttackCollider> arrColliders = scene.entityManager.getEntityComponentInstance(i, attackComponent.getClass()).arrColliders;\n\n //Check if it collides with a collidable entity\n for (Integer j : arrCollidable) {\n //if they are not the same and i is not a weapon of j, and if j is alive\n if (!Objects.equals(i, j) && !isWeaponOf(i, j) && scene.entityManager.getEntityComponentInstance(j, Playable.class).isAlive) {\n\n //for each collider that collides with the entity\n for (AttackCollider k : checkAttack(i, j)) {\n //Do something to the collidable entity\n executeAttack(i, j);\n }\n }\n }\n }\n }\n initializeEntities();\n }", "public void update(float delta) {\n\t\tfor(DefenseTower tower : world.getDefenseTowers()) {\n\t\t for(Enemy enemy : world.getEnemies()) {\n\t\t\t if(tower.isPowered() == true && tower.inRange(enemy)) {\n\t\t\t\t\ttower.fireBullets(enemy, delta);\n\t\t\t\t\t//enemy.takeHit(tower.POWER*delta);\n\t\t\t\t\tif(!enemy.isAlive()) {\n\t\t\t\t\t world.getEnemies().removeValue(enemy, false);\n\t\t\t\t\t}\n\t\t\t } \n\t\t\t}\n\t\t}\n\t\n\t\t// Towncentre actions goes here. It shoots enemies here.\n\t\tTownCentre tCentre = world.getTownCentre();\n\t for(Enemy enemy : world.getEnemies()) {\n\t\t if(tCentre.inRange(enemy)) {\n\t\t\t\ttCentre.fireBullets(enemy, delta);\n\t\t\t\t//enemy.takeHit(tCentre.POWER*delta);\n\t\t\t\tif(!enemy.isAlive()) {\n\t\t\t\t world.getEnemies().removeValue(enemy, false);\n\t\t\t\t}\n\t\t } \n\t\t}\n\t \n\t // Soldiers attack enemies here.\n\t for(Soldier s: InstanceManager.getInstance().getSoldiers()) {\n\t \t//s.attackEveryEnemy(delta, InstanceManager.getInstance().getDefenseTowers());\n\t }\n\t\n\t /*for(Enemy enemy : world.getEnemies()) {\n\t\t\tfor(Tower tower : world.getTowers()) {\n\t\t\t if(enemy.inRange(tower)) {\n\t\t\t\t tower.takeHit(enemy.STRENGTH*delta);\n\t\t\t\t //System.out.println(\"tower \" + tower.UID + \"strength is \" + tower.STRENGTH);\n\t\t\t\t if(!tower.isAlive) {\n\t\t\t\t\t \tif(world.getTowers().indexOf(tower, false) !=-1)\n\t\t\t\t\t \t\tactiveTower=-1;\n\t\t\t\t\t world.getTowers().removeValue(tower, false);\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t\t// This makes townCentre take the hit.\n\t\t\tif(enemy.inRange(tCentre) && tCentre.isAlive) {\n\t\t\t\ttCentre.takeHit(enemy.STRENGTH*delta);\n\t\t\t\t //System.out.println(\"TownCenter \" + tCentre.UID + \"strength is \" + tCentre.STRENGTH);\n\t\t\t}\n\t }*/\n\t\t\n\t // Steams attackers attack towers and links here\n\t sAttackers.AttackTowersAndLinks(delta);\n\t\t\n\t\tfor(Tower tower : world.getTowers()) {\n\t\t tower.update(delta);\n\t\t}\n\t\t\n\t\tfor(Enemy enemy : world.getEnemies()) {\n\t\t enemy.update(delta);\n\t\t if(enemy.getPosition().x > 21 && enemy.getPosition().y > 14)\n\t\t \tworld.getEnemies().removeValue(enemy, false);\n\t\t}\n\t\t\n\t\tfor(Person p: InstanceManager.getInstance().getPeople()) {\n\t\t\tp.update(delta);\n\t\t}\n\t\t\n\t\tfor(Soldier s : InstanceManager.getInstance().getSoldiers()) {\n\t\t\ts.update(delta);\n\t\t}\n\t\t\n\t\t// A lot happens here.\n\t\tInstanceManager.getInstance().update(delta);\n\t\t\n\t\tfor(DefenseTower tower : world.getDefenseTowers()) {\n\t\t\ttower.update(delta);\n\t\t}\n\t\t// If game slows down you can limit updation timing here.\n\t\ttCentre.update(delta);\n\t\tgManager.update(delta);\n\t\tworld.update(delta);\n\t\tsController.update();\n\t\t\n }", "private void handleCollisions() {\n\t\t\n\t\tfor (ArrayList<Invader> row : enemyArray) {\n\t\t\tfor (Invader a : row) {\n\t\t\t\tcheckInvaderDeath(a);\n\t\t\t\tcheckPlayerDeath(a);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (Shot s : enemyShotList) {\n\t\t\t\n\t\t\tif (s.detectDownwardCollision(player.getX(), player.getY())) {\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tcollectPowerUp(armorPiercing);\n\t\tcollectPowerUp(explosive);\n\t}", "public void cleanUpBullets() {\n for (int i = 0; i < this.bullets.size(); i++) {\n if (!this.bullets.get(i).visible) {\n this.bullets.remove(i);\n }\n }\n }", "public void updatePosition()\r\n\t{\r\n\t\tsuper.updatePosition();\r\n\t\t\r\n\t\t// Update the bomb's position\r\n\t\tPoint nextPosition = getPath().getLocation(t++);\r\n\t\tsetX(nextPosition.x + startX);\r\n\t\tint nextY = nextPosition.y + startY;\r\n\t\tsetY(nextY);\r\n\t\t\r\n\t\t// Blow the bomb up after it reaches mid screen\r\n\t\tif (t > 120 || (nextY < (Global.WINDOW_HEIGHT >> 1) && t > 30))\r\n\t\t{\r\n\t\t\tbombSound.stop();\r\n\t\t\tsuper.remove();\r\n\t\t\tGamePanel.makeExplosion(getX(), getY());\r\n\t\t\t\r\n\t\t\t// Injure all the enemies on the screen\r\n\t\t\t\r\n\t\t\tArrayList<Sprite> sprites = GamePanel.getSprites();\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < sprites.size(); i++)\r\n\t\t\t{\r\n\t\t\t\tif (sprites.get(i) instanceof Enemy)\r\n\t\t\t\t{\r\n\t\t\t\t\tEnemy enemy = (Enemy) sprites.get(i);\r\n\t\t\t\t\t\r\n\t\t\t\t\tint currentYTop = GamePanel.getLevel().getCurrentY() +\r\n\t\t\t\t\t\tBLOCKS_PER_Y - 1;\r\n\t\t\t\t\tboolean visibleX = enemy.getX() + enemy.getWidth() >= 0 &&\r\n\t\t\t\t\t\tenemy.getX() <= Global.WINDOW_WIDTH;\r\n\t\t\t\t\tboolean yOnScreen = enemy.getY() <= Global.WINDOW_HEIGHT +\r\n\t\t\t\t\t\t100;\r\n\t\t\t\t\tboolean visibleY = enemy.getYBlock() >= currentYTop &&\r\n\t\t\t\t\t\tyOnScreen;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (visibleX && visibleY && enemy.isAlive())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tenemy.offsetHealth(-300);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (enemy.getHealth() <= 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tenemy.remove();\r\n\t\t\t\t\t\t\tGamePanel.offsetNumLevelPoints(100);\r\n\t\t\t\t\t\t\tGamePanel.makeExplosion(enemy.getX(), enemy.getY());\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}\r\n\t}", "public void fireBullet(){\n\t\tBullet bullet = new Bullet(ship);\n\t\tbullets.add(bullet);\n\t\tsoundMan.playBulletSound();\n\t}", "public void shoot(){\r\n \tgame.pending.add(new Bullet(this, bulletlife));\t\r\n }", "void smallgunHandler() {\n for (Sprite smb: smBullets) {\n \n smb.display();\n if(usingCoil){\n smb.forward(120);\n }else{\n smb.forward(40);\n }\n\n }\n}", "private void speedBulletFire() {\n\n\t\tbulletArrayList.add(\n\t\t\t\tnew Bullet(xPosition + ((width / 2) - bulletWidth / 2), bulletYPosition, bulletWidth, bulletHeight, \"Yellow\"));\n\n\t\tfor (int i = 0; i < bulletArrayList.size(); i++) {\n\t\t\tbulletArrayList.get(i).setSpeed(5);\n\t\t}\n\t}", "public void shoot(){\n // boss bullete attract to player\n int bulletPosX = PApplet.parseInt(posX + (speed * cos(angle)));\n int bulletPosY = (int)(posY + hei / 2);\n float bulletAngle = atan2(Main.player.posY - bulletPosY, Main.player.posX - bulletPosX);\n int bulletVelX = (int)(8 * cos(bulletAngle));\n int bulletVelY = (int)(8 * sin(bulletAngle));\n bossBullets.add(new Bullet(bulletPosX,bulletPosY,bulletVelX,bulletVelY,1,attack));\n }", "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 void update() {\n// if (anim > 10000) anim = 0;\n// else anim++;\n setMousePossition();\n if (feildIsRightClicked()) {\n renderClicks = true;\n cannon.FireCannon();\n }\n else renderClicks = false;\n for (int i = 0; i < projectiles.size(); i++) {\n if (projectiles.get(i).isRemoved()) projectiles.remove(i);\n else projectiles.get(i).update();\n }\n }", "public void update() {\n super.update();\n // Code specific to the ship gameObject\n action = ctrl.action();\n direction.rotate(action.turn * STEER_RATE * Constants.DT);\n velocity.addScaled(direction, (MAG_ACC * Constants.DT * action.thrust));\n position.addScaled(velocity, DRAG * Constants.DT);\n position.wrap(Constants.FRAME_WIDTH, Constants.FRAME_HEIGHT);\n\n // Checks if the user is pressing forwards\n if(action.thrust == 1){\n thrusting = true;\n } else{\n thrusting = false;\n }\n time -= 1;\n if(action.shoot && time <= 0){\n mkBullet();\n time = 30;\n }\n\n if(invincible)\n color = Color.blue;\n else\n color = Color.cyan;\n }", "public void isShooting(GameContainer gc) throws LineUnavailableException{\r\n\t\tif(gc.getInput().isKeyPressed(Input.KEY_SPACE) || gc.getInput().isKeyPressed(Input.KEY_UP)){\r\n\t\t\tif(!this.bullet.isMoved()){\r\n\t\t\t\tthis.playSound();\r\n\t\t\t\tanimation = this.shooting;\r\n\t\t\t\tthis.bullet.position.x = super.getShape().getCenterX();\r\n\t\t\t\tthis.bullet.position.y = super.getShape().getCenterY();\r\n\t\t\t\tthis.getBullet().setMoved(true);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(this.getBullet().isMoved()){\r\n\t\t\tthis.bullet.move();\r\n\t\t}\r\n\t}", "protected void cleanBullets() {\n Set<Bullet> recyclable = new HashSet<Bullet>();\n for (Bullet bullet : this.bullets) {\n bullet.update();\n if (bullet.getPositionY() < SEPARATION_LINE_HEIGHT\n || bullet.getPositionY() > this.height)\n recyclable.add(bullet);\n }\n this.bullets.removeAll(recyclable);\n //BulletPool.recycle(recyclable);\n }", "@Override\n public void fireBullet(ArrayList<ScreenObject> level) {\n level.add(new ShipBullet(position.x, position.y, 8, 8, direction));\n }", "public void onHitByBullet(HitByBulletEvent e) {\n\t\t// Paramos tudo o que estamos fazendo.\n\t\tstop();\n\t\tscan(); // Escaneamos para verificar a ocorrência de um inimigo na direção\n\n\t\t// Giramos a arma na direção do disparo\n\t\tdouble turnGunAmt = Utils.normalRelativeAngleDegrees(e.getBearing() + getHeading() - getGunHeading());\n\t\tturnGunRight(turnGunAmt);\n\n\t\tscan(); // Escaneamos para verificar a ocorrência de um inimigo na direção\n\t\tback(400); // Recuamos\n\t}", "boolean testBulletExplode(Tester t) {\n return t.checkExpect(\n new Bullet(2, Color.PINK, new MyPosn(50, 50), new MyPosn(0, -8), 1).explode(),\n new ConsLoGamePiece(new Bullet(4, Color.PINK, new MyPosn(50, 50), new MyPosn(8, 0), 2),\n new ConsLoGamePiece(new Bullet(4, Color.PINK, new MyPosn(50, 50), new MyPosn(-8, 0), 2),\n this.mt)))\n && t.checkExpect(\n new Bullet(4, Color.PINK, new MyPosn(100, 100), new MyPosn(0, 4), 2).explode(),\n new ConsLoGamePiece(\n new Bullet(6, Color.PINK, new MyPosn(100, 100), new MyPosn(4, 0), 3),\n new ConsLoGamePiece(\n new Bullet(6, Color.PINK, new MyPosn(100, 100), new MyPosn(-2, 3), 3),\n new ConsLoGamePiece(\n new Bullet(6, Color.PINK, new MyPosn(100, 100), new MyPosn(-2, -3), 3),\n this.mt))))\n && t.checkExpect(\n new Bullet(2, Color.PINK, new MyPosn(50, 50), new MyPosn(0, -8), -1).explode(),\n new MtLoGamePiece());\n }", "@Override\n public boolean onTouchEvent(MotionEvent event) {\n if(player.getPlaying()) { //if player alive\n switch (event.getAction()) {\n case MotionEvent.ACTION_DOWN: //if finger down...\n bullets.add(new LightningBall(BitmapFactory.decodeResource(getResources(), R.drawable.firebolt), player.getX(), player.getY(), 32, 32)); // shoot bullet\n //store x,y of finger\n movX = event.getX();\n movY = event.getY();\n //store x,y of player\n posX = player.getX();\n posY = player.getY();\n break;\n case MotionEvent.ACTION_MOVE:\n player.setX(posX + (event.getX() - movX)); //set player x,y based on initial player pos, plus the distance finger moves by\n player.setY(posY + (event.getY() - movY));\n\n if ((player.getX() >= WIDTH - 69)) { //right boundry\n player.setX(WIDTH - 71);\n } else if ((player.getX() <= 10)) { //left boundry\n player.setX(11);\n }\n if ((player.getY() >= HEIGHT - 59)) { // bottom boundry\n player.setY(HEIGHT - 61);\n } else if ((player.getY() <= 1)) { //top boundry\n player.setY(3);\n }\n break;\n }\n }\n return true;\n }", "private void shootMove() {\n for (int i = 0; i < fires.size(); i++) {\n //子弹往上移动\n fires.get(i).move();\n //注意这里remove需要放在下面\n if (fires.get(i).y < -1000) {\n fires.remove(fires.get(i));\n }\n }\n\n }" ]
[ "0.771319", "0.741776", "0.73979664", "0.72704697", "0.70813704", "0.7004785", "0.68094397", "0.67985386", "0.6775275", "0.6773134", "0.6746208", "0.6746192", "0.67010754", "0.6636765", "0.66283554", "0.66245687", "0.6563331", "0.65623057", "0.65588605", "0.654165", "0.6532776", "0.64914775", "0.6487172", "0.6447997", "0.64376813", "0.64322406", "0.64084727", "0.6385204", "0.63709944", "0.6365445", "0.63454866", "0.6337228", "0.63369864", "0.6309534", "0.6305127", "0.6301979", "0.6284076", "0.6281443", "0.6257902", "0.6248568", "0.62293166", "0.6181262", "0.6152223", "0.6135575", "0.613412", "0.6124558", "0.6098026", "0.6097589", "0.60926706", "0.609031", "0.6077594", "0.60287565", "0.5990233", "0.5974783", "0.59702414", "0.5952022", "0.59382087", "0.5937051", "0.5919088", "0.5904705", "0.5894074", "0.5877927", "0.5875947", "0.5872235", "0.58659047", "0.5842303", "0.5828396", "0.5820676", "0.5805933", "0.57814205", "0.577939", "0.5773921", "0.5772377", "0.5743433", "0.5741297", "0.5738422", "0.57376915", "0.5733005", "0.57313013", "0.57243013", "0.57170117", "0.5711487", "0.57063043", "0.57011974", "0.5692912", "0.56622976", "0.5656688", "0.5636892", "0.56251556", "0.56246483", "0.56194645", "0.5612158", "0.5611394", "0.560132", "0.55913883", "0.559097", "0.5586388", "0.55324954", "0.5531398", "0.5527063" ]
0.82402515
0
Update rockets. It moves rocket and add smoke behind it. Checks whether the rocket has left the screen. Checks whether any rocket is hit any enemy.
private void UpdateRockets() { for(int i = 0; i < RocketList.size(); i++) { Rocket rocket = RocketList.get(i); // Moves the rocket. rocket.Update(); // Checks if it the rocket has left the screen. if(rocket.HasLeftScreen()) { RocketList.remove(i); } // Checks if current rocket hit any enemy. if( HasRocketHitEnemy(rocket) ) // Removes the rocket RocketList.remove(i); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void checkRockets() {\n for (Rocket rocket : rockets) {\n for (Ufo ufo : ufos) {\n if (ufo.intersects(rocket)) {\n ufo.die();\n rocket.die();\n }\n }\n\n if (rocket.getY() <= 0)\n rocket.die();\n }\n }", "public void updateRover()\n {\n //If reached the end of the simulation\n if(iFrame >= frames.size())\n {\n Rover.getRover().finished();\n }\n //If rover is attempting to go outside the level boundary\n else if (roverX + frames.get(iFrame).x >= MAX_COLUMNS //Too far right\n || roverX + frames.get(iFrame).x < 0 //Too far left\n || roverY + frames.get(iFrame).y >= MAX_ROWS //Too far down\n || roverY + frames.get(iFrame).y < 0) //Too far up\n {\n tilemap[roverX][roverY] = 5; //Draw warning to current position\n System.out.println(\"ERROR: Rover has lost connection to the sattelite!\");\n System.out.println(\" Where are you?!\");\n Rover.getRover().finished();\n }\n else\n { \n //Update tilemap\n //First, remove current rover position\n tilemap[roverX][roverY] = 0;\n \n //Move rover into new position (logic layer)\n roverX += frames.get(iFrame).x;\n roverY += frames.get(iFrame).y;\n \n //Check what exists on tile rover is moving into \n // If safe, move rover into new position (visual layer)\n switch(tilemap[roverX][roverY])\n {\n case 0: //Surface\n tilemap[roverX][roverY] = 1;\n break;\n case 1: //Rover - Safety, shouldn't happen\n tilemap[roverX][roverY] = 1;\n break;\n case 2: //Rock\n tilemap[roverX][roverY] = 5; //Draw warning\n System.out.println(\"CRASH DETECTED\");\n Rover.getRover().finished();\n break;\n case 3: //Mineral\n tilemap[roverX][roverY] = 5; //Draw warning\n System.out.println(\"CRASH DETECTED\");\n Rover.getRover().finished();\n break; \n case 4: //Target\n tilemap[roverX][roverY] = 1;\n System.out.println(\"REACHED TARGET!\");\n break;\n case 5: //Warning - Safety, shouldn't happen\n tilemap[roverX][roverY] = 5;\n System.out.println(\"CRASH DETECTED\");\n Rover.getRover().finished();\n break;\n default://Safety - shouldn't happen\n tilemap[roverX][roverY] = 1;\n break;\n }\n System.out.println(\"UPDATED: \" + roverX + \", \" + roverY); // DEBUG ONLY \n \n iFrame++; //inc framecounter\n } \n repaint(); //repaint level\n }", "private void collision() {\n\t\tfor(int i = 0; i < brownMeteors.length; i++) {\n\t\t\tif( distance(brownMeteors[i].getLayoutX() + ENTITIES_SIZE/2, brownMeteors[i].getLayoutY() - ENTITIES_SIZE/2, \n\t\t\t\t\tplayer.getLayoutX() + ENTITIES_SIZE/2, player.getLayoutY() - ENTITIES_SIZE/2) <= ENTITIES_SIZE) {\n\t\t\t\tsetNewElementPosition(brownMeteors[i]);\n\t\t\t\t\n\t\t\t\t//Update score -\n\t\t\t\tsc.score -= 3 * sc.collisionCounter; \n\t\t\t\tsc.collisionCounter++;\n\t\t\t}\n\t\t}\n\t\t//player vs grey Meteor\n\t\tfor(int i = 0; i < greyMeteors.length; i++) {\n\t\t\tif( distance(greyMeteors[i].getLayoutX() + ENTITIES_SIZE/2, greyMeteors[i].getLayoutY() - ENTITIES_SIZE/2, \n\t\t\t\t\tplayer.getLayoutX() + ENTITIES_SIZE/2, player.getLayoutY() - ENTITIES_SIZE/2) <= ENTITIES_SIZE) {\n\t\t\t\tsetNewElementPosition(greyMeteors[i]);\n\n\t\t\t\t//Update score -\n\t\t\t\tsc.score -= 3 * sc.collisionCounter;\n\t\t\t\tsc.collisionCounter++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//laser vs brown Meteor\n\t\tfor(int i = 0; i < lasers.size(); i++) {\n\t\t\tfor(int j = 0; j < brownMeteors.length; j++) { // 0 - 2 -> 3elem\n\t\t\t\tif(lasers.get(i).getBoundsInParent().intersects(brownMeteors[j].getBoundsInParent())) {\t// bounds of a node in it's parent coordinates\n\t\t\t\t\tsetNewElementPosition(brownMeteors[j]);\n\t\t\t\t\tgamePane.getChildren().remove(lasers.get(i));\n\t\t\t\t\tlasers.remove(i);\n\t\t\t\t\tSystem.out.println(lasers.size());\n\t\t\t\t\t\n\t\t\t\t\t//Update score +\n\t\t\t\t\tsc.score += 1; \n\t\t\t\t\tbreak; //kein fehler mehr durch index out of bounds verletzung\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\t\n\t\tfor(int i = 0; i < lasers.size(); i++) {\n\t\t\tfor(int j = 0; j < greyMeteors.length; j++) { // 0 - 2 -> 3elem\n\t\t\t\tif(lasers.get(i).getBoundsInParent().intersects(greyMeteors[j].getBoundsInParent())) {\t// bounds of a node in it's parent coordinates\n\t\t\t\t\tsetNewElementPosition(greyMeteors[j]);\n\t\t\t\t\tgamePane.getChildren().remove(lasers.get(i));\n\t\t\t\t\tlasers.remove(i);\n\t\t\t\t\tSystem.out.println(lasers.size());\n\t\t\t\t\t\n\t\t\t\t\t//Update score +\n\t\t\t\t\tsc.score += 1; \n\t\t\t\t\tbreak; //kein fehler mehr durch index out of bounds verletzung\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\t\t\n\t}", "private void penguinStormReaction(){\n if(obstacle.getUserData().getAssetId().equals(OBSTACLE_CLOUD_ASSETS_ID)){\n if(penguin.isFrightStopped()){\n obstacle.setStormRaining(false);\n }else{\n obstacle.setStormRaining(true);\n }\n }\n }", "public void update(){\n if(player.getPlaying()) {\n // update player animation.\n player.update();\n // update background animation.\n bg.update();\n // checks if skater has finished falling animation to end the game.\n if (player.animate instanceof FallAnimate && player.animate.getDone()) {\n player.setPlaying(false);\n player.setFall(false);\n System.out.println(\"End \" + player.getPlaying());\n }\n // checks if player has reached required points.\n if(player.getScore() > TARGETSCORE){\n player.setPlaying(false);\n levelCompleted = true;\n levelReset = System.nanoTime();\n }\n // increment jumpcounter while crouched.\n if (player.animate instanceof CrouchingAnimate && (jumpCounter <= 25)) {\n jumpCounter++;\n }\n // Creating Bananas:\n long bananaElapsed = (System.nanoTime() - bananaStartTime) / 1000000;\n if(bananaElapsed > 10500 && MainActivity.difficulty != 0){\n bananas.add(new Banana(BitmapFactory.decodeResource(getResources(),\n R.drawable.bigbanana), WIDTH + 10, (int) (HEIGHT * 0.85), 40, 40, 1));\n bananaStartTime = System.nanoTime();\n }\n //collision detection:\n for (int i = 0; i < bananas.size(); i++) {\n bananas.get(i).update();\n if (collision(bananas.get(i), player)) {\n bananas.remove(i);\n player.setFall(true);\n player.setPlaying(false);\n break;\n }\n // removing bananas when off screen\n if (bananas.get(i).getX() < -100) {\n bananas.remove(i);\n break;\n }\n }\n // Creating Cones:\n long coneElapsed = (System.nanoTime() - coneStartTime) / 1000000;\n if (coneElapsed > 5000) {\n cones.add(new TallBricks(BitmapFactory.decodeResource(getResources(),\n R.drawable.tallbricks), WIDTH + 10, (int) (HEIGHT * 0.59), 100, 161, 1));\n coneStartTime = System.nanoTime();\n }\n // update and check collisions.\n for (int i = 0; i < cones.size(); i++) {\n\n cones.get(i).update();\n if (collision(cones.get(i), player) && MainActivity.difficulty == 0) {\n cones.remove(i);\n player.forceSetScore(-500);\n break;\n }\n\n if (collision(cones.get(i), player) && MainActivity.difficulty != 0) {\n cones.remove(i);\n player.setFall(true);\n break;\n }\n // removing cones when off screen\n if (cones.get(i).getX() < -100) {\n cones.remove(i);\n break;\n }\n\n if((cones.get(i).getX() < player.getX() -15) ){\n cones.remove(i);\n player.setPendingPoints(1000);\n break;\n }\n }\n }\n else if(player.getPlaying() == false && levelCompleted){\n long resetElapsed = (System.nanoTime()-levelReset)/1000000;\n if(resetElapsed > 4000) {\n Intent resultIntent = new Intent();\n resultIntent.putExtra(\"result\",true);\n ((Activity)context).setResult(Activity.RESULT_OK,resultIntent);\n ((Activity)context).finish();\n }\n }\n else if(player.getPlaying() == false && !levelCompleted){\n if(!reset){\n newGameCreated = false;\n startReset = System.nanoTime();\n reset = true;\n }\n\n long resetElapsed = (System.nanoTime()-startReset)/1000000;\n\n if(resetElapsed > 2500 && !newGameCreated){\n newGame();\n }\n else if(resetElapsed < 2500 && started){\n player.update();\n }\n }\n }", "public void run()\n {\n // Used to keep track of time used to draw and update the game\n // This is used to limit the framerate later on\n long startTime;\n long deltaTime;\n \n // set up the pipes\n int pipeX = 600;\n Random randGen = new Random();\n for(int i = 0; i < topPipes.length; i++){\n // generating a random y position\n int pipeY = randGen.nextInt(HEIGHT - 2*minDistance) + minDistance;\n bottomPipes[i] = new Rectangle(pipeX, pipeY, pipeWidth, pipeHeight);\n topPipes[i] = new Rectangle(pipeX, pipeY - pipeGap - pipeHeight, pipeWidth, pipeHeight);\n // move the pipeX value over\n pipeX = pipeX + pipeWidth + pipeSpacing;\n }\n \n \n \n \n // the main game loop section\n // game will end if you set done = false;\n boolean done = false; \n while(!done)\n {\n // determines when we started so we can keep a framerate\n startTime = System.currentTimeMillis();\n \n // all your game rules and move is done in here\n // GAME LOGIC STARTS HERE \n \n // get the pipes moving\n if (start){\n if (!dead){\n \n \n for(int i = 0; i < topPipes.length; i++){\n topPipes[i].x = topPipes[i].x - speed;\n bottomPipes[i].x = bottomPipes[i].x - speed;\n // check if a pipe is off the screen\n if(topPipes[i].x + pipeWidth < 0){\n // move the pipe\n setPipe(i);\n }\n }\n }\n // get the bird to fall\n // apply gravity\n dy = dy + gravity;\n // apply the change in y to the bird\n if(jump && !lastjump){\n dy = jumpVelocity;\n }\n lastjump = jump;\n bird.y = bird.y + dy;\n if (bird.y<0||bird.y+bird.height > HEIGHT){\n done =true;\n }\n for (int i = 0; i <topPipes.length;i++){\n if(bird.intersects(topPipes[i])){\n done = true;\n }else if (bird.intersects(bottomPipes[i])){\n done =true;\n }\n }\n }\n // GAME LOGIC ENDS HERE \n \n // update the drawing (calls paintComponent)\n repaint();\n \n \n \n // SLOWS DOWN THE GAME BASED ON THE FRAMERATE ABOVE\n // USING SOME SIMPLE MATH\n deltaTime = System.currentTimeMillis() - startTime;\n try\n {\n if(deltaTime > desiredTime)\n {\n //took too much time, don't wait\n Thread.sleep(1);\n }else{\n // sleep to make up the extra time\n Thread.sleep(desiredTime - deltaTime);\n }\n }catch(Exception e){};\n }\n }", "private void checkCollision()\n {\n if(isTouching(Rocket.class))\n {\n removeTouching(Rocket.class);\n Level1 level1 = (Level1)getWorld(); \n isSwordscore = false;\n notifyObservers(-20);\n }\n else if(isTouching(Fire.class))\n {\n removeTouching(Fire.class);\n Level1 level1 = (Level1)getWorld(); \n isSwordscore = false;\n notifyObservers(-20);\n }\n else if(isTouching(Sword.class))\n { \n removeTouching(Sword.class);\n Level1 level1 = (Level1)getWorld();\n isSwordscore = false;\n notifyObservers(-20);\n }\n \n else if(isTouching(Star.class))\n { \n removeTouching(Star.class);\n Level1 level1 = (Level1)getWorld();\n isSwordscore = false;\n count++;\n boost();\n }\n }", "public void update() {\n //Increments the ticks and tube ticks\n ++ticks;\n ++ticksTubes;\n\n //Once ticksTubes is equal to speed, it is time to add a new tube with\n //random height. ticksTubes is reset to 0\n if (ticksTubes == speed) {\n final int height = FLOOR_OFFSET + 100\n + rnd.nextInt(HEIGHT - 200 - TUBE_APERTURE - FLOOR_OFFSET);\n tubes.add(new Tube(height));\n ticksTubes = 0;\n }\n\n //Iterates through each tube and determines if it is off screen and needs\n //to be removed. Determines if the bird has passed the current tube and \n //increments the score\n final Iterator<Tube> it = tubes.iterator();\n while (it.hasNext()) {\n final Tube tube = it.next();\n tube.position -= FLOOR_SPEED;\n if (tube.position + TUBE_WIDTH < 0.0)\n it.remove();\n if (!tube.passed && tube.position + TUBE_WIDTH < WIDTH / 3\n - BIRD_WIDTH / 2) {\n ++score;\n if (score % 10 == 0) {\n speed -= 5;\n speed = Math.max(speed, 20);\n }\n tube.passed = true;\n }\n }\n\n //Goes through each alive bird and updates its velocity, angle, position\n for (final Bird bird : birds) {\n \n //If bird is dead, go to next bird\n if (bird.dead)\n continue;\n\n //If bird 'flap' is true, adjust the velocity and set to false\n if (bird.flap) {\n bird.velocity = 10;\n bird.flap = false;\n ++bird.flaps;\n }\n\n //Adjust the height by adding the current velocity\n bird.height += bird.velocity;\n //Decrease the velocity\n bird.velocity -= 0.98;\n //Adjust the angle to a limit of 90 degrees\n bird.angle = 3.0 * bird.velocity;\n bird.angle = Math.max(-90.0, Math.min(90.0, bird.angle));\n\n //Make sure bird does not go past the upper bounds of the screen\n if (bird.height > HEIGHT) {\n bird.height = HEIGHT;\n bird.velocity = 0.0;\n bird.angle = -bird.angle;\n }\n\n //If bird hits the floor, kill the bird\n if (bird.height < FLOOR_OFFSET + BIRD_HEIGHT / 2)\n bird.dead = true;\n\n //transforms the bird by rotating it\n final AffineTransform at = new AffineTransform();\n at.translate(WIDTH / 3 - BIRD_HEIGHT / 2, HEIGHT - bird.height);\n at.rotate(-bird.angle / 180.0 * Math.PI, BIRD_WIDTH / 2,\n BIRD_HEIGHT / 2);\n at.translate(0, 52);\n final Shape bounds = new GeneralPath(BOUNDS)\n .createTransformedShape(at);\n \n //Goes through each tube and determines if the top 'cielTube' or bottom\n //'floorTube' hits the bird. If so, the bird dies\n for (final Tube tube : tubes) {\n final Rectangle2D ceilTube = new Rectangle2D.Double(\n tube.position,\n HEIGHT - tube.height - TUBE_APERTURE - TUBE_HEIGHT,\n TUBE_WIDTH, TUBE_HEIGHT);\n final Rectangle2D floorTube = new Rectangle2D.Double(\n tube.position, HEIGHT - tube.height, TUBE_WIDTH,\n TUBE_HEIGHT);\n if (bounds.intersects(ceilTube)\n || bounds.intersects(floorTube)) {\n bird.dead = true;\n break;\n }\n }\n }\n }", "public void onShiftPressed(){\n if(player.getRechargeTimer()<=0){\n if(player.getInfiniteRocketsTimer()>0||player.getRocketsNumber()>0) {\n if(player.getInfiniteRocketsTimer()<=0) {\n player.setRocketsNumber(player.getRocketsNumber() - 1);\n }\n Rocket rocket = new Rocket();\n player.setRechargeTimer(50);\n rocket.moveCentreTo(player.getCentreX(), player.getCentreY());\n rocket.setRotation(player.getRotation());\n rocket.setSpeed(new Point2D(11 * Math.cos(Math.toRadians(rocket.getRotation() - 90)), 11 * Math.sin(Math.toRadians(rocket.getRotation() - 90))));\n }\n }\n }", "public void update(float delta) {\n\t\ttimer += delta;\n\t\tgetObjects();\n\t\t\n\t\t//Update camera shake\n\t\tGameScreen.cam.updateShake(delta);\n\t\t\n\t\t//Regenerate ammo & bomb power\n\t\tearth.addAmmo(3f*delta);\n\t\tearth.addBombPower(delta);\n\t\t\n\t\t//Clear meteors if bomb has been triggered from input\n\t\tif(clearField) {\n\t\t\tclearField = false;\n\t\t\t\n\t\t\t//Trigger camera shake\n\t\t\tGameScreen.cam.shake(0.01f, Gdx.graphics.getHeight()/25);\n\t\t\t\n\t\t\t//Update screen flash\n\t\t\tgo.getScreenFlash().setOpacity(1);\n\t\t\t\n\t\t\t//Remove all meteors and add explosions where they were\n\t \tIterator<Meteor> iterMe = meteors.iterator();\n\t\t\twhile(iterMe.hasNext()){\n\t\t\t Meteor m = iterMe.next();\n\t\t\t Explosion exp = explosionPool.obtain();\n\t\t\t exp.init(m.getX() - m.getWidth()/2, m.getY() - m.getHeight()/2, m.getWidth() * 2);\n\t\t\t explosions.add(exp);\n\t\t\t \t\n\t\t\t iterMe.remove();\n\t\t\t meteorPool.free(m);\n\t\t\t \t\n\t\t\t earth.addScore(10);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Add explosions while screenFlash is still running\n\t\tif(go.getScreenFlash().getOpacity() > 0.6) {\n\t\t\tExplosion exp = explosionPool.obtain();\n\t\t exp.init(Gdx.graphics.getWidth() * rand.nextFloat() - Gdx.graphics.getHeight()/8 , Gdx.graphics.getHeight() * rand.nextFloat() - Gdx.graphics.getHeight()/8, Gdx.graphics.getHeight()/2 * rand.nextFloat() + 1);\n\t\t explosions.add(exp);\n\t \t\n\t \t//Play explosion sound\n\t\t if(soundOn)\n\t\t \texploSound.play(0.5f, rand.nextFloat() * 0.5f + 0.75f ,0);\n\t\t}\n\t\t\n\t\tsecTimer += delta;\n\t\t//Called once a second\n\t\tif(secTimer >= 1) {\n\t\t\tsecTimer = 0;\n\t\t\t\n\t\t\t//Update spawn interval and meteor speed\n\t\t\tif(meteorSpeed < Gdx.graphics.getHeight()/10) {\n\t\t\t\tmeteorSpeed += (float)Gdx.graphics.getHeight()/5000;\n\t\t\t\tGdx.app.log(\"MeteorSpeed\", Float.toString(meteorSpeed));\n\t\t\t}\n\t\t\t\n\t\t\tif(spawnInterval > 0.5) {\n\t\t\t\tspawnInterval -= 0.015f;\n\t\t\t\tGdx.app.log(\"SpawnInterval\", Float.toString(spawnInterval));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Add meteors\n\t\tif(meteorSpawn && timer > spawnInterval) {\n\t\t\ttimer = 0;\n\t\t\tMeteor meteor = meteorPool.obtain();\n\t \tmeteor.init(meteorSpeed);\n\t \tmeteors.add(meteor);\n\t\t}\n\t\t\n\t\t//Update explosion animations\n\t\tIterator<Explosion> iterE = explosions.iterator();\n\t\twhile(iterE.hasNext()){\n\t\t Explosion e = iterE.next();\n\t\t if(e.update(delta)) {\n\t\t \titerE.remove();\n\t\t \texplosionPool.free(e);\n\t\t }\n\t\t}\n\t\t\n\t\t//Update targets\n\t\tfor(Sprite t : targets)\n\t\t\tt.rotate(30*delta);\n\t\t\n\t\t//Update rockets position\n\t\tfor(Rocket r : rockets)\n\t\t\tr.move(delta);\n\t\t\n\t\t//Check if rocket has reached destination\n\t\tIterator<Rocket> iterR = rockets.iterator();\n\t\twhile(iterR.hasNext()){\n\t\t Rocket r = iterR.next();\n\t\t \n\t\t Sprite cross = go.getRocketCrossMap().get(r);\n\t\t crossRect.width = cross.getWidth()/4;\n\t\t crossRect.height = cross.getHeight()/4;\n\t\t crossRect.x = cross.getX() + crossRect.width;\n\t\t crossRect.y = cross.getY() + crossRect.height;\n\t\t \n\t\t if(Intersector.overlaps(r.getBoundingRectangle(), crossRect)) {\n\t\t \t\n\t\t \tSprite target = go.getCrossTargetMap().get(cross);\n\n\t\t \t//Remove cross\n\t\t \tcrosses.remove(cross);\n\t\t \t\n\t\t \t//Remove target\n\t\t \ttargets.remove(target);\n\t\t \t\n\t\t \t//Remove rocket\n\t\t \titerR.remove();\n\t\t \t\n\t\t \t//Add explosion\n\t\t \tExplosion exp = explosionPool.obtain();\n\t\t \texp.init(cross.getX() - (target.getWidth() * target.getScaleX()/2) + cross.getWidth()/2, cross.getY() - (target.getHeight() * target.getScaleX()/2) + cross.getWidth()/2, target.getWidth() * target.getScaleX());\n\t\t \texplosions.add(exp);\n\t\t \t\n\t\t \t//Play explosion sound\n\t\t \tif(soundOn)\n\t\t \t\texploSound.play(0.5f, rand.nextFloat() * 0.5f + 0.75f ,0);\n\t\t \t\n\t\t \t//Check for asteroids in explosion radius, remove and add explosion if found\n\t\t \texploCircle.setRadius(target.getWidth() * target.getScaleX()/2);\n\t\t \texploCircle.setPosition(cross.getX() + cross.getWidth()/2, cross.getY() + cross.getHeight()/2);\n\t\t \t\n\t\t \tIterator<Meteor> iterMe = meteors.iterator();\n\t\t\t\twhile(iterMe.hasNext()){\n\t\t\t\t Meteor m = iterMe.next();\n\t\t\t\t meteorCircle.setPosition(m.getX()+m.getWidth()/2, m.getY()+m.getHeight()/2);\n\t\t\t\t meteorCircle.setRadius(m.getWidth()/2);\n\t\t\t\t if(Intersector.overlaps(exploCircle, meteorCircle)) {\n\t\t\t\t \texp = explosionPool.obtain();\n\t\t\t\t \texp.init(m.getX(), m.getY(), m.getWidth());\n\t\t\t\t \texplosions.add(exp);\n\t\t\t\t \t\n\t\t\t\t \titerMe.remove();\n\t\t\t\t \tmeteorPool.free(m);\n\t\t\t\t \t\n\t\t\t\t \tearth.addScore(10);\n\t\t\t\t }\n\t\t\t\t}\n\t\t }\n\t\t}\n\t\t\n\t\tearthCircle = go.getEarth().getCollisionCircle();\n\t\t\n\t\t//Move each meteor, and check if it collides with the earth. Remove if it does\n\t\tIterator<Meteor> iterM = meteors.iterator();\n\t\twhile(iterM.hasNext()){\n\t\t Meteor m = iterM.next();\n\t\t m.move(delta);\n\t\t meteorCircle.setPosition(m.getX()+m.getWidth()/2, m.getY()+m.getHeight()/2);\n\t\t meteorCircle.setRadius(m.getWidth()/3);\n\t\t if(Intersector.overlaps(earthCircle, meteorCircle)) {\n\t\t \tExplosion exp = explosionPool.obtain();\n\t\t \texp.init(m.getX(), m.getY(), m.getWidth());\n\t\t \texplosions.add(exp);\n\t\t \t\n\t\t \titerM.remove();\n\t\t \tmeteorPool.free(m);\n\t\t \t\n\t\t \t//Trigger camera shake\n\t\t \tif(!GameScreen.gameOver)\n\t\t \t\tGameScreen.cam.shake(0.01f, Gdx.graphics.getHeight()/25);\n\t\t \t\n\t\t \tearth.damage(1);\n\t\t }\n\t\t}\n\t\t\n\t\tsaveObjects();\n\t}", "public void updateSensors() {\n if(bLCollide && bRCollide) {\n grounded = true;\n }\n else if(bLCollide || bRCollide) {\n grounded = true;\n }\n else if(!bLCollide && !bRCollide) {\n grounded = false;\n }\n if(!collideWithSlopeL && !collideWithSlopeR) {\n bottomLeft = new Rectangle(xDrawCenterPlayer-36,ySpriteCenterPlayer,4,80); \n bottomRight = new Rectangle(xDrawCenterPlayer+36,ySpriteCenterPlayer,4,80); \n middleLeft = new Rectangle(xDrawCenterPlayer-40,ySpriteCenterPlayer+28,40,4);\n middleRight = new Rectangle(xDrawCenterPlayer+4,ySpriteCenterPlayer+28,40,4); \n }\n else if(collideWithSlopeL && !collideWithSlopeR) {\n bottomLeft = new Rectangle(xDrawCenterPlayer-36,ySpriteCenterPlayer,4,144); \n bottomRight = new Rectangle(xDrawCenterPlayer+36,ySpriteCenterPlayer,4,80); \n middleLeft = new Rectangle(xDrawCenterPlayer-40,ySpriteCenterPlayer-4,40,4);\n middleRight = new Rectangle(xDrawCenterPlayer+4,ySpriteCenterPlayer-4,40,4);\n }\n else if(!collideWithSlopeL && collideWithSlopeR) {\n bottomLeft = new Rectangle(xDrawCenterPlayer-36,ySpriteCenterPlayer,4,80); \n bottomRight = new Rectangle(xDrawCenterPlayer+36,ySpriteCenterPlayer,4,144);\n middleLeft = new Rectangle(xDrawCenterPlayer-40,ySpriteCenterPlayer-4,40,4);\n middleRight = new Rectangle(xDrawCenterPlayer+4,ySpriteCenterPlayer-4,40,4); \n }\n else if(collideWithSlopeL && collideWithSlopeR) {\n bottomLeft = new Rectangle(xDrawCenterPlayer-36,ySpriteCenterPlayer,4,144); \n bottomRight = new Rectangle(xDrawCenterPlayer+36,ySpriteCenterPlayer,4,144); \n middleLeft = new Rectangle(xDrawCenterPlayer-40,ySpriteCenterPlayer-4,40,4);\n middleRight = new Rectangle(xDrawCenterPlayer+4,ySpriteCenterPlayer-4,40,4);\n }\n if(!grounded) {/*Added this to reset the height of the player sensors if he jumps off a slope (ground == true wouldn't trigger \n early) making the player stop earlier then he should*/\n bottomLeft = new Rectangle(xDrawCenterPlayer-36,ySpriteCenterPlayer,4,80); \n bottomRight = new Rectangle(xDrawCenterPlayer+36,ySpriteCenterPlayer,4,80); \n middleLeft = new Rectangle(xDrawCenterPlayer-40,ySpriteCenterPlayer-4,40,4);\n middleRight = new Rectangle(xDrawCenterPlayer+4,ySpriteCenterPlayer-4,40,4); \n }\n topLeft = new Rectangle(xDrawCenterPlayer-36,ySpriteCenterPlayer-84,4,80);\n topRight = new Rectangle(xDrawCenterPlayer+36,ySpriteCenterPlayer-84,4,80); \n //Gets the correct size of interactBox\n if(jumpState != JumpState.STATE_NOJUMP || duckState != DuckState.STATE_NODUCK) {\n intersectBox = new Rectangle(xDrawCenterPlayer-30, ySpriteCenterPlayer-20, 60, 80);\n }\n else {\n intersectBox = new Rectangle(xDrawCenterPlayer-29, ySpriteCenterPlayer-70, 60, 140);\n }\n }", "public void moveBlueCrab() {\n\t\tloseLife();\n\t\tif (wallOverlapX()) {\n\t\t\tif (hitRight) {\n\t\t\t\tif (xVel > 0) {\n\t\t\t\t\tyPos += yVel;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\txPos += xVel;\n\t\t\t\t\tyPos += yVel;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else if (hitLeft) {\n\t\t\t\tif (xVel < 0) {\n\t\t\t\t\tyPos += yVel;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\txPos += xVel;\n\t\t\t\t\tyPos += yVel;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (wallOverlapY()) {\n\t\t\tif (hitUp) {\n\t\t\t\tif (yVel < 0) {\n\t\t\t\t\txPos += xVel;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\txPos += xVel;\n\t\t\t\t\tyPos += yVel;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else if (hitDown) {\n\t\t\t\tif (yVel > 0) {\n\t\t\t\t\txPos += xVel;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\txPos += xVel;\n\t\t\t\t\tyPos += yVel;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint xLow = xPos;\n\t\tint xHigh =xPos + width;\n\t\tint yTop = yPos;\n\t\tint yBot = yPos + height;\n\t\tfor (int i = 0; i < game.m.walls.size(); i++) {\n\t\t\tif (game.m.walls.get(i).wallHit(this) > 0) {\n//\t\t\t\twhile (game.m.walls.get(i).wallHit(this)) {\n\t\t\t\tif (game.m.walls.get(i).wallHit(this) == 4) {\n\t\t\t\t\tif (yVel < 0) {\n\t\t\t\t\t\tyPos += yVel;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} \n\t\t\t\t\telse {\n\t\t\t\t\t\tfor (int j = 0; j < game.m.walls.size(); j++) {\n\t\t\t\t\t\t\tif (game.m.walls.get(j).wallHit(this) == 1) {\n\t\t\t\t\t\t\t\tif (xVel > 0) {\n\t\t\t\t\t\t\t\t\txPos += xVel;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (int j = 0; j < game.m.walls.size(); j++) {\n\t\t\t\t\t\t\tif (game.m.walls.get(j).wallHit(this) == 2) {\n\t\t\t\t\t\t\t\tif (xVel < 0) {\n\t\t\t\t\t\t\t\t\txPos += xVel;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\txPos += xVel;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (game.m.walls.get(i).wallHit(this) == 3) {\n\t\t\t\t\tif (yVel > 0) {\n\t\t\t\t\t\tyPos += yVel;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} \n\t\t\t\t\telse {\n\t\t\t\t\t\tfor (int j = 0; j < game.m.walls.size(); j++) {\n\t\t\t\t\t\t\tif (game.m.walls.get(j).wallHit(this) == 1) {\n\t\t\t\t\t\t\t\tif (xVel > 0) {\n\t\t\t\t\t\t\t\t\txPos += xVel;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (int j = 0; j < game.m.walls.size(); j++) {\n\t\t\t\t\t\t\tif (game.m.walls.get(j).wallHit(this) == 2) {\n\t\t\t\t\t\t\t\tif (xVel < 0) {\n\t\t\t\t\t\t\t\t\txPos += xVel;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\txPos += xVel;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (game.m.walls.get(i).wallHit(this) == 2) {\n\t\t\t\t\tif (xVel < 0) {\n\t\t\t\t\t\txPos += xVel;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} \n\t\t\t\t\telse {\n\t\t\t\t\t\tfor (int j = 0; j < game.m.walls.size(); j++) {\n\t\t\t\t\t\t\tif (game.m.walls.get(j).wallHit(this) == 3) {\n\t\t\t\t\t\t\t\tif (yVel > 0) {\n\t\t\t\t\t\t\t\t\tyPos += yVel;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (int j = 0; j < game.m.walls.size(); j++) {\n\t\t\t\t\t\t\tif (game.m.walls.get(j).wallHit(this) == 4) {\n\t\t\t\t\t\t\t\tif (yVel < 0) {\n\t\t\t\t\t\t\t\t\tyPos += yVel;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tyPos += yVel;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (game.m.walls.get(i).wallHit(this) == 1) {\n\t\t\t\t\tif (xVel > 0) {\n\t\t\t\t\t\txPos += xVel;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} \n\t\t\t\t\telse {\n\t\t\t\t\t\tfor (int j = 0; j < game.m.walls.size(); j++) {\n\t\t\t\t\t\t\tif (game.m.walls.get(j).wallHit(this) == 3) {\n\t\t\t\t\t\t\t\tif (yVel > 0) {\n\t\t\t\t\t\t\t\t\tyPos += yVel;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (int j = 0; j < game.m.walls.size(); j++) {\n\t\t\t\t\t\t\tif (game.m.walls.get(j).wallHit(this) == 4) {\n\t\t\t\t\t\t\t\tif (yVel < 0) {\n\t\t\t\t\t\t\t\t\tyPos += yVel;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tyPos += yVel;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n//\t\t\t\tif (xVel > 0) {\n//\t\t\t\t\txPos -= 20;\n//\t\t\t\t\treturn;\n//\t\t\t\t} \n//\t\t\t\telse if (xVel < 0) {\n//\t\t\t\t\txPos += 20;\n//\t\t\t\t\treturn;\n//\t\t\t\t}\n//\t\t\t\tif (yVel > 0) {\n//\t\t\t\t\tyPos -= 20;\n//\t\t\t\t\treturn;\n//\t\t\t\t}\n//\t\t\t\telse if (yVel < 0) {\n//\t\t\t\t\tyPos += 20;\n//\t\t\t\t\treturn;\n//\t\t\t\t}\n//\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (xPos <= 0) {\n\t\t\tif (xVel > 0) {\n\t\t\t\txPos += xVel;\n\t\t\t} else if (yPos + height <= game.mapHeight && yPos >= 0){\n\t\t\t\tyPos += yVel;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (xPos + width >= game.mapWidth) {\n\t\t\tif (xVel < 0) {\n\t\t\t\txPos += xVel;\n\t\t\t} else if (yPos + height <= game.mapHeight && yPos >= 0){\n\t\t\t\tyPos += yVel;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (yPos <= 0) {\n\t\t\tif (yVel > 0) {\n\t\t\t\tyPos += yVel;\n\t\t\t} else if (xPos + width <= game.mapWidth && xPos >= 0){ \n\t\t\t\txPos += xVel;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (yPos + height >= game.mapHeight) { \n\t\t\tif (yVel < 0) {\n\t\t\t\tyPos += yVel;\n\t\t\t} else if (xPos + width <= game.mapWidth && xPos >= 0){\n\t\t\t\txPos += xVel;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\txPos += xVel;\n\t\t\tyPos += yVel;\n\t\t}\n\n\t}", "@SuppressWarnings(\"deprecation\")\n\tpublic void gameTick() {\n\t\tBukkit.getScheduler().runTask(Plugin_MineTime.Plugin, new Runnable() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t\tfor (Block b: beacons) {\n\t\t\t\t\tw.playEffect(b.getLocation(), Effect.ENDER_SIGNAL, 0);\n\t\t\t\t}\n\t\t\t\tfor (Block b: gold_blocks) {\n\t\t\t\t\tw.playEffect(b.getLocation().add(0, 2, 0), Effect.FLYING_GLYPH, 100);\n\t\t\t\t\tw.playEffect(b.getLocation().add(0, 2, 0), Effect.FLYING_GLYPH, 100);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsynchronized (timers) {\n\t\t\t\t\tfor (final byte data: timers.keySet()) {\n\t\t\t\t\t\tif (timers.get(data) > 0) {\n\t\t\t\t\t\t\ttimers.put(data, timers.get(data)-1);\n\t\t\t\t\t\t\tif (!extended.get(data)) {\n\t\t\t\t\t\t\t\textended.put(data, true);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tBukkit.getScheduler().runTaskAsynchronously(Plugin_MineTime.Plugin, new Runnable() {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\tDirection d = getDirection(glass_blocks.get(data));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tboolean wand = false;\n\t\t\t\t\t\t\t\t\t\tLocation l = glass_blocks.get(data).getLocation().add(d.getVector());\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\twhile (!wand) {\n\t\t\t\t\t\t\t\t\t\t\tfinal Block change = w.getBlockAt(l);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tBukkit.getScheduler().runTask(Plugin_MineTime.Plugin, new Runnable() {\n\t\t\t\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\t\t\tchange.setType(Material.STAINED_GLASS);\n\t\t\t\t\t\t\t\t\t\t\t\t\tchange.setData(data);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tl = l.add(d.getVector());\n\t\t\t\t\t\t\t\t\t\t\tif (!(w.getBlockAt(l).getType() == Material.AIR || w.getBlockAt(l).getType() == Material.STAINED_GLASS)) {\n\t\t\t\t\t\t\t\t\t\t\t\twand = true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tThread.sleep(50);\n\t\t\t\t\t\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else {\t\t\n\t\t\t\t\t\t\tif (extended.get(data)) {\n\t\t\t\t\t\t\t\textended.put(data, false);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tBukkit.getScheduler().runTaskAsynchronously(Plugin_MineTime.Plugin, new Runnable() {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\tDirection d = getDirection(glass_blocks.get(data));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tboolean wand = false;\n\t\t\t\t\t\t\t\t\t\tLocation l = glass_blocks.get(data).getLocation().add(d.getVector());\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\twhile (!wand) {\n\t\t\t\t\t\t\t\t\t\t\tfinal Block change = w.getBlockAt(l);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tBukkit.getScheduler().runTask(Plugin_MineTime.Plugin, new Runnable() {\n\t\t\t\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\t\t\tchange.setType(Material.AIR);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tl = l.add(d.getVector());\n\t\t\t\t\t\t\t\t\t\t\tif (!(w.getBlockAt(l).getType() == Material.AIR || w.getBlockAt(l).getType() == Material.STAINED_GLASS)) {\n\t\t\t\t\t\t\t\t\t\t\t\twand = true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tThread.sleep(100);\n\t\t\t\t\t\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\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});\n\t}", "@Override\n public void run() {\n for (; ; ) {\n\n // increment score, speed and create rock counters\n incrementCounters();\n\n if (gameLevel > 24) {\n gameWon = true;\n } else {\n\n // check if we should create a new rock\n // (don't try to create rocks until we're drawn the screen)\n if (getWidth() > 0) {\n if (rockTimer >= rockInterval - gameLevel) {\n createRock();\n rockTimer = 0;\n }\n }\n\n // move all existing rocks in list\n for (RockView rock : rockList) {\n rock.dragTowards(touchPoint, touchWidth);\n }\n\n // check for rock collision with city -> end of game\n for (RockView rock : rockList) {\n if (isRockTouchingCity(rock)) {\n gameOver = true;\n }\n }\n\n // check for rock collision with ground -> delete rock\n CopyOnWriteArrayList<RockView> tmp1 = new CopyOnWriteArrayList<RockView>();\n Iterator<RockView> rockIterator = rockList.iterator();\n while (rockIterator.hasNext()) {\n RockView rock = rockIterator.next();\n if (isRockTouchingGround(rock)) {\n tmp1.add(rock);\n }\n }\n rockList.removeAll(tmp1);\n\n // check for rock collision with other rocks -> delete both rocks\n CopyOnWriteArrayList<RockView> tmp2 = new CopyOnWriteArrayList<RockView>();\n\n Iterator<RockView> rockIterator1 = rockList.iterator();\n while (rockIterator1.hasNext()) {\n RockView rock1 = rockIterator1.next();\n\n Iterator<RockView> rockIterator2 = rockList.iterator();\n while (rockIterator2.hasNext()) {\n RockView rock2 = rockIterator2.next();\n if (rock1 != rock2) {\n if (isRockTouchingRock(rock1, rock2)) {\n tmp2.add(rock1);\n // get 100 points for each rock you destroy\n score += 100;\n }\n }\n }\n }\n\n // remove rocks marked for destruction\n rockList.removeAll(tmp2);\n }\n\n //Call onDraw to redraw screen\n postInvalidate();\n\n // check if game is over or won, else sleep and then start loop over again\n if (gameOver || gameWon) {\n // pause for 7 seconds to display toast\n try {\n Thread.sleep(7000L); //milliseconds\n } catch (InterruptedException interruptedException) {\n }\n\n // reset game\n resetGame();\n } else {\n\n //Sleep for 1/10 of a second.\n try {\n Thread.sleep(100L); //milliseconds\n } catch (InterruptedException interruptedException) {\n }\n }\n }\n }", "public void checkWindCollision() {\n\n if (Intersector.overlaps(player.boundingCircle, wind1.boundingRectangle)) {\n if (!wind1.angry) {\n //Blow Right\n if (wind1.left && (player.x + AssetHandler.WIND_STRENGTH + player.circleRad < AssetHandler.SCREEN_WIDTH)) {\n player.x += AssetHandler.WIND_STRENGTH;\n } else if (!wind1.left && player.x - AssetHandler.WIND_STRENGTH - player.circleRad > 0) {\n player.x -= AssetHandler.WIND_STRENGTH;\n }\n } else {\n wind1.boundingRectangle.x = -wind1.boundingRectangle.width;\n player.paralyzed = true;\n player.paralyzedStart = TimeUtils.nanoTime();\n shake = true;\n }\n\n }\n\n\n //Check 2nd wind\n\n if (Intersector.overlaps(player.boundingCircle, wind2.boundingRectangle)) {\n if (!wind2.angry) {\n if (wind2.left && (player.x + AssetHandler.WIND_STRENGTH + player.circleRad < AssetHandler.SCREEN_WIDTH)) {\n player.x += AssetHandler.WIND_STRENGTH;\n } else if (!wind2.left && player.x - AssetHandler.WIND_STRENGTH - player.circleRad > 0) {\n player.x -= AssetHandler.WIND_STRENGTH;\n }\n } else {\n wind2.boundingRectangle.x = -wind2.boundingRectangle.width;\n player.paralyzed = true;\n player.paralyzedStart = TimeUtils.nanoTime();\n shake = true;\n }\n }\n\n\n //Check 3rd wind\n\n if (Intersector.overlaps(player.boundingCircle, wind3.boundingRectangle)) {\n if (!wind3.angry) {\n if (wind3.left && (player.x + AssetHandler.WIND_STRENGTH + player.circleRad < AssetHandler.SCREEN_WIDTH)) {\n player.x += AssetHandler.WIND_STRENGTH;\n } else if (!wind3.left && player.x - AssetHandler.WIND_STRENGTH - player.circleRad > 0) {\n player.x -= AssetHandler.WIND_STRENGTH;\n }\n } else {\n wind3.boundingRectangle.x = -wind3.boundingRectangle.width;\n player.paralyzed = true;\n player.paralyzedStart = TimeUtils.nanoTime();\n shake = true;\n }\n }\n\n\n /*\n * Check Wind Collision For Particle Effect Generation\n */\n\n\n //Check 1st Wind\n\n if(Intersector.overlaps(player.boundingCircle, wind1.spriteRectangle)) {\n if(!particle) {\n cloudParticle.setPosition(player.x, wind1.y + wind1.height/2);\n if(cloudParticle.isComplete())\n cloudParticle.reset();\n particle = true;\n } else {\n cloudParticle.setPosition(cloudParticle.getEmitters().first().getX(), wind1.y + wind1.height/2);\n }\n if(wind1.angry) {\n cloudParticle.setFlip(false, true);\n } else {\n cloudParticle.setFlip(false, false);\n }\n }\n\n\n //Check 2nd Wind\n\n if(Intersector.overlaps(player.boundingCircle, wind2.spriteRectangle)) {\n if(!particle) {\n cloudParticle.setPosition(player.x, wind2.y + wind2.height/2);\n if(cloudParticle.isComplete())\n cloudParticle.reset();\n particle = true;\n } else {\n cloudParticle.setPosition(cloudParticle.getEmitters().first().getX(), wind2.y + wind2.height/2);\n }\n if(wind2.angry) {\n cloudParticle.setFlip(false, true);\n } else {\n cloudParticle.setFlip(false, false);\n }\n }\n\n\n //Check 3rd Wind\n\n if(Intersector.overlaps(player.boundingCircle, wind3.spriteRectangle)) {\n if(!particle) {\n cloudParticle.setPosition(player.x, wind3.y + wind3.height/2);\n if(cloudParticle.isComplete())\n cloudParticle.reset();\n particle = true;\n } else {\n cloudParticle.setPosition(cloudParticle.getEmitters().first().getX(), wind3.y + wind3.height/2);\n }\n if(wind3.angry) {\n cloudParticle.setFlip(false, true);\n } else {\n cloudParticle.setFlip(false, false);\n }\n }\n\n }", "@Override\n public void update(GameContainer gc, StateBasedGame stateBasedGame, int delta) throws SlickException {\n timeSinceStart += delta;\n rtimeSinceStart += delta;\n Input input = gc.getInput();\n int mouseX = input.getMouseX();\n int mouseY = input.getMouseY();\n\n\n basicbulletSheet.rotate(90f);\n basicbulletSheet.setCenterOfRotation(16, 16);\n\n // Move this bullet\n for (int i = 0; i < bulletList.size(); i++) {\n bullet = bulletList.get(i);\n bullet.move();\n }\n\n //Add this tower to the this towerList\n if (Tower.isBasicPlaced()) {\n basicTowers.add(new BasicTower());\n System.out.println(basicTowers);\n Tower.setBasicPlaced(false);\n }\n\n //Add this tower to the this towerList\n if (Tower.isBomberPlaced()) {\n bomberTowers.add(new BomberTower());\n System.out.println(bomberTowers);\n Tower.setBomberPlaced(false);\n }\n\n //Add this tower to the this towerList\n if (Tower.isSniperPlaced()) {\n sniperTowers.add(new SniperTower());\n System.out.println(sniperTowers);\n Tower.setSniperPlaced(false);\n }\n\n //Add this tower to the this towerList\n if (Tower.isQuickPlaced()) {\n quickTowers.add(new QuickTower());\n System.out.println(quickTowers);\n Tower.setQuickPlaced(false);\n }\n\n //For this tower, calculate how often this tower will shoot bullets\n for (BasicTower basicTower1 : basicTowers) {\n for (Enemy enemy : enemies) {\n enemy.Playrect = new Circle(enemy.getStartPosX() * w + r,\n enemy.getStartPosY() * w + r, 10);\n if (rtimeSinceStart > basicTower1.rcoolDown + basicTower1.rlastShot) {\n if (enemy.Playrect.intersects(basicTower1.Radius)) {\n basicTower1.basicClicked.setRotation((float) getTargetAngle(basicTower1.towerX,\n basicTower1.towerY, enemy.getStartPosX(), enemy.getStartPosY()));\n basicTower1.basicClicked.setCenterOfRotation(32, 32);\n basicTower1.rlastShot = rtimeSinceStart;\n }\n }\n if (timeSinceStart > basicTower1.coolDown + basicTower1.lastShot) {\n if (enemy.Playrect.intersects(basicTower1.Radius)) {\n addNewBullet2(basicTower1.towerX, basicTower1.towerY, enemy.getStartPosX(),\n enemy.getStartPosY(), 10);\n basicTower1.lastShot = timeSinceStart;\n }\n\n }\n }\n }\n\n //For this tower, calculate how often this tower will shoot bullets\n for (BomberTower bomberTower1 : bomberTowers) {\n for (Enemy enemy : enemies) {\n enemy.Playrect = new Circle(enemy.getStartPosX() * w + r,\n enemy.getStartPosY() * w + r, 10);\n if (rtimeSinceStart > bomberTower1.rcoolDown + bomberTower1.rlastShot) {\n if (enemy.Playrect.intersects(bomberTower1.Radius)) {\n bomberTower1.bomberClicked.setRotation((float) getTargetAngle(bomberTower1.bombertowerX,\n bomberTower1.bombertowerY, enemy.getStartPosX(), enemy.getStartPosY()));\n bomberTower1.bomberClicked.setCenterOfRotation(32, 32);\n bomberTower1.rlastShot = rtimeSinceStart;\n }\n }\n if (timeSinceStart > bomberTower1.coolDown + bomberTower1.lastShot) {\n if (enemy.Playrect.intersects(bomberTower1.Radius)) {\n addNewBullet2(bomberTower1.bombertowerX, bomberTower1.bombertowerY, enemy.getStartPosX(),\n enemy.getStartPosY(), 10);\n bomberTower1.lastShot = timeSinceStart;\n }\n }\n }\n }\n //For this tower, calculate how often this tower will shoot bullets\n for (SniperTower sniperTower1 : sniperTowers) {\n for (Enemy enemy : enemies) {\n enemy.Playrect = new Circle(enemy.getStartPosX() * w + r,\n enemy.getStartPosY() * w + r, 10);\n\n if (rtimeSinceStart > sniperTower1.rcoolDown + sniperTower1.rlastShot) {\n if (enemy.Playrect.intersects(sniperTower1.Radius)) {\n sniperTower1.sniperClicked.setRotation((float) getTargetAngle(sniperTower1.towerX,\n sniperTower1.towerY, enemy.getStartPosX(), enemy.getStartPosY()));\n sniperTower1.sniperClicked.setCenterOfRotation(32, 32);\n sniperTower1.rlastShot = rtimeSinceStart;\n }\n }\n\n if (timeSinceStart > sniperTower1.coolDown + sniperTower1.lastShot) {\n if (enemy.Playrect.intersects(sniperTower1.Radius)) {\n addNewBullet2(sniperTower1.towerX, sniperTower1.towerY, enemy.getStartPosX(),\n enemy.getStartPosY(), 50);\n sniperTower1.lastShot = timeSinceStart;\n }\n\n }\n }\n }\n //For this tower, calculate how often this tower will shoot bullets\n for (QuickTower quickTower1 : quickTowers) {\n for (Enemy enemy : enemies) {\n enemy.Playrect = new Circle(enemy.getStartPosX() * w + r,\n enemy.getStartPosY() * w + r, 10);\n\n if (rtimeSinceStart > quickTower1.rcoolDown + quickTower1.rlastShot) {\n if (enemy.Playrect.intersects(quickTower1.Radius)) {\n quickTower1.quickClicked.setRotation((float) getTargetAngle(quickTower1.towerX,\n quickTower1.towerY, enemy.getStartPosX(), enemy.getStartPosY()));\n quickTower1.quickClicked.setCenterOfRotation(32, 32);\n quickTower1.rlastShot = rtimeSinceStart;\n }\n }\n\n\n if (timeSinceStart > quickTower1.coolDown + quickTower1.lastShot) {\n if (enemy.Playrect.intersects(quickTower1.Radius)) {\n radiusVisited = true;\n addNewBullet2(quickTower1.towerX, quickTower1.towerY, enemy.getStartPosX(),\n enemy.getStartPosY(), 5);\n quickTower1.lastShot = timeSinceStart;\n }\n }\n\n }\n }\n\n //A spawn is in progress\n if (spawninProgress) {\n timePassedEnemy += delta;\n if (timePassedEnemy > 800) {\n enemies.add(new Enemy());\n enemySpawns++;\n timePassedEnemy = 0;\n }\n }\n //When enough enemies has spawned, stop the spawninProgress\n if (enemySpawns == enemyCounter) {\n spawninProgress = false;\n //hasbeenDead = false;\n enemySpawns = 0;\n enemyCounter++;\n }\n\n //When no more enemies on maps\n if (enemies.size() == 0) {\n waveinProgress = false;\n startWaveCount = 0;\n }\n\n //Start a new level when there's no more enemies on the map\n if (loadMap.MAP[mouseY / w][mouseX / w] == 16) {\n if (input.isMousePressed(0) && startWaveCount == 0 && !waveinProgress) {\n startWaveCount++;\n if (startWaveCount == 1 && enemies.size() == 0 && !waveinProgress) {\n waveinProgress = true;\n gc.resume();\n spawninProgress = true;\n currentLevel++;\n }\n }\n }\n\n //For each new level, increase the HP of each enemy\n if (currentLevel < currentLevel + 1 && !waveinProgress) {\n for (Enemy enemyHP : enemies) {\n if (enemyHP.getStartPosX() <= 0 && enemyHP.getHP() < enemyHP.startHP + currentLevel) {\n enemyHP.setHP(enemyHP.getHP() + currentLevel);\n }\n }\n }\n\n\n //For each enemies, if enemies has finished their way, decrease player HP\n //and set them inactive\n for (Enemy enemyList : enemies) {\n if (enemyList.counter >= enemyList.path.getLength() - 1) {\n player.decreaseLife();\n bulletCount = 0;\n enemyList.isActive = false;\n }\n\n //If enemies' hp is zero, set them inactive and remove from the list\n if (enemyList.getHP() <= 0) {\n enemyList.isActive = false;\n bulletCount = 0;\n player.addCredits(20);\n }\n enemyList.update(gc, stateBasedGame, delta);\n }\n for (int i = 0; i < enemies.size(); i++) {\n if (!enemies.get(i).isActive) {\n enemies.remove(enemies.get(i));\n }\n }\n\n //For all objects, update\n for (GameObject obj : objects)\n try {\n obj.update(gc, stateBasedGame, delta);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n //Go to Menu\n if (gc.getInput().isKeyPressed(Input.KEY_ESCAPE)) {\n gc.getInput().clearKeyPressedRecord();\n stateBasedGame.enterState(2);\n }\n\n\n }", "public void gameLoop() {\r\n // make the whites of the eyes move from side to side\r\n if (whiteRight == 210){\r\n whiteRight += 20;\r\n }\r\n else if (whiteRight == 230){\r\n whiteRight -= 30;\r\n }\r\n else if (whiteRight == 200){\r\n whiteRight += 10;\r\n }\r\n if (whiteLeft == 350){\r\n whiteLeft += 20;\r\n }\r\n else if (whiteLeft == 370){\r\n whiteLeft -= 30;\r\n }\r\n else if (whiteLeft == 340){\r\n whiteLeft += 10;\r\n }\r\n // make the eyebrows move up and down\r\n if (eyebrowMove == 150){\r\n eyebrowMove -= 100;\r\n }\r\n else if (eyebrowMove == 50){\r\n eyebrowMove += 100;\r\n }\r\n // make the mustache move up and down\r\n if (mustache == 590){\r\n mustache +=20;\r\n }\r\n else if (mustache == 610){\r\n mustache -=40;\r\n }\r\n else if (mustache == 570){\r\n mustache +=20;\r\n }\r\n // make the tongue move up and down\r\n if (tongue == 700){\r\n tongue += 15;\r\n }\r\n else if (tongue == 715){\r\n tongue -= 15;\r\n }\r\n }", "public void onUpdate()\n {\n this.prevPosX = this.posX;\n this.prevPosY = this.posY;\n this.prevPosZ = this.posZ;\n this.motionY -= 0.03999999910593033D;\n this.moveEntity(this.motionX, this.motionY, this.motionZ);\n this.motionX *= 0.9800000190734863D;\n this.motionY *= 0.9800000190734863D;\n this.motionZ *= 0.9800000190734863D;\n\n if (this.onGround)\n {\n this.motionX *= 0.699999988079071D;\n this.motionZ *= 0.699999988079071D;\n this.motionY *= -0.5D;\n }\n\n if (this.fuse-- <= 0)\n {\n if (!this.worldObj.isRemote)\n {\n this.setDead();\n this.explode();\n }\n } else\n {\n this.worldObj.spawnParticle(\"smoke\", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);\n }\n }", "public void changePos() {\r\n\r\n // Add timeCount\r\n timeCount += 20;\r\n\r\n // Orange\r\n orangeY += 12;\r\n\r\n float orangeCenterX = orangeX + orange.getWidth() / 2;\r\n float orangeCenterY = orangeY + orange.getHeight() / 2;\r\n\r\n if (hitCheck(orangeCenterX, orangeCenterY)) {\r\n orangeY = frameHeight + 100;\r\n score += 10;\r\n soundPlayer.playHitOrangeSound();\r\n }\r\n\r\n if (orangeY > frameHeight) {\r\n orangeY = -100;\r\n orangeX = (float) Math.floor(Math.random() * (frameWidth - orange.getWidth()));\r\n }\r\n orange.setX(orangeX);\r\n orange.setY(orangeY);\r\n\r\n // Pink\r\n if (!pink_flg && timeCount % 10000 == 0) {\r\n pink_flg = true;\r\n pinkY = -20;\r\n pinkX = (float) Math.floor(Math.random() * (frameWidth - pink.getWidth()));\r\n }\r\n\r\n if (pink_flg) {\r\n pinkY += 20;\r\n\r\n float pinkCenterX = pinkX + pink.getWidth() / 2;\r\n float pinkCenterY = pinkY + pink.getWidth() / 2;\r\n\r\n if (hitCheck(pinkCenterX, pinkCenterY)) {\r\n pinkY = frameHeight + 30;\r\n score += 30;\r\n // Change FrameWidth\r\n if (initialFrameWidth > frameWidth * 110 / 100) {\r\n frameWidth = frameWidth * 110 / 100;\r\n changeFrameWidth(frameWidth);\r\n }\r\n soundPlayer.playHitPinkSound();\r\n }\r\n\r\n if (pinkY > frameHeight) pink_flg = false;\r\n pink.setX(pinkX);\r\n pink.setY(pinkY);\r\n }\r\n\r\n if (level.equals(\"easy\")) {\r\n blackY += 18;\r\n } else if (level.equals(\"medium\")) {\r\n blackY += 34;\r\n\r\n } else if (level.equals(\"hard\")) {\r\n blackY += 50;\r\n }\r\n\r\n\r\n float blackCenterX = blackX + black.getWidth() / 2;\r\n float blackCenterY = blackY + black.getHeight() / 2;\r\n\r\n if (hitCheck(blackCenterX, blackCenterY)) {\r\n blackY = frameHeight + 100;\r\n\r\n // Change FrameWidth\r\n frameWidth = frameWidth * 80 / 100;\r\n changeFrameWidth(frameWidth);\r\n soundPlayer.playHitBlackSound();\r\n if (frameWidth <= boxSize) {\r\n gameOver();\r\n }\r\n\r\n }\r\n\r\n if (blackY > frameHeight) {\r\n blackY = -100;\r\n blackX = (float) Math.floor(Math.random() * (frameWidth - black.getWidth()));\r\n }\r\n\r\n black.setX(blackX);\r\n black.setY(blackY);\r\n\r\n // Move Box\r\n if (action_flg) {\r\n // Touching\r\n boxX += 14;\r\n box.setImageDrawable(imageBoxRight);\r\n } else {\r\n // Releasing\r\n boxX -= 14;\r\n box.setImageDrawable(imageBoxLeft);\r\n }\r\n\r\n // Check box position.\r\n if (boxX < 0) {\r\n boxX = 0;\r\n box.setImageDrawable(imageBoxRight);\r\n }\r\n if (frameWidth - boxSize < boxX) {\r\n boxX = frameWidth - boxSize;\r\n box.setImageDrawable(imageBoxLeft);\r\n }\r\n\r\n box.setX(boxX);\r\n String b = \"Score : \" + score;\r\n scoreLabel.setText(b);\r\n\r\n }", "@Override\n\tpublic void onUpdate()\n\t{\n\t\tthis.lastTickPosX = this.posX;\n\t\tthis.lastTickPosY = this.posY;\n\t\tthis.lastTickPosZ = this.posZ;\n\t\tsuper.onUpdate();\n\n\t\tif (this.throwableShake > 0)\n\t\t{\n\t\t\t--this.throwableShake;\n\t\t}\n\n\t\tif (this.inGround)\n\t\t{\n\t\t\tif (this.worldObj.getBlockState(this.getPosition()).getBlock() == this.inTile)\n\t\t\t{\n\t\t\t\t++this.ticksInGround;\n\n\t\t\t\tif (this.ticksInGround == 1200)\n\t\t\t\t{\n\t\t\t\t\tthis.setDead();\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.inGround = false;\n\t\t\tthis.motionX *= this.rand.nextFloat() * 0.2F;\n\t\t\tthis.motionY *= this.rand.nextFloat() * 0.2F;\n\t\t\tthis.motionZ *= this.rand.nextFloat() * 0.2F;\n\t\t\tthis.ticksInGround = 0;\n\t\t\tthis.ticksInAir = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t++this.ticksInAir;\n\t\t}\n\n\t\tVec3 vec3 = new Vec3(this.posX, this.posY, this.posZ);\n\t\tVec3 vec31 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);\n\t\tMovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31);\n\t\tvec3 = new Vec3(this.posX, this.posY, this.posZ);\n\t\tvec31 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);\n\n\t\tif (movingobjectposition != null)\n\t\t{\n\t\t\tvec31 = new Vec3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);\n\t\t}\n\n\t\tif (!this.worldObj.isRemote)\n\t\t{\n\t\t\tEntity entity = null;\n\t\t\tList list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this,\n\t\t\t\t\tthis.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));\n\t\t\tdouble d0 = 0.0D;\n\t\t\tEntityLivingBase entitylivingbase = this.getThrower();\n\n\t\t\tfor (Object obj : list)\n\t\t\t{\n\t\t\t\tEntity entity1 = (Entity) obj;\n\n\t\t\t\tif (entity1.canBeCollidedWith() && ((entity1 != entitylivingbase) || (this.ticksInAir >= 5)))\n\t\t\t\t{\n\t\t\t\t\tfloat f = 0.3F;\n\t\t\t\t\tAxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand(f, f, f);\n\t\t\t\t\tMovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);\n\n\t\t\t\t\tif (movingobjectposition1 != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble d1 = vec3.distanceTo(movingobjectposition1.hitVec);\n\n\t\t\t\t\t\tif ((d1 < d0) || (d0 == 0.0D))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tentity = entity1;\n\t\t\t\t\t\t\td0 = d1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (entity != null)\n\t\t\t{\n\t\t\t\tmovingobjectposition = new MovingObjectPosition(entity);\n\t\t\t}\n\t\t}\n\n\t\tif (movingobjectposition != null)\n\t\t{\n\t\t\tif ((movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)\n\t\t\t\t\t&& (this.worldObj.getBlockState(movingobjectposition.getBlockPos()).getBlock() == Blocks.portal))\n\t\t\t{\n\t\t\t\tthis.inPortal = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.onImpact(movingobjectposition);\n\t\t\t}\n\t\t}\n\n\t\tthis.posX += this.motionX;\n\t\tthis.posY += this.motionY;\n\t\tthis.posZ += this.motionZ;\n\t\tfloat f1 = MathHelper.sqrt_double((this.motionX * this.motionX) + (this.motionZ * this.motionZ));\n\t\tthis.rotationYaw = (float) ((Math.atan2(this.motionX, this.motionZ) * 180.0D) / Math.PI);\n\n\t\tfor (this.rotationPitch = (float) ((Math.atan2(this.motionY, f1) * 180.0D) / Math.PI); (this.rotationPitch\n\t\t\t\t- this.prevRotationPitch) < -180.0F; this.prevRotationPitch -= 360.0F)\n\t\t{\n\t\t}\n\n\t\twhile ((this.rotationPitch - this.prevRotationPitch) >= 180.0F)\n\t\t{\n\t\t\tthis.prevRotationPitch += 360.0F;\n\t\t}\n\n\t\twhile ((this.rotationYaw - this.prevRotationYaw) < -180.0F)\n\t\t{\n\t\t\tthis.prevRotationYaw -= 360.0F;\n\t\t}\n\n\t\twhile ((this.rotationYaw - this.prevRotationYaw) >= 180.0F)\n\t\t{\n\t\t\tthis.prevRotationYaw += 360.0F;\n\t\t}\n\n\t\tthis.rotationPitch = this.prevRotationPitch + ((this.rotationPitch - this.prevRotationPitch) * 0.2F);\n\t\tthis.rotationYaw = this.prevRotationYaw + ((this.rotationYaw - this.prevRotationYaw) * 0.2F);\n\t\tfloat f2 = 0.99F;\n\t\tfloat f3 = this.getGravityVelocity();\n\n\t\tif (this.isInWater())\n\t\t{\n\t\t\tfor (int i = 0; i < 4; ++i)\n\t\t\t{\n\t\t\t\tfloat f4 = 0.25F;\n\t\t\t\tthis.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - (this.motionX * f4), this.posY - (this.motionY * f4),\n\t\t\t\t\t\tthis.posZ - (this.motionZ * f4), this.motionX, this.motionY, this.motionZ);\n\t\t\t}\n\n\t\t\tf2 = 0.8F;\n\t\t}\n\n\t\tthis.motionX *= f2;\n\t\tthis.motionY *= f2;\n\t\tthis.motionZ *= f2;\n\t\tthis.motionY -= f3;\n\t\tthis.setPosition(this.posX, this.posY, this.posZ);\n\t}", "private void action() {\r\n moveSnake();\r\n if (hasEatenPowerUp() == false) checkForCollisionWithSelf();\r\n if (hasHitBoundry() == false) redraw();\r\n }", "void tick() {\n\t\tif (playing) {\n\t\t\t// Advance the paddle and ball in their current direction.\n\t\t\tpaddle.move();\n\t\t\tball.move();\n\t\t\t\n\t\t\t//Ball intersects Paddle \n\t\t\tif (ball.intersects(paddle) != 0) {\n\t\t\t\tball.hitObj(paddle, ball.intersects(paddle));\n\t\t\t}\n\t\t\t//Ball intersects Brick. If Intersects then set Brick DNE accordingly \n\t\t\tbrickArray = bricks.getBricksArray();\n\t\t\tfor (int x = 0; x < Bricks.getColumns(); x++) {\n\t\t\t\tfor (int y = 0; y < Bricks.getRows(); y++) {\n\t\t\t\t\tbrick = brickArray[x][y];\n\t\t\t\t\tif (ball.intersects(brick) != 0 && brick.exists()) {\n\t\t\t\t\t\tball.hitObj(brick, ball.intersects(brick));\n\t\t\t\t\t\tbrick.setDNE();\n\t\t\t\t\t\t/*if (!brick.containsPowerUp()) {\n\t\t\t\t\t\t\tpowerUp = PowerUps.createPowerUp();\n\t\t\t\t\t\t\tpowerUp.move();\n\t\t\t\t\t\t}*/ // Setting up the framework for PowerUps \n\t\t\t\t\t\tcurrScoreVal++; // Incrementing Score by 1\n\t\t\t\t\t\tyourScore.setText(\"Your Score: \" + currScoreVal.toString());\n\t\t\t\t\t\tstatus.setText(\"Good job!\");\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tball.hitWall();\n\n\t\t\t\t// check for the round end/lose a life conditions\n\t\t\t\tif (livesLeft != 0) {\n\t\t\t\t\tif (ball.getPy() >= COURT_HEIGHT - 10) {\n\t\t\t\t\t\tplaying = true;\n\t\t\t\t\t\tstatus.setText(\"You lost a life! Get Ready!\");\n\t\t\t\t\t\trepaint();\n\t\t\t\t\t\tlivesLeft--;\n\t\t\t\t\t\tint timedelay = 2000;\n\t\t\t\t\t\tif (livesLeft == 0) {\n\t\t\t\t\t\t\ttimedelay = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlives.setText(\" Lives: \" + livesLeft.toString() + \"| \");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(timedelay);\n\t\t\t\t\t\t} catch (InterruptedException ex) {\n\t\t\t\t\t\t\tThread.currentThread().interrupt();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tball.setPx(250);\n\t\t\t\t\t\tball.setPy(170);\n\t\t\t\t\t\tball.setVx(-2);\n\t\t\t\t\t\tball.setVy(-3);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Finish Game Conditions\n\t\t\t\tif (livesLeft == 0 || currScoreVal == Bricks.getBlocksCreated()) {\n\t\t\t\t\tplaying = false;\n\t\t\t\t\tif (currScoreVal < Bricks.getBlocksCreated()){\n\t\t\t\t\tstatus.setText(\"You lose!\");\n\t\t\t\t\t}\n\t\t\t\t\tif (currScoreVal == Bricks.getBlocksCreated()){\n\t\t\t\t\tstatus.setText(\"You Win!\");\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tString[] options = { \"Yes\", \"No\", \"Save Score\" };\n\t\t\t\t\tint response = JOptionPane.showOptionDialog(null,\n\t\t\t\t\t\t\t\"Your Final Score:\" + currScoreVal + \"\\n\" + \"Start New Game?\\n\", \"Game Over\",\n\t\t\t\t\t\t\tJOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, options[0]);\n\n\t\t\t\t\tif (response == 0) {\n\t\t\t\t\t\treset();\n\t\t\t\t\t}\n\t\t\t\t\telse if (response == 1) {\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t\t//Handling the Highscores. Only the Top 5 are Printed \n\t\t\t\t\telse if (response == 2) {\n\t\t\t\t\t\tString name = JOptionPane.showInputDialog(\"Enter your name?\");\n\t\t\t\t\t\tHighscores.addNewScore(currScoreVal,name);\n\t\t\t\t\t\tHighscores.writeFile();\n\t\t\t\t\t\tJDialog highScoreDialog = new JDialog();\n\t\t\t\t\t\tJPanel highscores = new JPanel();\n\t\t\t\t\t\thighscores.setLayout(new BoxLayout(highscores, BoxLayout.PAGE_AXIS));\n\t\t\t\t\t\tArrayList<String> entries = Highscores.topFiveEntries();\n\t\t\t\t\t\tJLabel highScore1 = new JLabel(\" 1: \" + entries.get(0));\n\t\t\t\t\t\tJLabel highScore2 = new JLabel(\" 2: \" + entries.get(1));\n\t\t\t\t\t\tJLabel highScore3 = new JLabel(\" 3: \" + entries.get(2));\n\t\t\t\t\t\tJLabel highScore4 = new JLabel(\" 4: \" + entries.get(3));\n\t\t\t\t\t\tJLabel highScore5 = new JLabel(\" 5: \" + entries.get(4));\n\t\t\t\t\t\tJLabel highscoreTitle = new JLabel(\" ~~~~~~TOP 5 HIGHSCORES~~~~~\");\n\t\t\t\t\t\thighscores.add(highscoreTitle);\n\t\t\t\t\t\thighscores.add(highScore1);\n\t\t\t\t\t\thighscores.add(highScore2);\n\t\t\t\t\t\thighscores.add(highScore3);\n\t\t\t\t\t\thighscores.add(highScore4);\n\t\t\t\t\t\thighscores.add(highScore5);\n\t\t\t\t\t\thighScoreDialog.add(highscores);\n\t\t\t\t\t\thighScoreDialog.pack();\n\t\t\t\t\t\thighScoreDialog.setSize(300, 300);\n\t\t\t\t\t\thighscores.setVisible(true);\n\t\t\t\t\t\thighScoreDialog.setLocationRelativeTo(null);\n\t\t\t\t\t\thighScoreDialog.setVisible(true);\n\t\t\t\t\t\tcurrScoreVal = 0;\n\t\t\t\t\t\tlivesLeft = 3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// update the display\n\t\t\t\trepaint();\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void update() {\n\t\tAlly.update();\r\n\t\tEnemy.update();\r\n\t\tfor(int i = 0 ; i < GroundList.size();i++){\r\n\t\t\tif(GroundList.get(i).kill) {\r\n\t\t\t\tGroundList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < BarelList.size(); i++) {\r\n\t\t\tif(BarelList.get(i).kill) {\r\n\t\t\t\tBarelList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < WoodList.size(); i++) {\r\n\t\t\tif(WoodList.get(i).kill) {\r\n\t\t\t\tWoodList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < FireBallList.size(); i++) {\r\n\t\t\tif(FireBallList.get(i).kill) {\r\n\t\t\t\tFireBallList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < BulletList.size(); i++) {\r\n\t\t\tif(BulletList.get(i).kill) {\r\n\t\t\t\tBulletList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i = 0 ; i < GroundList.size();i++){\r\n\t\t\tGroundList.get(i).update();\r\n\t\t}\r\n\t\tfor(int i = 0 ; i < BarelList.size(); i++) {\r\n\t\t\tBarelList.get(i).update();\r\n\t\t}\r\n\t\tfor(int i = 0; i < BulletList.size(); i++) {\r\n\t\t\tBulletList.get(i).update();\r\n\t\t}\r\n\t\tfor(int i = 0; i < FireBallList.size(); i++) {\r\n\t\t\tFireBallList.get(i).update();\r\n\t\t}\r\n\t\tfor(int i = 0; i < WoodList.size(); i++) {\r\n\t\t\tWoodList.get(i).update();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(GamePanel.updateTimes%60 == 0) {\r\n\t\t\tEnemy.PushEntity(2, new Vector2f(width*1/2, height/4),enemy);\r\n\t\t}\r\n\t\tfor(int i = 0; i < AllyDeadList.size(); i++) {\r\n\t\t\tAlly.entityList.remove(AllyDeadList.get(i)-i);\r\n\t\t}\r\n\t\tfor(int i = 0; i < EnemyDeadList.size(); i++) {\r\n\t\t\tEnemy.entityList.remove(EnemyDeadList.get(i)-i);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tAllyDeadList.clear();\r\n\t\tEnemyDeadList.clear();\r\n\t\tfor(int i = 0; i < Ally.entityList.size(); i++) {\r\n\t\t\tif(Ally.entityList.get(i).returnHealth() <= 0) {\r\n\t\t\t\tAllyDeadList.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < Enemy.entityList.size(); i++) {\r\n\t\t\tif(Enemy.entityList.get(i).returnHealth() <= 0) {\r\n\t\t\t\tEnemyDeadList.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void checkMovedRedraw(){\n if((board.isTreasureCollected() || board.isKeyCollected()) && muteMusic == false){\n music.playAudio(\"PickupSound\");\n }\n renderer.redraw(board, boardCanvas.getWidth(), boardCanvas.getHeight());\n if(board.isChipAlive() == false){\n gamePaused = true;\n timeRuunableThread.setPause(gamePaused);\n if(muteMusic == false){\n music.stopPlayingAudio(\"All\");\n music.playAudio(\"LevelCompleteSound\");\n }\n musicName = \"LevelCompleteSound\";\n JOptionPane.showMessageDialog(null, \"Oops! Better luck next time!\", \"Failed\", 1);\n canLoadGame = false;\n } else if(board.isLevelFinished()){\n gamePaused = true;\n timeRuunableThread.setPause(gamePaused);\n if(muteMusic == false){\n music.stopPlayingAudio(\"All\");\n music.playAudio(\"LevelCompleteSound\");\n }\n musicName = \"LevelCompleteSound\";\n if(level == 1){\n int saveOrNot = JOptionPane.showConfirmDialog(null, \"congratulations! Level 1 passed! Go to next level?\", \"Confirm\", JOptionPane.YES_NO_OPTION);\n if (saveOrNot == 0) { // yes\n level = level + 1;\n newGameStart(level);\n } else {\n gamePaused = true;\n }\n }else if(level == 2){\n JOptionPane.showMessageDialog(null, \"congratulations! Level 2 passed!\", \"Win Level 2\", JOptionPane.INFORMATION_MESSAGE);\n }\n }else if(board.onInfoTile()){\n JOptionPane.showMessageDialog(null, readAllLines(), \"Information\", JOptionPane.INFORMATION_MESSAGE);\n }else{\n try {\n infoCanvas.drawChipsLeftNumber(board.getTreasureRemainingAmount());\n infoCanvas.drawKeysChipsPics();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n }", "private void checkSpikeCollisions() {\n\t\t\n\t\t//check collisions with up spikes\n\t\tint len = upSpikes.size();\n\t\tfor(int i = 0; i < len; i ++) {\n\t\t\tSpike spike = upSpikes.get(i);\n\t\t\t\n\t\t\tif(OverlapTester.overlapCircleRectangle(spike.bounds, player.bounds)) {\n\t\t\t\tplayerAlive = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//check collisions with down spikes\n\t\tlen = downSpikes.size();\n\t\tfor(int i = 0; i < len; i ++) {\n\t\t\tSpike spike = downSpikes.get(i);\n\t\t\t\n\t\t\tif(OverlapTester.overlapCircleRectangle(spike.bounds, player.bounds)) {\n\t\t\t\tplayerAlive = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//check collisions with right spikes\n\t\tlen = rightSpikes.size();\n\t\tfor(int i = 0; i < len; i ++) {\n\t\t\tSpike spike = rightSpikes.get(i);\n\t\t\t\n\t\t\tif(OverlapTester.overlapCircleRectangle(spike.bounds, player.bounds)) {\n\t\t\t\tplayerAlive = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//check collisions with left spikes\n\t\tlen = leftSpikes.size();\n\t\tfor(int i = 0; i < len; i ++) {\n\t\t\tSpike spike = leftSpikes.get(i);\n\t\t\t\n\t\t\tif(OverlapTester.overlapCircleRectangle(spike.bounds, player.bounds)) {\n\t\t\t\tplayerAlive = false;\n\t\t\t}\n\t\t}\n\t}", "public void update(){\n if(newPlayer.getRunning()) {\n\n if (botborder.isEmpty())\n {\n newPlayer.setRunning(false);\n return;\n }\n if (topborder.isEmpty())\n {\n newPlayer.setRunning(false);\n return;\n }\n\n background.update();\n newPlayer.update();\n\n\n //A threshold that the border can have based on the score\n maxBorderHeight = 30+newPlayer.getScore()/difficulty;\n if (maxBorderHeight > height/4){\n maxBorderHeight = height/4;\n minBorderHeight = 5+newPlayer.getScore()/difficulty;\n }\n\n for (int i = 0; i < topborder.size(); i++){\n if (collision(topborder.get(i), newPlayer)){\n newPlayer.setRunning(false);\n }\n }\n for (int i = 0; i < botborder.size(); i++){\n if (collision(botborder.get(i), newPlayer)){\n newPlayer.setRunning(false);\n }\n }\n\n this.updateTopBorder();\n //Create the borders\n this.updateBotBorder();\n\n //Adds smoke from spaceship from the timer\n long timeElapsed = (System.nanoTime() - outTimer)/1000000;\n if(timeElapsed > 120){\n effect.add(new Effects(newPlayer.getX(), newPlayer.getY()+30)); //Balls will appear out of backside of spaceship.\n outTimer = System.nanoTime();\n }\n for (int i = 0; i < effect.size(); i++){\n //Go through every ball and then update\n effect.get(i).update();\n if (effect.get(i).getX()<-10){\n effect.remove(i); //Removes the balls that are off the screen\n }\n }\n\n //Adds enemies in, first one in middle, rest are random\n long enemyElapsed = (System.nanoTime()- enemyStart)/1000000;\n //Higher the score is, the less delay there is\n if (enemyElapsed> (1500 - newPlayer.getScore()/4)){\n\n if (enemy.size() == 0){\n enemy.add(new Enemy(BitmapFactory.decodeResource(getResources(),R.drawable.enemy1), width+10, height + 50,25, 30, 30, 1));\n }\n else {\n enemy.add(new Enemy(BitmapFactory.decodeResource(getResources(),R.drawable.enemy1), width + 10, (int) (rng.nextDouble()*(height-(maxBorderHeight*2))+maxBorderHeight),25,30, newPlayer.getScore(), 1));\n }\n //Reset Timer\n enemyStart = System.nanoTime();\n\n }\n\n long shipElapsed = (System.nanoTime()-secondaryTimer)/1000000;\n\n\n if (newPlayer.getScore() == 150){\n level = 2;\n }\n\n //Randomised spot for secondary enemy\n if (newPlayer.getScore()%150==0) {\n if (newEnemy.size() == 0) {\n newEnemy.add(new secondaryEnemy(BitmapFactory.decodeResource(getResources(), R.drawable.enemy2), width + 5, (int) (rng.nextDouble() * (height - (maxBorderHeight * 2)) + maxBorderHeight), 32, 26, 5, 1));\n newEnemy.add(new secondaryEnemy(BitmapFactory.decodeResource(getResources(), R.drawable.enemy2), width + 5, (int) (rng.nextDouble() * (height - (maxBorderHeight * 2)) + maxBorderHeight), 32, 26, 5, 1));\n }\n\n secondaryTimer = System.nanoTime();\n }\n\n long thirdElapsed = (System.nanoTime()- tertiaryTimer)/1000000;\n\n if (newPlayer.getScore() == 300){\n level = 3;\n }\n if (level == 3) {\n if (enemyElapsed> (1500 - newPlayer.getScore()/4))\n\n //CHANGE THIS YOU PLEB!!!!\n if (thirdEnemy.size() == 0) {\n thirdEnemy.add(new thirdShip(BitmapFactory.decodeResource(getResources(), R.drawable.longship), width + 10, (int) (rng.nextDouble() * (height - (maxBorderHeight * 2)) + maxBorderHeight), 31, 49, 45, 1));\n } else {\n thirdEnemy.add(new thirdShip(BitmapFactory.decodeResource(getResources(), R.drawable.longship), width + 10, (int) (rng.nextDouble() * (height - (maxBorderHeight * 2)) + maxBorderHeight), 31, 49, newPlayer.getScore()/4, 1));\n }\n\n //Reset Timer\n tertiaryTimer = System.nanoTime();\n }\n\n //Go through every enemy and collision will check if two game objects are colliding.\n for (int i = 0; i < enemy.size(); i++){\n enemy.get(i).update();\n if(collision(enemy.get(i), newPlayer)){\n enemy.remove(i);\n newPlayer.setRunning(false);\n break;\n }\n if (enemy.get(i).getX()<-100){\n enemy.remove(i);\n break;\n }\n }\n\n for (int i = 0; i < newEnemy.size(); i++) {\n newEnemy.get(i).update();\n if (collision(newEnemy.get(i), newPlayer)) {\n newEnemy.remove(i);\n newPlayer.setRunning(false);\n break;\n }\n if (newEnemy.get(i).getX() < -100) {\n newEnemy.remove(i);\n break;\n }\n }\n\n for (int i = 0; i < thirdEnemy.size(); i++) {\n thirdEnemy.get(i).update();\n if (collision(thirdEnemy.get(i), newPlayer)) {\n thirdEnemy.remove(i);\n newPlayer.setRunning(false);\n break;\n }\n if (thirdEnemy.get(i).getX() < -100) {\n thirdEnemy.remove(i);\n break;\n }\n }\n\n }\n else {\n //Reset the acceleration of the player, if not reset then the start death animation will occur and everything will reset\n newPlayer.resetAcceleration();\n if (!reset){\n gamenew = false;\n startDeath = System.nanoTime();\n reset = true;\n disappear = true;\n death = new deathAnimation(BitmapFactory.decodeResource(getResources(),R.drawable.damage), newPlayer.getX(),newPlayer.getY()-30,329,137,1);\n level = 1;\n }\n death.update();\n\n long timeElapsed = (System.nanoTime()-startDeath)/1000000;\n\n //If time has passed and there is no new game yet, then create a new game.\n if (timeElapsed > 2500 && !gamenew){\n newGame();\n }\n\n }\n }", "public void refreshRobots() {\r\n\t\tfor (Robot curRobot : this.robots) {\r\n\t\t\tif (curRobot.isAlive()) {\r\n\t\t\t\tcurRobot.setMovement(refSheet.getMovement(curRobot.getType()));\r\n\t\t\t\tcurRobot.setFired(false);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void update() {\n if (player.getPlaying()) { //if player alive\n bg.update(); //update background\n player.update(); //update player\n //player collision detection, if player hits any baddies or their bullets is playing sets to false\n for (int i = 0; i < gargants.size(); i++) {\n if (collision(gargants.get(i), player)) {\n //gargants.remove(i);\n player.setPlaying(false);\n\n }\n for (int j = 0; j < demons.size(); j++) {\n if (collision(demons.get(j), player)) {\n //demons.remove(j);\n player.setPlaying(false);\n\n }\n for (int k = 0; k < dragons.size(); k++) {\n if (collision(dragons.get(k), player)) {\n //dragons.remove(k);\n player.setPlaying(false);\n\n }\n for (int l = 0; l < demonShots.size(); l++) {\n if (collision(demonShots.get(l), player)) {\n //demonShots.remove(l);\n player.setPlaying(false);\n\n }\n\n }\n }\n }\n }\n\n for (int i = 0; i < bullets.size(); i++) { //for each bullet\n bullets.get(i).update(); //update them\n if (bullets.get(i).getX() > WIDTH + 10) {\n bullets.remove(i); //if off screen delete\n }\n }\n\n for (int i = 0; i < demonShots.size(); i++) { // for each demon bullet\n demonShots.get(i).update(); //update them\n if (demonShots.get(i).getX() < -100) {\n demonShots.remove(i); //if off screen delete\n }\n }\n\n long gargantElapseTime = (System.nanoTime() - gargantStartTime) / 1000000;\n if (gargantElapseTime > (1200 - player.getScore() / 3)) { //as score increases, more will spawn\n gargants.add(new Gargant(BitmapFactory.decodeResource(getResources(), R.drawable.gargant), WIDTH + 10, (int) (rand.nextDouble() * (HEIGHT)), 64, 64, 8));\n if (gargants.size() >= 13) { //limit amount of this enemy to 13\n gargants.remove(gargants.size() - 1);\n }\n gargantStartTime = System.nanoTime();\n }\n for (int i = 0; i < gargants.size(); i++) { // for each gargant\n gargants.get(i).update(); //update them\n for (int j = 0; j < bullets.size(); j++) {\n if (collision(gargants.get(i), bullets.get(j))) {\n //when shot remove enemy and bullet\n gargants.remove(i);\n bullets.remove(j);\n player.addScore(10); //10 score for these guys\n break;\n }\n }\n if (gargants.get(i).getX() < -100) {\n gargants.remove(i); //if off screen remove\n }\n }\n\n if (level >= 3) { //only spawn demon above level 3\n long demonElapseTime = (System.nanoTime() - demonStartTime) / 1000000;\n if (demonElapseTime > (12000 - player.getScore() / 3)) { //as score increases, more will spawn\n demons.add(new Demon(BitmapFactory.decodeResource(getResources(), R.drawable.demon), WIDTH + 10, (int) (rand.nextDouble() * (HEIGHT)), 64, 64, 8));\n if (demons.size() >= 10) { //limit amount of this enemy to 10\n demons.remove(demons.size() - 1);\n }\n demonStartTime = System.nanoTime();\n }\n for (int i = 0; i < demons.size(); i++) { //for each demon\n demons.get(i).update(); //update them\n int n = rand.nextInt(1001); //random int between 1 and 1000\n if (n > 980) { //if random int > 980 shoot demon bullet\n demonShots.add(new HellFire(BitmapFactory.decodeResource(getResources(), R.drawable.hellfire_0), demons.get(i).getX(), demons.get(i).getY(), 64, 64));\n }\n for (int j = 0; j < bullets.size(); j++) {\n if (collision(demons.get(i), bullets.get(j))) {\n demonHitCount++; //each hit with bullet increases hitcount\n bullets.remove(j);\n if (demonHitCount >= 10) { //when hit more than 10 times it dies\n demonHitCount = 0;\n demons.remove(i);\n bullets.remove(j);\n player.addScore(100); //100 score for these big bois\n }\n }\n }\n if (demons.get(i).getX() < -100) {\n demons.remove(i); //if off screen delete\n }\n }\n }\n\n\n if (level >= 2) { //only spawn dragon above level 3\n long dragonElapseTime = (System.nanoTime() - dragonStartTime) / 1000000;\n if (dragonElapseTime > (6000 - player.getScore() / 3)) { //as score increases, more will spawn\n dragons.add(new Dragon(BitmapFactory.decodeResource(getResources(), R.drawable.dragon), WIDTH + 10, (int) (rand.nextDouble() * (HEIGHT)), 128, 128, 8));\n if (dragons.size() >= 5) { //dragons limitted to only 5\n dragons.remove(dragons.size() - 1);\n }\n dragonStartTime = System.nanoTime();\n }\n for (int i = 0; i < dragons.size(); i++) {\n dragons.get(i).update();\n for (int j = 0; j < bullets.size(); j++) {\n if (collision(dragons.get(i), bullets.get(j))) {\n dragonHitCount++; //if hit increase hitcount\n bullets.remove(j);\n if (dragonHitCount >= 4) { //when hit 4 times it dies\n dragonHitCount = 0;\n dragons.remove(i);\n bullets.remove(j);\n player.addScore(25); //25 score for dragons\n }\n break;\n }\n }\n if (dragons.get(i).getX() < -100) {\n dragons.remove(i); //when off screen remove\n }\n }\n }\n }\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}", "public void checkConditions(){\n\t\t// check game over conditions\n\t\tif(!status.isGameOver() && status.isGameStarted()){\n\t\t\tif(status.getShipsLeft() == 0){\n\t\t\n\t\t\t\tsoundMan.StopMusic3();\n\t\t\t\tsoundMan.StopMusic4();\n\t\t\t\tsoundMan.StopMusic5();\n\t\t\t\tsoundMan.StopMusic6();\n\t\t\t\tsoundMan.BackgroundMusic2();\n\t\t\t\tgameOver();\n\t\t\t\tsoundMan.StopMusic();\n\t\t\t}\n\t\t}\n\t\tif(!status.isGameOver() && status.isBossDestroyed()&& status.isGameStarted()){\n\t\t\tif(status.isBossDestroyed()){\n\t\t\t\tsoundMan.StopMusic5();\n\t\t\t\tsoundMan.BackgroundMusic4();\n\t\t\t\tgameWinner();\n\n\t\t\t}\n\n\t\t}\n\t}", "public void update()\n\t{\n\t\tgrid.draw();\n\t\tmonsterSpawner.update();\n\t\tjewelSpawner.update();\n\t\t\n\t\tint numOnCenter = 0;\n\t\tfor (Player player : players)\n\t\t\tif (player.getSprite().onCenterArea())\n\t\t\t\tnumOnCenter++;\n\t\tfor (Player player : players) {\n\t\t\tif (numOnCenter < 2 && player.getSprite().onCenterArea())\n\t\t\t\tplayer.addScore(Clock.getSeconds());\n\t\t\tplayer.update();\n\t\t}\n\t\tfor (Iterator<Projectile> iterator = projectiles.iterator(); iterator.hasNext();) {\n\t\t\tProjectile projectile = iterator.next();\n\t\t\tif (!projectile.exists())\n\t\t\t\titerator.remove();\n\t\t\telse\n\t\t\t\tprojectile.update();\n\t\t}\n\t\t\n\t\tui.update();\n\t\tfor (int i = traps.size() - 1; i >= 0; i--)\n\t\t{\n\t\t\tTrap trap = traps.get(i);\n\t\t\ttrap.update();\n\t\t\tif (!trap.exists())\n\t\t\t{\n\t\t\t\ttraps.remove(i);\n\t\t\t\tgrid.removeEntity(trap.getCurrentTile());\n\t\t\t}\n\t\t}\n\t}", "public void update()\n\t{\n\t\tgameTime++;\n\t\tfor(int i = 0; i<gameObj.length; i++)\n\t\t{\n\t\t\tfor(int j = 0; j < gameObj[i].size(); j++)\n\t\t\t{\n\t\t\t\t/*If the object implements movable\n\t\t\t\t * call the move method in each object\n\t\t\t\t */\n\t\t\t\tif(gameObj[i].get(j) instanceof Imovable)\n\t\t\t\t\t((MovableObject)gameObj[i].get(j)).move();\n\t\t\t\t/*call CheckBlink() method in SpaceStation\n\t\t\t\t * if the time % blinkRate == 0\n\t\t\t\t * the visibility with be switched\n\t\t\t\t */\n\t\t\t\tif(gameObj[i].get(j) instanceof SpaceStation)\n\t\t\t\t\t((SpaceStation)gameObj[i].get(j)).checkBlink(gameTime);\n\t\t\t\t/*check if missiles are out of fuel\n\t\t\t\tand remove if fuel = 0\n\t\t\t\t*/\n\t\t\t\tif(gameObj[i].get(j) instanceof Missile)\n\t\t\t\t\tif(((Missile)gameObj[i].get(j)).getFuel() <= 0)\n\t\t\t\t\t\tgameObj[i].remove(j);\n\t\t\t}\n\t\t}\t\t\n\t\tSystem.out.println(\"World updated\");\n\t}", "void update() {\n for (int i = 0; i < bullets.size(); i++) {//if any bullets expires remove it\n if (bullets.get(i).off) {\n bullets.remove(i);\n i--;\n }\n }\n move();//move everything\n checkPositions();//check if anything has been shot or hit\n }", "private void tick() {\n\n if (StateManager.getState() != null) {\n StateManager.getState().tick();\n }\n this.backgroundFrames--;\n if (this.backgroundFrames == 0) {\n this.backgroundFrames = Const.TOTAL_BACKGROUND_FRAMES;\n }\n//Check all changed variables for the player\n player.tick();\n long elapsed = (System.nanoTime() - time) / (Const.DRAWING_DELAY - (4000 * Enemy.getDifficulty()));\n//Check if enough time is passed to add new enemy or if spawnSpot is available\n if (elapsed > (this.delay - Enemy.getDifficulty() * 300)&& Road.isSpotAvailable()) {\n enemies.add(new Enemy());\n time = System.nanoTime();\n }\n//Loop for checking all changed variables for the enemies and check if they intersects with the player\n for (int j = 0; j < enemies.size(); j++) {\n enemies.get(j).tick();\n if(enemies.get(j).getY() > Const.ROAD_BOTTOM_BORDER + 200){\n Road.getOccupiedSpawnPoints()[Const.SPAWN_POINTS.indexOf(enemies.get(j).getX())] = false;\n player.setScore(player.getScore() + 50);\n enemies.remove(j);\n continue;\n }\n enemyBoundingBox = enemies.get(j).getEnemyRectangle();\n if (player.getBoundingBox().intersects(enemyBoundingBox)) {\n reset();\n if(player.getLives() == 0){\n gameOver();\n }\n break;\n }\n }\n }", "public void playGame()\n {\n while( !over )\n {\n circle.move();\n player.move();\n Circle.collision();\n points++;\n label.setText(\"Points = \" + points);\n if (projectileInitW)\n {projectileW.moveW();}\n if (projectileInitA)\n {projectileA.moveA();}\n if (projectileInitS)\n {projectileS.moveS();}\n if (projectileInitD)\n {projectileD.moveD();}\n try\n {\n Thread.sleep( 17 );//pause for 17 milliseconds\n }\n catch( InterruptedException ex ){}\n Circle.collision();\n this.repaint();//redraw the screen with the updated locations; calls paintComponent below\n }\n track.stop();\n }", "private void wrap() {\n if (myCurrentLeftX % (Grass.TILE_WIDTH * Grass.CYCLE) == 0) {\n if (myLeft) {\n myCowboy.move(Grass.TILE_WIDTH * Grass.CYCLE, 0);\n myCurrentLeftX += (Grass.TILE_WIDTH * Grass.CYCLE);\n for (int i = 0; i < myLeftTumbleweeds.length; i++) {\n myLeftTumbleweeds[i]\n .move(Grass.TILE_WIDTH * Grass.CYCLE, 0);\n }\n for (int i = 0; i < myRightTumbleweeds.length; i++) {\n myRightTumbleweeds[i].move(Grass.TILE_WIDTH * Grass.CYCLE,\n 0);\n }\n } else {\n myCowboy.move(-(Grass.TILE_WIDTH * Grass.CYCLE), 0);\n myCurrentLeftX -= (Grass.TILE_WIDTH * Grass.CYCLE);\n for (int i = 0; i < myLeftTumbleweeds.length; i++) {\n myLeftTumbleweeds[i].move(-Grass.TILE_WIDTH * Grass.CYCLE,\n 0);\n }\n for (int i = 0; i < myRightTumbleweeds.length; i++) {\n myRightTumbleweeds[i].move(-Grass.TILE_WIDTH * Grass.CYCLE,\n 0);\n }\n }\n }\n }", "@Override\n public void update() {\n// if (anim > 10000) anim = 0;\n// else anim++;\n setMousePossition();\n if (feildIsRightClicked()) {\n renderClicks = true;\n cannon.FireCannon();\n }\n else renderClicks = false;\n for (int i = 0; i < projectiles.size(); i++) {\n if (projectiles.get(i).isRemoved()) projectiles.remove(i);\n else projectiles.get(i).update();\n }\n }", "@Override\n\tpublic void update(float delta) {\n\t\tupdateMotion();\n\n\t\t// set position of sprite and update frames\n\t\tsetPosition(body.getWorldCenter().x - getWidth() / 2, body.getWorldCenter().y - 25 / SonicBoom.PPM);\n\t\tsetRegion(getFrame(delta));\n\t\tstateTimer += delta;\n\n\t\t// update ring losing\n\t\tif (loseRing && tempRing > 0) {\n\t\t\tgame.gameObjects.spawnRing(body.getWorldCenter().add(-8 / SonicBoom.PPM, 70 / SonicBoom.PPM),\n\t\t\t\t\tr.nextInt(5) - 2, 3);\n\t\t\ttempRing--;\n\n\t\t\tif (tempRing <= 0) {\n\t\t\t\tloseRing = false;\n\t\t\t}\n\n\t\t\tgame.manager.get(\"Sound/Lose Rings.wav\", Sound.class).play();\n\t\t}\n\n\t\t// hurting time update\n\t\tif (hurt) {\n\t\t\thurtTime -= delta;\n\n\t\t\tif (hurtTime <= 0) {\n\t\t\t\thurt = false;\n\t\t\t}\n\t\t}\n\n\t\t// after dead update\n\t\tif (dead) {\n\t\t\tdeadTime -= delta;\n\n\t\t\tif (deadTime <= 0) {\n\t\t\t\tgame.setUpdateCam(false);\n\t\t\t}\n\t\t}\n\n\t\t// update contactAngle\n\t\tVector2 p1 = contactPoint;\n\t\tVector2 p2 = body.getWorldCenter();\n\n\t\tcontactAngle = (float) (Math.atan2(p2.y - p1.y, p2.x - p1.x) * 180 / Math.PI) - 90;\n\n\t\t// update rotation\n\t\tif (onLoop) {\n\t\t\trotation = contactAngle;\n\t\t\tsetRotation(rotation);\n\n\t\t\tdeLoopTime = delta;\n\t\t} else if (!onLoop && deLoopTime > 0) {\n\t\t\tdeLoopTime -= delta;\n\t\t}\n\t\tif (rotation > 0) {\n\t\t\trotation = rotation < 9.81f ? 0 : rotation - 9.81f;\n\t\t}\n\t\tif (rotation < 0) {\n\t\t\trotation = rotation > -9.81f ? 0 : rotation + 9.81f;\n\t\t}\n\t\tsetRotation(rotation);\n\n\t\t// update wrapper body\n\t\twrapperBody.setTransform(body.getWorldCenter(), (float) Math.toRadians(rotation));\n\n\t}", "public void shootIntoRocket(){\n shoot.set(ROCKET_SHOOT);\n }", "public void rumbleInYourPants() {\n double accel_z = RobotMap.helmsman.getAcceleromoterZ();\n Robot.oi.getXBoxJoystick().setRumble(RumbleType.kLeftRumble, (float) Math.abs(accel_z - 1));\n Robot.oi.getXBoxJoystick().setRumble(RumbleType.kRightRumble, (float) Math.abs(accel_z - 1));\n Robot.oi.getXBoxJoystick2().setRumble(RumbleType.kLeftRumble, (float) Math.abs(accel_z - 1));\n Robot.oi.getXBoxJoystick2().setRumble(RumbleType.kRightRumble, (float) Math.abs(accel_z - 1));\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 void update(double t){\n\t\t\n\t\tthis.scene.clear();\n\t\t\n\t\t//update each sprite\n\t\tfor(int i = 0; i < this.sprites.size(); i++){\n\t\t\t\n\t\t\t//manage keys for background\n\t\t\tif(k.keysDown[k.A]){\n\t\t\t\tthis.sprites.get(i).addVector(90, 0.4);\n\t\t\t}\n\t\t\tif(k.keysDown[k.D]){\n\t\t\t\tthis.sprites.get(i).addVector(270, 0.4);\n\t\t\t}\n\t\t\tif(k.keysDown[k.W]){\n\t\t\t\tthis.sprites.get(i).addVector(180, 0.4);\n\t\t\t}\n\t\t\tif(k.keysDown[k.S]){\n\t\t\t\tthis.sprites.get(i).addVector(0, 0.4);\n\t\t\t}\n\t\t\t\n\t\t\t//apply gravity\n\t\t\tfor(int j = 0; j < this.gravity.size(); j++){\n\t\t\t\tthis.sprites.get(i).addVector(this.gravity.get(j)[0], this.gravity.get(j)[1]);\n\t\t\t}\n\t\t\t\n\t\t\tthis.sprites.get(i).update(t);\n\t\t}//end for\n\t\t\n\t\t//add gravity vectors and check collision\n\t\tfor(int i = 0; i < this.asteroids.size(); i++){\n\t\t\tthis.asteroids.get(i).gravitate();\n\t\t\t\n\t\t\tif(this.asteroids.get(i).collidesWith(this.mainSprite)){\n\t\t\t\tthis.mainSprite.setImage(\"explosion.gif\");\n\t\t\t\tthis.scene.stop();\n\t\t\t\tSystem.out.println(\"YOU LOSE!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t//clean gravity\n\t\twhile(this.gravity.size() > 250){\n\t\t\tthis.gravity.remove(0);\n\t\t}\n\t\t\n\t\t//rotate chests and check chest collision\n\t\tfor(int i = 0; i < this.chests.size(); i++){\n\t\t\t//rotate chests\n\t\t\tthis.chests.get(i).changeImgAngleBy(1);\n\t\t\t\n\t\t\t//check collisions\n\t\t\tif(this.chests.get(i).collidesWith(this.mainSprite)){\n\t\t\t\tthis.chests.get(i).hide();\n\t\t\t\tthis.chests.get(i).collected = true;\n\t\t\t\tthis.collected++;\n\t\t\t\tSystem.out.println(\"You collected a chest!\");\n\t\t\t\tSystem.out.println(this.collected + \" / \" + this.chests.size());\n\t\t\t\t\n\t\t\t\tif(this.collected >= this.chests.size()){\n\t\t\t\t\tSystem.out.println(\"All chests collected. Return to Earth.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//update main sprite\n\t\tthis.mainSprite.checkKeys();\n\t\tthis.mainSprite.update(t);\n\t\t\n\t\t//update compass\n\t\tif(this.collected < this.chests.size()){\n\t\t\t//point to chest\n\t\t\tint chest = 0;\n\t\t\tfor(int i = 1; i < this.chests.size() && this.chests.get(chest).collected == true; i++){\n\t\t\t\tchest = i;\n\t\t\t}\n\t\t\t\n\t\t\tthis.compass.setAngle(this.mainSprite.angleTo(this.chests.get(chest)));\n\t\t}else{\n\t\t\t//point to earth\n\t\t\tthis.compass.setAngle(this.mainSprite.angleTo(this.earth) - 90);\n\t\t}\n\t\tthis.compass.update(t);\n\t\t\n\t\t//check Earth message\n\t\tif(this.earth.collidesWith(this.mainSprite)){\n\t\t\t\n\t\t\tif(this.collected >= this.chests.size()){\n\t\t\t\tthis.scene.stop();\n\t\t\t\tSystem.out.println(\"YOU WIN!\");\n\t\t\t}else{\n\t\t\t\tSystem.out.println(\"You must collect all treasure before returning to Earth.\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "public boolean isRocketMoving(){\n\t\tif(mLevel.startGravity){\n\t\t\tif(mState == GameState.STARTING_LVL || mState == GameState.PLANNING_LVL){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}//if game is running then rocket is moving no matter what\n\t\tif(mState == GameState.RUNNING_LVL){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public void moveTowards(){\n \n \n \n if(!exploded){\n \n \n move(speed);\n \n if(isTouching(Enemy.class)){\n move(explosionRadius); \n \n inRange = (ArrayList) getObjectsInRange(explosionRadius + 25, Enemy.class);\n for(Enemy e : inRange){\n e.hit(damage);\n }\n \n //explode\n exploded = true;\n \n image = new GreenfootImage(\"50x50 aoe.png\");\n image.scale(explosionRadius*2, explosionRadius*2);\n setImage(image);\n //getWorld().removeObject(this);\n }\n else if (isAtEdge())\n {\n getWorld().removeObject(this);\n }\n else if ( radius < distance) {\n getWorld().removeObject(this); \n }\n }\n else{\n setImage(image);\n image.setTransparency(image.getTransparency() - 5);\n if(image.getTransparency() <= 0) getWorld().removeObject(this);\n }\n }", "public void resetObjects() {\n if (wind1.isOffScreen()) {\n wind1.reset(wind3.getBoundingRectangle().y - buffer - rand.nextInt(AssetHandler.SCREEN_HEIGHT / 4));\n }\n if (wind2.isOffScreen()) {\n wind2.reset(wind1.getBoundingRectangle().y - buffer - rand.nextInt(AssetHandler.SCREEN_HEIGHT / 4));\n }\n if (wind3.isOffScreen()) {\n wind3.reset(wind2.getBoundingRectangle().y - buffer - rand.nextInt(AssetHandler.SCREEN_HEIGHT / 4));\n }\n\n //Again, check if the clouds go off the screen and then reset them.\n cloudBuffer = rand.nextInt(AssetHandler.SCREEN_HEIGHT / 4) + AssetHandler.SCREEN_HEIGHT / 4;\n if (cloud1.isOffScreen()) {\n cloud1.reset(cloud4.y - cloudBuffer);\n }\n if (cloud2.isOffScreen()) {\n cloud2.reset(cloud1.y - cloudBuffer);\n }\n if (cloud3.isOffScreen()) {\n cloud3.reset(cloud2.y - cloudBuffer);\n }\n if (cloud4.isOffScreen()) {\n cloud4.reset(cloud3.y - cloudBuffer);\n }\n\n //Check if birds (drones) go above the screen and reset them\n birdBuffer = rand.nextInt(AssetHandler.SCREEN_HEIGHT / 2 + AssetHandler.SCREEN_HEIGHT / 3) + AssetHandler.SCREEN_HEIGHT / 2;\n if (drone1.isOffScreen()) {\n drone1.reset(drone2.y - birdBuffer);\n }\n birdBuffer = rand.nextInt(AssetHandler.SCREEN_HEIGHT / 2 + AssetHandler.SCREEN_HEIGHT / 3) + AssetHandler.SCREEN_HEIGHT / 2;\n if (drone2.isOffScreen()) {\n drone2.reset(drone1.y - birdBuffer);\n }\n\n }", "private void testCollisions () \n\t{\n\t r1.set(level.bird.position.x, level.bird.position.y,\n\t \t\t level.bird.bounds.width+.03f, level.bird.bounds.height);\n\t \n\t // Test collision: Pipes\n\t for (Pipe pipe : level.pipes) \n\t {\n\t \t r2.set(pipe.position.x, pipe.position.y, pipe.bounds.width,\n\t \t\t\t pipe.bounds.height);\n\t \t if (!r1.overlaps(r2)) continue;\n\t \t \n\t \t onCollisionBirdWithPipe(pipe);\n\t }\n\t \n\t // Test collision: GoldCoins\n\t for (GoldCoin goldcoin : level.goldcoins)\n\t {\n\t \t if (goldcoin.collected) continue;\n\t \t r2.set(goldcoin.position.x, goldcoin.position.y,\n\t \t\t\t goldcoin.bounds.width, goldcoin.bounds.height);\n\t \t if (!r1.overlaps(r2)) continue;\n\t \t onCollisionBirdWithGoldCoin(goldcoin);\n\t \t break;\n\t }\n\t \n\t // Test collision: Dp\n\t for (DoublePoint doublepoint : level.doublepoints) \n\t {\n\t \t if (doublepoint.collected) continue;\n\t \t r2.set(doublepoint.position.x, doublepoint.position.y,\n\t \t\t\t doublepoint.bounds.width, doublepoint.bounds.height);\n\t \t if (!r1.overlaps(r2)) continue;\n\t \t onCollisionBirdWithDoublePoint(doublepoint);\n\t \t break;\n\t }\n\t \n\t // Test collision: Goal\n\t for (Goal goal : level.goals)\n\t {\n\t \t r2.set(goal.position.x, goal.position.y,\n\t \t\t\t goal.bounds.width, goal.bounds.height);\n\t \t if (!r1.overlaps(r2)) continue;\n\t \t onCollisionBirdWithGoal(goal);\n\t \t break;\n\t }\n\t \n\t // Test collision: Brick\n\t for (Brick brick : level.bricks) \n\t {\n\t \t r2.set(brick.position.x, brick.position.y, brick.bounds.width,\n\t \t\t\t brick.bounds.height);\n\t \t if (!r1.overlaps(r2)) continue;\n\t \t \n\t \t onCollisionBirdWithBrick(brick);\n\t }\n\t }", "private void prepareGame()\n {\n Rocket rocket = new Rocket();\n \n scoreCounter = new Counter(\"Score: \");\n \n addObject(rocket, getWidth()/2 + 100, getHeight()/2);\n \n addObject(scoreCounter, 60, 480);\n \n //TODO (69): Make a method call to addAsteroids that uses your constant for the number of asteroids\n addAsteroids(START_ASTEROIDS);\n }", "public void updatePositions(float timeDeltaSeconds) {\n\t\tboolean xExpansion = needXExpansion(viewport.getWorldWidth());\n\t\tboolean yExpansion = needYExpansion(viewport.getWorldHeight());\n\t\tboolean needExpand = xExpansion || yExpansion;\n\t\tif(state.equals(SceneState.OBJECT_MOVE)) {\n\t\t\tif(needExpand) {\n\t\t\t\tfor(DrawableObject backgroundObject : this.backgroundObjects){\n\t\t\t\t\tbackgroundObject.setVelocity( xExpansion ? spider.getVelocityX() : 0, \n\t\t\t\t\t\t\tyExpansion ? -spider.getVelocityY() : 0);\n\t\t\t\t\tbackgroundObject.resume();\n\t\t\t\t}\n\t\t\t\tfor(DrawableObject sceneObject: this.sceneObjects) {\n\t\t\t\t\tsceneObject.pauseX(xExpansion);\n\t\t\t\t\tsceneObject.pauseY(yExpansion);\n\t\t\t\t}\n\t\t\t\tthis.state = SceneState.SCENE_MOVE;\n\t\t\t}\n\t\t} else if(state.equals(SceneState.SCENE_MOVE)) {\n\t\t\tif(!needExpand) {\n\t\t\t\tfor(DrawableObject backgroundObject : this.backgroundObjects){\n\t\t\t\t\tbackgroundObject.pause();\n\t\t\t\t}\n\t\t\t\tfor(DrawableObject sceneObject: this.sceneObjects) {\n\t\t\t\t\tsceneObject.resume();\n\t\t\t\t}\n\t\t\t\tthis.state = SceneState.OBJECT_MOVE;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// preload some data for collision detection mechanism\n\t\tif(spider.speed!=0 && !(spider.getVelocityX() == 0 && spider.getVelocityY() == 0)) {\n\t\t\tspider.setMovementVector(timeDeltaSeconds);\n\t\t\tfence.collisionPrefetch(spider.getMovementVector());\n\t\t}\n\t\t\n\t\t// update positions\n\t\tfor(DrawableObject object : objects) {\n\t\t\tif(object.speed!=0 && !(object.getVelocityX() == 0 && object.getVelocityY() == 0)) {\n\t\t\t\tobject.updatePosition(timeDeltaSeconds);\n\t\t\t\tobject.boundsCheck((int)viewport.getWorldWidth(), (int)viewport.getWorldHeight());\n\t\t\t}\n\t\t}\n\t\t\n\t\t// do the collision check\n\t\tif(spider.speed!=0 && !(spider.getVelocityX() == 0 && spider.getVelocityY() == 0)) {\n\t\t\tcollisionsCheck();\n\t\t}\n\t\t\n\t}", "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 }", "private void laserCollisions() {\r\n\t\tGObject topLeft = getElementAt(laser.getX() - 1, laser.getY());\r\n\t\tGObject topRight = getElementAt(laser.getX() + laser.getWidth() + 1, laser.getY());\r\n\t\tGObject bottomLeft = getElementAt(laser.getX() - 1, laser.getY() + laser.getHeight());\r\n\t\tGObject bottomRight = getElementAt(laser.getX() + laser.getWidth() + 1, laser.getY() + laser.getHeight());\r\n\t\tif(topLeft == player || topRight == player || bottomLeft == player || bottomRight == player) {\r\n\t\t\tremove(laser);\r\n\t\t\tlaser = null;\r\n\t\t\thits++;\r\n\t\t\tloseLife();\r\n\t\t}\r\n\t}", "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\r\n\t\t\t\tpublic void run() {\n\t\t\t\t\t\r\n\t\t\t\t\tfor(Entity as: Bukkit.getWorld(\"world\").getEntities()) {\r\n\t\t\t\t\t\tif(as instanceof ArmorStand) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tas.remove();\r\n\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\t//TOPS\r\n\t\t\t\t\r\n\t\t\t\t\tif(MetodosWarps.containsWarp(\"topkills\")) {\r\n\t\t\t\t\t getTop(locTopKILLS,\"Kills\");\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žAžlTOP KILLS ATUALIZADO COM SUCESSO! \\n \");\t\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žcžlO TOP KILLS NAO PODE SER CARREGADO, POIS A WARP topkills NAO ESTA SETADA! \\n \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(MetodosWarps.containsWarp(\"topcoins\")) {\r\n\t\t\t\t\t getTop(locTopCoins,\"Coins\");\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žAžlTOP COINS ATUALIZADO COM SUCESSO! \\n \");\t\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žcžlO TOP COINS NAO PODE SER CARREGADO, POIS A WARP topkills NAO ESTA SETADA! \\n \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(MetodosWarps.containsWarp(\"top1v1\")) {\r\n\t\t\t\t\t getTop(locTop1v1,\"wins\");\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žAžlTOP 1v1 ATUALIZADO COM SUCESSO! \\n \");\t\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žcžlO TOP 1v1 NAO PODE SER CARREGADO, POIS A WARP top1v1 NAO ESTA SETADA! \\n \");\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\t\r\n\t\t\t\t\t//Caixa misteriosa\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(MetodosWarps.containsWarp(\"misteryBox\")) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t Spawn(misteryBox, \"žažlCAIXA MISTERIOSA\",misteryBox.getY()-1.7);\r\n\t\t\t\t\t Spawn(misteryBox, \"žežlEM BREVE!\",misteryBox.getY()-2);\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žAžlMYSTERYBOX ATUALIZADO COM SUCESSO! \\n \");\t\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žcžlO TOP COINS NAO PODE SER CARREGADO, POIS A WARP misteryBox NAO ESTA SETADA! \\n \");\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "private void manageLoop() {\n if (!gameOver) {\n if (lastLoopTime != null) {\n timeBufer += lastLoopTime\n .until(LocalTime.now(), ChronoUnit.MILLIS);\n }\n lastLoopTime = LocalTime.now();\n\n if (timeBufer > fallingTime) {\n int nbFalling = (int) (timeBufer / fallingTime);\n timeBufer = timeBufer % fallingTime;\n for (int i = 0; i < nbFalling; i++) {\n if (currentPiece.canDown(grid)) {\n currentPiece.down();\n sincePieceDown = null;\n } else if (sincePieceDown == null) {\n sincePieceDown = LocalTime.now();\n sinceLastMove = LocalTime.now();\n }\n }\n }\n\n if (sincePieceDown != null && sinceLastMove != null) {\n long a = sinceLastMove\n .until(LocalTime.now(), ChronoUnit.MILLIS);\n long b = sincePieceDown\n .until(LocalTime.now(), ChronoUnit.MILLIS);\n if (a >= fallingTime || b >= fixTime) {\n effectsReader.play(\"drop.mp3\", 1);\n currentPiece.getPoints().stream().filter((p) -> (p.y >= 0))\n .forEachOrdered((p) -> {\n grid.get(p.y).updatePoint(\n p.x, currentPiece.getColorType()\n );\n });\n int nbRemove = 0;\n boolean newLevel = false;\n for (int j = Settings.getYCases() - 1; j >= 0; j--) {\n if (grid.get(j).isClear()) {\n grid.remove(j);\n nbRemove++;\n nbLines++;\n if (nbLines % 10 == 0) {\n newLevel = true;\n }\n }\n }\n if (nbRemove == 4) {\n effectsReader.play(\"tetris.mp3\", 1);\n } else if (nbRemove > 0) {\n effectsReader.play(\"line.mp3\", 1);\n }\n lineScore(nbRemove);\n if (newLevel) {\n effectsReader.play(\"level-up.mp3\", 1);\n level++;\n fallingTime = (int) (fallingTime * .8d);\n fixTime = fallingTime * 2;\n }\n for (int j = 0; j < nbRemove; j++) {\n grid.add(0, new Line());\n }\n initNextPiece();\n hasSwiched = false;\n }\n }\n }\n }", "protected void update(Input input) {\n\n if (input.wasPressed(Keys.ESCAPE) || boardNum > 4 ||turn.getShots() == 0){\n System.exit(0);\n }\n\n // if all red pegs are destroyed, advance to the next board\n if (board.finished() && balls == null){\n\n boardNum++;\n board = new Board(boardNum);\n }\n\n // B A L L'S O U T\n if (input.wasPressed(MouseButtons.LEFT) && balls == null) {\n balls = new ArrayList<>();\n balls.add(new Ball());\n balls.get(0).reset(input.getMouseX(), input.getMouseY());\n }\n\n if (balls != null) {\n board.update(balls);\n\n for (int i = 0; i < balls.size(); i++) {\n Ball ball = balls.get(i);\n\n ball.update();\n\n // check if all the balls are out of window, if yes, start a new turn\n if (ball.isOut()) {\n balls.remove(i);\n i--;\n }\n if (balls.isEmpty()){\n turn.nextTurn(board);\n balls = null;\n break;\n }\n\n // activate power up if struck\n if (turn.isActivated(ball)){\n balls.add(turn.activate(ball));\n balls.remove(ball);\n }\n\n // detect if the ball activates the bucket, if so, extra shot given\n if (ball.bounding().centre().y > Window.getHeight() && ball.bounding().intersects(bucket.bounding())){\n turn.extraShot();\n }\n\n }\n\n }\n\n board.render();\n turn.update();\n bucket.update();\n\n }", "public void collision() {\n for (int i = 0; i < friendlyBullets.size(); i++) {\n\n friendlyBullets.get(i).tick();\n\n if (friendlyBullets.get(i).getImgY() <= 40) {\n friendlyBullets.get(i).bulletImage.delete();\n friendlyBullets.remove(friendlyBullets.get(i));\n i--;\n continue;\n }\n\n for (int j = 0; j < enemies.size(); j++) {\n\n if (friendlyBullets.get(i).getHitbox().intersects(enemies.get(j).getHitbox())) {\n\n friendlyBullets.get(i).hit();\n friendlyBullets.remove(friendlyBullets.get(i));\n i--;\n\n enemies.get(j).hit();\n\n if (enemies.get(j).getHp() <= 0) {\n enemies.remove(enemies.get(j));\n score.setScore(50);\n j--;\n }\n //end this loop\n j = enemies.size();\n }\n }\n\n }\n\n ///////////////////////////////////////////////////////////////////////////////////////\n\n\n // Enemy out of bounds\n for (int i = 0; i < enemies.size(); i++) {\n\n enemies.get(i).tick();\n\n // Out of bounds\n if (enemies.get(i).getEnemyImage().getY() >= 750) {\n enemies.get(i).getEnemyImage().delete();\n enemies.remove(enemies.get(i));\n\n if (enemies.size() > 1) {\n i--;\n }\n }\n }\n\n\n //////////////////////////////////////////////////////////////////////////\n\n //powerUps out of bounds and collision with spaceships\n for (int i = 0; i < powerUps.size(); i++) {\n\n powerUps.get(i).tick();\n\n if (powerUps.get(i).getImgY() >= 745) {\n\n powerUps.get(i).powerUpImage.delete();\n powerUps.remove(powerUps.get(i));\n\n i--;\n continue;\n }\n\n for (int j = 0; j < spaceShips.size(); j++) {\n\n if (spaceShips.get(j).getHitbox().intersects(powerUps.get(i).getHitbox())) {\n\n\n spaceShips.get(j).powerUp(powerUps.get(i).getPowerUpType());\n powerUps.get(i).hit();\n powerUps.remove(powerUps.get(i));\n\n //if it collides with one leave the for loop\n i--;\n j = spaceShips.size();\n }\n }\n\n }\n\n }", "public void actionPerformed(ActionEvent e)\t\t\n\t{\n\t\t//Check if the frog hit the side\n\t\tfrogHitSide = froggy.hitSide(MIN_WIDTH, MAX_WIDTH, MIN_HEIGHT, MAX_HEIGHT);\n\t\tif(frogHitSide == true)\n\t\t{\n\t\t\tSystem.out.println(\"Lost\");\n\t\t\tint frogSize = FROG_SIZE;\n\t\t\tint x = START_X;\n\t\t\tint y = START_Y;\n\t\t\tint frogVelocityX = FROG_START_VELOCITY;\n\t\t\t\n\t\t\tfroggy = new Frog(x, y, frogSize, frogVelocityX);\n\t\t\tlossCount ++;\n\t\t\tfrogHitSide = false;\n\t\t}\n\t\tif(logOverlap == true)\n\t\t{\n\t\t\tfroggy.move();\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < logs.length; i++)\n\t\t{\n\t\t\t//move the logs\n\t\t\tlogs[i].move();\n\t\t\tlogs[i].wrap(0, MAX_WIDTH, MIN_HEIGHT, MAX_HEIGHT);\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < carsRight.length; i++)\n\t\t{\n\t\t\t// Move the cars going right\n\t\t\tcarsRight[i].move();\n\t\t\tcarsRight[i].wrap(0, MAX_WIDTH, MIN_HEIGHT, MAX_HEIGHT);\n\t\t}\n\t\t\t\n\t\tfor(int i = 0; i < carsLeft.length; i++)\n\t\t{\n\t\t\t// Move the cars going left\n\t\t\tcarsLeft[i].move();\n\t\t\tcarsLeft[i].wrap(0, MAX_WIDTH, MIN_HEIGHT, MAX_HEIGHT);\n\t\t}\n\t\t\n\t\t// Update the window.\n\t\trepaint();\n\t}", "private static void move() {\r\n\t\ttry {\r\n\t\t\tThread.sleep(timer);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\trunTime += timer;\r\n\t\tif (runTime > stepUp) {\r\n\t\t\ttimer *= 0.9;\r\n\t\t\tstepUp += 5000;\r\n\t\t}\r\n\r\n\t\tupdateSnake(lastMove);\r\n\t\t// updateField();\r\n\r\n\t\tif (score >= 10 && (r.nextInt(40) == 0)) {\r\n\t\t\taddFood(MOUSE);\r\n\t\t}\r\n\t\tif (score >= 30 && (r.nextInt(50) == 0)) {\r\n\t\t\taddFood(POISON);\r\n\t\t}\r\n\t}", "public void updateLogic(){\n\t\t\n\t\tif(gameMode){\n\t\t\tif(firstTouchdown){\n\t\t\t\t//linear x movement of the cube \n\t\t\t\tthis.applyBodyForceToCenter(Gsing.get().cSpeed, 0, true); \n\t\t\t\tthis.setBodyLinearDamping(0.3f); \n\t\t\t}\n\t\t\t\n\t\t\tif(!stopInc){\n\t\t\t\tthis.applyBodyForceToCenter(0, 50*this.getBodyMass(), true);\n\t\t\t}\n\t\t\t\n\t\t\tif(jump && isTouching){\n\t\t\t\tjump = false; \n\t\t\t\tisTouching = false; \n\t\t\t\tcheckInAirRotation = true; \n\t\t\t\tpos = this.getBodyWorldCenter();\n//\t\t\t\tthis.setBodyLinearVelocity(this.getBodyLinearVelocity().x, 17); \n\t\t\t\tthis.applyBodyLinearImpulse(new Vector2(0, Gsing.get().cImpulse), pos, true);\n\t\t\t}\n\t\t\t\n\t\t\tif(flyMode){\n\t\t\t\tpos = this.getBodyWorldCenter();\n\t\t\t\tthis.applyBodyForceToCenter(0, 35*this.getBodyMass(), true);\n\t\t\t\t\n\t\t\t\tif(fly){\n\t\t\t\t\tfly = false; \n\t\t\t\t\tthis.applyBodyForceToCenter(0, Gsing.get().cForce, true); \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(specialJump && isTouching){\n\t\t\t\tangle = Math.random()*Math.PI*2; \n\t\t\t\tspecialJump = false; \n\t\t\t\tisTouching = false; \n\t\t\t\tpos = this.getBodyWorldCenter(); \n\t\t\t\tthis.applyBodyLinearImpulse(specialImpulse, pos, true); \n\t\t\t\tLogger.log(\"jumped in a special way\"); \n\t\t\t}\n\t\t\t\n\t\t\tif(checkInAirRotation){\n\t\t\t\tsetDrawAngle(); \n\t\t\t}\n\t\t\t\n\t\t\tif(cubeDamageCnt == 6){\n\t\t\t\tcubeDead = true; \n\t\t\t}\n\t\t\t\n\t\t\t//check if the cube has encountered an obstacle\n\t\t\tif(isHurt)\n\t\t\t{\n\t\t\t\temitParticle(); \n\t\t\t}\n\t\t\t\n\t\t\tif(cubeDead){\n\t\t\t\tScreenHub.s.transitionTo(2, ScreenManager.TransactionType.SLICE); \n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\telse{\n\t\t\t\n\t\t\tif(this.getBodyLinearVelocity().x < .1 && !itsTheEnd){\n\t\t\t\tif(this.getBodyWorldCenter().y <= Gdx.graphics.getHeight()*.75){\n\t\t\t\t\tthis.applyBodyForceToCenter(0, 700f, true);\n//\t\t\t\t\tthis.getBody().setTransform(this.getBodyPosition(), 0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\temitParticle(); \n\t\t\t\t\titsTheEnd = true; \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tcheckParticles4Destruction();\n\t}", "protected void updatePos()\r\n\t{\r\n\t\t// storing all birds of this flock into ArrayList\r\n\t\tArrayList<Bird> bird_list = new ArrayList<Bird>();\r\n\t\tbird_list = getFlock().getBirds();\r\n\t\tPosition currPos = getPos();\r\n\t\tdouble move_x=0,move_y=0,temp_x=0,temp_y=0,normal=0;\r\n\t\t// taking the current positions\r\n int x = currPos.getX();\r\n int y = currPos.getY();\r\n if (!isleader)\r\n\t\t{\r\n Position leader_pos = getFlock().getLeader().getPos();\r\n setTarget(leader_pos.getX(),leader_pos.getY());\r\n }\r\n\t\t// giving the target positions\r\n int x_target = getTarget().getX();\r\n int y_target = getTarget().getY();\r\n\t\t// if normal is zero give some initial value to normal\r\n\t\tnormal = Math.pow(Math.pow(y_target-y,2)+Math.pow(x_target-x,2),0.5);\r\n\t\tif(normal==0) normal = 10;\r\n\t\tmove_x = ((x_target-x)*getMaxSpeed())/normal;\r\n\t\tmove_y = ((y_target-y)*getMaxSpeed())/normal;\r\n\t\t// checking all other birds in the flock for avoiding collisions\r\n\t\tfor(Bird b:bird_list)\r\n\t\t{\r\n\t\t\ttemp_x = b.getPos().getX();\r\n\t\t\ttemp_y = b.getPos().getY();\r\n\t\t\tnormal = Math.pow(Math.pow(temp_x-x,2)+Math.pow(temp_y-y,2),0.5);\r\n\t\t\t// if distance between two birds is less than 2*maxSpeed,giving the bird\r\n\t\t\t// velocity in other direction and atlast taking resultant\r\n\t\t\tif(normal<2*(getMaxSpeed()+5) && normal!=0)\r\n\t\t\t{\r\n\t\t\t\tmove_x += ((x - temp_x)*getMaxSpeed())/normal;\r\n\t\t\t\tmove_y += ((y - temp_y)*getMaxSpeed())/normal;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// updating the position of the bird by avoiding collisions\r\n\t\tsetPos(x+(int)move_x, y+(int)move_y);\r\n\t}", "void update()\n\t{\n\t\t// the snake moves this function records it\n\t\ttheSnake.update();\n\n\t\t// checks if the snake is alive\n\t\tplaying = theSnake.isAlive();\n\n\t\t// checks if the snake has eaten a fruit\n\t\tif (theSnake.getXofPartI(0) == fruit[0] && theSnake.getYofPartI(0) == fruit[1] && theSnake.getZofPartI(0) == fruit[2])\n\t\t{\n\t\t\t// the snake grows\n\t\t\ttheSnake.grow();\n\t\t\t// a new fruit location needs to be determined\n\t\t\tplaceFruit();\n\t\t}\n\t}", "@Override\r\n\tpublic void collisionReaction(GameObject collidedWith)\r\n\t{\r\n\t\tif (\"Enemy\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(30,40);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t}\r\n\r\n\t\tif (\"StarBurst\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(20,40);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t}\r\n\t\tif (\"GeneralEnemyBullet\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(10,20);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t}\r\n\t\tif (\"AimedShot\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(1,5);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t}\r\n\r\n\r\n\t\tif (\"Asteroid\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(20, 45);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\r\n\t\t\t//DESTROYED ASTEROID CODE! NEEDS TO BE REUSED WITH SHOOTING!\r\n\t\t\tVec2 deathSpot = collidedWith.getPosition();\r\n\r\n\r\n\t\t\tint healthdropNum = 0;\r\n\t\t\twhile(healthdropNum <= 4)\r\n\t\t\t{\r\n\t\t\t\thealthdropNum++;\r\n\t\t\t\tGameObject healthDrop = new HealthDrops();\r\n\t\t\t\thealthDrop.setPosition(deathSpot.getX() + getRandomValue(-5, 5), deathSpot.getY() + getRandomValue(-5, 5));\r\n\t\t\t\tObjectManager.addGameObject(healthDrop);\r\n\r\n\t\t\t}\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\r\n\t\t\tif (ShipHealth <= 30)\r\n\t\t\t{\r\n\t\t\t\tSoundManager.playBackgroundSound(\"LowHealth\");\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\t\tif (\"HealthDrop\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\tscore = score + 1;\r\n\t\t\tSystem.out.println(\"Score: \"+ score);\r\n\t\t\tif (ShipHealth < 100)\r\n\t\t\t{\r\n\r\n\t\t\t\tShipHealth += 1;\r\n\t\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\r\n\t\t\t\tif (ShipHealth > 30)\r\n\t\t\t\t{\r\n\t\t\t\t\tSoundManager.stopBackgroundSound(\"LowHealth\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcollidedWith.kill();\r\n\t\t}\r\n\t\tif (\"EnemyHealthDrop\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\tscore = score + 2;\r\n\t\t\tSystem.out.println(\"Score: \"+ score);\r\n\t\t\tif (ShipHealth < 100)\r\n\t\t\t{\r\n\r\n\t\t\t\tShipHealth += 2;\r\n\t\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\t\tif (ShipHealth > 30)\r\n\t\t\t\t{\r\n\t\t\t\t\tSoundManager.stopBackgroundSound(\"LowHealth\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcollidedWith.kill();\r\n\t\t}\r\n\t\tif (\"HealthPickup\".equals(collidedWith.getName()))\r\n\t\t{\r\n\r\n\t\t\t//System.out.println(\"Score: \" + score);\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth = 100;\r\n\t\t\tSystem.out.println(\"HEALTH RESTORED\");\r\n\t\t\tSoundManager.stopBackgroundSound(\"LowHealth\");\r\n\r\n\t\t}\r\n\t\tif (\"FollowBullet\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(10, 30);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t\tif (ShipHealth <= 30)\r\n\t\t\t{\r\n\t\t\t\tSoundManager.playBackgroundSound(\"LowHealth\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (\"BossFollower\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\tsetPositionY(165.7f);\r\n\t\t}\r\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 void gameUpdate()\n {\n\t\tcheckCollisions();\n\t\t\n\t\tif(up)\t\tcraft.accelerat();\t\t\n\t\tif(left)\tcraft.rotateLeft();\n\t\tif(right) \tcraft.rotateRight();\n\t\t\n\t\tcraft.move();\n\t\tmoveAstroids();\n }", "public void trackEnderpearls() {\n\n Set<EnderPearl> pearlsToTrack = new HashSet<>(launchedPearls);\n for (EnderPearl pearl : pearlsToTrack) {\n if (pearl.isValid()) {\n Block hitBlock;\n\n findCollision:\n {\n Vector start = pearl.getLocation().toVector();\n Vector finish = pearl.getVelocity().add(start);\n\n if (start.toBlockVector().equals(finish.toBlockVector())) {\n Block block = pearl.getLocation().getBlock();\n if (block.getType() == Material.END_GATEWAY) {\n hitBlock = block;\n break findCollision;\n }\n }\n else {\n BlockIterator ray = new BlockIterator(\n pearl.getWorld(),\n start,\n pearl.getVelocity().normalize(),\n 0,\n (int) Math.ceil(pearl.getVelocity().length()));\n while (ray.hasNext()) {\n Block block = ray.next();\n if (block.getType() == Material.END_GATEWAY) {\n hitBlock = block;\n break findCollision;\n }\n }\n }\n continue;\n }\n if (hitBlock.getType() == Material.END_GATEWAY && Teleportal.getFromStruct(hitBlock) != null) {\n\n // TODO find collided face instead of using the ender pearl's yaw\n float yaw = 0 - pearl.getLocation().getYaw();\n BlockFace hitFace = Utils.yawToBlockFace(yaw).getOppositeFace();\n\n ProjectileHitEvent event = new ProjectileHitEvent(pearl, null, hitBlock, hitFace);\n getServer().getPluginManager().callEvent(event);\n pearl.remove();\n }\n }\n launchedPearls.remove(pearl);\n }\n }", "public static void turn() throws GameActionException {\n RobotInfo[] robots = rc.senseNearbyRobots(RobotType.LUMBERJACK.bodyRadius+GameConstants.LUMBERJACK_STRIKE_RADIUS, them);\n\n if(robots.length > 0 && !rc.hasAttacked()) {\n // Use strike() to hit all nearby robots!\n rc.strike();\n } else {\n // No close robots, so search for robots within sight radius\n robots = rc.senseNearbyRobots(-1,them);\n\n // If there is a robot, move towards it\n if(robots.length > 0) {\n MapLocation enemyLocation = robots[0].getLocation();\n Direction toEnemy = here.directionTo(enemyLocation);\n\n Util.tryMove(toEnemy);\n } else {\n \t\n \tchopTrees();\n \t\n // Move Randomly\n \tUtil.tryMove(Util.randomDirection());\n \t\n \t\n }\n }\n\t}", "@Override\n public void update() {\n if(firstTick) {\n sortingInventory.onFirstTick();\n firstTick = false;\n }\n\n ticksSinceSync++;\n\n int x = pos.getX();\n int y = pos.getY();\n int z = pos.getZ();\n if (!worldObj.isRemote && numPlayersUsing != 0 && (ticksSinceSync + x + y + z) % 200 == 0) {\n Iterator<EntityPlayer> it = chestPlayers.iterator();\n while(it.hasNext()) {\n EntityPlayer entityPlayer = it.next();\n if(entityPlayer.isDead || ((ContainerSortingChest) entityPlayer.openContainer).getTileEntity() != this) {\n it.remove();\n }\n }\n numPlayersUsing = chestPlayers.size();\n worldObj.addBlockEvent(pos, getBlockType(), 1, numPlayersUsing);\n }\n\n prevLidAngle = lidAngle;\n float lidAngleSpeed = 0.1f;\n if (numPlayersUsing > 0 && lidAngle == 0f) {\n worldObj.playSoundEffect(x + 0.5d, y + 0.5d, z + 0.5d, \"random.chestopen\", 0.5f, worldObj.rand.nextFloat() * 0.1f + 0.9f);\n }\n\n if (numPlayersUsing == 0 && lidAngle > 0.0F || numPlayersUsing > 0 && lidAngle < 1.0F) {\n float oldLidAngle = lidAngle;\n if (numPlayersUsing > 0) {\n lidAngle += lidAngleSpeed;\n } else {\n lidAngle -= lidAngleSpeed;\n }\n\n if (lidAngle > 1f) {\n lidAngle = 1f;\n }\n\n float closeSoundAngle = 0.5f;\n if (lidAngle < closeSoundAngle && oldLidAngle >= closeSoundAngle) {\n worldObj.playSoundEffect(x + 0.5d, y + 0.5d, z + 0.5d, \"random.chestclosed\", 0.5f, worldObj.rand.nextFloat() * 0.1f + 0.9f);\n }\n\n if (lidAngle < 0f) {\n lidAngle = 0f;\n }\n }\n }", "private RockGameController() {\n points = 0; opponentPoints = 0;\n update1 = false; update2 = false; update3 = false; update4 = false; update5 = false;\n rockBodyOne = new RockGameBody(RockGameModel.getInstance().getRockOne());\n rockBodyTwo = new RockGameBody(RockGameModel.getInstance().getRockTwo());\n rockBodyThree = new RockGameBody(RockGameModel.getInstance().getRockThree());\n rockBodyFour = new RockGameBody(RockGameModel.getInstance().getRockFour());\n rockBodyFive = new RockGameBody(RockGameModel.getInstance().getRockFive());\n rocks = new ArrayList<RockGameBody>() {{add(rockBodyOne); add(rockBodyTwo); add(rockBodyThree); add(rockBodyFour); add(rockBodyFive);}};\n }", "@Override\n\tprotected void simpleUpdate() {\n\t\tif(danks.isEmpty()){\n\t\t\tdanks.clear();\n\t\t\tnewDanks();\n\t\t}\n\n\t\tArrayList<Projectiles> projs = hero.getArray();\n\t\tIterator<Dank> enemIt = danks.iterator();\n\n\t\twhile(enemIt.hasNext()){\n\t\t\tDank e = enemIt.next();\n\t\t\tif(hero.getBounds().intersects(e.getBounds())){\n\t\t\t\tif(!isPaused)\n\t\t\t\t\tisPaused = !isPaused;\n\t\t\t\tgameOver = true;\n\t\t\t\tprojs.clear();\n\t\t\t}\n\t\t\t\n\t\t\tfor(int j = 0; j < projs.size(); j++){\n\t\t\t\tif(e.getBounds().intersects(projs.get(j).getBounds())){\n\t\t\t\t\tscore += e.getSpeed();\n\t\t\t\t\tenemIt.remove();\n\t\t\t\t\tprojs.remove(j);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\te.move();\n\t\t}\n\t}", "@Override\n public void update(ArrayList<String> pressedKeys) {\n\n\n super.update(pressedKeys);\n// if(!backgroundMusic.play && x==0){\n// x=1;\n// backgroundMusic.playMusic(\"resources/oceanOperator.mp3\");\n// }\n\n if (state == STATE.MENU) {\n\n }\n\n //moveGameY(1);\n\n else if (state == STATE.GAME) {\n if (player != null && !player.isDead) {\n player.update(pressedKeys);\n }\n if (player.getLifeCount() <= 0) {\n complete = true;\n player.isDead = true;\n }\n\n\n if (transitionYCurrent < transitionY) {\n moveGameY(transitionYSpeed);\n transitionYCurrent += transitionYSpeed;\n }\n\n if(complete && !player.isDead){\n System.out.println(\"you won!\");\n state = STATE.COMPLETE;\n\n\n }\n\n if (player != null && !player.isDead) {\n// for (int i = 0; i < enemies.size(); i++) {\n// if (player.playerCollidesWith(enemies.get(i)) && enemies.get(i).dead == false && player.canGetHurt()) {\n// damageThePlayer();\n// }\n// }\n\n for (int i = 0; i < currentRoom.getSpikeList().size(); i++) {\n SpikeTile spikes = currentRoom.getSpikeList().get(i);\n if (player.feetCollideWith(spikes) && spikes.getStateName() == \"idle up\" && player.canGetHurt()) {\n damageThePlayer();\n }\n }\n\n\n if (player.playerCollidesWith(coin)) {\n coin.handleEvent(collidedEvent);\n myQuestManager.handleEvent(PickedUpEvent);\n }\n player.update();\n checkCollisions(player);\n\n\n for (int i = 0; i < player.playerBullets.size(); i++) {\n Bullet bul = player.playerBullets.get(i);\n bul.update(pressedKeys);\n if (bul.getShotTimer() >= bul.getShotCap()) {\n\n player.playerBullets.remove(i);\n }\n }\n\n TweenJuggler.getInstance().nextFrame();\n\n boolean pickpocketTrigger = false;\n for (int i = 0; i < enemies.size(); i++) {\n\n Enemy enemy = enemies.get(i);\n if (player.getHitBox().intersects(enemy.getPickpocketRect())) {\n pickpocketTrigger = true;\n pickpocketEnemy = enemy;\n }\n\n }\n pickpocket = pickpocketTrigger;\n if (!pickpocket)\n pickpocketEnemy = null;\n }\n if (pressedKeys.contains(KeyEvent.getKeyText(KeyEvent.VK_W))) {\n for (int i = 0; i < currentRoom.getDoors().size(); i++) {\n if (player.getHitBox().intersects(currentRoom.getDoors().get(i).getDoorCollider()) && currentRoom.getDoors().get(i).stateName == \"door_open\" && transitionPhase == false) {\n transitionPhase = true;\n currentRoom.fadeOut();\n queuedRoom = currentRoom.getDoors().get(i).getNextRoom();\n queuedRoom.fadeIn();\n transitionYCurrent = 0;\n enemies = new ArrayList<>();\n pressedKeys.remove(KeyEvent.getKeyText(KeyEvent.VK_W));\n }\n }\n\n }\n\n if (pressedKeys.contains(KeyEvent.getKeyText(KeyEvent.VK_E))) {\n if (pickpocket == true && pickpocketEnemy != null) {\n keyCount += pickpocketEnemy.pickpocketKeys();\n int knives = pickpocketEnemy.pickpocketKnives();\n knifeCount += knives;\n System.out.println(knives);\n// int n = rand.nextInt(3) + 1;\n// if (n == 1) {\n//\n// itemString = \"You found a knife!\";\n// } else if (n == 2) {\n// keyCount++;\n// itemString = \"You found a key!\";\n//\n// } else if (n == 3) {\n// itemString = \"No items found.\";\n// }\n }\n\n\n for (int i = 0; i < currentRoom.getDoors().size(); i++) {\n\n if (player.getHitBox().intersects(currentRoom.getDoors().get(i).getDoorCollider()) && currentRoom.getDoors().get(i).stateName == \"door_closed\") {\n if (keyCount > 0) {\n soundEffects.playSoundEffect(\"resources/chains.wav\",0);\n currentRoom.getDoors().get(i).setAnimationState(\"door_opening\", \"door_open\");\n itemString = \"Door unlocked\";\n keyCount--;\n } else {\n soundEffects.playMusic(\"resources/door_locked.wav\");\n }\n } else if (player.getHitBox().intersects(currentRoom.getDoors().get(i).getDoorCollider()) && currentRoom.getDoors().get(i).stateName == \"door_open\" && transitionPhase == false) {\n transitionPhase = true;\n currentRoom.fadeOut();\n queuedRoom = currentRoom.getDoors().get(i).getNextRoom();\n queuedRoom.fadeIn();\n transitionYCurrent = 0;\n enemies = new ArrayList<>();\n }\n }\n\n for (int i = 0; i < currentRoom.getChests().size(); i++) {\n TreasureChest chest = currentRoom.getChests().get(i);\n if (player.feetCollideWith(chest) && chest.getStateName() == \"closed\") {\n chest.setAnimationState(\"open\", \"\");\n if (chest.getItem().equals(\"key\")) {\n keyCount++;\n } else if (chest.getItem().equals(\"knife\")) {\n knifeCount++;\n }\n }\n }\n\n\n pressedKeys.remove(KeyEvent.getKeyText(KeyEvent.VK_E));\n }\n\n if (pressedKeys.contains(KeyEvent.getKeyText(KeyEvent.VK_P))) {\n if (complete == true) {\n removeAll();\n complete = false;\n currentLevel = 0;\n\n\n tutorial = new TutorialLevel1(\"Tutorial\");\n tutorial.run();\n addChild(tutorial);\n\n\n myLevel = new Level0(\"Room1\");\n myLevel.run();\n addChild(myLevel);\n\n\n myLevel1 = new Level1(\"Room2\");\n myLevel1.run();\n myLevel1.hide();\n addChild(myLevel1);\n\n myLevel2 = new ahmedslevel(\"Room3\", player);\n myLevel2.run();\n myLevel2.hide();\n addChild(myLevel2);\n\n myLevel3 = new BrighamLevel(\"Room4\");\n myLevel3.run();\n myLevel3.hide();\n addChild(myLevel3);\n\n level4 = new AlternatingSpikesLevel(\"Room6\");\n level4.run();\n level4.hide();\n addChild(level4);\n\n\n bossLevel = new BossLevel(\"Room5\", player);\n bossLevel.run();\n bossLevel.hide();\n addChild(bossLevel);\n\n\n tutorial.mapDoorToRoom(0,myLevel);\n myLevel.mapDoorToRoom(0, myLevel1);\n myLevel1.mapDoorToRoom(0, myLevel2);\n myLevel2.mapDoorToRoom(0, myLevel3);\n myLevel3.mapDoorToRoom(0, level4);\n level4.mapDoorToRoom(0, bossLevel);\n currentRoom = tutorial;\n\n enemies = currentRoom.enemies;\n\n player.isDead = false;\n player.setLifeCount(3);\n player.setPositionX(550);\n player.setPositionY(700);\n knifeCount = 4;\n keyCount = 0;\n backgroundMusic.stop();\n backgroundMusic.playSoundEffect(\"resources/oceanOperator.wav\", 100);\n } else {\n state = STATE.PAUSE;\n\n }\n }\n for (int i = 0; i < enemies.size(); i++) {\n Enemy currentEnemy = enemies.get(i);\n currentEnemy.update();\n if (!currentEnemy.dead) {\n if (currentEnemy.enemyBullet != null) {\n currentEnemy.enemyBullet.update(pressedKeys);\n if (currentEnemy.enemyBullet.getShotTimer() >= currentEnemy.enemyBullet.getShotCap()) {\n currentEnemy.enemyBullet = null;\n }\n }\n if (currentEnemy.isInView(player, currentRoom.coverList)) {\n// System.out.println(currentRoom.coverList.get(0));\n if (complete == false) {\n if (currentEnemy.enemyBullet == null) {\n currentEnemy.enemyBullet = new Bullet(\"bullet\", \"knife.png\", 0.4);\n currentEnemy.enemyBullet.setStart(currentEnemy.getPositionX() + currentEnemy.getUnscaledWidth() / 2, currentEnemy.getPositionY() + currentEnemy.getUnscaledHeight() / 2);\n currentEnemy.enemyBullet.setEnd(player.getPositionX(), player.getPositionY());\n TweenTransitions enemyBulletPath = new TweenTransitions(\"linearTransition\");\n Tween enemyBulletmovement = new Tween(currentEnemy.enemyBullet, enemyBulletPath);\n enemyBulletmovement.animate(TweenableParams.X, currentEnemy.enemyBullet.startValX, currentEnemy.enemyBullet.endValX, 0.4);\n enemyBulletmovement.animate(TweenableParams.Y, currentEnemy.enemyBullet.startValY, currentEnemy.enemyBullet.endValY, 0.4);\n TweenJuggler.getInstance().add(enemyBulletmovement);\n currentEnemy.handleEvent(throwKnife);\n }\n }\n if (currentEnemy.enemyBullet != null) {\n// System.out.println(currentEnemy.enemyBullet.getShotTimer());\n if (currentEnemy.enemyBullet.collidesWith(player) && player.canGetHurt()) {\n damageThePlayer();\n currentEnemy.enemyBullet = null;\n break;\n }\n for (int j = 0; j < currentRoom.collisionArray.size(); j++) {\n if (currentEnemy.enemyBullet.collidesWith(currentRoom.collisionArray.get(j))) {\n currentEnemy.enemyBullet = null;\n break;\n }\n }\n\n }\n }\n\n\n for (int j = 0; j < player.playerBullets.size(); j++) {\n Bullet bul = player.playerBullets.get(j);\n// for (int k = 0; k < currentRoom.collisionArray.size(); k++) {\n// if (bul.collidesWith(currentRoom.collisionArray.get(k))) {\n// player.playerBullets.remove(j);\n// break;\n// }\n// }\n if (bul != null) {\n if (bul.collidesWith(enemies.get(i))) {\n enemies.get(i).dead = true;\n enemies.get(i).enemyBullet = null;\n if (enemies.get(i).getStateName().contains(\"right\")) {\n enemies.get(i).setDelay(90);\n enemies.get(i).setAnimationState(\"dying right\", \"dead right\");\n } else {\n enemies.get(i).setDelay(90);\n enemies.get(i).setAnimationState(\"dying left\", \"dead left\");\n }\n if (player.playerBullets.size() > j)\n player.playerBullets.remove(j);\n }\n\n }\n }\n }\n }\n\n for (int j = 0; j < player.playerBullets.size(); j++) {\n Bullet bul = player.playerBullets.get(j);\n for (int k = 0; k < currentRoom.collisionArray.size(); k++) {\n if (bul.collidesWith(currentRoom.collisionArray.get(k))) {\n player.playerBullets.remove(j);\n break;\n }\n }\n }\n\n currentRoom.update();\n\n if (queuedRoom != null) {\n queuedRoom.update();\n\n if (queuedRoom.getDoneFading() && currentRoom.getDoneFading()) {\n\n queuedRoom.setDoneFading(false);\n currentRoom.setDoneFading(false);\n if(queuedRoom == bossLevel){\n backgroundMusic.stop();\n bossLevel.intro();\n }\n currentRoom = queuedRoom;\n enemies = currentRoom.enemies;\n queuedRoom = null;\n transitionPhase = false;\n currentQuestObjective = 0;\n }\n }\n }\n if (keyCount > 0){\n currentQuestObjective = 1;\n }\n else if(currentRoom == bossLevel){\n currentQuestObjective = 2;\n }\n\n if(bossLevel != null) {\n if (bossLevel.endgame == true) {\n state = STATE.COMPLETE;\n System.out.println(\"you won!\");\n quitButton.setPositionX(300);\n\n }\n }\n }", "@Override\n public void handleRightCollision(Drawable struckObject) {\n if(struckObject instanceof Ground){\n Ground ground = (Ground)struckObject;\n setPositionX(ground.getLeft() - getWidth()/2);\n } else if (struckObject instanceof Pacer){\n Pacer pacer = (Pacer)struckObject;\n if(pacer.isInPlay()){\n killPlayer();\n setAngleXYDeltaTheta(-5f);\n setDx(-.015f);\n }\n }\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 onLivingUpdate() {\n if (!this.onGround && this.motionY < 0.0D)\n this.motionY *= 0.6D;\n\n\n if (this.ticksExisted % 20 == 0 && this.getHealth() != this.getMaxHealth() && this.getHealth() >= 1)\n this.setHealth(this.getHealth() + 1);\n\n if (worldObj.isRemote) {\n if (this.isSitting())\n worldObj.spawnParticle(EnumParticleTypes.REDSTONE, posX, posY + 1.5, posZ, 0, 0, 0);\n }\n\n if (worldObj.isRemote) {\n MoWitchAndWizard.proxy.spawnParticles(\"air_normal\", this);\n }\n\n super.onLivingUpdate();\n }", "@Override\n public void update() {\n App.updateScore();\n App.updateRocketsCount();\n checkLevel();\n\n if(pickupSpawnCooldown > 0){\n pickupSpawnCooldown--;\n }\n\n player.setSpeed(new Point2D(player.getSpeed().getX()*0.98,player.getSpeed().getY()*0.98));\n int rand = random.nextInt(100);\n if(rand == 0 && asteroidsNumber<asteroidsMaxNumber){\n createAsteroid();\n asteroidsNumber++;\n }\n rand = random.nextInt(500);\n if(rand == 0 && astronautsNumber<astronautsMaxNumber){\n createAstronaut();\n astronautsNumber++;\n }\n }", "public void update(float delta) {\n for(int i = 0; i < rocks.size(); i++) {\n if(RockGameModel.getInstance().isDestroid(rocks.get(i).getModel())) {//se pedra destruida\n if(rocks.get(i).getLatentTime() <= 0) {//pedra desaparece; é criada uma nova pedra\n rocks.add(i+1, createNewRock(rocks.get(i).getModel()));\n rocks.remove(i);\n } else {\n rocks.get(i).decreaseLatentTime(delta);\n System.out.println(\"tempo latente: \"+rocks.get(i).getLatentTime());\n }\n }\n }\n }", "public void tick()\n {\n //We have to respawn the circles if they reach the bottom of the screen\n if (hasPassed())\n {\n //Randomly reset the x coordinates.\n this.x = minRandom + new Random().nextFloat()*(maxRandom-minRandom);\n //Fixed Y spawn\n this.y = spawnY;\n //Randomly reset the width,height, and radius of the new asteroid\n int newHeight, newWidth;\n newHeight = 32 + (int) (new Random().nextFloat()*(64.0f-32.0f));\n newWidth = newHeight;\n setWidth(newWidth);\n setHeight(newHeight);\n this.radius = width*0.5f;\n //Create a new Random color\n Random gen = new Random();\n int red, green, blue = 50;\n do\n {\n red = 40 + (int) (gen.nextFloat()*(255.0f-40.0f));\n green = 40 + (int) (gen.nextFloat()*(255.0f-40.0f));\n blue = 40 + (int) (gen.nextFloat()*(255.0f-40.0f));\n } while (red != green && red != blue);\n \n this.color = new Color(red,green,blue);\n }\n else\n {\n fall();\n move();\n }\n }", "public void move()\n {\n daysSurvived+=1;\n\n energy -= energyLostPerDay;\n\n Random generator = new Random();\n\n //losowo okreslony ruch na podstawie genomu\n int turnIndex = generator.nextInt((int)Math.ceil(Genome.numberOfGenes));\n int turn = genome.getGenome().get(turnIndex);\n\n //wywolujemy metode obrotu - dodaje odpowiednio liczbe do aktualnego kierunku\n direction.turn(turn);\n\n //zmieniamy pozycje zwierzaka przez dodanie odpowiedniego wektora\n position = position.add(direction.move());\n //walidacja pozycji tak, by wychodzac za mape byc na mapie z drugiej strony\n position.validatePosition(map.getWidth(),map.getHeight());\n\n moveOnSimulation();\n\n //jesli po ruchu zwierzaczek nie ma juz energii na kolejny ruch\n if(energy < energyLostPerDay )\n {\n this.animalHungry = true;\n }\n }", "@Override\n\tpublic void update(GameContainer arg0, StateBasedGame arg1, int arg2)\n\t\t\tthrows SlickException {\n\t\tif(!mainMusic.playing()){\n\t\t mainMusic.loop();\n\t\t}\n\t\t\n\t\tif(girl.getRoom() == cat.getRoom() && girl.getRoom().getHumans() == 1){\n\t\t\tcatIsDead = true;\n\t\t\tdeath.play();\n\t\t\tend(arg1);\n\t\t}\n\t\t\n\t\tif(Human.frustration >= 100) {\n\t\t\tdeath.play();\n\t\t\tend(arg1);\n\t\t}\n\t\t\n\t\tif(cat.getHunger() > 90 && cat.getSommeil() > 90){\n\t\t\tend(arg1);\n\t\t}\n\t\t\n\t\tmouseTimer += arg2;\n\t\t\n\t\tdad.timer += arg2;\n\t\tmom.timer += arg2;\n\t\tgirl.timer += arg2;\n\t\tcat.timer += arg2;\n\t\tkitchen.timer += arg2;\n\t\t\n\t\tif (dad.timer > 10000) {\n\t\t\tdad.getRoom().leave(dad);\n\t\t\tdad.update();\n\t\t\tdad.timer = 0;\n\t\t}\n\t\t\n\t\tif (mom.timer > 10000) {\n\t\t\tmom.getRoom().leave(mom);\n\t\t\tmom.update();\n\t\t\tmom.timer = 0;\n\t\t}\n\t\t\n\t\tif (girl.timer > 10000) {\n\t\t\tgirl.getRoom().leave(girl);\n\t\t\tgirl.update();\n\t\t\tgirl.timer = 0;\n\t\t}\n\t\t\n\t\tif(!catIsDead){\n\t\t\tif(arg0.getInput().isMouseButtonDown(Input.MOUSE_LEFT_BUTTON) && mouseTimer > 500){\n\t\t\t\tmouseTimer = 0;\n\t\t\t\tif(!cursorDownActivated){\n\t\t\t\t\targ0.setMouseCursor(CDown, cursorOffsetx, cursorOffsety);\n\t\t\t\t\tcursorDownActivated = true;\n\t\t\t\t\tcursorRegularActivated = false;\n\t\t\t\t\tcursorUpActivated = false;\n\t\t\t\t}\n\t\t\t\tint roomIndex = getClickedRoom(arg0.getInput().getMouseX(), arg0.getInput().getMouseY());\n\t\t\t\t\n\t\t\t\tif(roomIndex == -1){\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Unusable room !\");\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\tRoom ro = map.getRooms().get(roomIndex);\n\t\t\t\t\t\n\t\t\t\t\tif(roomIndex == map.getRooms().indexOf(cat.getRoom())){\n\t\t\t\t\t\t\n\t\t\t\t\t\tint objIndex = getClickedObject(arg0.getInput().getMouseX(), \n\t\t\t\t\t\t\t\targ0.getInput().getMouseY(), ro);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (objIndex == -1) {\n\t\t\t\t\t\t\tSystem.out.println(\"Unusable object !\");\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tif (!((cat.getRoom() instanceof Lounge && cat.getRoom().getHumans() > 1)\n\t\t\t\t\t\t\t\t\t\t|| (cat.getRoom() instanceof Bedroom && cat.getRoom().getHumans() > 0))) {\n\t\t\t\t\t\t\t\t\tcat.action((Usable)ro.getObj().get(objIndex));\n\t\t\t\t\t\t\t\t\tif(normalMeow.playing()){\n\t\t\t\t\t\t\t\t\t\tnormalMeow.stop();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tnormalMeow.play();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\te.printStackTrace();\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} else {\n\t\t\t\t\t\tcat.goTo(ro);\n\t\t\t\t\t}\n\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\n\t\t\t}else if(checkIfHover(arg0.getInput().getMouseX(), arg0.getInput().getMouseY())){\n\t\t\t\tif(!cursorUpActivated){\n\t\t\t\t\t\n\t\t\t\t\targ0.setMouseCursor(CUp, cursorOffsetx, cursorOffsety);\n\t\t\t\t\tcursorDownActivated = false;\n\t\t\t\t\tcursorRegularActivated = false;\n\t\t\t\t\tcursorUpActivated = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else {\n\t\t\t\tif(!cursorRegularActivated){\n\t\t\t\t\t\n\t\t\t\t\targ0.setMouseCursor(Cregular, cursorOffsetx, cursorOffsety);\n\t\t\t\t\tcursorDownActivated = false;\n\t\t\t\t\tcursorRegularActivated = true;\n\t\t\t\t\tcursorUpActivated = false;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Gestion du cat\n\t\t\tif(cat.timer > 2000)\n\t\t\t{\n\t\t\t\tcat.minusFaim();\n\t\t\t\tcat.minusSommeil();\n\t\t\t\tif (cat.getUsed() instanceof Bed) {\n\t\t\t\t\tcat.plusSommeil(3);\n\t\t\t\t}\n\t\t\t\tif (cat.getUsed() instanceof Couch) {\n\t\t\t\t\tcat.plusSommeil(2);\n\t\t\t\t}\n\t\t\t\tcat.timer = 0;\n\t\t\t\tif(Human.frustration > 0)\n\t\t\t\t\tHuman.frustration--;\n\t\t\t\tif(cat.getSommeil() == 0)\n\t\t\t\t\tcatIsDead = true;\n\t\t\t\tif(cat.getHunger() == 0)\n\t\t\t\t\tcatIsDead = true;\n\t\t\t}\n\t\t\t\n\t\t\tif(arg0.getInput().isKeyDown(Input.KEY_C) && arg0.getInput().isKeyDown(Input.KEY_A) \n\t\t\t\t\t&& arg0.getInput().isKeyDown(Input.KEY_T)){\n\t\t\t\tcat.plusFaim(100);\n\t\t\t\tcat.plusSommeil(100);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "private void updatePhysics() {\n long now = System.currentTimeMillis();\n // Do nothing if mLastTime is in the future.\n // This allows the game-start to delay the start of the physics\n // by 100ms or whatever.\n if (mLastTime > now) return;\n int n = particles.length;\n tree.clear();\n for (int i = 0; i < n; i++) {\n tree.insert(particles[i]);\n }\n // Determine if there are any collisions\n // http://www.kirupa.com/developer/actionscript/multiple_collision2.htm\n for (int i = 0; i < n; i++) {\n \tparticles[i].update(now);\n \tparticles[i].disappearsFromEdge(canvasWidth, canvasHeight);\n\t\t\tSet<Particle> nearBy = tree.retrieve(particles[i]);\n\t\t\tfor (Particle particle : nearBy) {\n\t\t\t\tif (particle != particles[i])\n\t\t\t\t\tparticles[i].collidesWith(particle);\n\t\t\t}\n }\n }", "public void Update() {\r\n\t\t//if player is near and haven't fired in a while, fire a projectile\r\n\t\tif(!playerNear().equals(\"n\") && j > 250){\r\n\t\t\tfireProjectile(playerNear());\r\n\t\t\tj = 0;\r\n\t\t}\r\n\t\tj++;\r\n\r\n\t\t//COLLISION\r\n\t\tfor(int i = 0; i < AdventureManager.currentRoom.projectiles.size(); i++){ //Checks for collision with player projectiles\r\n\t\t\tif(((AdventureManager.currentRoom.projectiles.get(i).x + 50 > x) && (AdventureManager.currentRoom.projectiles.get(i).x + 50 < x+50) &&(AdventureManager.currentRoom.projectiles.get(i).y + 50> y) &&(AdventureManager.currentRoom.projectiles.get(i).y + 50< y+98) )\r\n\t\t\t\t\t|| ((AdventureManager.currentRoom.projectiles.get(i).x > x) && (AdventureManager.currentRoom.projectiles.get(i).x < x+50) &&(AdventureManager.currentRoom.projectiles.get(i).y + 50> y) &&(AdventureManager.currentRoom.projectiles.get(i).y + 50< y+98) )\r\n\r\n\t\t\t\t\t\t) {\r\n\r\n\t\t\t\t\tswitch(AdventureManager.currentRoom.projectiles.get(i).type) {\r\n\t\t\t\t\tcase \"fireball\": health -= AdventureManager.toon.intelligence; break;\r\n\t\t\t\t\tcase \"sword\": health -= AdventureManager.toon.strength;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tAdventureManager.currentRoom.projectiles.get(i).kill();\r\n\t\t\t\t}\r\n\t\t}\r\n\t\tif((AdventureManager.toon.y < y+50) && (AdventureManager.toon.y > y+40) && //Checks for collision with player\r\n\t\t\t\t(((AdventureManager.toon.x > x) && (AdventureManager.toon.x < x+50))\r\n\t\t\t\t|| ((AdventureManager.toon.x+50 > x) && AdventureManager.toon.x+50 < x+50))) {\r\n\t\t\tAdventureManager.toon.y = y+55; AdventureManager.toon.repaint();\r\n\t\t\tif(contact <= 0){\r\n\t\t\t\tAdventureManager.toon.damage(1);\r\n\t\t\t\tcontact = 50;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if((AdventureManager.toon.y+100 < y) && (AdventureManager.toon.y+100 > y-5) && (((AdventureManager.toon.x >= x) && (AdventureManager.toon.x <= x+50)) //Checks for collision with player\r\n\t\t\t\t|| ((AdventureManager.toon.x+50 >= x) && (AdventureManager.toon.x+50 <= x+50))\r\n\t\t\t\t|| ((AdventureManager.toon.x+25 >= x) && AdventureManager.toon.x+25 <= x+50))) {\r\n\t\t AdventureManager.toon.y = y-105; AdventureManager.toon.repaint();\r\n\t\t AdventureManager.toon.jumpCount = 25;\r\n\t\t if(contact <= 0){\r\n\t\t\t AdventureManager.toon.damage(1);\r\n\t\t\t contact = 50;\r\n\t\t }\r\n\t\t}\r\n\t\telse if(((AdventureManager.toon.x + 50) > x) && ((AdventureManager.toon.x+50)<x+20) && ( //Left Collision\r\n\t\t\t\t((AdventureManager.toon.y > y) && (AdventureManager.toon.y < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 25 > y) && (AdventureManager.toon.y + 25 < y+45)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 50 > y) && (AdventureManager.toon.y + 50 < y+45)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 75 > y) && (AdventureManager.toon.y + 75 < y+45)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 100 > y) && (AdventureManager.toon.y + 100 < y+45))\r\n\r\n\r\n\t\t\t\t) ) {\r\n\t\t\tAdventureManager.toon.x = x-51; AdventureManager.toon.repaint();\r\n\t\t\tif(contact <= 0){\r\n\t\t\t\tAdventureManager.toon.damage(1);\r\n\t\t\t\tcontact = 50;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(((AdventureManager.toon.x) > x+40) && ((AdventureManager.toon.x)<x+50) && ( //Right Collision\r\n\t\t\t\t((AdventureManager.toon.y > y) && (AdventureManager.toon.y < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 25 > y) && (AdventureManager.toon.y + 25 < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 50 > y) && (AdventureManager.toon.y + 50 < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 75 > y) && (AdventureManager.toon.y + 75 < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 100 > y) && (AdventureManager.toon.y + 100 < y+50))\r\n\r\n\r\n\t\t\t\t) ) {\r\n\t\t\tAdventureManager.toon.x = x+51; AdventureManager.toon.repaint();\r\n\t\t\tif(contact <= 0){\r\n\t\t\t\tAdventureManager.toon.damage(1);\r\n\t\t\t\tcontact = 50;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcontact--;\r\n\t\tif(health<=0){\r\n\t\t\tsetVisible(false);\r\n\t\t\talive = false;\r\n\t\t\tAdventureManager.currentRoom.enemies.remove(this);\r\n\t\t}\r\n\r\n\r\n\r\n\t\t\tif((y+100)>=AdventureManager.floorHeight) {\r\n\t\t\t\ty= AdventureManager.floorHeight -100;\r\n\t\t\t\tgravity *= 0;\r\n\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tgravity = 3;}\r\n\r\n\t\t\ty += gravity; setLocation(x,y);\r\n\r\n\t\t\tswitch(movetype) {\r\n\t\t\tcase 0: chasePlayer(); break;\r\n\t\t\tcase 1: randomMove(); break;\r\n\t\t\tcase 2: dontMove(); break;\r\n\t\t\t}\r\n\r\n\t\t\t}", "public void update(GameContainer gc, StateBasedGame sbg, int i) throws SlickException {\n\r\n //spriteID = new SpriteSheet(\"Images/Free/Main Characters/Pink Man/Run2 (32x32).png\",32,32);\r\n //CA = new Animation(spriteID,50);\r\n \r\n Franklen.CheckMove(gc);\r\n \r\n if(ground.getY()<=Franklen.getYP()+32){\r\n Franklen.setGround(true);\r\n }\r\n else{\r\n Franklen.setGround(false);\r\n }\r\n for (int k = 0; k < Apples.length; k++) {\r\n if(Franklen.getHitBox().intersects(Apples[k].getHitbox())&&Apples.length>0){\r\n \r\n Apples[k].setX(1000);\r\n \r\n apples++;\r\n }\r\n }\r\n \r\n\r\n if(finish.intersects(Franklen.getHitBox())&&apples==10){\r\n sbg.enterState(1, new FadeOutTransition(), new FadeInTransition());\r\n }\r\n }", "public void doGameOver() {\r\n\t// all players takes seeds left on their side of the game\r\n\tfor (short i = 0; i < this.size; i++) {\r\n\t if (this.territory[0][i] != 0) {\r\n\t\tthis.points[0] += this.territory[0][i];\r\n\t\tthis.territory[0][i] = 0;\r\n\t\tfireChanged(TERRITORY, (short) 0, i);\r\n\t }\r\n\r\n\t if (this.territory[1][i] != 0) {\r\n\t\tthis.points[1] += this.territory[1][i];\r\n\t\tthis.territory[1][i] = 0;\r\n\t\tfireChanged(TERRITORY, (short) 1, i);\r\n\t }\r\n\t}\r\n\tfireChanged(POINTS, NO_SIDE, NO_POSITION);\r\n }", "public void checkForHits(){\n\t\tfor(Missile missile : this.missiles){\n\t\t\tif(missile != null && !missile.isDestroyed()){\n\t\t\t\t// Check buildings\n\t\t\t\tfor (int i = 0; i < this.buildings.length; i++) {\n\t\t\t\t\tif(!this.buildings[i].isDestroyed()){\n\t\t\t\t\t\tif (this.buildings[i].getHitBox().intersects(missile.getHitBox())) {\n\t\t\t\t\t\t\tthis.buildings[i].destroy();\n\t\t\t\t\t\t\tmissile.setDestroyed(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}\n\t\t\t\t// Check turrets\n\t\t\t\tfor (int i = 0; i < this.turrets.length; i++ ) {\n\t\t\t\t\tif(!this.turrets[i].isDestroyed()){\n\t\t\t\t\t\tif (!missile.isFriendly() && this.turrets[i].getHitBox().intersects(missile.getHitBox())) {\n\t\t\t\t\t\t\tthis.turrets[i].destroy();\n\t\t\t\t\t\t\tmissile.setDestroyed(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}\n\t\t\t\t\n\t\t\t\t// Checks Missile vs. Friendly Missile collisions\n\t\t\t\tfor (Missile fMissile : this.friendlyMissiles){\n\t\t\t\t\tif(!fMissile.isDestroyed() && fMissile != null){\n\t\t\t\t\t\tif (missile.getHitBox().intersects(fMissile.getHitBox())) {\n\t\t\t\t\t\t\tfMissile.setDestroyed(true);\n\t\t\t\t\t\t\tmissile.setDestroyed(true);\n\t\t\t\t\t\t\tthis.incrementScore(this.SCORE_INCREASE);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void updateSafeSpots()\n\t{\n\t\tif (client.getLocalPlayer().getInteracting() != null)\n\t\t{\n\t\t\tActor enemy = client.getLocalPlayer().getInteracting();\n\t\t\tWorldArea worldArea = new WorldArea(enemy.getWorldLocation().getX() - 12,\n\t\t\t\tenemy.getWorldLocation().getY() - 12, 24, 24, client.getPlane());\n\t\t\tList<WorldPoint> worldPoints = worldArea.toWorldPointList();\n\t\t\tsafeSpotList = getSafeSpotList(enemy, worldPoints);\n\t\t}\n\t}", "public void updateScore() {\n\t\tif (pellet.overlapsWith(avatar)) {\n\t\t\tavatar.addScore(1);\n\t\t\tpellet.removePellet(avatar.getLocation());\n\t\t\tSystem.out.println(\"collected pellet\");\n\t\t}\n\t}", "private void respawnChest(){\n //remove the physical chest\n this.location.getBlock().setType(Material.AIR);\n\n //increment the level of the chest. If its higher than its max level, shut down.\n if(++this.level >= getMaxLevel()){\n deleteInstance();\n return;\n }\n\n //play a sound effect for all players (INCLUDING juggernaut) to indicate a chest respawned.\n for(JuggernautPlayer jp: JuggernautGame.getInstance().getPlayers()){\n PacketHelper.playSound(jp.getPlayer(), location, Sound.DIG_WOOD, 1f, 1f);\n }\n\n //set the seconds to unlock depending on the level of the chest\n this.secondsToUnlock = this.level==0 ? 15 : this.level==1 ? 30 : 60;\n\n //reset all old values\n this.claimProgress.clear();\n this.unlockedPercentage = 0;\n this.chestProgressLevel = 0;\n\n //get a new location to spawn the new chest in.\n this.location = JuggernautGame.getInstance().getRandomChestLocation().use();\n\n //log\n System.out.println(\"[Jugg] Respawned chest \" + this.getClass().getSimpleName() + \" Level \" + this.level + \" at \" + location.getBlockX() + \",\" + location.getBlockY() + \",\" + location.getBlockZ());\n\n //set the new location to a chest block\n this.location.getBlock().setType(Material.CHEST);\n }", "public void update() {\n\tif(myGlass != null && continueGlassMoving == true) \n\t\tmyGlass.moveLaterally(FactoryPart.WEST, 1);\n\tif(myGlass != null && isBreaking == true)\n\t{\n\t\tmyGlass.breakGlass();\n\t}\n if(myGlass != null && myGlass.getXCoord() /*+ myGlass.getWidth()*/ <= baseXCoord && continueGlassMoving == true)\n {\n \tisOn = false;\n \tcontinueGlassMoving = false;\n \t//getPart(FactoryPart.WEST).receiveGlass(myGlass,FactoryPart.EAST);\n \tcontroller.doneJob();\n \t\n \t\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}", "private void bladeAndActorOverlap() {\n for (BirdActor bird : birdList) {\n if (bird.isCircleOverlap(bladeActor.boundaryCircle)) {\n ExplosionActor explosionActor = new ExplosionActor(bird.getX(), bird.getY(), 0.03333f, explosionAtlas, Animation.PlayMode.NORMAL);\n gameStage.addActor(explosionActor);\n bird.setRandomPosition(birdActorLowestYPos);\n bird.flyAction.restart();\n lblHighScore.setText(scoreDefaultTxt + String.format(\"%04d\", ++score));\n ++destroyInOneShoot;\n }\n }\n }", "public void removeEffectFromSpecialBrick(){\r\n\t\t\t// return everything to the original\r\n\t\t\tColor origColor = (specialBrickId.equals(\"Rect0\"))? discsColors[0]:(specialBrickId.equals(\"Rect1\"))? discsColors[1]:\r\n\t\t\t\t\t\t (specialBrickId.equals(\"Rect2\"))? discsColors[2]:(specialBrickId.equals(\"Rect3\"))? discsColors[3]:\r\n\t\t\t\t\t\t (specialBrickId.equals(\"Rect4\"))? discsColors[4]:(specialBrickId.equals(\"Rect5\"))? discsColors[5]:\r\n\t\t\t\t\t\t (specialBrickId.equals(\"Rect6\"))? discsColors[6]:(specialBrickId.equals(\"Rect7\"))? discsColors[7]:null; \r\n\t\t\tint origWidth = (specialBrickId.equals(\"Rect0\"))? 30:(specialBrickId.equals(\"Rect1\"))? 60:\r\n\t\t\t\t\t\t\t(specialBrickId.equals(\"Rect2\"))? 90:(specialBrickId.equals(\"Rect3\"))? 120:\r\n\t\t\t\t\t\t\t(specialBrickId.equals(\"Rect4\"))? 150:(specialBrickId.equals(\"Rect5\"))? 180:\r\n\t\t\t\t\t\t\t(specialBrickId.equals(\"Rect6\"))? 210:(specialBrickId.equals(\"Rect7\"))? 240:null;\r\n\t\t\tRectangle rect = new Rectangle(origWidth,20, origColor);\r\n\t\t\trect.setId(specialBrickId);\r\n\t\t\trect.setStroke(Color.BLACK);\r\n\t\t\trect.setStrokeWidth(3);\r\n\t\t\t\t\t\t\r\n\t\t\tswitch(specialBrickTower){\r\n\t\t\t\tcase \"firstTower\":\r\n\t\t\t\t\tfor(int i=0; i<firstTower.getChildren().size(); i++){ // cycle through the tower to check which one is the special brick\r\n\t\t\t\t\t\tif (firstTower.getChildren().get(i).getId().equals(specialBrickId)){\r\n\t\t\t\t\t\t\tfirstTower.getChildren().set(i, rect); // then reset it\r\n\t\t\t\t\t}}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"secondTower\":\r\n\t\t\t\t\tfor(int i=0; i<secondTower.getChildren().size(); i++){\r\n\t\t\t\t\t\tif (secondTower.getChildren().get(i).getId().equals(specialBrickId)){\r\n\t\t\t\t\t\t\tsecondTower.getChildren().set(i, rect);\r\n\t\t\t\t\t}}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"thirdTower\":\r\n\t\t\t\t\tfor(int i=0; i<thirdTower.getChildren().size(); i++){\r\n\t\t\t\t\t\tif (thirdTower.getChildren().get(i).getId().equals(specialBrickId)){\r\n\t\t\t\t\t\t\tthirdTower.getChildren().set(i, rect);\r\n\t\t\t\t\t}}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\trect.widthProperty().bind(scene.widthProperty().divide(3).subtract(250-origWidth));\r\n\t\t\trect.heightProperty().bind(scene.heightProperty().divide(19));\r\n\t\t\r\n\t\tif(countDownRunning){towersRegion.getChildren().remove(2);countDownRunning=false;} // remove the count down watch from the screen\t\t\r\n\t\tspecialBrickId=null; // reset the special brick id\r\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}", "void updateScreen() {\n\t\tZone possibleNewZone = currentZone.getSpace(playerY, playerX).getNextZone();\n\t\tif (possibleNewZone != null) {\n\t\t\tString oldBGMusic = currentZone.getBackgroundMusic();\n\t\t\tcurrentZone = possibleNewZone;\n\t\t\tcurrentZone.enableZoneWarpSpaces();\n\t\t\tplayerX = currentZone.getPlayerStartX();\n\t\t\tplayerY = currentZone.getPlayerStartY();\n\t\t\t\n\n\t\t\tif (!oldBGMusic.equals(currentZone.getBackgroundMusic())) {\n\t\t\t\tmusicPlayer.stop();\n\t\t\t\tmusicPlayer.play(currentZone.getBackgroundMusic(), 100);\n\t\t\t}\n\t\t}\n\n\t\t// Update Panel Colors\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tfor (int a = 0; a < 10; a++) {\n\t\t\t\tpanels[i][a].setBackground(currentZone.getSpace(i, a).getColor());\n\t\t\t}\n\t\t}\n\n\t\t// Update Labels\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tfor (int a = 0; a < 10; a++) {\n\n\t\t\t\tlabels[i][a].setIcon(currentZone.getSpace(i, a).getPic());\n\t\t\t}\n\t\t}\n\t\t// Shows player in the new space\n\t\tlabels[playerY][playerX].setIcon(playerPic);\n\n\t\t// Shows enemy in the new space\n\t\t// labels[enemyY][enemyX].setIcon(enemyPic);\n\t}", "public void sideCheck() {\n /*Be careful when creating tiles, especially ones that allow Sonic's bottom and middle sensors to intersect \n the same tile*/\n mLCollide = false;\n mRCollide = false;\n if(grounded) {\n if(groundSpeed > 0) {\n sideCollision(middleRight);\n }\n else if(groundSpeed < 0) {\n sideCollision(middleLeft);\n } \n }\n else if(!grounded) {\n if(xSpeed < 0) {\n sideCollision(middleLeft);\n }\n else if(xSpeed > 0) {\n sideCollision(middleRight);\n }\n }\n }", "public void detectAndSendChanges() {\n super.detectAndSendChanges();\n\n for (int var1 = 0; var1 < this.crafters.size(); ++var1) {\n ICrafting var2 = (ICrafting) this.crafters.get(var1);\n\n if (this.brewTime != this.tileBrewingStand.getField(0)) {\n var2.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getField(0));\n }\n }\n\n this.brewTime = this.tileBrewingStand.getField(0);\n }", "private void update() {\n if(!Constants.GAME_OVER) {\n deltaTime = (int) (System.currentTimeMillis() - startTime);\n startTime = System.currentTimeMillis();\n elapsedTime = (int) (System.currentTimeMillis() - initTime)/1000;\n Constants.ELAPSED_TIME = elapsedTime;\n //Log.d(\"FRAMES \", \"\"+ Constants.FRAME_COUNT);\n //call update on every object\n player.update();\n enemyManager.update(player);\n starManager.update(player.getSpeed());\n asteroidManager.update(player);\n } else {\n playing = false;\n sound.stopBg();\n for(int i = 0; i < highScore.length; i++) {\n if (Constants.SCORE > highScore[i]) {\n final int endI = i;\n highScore[i] = Constants.SCORE;\n // Log.d(\"SCORE \", \"\" + highScore[i]);\n break;\n }\n }\n\n SharedPreferences.Editor editor = sharedPreferences.edit();\n for(int i = 0; i < highScore.length; i++) {\n int index = i + 1;\n editor.putInt(\"score\" + index, highScore[i]);\n }\n editor.apply();\n }\n }", "@Override\r\n\t\tpublic void run() {\n\t\t\t\r\n\t\t\tnew BukkitRunnable() {\r\n\t\t\t\t\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(Entity as: Bukkit.getWorld(\"world\").getEntities()) {\r\n\t\t\t\t\t\tif(as instanceof ArmorStand) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tas.remove();\r\n\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\t//TOPS\r\n\t\t\t\t\r\n\t\t\t\t\tif(MetodosWarps.containsWarp(\"topkills\")) {\r\n\t\t\t\t\t getTop(locTopKILLS,\"Kills\");\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žAžlTOP KILLS ATUALIZADO COM SUCESSO! \\n \");\t\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žcžlO TOP KILLS NAO PODE SER CARREGADO, POIS A WARP topkills NAO ESTA SETADA! \\n \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(MetodosWarps.containsWarp(\"topcoins\")) {\r\n\t\t\t\t\t getTop(locTopCoins,\"Coins\");\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žAžlTOP COINS ATUALIZADO COM SUCESSO! \\n \");\t\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žcžlO TOP COINS NAO PODE SER CARREGADO, POIS A WARP topkills NAO ESTA SETADA! \\n \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(MetodosWarps.containsWarp(\"top1v1\")) {\r\n\t\t\t\t\t getTop(locTop1v1,\"wins\");\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žAžlTOP 1v1 ATUALIZADO COM SUCESSO! \\n \");\t\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žcžlO TOP 1v1 NAO PODE SER CARREGADO, POIS A WARP top1v1 NAO ESTA SETADA! \\n \");\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\t\r\n\t\t\t\t\t//Caixa misteriosa\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(MetodosWarps.containsWarp(\"misteryBox\")) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t Spawn(misteryBox, \"žažlCAIXA MISTERIOSA\",misteryBox.getY()-1.7);\r\n\t\t\t\t\t Spawn(misteryBox, \"žežlEM BREVE!\",misteryBox.getY()-2);\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žAžlMYSTERYBOX ATUALIZADO COM SUCESSO! \\n \");\t\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žcžlO TOP COINS NAO PODE SER CARREGADO, POIS A WARP misteryBox NAO ESTA SETADA! \\n \");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}.runTaskLater(Main.plugin, 20);\r\n\t\t\t\r\n\t\t}", "public void collisionEvent(Keeper keeper) {\r\n if (getPossessionStatus() &&\r\n (keeper.getTeam().getColor() != this.getTeam().getColor()))\r\n {\r\n if(!keeper.isStunned() && //They do not tackle you if they are stunned!\r\n random.nextInt(MAX_CHANCE) <= KEEPER_CHANCE) // and a 40% chance.\r\n {\r\n dropQuaffle(); // Simulating the chaser of the opposing team tackling you.\r\n }\r\n }\r\n super.collisionEvent(keeper);\r\n }", "public abstract void placeSmoke(ShortPoint2D position, boolean smokeOn);", "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 }", "public void generalUpdate() {\n\n\t\tif (player.isDead()) {\n\t\t\trespawnTimer++;\n\t\t\tif (respawnTimer > 90) {\n\t\t\t\treset();\n\t\t\t}\n\t\t}\n\t\tif (started) {\n\t\t\tplayer.generalUpdate();\n\n\t\t\tspawnCount++;\n\t\t\tif (spawnCount > 100) {\n\t\t\t\tcreateWall();\n\t\t\t\tspawnCount = 0;\n\t\t\t}\n\t\t}\n\n\t\tsky.generalUpdate();\n\t\tmountains.generalUpdate();\n\t\ttrees.generalUpdate();\n\n\t\t//Cycle through walls ArrayList and update each one\n\t\t\n\t\tfor (int i = 0; i < walls.size(); i++) {\n\t\t\tWall w = walls.get(i);\n\t\t\tw.generalUpdate();\n\t\t}\n\t\t//Same thing with Ground objects\n\t\t\n\t\tfor (int i = 0; i < ground.size(); i++) {\n\t\t\tGround g = ground.get(i);\n\t\t\tg.generalUpdate();\n\n\t\t\t//Also check each for collision with player\n\t\t\t\n\t\t\tif (player.getBounds().overlaps(g.getBounds())\n\t\t\t\t\t&& player.isDead() == false) {\n\t\t\t\tplayer.die();\n\t\t\t\tAssets.playSound(\"hit\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t//When walls go off screen, delete\n\t\t\n\t\tfor (int i = 0; i < walls.size(); i++) {\n\t\t\tWall w = walls.get(i);\n\t\t\tif (w.getBounds().x < -64) {\n\t\t\t\twalls.remove(i);\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < checkPoints.size(); i++) {\n\t\t\tWall c = checkPoints.get(i);\n\t\t\tc.generalUpdate();\n\t\t}\n\n\t\tfor (int i = 0; i < checkPoints.size(); i++) {\n\t\t\tWall c = checkPoints.get(i);\n\t\t\tif (c.getBounds().x <= player.getBounds().x) {\n\t\t\t\tscore++;\n\t\t\t\tcheckPoints.remove(i);\n\t\t\t\ti--;\n\t\t\t\tAssets.playSound(\"score\");\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < walls.size(); i++) {\n\t\t\tWall w = walls.get(i);\n\t\t\tif (player.getBounds().overlaps(w.getBounds())\n\t\t\t\t\t&& player.isDead() == false) {\n\t\t\t\tplayer.die();\n\t\t\t\tAssets.playSound(\"hit\");\n\t\t\t}\n\t\t}\n\n\t\tif (score > highScore) {\n\t\t\thighScore = score;\n\t\t}\n\n\t}", "private void startGame() {\n\t\tfor (int j = 0; j< this.game_.getSaveBaby().size();j++){\n\t\t\tBabyBunnies b = this.game_.getSaveBaby().get(j);\n this.object_batch.begin();\n this.object_batch.draw(img_baby,b.getPosition().y,b.getPosition().x,150,150);\n this.object_batch.end();\n\t\t\tthis.pos=b.getPosition();\n\t\t}\n\n/**\n * Apparition du loup et mv\n * et reset de position quand il va trop loin\n */\n\t\tif ((this.game_.getNbBunnies()%10) == 0 && this.game_.getNbBunnies()!= 0 ){\n\t\t\tthis.game_.hunt(this.pos);\n this.object_batch.begin();\n this.object_batch.draw(wolf,this.game_.getWolf().getPosition().y,this.game_.getWolf().getPosition().x,150,150);\n this.object_batch.end();\n\t\t\tthis.game_.getWolf().move(this.game_.getNbBunnies()/10);\n Gdx.app.log(\"wolf\",\"pos lapon \"+this.game_.getSaveBaby().get(0).getPosition());\n Gdx.app.log(\"wolf\",\"pos du loup \"+this.game_.getWolf().getPosition());\n\t\t}\n\t\tif (this.game_.getWolf().getPosition().y>=width || this.game_.getWolf().getPosition().y<0){\n\t\t\tthis.game_.getWolf().restPost();\n\t\t}\n\n/**\n * Check + mv accelerometre\n */\n\t\tif (this.isOnAccelerometer) {\n\t\t\tif (this.mvX < 0 ){\n this.mvX=height;\n\t\t\t}\n\t\t\tif (this.mvY < 0) {\n this.mvY = width;\n\t\t\t}\n\t\t\tif (this.mvX >height){\n this.mvX=0;\n\t\t\t}\n\t\t\tif (this.mvY> width){\n this.mvY = 0;\n\t\t\t}\n\n this.mvX +=-Gdx.input.getAccelerometerX()*1.50;\n this.mvY += Gdx.input.getAccelerometerY()*2.50;\n\t\t\tthis.game_.getBunnyHood().setPosition((int)(mvX),(int)(mvY));\n\t\t\tcollision();\n this.player_batch.begin();\n this.player_batch.draw(this.img_bunnyHood,this.game_.getBunnyHood().getPosition().y,this.game_.getBunnyHood().getPosition().x,200,200);\n this.player_batch.end();\n\n\t\t\tGdx.app.log(\"Score\",Integer.toString(this.game_.getNbBunnies()));\n\n\t\t}\n\t}" ]
[ "0.58884573", "0.5873013", "0.559507", "0.55443275", "0.54739755", "0.544614", "0.54151773", "0.53953624", "0.53254473", "0.5324741", "0.52972865", "0.52840495", "0.528066", "0.5279545", "0.5269064", "0.52434283", "0.5241604", "0.5224888", "0.52208865", "0.52208817", "0.5215534", "0.5203909", "0.5200715", "0.51933753", "0.5189198", "0.5181653", "0.5165845", "0.51656175", "0.5160534", "0.51574236", "0.51553255", "0.5153037", "0.51393765", "0.51342726", "0.5113757", "0.5103645", "0.5092667", "0.5085848", "0.5085472", "0.50795645", "0.50759363", "0.5039061", "0.5038941", "0.5035413", "0.5034436", "0.5022072", "0.50204414", "0.5020012", "0.5017846", "0.5017177", "0.50147086", "0.5014196", "0.5009885", "0.5008623", "0.5006601", "0.5005295", "0.49973276", "0.49950534", "0.49936932", "0.49855885", "0.49815768", "0.49779576", "0.49756366", "0.49721512", "0.49689332", "0.49366325", "0.49302858", "0.49301958", "0.49174234", "0.49093726", "0.4908931", "0.49087462", "0.48927367", "0.4890943", "0.48908854", "0.48859334", "0.48839176", "0.48646194", "0.48567855", "0.48455167", "0.4843118", "0.4832638", "0.48319173", "0.48279828", "0.48247492", "0.48242143", "0.48194003", "0.48181155", "0.48181012", "0.48159912", "0.4811593", "0.4811063", "0.4806401", "0.48049167", "0.47984847", "0.47981605", "0.47926214", "0.47905272", "0.47870046", "0.4785801" ]
0.71811837
0
Checks if the given rocket is hit any of enemy helicopters.
private boolean HasRocketHitEnemy(Rocket rocket) { boolean HitEnemy = false; Rectangle rocketRectangle = new Rectangle(rocket.xCoord, rocket.yCoord,rocket.RocketImage.getWidth(), rocket.RocketImage.getHeight()); // Go through all enemies. for(int j = 0; j < EnemyList.size(); j++) { Enemy eh = EnemyList.get(j); // Current enemy rectangle. Rectangle enemyRectangel = new Rectangle(eh.xCoord, eh.yCoord, eh.EnemyHelicopterImage.getWidth(), eh.EnemyHelicopterImage.getHeight()); // Is current rocket over current enemy? if(rocketRectangle.intersects(enemyRectangel)) { HitEnemy = true; // Rocket hit the enemy so we reduce his health. eh.Health -= rocket.damagePower; // Rocket hit enemy so we don't need to check other enemies. break; } } return HitEnemy; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void checkHits() {\n\t\t// your code here\n\t\tfor (int i = 0; i < enemyX.length; i++) {\n\t\t\tif (distance((int)xI, (int)yI, enemyX[i], enemyY[i]) <= DIAM_ENEMY/2 + DIAM_LAUNCHER/2) {\n\t\t\t}\n\t\t}\n\t}", "boolean collidesEnemy() {\n for(int i = 0; i < barrage.size(); i++) {\n // establish a rectangle for the laser\n Rectangle blaster = new Rectangle((int)barrage.get(i).getX(), (int)barrage.get(i).getY(), WIDTH, HEIGHT);\n \n // determine if the laser intersects an enemy\n for (int q = 0; q < fleet.size(); q++) {\n Rectangle enemy = new Rectangle((int)fleet.get(q).getX(), (int)fleet.get(q).getY(), 40, 36); \n \n // if blaster hits a ship, remove it\n if (blaster.intersects(enemy) && fleet.get(q).getCount() == 0) {\n fleet.get(q).hit = true; // set the enemy hit\n barrage.remove(barrage.get(i));\n score += 100; // add to score\n return true; // hit\n }\n }\n }\n return false; // miss\n }", "private boolean enemyCanAttack(PieceColor allyColor, Location loc)\n {\n if (!loc.isValid())\n return false;\n for (Piece other: getPieces())\n {\n if (other.getColor()!=allyColor && canAttack(other,loc))\n return true;\n }\n return false;\n }", "private boolean canReach(Point positionEnemy, Point towerPosition) {\n return towerPosition.distance(positionEnemy) / Tile.TILE_WIDTH <= tower.getFireRange();\n }", "public static boolean isUnderThreat(int x, int y, ArrayList<Piece> listOfThreats){\n if (listOfThreats == null) return false;\n for(Piece piece : listOfThreats)\n {\n if(piece.moveCheck(x, y)) return true;\n }\n return false;\n }", "private boolean checkNearbyVillagers() {\n\t\tIterator<Integer> it = sprites.keySet().iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tSprite as = sprites.get(it.next());\n\t\t\tif (as instanceof Villager) {\n\t\t\t\tVillager v = (Villager) as;\n\t\t\t\tif (v.checkTalkable(player.pos, player.direction)) {\n\t\t\t\t\treturn executeTalkableVillager(v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean wantsToAttack() {\n boolean ret = false;\n \n potentialAttackers.clear(); //Previous potentials might no longer be adjacent to an enemy\n \n //Look at all my territories. If it has enough troops to smack someone, it does.\n for(Territory t : gameController.getBoard().getAgentsTerritories(this)){\n if(t.getNumTroops() > 1){\n \n //Check adjacent territories to see if we can do anything about it.\n List<Territory> adjs = gameController.getBoard().getAdjacentTerritories(t);\n for(Territory adj : adjs){\n //Record a boolean so we don't need to call it twice;\n boolean yes = !adj.getOwner().equals(this);\n \n //Check if we have an acceptable chance of success\n int tTroops = t.getNumTroops() - 1;\n int aTroops = adj.getNumTroops();\n double odds = MarkovLookupTable.getOddsOfSuccessfulAttack(tTroops, aTroops);\n yes &= Double.compare(odds, ACCEPTABLE_RISK) >= 0;\n \n //If we can attack with this territory, yes will be true, throw this Territory\n //in the list of potential attackers if it isn't already in there.\n if(yes){\n if(!potentialAttackers.contains(t)){\n potentialAttackers.add(t);\n }\n }\n ret |= yes; //Ret will be set to true and can't be unset if even 1 t can attack\n }\n }\n }\n \n return ret;\n }", "private static void checkForEnemies() throws GameActionException {\n //No need to hijack code for structure\n if (rc.isWeaponReady()) {\n // basicAttack(enemies);\n HQPriorityAttack(enemies, attackPriorities);\n }\n \n //Old splash damage code\n //Preserve because can use to improve current splash damage code\n //But not so simple like just checking directions, since there are many more \n //locations to consider hitting.\n /*if (numberOfTowers > 4) {\n //can do splash damage\n RobotInfo[] enemiesInSplashRange = rc.senseNearbyRobots(37, enemyTeam);\n if (enemiesInSplashRange.length > 0) {\n int[] enemiesInDir = new int[8];\n for (RobotInfo info: enemiesInSplashRange) {\n enemiesInDir[myLocation.directionTo(info.location).ordinal()]++;\n }\n int maxDirScore = 0;\n int maxIndex = 0;\n for (int i = 0; i < 8; i++) {\n if (enemiesInDir[i] >= maxDirScore) {\n maxDirScore = enemiesInDir[i];\n maxIndex = i;\n }\n }\n MapLocation attackLoc = myLocation.add(directions[maxIndex],5);\n if (rc.isWeaponReady() && rc.canAttackLocation(attackLoc)) {\n rc.attackLocation(attackLoc);\n }\n }\n }//*/\n \n }", "public void checkRockets() {\n for (Rocket rocket : rockets) {\n for (Ufo ufo : ufos) {\n if (ufo.intersects(rocket)) {\n ufo.die();\n rocket.die();\n }\n }\n\n if (rocket.getY() <= 0)\n rocket.die();\n }\n }", "boolean allEnemyShipsAreDestroyed()\n\t{\n\t\tfor (int i = 0; i < targets.myShips.size(); i++) {\n\t\t\tif (targets.myShips.get(i).isAlive()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public void checkForHits(){\n\t\tfor(Missile missile : this.missiles){\n\t\t\tif(missile != null && !missile.isDestroyed()){\n\t\t\t\t// Check buildings\n\t\t\t\tfor (int i = 0; i < this.buildings.length; i++) {\n\t\t\t\t\tif(!this.buildings[i].isDestroyed()){\n\t\t\t\t\t\tif (this.buildings[i].getHitBox().intersects(missile.getHitBox())) {\n\t\t\t\t\t\t\tthis.buildings[i].destroy();\n\t\t\t\t\t\t\tmissile.setDestroyed(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}\n\t\t\t\t// Check turrets\n\t\t\t\tfor (int i = 0; i < this.turrets.length; i++ ) {\n\t\t\t\t\tif(!this.turrets[i].isDestroyed()){\n\t\t\t\t\t\tif (!missile.isFriendly() && this.turrets[i].getHitBox().intersects(missile.getHitBox())) {\n\t\t\t\t\t\t\tthis.turrets[i].destroy();\n\t\t\t\t\t\t\tmissile.setDestroyed(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}\n\t\t\t\t\n\t\t\t\t// Checks Missile vs. Friendly Missile collisions\n\t\t\t\tfor (Missile fMissile : this.friendlyMissiles){\n\t\t\t\t\tif(!fMissile.isDestroyed() && fMissile != null){\n\t\t\t\t\t\tif (missile.getHitBox().intersects(fMissile.getHitBox())) {\n\t\t\t\t\t\t\tfMissile.setDestroyed(true);\n\t\t\t\t\t\t\tmissile.setDestroyed(true);\n\t\t\t\t\t\t\tthis.incrementScore(this.SCORE_INCREASE);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public boolean hitBy(Pweapon weapon, Tower tower) {\r\n\t\tif (!spawned)\r\n\t\t\treturn false;\r\n\r\n\t\t// System.out.println(\"Tir avec arme : \" + weapon.getNameWeapon());\r\n\t\tif (!tower.isControledByPlayer()) {\r\n\t\t\t// if (decideShootMiss(tower)) {\r\n\t\t\tthis.health -= weapon.getDamage();\r\n\t\t\t// }\r\n\t\t} else {\r\n\t\t\tthis.health -= weapon.getDamage();\r\n\t\t}\r\n\t\tif (this.health <= 0) {\r\n\t\t\tthis.health = 0;\r\n\t\t\tthis.spawned = false;\r\n\t\t}\r\n\t\treturn this.health == 0;\r\n\t}", "public boolean checkHit(int x, int y) {\n\t\t\n\t\t//Check if the guard caught the hero\n\t\tint[][] adjacent = new int[][] {\n\t\t\t{ getY() + 1, getX()},\n\t\t\t{ getY() - 1, getX()},\n\t\t\t{ getY(), getX() + 1},\n\t\t\t{ getY(), getX() - 1}\n\t\t\t};\n\n\t\tfor (int[] spot : adjacent) {\n\t\t\tif (spot[1] == x && spot[0] == y) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\t\t\n\t}", "static boolean canEscape(Point dog, Point gopher, Point hole)\n {\n double dog_dist = distance(dog.x, dog.y, hole.x, hole.y);\n double gopher_dist = distance(gopher.x, gopher.y, hole.x, hole.y);\n return (dog_dist >= (gopher_dist*2));\n }", "public static boolean checkVictory(){\n\t\tboolean victory = true;\n\t\t\n\t\tfor (int i = 0; i < enemyList.length && victory; i++) {\n\t\t\tif (enemyList[i].isAlive()) {\n\t\t\t\tvictory = false;\n\t\t\t}\n\t\t}\n\t\treturn victory;\n\t}", "public boolean isEnemy(Piece piece) {\n\t\treturn piece == null ? false : piece.team != this.team;\n\t}", "public boolean isBattleOver(){\n\n if(battleEnemies.size() == 0) {\n System.out.println(\"Battle over all enemies dead\");\n findDefeated();\n cleanStatuses();\n result = true;\n\n return true;\n }\n if(character.getCurrHP() <= 0){\n System.out.println(\"Battle over character has died\");\n //findDefeated();\n cleanStatuses();\n result = false;\n\n return true;\n }\n //System.out.printf(\"remaining enemies: %s\\n\", battleEnemies.size());\n return false;\n }", "private boolean isEnemyOccupied(int x, int y) {\n for (int i = 0; i < player.own.length; i++) {\n if (player.enemy[i].x == x && player.enemy[i].y == y) {\n System.out.println(\"enemy occupied:\" + i);\n return true;\n }\n }\n return false;\n }", "@Override\n public boolean hasHipCrit() {\n for (int loc = 0; loc < NUM_MECH_LOCATIONS; loc++) {\n if (legHasHipCrit(loc)) {\n return true;\n }\n }\n return false;\n }", "public boolean isHit(Collideable otherCol){\n return this.collideable.getHitX() - otherCol.getHitX() < 50\n && this.collideable.getHitX() - otherCol.getHitX() > -50\n && this.collideable.getHitY() - otherCol.getHitY() > -30\n && this.collideable.getHitY() - otherCol.getHitY() < 30;\n }", "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}", "public boolean checkContain(Hero h) {\r\n return team.contains(h);\r\n }", "private boolean checkSeesPlayer(int x, int y) {\r\n\t\tint enemy;\r\n\t\tif (creature.getCreature().team == 1) {\r\n\t\t\tenemy = 2;\r\n\t\t} else if (creature.getCreature().team == 2) {\r\n\t\t\tenemy = 1;\r\n\t\t} else {\r\n\t\t\tenemy = 0; //No enemy\r\n\t\t}\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(Creature c : handler.getWorld().getEntityManager().getCreatures()) {\r\n\t\t\tif (c.getCreature().team == enemy) {\r\n\t\t\t\tif(c.getCollisionBounds(0, 0).intersects(r)) {\r\n\t\t\t\t\tseenEnemy = c;\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean hasScannedEnemies()\n\t{\n\t\treturn (lastscanround == br.curRound && !needToScanEnemies);\n\t}", "public boolean[] isFightWinning() {\n RobotInfo[] nearbyEnemies = Cache.getEngagementEnemies();\n if (nearbyEnemies.length == 0) {\n return new boolean[] {true};\n }\n \n RobotInfo closestEngageable = null;\n double closestDist = Double.MAX_VALUE;\n double tempDist = 0;\n for (RobotInfo bot : nearbyEnemies) {\n switch (bot.type) {\n case HQ:\n case TOWER:\n // TODO figure out how to deal with towers that turn up...\n return new boolean[] {false, false};\n case BEAVER:\n case DRONE:\n case SOLDIER:\n case TANK:\n case COMMANDER:\n case MINER:\n case BASHER:\n case MISSILE:\n tempDist = curLoc.distanceSquaredTo(bot.location);\n if (tempDist < closestDist) {\n closestDist = tempDist;\n closestEngageable = bot;\n }\n break;\n default:\n break;\n }\n }\n \n if (closestEngageable == null) {\n return new boolean[] {true};\n }\n \n RobotInfo[] allies = rc.senseNearbyRobots(closestEngageable.location, ALLY_INLCUDE_RADIUS_SQ, myTeam);\n double allyScore = Util.getDangerScore(allies);\n double enemyScore = Util.getDangerScore(rc.senseNearbyRobots(closestEngageable.location, ENEMY_INCLUDE_RADIUS_SQ, theirTeam));\n // rc.setIndicatorString(2, \"Ally score: \" + allyScore + \", Enemy score: \" + enemyScore);\n if (allyScore > enemyScore) {\n return new boolean[] {true};\n } else {\n // Check if we are definitely going to die.\n double myHealth = rc.getHealth();\n int myID = rc.getID();\n boolean isAlone = true;\n for (int i = allies.length; i-- > 0;) {\n if (allies[i].ID != myID) {\n isAlone = false;\n if(allies[i].health < myHealth) {\n return new boolean[] {false, false};\n }\n }\n }\n // We didn't find any bots with lower health, so we are the lowest.\n // If we are alone, we should retreat anyways...\n return new boolean[] {false, !isAlone};\n }\n }", "@Override\n public boolean isGameOver() {\n if (!gameStarted) {\n return false;\n }\n // If any non-foundation pile still has cards, the game is not over.\n for (IPile pile : this.cascadePiles) {\n if (!pile.isEmpty()) {\n return false;\n }\n }\n for (IPile pile : this.openPiles) {\n if (!pile.isEmpty()) {\n return false;\n }\n }\n // If all the non-foundation piles are empty, the foundation piles must all be full,\n // so the game is over.\n return true;\n }", "public boolean hasHitShip() {\n\t\t// see if the lines of the ship have intersected with the lines of the\n\t\t// asteroid\n\t\treturn linesIntersect();\n\n\t}", "public boolean canHit() {\n\t\treturn this.hand.countValue().first() < 17;\n\t}", "public boolean checkHit(Rectangle r){\n\t\t\tif (exists){\n\t\t\t\tif(this.intersects(r) || this.contains(r)){\n\t\t\t\t\thealth -= 1; //reduces the curret health\n\t\t\t\t\tif (health == 0) {\n\t\t\t\t\t\texists = false;\n\t\t\t\t\t\tstartboomtimer = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tstartredtimer = true; //starts the red animation\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse return false;\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public boolean canThreaten(ChessPiece occupant) {\n\t\treturn (occupant.getPlayer() != owner.getPlayer());\n\t}", "boolean testIsTouchingILoGamePieceShip(Tester t) {\n return t.checkExpect(ship2.isTouching(los2), false)\n && t.checkExpect(ship2.isTouching(lob2), true)\n && t.checkExpect(ship3.isTouching(lob3), true)\n && t.checkExpect(ship3.isTouching(mt), false);\n }", "public boolean kingCheck(ArrayList<Piece> pieces) {\r\n boolean check = false;\r\n int[] kingCoords = new int[]{this.getX(), this.getY()};\r\n\r\n for (Piece piece : pieces) {\r\n if (piece.getColor() != this.getColor()) { // If the color does not match the king's color...\r\n for (int[] coordinate : piece.range) {\r\n if (coordinate[0] == kingCoords[0] && coordinate[1] == kingCoords[1]) { // Checks to see if the king is in range of enemy pieces\r\n check = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return check;\r\n }", "public boolean isOver() {\n\t\t\n\t\tif(!dealer.hasCards()){\n\t\t\tisOver= true;\n\t\t\treturn isOver;\n\t\t}\n\t\t\n\t\tfor (Player p : players) {\n\t\t\tif (!p.hasCards()) {\n\t\t\t\tisOver = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn isOver;\n\t}", "public void checkGameEndState() {\n\t\tfor(MapCharacter c : friendlyMissionCriticals) {\n\t\t\tif(!friendlies.contains(c))\n\t\t\t\tthrow new PlayerLosesException();\n\t\t}\n\t\tif(getEnemies().size() == 0)\n\t\t\tthrow new PlayerWinsException();\n\t}", "boolean testIsTouchingIGamePiece(Tester t) {\n return t.checkExpect(los2.isTouching(ship2), false)\n && t.checkExpect(los3.isTouching(bullet8), true)\n && t.checkExpect(lob2.isTouching(ship2), true)\n && t.checkExpect(lob3.isTouching(ship11), false)\n && t.checkExpect(lob3.isTouching(ship3), true)\n && t.checkExpect(mt.isTouching(ship6), false);\n }", "public boolean check(double xDelt,double yDelt) {\r\n \tBounds pBound= player1.player.getBoundsInParent();\r\n \t\r\n \tfor( Node object: enemy1.hostileG.getChildren()) {\r\n \t\t\r\n \t\tif(object.getBoundsInParent().intersects(pBound.getMinX()+xDelt, pBound.getMinY()+yDelt, pBound.getWidth(), pBound.getHeight())){\r\n \t\t\teHealth -= inventory.getpDamage();\r\n \t\t\tpHealth -= 1;\r\n\r\n \t\t\tSystem.out.println(\"eHealth \"+ eHealth);\r\n \t\t\tSystem.out.println(\"pHealth \"+ pHealth);\r\n \t\t\t\r\n \t\t\t//\"Deaths of the sprites\"\r\n \t\t\tif(pHealth <=0) {\r\n \t\t\t\tlayout.getChildren().remove(player1.player);\r\n \t\t\t\tSystem.out.println(\"You died!\");\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif(eHealth <=0) {\r\n \t\t\t\tlayout.getChildren().remove(enemy1.enemy);\r\n \t\t\t\tenemy1.enemy.setLayoutX(-10000);\r\n \t\t\t\tenemy1.enemy.setLayoutY(-10000);\r\n \t\t\t}\r\n \t\treturn false;\r\n \t\t}\r\n }\r\n \t\r\n \tfor( Node object: map1.walls.getChildren()) {\r\n \t\tif(object.getBoundsInParent().intersects(pBound.getMinX()+xDelt, pBound.getMinY()+yDelt, pBound.getWidth(), pBound.getHeight())) return false;\r\n \t}\r\n \t\r\n \tfor( Node chest: map1.chests.getChildren()) {\r\n \tif(chest.getBoundsInParent().intersects(pBound.getMinX()+xDelt, pBound.getMinY()+yDelt, pBound.getWidth(), pBound.getHeight())){\r\n \t\tmap1.chests.getChildren().remove(chest);\r\n \t chestchose=inventory.getchestchose();\r\n \t \r\n \t if(chestchose==1) {\r\n \t \tinventory.sworda.setVisible(true);\r\n \t \tinventory.setpDamage(3);\r\n \t }\r\n \t if(chestchose==2) {\r\n \t \tinventory.healthbag.setVisible(true);\r\n \t }\r\n \t \r\n \t return false;\r\n \t} \r\n }\t\r\n \t\r\n return true;\r\n }", "private boolean hitSides() {\n if (b.numY + 60 >= BOX_HEIGHT || (b.numY - 60 <= 0)) {\n return true;\n } else {\n return false;\n }\n }", "private boolean alreadyHit(int x, int y) {\n for (int i = 0; i < hitCount; i++){\n if (x == hitList[i].x && y == hitList[i].y){\n return true;\n }\n }\n for (int i = 0; i < missCount; i++) {\n if (x == missList[i].x && y == missList[i].y) {\n return true;\n }\n }\n return false;\n }", "public void checkForHits ()\n\t\t{\n\t\t\tif (ball.getRectangle().x < 0) {\n\t\t\t\t//computerAI.getCharacter().gotHit(player.getCharacter().getDamage());\n\t\t\t\tplayer1.character.gotHit(player2.character.getDamage());\n\t\t\t\tball.reset();\n\t\t\t\tif (player1.character.getHitPoints() <= 0) { //hit points=0 attempt to end game\n\t\t\t\t\t//WinWindow.lose_window(0);\n\t\t\t\t\tendGame();\n\t\t\t\t}\n\t\t\t} else if (ball.getRectangle().x > WIDTH - ball.getRectangle().width) {\n\t\t\t\tplayer2.character.gotHit(player1.character.getDamage());\n\t\t\t\tball.reset();\n\t\t\t\tif (player2.character.getHitPoints() <= 0) { //hit points=0 attempt to end game\n\t\t\t\t\t//dispose(); TODO - this might be necessary for resetting, but it's currently a breaking change\n\t\t\t\t\t//WinWindow.lose_window(1);\n\t\t\t\t\tendGame();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private boolean isInDoor(Entity player){\n Sprite playerSprite= (Sprite) player.getComponent(Sprite.class);\n for(int i = 0; i<Main.colliderWallMap.size(); i++){\n if(Main.colliderWallMap.get(i).intersects(playerSprite.getValue().getX(), playerSprite.getValue().getY(),playerSprite.getValue().getWidth(), playerSprite.getValue().getHeight())){\n return false;\n }\n }\n\n return true;\n }", "public boolean collisionCheck() {\n for (Alien al : aliens) {\n if (you.collide(al)) {\n al.collide(you);\n return true;\n }\n }\n boolean tf = false;\n int index = 0, size = lazers.size();\n while (index < size) {\n if (you.collide(lazers.get(index))) {\n lazers.remove(index);\n size--;\n index--;\n tf = true;\n }\n index++;\n }\n return tf;\n }", "private boolean isAllAreaAchievable() throws ReachabilityException {\n\t\t\n\t\t// mark all points that the player should reach as 1, else as 0\n\t\tint[][] tempMap = new int[height][width];\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = 0; j < width; j++) {\n\t\t\t\tif (mapElementArray[i][j] instanceof Item\n\t\t\t\t\t\t|| mapElementArray[i][j] instanceof Teleporter\n\t\t\t\t\t\t|| mapElementArray[i][j] instanceof PlayerSpawnPoint)\n\t\t\t\t\ttempMap[i][j] = 1;\n\t\t\t\telse\n\t\t\t\t\ttempMap[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//try to reach all area\n\t\treachAllValidPoint(tempMap, aPlayerSpawnPointRow, aPlayerSpawnPointCol);\n\t\t\n\t\t//check if all area have been reached\n\t\tint unreachablePoint = 0;\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = 0; j < width; j++) {\n\t\t\t\tif (tempMap[i][j] == 1) {\n\t\t\t\t\tunreachablePoint++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n//\t\ttry {\n\t\t\tif (unreachablePoint > 0) {\n\t\t\t\tSystem.out.println(unreachablePoint + \" points are unreachable\");\n\t\t\t\tthrow new ReachabilityException();\n\t\t\t}else {\n\t\t\t\treturn true;\n\t\t\t}\n\t/*\t} catch (ReachabilityException e) {\n\t\t\tSystem.out.println(e);\n\t\t\t//print out map with invalid area\n\t\t\tfor (int i = 0; i < height; i++) {\n\t\t\t\tfor (int j = 0; j <width; j++) {\n\t\t\t\t\tSystem.out.print(tempMap[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t}\n\t\t\treturn false;\n\t\t}*/\n\n\t}", "public boolean inCheck(PieceColor color)\n {\n Piece king = findKing(color);\n if (king==null)\n return false;\n Location loc = getLocation(king);\n return enemyCanAttack(color,loc);\n }", "public boolean checkTrades(Player owner, Player targetPlayer, ArrayList<Tile> targetTiles, ArrayList<Tile> offeredTiles) {\n for(int i = 0; i < offeredTiles.size(); i++)\n if (!owner.containsTile(offeredTiles.get(i)))\n return false;\n\n for(int k = 0; k < targetTiles.size(); k++)\n if (!targetPlayer.containsTile(targetTiles.get(k)))\n return false;\n return true; // Some other things may be added\n }", "public boolean tileReachObjectives(float xTile, float yTile)\r\n/* 122: */ {\r\n/* 123:136 */ return (!tileInBounds(xTile, yTile)) || \r\n/* 124:137 */ (this.reach[((int)xTile)][((int)yTile)] != 0);\r\n/* 125: */ }", "public boolean isRoundOver() {\n\t\tint numberOfLiving = 0;\n\t\tboolean nobodyHasAmmo = true;\n\t\t\n\t\tfor (int i = 0; i < players.length; i++) {\n\t\t\t// The round is over if someone is dead\n\t\t\tif (tanks[i].isAlive()) {\n\t\t\t\tnumberOfLiving++;\n\t\t\t}\n\t\t\tnobodyHasAmmo &= tanks[i].getAmmo() == 0;\n\t\t}\n\t\t\n\t\t// Return true if one or none players are living, or stalemate\n\t\treturn numberOfLiving <= 1 || (nobodyHasAmmo && bullets.isEmpty());\n\t}", "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 }", "public static boolean isSomethingToAttackDefined() {\n\t\treturn _attackTargetUnit != null && !_attackTargetUnit.getType().isOnGeyser();\n\t}", "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 boolean fire(RobotInfo enemy) throws GameActionException {\n if (rc.getType() == RobotType.LUMBERJACK) return strike(enemy);\n if (rc.hasAttacked()) return false; //One such check (just in case)\n Direction toEnemy = rc.getLocation().directionTo(enemy.location);\n if (shouldFirePentad(enemy)){\n rc.firePentadShot(toEnemy);\n }\n else if(shouldFireTriad(enemy)){\n rc.fireTriadShot(toEnemy);\n }\n else{\n if (rc.canFireSingleShot()){\n rc.fireSingleShot(toEnemy);\n }\n }\n return false;\n }", "public boolean collides(Rectangle player) {\r\n return player.overlaps(boundsTop) || player.overlaps(boundsBot);\r\n }", "private boolean shouldRush(GameInfo intel) {\n if (intel.getNumPlayers() > 2) {\n return false;\n }\n\n final GameMap gameMap = intel.getGamemap();\n final Map<Integer, Ship> myShips = gameMap.getMyPlayer().getShips();\n\n // get enemy player ships\n for (Player player : gameMap.getAllPlayers()) {\n if (player.getId() != gameMap.getMyPlayerId()) {\n for (Ship ship : player.getShips().values()) {\n for (Ship myShip : myShips.values()) {\n if (myShip.getDistanceTo(ship) < RUSH_MAX_DISTANCE) {\n return true;\n }\n }\n }\n }\n }\n\n return false;\n }", "public boolean isControlledByPlayer(Player player) {\r\n if (territories == null) {\r\n return false;\r\n }\r\n\r\n for (Territory territory : territories) {\r\n if (!territory.getPlayer().equals(player)) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "public boolean tileFireObjectives(float xTile, float yTile)\r\n/* 128: */ {\r\n/* 129:142 */ return (!tileInBounds(xTile, yTile)) || \r\n/* 130:143 */ (this.fire[((int)xTile)][((int)yTile)] != 0);\r\n/* 131: */ }", "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 }", "private boolean playerIsInSight(Point enemyLocation, Direction enemyLookDirection) {\n \tfor(int i = 1; i <= 2; i++) {\n \tif(enemyLookDirection == Direction.UP && !board.isOOB(enemyLocation.x - i, enemyLocation.y)) {\n \t\tif(board.getTile(enemyLocation.x - i, enemyLocation.y).hasPlayer() && !board.getTile(enemyLocation.x - i, enemyLocation.y).isRoom())\n \t\t\treturn true; \t\t\n \t}\n \telse if(enemyLookDirection == Direction.DOWN && !board.isOOB(enemyLocation.x + i, enemyLocation.y)) {\n \t\tif(board.getTile(enemyLocation.x + i, enemyLocation.y).hasPlayer() && !board.getTile(enemyLocation.x + i, enemyLocation.y).isRoom())\n \t\t\treturn true; \t\t\n \t}\n \telse if(enemyLookDirection == Direction.LEFT && !board.isOOB(enemyLocation.x, enemyLocation.y - i)) {\n \t\tif(board.getTile(enemyLocation.x, enemyLocation.y - i).hasPlayer() && !board.getTile(enemyLocation.x, enemyLocation.y - i).isRoom())\n \t\t\treturn true; \t\t\n \t}\n \telse if(enemyLookDirection == Direction.RIGHT && !board.isOOB(enemyLocation.x, enemyLocation.y + i)) {\n \t\tif(board.getTile(enemyLocation.x, enemyLocation.y + i).hasPlayer() && !board.getTile(enemyLocation.x, enemyLocation.y + i).isRoom())\n \t\t\treturn true; \t\t\n \t}\n \t}\n \treturn false;\n }", "public boolean isOverhit()\n\t{\n\t\treturn overhit;\n\t}", "boolean gameOver() {\n return piecesContiguous(BP) || piecesContiguous(WP);\n }", "private boolean isCellOccupied(Cell c) {\n Worm[] opponentWorms = opponent.worms;\n Worm[] playerWorms = player.worms;\n int i = 0;\n int j = 0;\n boolean foundOpponentWorm = false;\n boolean foundPlayerWorm = false;\n while ((i < opponentWorms.length) && (!foundOpponentWorm)) {\n if ((opponentWorms[i].position.x == c.x) && (opponentWorms[i].position.y == c.y)) {\n foundOpponentWorm = true;\n } else {\n i++;\n }\n }\n while ((j < playerWorms.length) && (!foundPlayerWorm)) {\n if ((playerWorms[j].position.x == c.x) && (playerWorms[j].position.y == c.y)) {\n foundPlayerWorm = true;\n } else {\n j++;\n }\n }\n return (foundOpponentWorm || foundPlayerWorm);\n }", "public boolean isHealthy() {\r\n boolean healthy = true;\r\n\r\n for (Meter m: meters) {\r\n if (!m.isHealthy()) healthy = false;\r\n }\r\n\r\n return healthy;\r\n }", "boolean checkFighterEnergy(AbstractFighterPokemon pokemon);", "public boolean allDestroyed()\n {\n\n \tcalculateTotalHitsRequired();\n \tint hits = 0;\n \tfor (int row = 0; row < NUM_ROWS; row++){\n \t\tfor(int col = 0; col < NUM_COLS; col++){\n \t\t\tif(grid[row][col] == HIT)\n \t\t\t\thits++;\n \t\t}\n \t}\n \tif(hits == totalHitsRequired)\n \t\treturn true;\n\n return false;\n }", "private void handleCollisions() {\n\t\t\n\t\tfor (ArrayList<Invader> row : enemyArray) {\n\t\t\tfor (Invader a : row) {\n\t\t\t\tcheckInvaderDeath(a);\n\t\t\t\tcheckPlayerDeath(a);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (Shot s : enemyShotList) {\n\t\t\t\n\t\t\tif (s.detectDownwardCollision(player.getX(), player.getY())) {\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tcollectPowerUp(armorPiercing);\n\t\tcollectPowerUp(explosive);\n\t}", "boolean hasDamage();", "boolean hasDamage();", "boolean hasDamage();", "boolean hasDamage();", "boolean hasDamage();", "public boolean isTurnOngoing() {\n int numEntitiesWithActions = 0;\n for (Entity entity : entitiesInCombat) {\n if (entity.canAct()) {\n numEntitiesWithActions++;\n }\n }\n return numEntitiesWithActions > 0;\n }", "boolean checkFireEnergy(AbstractFirePokemon pokemon);", "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 hit() {\r\n add(deck.deal());\r\n return getHandValue() <= 21;\r\n }", "Boolean checkEndGame() {\n for (WarPlayer player : players) {\n if (player.getHand().size() == 0)\n return true;\n }\n return false;\n }", "float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);", "public boolean canProtectPieces() {\r\n\t\treturn (cityCards.stream().anyMatch(c -> (c.isSmallGods() && !c.isDisabled())\r\n\t\t\t\t&& money >= PROTECTION_COST)); \r\n\t}", "HitEnemy checkHits(@NotNull List<Bullet> bullets, Bitmap hitEnemyImage) {\n for (Bullet b : bullets) {\n int enemyXCoordinate = x();\n int enemyYCoordinate = y();\n int enemyWidth = this.getBitmap().getWidth();\n int enemyHeight = this.getBitmap().getHeight();\n\n int bulletXCoordinate = b.x();\n int bulletYCoordinate = b.y();\n int bulletWidth = b.getBitmap().getWidth();\n int bulletHeight = b.getBitmap().getHeight();\n\n // Standard rectangular bitmap intersection formula\n // (Good enough up to +/- the corner pixels, which are not\n // noticeable in the game)\n if (enemyXCoordinate + enemyWidth >= bulletXCoordinate\n && bulletXCoordinate + bulletWidth >= enemyXCoordinate\n && enemyYCoordinate + enemyHeight >= bulletYCoordinate\n && bulletYCoordinate + bulletHeight >= enemyYCoordinate) {\n b.markForRemoval();\n this.markForRemoval();\n\n return new HitEnemy(this.x(), this.y() - 34, hitEnemyImage);\n }\n }\n\n return null;\n }", "private boolean checkCollisions(int X, int Y){\n\t\tint hitBoxSizeX = 105;\n\t\tint hitBoxSizeY = 80;\n\t\tfor(int i=0;i<enemy_num;i++){\n\t\t\tif(X<enemy[i][0]+hitBoxSizeX && X>enemy[i][0]){\n\t\t\t\tif(Y<enemy[i][1]+hitBoxSizeY && Y>enemy[i][1]){\n\t\t\t\t\tremoveEnemy(i);\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}", "public boolean isHit(Point p){\n if(super.getLocation().equals(p)){\n nunMissiles = 0;\n return true;\n } else {\n return false;\n }\n }", "public boolean enemyOutOfBounds() {\n return (position.x < 0\n || position.x + TYPE_A_WIDTH > World.WORLD_WIDTH\n || position.y < 0\n || position.y + TYPE_A_HEIGHT > World.WORLD_HEIGHT);\n }", "boolean hasArmor();", "public boolean isAllPiecesEaten(PrimaryColor playerColor) {\n\n\t\tArrayList<Piece> ediblePieces= getAllEdiblePiecesByColor(playerColor);\n\t\tif(ediblePieces.isEmpty()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean canPirateShipCardAttack(Battle b, PirateShip c) {\n\t\t\n\t\tAttacker a = b.getAttackerByPlayerId(getId());\n \n\t\tif (a != null) {\n\t\t\tif (a.getAttackCards().getCards().size() > 0) {\n\t\t\t\t// this is to account for the empty ownerAttacker\n\t\t\t\tif (a.getScore() + c.getValue() >= b.getHighScore()) {\n\t\t\t\t\treturn a.getAttackerColor() == c.getColor();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (Attacker at: b.getAttackers()) {\n\t\t\tif (at.getAttackerColor() == c.getColor()){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (c.getValue() >= b.getHighScore()){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private boolean didPlayerWin() {\r\n for (int i = 0; i < targets.length; i++) {\r\n if (targets[i].getHitPoints() != 0) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public void battleEnemyAttack() {\n if(battleEnemy != null){ // If all enemies have attacked, they cannot attack anymore for this round\n\n MovingEntity target = battleEnemy.getAttackPreference(targetAllies);\n if(target == null){\n target = targetAlly;\n }\n\n battleEnemy.attack(target, targetEnemies, targetAllies);\n //System.out.println(battleEnemy.getID() + \" is attacking \" + target.getID() + \" remaining hp: \" + target.getCurrHP());\n if (updateTarget(target) == false) {\n // if target still alive, check if its still friendly incase of zombify\n targetAlly = checkSideSwap(targetAlly, false, battleEnemies, targetEnemies, battleAllies, targetAllies);\n }\n\n battleEnemy = nextAttacker(battleEnemy, battleEnemies);\n\n }\n }", "private void checkLoosePLayer(){\n if (hero.getHp()<=0){\n loose();\n }\n\n }", "public boolean isGameOver(){\n return checkKingReachedEnd() || checkNoDragonsLeft() || checkIfKingSurrounded();\n }", "public boolean collides (){\n if(shipX<=astX && shipY>=astY){\n if(Math.abs(shipX-astX)<=40 && Math.abs(shipY-astY)<=65){\n return true;\n }\n }\n else if(shipX>=astX && shipY>=astY){\n if(Math.abs(shipX-astX)<=75 && Math.abs(shipY-astY)<=65){\n return true;\n }\n }\n else if(shipX>=astX && shipY<=astY){\n if(Math.abs(shipX-astX)<=75 && Math.abs(shipY-astY)<=55){\n return true;\n }\n }\n else if(shipX<=astX && shipY<=astY){\n if(Math.abs(shipX-astX)<=60 && Math.abs(shipY-astY)<=55){\n return true;\n }\n }\n return false;\n }", "public void isStillInCombat() {\n isInCombat = enemiesInCombat.size() > 0;\n }", "private boolean isRockTouchingCity(RockView targetRock) {\n\n boolean isTouching = false;\n\n for (int i = 0; i < cityCount; ++i) {\n double distance = targetRock.calcDistance(cityLocations[i]);\n\n if (distance <= citySize * 1.5) {\n isTouching = true;\n }\n }\n\n return isTouching;\n }", "protected boolean isHit(Coordinate coordinate) {\n\t\t// Due to override of \"equals\" method, \"contains\" only checks whether x-\n\t\t// and y-coordinate are equal.\n\t\t// Other properties of the coordinate object are ignored.\n\t\tif (shipPositions.contains(coordinate)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private void checkWeaponCollisions(GObject element) {\r\n\t\tGObject topLeft = getElementAt(element.getX() - 1, element.getY());\r\n\t\tGObject topRight = getElementAt(element.getX() + element.getWidth() + 1, element.getY());\r\n\t\tGObject bottomLeft = getElementAt(element.getX() - 1, element.getY() + element.getHeight());\r\n\t\tGObject bottomRight = getElementAt(element.getX() + element.getWidth() + 1, element.getY() + element.getHeight());\r\n\t\tif(topLeft == player || topRight == player || bottomLeft == player || bottomRight == player) {\r\n\t\t\tremove(element);\r\n\t\t\telement = null;\r\n\t\t\thits++;\r\n\t\t\tloseLife();\r\n\t\t}\r\n\t}", "public boolean gameIsOver() {\r\n int cpt = 0;\r\n for (Player p : players) {\r\n if (p.getLife() > 0) {\r\n cpt++;\r\n }\r\n }\r\n return cpt==1;\r\n }", "public boolean collidesWith(ICollider other);", "public boolean isInTeam(Fighter fighter) {\n\t\treturn fighters.contains(fighter);\n\t}", "public boolean isAttacking(int row, int col)\n {\n if (this.getRow() == row || this.getCol() == col) // if self has same row or column as chesspiece, self is attacking\n return true;\n else\n return false; // self is not attacking chesspiece\n }", "public boolean hitDealer() {\r\n while (getHandValue() <= 16) {\r\n hit();\r\n }\r\n return getHandValue() <= 21;\r\n }", "public static boolean isEnemyTerran() {\n return AtlantisGame.enemy().getRace().equals(RaceTypes.Terran);\n }", "boolean checkElectricEnergy(AbstractElectricPokemon pokemon);", "public boolean containsTarget(final L2Character player)\n\t{\n\t\treturn getAggroListRP().containsKey(player);\n\t}", "public abstract boolean isHit(int x, int y);" ]
[ "0.6731204", "0.65164095", "0.64096385", "0.6251347", "0.6148555", "0.6089368", "0.60871124", "0.60424715", "0.60297817", "0.5954685", "0.59300613", "0.58789754", "0.5874352", "0.58054733", "0.5800298", "0.5770003", "0.57490706", "0.5734914", "0.57342637", "0.5700848", "0.567682", "0.56641996", "0.5664144", "0.56382656", "0.5608622", "0.559504", "0.55875206", "0.55734646", "0.55374926", "0.5486103", "0.54810673", "0.5475426", "0.54655147", "0.54649335", "0.5441575", "0.54303133", "0.542653", "0.54182947", "0.5413204", "0.54095167", "0.5399954", "0.53855115", "0.53802955", "0.53794336", "0.5379158", "0.53726095", "0.5370286", "0.5369139", "0.5342663", "0.53258806", "0.5324972", "0.5321281", "0.53183496", "0.53121233", "0.53090084", "0.5299367", "0.52973974", "0.52950275", "0.52949816", "0.5291746", "0.5289535", "0.52888215", "0.5285806", "0.5284642", "0.5284642", "0.5284642", "0.5284642", "0.5284642", "0.5274436", "0.5274178", "0.52739245", "0.52533764", "0.52488893", "0.52471626", "0.52444106", "0.524158", "0.5231793", "0.5229844", "0.5226", "0.52230835", "0.52172786", "0.521139", "0.520959", "0.5207252", "0.5206094", "0.52055764", "0.520354", "0.5200358", "0.5198676", "0.51962787", "0.51943284", "0.51935166", "0.51921755", "0.5190091", "0.5185615", "0.51788706", "0.5175196", "0.51726055", "0.51725847", "0.5171537" ]
0.78331393
0
Draws all game images
protected void paintComponent(Graphics g) { super.paintComponent(g); //drawing the background g.drawImage(BackGround, 0, 0, null); //if(GameOn == true) //{ //calling the paint function of the game characters pl.paint(g); for(int i = 0 ; i < EnemyList.size(); i++) { EnemyList.get(i).paint(g); } //drawing the explosions g.drawImage(Explosion, enExplosionX, enExplosionY, null); g.drawImage(Explosion, plExplosionX, plExplosionY, null); font = new Font("LCD", Font.BOLD, 25); g.setFont(font); //g.drawString("Time: " + formatTime(gameTime), 0, 615); g.drawString("Rockets Remaining: " + pl.NumRockets, 0, 635); g.drawString("Bullets Remaining: " + pl.NumBullets, 0, 655); g.drawString("Enemies Destroyed: " + DestroyedEnemies, 0, 675); g.drawString("Runaway Enemies: " + RunAwayEnemies, 0, 695); //} if(BulletFired = true) { for(int i = 0; i < BulletList.size();i++) { BulletList.get(i).paint(g); } } if(RocketFired = true) { for(int i = 0; i < RocketList.size();i++) { RocketList.get(i).paint(g); } } if(GameOn == false){ g.drawImage(GameOver, 200, 0, null); //g.drawString("Enemies Destroyed: " + DestroyedEnemies, 250, 10); } else if (WinsState == true ) { g.drawImage(GameWin, 200, 0, null); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void drawImages() {\n\t\t\r\n\t}", "private void drawGame(){\n drawBackGroundImage();\n drawWalls();\n drawPowerups();\n drawBullet();\n }", "public void draw(){\n\t\tStdDraw.picture(this.xxPos,this.yyPos,\"images/\"+this.imgFileName);\n\t}", "private void render() {\n bs = display.getCanvas().getBufferStrategy();\n /* if it is null, we define one with 3 buffers to display images of\n the game, if not null, then we display every image of the game but\n after clearing the Rectanlge, getting the graphic object from the \n buffer strategy element. \n show the graphic and dispose it to the trash system\n */\n if (bs == null) {\n display.getCanvas().createBufferStrategy(3);\n }else{\n g = bs.getDrawGraphics();\n g.drawImage(Assets.background, 0, 0, width, height, null);\n \n \n if(!gameover){\n player.render(g);\n borrego.render(g);\n rayo.render(g);\n \n for (Enemy brick : enemies) {\n brick.render(g);\n //bomba.render(g);\n }\n \n for (Fortaleza fortaleza : fortalezas) {\n fortaleza.render(g);\n }\n \n for (Bomba bomba: bombas){\n bomba.render(g);\n }\n \n drawScore(g);\n drawLives(g,vidas);\n }else if(gameover){\n drawGameOver(g);\n }\n \n\n if (lost && !gameover){\n drawLost(g);\n }\n if (pause && !lost && !gameover){\n drawPause(g);\n }\n if(win && !lost && !pause && !lost &&!gameover){\n \n drawWin(g);\n }\n \n bs.show();\n g.dispose();\n }\n }", "public void draw(){\n\t\tString filename = \"images/\" + this.imgFileName;\n\t\tStdDraw.picture(this.xxPos, this.yyPos, filename);\n\t}", "private void render() {\n bs = display.getCanvas().getBufferStrategy();\n /* if it is null, we define one with 3 buffers to display images of\n the game, if not null, then we display every image of the game but\n after clearing the Rectanlge, getting the graphic object from the \n buffer strategy element. \n show the graphic and dispose it to the trash system\n */\n if (bs == null) {\n display.getCanvas().createBufferStrategy(3);\n } else {\n g = bs.getDrawGraphics();\n g.drawImage(Assets.background, 0, 0, width, height, null);\n g.setColor(Color.white);\n g.drawLine(0, 500, 595, 500);\n player.render(g);\n for (int i = 0; i < aliens.size(); i++) {\n Alien al = aliens.get(i);\n al.render(g);\n }\n if (shotVisible) {\n shot.render(g);\n }\n\n if(gameOver==false)\n {\n gameOver();\n }\n for(Alien alien: aliens){\n Bomb b = alien.getBomb();\n b.render(g);\n }\n g.setColor(Color.red);\n Font small = new Font(\"Helvetica\", Font.BOLD, 20);\n g.setFont(small);\n g.drawString(\"G - Guardar\", 10, 50);\n g.drawString(\"C - Cargar\", 10, 70);\n g.drawString(\"P - Pausa\", 10, 90);\n\n if(keyManager.pause)\n {\n g.drawString(\"PAUSA\", 250, 300);\n }\n \n bs.show();\n g.dispose();\n }\n\n }", "public void drawAllGraphics(){\r\n\t\t \r\n\t}", "private void drawStuff() {\n //Toolkit.getDefaultToolkit().sync();\n g = bf.getDrawGraphics();\n bf.show();\n Image background = window.getBackg();\n try {\n g.drawImage(background, 4, 24, this);\n\n for(i=12; i<264; i++) {\n cellKind = matrix[i];\n\n if(cellKind > 0)\n g.drawImage(tile[cellKind], (i%12)*23-3, (i/12)*23+17, this);\n }\n\n drawPiece(piece);\n drawNextPiece(pieceKind2);\n\n g.setColor(Color.WHITE);\n g.drawString(\"\" + (level+1), 303, 259);\n g.drawString(\"\" + score, 303, 339);\n g.drawString(\"\" + lines, 303, 429);\n\n } finally {bf.show(); g.dispose();}\n }", "public void draw() {\n GraphicsContext gc = getGraphicsContext2D();\n /*gc.clearRect(0, 0, getWidth(), getHeight());\n\n if (squareMap != null) {\n squareMap.draw(gc);\n }\n if (hexMap != null) {\n hexMap.draw(gc);\n }*/\n\n // Draw animations\n for (SpriteAnimationInstance anim : animationList) {\n anim.draw(gc);\n }\n\n // Lastly draw the dialogue window, no matter which canvas\n // we are on, all the same.\n DfSim.dialogueWindow.draw(gc);\n\n /*if (landMap != null) {\n landMap.draw(gc);\n }*/\n\n // Draw a border around the canvas\n //drawBorder(gc);\n\n // And now just draw everything directly from the simulator\n /*for (Raindrop item : sim.getDrops()) {\n drawMovableCircle(gc, item);\n }\n for (Earthpatch item : sim.getPatches()) {\n drawMovableCircle(gc, item);\n }\n for (SysShape item : sim.getShapes()) {\n drawSysShape(gc, item);\n }\n for (Spike item : sim.getSpikes()) {\n drawMovablePolygon(gc, item);\n }\n for (GravityWell item : sim.getGravityWells()) {\n drawGravityWell(gc, item);\n }*/\n }", "private void drawWalls(){\n for(int i = 0 ; i < wallsArrayList.size(); i++){\n wallsArrayList.get(i).drawImage(buffer);\n }\n\n }", "public void draw(){\n StdDraw.picture(this.xCoordinate,this.yCoordinate,this.img);\n }", "public void draw()\n\t{\n\t\tdrawWalls();\n\n\t\tfor( Zombie z: zombies )\n\t\t{\n\t\t\tz.draw();\n\t\t}\n\t\tfor( Entity h: humans )\n\t\t{\n\t\t\th.draw();\n\t\t}\n\n\t\tdp.repaintAndSleep(rate);\n\t}", "private void draw() {\n this.player.getMap().DrawBackground(this.cameraSystem);\n\n //Dibujamos al jugador\n player.draw();\n\n for (Character character : this.characters) {\n if (character.getMap() == this.player.getMap()) {\n character.draw();\n }\n }\n\n //Dibujamos la parte \"superior\"\n this.player.getMap().DrawForeground();\n\n //Sistema de notificaciones\n this.notificationsSystem.draw();\n\n this.player.getInventorySystem().draw();\n\n //Hacemos que la cámara se actualice\n cameraSystem.draw();\n }", "public void drawImage()\n {\n imageMode(CORNERS);\n //image(grayImgToFit, firstCellPosition[0], firstCellPosition[1]);\n image(canvas, firstCellPosition[0], firstCellPosition[1]);\n //image(tileMiniaturesV[0],10,250);\n //if(avaragedImgs.length > 4)\n // image(avaragedImgs[3],200,200);\n //getTileIntensityAtIndex(15,15);\n //println(tiles[7].getEndBrightness());\n \n }", "private void drawImage(){\n Integer resourceId = imageId.get(this.name);\n if (resourceId != null) {\n drawAbstract(resourceId);\n } else {\n drawNone();\n }\n }", "public void draw() {\n mGameBoard.draw();\n }", "private void render() {\n\n if (state == STATE.PAUSE) {\n\n return;\n }\n\n\n if (state == STATE.MENU) {\n\n menu.draw();\n arrow.render();\n return;\n\n }\n\n if (state == STATE.INSTRUCTIONS) {\n instructions.draw();\n return;\n }\n\n for (int i = 0; i < spaceShips.size(); i++) {\n spaceShips.get(i).render();\n }\n\n\n for (Enemy enemy : enemies) {\n enemy.render();\n }\n\n for (int i = 0; i < powerUps.size(); i++) {\n\n powerUps.get(i).render();\n }\n\n for (int i = 0; i < enemyBullets.size(); i++) {\n\n enemyBullets.get(i).render();\n }\n\n for (int i = 0; i < friendlyBullets.size(); i++) {\n\n friendlyBullets.get(i).render();\n }\n\n topBar.render();\n bottomBar.render();\n fps.render();\n score.render();\n\n\n }", "private void draw()\n {\n if(surfaceHolder.getSurface().isValid())\n {\n // Locks the surface. Can't be accessed or changed before it is unlocked again\n canvas = surfaceHolder.lockCanvas();\n\n // Background color\n canvas.drawColor(Color.BLACK);\n\n\n // ===================== DRAW SPRITES ======================= //\n // Draw Pacman\n canvas.drawBitmap(pacman.getBitmap(), pacman.getX(), pacman.getY(), paint);\n\n // Draw all Monsters\n for(Monster monster : monsterList)\n {\n canvas.drawBitmap(monster.getBitmap(), monster.getX(), monster.getY(), paint);\n }\n\n // Draw Cherries\n for(Cherry cherry : cherryList)\n {\n canvas.drawBitmap(cherry.getBitmap(), cherry.getX(), cherry.getY(), paint);\n }\n\n // Draw Key\n canvas.drawBitmap(key.getBitmap(), key.getX(), key.getY(), paint);\n\n // Draw Stars\n paint.setColor(Color.WHITE);\n for(Star star : starList)\n {\n paint.setStrokeWidth(star.getStarWidth());\n canvas.drawPoint(star.getX(), star.getY(), paint);\n }\n\n // ======================================================= //\n\n\n if(!gameEnded)\n {\n // Draw user HUD\n paint.setTextAlign(Paint.Align.LEFT);\n paint.setColor(Color.WHITE);\n paint.setTextSize(40);\n paint.setTypeface(Typeface.MONOSPACE);\n canvas.drawText(\"Level: \" + level, 10, 50, paint);\n canvas.drawText(\"Hi Score: \" + hiScore, (screenMax_X /4) * 3, 50 , paint);\n canvas.drawText(\"Score: \" + score, screenMax_X / 3, 50 , paint);\n canvas.drawText(\"New level in: \" + distanceRemaining + \"km\", screenMax_X / 3, screenMax_Y - 20, paint);\n canvas.drawText(\"Lives: \" + pacman.getLifes(), 10, screenMax_Y - 20, paint);\n canvas.drawText(\"Speed \" + pacman.getSpeed() * 100 + \" Km/h\", (screenMax_X /4) * 3, screenMax_Y - 20, paint);\n\n } else {\n\n // Draw 'Game Over' Screen\n paint.setTextAlign(Paint.Align.CENTER);\n paint.setTypeface(Typeface.MONOSPACE);\n paint.setFakeBoldText(true);\n paint.setTextSize(150);\n canvas.drawText(\"Game Over\", screenMax_X / 2, 350, paint);\n paint.setTextSize(50);\n paint.setTypeface(Typeface.DEFAULT);\n paint.setFakeBoldText(false);\n canvas.drawText(\"Hi Score: \" + hiScore, screenMax_X / 2, 480, paint);\n canvas.drawText(\"Your Score: \" + score, screenMax_X / 2, 550, paint);\n paint.setTextSize(80);\n canvas.drawText(\"Tap to replay!\", screenMax_X / 2, 700, paint);\n }\n\n if(levelSwitched)\n {\n // Notify the user whenever level is switched\n paint.setTextSize(100);\n paint.setTypeface(Typeface.MONOSPACE);\n paint.setFakeBoldText(true);\n paint.setTextAlign(Paint.Align.CENTER);\n canvas.drawText(\"Level \" + level + \"!\", screenMax_X / 2, 350, paint);\n }\n\n // Unlcock canvas and draw it the scene\n surfaceHolder.unlockCanvasAndPost(canvas);\n }\n }", "public void renderAll() {\n GameObjectManager.instance.renderAll(graphics);\n this.repaint();\n }", "public void drawAll(){\n for (Triangle triangle : triangles) {\n triangle.draw();\n }\n for (Circle circle : circles) {\n circle.draw();\n }\n for(Rectangle rectangle : rectangles){\n rectangle.draw();\n }\n }", "public void paintComponent(Graphics g){\n super.paintComponent(g);\n for(int i = 0; i < count; i++){\n drawObjects[i].draw(g);\n } \n }", "@Override\n\tpublic void draw(Canvas game) {\n\t\tGraphicsContext gc = game.getGraphicsContext2D();\n\t\tgc.drawImage(image, posX, Y_LAND - image.getHeight());\n\t\t\n\t}", "private void drawObjects(Graphics g) {\n\n g.setColor(Color.white);\n g.fillRect(0,0,WIDTH,HEIGHT);\n\n Player player = physics.getPlayer();\n\n\n\n ArrayList<Sprite> sprites = physics.getSprites();\n for( Sprite p: sprites){\n if (p.isVisible()) {\n g.drawImage(p.getImage(), p.getX() - scroll, p.getY(),\n this);\n }\n }\n\n if (player.isVisible()) {\n g.drawImage(player.getImage(), player.getX() - scroll, player.getY(),\n this);\n }\n Font font = new Font(\"Helvetica\", Font.BOLD, 30);\n FontMetrics fm = getFontMetrics(font);\n\n g.setColor(Color.black);\n g.setFont(font);\n g.drawString(Integer.toString(physics.playerScore),5, 25);\n }", "public void draw() {\n\t\t/* Clear Screen */\n\t\tGdx.graphics.getGL20().glClearColor(1,1,1,0);\n\t\tGdx.graphics.getGL20().glClear( GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT );\n\n\t\t/* Iterate through draw list */\n\t\tIterator<ArrayList<Drawable>> iter = this.drawlist.iterator();\n\t\twhile(iter.hasNext()) {\n\t\t\tArrayList<Drawable> layer = iter.next();\n\t\t\t/* Sort the layer. */\n\t\t\tCollections.sort(layer, new DrawableComparator());\n\t\t\t/* Iterate through the layer. */\n\t\t\tIterator<Drawable> jter = layer.iterator();\n\t\t\twhile(jter.hasNext()) {\n\t\t\t\tDrawable drawable = jter.next();\n\t\t\t\tif (drawable.isDead()) {\n\t\t\t\t\tjter.remove(); //Remove if dead.\n\t\t\t\t}//fi\n\t\t\t\telse {\n\t\t\t\t\tdrawable.draw(this, this.scalar); //Draw the drawable.\n\t\t\t\t}//else\n\t\t\t}//elihw\n\t\t}//elihw\n\t}", "private void drawEnemies(ArrayList<EnemyFishCollect> images, GraphicsContext gc) {\n\t\tgc.save();\n\t\tfor (int i = 0; i < images.size(); i++) {\n\t\t\tgc.drawImage(images.get(i).img, images.get(i).x, images.get(i).y);\n\n\t\t}\n\t\tgc.restore();\n\n\t}", "public void draw() {\n if (!myTurn()) {\n return;\n }\n draw(4 - handPile.size());\n }", "public void draw() {\n\t\tfor (Link link : links)\n\t\t\tlink.draw();\n\t}", "public void drawAllOn(DrawSurface d) {\r\n for (Sprite s : sprites) {\r\n s.drawOn(d);\r\n }\r\n }", "static void draw()\n {\n for (Viewport viewport : viewports)\n viewport.draw(renderers);\n }", "public void render(){\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif(bs == null){\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthis.screen.renderBackground();\n\t\t\n\t\t\n\t\tfor(int i=0;i<this.obstacles.size();i++){\n\t\t\tobstacles.get(i).render(screen);\n\t\t}\n\t\t\n\t\tthis.screen.renderGround();\n\t\t\n\t\t\n\t\tthis.bird.render(screen);\n\n\t\tscreen.renderLeftLim();\n\t\t\n\t\tfor(int i= 0;i<this.pixels.length;i++){\n\t\t\tthis.pixels[i] = this.screen.getPixel(i);\n\t\t}\n\t\n\n\t\t\n\t\tGraphics g = bs.getDrawGraphics();\n\t\tg.drawImage(image,0,0,getWidth(),getHeight(),null);\n\t\tg.setColor(Color.WHITE);\n\t\tg.setFont(new Font(\"Verdana\",0,30));\n\t\tg.drawString(\"\"+this.numGoals, 300, 60);\n\t\tif(this.gameOver){\n\t\t\tif(this.begin){\n\t\t\t\tg.setFont(new Font(\"Verdana\",0,50));\n\t\t\t\tg.drawString(GAMEOVER_MESSAGE, (WIDTH-300)/2, 200);\n\t\t\t\t\n\t\t\t\tg.setFont(new Font(\"Verdana\",0,20));\n\t\t\t\tg.drawString(\"press down key to restart\", (WIDTH-250)/2, 300);\n\t\t\t\tg.drawString(\"Best score:\"+this.bestScore, (WIDTH-135)/2, 350);\n\t\t\t}else{\n\t\t\t\tg.setFont(new Font(\"Verdana\",0,50));\n\t\t\t\tg.drawString(\"OPEN BIRD\", (WIDTH-270)/2, 200);\n\t\t\t\t\n\t\t\t\tg.setFont(new Font(\"Verdana\",0,20));\n\t\t\t\tg.drawString(\"press down key to start\", (WIDTH-250)/2, 300);\n\t\t\t}\n\t\t}\n\t\tg.dispose();\n\t\tbs.show();\n\t}", "@Override\n public void handlePaint()\n {\n for(GraphicObject obj : this.graphicObjects)\n {\n obj.draw();\n }\n \n }", "private void render() {\n\n // Clear the whole screen\n gc.clearRect(0, 0, canvas.getWidth(), canvas.getHeight());\n\n // Draw the background image\n gc.drawImage(curMap.getMap(), 0,0, canvas.getWidth(), canvas.getHeight());\n\n // Draw Paths\n for(DrawPath p : pathMap.values()) {\n p.draw(gc);\n }\n\n // Draw all of the lines and edges\n\n // Lines\n for(Line l : lineMap.values()) {\n l.draw(gc);\n }\n\n // Points\n for(Point p : pointMap.values()) {\n p.draw(gc);\n }\n\n // Images\n for(Img i : imgMap.values()) {\n i.draw(gc);\n }\n\n // Text\n for(Text t : textMap.values()) {\n t.draw(gc);\n }\n }", "public synchronized void draw() {\n // Clear the canvas\n// canvas.setFill(Color.BLACK);\n// canvas.fillRect(0, 0, canvasWidth, canvasHeight);\n canvas.clearRect(0, 0, canvasWidth, canvasHeight);\n\n // Draw a grid\n if (drawGrid) {\n canvas.setStroke(Color.LIGHTGRAY);\n canvas.setLineWidth(1);\n for (int i = 0; i < mapWidth; i++) {\n drawLine(canvas, getPixel(new Point(i - mapWidth / 2, -mapHeight / 2)), getPixel(new Point(i - mapWidth / 2, mapHeight / 2)));\n drawLine(canvas, getPixel(new Point(-mapWidth / 2, i - mapHeight / 2)), getPixel(new Point(mapWidth / 2, i - mapHeight / 2)));\n }\n }\n\n // Draw each player onto the canvas\n int height = 0;\n for (Player p : playerTracking) {\n canvas.setStroke(p.getColor());\n\n drawName(canvas, p.getName(), height, p.getColor());\n height += 30;\n\n canvas.setLineWidth(7);\n\n // Draw each position\n Point last = null;\n int direction = 0;\n for (Point point : p.getPoints()) {\n if (last != null) {\n drawLine(canvas, getPixel(last), getPixel(point));\n\n Point dir = point.substract(last);\n if (dir.X > dir.Y && dir.X > 0) {\n direction = 1;\n } else if (dir.X < dir.Y && dir.X < 0) {\n direction = 3;\n } else if (dir.Y > dir.X && dir.Y > 0) {\n direction = 2;\n } else if (dir.Y < dir.X && dir.Y < 0) {\n direction = 0;\n }\n }\n last = point;\n }\n\n drawSlug(canvas, p.getId() - 1, getPixel(last), direction);\n }\n }", "@Override\r\n\tpublic void render(GameContainer gc, Graphics g) {\n\r\n\t\tg.drawImage(image, drawX - 16, drawY - 24); \r\n\t}", "public void render() {\r\n\t\t //Draw all of the sprites in the game\r\n\t background.draw(0,backgroudY1);\r\n\t\tbackground.draw(0,backgroudY2);\r\n\t\tbackground.draw(0,backgroudY3);\r\n\t\tbackground.draw(WIDTH/2,backgroudY1);\r\n\t\tbackground.draw(WIDTH/2,backgroudY2);\r\n\t background.draw(WIDTH/2,backgroudY3);\r\n\t \r\n\t // call this method from Player class, to draw the plane.\r\n\t player.render();\r\n\t \r\n\t \r\n\t // loop through every enemy, draw enemy if it's not killed\r\n\t for(int i=0; i<enemy.length; i++) {\r\n\t \t\r\n \tif(enemy[i] != null && enemyKilled[i] == true) {\r\n \t\t\r\n\t \t\t\r\n\t enemy[i].render();\r\n\t \r\n\t \t}\r\n\t \r\n\t }\r\n\t // loop through every laser, if it has not made contact with any enemy,\r\n\t // call its render method to draw it\r\n\t for (int i = 0; i < arr_size; i++) {\r\n\t \tif (lasers[i] != null && laserUsed[i] == true) {\r\n\t lasers[i].render();\r\n \t}\r\n\t \t\r\n\t }\r\n\t \r\n\t}", "public void drawMap() {\r\n\t\tfor (int x = 0; x < map.dimensionsx; x++) {\r\n\t\t\tfor (int y = 0; y < map.dimensionsy; y++) {\r\n\t\t\t\tRectangle rect = new Rectangle(x * scalingFactor, y * scalingFactor, scalingFactor, scalingFactor);\r\n\t\t\t\trect.setStroke(Color.BLACK);\r\n\t\t\t\tif (islandMap[x][y]) {\r\n\t\t\t\t\tImage isl = new Image(\"island.jpg\", 50, 50, true, true);\r\n\t\t\t\t\tislandIV = new ImageView(isl);\r\n\t\t\t\t\tislandIV.setX(x * scalingFactor);\r\n\t\t\t\t\tislandIV.setY(y * scalingFactor);\r\n\t\t\t\t\troot.getChildren().add(islandIV);\r\n\t\t\t\t} else {\r\n\t\t\t\t\trect.setFill(Color.PALETURQUOISE);\r\n\t\t\t\t\troot.getChildren().add(rect);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void Draw (Graphics graphics, MainJPanel JPanel){ // draw the player game pieces\n for(Piece piece : pieces.values())\n piece.Draw(graphics,JPanel);\n }", "public void draw(Canvas canvas) {\n // Draw the game\n for (int i = 0; i < width + 2; i++) {\n for (int j = 0; j < height + 2; j++) {\n canvas.setPoint(i, j, '.');\n }\n }\n\n for (int i = 0; i < width + 2; i++) {\n canvas.setPoint(i, 0, '-');\n canvas.setPoint(i, height + 1, '-');\n }\n\n for (int i = 0; i < height + 2; i++) {\n canvas.setPoint(0, i, '|');\n canvas.setPoint(width + 1, i, '|');\n }\n\n for (BaseObject object : getAllItems()) {\n object.draw(canvas);\n }\n }", "private void addAllDrawables() {\n \t\n \tfor (int i = 0; i < 10; i++) {\n \t\tint res_id = c.getResources().getIdentifier(\"puzzle_\"+i, \"drawable\", c.getPackageName());\n \t\t\n \t\tif (res_id != 0) {\n \t\t\timage_id_array.add(res_id);\n \t\t}\n \t}\n }", "private void drawArray(ArrayList<NormalFishCollect> images, GraphicsContext gc) {\n\t\tgc.save();\n\t\tfor (int i = 0; i < images.size(); i++) {\n\t\t\tgc.drawImage(images.get(i).img, images.get(i).x, images.get(i).y);\n\n\t\t}\n\t\tgc.restore();\n\n\t}", "protected abstract void drawGame();", "public void draw() {\r\n background(255);\r\n\r\n float mouseXFactor = map(mouseX, 0, width, 0.05f, 1);\r\n float mouseYFactor = map(mouseY, 0, height, 0.05f, 1);\r\n\r\n for (int gridX = 0; gridX < img.width; gridX++) {\r\n for (int gridY = 0; gridY < img.height; gridY++) {\r\n // grid position + tile size\r\n float tileWidth = width / (float) img.width;\r\n float tileHeight = height / (float) img.height;\r\n float posX = tileWidth * gridX;\r\n float posY = tileHeight * gridY;\r\n\r\n // get current color\r\n int c = pixelArray[gridX][gridY];\r\n\r\n // greyscale conversion\r\n int greyscale = round(red(c) * 0.222f + green(c) * 0.707f + blue(c) * 0.071f);\r\n\r\n if (drawMode == 1) {\r\n // greyscale to ellipse area\r\n fill(0);\r\n noStroke();\r\n float r2 = 1.1284f * sqrt(tileWidth * tileWidth * (1 - greyscale / 255.0f));\r\n r2 = r2 * mouseXFactor * 3;\r\n ellipse(posX, posY, r2, r2);\r\n } else if (drawMode == 2) {\r\n // greyscale to rotation, line length and stroke weight\r\n stroke(0);\r\n float w4 = map(greyscale, 0, 255, 10, 0);\r\n strokeWeight(w4 * mouseXFactor + 0.1f);\r\n float l4 = map(greyscale, 0, 255, 35, 0);\r\n l4 = l4 * mouseYFactor;\r\n pushMatrix();\r\n translate(posX, posY);\r\n rotate(greyscale / 255.0f * PI);\r\n line(0, 0, 0 + l4, 0 + l4);\r\n popMatrix();\r\n } else if (drawMode == 3) {\r\n // greyscale to line relief\r\n float w5 = map(greyscale, 0, 255, 5, 0.2f);\r\n strokeWeight(w5 * mouseYFactor + 0.1f);\r\n // get neighbour pixel, limit it to image width\r\n int /* color */ c2 = img.get(min(gridX + 1, img.width - 1), gridY);\r\n stroke(c2);\r\n int greyscale2 = (int) (red(c2) * 0.222f + green(c2) * 0.707f + blue(c2) * 0.071f);\r\n float h5 = 50 * mouseXFactor;\r\n float d1 = map(greyscale, 0, 255, h5, 0);\r\n float d2 = map(greyscale2, 0, 255, h5, 0);\r\n line(posX - d1, posY + d1, posX + tileWidth - d2, posY + d2);\r\n } else if (drawMode == 4) {\r\n // pixel color to fill, greyscale to ellipse size\r\n float w6 = map(greyscale, 0, 255, 25, 0);\r\n noStroke();\r\n fill(c);\r\n ellipse(posX, posY, w6 * mouseXFactor, w6 * mouseXFactor);\r\n // TODO 2: Add the following: if(Math.random()<0.1) {pixelArray[gridX][gridY] = lerpColor(c,0xff0000, 0.1f);}\r\n } else if (drawMode == 5) {\r\n stroke(c);\r\n float w7 = map(greyscale, 0, 255, 5, 0.1f);\r\n strokeWeight(w7);\r\n fill(255, 255 * mouseXFactor);\r\n pushMatrix();\r\n translate(posX, posY);\r\n rotate(greyscale / 255.0f * PI * mouseYFactor);\r\n rect(0, 0, 15, 15);\r\n popMatrix();\r\n }\r\n /*\r\n * TODO 3: Add a drawMode == 6 case. \r\n * Try modifying the pixelArray \r\n * Try drawing shapes or colors depending on c and grayscale variables \r\n * Try adding other forms of animation\r\n */\r\n }\r\n }\r\n }", "private void draw() {\n gsm.draw(g);\n }", "public synchronized void draw()\n\t{\n\t\t// First update the lighting of the world\n\t\t//int x = avatar.getX();\n\t\t//int y = avatar.getY();\t\t\n\n\t\tfor (int x = 0; x < width; x++)\n\t\t{\n\t\t\tfor (int y = 0; y < height; y++)\n\t\t\t{\n\t\t\t\ttiles[x][y].draw(x, y);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (int i = monsters.size() - 1; i >=0; i--)\n\t\t{\n\t\t\tMonster monster = monsters.get(i);\n\t\t\tint x = monster.getX();\n\t\t\tint y = monster.getY();\n\t\t\t\n\t\t\t// Check if the monster has been killed\n\t\t\tif (monster.getHitPoints() <= 0)\n\t\t\t{\n\t\t\t\tmonsters.remove(i);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (tiles[x][y].getLit())\n\t\t\t\t\tmonster.draw();\n\t\t\t}\n\t\t}\t\t\n\t\tavatar.draw();\n\t}", "public void draw() {\r\n\r\n//\t\tif (textures.length > 1) {\r\n//\t\t\tfor (int i = 1; i < textures.length; i++) {\r\n\t\tif (textures.length > 1) {\r\n\t\t\tDrawQuadWithTexture(textures[0], x, y, width, height);\r\n\t\t\tDrawQuadWithRotatedTexture(textures[1], x, y, width, height, angle);\r\n\t\t} else {\r\n\t\t\tDrawQuadWithRotatedTexture(textures[0], x, y, width, height, angle);\r\n\t\t}\r\n\r\n//\t\t\t}\r\n//\t\t}\r\n//\t\t\r\n\t}", "@Override\r\n\tpublic void draw() {\r\n\t\t//Set the background to dark grey\r\n\t\tbackground(50, 50, 50);\t\r\n\t\t//If the current state is processing, display text explaining this\r\n\t\tif (this.currentGameState == DisplayStates.PROCESSING) {\r\n\t\t\ttext(\"Processing, please wait...\", 30, 340); \r\n\t\t} else { //Otherwise, the grid should be drawn in it's current state\r\n\t\t\tthis.zoomer.transform(); //Transform the zoom based on user input\r\n\t\t\t//Get the cells in their current state\r\n\t\t\tthis.gridCells = this.world.getCells(); \r\n\t\t\t//Work out which size images to use.\r\n\t\t\tupdateImageScale();\r\n\t\t\t//Draw the images to the sketch based on the current scale\r\n\t\t\tif (this.currentImageScale == ImageDrawScales.LARGE) {\r\n\t\t\t\tdrawImages(LARGE_IMAGE, this.gridCells);\r\n\t\t\t} else if (this.currentImageScale == ImageDrawScales.MEDIUM) {\r\n\t\t\t\tdrawImages(MEDIUM_IMAGE, this.gridCells);\r\n\t\t\t} else {\r\n\t\t\t\tdrawImages(SMALL_IMAGE, this.gridCells);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void updateImage() {\n Graphics2D g = img.createGraphics();\n for (Circle gene : genes) {\n gene.paint(g);\n }\n g.dispose();\n }", "public void draw(){\n\t\tif(selected){\n\t\t\timg.draw(xpos,ypos,scale,Color.blue);\n\t\t}else{\n\t\t\timg.draw(xpos, ypos, scale);\n\t\t}\n\t}", "private void drawSquares() {\n for (Square square : gui.game) {\n new SquareRenderer(gui, g2, square);\n }\n }", "@Override\n\tpublic void draw() {\n\t\tbg.draw();\n\t\tfor(Test2 t : test)\n\t\t\tt.draw();\n\t\tfor(Test2 t : test2)\n\t\t\tt.draw();\n\t\t\n\t\tfor(Test2 t : test3)\n\t\t\tt.draw();\n\t\tobj.draw();\n\t\tEffect().drawEffect(1);\n\t}", "public void draw() {\n for (Point2D i : pointsSet)\n i.draw();\n }", "public void draw() {\n \n // TODO\n }", "public void render(Graphics g) {\r\n for(int i = 0; i < 5;i++){ // runs 5 times, and just draws the \"deck\" of cards sitting off to the side.\r\n g.drawImage(cardBack.getImage(),110+(i*2),210,null); // draws a pile of card back images\r\n //// next to each other.\r\n }\r\n for(int i = 0; i < game.yourCards.size();i++){ // Runs once for however many cards the player had in that hand.\r\n g.drawImage(game.yourCards.get(i).getImage(),500 - (int)((0.5)*game.yourCards.size()*72) + i*72,\r\n 300,null); // Draws each of the cards that the player had in the previous hand.\r\n }\r\n for(int i = 0; i < game.CPUCards.size();i++){ // Does the same for the CPU.\r\n g.drawImage(game.CPUCards.get(i).getImage(),500 - (int)((0.5)*game.CPUCards.size()*72) + i*72,100,\r\n null); // ...\r\n }\r\n g.setColor(new Color(48, 52, 52)); // Makes a new color and sets the pen color to it.\r\n g.setFont(new Font(\"font\", Font.BOLD,36)); // Changes the font size to 36.\r\n g.drawString(\"Money: $\"+game.money,82,128); // Draws text to the screen.\r\n g.setColor(Color.black); // ...\r\n g.setFont(new Font(\"\", Font.BOLD,55)); // ...\r\n if(!GameState.tied && !GameState.lost) { // Checks to see if the player won the previous hand.\r\n g.drawString(\"You won this hand\", 235, 240); // ...\r\n g.drawString(\"You gained $\" + game.betAmount, 314, 290); // ...\r\n }else if(!GameState.lost){ // If they didn't win, checks to see if they tied.\r\n g.drawString(\"You tied this hand\",245,240); // ...\r\n g.drawString(\"You gained nothing\",225,290); // ...\r\n }else{ // If they didn't win or tie, then they lost.\r\n g.drawString(\"You lost this hand\",245,240); // ...\r\n if(game.betAmount !=0 ){ // If they still have money left after losing.\r\n g.drawString(\"You lost $\"+game.betAmount,330,290); // ...\r\n }else{ // If they are all out of money.\r\n g.drawString(\"You lost it all\",330,290); // Tells the player they have lost all their money.\r\n }\r\n }\r\n if(Game.mouseX >= 390 && Game.mouseX <= 610 && Game.mouseY >= 415 && Game.mouseY < 500){\r\n // Checks to see if the \"New Hand\" button is hovered or not.\r\n g.setColor(Color.WHITE); // If so, the rectangle is white.\r\n }else{\r\n g.setColor(Color.BLACK); // If not, black.\r\n }\r\n g.fillRoundRect(390,415,220,85,13,13); // New Hand button.\r\n g.setColor(Color.magenta); // Pink text to contrast both white and black somewhat.\r\n g.setFont(new Font(\"\", Font.BOLD,30)); // ...\r\n g.drawString(\"New Hand\",427,471); // ...\r\n }", "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 }", "public void draw(){\n\t\t/* Stamps a copy of the planet at the position. the file of the planet image is under folder of \"images\".\n\t\t * a mistake easily to be ignored here..*/\n\t\tString imageToDraw = \"images/\" + imgFileName;\n\t\tStdDraw.picture(xxPos, yyPos, imageToDraw);\n\n\t}", "public void draw() {\t\t\n\t\ttexture.draw(x, y);\n\t\tstructure.getTexture().draw(x,y);\n\t}", "@Override\r\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\r\n Graphics2D g2d = (Graphics2D) g;\r\n g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\r\n RenderingHints.VALUE_ANTIALIAS_ON);\r\n g2d.setRenderingHint(RenderingHints.KEY_RENDERING,\r\n RenderingHints.VALUE_RENDER_QUALITY);\r\n \r\n\r\n Image icon = new ImageIcon(getClass().getClassLoader().getResource(\"wallpaper.jpg\")).getImage();\r\n g2d.drawImage(icon,0,0,this);\r\n //drawScenario(g2d);\r\n if(currentState == Common.GAME_STATE.INGAME){\r\n drawGaming(g2d);\r\n }\r\n if(currentState == Common.GAME_STATE.MENU || currentState == Common.GAME_STATE.LOSE){\r\n drawMenu(g2d);\r\n }\r\n\r\n Toolkit.getDefaultToolkit().sync();\r\n }", "public void gameRender(int x, int y) throws IOException {\n if (dbImage == null) {\n dbImage = new BufferedImage(PWIDTH, PHEIGHT, BufferedImage.TYPE_INT_RGB);\n if (dbImage == null) {\n System.out.println(\"dbImage is null\");\n return;\n } else {\n graphics = dbImage.getGraphics();\n }\n }\n\n int width = backgroundImage.getWidth();//width of background image\n graphics.drawImage(backgroundImage, x, y, null);//draws image on main game panel\n graphics.drawImage(backgroundImage, x + width, y, null);//draws image off screen for scrolling reasons\n if (nextStage == 1) {\n graphics.drawImage(planetImageTransformed, PWIDTH - planetImageTransformed.getWidth() / 2, PHEIGHT / 2 - planetImageTransformed.getHeight() / 2, null);\n }\n for (int i = 0; i < Ship.health; i++) { //i < 5\n graphics.drawImage(health.getHealthimage(), 30 * i, 10, 30, 30, null); //20*i, 10, 30, 30, nul \n }\n\n for (int j = 0; j < Shield.count; j++) { // draw Shield Image\n graphics.drawImage(shield.getShieldImage(), 30 * j, 80, 30, 30, null);\n }\n\n if (nextStage == 1) {\n graphics.drawImage(planetImageTransformed, PWIDTH - planetImageTransformed.getWidth() / 2, PHEIGHT / 2 - planetImageTransformed.getHeight() / 2, null);\n }\n\n if (stageChange) {\n if (nextStage == 1) {\n currentStage = new Stage1();\n planetImageTransformed = planetImage;\n scaleCount = 0;\n scale = 1;\n collectFromStage();\n }\n\n if (nextStage == 2) {\n currentStage = new Stage2();\n collectFromStage();\n }\n\n if (nextStage == 3) {\n currentStage = new Stage3();\n collectFromStage();\n }\n\n stageChange = false;\n }\n\n if (cutsceneChange) {\n\n if (nextCutscene == 1) {\n currentCutscene = new Cutscene1();\n currentStage = new Stage2();\n collectFromCutscenes();\n Animator.cutsceneRunning = true;\n\n }\n if (nextCutscene == 2) {\n currentCutscene = new Cutscene2();\n currentStage = new Stage3();\n collectFromCutscenes();\n Animator.cutsceneRunning = true;\n }\n cutsceneChange = false;\n }\n\n synchronized (gameData.figures) {//runs through each game figures and renders them\n GameFigure f;\n for (GameFigure figure : gameData.figures) {\n f = (GameFigure) figure;\n f.render(graphics);\n }\n }\n }", "public void render(Graphics g) {\n\t\t// Tile the background image\n\t\tfor (int i = 0; i < App.SCREEN_WIDTH; i += background.getWidth()) {\n\t\t\tfor (int j = -background.getHeight() + (int)backgroundOffset; j < App.SCREEN_HEIGHT; j += background.getHeight()) {\n\t\t\t\tbackground.draw(i, j);\n\t\t\t}\n\t\t}\n\t\t// Draw all sprites\n\t\tfor (Sprite sprite : sprites) {\n\t\t\tsprite.render();\n\t\t}\n\t\tg.drawString(\"Score: \" + score, 20, App.SCREEN_HEIGHT - 30);\n\t\tfor (int i = 1; i <= lives; ++i) {\n\t\t\tlivesImage.draw(20 + 40 * (i - 1), App.SCREEN_HEIGHT - 72);\n\t\t}\n\t}", "public void draw() {\r\n\t\tif (active_)\r\n\t\t\tGlobals.getInstance().getCamera().drawImageOnHud(posx_, posy_, currentImage());\r\n\t}", "private void render() {\n if (game.isEnded()) {\n if (endGui == null) {\n drawEndScreen();\n }\n\n return;\n }\n\n drawScore();\n drawSnake();\n drawFood();\n }", "@Override\n\tpublic void render() {\n\t\tgraphics.clearRect(0, 0, layerWidth, layerheight);\n\t\t\n\t\tfor(int i = 0, length = renderList.size(); i < length; i++) {\n\t\t\tSprite sprite = renderList.get(i);\n\t\t\trotateImage(sprite);\n\t\t\tgraphics.drawImage(sprite.getImage(), sprite.getX(), sprite.getY());\n\t\t}\n\t\t\n\t\ttimeDelay(3000);\n\t}", "public void render(){\n spriteBatch.begin();\n drawEnemies();\n drawPlayer();\n drawBullets();\n spriteBatch.end();\n if(debug){\n drawDebug();\n }\n }", "public void findImages() {\n URL imgURL = ImageLoader.class.getResource(\"/BackgroundMenu.jpg\");\n this.backgroundImages.put(MenuP.TITLE, loadImage(imgURL));\n\n imgURL = ImageLoader.class.getResource(\"/backgroundGame.png\");\n this.backgroundImages.put(ArenaView.TITLE, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/gameOver.jpg\");\n this.backgroundImages.put(GameOverView.TITLE, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Player.png\");\n this.entityImages.put(ID.PLAYER, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Enemy1.png\");\n this.entityImages.put(ID.BASIC_ENEMY, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/boss.png\");\n this.entityImages.put(ID.BOSS_ENEMY, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/meteorBrown_big1.png\");\n this.entityImages.put(ID.METEOR, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/BlueBullet.png\");\n this.bulletImages.put(new Pair<>(ID.PLAYER_BULLET, ID.PLAYER), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/redBullet.png\");\n this.entityImages.put(ID.ENEMY_BULLET, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_FireBoost.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.FIRE_BOOST), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_Freeze.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.FREEZE), loadImage(imgURL)); \n \n imgURL = ImageLoader.class.getResource(\"/powerup_Health.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.HEALTH), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_Shield.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.SHIELD), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/bulletSpeedUp.png\");\n this.AnimationsPowerUp.put(new Pair<>(ID.POWER_UP, PowerUpT.FIRE_BOOST), loadEffect(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Explosion.png\");\n this.AnimationsEffect.put(new Pair<>(ID.EFFECT, SpecialEffectT.EXPLOSION), loadEffect(imgURL));\n\n imgURL = ImageLoader.class.getResource(\"/freeze.png\");\n this.AnimationsPowerUp.put(new Pair<>(ID.POWER_UP, PowerUpT.FREEZE), loadImage(imgURL));\n }", "private void draw(){\n if (ourHolder.getSurface().isValid()) {\n\n if (openMainMenu) {\n mainMenu();\n } else if (openGameOverMenu) {\n gameOverMenu();\n } else if (openUpgradesMenu) {\n upgradeMenu();\n } else if (openPauseMenu) {\n pauseMenu();\n } else {\n // Lock the canvas ready to draw\n gameCanvas = ourHolder.lockCanvas();\n\n // Draw the background\n gameCanvas.drawBitmap(btBgLeft, leftSideRect.left, leftSideRect.top, null);\n gameCanvas.drawBitmap(btBgMiddle, middleSideRect.left, middleSideRect.top, null);\n gameCanvas.drawBitmap(btBgRight, rightSideRect.left, rightSideRect.top, null);\n\n // HUD Rectangle\n String padding = \" | \";\n paint.setTextSize(30);\n paint.setColor(Color.argb(125, 0, 0, 0));\n gameCanvas.drawRect(hudRect, paint);\n paint.setColor(Color.argb(255, 255, 255, 255));\n gameCanvas.drawText(\"Bonus: \" + multiplier + padding + \"Score: \" + totalScore + padding + \"Shields: \" + shields + padding + \"Cash: £\" + cash, hudRect.left + (hudRect.right/25), hudRect.bottom - (hudRect.height()/3), paint);\n\n // Draw the invaders bullets if active\n for(int i = 0; i < invadersBullets.length; i++){\n paint.setColor(Color.argb(255, 228, 53, 37));\n if(invadersBullets[i].getStatus()) {\n gameCanvas.drawRect(invadersBullets[i].getRect(), paint);\n }\n }\n\n // Draw the players bullet if active\n if(bullet.getStatus()){\n paint.setColor(Color.argb(255, 30, 127, 224));\n gameCanvas.drawRect(bullet.getRect(), paint);\n }\n\n // Draw the player spaceship\n paint.setColor(Color.argb(255, 255, 255, 255));\n gameCanvas.drawBitmap(defender.getBitmap(), defender.getX(), screenY - defender.getHeight(), paint);\n\n // Draw the invaders\n for(int i = 0; i < numInvaders; i++){\n if(invaders[i].getVisibility()) {\n if(uhOrOh) {\n gameCanvas.drawBitmap(invaders[i].getBitmap(), invaders[i].getX(), invaders[i].getY(), paint);\n }else{\n gameCanvas.drawBitmap(invaders[i].getBitmap2(), invaders[i].getX(), invaders[i].getY(), paint);\n }\n }\n }\n\n // Pause button\n paint.setColor(Color.argb(125, 0, 0, 0));\n gameCanvas.drawRect(pauseRect, paint);\n paint.setTextSize((float) (screenX*0.0138));\n paint.setColor(Color.argb(255, 255, 255, 255));\n gameCanvas.drawText(\"PAUSE GAME\", pauseRect.left + (pauseRect.width()/10), pauseRect.bottom - (pauseRect.height()/3), paint);\n\n // Animations\n renderAnimations();\n\n // Draw everything to the screen\n ourHolder.unlockCanvasAndPost(gameCanvas);\n }\n\n }\n }", "private void drawImages(int imageScale, Cell[][] gridCells) {\r\n\t\t//If the background buffer isn't null, draw it to the screen\r\n\t\tif (this.backgroundBuffer != null) {\r\n\t\t\timage(this.backgroundBuffer, 0, 0);\r\n\t\t}\r\n\t\tif (this.currentGameState == DisplayStates.RUNNING) {\r\n\t\t\t//Loop through each hexagon, and draw the markers, then food, then\r\n\t\t\t//ants in that order\r\n\t\t\tfor (int row = 0; row < this.numHexRow; row++) {\r\n\t\t\t\tfor (int col = 0; col < this.numHexCol; col++) {\r\n\t\t\t\t\tif (this.isMarkers) {\r\n\t\t\t\t\t\tdrawMarker(row, col, gridCells);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdrawFood(imageScale, row, col);\r\n\t\t\t\t\tdrawAnt(imageScale, row, col);\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void drawPokemon() {\n setAttackText();\n drawImage();\n }", "public void paint() {\n BufferStrategy bs;\n bs = this.getBufferStrategy();\n\n Graphics g = bs.getDrawGraphics();\n g.drawImage(background, 0, 0, this.getWidth(), this.getHeight(), null);\n if (this.blackHoles != null) {\n for (BlackHole blackHole : this.blackHoles) {\n blackHole.paint(g);\n }\n }\n if (this.balls != null) {\n for (int i = 0; i <this.balls.size() ; i++) {\n this.balls.get(i).paint(g);\n }\n\n }\n\n bs.show();\n g.dispose();\n\n }", "public void draw() {\r\n\t\tfor(int i=0; i<2; i++) {\r\n\t\t\trenderer[i].setView(camera[i]);\r\n\t\t\trenderer[i].render();\r\n\t\t}\r\n\t}", "void drawImage(Graphics g, Image i, int index, int x, int y, int width, int height){\n\t\tg.drawImage(images.get(i).get(index), (int) (x*worldScale), (int) (y*worldScale), (int) (width*worldScale), (int) (height*worldScale), this);\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}", "public abstract WorldImage drawBoard(int blocks);", "@Override\n\tpublic void draw(Canvas canvas) {\n\t\t\n\t\tif(!all) {\n\t\t\tsprite3.draw(canvas);\n\t\t}\n\t\telse {\n\t\tif (count%4 == 0) {\n\t\t\tsprite1.draw(canvas);\n\t\t}\n\t\telse {\n\t\t\tsprite2.draw(canvas);\n\t\t}\n\t\t++count;\n\t\t\n\t\tif (count==60) {\n\t\t\tcount=0;\n\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "public void render(GameContainer gc, Graphics g){\n\n for(Renderable r:renderables){\n r.render(gc, g);\n }\n\n if(this.gameData.getCurrentRoom().getRoomType() == MasarRoom.VICTORYROOM) {\n this.gameData.getImageList().get(2).draw(226, 284);\n }\n\n if(this.gameData.getCurrentRoom().getRoomType() == MasarRoom.DEFEATROOM) {\n this.gameData.getImageList().get(3).draw(120, 288);\n }\n\n\n if(roomType == GAMEROOM){\n\n for(Renderable l: this.gameData.getLinkList()){\n l.render(gc, g);\n }\n for(Renderable s: this.gameData.getSystemList()){\n s.render(gc, g);\n }\n\n this.gameData.getImageList().get(0).draw(300, 5);\n this.gameData.getImageList().get(1).draw(800, 5);\n this.gameData.getButtonsImages().get(\"Enemy\").drawNextSubimage(600, 16);\n this.gameData.getButtonsImages().get(\"Allied\").drawNextSubimage(500, 16);\n\n TrueTypeFont font = this.gameData.getFont(\"UITopFont\");\n font.drawString(536, 0, \"VS\" , Color.green);\n\n int popa = this.gameData.getPopA();\n int pope = this.gameData.getPopE();\n int resa = this.gameData.getResA();\n int rese = this.gameData.getResE();\n\n if ( popa > 1000000 ) font.drawString(480 - font.getWidth(\"\"+popa/1000000 + \"M\"), 0, \"\"+popa/1000000 + \"M\" , Color.cyan);\n else if ( popa > 1000 ) font.drawString(480 - font.getWidth(\"\"+popa/1000 + \"K\"), 0, \"\"+popa/1000 + \"K\" , Color.cyan);\n else font.drawString(480 - font.getWidth(\"\"+popa), 0, \"\"+popa , Color.cyan);\n font.drawString(295 - font.getWidth(\"\"+resa), 0, \"\"+resa , Color.cyan);\n\n if ( pope > 1000000 ) font.drawString(620, 0, \"\"+pope/1000000 + \"M\" , Color.red);\n else if ( pope > 1000 ) font.drawString(620, 0, \"\"+pope/1000 + \"K\" , Color.red);\n else font.drawString(620, 0, \"\"+pope , Color.red);\n font.drawString(830, 0, \"\"+rese , Color.red);\n\n for(WindowSystem w: this.gameData.getWindowList()){\n if(w.getMs().isShowWindow())\n w.render(gc, g);\n }\n\n //this.getClickManager().renderHitboxes(gc, g);\n\n }\n\n //this.getClickManager().renderHitboxes(gc, g);\n }", "void draw(Graphics g){\n\t\t\tg.drawImage(GamePanel.rocketImg, x, y, width, height, null);\n\t\t}", "protected void paintComponent(Graphics g) {\n super.paintComponent(g);\n // draw all piles and the remaining cards left in the deck\n for (int i = 0; i < mainPiles.length; i++) {\n mainPiles[i].draw(g);\n }\n for (int i = 0; i < suitPiles.length; i++) {\n suitPiles[i].draw(g);\n }\n deckPile.draw(g);\n deck.draw(g);\n \n if (selectedPile != null) {\n selectedPile.draw(g);\n }\n }", "public void displayGameMode (Graphics g1)\n {\n if (state == 1)\n {\n if (sprite == 2)\n g1.drawImage (new ImageIcon (\"Images/1P2P/1/2player2.png\").getImage(), 0, 0, null);\n else if (sprite == 1)\n g1.drawImage (new ImageIcon (\"Images/1P2P/1/1player2.png\").getImage(), 0, 0, null);\n else \n g1.drawImage (new ImageIcon (\"Images/1P2P/1/plain2.png\").getImage(), 0, 0, null);\n }\n \n else if (state == 2)\n {\n if (sprite == 2)\n g1.drawImage (new ImageIcon (\"Images/1P2P/2/2player2.png\").getImage(), 0, 0, null);\n else if (sprite == 1)\n g1.drawImage (new ImageIcon (\"Images/1P2P/2/1player2.png\").getImage(), 0, 0, null);\n else \n g1.drawImage (new ImageIcon (\"Images/1P2P/2/plain2.png\").getImage(), 0, 0, null);\n }\n \n else if (state == 3)\n {\n if (sprite == 2)\n g1.drawImage (new ImageIcon (\"Images/1P2P/3/2player.png\").getImage(), 0, 0, null);\n else if (sprite == 1)\n g1.drawImage (new ImageIcon (\"Images/1P2P/3/1player.png\").getImage(), 0, 0, null);\n else \n g1.drawImage (new ImageIcon (\"Images/1P2P/3/plain.png\").getImage(), 0, 0, null);\n }\n \n else if (state == 4)\n {\n if (sprite == 2)\n g1.drawImage (new ImageIcon (\"Images/1P2P/4/2player.png\").getImage(), 0, 0, null);\n else if (sprite == 1)\n g1.drawImage (new ImageIcon (\"Images/1P2P/4/1player.png\").getImage(), 0, 0, null);\n else \n g1.drawImage (new ImageIcon (\"Images/1P2P/4/plain.png\").getImage(), 0, 0, null);\n }\n \n bird1.displayDisplayCharacter (g1);\n bird2.displayDisplayCharacter (g1);\n bird3.displayDisplayCharacter (g1);\n }", "public void render(Graphics g) {\n int sxtemp = sx, sytemp = sy;\n g.drawImage(background, 0, 0, 1024, 768, sxtemp, sytemp-768, sxtemp+1024, sytemp, null);\n \n for (Obstacle1 obstacle : floors) {\n\t Rectangle range = new Rectangle(obstacle.getLocation(), obstacle.getSize());\n g.drawImage(obstacle.getImage(), range.x - sx , range.y - sy + 768, range.width, range.height, null);\n //g.drawImage(obstacle, 666, 444, obstacle.getWidth(), obstacle.getHeight(), null);\n\t}\n\tfor (Obstacle2 stair : stairs) {\n\t Rectangle range = new Rectangle(stair.getLocation(), stair.getSize());\n if (stair.getFace() == Direction.RIGHT) {\n g.drawImage(stair.getImage(), range.x + range.width - sx, range.y - sy + 768, -range.width, range.height, null);\n } else {\n g.drawImage(stair.getImage(), range.x - sx , range.y - sy + 768, range.width, range.height, null);\n }\n //g.drawImage(obstacle, 666, 444, obstacle.getWidth(), obstacle.getHeight(), null);\n\t}\n\tfor (Obstacle3 obstacle : rocks) {\n\t Rectangle range = new Rectangle(obstacle.getLocation(), obstacle.getSize());\n g.drawImage(obstacle.getImage(), range.x - sx , range.y - sy + 768, range.width, range.height, null);\n\t}\n\t\n for (Sprite sprite : sprites) {\n //System.out.println(sprite.location);\n //System.out.printf(\"%d %d\\n\", sxtemp, sytemp);\n sprite.setLocation(new Point(sprite.getX()-sxtemp, sprite.getY()-sytemp+768));\n //System.out.printf(\"%d %d\\n\", sxtemp, sytemp);\n sprite.render(g);\n sprite.setLocation(new Point(sprite.getX()+sxtemp, sprite.getY()+sytemp-768));\n }\n for(DropItem dropItem : dropItems) {\n dropItem.setLocation(new Point(dropItem.getLocation().x-sxtemp, dropItem.getLocation().y-sytemp+768));\n dropItem.render(g);\n dropItem.setLocation(new Point(dropItem.getLocation().x+sxtemp, dropItem.getLocation().y+sytemp-768));\n }\n sx = sxtemp; sy = sytemp;\n\n BufferedImage bg = resizeImage((BufferedImage)background, background.getWidth(null)/16, background.getHeight(null)/16);\n g.drawImage(bg, 0, 0, null);\n for (Sprite sprite : sprites) {\n g.setColor(Color.RED);\n Point p = sprite.getLocation();\n if(sprite instanceof Boss) g.fillOval((int)(p.getX()/16), (int)(p.getY()/16), 16, 16);\n else g.fillOval((int)(p.getX()/16), (int)(p.getY()/16), 6, 6);\n }\n for(Obstacle obstacle : floors) {\n Point p = obstacle.getLocation();\n int w = obstacle.getImage().getWidth(null), h = obstacle.getImage().getHeight(null);\n BufferedImage img = resizeImage((BufferedImage)obstacle.getImage(), w/16, h/16);\n g.drawImage(img, (int)(p.getX()/16), (int)(p.getY()/16), null);\n }\n for(Obstacle obstacle : rocks) {\n Point p = obstacle.getLocation();\n int w = obstacle.getImage().getWidth(null), h = obstacle.getImage().getHeight(null);\n BufferedImage img = resizeImage((BufferedImage)obstacle.getImage(), w/16, h/16);\n g.drawImage(img, (int)(p.getX()/16), (int)(p.getY()/16), null);\n }\n for(Obstacle obstacle : stairs) {\n Point p = obstacle.getLocation();\n int w = obstacle.getImage().getWidth(null), h = obstacle.getImage().getHeight(null);\n BufferedImage img = resizeImage((BufferedImage)obstacle.getImage(), w/16, h/16);\n g.drawImage(img, (int)(p.getX()/16), (int)(p.getY()/16), null);\n }\n\n\n g.setColor(Color.green);\n Point p = player.getLocation();\n g.fillOval((int)(p.getX()/16), (int)(p.getY()/16), 8, 8);\n g.setColor(Color.black);\n g.drawOval((int)(p.getX()/16), (int)(p.getY()/16), 8, 8);\n\n g.drawImage(pause, 950, 0, null);\n\n g.setColor(Color.pink);\n g.fillRect(350, 650, 300, 80);\n g.setColor(Color.black);\n g.drawRect(350, 650, 300, 80);\n Image pl;\n try {\n pl = ImageIO.read(new File(\"assets/others/player.png\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(pl, 365, 655, null);\n g.setColor(Color.black);\n g.setFont(new Font(\"TimesRoman\", Font.BOLD, 16));\n g.drawString(\"LV. \" + player.lv, 415, 700); //player.exp + \"/\" + player.lv*100\n g.drawString(\"exp \", 480, 675);\n\n g.setFont(new Font(\"TimesRoman\", Font.PLAIN, 16));\n g.setColor(Color.GRAY);\n g.fillRect(510, 660, 120, 15);\n g.setColor(Color.YELLOW);\n g.fillRect(510, 660, (int) (player.exp * 120 / (player.lv*100)), 15);\n g.setColor(Color.BLACK);\n g.drawRect(510, 660, 120, 15);\n g.drawString(player.exp + \"/\" + player.lv*100, 520, 675);\n\n HealthPointBar hpBar = player.hpBar;\n int width = (int) (hpBar.getHp() * 120 / player.KNIGHT_HP);\n int widthMp = (int) (hpBar.getMp() * 120 / player.KNIGHT_MP);\n g.setColor(Color.RED);\n g.fillRect(510, 685, 120, 15);\n g.setColor(Color.GREEN);\n g.fillRect(510, 685, width, 15);\n g.setColor(Color.WHITE);\n g.fillRect(510, 705, 120, 15);\n g.setColor(Color.BLUE);\n g.fillRect(510, 705, widthMp, 15);\n g.setColor(Color.black);\n g.drawRect(510, 685, 120, 15);\n g.drawRect(510, 705, 120, 15);\n g.setFont(new Font(\"TimesRoman\", Font.PLAIN, 16));\n g.setColor(Color.black);\n g.drawString(\"HP \", 480, 700);\n g.drawString(\"MP \", 480, 720);\n g.drawString(hpBar.getHp() + \"/\" + player.KNIGHT_HP, 520, 700);\n g.drawString(hpBar.getMp() + \"/\" + player.KNIGHT_MP, 520, 720);\n\n\n //boss\n if(bossAppear && !bossDies) {\n g.setColor(Color.pink);\n g.fillRect(350, 0, 300, 80);\n g.setColor(Color.black);\n g.drawRect(350, 0, 300, 80);\n Image bo;\n try {\n bo = ImageIO.read(new File(\"assets/others/boss.png\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(bo, 560, -5, null);\n g.setColor(Color.black);\n\n g.setFont(new Font(\"TimesRoman\", Font.PLAIN, 16));\n hpBar = boss.hpBar;\n width = (int) (hpBar.getHp() * 150 / boss.HP);\n g.setColor(Color.RED);\n g.fillRect(420, 35, 150, 15);\n g.setColor(Color.GREEN);\n g.fillRect(420, 35, width, 15);\n g.setColor(Color.black);\n g.drawRect(420, 35, 150, 15);\n g.setFont(new Font(\"TimesRoman\", Font.PLAIN, 16));\n g.setColor(Color.black);\n g.drawString(\"HP \", 380, 50);\n g.drawString(hpBar.getHp() + \"/\" + boss.HP, 425, 50);\n\n }\n\n if(player.levelUping > 0) {\n player.levelUping--;\n Image lvup;\n try {\n lvup = ImageIO.read(new File(\"assets/lvup/\" + player.lv + \".png\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(lvup, 290, 80, null);\n }\n\n g.setFont(new Font(\"TimesRoman\", Font.BOLD, 16));\n g.setColor(Color.gray);\n if(player.lv >= 1) {\n Image skillu;\n try {\n skillu = ImageIO.read(new File(\"assets/skillicon/skillu.jpg\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(skillu, 0, 680, null);\n g.drawString(\"u\", 20, 675);\n }\n if(player.lv >= 2) {\n Image twoStepJump;\n try {\n twoStepJump = ImageIO.read(new File(\"assets/skillicon/2stepjump.jpg\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(twoStepJump, 50, 680, null);\n g.drawString(\"space\", 50, 675);\n }\n if(player.lv >= 3) {\n Image skilli;\n try {\n skilli = ImageIO.read(new File(\"assets/skillicon/skilli.jpg\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(skilli, 100, 680, null);\n g.drawString(\"i\", 120, 675);\n }\n if(player.lv >= 4) {\n Image skillo;\n try {\n skillo = ImageIO.read(new File(\"assets/skillicon/heal.png\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(skillo, 150, 680, null);\n g.drawString(\"o\", 170, 675);\n }\n\n int hp = player.hpPotionCount, mp = player.mpPotionCount, ring = player.ringCount;\n g.setColor(Color.yellow);\n g.fillRect(860, 680, 150, 50);\n g.setColor(Color.black);\n g.drawRect(860, 680, 50, 50);\n g.drawRect(910, 680, 50, 50);\n g.drawRect(960, 680, 50, 50);\n\n g.setFont(new Font(\"TimesRoman\", Font.BOLD, 16));\n g.setColor(Color.black);\n Image im;\n try {\n im = ImageIO.read(new File(\"assets/dropitem/33.png\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(im, 860, 680, null);\n g.setColor(Color.gray);\n g.drawString(\"1\", 895, 695);\n g.setColor(Color.black);\n g.drawString(\"\" + hp, 895, 730);\n\n try {\n im = ImageIO.read(new File(\"assets/dropitem/22.png\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(im, 910, 680, null);\n g.setColor(Color.gray);\n g.drawString(\"2\", 945, 695);\n g.setColor(Color.black);\n g.drawString(\"\" + mp, 945, 730);\n\n try {\n im = ImageIO.read(new File(\"assets/dropitem/11.png\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(im, 960, 680, null);\n g.setColor(Color.gray);\n g.drawString(\"3\", 995, 695);\n g.setColor(Color.black);\n g.drawString(\"\" + ring, 995, 730);\n }", "public void render () {\n image (img, xC, yC, xLength * getPixelSize(), yLength * getPixelSize());\n }", "@Override\r\n protected void paintComponent(Graphics g) {\r\n super.paintComponent(g);\r\n for (IVehicle vehicle : carView.carController.getVehicles()){\r\n g.drawImage(carView.assets.get(vehicle), vehicle.getPosition().x, vehicle.getPosition().y, null);\r\n }\r\n }", "public void drawImage() {\n mTextureRender.drawFrame(mSurfaceTexture);\n }", "public void draw() {\r\n try{\r\n while(vidas!=0) {\r\n Canvas canvas = ourHolder.lockCanvas();\r\n canvas.drawBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.space), 0, 0, null);\r\n canvas.drawBitmap(airplane, xPos, yPos, null);\r\n canvas.drawBitmap(mars, 490, 0, null);\r\n canvas.drawBitmap(lune, 430, 380, null);\r\n\r\n for (int i = 1; i < vidas; i++) {\r\n int x = 475;\r\n int y = 285;\r\n canvas.drawBitmap(heart, x, y, null);\r\n\r\n }\r\n\r\n //RECTANGULOS PARA COLISION//\r\n\r\n RectF drawRect = new RectF();\r\n RectF drawRect2 = new RectF();\r\n RectF drawRect3 = new RectF();\r\n\r\n\r\n drawRect.set(425, 50, 585, 215);\r\n drawRect3.set(425, 400, 585, 575);\r\n drawRect2.set(xPos, yPos, xPos + 100, yPos + 100);\r\n ourHolder.unlockCanvasAndPost(canvas); //BLOQUEA EL CANVAS NO SE PUEDE DIBUJAR NADA MAS DEBEMOS UTILIZARLO AL FINAL\r\n\r\n\r\n rect1 = new Rect(450, 50, 575, 200);\r\n rect2 = new Rect(Math.round(xPos), Math.round(yPos), Math.round(xPos + 100), Math.round(yPos + 100));\r\n rect3 = new Rect(450, 400, 585,560);\r\n\r\n //COLISION\r\n\r\n if(opcion==1){\r\n ourView.Colision(rect1, rect2, rect3);\r\n }\r\n else{\r\n ourView.Colision2(rect1,rect2,rect3);\r\n }\r\n\r\n\r\n }}\r\n catch (Exception e) {\r\n\r\n }\r\n }", "private void draw() {\n ctx.clearRect(0, 0, width, height);\n\n for (ImageParticle p : particles) {\n p.opacity = p.remainingLife / p.life * 0.5;\n\n // Draw particle from image\n ctx.save();\n ctx.translate(p.x, p.y);\n ctx.scale(p.size, p.size);\n //ctx.translate(p.image.getWidth() * (-0.5), p.image.getHeight() * (-0.5));\n ctx.translate(-HALF_WIDTH, -HALF_HEIGHT);\n ctx.setGlobalAlpha(p.opacity);\n ctx.drawImage(p.image, 0, 0);\n ctx.restore();\n\n //p.remainingLife--;\n p.remainingLife *= 0.98;\n //p.size *= 0.99;\n p.x += p.vX;\n p.y += p.vY;\n\n //regenerate particles\n if (p.remainingLife < 0 || p.size < 0 || p.opacity < 0.01) {\n if (running) {\n p.reInit();\n } else {\n particles.remove(p);\n }\n }\n }\n }", "@Override\n\tpublic void renderImages(Graphics g){\n\t\t//Draws Resources.welcome to the screen at x = 0\n\t\tg.drawImage(Resources.welcome, 0, 0, null);\n\n\t}", "public void Draw() {\n\t\timgIcon = new ImageIcon(imgUrl);\n\t}", "public void drawImage(Graphics g) {\n\t\tint space = 30;\n\t\tint xHealthOffset = 20; \n\n\t\tfor (int i = 0; i < this.srb.pop.getLives(); i++) {\n\t\t\tGraphics2D g2 = (Graphics2D) g;\n\t\t\tg2.drawImage(img, xHealthOffset + space, 700, img.getWidth(), img.getHeight(), null);\n\t\t\txHealthOffset += space;\n\t\t}\n\t\t\n\t}", "@SuppressLint(\"MissingSuperCall\")\n @Override\n public void draw(Canvas canvas) {\n final float scaleX = getWidth() / (WIDTH * 1.f); //set scale factor of bg image and screen area\n final float scaleY = getHeight() / (HEIGHT * 1.f);\n if (canvas != null) {\n final int savedState = canvas.save();\n canvas.scale(scaleX, scaleY); //scale bg\n //draw order means that demons walk over gargants, demon shots go over all ground troops and under dragon.\n //also means dragons fly over all enemies cus, ya know, they fly\n bg.draw(canvas); //draw bg\n player.draw(canvas); //draw player\n for (LightningBall b : bullets) {\n b.draw(canvas); //draw each player bullet\n }\n for (Gargant g : gargants) {\n g.draw(canvas); //draw each gargant\n }\n for (Demon de : demons) {\n de.draw(canvas); //draw each demon\n }\n for (HellFire ds : demonShots) {\n ds.draw(canvas); //draw each demon shot\n }\n for (Dragon d : dragons) {\n d.draw(canvas); //draw each dragon\n }\n\n drawText(canvas); //draw the text on screen\n canvas.restoreToCount(savedState);\n }\n }", "public void draw() {\n for (Point2D point : pointSet) {\n point.draw();\n }\n }", "public void draw() {\n for (Point2D p: mPoints) {\n StdDraw.filledCircle(p.x(), p.y(), 0.002);\n }\n }", "public void draw(Graphics2D graphics) {\n\n for (int y = 0; y < MAP_HEIGHT; y++)\n for (int x = 0; x < MAP_WIDTH; x++) {\n Tile temp = tiles[x][y];\n Tile bgtemp = backGroundTiles[x][y];\n Tile grasstemp = grassTiles[x][y];\n if ((temp.x >= -TILE_SIZE && temp.x <= Constants.FRAME_WIDTH\n + TILE_SIZE)\n && (temp.y >= -TILE_SIZE && temp.y <= Constants.FRAME_HEIGHT\n + TILE_SIZE)) {\n\n if (bgtemp.texture != 0) {\n graphics.drawImage(sprites.getTile(bgtemp.texture), bgtemp.x,\n bgtemp.y, null);\n }\n if (temp.texture != 0) {\n graphics.drawImage(sprites.getTile(temp.texture), temp.x, temp.y,\n null);\n }\n if (grasstemp.texture != 0) {\n graphics.drawImage(sprites.getTile(grasstemp.texture), grasstemp.x,\n grasstemp.y, null);\n }\n }\n }\n }", "private void render() {\n\t\ttheMap.draw(g);\n\t\ttheTrainer.draw(g);\n\t}", "@Override\r\n\tpublic void draw() {\n\t\tSystem.out.println(\"Draw all shapes\");\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void draw() {\n\t\tSystem.out.println(\"Draw all shapes\");\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void draw() {\n\t\tSystem.out.println(\"Draw all shapes\");\r\n\t\t\r\n\t}", "public void draw() {\n PImage grid = loadImage(\"C:/Users/NM/Desktop/UNI_ACAD/INFO1113/Assignment2/Atomination/assets/tile.png\");\n for(int i = 0 ; i < 10 ; i++){\n for(int j = 0 ; j < 6 ; j++){\n image(grid, i*grid.width, j*grid.height);\n if(gridPlane.get(List.of(i, j)).getOwner() != null){\n if(gridPlane.get(List.of(i, j)).getOwner().getColor().equals(\"Red\")){\n if(gridPlane.get(List.of(i, j)).getAtomCount() == 1){\n image(loadImage(\"C:/Users/NM/Desktop/UNI_ACAD/INFO1113/Assignment2/Atomination/assets/red1.png\"), i*grid.width, j*grid.height);\n }else if(gridPlane.get(List.of(i, j)).getAtomCount() == 2){\n image(loadImage(\"C:/Users/NM/Desktop/UNI_ACAD/INFO1113/Assignment2/Atomination/assets/red2.png\"), i*grid.width, j*grid.height);\n }else if(gridPlane.get(List.of(i, j)).getAtomCount() == 3){\n image(loadImage(\"C:/Users/NM/Desktop/UNI_ACAD/INFO1113/Assignment2/Atomination/assets/red3.png\"), i*grid.width, j*grid.height);\n }\n }else if(gridPlane.get(List.of(i, j)).getOwner().getColor().equals(\"Green\")){\n if(gridPlane.get(List.of(i, j)).getAtomCount() == 1){\n image(loadImage(\"C:/Users/NM/Desktop/UNI_ACAD/INFO1113/Assignment2/Atomination/assets/green1.png\"), i*grid.width, j*grid.height);\n }else if(gridPlane.get(List.of(i, j)).getAtomCount() == 2){\n image(loadImage(\"C:/Users/NM/Desktop/UNI_ACAD/INFO1113/Assignment2/Atomination/assets/green2.png\"), i*grid.width, j*grid.height);\n }else if(gridPlane.get(List.of(i, j)).getAtomCount() == 3){\n image(loadImage(\"C:/Users/NM/Desktop/UNI_ACAD/INFO1113/Assignment2/Atomination/assets/green3.png\"), i*grid.width, j*grid.height);\n }\n }\n }\n }\n }\n if(this.finish == true){\n System.exit(0);\n }\n }", "@Override\n\tpublic void paint(Graphics g) {\n\t\tg.setColor(getBackground());\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\n\t\t// Draw each of the DrawSurfaces in the correct order.\n\t\tfor (Object element : aiDrawingOrder) {\n\t\t\tpaint(g, element);\n\t\t}\n\t}", "private void draw() {\n frames++;\n MainFrame.singleton().draw();\n }", "@Override public void paintComponent(Graphics g) {\n super.paintComponent(g);\n g.drawImage(board, 0, 0, null);\n \n //draw currently placed ship\n if(currentlyPlacedShip != null)\n g.drawImage(imageMap.get(currentlyPlacedShip),\n mousePosition.getX()*40, mousePosition.getY()*40, null);\n \n //draw ships and shots\n if(shotsBoard != null && shipsBoard != null) {\n for(int i = 0; i != 10; ++i)\n for(int j = 0; j != 10; ++j) {\n if(shipsBoard[i][j] != null)\n g.drawImage(imageMap.get(shipsBoard[i][j]), i*40, j*40, null);\n if(shotsBoard[i][j] == ShotField.HIT)\n g.drawImage(hit, i*40, j*40, null);\n if(shotsBoard[i][j] == ShotField.MISHIT)\n g.drawImage(mishit, i*40, j*40, null);\n }\n }\n }", "public void draw(Graphics g) {\n for (Ghost ghost: ghostList) {\n ghost.draw(g);\n }\n }", "public void draw() {\n //Grey background, which removes the tails of the moving elements\n background(0, 0, 0);\n //Running the update function in the environment class, updating the positions of stuff in environment\n //update function is a collection of the methods needing to be updated\n if(stateOfProgram == 0) { startTheProgram.update(); }\n if(stateOfProgram == 1) {\n theEnvironment.update();\n //update function is a collection of the methods needing to be updated\n //Running the update function in the Population class, updating the positions and states of the rabbits.\n entitiesOfRabbits.update();\n entitiesOfGrass.update();\n entitiesOfFoxes.update();\n\n entitiesOfRabbits.display();\n entitiesOfGrass.display();\n entitiesOfFoxes.display();\n openGraph.update();\n }\n }", "@Override\n\tpublic void render(Graphics g) {\t\n\t\tg.drawImage(Images.player, (int)x, (int)y, null);\n\t}" ]
[ "0.83027697", "0.79937464", "0.7349116", "0.72533584", "0.72083956", "0.7169849", "0.71517175", "0.6999607", "0.6928163", "0.6901576", "0.69004905", "0.68860674", "0.68825686", "0.68779844", "0.6819272", "0.6760946", "0.673378", "0.6718626", "0.6716919", "0.6714916", "0.6671824", "0.6652875", "0.66510683", "0.66498345", "0.6619707", "0.66177434", "0.6611518", "0.6611235", "0.66091275", "0.65988415", "0.65811515", "0.6569199", "0.6550781", "0.6547498", "0.6544069", "0.65394527", "0.65355796", "0.6529975", "0.65281713", "0.6523418", "0.6504863", "0.6502745", "0.6488394", "0.6478351", "0.64640546", "0.64637905", "0.64568585", "0.6452105", "0.6436369", "0.6428177", "0.6419412", "0.6419045", "0.6418517", "0.6414246", "0.6410307", "0.639802", "0.6389884", "0.6388838", "0.6382183", "0.63811874", "0.6380949", "0.6373557", "0.6365759", "0.6348068", "0.6347647", "0.6339456", "0.6333829", "0.63324964", "0.63268393", "0.63255984", "0.6314803", "0.6298801", "0.62880033", "0.62837386", "0.62830305", "0.62780976", "0.62721294", "0.62619096", "0.62605053", "0.6260424", "0.6256822", "0.62543756", "0.6245984", "0.62388164", "0.6238003", "0.623727", "0.62364835", "0.623195", "0.6216452", "0.621412", "0.6213757", "0.62092996", "0.62092996", "0.62092996", "0.62081736", "0.6207273", "0.620398", "0.62037545", "0.62020123", "0.6197718", "0.6195536" ]
0.0
-1
Writes the currents game stats to a binary file
public void WiriteToBinary() throws IOException { DataOutputStream Output = new DataOutputStream (new FileOutputStream("GameProgress.dat", true)); //*************************************information to send using smtp Output.write(pl.xCoord); Output.write(pl.yCoord); Output.write(pl.NumRockets); Output.write(pl.NumBullets); Output.write(pl.Health); Output.write(DestroyedEnemies); Output.write(RunAwayEnemies); for (int i = 0 ; i < EnemyList.size(); i++ ) { Output.write(EnemyList.get(i).xCoord); Output.write(EnemyList.get(i).xCoord); Output.write(EnemyList.get(i).Health); } Output.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void saveStats() {\r\n\t\tif(Main.optionsCheckbox.getState()) FileUtils.exportGameOptions();\r\n\t\t\r\n\t\tif(Main.isFourHandedTeams) {\r\n\t\t\tif(Main.team1Checkbox.getState()) FileUtils.exportTeamFile(Main.teamOne);\r\n\t\t\tif(Main.team2Checkbox.getState()) FileUtils.exportTeamFile(Main.teamTwo);\r\n\t\t\tif(Main.teamPreviousCheckbox.getState()) FileUtils.exportTeamFile(Main.teamPrevious);\r\n\t\t}\r\n\t\t\r\n\t\tif(Main.isFourHandedSingle) {\r\n\t\t\tif(Main.player1Checkbox.getState()) FileUtils.exportPlayerFile(Main.playerOne);\r\n\t\t\tif(Main.player2Checkbox.getState()) FileUtils.exportPlayerFile(Main.playerTwo);\r\n\t\t\tif(Main.player3Checkbox.getState()) FileUtils.exportPlayerFile(Main.playerThree);\r\n\t\t\tif(Main.player4Checkbox.getState()) FileUtils.exportPlayerFile(Main.playerFour);\r\n\t\t\tif(Main.playerPreviousCheckbox.getState()) FileUtils.exportPlayerFile(Main.playerPrevious);\r\n\t\t}\r\n\t\t\r\n\t\tif(Main.isThreeHanded) {\r\n\t\t\tif(Main.player1Checkbox.getState()) FileUtils.exportPlayerFile(Main.playerOne);\r\n\t\t\tif(Main.player2Checkbox.getState()) FileUtils.exportPlayerFile(Main.playerTwo);\r\n\t\t\tif(Main.player3Checkbox.getState()) FileUtils.exportPlayerFile(Main.playerThree);\r\n\t\t\tif(Main.playerPreviousCheckbox.getState()) FileUtils.exportPlayerFile(Main.playerPrevious);\r\n\t\t}\r\n\t}", "public static void save(){\n\t\ttry{\n\t\t\tFile f=new File(Constants.PATH+\"\\\\InitializeData\\\\battlesavefile.txt\");\n\t\t\tPrintWriter pw=new PrintWriter(f);\n\t\t\tpw.println(turn);\n\t\t\tpw.println(opponent.toString());\n\t\t\tfor(Unit u:punits){\n\t\t\t\tpw.println(u.toString());\n\t\t\t}\n\t\t\tpw.println(\"End Player Units\");\n\t\t\tfor(Unit u:ounits){\n\t\t\t\tpw.println(u.toString());\n\t\t\t}\n\t\t\tpw.println(\"End Opponent Units\");\n\t\t\tpw.println(priorities);\n\t\t\tpw.println(Arrays.asList(xpgains));\n\t\t\tpw.println(spikesplaced+\" \"+numpaydays+\" \"+activeindex+\" \"+activeunit.getID()+\" \"+weather+\" \"+weatherturn);\n\t\t\tpw.println(bfmaker.toString());\n\t\t\tpw.close();\n\t\t}catch(Exception e){e.printStackTrace();}\n\t}", "private void reportToFile() {\n try {\n fileWriter = new FileWriter(\"GameStats.txt\");\n fileWriter.write(reportContent);\n fileWriter.close();\n }\n catch (IOException ioe) {\n System.err.println(\"IO Exception thrown while trying to write to file GameStats.txt\");\n }\n }", "private void updateFile() {\n\t\tPrintWriter outfile;\n\t\ttry {\n\t\t\toutfile = new PrintWriter(new BufferedWriter(new FileWriter(\"stats.txt\")));\n\t\t\toutfile.println(\"15\"); // this is the number\n\t\t\tfor (Integer i : storeInfo) {\n\t\t\t\toutfile.println(i); // we overwrite the existing files\n\t\t\t}\n\t\t\tfor (String s : charBought) {\n\t\t\t\toutfile.println(s); // overwrite the character\n\t\t\t}\n\t\t\tfor (String s : miscBought) {\n\t\t\t\toutfile.println(s);\n\t\t\t}\n\t\t\toutfile.close();\n\t\t}\n\t\tcatch (IOException ex) {\n\t\t\tSystem.out.println(ex);\n\t\t}\n\t}", "private void writeStatsToFile() {\n\t\tString fileName = \"TypeaheadStats.dat\";\n\t\tString contents = \"Typeahead_Tasks,Index_Hits,Hit_Ratio,Avg_Time,Suffix_Time,Pruning\\n\";\n\t\tcontents += numOfSearchTasks + \n\t\t\t\t\",\" + numOfIndexHits + \n\t\t\t\t\",\" + 1.0 * numOfIndexHits / numOfSearchTasks + \n\t\t\t\t\",\" + totalTime / numOfSearchTasks +\n\t\t\t\t\",\" + suffixTreeTime / numOfSearchTasks + \n\t\t\t\t\",\" + pruningPercentage / numOfSearchTasks;\n\t\tFileManager.writeToFile(fileName, contents);\n\t}", "private void saveScore() {\n try {\n PrintWriter writer = new PrintWriter(new FileOutputStream(new File(Const.SCORE_FILE), true));\n writer.println(this.player.getName() + \":\" + this.player.getGold() + \":\" + this.player.getStrength());\n writer.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "public void save() {\n\t\ttry {\n\t\t\t// use buffering\n\t\t\tOutputStream file = new FileOutputStream(\"games.txt\");\n\t\t\tOutputStream buffer = new BufferedOutputStream(file);\n\t\t\tObjectOutput output = new ObjectOutputStream(buffer);\n\t\t\ttry {\n\t\t\t\tif (gameOver) {\n\t\t\t\t\t//notify no need to save completed game\n\t\t\t\t} else {\n\t\t\t\t\tgames.add(this);\n\t\t\t\t\toutput.writeObject(games);\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\toutput.close();\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Save not successful\");\n\t\t}\n\t}", "public void saveGame(DataOutputStream s) throws IOException {\n s.writeUTF(level.toString());\n s.writeUTF(level.getName());\n s.writeInt(lives);\n s.writeInt(points);\n s.writeInt(wonLevels);\n pacman.writeEntity(s);\n s.writeInt(entities.size());\n for (GameEntity entity : entities)\n entity.writeEntity(s);\n }", "static void savePlayerData() throws IOException{\n\t\t/*\n\t\t\tFile playerData = new File(\"Players/\" + Player.getName() +\".txt\");\n\t\t\tif (!playerData.exists()) {\n\t\t\t\tplayerData.createNewFile(); \n\t\t\t}\n\t\tObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(\"Players/\" + Player.getName() +\".txt\"));\n\t\toos.writeObject(Player.class);\n\t\toos.close();\n\t\t*/\n\t\t\n\t\tString[] player = Player.getInfoAsStringArray();\n\t\tjava.io.File playerData = new java.io.File(\"Players/\" + player[0] +\".txt\");\n\t\tif (!playerData.exists()){\n\t\t\tplayerData.createNewFile();\n\t\t}\n\t\tjava.io.PrintWriter writer = new java.io.PrintWriter(playerData);\n\t\t//[0] Name, \n\t\twriter.println(\"# Name\");\n\t\twriter.println(player[0]);\n\t\t//[1] Level, \n\t\twriter.println(\"# Level\");\n\t\twriter.println(player[1]);\n\t\t//[2] getRoleAsInt(),\n\t\twriter.println(\"# Role/Class\");\n\t\twriter.println(player[2]);\n\t\t//[3] exp,\n\t\twriter.println(\"# Exp\");\n\t\twriter.println(player[3]);\n\t\t//[4] nextLevelAt,\n\t\twriter.println(\"# Exp Required for Next Level Up\");\n\t\twriter.println(player[4]);\n\t\t//[5] health,\n\t\twriter.println(\"# Current Health\");\n\t\twriter.println(player[5]);\n\t\t//[6] maxHealth,\n\t\twriter.println(\"# Max Health\");\n\t\twriter.println(player[6]);\n\t\t//[7] intelligence,\n\t\twriter.println(\"# Intelligence\");\n\t\twriter.println(player[7]);\n\t\t//[8] dexterity,\n\t\twriter.println(\"# Dexterity\");\n\t\twriter.println(player[8]);\n\t\t//[9] strength,\n\t\twriter.println(\"# Strength\");\n\t\twriter.println(player[9]);\n\t\t//[10] speed,\n\t\twriter.println(\"# Speed\");\n\t\twriter.println(player[10]);\n\t\t//[11] protection,\n\t\twriter.println(\"# Protection\");\n\t\twriter.println(player[11]);\n\t\t//[12] accuracy,\n\t\twriter.println(\"# Accuracy\");\n\t\twriter.println(player[12]);\n\t\t//[13] dodge,\n\t\twriter.println(\"# Dodge\");\n\t\twriter.println(player[13]);\n\t\t//[14] weaponCode,\n\t\twriter.println(\"# Weapon's Code\");\n\t\twriter.println(player[14]);\n\t\t//[15] armorCode,\n\t\twriter.println(\"# Armor's Code\");\n\t\twriter.println(player[15]);\n\t\t//[16] Gold,\n\t\twriter.println(\"# Gold\");\n\t\twriter.println(player[16]);\n\t\twriter.close();\n\t\t\n\t}", "@Override\n\tpublic boolean writeData(File file) {\n\n Collection<SoccerPlayer> soccerPlayers = stats.values();\n\n\n\n try {\n\n PrintWriter writer = new PrintWriter(file);\n\n for (SoccerPlayer sp : soccerPlayers) {\n\n writer.println(logString(sp.getFirstName()));\n writer.println(logString(sp.getLastName()));\n writer.println(logString(sp.getTeamName()));\n writer.println(logString(sp.getUniform()+\"\"));\n writer.println(logString(sp.getGoals() + \"\"));\n writer.println(logString(sp.getAssists() + \"\"));\n writer.println(logString(sp.getShots() + \"\"));\n writer.println(logString(sp.getSaves() + \"\"));\n writer.println(logString(sp.getFouls() + \"\"));\n writer.println(logString(sp.getYellowCards() + \"\"));\n writer.println(logString(sp.getRedCards() + \"\"));\n\n }\n\n writer.close();\n\n return true;\n\n }\n\n catch(java.io.FileNotFoundException ex) {\n\n return false;\n }\n\t}", "public void save() {\n\t\tlog.log(\"Attempting to save...\");\n\t\tPath spath = Paths.get(getFullSavePath());\n\t\tPath cpath = Paths.get(getFullSavePath() + \"units/\");\n\t\ttry {\n\t\t\tif(!Files.exists(spath))\n\t\t\t\tFiles.createDirectory(spath);\n\t\t\tif(!Files.exists(cpath))\n\t\t\t\tFiles.createDirectory(cpath);\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tlog.log(\"Save failed.\");\n\t\t\treturn;\n\t\t}\n\n\t\tFile[] files = new File(cpath.toString()).listFiles();\n\t\tfor(File f : files) {\n\t\t\tf.delete();\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tBufferedWriter mfestWriter = new BufferedWriter(new FileWriter(getFullSavePath() + \"progress.txt\"));\n\t\t\tmfestWriter.write(name);\n\t\t\tmfestWriter.close();\n\t\t\tfor(MapCharacter mc : getFriendlies()) {\n\t\t\t\tBufferedWriter charWriter = new BufferedWriter(new FileWriter(getFullSavePath() + \"units/\"\n\t\t\t\t\t\t+ mc.getEnclosed().getDirName()));\n\t\t\t\tcharWriter.write(mc.getEnclosed().save());\n\t\t\t\tcharWriter.close();\n\t\t\t}\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tlog.log(\"Save failed.\");\n\t\t\treturn;\n\t\t}\n\t\tlog.log(\"Game saved.\");\n\t}", "private void saveInFile() {\n try {\n FileOutputStream fOut = openFileOutput(FILENAME,\n Context.MODE_PRIVATE);\n\n OutputStreamWriter writer = new OutputStreamWriter(fOut);\n Gson gson = new Gson();\n gson.toJson(counters, writer);\n writer.flush();\n\n fOut.close();\n\n } catch (FileNotFoundException e) {\n throw new RuntimeException();\n } catch (IOException e) {\n throw new RuntimeException();\n }\n }", "private void writeToFile() {\n boolean flag = true;\n int expectedPacket = (lastPacket)? sequenceNo: Constants.WINDOW_SIZE;\n for (int i = 0; i < expectedPacket; i++) {\n if(!receivedPacketList.containsKey(i)) {\n flag = false;\n }\n }\n if (flag) {\n System.out.println(\"Time: \" + System.currentTimeMillis() + \"\\t\" + \"Write to file Possible\");\n try (BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(fileSavePath, true))) {\n for (int i = 0; i < receivedPacketList.size(); i++) {\n //System.out.println(new String(receivedPacketList.get(i)));\n stream.write(receivedPacketList.get(i));\n }\n receivedPacketList.clear();\n stream.close();\n } catch (FileNotFoundException ex) {\n \n } catch (IOException ex) {\n \n }\n receivedPacketList.clear();\n expectedList.clear();\n }\n }", "public void saveGame(String fileName){\n Gson gson = new Gson();\n String userJson = gson.toJson(player);\n\n try(Writer w = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(fileName), \"UTF-8\"))) {\n w.write(userJson);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void save(){\n try{\n Date date = new Date();\n \n PrintWriter writer = new PrintWriter(\"data.MBM\", \"UTF-8\");\n \n writer.println(\"version:\"+MBMDriver.version);\n writer.println(\"numworlds:\" + worlds.size());\n writer.println(\"lastclosed:\" + date.toString());\n writer.println(\"outDir:\"+outputDir.toPath());\n \n for(int i = 0; i < worlds.size(); i++){\n \n writer.println(\"MBMWORLD:\"+worlds.get(i).getWorldFile().getName()+\":\"+worlds.get(i).getName()+\":\"+worlds.get(i).getWorldFile().toPath()+\":\"+worlds.get(i).getLastBackupDate());\n }\n \n writer.close();\n }catch(FileNotFoundException e){\n System.out.println(\"ERROR: Failed to Find File\");\n }catch(UnsupportedEncodingException e){\n System.out.println(\"ERROR: Unsupported Encoding Exception\");\n }\n }", "public void saveGame(){\n updateProperties();\n try {\n output = new FileOutputStream(fileName);\n properties.store(output, null); //saving properties to file\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO SAVE GAME ---\");\n e.printStackTrace();\n } finally {\n if (output != null) {\n try {\n output.close();\n System.out.println(\"--- GAME SAVED ---\");\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO CLOSE OUTPUT ---\");\n e.printStackTrace();\n }\n }\n }\n }", "public static void saveBoxScore(){\n Engine engine = Utility.getEngine();\n ArrayList<Player> homePlayers = engine.getHomePlayers();\n ArrayList<Player> awayPlayers = engine.getAwayPlayers();\n ArrayList<String> output = new ArrayList<String>();\n output.add(\"Home team\");\n for(Player player : homePlayers){\n Player upToDatePlayer = Utility.getPlayer(player);\n output.add(upToDatePlayer.toString());\n }\n\n output.add(\"Away team\");\n for(Player player : awayPlayers){\n Player upToDatePlayer = Utility.getPlayer(player);\n output.add(upToDatePlayer.toString());\n }\n\n try {\n Path path = Paths.get(Constants.OUTPUT_FILE_PATH);\n Files.write(path,output,StandardCharsets.UTF_8);\n } catch (Exception e){\n System.out.println(\"Exception: \" + e.toString());\n }\n\n System.exit(0);\n }", "public void updateScoreFile() {\n try {\n outputStream = new ObjectOutputStream(new FileOutputStream(HIGHSCORE_FILE));\n outputStream.writeObject(scores);\n } catch (FileNotFoundException e) {\n } catch (IOException e) {\n } finally {\n try {\n if (outputStream != null) {\n outputStream.flush();\n outputStream.close();\n }\n } catch (IOException e) {\n }\n }\n }", "public void save(){\n Player temp = Arena.CUR_PLAYER;\n try{\n FileOutputStream outputFile = new FileOutputStream(\"./data.sec\");\n ObjectOutputStream objectOut = new ObjectOutputStream(outputFile);\n objectOut.writeObject(temp);\n objectOut.close();\n outputFile.close();\n }\n catch(FileNotFoundException e){\n System.out.print(\"Cannot create a file at that location\");\n }\n catch(SecurityException e){\n System.out.print(\"Permission Denied!\");\n }\n catch(IOException e){\n System.out.println(\"Error 203\");\n } \n }", "void saveToFile() {\n\t\ttry {\n\t\t\tFile directory = GameApplication.getInstance().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS);\n\t\t\tFile target = new File(directory, FILE_NAME);\n\t\t\tif (!target.exists()) {\n\t\t\t\ttarget.createNewFile();\n\t\t\t}\n\t\t\tJsonWriter writer = new JsonWriter(new FileWriter(target));\n\t\t\twriter.setIndent(\" \");\n\t\t\twriter.beginArray();\n\t\t\tfor (Scoreboard scoreboard : scoreboards.values()) {\n\t\t\t\twriteScoreboard(writer, scoreboard);\n\t\t\t}\n\t\t\twriter.endArray();\n\t\t\twriter.flush();\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void printDataToFile(){\n\ttry {\n\t File file = new File(\"media/gameOutput.txt\");\n \n\t // if file doesnt exists, then create it\n\t if (!file.exists()) {\n\t\tfile.createNewFile();\n\t }\n \n\t FileWriter fw = new FileWriter(file.getAbsoluteFile());\n\t BufferedWriter bw = new BufferedWriter(fw);\n\t bw.write(printString);\n\t bw.close();\n\t} catch (IOException e) {\n\t e.printStackTrace();\n\t}\n }", "public void saveGame() {\r\n\t\t//separator used by system\r\n\t\tString separator = System.getProperty(\"file.separator\");\r\n\t\t//path to where files will be saved\r\n\t\tString path = System.getProperty(\"user.dir\") + separator + \"src\" + separator + \"GameFiles\" + separator;\r\n\r\n\t\ttry {\r\n\r\n\t\t\t//Save the world objects\r\n\t\t\tString world_objects_name = EnvironmentVariables.getTitle() + \"WorldObjects\";\r\n\t\t\t//create a new file with name given by user with added text for identification\r\n\t\t\tFile world_objects_file = new File(path + world_objects_name + \".txt\");\r\n\t\t\tFileOutputStream f_world_objects = new FileOutputStream(world_objects_file);\r\n\t\t\tObjectOutputStream o_world_objects = new ObjectOutputStream(f_world_objects);\r\n\r\n\t\t\t//loop through list and write each object to file\r\n\t\t\tfor(GameObject obj: EnvironmentVariables.getWorldObjects()) {\r\n\t\t\t\to_world_objects.writeObject(obj);\r\n\t\t\t}\r\n\r\n\t\t\to_world_objects.flush();\r\n\t\t\to_world_objects.close();\r\n\t\t\tf_world_objects.flush();\r\n\t\t\tf_world_objects.close();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//Save terrain is done the same ass world objects but we create a new file \r\n\t\t\t//with different added text\r\n\t\t\tString terrain_name = EnvironmentVariables.getTitle() + \"Terrain\";\r\n\t\t\tFile terrain_file = new File(path + terrain_name + \".txt\");\r\n\t\t\tFileOutputStream f_terrain = new FileOutputStream(terrain_file);\r\n\t\t\tObjectOutputStream o_terrain = new ObjectOutputStream(f_terrain);\r\n\r\n\t\t\tfor(GameObject obj: EnvironmentVariables.getTerrain()) {\r\n\t\t\t\to_terrain.writeObject(obj);\r\n\t\t\t}\r\n\r\n\t\t\to_terrain.flush();\r\n\t\t\to_terrain.close();\r\n\t\t\tf_terrain.flush();\r\n\t\t\tf_terrain.close();\r\n\t\t\t\r\n\t\t\t//Save main player, given own file but just a single object\r\n\t\t\tString main_player_name = EnvironmentVariables.getTitle() + \"MainPlayer\";\r\n\t\t\tFile main_player_file = new File(path + main_player_name + \".txt\");\r\n\t\t\tFileOutputStream f_main_player = new FileOutputStream(main_player_file);\r\n\t\t\tObjectOutputStream o_main_player = new ObjectOutputStream(f_main_player);\r\n\r\n\t\t\to_main_player.writeObject(EnvironmentVariables.getMainPlayer());\r\n\r\n\t\t\to_main_player.flush();\r\n\t\t\to_main_player.close();\r\n\t\t\tf_main_player.flush();\r\n\t\t\tf_main_player.close();\r\n\t\t\t\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tSystem.out.println(\"File not found\");\r\n\t\t}\r\n\t\tcatch (IOException e) {\r\n\t\t\tSystem.out.println(\"Error initializing stream\");\r\n\t\t} \r\n\t\t\r\n\t\t//saving the environment variables\r\n\t\ttry {\r\n\t\t\tString env_name = EnvironmentVariables.getTitle() + \"EnvVariables\";\r\n\t\t\tFile env_file = new File(path + env_name + \".txt\");\r\n\t\t\t\r\n\t\t\tif(!env_file.exists()) {\r\n\t\t\t\tenv_file.createNewFile();\r\n\t\t }\r\n\t\t\t \r\n\t\t\t//FileWriter fw = new FileWriter(env_file);\r\n\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(env_file));\r\n\t\t\t//write each variable to a new line as a string\r\n\t\t\tbw.write(EnvironmentVariables.getTitle()); bw.newLine();\r\n\t\t\tbw.write(Float.toString(EnvironmentVariables.getWidth())); bw.newLine();\r\n\t\t\tbw.write(Float.toString(EnvironmentVariables.getHeight())); bw.newLine();\r\n\t\t\tbw.write(EnvironmentVariables.getPlanet()); bw.newLine();\r\n\t\t\tbw.write(Float.toString(EnvironmentVariables.getMass())); bw.newLine();\r\n\t\t\tbw.write(Float.toString(EnvironmentVariables.getRadius())); bw.newLine();\r\n\t\t\tbw.write(Float.toString(EnvironmentVariables.getAirDensity())); bw.newLine();\r\n\t\t\tbw.write(Float.toString(EnvironmentVariables.getMeter())); bw.newLine();\r\n\r\n\t\t\t\r\n\t\t\t//bw.flush();\r\n\t\t\tbw.close();\r\n\t\t\t\r\n\t\t}catch (IOException e) {\r\n\t\t\tSystem.out.println(\"Error initializing stream\");\r\n\t\t}\r\n\t\t\r\n\t\tEnvironmentVariables.getTerrain().clear();\r\n\t\tEnvironmentVariables.getWorldObjects().clear();\r\n\t}", "public static void saveDataToFile() {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy MM dd, HH mm\");\n Date date = new Date();\n String fileName= dateFormat.format(date)+\".txt\";\n\n try {\n PrintWriter writer = new PrintWriter(fileName, \"UTF-8\");\n writer.print(\"Wins: \");\n writer.println(wins);\n writer.print(\"Draws: \");\n writer.println(draws);\n writer.print(\"Losses: \");\n writer.println(loses);\n writer.close();\n System.out.println(\"File Write Successful\");\n } catch (IOException e) {\n\n }\n\n\n }", "public void save() {\n final JFileChooser fileChooser =\n new JFileChooser(System.getProperty(\"user.dir\"));\n try {\n fileChooser.setSelectedFile(new File(\"save.ser\"));\n int saveFile = fileChooser.showSaveDialog(GameFrame.this);\n\n if (saveFile == JFileChooser.APPROVE_OPTION) {\n File saveGame = fileChooser.getSelectedFile();\n FileOutputStream fileOut = new FileOutputStream(saveGame);\n ObjectOutputStream objOut = new ObjectOutputStream(fileOut);\n objOut.writeObject(world);\n objOut.close();\n fileOut.close();\n System.out.println(\"Game saved.\");\n } else {\n return;\n }\n } catch (IOException i) {\n i.printStackTrace();\n }\n\n }", "@Override\n\tpublic void savePlayerData(OutputStream os) {\n\t\t\n\t}", "@Override\n\tpublic void savePlayerData(OutputStream os) {\n\n\t}", "public void endGame(){\r\n\t\tupdateRecord();\r\n\t\tgameStats.writeToFile();\r\n\t\tstatisticsList = gameStats.makeArrayList();\r\n\t\tgameStats.writeListToFile(statisticsList);\r\n\t}", "public void writeToTxtStats() throws IOException{\n\t\tPath fileName = Path.of(\"stats.out\");\n \n\t\tString outputText = \"Day \" + day + \", Spring \" + inventory.get(0).getStock() + \", Egg \" + inventory.get(1).getStock() \n + \", Sausage \" + inventory.get(2).getStock() + \", Jelly \" + inventory.get(3).getStock()\n\t+ \", Pastry \" + inventory.get(4).getStock() + \", Outages \" + dailyDisruptions+ \"\";\n\t\toutputText = outputText + \"\\n\";\n Files.writeString(fileName, outputText, StandardOpenOption.APPEND);\n\t\t//Day x, Spring x, Egg x, Sausage x, Jelly x, Pastry x, Outages x \\n\n\t}", "private synchronized void sendGameData(PrintWriter stream) {\r\n\t\tstream.println(\"1\");\r\n\t\tstream.println(Integer.toString(XSIZ));\r\n\t\tstream.println(Integer.toString(YSIZ));\r\n\t\tstream.println(Integer.toString(ZOMBIE_BORDER));\r\n\t\tstream.println(Integer.toString(MAX_NR_ZOMBIES));\r\n\t\tstream.println(Integer.toString(SQ_SIZE));\r\n\t\tif(dead){\r\n\t\t\tstream.println(\"true\");\r\n\t\t}else{\r\n\t\t\tstream.println(\"false\");\r\n\t\t}\r\n\t\t\r\n\t\t//planten doorsturen\r\n\t\tsendPlants(stream);\r\n\t\t//zombies doorsturen\r\n\t\tsendZombies(stream);\r\n\r\n\t\tstream.flush();\r\n\t}", "public void saveGame(File fileLocation);", "private void saveHighScore() {\n\n\t\tFileOutputStream os;\n\t\n\t\ttry {\n\t\t boolean exists = (new File(this.getFilesDir() + filename).exists());\n\t\t // Create the file and directories if they do not exist\n\t\t if (!exists) {\n\t\t\tnew File(this.getFilesDir() + \"\").mkdirs();\n\t\t\tnew File(this.getFilesDir() + filename);\n\t\t }\n\t\t // Saving the file\n\t\t os = new FileOutputStream(this.getFilesDir() + filename, false);\n\t\t ObjectOutputStream oos = new ObjectOutputStream(os);\n\t\t oos.writeObject(localScores);\n\t\t oos.close();\n\t\t os.close();\n\t\t} catch (Exception e) {\n\t\t e.printStackTrace();\n\t\t}\n }", "static void writeRanking(ArrayList<PlayerInfo> player){\n\t\ttry{\r\n\t\t\tFileOutputStream fos = new FileOutputStream(\"ranking.dat\");\r\n\t\t\tObjectOutputStream oos = new ObjectOutputStream(fos);\r\n\t\t\toos.writeObject(player);\r\n\t\t\toos.flush();\r\n\t\t\toos.close();\r\n\t\t\tfos.close();\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t//return player;\r\n\t}", "private static void writeStatistics(String name) throws IOException {\n fileWriter = new BufferedWriter(new FileWriter(PATH + \"/uid/\" + name));\n fileWriter.write(\"Number of Nodes total: \" + globalVertexCount);\n fileWriter.newLine();\n fileWriter.write(\"Number of Edges total: \" + globalEdgeCount);\n fileWriter.newLine();\n fileWriter.write(\"######################################\");\n fileWriter.newLine();\n fileWriter.write(\"Nodes counted:\");\n fileWriter.newLine();\n for (Map.Entry<String, Long> entry : counterMapNodes.entrySet()) {\n fileWriter\n .write(entry.getKey().replace(\"_0.csv\", \"\") + \": \" + entry.getValue());\n fileWriter.newLine();\n }\n fileWriter.write(\"######################################\");\n fileWriter.newLine();\n fileWriter.write(\"Edges counted:\");\n fileWriter.newLine();\n for (Map.Entry<String, Long> entry : counterMapEdges.entrySet()) {\n fileWriter\n .write(entry.getKey().replace(\"_0.csv\", \"\") + \": \" + entry.getValue());\n fileWriter.newLine();\n }\n fileWriter.close();\n }", "public void write(DataOutputStream out) throws IOException {\n final HashMap<NetworkIdentitySet, ArrayList<Key>> keysByIdent = Maps.newHashMap();\n for (Key key : mStats.keySet()) {\n ArrayList<Key> keys = keysByIdent.get(key.ident);\n if (keys == null) {\n keys = Lists.newArrayList();\n keysByIdent.put(key.ident, keys);\n }\n keys.add(key);\n }\n\n out.writeInt(FILE_MAGIC);\n out.writeInt(VERSION_UNIFIED_INIT);\n\n out.writeInt(keysByIdent.size());\n for (NetworkIdentitySet ident : keysByIdent.keySet()) {\n final ArrayList<Key> keys = keysByIdent.get(ident);\n ident.writeToStream(out);\n\n out.writeInt(keys.size());\n for (Key key : keys) {\n final NetworkStatsHistory history = mStats.get(key);\n out.writeInt(key.uid);\n out.writeInt(key.set);\n out.writeInt(key.tag);\n history.writeToStream(out);\n }\n }\n\n out.flush();\n }", "public void saveGame(GamePanel gamePanel) throws IOException\r\n\t{\r\n\t\tSystem.out.println(\"Saving your game.\");\r\n\t\ttry\r\n\t\t{\r\n\t\t\tObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(\"Game.ser\"));\r\n\t\t\tos.writeObject(gamePanel);\r\n\t\t\tos.close();\r\n\t\t}\r\n\t\tcatch (IOException ex) \r\n\t\t{\r\n ex.printStackTrace();\r\n }\r\n\t}", "@Override\r\n\tpublic void SavePlayerData() {\r\n\r\n Player player = (Player)Player.getPlayerInstance();\r\n\t\t\r\n\t\tString file = \"PlayerInfo.txt\";\r\n\t\tString playerlifepoint = \"\"+player.getLifePoints();\r\n\t\tString playerArmore = player.getArmorDescription();\r\n\t\ttry{\r\n\t\t\tPrintWriter print = new PrintWriter(file);\r\n\t\t\tprint.println(playerlifepoint);\r\n\t\t\tprint.println(playerArmore);\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch(FileNotFoundException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "private void createSaveData(){\n try {\n File f = new File(filePath, highScores);\n FileWriter output = new FileWriter(f);\n BufferedWriter writer = new BufferedWriter(output);\n\n writer.write(\"0-0-0-0-0\");\n writer.newLine();\n writer.write(\".....-.....-.....-.....-.....\");\n writer.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public static synchronized void save() {\n\n String team_fil = config.Server.serverdata_file_location + \"/teams.ser\";\n String team_backup = config.Server.serverdata_file_location + \"/teams\";\n\n Calendar dato = new GregorianCalendar();\n\n team_backup += dato.get(Calendar.YEAR) + \"-\" + dato.get(Calendar.DAY_OF_MONTH) + \"-\" + dato.get(Calendar.MONTH) + \"-\";\n team_backup += dato.get(Calendar.HOUR) + \"-\" + dato.get(Calendar.MINUTE) + \".ser\";\n\n admin.logging.globalserverMsg(\"Saving team data to file.\");\n\n try {\n FileOutputStream fil = new FileOutputStream(team_fil);\n FileOutputStream fil_backup = new FileOutputStream(team_backup);\n\n //Skriv til teams.txt\n ObjectOutputStream out = new ObjectOutputStream(fil);\n out.writeObject(team_list);\n out.flush();\n out.close();\n fil.close();\n\n //Skriv til backup fil.\n out = new ObjectOutputStream(fil_backup);\n out.writeObject(team_list);\n out.flush();\n out.close();\n fil.close();\n } catch (Exception e) {\n e.printStackTrace();\n admin.logging.globalserverMsg(\"Error saving team data to file.\");\n }\n }", "public void writeLog(){\n\t\ttry\n\t\t{\n\t\t\tFileWriter writer = new FileWriter(\"toptrumps.log\");\n\t\t\twriter.write(log);\n\t\t\twriter.close();\n\t\t\tSystem.out.println(\"log saved to toptrumps.log\");\n\t\t\t\n\t\t\tDataBaseCon.gameInfo(winName, countRounds, roundWins);\n\t\t\tDataBaseCon.numGames();\n\t\t\tDataBaseCon.humanWins();\n\t\t\tDataBaseCon.aIWins();\n\t\t\tDataBaseCon.avgDraws();\n\t\t\tDataBaseCon.maxDraws();\n\t\t\t\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void saveGameState(File saveName);", "public void saveGame(File f) {\n savegame = new SaveGame(f, chessboard, gamelog, colorsTurn);\n System.out.println(\"Gamed Saved.\");\n\n }", "private void writeToFile(){\r\n File file = new File(\"leaderboard.txt\");\r\n\r\n try {\r\n FileWriter fr = new FileWriter(file, true);\r\n BufferedWriter br = new BufferedWriter(fr);\r\n for(Player player : this.sortedPlayers){\r\n br.write(player.toString());\r\n br.write(\"\\n\");\r\n }\r\n br.close();\r\n fr.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n }", "public static void save(Game game, String filename) {\n\t\ttry {\n\t\t\t/*\n\t\t\t * Setting up the xml writer\n\t\t\t */\n\t\t\t StringWriter stringWriter = new StringWriter();\n\n\t XMLOutputFactory xMLOutputFactory = XMLOutputFactory.newInstance();\n\t XMLStreamWriter xMLStreamWriter = xMLOutputFactory.createXMLStreamWriter(stringWriter);\n\n\t //Game node\n\t xMLStreamWriter.writeStartDocument();\n\t xMLStreamWriter.writeStartElement(\"Game\");\n\n\t\t\tWorld world = game.getWorld();\n\n\t\t\txMLStreamWriter.writeStartElement(\"TorchLight\");\n\t\t\txMLStreamWriter.writeCharacters(game.getTorchLight()+\"\");\n\t\t\txMLStreamWriter.writeEndElement();\n\n\t\t\t//World node\n\t\t\txMLStreamWriter.writeStartElement(\"World\");\n\n\t\t\t/*\n\t\t\t * Writing the dimensions of the game (i.e its width and height)\n\t\t\t */\n\t\t\twriteWorldDimension(xMLStreamWriter, world);\n\n\t\t\t/*\n\t\t\t * Writing the content of every room in the game\n\t\t\t */\n\t\t\tfor(int row = 0; row < world.getHeight(); row++) {\n\t\t\t\tfor(int col = 0; col < world.getWidth(); col++) {\n\t\t\t\t\twriteRoom(xMLStreamWriter, world, row, col);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Closing the tags\n\t\t\t */\n\t xMLStreamWriter.writeEndElement();\n\t xMLStreamWriter.writeEndElement();\n\n\t xMLStreamWriter.writeEndDocument();\n\n\t xMLStreamWriter.flush();\n\t xMLStreamWriter.close();\n\n\t String xmlString = stringWriter.getBuffer().toString();\n\n\t stringWriter.close();\n\t /*\n\t * Writing the content of the game in xml format\n\t */\n\t try (PrintStream out = new PrintStream(new FileOutputStream(filename))) {\n\t \t out.print(xmlString);\n\t \t out.close();\n\t \t}\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void saveGame(String fileName){\n try {\n File file1 = new File(fileName);\n FileOutputStream fileOutputStream = new FileOutputStream(file1);\n ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);\n objectOutputStream.writeObject(this);\n }catch (Exception e){\n System.err.println(\"Error when saving file\");\n }\n }", "public void writeScores() throws IOException {\n if (this.list.isPresent() && this.toSave) {\n try (DataOutputStream out = new DataOutputStream(new FileOutputStream(this.file))) {\n for (final Pair<String, Integer> p : this.list.get()) {\n out.writeUTF(p.getX());\n out.writeInt(p.getY().intValue());\n }\n this.toSave = false;\n } catch (IOException e) {\n System.out.println(\"IOException on writing scores\");\n }\n }\n\n }", "public void write() {\n\t\tint xDist, yDist;\r\n\t\ttry {\r\n\t\t\tif (Pipes.getPipes().get(0).getX() - b.getX() < 0) { // check if pipes are behind bird\r\n\t\t\t\txDist = Pipes.getPipes().get(1).getX() - b.getX();\r\n\t\t\t\tyDist = Pipes.getPipes().get(1).getY() - b.getY() + Pipes.height;\r\n\t\t\t} else {\r\n\t\t\t\txDist = Pipes.getPipes().get(0).getX() - b.getX();\r\n\t\t\t\tyDist = Pipes.getPipes().get(0).getY() - b.getY() + Pipes.height;\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\txDist = -6969;\r\n\t\t\tyDist = -6969;\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(\"Pipe out of bounds\");\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tFile file = new File(\"DATA.txt\");\r\n\t\t\tFileWriter fr = new FileWriter(file, true);\r\n\t\t\tfr.write(xDist + \",\" + yDist + \",\" + b.getYVel() + \",\" + didJump);\r\n\t\t\tfr.write(System.getProperty(\"line.separator\")); // makes a new line\r\n\t\t\tfr.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Wtrie file error\");\r\n\t\t}\r\n\t}", "public static void SaveAchievements()\n {\n try\n {\n StartSaveAnimation();\n PrintWriter writer = new PrintWriter(achievements_file_name, \"UTF-8\");\n int actualLine = 0, nb_achievements_done = 0;\n while(actualLine<Achievement.NB_ACHIEVEMENTS)\n {\n boolean currentValue = Achievement.achievements_done[actualLine];\n if(currentValue)\n nb_achievements_done++;\n writer.print(Utilities.BoolToInt(currentValue) + \"\\r\\n\");\n actualLine++;\n }\n writer.close();\n Achievement.nb_achievements_done = nb_achievements_done;\n }\n catch(Exception e) { System.out.println(\"Problem writing in the file \" + achievements_file_name + \".\"); }\n }", "public void writeScores(){\r\n // TODO: Write the high scores data to the file name indicated\r\n // TODO: by Settings.highScoresFileName.\r\n \tFile outFile=new File(Settings.highScoresFileName);\r\n \tPrintWriter out=null;\r\n \ttry{\r\n \t\tout=new PrintWriter(outFile);\r\n \t\tfor(int i=0; i<Settings.numScores; i++){\r\n \t\t\tout.println(scores[i]+\" \"+names[i]);\r\n \t\t}\r\n \t}catch(Exception e){} \t\r\n \tfinally{\r\n \t\tif(out!=null) out.close();\r\n }\r\n }", "public void saveGameData(int score, int tiempo, String replay_path){\n connect();\n\n try {\n doStream.writeUTF(\"END_GAME_DATA\");\n doStream.writeUTF(currentUser.getUserName());\n doStream.writeInt(score);\n doStream.writeInt(tiempo);\n doStream.writeUTF(replay_path);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n disconnect();\n }", "void dumpStats() {\n long wallTimeNanos = totalStopwatch.elapsed(TimeUnit.NANOSECONDS);\n long dbtime = 0;\n for (String name : methodCalls.keySet()) {\n long calls = methodCalls.get(name);\n long time = methodTotalTime.get(name);\n dbtime += time;\n long average = time / calls;\n double proportion = (time + 0.0) / (wallTimeNanos + 0.0);\n log.info(name + \" c:\" + calls + \" r:\" + time + \" a:\" + average + \" p:\" + String.format(\"%.2f\", proportion));\n }\n double dbproportion = (dbtime + 0.0) / (wallTimeNanos + 0.0);\n double hitrate = (hit + 0.0) / (hit + miss + 0.0);\n log.info(\"Cache size:\" + utxoCache.size() + \" hit:\" + hit + \" miss:\" + miss + \" rate:\"\n + String.format(\"%.2f\", hitrate));\n bloom.printStat();\n log.info(\"hasTxOut call:\" + hasCall + \" True:\" + hasTrue + \" False:\" + hasFalse);\n log.info(\"Wall:\" + totalStopwatch + \" percent:\" + String.format(\"%.2f\", dbproportion));\n String stats = db.getProperty(\"leveldb.stats\");\n System.out.println(stats);\n\n }", "public void saveGame(){\n \tsaveOriginator.writeMap(this.map, this.getObjectives(), this.gameState);\n \tsaveGame.saveGame(saveOriginator);\n }", "public void writeScoreToFile(){\n\t\ttry{\n\t\t\tFile file = new File(\"conversation_file.txt\");\n\t\t\tFileWriter f = new FileWriter(file.getAbsoluteFile());\n\t\t\tBufferedWriter b = new BufferedWriter(f);\n\t\t\tif(score > highScore)\n\t\t\t\tb.write(String.valueOf(score));\n\t\t\telse\n\t\t\t\tb.write(String.valueOf(highScore));\n\t\t\tb.close();\n\t\t} catch (IOException e){}\n\t\tSystem.out.println(\"File written, highScore \" + highScore + \" or Score \" + score + \" saved to file.\");\n\t}", "public static void Save(String filename) throws IOException {\n\t\tFileWriter fw=new FileWriter(filename);\r\n\t\tround=A1063307_GUI.round;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tfw.write(\"Round:\"+round+\",Turn:\"+who+\"\\n\");\r\n\t\tint t2=1;\r\n\t\twhile(t2<(linenumber)) {\r\n\t\t\tint zz=0;\r\n\t\t\twhile(zz<5) {\r\n\t\t\t\tif(zz==0) {\t\t\r\n\t\t\t\t\tch[t2].location=ch[t2].location%20;\r\n\t\t\t\t fw.write(Integer.toString(ch[t2].location)+\",\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(zz==1){\r\n\t\t\t\t fw.write(Integer.toString(ch[t2].CHARACTER_NUMBER)+\",\");\r\n\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\telse if(zz==2){\r\n\t\t\t\t\tfw.write(Integer.toString(ch[t2].money)+\",\");\r\n\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t else if(zz==3){\r\n\t\t\t \tfw.write(Integer.toString(ch[t2].status)+\",\");\r\n\t\t\t \r\n\t\t\t \t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tfw.write(ch[t2].IMAGE_FILENAME);\t\t\t\t\r\n\t\t\t\t\t }\r\n\t\t\t\tzz++;\r\n\t\t\t}\r\n\t\t\tfw.write(\"\\n\");\r\n\t\t\tt2++;\r\n\t\t}\r\n\t\tfw.close();\r\n\t\tFileWriter fw1=new FileWriter(\"Land.txt\");\r\n\t\tfw1.write(\"LOCATION_NUMBER, owner\\n\");\r\n\t\tfor(int i=1;i<17;i++) {\r\n\t\t\tfw1.write(Land[i].PLACE_NUMBER+\",\"+Land[i].owner+\"\\n\");\r\n\t\t}\r\n\t\tfw1.close();\r\n\t}", "public void writeDump(File f) {\n\n }", "public void writeVisits() {\n try {\n FileOutputStream fileOut = new FileOutputStream(\"temp/visits.ser\");\n ObjectOutputStream out = new ObjectOutputStream(fileOut);\n out.writeObject(visits);\n out.close();\n fileOut.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public void saveStats() {\n this.saveStats(null);\n }", "@Override\n\tpublic void savePlayerData(OutputStream arg0)\n\t{\n\n\t}", "public static void writePlayerToFile(Player p)\r\n {\r\n try{\r\n //Create an \"players.txt\" file with an ObjectOutputStream\r\n FileOutputStream fileOut = new FileOutputStream(\"players.txt\", true);\r\n ObjectOutputStream objectOut = new ObjectOutputStream(fileOut); \r\n\r\n //Write the Player objetct to the file \r\n objectOut.writeObject(p);\r\n //Close file\r\n objectOut.close();\r\n }catch (IOException ioException) \r\n { \r\n //Output error message \r\n System.out.println(\"Error: The file cannot be created\"); \r\n }//end try\r\n }", "@Override\n\tpublic void savePlayerData(OutputStream arg0) {\n\n\t}", "public void SaveCurrentGame(){\n if(gameStarted == false){ return; }\n recordGame.write(board, timeRuunableThread, level);\n timeRuunableThread.setDrawNumber(false);\n canLoadGame = true;\n // update infoCanvas\n CleanInfoCanvas();\n }", "public void tempSaveToFile() {\n try {\n ObjectOutputStream outputStream = new ObjectOutputStream(\n this.openFileOutput(MenuActivity2048.TEMP_SAVE_FILENAME, MODE_PRIVATE));\n outputStream.writeObject(boardManager);\n outputStream.close();\n } catch (IOException e) {\n Log.e(\"Exception\", \"File write failed: \" + e.toString());\n }\n }", "public void saveAllData()\n {\n \tfor(String s : games.keySet())\n \t{\n \t\tGame g = games.get(s);\n \t\tif(g.saveAllData())\n \t\t{\n \t\t\tSystem.out.println(\"Game '\" + g.getGameName() + \"' saved all data successfully!\");\n \t\t}\n \t\telse\n \t\t{\n \t\t\tSystem.out.println(\"Error when attempting to save data in game '\" + g.getGameName() + \"'!\");\n \t\t}\n \t}\n }", "public String saveGame(String fileName) {\n File file = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);\n File saveFile = new File(file, fileName);\n\n try {\n PrintWriter writer = new PrintWriter(saveFile.getAbsolutePath(), \"UTF-8\");\n writer.println(\"Black: \" + playerBlack.getScore());\n writer.println(\"White: \" + playerWhite.getScore());\n writer.println(\"Board:\");\n\n for (int r = 0; r < Board.MAX_ROW; r++) {\n for (int c = 0; c < Board.MAX_COLUMN; c++) {\n if (boardObject.getSlot(r, c).getColor() == Slot.BLACK) {\n writer.print(\"B \");\n } else if (boardObject.getSlot(r, c).getColor() == Slot.WHITE) {\n writer.print(\"W \");\n } else {\n writer.print(\"O \");\n }\n }\n writer.println();\n }\n\n String nextPlayer = playerWhite.isTurn() ? \"White\" : \"Black\";\n writer.println(\"Next player: \" + nextPlayer);\n\n String humanPlayer = playerWhite.isComputer() ? \"Black\" : \"White\";\n writer.println(\"Human: \" + humanPlayer);\n\n writer.close();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return saveFile.getAbsolutePath();\n }", "void saveData(PrintWriter out, Player player, Computer computer, Object strategy) {\r\n\t\t\r\n\t\tout.println(\"CompGrid:\");\r\n\t\tint[][] saveCompGrid = new int[Computer.computerGrid.length][Computer.computerGrid[0].length];\r\n\t\tfor (int i = 0; i < Computer.computerGrid.length; ++i) {\r\n\t saveCompGrid[i] = new int[Computer.computerGrid[i].length];\r\n\t for (int j = 0; j < saveCompGrid[i].length; ++j) {\r\n\t saveCompGrid[i][j] = Computer.computerGrid[i][j];\r\n\t out.print(saveCompGrid[i][j]);\r\n\t }\r\n\t out.println(\"\");\r\n\t\t}\r\n\t\tif(strategy instanceof HitStrategy)\r\n\t\t\tout.println(\"Computer Score: \"+ ((HitStrategy)strategy).getScore());\r\n\t\telse\r\n\t\t\tout.println(\"Computer Score: \"+ ((HitStrategySalvo)strategy).getScore());\r\n\t\tout.print(\"Computer Sunken ships:\");\r\n\t\tsaveComputerSunkenShips(out);\r\n\t\tout.println(\"Computer ships status: \");\r\n\t\tsaveComputerShipsMap(out);\r\n\t\tout.print(\"Coordinates hit:\");\r\n\t\tsetComputerCoordinatesHit(Computer.coordinatesHit);\r\n\t\tsaveComputerCoordinatesHit(out);\r\n\t\tout.println(\"ShipGrid:\");\r\n\t\tint[][] saveUserGrid = new int[Player.userGrid.length][Player.userGrid[0].length];\r\n\t\tfor (int i = 0; i < Player.userGrid.length; ++i) {\r\n\t saveUserGrid[i] = new int[Player.userGrid[i].length];\r\n\t for (int j = 0; j < saveUserGrid[i].length; ++j) {\r\n\t saveUserGrid[i][j] = Player.userGrid[i][j];\r\n\t out.print(saveUserGrid[i][j]);\r\n\t }\r\n\t out.println(\"\");\r\n\t\t}\r\n\t\tout.println(\"Player Score: \"+computer.getScoreComp());\r\n\t\tout.print(\"Player Sunken ships:\");\r\n\t\tsaveUserSunkenShips(out);\r\n\t\tout.println(\"Player ships status: \");\r\n\t\tsaveUserShipsMap(out);\r\n\t\tout.print(\"Coordinates hit:\");\r\n\t\tsetComputerCoordinatesHit(Computer.coordinatesHit);\r\n\t\tsaveUserCoordinatesHit(out);\t\t\r\n\t}", "private void saveGame(int gameId, String fileName){\n\n }", "public static void writeObject() {\r\n ChunkedCharBuffer buf = new ChunkedCharBuffer();\r\n for (Map.Entry<String, CronJob> entry : getInstance().events.entrySet()) {\r\n CronJob event = entry.getValue();\r\n buf.append(entry.getKey());\r\n buf.append(\"|\");\r\n buf.append(String.valueOf(event.getInterval()));\r\n buf.append(\"|\");\r\n buf.append(String.valueOf(event.getStartTime().getTime()));\r\n buf.append(\"|\");\r\n buf.append(event.getCommandString());\r\n buf.append(\"|\");\r\n buf.append(event.getUser());\r\n buf.append(\"|\");\r\n buf.append(event.getUserService());\r\n buf.append(\"\\n\");\r\n }\r\n if (buf.size() > 0) {\r\n try {\r\n OutputStreamWriter out = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(FILE, false)));\r\n buf.writeTo(out);\r\n out.flush();\r\n out.close();\r\n } catch (Exception e) {\r\n LoggingService.getInstance().serverLog(\"Error writing statistics: \" + e);\r\n }\r\n }\r\n }", "public static void save()\r\n\t{\r\n\r\n\t\ttry {\r\n\t\t\tObjectOutputStream fileOut = new ObjectOutputStream(new FileOutputStream(\"highscores.txt\"));\r\n\t\t\tfileOut.writeObject(hsd);\r\n\t\t\tfileOut.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tJOptionPane.showMessageDialog(null,\"Save File not found\",\"Error\",JOptionPane.ERROR_MESSAGE);\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\tJOptionPane.showMessageDialog(null,\"Unable to save data\",\"Error\",JOptionPane.ERROR_MESSAGE);\r\n\t\t\te.printStackTrace();\r\n\t\t\r\n\t\t}\r\n\r\n\t}", "void saveGame();", "public static void write(final Game game, final String filename) throws IOException {\n\t\tnew File(SAVES_FOLDER).mkdirs();\n\t\tfinal ObjectOutputStream output = new ObjectOutputStream(new FileOutputStream(new File(SAVES_FOLDER + filename)));\n\t\toutput.writeObject(game);\n\t\toutput.close();\n\t}", "public void saveGame(Player player, Computer computer, \r\n\t\t\tObject strategy, String gameMode, String gameType) {\r\n\t\r\n\t\tSystem.out.println(\"writing data in file \"+this.uName);\r\n\t\ttry {\r\n\r\n\t\t\t//gets the total saved files in the folder;\r\n\t\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\"); \r\n\t\t Date date = new Date();\r\n\t\t formatter.format(date);\r\n\t\t FileWriter fw = new FileWriter(folderPath+this.uName+\".txt\", true);\r\n\t\t BufferedWriter bw = new BufferedWriter(fw);\r\n\t\t PrintWriter out = new PrintWriter(bw);\r\n\t\t out.println(\"Created on: \"+date);\r\n\t\t out.println(\"Game Mode: \"+gameMode);\r\n\t\t out.println(\"Game Type: \"+gameType);\r\n\t\t saveData(out, player, computer, strategy);\r\n\t\t out.close();\r\n\t\t}catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}", "public void saveScores(){\n try {\n File f = new File(filePath, highScores);\n FileWriter output = new FileWriter(f);\n BufferedWriter writer = new BufferedWriter(output);\n\n writer.write(topScores.get(0) + \"-\" + topScores.get(1) + \"-\" + topScores.get(2) + \"-\" + topScores.get(3) + \"-\" + topScores.get(4));\n writer.newLine();\n writer.write(topName.get(0) + \"-\" + topName.get(1) + \"-\" + topName.get(2) + \"-\" + topName.get(3) + \"-\" + topName.get(4));\n writer.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void save(PrintWriter pw) {\n\t\tpw.println(color);\n\t\tpw.println(name);\n\t\tpw.println(diceValue);\n\t\tpw.println(diceTossed);\n\t\tfor(int i = 1; i<=4; i++)\n\t\t\tif(hasPawn(i))\n\t\t\t\tpw.println(pawns[i-1].getPosition());\n\t\t\telse\n\t\t\t\tpw.println(0);\n\t}", "public void saveStats(int winnerId, GameActivity gameActivity) {\n Player player0;\n CardSuit trumpSuit;\n ArrayList<Card> playerPile;\n if (gameActivity.modality == 0) {\n player0 = GameMaster.getInstance().getPlayers().get(0);\n if (player0 instanceof PlayerAI){return;}\n trumpSuit = GameTable.getInstance().getTrump();\n } else {\n RemoteGameMaster remoteGameMaster = RemoteGameMaster.getInstance();\n trumpSuit = remoteGameMaster.getTrump().getSuit();\n player0 = remoteGameMaster.getLocalPlayer();\n }\n //update stats only if match is played by a real player\n if(player0 instanceof PlayerAI){return;}\n\n totalPoints += player0.calculatePoints();\n playerPile = player0.getPile();\n if (winnerId == 0) {\n wins++;\n } else if (winnerId == 1) {\n losses++;\n } else {\n draws++;\n }\n analyzePile(playerPile, trumpSuit);\n SharedPreferencePersistence persistance = SharedPreferencePersistence.getInstance(context);\n persistance.saveStatistic(this);\n }", "public void FileWrite(Nimsys nimSys,ArrayList<Player> list)throws IOException{\r\n\t\tOutputStream out = new FileOutputStream(\"players.dat\");\r\n\t\tIterator<Player> aa = list.iterator();\r\n\t\twhile(aa.hasNext()){ //each line includes the information below related to the players\r\n\t\t\tPlayer in = aa.next();\r\n\t\t\tout.write(in.getUserName().getBytes());\r\n\t\t\tout.write(' ');\r\n\t\t\tout.write(in.getSurName().getBytes());\r\n\t\t\tout.write(' ');\r\n\t\t\tout.write(in.getGivenName().getBytes());\r\n\t\t\tout.write(' ');\r\n\t\t\tout.write(String.valueOf(in.getGamePlay()).getBytes());\r\n\t\t\tout.write(' ');\r\n\t\t\tout.write(String.valueOf(in.getWinGame()).getBytes());\r\n\t\t\tout.write(' ');\r\n\t\t\tout.write(String.valueOf(in.getID()).getBytes());\r\n\t\t\tout.write('\\r');\r\n\t\t}\r\n\t}", "public void writeToGameFile(String fileName) {\n\n try {\n DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder docBuilder = docFactory.newDocumentBuilder();\n Document doc = docBuilder.newDocument();\n Element rootElement = doc.createElement(\"Sifeb\");\n doc.appendChild(rootElement);\n Element game = doc.createElement(\"Game\");\n rootElement.appendChild(game);\n\n Element id = doc.createElement(\"Id\");\n id.appendChild(doc.createTextNode(\"001\"));\n game.appendChild(id);\n Element stories = doc.createElement(\"Stories\");\n game.appendChild(stories);\n\n for (int i = 1; i < 10; i++) {\n Element cap1 = doc.createElement(\"story\");\n Element image = doc.createElement(\"Image\");\n image.appendChild(doc.createTextNode(\"Mwheels\"));\n Element text = doc.createElement(\"Text\");\n text.appendChild(doc.createTextNode(\"STEP \" + i + \":\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Donec eu.\"));\n cap1.appendChild(image);\n cap1.appendChild(text);\n stories.appendChild(cap1);\n }\n\n TransformerFactory transformerFactory = TransformerFactory.newInstance();\n Transformer transformer = transformerFactory.newTransformer();\n DOMSource source = new DOMSource(doc);\n File file = new File(SifebUtil.GAME_FILE_DIR + fileName + \".xml\");\n StreamResult result = new StreamResult(file);\n transformer.transform(source, result);\n\n System.out.println(\"File saved!\");\n\n } catch (ParserConfigurationException | TransformerException pce) {\n pce.printStackTrace();\n }\n\n }", "public abstract void saveToFile(PrintWriter out);", "public void saveFile() {\r\n final String file = \"respuestaConjuntoDeDatosCon\" + this.numberOfBees + \"abejas.txt\";\r\n try {\r\n int count = 0;\r\n PrintWriter writer = new PrintWriter(file, \"UTF-8\");\r\n for (int i = 0; i < this.numberOfBees; i++) {\r\n if (beesArray[i].isInCollisionRisk()) {\r\n writer.println(beesArray[i].getLatitude() + \",\" + beesArray[i].getLongitude() + \",\" + beesArray[i].getHeight());\r\n count++;\r\n }\r\n }\r\n System.out.println(\"Number of bees in collision risk: \" + count);\r\n writer.close();\r\n } catch (IOException ioe) {\r\n System.out.println(\"Something went wrong writing the exit file\");\r\n }\r\n }", "void exportGame();", "public void save(File filename) throws IOException {\n ObjectOutputStream outputStream = null;\n try {\n outputStream = new ObjectOutputStream(new FileOutputStream(filename));\n outputStream.writeObject(this.getHighScores());\n } catch (IOException e) {\n System.out.println(\"cannot save to file\");\n } finally {\n if (outputStream != null) { // Exception might have happened at constructor\n try {\n outputStream.close();\n } catch (IOException e) {\n System.out.println(\" Failed closing the file !\");\n }\n }\n }\n }", "public void saveMap() {\n this.scanMap();\n String userHome = System.getProperty(\"user.home\");\n BinaryExporter export = BinaryExporter.getInstance();\n File file = new File(userHome + \"world.j3o\");\n try {\n export.save(this.testNode, file); \n } catch (IOException ex) {\n Logger.getLogger(mapDevAppState_2.class.getName()).log(Level.SEVERE, \"File write error\");\n }\n }", "public void writePlayerFile(String fileName)\r\n\t{\r\n\t\tPrintWriter fileWrite;\r\n\t\ttry\r\n\t\t{\r\n\t\t\tfileWrite = new PrintWriter(new FileOutputStream(fileName));\r\n\t\t\tfileWrite.println(\"Name \" + name);\r\n\t\t\tfileWrite.println(\"HP \" + hp);\r\n\t\t\tfileWrite.println(\"Strength \" + strength);\r\n\t\t\tfileWrite.println(\"Speed \" + speed);\r\n\t\t\tfileWrite.println(\"Weapon \" + weapon);\r\n\t\t\tfileWrite.close();\r\n\t\t}\r\n\t\tcatch(IOException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "public final void saveToFile() {\n\t\tWrite.midi(getScore(), getName()+\".mid\"); \n\t}", "void onGameSaved(File file);", "private void saveGame(){\n\t\t\n\t}", "static void saveMeta() {\n File dir = new File(\"./plugins/SkyblockShop/\");\n if (!dir.exists()) {if (!dir.mkdir()) { System.out.println(\"Failed to create SkyblockShop directory!\");}}\n\n //save 'money' to .meta file\n try {\n PrintWriter writer = new PrintWriter(\"./plugins/SkyblockShop/.meta\", \"UTF-8\");\n writer.println(Main.money);\n writer.close();\n } catch (Exception e) {\n e.printStackTrace();\n System.out.println(\"Something went wrong while creating the .meta file!\");\n }\n }", "public void save()\n\t{\n\t\tfor(PlayerData pd : dataMap.values())\n\t\t\tpd.save();\n\t}", "public void SerialWriteFile() {\r\n\r\n PrintWriter pwrite = null;\r\n File fileObject = new File(getName());\r\n QuizPlayer q = new QuizPlayer(getName(), getNickname(), getTotalScore());\r\n\r\n try {\r\n ObjectOutputStream outputStream =\r\n new ObjectOutputStream(new FileOutputStream(fileObject));\r\n\r\n outputStream.writeObject(q); //Writes the object to the serialized file.\r\n outputStream.close();\r\n\r\n\r\n } catch (IOException e) {\r\n System.out.println(\"Problem with file output.\");\r\n }\r\n\r\n }", "void writeToFile(){\n try{\n OutputStream o = new FileOutputStream(distanceFile);\n for(int start = 1; start < 200; start++)\n for(int to = 1; to < 200; to++)\n for(int taxi = 0; taxi < 12; taxi++)\n for(int bus = 0; bus < 9; bus++)\n o.write(distance[start][to][taxi][bus]);\n o.close();\n o = new FileOutputStream(validMoveFile);\n for(int node = 1; node < 200; node++)\n for(int taxi = 0; taxi < 3; taxi++)\n for(int bus = 0; bus < 3; bus++)\n for(int underground = 0; underground < 3; underground++)\n for(int doublet = 0; doublet < 2; doublet++)\n for(int secret = 0; secret < 3; secret++)\n for(int b = 0; b < 4; b++)\n o.write((byte) (validMoves[node][taxi][bus][underground][doublet][secret] >> ((3 - b) * 8)));\n o.close();\n }\n catch (Exception e){\n System.out.println(\"Exception: \" + e);\n }\n }", "static void saveAllPlayersToFiles(){\n \tfor( String playername : GoreaProtect.playersData.getKeys(false))\n \t{\n \t\tFile playerfile = new File(GoreaProtect.datafolder + File.separator + \"Protections\");\n \t\tFile fileplayer= new File(playerfile, playername + \".yml\");\n\n \t\tConfigurationSection playerdata = GoreaProtect.playersData.getConfigurationSection(playername);\n\n \t\tYamlConfiguration PlayersDatayml = new YamlConfiguration();\n\n \t\tfor (String aaa:playerdata.getKeys(false))\n \t\tPlayersDatayml.set(aaa, playerdata.get(aaa));\n \t\t\n \t\t\n \t\ttry {\n\t\t\t\tPlayersDatayml.save(fileplayer);\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} \n }", "public void saveBinary(String file) throws IOException {\n FileOutputStream f = new FileOutputStream(new File(file));\n ObjectOutputStream o = new ObjectOutputStream(f);\n o.writeObject(this);\n o.flush();\n o.close();\n }", "public void saveStats() throws IOException {\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"learnedWords\")));\r\n out.println(wordIndex);\r\n for (Word s : masteredWords) {//write mastered words first\r\n out.println(s.toString());\r\n }\r\n for (int i = 0; i < learningWords.size(); i++) {//writes learning words next\r\n Word w = learningWords.get(i);\r\n out.println(w.toString());\r\n }\r\n out.close();\r\n }", "private void saveGame() throws FileNotFoundException {\r\n\t\tJFileChooser fileChooser = new JFileChooser();\r\n\t\tFile file = null;\r\n\t\tif (fileChooser.showSaveDialog(gameView) == JFileChooser.APPROVE_OPTION) {\r\n\t\t\tfile = fileChooser.getSelectedFile();\r\n\t\t}\r\n\t\tif (file != null) {\r\n\t\t\tFileWriter fileWriter = new FileWriter(convertToStringArrayList(), file);\r\n\t\t\tfileWriter.writeFile();\r\n\t\t}\r\n\r\n\t}", "public static void writePlayerToFile(ArrayList<Player> players)\r\n {\r\n clearFile(new File(\"players.txt\"));\r\n\r\n for(Player p : players)\r\n {\r\n writePlayerToFile(p);\r\n }//end for\r\n }", "private void updateCoins() {\r\n\t\tFile file = new File(\".coinSave\");\r\n\r\n\t\tPrintWriter pw;\r\n\t\ttry {\r\n\t\t\tpw = new PrintWriter(file);\r\n\t\t\tpw.close();\r\n\r\n\t\t\tFileWriter fw = new FileWriter(file);\r\n\t\t\tBufferedWriter bw = new BufferedWriter(fw);\r\n\r\n\t\t\tbw.write(_hiddenCoins + \"\\n\");\r\n\t\t\tbw.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "public void writeState(float timer, float xPos, float yPos, Float killCount, Float pHealth, Float level, Float gravity) throws IOException {\n boolean append = false;\n FileWriter writer = null;\n try {\n writer = new FileWriter(fileName, append);\n writer.write(timer + \",\" + xPos + \",\"+ yPos + \",\" + killCount + \",\" + pHealth + \",\" + level + \",\" + gravity + \"\\n\");\n } finally {\n if (writer != null) {\n writer.close();\n }\n }\n }", "public static void writeToStringToFile(Player p)\r\n {\r\n try \r\n { \r\n //Create file \r\n PrintWriter fileOutput = new PrintWriter(new FileWriter(\"playersData.txt\", true), true); \r\n\r\n //Write data from given ArrayList to the file \r\n fileOutput.println(p);\r\n\r\n //Close file\r\n fileOutput.close();\r\n } \r\n catch (IOException ioException) \r\n { \r\n //Output error message \r\n System.out.println(\"Error: The file cannot be created\"); \r\n }//end try \r\n }", "private void saveData() {\n\t\tlogger.trace(\"saveData() is called\");\n\t\t\n\t\tObjectOutputStream out = null;\n\t\ttry {\n\t\t\tFileOutputStream fileOut = new FileOutputStream(\"server-info.dat\");\n\t\t\tout = new ObjectOutputStream(fileOut);\n\t\t\tout.writeObject(jokeFile);\n\t\t\tout.writeObject(kkServerPort);\n\t\t\tout.flush();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.err.println(\"saving server-info.dat file is encountering an error for some reason.\");\n\t\t\tlogger.error(\"saving server-info.dat file is encountering an error for some reason.\");\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"saving server-info.dat file is encountering an error for some reason.\");\t\n\t\t\tlogger.error(\"saving server-info.dat file is encountering an error for some reason.\");\n\t\t} \n\t\tfinally {\n\t\t\tif (out != null){\n\t\t\t\ttry{\n\t\t\t\t\tout.close();\n\t\t\t\t}\n\t\t\t\tcatch (IOException e){\n\t\t\t\t\tSystem.err.println(\"saving server-info.dat file is encountering an error for some reason.\");\n\t\t\t\t\tlogger.error(\"saving server-info.dat file is encountering an error for some reason.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "void saveGame() throws IOException, Throwable {\n Save save = new Save(\"01\");\n save.addToSaveGame(objectsToSave());\n save.saveGame();\n }", "private void writeCheckpoint(String filename) {\n File file = new File(checkpointDir, filename);\n try {\n geneticProgram.savePopulation(new FileOutputStream(file));\n } catch (FileNotFoundException e) {\n log.log(Level.WARNING, \"Exception in dump\", e);\n }\n }", "public static void saveGameConfiguration() {\n exportJsonFile(new File(FileUtils.getRootFile(), Constant.CONFIG_FILE_NAME));\n }" ]
[ "0.71963125", "0.68947107", "0.6886871", "0.66852176", "0.6632148", "0.6593409", "0.65733105", "0.6505053", "0.6496206", "0.64069366", "0.63891727", "0.6364614", "0.63548833", "0.6351927", "0.6349311", "0.63079983", "0.6299017", "0.6295236", "0.6294295", "0.62513417", "0.62228394", "0.62176096", "0.62122536", "0.6206947", "0.6187331", "0.6184501", "0.6180607", "0.61709404", "0.6111349", "0.6093011", "0.60796356", "0.6076659", "0.6064415", "0.60322267", "0.60073906", "0.5997981", "0.5993941", "0.5992745", "0.5984596", "0.5982723", "0.5978388", "0.5966645", "0.5943325", "0.59367317", "0.59354496", "0.5930071", "0.5919615", "0.59103376", "0.5907401", "0.58993775", "0.58933", "0.58917445", "0.5889745", "0.5857388", "0.5852368", "0.58461785", "0.58412176", "0.5834779", "0.5833401", "0.58311296", "0.5826745", "0.58107436", "0.580847", "0.58000284", "0.5786105", "0.57709694", "0.577044", "0.576949", "0.57660735", "0.57579833", "0.57553375", "0.5754279", "0.57522225", "0.5742231", "0.5731393", "0.57265097", "0.5720398", "0.57173264", "0.57101834", "0.5684141", "0.5681779", "0.56758404", "0.56738764", "0.5670425", "0.5668955", "0.56677914", "0.5659454", "0.56543976", "0.564787", "0.5635848", "0.5614242", "0.56130546", "0.5611267", "0.56088144", "0.55930334", "0.55841225", "0.5580229", "0.55796325", "0.55783325", "0.557684" ]
0.7059873
1
Reads the currents game stats from a binary file
public void ReadFromBinary() throws IOException { DataInputStream Input = new DataInputStream(new FileInputStream("GameProgress.dat")); pl.xCoord = Input.read(); pl.xCoord = Input.read(); pl.NumRockets = Input.read(); pl.NumBullets = Input.read(); pl.Health =Input.read(); DestroyedEnemies =Input.read(); RunAwayEnemies =Input.read(); int x, y = 0; for (int i = 0 ; i < EnemyList.size(); i++ ) { x = Input.read(); y = Input.read(); eh = new Enemy(x,y); EnemyList.add(eh); } Input.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void loadGameStats(Player player) throws FileNotFoundException {\n gameStatsReader = new BufferedReader(new FileReader(\"src/main/resources/stats/gamestats.txt\"));\n try {\n player.getGameStats().setAttacks(Integer.parseInt(gameStatsReader.readLine()));\n player.getGameStats().setHits(Integer.parseInt(gameStatsReader.readLine()));\n player.getGameStats().setDamage(Long.parseLong(gameStatsReader.readLine()));\n player.getGameStats().setKills(Integer.parseInt(gameStatsReader.readLine()));\n player.getGameStats().setFirstHitKill(Integer.parseInt(gameStatsReader.readLine()));\n player.getGameStats().setAssists(Integer.parseInt(gameStatsReader.readLine()));\n player.getGameStats().setCasts(Integer.parseInt(gameStatsReader.readLine()));\n player.getGameStats().setSpellDamage(Long.parseLong(gameStatsReader.readLine()));\n player.getGameStats().setTimePlayed(Long.parseLong(gameStatsReader.readLine()));\n\n } catch (IOException ex) {\n Logger.getLogger(StatsLoader.class.getName()).log(Level.SEVERE, \"Cannot find specificed stats file\", ex);\n }\n }", "public void loadGame() throws IOException\r\n\t{\r\n\t\tjava.io.BufferedReader reader;\r\n\t String line;\r\n\t String[] elements;\r\n\t int ammo = 0;\r\n\t String state = null;\r\n\t try\r\n\t {\r\n\t reader = new java.io.BufferedReader(new java.io.FileReader(\"Game.ser\"));\r\n\t line = reader.readLine();\r\n\t elements = line.split(\":\");\r\n\t state = elements[0];\r\n\t ammo = Integer.decode(elements[1]);\r\n\t \r\n\t reader.close();\r\n\t \r\n\t\t gamePanel.getView().getPlayer().setAmmo(ammo);\r\n\t\t gamePanel.getView().getPlayer().setState(state);\r\n\t }\r\n\t catch(Exception e)\r\n\t {\r\n\t System.out.println(\"Can't load this save\");\r\n\t }\r\n\t \r\n\t \r\n\r\n\t}", "public static void loadHistoricalStats(Player player) throws FileNotFoundException {\n historicalStatsReader = new BufferedReader(new FileReader(\"src/main/resources/stats/historicalstats.txt\"));\n try {\n player.getHistoricalStats().setWins(Integer.parseInt(historicalStatsReader.readLine()));\n player.getHistoricalStats().setLosses(Integer.parseInt(historicalStatsReader.readLine()));\n player.getHistoricalStats().setGamesPlayed(Integer.parseInt(historicalStatsReader.readLine()));\n player.getHistoricalStats().setTimePlayed(Integer.parseInt(historicalStatsReader.readLine()));\n player.getHistoricalStats().setKills(Integer.parseInt(historicalStatsReader.readLine()));\n player.getHistoricalStats().setGamesLeft(Integer.parseInt(historicalStatsReader.readLine()));\n\n } catch (IOException ex) {\n Logger.getLogger(StatsLoader.class.getName()).log(Level.SEVERE, \"Cannot find specificed stats file\", ex);\n }\n }", "private static void load(String filename, Stats stats) throws IOException {\n System.out.println(\"Analysing file: \" + filename);\n getConsole().println(\"Analysing file: \" + filename.substring(0, Integer.min(filename.length(), 60)) + (filename.length() > 60 ? \"...\" : \"\"));\n\n String line;\n long numOfKeys = 0,\n actualKey = 0,\n actualLineNumber = 0,\n startFileTime = System.nanoTime();\n try (BufferedReader reader = new BufferedReader(new FileReader(filename))) {\n while ((line = reader.readLine()) != null) {\n String[] tuple = line.split(\":\", 2);\n if (tuple.length == 2 && tuple[0].equals(\"PRIV\")) {\n numOfKeys++;\n }\n }\n } catch (FileNotFoundException ex) {\n System.err.println(\"File '\" + filename + \"' not found\");\n return;\n }\n\n try (BufferedReader reader = new BufferedReader(new FileReader(filename))) {\n lastStatusMessageTime = System.nanoTime();\n Params params = null;\n while ((line = reader.readLine()) != null) {\n actualLineNumber++;\n String[] tuple = line.split(\";\", 2);\n if (tuple[0].equals(\"CPLC.ICSerialNumber\")) {\n stats.changeCard(tuple[1]);\n }\n\n tuple = line.split(\":\", 2);\n if (tuple.length != 2) {\n continue;\n }\n String value = tuple[1].replaceAll(\"\\\\s\", \"\");\n switch (tuple[0]) {\n case \"PUBL\":\n if (params != null) {\n throw new WrongKeyException(\"Loading public key on line \" + actualLineNumber + \" while another public key is loaded\");\n }\n params = Params.readPublicKeyFromTlv(value);\n break;\n case \"PRIV\":\n if (params == null) {\n throw new WrongKeyException(\"Loading private key on line \" + actualLineNumber + \" while public key not loaded\");\n }\n params.readPrivateKeyFromTlv(value);\n break;\n default:\n if (tuple[0].charAt(0) == '#') {\n if (params == null) {\n throw new WrongKeyException(\"Loading time on line \" + actualLineNumber + \" while public key not loaded\");\n }\n\n int time = (int) (Double.parseDouble(tuple[1]) * 1000.0);\n params.setTime(time);\n stats.process(params);\n\n params = null;\n actualKey++;\n showProgress(actualKey, numOfKeys, startFileTime);\n }\n }\n }\n } catch (FileNotFoundException ex) {\n System.err.println(\"File '\" + filename + \"' not found\");\n } catch (WrongKeyException ex) {\n System.err.println(\"File '\" + filename + \"' is in wrong format.\\n\" + ex.getMessage());\n } finally {\n consoleDoneLine();\n }\n }", "private void readFile() {\n\t\tint newPlayerScore = level.animal.getPoints();\n\t\t\n\t\tlevel.worDim = 30;\n\t\tlevel.wordShift = 25;\n\t\tlevel.digDim = 30;\n\t\tlevel.digShift = 25;\n\t\t\n\t\tfor( int y =0; y<10; y++ ) { //display placeholder numbers\n\t\t\tfor( int x=0; x<4; x++ ) {\n\t\t\t\tbackground.add(new Digit( 0, 30, 470 - (25*x), 200 + (35*y) ) );\n\t\t\t}\n\t\t}\n\t\t\n\t\ttry { //display highscores from highscores.txt\n\t\t\tScanner fileReader = new Scanner(new File( System.getProperty(\"user.dir\") + \"\\\\highscores.txt\"));\n\t\t\t\n\t\t\tint loopCount = 0;\n\t\t\twhile( loopCount < 10 ) {\n\t\t\t\tString playerName = fileReader.next() ;\n\t\t\t\tString playerScore = fileReader.next() ;\n\t\t\t\tint score=Integer.parseInt(playerScore);\n\t\t\t\t\n\t\t\t\tif( newPlayerScore >= score && newHighScore == false ) {\n\t\t\t\t\tstopAt = loopCount;\n\t\t\t\t\tnewHighScore = true;\n\t\t\t\t\tlevel.wordY = 200 + (35*loopCount);\n\t\t\t\t\t\n\t\t\t\t\tpointer = new Icon(\"pointer.png\", 30, 75, 200 + (35*loopCount) );// add pointer indicator\n\t\t\t\t\tbackground.add( pointer ); \n\t\t\t\t\tlevel.setNumber(newPlayerScore, 470, 200 + (35*loopCount));\n\t\t\t\t\tloopCount += 1;\n\t\t\t\t\tlevel.setWord(playerName, 10, 100, 200 + (35*loopCount));\n\t\t\t\t\tlevel.setNumber(score, 470, 200 + (35*loopCount));\n\t\t\t\t\tloopCount += 1;\n\t\t\t\t}else {\n\t\t\t\t\tlevel.setWord(playerName, 10, 100, 200 + (35*loopCount));\n\t\t\t\t\tlevel.setNumber(score, 470, 200 + (35*loopCount));\n\t\t\t\t\tloopCount += 1;\n\t\t\t\t}\n\t\t\t}//end while\n\t\t\tfileReader.close();\n\t\t\tif( newHighScore ) {\n\t\t\t\tnewHighScoreAlert();\n\t\t\t}else {\n\t\t\t\tgameOverAlert();\n\t\t\t}\n } catch (Exception e) {\n \tSystem.out.print(\"ERROR: Line 168: Unable to read file\");\n //e.printStackTrace();\n }\n\t}", "private void loadFromFile() {\n try {\n /* Load in the data from the file */\n FileInputStream fIn = openFileInput(FILENAME);\n BufferedReader inRead = new BufferedReader(new InputStreamReader(fIn));\n\n /*\n * access from the GSON file\n * Taken from lonelyTwitter lab code\n */\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Counter>>() {}.getType();\n counters = gson.fromJson(inRead, listType);\n\n } catch (FileNotFoundException e) {\n counters = new ArrayList<Counter>();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "public void load(String filePath){\r\n File loadFile = new File(filePath);\r\n if (!loadFile.exists()){\r\n System.out.println(\"I failed. There are no saved games.\");\r\n return;\r\n }\r\n FileInputStream fis = null;\r\n ObjectInputStream in = null;\r\n try {\r\n fis = new FileInputStream(filePath);\r\n in = new ObjectInputStream(fis);\r\n long versionUID = (long) in.readObject();\r\n if (versionUID != this.serialVersionUID) {\r\n throw new UnsupportedClassVersionError(\"Version mismatch for save game!\");\r\n }\r\n this.p = (Character) in.readObject();\r\n this.map = (SpecialRoom[][]) in.readObject();\r\n\r\n } catch (FileNotFoundException ex){\r\n System.out.println(\"The saved game was not found!\");\r\n ex.printStackTrace();\r\n } catch (IOException ex) {\r\n System.out.println(\"There was an error reading your save game :(\");\r\n ex.printStackTrace();\r\n System.out.println(\")\");\r\n } catch (ClassNotFoundException ex) {\r\n System.out.println(\"The version of the save game is not compatible with this game!\");\r\n ex.printStackTrace();\r\n } catch (UnsupportedClassVersionError ex) {\r\n System.out.println(ex.getMessage());\r\n ex.printStackTrace();\r\n } catch (Exception ex) {\r\n System.out.println(\"An unknown error occurred!\");\r\n }\r\n\r\n }", "private static void displayStats() {\n\t\tint numPlay = 0;\n\t\tint numWon = 0;\n\t\tint sumGuess = 0;\n\t\tint minGuess = Integer.MAX_VALUE;\n\t\tint maxGuess = Integer.MIN_VALUE;\n\t\tdouble average = 0;\n\t\tint lastNumGuess = 0;\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader(fileName));\n\t\t\tString line = \"\";\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tnumPlay++;\n\t\t\t\tlastNumGuess = Integer.parseInt(line);\n\t\t\t\tif (lastNumGuess > 0) { // a positive number of guesses indicates the user won the game\n\t\t\t\t\tnumWon++;\n\t\t\t\t\tminGuess = Math.min(minGuess, lastNumGuess);\n\t\t\t\t\tmaxGuess = Math.max(maxGuess, lastNumGuess);\n\t\t\t\t\tsumGuess += lastNumGuess;\n\t\t\t\t}\n\t\t\t}\n\t\t\treader.close();\n\t\t} catch (FileNotFoundException exception) {\n\t\t\tSystem.out.println(\"It seems that you haven't played this game before. Keep playing to gather statistics!\");\n\t\t\treturn;\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Sorry the software encountered an IO Error. Please try again later.\");\n\t\t}\n\t\tSystem.out.println(\"Below are the summary statistics: \");\n\t\tSystem.out.println(\"Number of games played: \" + numPlay);\n\t\tSystem.out.println(\"Number of games won: \" + numWon);\n\t\tSystem.out.println(String.format(\"Total number of guesses: %d\", sumGuess + 12 * (numPlay - numWon)));\n\t\tif (lastNumGuess < 1) {\n\t\t\tSystem.out.println(\"Last time you lost\");\n\t\t} else {\n\t\t\tSystem.out.println(String.format(\"Last time you won and made %d guess%s\", lastNumGuess,\n\t\t\t\t\t(lastNumGuess > 1 ? \"es\" : \"\")));\n\t\t}\n\t\tif (numWon > 0) {\n\t\t\tSystem.out.println(\"Minimum number of guesses to win: \" + minGuess);\n\t\t\tSystem.out.println(\"Maximum number of guesses to win: \" + maxGuess);\n\t\t\taverage = (double) sumGuess / numWon;\n\t\t\tSystem.out.println(String.format(\"Average number of guesses to win: %.2f\", average));\n\t\t}\n\t}", "private void readSimulationResults(){\n\t\tString tempDir = System.getProperty(\"java.io.tmpdir\");\r\n\t\tFile file = new File(tempDir+File.separator+\"simulation.bin\");\r\n\t try {\r\n\t \t\r\n\t \tObjectInputStream in = new ObjectInputStream(new FileInputStream(file));\r\n\t\t\t// Deserialize the object\r\n\t\t\t\r\n\t\t\tresults = (PortfolioStatistics) in.readObject();\r\n\t\t\tin.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public GameLevel LoadGame() throws IOException {\n FileReader fr = null;\n BufferedReader reader = null;\n\n try {\n System.out.println(\"Reading \" + fileName + \" data/saves.txt\");\n\n fr = new FileReader(fileName);\n reader = new BufferedReader(fr);\n\n String line = reader.readLine();\n int levelNumber = Integer.parseInt(line);\n\n //--------------------------------------------------------------------------------------------\n\n if (levelNumber == 1){\n gameLevel = new Level1();\n } else if(levelNumber == 2){\n gameLevel = new Level2();\n JFrame debugView = new DebugViewer(gameLevel, 700, 700);\n } else {\n gameLevel = new Level3();\n }\n\n //------------------------------------------------------------------------------------------\n\n\n while ((line = reader.readLine()) != null){\n String[] tokens = line.split(\",\");\n String className = tokens[0];\n float x = Float.parseFloat(tokens[1]);\n float y = Float.parseFloat(tokens[2]);\n Vec2 pos = new Vec2(x, y);\n Body platform = null;\n\n if (className.equals(\"PlayableCharacter\")){\n PlayableCharacter playableCharacter = new PlayableCharacter(gameLevel, PlayableCharacter.getItemsCollected(),PlayableCharacter.isSpecialGravity(),game);\n playableCharacter.setPosition(pos);\n gameLevel.setPlayer(playableCharacter);\n\n }\n\n if (className.equals(\"LogPlatform\")){\n Body body = new LogPlatform(gameLevel, platform);\n body.setPosition(pos);\n }\n\n if (className.equals(\"Coin\")){\n Body body = new Coin(gameLevel);\n body.setPosition(pos);\n body.addCollisionListener(new Pickup(gameLevel.getPlayableCharacter(), game));\n }\n\n if (className.equals(\"ReducedGravityCoin\")){\n Body body = new ReducedGravityCoin(gameLevel);\n body.setPosition(pos);\n body.addCollisionListener(\n new PickupRGC(gameLevel.getPlayer(), game)\n\n );\n }\n\n if (className.equals(\"AntiGravityCoin\")){\n Body body = new AntiGravityCoin(gameLevel);\n body.setPosition(pos);\n body.addCollisionListener(\n new PickupAGC(gameLevel.getPlayer(), game) );\n }\n\n if (className.equals(\"Rock\")){\n Body body = new Rock(gameLevel);\n body.setPosition(pos);\n body.addCollisionListener(\n new FallCollisionListener(gameLevel.getPlayableCharacter(), game));\n }\n\n if (className.equals(\"Pellet\")){\n Body body = new Pellet(gameLevel);\n body.setPosition(pos);\n body.addCollisionListener(\n new AddLifeCollisionListener(gameLevel.getPlayer(), game));\n }\n\n if (className.equals(\"Branch\")){\n Body body = new Branch(gameLevel);\n body.setPosition(pos);\n body.addCollisionListener(new BranchListener(gameLevel.getPlayableCharacter(), game));\n }\n\n if (className.equals(\"Portal\")){\n Body portal = new Portal(gameLevel);\n portal.setPosition(pos);\n portal.addCollisionListener(new DoorListener(game));\n }\n\n if (className.equals(\"DeathPlatform\")){\n float w = Float.parseFloat(tokens[3]);\n float h = Float.parseFloat(tokens[4]);\n float deg = Float.parseFloat(tokens[5]);\n\n Body body = new DeathPlatform(gameLevel, w, h);\n body.setPosition(pos);\n body.addCollisionListener(new FallCollisionListener(gameLevel.getPlayer(), game));\n body.setFillColor(Color.black);\n body.setAngleDegrees(deg);\n\n }\n\n }\n\n return gameLevel;\n } finally {\n if (reader != null) {\n reader.close();\n }\n if (fr != null) {\n fr.close();\n }\n }\n }", "public void load(){\n Player temp;\n try{\n FileInputStream inputFile = new FileInputStream(\"./data.sec\");\n ObjectInputStream objectIn = new ObjectInputStream(inputFile);\n temp = (Player)objectIn.readObject();\n Arena.CUR_PLAYER = temp;\n objectIn.close();\n inputFile.close(); \n }\n catch(FileNotFoundException e ){\n System.err.print(\"data.sec not found\");\n }\n catch(IOException e){\n System.out.println(\"Error 201\");\n }\n catch(ClassNotFoundException e){\n System.out.println(\"Error 202\");\n }\n }", "public void fileReadGameHistory(String filename)\n {\n \t//ArrayList<GameObject> gameObject = new ArrayList<>();\n\t\tFileReader file = null;\n\t\ttry {\n\t\t\tfile = new FileReader(filename);\n\t\t} catch (FileNotFoundException e) {\n\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(filename);\n\t\tBufferedReader br = new BufferedReader(file);\n\t\tString s = \"\";\n\t\ttry\n\t\t{\n\t\t\twhile((s = br.readLine()) != null )\n\t\t\t{\n\t\t\t\tString[] prop1 = s.split(\"#\");\n\t\t\t\tSystem.out.println(prop1[0] + \" fgdfsgfds \" + prop1[1]);\n\t\t\t\tString indexOfList = prop1[0];\n\t\t\t\tString[] prop2 = prop1[1].split(\",\");\n\t\t\t\tString[] prop3;\n\t\t\t\tString[] prop4 = indexOfList.split(\";\");\n\t\t\t\t//gameObject.add(new GameObject(indexOfList));\n\t\t\t\tcount = count +1;\n\t\t\t\texistCount = existCount + 1;\n\t\t\t\tif (indexOfList.charAt(0) == 's')//when this line is data of a swimming game\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(prop4[0]);\n\t\t\t\t\tgames.add(new Swimming(prop4[1],\"Swimming\",prop4[0]));\n\t\t\t\t\tfor(int i = 0; i < Array.getLength(prop2); i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tprop3 = prop2[i].split(\":\");\n\t\t\t\t\t\tgames.get(count - 1).addParticipant(prop3[0], Integer.parseInt(prop3[1]), 0);\n//\t\t\t\t\t\tgames.get(count-1).getResults().get(i).setId(prop3[0]);\n//\t\t\t\t\t\tgames.get(count-1).getResults().get(i).setRe(Integer.parseInt(prop3[1]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (indexOfList.charAt(0) == 'c')//when this line is data of a cycling game\n\t\t\t\t{\n\t\t\t\t\tgames.add(new Cycling(prop4[1],\"Cycling\",prop4[0]));\n\t\t\t\t\tfor(int i = 0; i < Array.getLength(prop2); i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tprop3 = prop2[i].split(\":\");\n\t\t\t\t\t\tgames.get(count - 1).addParticipant(prop3[0], Integer.parseInt(prop3[1]), 0);\n//\t\t\t\t\t\tgames.get(count-1).getResults().get(i).setId(prop3[0]);\n//\t\t\t\t\t\tgames.get(count-1).getResults().get(i).setRe(Integer.parseInt(prop3[1]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (indexOfList.charAt(0) == 'r')//when this line is data of a running game\n\t\t\t\t{\n\t\t\t\t\tgames.add(new Running(prop4[1],\"Running\",prop4[0]));\n\t\t\t\t\tfor(int i = 0; i < Array.getLength(prop2); i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tprop3 = prop2[i].split(\":\");\n\t\t\t\t\t\tgames.get(count - 1).addParticipant(prop3[0], Integer.parseInt(prop3[1]), 0);\n//\t\t\t\t\t\tgames.get(count-1).getResults().get(i).setId(prop3[0]);\n//\t\t\t\t\t\tgames.get(count-1).getResults().get(i).setRe(Integer.parseInt(prop3[1]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}catch (NumberFormatException | IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n }", "private void loadGame() {\r\n\t\tJFileChooser fileChooser = new JFileChooser();\r\n\t\tArrayList<String> data = new ArrayList<String>();\r\n\t\tFile file = null;\r\n\t\tif (fileChooser.showOpenDialog(gameView) == JFileChooser.APPROVE_OPTION) {\r\n\t\t\tfile = fileChooser.getSelectedFile();\r\n\t\t}\r\n\r\n\t\tif (file != null) {\r\n\t\t\tmyFileReader fileReader = new myFileReader(file);\r\n\t\t\ttry {\r\n\t\t\t\tdata = fileReader.getFileContents();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t\t// TODO: allow writing of whose turn it is!\r\n\t\t\tParser parse = new Parser();\r\n\t\t\tint tempBoard[][] = parse.parseGameBoard(data);\r\n\t\t\tgameBoard = new GameBoardModel(tempBoard, parse.isBlackTurn(), parse.getBlackScore(), parse.getRedScore());\r\n\t\t}\r\n\t}", "private void cargarStatsBase (){\n\t\tString dirRoot = System.getProperty(\"user.dir\")+ File.separator+\"recursos\"+ File.separator+\"ficheros\"+ File.separator+\"dungeons\"+File.separator;\n\t\tString dirRazas = dirRoot+\"razas_stats.txt\";\n\t\tString dirClases = dirRoot+\"clases_stats.txt\";\n\n\t\t//Carga de los stats de Raza\n\t\ttry{\n\t\t\tInputStream fichDataRazas = new FileInputStream(dirRazas);\n\t\t\tScanner sc = new Scanner(fichDataRazas);\n\n\t\t\tString lineaAct;\n\t\t\tString lineaRaza=null;\n\n\t\t\twhile (lineaRaza == null && sc.hasNext()){\n\t\t\t\tlineaAct = sc.nextLine();\n\t\t\t\tif (lineaAct.contains(this.raza+\"&\")){\n\t\t\t\t\tlineaRaza = lineaAct;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (lineaRaza != null && lineaRaza.matches(\"(.*)&\\\\d\\\\d,\\\\d\\\\d,\\\\d\\\\d,\\\\d\\\\d\")){\n\t\t\t\tString[] dataStatRaza = lineaRaza.split(\"&\")[1].split(\",\");\n\t\t\t\tint fuerza = Integer.parseInt(dataStatRaza[0]);\n\t\t\t\tint defensa = Integer.parseInt(dataStatRaza[1]);\n\t\t\t\tint inteligencia = Integer.parseInt(dataStatRaza[2]);\n\t\t\t\tint destreza = Integer.parseInt(dataStatRaza[3]);\n\t\t\t\tthis.lStats.sumarStats(new ListaStat(fuerza,defensa,inteligencia,destreza));\n\t\t\t}\n\t\t\telse {throw new ExcepcionRazaInexistente();}\n\t\t\t//Se cierra el escaner\n\t\t\tsc.close();\n\n\n\t\t\t//Carga de los stats de Clase\n\t\t\tInputStream fichDataClases = new FileInputStream(dirClases);\n\t\t\tsc = new Scanner(fichDataClases);\n\n\t\t\tString lineaClase = null;\n\t\t\twhile (lineaClase == null && sc.hasNext()){\n\t\t\t\tlineaAct = sc.nextLine();\n\t\t\t\tif (lineaAct.contains(this.clase+\"&\")){\n\t\t\t\t\tlineaClase = lineaAct;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (lineaClase != null && lineaClase.matches(\"(.*)&\\\\d\\\\d,\\\\d\\\\d,\\\\d\\\\d,\\\\d\\\\d\")){\n\t\t\t\tString[] dataStatClase = lineaClase.split(\"&\")[1].split(\",\");\n\t\t\t\tint fuerza = Integer.parseInt(dataStatClase[0]);\n\t\t\t\tint defensa = Integer.parseInt(dataStatClase[1]);\n\t\t\t\tint inteligencia = Integer.parseInt(dataStatClase[2]);\n\t\t\t\tint destreza = Integer.parseInt(dataStatClase[3]);\n\t\t\t\tthis.lStats.sumarStats(new ListaStat(fuerza,defensa,inteligencia,destreza));\n\t\t\t}\n\t\t\telse {throw new ExcepcionClaseInexistente();}\n\t\t\t//Se cierra el escaner\n\t\t\tsc.close();\n\t\t}\n\n\t\tcatch(FileNotFoundException e){\n\t\t\tSystem.out.println(\"No se encuentran los ficheros de datos de los stats de razas y/o clases, por lo que el juego se cerrará.\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tcatch (ExcepcionRazaInexistente e){\n\t\t\tSystem.out.println(\"El fichero \"+dirRazas+\" no contiene datos sobre la raza seleccionada o tiene un formato inadecuado, por lo que el juego se cerrará.\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tcatch (ExcepcionClaseInexistente e){\n\t\t\tSystem.out.println(\"El fichero \"+dirClases+\" no contiene datos sobre la clase seleccionada o tiene un formato inadecuado, por lo que el juego se cerrará.\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tcatch (Exception e){\n\t\t\tSystem.out.println(\"Ha ocurrido un error inesperado: el juego se cerrará\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "private static void loadNewFormat(String filename, Stats stats) throws IOException {\n System.out.println(\"Analysing file: \" + filename);\n getConsole().println(\"Analysing file: \" + filename.substring(0, Integer.min(filename.length(), 60)) + (filename.length() > 60 ? \"...\" : \"\"));\n\n lastStatusMessageTime = System.nanoTime();\n String line;\n long numOfKeys = 0,\n actualKey = 0,\n startFileTime = System.nanoTime();\n try (BufferedReader reader = new BufferedReader(new FileReader(filename))) {\n while ((line = reader.readLine()) != null) {\n String tuple[] = line.replace(\",\", \";\").split(\";\", 7);\n if (tuple.length == 7 && tuple[0].matches(\"\\\\d+\")) {\n numOfKeys++;\n }\n }\n } catch (FileNotFoundException ex) {\n System.err.println(\"File '\" + filename + \"' not found\");\n return;\n }\n\n try (BufferedReader reader = new BufferedReader(new FileReader(filename))) {\n int pos = filename.lastIndexOf('.');\n String icsn = filename;\n if (pos >= 0) {\n icsn = icsn.substring(0, pos);\n }\n stats.changeCard(icsn);\n while ((line = reader.readLine()) != null) {\n String tuple[] = line.replace(\",\", \";\").split(\";\", 7);\n if (tuple.length != 7 || !tuple[0].matches(\"\\\\d+\")) {\n continue;\n }\n\n try {\n Params params = new Params();\n params.setModulus(new BigInteger(tuple[1], 16));\n params.setExponent(new BigInteger(tuple[2], 2));\n params.setP(new BigInteger(tuple[3], 16));\n params.setQ(new BigInteger(tuple[4], 16));\n params.setTime(Long.valueOf(tuple[6]));\n stats.process(params);\n\n actualKey++;\n showProgress(actualKey, numOfKeys, startFileTime);\n } catch (NumberFormatException ex) {\n String message = \"\\nKey \" + actualKey + \" is not correct.\";\n getConsole().println(message);\n System.out.println(message);\n System.out.println(\" \" + line);\n }\n }\n } catch (FileNotFoundException ex) {\n System.err.println(\"File '\" + filename + \"' not found\");\n } finally {\n consoleDoneLine();\n }\n }", "private boolean readBin(String filePath) throws FileNotFoundException, IOException {\n try {\n BufferedReader dataIn = new BufferedReader(new FileReader(filePath + \".bin\"));\n\n String next = dataIn.readLine();\n int length = Integer.parseInt(next);\n next = dataIn.readLine();\n start = Integer.parseInt(next);\n for (int i = 0; i < memory.length; i++) {\n next = dataIn.readLine();\n if (next == null) {\n break;\n }\n memory[i] = Integer.parseInt(next);\n }\n dataIn.close();\n } catch (IOException ex) {\n print(\"File error: \" + ex.toString());\n return true;\n }\n return false;\n\n }", "public static GameLevel load(Game game, String fileName)\n throws IOException{\n FileReader fr = null;\n BufferedReader reader = null;\n try {\n System.out.println(\"Reading \" + fileName + \" ...\");\n fr = new FileReader(fileName);\n reader = new BufferedReader(fr);\n String line = reader.readLine();\n String[] tokens = line.split(\",\");\n String name = tokens[0];\n int ballCount = Integer.parseInt(tokens[1]);\n\n GameLevel level = null;\n if (name.equals(\"Level1\"))\n level = new Level1(game);\n else if (name.equals(\"Level2\"))\n level = new Level2(game);\n else if (name.equals(\"Level3\"))\n level = new Level3(game);\n else if (name.equals(\"Level4\"))\n level = new Level4(game);\n\n level.getNaruto().setBallCount(ballCount);\n\n return level;\n\n } finally {\n if (reader != null) {\n reader.close();\n }\n if (fr != null) {\n fr.close();\n }\n }\n }", "private void readScores() {\n final List<Pair<String, Integer>> list = new LinkedList<>();\n try (DataInputStream in = new DataInputStream(new FileInputStream(this.file))) {\n while (true) {\n /* reads the name of the player */\n final String name = in.readUTF();\n /* reads the score of the relative player */\n final Integer score = Integer.valueOf(in.readInt());\n list.add(new Pair<String, Integer>(name, score));\n }\n } catch (final Exception ex) {\n }\n this.sortScores(list);\n /* if the list was modified by the cutting method i need to save it */\n if (this.cutScores(list)) {\n this.toSave = true;\n }\n this.list = Optional.of(list);\n\n }", "public void loadScoreFile() {\n try {\n inputStream = new ObjectInputStream(new FileInputStream(HIGHSCORE_FILE));\n scores = (ArrayList<Score>) inputStream.readObject();\n } catch (FileNotFoundException e) {\n } catch (IOException e) {\n } catch (ClassNotFoundException e) {\n } finally {\n try {\n if (outputStream != null) {\n outputStream.flush();\n outputStream.close();\n }\n } catch (IOException e) {\n }\n }\n }", "public PlayerStats readPlayerStatsFromStats(String username) throws IOException{\r\n\t\tint numberOfPlayers;\r\n\t\tboolean found = false;\r\n\t\tint iteration = 0;\r\n\t\tScanner statReader = new Scanner(new BufferedReader(new FileReader(\"statistics.txt\")));\r\n\t\tPlayerStats stats = new PlayerStats();\r\n\t\tnumberOfPlayers = statReader.nextInt(); // read in the number of players\r\n\t\t\r\n\t\twhile((iteration < numberOfPlayers) && (!found)) {\r\n\t\t\treadPlayerStats(stats, statReader);\r\n\t\t\tif((stats.username).equals(username) == true){\r\n\t\t\t\tfound = true;\r\n\t\t\t\tstatReader.close();\r\n\t\t\t\treturn stats;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\titeration++;\r\n\t\t\t\t// maybe make this below into its own function to save space\r\n\t\t\t\tstats.username = username;\r\n\t\t\t\tresetPlayerStats(stats);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tstatReader.close();\r\n\t\treturn stats;\r\n\t}", "public void readScoreFromFile(){\n\t\tString line;\n\t\tString[] temp;\n\t\ttry{\n\t\t\tFileReader f = new FileReader(\"conversation_file.txt\");\n\t\t\tBufferedReader b = new BufferedReader(f);\n\t\t\tif((line = b.readLine()) != null){\n\t\t\t\ttemp = line.split(\" \", -1);\n\t\t\t\thighScore = Integer.parseInt(temp[1]);\n\t\t\t\thighScorer = temp[0];\n\t\t\t}\n\t\t} catch (IOException e){\n\t\t\tSystem.out.println(\"File Not Found.\");\n\t\t}\n\t\tSystem.out.println(\"File read, highScore \" + highScore + \" saved.\");\n\t}", "public void displayStatistics() {\n FileInputStream fInStr;\n ObjectInputStream objInStr = null;\n File file = new File(\"clubData.txt\");\n if (file.exists()) {\n try {\n fInStr = new FileInputStream(\"clubData.txt\");\n while ( fInStr.available() > 0) {\n objInStr = new ObjectInputStream( fInStr);\n ArrayList<FootballClub> readedArray = (ArrayList<FootballClub>) objInStr.readObject();\n footballClubArrayList = readedArray;\n\n\n }\n if (objInStr != null) {\n objInStr.close();\n }\n } catch (IOException | ClassNotFoundException e) {\n e.printStackTrace();\n }\n\n }\n\n }", "public void loadSaveGameFromFile(File file) {\r\n\t\t//TODO\r\n\t}", "public void loadScores() {\n try {\n File f = new File(filePath, highScores);\n if(!f.isFile()){\n createSaveData();\n }\n BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(f)));\n\n topScores.clear();\n topName.clear();\n\n String[] scores = reader.readLine().split(\"-\");\n String[] names = reader.readLine().split(\"-\");\n\n for (int i =0; i < scores.length; i++){\n topScores.add(Integer.parseInt(scores[i]));\n topName.add(names[i]);\n }\n reader.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public static Game loadGame(String fileName){\n Game game = null;\n try {\n File file1 = new File(fileName);\n FileInputStream fileInputStream = new FileInputStream(file1);\n ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);\n game = (Game) objectInputStream.readObject();\n game.makeGUIVisible();\n }catch (Exception e){\n System.err.println(\"Error when loading file\");\n }\n return game;\n }", "private void readFileAndStoreData_(String fileName) {\n In in = new In(fileName);\n int numberOfTeams = in.readInt();\n int teamNumber = 0;\n while (!in.isEmpty()) {\n assignTeam_(in, teamNumber);\n assignTeamInfo_(in, numberOfTeams, teamNumber);\n teamNumber++;\n }\n }", "public void getscores() {\n\t\tInputStream in = null;\n\t\t//String externalStoragePath= Environment.getExternalStorageDirectory()\n // .getAbsolutePath() + File.separator;\n\t\t\n try {\n \tAssetManager assetManager = this.getAssets();\n in = assetManager.open(\"score.txt\");\n \tSystem.out.println(\"getting score\");\n //in = new BufferedReader(new InputStreamReader(new FileInputStream(externalStoragePath + \"score.txt\")));\n \n \tGlobalVariables.topScore = Integer.parseInt(new BufferedReader(new InputStreamReader(in)).readLine());\n System.out.println(\"topscore:\"+GlobalVariables.topScore);\n \n\n } catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}catch (NumberFormatException e) {\n // :/ It's ok, defaults save our day\n \tSystem.out.println(\"numberformatexception score\");\n } finally {\n try {\n if (in != null)\n in.close();\n } catch (IOException e) {\n }\n }\n\t}", "public void loadGame(File f) {\n clearGame();\n loadgame = new LoadGame(f, chessboard, this, gamelog);\n System.out.println(\"Gamed Loaded.\");\n \n frame.update(frame.getGraphics());\n\n }", "void loadFromFile() {\n\t\ttry {\n\t\t\tFile directory = GameApplication.getInstance().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS);\n\t\t\tFile source = new File(directory, FILE_NAME);\n\t\t\tMap<String, Scoreboard> scoreboards = new HashMap<String, Scoreboard>();\n\t\t\tif (source.exists()) {\n\t\t\t\tJsonReader reader = new JsonReader(new FileReader(source));\n\t\t\t\treader.beginArray();\n\t\t\t\twhile (reader.hasNext()) {\n\t\t\t\t\tScoreboard scoreboard = readScoreboard(reader);\n\t\t\t\t\tscoreboards.put(scoreboard.getName(), scoreboard);\n\t\t\t\t}\n\t\t\t\treader.endArray();\n\t\t\t\treader.close();\n\t\t\t} else {\n\t\t\t\tsource.createNewFile();\n\t\t\t}\n\t\t\tthis.scoreboards = scoreboards;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void loadConfig() throws IOException {\n File bStatsFolder = new File(plugin.getDataFolder().getParentFile(), \"bStats\");\n File configFile = new File(bStatsFolder, \"config.yml\");\n Config config = new Config(configFile);\n \n // Check if the config file exists\n if (!config.exists(\"serverUuid\")) {\n // Add default values\n config.set(\"enabled\", true);\n // Every server gets it's unique random id.\n config.set(\"serverUuid\", UUID.randomUUID().toString());\n // Should failed request be logged?\n config.set(\"logFailedRequests\", false);\n // Should the sent data be logged?\n config.set(\"logSentData\", false);\n // Should the response text be logged?\n config.set(\"logResponseStatusText\", false);\n \n DumperOptions dumperOptions = new DumperOptions();\n dumperOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);\n writeFile(configFile,\n \"# bStats collects some data for plugin authors like how many servers are using their plugins.\",\n \"# To honor their work, you should not disable it.\",\n \"# This has nearly no effect on the server performance!\",\n \"# Check out https://bStats.org/ to learn more :)\",\n new Yaml(dumperOptions).dump(config.getRootSection()));\n }\n \n // Load the data\n enabled = config.getBoolean(\"enabled\", true);\n serverUUID = config.getString(\"serverUuid\");\n logFailedRequests = config.getBoolean(\"logFailedRequests\", false);\n logSentData = config.getBoolean(\"logSentData\", false);\n logResponseStatusText = config.getBoolean(\"logResponseStatusText\", false);\n }", "@SuppressWarnings(\"unchecked\")\n public static void load() {\n\n System.out.print(\"Loading team data from file...\");\n\n try {\n\n String team_fil = config.Server.serverdata_file_location + \"/teams.ser\";\n\n FileInputStream fil = new FileInputStream(team_fil);\n ObjectInputStream in = new ObjectInputStream(fil);\n\n team_list = (ConcurrentHashMap<Integer, Team>) in.readObject();\n cleanTeams();\n\n fil.close();\n in.close();\n\n //Gå gjennom alle lagene og registrer medlemmene i team_members.\n Iterator<Team> lag = team_list.values().iterator();\n\n while (lag.hasNext()) {\n\n Team laget = lag.next();\n\n Iterator<TeamMember> medlemmer = laget.getTeamMembers();\n while (medlemmer.hasNext()) {\n registerMember(medlemmer.next().getCharacterID(), laget.getTeamID());\n }\n\n }\n\n System.out.println(\"OK! \" + team_list.size() + \" teams loaded.\");\n\n } catch (Exception e) {\n System.out.println(\"Error loading team data from file.\");\n }\n\n }", "public void readCpuStat() {\n\t\ttry {\n\t\t\t// monitor total and idle cpu stat of certain process\n\t\t\tRandomAccessFile cpuInfo = new RandomAccessFile(\"/proc/stat\", \"r\");\n\t\t\tString[] toks = cpuInfo.readLine().split(\"\\\\s+\");\n\t\t\tidleCpu = Long.parseLong(toks[4]);\n\t\t\ttotalCpu = Long.parseLong(toks[1]) + Long.parseLong(toks[2])\n\t\t\t\t\t+ Long.parseLong(toks[3]) + Long.parseLong(toks[4])\n\t\t\t\t\t+ Long.parseLong(toks[6]) + Long.parseLong(toks[5])\n\t\t\t\t\t+ Long.parseLong(toks[7]);\n\t\t\tcpuInfo.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t} catch (IOException e) {\n\t\t}\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}", "static Stats readFrom(ByteBuffer buffer) {\n/* 568 */ Preconditions.checkNotNull(buffer);\n/* 569 */ Preconditions.checkArgument(\n/* 570 */ (buffer.remaining() >= 40), \"Expected at least Stats.BYTES = %s remaining , got %s\", 40, buffer\n/* */ \n/* */ \n/* 573 */ .remaining());\n/* 574 */ return new Stats(buffer\n/* 575 */ .getLong(), buffer\n/* 576 */ .getDouble(), buffer\n/* 577 */ .getDouble(), buffer\n/* 578 */ .getDouble(), buffer\n/* 579 */ .getDouble());\n/* */ }", "public void loadGame(File fileLocation, boolean replay);", "public static void load(){\n\t\tinbattle=true;\n\t\ttry{\n\t\t\tFile f=new File(Constants.PATH+\"\\\\InitializeData\\\\battlesavefile.txt\");\n\t\t\tScanner s=new Scanner(f);\n\t\t\tturn=s.nextInt();\n\t\t\ts.nextLine();\n\t\t\tString curr=s.next();\n\t\t\tif(curr.equals(\"WildTrainer:\"))\n\t\t\t\topponent=WildTrainer.readInTrainer(s);\n\t\t\telse if(curr.equals(\"EliteTrainer:\"))\n\t\t\t\topponent=EliteTrainer.readInTrainer(s);\n\t\t\telse if(curr.equals(\"Trainer:\"))\n\t\t\t\topponent=Trainer.readInTrainer(s);\n\t\t\tSystem.out.println(\"Initializing previous battle against \"+opponent.getName());\n\t\t\tcurr=s.next();\n\t\t\tallunits=new ArrayList<Unit>();\n\t\t\tpunits=new ArrayList<Unit>();\n\t\t\tounits=new ArrayList<Unit>();\n\t\t\twhile(!curr.equals(\"End\")){\n\t\t\t\tpunits.add(Unit.readInUnit(null,s));\n\t\t\t\tcurr=s.next();\n\t\t\t}\n\t\t\ts.nextLine();// Player Units\n\t\t\tcurr=s.next();\n\t\t\twhile(!curr.equals(\"End\")){\n\t\t\t\tounits.add(Unit.readInUnit(opponent,s));\n\t\t\t\tcurr=s.next();\n\t\t\t}\n\t\t\ts.nextLine();// Opponent Units\n\t\t\tallunits.addAll(punits);\n\t\t\tallunits.addAll(ounits);\n\t\t\tpriorities=new ArrayList<Integer>();\n\t\t\tint[] temp=GameData.readIntArray(s.nextLine());\n\t\t\tfor(int i:temp){\n\t\t\t\tpriorities.add(i);\n\t\t\t}\n\t\t\txpgains=GameData.readIntArray(s.nextLine());\n\t\t\tspikesplaced=s.nextBoolean();\n\t\t\tnumpaydays=s.nextInt();\n\t\t\tactiveindex=s.nextInt();\n\t\t\tactiveunit=getUnitByID(s.nextInt());\n\t\t\tweather=Weather.valueOf(s.next());\n\t\t\tweatherturn=s.nextInt();\n\t\t\ts.nextLine();\n\t\t\tbfmaker=new LoadExistingBattlefieldMaker(s);\n\t\t\tinitBattlefield();\n\t\t\tplaceExistingUnits();\n\t\t\tMenuEngine.initialize(new UnitMenu(activeunit));\n\t\t}catch(Exception e){e.printStackTrace();System.out.println(e.getCause().toString());}\n\t}", "String readScore(){\n try\n {\n char[] allAtOnce = new char[(int)scores.length()];\n int charsRead = fr.read(allAtOnce);\n currentScores = String.valueOf(allAtOnce);\n fr.close();//close the file\n fr = new BufferedReader(new FileReader(scores));\n }\n \n catch(IOException e)\n {\n e.printStackTrace();\n }\n return (String.valueOf(currentScores));\n }", "public void readFile(){\n try {\n highscores = new ArrayList<>();\n BufferedReader br = new BufferedReader(new FileReader(\"Highscores.txt\"));\n String line = br.readLine();\n while (line != null){\n try{\n highscores.add(Integer.parseInt(line));\n } catch (NumberFormatException e){}\n line = br.readLine();\n }\n br.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"No file found\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static Statistics deserialize() {\n // checks if the file exists at the directory\n if (data.exists()) {\n FileInputStream fileInput = null;\n ObjectInputStream inStream = null;\n // deserializes the object\n try {\n fileInput = new FileInputStream(data);\n inStream = new ObjectInputStream(fileInput);\n Object obj1 = inStream.readObject();\n if (obj1 instanceof Statistics)\n return (Statistics) obj1;\n } catch (Exception e) {\n } finally {\n try {\n if (inStream != null)\n inStream.close();\n } catch (Exception e) {\n }\n }\n }\n // returns a new Statistics object if no file was found\n return new Statistics();\n }", "private void parse() throws IOException {\n\n\t\tStats statsObject = new Stats();\n\n\t\tstatsObject.setProcessName(process);\n\n\t\tList<String> lines = Files.readAllLines(Paths.get(filename), Charset.defaultCharset());\n\n\t\tPattern timePattern = Pattern.compile(\"((\\\\d+)-)*(\\\\d+)\\\\W((\\\\d+):)*(\\\\d+)\\\\.(\\\\d+)\");\n\n\t\tSystem.out.println(filename+\" \"+lines.get(0));\n\t\tMatcher matcher = timePattern.matcher(lines.get(0));\n\t\twhile (matcher.find()) {\n\t\t\tstatsObject.setStartTime(matcher.group(0));\n\t\t\tbreak;\n\t\t}\n\n\t\tmatcher = timePattern.matcher(lines.get(lines.size() - 1));\n\t\twhile (matcher.find()) {\n\t\t\tstatsObject.setEndTime(matcher.group(0));\n\t\t\tbreak;\n\t\t}\n\t\tString error = new String();\n\t\tfor (String line : lines) {\n\n\t\t\tif (line.startsWith(\"[\")) {\n\t\t\t\tif (!error.isEmpty()) {\n\t\t\t\t\tstatsObject.addError(error);\n\t\t\t\t\terror = \"\";\n\t\t\t\t}\n\n\t\t\t\tif (line.contains(\"Number of records processed: \")) {\n\n\t\t\t\t\tPattern numberPattern = Pattern.compile(\"\\\\d+\");\n\t\t\t\t\tmatcher = numberPattern.matcher(line);\n\t\t\t\t\t\n\t\t\t\t\tString numberOfRecordsProcessed = \"N/A\";\n\t\t\t\t\t\n\t\t\t\t\twhile (matcher.find()) {\n\t\t\t\t\t\tnumberOfRecordsProcessed = matcher.group();\n\t\t\t\t\t}\n\t\t\t\t\tstatsObject.setRecordsProcessed(numberOfRecordsProcessed);\n\n\t\t\t\t}\n\n\t\t\t\telse if (line.contains(\"WARNING\")) {\n\t\t\t\t\tif (line.contains(\"MISSING Property\")) {\n\t\t\t\t\t\tstatsObject.incrementErrorCounter();\n\t\t\t\t\t\tstatsObject.addError(line);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstatsObject.incrementWarningCounter();\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else if (line.contains(\"Exception\") || (line.contains(\"Error\"))) {\n\t\t\t\tif (!error.isEmpty()) {\n\t\t\t\t\tstatsObject.addError(error);\n\t\t\t\t\terror = \"\";\n\t\t\t\t}\n\t\t\t\tstatsObject.incrementErrorCounter();\n\t\t\t\terror = error + line;\n\t\t\t} else {\n\t\t\t\terror = error + line ;\n\t\t\t}\n\n\t\t}\n\t\t// reader.close();\n\t\tif (statsObject.getErrorCounter() > 0) {\n\t\t\tstatsObject.setStatus(\"Failure\");\n\t\t}\n\n\t\tPattern pattern = Pattern.compile(\"\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\");\n\t\tmatcher = pattern.matcher(filename);\n\t\tString date = null;\n\t\twhile (matcher.find()) {\n\t\t\tdate = matcher.group(0);\n\t\t\tbreak;\n\t\t}\n\t\tboolean saveSuccessful = OutputManipulator.addToStatFile(username, process, date, statsObject);\n\n\t\tif (saveSuccessful) {\n\t\t\tFileParseScheduler.addSuccessfulParsedFileName(username, process, filename);\n\t\t}\n\n\t\tFileParseScheduler.removeLatestKilledThreads(process + filename);\n\t}", "private void loadGame(String fileName){\n\n }", "public void load() throws IOException, ClassNotFoundException {\n\t\ttry {\n\t\t\t// use buffering\n\t\t\tFile gamesInFile = new File(\"games.txt\");\n\t\t\tif (!gamesInFile.exists())\n\t\t\t\tSystem.out.println(\"First run\");\n\t\t\telse {\n\t\t\t\tInputStream file = new FileInputStream(gamesInFile);\n\t\t\t\tInputStream buffered = new BufferedInputStream(file);\n\t\t\t\tObjectInput input = new ObjectInputStream(buffered);\n\t\t\t\ttry {\n\t\t\t\t\t// deserialize the List\n\t\t\t\t\tArrayList<MancalaGame> gamesFromFile = (ArrayList<MancalaGame>) input.readObject();\n\t\t\t\t\tgames = gamesFromFile;\n\t\t\t\t} finally {\n\t\t\t\t\tinput.close();\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tSystem.out.println(\"Load successful\");\n\t\t}\n\t}", "private void loadDocStatFromFile(String path) {\n docStat = new HashMap<String, Integer>();\n List<String> stats = fu.textFileToList(path);\n int totLength = 0;\n for (String stat : stats) {\n String docID = stat.split(\" \")[0];\n int docLen = Integer.parseInt(stat.split(\" \")[1]);\n totLength += docLen;\n docStat.put(docID, docLen);\n }\n avdl = totLength / N;\n }", "public void loadGame(){\n\n try {\n input = new FileInputStream(fileName);\n properties.load(input);\n System.out.println(\"--- LOADING GAMEFILE PROPERTIES ---\");\n\n int highestReachedLevel = getHighestLevelFromProperties();\n GameModel.getInstance().setHighestCompletedLevel(highestReachedLevel);\n\n GameModel.getInstance().setfirstTimePlay(false);\n\n //TODO: Save properties to gameModel\n\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO LOAD GAME ---\");\n GameModel.getInstance().setfirstTimePlay(true);\n e.printStackTrace();\n } finally {\n if (input != null) {\n try {\n input.close();\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO CLOSE INTPUT ---\");\n e.printStackTrace();\n }\n }\n }\n\n }", "public void readAll() throws FileNotFoundException{ \n b = new BinaryIn(this.filename);\n this.x = b.readShort();\n this.y = b.readShort();\n \n int count = (x * y) / (8 * 8);\n this.blocks = new double[count][8][8][3];\n \n Node juuri = readTree();\n readDataToBlocks(juuri);\n }", "public void readVotes(File inFile);", "public static void saveStats() {\r\n\t\tif(Main.optionsCheckbox.getState()) FileUtils.exportGameOptions();\r\n\t\t\r\n\t\tif(Main.isFourHandedTeams) {\r\n\t\t\tif(Main.team1Checkbox.getState()) FileUtils.exportTeamFile(Main.teamOne);\r\n\t\t\tif(Main.team2Checkbox.getState()) FileUtils.exportTeamFile(Main.teamTwo);\r\n\t\t\tif(Main.teamPreviousCheckbox.getState()) FileUtils.exportTeamFile(Main.teamPrevious);\r\n\t\t}\r\n\t\t\r\n\t\tif(Main.isFourHandedSingle) {\r\n\t\t\tif(Main.player1Checkbox.getState()) FileUtils.exportPlayerFile(Main.playerOne);\r\n\t\t\tif(Main.player2Checkbox.getState()) FileUtils.exportPlayerFile(Main.playerTwo);\r\n\t\t\tif(Main.player3Checkbox.getState()) FileUtils.exportPlayerFile(Main.playerThree);\r\n\t\t\tif(Main.player4Checkbox.getState()) FileUtils.exportPlayerFile(Main.playerFour);\r\n\t\t\tif(Main.playerPreviousCheckbox.getState()) FileUtils.exportPlayerFile(Main.playerPrevious);\r\n\t\t}\r\n\t\t\r\n\t\tif(Main.isThreeHanded) {\r\n\t\t\tif(Main.player1Checkbox.getState()) FileUtils.exportPlayerFile(Main.playerOne);\r\n\t\t\tif(Main.player2Checkbox.getState()) FileUtils.exportPlayerFile(Main.playerTwo);\r\n\t\t\tif(Main.player3Checkbox.getState()) FileUtils.exportPlayerFile(Main.playerThree);\r\n\t\t\tif(Main.playerPreviousCheckbox.getState()) FileUtils.exportPlayerFile(Main.playerPrevious);\r\n\t\t}\r\n\t}", "public void loadState() throws IOException, ClassNotFoundException {\n\t\tFile f = new File(workingDirectory() + File.separator + id() + FILE_EXTENSION);\n\t\t\n\t\t// load client state from file\n\t\tObjectInputStream is = new ObjectInputStream(new FileInputStream(f));\n\t\tTrackerDaemon client = (TrackerDaemon) is.readObject();\n\t\tis.close();\n\t\t\n\t\t// copy attributes\n\t\tthis.peerRecord = client.peerRecord();\n\t\t\n\t}", "public static void readFile(String filename) {\n JSONParser jsonParser = new JSONParser();\n try (Reader reader = new FileReader(filename)) {\n JSONObject jo = (JSONObject) jsonParser.parse(reader);\n\n SHORT_PERIOD = (int) (long) jo.get(\"shortPeriod\");\n LONG_PERIOD = (int) (long) jo.get(\"longPeriod\");\n AVG_AMOUNT_PERIOD = (int) (long) jo.get(\"avgAmountPeriod\");\n SESSION_INTERVAL = (int) (long) jo.get(\"sessionInterval\");\n\n\n } catch (IOException | ParseException e) {\n e.printStackTrace();\n }\n }", "public static scoreSheet readStats(String user)\n \t{\n \t\tScanner stats;\n \t\tString current;\n \t\ttry {\n \t\t\tstats = new Scanner(statisticsFile);\n \t\t} catch (FileNotFoundException e) {\n \t\t\treturn null;\n \t\t}\n \t\twhile (stats.hasNext())\n \t\t{\n \t\t\tcurrent = stats.nextLine();\n \t\t\tif (current.equals(user))\n \t\t\t{\n \t\t\t\treturn new scoreSheet(user, Integer.parseInt(stats.nextLine()), Integer.parseInt(stats.nextLine()), \n \t\t\t\t\t\t\t\t\tInteger.parseInt(stats.nextLine()), Integer.parseInt(stats.nextLine()), \n \t\t\t\t\t\t\t\t\tInteger.parseInt(stats.nextLine()));\n \t\t\t}\n \t\t}\n \t\t\treturn null;\n \t}", "public void readData() throws FileNotFoundException {\n this.plane = readPlaneDimensions();\n this.groupBookingsList = readBookingsList();\n }", "public void readFromFile() {\n\n\t}", "public void updateTwoPlayersStatsInStats(PlayerStats stats1, PlayerStats stats2) throws IOException {\r\n\t\tScanner statsReader = new Scanner(new BufferedReader(new FileReader(\"statistics.txt\")));\r\n\t\tint numberOfPlayers;\r\n\t\tnumberOfPlayers = statsReader.nextInt();\r\n\t\tPlayerStats[] statsDirectory = new PlayerStats[numberOfPlayers];\r\n\t\t\r\n\t\tfor(int count = 0; count < numberOfPlayers; count++) {\r\n\t\t\tPlayerStats tempPlayerStats = new PlayerStats();\r\n\t\t\t/* load temporary stats object with stats */\r\n\t\t\treadPlayerStats(tempPlayerStats, statsReader);\r\n\t\t\t/* add new stats object to directory */\r\n\t\t\tstatsDirectory[count] = tempPlayerStats;\r\n\t\t}\r\n\t\t\r\n\t\tstatsReader.close();\r\n\t\t\r\n\t\t/* update the stats of the two players */\r\n\t\tfor(int index = 0; index < numberOfPlayers; index++) {\r\n\t\t\tif((statsDirectory[index].username).equals(stats1.username) == true) { // modify first player stats\r\n\t\t\t\tsetPlayerStats(statsDirectory[index], stats1);\r\n\t\t\t}\r\n\t\t\telse if((statsDirectory[index].username).equals(stats2.username) == true) { // modify second player stats\r\n\t\t\t\tsetPlayerStats(statsDirectory[index], stats2);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/* rewrite the statistics file with updated user stats */\r\n\t\tFileWriter writer = new FileWriter(\"statistics.txt\");\r\n\t\tBufferedWriter statsWriter = new BufferedWriter(writer);\r\n\t\tInteger numPlayers = numberOfPlayers;\r\n\t\tstatsWriter.write(numPlayers.toString()); // write the number of players\r\n\t\tstatsWriter.write(\"\\n\");\r\n\t\t\r\n\t\tfor(int count = 0; count < numberOfPlayers; count++) {\r\n\t\t\tstatsWriter.write(statsDirectory[count].playerStatsToString()); // write player to statistics.txt\r\n\t\t}\r\n\t\t\r\n\t\tstatsWriter.close();\r\n\t}", "private void loadGameFiles(){\n\t}", "private void loadFromFile() {\n\t\ttry {\n\t\t\tFileInputStream fis = openFileInput(FILENAME);\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(fis));\n\t\t\tString line = in.readLine();\n\t\t\tGson gson = new Gson();\n\t\t\twhile (line != null) {\n\t\t\t\tCounterModel counter = gson.fromJson(line, CounterModel.class);\n\t\t\t\tif (counterModel.getCounterName().equals(counter.getCounterName())) {\n\t\t\t\t\tcounterListModel.addCounterToList(counterModel);\n\t\t\t\t\tcurrentCountTextView.setText(Integer.toString(counterModel.getCount()));\n\t\t\t\t} else {\n\t\t\t\t\tcounterListModel.addCounterToList(counter);\n\t\t\t\t}\n\t\t\t\tline = in.readLine();\n\t\t\t} \n\t\t\tfis.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void ReadAchievements()\n {\n try\n {\n BufferedReader file = new BufferedReader(new FileReader(achievements_file_name));\n int actualLine = 0, nb_achievements_done = 0;\n while(actualLine<Achievement.NB_ACHIEVEMENTS)\n {\n boolean currentValue = Utilities.IntToBool(Integer.parseInt(file.readLine()));\n Achievement.achievements_done[actualLine] = currentValue;\n if(currentValue)\n nb_achievements_done++;\n actualLine++;\n }\n file.close();\n Achievement.nb_achievements_done = nb_achievements_done;\n Achievement.CheckAllAchievements();\n } \n catch (Exception e) { SaveAchievements(); }\n }", "public GameInfo getGameInfo() throws InterruptedException, IOException, URISyntaxException {\n String json = caller.GET(\"game/status\");\n\n GsonBuilder builder = new GsonBuilder();\n builder.registerTypeAdapter(GameInfo.class, new GameInfoDeserializer());\n\n Gson gson = builder.create();\n\n return gson.fromJson(json, GameInfo.class);\n }", "public void readVisits() {\n try {\n FileInputStream fileIn = new FileInputStream(\"temp/visits.ser\");\n ObjectInputStream in = new ObjectInputStream(fileIn);\n visits = (HashMap<Date, Member>) in.readObject();\n in.close();\n fileIn.close();\n } catch (IOException e) {\n visits = new HashMap<>();\n } catch (ClassNotFoundException c) {\n System.out.println(\"Class HashMap not found\");\n c.printStackTrace();\n return;\n }\n\n }", "public void load() throws IOException {\r\n File file = new File(this.filename);\r\n //if file exist.\r\n if (file.exists() && !file.isDirectory()) {\r\n ObjectInputStream is = null;\r\n try {\r\n //opening and reaind the source file\r\n is = new ObjectInputStream(new FileInputStream(this.filename));\r\n SettingsFile temp = (SettingsFile) is.readObject();\r\n //import the loaded file data to the current core.SettingsFile\r\n this.boardSize = temp.getBoardSize();\r\n this.firstPlayer = temp.getFirstPlayer();\r\n this.secondPlayer = temp.getSecondPlayer();\r\n this.player1Color = temp.getPlayer1Color();\r\n this.player2Color = temp.getPlayer2Color();\r\n } catch (IOException e) {\r\n System.out.println(\"Error while loading\");\r\n } catch (ClassNotFoundException e) {\r\n System.out.println(\"Problem with class\");\r\n } finally {\r\n if (is != null) {\r\n is.close();\r\n }\r\n }\r\n }\r\n //if no file, set default settings.\r\n else {\r\n save(SIZE, FIRST_PLAYER, SECOND_PLAYER, PLAYER1COLOR, PLAYER2COLOR);\r\n }\r\n }", "public void setGameFromState(String filePath, int boardSize) {\n File readFile = new File(filePath);\n\n int whiteScore = 0;\n int blackScore = 0;\n String turn = \"black\";\n int endBoardLine;\n String human = \"black\";\n\n if (boardSize == 6) {\n endBoardLine = 8;\n } else if (boardSize == 8) {\n endBoardLine = 10;\n } else {\n endBoardLine = 12;\n }\n\n try (BufferedReader bufferedReader = new BufferedReader(new FileReader(readFile))) {\n String line;\n int lineCounter = 0;\n\n while ((line = bufferedReader.readLine()) != null) {\n if (lineCounter == 0) {\n blackScore = Integer.parseInt(line.substring(7));\n } else if (lineCounter == 1) {\n whiteScore = Integer.parseInt(line.substring(7));\n } else if (lineCounter >= 3 && lineCounter <= endBoardLine) {\n for (int c = 0; c < line.length(); c += 2) {\n if (line.charAt(c) == 'B') {\n boardObject.setSlotColor(boardObject.getSlot(lineCounter - 3, c / 2), Slot.BLACK);\n } else if (line.charAt(c) == 'W') {\n boardObject.setSlotColor(boardObject.getSlot(lineCounter - 3, c / 2), Slot.WHITE);\n } else if (line.charAt(c) == 'O') {\n boardObject.setSlotColor(boardObject.getSlot(lineCounter - 3, c / 2), Slot.EMPTY);\n }\n }\n } else if (lineCounter == endBoardLine + 1) {\n turn = line.substring(13);\n } else if (lineCounter == endBoardLine + 2) {\n human = line.substring(7);\n }\n\n lineCounter++;\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n playerWhite.setScore(whiteScore);\n playerBlack.setScore(blackScore);\n\n if (turn.equals(\"White\")) {\n playerWhite.setIsTurn(true);\n playerBlack.setIsTurn(false);\n } else {\n playerBlack.setIsTurn(true);\n playerWhite.setIsTurn(false);\n }\n\n if (human.equals(\"White\")) {\n playerWhite.setComputer(false);\n playerBlack.setComputer(true);\n } else {\n playerWhite.setComputer(true);\n playerBlack.setComputer(false);\n }\n }", "public UserInfo readData()\n\t{\n\t\t\n\t\tIterator<UserInfo> itr= iterator();\n\t\tUserInfo info;\n\t\tSystem.out.println(\"file has been read!\");\n\t\twhile(itr.hasNext()) {\n\t\t\t\n\t\t\tinfo= itr.next();\n\t\t\tif( info.getUrl().equalsIgnoreCase(file)) {\n\t\t\t\t\n\t\t\t\treturn info;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public void readAchievements() {\n\t\tDataStorage dataStorage = new DataStorage();\n\t\tjsonObject = JsonObject.readFrom(dataStorage.getAchievements()); // readFrom is buffered\n\t}", "public static ArrayList<Player> readPlayersFromFile() \r\n {\r\n //Inisialize Arraylist \r\n ArrayList<Player> players = new ArrayList<Player>();\r\n //Inisialize FileInputStream\r\n FileInputStream fileIn = null;\r\n\r\n try \r\n {\r\n //Establish connection to file \r\n fileIn = new FileInputStream(\"players.txt\");\r\n while (true) \r\n {\r\n //Create an ObjectOutputStream \r\n ObjectInputStream objectIn = new ObjectInputStream(fileIn);\r\n //Read a Player object from the file and add it to the ArrayList\r\n players.add((Player)objectIn.readObject());\r\n }//end while\r\n\r\n }\r\n catch (Exception e)\r\n {\r\n //System.out.println(e);\r\n }\r\n finally \r\n {\r\n usernamesTaken.clear();\r\n\r\n for(int i = 0; i < players.size(); i++)\r\n {\r\n usernamesTaken.add(players.get(i).getUsername());\r\n }//end for\r\n\r\n //Try to close the file and return the ArrayList\r\n try\r\n {\r\n //Check if the end of the file is reached\r\n if (fileIn != null)\r\n { \r\n //Close the file \r\n fileIn.close();\r\n //Return the ArrayList of players\r\n return players;\r\n }\r\n }\r\n catch (Exception e)\r\n {\r\n //System.out.println(e)\r\n }//end try \r\n\r\n //Return null if there is an excetion \r\n return null;\r\n }//end try \r\n }", "static String[] readPlayerData() throws FileNotFoundException{\n\t\tjava.io.File player = new java.io.File(\"Players/\" + Player.getName() +\".txt\");\n\t\tjava.util.Scanner fileScanner = new java.util.Scanner(player); \n\t\tString[] tempPlayerData = new String[17];\n\t\tint counter = 0;\n\t\twhile (fileScanner.hasNextLine()) {\n\t\t\tString s = fileScanner.nextLine();\n\t\t\tif (!s.startsWith(\"#\")){\n\t\t\t\ttempPlayerData[counter] = s;\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t}\n\t\tfileScanner.close();\n\t\treturn tempPlayerData;\n\t}", "private void getCoins() throws IOException{\r\n\t\tFile file = new File(\".coinSave\");\r\n\t\tif (! file.exists()) {\r\n\t\t\tfile.createNewFile();\r\n\t\t} else {\r\n\t\t\tFileReader fr = new FileReader(file);\r\n\t\t\tBufferedReader br = new BufferedReader(fr);\r\n\t\t\tString str;\r\n\t\t\tstr = br.readLine();\r\n\t\t\t_hiddenCoins = Integer.parseInt(str);\r\n\t\t}\r\n\t}", "public void update() throws IOException {\n\n\t\tif(this.bdgDataColIdx < 4){\n\t\t\tSystem.err.println(\"Invalid index for bedgraph column of data value. Resetting to 4. Expected >=4. Got \" + this.bdgDataColIdx);\n\t\t\tthis.bdgDataColIdx= 4;\n\t\t}\n\n\t\tif(Utils.getFileTypeFromName(this.getFilename()).equals(TrackFormat.BIGWIG)){\n\t\t\t\n\t\t\tbigWigToScores(this.bigWigReader);\n\t\t\t\n\t\t} else if(Utils.getFileTypeFromName(this.getFilename()).equals(TrackFormat.TDF)){\n\n\t\t\tthis.screenWiggleLocusInfoList= \n\t\t\t\t\tTDFUtils.tdfRangeToScreen(this.getFilename(), this.getGc().getChrom(), \n\t\t\t\t\t\t\tthis.getGc().getFrom(), this.getGc().getTo(), this.getGc().getMapping());\n\t\t\t\n\t\t\tArrayList<Double> screenScores= new ArrayList<Double>();\n\t\t\tfor(ScreenWiggleLocusInfo x : screenWiggleLocusInfoList){\n\t\t\t\tscreenScores.add((double)x.getMeanScore());\n\t\t\t}\n\t\t\tthis.setScreenScores(screenScores);\t\n\t\t\t\n\t\t} else if(Utils.getFileTypeFromName(this.getFilename()).equals(TrackFormat.BEDGRAPH)){\n\n\t\t\t// FIXME: Do not use hardcoded .samTextViewer.tmp.gz!\n\t\t\tif(Utils.hasTabixIndex(this.getFilename())){\n\t\t\t\tbedGraphToScores(this.getFilename());\n\t\t\t} else if(Utils.hasTabixIndex(this.getFilename() + \".samTextViewer.tmp.gz\")){\n\t\t\t\tbedGraphToScores(this.getFilename() + \".samTextViewer.tmp.gz\");\n\t\t\t} else {\n\t\t\t\tblockCompressAndIndex(this.getFilename(), this.getFilename() + \".samTextViewer.tmp.gz\", true);\n\t\t\t\tbedGraphToScores(this.getFilename() + \".samTextViewer.tmp.gz\");\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new RuntimeException(\"Extension (i.e. file type) not recognized for \" + this.getFilename());\n\t\t}\n\t\tthis.setYLimitMin(this.getYLimitMin());\n\t\tthis.setYLimitMax(this.getYLimitMax());\n\t}", "public static void readLotteryFiles() {\n\t\tfor (int index = 0; index < NpcHandler.npcs.length; index++) {\n\t\t\tNpc npc = NpcHandler.npcs[index];\n\t\t\tif (npc == null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (npc.npcType == 11057) {\n\t\t\t\tlotteryNpcIndex = npc.npcIndex;\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\ttotalTicketsPurchased = Integer.parseInt(FileUtility.readFirstLine(TOTAL_TICKETS_FILE));\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tArrayList<String> data = FileUtility.readFile(LOTTERY_ENTRIES_FILE);\n\t\tfor (int index = 0; index < data.size(); index++) {\n\t\t\tString parse[] = data.get(index).split(ServerConstants.TEXT_SEPERATOR);\n\t\t\tString name = parse[0];\n\t\t\tint ticketsPurchased = Integer.parseInt(parse[1]);\n\t\t\tLotteryDatabase.lotteryDatabase.add(new LotteryDatabase(name, ticketsPurchased));\n\t\t}\n\t}", "private String getStringStat(int index) {\n String[] scores = readFromFile().split(\"\\n\");\n String[] stats = scores[currPlayer].split(\",\");\n return stats[index];\n }", "public void readTable() {\r\n\r\n try ( BufferedReader b = new BufferedReader(new FileReader(\"Hashdata.txt\"))) {\r\n\r\n String line;\r\n ArrayList<String> arr = new ArrayList<>();\r\n while ((line = b.readLine()) != null) {\r\n\r\n arr.add(line);\r\n }\r\n\r\n for (String str : arr) {\r\n this.load(str);\r\n }\r\n this.print();\r\n\r\n } catch (IOException e) {\r\n System.out.println(\"Unable to read file\");\r\n }\r\n\r\n this.userInterface();\r\n\r\n }", "private void initializeFile()\n\t{\n\t\tHighScore[] h={new HighScore(0,0,\" \"),new HighScore(0,0,\" \"),new HighScore(0,0,\" \"),\n\t\t\t\tnew HighScore(0,0,\" \"),new HighScore(0,0,\" \"),new HighScore(0,0,\" \"),\n\t\t\t\tnew HighScore(0,0,\" \"),new HighScore(0,0,\" \"),new HighScore(0,0,\" \"),\n\t\t\t\tnew HighScore(0,0,\" \")};\n\t\ttry \n\t\t{\n\t\t\tSystem.out.println(\"Hi1\");\n\t\t\tObjectOutputStream o=new ObjectOutputStream(new FileOutputStream(\"HighScores.dat\"));\n\t\t\to.writeObject(h);\n\t\t\to.close();\n\t\t} catch (FileNotFoundException e) {e.printStackTrace();}\n\t\tcatch (IOException e) {e.printStackTrace();}\n\t}", "private static int readScore() {\n try {\n fis = activity.openFileInput(scoreFileName);\n BufferedReader br = new BufferedReader(new InputStreamReader(fis));\n String readLine = br.readLine();\n fis.close();\n br.close();\n Log.v(\"Setting score to: \", readLine);\n return Integer.parseInt(readLine);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return 0;\n }", "private int mRead() {\n\t\t// read in a full buffer of bytes from the file\n\t\tint bytesRead = rawBytes.length;\n\t\tif (loop) {\n\t\t\treadBytesLoop();\n\t\t} else {\n\t\t\tbytesRead = readBytes();\n\t\t}\n\t\t// convert them to floating point\n\t\tint frameCount = bytesRead / format.getFrameSize();\n\t\tsynchronized (buffer) {\n\t\t\tbuffer.setSamplesFromBytes(rawBytes, 0, format, 0, frameCount);\n\t\t}\n\n\t\treturn frameCount;\n\t}", "public static final Map<String, String> memoryStats(String filename) {\n kelondroFlexTable theFlexTable = (kelondroFlexTable) tableTracker.get(filename);\r\n return theFlexTable.memoryStats();\r\n }", "private void loadProfileFile(\n Path workingDirectory, String workSpaceName, String file, InfoListener listener) {\n ProfileInfo info;\n Path profileFile = workingDirectory.getRelative(file);\n try {\n info = ProfileInfo.loadProfileVerbosely(profileFile, listener);\n ProfileInfo.aggregateProfile(info, listener);\n } catch (IOException e) {\n listener.warn(\"Ignoring file \" + file + \" - cannot load: \" + e.getMessage());\n return;\n }\n\n summaryStatistics.addProfileInfo(info);\n\n EnumMap<ProfilePhase, PhaseStatistics> fileStatistics = new EnumMap<>(ProfilePhase.class);\n filePhaseStatistics.put(profileFile, fileStatistics);\n\n for (ProfilePhase phase : ProfilePhase.values()) {\n PhaseStatistics filePhaseStat =\n new PhaseStatistics(phase, info, workSpaceName, generateVfsStatistics);\n fileStatistics.put(phase, filePhaseStat);\n\n PhaseStatistics summaryPhaseStats;\n if (summaryPhaseStatistics.containsKey(phase)) {\n summaryPhaseStats = summaryPhaseStatistics.get(phase);\n } else {\n summaryPhaseStats = new PhaseStatistics(phase, generateVfsStatistics);\n summaryPhaseStatistics.put(phase, summaryPhaseStats);\n }\n summaryPhaseStats.add(filePhaseStat);\n }\n\n skylarkStatistics.addProfileInfo(info);\n\n missingActionsCount += info.getMissingActionsCount();\n }", "public synchronized int readBuf(String filename) {\n\t\t\n\t\t// find a buffer id that hasn't been used yet.\n\t\tint bufNum = 0;\n\t\twhile (_bufferMap.containsKey(bufNum))\n\t\t\tbufNum++;\n\n\t\t// add this buffer number to the map\n\t\t_bufferMap.put(bufNum, filename);\n\n\t\t// create and load the buffer\n\t\tsendMessage(\"/b_allocRead\", new Object[] { bufNum, filename });\n\t\tsendMessage(\"/sync\", new Object[]{bufNum + _bufferReadIdOffset});\n\t\treturn bufNum;\n\t}", "public void load(File filename) throws IOException {\n try {\n FileInputStream fis = new FileInputStream(filename);\n ObjectInputStream ois = new ObjectInputStream(fis);\n HighScoresTable table = (HighScoresTable) ois.readObject();\n ois.close();\n this.capacity = table.size();\n this.highScores = table.getHighScores();\n } catch (IOException e) {\n throw e;\n } catch (ClassNotFoundException e2) {\n System.out.println(e2);\n this.capacity = HighScoresTable.DEFAULT_CAPACITY;\n this.highScores.clear();\n System.out.println(\"table has been cleared. new size is: \" + HighScoresTable.DEFAULT_CAPACITY);\n }\n }", "private static void readFile(File file) throws IOException {\n try (FileInputStream is = new FileInputStream(file)) {\n byte[] buf = new byte[CHUNK];\n int count = 0;\n long t = System.nanoTime();\n for (int i = 0; i < N/CHUNK; i++) {\n int c = is.read(buf);\n if (c == -1) {\n System.out.println(\"EOF\");\n break;\n } else if (c < 10) {\n System.out.println(\"PARTIAL\");\n break;\n }\n count += c;\n }\n System.out.println((System.nanoTime() - t) / 1_000_000 + \" ms \" + count + \" bytes\");\n }\n }", "public void readScoresFromFile(File f) throws IOException, FileNotFoundException{\r\n\t\tBufferedReader br = null;\r\n\t\ttry{\r\n\t\t\tFileReader fr = new FileReader(f);\r\n\t\t\tbr = new BufferedReader(fr);\r\n\t\t\t\r\n\t\t\tString str = br.readLine();\r\n\t\t\t\r\n\t\t\tfor (int count = 0; count < scores.length; count++){\r\n\t\t\t\tscores[9-count] = new HighScore(str, SEPARATOR);\r\n\t\t\t\tstr = br.readLine();\r\n\t\t\t}\r\n\t\t} catch (Exception ex){\r\n\t\t\tSystem.err.println(\"Trouble with file: \"+ex.getMessage());\r\n\t\t} finally {\r\n\t\t\ttry{\r\n\t\t\t\tif (br != null){\r\n\t\t\t\t\tbr.close();\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception ex1){\r\n\t\t\t\tex1.printStackTrace();\r\n\t\t\t\tSystem.exit(-1);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void WiriteToBinary() throws IOException\n\t {\n\t\t\t\tDataOutputStream Output = new DataOutputStream (new FileOutputStream(\"GameProgress.dat\", true));\n\t\t\t\t\n\t\t\t\t//*************************************information to send using smtp\n\t\t\t\tOutput.write(pl.xCoord);\n\t\t\t\tOutput.write(pl.yCoord);\n\t\t\t\tOutput.write(pl.NumRockets);\t\n\t\t\t\tOutput.write(pl.NumBullets); \n\t\t\t\tOutput.write(pl.Health); \n\t\t\t\tOutput.write(DestroyedEnemies); \n\t\t\t\tOutput.write(RunAwayEnemies); \n\t\t\t\t\n\t\t\t\tfor (int i = 0 ; i < EnemyList.size(); i++ )\n\t\t\t\t{\n\t\t\t\t\tOutput.write(EnemyList.get(i).xCoord); \n\t\t\t\t\tOutput.write(EnemyList.get(i).xCoord); \n\t\t\t\t\tOutput.write(EnemyList.get(i).Health); \n\t\t\t\t}\n\t\t\t\t\n\t\t\tOutput.close(); \n\t }", "int load() {\n File file = new File(\"network.dat\");\n try (BufferedReader in = file.exists() ? new BufferedReader(new InputStreamReader(new FileInputStream(file))) : Gdx.files.internal(\"network.dat\").reader(1024)) {\n int generation = Integer.parseInt(in.readLine());\n for (int i = 0; i < weightLayer1.length; i++)\n weightLayer1[i] = Float.valueOf(in.readLine().trim());\n for (int i = 0; i < weightLayer2.length; i++)\n weightLayer2[i] = Float.valueOf(in.readLine().trim());\n return generation;\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"The Neural Network could not be loaded:\\n\" + e.getLocalizedMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\n }\n return -1;\n }", "private void updateFile() {\n\t\tPrintWriter outfile;\n\t\ttry {\n\t\t\toutfile = new PrintWriter(new BufferedWriter(new FileWriter(\"stats.txt\")));\n\t\t\toutfile.println(\"15\"); // this is the number\n\t\t\tfor (Integer i : storeInfo) {\n\t\t\t\toutfile.println(i); // we overwrite the existing files\n\t\t\t}\n\t\t\tfor (String s : charBought) {\n\t\t\t\toutfile.println(s); // overwrite the character\n\t\t\t}\n\t\t\tfor (String s : miscBought) {\n\t\t\t\toutfile.println(s);\n\t\t\t}\n\t\t\toutfile.close();\n\t\t}\n\t\tcatch (IOException ex) {\n\t\t\tSystem.out.println(ex);\n\t\t}\n\t}", "public ClickerCounterModel[] readObjectFromFile() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\ttry {\n\t\t\tFileInputStream inputStream = openFileInput(filename);\n\t\t\tInputStreamReader isr = new InputStreamReader(inputStream);\n\t\t\tBufferedReader bufferedReader = new BufferedReader(isr);\n\t\t\tString line;\n\t\t\twhile ((line = bufferedReader.readLine()) != null) {\n\t\t\t\tsb.append(line);\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} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t// use Gson to convert it into and object\n\t\tString json = sb.toString();\n\t\tGson gson = new Gson();\n\t\tClickerCounterModel[] object = gson.fromJson(json,\n\t\t\t\tClickerCounterModel[].class);\n\t\treturn object;\n\t}", "public Interface(String filename) throws FileNotFoundException \n {\n //read file for first time to find size of array\n File f = new File(filename);\n Scanner b = new Scanner(f);\n\n while(b.hasNextLine())\n {\n b.nextLine();\n arraySize++;\n }\n //create properly sized array\n array= new double[arraySize];\n //open and close the file, scanner class does not support rewinding\n b.close();\n b = new Scanner(f);\n //read input \n for(int i = 0; i < arraySize; i++)\n { \n array[i] = b.nextDouble();\n }\n //create a stats object of the proper size\n a = new Stats(arraySize);\n a.loadNums(array); //pass entire array to loadNums to allow Stats object a to have a pointer to the array\n }", "private void bedGraphToScores(String fileName) throws IOException{\n\t\t\n\t\tList<ScreenWiggleLocusInfo> screenWigLocInfoList= new ArrayList<ScreenWiggleLocusInfo>();\n\t\tfor(int i= 0; i < getGc().getUserWindowSize(); i++){\n\t\t\tscreenWigLocInfoList.add(new ScreenWiggleLocusInfo());\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tTabixReader tabixReader= new TabixReader(fileName);\n\t\t\tIterator qry= tabixReader.query(this.getGc().getChrom(), this.getGc().getFrom()-1, this.getGc().getTo());\n\t\t\twhile(true){\n\t\t\t\tString q = qry.next();\n\t\t\t\tif(q == null){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tString[] tokens= q.split(\"\\t\");\n\t\t\t\tint screenFrom= Utils.getIndexOfclosestValue(Integer.valueOf(tokens[1])+1, this.getGc().getMapping());\n\t\t\t\tint screenTo= Utils.getIndexOfclosestValue(Integer.valueOf(tokens[2]), this.getGc().getMapping());\n\t\t\t\tfloat value= Float.valueOf(tokens[this.bdgDataColIdx-1]);\n\t\t\t\tfor(int i= screenFrom; i <= screenTo; i++){\n\t\t\t\t\tscreenWigLocInfoList.get(i).increment(value);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\t\t\t\n\t\t\te.printStackTrace();\n\t\t\tSystem.err.println(\"Could not open tabix file: \" + fileName);\n\t\t\tSystem.err.println(\"Is the file sorted and indexed? After sorting by position (sort e.g. -k1,1 -k2,2n), compress with bgzip and index with e.g.:\");\n\t\t\tSystem.err.println(\"\\nbgzip \" + fileName);\n\t\t\tSystem.err.println(\"tabix -p bed \" + fileName + \"\\n\");\n\t\t}\n\t\tArrayList<Double> screenScores= new ArrayList<Double>();\n\t\tfor(ScreenWiggleLocusInfo x : screenWigLocInfoList){\n\t\t\tscreenScores.add((double)x.getMeanScore());\n\t\t}\n\t\tthis.setScreenScores(screenScores);\n\t\treturn;\n\t}", "public Account load() throws IOException {\n Account account = new Account();\n try {\n FileReader fileReader = new FileReader(fileName);\n BufferedReader bufferedReader = new BufferedReader(fileReader);\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n //if (line.contains(\"#\")) { continue; }\n String[] info = line.split(\" @ \");\n\n switch (info[0]) {\n case \"INIT\":\n account.setToInitialize(Boolean.parseBoolean(info[1]));\n break;\n case \"BS\":\n account.setBaseSavings(Float.parseFloat((info[1])));\n break;\n case \"INC\":\n parseIncome(info, account);\n break;\n case \"EXP\":\n parseExpenditure(info, account);\n break;\n case \"G\":\n parseGoal(info, account);\n break;\n case \"INS\":\n parseInstalment(info, account);\n break;\n case \"LOA\":\n parseLoan(info, account);\n break;\n case \"BAN\":\n parseBankAccount(info, account);\n break;\n default:\n throw new DukeException(\"OOPS!! Your file has been corrupted/ input file is invalid!\");\n }\n }\n bufferedReader.close();\n } catch (FileNotFoundException err) {\n final File parentDir = new File(\"dataFG\");\n parentDir.mkdir();\n final String hash = \"moneyAccount\";\n final String fileName = hash + \".txt\";\n final File file = new File(parentDir, fileName);\n file.createNewFile();\n } catch (IOException | DateTimeParseException | DukeException e) {\n e.printStackTrace();\n }\n return account;\n }", "private HashMap<String, Integer> loadFileQuestionUpvotes() {\n\t\tHashMap<String, Integer> upvotes = new HashMap<String, Integer>();\n\t\ttry {\n\t\t\tFileInputStream fileInputStream = context.openFileInput(SAVE_FILE);\n\t\t\tInputStreamReader inputStreamReader = new InputStreamReader(\n\t\t\t\t\tfileInputStream);\n\t\t\tType listType = new TypeToken<HashMap<String, Integer>>() {\n\t\t\t}.getType();\n\t\t\tGsonBuilder builder = new GsonBuilder();\n\t\t\tGson gson = builder.create();\n\t\t\tupvotes = gson.fromJson(inputStreamReader, listType);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn upvotes;\n\t}", "private void loadData() {\n\t\tlogger.trace(\"loadData() is called\");\n\t\t\n\t\ttry {\n\t\t\tFileInputStream fileIn = new FileInputStream(\"server-info.dat\");\n\t\t\tObjectInputStream in = new ObjectInputStream(fileIn);\n\t\t\tjokeFile = (String ) in.readObject();\n\t\t\tkkServerPort = (int) in.readObject();\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\tjokeFile = \"kk-jokes.txt\";\n\t\t\tkkServerPort = 5555;\n\t\t\t//e.printStackTrace();\n\t\t\tSystem.err.println(\"server-info.dat file is likely missing but it should be created automatically when this app is closed.\");\n\t\t\tlogger.info(\"server-info.dat file is likely missing but it should be created automatically when this app is closed.\");\n\t\t}\t\n\t}", "public void load (){\n try{\n FileInputStream fis = new FileInputStream(\"game.data\");\n ObjectInputStream o = new ObjectInputStream(fis);\n for (int i = 0; i < 8; i++){\n for (int j = 0; j < 8; j++){\n String loaded = o.readUTF();\n if (loaded.equals(\"null\")){\n Tiles[i][j].removePiece();\n }else if (loaded.equals(\"WhiteLeftKnight\")){\n Tiles[i][j].setPiece(WhiteLeftKnight);\n }else if (loaded.equals(\"WhiteRightKnight\")){\n Tiles[i][j].setPiece(WhiteRightKnight);\n }else if (loaded.equals(\"WhiteLeftBishop\")){\n Tiles[i][j].setPiece(WhiteLeftBishop);\n }else if (loaded.equals(\"WhiteRightBishop\")){\n Tiles[i][j].setPiece(WhiteRightBishop);\n }else if (loaded.equals(\"WhiteLeftRook\")){\n Tiles[i][j].setPiece(WhiteLeftRook);\n }else if (loaded.equals(\"WhiteRightRook\")){\n Tiles[i][j].setPiece(WhiteRightRook);\n }else if (loaded.equals(\"WhiteQueen\")){\n Tiles[i][j].setPiece(WhiteQueen);\n }else if (loaded.equals(\"WhiteKing\")){\n Tiles[i][j].setPiece(WhiteKing);\n }else if (loaded.equals(\"WhitePromotedRookPawn\")){\n Rook WhitePromotedRookPawn = new Rook(\"WhitePromotedRookPawn\");\n WhitePromotedRookPawn.setIcon(WhiteRookImg);\n Tiles[i][j].setPiece(WhitePromotedRookPawn);\n }else if (loaded.equals(\"WhitePromotedBishopPawn\")){\n Bishop WhitePromotedBishopPawn = new Bishop(\"WhitePromotedBishopPawn\");\n WhitePromotedBishopPawn.setIcon(WhiteBishopImg);\n Tiles[i][j].setPiece(WhitePromotedBishopPawn);\n }else if (loaded.equals(\"WhitePromotedKnightPawn\")){\n Knight WhitePromotedKnightPawn = new Knight(\"WhitePromotedKnightPawn\");\n WhitePromotedKnightPawn.setIcon(WhiteKnightImg);\n Tiles[i][j].setPiece(WhitePromotedKnightPawn);\n }else if (loaded.equals(\"WhitePromotedQueenPawn\")){\n Queen WhitePromotedQueenPawn = new Queen(\"WhitePromotedQueenPawn\");\n WhitePromotedQueenPawn.setIcon(WhiteQueenImg);\n Tiles[i][j].setPiece(WhitePromotedQueenPawn);\n }else if (loaded.equals(\"BlackLeftKnight\")){\n Tiles[i][j].setPiece(BlackLeftKnight);\n }else if (loaded.equals(\"BlackRightKnight\")){\n Tiles[i][j].setPiece(BlackRightKnight);\n }else if (loaded.equals(\"BlackLeftBishop\")){\n Tiles[i][j].setPiece(BlackLeftBishop);\n }else if (loaded.equals(\"BlackRightBishop\")){\n Tiles[i][j].setPiece(BlackRightBishop);\n }else if (loaded.equals(\"BlackLeftRook\")){\n Tiles[i][j].setPiece(BlackLeftRook);\n }else if (loaded.equals(\"BlackRightRook\")){\n Tiles[i][j].setPiece(BlackRightRook);\n }else if (loaded.equals(\"BlackQueen\")){\n Tiles[i][j].setPiece(BlackQueen);\n }else if (loaded.equals(\"BlackKing\")){\n Tiles[i][j].setPiece(BlackKing);\n }else if (loaded.equals(\"BlackPromotedQueenPawn\")){\n Queen BlackPromotedQueenPawn = new Queen(\"BlackPromotedQueenPawn\");\n BlackPromotedQueenPawn.setIcon(BlackQueenImg);\n Tiles[i][j].setPiece(BlackPromotedQueenPawn);\n }else if (loaded.equals(\"BlackPromotedRookPawn\")){\n Rook BlackPromotedRookPawn = new Rook(\"BlackPromotedRookPawn\");\n BlackPromotedRookPawn.setIcon(BlackRookImg);\n Tiles[i][j].setPiece(BlackPromotedRookPawn);\n }else if (loaded.equals(\"BlackPromotedBishopPawn\")){\n Bishop BlackPromotedBishopPawn = new Bishop(\"BlackPromotedBishopPawn\");\n BlackPromotedBishopPawn.setIcon(BlackBishopImg);\n Tiles[i][j].setPiece(BlackPromotedBishopPawn);\n }else if (loaded.equals(\"BlackPromotedKnightPawn\")){\n Knight BlackPromotedKnightPawn = new Knight(\"BlackPromotedKnightPawn\");\n BlackPromotedKnightPawn.setIcon(BlackKnightImg);\n Tiles[i][j].setPiece(BlackPromotedKnightPawn);\n }else if (loaded.equals(\"WhitePawn0\")){\n Tiles[i][j].setPiece(WhitePawns[0]);\n }else if (loaded.equals(\"WhitePawn1\")){\n Tiles[i][j].setPiece(WhitePawns[1]);\n }else if (loaded.equals(\"WhitePawn2\")){\n Tiles[i][j].setPiece(WhitePawns[2]);\n }else if (loaded.equals(\"WhitePawn3\")){\n Tiles[i][j].setPiece(WhitePawns[3]);\n }else if (loaded.equals(\"WhitePawn4\")){\n Tiles[i][j].setPiece(WhitePawns[4]);\n }else if (loaded.equals(\"WhitePawn5\")){\n Tiles[i][j].setPiece(WhitePawns[5]);\n }else if (loaded.equals(\"WhitePawn6\")){\n Tiles[i][j].setPiece(WhitePawns[6]);\n }else if (loaded.equals(\"WhitePawn7\")){\n Tiles[i][j].setPiece(WhitePawns[7]);\n }else if (loaded.equals(\"BlackPawn0\")){\n Tiles[i][j].setPiece(BlackPawns[0]);\n }else if (loaded.equals(\"BlackPawn1\")){\n Tiles[i][j].setPiece(BlackPawns[1]);\n }else if (loaded.equals(\"BlackPawn2\")){\n Tiles[i][j].setPiece(BlackPawns[2]);\n }else if (loaded.equals(\"BlackPawn3\")){\n Tiles[i][j].setPiece(BlackPawns[3]);\n }else if (loaded.equals(\"BlackPawn4\")){\n Tiles[i][j].setPiece(BlackPawns[4]);\n }else if (loaded.equals(\"BlackPawn5\")){\n Tiles[i][j].setPiece(BlackPawns[5]);\n }else if (loaded.equals(\"BlackPawn6\")){\n Tiles[i][j].setPiece(BlackPawns[6]);\n }else if (loaded.equals(\"BlackPawn7\")){\n Tiles[i][j].setPiece(BlackPawns[7]);\n }\n }\n }\n player = o.readInt();\n if (player == 1){\n area.setText(\"\\t\\t\\tPlayer \"+player+\" (White)\");\n }else{\n area.setText(\"\\t\\t\\tPlayer \"+player+\" (Black)\");\n }\n o.close();\n OriginalColor();\n }catch (Exception ex){\n\n }\n }", "public void updateScoreFile() {\n try {\n outputStream = new ObjectOutputStream(new FileOutputStream(HIGHSCORE_FILE));\n outputStream.writeObject(scores);\n } catch (FileNotFoundException e) {\n } catch (IOException e) {\n } finally {\n try {\n if (outputStream != null) {\n outputStream.flush();\n outputStream.close();\n }\n } catch (IOException e) {\n }\n }\n }", "public static List<Integer> readBinaryFile(String filename) throws IOException\n {\n List<Integer> binary = new ArrayList<>();\n\n FileInputStream inputStream = new FileInputStream(filename);\n BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);\n\n byte[] byteInput = bufferedInputStream.readAllBytes();\n\n String stringInput = new String(byteInput);\n\n for(char c : stringInput.toCharArray())\n {\n binary.add((int) (c - '0'));\n }\n\n return binary;\n }", "public HighScore[] getHighScores()\n\t{\n\t\tif (!new File(\"HighScores.dat\").exists())\n\t\t\tinitializeFile();\n\t\ttry \n\t\t{\n\t\t\tObjectInputStream o=new ObjectInputStream(new FileInputStream(\"HighScores.dat\"));\n\t\t\tHighScore[] h=(HighScore[]) o.readObject();\n\t\t\treturn h;\n\t\t} catch (IOException e) {e.printStackTrace();} \n\t\tcatch (ClassNotFoundException e) {e.printStackTrace();}\n\t\treturn null;\n\t}", "public boolean loadGame(File file){\n\t\treturn true;\n\t}", "private void loadFromFile(String fileName) {\n try {\n InputStream inputStream = this.openFileInput(fileName);\n if (inputStream != null) {\n ObjectInputStream input = new ObjectInputStream(inputStream);\n boardManager = (BoardManager) input.readObject();\n inputStream.close();\n }\n } catch (FileNotFoundException e) {\n Log.e(\"login activity\", \"File not found: \" + e.toString());\n } catch (IOException e) {\n Log.e(\"login activity\", \"Can not read file: \" + e.toString());\n } catch (ClassNotFoundException e) {\n Log.e(\"login activity\", \"File contained unexpected data type: \" + e.toString());\n }\n }", "private void checkForUpdates() {\n File dbFile = new File(peopleDBPath + \"people.protostuff\");\n try {\n BasicFileAttributes readAttributes = Files.readAttributes(dbFile.toPath(), BasicFileAttributes.class);\n if (lastModifiedDate.getTime() < readAttributes.lastModifiedTime().toMillis()) {\n // db = MAPPER.readValue(dbFile, PeopleDB.class);\n db = daoProtostuff.load(dbFile.getAbsolutePath(), PeopleDB.class);\n System.out.println(\"DB loaded\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private static void readHistoryData()\n throws FileNotFoundException {\n File file = new File(HISTORY_FILE_PATH);\n Scanner scanner = new Scanner(file); // create a Scanner using the File as the source\n StringBuilder message = new StringBuilder();\n int index = 1;\n while (scanner.hasNext()) {\n String line = scanner.nextLine();\n message.append(\"\\n\\t\" + index + \". \" + line);\n index++;\n }\n scanner.close();\n\n history = message.toString();\n }", "public static GameManager loadGame(String path) throws Exception\n\t{\n\t\tXMLFile db = new XMLFile(path + Definition.GAME_FILE_EXTENSION);\n\t\tGameManager gameManager = db.load();\n\t\t\n\t\tSystem.out.println(gameManager.getEntireGameStatus());\n\t\treturn gameManager;\n\t}", "public void read(DataInputStream in) throws IOException {\n final int magic = in.readInt();\n if (magic != FILE_MAGIC) {\n throw new ProtocolException(\"unexpected magic: \" + magic);\n }\n\n final int version = in.readInt();\n switch (version) {\n case VERSION_UNIFIED_INIT: {\n // uid := size *(NetworkIdentitySet size *(uid set tag NetworkStatsHistory))\n final int identSize = in.readInt();\n for (int i = 0; i < identSize; i++) {\n final NetworkIdentitySet ident = new NetworkIdentitySet(in);\n\n final int size = in.readInt();\n for (int j = 0; j < size; j++) {\n final int uid = in.readInt();\n final int set = in.readInt();\n final int tag = in.readInt();\n\n final Key key = new Key(ident, uid, set, tag);\n final NetworkStatsHistory history = new NetworkStatsHistory(in);\n recordHistory(key, history);\n }\n }\n break;\n }\n default: {\n throw new ProtocolException(\"unexpected version: \" + version);\n }\n }\n }", "private static Map<Integer, Integer> readState(String stateFile) throws Exception {\n\n Map<Integer, Integer> ret = new HashMap<>();\n\n File f = new File(stateFile);\n if (f.exists()) {\n //LOG.info(\"File exists\");\n List<String> lines = FileUtils.readLines(f, null);\n for (String line: lines) {\n //LOG.info(\"Line: \" + line);\n String[] toks = line.split(\":\");\n String channelId = toks[0];\n String messageId = toks[1];\n ret.put(Integer.valueOf(channelId), Integer.valueOf(messageId));\n }\n }\n\n //LOG.info(\"Read from file into map size \" + ret.size());\n\n return ret;\n }", "public void load() {\n World loadGame;\n final JFileChooser fileChooser =\n new JFileChooser(System.getProperty(\"user.dir\"));\n try {\n int fileOpened = fileChooser.showOpenDialog(GameFrame.this);\n\n if (fileOpened == JFileChooser.APPROVE_OPTION) {\n FileInputStream fileInput =\n new FileInputStream(fileChooser.getSelectedFile());\n ObjectInputStream objInput = new ObjectInputStream(fileInput);\n loadGame = (World) objInput.readObject();\n objInput.close();\n fileInput.close();\n } else {\n return;\n }\n } catch (IOException i) {\n i.printStackTrace();\n return;\n } catch (ClassNotFoundException x) {\n x.printStackTrace();\n return;\n }\n\n world = loadGame;\n gridPanel.removeAll();\n fillGamePanel();\n world.reinit();\n setWorld(world);\n GameFrame.this.repaint();\n System.out.println(\"Game loaded.\");\n }", "private int read_int(RandomAccessFile file) throws IOException {\n int number = 0;\n for (int i = 0; i < 4; ++i) {\n number += (file.readByte() & 0xFF) << (8 * i);\n }\n return number;\n }" ]
[ "0.66196626", "0.60682416", "0.59473634", "0.57442147", "0.56772053", "0.5671603", "0.5649447", "0.56404006", "0.5638209", "0.55988324", "0.55632573", "0.556052", "0.5548689", "0.5543208", "0.5542965", "0.55275923", "0.5517386", "0.55161357", "0.55098534", "0.54459465", "0.5442403", "0.5392952", "0.5390869", "0.5380131", "0.5373888", "0.53689915", "0.53443295", "0.52984834", "0.5291532", "0.5269671", "0.5253012", "0.52482635", "0.5242127", "0.5220316", "0.52135223", "0.5206047", "0.519714", "0.51894325", "0.5176295", "0.5130187", "0.51297665", "0.5129499", "0.51222384", "0.5108563", "0.5101634", "0.50979114", "0.50878453", "0.5085177", "0.50781095", "0.50684917", "0.5064667", "0.5063301", "0.5060233", "0.50441253", "0.50416696", "0.50406486", "0.50393915", "0.5020509", "0.50199395", "0.50170386", "0.5015449", "0.5013654", "0.50131744", "0.50020176", "0.49981886", "0.49980032", "0.49979594", "0.49882066", "0.4961804", "0.4944843", "0.49406606", "0.49386054", "0.49325398", "0.4929801", "0.49149162", "0.49146593", "0.49129677", "0.49071783", "0.49066764", "0.48896015", "0.48880255", "0.48805645", "0.487764", "0.4873351", "0.48648694", "0.4855826", "0.4845859", "0.48396683", "0.4833874", "0.48338115", "0.48331136", "0.48325825", "0.48323095", "0.48316008", "0.48300323", "0.48275226", "0.48212388", "0.48114622", "0.48081663", "0.48026195" ]
0.6508131
1
method for heal method testing.
@Test public void whenDoctorHealThenCorrectDescription() { Treatment treatment = new Treatment(); treatment.setDrug("Аспирин", "125-6"); treatment.setProcedure("Массаж", 10); Doctor doctor = new Doctor("Алексей Петрович", "СПбГУ", 3650, treatment); Patient patient = new Patient(); patient.setName("Антон"); String result = doctor.heal(patient); String expectString = "Алексей Петрович лечит Антон"; assertThat(result, is(expectString)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void heal(Heros h);", "public void heal(int healAmount){\r\n health+= healAmount;\r\n }", "public void heal() {\n delegate.heal();\n }", "public void heal(){\n\t\thp += potion.getHpBoost();\n\t\tif(hp > max_hp)hp = max_hp;\n\t}", "@Override\n\tpublic void heal() {\n\t\tboolean canHeal;\n\t\tint healPoints;\n\n\t\tcanHeal = (Math.random() <= chanceToHeal) && (hitPoints > 0);\n\n\t\tif (canHeal) {\n\t\t\thealPoints = (int) (Math.random() * (maxHeal - minHeal + 1)) + minHeal;\n\t\t\taddHitPoints(healPoints);\n\t\t\tSystem.out.println(name + \" healed itself for \" + healPoints + \" points.\\n\"\n\t\t\t\t\t+ \"Total hit points remaining are: \" + hitPoints);\n\t\t\tSystem.out.println();\n\t\t} // end can heal\n\n\t}", "public void heal()\n {\n\tif (potions <= 0) {\n\t System.out.println(\"Out of potions. :(\");\n\t}\n\telse {\n\t HP += 1300/4;\n\t if (HP > 1300 ){\n\t\tHP = 1300;\n\t }\n System.out.println(\"Your HP is now \" + HP + \".\");\n\t potions -= 1;\n\t}\n }", "public void heal2()\r\n {\r\n this.health = 900;\r\n Story.healText2();\r\n }", "public void heal1()\r\n {\r\n this.health = 700;\r\n Story.healText1();\r\n }", "public void heal3()\r\n {\r\n this.health = 1200;\r\n Story.healText3();\r\n }", "@Override\r\n\tpublic void heal() {\n\t\tSystem.out.println(\"Paladin \" + super.getName() + \" heals for 50 points.\");\r\n\t\tsuper.setHitPoints(super.getHitPoints() + 50);\r\n\t}", "@Override\n\tpublic void heal(Hero... target) {\n\t\tsuper.heal(target);\n\t}", "private void selfHeal() {\n\t\t\n\t\t//IF the Droid is carrying an item...\n\t\tif (this.getItemCarried() != null){\n\t\t\t\n\t\t\t//If the item is an oil can...\n\t\t\tif (this.getItemCarried().getShortDescription() == \"an oil can\" ) {\n\t\t\t\n\t\t\t\t//If the Droids health is LOWER than half...\n\t\t\t\tif((this.getInitialHP()/2) > this.getHitpoints()) {\n\t\t\t\t\tsay(this.getShortDescription() + \" is at or below half HP. \"\n\t\t\t\t\t\t\t+ \" Healing itself...\");\n\t\t\t\t\t\n\t\t\t\t\t//Implementing a new HealDroid method (Droid heals on itself)\n\t\t\t\t\t//public HealDroid(SWEntityInterface theTarget, MessageRenderer m) {\n\t\t\t\t\tHealDroid droidHeal = new HealDroid(this, messageRenderer);\n\t\t\t\t\t\n\t\t\t\t\tscheduler.schedule(droidHeal, this, 1);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}", "public int healHero(int i) {\n int heal;\n switch (i) {\n case 1:\n heal = rand.nextInt(4) + 1;\n HP.replenish(heal);\n return heal;\n case 2:\n heal = rand.nextInt(5) + 2;\n HP.replenish(heal);\n return heal;\n case 3:\n heal = rand.nextInt(6) + 3;\n HP.replenish(heal);\n return heal;\n case 4:\n heal = rand.nextInt(9) + 5;\n HP.replenish(heal);\n return heal;\n case 5: // healing hero to full\n HP.replenish(100);\n default:\n return 0;\n }\n }", "public void healPokemon()\n\t{\n\t\tfor(Pokemon pokemon : getParty())\n\t\t\tif(pokemon != null)\n\t\t\t{\n\t\t\t\tpokemon.calculateStats(true);\n\t\t\t\tpokemon.reinitialise();\n\t\t\t\tpokemon.setIsFainted(false);\n\t\t\t\tfor(int i = 0; i < pokemon.getMoves().length; i++)\n\t\t\t\t\tif(pokemon.getMoves()[i] != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tPokemonMove move = pokemon.getMoves()[i].getMove();\n\t\t\t\t\t\tpokemon.setPp(i, move.getPp() * (5 + pokemon.getPpUpCount(i)) / 5);\n\t\t\t\t\t\tpokemon.setMaxPP(i, move.getPp() * (5 + pokemon.getPpUpCount(i)) / 5);\n\t\t\t\t\t}\n\t\t\t}\n\t\tServerMessage sendHeal = new ServerMessage(ClientPacket.POKES_HEALED);\n\t\tgetSession().Send(sendHeal);\n\t}", "private String heal(Human human) {\n human.healthLvl += this.healLvl;\n return \"Doctor \" + this.getName() + \" heals \" + human.getName() + \" to \" + human.getHealthLvl() + \" health lvl\";\n }", "public void fullyHeal() {\n removeStatus();\n getActualMoves().restoreAllPP();\n healHealthFraction(1);\n }", "public void heal(float health) {\r\n \t\tthis.health += health;\r\n \t\tif(health > maxHealth) {\r\n \t\t\thealth = maxHealth;\r\n \t\t}\r\n \t}", "public void heal(int healAmt) {\r\n\t\thealth += healAmt;\r\n\t\tif (health >= maxHealth)\r\n\t\t\thealth = maxHealth;\r\n\t\t_checkInvariant();\r\n\t}", "private void heal(){\n\t\tfinal long rowID = getSelectedRowID();\n\n\t\t// reset the selection\n\t\tresetSelection();\n\n\t\t// show the dialog\n\t\tQuickDialogs.showHealDialog(getActivity(), new IInputCallback() {\n\n\t\t\t@Override\n\t\t\tpublic void onInput(String input) {\n\t\t\t\tint damage;\n\t\t\t\t// convert the string to int\n\t\t\t\ttry{\n\t\t\t\t\tdamage = Integer.valueOf(input);\n\t\t\t\t}catch(NumberFormatException e){\n\t\t\t\t\t// TODO display incorrect input dialog\n\t\t\t\t\tdamage = 0;\n\t\t\t\t}\n\n\t\t\t\t// heal it up!\n\t\t\t\tEncountersTable.changeHP(GameSQLDataSource.getDatabase(getActivity()), rowID, damage);\t\n\n\t\t\t\trefreshList();\n\t\t\t}\n\t\t});\n\t}", "@Override\n\tprotected void ExecutePrimary() {\n\t\tgameContext.generateHeal(value);\n\t}", "public void healPokemon() {\r\n\t\tfor (Pokemon p : ownedPokemon) {\r\n\t\t\tp.resetCurrentHP();\r\n\t\t}\r\n\t}", "public void healDamage(int x, int y, int healed) {\r\n\t\tint id;\r\n\t\tMessage healMessage;\r\n\t\tsynchronized (this) {\r\n\t\t\tid = localMessageCounter++;\r\n\r\n\t\t\thealMessage = new Message();\r\n\t\t\thealMessage.put(\"request\", MessageRequest.healDamage);\r\n\t\t\thealMessage.put(\"x\", x);\r\n\t\t\thealMessage.put(\"y\", y);\r\n\t\t\thealMessage.put(\"healed\", healed);\r\n\t\t\thealMessage.put(\"id\", id);\r\n\t\t\thealMessage.put(\"origin\", \"D\" + unitID);\r\n\t\t}\r\n\r\n\t\t// Send a spawn message\r\n\t\tsendMessage(healMessage);\r\n\t}", "public PureHeal(Player p) {\n\t\tsuper(\"Pure Heal\", p);\n\t}", "public int heal(int amount) {\n\n // Dead Pokemon can't heal\n if (hasStatus(StatusNamesies.FAINTED)) {\n return 0;\n }\n\n int prev = hp;\n setHP(hp + amount);\n return hp - prev;\n }", "@Test\n void doEffectheatseeker() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"heatseeker\");\n Weapon w4 = new Weapon(\"heatseeker\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n wd.addWeapon(w4);\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w4);\n p.setPlayerPosition(Board.getSquare(0));\n p.getPh().drawWeapon(wd, w4.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(10));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n try{\n p.getPh().getWeaponDeck().getWeapon(w4.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 3);\n }", "public static void handleHealGroup(Player player) {\n\t\t\n\t}", "public void buyHealth() {\n this.healthMod++;\n heathMax += 70 * healthMod;\n }", "public StarAbilityHeal() {\n\t\t\n\t\tthis.setMaxLevel(4);\n\t\tthis.setEffectable(Effectable.Heal);\n\t\t\n\t}", "public void heal(int[] fighter, int points) {\n fighter[LIFE] = fighter[LIFE] + points;\n if (fighter[LIFE] > fighter[MAX_LIFE]) {\n fighter[LIFE] = fighter[MAX_LIFE];\n }\n }", "public int heal(int magnitude) {\n int value = Math.min(magnitude, actor.getBaseHealth() - health);\n health += value;\n System.out.println(actor.getName() + \": \" + health);\n return value;\n }", "public void heal(ItemPotion itemPotion) {\n\t\tint old_life = life;\n\t\tlife += itemPotion.getValue(); //On récupère une valeur temporaire\n\t\tif(life<MIN_LIFE) life = MIN_LIFE;\n\t\tif(life>MAX_LIFE) life = MAX_LIFE;\n\t\t\n\t\tif(life<old_life) {\n\t\t\tDisplay.sendMessage(\"Vous avez perdu \" + (old_life-life) + \" point\"+(old_life-life>1?\"s\":\"\")+\" de vie\");\n\t\t}\n\t\telse {\n\t\t\tDisplay.sendMessage(\"Vous avez regagné \" + (life-old_life) + \" point\"+(life-old_life>1?\"s\":\"\")+\" de vie\");\n\t\t}\n\t}", "@EventHandler(priority = EventPriority.MONITOR)\n\tvoid onPlayerInteract(PlayerInteractEntityEvent event)\n\t{\n\t\tPlayer player = event.getPlayer();\n\t\tisHealingOther = true;\n\t\t\n\t\t//Check that the player right-clicked on another player.\n\t\tif (!(event.getRightClicked() instanceof Player))\n\t\t\treturn;\n\n \t//Check if the item in hand fits any of the items specified in the configuration file.\t\t\n \tSet <String> items;\n \ttry { items = config.getConfigurationSection(\"healing.\").getKeys(false); }\n \tcatch (NullPointerException e)\n \t{ return; }\n \t\n \tString item = null;\n \tfor (String i: items)\n \t\tif (player.getItemInHand().getType().toString().equalsIgnoreCase(i))\n \t\t\titem = i;\n \t\n \t//If the item isn't found, it's not a healing item.\n \tif (item == null)\n \t\treturn;\n \t\n\t\t//Check if the amount to heal is in the config\n \tSet<String> professionsRequired;\n \ttry { professionsRequired = config.getConfigurationSection(\"healing.\" + item).getKeys(false); }\n \tcatch (NullPointerException e)\n \t{ return; }\n \t\n \tfor (String p: professionsRequired)\n \t{\n \t\tProfessionStats prof = new ProfessionStats(perms, data, config, player.getUniqueId());\n \t\t\n \t\tif (p == null)\n \t\t\tcontinue;\n \t\t\n \tProfessionHandler profHandler = new ProfessionHandler(perms, data, config);\n \t\n \tdouble amountToHeal = config.getInt(\"healing.\" + item + \".\" + p + \".\"\n\t\t\t\t\t+ profHandler.getTierName(prof.getTier(p)));\n \tif (amountToHeal == 0)\n \t{\n \t\tplayer.sendMessage(ChatColor.RED + \"You do not have the skill required to do this!\");\n \t\treturn;\n \t}\n \t\n \t//Check that the recipient has missing health.\n \t\tPlayer recipient = (Player) event.getRightClicked();\n \t\tif (recipient.getHealth() >= 20)\n \t\t{\n \t\t\tplayer.sendMessage(ChatColor.YELLOW + recipient.getName() + \" does not need bandaging!\");\n \t\t\treturn;\n \t\t} \n \t\t\n \t//Check that it won't take you over the maximum amount of health.\n \tif (recipient.getHealth() + amountToHeal > 20)\n \t\tamountToHeal = 20 - recipient.getHealth();\n \t\t\n \t\tplayer.sendMessage(ChatColor.YELLOW + \"Bandaging...\");\n \t\tString name = player.getCustomName();\n \t\tif (name == null)\n \t\t\tname = player.getName();\n \t\trecipient.sendMessage(ChatColor.YELLOW + name + \" is bandaging you...\");\n \t\t\n \t\t//Schedule the task in one second.\n \t\tmakeDelayedTask(player, recipient, amountToHeal, item, p, player.getLocation(), recipient.getLocation());\n \t}\n\t}", "private void functionalInterface1() {\n\t\tcharmander.heal();\n\n\t\tPokedex.printData(Arrays.asList(charmander));\n\n\t\tguilherme.powerUp(charmander, new BigDecimal(\"-10\"), psMinimalDamage); // -10\n\n\t\tPokedex.printData(Arrays.asList(charmander));\n\n\t\tguilherme.powerUp(charmander, new BigDecimal(\"-10\"), psHugeDamage); // -20\n\n\t\tPokedex.printData(Arrays.asList(charmander));\n\t}", "public int heal(int health) {\r\n lifepoints += health;\r\n int left = 0;\r\n if (lifepoints > getMaximumLifepoints()) {\r\n left = lifepoints - getMaximumLifepoints();\r\n lifepoints = getMaximumLifepoints();\r\n }\r\n lifepointsUpdate = true;\r\n return left;\r\n }", "public void decreaseHealingNumber() {\n healingNumber--;\n }", "@Test\n\tvoid testDealBackDamage() {\n\t\tthis.miner.shoot();\n\t\tassertEquals(mRUtil.dwarfMiner_hp - (mRUtil.pickaxe_damage/mRUtil.saphir_returnedDamageRatio), this.miner.getHp(), \"Case: Damage taken by the Miner from saphir\");\n\n\t\tthis.saphir.setHp(50); // reset hp to 50\n\t\tthis.soldier.shoot();\n\t\tassertEquals(mRUtil.dwarfSoldier_hp - (mRUtil.rocket_damage/mRUtil.saphir_returnedDamageRatio),this.soldier.getHp(), \"Case: Damage taken by the Soldier from saphir\");\n\n\t\tthis.saphir.setHp(50);\n\t\tthis.demolitionist.shoot();\n\t\tassertEquals(mRUtil.dwarfDemolitionist_hp - (mRUtil.dynamite_damage/mRUtil.saphir_returnedDamageRatio),this.demolitionist.getHp(), \"Case: Damage taken by the Demolitionist from saphir\");\n\n\t\tthis.saphir.setHp(50);\n\t\tthis.scientist.shoot();\n\t\tassertEquals(mRUtil.dwarfScientist_hp - (mRUtil.potion_damage/mRUtil.saphir_returnedDamageRatio),this.scientist.getHp(), \"Case: Damage taken by the Scientist from saphir\");\n\t}", "public void healPlayer(int hp) {\n if (hero.getHp() < LabyrinthFactory.HP_PLAYER) {\n hero.increaseHP(hp);\n }\n }", "static void healing_challenge3() { //this is where the player will be able to heal himself/herself in boss challenge\n System.out.println(\" You open up the bag to check your inventory...\");\n enter = next.nextLine();\n if(potions <= zero) {\n System.out.println(username + \" feels something in the bag...\");\n System.out.println(\"\\n\");\n System.out.println(\"There is a large object inside, but turns out to be your spell book\");\n enter = next.nextLine();\n System.out.println(\"UH! OH! You ran out of potions. GUESS YOUR ON YOUR OWN!!!\");\n System.out.println(\"\\n\");\n }else if(potions > zero && playerhealth != 3500) { //this makes sure their aren't any loop holes in the game for cheats\n System.out.println(username + \" found a potion in the bag.\");\n System.out.println(username + \" takes the new blue potion and consumes it entirely...\");\n System.out.println(username + \" gained 300 HP points.\");\n playerhealth = playerhealth + 300; //player's health is healed\n potions--;//put it like this, not potions = potions--; This would break the game...\n if(playerhealth > 3500){ //in case that player heals and adds 300 and health goes higher than maixmum\n playerhealth = 3500;\n }\n //in case if player tries to cheat with the maximum health\n }else if (playerhealth == 3500) {\n System.out.println(\"You are at your maximum health...You can't raise it any higher than that...\");\n System.out.println(\"NICE TRY!\");\n } \n }", "public int getHealY()\n\t{\n\t\treturn m_healY;\n\t}", "public int giveDamage();", "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 }", "void gainHealth(int points) {\n this.health += points;\n }", "public void gainHealth()\n\t{\n\t\tSystem.out.println(\"1 heart gained\");\n\t}", "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}", "edu.usfca.cs.dfs.StorageMessages.HealMyChunk getHealMyChunk();", "public int getHealthGain();", "@Test\n void doEffectPlasmaGun() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"plasma gun\");\n Weapon w17 = new Weapon(\"plasma gun\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w17);\n p.setPlayerPosition(Board.getSquare(6));\n p.getPh().drawWeapon(wd, w17.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n ArrayList<GenericSquare> s = new ArrayList<>();\n try {\n p.getPh().getWeaponDeck().getWeapon(w17.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2);\n\n p.setPlayerPosition(Board.getSpawnpoint(2));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSquare(6));\n try {\n p.getPh().getWeaponDeck().getWeapon(w17.getName()).doEffect(\"opt1\", \"base\", null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2 && p.getPlayerPosition() == Board.getSquare(6));\n\n p.setPlayerPosition(Board.getSquare(6));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSquare(1));\n try {\n p.getPh().getWeaponDeck().getWeapon(w17.getName()).doEffect(\"base\", \"opt1\", null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2 && p.getPlayerPosition() == Board.getSquare(1));\n\n p.setPlayerPosition(Board.getSpawnpoint(2));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSquare(6));\n try {\n p.getPh().getWeaponDeck().getWeapon(w17.getName()).doEffect(\"opt1\", \"base\", \"opt2\", p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 3 && p.getPlayerPosition() == Board.getSquare(6));\n\n p.setPlayerPosition(Board.getSquare(6));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSpawnpoint('b'));\n try {\n p.getPh().getWeaponDeck().getWeapon(w17.getName()).doEffect(\"base\", \"opt2\", \"opt1\", p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 3 && p.getPlayerPosition() == Board.getSpawnpoint('b'));\n }", "public int HighHit(int start)\r\n {\r\n damage = ((int)(Math.random() * 100) % 50 + 80);\r\n int hp = start - damage;\r\n \r\n //modified to turn hp to 0 once it drops below or equals 0.\r\n if(hp <= 0)\r\n hp = 0;\r\n return hp;\r\n }", "public void reduceHealth() {\n\t}", "public int getHealX()\n\t{\n\t\treturn m_healX;\n\t}", "public static void heal(Player player, boolean specialDelay, boolean resetPrayers) {\n\t\t// Box of health at clan wars.\n\t\tif (player.getObjectX() == 3327 && player.getObjectY() == 4757) {\n\t\t\tspecialDelay = false;\n\t\t}\n\t\tplayer.chargeSpellTime = 0;\n\t\tplayer.imbuedHeartEndTime = 0;\n\t\tplayer.teleBlockEndTime = 0;\n\t\tplayer.dfsDelay = 0;\n\t\tOverlayTimer.stopAllOverlayTimers(player);\n\t\tplayer.lastVeng = 0;\n\t\tplayer.setAntiFirePotionTimer(0);\n\t\tplayer.setFrozenLength(0);\n\t\tplayer.frozenBy = 0;\n\t\tplayer.venomImmunityExpireTime = 0;\n\t\tplayer.poisonImmune = 0;\n\t\tplayer.overloadReboostTicks = 0;\n\t\tplayer.timeClawsOfGuthixAffected = 0;\n\t\tplayer.timeZamorakFlamesAffected = 0;\n\t\tplayer.setHitPoints(player.getBaseHitPointsLevel());\n\t\tSkilling.updateSkillTabFrontTextMain(player, ServerConstants.HITPOINTS);\n\t\tplayer.currentCombatSkillLevel[ServerConstants.PRAYER] = player.getBasePrayerLevel();\n\t\tSkilling.updateSkillTabFrontTextMain(player, ServerConstants.PRAYER);\n\t\tplayer.setUsingSpecialAttack(false);\n\t\tif (System.currentTimeMillis() - player.timeUsedHealthBoxSpecial >= getRestoreSpecialDelay(player) && specialDelay || !specialDelay) {\n\t\t\tif (specialDelay && player.getSpecialAttackAmount() <= 7.0) {\n\t\t\t\tplayer.timeUsedHealthBoxSpecial = System.currentTimeMillis();\n\t\t\t}\n\t\t\tplayer.setSpecialAttackAmount(10.0, false);\n\t\t\tplayer.weaponSpecialUpdatedId = player.getWieldedWeapon();\n\t\t\tCombatInterface.addSpecialBar(player, player.getWieldedWeapon());\n\t\t} else if (specialDelay) {\n\t\t\tif (player.getSpecialAttackAmount() < 10.0) {\n\t\t\t\tlong seconds = getRestoreSpecialDelay(player) - (System.currentTimeMillis() - player.timeUsedHealthBoxSpecial);\n\t\t\t\tseconds /= 1000;\n\t\t\t\tplayer.getPA().sendMessage(\"You may restore your special attack in \" + seconds + \" second\" + Misc.getPluralS(seconds) + \".\");\n\t\t\t}\n\t\t}\n\n\t\tplayer.setVengeance(false);\n\t\tplayer.runEnergy = 100.0;\n\t\tPoison.removePoison(player);\n\t\tVenom.removeVenom(player);\n\t\tplayer.timeStaffOfTheDeadSpecialUsed = 0;\n\t\tAgilityAssistant.updateRunEnergyInterface(player);\n\t\tif (resetPrayers) {\n\t\t\tCombat.resetPrayers(player);\n\t\t}\n\t\tplayer.resetDamageTaken();\n\t\tSkilling.resetCombatSkills(player);\n\t\tfor (int i = 0; i < 7; i++) {\n\t\t\tplayer.getPA().setSkillLevel(i, player.baseSkillLevel[i], player.skillExperience[i]);\n\t\t}\n\t\tAutoCast.resetAutocast(player, true);\n\t\tAgilityAssistant.removeStaminaEffect(player);\n\t\tplayer.antiBoxingData.clear();\n\t}", "public void makeHero()\r\n { \r\n maxHealth = 100;\r\n health = maxHealth;\r\n }", "public void hasHeartPower(){\n shipVal.setHealth(shipVal.getHealth()+1);\n updateHearts(new ImageView(cacheHeart));\n score_val += 1000;\n }", "private void takeDamage(int damage){ health -= damage;}", "@Test\n void doEffecthellion() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"hellion\");\n Weapon w5 = new Weapon(\"hellion\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n wd.addWeapon(w5);\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w5);\n p.setPlayerPosition(Board.getSquare(0));\n p.getPh().drawWeapon(wd, w5.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('b'));\n Terminator t = new Terminator('e', Board.getSpawnpoint('b'));\n t.setOwnerColor(victim.getColor());\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n players.add(t);\n try{\n p.getPh().getWeaponDeck().getWeapon(w5.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().getMarkedDamages('b') == 1 && victim.getPb().countDamages() == 1 && t.getPb().getMarkedDamages('b') == 1);\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('b'));\n t = new Terminator('e', Board.getSpawnpoint('b'));\n t.setOwnerColor(victim.getColor());\n players.clear();\n players.add(victim);\n players.add(t);\n\n try{\n p.getPh().getWeaponDeck().getWeapon(w5.getName()).doEffect(\"alt\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().getMarkedDamages('b') == 2 && victim.getPb().countDamages() == 1 && t.getPb().getMarkedDamages('b') == 2);\n }", "@Override\r\n\tpublic void getHealth() {\n\t\t\r\n\t}", "public static void heal(LivingEntity ent) {\n\t\tAttributeInstance maxHealth = ent.getAttribute(Attribute.GENERIC_MAX_HEALTH);\n\t\tif(maxHealth != null) {\n\t\t\tent.setHealth(maxHealth.getValue());\n\t\t}\n\t\tif(ent instanceof Player) {\n\t\t\tPlayer p = (Player) ent;\n\t\t\tp.setFoodLevel(20);\n\t\t\tp.setSaturation(20);\n\t\t}\n\t}", "@Test\n\tpublic void testCalHealth() {\n\t\tnpc.setLevel(1);\n\t\tnpc.setHealth(55);\n\t\tassertFalse(npc.getHealth() == npc.getMaxHealth());\n\t\tnpc.calHealth();\n\t\tassertTrue(npc.getHealth() == npc.getMaxHealth());\n\t}", "@Test\n void doEffectcyberblade(){\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"cyberblade\");\n Weapon w20 = new Weapon(\"cyberblade\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w20);\n p.setPlayerPosition(Board.getSquare(6));\n p.getPh().drawWeapon(wd, w20.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n try {\n p.getPh().getWeaponDeck().getWeapon(w20.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages()==2);\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n players.clear();\n players.add(victim);\n ArrayList<GenericSquare> s = new ArrayList<>();\n s.add(Board.getSquare(7));\n try {\n p.getPh().getWeaponDeck().getWeapon(w20.getName()).doEffect(\"base\", \"opt1\", null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages()==2 && p.getPlayerPosition()==Board.getSquare(7));\n\n p.setPlayerPosition(Board.getSquare(6));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(7));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSquare(7));\n try {\n p.getPh().getWeaponDeck().getWeapon(w20.getName()).doEffect(\"opt1\", \"base\", null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages()==2 && p.getPlayerPosition()==Board.getSquare(7));\n\n p.setPlayerPosition(Board.getSquare(6));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n RealPlayer victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(7));\n players.clear();\n players.add(victim);\n players.add(victim2);\n s.clear();\n s.add(Board.getSquare(7));\n try {\n p.getPh().getWeaponDeck().getWeapon(w20.getName()).doEffect(\"base\", \"opt1\", \"opt2\", p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages()==2 && victim2.getPb().countDamages()==2 && p.getPlayerPosition()==Board.getSquare(7));\n\n p.setPlayerPosition(Board.getSquare(6));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(6));\n players.clear();\n players.add(victim);\n players.add(victim2);\n s.clear();\n s.add(Board.getSquare(7));\n try {\n p.getPh().getWeaponDeck().getWeapon(w20.getName()).doEffect(\"base\", \"opt2\", \"opt1\", p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages()==2 && victim2.getPb().countDamages()==2 && p.getPlayerPosition()==Board.getSquare(7));\n\n p.setPlayerPosition(Board.getSquare(6));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(7));\n victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(7));\n players.clear();\n players.add(victim);\n players.add(victim2);\n s.clear();\n s.add(Board.getSquare(7));\n try {\n p.getPh().getWeaponDeck().getWeapon(w20.getName()).doEffect(\"opt1\", \"base\", \"opt2\", p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages()==2 && victim2.getPb().countDamages()==2 && p.getPlayerPosition()==Board.getSquare(7));\n }", "@Test\n void doEffectfurnace() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"furnace\");\n Weapon w3 = new Weapon(\"furnace\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n wd.addWeapon(w3);\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n p.setPlayerPosition(Board.getSquare(0));\n p.getPh().drawWeapon(wd, w3.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('r'));\n Terminator t = new Terminator('g', Board.getSquare(5));\n t.setOwnerColor(victim.getColor());\n ArrayList<GenericSquare> s = new ArrayList<>();\n s.add(victim.getPlayerPosition());\n try{\n p.getPh().getWeaponDeck().getWeapon(w3.getName()).doEffect(\"base\", null, null, p, null, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 1 && t.getPb().countDamages() == 1);\n\n p.setPlayerPosition(Board.getSquare(0));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('r'));\n t = new Terminator('g', Board.getSpawnpoint('r'));\n t.setOwnerColor(victim.getColor());\n s.clear();\n s.add(Board.getSpawnpoint('r'));\n try{\n p.getPh().getWeaponDeck().getWeapon(w3.getName()).doEffect(\"alt\", null, null, p, null, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 1 && victim.getPb().getMarkedDamages('b')==1 && t.getPb().countDamages() == 1 && t.getPb().getMarkedDamages('b')==1);\n\n }", "@Override\n\tprotected void onPlayerDamage(EntityDamageEvent evt, Player p) {\n\t\tsuper.onPlayerDamage(evt, p);\n\t\tif(evt.getCause() == DamageCause.WITHER){\n\t\t\tGUtils.healDamageable(getOwnerPlayer(), evt.getDamage() * 1.5);\n\t\t\tVector v = Utils.CrearVector(getOwnerPlayer().getLocation(), getPlayer().getLocation()).multiply(0.5D);\n\t\t\tdouble max = 7;\n\t\t\tfor (int i = 0; i < max; i++) {\n//\t\t\t\tgetWorld().playEffect(getPlayer().getEyeLocation().add(0, -0.8, 0).add(v.clone().multiply(i/max)),\n//\t\t\t\t\t\tEffect.HEART, 0);\n\t\t\t}\n\t\t}\n\t}", "void takeDamage(int points) {\n this.health -= points;\n }", "public short getHandThrowDamage();", "@Test\n void doEffectflamethrower() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"flamethrower\");\n Weapon w7 = new Weapon(\"flamethrower\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n wd.addWeapon(w7);\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n p.setPlayerPosition(Board.getSquare(0));\n p.getPh().drawWeapon(wd, w7.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(1));\n Terminator t = new Terminator('e', Board.getSpawnpoint('b'));\n t.setOwnerColor(victim.getColor());\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n players.add(t);\n try{\n p.getPh().getWeaponDeck().getWeapon(w7.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 1 && t.getPb().countDamages() == 1);\n\n players.get(1).setPlayerPosition(Board.getSquare(5));\n try{\n p.getPh().getWeaponDeck().getWeapon(w7.getName()).doEffect(\"base\", null, null, p, players, null); //\"A choice of yours is wrong\"\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 1 && t.getPb().countDamages() == 1);\n\n players.remove(1);\n\n try {\n p.getPh().getWeaponDeck().getWeapon(w7.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2);\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(1));\n t = new Terminator('e', Board.getSpawnpoint('b'));\n t.setOwnerColor(victim.getColor());\n RealPlayer p2 = new RealPlayer('v', \"ciccia\");\n p2.setPlayerPosition(Board.getSquare(1));\n ArrayList<GenericSquare> s = new ArrayList<>();\n s.clear();\n s.add(victim.getPlayerPosition());\n s.add(t.getPlayerPosition());\n\n try {\n p.getPh().getWeaponDeck().getWeapon(w7.getName()).doEffect(\"alt\", null, null, p, null, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2 && p2.getPb().countDamages() == 2 && t.getPb().countDamages() == 1);\n }", "public float getHungerDamage();", "static void healing_challenge2() {\n System.out.println(username + \" opens up the bag to check if there are any potions left in there...\");\n enter = next.nextLine();\n if(potions <= zero) {\n System.out.println(username + \" feels something in the bag...\");\n System.out.println(\"\\n\");\n System.out.println(\"GASP!!! It's just a sock from granny Boo.\");\n enter = next.nextLine();\n System.out.println(\"UH! OH! You have no more potions left, SORRY YOU'RE ON YOUR OWN...\");\n System.out.println(\"\\n\");\n }else if(potions > zero && playerhealth != 310) {\n System.out.println(username + \" found a potion in the bag...\");\n System.out.println(username + \" takes the red potion, throws the cap, and slowly let the potion heal the wounds.\");\n System.out.println(username + \" gained 80 HP points.\");\n playerhealth = playerhealth + 80; //player's health is healed\n potions--;\n if(playerhealth > 310){ //in case of player heals and adds 80 and health goes higher than 310\n playerhealth = 310;\n }\n //in case if player tries to increase their health over the maximum\n }else if(playerhealth == 310) {\n System.out.println(\"You are at maximum health.\");\n }\n }", "public static Action heal(final int scalar) {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.getGrid().isValid(a.getLocation().getAdjacentLocation(a.getDirection()))) {\n Actor b = a.getGrid().get(a.getLocation().getAdjacentLocation(a.getDirection()));\n if(b instanceof DestructibleActor) {\n ((DestructibleActor) b).damage(-scalar, a);\n a.energy = a.energy - getCost();\n }\n }\n }\n\n @Override\n public int getCost() {\n return (5 + (5 * scalar)) * scalar;\n }\n\n @Override\n public boolean isExclusive() {\n return true;\n }\n\n @Override\n public Object getData() {\n return scalar;\n }\n\n @Override\n public String toString() {\n return \"HealOther(\" + scalar + \")\";\n }\n };\n }", "Float getHealth();", "@Test\n void doEffectsledgehammer() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"sledgehammer\");\n Weapon w13 = new Weapon(\"sledgehammer\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w13);\n p.setPlayerPosition(Board.getSquare(6));\n p.getPh().drawWeapon(wd, w13.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n try {\n p.getPh().getWeaponDeck().getWeapon(w13.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2);\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n players.clear();\n players.add(victim);\n ArrayList<GenericSquare> s = new ArrayList<>();\n s.add(Board.getSquare(10));\n try {\n p.getPh().getWeaponDeck().getWeapon(w13.getName()).doEffect(\"alt\", null, null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 3 && victim.getPlayerPosition() == Board.getSquare(10));\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n players.clear();\n players.add(victim);\n s.clear();\n try {\n p.getPh().getWeaponDeck().getWeapon(w13.getName()).doEffect(\"alt\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 3 && victim.getPlayerPosition() == Board.getSquare(6));\n }", "@Override\r\n\tpublic void damage(float amount) {\n\t\t\r\n\t}", "public void startHealing()\n\t{\n\t\ttimerList.clear();\n\t\tinHospitalTimer = new PlayPauseTimer(10, new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tworld.heal();\n\t\t\t\tx = random.nextInt(world.getSIMULATION_WIDTH() - individualSize);\n\t\t\t\ty = random.nextInt(world.getSIMULATION_HEIGHT() - individualSize); \n\t\t\t\tmoveInPopulation();\n\t\t\t\texitHospital();\n\t\t\t\thealthStatus = HealthStatus.HEALTHY;\n\t\t\t\ttimerList.remove(inHospitalTimer);\n\t\t\t}\n\t\t\t\n\t\t}, world.getRefreshTime());\n\t\ttimerList.add(inHospitalTimer);\n\t}", "private void onCrystalDestroyed(DamageSource source) {\n\t\tif (source != DamageSource.OUT_OF_WORLD) {\n\t\t\t// DONE: Implement healing of all entities nearby\n\n\t\t\tVec3d p1 = this.getPositionVector().add(EXPLOSION_EFFECT_RADIUS, EXPLOSION_EFFECT_RADIUS, EXPLOSION_EFFECT_RADIUS);\n\t\t\tVec3d p2 = this.getPositionVector().subtract(EXPLOSION_EFFECT_RADIUS, EXPLOSION_EFFECT_RADIUS, EXPLOSION_EFFECT_RADIUS);\n\t\t\tAxisAlignedBB aabb = new AxisAlignedBB(p1.x, p1.y, p1.z, p2.x, p2.y, p2.z);\n\t\t\tList<EntityLiving> affectedEntities = this.world.getEntitiesWithinAABB(EntityLiving.class, aabb);\n\t\t\tif (!affectedEntities.isEmpty()) {\n\t\t\t\tfinal float healingAmount = 4 * (this.absorbedHealth / affectedEntities.size());\n\t\t\t\taffectedEntities.forEach(new Consumer<EntityLiving>() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void accept(EntityLiving arg0) {\n\t\t\t\t\t\targ0.heal(healingAmount);\n\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\t// TODO: Play some fancy effects and sounds\n\t}", "private void damage(){\n\n LevelMap.getLevel().damage(dmg);\n //System.out.println(\"died\");\n setDie();\n }", "@EventHandler(priority = EventPriority.MONITOR)\n\tvoid onRightClick(PlayerInteractEvent event)\n\t{\n\t\tPlayer player = event.getPlayer();\n\t\t\n\t\t//Check that it's a right click\n\t\tif (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)\n\t\t\treturn;\n\t\t\n\t\t//If the player is healing another person, they're not healing themself.\n\t\tif (isHealingOther)\n\t\t{\n\t\t\tisHealingOther = false;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Check if the item in hand fits any of the items specified in the configuration file.\t\n\t\tSet<String> items;\n \ttry { items = config.getConfigurationSection(\"healing.\").getKeys(false); }\n \tcatch (NullPointerException e)\n \t{ return; }\n \t\n \tString item = null;\n \tfor (String i: items)\n \t\tif (player.getItemInHand().getType().toString().equalsIgnoreCase(i))\n \t\t\titem = i;\n \t\n \t//If the item isn't found, it's not a healing item.\n \tif (item == null)\n \t\treturn;\n \t\n \tSet<String> professionReqs;\n \ttry { professionReqs = config.getConfigurationSection(\"healing.\" + item).getKeys(false); }\n \tcatch (NullPointerException e)\n \t{ return; }\n \t\n \tfor (String p: professionReqs)\n \t{\n \t\tProfessionHandler profHandler = new ProfessionHandler(perms, data, config);\n \t\t\n \t\tif (p == null || !profHandler.isValidProfession(p))\n \t\t\tcontinue;\n \t\t\n \t\t//Check if the amount to heal is in the config\n \tProfessionStats prof = new ProfessionStats(perms, data, config, player.getUniqueId());\n \t\n \tdouble amountToHeal = config.getInt(\"healing.\" + item + \".\" + p + \".\"\n\t\t\t\t\t+ profHandler.getTierName(prof.getTier(p)));\n \tif (amountToHeal == 0)\n \t{\n \t\tplayer.sendMessage(ChatColor.RED + \"You do not have the skill required to do this!\");\n \t\treturn;\n \t}\n \t \t\n \t//Check that the player has missing health.\n \tif (player.getHealth() >= 20)\n \t{\n \t\tplayer.sendMessage(ChatColor.YELLOW + \"You do not need bandaging!\");\n \t\treturn;\n \t} \n \t\n \t//Check that it won't take you over the maximum amount of health.\n \tif (player.getHealth() + amountToHeal > 20)\n \t\tamountToHeal = 20 - player.getHealth();\n \t\t\t\n \tplayer.sendMessage(ChatColor.YELLOW + \"Bandaging...\");\n \t\t\t\n \t//Schedule the task in one second.\n \tmakeDelayedTask(player, player, amountToHeal, item, p, player.getLocation(), player.getLocation());\n \t}\n\t}", "@Test\n void doEffectrailgun() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"railgun\");\n Weapon w11 = new Weapon(\"railgun\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w11);\n p.setPlayerPosition(Board.getSpawnpoint('r'));\n p.getPh().drawWeapon(wd, w11.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n ArrayList<GenericSquare> s = new ArrayList<>();\n try {\n p.getPh().getWeaponDeck().getWeapon(w11.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 3);\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n players.clear();\n players.add(victim);\n try{\n p.getPh().getWeaponDeck().getWeapon(w11.getName()).doEffect(\"alt\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2);\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n RealPlayer victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(7));\n players.clear();\n players.add(victim);\n players.add(victim2);\n s.clear();\n try {\n p.getPh().getWeaponDeck().getWeapon(w11.getName()).doEffect(\"alt\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2 && victim2.getPb().countDamages() == 2);\n }", "@Test\n void doEffectwhisper() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"whisper\");\n Weapon w6 = new Weapon(\"whisper\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n wd.addWeapon(w6);\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n p.setPlayerPosition(Board.getSpawnpoint(2));\n p.getPh().drawWeapon(wd, w6.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n\n try{\n p.getPh().getWeaponDeck().getWeapon(w6.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().getMarkedDamages('b') == 1 && victim.getPb().countDamages() == 3);\n\n players.get(0).setPlayerPosition(Board.getSquare(7));\n try {\n p.getPh().getWeaponDeck().getWeapon(w6.getName()).doEffect(\"base\", null, null, p, players, null); //\"A choice of yours is wrong\"\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n }", "public int getHealingNumber() {\n return healingNumber;\n }", "public void use(Direction dir, float hitProb){\n\t\tString text = null;\n\t\tif (holder() != null) {\n\t\t\tif(getCount() > 0 || (type.equals(WeaponType.melee.toString()))){\n\t\t\t\ttext = ((Creature) holder()).attackText();\n\t\t \tif (!isProjectile()){\n\t\t \t\ttext += fireWeapon(dir, hitProb);\n\t\t \t} else {\n\t\t \t\tworld().addActor(new Projectile(dir, this), pos());\n\t\t \t}\n\t\t \tif (!type.equals(WeaponType.melee.toString()))\n\t\t \t\tsuper.use();\n\t\t \telse\n\t\t \t\tsetCount(1);\n\t\t\t} else {\n\t\t\t\tif (holder() instanceof Player) \n\t\t\t\t\ttext = getName() + \" ist leer!\";\n\t\t\t}\n\t\t} else {\n\t\t\tif (holder() instanceof Player) \n\t\t\t\ttext = \"Keine Waffe ausgerüstet\";\n\t\t}\n\t\teventText(text);\n\t}", "void takeDamage(HeroDamage enemy1, HeroDamage enemy2);", "@Test\n public void useEffect() {\n \t//should normally run useItem method, but for testing it is not needed here.\n \tHealthEffect bombEff = (HealthEffect) bomb.getEffect().get(0);\n \tbombEff.applyEffect(com);\n \tAssert.assertTrue(com.getHealth() == baseHP - 700);\n \tSpecial heal = new Special(SpecialType.HEALTHBLESS);\n \theal.getEffect().get(0).applyEffect(com);\n \tAssert.assertTrue(com.getHealth() == baseHP);\n }", "private void GenerateHealth(){\t\t\n\t\t\n\t\t//Update for the health powerup\n\t\tint randGen = rand.nextInt((int)((float)HEALTH_FREQUENCY * RANDOM_DEVIATION));\n\t\trandGen = (rand.nextBoolean()) ?-randGen :randGen;\n\t\t\n\t\t//D.BUG(\"RandGen is: \" + String.valueOf(randGen));\n\t\t\n\t\tif(timeSinceLastSpawns.get(CollectibleType.Health.ordinal()).intValue() > (HEALTH_FREQUENCY + randGen)){\n\t\t\t\n\t\t\t//D.BUG(\"We have Spawned another health collectible after \" + String.valueOf(randGen + HEALTH_FREQUENCY) + \" milliseconds!\");\n\t\t\ttimeSinceLastSpawns.set(CollectibleType.Health.ordinal(), 0);\n\t\t\t\n\t\t\t//SPAWN HEALTH COLLECTIBLE HERE\n\t\t}\n\t}", "public int heal(final int amount) {\n final int effectiveHeal = Math.min(this.maxHealthPoints - this.currentHealthPoints, amount);\n this.currentHealthPoints += effectiveHeal;\n return effectiveHeal;\n }", "public TransactionResponse sellEnchant() {\r\n \t\tTransactionResponse response = new TransactionResponse(hp);\r\n \t\tCalculation calc = hc.getCalculation();\r\n \t\tAccount acc = hc.getAccount();\r\n \t\tLog log = hc.getLog();\r\n \t\tNotification not = hc.getNotify();\r\n \t\tInfoSignHandler isign = hc.getInfoSignHandler();\r\n \t\ttry {\r\n \t\t\tString nenchant = \"\";\r\n \t\t\tString playerecon = hp.getEconomy();\r\n \t\t\tPlayer p = hp.getPlayer();\r\n \t\t\tnenchant = hyperObject.getMaterial();\r\n \t\t\tEnchantment ench = Enchantment.getByName(nenchant);\r\n \t\t\tint lvl = Integer.parseInt(hyperObject.getName().substring(hyperObject.getName().length() - 1, hyperObject.getName().length()));\r\n \t\t\tint truelvl = im.getEnchantmentLevel(p.getItemInHand(), ench);\r\n \t\t\tif (im.containsEnchantment(p.getItemInHand(), ench) && lvl == truelvl) {\r\n \t\t\t\tdouble dura = p.getItemInHand().getDurability();\r\n \t\t\t\tdouble maxdura = p.getItemInHand().getType().getMaxDurability();\r\n \t\t\t\tdouble duramult = (1 - dura / maxdura);\r\n \t\t\t\tif (p.getItemInHand().getType().equals(Material.ENCHANTED_BOOK)) {\r\n \t\t\t\t\tduramult = 1;\r\n \t\t\t\t}\r\n \t\t\t\tString mater = p.getItemInHand().getType().toString();\r\n \t\t\t\tdouble price = hyperObject.getValue(EnchantmentClass.fromString(mater));\r\n \t\t\t\tdouble fprice = duramult * price;\r\n \t\t\t\tboolean sunlimited = hc.getYaml().getConfig().getBoolean(\"config.shop-has-unlimited-money\");\r\n \t\t\t\tif (acc.checkshopBalance(fprice) || sunlimited) {\r\n \t\t\t\t\tim.removeEnchantment(p.getItemInHand(), ench);\r\n \t\t\t\t\tdouble shopstock = hyperObject.getStock();\r\n \t\t\t\t\thyperObject.setStock(shopstock + duramult);\r\n \t\t\t\t\tdouble salestax = hp.getSalesTax(fprice);\r\n \t\t\t\t\tacc.deposit(fprice - salestax, p);\r\n \t\t\t\t\tacc.withdrawShop(fprice - salestax);\r\n \t\t\t\t\tif (sunlimited) {\r\n \t\t\t\t\t\tString globalaccount = hc.getYaml().getConfig().getString(\"config.global-shop-account\");\r\n \t\t\t\t\t\tacc.setBalance(0, globalaccount);\r\n \t\t\t\t\t}\r\n \t\t\t\t\tfprice = calc.twoDecimals(fprice);\r\n \t\t\t\t\tresponse.addSuccess(L.f(L.get(\"ENCHANTMENT_SELL_MESSAGE\"), 1, calc.twoDecimals(fprice), hyperObject.getName(), calc.twoDecimals(salestax)), calc.twoDecimals(fprice - salestax), hyperObject);\r\n \t\t\t\t\tresponse.setSuccessful();\r\n \t\t\t\t\tString type = \"dynamic\";\r\n \t\t\t\t\tif (Boolean.parseBoolean(hyperObject.getInitiation())) {\r\n \t\t\t\t\t\ttype = \"initial\";\r\n \t\t\t\t\t} else if (Boolean.parseBoolean(hyperObject.getIsstatic())) {\r\n \t\t\t\t\t\ttype = \"static\";\r\n \t\t\t\t\t}\r\n \t\t\t\t\tlog.writeSQLLog(p.getName(), \"sale\", hyperObject.getName(), 1.0, fprice - salestax, salestax, playerecon, type);\r\n \r\n \t\t\t\t\tisign.updateSigns();\r\n \t\t\t\t\tnot.setNotify(hyperObject.getName(), mater, playerecon);\r\n \t\t\t\t\tnot.sendNotification();\r\n \t\t\t\t} else {\r\n \t\t\t\t\tresponse.addFailed(L.get(\"SHOP_NOT_ENOUGH_MONEY\"), hyperObject);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"ITEM_DOESNT_HAVE_ENCHANTMENT\"), hyperObject.getName()), hyperObject);\r\n \t\t\t}\r\n \t\t\treturn response;\r\n \t\t} catch (Exception e) {\r\n \t\t\tString info = \"ETransaction sellEnchant() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}", "@Test\n void doEffectpowerglove() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"power glove\");\n Weapon w10 = new Weapon(\"power glove\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w10);\n p.setPlayerPosition(Board.getSquare(0));\n p.getPh().drawWeapon(wd, w10.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(1));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n ArrayList<GenericSquare> s = new ArrayList<>();\n try {\n p.getPh().getWeaponDeck().getWeapon(w10.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(p.getPlayerPosition() == Board.getSquare(1) && victim.getPb().countDamages() == 1 && victim.getPb().getMarkedDamages('b') == 2);\n\n p.setPlayerPosition(Board.getSquare(0));\n s.add(Board.getSquare(1));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(1));\n players.clear();\n players.add(victim);\n s.add(Board.getSpawnpoint('b'));\n RealPlayer victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSpawnpoint('b'));\n players.add(victim2);\n try{\n p.getPh().getWeaponDeck().getWeapon(w10.getName()).doEffect(\"alt\", null, null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(p.getPlayerPosition() == Board.getSpawnpoint('b') && victim.getPb().countDamages() == 2 && victim2.getPb().countDamages() == 2);\n\n p.setPlayerPosition(Board.getSquare(0));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('b'));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSquare(1));\n s.add(Board.getSpawnpoint('b'));\n try{\n p.getPh().getWeaponDeck().getWeapon(w10.getName()).doEffect(\"alt\", null, null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { System.out.println(\"ERROR\");}\n\n assertTrue(p.getPlayerPosition() == Board.getSpawnpoint('b') && victim.getPb().countDamages() == 2);\n }", "@Test\n void doEffectelectroscythe() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n setPlayers(pl);\n WeaponFactory wf = new WeaponFactory(\"electroscythe\");\n Weapon w1 = new Weapon(\"electroscythe\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.getWeapons().add(w1);\n p.setPlayerPosition(Board.getSquare(0));\n p.getPh().drawWeapon(wd, w1.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(0));\n Terminator t = new Terminator('y', Board.getSquare(0));\n t.setOwnerColor(victim.getColor());\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n players.add(t);\n try{\n p.getPh().getWeaponDeck().getWeapon(w1.getName()).doEffect(\"alt\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2 && t.getPb().countDamages() == 2);\n\n try{\n p.getPh().getWeaponDeck().getWeapon(w1.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 3 && t.getPb().countDamages() == 3);\n }", "public void takeHeal(double amount)\n\t{\n\t\tif(healthHardCap == -1)\n\t\t{\n\t\t\tthis.maxHealth += amount;\n\t\t}\n\t\tthis.health = Math.min(this.health + amount, this.maxHealth);\n\t}", "@Test\n void doEffectshockwave() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n RealPlayer b = new RealPlayer('b', \"blue\");\n RealPlayer e = new RealPlayer('e', \"emerald\");\n RealPlayer gr = new RealPlayer('g', \"grey\");\n RealPlayer v = new RealPlayer('v', \"violet\");\n RealPlayer y = new RealPlayer('y', \"yellow\");\n AlphaGame.getPlayers().add(b);\n AlphaGame.getPlayers().add(e);\n AlphaGame.getPlayers().add(gr);\n AlphaGame.getPlayers().add(v);\n AlphaGame.getPlayers().add(y);\n WeaponFactory wf = new WeaponFactory(\"shockwave\");\n Weapon w12 = new Weapon(\"shockwave\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w12);\n p.setPlayerPosition(Board.getSquare(6));\n p.getPh().drawWeapon(wd, w12.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(7));\n RealPlayer victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(5));\n RealPlayer victim3 = new RealPlayer('g', \"ciccia\");\n victim3.setPlayerPosition(Board.getSquare(10));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n players.add(victim2);\n players.add(victim3);\n try{\n p.getPh().getWeaponDeck().getWeapon(w12.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException ex) { }\n\n assertTrue(victim.getPb().countDamages() == 1 && victim2.getPb().countDamages() == 1 && victim3.getPb().countDamages() == 1);\n\n victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(5));\n victim3 = new RealPlayer('g', \"ciccia\");\n victim3.setPlayerPosition(Board.getSquare(10));\n players.clear();\n players.add(victim2);\n players.add(victim3);\n try{\n p.getPh().getWeaponDeck().getWeapon(w12.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException ex) { }\n\n assertTrue(victim2.getPb().countDamages() == 1 && victim3.getPb().countDamages() == 1);\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(7));\n victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(5));\n victim3 = new RealPlayer('g', \"ciccia\");\n victim3.setPlayerPosition(Board.getSquare(10));\n RealPlayer victim4 = new RealPlayer('b', \"ciccia\");\n RealPlayer victim5 = new RealPlayer('p', \"ciccia\");\n victim4.setPlayerPosition(Board.getSquare(1));\n victim5.setPlayerPosition(Board.getSquare(0));\n players.clear();\n try {\n p.getPh().getWeaponDeck().getWeapon(w12.getName()).doEffect(\"alt\", null, null, p, null, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException ex) { }\n\n assertTrue(victim.getPb().countDamages() == 1 && victim2.getPb().countDamages() == 1 && victim3.getPb().countDamages() == 1 && victim4.getPb().countDamages() == 0 && victim5.getPb().countDamages() == 0);\n }", "public void forgetStats() {\n this.name = generateIdiotName();\n hitPoints = HeroesVersusMonsters.randInt(70, 200);\n //Without this line forgetStats() would be a very overpowered healing ability\n subtractHitPointsSilently(this.damageTaken);\n attackSpeed = HeroesVersusMonsters.randInt(2, 6);\n damageMax = HeroesVersusMonsters.randInt(30, 60);\n damageMin = HeroesVersusMonsters.randInt(15, 30);\n chanceToHit = HeroesVersusMonsters.randDouble(0.6D, 0.8D);\n chanceToBlock = HeroesVersusMonsters.randDouble(0.2D, 0.4D);\n Interface.showln(\"You are now \" + this.getName() + \", a forgetful idiot with a max health of \" + this.getHitPoints());\n Interface.showln(\"You have an attack speed of \" + this.getAttackSpeed() + \" and deal damage ranging from \" + this.getDamageMin() + \" to \" + this.getDamageMax());\n Interface.showln(\"You have a \" + (int) (this.getchanceToHit() * 100) + \"% chance to hit, and a \" + (int) (this.getChanceToBlock() * 100) + \"% chance to block\");\n }", "int getHealth();", "@Test\n void doEffecttractorbeam() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n setPlayers(pl);\n WeaponFactory wf = new WeaponFactory(\"tractor beam\");\n Weapon w2 = new Weapon(\"tractor beam\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n wd.getWeapons().add(w2);\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n p.setPlayerPosition(Board.getSquare(0));\n p.getPh().drawWeapon(wd, w2.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(6));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n ArrayList<GenericSquare> s = new ArrayList<>();\n s.add(Board.getSpawnpoint('b'));\n try {\n p.getPh().getWeaponDeck().getWeapon(w2.getName()).doEffect(\"base\", null, null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n assertTrue(players.get(0).getPb().countDamages() == 1 && players.get(0).getPlayerPosition() == Board.getSpawnpoint('b'));\n\n players.get(0).setPlayerPosition(Board.getSquare(1));\n s.clear();\n\n try{\n p.getPh().getWeaponDeck().getWeapon(w2.getName()).doEffect(\"alt\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(players.get(0).getPb().countDamages() == 4 && players.get(0).getPlayerPosition() == p.getPlayerPosition());\n }", "@Override\n\tpublic int fight(Enemy e1) {\n\t\tint damage = 0;\n\t\tRandom randomNum = new Random();\n\t\tdamage = 6 + randomNum.nextInt(4);\n\t\ttry {\n\t\t\te1.takeDamage(damage);\n\t\t} catch (InvalidDamageException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn damage;\n\t}", "@Override\n public void hp(){\n HP=50*nivel;\n }", "public float getHealth(){\n return health.getHealth();\n }", "public abstract int getRandomDamage();", "@Override\n\tpublic void damage(float f) {\n\t\t\n\t}", "public void updateHealth(String target, Integer amount, boolean isAttack){\n\n if(target == \"player\"){\n if(isAttack){\n //To make defence/armour a bit weaker, round up on the damage.\n playerShipHealth+= (int) (amount - Math.ceil(amount*playerShipDefence));\n } else{\n playerShipHealth+=amount;\n\n }\n if (playerShipHealth > playerShipHealthMax){\n playerShipHealth = playerShipHealthMax;}\n else if (playerShipHealth <= 0){\n //PlayerDied\n\n playerShipDead = true;\n playerShip.setIsDead();\n }\n\n } else if (target == \"enemy\"){\n if(isAttack){\n enemyShipHealth+= (int) (amount - Math.ceil(amount*enemyShipDefence));\n } else{\n enemyShipHealth+=amount;\n }\n if (enemyShipHealth > enemyShipHealthMax){\n enemyShipHealth = enemyShipHealthMax;}\n else if (enemyShipHealth <= 0){\n //Enemy Died\n enemyShipDead = true;\n enemyShip.setIsDead();\n }\n }\n }", "public int getHealthCost();", "private void drawHealthPoints() {\n int i = 0;\n for (; i < Math.floor(gameWorld.getHero().getHealthPoints()); i++) {\n hudBatch.draw(heartFull, i * HEART_SIZE, VIRTUAL_HEIGHT - HEART_SIZE, HEART_SIZE, HEART_SIZE);\n }\n if (gameWorld.getHero().getHealthPoints() % 1 != 0) {\n hudBatch.draw(heartHalf, i++ * HEART_SIZE, VIRTUAL_HEIGHT - HEART_SIZE, HEART_SIZE, HEART_SIZE);\n }\n for (; i < gameWorld.getHero().getMaxHealthPoints(); i++) {\n hudBatch.draw(heartEmpty, i * HEART_SIZE, VIRTUAL_HEIGHT - HEART_SIZE, HEART_SIZE, HEART_SIZE);\n }\n }", "@Test\n void doEffectthor() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"t.h.o.r.\");\n Weapon w15 = new Weapon(\"t.h.o.r.\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w15);\n p.setPlayerPosition(Board.getSquare(6));\n p.getPh().drawWeapon(wd, w15.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(7));\n RealPlayer victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(10));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n players.add(victim2);\n try {\n p.getPh().getWeaponDeck().getWeapon(w15.getName()).doEffect(\"base\", \"opt1\", null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2 && victim2.getPb().countDamages() == 1);\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(7));\n victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(10));\n RealPlayer victim3 = new RealPlayer('g', \"ciccia\");\n victim3.setPlayerPosition(Board.getSpawnpoint('y'));\n players.clear();\n players.add(victim);\n players.add(victim2);\n players.add(victim3);\n try {\n p.getPh().getWeaponDeck().getWeapon(w15.getName()).doEffect(\"base\", \"opt1\", \"opt2\", p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2 && victim2.getPb().countDamages() == 1 && victim3.getPb().countDamages() == 2);\n }", "public double castFireball(){\n this.mana -= fireball.manaCost;\n return fireball.hit();\n }", "public int getHealth();" ]
[ "0.7858827", "0.7695189", "0.7604803", "0.75100595", "0.75090367", "0.74339813", "0.7364095", "0.73088205", "0.7236234", "0.7234015", "0.7175396", "0.7027721", "0.6996787", "0.6951713", "0.6898153", "0.68437696", "0.68277943", "0.67811286", "0.67229974", "0.6703102", "0.6653781", "0.66217864", "0.6600229", "0.65728873", "0.65501297", "0.65405697", "0.64386076", "0.64105177", "0.6351257", "0.63205314", "0.63124406", "0.6303445", "0.6278319", "0.6247292", "0.62379956", "0.6233122", "0.6192449", "0.6185022", "0.6181417", "0.6181188", "0.6117095", "0.6097261", "0.6079765", "0.6076707", "0.6075208", "0.6074534", "0.6058123", "0.6043997", "0.60381687", "0.60314757", "0.6024089", "0.6020659", "0.60155416", "0.6002363", "0.59889644", "0.5982405", "0.5979154", "0.5958786", "0.5948052", "0.5933429", "0.5932059", "0.5931665", "0.5927192", "0.59225416", "0.5915961", "0.59107345", "0.58971167", "0.5894778", "0.5889784", "0.5884802", "0.5876537", "0.5865952", "0.58619255", "0.5861531", "0.5854597", "0.5853696", "0.5836079", "0.5836036", "0.583196", "0.5822671", "0.58209676", "0.5813901", "0.5808664", "0.5807891", "0.5800412", "0.5797212", "0.57912505", "0.5786695", "0.57779634", "0.5773", "0.5771529", "0.57701224", "0.57700753", "0.57681537", "0.5763618", "0.5763037", "0.57507443", "0.574488", "0.5744832", "0.5738876", "0.573463" ]
0.0
-1
Parse the file and output in ".igv" format
public void convert(File inputFile, File outputFile) throws IOException { setType(inputFile); BufferedReader reader = null; PrintWriter writer = null; try { reader = new BufferedReader(new FileReader(inputFile)); writer = new PrintWriter(new BufferedWriter(new FileWriter(outputFile))); String nextLine = null; // Skip meta data. Note for GCT files this includes the mandatory first line while ((nextLine = reader.readLine()).startsWith("#") && (nextLine != null)) { writer.println(nextLine); } // This is the first non-meta line writer.println(nextLine); // for TAB and RES files the first row contains the column headings. int nCols = 0; if (type == FileType.TAB || type == FileType.RES) { nCols = nextLine.split("\t").length; } if (type == FileType.GCT) { // GCT files. Column headings are 3rd row (read next line) nextLine = reader.readLine(); nCols = nextLine.split("\t").length; writer.println(nextLine); } else if (type == FileType.RES) { // Res files -- skip lines 2 and 3 writer.println(reader.readLine()); writer.println(reader.readLine()); } // Compute the # of data points int columnSkip = 1; if (type == FileType.RES) { columnSkip = 2; nCols++; // <= last call column of a res file is sometimes blank, if not this will get } nPts = (nCols - dataStartColumn) / columnSkip; // Now for the data while ((nextLine = reader.readLine()) != null) { String[] tokens = nextLine.split("\t"); for (int i = 0; i < dataStartColumn; i++) { writer.print(tokens[i] + "\t"); } DataRow row = new DataRow(tokens, nextLine); for (int i = 0; i < nPts; i++) { if (Double.isNaN(row.scaledData[i])) { writer.print("\t"); } else { writer.print(row.scaledData[i]); if (type == FileType.RES) { writer.print("\t" + row.calls[i]); } if (i < nPts - 1) { writer.print("\t"); } } } writer.println(); } } finally { if (reader != null) { reader.close(); } if (writer != null) { writer.close(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getIGVExtension(String path) {\n\n // String off gzip first\n if (path.endsWith(\".gz\")) path = path.substring(0, path.length() - 3);\n\n // Now common qualifiers\n if (path.endsWith(\".txt\") || path.endsWith(\".xls\")) path = path.substring(0, path.length() - 4);\n\n int idx = path.lastIndexOf('.');\n return idx < 0 ? path : path.substring(idx + 1, path.length());\n }", "public String parse(File file);", "private void translator(File inputFile) throws IOException {\n Parser fileParser = new Parser(inputFile);\n CodeWriter writer = new CodeWriter(inputFile);\n String outputName = inputFile.getPath().replace(\".vm\", \".asm\");\n writer.setFileName(inputFile.getName().replace(\".vm\", \"\"));\n\n Path outputPath = Paths.get(outputName);\n PrintWriter out = new PrintWriter(Files.newBufferedWriter(outputPath));\n\n String line;\n while (fileParser.hasMoreCommends()) {\n line = fileParser.adanvce();\n fileParser.lineAnalizer(line); // updates parser fields\n int CommendType = fileParser.getCommendType();\n\n switch (CommendType) {\n case Parser.C_ARITHMETIC:\n writer.writeArithmetic(fileParser.getArg1());\n break;\n case Parser.C_PUSH:\n case Parser.C_POP:\n writer.writePushPop(CommendType, fileParser.getArg1(), fileParser.getArg2());\n break;\n }\n\n }\n fileParser.close();\n writer.close();\n }", "private void cmdGenVCG(String filename) throws NoSystemException {\n MSystem system = system();\n PrintWriter out = null;\n try {\n if (filename == null)\n out = new PrintWriter(System.out);\n else {\n out = new PrintWriter(new BufferedWriter(new FileWriter(\n filename)));\n }\n ModelToGraph.write(out, system.model());\n } catch (IOException ex) {\n Log.error(ex.getMessage());\n } finally {\n if (out != null) {\n out.flush();\n if (filename != null)\n out.close();\n }\n }\n }", "public void parse(String filename);", "void visitFile(File file);", "protected abstract void parseFile(File f) throws IOException;", "@Override\r\n\tpublic void handleFile(String inFilename, String outFilename) \r\n\t{\n\r\n\r\n\t\tString s = slurpFile(inFilename);\r\n\t\tDocument teiDocument = parsePlainText(s);\r\n\t\ttry \r\n\t\t{\r\n\t\t\tPrintStream pout = new PrintStream(new FileOutputStream(outFilename));\r\n\t\t\tpout.print(XML.documentToString(teiDocument));\r\n\t\t\tpout.close();\r\n\t\t} catch (FileNotFoundException e) \r\n\t\t{\r\n\t\t\te.printStackTrace\r\n\t\t\t();\r\n\r\n\t\t}\t\r\n\t}", "private void processGeneFile(String inputFilename, String taxonID) throws IOException {\n BufferedReader reader = createInputFileReader(inputFilename);\n String line;\n String[] columns;\n \n \t// Skip the first line\n line = reader.readLine();\n while (reader.ready()) {\n line = reader.readLine();\n \t\t//writeToDebugFile(line);\n \t\tif (line.substring(0,1).equals(\"#\")) {\n \t\twriteToErrorFile(line, \"Comment\");\n \t\t\tcontinue;\n \t\t}\n columns = line.split(INPUT_COLUMN_DELIM);\n \n String rgdID = columns[0].trim();\n \n // If line contains column names (usually first line), skip it\n if (rgdID.equals(\"GENE_RGD_ID\")) continue;\n \n String geneSymbol = columns[1].trim();\n String chromosome = columns[6].trim(); \n \n \t\t// columns[14] == start base pair\n \t\t// columns[15] == end base pair\n \t\t// columns[16] == strand (- or +)\n \n String mapLocation = getMapLocation(columns[14], columns[15], columns[16].trim());\n \n // The following columns may contain multiple items\n String[] entrezGeneIDs = splitListColumn(columns[20]);\n String[] swissProtIDs = splitListColumn(columns[21]);\n String[] genBankRNAIDs = splitListColumn(columns[23]);\n String[] genBankProteinIDs = splitListColumn(columns[25]);\n String[] unigeneIDs = splitListColumn(columns[26]);\n String[] ensemblIDs;\n \n // if columns.length < 38, the last column (Ensembl ID) is missing\n // from the input file\n if (columns.length < 38) {\n // since there are no EnsemblIDs, set the variable to an empty array,\n // which is what splitListColumn() would do\n ensemblIDs = EMPTY_STRING_ARRAY;\n } else {\n //ensemblIDs = columns[37].split(INPUT_LIST_DELIM);\n ensemblIDs = splitListColumn(columns[37]);\n }\n \n // Write RGD Info\n writeToInfoFile(taxonID, RGD_ID_TYPE, rgdID, chromosome, mapLocation);\n \n // Write Gene Symbol and Ensembl ID Info and Links\n if (!geneSymbol.equals(\"\")) {\n writeToInfoFile(taxonID, \"Gene Symbol\", geneSymbol, chromosome, mapLocation);\n writeToLinksFile(RGD_ID_TYPE,rgdID,\"Gene Symbol\",geneSymbol);\n }\n for (int i = 0; i < ensemblIDs.length; i++) {\n writeToInfoFile(taxonID, \"Ensembl ID\", ensemblIDs[i], chromosome, mapLocation);\n writeToLinksFile(RGD_ID_TYPE,rgdID,\"Ensembl ID\",ensemblIDs[i]);\n }\n \n // Handle NCBI RefSeq and non-RefSeq IDs (both RNA and Protein)\n for (int i = 0; i < genBankRNAIDs.length; i++) {\n String genBankRNAID = genBankRNAIDs[i];\n if (isRefSeq(genBankRNAID)) {\n writeToLinksFile(RGD_ID_TYPE,rgdID,\"RefSeq RNA ID\",genBankRNAIDs[i]);\n } else {\n writeToLinksFile(RGD_ID_TYPE,rgdID,\"NCBI RNA ID\",genBankRNAIDs[i]);\n }\n }\n for (int i = 0; i < genBankProteinIDs.length; i++) {\n String genBankProteinID = genBankProteinIDs[i];\n if (isRefSeq(genBankProteinID)) {\n writeToLinksFile(RGD_ID_TYPE,rgdID,\"RefSeq Protein ID\",genBankProteinIDs[i]);\n } else {\n writeToLinksFile(RGD_ID_TYPE,rgdID,\"NCBI Protein ID\",genBankProteinIDs[i]);\n }\n } \n \n // create Links entries for the rest\n writeCollectionToLinksFile(RGD_ID_TYPE,rgdID,\"Entrez Gene ID\",Arrays.asList(entrezGeneIDs));\n writeCollectionToLinksFile(RGD_ID_TYPE,rgdID,\"SwissProt ID\",Arrays.asList(swissProtIDs));\n writeCollectionToLinksFile(RGD_ID_TYPE,rgdID,\"UniGene ID\",Arrays.asList(unigeneIDs));\n } \n reader.close();\n }", "protected void createParseAllVisitorInterface(File dir) {\n\t // Prepare the arguments for the output procedure\n\t PrintWriter visitor=null;\n\t String fileName = context.getNaming().getParseAllVisitorInterface(modelName)+\".java\";\n\t try {\n\t visitor = new PrintWriter(new FileWriter(new File(dir, fileName)), true);\n\t } catch (Exception e) {\n\t log.reportError(\"Cannot open file '\"+fileName+\"'.\", e);\n\t }\n\t // Call the output procedure\n\t\t(new InvariantsParseAllInterfTemplate(model, context, invariants, visitor)).generate();\n\t\tvisitor.close();\n\t}", "public void parse(String fileName) throws Exception;", "public Vector loadAffyGCOSExpressionFile(File f) throws IOException {\r\n \tthis.setTMEVDataType();\r\n final int preSpotRows = this.sflp.getXRow()+1;\r\n final int preExperimentColumns = this.sflp.getXColumn();\r\n int numLines = this.getCountOfLines(f);\r\n int spotCount = numLines - preSpotRows;\r\n\r\n if (spotCount <= 0) {\r\n JOptionPane.showMessageDialog(superLoader.getFrame(), \"There is no spot data available.\", \"TDMS Load Error\", JOptionPane.INFORMATION_MESSAGE);\r\n }\r\n \r\n int[] rows = new int[] {0, 1, 0};\r\n int[] columns = new int[] {0, 1, 0};\r\n //String value,pvalue;\r\n String detection;\r\n\r\n float cy3, cy5;\r\n\r\n String[] moreFields = new String[1];\r\n String[] extraFields=null;\r\n final int rColumns = 1;\r\n final int rRows = spotCount;\r\n \r\n ISlideData slideDataArray[]=null;\r\n AffySlideDataElement sde=null;\r\n FloatSlideData slideData=null;\r\n \r\n BufferedReader reader = new BufferedReader(new FileReader(f));\r\n StringSplitter ss = new StringSplitter((char)0x09);\r\n String currentLine;\r\n int counter, row, column,experimentCount=0;\r\n counter = 0;\r\n row = column = 1;\r\n this.setFilesCount(1);\r\n this.setRemain(1);\r\n this.setFilesProgress(0);\r\n this.setLinesCount(numLines);\r\n this.setFileProgress(0);\r\n float[] intensities = new float[2];\r\n \r\n while ((currentLine = reader.readLine()) != null) {\r\n if (stop) {\r\n return null;\r\n }\r\n// fix empty tabbs appending to the end of line by wwang\r\n while(currentLine.endsWith(\"\\t\")){\r\n \tcurrentLine=currentLine.substring(0,currentLine.length()-1);\r\n }\r\n ss.init(currentLine);\r\n \r\n if (counter == 0) { // parse header\r\n \t\r\n \tif(sflp.onlyIntensityRadioButton.isSelected()) \r\n \t\texperimentCount = ss.countTokens()- preExperimentColumns;\r\n \t\t\r\n \tif(sflp.intensityWithDetectionRadioButton.isSelected()) \r\n \t\texperimentCount = (ss.countTokens()+1- preExperimentColumns)/2;\r\n \t\t\r\n \tif(sflp.intensityWithDetectionPvalRadioButton.isSelected()) \r\n \t\texperimentCount = (ss.countTokens()+1- preExperimentColumns)/3;\r\n \t\r\n \t\r\n \tslideDataArray = new ISlideData[experimentCount];\r\n \tSampleAnnotation sampAnn=new SampleAnnotation();\r\n \tslideDataArray[0] = new SlideData(rRows, rColumns, sampAnn);//Added by Sarita to include SampleAnnotation model.\r\n \r\n slideDataArray[0].setSlideFileName(f.getPath());\r\n for (int i=1; i<experimentCount; i++) {\r\n \tsampAnn=new SampleAnnotation();\r\n \tslideDataArray[i] = new FloatSlideData(slideDataArray[0].getSlideMetaData(),spotCount, sampAnn);//Added by Sarita \r\n \tslideDataArray[i].setSlideFileName(f.getPath());\r\n \t//System.out.println(\"slideDataArray[i].slide file name: \"+ f.getPath());\r\n }\r\n if(sflp.onlyIntensityRadioButton.isSelected()){\r\n \tString [] fieldNames = new String[1];\r\n \t//extraFields = new String[1];\r\n \tfieldNames[0]=\"AffyID\";\r\n \tslideDataArray[0].getSlideMetaData().appendFieldNames(fieldNames);\r\n }else if(sflp.intensityWithDetectionRadioButton.isSelected()){\r\n \tString [] fieldNames = new String[2];\r\n \textraFields = new String[1];\r\n fieldNames[0]=\"AffyID\";\r\n fieldNames[1]=\"Detection\";\r\n slideDataArray[0].getSlideMetaData().appendFieldNames(fieldNames);\r\n }else{\r\n \tString [] fieldNames = new String[3];\r\n \textraFields = new String[2];\r\n fieldNames[0]=\"AffyID\";\r\n fieldNames[1]=\"Detection\";\r\n fieldNames[2]=\"P-value\";\r\n slideDataArray[0].getSlideMetaData().appendFieldNames(fieldNames);\r\n \r\n }\r\n ss.nextToken();//parse the blank on header\r\n for (int i=0; i<experimentCount; i++) {\r\n \tString val=ss.nextToken();\r\n\t\t\t\t\tslideDataArray[i].setSampleAnnotationLoaded(true);\r\n\t\t\t\t\tslideDataArray[i].getSampleAnnotation().setAnnotation(\"Default Slide Name\", val);\r\n\t\t\t\t\tslideDataArray[i].setSlideDataName(val);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.mav.getData().setSampleAnnotationLoaded(true);\r\n\t\t\t \t \r\n if(sflp.intensityWithDetectionPvalRadioButton.isSelected()){\r\n \tss.nextToken();//parse the detection\r\n ss.nextToken();//parse the pvalue\r\n }else if(sflp.intensityWithDetectionRadioButton.isSelected()){\r\n \tss.nextToken();//parse the detection \r\n } \r\n }\r\n \r\n } else if (counter >= preSpotRows) { // data rows\r\n \trows[0] = rows[2] = row;\r\n \tcolumns[0] = columns[2] = column;\r\n \tif (column == rColumns) {\r\n \t\tcolumn = 1;\r\n \t\trow++;//commented by sarita\r\n \t\t\r\n \t\t\r\n \t} else {\r\n \t\tcolumn++;//commented by sarita\r\n \t\t\r\n \t\t\r\n \t}\r\n\r\n \t//affy ID\r\n \tmoreFields[0] = ss.nextToken();\r\n \r\n \t\r\n \t\r\n String cloneName = moreFields[0];\r\n if(_tempAnno.size()!=0) {\r\n \t \r\n \t \t \r\n \t if(((MevAnnotation)_tempAnno.get(cloneName))!=null) {\r\n \t\t MevAnnotation mevAnno = (MevAnnotation)_tempAnno.get(cloneName);\r\n\r\n \t\t sde = new AffySlideDataElement(String.valueOf(row+1), rows, columns, intensities, moreFields, mevAnno);\r\n \t }else {\r\n \t /**\r\n \t * Sarita: clone ID explicitly set here because if the data file\r\n \t * has a probe (for eg. Affy house keeping probes) for which Resourcerer\r\n \t * does not have annotation, MeV would still work fine. NA will be\r\n \t * appended for the rest of the fields. \r\n \t * \r\n \t * \r\n \t */\r\n \t\tMevAnnotation mevAnno = new MevAnnotation();\r\n \t\tmevAnno.setCloneID(cloneName);\r\n sde = new AffySlideDataElement(String.valueOf(row+1), rows, columns, new float[2], moreFields, mevAnno);\r\n \t \t\t \r\n }\r\n }\r\n /* Added by Sarita\r\n * Checks if annotation was loaded and accordingly use\r\n * the appropriate constructor.\r\n * \r\n * \r\n */\r\n \r\n else {\r\n sde = new AffySlideDataElement(String.valueOf(row+1), rows, columns, intensities, moreFields);\r\n }\r\n \r\n \t\r\n \t//sde = new AffySlideDataElement(String.valueOf(row+1), rows, columns, new float[2], moreFields);\r\n\r\n \tslideDataArray[0].addSlideDataElement(sde);\r\n \tint i=0;\r\n\r\n \tfor ( i=0; i<slideDataArray.length; i++) { \r\n \t\ttry {\t\r\n\r\n \t\t\t// Intensity\r\n \t\t\tintensities[0] = 1.0f;\r\n \t\t\tintensities[1] = ss.nextFloatToken(0.0f);\r\n \t\t\r\n \t\t\tif(sflp.intensityWithDetectionPvalRadioButton.isSelected()){\r\n \t\t\t\t\r\n \t\t\t\textraFields[0]=ss.nextToken();//detection\r\n \t\t\t\textraFields[1]=ss.nextToken();//p-value\r\n \t\t\t\t\r\n \t\t\t}else if(sflp.intensityWithDetectionRadioButton.isSelected()){\r\n \t\t\t\textraFields[0]=ss.nextToken();//detection\r\n \t\t\t}\r\n\r\n \t\t} catch (Exception e) {\r\n \t\t\t\r\n \t\t\tintensities[1] = Float.NaN;\r\n \t\t}\r\n \t\tif(i==0){\r\n \t\t\t\r\n \t\t\tslideDataArray[i].setIntensities(counter - preSpotRows, intensities[0], intensities[1]);\r\n \t\t\t//sde.setExtraFields(extraFields);\r\n \t\t\tif(sflp.intensityWithDetectionPvalRadioButton.isSelected()){\r\n \t\t\t\tsde.setDetection(extraFields[0]);\r\n \t\t\t\tsde.setPvalue(new Float(extraFields[1]).floatValue());\r\n \t\t\t}else if(sflp.intensityWithDetectionRadioButton.isSelected()){\r\n \t\t\t\tsde.setDetection(extraFields[0]);\r\n \t\t\t}\r\n \t\t}else{\r\n \t\t\tif(i==1){\r\n \t\t\t\tmeta = slideDataArray[0].getSlideMetaData(); \t\r\n \t\t\t}\r\n \t\t\tslideDataArray[i].setIntensities(counter-preSpotRows,intensities[0],intensities[1]);\r\n \t\t\tif(sflp.intensityWithDetectionPvalRadioButton.isSelected()){\r\n \t\t\t\t((FloatSlideData)slideDataArray[i]).setDetection(counter-preSpotRows,extraFields[0]);\r\n \t\t\t\t((FloatSlideData)slideDataArray[i]).setPvalue(counter-preSpotRows,new Float(extraFields[1]).floatValue());\r\n \t\t\t}\r\n \t\t\tif(sflp.intensityWithDetectionRadioButton.isSelected()){\r\n \t\t\t\t((FloatSlideData)slideDataArray[i]).setDetection(counter-preSpotRows,extraFields[0]);\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n\r\n } else {\r\n //we have additional sample annoation\r\n \r\n \tfor (int i = 0; i < preExperimentColumns - 1; i++) {\r\n\t\t\t\t\tss.nextToken();\r\n\t\t\t\t}\r\n\t\t\t\tString key = ss.nextToken();\r\n\r\n\t\t\t\tfor (int j = 0; j < slideDataArray.length; j++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(slideDataArray[j].getSampleAnnotation()!=null){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tString val=ss.nextToken();\r\n\t\t\t\t\t\tslideDataArray[j].getSampleAnnotation().setAnnotation(key, val);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tSampleAnnotation sampAnn=new SampleAnnotation();\r\n\t\t\t\t\t\t\tsampAnn.setAnnotation(key, ss.nextToken());\r\n\t\t\t\t\t\t\tslideDataArray[j].setSampleAnnotation(sampAnn);\r\n\t\t\t\t\t\t\tslideDataArray[j].setSampleAnnotationLoaded(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n \t}\r\n \t\r\n this.setFileProgress(counter);\r\n \tcounter++;\r\n \t//System.out.print(counter);\r\n \t}\r\n reader.close();\r\n \r\n \r\n Vector data = new Vector(slideDataArray.length);\r\n \r\n for(int j = 0; j < slideDataArray.length; j++)\r\n \tdata.add(slideDataArray[j]);\r\n \r\n this.setFilesProgress(1);\r\n return data;\r\n }", "public String VerticalOp() {\n String line;\n try {\n BufferedReader br = new BufferedReader(new FileReader(file1));\n BufferedReader br2 = new BufferedReader(new FileReader(file2));\n BufferedWriter bw = new BufferedWriter(new FileWriter(\"output\" + mProcCount + extension));\n\n do{\n line = br.readLine();\n bw.write(line);\n }while(line != null);\n\n do{\n line = br2.readLine();\n bw.write(line);\n bw.newLine();\n }while(line != null);\n bw.flush();\n }\n catch(FileNotFoundException e) {\n System.out.println(\"ERROR: File does not exist. Please input a valid input file.\");\n }\n catch(IOException e) {\n System.out.println(\"ERROR: Failure while reading from file.\");\n }\n ++mProcCount;\n return \"output\" + mProcCount + extension;\n }", "protected void addContentHMetisInFilePath() {\n\t\tPTNetlist ptNetlist = this.getNetlister().getPTNetlist();\n\t\tString newline = System.lineSeparator();\n\t\tMap<PTNetlistNode, Integer> vertexIntegerMap = this.getVertexIntegerMap();\n\t\tList<String> fileContent = new ArrayList<String>();\n\t\t// vertices\n\t\tPTNetlistNode src = null;\n\t\tPTNetlistNode dst = null;\n\t\tInteger srcInteger = null;\n\t\tInteger dstInteger = null;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < ptNetlist.getNumEdge(); i++){\n\t\t\tPTNetlistEdge edge = ptNetlist.getEdgeAtIdx(i);\n\t\t\tif (PTNetlistEdgeUtils.isEdgeConnectedToPrimary(edge)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttemp ++;\n\t\t\tsrc = edge.getSrc();\n\t\t\tdst = edge.getDst();\n\t\t\tsrcInteger = vertexIntegerMap.get(src);\n\t\t\tdstInteger = vertexIntegerMap.get(dst);\n\t\t\tfileContent.add(srcInteger + \" \" + dstInteger + newline);\n\t\t}\n\t\ttry {\n\t\t\tOutputStream outputStream = new FileOutputStream(this.getHMetisInFile());\n\t\t\tWriter outputStreamWriter = new OutputStreamWriter(outputStream);\n\t\t\t// Format of Hypergraph Input File\n\t\t\t// header lines are: [number of edges] [number of vertices] \n\t\t\t//\t\tsubsequent lines give each edge, one edge per line\n\t\t\toutputStreamWriter.write(temp + \" \" + vertexIntegerMap.size() + newline);\n\t\t\tfor (int i = 0; i < fileContent.size(); i++) {\n\t\t\t\toutputStreamWriter.write(fileContent.get(i));\n\t\t\t}\t\t\t\n\t\t\toutputStreamWriter.close();\n\t\t\toutputStream.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void addCNVTrack(String inDir, String outDir) {\n\t\tString[] split;\n\t\tString toWrite = \"\", chr, load;\n\t\tArrayList<Point> regions;\n\t\tint loc_min = Integer.MAX_VALUE, loc_max = Integer.MIN_VALUE;\n\t\tfloat min, max;\n\t\tFile[] files = (new File(inDir)).listFiles();\n\t\tfor (int i = 1; i<=22; i++) { //iterate through chromosomes\n\t\t\tif (i<=21)\n\t\t\t\tchr = Integer.toString(i);\n\t\t\telse\n\t\t\t\tchr = \"X\";\n\t\t\tSystem.out.println(\"chr\" + chr);\n\t\t\tfor (File file : files) {\n\t\t\t\tif (file.getName().indexOf(\".txt\")!=-1) {\n\t\t\t\t\tSystem.out.print(file.getName().split(\".txt\")[0] + \" \");\n\t\t\t\t\tload = FileOps.loadFromFile(file.getAbsolutePath());\n\t\t\t\t\tsplit = load.split(\"\\tchr\" + chr + \"\\t\"); //sans-\"chr\" for hepato\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttoWrite = \"\";\n\t\t\t\t\t\tregions = new ArrayList<Point>();\n\t\t\t\t\t\tmin = Float.MAX_VALUE; max = -1 * Float.MAX_VALUE;\n\t\t\t\t\t\tloc_min = Integer.MAX_VALUE; loc_max = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (int j = 1; j<split.length; j++) { //iterate through regions -- grab bounds\n\t\t\t\t\t\t\tif (Float.parseFloat(split[j].split(\"\\t\")[1].split(\"\\n\")[0]) > max)\n\t\t\t\t\t\t\t\tmax = Float.parseFloat(split[j].split(\"\\t\")[1].split(\"\\n\")[0]);\n\t\t\t\t\t\t\tif (Float.parseFloat(split[j].split(\"\\t\")[1].split(\"\\n\")[0]) < min)\n\t\t\t\t\t\t\t\tmin = Float.parseFloat(split[j].split(\"\\t\")[1].split(\"\\n\")[0]);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (Integer.parseInt(split[j].split(\"\\t\")[0]) < loc_min)\n\t\t\t\t\t\t\t\tloc_min = Integer.parseInt(split[j].split(\"\\t\")[0]);\n\t\t\t\t\t\t\tif (Integer.parseInt(split[j].split(\"\\t\")[0]) > loc_max)\n\t\t\t\t\t\t\t\tloc_max = Integer.parseInt(split[j].split(\"\\t\")[0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (int j = 1; j<split.length; j++) { //iterate through regions -- collect/merge\n\t\t\t\t\t\t\tif (regions.size()==0)\n\t\t\t\t\t\t\t\tregions.add(new Point(Integer.parseInt(split[j].split(\"\\t\")[0]), Integer.parseInt(split[j].split(\"\\t\")[0])\n\t\t\t\t\t\t\t\t\t\t, Float.parseFloat(split[j].split(\"\\t\")[1].split(\"\\n\")[0]) - min));\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tregions = cnvSplice(new Point(Integer.parseInt(split[j].split(\"\\t\")[0]), Integer.parseInt(split[j].split(\"\\t\")[0])\n\t\t\t\t\t\t\t\t\t\t, Float.parseFloat(split[j].split(\"\\t\")[1].split(\"\\n\")[0]) - min), regions);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(split.length + \" | \" + regions.size());\n\t\t\t\t\t\tfor (Point region : regions) //iterate through regions -- dump\n\t\t\t\t\t\t\tFileOps.appendToFile(outDir + \"/chr\" + chr + \".txt\", \"chr\" + chr + \" \" + region.x + \" \" + region.y + \" cn\" + (region.score / (float)region.z) + \" \" + Utils.normalize((float)Math.pow(2, Math.abs(region.score / (float)region.z)), (float)Math.pow(2, 0), (float)Math.pow(2, Math.abs(max - min)), 200, 900) + \" + \" + region.x + \" \" + region.y + \"\\n\");\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (Exception e) { e.printStackTrace(); System.out.println(\"throwing chr\" + chr); }\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\ttoWrite = \"browser position chr\" + chr + \":\" + loc_min + \"-\" + loc_max + \"\\nbrowser hide all\\n\"\n\t\t\t\t+ \"track name=\\\"CopyNumVar\\\" description=\\\" \\\" visibility=dense useScore=1\\n\";\n\t\t\tFileOps.writeToFile(outDir + \"/chr\" + chr + \".txt\", toWrite + FileOps.loadFromFile(outDir + \"/chr\" + chr + \".txt\"));\n\t\t}\n\t}", "public void visitFile(ICVSFile file) throws CVSException {\n \t\t\t\t}", "public BaseballElimination(String filename) {\n\n System.out.println(\"start parsing \" + filename);\n In in = new In(filename);\n if (in.hasNextLine()) {\n int count = Integer.valueOf(in.readLine());\n w = new int[count];\n l = new int[count];\n r = new int[count];\n g = new int[count][count];\n\n for (int i = 0; i < count; i++) {\n if (!in.hasNextLine()) {\n throw new IllegalArgumentException(\"Not enough lines, count is \" + count +\n \", file ends after \" + i + \" line\");\n }\n String line = in.readLine();\n System.out.println(\"Line: \" + line);\n\n String[] parts = line.split(\" \");\n names[i] = parts[0];\n w[i] = Integer.valueOf(parts[1]);\n l[i] = Integer.valueOf(parts[2]);\n r[i] = Integer.valueOf(parts[3]);\n for (int j = 0; j < count; j++) {\n g[i][j] = Integer.valueOf(parts[4 + j]);\n }\n System.out.print(\" Parsed: \" + names[i] + \" \" + w[i] + \" \" + l[i] + \" \" + r[i]);\n for (int j = 0; j < count; j++) {\n System.out.print(\" \" + g[i][j]);\n }\n System.out.println();\n }\n }\n System.out.println(\"end\");\n }", "public Vector loadExpressionFiles() throws IOException {\r\n \tif(isAnnotationSelected()) {\r\n \t\t\r\n \t\tthis.mav.getData().setAnnotationLoaded(true);\r\n\t\t\tFile annoFile=new File(getAnnotationFilePath());\r\n\t\t\tString extension=(annoFile.getName()).substring((annoFile.getName()).lastIndexOf('.')+1, annoFile.getName().length());\r\n\t\t\t\r\n\t\t\tif(annoFile.getName().endsWith(\"annot.csv\")){\r\n\t\t\t\t//System.out.println(\"Ends with annot.csv\");\r\n\t\t\t\tAffymetrixAnnotationParser aafp = AffymetrixAnnotationParser.createAnnotationFileParser(new File(getAnnotationFilePath()));\r\n\t\t\t\t_tempAnno = aafp.getAffyAnnotation();\r\n\t\t\t\t//chipAnno = aafp.getAffyChipAnnotation();\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tif(extension.equalsIgnoreCase(\"txt\")){\r\n\t\t\tAnnotationFileReader afr = AnnotationFileReader.createAnnotationFileReader(new File(getAnnotationFilePath()));\r\n\t\t\t_tempAnno = afr.getAffyAnnotation();\r\n\t\t\tchipAnno = afr.getAffyChipAnnotation();\r\n\t\t\t}\r\n \t\t \t\r\n }\r\n\r\n return loadAffyGCOSExpressionFile(new File(this.sflp.selectedFiles.getText()));\r\n }", "public void process(String infilename, String outfilename)\n throws IOException, Exception\n {\n PrintWriter pw = new PrintWriter(new FileWriter(outfilename));\n List<Result> resultList = this.api.processCitationsFromFile(infilename);\n for (Result result : resultList) {\n if (result != null) {\n\t/** Add cuis in evterms to cui set */\n\tfor (Utterance utterance : result.getUtteranceList()) {\n\t for (PCM pcm : utterance.getPCMList()) {\n\t for (Mapping map : pcm.getMappingList()) {\n\t for (Ev mapEv : map.getEvList()) {\n\t\tpw.println(infilename + \"|\" + \n\t\t\t pcm.getPhrase().getPhraseText() + \"|(\" +\n\t\t\t pcm.getPhrase().getPosition().getX() + \",\" + pcm.getPhrase().getPosition().getY() + \")|\" +\n\t\t\t mapEv.getScore() + \"|\" + \n\t\t\t mapEv.getConceptId() + \"|\" +\n\t\t\t ((mapEv.getNegationStatus() == 0) ? \"POS\" : \"NEG\") + \"|\" +\n\t\t\t mapEv.getConceptName () + \n\t\t\t pprintBracketedList(mapEv.getSemanticTypes(), \",\") + \"|\" +\n\t\t\t mapEv.getPreferredName() + \"|\" +\n\t\t\t pprintBracketedList(mapEv.getMatchedWords(), \",\") + \"|\" +\n\t\t\t pprintBracketedList(mapEv.getSources(), \",\") + \"|\");\n\t }\n\t }\n\t }\n\t}\n }\n }\n }", "public void parseFile() {\n File file = new File(inputFile);\n try {\n Scanner scan = new Scanner(file);\n\n while (scan.hasNextLine()) {\n String line = scan.nextLine();\n line = line.replaceAll(\"\\\\s+\", \" \").trim();\n\n if (line.isEmpty()) {\n continue;\n }\n // System.out.println(line);\n String cmd = line.split(\" \")[0];\n String lineWithoutCmd = line.replaceFirst(cmd, \"\").trim();\n // System.out.println(lineWithoutCmd);\n\n // The fields following each command\n String[] fields;\n\n switch (cmd) {\n case (\"add\"):\n fields = lineWithoutCmd.split(\"<SEP>\");\n fields[0] = fields[0].trim();\n fields[1] = fields[1].trim();\n fields[2] = fields[2].trim();\n add(fields);\n break;\n case (\"delete\"):\n\n fields = split(lineWithoutCmd);\n delete(fields[0], fields[1]);\n break;\n case (\"print\"):\n if (lineWithoutCmd.equals(\"ratings\")) {\n printRatings();\n break;\n }\n fields = split(lineWithoutCmd);\n\n print(fields[0], fields[1]);\n\n break;\n case (\"list\"):\n // need to check if it is the movie or reviewer\n fields = split(lineWithoutCmd);\n list(fields[0], fields[1]);\n break;\n case (\"similar\"):\n // need to check if it is the movie or reviewer\n fields = split(lineWithoutCmd);\n similar(fields[0], fields[1]);\n break;\n default:\n break;\n }\n\n }\n\n }\n catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "public static Object gvRenderFilename(Object... arg) {\r\nUNSUPPORTED(\"9xxpjotl5x2p5wtwqunca24kv\"); // int gvRenderFilename(GVC_t *gvc, graph_t *g, const char *format, const char *filename)\r\nUNSUPPORTED(\"erg9i1970wdri39osu8hx2a6e\"); // {\r\nUNSUPPORTED(\"1bh3yj957he6yv2dkeg4pzwdk\"); // int rc;\r\nUNSUPPORTED(\"1ag9dz4apxn0w3cz8w2bfm6se\"); // GVJ_t *job;\r\nUNSUPPORTED(\"8msotrfl0cngiua3j57ylm26b\"); // g = g->root;\r\nUNSUPPORTED(\"exts51afuertju5ed5v7pdpg7\"); // /* create a job for the required format */\r\nUNSUPPORTED(\"dn6z1r1bbrtmr58m8dnfgfnm0\"); // rc = gvjobs_output_langname(gvc, format);\r\nUNSUPPORTED(\"5apijrijm2r8b1g2l4x7iee7s\"); // job = gvc->job;\r\nUNSUPPORTED(\"5wvj0ph8uqfgg8jl3g39jsf51\"); // if (rc == 999) {\r\nUNSUPPORTED(\"cpui2f5hfk3cihua2ie59746n\"); // \tagerr(AGERR, \"Format: \\\"%s\\\" not recognized. Use one of:%s\\n\",\r\nUNSUPPORTED(\"2pjgp86rkudo6mihbako5yps2\"); // format, gvplugin_list(gvc, API_device, format));\r\nUNSUPPORTED(\"8d9xfgejx5vgd6shva5wk5k06\"); // \treturn -1;\r\nUNSUPPORTED(\"dvgyxsnyeqqnyzq696k3vskib\"); // }\r\nUNSUPPORTED(\"ect62lxc3zm51lhzifift55m\"); // job->output_lang = gvrender_select(job, job->output_langname);\r\nUNSUPPORTED(\"ewlceg1k4gs2e6syq4ear5kzo\"); // if (!(agbindrec(g, \"Agraphinfo_t\", 0, NOT(0)) && GD_drawing(g)) && !(job->flags & (1<<26))) {\r\nUNSUPPORTED(\"3yo4xyapbp7osp8uyz4kff98s\"); // \tagerrorf( \"Layout was not done\\n\");\r\nUNSUPPORTED(\"8d9xfgejx5vgd6shva5wk5k06\"); // \treturn -1;\r\nUNSUPPORTED(\"dvgyxsnyeqqnyzq696k3vskib\"); // }\r\nUNSUPPORTED(\"23iaqajrvbemalclzlgih1a09\"); // gvjobs_output_filename(gvc, filename);\r\nUNSUPPORTED(\"9szsye4q9jykqvtk0bc1r91d0\"); // rc = gvRenderJobs(gvc, g);\r\nUNSUPPORTED(\"7l8ugws8ptgtlxc1ymmh3cf18\"); // gvrender_end_job(job);\r\nUNSUPPORTED(\"dql0bth0nzsrpiu9vnffonrhf\"); // gvdevice_finalize(job);\r\nUNSUPPORTED(\"a9p7yonln7g91ge7xab3xf9dr\"); // gvjobs_delete(gvc);\r\nUNSUPPORTED(\"5bc9k4vsl6g7wejc5xefc5964\"); // return rc;\r\nUNSUPPORTED(\"c24nfmv9i7o5eoqaymbibp7m7\"); // }\r\n\r\nthrow new UnsupportedOperationException();\r\n}", "public void readTestFileToViterbi(String inputFile){\n\t\ttry {\n\t\t\tBufferedReader reader=new BufferedReader(new InputStreamReader(new FileInputStream(inputFile),\"ISO-8859-1\"));\n\t\t\tString line=null;\n\t\t\twhile((line=reader.readLine())!=null){\n\t\t\t\tString[] words=line.split(\" \");\n\t\t\t\tArrayList<String> wordList=new ArrayList<String>();\n\t\t\t\tassert(words.length>0&&words.length%2==0);\n\t\t\t\t\n\t\t\t\tfor(int i=0;i<words.length;i+=2){\n\t\t\t\t\twordList.add(words[i]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tArrayList<HashMap<String,ViterbiUnit>> viterbiMap=updateMuList(wordList);\n\t\t\t\tArrayList<ViterbiUnit> resultList=getMuList(viterbiMap);\n\t\t\t\tString outputLine=\"\";\n\t\t\t\tfor(int i=1;i<resultList.size()-1;i++){\n\t\t\t\t\tViterbiUnit unit=resultList.get(i);\n\t\t\t\t\toutputLine+=(words[2*(i-1)]+\" \"+unit.word+\" \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println(outputLine.substring(0, outputLine.length()-1));\n\t\t\t\t\n\t\t\t}\n\t\t\t//close the buffered reader\n\t\t\treader.close();\n\t\t\t\n\t\t}catch(IOException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void exportTEI(String path, String extention) throws IOException {\r\n\t\tList<Integer> seg1Atts = new ArrayList<Integer>();\r\n\t\tList<Integer> seg2Atts = new ArrayList<Integer>();\r\n\r\n\t\tint idCounter1 = 0, idCounter2 = 0;\r\n\r\n\t\tString[] tokens;\r\n\t\tString filename1 = new String(), filename2 = new String();\r\n\r\n\t\ttokens = dataModel.getProperty(\"file1\").split(\"\\\\\\\\\");\r\n\t\ttokens = tokens[tokens.length - 1].split(\"\\\\.\");\r\n\t\tfor (int i = 0; i < tokens.length - 1; i++) {\r\n\t\t\tfilename1 = filename1.concat(tokens[i]);\r\n\t\t\tfilename1 = filename1.concat(\".\");\r\n\t\t}\r\n\t\tif (filename1.endsWith(\".\")) {\r\n\t\t\tfilename1 = filename1.subSequence(0, filename1.length() - 1)\r\n\t\t\t\t\t.toString();\r\n\t\t}\r\n\r\n\t\ttokens = dataModel.getProperty(\"file2\").split(\"\\\\\\\\\");\r\n\t\ttokens = tokens[tokens.length - 1].split(\"\\\\.\");\r\n\t\tfor (int i = 0; i < tokens.length - 1; i++) {\r\n\t\t\tfilename2 = filename2.concat(tokens[i]);\r\n\t\t\tfilename2 = filename2.concat(\".\");\r\n\t\t}\r\n\t\tif (filename2.endsWith(\".\")) {\r\n\t\t\tfilename2 = filename2.subSequence(0, filename2.length() - 1)\r\n\t\t\t\t\t.toString();\r\n\t\t}\r\n\r\n\t\t//System.out.println(extention);\r\n\t\tpath = checkPath(path, extention);\r\n\r\n\t\ttry {\r\n\t\t\tOutputStream fout = new FileOutputStream(path);\r\n\t\t\tOutputStream bout = new BufferedOutputStream(fout);\r\n\t\t\tOutputStreamWriter output = new OutputStreamWriter(bout, \"UTF-8\");\r\n\r\n\t\t\toutput.write(\"<doc type=\" + \"\\\"\" + \"article_aligned\"\r\n\t\t\t\t\t\t\t+ \"\\\" projectName=\\\"\"\r\n\t\t\t\t\t\t\t+ dataModel.getProperty(\"projectName\") + \"\\\"\"\r\n\t\t\t\t\t\t\t+ \">\\r\\n\\r\\n\");\r\n\r\n\t\t\t// body\r\n\t\t\t// output.write(\"<doc>\\r\\n\\r\\n\");\r\n\r\n\t\t\tfor (int i = 0; i < idList1.size(); i++) {\r\n\r\n\t\t\t\tif (dataModel.getConnections(idList1.get(i)).isEmpty()) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!visited.contains(idList1.get(i))) {\r\n\t\t\t\t\tgoDeep(idList1.get(i));\r\n\r\n\t\t\t\t\tfor (int j = 0; j < tuvPair.size(); j++) {\r\n\t\t\t\t\t\tif (idList1.contains(tuvPair.get(j))) {\r\n\t\t\t\t\t\t\t// seg1.add(dataModel.getElement(tuvPair.get(j)));\r\n\t\t\t\t\t\t\tseg1Atts.add(tuvPair.get(j));\r\n\t\t\t\t\t\t\t// pair1++;\r\n\t\t\t\t\t\t} else if (idList2.contains(tuvPair.get(j))) {\r\n\t\t\t\t\t\t\t// seg2.add(dataModel.getElement(tuvPair.get(j)));\r\n\t\t\t\t\t\t\tseg2Atts.add(tuvPair.get(j));\r\n\t\t\t\t\t\t\t// pair2++;\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\toutput.write(\"<tu type=\" + \"\\\"\" + seg1Atts.size() + \":\"\r\n\t\t\t\t\t\t\t+ seg2Atts.size() + \"\\\"\" + \">\\r\\n\");\r\n\r\n\t\t\t\t\toutput.write(\"\\t\" + \"<seg lang=\" + \"\\\"\"\r\n\t\t\t\t\t\t\t+ dataModel.getProperty(\"language1\") + \"\\\">\\r\\n\");\r\n\r\n\t\t\t\t\tfor (int j = 0; j < seg1Atts.size(); j++) {\r\n\t\t\t\t\t\ttemp = constructAttributesOutput(seg1Atts.get(j));\r\n\r\n\t\t\t\t\t\toutput.write(\"\\t\\t\" + \"<s id=\" + \"\\\"\" + filename1\r\n\t\t\t\t\t\t\t\t+ \".S\" + idCounter1++ + \"\\\"\" + temp + \">\"\r\n\t\t\t\t\t\t\t\t+ dataModel.getElement(seg1Atts.get(j))\r\n\t\t\t\t\t\t\t\t+ \"</s>\\r\\n\");\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\toutput.write(\"\\t\" + \"</seg>\\r\\n\");\r\n\t\t\t\t\toutput.write(\"\\t\" + \"<seg lang=\" + \"\\\"\"\r\n\t\t\t\t\t\t\t+ dataModel.getProperty(\"language2\") + \"\\\">\\r\\n\");\r\n\r\n\t\t\t\t\tfor (int j = 0; j < seg2Atts.size(); j++) {\r\n\t\t\t\t\t\ttemp = constructAttributesOutput(seg2Atts.get(j));\r\n\r\n\t\t\t\t\t\toutput.write(\"\\t\\t\" + \"<s id=\" + \"\\\"\" + filename2\r\n\t\t\t\t\t\t\t\t+ \".S\" + idCounter2++ + \"\\\"\" + temp + \">\"\r\n\t\t\t\t\t\t\t\t+ dataModel.getElement(seg2Atts.get(j))\r\n\t\t\t\t\t\t\t\t+ \"</s>\\r\\n\");\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\toutput.write(\"\\t\" + \"</seg>\\r\\n\");\r\n\r\n\t\t\t\t\toutput.write(\"</tu>\\r\\n\\r\\n\");\r\n\t\t\t\t\tseg1Atts.clear();\r\n\t\t\t\t\tseg2Atts.clear();\r\n\t\t\t\t\ttuvPair.clear();\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\toutput.write(\"</doc>\");\r\n\r\n\t\t\toutput.close();\r\n\t\t\tvisited.clear();\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tthrow new FileNotFoundException(\r\n\t\t\t\t\t\"File could not be found!\\r\\n\"\r\n\t\t\t\t\t\t\t+ \"- Verify that the file exists in the specified location.\\r\\n\"\r\n\t\t\t\t\t\t\t+ \"- Check the spelling of the name of the document.\\r\\n\\r\\n\"\r\n\t\t\t\t\t\t\t+ path);\r\n\t\t} catch (UnsupportedEncodingException e) {\r\n\t\t\tthrow new UnsupportedEncodingException(\"Selected encoding is not supported.\");\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new IOException(\"I/O exception has occurred.\");\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n \tString file = \"ensembl_genes.txt\";\r\n \tString dbname = \"ensembl_homo_sapiens_38_36\";\r\n \tEnsembl2Visio ensj = new Ensembl2Visio();\r\n // \tensj.fetchFromEnsembl(nrGenes, organism, file); // Do this with perl\r\n \tensj.createGdbFromTxt(file, dbname);\r\n }", "public static void main(String[] args) throws IOException {\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.println(\"\\nNome do arquivo: \");\n\t\tString arquivo = sc.nextLine();\n\n\t\tFile input = new File(\"src/assets/\" + arquivo + \".txt\");\n\t\tBufferedReader in = new BufferedReader(new FileReader(input));\n\t\tString texto_cifrado = in.readLine();\n\n\t\t// Classe que realiza a decifragem\n\t\tVigenere vigenere = new Vigenere(texto_cifrado);\n\n\t\tint tamanho_chave = vigenere.encontraTamanhoChave();\n\n\t\t// Busca caracteres da chave\n\t\tString chave = vigenere.encontraChave(tamanho_chave);\n\n\t\t// Decifra texto usando a chave encontrada\n\t\tString result = vigenere.decifra(chave);\n\n\t\t// Salva resultado no arquivo\n\t\tSystem.out.println(\"\\nResultado salvo no arquivo: 'texto_claro.txt'\");\n\t\tString outputfile = \"texto_claro.txt\";\n\t\tFileWriter out = new FileWriter(outputfile, false);\n\t\tout.write(result);\n\t\tout.close();\n\t}", "private void fileToPoSTags(String filePath,int version){\n Log.log(\"Reading TreeBank file <\" + filePath +\">\");\n\n FileReader fr = null;\n BufferedReader br = null;\n\n try{\n fr = new FileReader(filePath);\n br = new BufferedReader(fr);\n\n String currentLine;\n String[] columns;\n\n Tag tag1 = null;\n Tag tag2;\n String word;\n\n Integer numRow;\n while((currentLine = br.readLine()) != null){\n columns = currentLine.split(\"\\t\");\n numRow = getIntegerString(columns[0]);\n if(numRow != null && numRow >= 1){\n if(numRow == 1) {\n tag1 = Tag.valueOf(\"START\");\n saveTag(tag1);\n }\n try{\n tag2 = Tag.valueOf(columns[3]);\n saveTag(tag2);\n word = columns[1];\n switch (version){\n case 1:\n savePoSTag(new PoSTag(word.toLowerCase(),tag2));\n break;\n case 2:\n if(!tag2.equals(Tag.PROPN))\n savePoSTag(new PoSTag(word.toLowerCase(),tag2));\n else if(Character.isUpperCase(word.charAt(0)))\n savePoSTag(new PoSTag(word,tag2));\n break;\n case 3:\n\n if(tag2.equals(Tag.PROPN))\n savePoSTag(new PoSTag(word,tag2));\n else{\n if(Character.isUpperCase(word.charAt(0))){\n savePoSTag(new PoSTag(word,tag2));\n savePoSTag(new PoSTag(word.toLowerCase(),tag2));\n }else{\n savePoSTag(new PoSTag(word,tag2));\n savePoSTag(new PoSTag(\n word.substring(0,1).toUpperCase()\n +word.substring(1),tag2));\n }\n\n }\n\n break;\n case 4:\n\n if(!tag2.equals(Tag.PROPN))\n savePoSTag(new PoSTag(word,tag2));\n savePoSTag(new PoSTag(word,tag2));\n break;\n case 5:\n\n if(!tag2.equals(Tag.PROPN))\n savePoSTag(new PoSTag(word.toLowerCase(),tag2));\n savePoSTag(new PoSTag(word,tag2));\n break;\n\n }\n saveBigram(new BiGram(tag1,tag2));\n tag1 = tag2;\n }catch (IllegalArgumentException e){\n e.printStackTrace();\n }\n }\n }\n\n }catch (IOException e){\n e.printStackTrace();\n }finally {\n UtilitiesIO.closeFile(fr,br);\n }\n }", "String process(File file) throws LocalizedSignatureException;", "public String getFormattedFileContents ();", "public VoiceExtraction(JFileChooser fChooser, LDVProject ldv) {\n try{\n input = new DataInputStream(new FileInputStream(fChooser.getSelectedFile()));\n currentDirectory = fChooser.getCurrentDirectory().getPath();\n } \n catch (Exception e) {\n System.err.println(\"File operation problem:\" + e.getMessage()); \n }\n }", "public static void tagExtractor() throws IOException {\t\n\t\tDate inizio=new Date();\n\t\t//Inizializzo le Regex\n\t\tRegex regex= new Regex();\n\t\tRegex.CreateRegex();\n\t\t//Inizializzo i file di output\n\t\tResult.inizialize();\n\n\t\tfinal File sourceDocDir = new File(\"C:/Users/Pietro/Desktop/datasetTagMining\");\n\t\tif (sourceDocDir.canRead()) {\n\t\t\tif (sourceDocDir.isDirectory()) {\n\t\t\t\tString[] files = sourceDocDir.list();\n\t\t\t\t// an IO error could occur\n\t\t\t\tif (files != null) {\n\t\t\t\t\tfor (int i = 0; i < files.length; i++) {\n\t\t\t\t\t\tSystem.out.println(files[i]);\n\t\t\t\t\t\tTagExtractor.Extractor(new File(sourceDocDir, files[i]),regex);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\n\n\n\t\t}\n\t\tDate fine=new Date();\n\t\tlong tempo=(fine.getTime() - inizio.getTime())/1000;\n\t\tResult.writeStats(\"Tempo Estrazione Tag: \"+\" \"+ tempo);\n\t\tResult.close();\n\n\n\n\n\t}", "Graph<V,E> load(String filename);", "protected void createParseAllVisitorImplementation(File dir) {\n\t // Prepare the arguments for the output procedure\n\t PrintWriter visitor=null;\n\t String fileName = context.getNaming().getParseAllVisitorClass(modelName)+\".java\";\n\t try {\n\t visitor = new PrintWriter(new FileWriter(new File(dir, fileName)), true);\n\t } catch (Exception e) {\n\t log.reportError(\"Cannot open file '\"+fileName+\"'.\", e);\n\t }\n\t // Call the output procedure\n\t (new InvariantsParseAllImplTemplate(model, context, invariants, visitor)).generate();\n\t visitor.close();\n\t}", "private boolean buildFile(IFile file) {\n \t\t/* \n \t\t * We want to compile each source file in .gf with these commands:\n \t\t * i --retain HelloEng.gf\n \t\t * ss -strip -save\n \t\t * \n \t\t * Shell command: echo \"ss -strip -save\" | gf -retain HelloEng.gf\n \t\t */\n \t\tString filename = file.getName();\n \t\tString buildDir = getBuildDirectory(file);\n \t\t\n \t\tArrayList<String> command = new ArrayList<String>();\n \t\tcommand.add(gfPath);\n \t\tcommand.add(\"--retain\");\n \t\tif (USE_INDIVIDUAL_FOLDERS) {\n \t\t\tcommand.add(String.format(\"..%1$s..%1$s%2$s\", java.io.File.separator, filename));\n \t\t} else {\n \t\t\tcommand.add(\"..\" + java.io.File.separator + filename);\n \t\t}\n \t\t\n \t\ttry {\n \t\t\t// Check the build directory and try to create it\n \t\t\tFile buildDirFile = new File(buildDir);\n \t\t\tif (!buildDirFile.exists()) {\n \t\t\t\tbuildDirFile.mkdir();\n \t\t\t}\n \t\t\t\n \t\t\t// Piece together our GF process\n \t\t\tProcessBuilder b = new ProcessBuilder(command);\n \t\t\tb.directory(buildDirFile);\n //\t\t\tb.redirectErrorStream(true);\n \t\t\tProcess process = b.start();\n \t\t\t\n \t\t\t// Feed it our commands, then quit\n \t\t\tBufferedWriter processInput = new BufferedWriter(new OutputStreamWriter(process.getOutputStream()));\n \t\t\tprocessInput.write(\"ss -strip -save\");\n \t\t\tprocessInput.newLine();\n \t\t\tprocessInput.flush();\n \t\t\tprocessInput.write(\"quit\");\n \t\t\tprocessInput.newLine();\n \t\t\tprocessInput.flush();\n \t\t\t\n //\t\t\tBufferedReader processError = new BufferedReader(new InputStreamReader(process.getErrorStream()));\n //\t\t\tString err_str;\n //\t\t\twhile ((err_str = processError.readLine()) != null) {\n//\t\t\t\tSystem.out.println(err_str);\n //\t\t\t}\n \t\t\tBufferedReader processOutput = new BufferedReader(new InputStreamReader(process.getInputStream()));\n \t\t\tString out_str;\n \t\t\twhile ((out_str = processOutput.readLine()) != null) {\n\t\t\t\tSystem.out.println(out_str);\n \t\t\t}\n \t\t\t\n \t\t\t// Tidy up\n \t\t\tprocessInput.close();\n //\t\t\tprocessOutput.close();\n \t\t\tprocess.waitFor();\n \t\t\treturn true;\n \t\t\t\n \t\t} catch (IOException e) {\n \t\t\te.printStackTrace();\n \t\t} catch (InterruptedException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t\t\n \t\treturn false;\t\t\n \t}", "public void AddToVG() throws Exception{\n\tString PVPath = null;\n\tBufferedReader addDrives = new BufferedReader(new FileReader(\"add\"));\n\tcommandExec c1 = new commandExec();\n\tPattern pattern = \n Pattern.compile(\"(\\\\/)(d)(e)(v)(\\\\/)(s)([a-z])([a-z])(\\\\*?)\");\n\twhile ((PVPath = addDrives.readLine())!= null){\n\t\tMatcher match = pattern.matcher(PVPath);\n\t\tif(match.find()){\n\t\t\tSystem.out.println(\"Adding \" + PVPath + \" to TargetVG volume group\");\n\t\t\tc1.runCommand(\"vgextend \" + VGName + \" \" + PVPath);\n\t\t}\n\t}\n}", "public static void main(String args[]) throws Exception {\n String fileName;\n fileName = scan.nextLine();\n\n OutputStream outStream = null;\n\n String info = readLogFile(fileName);\n\n String outFileName = \"gifs_\" + fileName;\n\n\n try{\n outStream = new FileOutputStream(new File(outFileName), true);\n outStream.write(info.getBytes(), 0, info.length());\n } catch(IOException ioEx) {\n ioEx.printStackTrace();\n } finally {\n try {\n outStream.close();\n } catch( IOException exception ){\n exception.printStackTrace();\n }\n }\n\n }", "public static void main(String[] args) throws IOException {\r\n\t\t\r\n\t\tSystem.out.println(parseInputFile());\r\n\t\t\r\n\t}", "protected final void parseV() {\n current = read();\n skipSpaces();\n\n for (;;) {\n switch (current) {\n case '+': case '-': case '.':\n case '0': case '1': case '2': case '3': case '4':\n case '5': case '6': case '7': case '8': case '9':\n float y = parseNumber();\n smoothQCenterX = currentX;\n smoothCCenterX = currentX;\n\n currentY = y;\n smoothQCenterY = y;\n smoothCCenterY = y;\n p.lineTo(smoothCCenterX, smoothCCenterY);\n break;\n default:\n return;\n }\n skipCommaSpaces();\n }\n }", "private void createGenotypes(File inFile)\r\n\t\tthrows Exception\r\n\t{\n\t\tBufferedReader in = new BufferedReader(new FileReader(inFile));\r\n\t\t// And write back out in Flapjack format\r\n\t\tBufferedWriter out = new BufferedWriter(new FileWriter(new File(wrkDir, \"geno\")));\r\n\t\tout.write(\"# fjFile = GENOTYPE\");\r\n\t\tout.newLine();\r\n\r\n\t\t// Skip the first two lines; we'll just assume marker order...\r\n\t\tin.readLine(); in.readLine();\r\n\t\t// ...and use the data we already have from the map\r\n\t\tfor (Marker m: markers)\r\n\t\t\tout.write(\"\\t\" + m.name);\r\n\t\tout.newLine();\r\n\r\n\r\n\t\t// Now process each line\r\n\t\tint index = 0;\r\n\t\tString str = null;\r\n\t\twhile ((str = in.readLine()) != null)\r\n\t\t{\r\n\t\t\tif (str.isEmpty())\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tif (index == 0)\r\n\t\t\t\tout.write(\"RP\");\r\n\t\t\telse if (index == 1)\r\n\t\t\t\tout.write(\"DP\");\r\n\t\t\telse\r\n\t\t\t\tout.write(\"RP[1]/DP-\" + index);\r\n\r\n\t\t\tfor (String allele: str.split(\",\"))\r\n\t\t\t\tout.write(\"\\t\" + allele);\r\n\r\n\t\t\tout.newLine();\r\n\t\t\tindex++;\r\n\t\t}\r\n\r\n\t\tin.close();\r\n\t\tout.close();\r\n\t}", "public void readFile()\r\n\t{\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tx = new Scanner(new File(\"clean vipr measles results.txt\"));\r\n\t\t\t\r\n\t\t\twhile (x.hasNext())\r\n\t\t\t{\r\n\t\t\t\tString a = x.next();\r\n\t\t\t\tString b = x.next();\r\n\t\t\t\tString c = x.next();\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.printf(\"%s %s %s \\n\\n\", a,b,c);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tx.close();\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"file not found\");\r\n\t\t}\r\n\t\r\n\t}", "protected CipherIV getCipherAndIVFromFile(String filename) throws IOException {\n byte[] cipher = super.readBytesFromFile(filename + CIPHER_PART);\n byte[] iv = super.readBytesFromFile(filename + IV_PART);\n return new CipherIV(cipher, iv);\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 }", "void visit(PetriNetFileName name);", "static TreeSet<Verb> parseVerbs(Scanner data, int conjugation){\n\t\tArrayList<String[]> raw = parseDataToArray(data);\n\t\tTreeSet<Verb> output = new TreeSet<Verb>();\n\n\t\tfor(String[] current : raw){ //iterate over each line from the original file.\n\n\t\t\tif(current.length != Values.VERB_DATA_ARRAY_LENGTH_CORRECT){\n\t\t\t\tSystem.err.println(\"Error parsing a line.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//System.out.println(\"Raw: \" + Arrays.toString(current));\n\n\t\t\t//current[] contains a split based on tabs. Generally {chapter, nom/gen/gender, definition}.\n\n\t\t\tint chapter = 0;\n\t\t\tString PP1 = null;\n\t\t\tString PP2 = null;\n\t\t\tString PP3 = null;\n\t\t\tString PP4 = null;\n\n\t\t\tString[] PPs = current[1].split(\", \");\n\t\t\tArrayList<String> definitions = new ArrayList<String>();\n\n\t\t\t//Values.betterStringArrayPrint(current);\n\n\t\t\ttry{ //try to read a noun, assuming that the chapter IS specified\n\t\t\t\tchapter = Integer.parseInt(current[0].trim());\n\t\t\t\tPP1 = PPs[0];\n\t\t\t\tPP2 = PPs[1];\n\t\t\t\tPP3 = PPs[2];\n\t\t\t\ttry{\n\t\t\t\t\tPP4 = PPs[3];\n\t\t\t\t} catch (ArrayIndexOutOfBoundsException e){\n\t\t\t\t\t//deponent verb.\n\t\t\t\t}\n\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\"));\n\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t} catch(Exception e){\n\t\t\t\tSystem.err.println(\"Could not read a line!\");\n\t\t\t\te.printStackTrace();\n\t\t\t\tcontinue; //We can't make a noun out of the botrked line.\n\t\t\t}\n\t\t\tVerb currentVerb = new Verb(PP1, PP2, PP3, PP4, conjugation, chapter, definitions);\n\n\t\t\tSystem.out.println(\"Added: \" + currentVerb);\n\t\t\toutput.add(currentVerb);\n\t\t}\n\n\t\treturn output;\n\t}", "public void generate() throws FileNotFoundException, UnsupportedEncodingException {\n\t\twriter = new PrintWriter(outputFile, \"UTF-8\");\n\t\tFile file = new File(inputFile);\n\t\treader = new Scanner(file);\n\t\tinitializeFile();\n\t\t\n\t\tString line = readLine();\n\t\twhile (line != null) {\n\t\t\tprocess(line);\n\t\t\tline = readLine();\n\t\t}\n\t\t\n\t\tfinishFile();\n\t\twriter.close();\n\t}", "protected final void parsev() {\n current = read();\n skipSpaces();\n\n for (;;) {\n switch (current) {\n case '+': case '-': case '.':\n case '0': case '1': case '2': case '3': case '4':\n case '5': case '6': case '7': case '8': case '9':\n float y = parseNumber();\n smoothQCenterX = currentX;\n smoothCCenterX = currentX;\n\n currentY += y;\n smoothQCenterY = currentY;\n smoothCCenterY = currentY;\n p.lineTo(smoothCCenterX, smoothCCenterY);\n break;\n default:\n return;\n }\n skipCommaSpaces();\n }\n }", "public void generate(File file) throws IOException;", "static void splitVcf(String inputFile, String outDir) throws Exception\n\t{\n\t\tint n = countInputs(inputFile);\t\n\t\tif(n == 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Make output directory for the split VCF files\n\t\tPath currentRelativePath = Paths.get(\"\");\n\t\toutDir = currentRelativePath.toAbsolutePath().toString() + \"/\" + outDir;\n\t\tFile f = new File(outDir);\n\t\tf.mkdir();\n\t\t\n\t\tString[] fns = new String[n];\n\t\tfor(int i = 0; i<n; i++) fns[i] = outDir + \"/\" + \"sample\" + (i+1) + \".vcf\";\n\t\t\n\t\tPrintWriter[] outs = new PrintWriter[n];\n\t\tfor(int i = 0; i<n; i++)\n\t\t{\n\t\t\touts[i] = new PrintWriter(new File(fns[i]));\n\t\t}\n\t\t\n\t\t// Write split VCF filenames to filelist.txt\n\t\tPrintWriter out = new PrintWriter(new File(outDir + \"/filelist.txt\"));\n\t\tfor(int i = 0; i<n; i++)\n\t\t{\n\t\t\tout.println(fns[i]);\n\t\t}\n\t\tout.close();\n\t\t\n\t\tScanner input = new Scanner(new FileInputStream(new File(inputFile)));\n\t\twhile(input.hasNext())\n\t\t{\n\t\t\tString line = input.nextLine();\n\t\t\tif(line.length() == 0)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(line.startsWith(\"#\"))\n\t\t\t{\n\t\t\t\tfor(int i = 0; i<n; i++)\n\t\t\t\t{\n\t\t\t\t\touts[i].println(line);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tVcfEntry entry = new VcfEntry(line);\n\t\t\t\tString suppVec = entry.getInfo(\"SUPP_VEC\");\n\t\t\t\tString method = entry.getInfo(\"SVMETHOD\");\n\t\t\t\tint supp = Integer.parseInt(entry.getInfo(\"SUPP\"));\n\t\t\t\t\n\t\t\t\t// Get the list of IDs - the way of doing that depends on the method used to merge them\n\t\t\t\tString[] idList = new String[supp];\n\t\t\t\tif(method.equals(\"JASMINE\"))\n\t\t\t\t{\n\t\t\t\t\tidList = entry.getInfo(\"IDLIST\").split(\",\");\n\t\t\t\t}\n\t\t\t\telse if(method.startsWith(\"SURVIVOR\"))\n\t\t\t\t{\n\t\t\t\t\tArrayList<String> ids = new ArrayList<String>();\n\t\t\t\t\tfor(int i = 9; i<entry.tabTokens.length; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tString val = entry.tabTokens[i].split(\":\")[7];\n\t\t\t\t\t\tif(!val.equalsIgnoreCase(\"nan\")) ids.add(val);\n\t\t\t\t\t}\n\t\t\t\t\tfor(int i = 0; i<ids.size(); i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tidList[i] = ids.get(i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tint idIdx = 0;\n\t\t\t\tfor(int i = 0; i<n; i++)\n\t\t\t\t{\n\t\t\t\t\tboolean inSample = suppVec.charAt(i) == '1';\n\t\t\t\t\tif(inSample)\n\t\t\t\t\t{\n\t\t\t\t\t\tVcfEntry newEntry = new VcfEntry(entry.originalLine);\n\t\t\t\t\t\t\n\t\t\t\t\t\tnewEntry.setId(idList[idIdx]);\n\t\t\t\t\t\t\n\t\t\t\t\t\tlong oldStart = newEntry.getPos();\n\t\t\t\t\t\t\n\t\t\t\t\t\tint curNoise = Math.min(AVERAGE_POS_ERROR, (int)(Math.abs(newEntry.getLength()) * 0.25));\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add some noise to different parts of it\n\t\t\t\t\t\tint dPos = randomDelta(curNoise);\n\t\t\t\t\t\tint dLen = randomDelta(curNoise);\n\t\t\t\t\t\t\n\t\t\t\t\t\tlong newStart = oldStart + dPos;\n\t\t\t\t\t\tint newLen = newEntry.getLength() + dLen;\n\t\t\t\t\t\tlong newEnd = newStart + newLen;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Set start\n\t\t\t\t\t\tnewEntry.setPos(newEntry.getPos() + dPos);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Set SVLEN INFO field\n\t\t\t\t\t\tif(newEntry.hasInfoField(\"SVLEN\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewEntry.setInfo(\"SVLEN\", newLen + \"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tString type = newEntry.getType();\n\t\t\t\t\t\tint refLength = newEntry.getRef().length();\n\t\t\t\t\t\tint altLength = newEntry.getAlt().length();\n\t\t\t\t\t\tif(!newEntry.getAlt().contains(\"<\") && !newEntry.getRef().contains(\"N\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(refLength > altLength)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype = \"DEL\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(refLength < altLength)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype = \"INS\";\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\t// Set END INFO field\n\t\t\t\t\t\tif(newEntry.hasInfoField(\"END\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(type.equals(\"INS\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewEntry.setInfo(\"END\", newStart + \"\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewEntry.setInfo(\"END\", newEnd + \"\");\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\t// Set REF and ALT fields depending on SV type\n\t\t\t\t\t\tif(!newEntry.getAlt().contains(\"<\") && !newEntry.getRef().contains(\"N\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(type.equals(\"INS\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(entry.getLength() < 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tSystem.out.println(entry);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tentry.setAlt(adjustStringLength(entry.getAlt(), newLen + 1));\n\t\t\t\t\t\t\t\tif(entry.hasInfoField(\"SEQ\"))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tentry.setInfo(\"SEQ\", entry.getAlt().substring(1));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(type.equals(\"DEL\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tentry.setRef(adjustStringLength(entry.getRef(), Math.abs(newLen) + 1));\n\t\t\t\t\t\t\t\tif(entry.hasInfoField(\"SEQ\"))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tentry.setInfo(\"SEQ\", entry.getRef().substring(1));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(type.equals(\"DEL/INV\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tentry.setRef(adjustStringLength(entry.getRef(), Math.abs(newLen) + 1));\n\t\t\t\t\t\t\t\tif(entry.hasInfoField(\"SEQ\"))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tentry.setInfo(\"SEQ\", entry.getRef().substring(1));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tSystem.out.println(type);\n\t\t\t\t\t\t\t\tSystem.out.println(entry.getRef()+\" \"+entry.getAlt());\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\touts[i].println(newEntry);\n\t\t\t\t\t\tidIdx++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0; i<n; i++)\n\t\t{\n\t\t\touts[i].close();\n\t\t}\n\t\tinput.close();\n\t}", "public static void parseScript(String inFile) {\r\n\t\tScanner in;\r\n\t\t\r\n\t\t// Create the resize visitor\r\n\t\tResizeVisitor rsv = new ResizeVisitor();\r\n\t\t// Set the text tree display (with decorators) as an observer to the resize visitor\r\n\t\trsv.attach(ttd);\r\n\t\t\r\n\t\t/*\r\n\t\t * Other visitor objects should also be created here instead of in the switch statement\r\n\t\t * I would have fixed this if I had more time\r\n\t\t * The program works the way it is now, but fixing this would have been better design\r\n\t\t */\r\n\t\t\r\n\t\ttry {\r\n\t\t\t// Create scanner to read the script file\r\n\t\t\tin = new Scanner(new File(inFile));\r\n\t\t\tFileComponentBuilder fb;\r\n\t\t\t\r\n\t\t\tString line;\r\n\t\t\tString[] command;\r\n\t\t\twhile (in.hasNextLine()) {\r\n\t\t\t\tline = in.nextLine();\r\n\t\t\t\t\r\n\t\t\t\t// Print command to output file for clarity\r\n\t\t\t\tout.print('\\n' + fs.getCurrentDir().getName() + \"> \");\r\n\t\t\t\tout.println(line);\r\n\t\t\t\t\r\n\t\t\t\t// Read line from script and parse it\r\n\t\t\t\tcommand = line.split(\"\\\\s\");\r\n\t\t\t\t\r\n\t\t\t\t// All script commands must be accounted for in this switch statement\r\n\t\t\t\tswitch(command[0]) {\r\n\t\t\t\tcase \"mkdir\":\r\n\t\t\t\t\t// Uses builder pattern to create directory and proxy while hiding creation process\r\n\t\t\t\t\tfb = new DirectoryBuilder();\r\n\t\t\t\t\tfb.setParameters(fs, command);\r\n\t\t\t\t\tfs.getCurrentDir().add(fb.getFileComponent());\r\n\t\t\t\t\tout.println(\"Subdirectory \\\"\" + command[1] + \"\\\" created\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"create\":\r\n\t\t\t\t\t// Uses builder pattern to create file and proxy while hiding creation process\r\n\t\t\t\t\tfb = new FileBuilder();\r\n\t\t\t\t\tfb.setParameters(fs, command);\r\n\t\t\t\t\tfs.getCurrentDir().add(fb.getFileComponent());\r\n\t\t\t\t\tout.println(\"File \\\"\" + command[1] + \"\\\" created\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"cd\":\r\n\t\t\t\t\tif (command[1].contentEquals(\"..\")) {\r\n\t\t\t\t\t\t// cd ..\r\n\t\t\t\t\t\t// If at root (or in error situation where parent directory is null)\r\n\t\t\t\t\t\t// current directory will be set to the root\r\n\t\t\t\t\t\tfs.setDir(fs.getCurrentDir().getParent());\r\n\t\t\t\t\t\tif (fs.getCurrentDir() == null) {\r\n\t\t\t\t\t\t\tfs.setDir(fs.getRoot());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tout.println(\"Directory changed to \" + fs.getCurrentDir().getName());\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t// cd subdirectory\r\n\t\t\t\t\t\tFileComponent newDir = fs.getCurrentDir().getChild(command[1]);\r\n\t\t\t\t\t\tif (newDir == null || newDir instanceof LeafFile) {\r\n\t\t\t\t\t\t\tout.println(command[1] + \" is not a valid directory\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tfs.setDir(newDir);\r\n\t\t\t\t\t\t\tout.println(\"Directory changed to \" + command[1]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"del\":\r\n\t\t\t\t\tFileComponent delFile = fs.getCurrentDir().getChild(command[1]);\r\n\t\t\t\t\tif (delFile == null) {\r\n\t\t\t\t\t\tout.println(command[1] + \" is not a valid file or directory\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tdelFile.accept(new DeleteVisitor());\r\n\t\t\t\t\t\tout.println(command[1] + \" deleted\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"size\":\r\n\t\t\t\t\tFileComponent sizeFile = fs.getCurrentDir().getChild(command[1]);\r\n\t\t\t\t\tif (sizeFile == null) {\r\n\t\t\t\t\t\tout.println(command[1] + \" is not a valid file or directory\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSizeVisitor sv = new SizeVisitor();\r\n\t\t\t\t\t\tsizeFile.accept(sv);\r\n\t\t\t\t\t\tout.println(sv.getTotalSize());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"ls\":\r\n\t\t\t\t\tFileComponent lsFile = fs.getCurrentDir();\r\n\t\t\t\t\tif (command.length > 1) {\r\n\t\t\t\t\t\tlsFile = fs.getCurrentDir().getChild(command[1]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (lsFile == null) {\r\n\t\t\t\t\t\tout.println(command[1] + \" is not a valid file or directory\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tLSVisitor lv = new LSVisitor();\r\n\t\t\t\t\t\tlsFile.accept(lv);\r\n\t\t\t\t\t\tfor (int i = 0; i < lv.getOutput().size(); i++) {\r\n\t\t\t\t\t\t\tif (lv.getOutput().get(i).length > 1) {\r\n\t\t\t\t\t\t\t\tout.println(lv.getOutput().get(i)[0] + \" \" + lv.getOutput().get(i)[1]);\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\tout.println(lv.getOutput().get(i)[0]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"resize\":\r\n\t\t\t\t\tFileComponent ResizeFile = fs.getCurrentDir().getChild(command[1]);\r\n\t\t\t\t\tif (ResizeFile == null) {\r\n\t\t\t\t\t\tout.println(command[1] + \" is not a valid file\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\trsv.setNewSize(Integer.parseInt(command[2]));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tResizeFile.accept(rsv);\r\n\t\t\t\t\t\tif (rsv.resizeSuccessful()) {\r\n\t\t\t\t\t\t\tout.println(\"Size of \" + command[1] + \" set to \" + command[2]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tout.println(command[1] + \" is not a valid file\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"exit\":\r\n\t\t\t\t\tfs.getRoot().accept(new ExitVisitor());\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault: out.println(command[0] + \" is not a valid command\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tin.close();\r\n\t\t\tSystem.out.println(\"Script read successfully\");\r\n\t\t}\r\n\t\tcatch (IOException e) {\r\n\t\t\tSystem.err.println(\"Error: could not read from script file\");\r\n\t\t}\r\n\t}", "public void Parse()\n {\n String prepend = \"urn:cerner:mid:core.personnel:c232:\";\n try{\n\n BufferedReader br = new BufferedReader(new FileReader(new File(path)));\n\n String line;\n\n while ((line = br.readLine()) != null)\n {\n line = line.trim();\n String[] lines = line.split(\",\");\n for (String entry : lines)\n {\n entry = entry.trim();\n entry = entry.replace(prepend, replace);\n System.out.println(entry+\",\");\n }\n\n }\n \n br.close();\n }catch(IOException IO)\n {\n System.out.println(IO.getStackTrace());\n } \n \n }", "public EnigmaFile() throws Exception\n {\n\n String path = Main.class.getClassLoader().getResource(\"filein.txt\").getPath();\n File currentDirectory=new File(path);\n finstream = new FileInputStream(currentDirectory);\n\n\n String pathToWrite = path.replaceFirst(\"filein.txt\",\"fileout.txt\");\n File outputFile = new File(pathToWrite);\n br = new BufferedReader(new InputStreamReader(finstream));\n outputFile.createNewFile();\n FileWriter fileWrite = new FileWriter(outputFile.getAbsoluteFile());\n writer = new BufferedWriter(fileWrite);\n\n\n }", "private static String readParseOutput(String fileName, int mode) throws IOException {\n\t\tStringBuffer stringBuffer = new StringBuffer();\n\t\tStringBuffer errorBuffer = new StringBuffer();\n\t\tFileReader fileReader = new FileReader(fileName);\n\t\tBufferedReader bufferedReader = new BufferedReader(fileReader);\n\t\tScanner fileScanner = new Scanner(bufferedReader);\n\t\tint fileStage = 0;\n\n\t\twhile (fileScanner.hasNextLine()) {\n\t\t\tString s = fileScanner.nextLine();\n\n\t\t\tif (s.equals(\"** Basic block: 0 **\")) {\n\t\t\t\tfileStage = 0;\n\t\t\t}\n\t\t\t// Beginning of Live Range info\n\t\t\telse if (s.startsWith(\"<<---- Live Ranges ---->>\")) {\n\t\t\t\tfileStage = 1;\n\t\t\t}\n\t\t\t// uninitialized variable warning\n\t\t\telse if (s.startsWith(\"WARNING: possible uninitialized local variable index\")) {\n\t\t\t\tfileStage = 2;\n\t\t\t}\n\t\t\telse if (s.startsWith(\"<<---- Optimized code ---->>\")) {\n\t\t\t\tfileStage = 3;\n\t\t\t}\n\n\t\t\t// store instruction, ignoring instruction number\n\t\t\tif (fileStage == 0) {\t\t// CFG, only look at pred/succ info\n\t\t\t\tif (mode == 0 && s.contains(\"Successors\")) {\n\t\t\t\t\tstringBuffer.append(s + \"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (fileStage == 1) {\t\t// Live range, ignore instruction\n\t\t\t\tif (mode > 0) {\n\t\t\t\t\tint idx = s.indexOf(\":\");\n\t\t\t\t\tif (idx > 3)\n\t\t\t\t\t\tstringBuffer.append(s.substring(0, idx-3));\n\t\t\t\t\telse\n\t\t\t\t\t\tstringBuffer.append(s);\n\t\t\t\t\tstringBuffer.append(\"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (fileStage == 2) {\t\t// Look at all warnings\n\t\t\t\tif (mode == 2 && s.contains(\"uninitialized\")) {\n\t\t\t\t\tstringBuffer.append(s + \"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (fileStage == 3) {\t\t\t// Opt code, ignore instruction #\n\t\t\t\tif (mode == 3) {\n\t\t\t\t\tint idx = s.indexOf(\":\");\n\t\t\t\t\tstringBuffer.append(s.substring(idx+1));\n\t\t\t\t\tstringBuffer.append(\"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfileScanner.close();\n\t\tString result;\n\t\tresult = stringBuffer.toString() + \"\\n\";\n\t\treturn result;\n\t}", "static TreeSet<Adjective> parseAdjective3(Scanner data){\n\t\tArrayList<String[]> raw = parseDataToArray(data);\n\t\tTreeSet<Adjective> output = new TreeSet<Adjective>();\n\n\t\tfor(String[] current : raw){ //iterate over each line from the original file.\n\n\t\t\tif(current.length != Values.ADJECTIVE_DATA_ARRAY_LENGTH_CORRECT){\n\t\t\t\tSystem.err.println(\"Error parsing a line.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//System.out.println(\"Raw: \" + Arrays.toString(current));\n\n\t\t\t//current[] contains a split based on tabs. Generally {chapter, nom/gen/gender, definition}.\n\n\t\t\tint chapter = 0;\n\t\t\tArrayList<String> definitions = new ArrayList<String>();\n\t\t\tAdjective currentAdjective = null;\n\n\t\t\t//Values.betterStringArrayPrint(current);\n\n\t\t\ttry{ //try to read a noun, assuming that the chapter IS specified\n\t\t\t\t\n\t\t\t\tchapter = Integer.parseInt(current[0].trim());\n\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t\ttrimAll(definitions);\n\t\t\t\t\n\t\t\t\tif(current[1].split(\", \").length == 1){\n\t\t\t\t\tcurrentAdjective = new OneTerminationAdjective(current[1].split(\", \")[0].split(\":\")[0], current[1].split(\", \")[0].split(\":\")[1], chapter, definitions);\n\t\t\t\t} else if(current[1].split(\", \").length == 2){\n\t\t\t\t\tString mascFem = current[1].split(\", \")[0];\n\t\t\t\t\tString neuter = current[1].split(\", \")[1];\n\t\t\t\t\tcurrentAdjective = new TwoTerminationAdjective(mascFem, neuter, chapter, definitions);\n\t\t\t\t} else if(current[1].split(\", \").length == 3){\n\t\t\t\t\tString masculine = current[1].split(\", \")[0];\n\t\t\t\t\tString feminine = current[1].split(\", \")[1];\n\t\t\t\t\tString neuter = current[1].split(\", \")[2];\n\t\t\t\t\tcurrentAdjective = new ThreeTerminationAdjective(masculine, feminine, neuter, chapter, definitions);\n\t\t\t\t}\n\n\t\t\t} catch(Exception e){\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.err.println(\"Could not read a line!\");\n\t\t\t\tcontinue; //We can't make a noun out of the botrked line.\n\t\t\t}\n\t\t\t//Adjective currentAdjective = new Adjective(masculine, feminine, neuter, chapter, declension, definitions);\n\t\t\tSystem.out.println(\"Added: \" + currentAdjective);\n\t\t\toutput.add(currentAdjective);\n\t\t}\n\n\t\treturn output;\n\t}", "public void writeToXML(){\n\t\t\n\t\t String s1 = \"\";\n\t\t String s2 = \"\";\n\t\t String s3 = \"\";\n\t\t Element lastElement= null;\n\t\t\n\t\tDocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();\n\t\tDocumentBuilder dbElement;\n\t\tBufferedReader brRead=null;\n\n\t\ttry{\n\t\t\tdbElement = dbfactory.newDocumentBuilder();\n\t\t\t\n\t\t\t//Create the root\n\t\t\tDocument docRoot = dbElement.newDocument();\n\t\t\tElement rootElement = docRoot.createElement(\"ROYAL\");\n\t\t\tdocRoot.appendChild(rootElement);\n\t\t\t\n\t\t\t//Create elements\n\t\t\t\n\t\t\t//Element fam = docRoot.createElement(\"FAM\");\n\t\t\tElement e= null;\n\t\t\tbrRead = new BufferedReader(new FileReader(\"complet.ged\"));\n\t\t\tString line=\"\";\n\t\t\twhile((line = brRead.readLine()) != null){\n\t\t\t\tString lineTrim = line.trim();\n\t\t\t\tString str[] = lineTrim.split(\" \");\n\t\t\t\t//System.out.println(\"length = \"+str.length);\n\n\t\t\t\tif(str.length == 2){\n\t\t\t\t\ts1 = str[0];\n\t\t\t\t\ts2 = str[1];\n\t\t\t\t\ts3 = \"\";\n\t\t\t\t}else if(str.length ==3){\n\t\t\t\t\ts1 = str[0];\n\t\t\t\t\ts2=\"\";\n\n\t\t\t\t\ts2 = str[1];\n//\t\t\t\t\tSystem.out.println(\"s2=\"+s2);\n\t\t\t\t\ts3=\"\";\n\t\t\t\t\ts3 = str[2];\n//\t\t\t\t\ts3 = s[0];\n\t\t\t\t\t\n\t\t\t\t}else if(str.length >3){\n\t\t\t\t\ts1 = str[0];\n\t\t\t\t\ts2 = str[1];\n\t\t\t\t\ts3=\"\";\n\t\t\t\t\tfor(int i =2; i<str.length; i++){\n\t\t\t\t\t\ts3 = s3 + str[i]+ \" \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//System.out.println(s1+\"!\"+s2+\"!\"+s3+\"!\");\n\t\t\t\t//Write to file xml\n\t\t\t\t//writeToXML(s1, s2, s3);\n\t\t\t//Element indi = docRoot.createElement(\"INDI\");\t\n\t\t\t//System.out.println(\"Check0 :\" + s1);\n\t\t\tif( Integer.parseInt(s1)==0){\n\t\t\t\t\n\t\t\t\t//System.out.println(\"Check1\");\n\t\t\t\tif(s3.equalsIgnoreCase(\"INDI\")){\n\t\t\t\t\t//System.out.println(\"Check2\");\n\t\t\t\t\tSystem.out.println(\"This is a famille Individual!\");\n\t\t\t\t\te = docRoot.createElement(\"INDI\");\n\t\t\t\t\trootElement.appendChild(e);\n\t\t\t\t\t\n\t\t\t\t\t//Set attribute to INDI\n\t\t\t\t\tAttr indiAttr = docRoot.createAttribute(\"id\");\n\t\t\t\t\ts2 = s2.substring(1, s2.length()-1);\n\t\t\t\t\tindiAttr.setValue(s2);\n\t\t\t\t\te.setAttributeNode(indiAttr);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t\t\n\t\t\t\t}if(s3.equalsIgnoreCase(\"FAM\")){\n\t\t\t\t\t//System.out.println(\"Check3\");\n\t\t\t\t\tSystem.out.println(\"This is a famille!\");\n\t\t\t\t\te = docRoot.createElement(\"FAM\");\n\t\t\t\t\trootElement.appendChild(e);\n\t\t\t\t\t//Set attribute to FAM\n\t\t\t\t\tAttr famAttr = docRoot.createAttribute(\"id\");\n\t\t\t\t\ts2 = s2.substring(1, s2.length()-1);\n\t\t\t\t\tfamAttr.setValue(s2);\n\t\t\t\t\te.setAttributeNode(famAttr);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t}if(s2.equalsIgnoreCase(\"HEAD\")){\n\t\t\t\t\tSystem.out.println(\"This is a head!\");\n\t\t\t\t\te = docRoot.createElement(\"HEAD\");\n\t\t\t\t\trootElement.appendChild(e);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t\t\n\t\t\t\t}if(s3.equalsIgnoreCase(\"SUBM\")){\n\n\t\t\t\t\tSystem.out.println(\"This is a subm!\");\n\t\t\t\t\te = docRoot.createElement(\"SUBM\");\n\t\t\t\t\trootElement.appendChild(e);\n\t\t\t\t\t//Set attribute to FAM\n\t\t\t\t\tAttr famAttr = docRoot.createAttribute(\"id\");\n\t\t\t\t\ts2 = s2.substring(1, s2.length()-1);\n\t\t\t\t\tfamAttr.setValue(s2);\n\t\t\t\t\te.setAttributeNode(famAttr);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(Integer.parseInt(s1)==1){\n\n\t\t\t\tString child = s2;\n\t\t\t\tif(child.equalsIgnoreCase(\"SOUR\")||child.equalsIgnoreCase(\"DEST\")||child.equalsIgnoreCase(\"DATE\")\n\t\t\t\t\t\t||child.equalsIgnoreCase(\"FILE\")||child.equalsIgnoreCase(\"CHAR\")\n\t\t\t\t\t\t||child.equalsIgnoreCase(\"NAME\")||child.equalsIgnoreCase(\"TITL\")||child.equalsIgnoreCase(\"SEX\")||child.equalsIgnoreCase(\"REFN\")\n\t\t\t\t\t\t||child.equalsIgnoreCase(\"PHON\")||child.equalsIgnoreCase(\"DIV\")){\n\t\t\t\t\tString name = lastElement.getNodeName();\n\t\t\t\t\tif(name.equalsIgnoreCase(\"INDI\")||name.equalsIgnoreCase(\"HEAD\")||name.equalsIgnoreCase(\"FAM\")||name.equalsIgnoreCase(\"SUBM\")){\t\n\t\t\t\t\t\te= docRoot.createElement(child);\n\t\t\t\t\t\te.setTextContent(s3);\n\t\t\t\t\t\t\n\t\t\t\t\t\tlastElement.appendChild(e);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tNode p = e.getParentNode();\n\t\t\t\t\t\t\tElement x= docRoot.createElement(child);\n\t\t\t\t\t\t\tx.setTextContent(s3);\n\t\t\t\t\t\t\tp.appendChild(x);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(child.equalsIgnoreCase(\"BIRT\")||child.equalsIgnoreCase(\"DEAT\")||child.equalsIgnoreCase(\"COMM\")\n\t\t\t\t\t\t||child.equalsIgnoreCase(\"BURI\")||child.equalsIgnoreCase(\"ADDR\")||child.equalsIgnoreCase(\"CHR\")){\n\t\t\t\t\t\n\t\t\t\t\tString name = lastElement.getNodeName();\t\n\t\t\t\t\tif(name.equalsIgnoreCase(\"INDI\")||name.equalsIgnoreCase(\"FAM\")||name.equalsIgnoreCase(\"SUBM\")){\t\n\t\t\t\t\te= docRoot.createElement(child);\n\t\t\t\t\te.setTextContent(s3);\n\t\t\t\t\t\n\t\t\t\t\tlastElement.appendChild(e);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tNode p = e.getParentNode();\n\t\t\t\t\t\tElement x= docRoot.createElement(child);\n\t\t\t\t\t\tx.setTextContent(s3);\n\t\t\t\t\t\tp.appendChild(x);\n\t\t\t\t\t\tlastElement = x;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(child.equalsIgnoreCase(\"FAMS\")||child.equalsIgnoreCase(\"FAMC\")){\n\t\t\t\t\tString name = lastElement.getNodeName();\n\t\t\t\t\tif(name.equalsIgnoreCase(\"INDI\")||name.equalsIgnoreCase(\"FAM\")){\t\n\t\t\t\t\t\te= docRoot.createElement(child);\n\t\t\t\t\t\ts3 = s3.substring(1, s3.length()-1);\n\t\t\t\t\t\te.setAttribute(\"id\",s3);\n\t\t\t\t\t\tlastElement.appendChild(e);\n\t\t\t\t\t\tlastElement = e;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tNode p = e.getParentNode();\n\t\t\t\t\t\t\tElement x= docRoot.createElement(child);\n\t\t\t\t\t\t\ts3 = s3.substring(1, s3.length()-1);\n\t\t\t\t\t\t\tx.setAttribute(\"id\",s3);\n\t\t\t\t\t\t\tp.appendChild(x);\n\t\t\t\t\t\t\tlastElement = x;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(child.equalsIgnoreCase(\"HUSB\")||child.equalsIgnoreCase(\"WIFE\")||child.equalsIgnoreCase(\"CHIL\")){\n\t\t\t\t\te= docRoot.createElement(child);\n\t\t\t\t\ts3 = s3.substring(1, s3.length()-1);\n\t\t\t\t\te.setAttribute(\"id\",s3);\n\t\t\t\t\tlastElement.appendChild(e);\n\t\t\t\t}\n\t\t\t\tif(child.equalsIgnoreCase(\"MARR\")){\n\t\t\t\t\te= docRoot.createElement(child);\n\t\t\t\t\tlastElement.appendChild(e);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(Integer.parseInt(s1)==2){\n\t\t\t\tString lastName = lastElement.getNodeName();\n\t\t\t\tif((lastName.equalsIgnoreCase(\"BIRT\"))||(lastName.equalsIgnoreCase(\"DEAT\"))||(lastName.equalsIgnoreCase(\"BURI\"))\n\t\t\t\t\t\t||(lastName.equalsIgnoreCase(\"MARR\"))||(lastName.equalsIgnoreCase(\"CHR\"))){\n\t\t\t\t\t//Add child nodes to birt, deat or marr\n\t\t\t\t\tif(s2.equalsIgnoreCase(\"DATE\")){\n\t\t\t\t\t\tElement date = docRoot.createElement(\"DATE\");\n\t\t\t\t\t\tdate.setTextContent(s3);\n\t\t\t\t\t\tlastElement.appendChild(date);\n\t\t\t\t\t}\n\t\t\t\t\tif(s2.equalsIgnoreCase(\"PLAC\")){\n\t\t\t\t\t\tElement plac = docRoot.createElement(\"PLAC\");\n\t\t\t\t\t\tplac.setTextContent(s3);\n\t\t\t\t\t\tlastElement.appendChild(plac);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif(lastName.equalsIgnoreCase(\"COMM\")||lastName.equalsIgnoreCase(\"ADDR\")){\n\t\t\t\t\tif(s2.equalsIgnoreCase(\"CONT\")){\n\t\t\t\t\t\tElement plac = docRoot.createElement(\"CONT\");\n\t\t\t\t\t\tplac.setTextContent(s3);\n\t\t\t\t\t\tlastElement.appendChild(plac);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//lastElement = e;\n\t\t\t}\n\n\t\t\t\n\t\t\t\n\t\t\t//Saved this element for the next step\n\t\t\t\n\t\t\t//Write to file\n\t\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance();\n\t\t\tTransformer transformer = transformerFactory.newTransformer();\n\t\t\ttransformer.setOutputProperty(OutputKeys.ENCODING, \"iso-8859-1\");\n\t\t\ttransformer.setOutputProperty(OutputKeys.INDENT, \"yes\");\n\t\t\ttransformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, \"Royal.dtd\");\n\t\t\tDOMSource source = new DOMSource(docRoot);\n\t\t\tStreamResult result = new StreamResult(new File(\"complet.xml\"));\n\t \n\t\t\t// Output to console for testing\n\t\t\t// StreamResult result = new StreamResult(System.out);\t \n\t\t\ttransformer.transform(source, result);\n\t \n\t\t\tSystem.out.println(\"\\nXML DOM Created Successfully.\");\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public void parseFile(String fileName) {\n Matrix m = new Matrix(); \n imp.doPaint(m);\n System.out.println(fileName + \", format is PNG.\");\n }", "ReleaseFile parse( InputStream is ) throws IOException;", "private void processNewFile(String filename) throws IOException {\n \n /*read posture information from file*/\n Posture posture = new Posture(filename);\n /* keep the predictions made by each activity HMM to later choose the best one*/\n Map<Activity, Prediction> predictions = new EnumMap<Activity, Prediction>(Activity.class);\n Prediction prediction;\n Map.Entry<Activity, Prediction> bestPrediction;\n String predictedActivity;\n int preds[], predictedActivityIndex;\n int frameNumber = FileNameComparator.getFileNumber(filename);\n \n for (Activity activity : Activity.values()) {\n /* make a prediction using an activity's HMM*/\n prediction = predictActivity(activity, posture, filename);\n predictions.put(activity, prediction);\n }\n \n /* select the best prediction */\n bestPrediction = chooseBestPrediction(predictions);\n \n preds = bestPrediction.getValue().getPredictions();\n \n /* check to see if no activity has been detected */\n if (preds[preds.length - 1] == 1) {\n predictedActivity = bestPrediction.getKey().getName();\n predictedActivityIndex = bestPrediction.getKey().getIndex();\n } else {\n predictedActivity = \"no activity\";\n predictedActivityIndex = 0;\n }\n \n \n System.out.println(\"Activity from frame \" + frameNumber + \": \" + predictedActivity);\n \n /* log activity prediction to file */\n appendActivityToFile(frameNumber, predictedActivityIndex, bestPrediction.getValue().getProbability());\n \n \n }", "GmMacro createGmMacro(File file) throws IOException, SAXException, ParserConfigurationException;", "public interface FileNameVisitor extends NameVisitor {\n /**\n *\n * Visit the Petri net file name\n *\n * @param name to be visited \n */\n void visit(PetriNetFileName name);\n}", "public void parseVCF(String vcfFilePath) throws IOException {\n\t\tthis.filePath = vcfFilePath;\n\n\t\ttry {\n\t\t\t// Parse base VCF file with full data about events\n\t\t\tBufferedReader vcfBuffReader;\n\t\t\tvcfBuffReader = new BufferedReader(new FileReader(this.filePath));\n\n\t\t\tmainVcfParser = new VcfParser(vcfBuffReader);\n\t\t\tmainVcfParser.parse();\n\n\t\t} catch (IOException e) {\n\t\t\tthrow new IOException(e);\n\t\t}\n\t}", "public String VerticalOp(String name) {\n String line;\n try {\n BufferedReader br = new BufferedReader(new FileReader(file1));\n BufferedReader br2 = new BufferedReader(new FileReader(file2));\n BufferedWriter bw = new BufferedWriter(new FileWriter(name));\n\n do{\n line = br.readLine();\n bw.write(line);\n }while(line != null);\n\n do{\n line = br2.readLine();\n bw.write(line);\n }while(line != null);\n bw.flush();\n }\n catch(FileNotFoundException e) {\n System.out.println(\"ERROR: File does not exist. Please input a valid input file.\");\n }\n catch(IOException e) {\n System.out.println(\"ERROR: Failure while reading from file.\");\n }\n ++mProcCount;\n return name;\n }", "private static GiaoVu readGiaoVu(String line) {\n\t String[] s = line.split(\",\");\n GiaoVu gv = new GiaoVu(s[1], s[2], s[3], s[4], s[5]);\n return gv;\n }", "public void readFile(File file) {\n\ttry (BufferedReader br = new BufferedReader(new FileReader(file)))\n\t{\n\n\t\tString sCurrentLine;\n\t\tString [] lineElements;\n\t\t\n\t\t// read the headlines\n\t\tsCurrentLine = br.readLine();\n\t\tlineElements = sCurrentLine.split(\"\\\\s+\");\n\t\tnumVertices = Integer.parseInt(lineElements[1]);\n\t\tsCurrentLine = br.readLine();\n\t\tlineElements = sCurrentLine.split(\"\\\\s+\");\n\t\tnumPaths = Integer.parseInt(lineElements[1]);\n\t\tsCurrentLine = br.readLine();\n\t\tlineElements = sCurrentLine.split(\"\\\\s+\");\n\t\ttmax = Double.parseDouble(lineElements[1]);\n\t\t\n//\t\tSystem.out.println(numVertices + \", \" + numPaths + \", \" + tmax);\n\n\t\t/* read benefits1 */\n\t\tint index = 0;\n\t\twhile ((sCurrentLine = br.readLine()) != null) {\n//\t\t\t\tSystem.out.println(sCurrentLine);\n\t\t\tlineElements = sCurrentLine.split(\"\\\\s+\");\n\t\t\tdouble x = Double.parseDouble(lineElements[0]);\n\t\t\tdouble y = Double.parseDouble(lineElements[1]);\n\t\t\tList<Double> scores = new ArrayList<Double>();\n\t\t\tfor (int i = 2; i < lineElements.length; i++) {\n\t\t\t\tdouble score = Double.parseDouble(lineElements[i]);\n\t\t\t\tscores.add(new Double(score));\n\t\t\t}\n\t\t\tPOI POI = new POI(index, x, y, scores);\n\t\t\t//POI.printMe();\n\t\t\t\n\t\t\tvertices.add(POI);\n\t\t\tindex ++;\n\t\t}\n\t\t\n\t\t// create the arcs and the graph\n\t\tfor (int i = 0; i < vertices.size(); i++) {\n\t\t\tfor (int j = 0; j < vertices.size(); j++) {\n\t\t\t\tArc arc = new Arc(vertices.get(i), vertices.get(j));\n\t\t\t\tarcs.add(arc);\n\t\t\t\tgraph.put(new Tuple2<POI, POI>(vertices.get(i), vertices.get(j)), arc);\n\t\t\t}\n\t\t}\n\t} catch (IOException e) {\n\t\te.printStackTrace();\n\t}\n}", "public void selectAndConvert() {\n // Used to select multiple files\n DirectoryResource dr = new DirectoryResource();\n // For each file in the selected files\n for (File f : dr.selectedFiles()) {\n ImageResource inputImg = new ImageResource(f);\n // Converting image in the input file to gray image\n ImageResource outputImg = makeInversion(inputImg);\n // Used to get the name of the file selected\n String inputImgFileName = inputImg.getFileName();\n String outputImgFileName = \"inverted-\" + inputImgFileName;\n // Creating file name to the outputImg with the help of absolute path of the inputImgFileName\n outputImg.setFileName(\"src/java_assignments/coursera1/image_inversion/\"+outputImgFileName);\n outputImg.draw();\n outputImg.save();\n }\n }", "@Override\n\tpublic void accept(Visitor visitor) throws FileNotFoundException, IOException {\n\n\t\tfor (Element e : sentenceArrayLst) {\n\n\t\t\t((Element) e).accept(visitor);\n\t\t}\n\n\t}", "@Test\n\tpublic void testInlinerWithFile() throws Exception {\n\t\tString input = new String(Files.readAllBytes(new File(\"../warre.txt\").toPath()));\n\t\tInliner inliner = new Inliner();\n\t\tList<Part> parts = new Tokenizer(inliner).split(input);\n\t\tList<HTreeNode> freq = new FrequencyAnalyzer().analyzeFrequency(parts);\n\t\tString result = inliner.encode(parts, freq, 'X');\n\n\t\tSystem.out.println(\"\\nInput size : \" + input.length());\n\t\tSystem.out.println(\"Output size : \" + result.length());\n\t\tSystem.out.println(\"Num tokens : \" + freq.stream().filter(a -> a.prevalence > 1).count());\n\n//\t\tSystem.out.println(input);\n\t\tSystem.out.println(result);\n//\t\tSystem.out.println(inliner.decode(result, 'X'));\n\t}", "private void doConvert(String path) throws IOException {\n\n MediaMetadataRetriever retriever = new MediaMetadataRetriever();\n retriever.setDataSource(path);\n String rotation = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION);\n// Log.d(\"Metadata\", \"doConvert: \" + rotation);\n\n //extract frames\n extractFrames(path, rotation);\n\n //extract faces in each frames\n extractFaces();\n\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Utils.hideLoadingIndicator();\n }\n });\n }", "protected void parse() throws ParseException {\n String s;\n try {\n s=getFullText();\n } catch (IOException ioe) {\n if (ioe instanceof FileNotFoundException) {\n throw new DataNotFoundException (\"Could not find log file.\", ioe);\n } else {\n throw new ParseException (\"Error getting log file text.\", new File (getFileName()));\n }\n }\n StringTokenizer sk = new StringTokenizer(s);\n ArrayList switches = new ArrayList(10);\n while (sk.hasMoreElements()) {\n String el =sk.nextToken().trim();\n if (el.startsWith(\"-J\")) {\n if (!(el.equals(\"-J-verbose:gc\"))) {\n if (!(el.startsWith(\"-J-D\"))) {\n JavaLineswitch curr = new JavaLineswitch(el.substring(2));\n addElement (curr); \n }\n }\n }\n }\n }", "public static void main(String[] argv) throws IOException, ParseException {\r\n\r\n\t\tif (argv.length < 1) {\r\n\t\t\tSystem.err.println(\"Usage: java GeoGDSPArser inputFilename.soft\");\r\n\t\t\tSystem.exit(2);\r\n\t\t}\r\n\r\n\t\tGeoGDSParser parser = new GeoGDSParser();\r\n\t\tparser.parseFile(argv[0]);\t\t\r\n\r\n\t\tfor (String k: parser.singleKeys) {\r\n\t\t\tString val = parser.getSingleValue(k);\r\n\t\t\tif (val != null) {\r\n\t\t\t\tSystem.out.println(k + \": \" + val);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (String k: parser.multiKeys) {\r\n\t\t\tArrayList<String> vals = parser.getValues(k);\t\t\t\t\t\r\n\t\t\tif (vals != null) {\r\n\t\t\t\tSystem.out.println(k + \":\");\r\n\t\t\t\tfor (String v: vals) {\r\n\t\t\t\t\tSystem.out.println(\"\\t\" + v);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void readVotes(File inFile);", "public void parse(Visitor v) {\n\t\tTransitionsParser.Transitions tr = new TransitionsParser.Transitions();\n\t\tStreamTokenizer st = new StreamTokenizer(reader);\n\t\tst.ordinaryChar('.');\n\t\ttr.parse(st, v);\n\t}", "@Test\n public void testBasicIndels() throws IOException {\n final File outputFile = File.createTempFile(\"ob_indel_annotate_\", \".vcf\");\n final List<String> arguments = new ArrayList<>();\n arguments.add(\"-\" + StandardArgumentDefinitions.VARIANT_SHORT_NAME);\n arguments.add(TEST_VCF_INDELS);\n arguments.add(\"-\" + StandardArgumentDefinitions.INPUT_SHORT_NAME);\n arguments.add(TEST_BAM_TUMOR_INDELS);\n arguments.add(\"-\" + StandardArgumentDefinitions.INPUT_SHORT_NAME);\n arguments.add(TEST_BAM_NORMAL_INDELS);\n\n\n arguments.add(\"-\" + StandardArgumentDefinitions.OUTPUT_SHORT_NAME);\n arguments.add(outputFile.getAbsolutePath());\n runCommandLine(arguments);\n\n // Ground truth from manual review in IGV\n final String[][] gtF1R2F2R1 = {{\"14,0\", \"21,0\", \"11,3\", \"13,4\"},{\"34,0\",\"27,0\", \"10,12\",\"14,11\"},\n {\"14,0\", \"14,0\", \"18,1\", \"17,3\"},{\"24,0\",\"15,0\", \"19,7\",\"22,2\"}};\n\n Assert.assertTrue(outputFile.exists());\n final List<VariantContext> variantContexts = getVariantContextsFromFile(outputFile);\n\n assertOrientationAnnotationValues(variantContexts, gtF1R2F2R1, \"G15512.prenormal.sorted\",\n \"IS3.snv.indel.sv\");\n }", "public static void main(String[] args) {\r\n\r\n try {\r\n \r\n String outFile = \"H:\\\\Nexrad_Viewer_Test\\\\Hutchins\\\\gis\\\\WFUS53-KPAH-152129.txt\";\r\n convertFile(outFile);\r\n \r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void parse() throws ParserConfigurationException, SAXException,\n\t\t\tIOException, XMLStreamException {\n\n\t\tGem gem = new Gem();\n\t\tVisualParameters params = new VisualParameters();\n\n\t\t// current element name holder\n\t\tString currentElement = null;\n\n\t\tXMLInputFactory factory = XMLInputFactory.newInstance();\n\n\t\tfactory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, true);\n\n\t\tXMLEventReader reader = factory.createXMLEventReader(new StreamSource(\n\t\t\t\txmlFileName));\n\n\t\twhile (reader.hasNext()) {\n\t\t\tXMLEvent event = reader.nextEvent();\n\n\t\t\t// skip any empty content\n\t\t\tif (event.isCharacters() && event.asCharacters().isWhiteSpace()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// handler for start tags\n\t\t\tif (event.isStartElement()) {\n\t\t\t\tStartElement startElement = event.asStartElement();\n\t\t\t\tcurrentElement = startElement.getName().getLocalPart();\n\n\t\t\t\tif (XML.FOND.equalsTo(currentElement)) {\n\t\t\t\t\tfond = new Fond();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (XML.GEM.equalsTo(currentElement)) {\n\t\t\t\t\tgem = new Gem();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (XML.VISUAL_PARAMETRS.equalsTo(currentElement)) {\n\t\t\t\t\tparams = new VisualParameters();\n\t\t\t\t\tAttribute attribute = startElement\n\t\t\t\t\t\t\t.getAttributeByName(new QName(XML.VALUE_COLOR\n\t\t\t\t\t\t\t\t\t.value()));\n\t\t\t\t\tif (attribute != null) {\n\t\t\t\t\t\tparams.setValueColor(EnumColors.fromValue(attribute\n\t\t\t\t\t\t\t\t.getValue()));\n\t\t\t\t\t}\n\t\t\t\t\tattribute = startElement.getAttributeByName(new QName(\n\t\t\t\t\t\t\tXML.TRANSPARENCY.value()));\n\t\t\t\t\tif (attribute != null) {\n\t\t\t\t\t\tparams.setTransparency(Integer.valueOf(attribute\n\t\t\t\t\t\t\t\t.getValue()));\n\t\t\t\t\t}\n\t\t\t\t\tattribute = startElement.getAttributeByName(new QName(\n\t\t\t\t\t\t\tXML.FACETING.value()));\n\t\t\t\t\tif (attribute != null) {\n\t\t\t\t\t\tparams.setFaceting(Integer.valueOf(attribute.getValue()));\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// handler for contents\n\t\t\tif (event.isCharacters()) {\n\t\t\t\tCharacters characters = event.asCharacters();\n\n\t\t\t\tif (XML.NAME.equalsTo(currentElement)) {\n\t\t\t\t\tgem.setName(characters.getData());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (XML.PRECIOUSNESS.equalsTo(currentElement)) {\n\t\t\t\t\tgem.setPreciousness(Boolean.valueOf(characters.getData()));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (XML.ORIGIN.equalsTo(currentElement)) {\n\t\t\t\t\tgem.setOrigin(characters.getData());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (XML.VALUE.equalsTo(currentElement)) {\n\t\t\t\t\tgem.setValue(Double.valueOf(characters.getData()));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// handler for end tags\n\t\t\tif (event.isEndElement()) {\n\t\t\t\tEndElement endElement = event.asEndElement();\n\t\t\t\tString localName = endElement.getName().getLocalPart();\n\n\t\t\t\tif (XML.GEM.equalsTo(localName)) {\n\t\t\t\t\tfond.getGem().add(gem);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (XML.VISUAL_PARAMETRS.equalsTo(localName)) {\n\t\t\t\t\t// just add answer to container\n\t\t\t\t\tgem.setVisualParameters(params);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treader.close();\n\t}", "public static void encode(File fIn) throws IOException {\n\t\tencode(fIn, fIn, true);\n\t}", "private void posRead() throws IOException {\n\t\tFile file = new File(fullFileName());\n\t\tString line;\n\t\tBufferedReader reader = new BufferedReader(new FileReader(file));\n\t\tStringBuffer fileText = new StringBuffer();\n\t\twhile((line = reader.readLine()) != null) {\n\t\t\tStringTokenizer st = new StringTokenizer(line);\n\t\t\twhile (st.hasMoreTokens()) {\n \t\tString tokenAndPos = st.nextToken();\n \t\tint slashIndex = tokenAndPos.lastIndexOf('/');\n \t\tif (slashIndex <= 0) throw new IOException(\"invalid data\");\n \t\tString token = tokenAndPos.substring(0,slashIndex);\n \t\tString pos = tokenAndPos.substring(1+slashIndex).intern();\n \t\tint start = this.length();\n \t\tthis.append(token);\n \t\tif (st.hasMoreTokens())\n \t\t\tthis.append(\" \");\n \t\telse\n \t\t\tthis.append(\" \\n\");\n \t\tint end = this.length();\n \t\tSpan span = new Span(start,end);\n \t\tthis.annotate(\"token\", span, new FeatureSet());\n \t\tthis.annotate(\"constit\", span, new FeatureSet(\"cat\", pos));\n \t}\n\t\t}\n\t}", "public interface GraphFile<V,E> {\n\t\n\t/**\n\t * Loads a graph from a file per the appropriate format\n\t * @param filename the location and name of the file\n\t * @return the graph\n\t */\n\tGraph<V,E> load(String filename);\n\t\n\t/**\n\t * Save a graph to disk per the appropriate format\n\t * @param graph the location and name of the file\n\t * @param filename the graph\n\t */\n\tvoid save(Graph<V,E> graph, String filename);\n}", "public static void decode(File fIn) throws IOException {\n\t\tdecode(fIn, fIn, true);\n\t}", "public static List<GPSPeak> parseGPSOutput(String filename, Genome g) throws IOException {\n\t\tArrayList<GPSPeak> results = new ArrayList<GPSPeak>();\n\n\t\tint count = 0;\n BufferedReader bin = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));\n\t\t\n String line;\n while((line = bin.readLine()) != null) { \n line = line.trim();\n if (line.length()==0)\n \tcontinue;\n String[] f=line.split(\"\\t\");\n if (f[0].equals(\"Position\")||f[0].equals(\"chr\")){\n continue;\n }\n try {\n GPSPeak hit = GPSParser.parseLine(g, line, count);\n if (hit!=null) {\n results.add(hit);\n }\n } catch (RuntimeException e) {\n System.err.println(\"Parsing line \" + line);\n System.err.println(e.toString());\n throw(e);\n }\t\t\t\t\n count++;\n }\t\t\t\n if (bin != null) {\n bin.close();\n }\n results.trimToSize();\n \n\t\treturn results;\n\t}", "public void readFile(String file) throws FileNotFoundException {\n\t\tsc = new Scanner(new File(file));\n\t\tString firstLine = sc.nextLine();\n\t\tString [] breakFirstLine = firstLine.split(\" \");\n\t\tvillages = Integer.parseInt(breakFirstLine[0]);\n\t\tlines = Integer.parseInt(breakFirstLine[1]);\n\t\tSystem.out.println(\"villages: \" + villages + \"\\nlines: \" + lines);\n\t\tString line = \"\"; // current line\n\t\twhile(sc.hasNextLine()) { \n\t\t\tline = sc.nextLine();\n\t\t\tSystem.out.println(line);\n\t\t\tString[] breaks = line.split(\" \");\n\t\t\tString city1 = breaks[0];\n\t\t\tString city2 = breaks[1];\n\t\t\tString col = breaks[2];\n\t\t\tcolor = color(col);\n\t\t\tString route = breaks[3];\n\t\t\ttransit = transit(route);\n\t\t\tVillage a = new Village(city1);\n\t\t\tVillage b = new Village(city2);\n\t\t\t\n\t\t\tEdge e = new Edge(a, b, transit, color);\n\t\t\ta.addEdge(e);\n\t\t\tb.addEdge(e);\n\t\t\tg.addEdge(e);\n\t\t\t\n\t\t\tvertices.add(a);\n\t\t\tlast_transit = transit;\n\t\t\tlast_color = color;\n\t\t}\n\t}", "public static ResultInfo readIterationOutput(String new_path) throws Exception {\n ResultInfo ri = new ResultInfo();\n ri.changed = ri.unchanged = 0;\n String output_path = new_path + \"/part-00000\";\n String file_line = \"\";\n\n try {\n BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(output_path), \"UTF8\"));\n\n // Read first line\n file_line = in.readLine();\n\n // Read through file one line at time. Print line # and line\n while (file_line != null) {\n final String[] line = file_line.split(\"\\t\");\n\n if (line[0].startsWith(\"i\"))\n ri.changed = Long.parseLong(line[1]);\n else // line[0].startsWith(\"u\")\n ri.unchanged = Long.parseLong(line[1]);\n\n file_line = in.readLine();\n }\n\n in.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return ri;//result;\n }", "public String getFileExtension() {\r\n return Generator.ANIMALSCRIPT_FORMAT_EXTENSION;\r\n }", "public void parseAndDisplay(File inputFile) throws IOException, FileParseException {\n\t\tinfile = inputFile;\n\t\tDisplayData data = null;\n\n\t\tdata = parse(inputFile);\n\n\t\tinfile = null;\n\t\tsunfishParent.displayData(data, data.getFileName());\n\t}", "public static void main(String[] args) {\n\n\t\tSystem.out.println(\"Inputfile: \");\n\t\tScanner sc = new Scanner(System.in);\n System.out.println(\"Printing the file passed in:\");\n String inputfile = \"\";\n while(sc.hasNextLine()){\n \tinputfile = sc.nextLine();\n \tbreak;\n }\n System.out.println(\"Reading from: \" + inputfile);\n \n try {\n String fromfile = FileUtils.readFileToString( new File(\"C:\\\\Users\\\\fille\\\\Documents\\\\firstobj.obj\"));\n\n\t\tWavefontConverter conv = new WavefontConverter();\n\t\tconv.ToVertics(fromfile);\n\t\tArrayList<float[]>vertics = conv.meshes; \n\t\tArrayList<short[]> indices = conv.indices;\n\t\twriteToBinary(conv.mesh2,conv.by,\"test\");\n\t\treadfile();\n\t//\tToJavaclass(vertics,indices,\"Monkey\");\n\t\t\n }catch(Exception e) {\n \te.printStackTrace();\n }\n\t\t//conv.ToVertics(Files)\n\t}", "public VCipher(String keyword, String fileName, boolean actionB)\n\t{\n\t\talphabet = new char [SIZE];\n\t\tfor (int i = 0; i < SIZE; i++) \n\t\t{\n\t\t\talphabet[i] = (char)('A' + i);\n\t\t}\n\t\tStringBuilder keybuilder = new StringBuilder(keyword);\t\t\n\t\tint k = (int)keybuilder.length();\n\t\tcipher = new char [k][SIZE];\n\t\tfor (int i=0;i<k;i++)\n\t\t{\n\t\t\tint j=0;\n\t\t\tcipher[i][j] = keybuilder.charAt(i);\n\t\t\tint position = Character.getNumericValue(keybuilder.charAt(i))-9;\n\t\t\tint t =SIZE - position;\n\t\t\tfor (j=1;j<=t;j++)\n\t\t\t{\n\t\t\t\tcipher[i][j] = alphabet[position];\n\t\t\t\tposition ++;\n\t\t\t}\n\t\t\tposition=0;\n\t\t\tfor(j=t+1;j<SIZE;j++)\n\t\t\t{\n\t\t\t\tcipher[i][j] = alphabet[position];\n\t\t\t\tposition ++;\n\t\t\t}\n\t\t}\n\t\tString inFile = fileName+\".txt\";\n\t\tString outFile = this.fileProcessVigenere(fileName, actionB);\n\t\ttry{\t\n\t\t\tFileReader reader = new FileReader(inFile);\n\t\t\tFileWriter writer = new FileWriter(outFile);\n\t\t\tScanner in = new Scanner(reader);\n\t\t\twhile (in.hasNextLine()) {\n\t\t\t\tStringBuilder line = new StringBuilder(in.nextLine());\n\t\t\t\t//System.err.println(\"\\n\"+line+\"\\nCIBE JMGRI XNQJICBVKW\");\n\t\t\t\tint b=0;\n\t\t\t\tchar chr;\n\t\t\t\tint p=0;\n\t\t\t\twhile (b < line.length()) {\n\t\t\t\t\tif (p==k)\n\t\t\t\t\t{\n\t\t\t\t\t\tp=0;\n\t\t\t\t\t}\n\t\t\t\t\tif ((chr = line.charAt(b)) >= 'A' && (chr = line.charAt(b)) <= 'Z') \n\t\t\t\t\t{\n\t\t\t\t\t\tif (actionB==false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchar temp = this.encode(chr,p);\n\t\t\t\t\t\t\twriter.write(temp);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\twriter.write(this.decode(chr,p));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tp +=1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\twriter.write(line.charAt(b));\n\t\t\t\t\t}\n\t\t\t\t\tb +=1;\n\t\t\t\t}\n\t\t\t\twriter.write(\"\\r\\n\");\n\t\t\t}\n\t\t\t\treader.close();\n\t\t\t\twriter.close();\n\t\t\t\tnew LetterFrequencies(outFile);\n\t\t\t}\n\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\tSystem.err.println(\"File not Found\");\n\t\t\t}\n\t}", "public void convert(String inFile, String outFile) throws IOException, JAXBException;", "public static void main(String[] args) { // generate new json files\n \t// All directories to pull from\n \t\n \tArrayList<List<List<Integer>>> levels = new ArrayList<List<List<Integer>>>();\n \tfor(int i = 1;i<=10;i++) {\n \t\tif (i != 9) {\n \t\t\tmaxX=0;\n \t\t\tmaxY=0;\n \t\t\tvisited.clear();\n \t\t\tenemyNumber=-1;\n \t\t\tenemyString = null;\n \t\t\tbossString = null;\n \t\t\tList<List<Integer>> level = convertMMLVtoInt(MegaManVGLCUtil.MEGAMAN_MMLV_PATH+\"MegaManLevel\"+i+\".mmlv\");\n \t\t\tlevels.add(level);\n \t\t\t//MegaManVGLCUtil.printLevel(level);\n \t\t}\n\t\t}\n \tSystem.out.println(\"Read \"+levels.size()+\" levels.\");\n\n \t\n \toutputOneGAN(levels, \"NoWater9\"); \n \toutputSevenGAN(levels, \"NoWater9\");\n \t//File testFile = new File(\"data\\\\VGLC\\\\MegaMan\\\\MegaManOneGANNoWater9.json\");\n \t//showJsonContents(testFile);\n }", "@Test\n\tpublic void testParseTagFile_Success() throws IOException \n\t{\n\t\tString expected = \"aus-capitals.csv|8\";\t\t\n\t\t\n\t\t// Act\n\t\t// need to be modified the hardcoded path with mocking\n\t\tString actual = TagFileParser.readTagFile(\"D:\\\\Learning\\\\testlocation\\\\aus-capitals.tag\");\n\t\t\n\t\t// Assert\t\t\n\t\tassertEquals(expected, actual);\t\n\t}", "private static void loadNewFormat(String filename, Stats stats) throws IOException {\n System.out.println(\"Analysing file: \" + filename);\n getConsole().println(\"Analysing file: \" + filename.substring(0, Integer.min(filename.length(), 60)) + (filename.length() > 60 ? \"...\" : \"\"));\n\n lastStatusMessageTime = System.nanoTime();\n String line;\n long numOfKeys = 0,\n actualKey = 0,\n startFileTime = System.nanoTime();\n try (BufferedReader reader = new BufferedReader(new FileReader(filename))) {\n while ((line = reader.readLine()) != null) {\n String tuple[] = line.replace(\",\", \";\").split(\";\", 7);\n if (tuple.length == 7 && tuple[0].matches(\"\\\\d+\")) {\n numOfKeys++;\n }\n }\n } catch (FileNotFoundException ex) {\n System.err.println(\"File '\" + filename + \"' not found\");\n return;\n }\n\n try (BufferedReader reader = new BufferedReader(new FileReader(filename))) {\n int pos = filename.lastIndexOf('.');\n String icsn = filename;\n if (pos >= 0) {\n icsn = icsn.substring(0, pos);\n }\n stats.changeCard(icsn);\n while ((line = reader.readLine()) != null) {\n String tuple[] = line.replace(\",\", \";\").split(\";\", 7);\n if (tuple.length != 7 || !tuple[0].matches(\"\\\\d+\")) {\n continue;\n }\n\n try {\n Params params = new Params();\n params.setModulus(new BigInteger(tuple[1], 16));\n params.setExponent(new BigInteger(tuple[2], 2));\n params.setP(new BigInteger(tuple[3], 16));\n params.setQ(new BigInteger(tuple[4], 16));\n params.setTime(Long.valueOf(tuple[6]));\n stats.process(params);\n\n actualKey++;\n showProgress(actualKey, numOfKeys, startFileTime);\n } catch (NumberFormatException ex) {\n String message = \"\\nKey \" + actualKey + \" is not correct.\";\n getConsole().println(message);\n System.out.println(message);\n System.out.println(\" \" + line);\n }\n }\n } catch (FileNotFoundException ex) {\n System.err.println(\"File '\" + filename + \"' not found\");\n } finally {\n consoleDoneLine();\n }\n }", "public static void readCVS(String filename){\n try {\n BufferedReader reader = new BufferedReader(new FileReader(filename));\n String line;\n while((line=reader.readLine())!=null){\n String item[] = line.split(\",\");\n String name = item[0];\n String value = item[1];\n switch (name){\n case \"useMaxTick\":{\n if(value.toLowerCase().equals(\"true\")){\n Params.useMaxTick = true;\n }else{\n Params.useMaxTick = false;\n }\n break;\n }\n case \"maxTick\":{\n Params.maxTick = Integer.parseInt(value);\n break;\n }\n case \"startPctWhites\":{\n Params.startPctWhites = Float.parseFloat(value);\n break;\n }\n case \"startPctBlacks\":{\n Params.startPctBlacks = Float.parseFloat(value);\n break;\n }\n case \"startPctGreys\":{\n Params.startPctGreys = Float.parseFloat(value);\n break;\n }\n case \"albedoOfWhites\":{\n Params.albedoOfWhites = Float.parseFloat(value);\n break;\n }\n case \"albedoOfBlacks\":{\n Params.albedoOfBlacks = Float.parseFloat(value);\n break;\n }\n case \"albedoOfGreys\":{\n Params.albedoOfGreys = Float.parseFloat(value);\n break;\n }\n case \"solarLuminosity\":{\n Params.solarLuminosity = Float.parseFloat(value);\n break;\n }\n case \"albedoOfSurface\":{\n Params.albedoOfSurface = Float.parseFloat(value);\n break;\n }\n case \"diffusePct\":{\n Params.diffusePct = Float.parseFloat(value);\n break;\n }\n case \"maxAge\":{\n Params.maxAge = Integer.parseInt(value);\n break;\n }\n case \"scenario\":{\n switch (Integer.parseInt(value)){\n case 0: {\n Params.scenario = Scenario.RAMP;\n break;\n }\n case 1: {\n Params.scenario = Scenario.LOW;\n break;\n }\n case 2: {\n Params.scenario = Scenario.OUR;\n break;\n }\n case 3: {\n Params.scenario = Scenario.HIGH;\n break;\n }\n case 4: {\n Params.scenario = Scenario.MAINTAIN;\n break;\n }\n default:\n break;\n }\n }\n default:\n break;\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) throws IOException\n\t {\t\n\t try{\t\n\t\t FileReader f=new FileReader(path);\n\t\t @SuppressWarnings(\"resource\")\n\t\tBufferedReader br=new BufferedReader(f);\n\t\t String text;\n\t\t String dot=\"\\\\.\";\n\t\t \n\t\t while((text=br.readLine())!=null)\n\t\t {\n\t\t\tfor(String retval: text.split(dot))\n\t \n\t\t\t System.out.println(\"Ip Address:\"+retval);\n\t \n\t\t\t\n\t\t\n\t\t }}\n\t catch(Exception e)\n\t {\n\t \te.printStackTrace();\n\t }\n\t\t\t \n\t\t \n\t \n\t }", "private void parseFile(IFile file) throws CoreException, IOException {\r\n \t\tBufferedReader reader = new BufferedReader(new InputStreamReader(file.getContents()));\r\n \t\tString nxt = \"\";\r\n \t\tStringBuilder builder = new StringBuilder();\r\n \t\tbuilder.append(reader.readLine());\r\n \t\twhile (nxt!=null) {\r\n \t\t\tnxt = reader.readLine();\r\n \t\t\tif (nxt!=null) {\r\n \t\t\t\tbuilder.append(\"\\n\");\r\n \t\t\t\tbuilder.append(nxt);\r\n \t\t\t}\r\n \t\t}\r\n \t\t// QUESTION: does this trigger the reconcilers?\r\n \t\tset(builder.toString());\r\n \t}", "public static void main(String args[]) throws IOException {\n\t\tProcessData ged = new ProcessData(); \r\n\t\tged.readFile(\"My Family.ged\"); \r\n\t\t\r\n\t\t// output result for sprint 1, sprint 2, sprint 3 and sprint 4 to output.txt file\r\n\t\tVector<String> s = new Vector<String>();\r\n\t\t\r\n\t\t// get the individuals data\r\n\t\ts.add(\"Individuals Info:\");\r\n\t\ts.addAll(ged.print_individual());\r\n\t\tPrintWriter writer = new PrintWriter(\"Output.txt\", \"UTF-8\");\r\n\t\twhile(s.size()>0)\r\n\t\t{\r\n\t\t writer.write(s.firstElement());\r\n\t\t writer.println();\r\n\t\t s.removeElementAt(0);\r\n\t\t}\r\n\t\ts.add(\"\");\r\n\t\ts.add(\"\");\r\n\t\ts.add(\"\");\r\n\t\t\r\n\t\t// get the family data\r\n\t\ts.add(\"Family Info\");\r\n\t\ts.addAll(ged.print_family());\r\n\t\twhile(s.size()>0)\r\n\t\t{\r\n\t\t writer.write(s.firstElement());\r\n\t\t writer.println();\r\n\t\t s.removeElementAt(0);\r\n\t\t}\t\t\t\r\n\t\tSystem.out.println(\"Result is printed to Output.txt file.\");\r\n\t\twriter.close();\t\t\r\n\t}", "public static void main(String[] args)\n throws FileNotFoundException, IOException\n {\n if (args.length == 0)\n {\n System.out.println(getUsageString());\n System.exit(0);\n }\n\n AssignEigenvectorsCmd cmd = new AssignEigenvectorsCmd();\n // Parse input. If incorrect, say what's wrong and print usage String\n if (!cmd.parseArguments(args))\n {\n System.out.println(getUsageString());\n System.exit(0);\n }\n\n // read lag times\n IDoubleArray lagFile = doublesNew.fromFile(cmd.inDir + \"/hmm-its.dat\");\n int[] lagtimes = intArrays.from(lagFile.getColumn(0));\n\n // reference\n IDoubleArray pibig0 = doublesNew.fromFile(cmd.inDir + \"/hmm-pibig-lag\" + cmd.reflag + \".dat\");\n IDoubleArray Rbig0 = doublesNew.fromFile(cmd.inDir + \"/hmm-Rbig-lag\" + cmd.reflag + \".dat\");\n cmd.setReference(pibig0, Rbig0);\n\n // read matrices and Chi\n for (int tau : lagtimes)\n {\n IDoubleArray TC = doublesNew.fromFile(cmd.inDir + \"/hmm-TC-lag\" + tau + \".dat\");\n IDoubleArray timescales = msm.timescales(TC, tau);\n IDoubleArray pibig = doublesNew.fromFile(cmd.inDir + \"/hmm-pibig-lag\" + tau + \".dat\");\n IDoubleArray Rbig = doublesNew.fromFile(cmd.inDir + \"/hmm-Rbig-lag\" + tau + \".dat\");\n\n System.out.print(tau + \"\\t\");\n for (int i = 1; i < Rbig.columns(); i++)\n {\n IDoubleArray ri = Rbig.viewColumn(i);\n\n double max = 0;\n int argmax = i;\n for (int j = 1; j < Rbig.columns(); j++)\n {\n double o = cmd.overlap(ri, j, pibig);\n if (o > max)\n {\n max = o;\n argmax = j;\n }\n }\n \n if (max > cmd.minOverlap)\n {\n System.out.print(timescales.get(argmax-1)+\"\\t\");\n }\n else\n {\n System.out.print(0+\"\\t\");\n }\n //System.out.print(max + \"(\"+argmax+\")\" + \"\\t\");\n }\n System.out.println();\n }\n\n }", "public static void main(final String[] args) throws IOException, TikaException, SAXException {\n\t File file = new File(args[0]);\n\n Tika tika = new Tika();\n \n //detecting the file type using detect method\n String filetype = tika.detect(file);\n //System.out.println(filetype);\n \n //Parser method parameters\n //Parser parser = new AutoDetectParser();\n //Parser parser = new DcXMLParser();\n Parser parser = new Eml211Parser();\n \n BodyContentHandler handler = new BodyContentHandler();\n Metadata metadata = new Metadata();\n FileInputStream inputstream = new FileInputStream(file);\n ParseContext context = new ParseContext();\n \n parser.parse(inputstream, handler, metadata, context);\n \n //System.out.println(handler.toString());\n \n System.out.println(\"Extracting Metadata of the document: \");\n //getting the list of all meta data elements \n String[] metadataNames = metadata.names();\n \n for(String name : metadataNames) {\t\t \n System.out.println(name + \": \"+ metadata.get(name));\n } \n }", "static TreeSet<Adverb> parseAdverbs(Scanner data){\n\t\tArrayList<String[]> raw = parseDataToArray(data);\n\t\tTreeSet<Adverb> output = new TreeSet<Adverb>();\n\n\t\tfor(String[] current : raw){ //iterate over each line from the original file.\n\n\t\t\tif(current.length != Values.ADVERB_DATA_ARRAY_LENGTH_CORRECT){\n\t\t\t\tSystem.err.println(\"Error parsing a line.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//System.out.println(\"Raw: \" + Arrays.toString(current));\n\n\t\t\t//current[] contains a split based on tabs. Generally {chapter, nom/gen/gender, definition}.\n\n\t\t\tint chapter = 0;\n\t\t\tString Adverb = null;\n\t\t\tArrayList<String> definitions = new ArrayList<String>();\n\n\t\t\t//Values.betterStringArrayPrint(current);\n\n\t\t\ttry{ //try to read a noun, assuming that the chapter IS specified\n\t\t\t\tchapter = Integer.parseInt(current[0]);\n\t\t\t\tAdverb = current[1];\n\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t} catch(Exception e){\n\t\t\t\tSystem.err.println(\"Could not read a line!\");\n\t\t\t\tcontinue; //We can't make a noun out of the botrked line.\n\t\t\t}\n\t\t\ttrimAll(definitions);\n\t\t\tAdverb currentAdverb = new Adverb(Adverb, chapter, definitions);\n\t\t\tSystem.out.println(\"Added: \" + currentAdverb);\n\t\t\toutput.add(currentAdverb);\n\t\t}\n\n\t\treturn output;\n\t}", "String prepareFile();", "private static void writeToOutput() {\r\n FileWriter salida = null;\r\n String archivo;\r\n JFileChooser jFC = new JFileChooser();\r\n jFC.setDialogTitle(\"KWIC - Seleccione el archivo de salida\");\r\n jFC.setCurrentDirectory(new File(\"src\"));\r\n int res = jFC.showSaveDialog(null);\r\n if (res == JFileChooser.APPROVE_OPTION) {\r\n archivo = jFC.getSelectedFile().getPath();\r\n } else {\r\n archivo = \"src/output.txt\";\r\n }\r\n try {\r\n salida = new FileWriter(archivo);\r\n PrintWriter bfw = new PrintWriter(salida);\r\n System.out.println(\"Índice-KWIC:\");\r\n for (String sentence : kwicIndex) {\r\n bfw.println(sentence);\r\n System.out.println(sentence);\r\n }\r\n bfw.close();\r\n System.out.println(\"Se ha creado satisfactoriamente el archivo de texto\");\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "public String toFileFormat()\n\t{\n\t\t\n\t\treturn startx + \" \" + starty + \"; \" + endx + \" \" + endy + \"; \"+ texture + \";\\r\\n\";\n\t\t\n\t}", "public static void writeBibleATV(File file, Bible bible) {\r\n\t\t\r\n\t\twriteVersesATV(file, bible.getVersion() + \": \" + bible.getTitle(), bible.getAllVerses());\r\n\t}", "private void processAce ()\n{\n // Set the .ace input file name.\n ace_file.setFileName ( fileName );\n\n // Open the .ace input file.\n ace_file.openFile ();\n\n // Set the XML file name.\n xml_file.setFileName ( fileName + \".xml\" );\n\n // Open the XML file for writing.\n xml_file.open_XML_file ();\n\n // Write the XML file header.\n xml_file.write_XML_header ();\n\n // Process the .ace summary line.\n processSummary ();\n\n // Process the Phrap assembled contigs.\n processContigs ();\n\n // Complete the XML file.\n xml_file.write_XML_footer ();\n xml_file.close_XML ();\n\n // Close the .ace input file.\n ace_file.closeFile ();\n\n // Close the XML file.\n xml_file.closeFile ();\n}" ]
[ "0.56798315", "0.5557617", "0.5491803", "0.5307464", "0.5294974", "0.52312666", "0.5114316", "0.50712264", "0.50429803", "0.5000527", "0.49942064", "0.4993905", "0.4968992", "0.49399826", "0.48772404", "0.48688385", "0.4849317", "0.4807805", "0.47554845", "0.47479233", "0.46987236", "0.46839646", "0.46730226", "0.4667134", "0.46627358", "0.46614042", "0.46409038", "0.4626546", "0.46232536", "0.4619754", "0.46114695", "0.460849", "0.4607484", "0.45996138", "0.45939985", "0.45898917", "0.45869198", "0.4577453", "0.4572342", "0.4564065", "0.45604336", "0.4551028", "0.45504087", "0.45339078", "0.45323825", "0.45273682", "0.45060402", "0.44989496", "0.44925076", "0.4485215", "0.4485041", "0.44818494", "0.44727942", "0.4471458", "0.4466287", "0.44613135", "0.4460071", "0.44588563", "0.44527504", "0.44483653", "0.4439232", "0.44335425", "0.44304955", "0.4424412", "0.4422636", "0.44118005", "0.4411752", "0.44098908", "0.44097602", "0.44079688", "0.44079205", "0.4404912", "0.44026783", "0.43995848", "0.4396433", "0.43809992", "0.43804598", "0.4374232", "0.43729457", "0.4369509", "0.43673828", "0.4367045", "0.43641606", "0.43637738", "0.43616664", "0.43571132", "0.43541646", "0.43541372", "0.43527362", "0.43487445", "0.43429026", "0.4342224", "0.43406695", "0.4339684", "0.4338668", "0.43374956", "0.43365383", "0.4331712", "0.43307677", "0.4327496" ]
0.43791097
77
validation for k and string length
public static int maxSubStringSizeKDistinctChars(String str, int k) { int start = 0; int maxLen = 0; int localSum = 0; HashMap<Character, Integer> hm = new HashMap<>(); for(int end = 0; end < str.length(); end++) { localSum++; if (hm.containsKey(str.charAt(end))) { hm.put(str.charAt(end), hm.get(str.charAt(end)) + 1); } else { hm.put(str.charAt(end), 1); } while(hm.size() > k) { // maxLen = Math.max(maxLen, end - start); maxLen = Math.max(maxLen, localSum - 1); hm.put(str.charAt(start), hm.get(str.charAt(start)) - 1); if(hm.get(str.charAt(start)) == 0) { hm.remove(str.charAt(start)); } start++; localSum--; } } return Math.max(maxLen, localSum); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void validate(String s, int length, String msg) {\n Logger.getLogger(getClass()).info(\"valore della stringa inserita\"+s);\n \tif (s != null && s.length()>length)\n throw new IllegalArgumentException(msg);\n }", "public boolean isValidPalindrome(String s, int k) {\n int n = s.length();\n return n - longestCommonSubseq(s, new StringBuilder(s).reverse().toString()) <= k;\n }", "private boolean isValidInput(String input) \r\n {\r\n\t \r\n return input!=null&&input.length()<=10;\r\n \r\n }", "int minLength();", "@Test\n\tpublic void invalidLengthShort() {\n\t\tboolean result = validator.isValid(\"73602851\");\n\t\tassertFalse(result);\n\t}", "static public String solution(String message, int k) {\n if (message == null || message.isEmpty()) return message;\n if (k <= 0) return \"\";\n\n // cut out spaces from the input\n message = message.trim();\n\n // split on space for all the words\n String[] words = message.split(\" \");\n\n // For the output\n StringBuilder kLength = new StringBuilder();\n\n // Temporary variable for the word separator\n String separator = \"\";\n for (String iWord : words) {\n if(iWord.trim().isEmpty()) continue;\n if (kLength.length() + 1 + iWord.length() <= k) {\n kLength.append(separator).append(iWord);\n } else {\n break;\n }\n separator = \" \";\n }\n\n // .trim here is to avoid spaces being appended\n return kLength.toString().trim();\n }", "Boolean checkLength(String detail);", "public boolean isKPalindrome(String input, int k){\n\t\t\n\t\t//if the input string is null or less than 0 return false\n\t\tif(input == null || k < 0)\n\t\t\treturn false;\n\t\t//if the input length equals 1, return true\n\t\telse if(input.length() == 1)\n\t\t\treturn true;\n\t\telse if(input.length() ==2)\n\t\t{\n\t\t\t//if the input length equals true, then return true if characters are equal or if \n\t\t\t// k is greater than 0, otherwise return false.\n\t\t\tif(input.charAt(0) == input.charAt(1))\n\t\t\t\treturn true;\n\t\t\telse if(k > 0)\n\t\t\t\treturn true;\n\t\t\telse \n\t\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//Check recursively\n\t\t\t//Compare the first and last characters, if they are the same make a recursive call\n\t\t\t// with k the same and the start and end lopped off\n\t\t\t// if they are not the same, make 2 recursive calls, each with one end lopped off and k decremented by 1\n\t\t\t// return true if either one of them returns true.\n\t\t\tif(input.charAt(0)==input.charAt(input.length()-1))\n\t\t\t\treturn isKPalindrome(input.substring(1,input.length()-1),k);\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(k<=0)\n\t\t\t\t\treturn false;\n\t\t\t\telse\n\t\t\t\t\treturn isKPalindrome(input.substring(0,input.length()-1),k-1) ||\n\t\t\t\t\t\t\tisKPalindrome(input.substring(1,input.length()),k-1);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "private static boolean checkLength(String password) {\n \treturn password.length() >= minLength;\n }", "@Override\n\tprotected void checkNumberOfInputs(int length) {\n\n\t}", "public int lengthOfLongestSubstringKDistinctImprvd(String s, int k) {\n if (s == null || s.length() == 0) {\n return 0;\n }\n \n int[] map = new int[256];\n int j = 0;\n int distinctCt = 0;\n int maxLen = 0;\n\n for (int i = 0; i < s.length(); i++) {\n while (j < s.length()) {\n map[s.charAt(j)] += 1;\n if (map[s.charAt(j)] == 1) {\n distinctCt++;\n }\n j++;\n if (distinctCt > k) {\n break;\n }\n maxLen = Math.max(j- i, maxLen);\n }\n map[s.charAt(i)] -= 1;\n if (map[s.charAt(i)] == 0) {\n distinctCt--;\n }\n }\n\n return maxLen;\n}", "public boolean checkKey(char k) { \r\n \t\tif (keys.length >= k) {\r\n \t\t\treturn keys[k];\r\n \t\t}\r\n \t\treturn false;\r\n \t}", "@Test\n\tpublic void caseNameWithWrongLength() {\n\t\tString caseName = \"le\";\n\t\ttry {\n\t\t\tCaseManagerValidator.isCharAllowed(caseName);\n\t\t\tfail();\n\t\t} catch (ValidationException e) {\n\t\t}\n\t}", "private boolean isValidValue(String val) {\n for (int i = 2; i <= 10; i++) {\n if (val.equals(i + \"\")) {\n return true;\n }\n }\n return (val.equals(\"J\") || val.equals(\"Q\") || val.equals(\"K\") || val.equals(\"A\"));\n }", "abstract protected boolean validateKey(String key);", "private boolean hasValidLength()\n {\n final int length = mTextInputLayout.getText().length();\n return (length >= mMinLen && length <= mMaxLen);\n }", "private boolean checkKey(char k)\n {\n \tint index = word.indexOf(k);\n \tif (index == -1)\n \t{\n \t\t//k doesn't exist in word\n \t\tguess_number--;\n \t\treturn false;\n \t}\n \telse\n \t{\n \t\t//k exist in the word\n \t\twhile (index != -1)\n \t\t{\n \t\t\t//update mask\n \t\t\tmask = mask.substring(0, index)+k+mask.substring(index+1);\n \t\t\t//update index\n \t\t\tindex = word.indexOf(k, index + 1);\n \t\t}\n \t\treturn true;\n \t}\n \t\n }", "public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\tint k = input.nextInt();\n\t\tString s = input.next();\n\t\tString smallest = \" \";\n\t\tString largest = \" \";\n\t\tList<String> SubStringsOf_k_Length = new ArrayList<String>();\n\t\tfor(int i=0;(i+k)<=s.length();i++) {\n\t\t\tSubStringsOf_k_Length.add(s.substring(i,i+k));\n\t\t}\n//\t\tSystem.out.println(\"Before Sorting\");\n\t\tSystem.out.println(SubStringsOf_k_Length);\n\t\tSystem.out.println(SubStringsOf_k_Length.size());\n//\t\tCollections.sort(SubStringsOf_k_Length);\n//\t\tSystem.out.println(\"After Sorting\");\n//\t\tSystem.out.println(SubStringsOf_k_Length);\n\t\t\n//\t\tIterator itr = SubStringsOf_k_Length.iterator();\n//\t\t\n//\t\twhile(itr.hasNext()) {\n//\t\t\t\n//\t\t}\n\t\tString temp_largest = SubStringsOf_k_Length.get(0);\n\t\tString temp_smallest = SubStringsOf_k_Length.get(0);\n\t\tfor(int i=0;i<SubStringsOf_k_Length.size();i++) {\n\t\t\tif(temp_largest.compareTo(SubStringsOf_k_Length.get(i))>0 || temp_smallest.compareTo(SubStringsOf_k_Length.get(i))<0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfor(int j=i+1;j<SubStringsOf_k_Length.size();j++) {\n\t\t\t\t\tif(SubStringsOf_k_Length.get(i).compareTo(SubStringsOf_k_Length.get(j))>0) {\n\t\t\t\t\t\tlargest = SubStringsOf_k_Length.get(i);\n\t\t\t\t\t\tsmallest=SubStringsOf_k_Length.get(j);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//smallest = SubStringsOf_k_Length.get(i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp_largest = largest;\n\t\t\t\ttemp_smallest = smallest;\n\t\t\t\t\n\t\t\t}\t\n\t\t}\n\t\tSystem.out.println(largest);\n\t\tSystem.out.println(smallest);\n//\t\tfor(int i=1;i<subStrings_Of_k_Length.length;i++) {\n//\t\t\tSystem.out.println(subStrings_Of_k_Length[i-1]);\n//\t\t\tsmallest = subStrings_Of_k_Length[i-1];\n//\t\t\tif((subStrings_Of_k_Length[i].compareTo(smallest))<0) {\n//\t\t\t\tlargest = subStrings_Of_k_Length[i-1];\n//\t\t\t\tsmallest = subStrings_Of_k_Length[i];\n//\t\t\t}\n//\t\t}\n//\t\tSystem.out.println(\"Smallest:\" +smallest);\n//\t\tSystem.out.println(\"Largest:\" +largest);\n\t}", "public int lengthOfLongestSubstringKDistinct(String s, int k) {\n Map<Character, Integer> map = new HashMap<>();\n int maxLenght = 0;\n\n int i = 0;\n int j = 0;\n int n = s.length();\n\n while (j < s.length()) {\n\n char c = s.charAt(j);\n if (map.containsKey(c)) {\n map.put(c, map.get(c) + 1);\n } else {\n map.put(c, 1);\n }\n\n if (map.size() <= k) {\n maxLenght = Math.max(maxLenght, j - i + 1);\n }\n\n if (map.size() > k) {\n\n while (map.size() > k && i < j) {\n char cx = s.charAt(i);\n map.put(cx, map.get(cx) - 1);\n if (map.get(cx) == 0) {\n map.remove(cx);\n }\n i++;\n }\n }\n\n j++;\n }\n\n return maxLenght;\n }", "@Test\r\n\tpublic void testIsValidPasswordTooShort()\r\n\t{\r\n\t\ttry{\r\n\t\t\tassertTrue(PasswordCheckerUtility.isValidPassword(\"flgk1\"));\r\n\t\t}\r\n\t\tcatch(LengthException e)\r\n\t\t{\r\n\t\t\tassertTrue(\"Successfully threw a lengthExcepetion\",true);\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n String str = \"aabacbebebe\";\n int k = 3;\n\n int maxLength = getMaxSubstr(str, k);\n System.out.println(maxLength);\n }", "@Test\n public void testPasswordMinLength()\n {\n String invalid = repeatM(7);\n owner.setPassword(invalid);\n assertInvalid(owner, \"password\", \"Password must be at least 8 characters in length\", invalid);\n }", "public int lengthOfLongestSubstringKDistinct(String s, int k) {\n if (s == null || s.length() == 0) {\n return 0;\n }\n\n int j = 0;\n int max = 0;\n int[] map = new int[256];\n int distinctCt = 0;\n\n for (int i = 0; i < s.length(); i++) {\n while( j < s.length()) {\n int ch = s.charAt(j);\n if (map[ch] == 0) {\n if (distinctCt + 1 > k) {\n break;\n }\n map[ch] = 1;\n distinctCt++;\n j++;\n } else {\n map[ch] += 1;\n j++;\n }\n }\n max = Math.max(max, j - i);\n map[s.charAt(i)] -= 1;\n if (map[s.charAt(i)] == 0) {\n distinctCt--;\n }\n }\n return max;\n }", "public static int is_legal(String name, int length)\n\t{\n\t\tif (first_lg(name[0]) == 0)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\tif (illegal_sym(name, length) == 0)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\treturn 1;\n\t}", "public boolean meetsMinimumLength(){\n\n return alg.meetsMinimumLength(input.getText().toString());\n }", "private String validateString(String data, String defaultValue, int minLength, int maxLength)\n {\n return (data.length() < minLength || data.length() > maxLength) ? defaultValue : data;\n }", "@Test\n public void testFirstNameMaxLength()\n {\n String invalid = repeatM(21);\n owner.setFirstName(invalid);\n assertInvalid(owner, \"firstName\", \"First name must be between 2 and 20 characters\", invalid);\n }", "public static boolean validateInputLength(String[] args) {\n return args.length == 3;\n }", "private int validateKey (int key) {\n return (key < 0 || key > ALPHABET_LENGTH-1) ? 0 : key;\n }", "public static boolean isAkParamLengthValid(String parameter, int length)\n {\n boolean ret = true;\n if (isConstantAkParamsDefined())\n {\n int i = getAkParamIndex(parameter);\n if (length != akParams_[i].len)\n {\n ret = false;\n Log.e(LOG_TAG, \"In configuration file, the AK parameter \" + parameter + \" values length \"\n + length + \" is NOT compatible to the defined length \" + akParams_[i].len);\n }\n }\n return ret;\n }", "private boolean isLengthCorrect(final String token) {\n return token.length() == VALID_TOKEN_LENGTH;\n }", "@Test\n\tpublic void invalidLengthLong() {\n\t\tboolean result = validator.isValid(\"73102851691\");\n\t\tassertFalse(result);\n\t}", "public abstract int getMaxLength();", "private boolean isStringValid(String s){\n int[] result = getLeftRightCount(s);\n return result[0] == 0 && result[1] == 0;\n }", "int getMaxStringLiteralSize();", "public static boolean isValidLength(String test) {\n return test.length() <= MAX_CHARACTERS;\n }", "private static boolean isKata(String s) {\n\t\tchar c = s.charAt(0);\n\t\tif (c < '0' || c > '9') return true;\n\t\t\n\t\ttry {\n\t\t\tInteger.parseInt(s);\n\t\t\treturn false;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn true;\n\t\t}\n\t}", "@Test\n public void testPasswordLowerBound()\n {\n String valid = repeatM(8);\n owner.setPassword(valid);\n assertEquals(0, validator.validate(owner).size());\n }", "static int letterIslands(String s, int k) {\n /*\n * Write your code here.\n */\n\n }", "private static String testString(String str, int minLen, int maxLen) throws Exception {\n if (str.length() > maxLen || str.length() < minLen) {\n throw new Exception(str + \" has a length not in [\" + minLen + \", \" + maxLen + \"]\");\n }\n return str;\n }", "private void checkBounds(int n) throws ParseException\n {\n if (pos + n > s.length())\n {\n throw new ParseException(format(\"Requested: %s, Available: %s\", n, remaining()));\n }\n }", "private void minPepLengthTxtKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_minPepLengthTxtKeyReleased\n validateInput(false);\n }", "@Override\r\n\tpublic boolean validate(String num) {\n\t\treturn false;\r\n\t}", "public static boolean isAtLeastXCharacters(String value, int x) {\r\n\t\ttry {\r\n\t\t\treturn value.length() >= x;\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public static int getMaxSubstr(String str, int k) {\n int[] freqArr = new int[256];\n int uniqCount = 0;\n\n int cStart = 0;\n int cEnd = 0;\n\n int resStart = -1;\n int resLen = -1;\n\n for(int i = 0; i < str.length(); i++) {\n int ch = str.charAt(i);\n\n if(freqArr[ch] == 0) {\n uniqCount++;\n }\n\n freqArr[ch]++;\n cEnd++;\n\n while(uniqCount > k) {\n cStart++;\n int c = str.charAt(cStart);\n\n if(freqArr[c] == 1) {\n uniqCount--;\n }\n\n freqArr[c]--;\n }\n\n\n if(uniqCount == k && (cEnd - cStart > resLen) ) {\n resLen = cEnd - cStart;\n resStart = cStart;\n }\n\n }\n\n //print \"resLen\" characters starting from \"resStart\"\n for(int i = resStart; i < resStart + resLen; i++) {\n System.out.print(str.charAt(i));\n }\n\n\n //returning the length\n return resLen;\n }", "public StringLengthValidator(int minCharacters, int maxCharacters) {\n this.min = minCharacters;\n this.max = maxCharacters;\n }", "public void testLength()\n {\n LinearSearch ls = new LinearSearch();\n\n assertFalse(ls.validLength(int [15] haystack));\n }", "public boolean checkName(String name)\n {\n boolean value = true;\n if(name.length() < 3 || name.length() > 15)\n {\n System.out.println(\"Name must be between 3 and 15 characters\");\n value = false;\n }\n return value;\n }", "int getStrLngth(String name){\r\n int l= name.length();\r\n return l;}", "public static boolean validigits(String pass){\n\t\tif (pass.length()>=8){\n\t\t\treturn true;\n\t\t}\n\t\telse \n\t\t\treturn false;\n\t}", "public void testOtacTooLong()\n {\n form.setVerificationCode(\"123456789\");\n validator.validate(form, errors);\n assertTrue(errors.hasErrors());\n }", "int getMaxCharSize();", "public static String getKthPermuation(String input, long k){\n \n //Boiler plate code to create a list of unique characters from string\n //and a map maintaining the character count for the string\n List<Character> chars = new ArrayList<Character>();\n Map<Character, CharCount> map = new HashMap<Character, CharCount>();\n for (int i = 0; i < input.length(); i++) {\n char charAt = input.charAt(i);\n if (map.containsKey(charAt)) {\n map.get(charAt).incrementCount();\n } else {\n CharCount cc = new CharCount(charAt, 1);\n chars.add(charAt);\n map.put(charAt, cc);\n }\n }\n Collections.sort(chars);\n return getPermutation(k-1, input.length(), map, chars);\n }", "static int size_of_cz(String passed){\n\t\treturn 3;\n\t}", "boolean hasSearchLength();", "static int size_of_jm(String passed){\n\t\treturn 3;\n\t}", "public int getMaxLength();", "@Test\n public void testLastNameMaxLength()\n {\n String invalid = repeatM(31);\n owner.setLastName(invalid);\n assertInvalid(owner, \"lastName\", \"Last name must be between 2 and 30 characters\", invalid);\n }", "private static String makeCorrectSize(String s, int length){\n\t\tStringBuilder sb = new StringBuilder(s); \n\t\tfor(int i = sb.length(); i<length; i++){\n sb.append(\" \");\n }\n\t\treturn sb.toString(); \n\n\t}", "public MinSubStringMaxCharactersTest(String testName) {\n super(testName);\n }", "public void findLength()\n\t{\n\t\tlength = name.length();\n\t}", "private void checkLength(String value, int maxLength) throws WikiException {\r\n\t\tif (value != null && value.length() > maxLength) {\r\n\t\t\tthrow new WikiException(new WikiMessage(\"error.fieldlength\", value, Integer.valueOf(maxLength).toString()));\r\n\t\t}\r\n\t}", "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 }", "static int size_of_cm(String passed){\n\t\treturn 3;\n\t}", "static int size_of_inr(String passed){\n\t\treturn 1;\n\t}", "public static boolean isAtLeastXCharacters(MeasureableLength f) {\r\n\t\tInteger minlength = f.getMinlength();\r\n\t\tif(minlength == 0 || minlength == null) return true;\r\n\t\telse if(f.getValue().equals(null)) return false;\r\n\t\telse return isAtLeastXCharacters(f.getValue(), minlength);\r\n\t}", "public InvalidOntologyName(int length) {\n super(String.format(\"Ontology name is too long (%d)\", length));\n }", "@Test\n public void testCheckInputValidation() {\n GreekNumberValidation instance = new GreekNumberValidation();\n assertEquals(false, instance.checkInputValidation(\"69 88 89 89 35\"));\n assertEquals(false, instance.checkInputValidation(\"69 885 896 897 35\"));\n assertEquals(false, instance.checkInputValidation(\"6 885 896 8 35\"));\n assertEquals(true, instance.checkInputValidation(\"6985898731\"));\n assertEquals(true, instance.checkInputValidation(\"asd 34 5\"));\n assertEquals(true, instance.checkInputValidation(\"asd gfd g\"));\n assertEquals(true, instance.checkInputValidation(\"asdgfdg\"));\n\n }", "public static String appendAndDelete(String s, String t, int k) {\n if (s.equals(t)) {\n return \"Yes\";\n }\n\n // Return yes if the same length\n if (s.length() == t.length()) {\n if (s.length() < k) {\n return \"Yes\";\n } else {\n return \"No\";\n }\n }\n\n // Return yes of all letters are the same in both\n String test = s.substring(0,1);\n boolean same = true;\n for (int i = 0; i < s.length(); i++) {\n if (!test.equals(s.substring(i, i+1))) {\n same = false;\n break;\n }\n }\n for (int i = 0; i < t.length(); i++) {\n if (!test.equals(t.substring(i, i+1))) {\n same = false;\n break;\n }\n }\n if (same) {\n return \"Yes\";\n }\n // find the shorter length\n String shorter = \"\";\n String longer = \"\";\n if (s.length() < t.length()) {\n shorter = s;\n longer = t;\n } else if (t.length() < s.length()) {\n shorter = t;\n longer = s;\n } else {\n }\n\n\n\n // Only loop if the lengths are different\n int index = 0;\n for (int i = 0; i < shorter.length(); i++) {\n if (s.charAt(i) != t.charAt(i)) {\n //time to record index\n index = i;\n break;\n }\n }\n\n// if (index == 0 && shorter.equals(\"\")) {\n// return \"Yes\";\n// }\n\n if ((s.length() - index) + (t.length() - index) == k) {\n return \"Yes\";\n }\n return \"No\";\n\n\n }", "@Test\n public void test_kmin_String_Collection1() {\n populate_s1();\n String actual = Selector.kmin(s1, 4, new CompareStringAscending());\n String expected = \"D\";\n Assert.assertEquals(\"4th minimum not found (strings)\", expected, actual);\n }", "public void checkCapacity(String target, long size) throws Exception;", "private static boolean nameIsValid(String name) {\n if (name.length() < 4 || name.length() > 11)\n return false;\n\n for (int i = 0; i < name.length(); i++) {\n int charIndex = name.charAt(i);\n\n // Each character can only be a letter or number\n if (charIndex < 48 || (charIndex > 57 && charIndex < 65) || (charIndex > 90 && charIndex < 97) || charIndex > 122)\n return false;\n }\n\n return true;\n }", "public String generateKey(String str, String key)\n{\n int x = str.length();\n \n for (int i = 0; ; i++)\n {\n if (x == i)\n i = 0;\n if (key.length() == str.length())\n break;\n key+=(key.charAt(i));\n }\n return key;\n}", "public boolean validString(String str){\n if(!str.equals(null) && str.length() <= this.MAX_LEN){\n return true;\n }\n return false;\n }", "LengthConstraint createLengthConstraint();", "public boolean isValidKey(String key) throws Exception;", "public int minLength(String s, Set<String> dict) {\n StringBuilder sb = new StringBuilder();\n sb.append(s);\n sb.delete(sb.indexOf(s), sb.lastIndexOf(s));\n for (String st : dict) {\n s.replaceAll(st, \"\");\n }\n return 1;\n }", "static int size_of_adi(String passed){\n\t\treturn 2;\n\t}", "static String appendAndDelete(String s, String t, int k) {\n\n if(k >= s.length() + t.length()){\n return \"Yes\";\n }\n\n int pointer;\n\n int bound = Math.min(s.length(), t.length());\n\n for(pointer=0; pointer<bound; pointer++)\n {\n if(s.charAt(pointer) != t.charAt(pointer)){\n break;\n }\n }\n\n\n if(k == (s.length()-pointer + t.length()-pointer)){\n return \"Yes\";\n }else if(k > (s.length()-pointer + t.length()-pointer)){\n int left = k - s.length()-pointer + t.length()-pointer;\n if(left%2 == 0){\n return \"No\";\n }\n\n }\n\n if(s.equals(t) && (k%2==0)){\n return \"Yes\";\n }\n\n\n\n return \"No\";\n\n\n }", "protected void validateJitterUsername(final String username) {\n Assert.notNull(username, VALUE_NOT_NULL);\n Assert.isTrue((username.length() >= VALIDATION_USERNAME_SIZE_MIN) &&\n (username.length() <= VALIDATION_USERNAME_SIZE_MAX), VALIDATE_NOTE_USERNAME_SIZE);\n }", "public static String anyLenabc() {\n\t\treturn RString.ANY_LEN_abc;\n\t}", "public static void kSmallest(int l,int r,int k){\n\t\t\n if((r-l+1)>=k){\n\t\tint freq[]=new int[26];\n\t\tfor(int i=l;i<=r;i++){\n\t\t\tfreq[source.charAt(i)-97]++;\n\t\t}\n\t\t\n\t\tint sum=0;\n\n\t\tfor(int i=0;i<26;i++){\n\t\t\tif(freq[i]>0){\n\t\t\t\tsum+=freq[i];\n\t\t\t\tif(sum>=k){\n\t\t\t\t\tSystem.out.println((char)(i+97));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }else{\n \t System.out.println(\"Out of range\");\n }\n\t}", "@Test(timeout = 4000)\n public void test32() throws Throwable {\n SystemInUtil.addInputLine(\"0(u\");\n SystemInUtil.addInputLine(\"( \");\n SystemInUtil.addInputLine(\"eWEzLBT{b\");\n SystemInUtil.addInputLine(\"znot\");\n JSPredicateForm jSPredicateForm0 = new JSPredicateForm();\n jSPredicateForm0.add((Object) \"znot\");\n jSPredicateForm0.print();\n assertEquals(10, jSPredicateForm0.capacity());\n }", "private boolean validatePacket(String[] packet)throws NullPointerException\n\t{\n\n\t\tif(packet == null)\n\t\t{\n\t\t\tthrow new NullPointerException(\"Packet was null\");\n\t\t}\n\n\t\tfor(int i = 2 ; i< packet.length ; i++)\n\t\t{\n\t\t\tif(packet.length > MAX_SIZE)\n\t\t\t{\n\t\t\t\tthrow new StringIndexOutOfBoundsException(\"Message \" + (i-1)+\": \" + \"'\" + packet[i] + \"'\" + \"is to long\");\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public int longestRepeatingSubsequenceII(String str, int k) {\n HashMap<String, Integer> cache = new HashMap<>();\n\n int max = 0;\n for (int i = str.length(); 0<=i; i--) {\n for (int j = 0; j+i < str.length(); j++) {\n String sub = str.substring(j, j+i);\n int count = repeat(str, sub, k , cache);\n if (count>=k) {\n return sub.length();\n }\n }\n }\n\n return max;\n\n }", "public static void checkMinLength(String name, int minLength) throws MinSizeExceededException{\n \n if(name.length()<minLength) throw new MinSizeExceededException(\"Length of name is too short! MinLength=\" + minLength + \", ActualLength=\" + name.length());\n }", "private static void checkBounds(byte[] bytes, int offset, int length) {\n\t\tif (length < 0)\n\t\t\tthrow new StringIndexOutOfBoundsException(length);\n\t\tif (offset < 0)\n\t\t\tthrow new StringIndexOutOfBoundsException(offset);\n\t\tif (offset > bytes.length - length)\n\t\t\tthrow new StringIndexOutOfBoundsException(offset + length);\n\t}", "protected boolean isVmNameValidLength(VM vm) {\n\n // get VM name\n String vmName = vm.getvm_name();\n\n // get the max VM name (configuration parameter)\n int maxVmNameLengthWindows = Config.<Integer> GetValue(ConfigValues.MaxVmNameLengthWindows);\n int maxVmNameLengthNonWindows = Config.<Integer> GetValue(ConfigValues.MaxVmNameLengthNonWindows);\n\n // names are allowed different lengths in Windows and non-Windows OSs,\n // consider this when setting the max length.\n int maxLength = vm.getvm_os().isWindows() ? maxVmNameLengthWindows : maxVmNameLengthNonWindows;\n\n // check if name is longer than allowed name\n boolean nameLengthValid = (vmName.length() <= maxLength);\n\n // return result\n return nameLengthValid;\n }", "public static boolean minCharRequirementPassed(String toCheck, int limit) {\n if (toCheck == null) return false;\n return toCheck.length() >= limit;\n }", "public abstract boolean mo53567k(int i, int i2, String str);", "public static String anyLenABC() {\n\t\treturn RString.ANY_LEN_ABC;\n\t}", "public static void main(String[] args) throws IOException {\n BufferedReader f = new BufferedReader(new FileReader(\"whereami.in\"));\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"whereami.out\")));\n\n //reads in and initializes n and k values\n StringTokenizer st = new StringTokenizer(f.readLine());\n int stringSize = Integer.parseInt(st.nextToken());\n\n st = new StringTokenizer(f.readLine());\n //initializes variable for input string\n String string = st.nextToken();\n\n //computes all subsequences and adds to set\n subsequence(string, string.length());\n\n boolean[] checks= new boolean[stringSize];\n\n int smallestSize = 0;\n\n for (int i = 0; i < stringSize; i++) {\n checks[i] = true;\n for (String s : subSequences) {\n if (s.length() == i + 1 && numberOccurrences(string, s) != 1) {\n checks[s.length() - 1] = false;\n }\n }\n if (checks[i] == true) {\n smallestSize = i + 1;\n break;\n }\n }\n\n out.println(smallestSize);\n out.close();\n }", "static int size_of_inx(String passed){\n\t\treturn 1;\n\t}", "@Test\n public void tc_VerifyMinLengthMemorizedValue() throws Exception\n {\n EN.BeginTest( TestName );\n \n // Testscript in Schlüsselwort-Notation\n EN.SelectWindow( \"Rechner\" );\n \n // Soll/Ist-Vergleich: Ist das Richtige Fenster gesetzt?\n // Check the Name, Called Method and Value of Actuel object\n assertEquals( \"NO VALUE\", myClipBoard.getValue().get( 0 ) );\n assertEquals( 1, myClipBoard.getValue().size() );\n assertEquals( \"Rechner\", myClipBoard.getObjectName() );\n assertEquals( \"SelectWindow()\", myClipBoard.getMethod() );\n\n // Set Value in \"Memory\"\n OKW_Memorize_Sngltn.getInstance().set( \"Key1\", \"2\" );\n \n EN.SetValue( \"All_MethodsObj\", \"${Key1}\" );\n EN.VerifyMinLength( \"All_MethodsObj\", \"${Key1}\" );\n \n // Check the Name, Called Method and Value of Actuel object\n // assertEquals( \"Wert 1\", myClipBoard.getValue().get( 0 ) );\n assertEquals( 1, myClipBoard.getValue().size() );\n \n assertEquals( \"Rechner.All_MethodsObj\", myClipBoard.getObjectName() );\n assertEquals( \"VerifyMinLength()\", myClipBoard.getMethod() );\n }", "static String lexography(String s,int k) {\n\t\tString smallest=\"\";\n\t\tString largest=\"\";\n\t\tString temp=\"\";\n\t\tsmallest=largest=s.substring(0, k);\n\t\tint x;\n\t\tfor(int i=1;i<=s.length()-k;i++)\n\t\t{\n\t\t\ttemp=s.substring(i,i+k);\n\t\t\t\n\t\t\tx=temp.compareTo(smallest);\n\t\t\tif(x<0) smallest=temp;\n\t\t\tx=temp.compareTo(largest);\n\t\t\tif(x>0) largest=temp;\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t return smallest+\"\\n\"+largest;\n\t}", "@Test\n public void test_kmax_String_Collection1() {\n populate_s1();\n String actual = Selector.kmax(s1, 4, new CompareStringAscending());\n String expected = \"B\";\n Assert.assertEquals(\"4th maximum not found (strings)\", expected, actual);\n }", "private static boolean isUniqueM2(String str) {\n\n if (str.length() > 128) return false;\n\n boolean[] char_set = new boolean[128];\n for (int i = 0; i < str.length(); i++) {\n int val = str.charAt(i);\n System.out.println(\"str.charAt(i): \" + val);\n if (char_set[val]) {\n return false;\n }\n char_set[val] = true;\n }\n return true;\n }", "private boolean hasInvalidLength(final String taxId) {\n if (taxId == null || taxId.length() != EXPECTED_LEN) {\n return true;\n }\n return false;\n }", "@Test\n public void testFirstNameMinLength() {\n owner.setFirstName(\"T\");\n assertInvalid(owner, \"firstName\", \"First name must be between 2 and 20 characters\", \"T\");\n }", "public static boolean isValidNameFormat( String source )\n {\n int minNameLength = 3;\n\n return (source != null) && (source.length() >= minNameLength);\n }" ]
[ "0.645189", "0.6417806", "0.6397077", "0.6380624", "0.6368808", "0.6316062", "0.62716395", "0.60862464", "0.6066836", "0.60625803", "0.6050986", "0.60181695", "0.6015288", "0.6000637", "0.59583247", "0.59375215", "0.588191", "0.58724695", "0.5864214", "0.5840092", "0.58286476", "0.5824243", "0.58195734", "0.5786599", "0.5783196", "0.57752067", "0.57579285", "0.5729408", "0.5723433", "0.57215583", "0.5705392", "0.56670475", "0.56472254", "0.5635992", "0.5623507", "0.56148446", "0.56144875", "0.5613167", "0.55957997", "0.559132", "0.55818135", "0.5575009", "0.5554095", "0.5552888", "0.55345356", "0.55345196", "0.5530116", "0.5521983", "0.5516528", "0.55150646", "0.55138373", "0.5512603", "0.55084866", "0.5491756", "0.5485619", "0.54821604", "0.5475619", "0.54687566", "0.5448546", "0.5445647", "0.542255", "0.54193366", "0.541636", "0.54162294", "0.5416169", "0.5406629", "0.53967243", "0.53834724", "0.5380437", "0.5370377", "0.5360095", "0.5358461", "0.5352343", "0.53523046", "0.534913", "0.53483355", "0.53442043", "0.53421146", "0.5331064", "0.531089", "0.5306617", "0.53001046", "0.52961123", "0.52936244", "0.5289363", "0.5286863", "0.52829814", "0.5279783", "0.5278392", "0.5265006", "0.52643144", "0.52638745", "0.52610725", "0.5258518", "0.52526075", "0.5246602", "0.52449137", "0.52374333", "0.52370197", "0.5235007" ]
0.6239478
7
check if a job in the queue is done
boolean isDone(long number) throws NoSuchJobException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isDone();", "public boolean isDone();", "boolean isDone();", "boolean hasFinished();", "public boolean isDone(){\r\n\t\tif(worker.getState()==Thread.State.TERMINATED) return true;\r\n\t\treturn false;\r\n\t}", "public boolean isDone() { return true; }", "protected boolean isAllJobsFinished() {\r\n \tIterator<Progress> jobsIterator = JobManager.iterator();\r\n \twhile (jobsIterator.hasNext()) {\r\n \t\tProgress job = jobsIterator.next();\r\n\t\t\tif (!job.isFinished()) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n }", "boolean hasJobId();", "public boolean wasQueued() {\r\n\t\tif (wasQueued == true) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "@Override\n\tpublic boolean done() {\n\t\tfor(Task t : details.getPendingTasks()){\n\t\t\tif(!t.isComplete())\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "protected abstract long waitOnQueue();", "public boolean isFinished();", "public boolean isComplete() {\n return addedFrontWork.size() == 0 && addedBackWork.size() == 0 && sawAllDone.get();\n }", "public boolean isDone() { return false; }", "boolean isCompleted();", "public boolean checkDone() {\n return this.isDone;\n }", "boolean isFinished();", "public boolean is_completed();", "public boolean isDone() {\n\t\treturn true;\n\t}", "protected boolean isFinished() {\n\treturn this.isDone;\n }", "public final boolean isDone() {\n\t\tboolean result = true;\n\t\tfor (String mdl : executors.keySet()) {\n\t\t\tSubstructureExecutorI exe = executors.get(mdl);\n\t\t\tresult = result && exe.stepIsDone();\n\t\t}\n\t\t// final int matlabWait = 200;\n\t\t// try {\n\t\t// log.debug(\"Waiting to return\");\n\t\t// Thread.sleep(matlabWait);\n\t\t// } catch (InterruptedException e) {\n\t\t// log.debug(\"HEY who woke me up?\");\n\t\t// }\n\t\treturn result;\n\t}", "protected boolean isFinished() {\n \t// wait for a time out\n return false;\n }", "boolean isFinished() {\n if (completeCount < reserve) {\n return false;\n }\n\n // We need to check if the last entry was used\n final OutboundQueueEntry last = queue[reserve];\n return !last.isCommitted() || last.isCompleted();\n }", "Boolean isFinished();", "@Override\n public boolean isDone()\n {\n return false;\n }", "public boolean isDone()\n {\n return (this.elapsed >= this.duration);\n }", "public boolean isDone()\r\n/* 69: */ {\r\n/* 70:106 */ return isDone0(this.result);\r\n/* 71: */ }", "boolean isComplete();", "boolean isComplete();", "protected boolean isFinished() {\n \t//ends \n \treturn isTimedOut();\n }", "void isFinished();", "public boolean hasWorkToDo() {\n return !this.incUpdateQueue.isEmpty();\n }", "public boolean isComplete();", "public boolean isDone(){\n return status;\n }", "@Override\n public boolean isDone() {\n return done;\n }", "public boolean isFinished(){\n return true;\n }", "@Override\n public boolean isFinished() {\n return isDone;\n }", "@Override\n public boolean isFinished() {\n return isDone;\n }", "@Override\n public boolean isDone() {\n return false;\n }", "@Override\n\tprotected boolean isFinished() {\n\t\treturn done; \n\t}", "protected boolean isFinished() {\r\n\t\t \tboolean ans = false;\r\n\t\t \treturn ans;\r\n\t\t }", "public boolean isDone(){\n return done;\n }", "public Status waitUntilFinished();", "boolean hasIsComplete();", "boolean hasIsComplete();", "@Override\n public boolean isDone() {\n return future.isDone();\n }", "protected boolean isFinished() {\n return (System.currentTimeMillis() - startTime) >= time;\n \t//return false;\n }", "protected boolean isFinished() {\n\n \tif(weAreDoneSenor == true) {\n\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t}\n \t\n }", "public boolean isDone() {\n\t\t\n\t\treturn done;\n\t}", "synchronized public void jobDone(){ // l'action a été réalisée\n\t\tdone = true; // changement d'état\n\t\tthis.notifyAll(); // on notifie tout le monde\n\t}", "public synchronized boolean hasFinished ()\n {\n return this.finished;\n }", "protected boolean isFinished(){\r\n return true;\r\n }", "@Override\n\tpublic boolean isFinished() {\n\t\treturn (this.timeRemaining == 0);\n\t}", "protected boolean isFinished()\n\t{\n\t\treturn true;\n\t}", "boolean completed();", "protected boolean isFinished()\n\t{\n\t\treturn false;\n\t}", "@Override\n public boolean isDone() {\n return this.isDone;\n }", "@Override\n\tpublic boolean isJobRunning() {\n\t\treturn false;\n\t}", "protected boolean isFinished() {\n return true;\n }", "protected boolean isFinished() {\n return true;\n }", "protected boolean isFinished() {\n return true;\n }", "protected boolean isFinished() {\n return true;\n }", "protected boolean isFinished() {\n return true;\n }", "protected boolean isFinished() {\n return true;\n }", "protected boolean isFinished() {\n return count > maxCount;\n }", "public boolean queueFull() {\r\n\t\tif (vehiclesInQueue.size() > maxQueueSize) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean isDone() {\n return done;\n }", "public boolean isFinished() {\n return true;\n }", "public boolean inProgress(){return (this.currentTicket != null);}", "public abstract boolean isFinished ();", "protected boolean isFinished() {\n\t\treturn isTimedOut();\n\t}", "boolean getFinished();", "public abstract boolean isCompleted();", "protected boolean isFinished() {\n\t\treturn true;\n\t}", "protected boolean isFinished() {\n\t\treturn true;\n\t}", "protected boolean isFinished() {\n\t\treturn true;\n\t}", "public boolean isDone() {\n return done;\n }", "public boolean isDone() {\n return done;\n }", "protected boolean isFinished() {\n return finished;\n }", "public boolean isQueueClosed();", "protected boolean isFinished() {\n return Math.abs(pid.getError()) < 0.25;\n }", "public boolean queueEmpty() {\r\n\t\tif (vehiclesInQueue.size() == 0) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean isDone() {\r\n return isDone;\r\n }", "public boolean hasFinished()\r\n {\r\n return (timer.hasTimePassed());\r\n }", "private boolean queueFullError() {\n\t\tSystem.out.println(\"Queue Full!!!\");\n\t\treturn false;\n\t}", "protected boolean isFinished() {\r\n return isTimedOut();\r\n }", "public boolean isDone() {\n return isDone;\n }", "public boolean isDone() {\n return isDone;\n }", "public boolean isDone() {\n return isDone;\n }", "boolean hasBatchJob();", "protected boolean isFinished() {\r\n if (state == STATE_SUCCESS) {\r\n // Success\r\n return true;\r\n }\r\n if (state == STATE_FAILURE) {\r\n // Failure\r\n return true;\r\n }\r\n return false;\r\n }", "public boolean isFinished() {\n\t\tif (getRemaining() <= 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "protected boolean isFinished() {\n\t\treturn false;\r\n\t}", "protected boolean isFinished() {\n\t\treturn pid.onTarget();\n\t}", "protected boolean isFinished() {\n return this.isTimedOut();\n }", "protected boolean isFinished() {\n\t\treturn false;\n\t}", "protected boolean isFinished() {\n\t\treturn false;\n\t}", "protected boolean isFinished() {\n\t\treturn false;\n\t}", "protected boolean isFinished() {\n\t\treturn false;\n\t}", "protected boolean isFinished() {\n\t\treturn false;\n\t}" ]
[ "0.7197324", "0.7197324", "0.7139734", "0.7066612", "0.70477796", "0.6977059", "0.69692737", "0.69115436", "0.68701905", "0.68660825", "0.68528473", "0.68259215", "0.68033594", "0.6771938", "0.6706633", "0.6706187", "0.67033386", "0.6689793", "0.66837394", "0.6672949", "0.6669831", "0.66601795", "0.66529286", "0.6633478", "0.6630002", "0.6607634", "0.6601471", "0.6589414", "0.6589414", "0.65637773", "0.6562334", "0.65452856", "0.6542583", "0.65423876", "0.6531467", "0.6527104", "0.6502446", "0.6502446", "0.6493122", "0.648799", "0.6480262", "0.6479628", "0.6469509", "0.6465545", "0.6465545", "0.6440415", "0.6438213", "0.6427606", "0.64221895", "0.6421605", "0.6414194", "0.63923734", "0.63836145", "0.63802975", "0.63721275", "0.63667214", "0.6363096", "0.6353792", "0.6340521", "0.6340521", "0.6340521", "0.6340521", "0.6340521", "0.6340521", "0.6336822", "0.6334779", "0.63312095", "0.63285846", "0.6325794", "0.63229525", "0.63227564", "0.6322396", "0.6304329", "0.6303246", "0.6303246", "0.6303246", "0.6293039", "0.6293039", "0.6291824", "0.62914324", "0.6288898", "0.6283739", "0.6280798", "0.6279714", "0.6276656", "0.6276073", "0.62704974", "0.62704974", "0.62704974", "0.6268822", "0.62670046", "0.62652653", "0.6263127", "0.62607175", "0.62454665", "0.62447125", "0.62447125", "0.62447125", "0.62447125", "0.62447125" ]
0.7561757
0
Add a job to the queue
void put( long number,Future<T> t);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addJob(String name, JobInProgress job) {\n Queue<JobInProgress> queue = queues.get(name);\n if (null != queue)\n queue.addJob(job);\n }", "@Override\n public void pipeStepQueueJob(final Job job) {\n synchronized(jobs_queue) {\n pipeStepLog(\"Queuing JOB #\" + job.getId());\n jobs_queue.add(job);\n jobs_queue.notifyAll();\n }\n }", "public void submitJob(Job job) {\n\t\tthis.jobs.add(job);\n\t}", "public void addJob(Job job) {\n try {\n JobWrapper jobWrapper = new JobWrapper(agentManager, job);\n this.runningPool.execute(jobWrapper);\n JobWrapper jobWrapperRet = jobs.putIfAbsent(jobWrapper.getJob().getJobInstanceId(), jobWrapper);\n if (jobWrapperRet != null) {\n LOGGER.warn(\"{} has been added to running pool, \"\n + \"cannot be added repeatedly\", job.getJobInstanceId());\n } else {\n jobMetrics.runningJobs.incrementAndGet();\n }\n } catch (Exception rje) {\n LOGGER.debug(\"reject job {}\", job.getJobInstanceId(), rje);\n pendingJobs.putIfAbsent(job.getJobInstanceId(), job);\n }\n }", "@Override\n protected void insertJobInQueueUponArrival (final J job, final double time)\n {\n addRealJobLocal (job);\n }", "public void enqueJob(FJJob job, boolean sample) {\n if (FJSimulator.DEBUG) System.out.println(\"enqueJob(\"+job.path_log_id+\") \"+job.arrival_time);\n \n // only keep a reference to the job if the simulator tells us to\n job.setSample(sample);\n \n job_queue.add(job);\n feedWorkers(job.arrival_time);\n if (FJSimulator.DEBUG) System.out.println(\" queued a job. New queue length: \"+job_queue.size());\n }", "public void submit(final Job job, final long runAt) {\n deque.add(new DelayedJob(job, runAt));\n }", "public void submit(final Job job) {\n deque.add(new DelayedJob(job, System.nanoTime()));\n }", "@Override\n\tpublic void addToQueue() {\n\t}", "@Override\n\tpublic void addTask(ISimpleTask task) {\n\t\ttry {\n\t\t\tqueue.put(task);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "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 }", "public void addToQueue(Unit unit) {\n if (units.size() < maxStock) {\n endTime = System.currentTimeMillis() + unit.getBuildTime();\n units.add(unit);\n }\n }", "final static void addJob(BatchJob<?> job) {\n\t\tif(job == null) {\n\t\t\tthrow new IllegalArgumentException(\"Job cannot be null\");\n\t\t}\n\t\t\n\t\tBatchCentral.ALL_BATCH_JOBS.add(job);\n\t}", "void addToQueue(WebhookMessage msg);", "private void addCommandToQueue(CancellableCommand command) {\n outstandingRequests.add(command);\n while (outstandingRequests.size() > maxOutstandingRequests) {\n outstandingRequests.poll().onCancelled();\n }\n }", "public void addDiskJob(DiskJob task) {\n\t\tioManager.addTask(task);\n\t}", "protected static Future<Job> checkAndAddJobToQueueFuture(Marker marker, Job job, HApiParam.HQuery.Command command){\n\n return checkRunningImportJobs(marker, job, command)\n .compose( runningJobs -> {\n if(runningJobs == null){\n CService.importQueue.addJob(job);\n return Future.succeededFuture(job);\n }else{\n return Future.failedFuture(new HttpException(CONFLICT, \"Job '\"+runningJobs+\"' is already running on target!\"));\n }\n });\n }", "public void enqueue(Message msg){\n\t\tqueue.add(msg);\n\t}", "private void queueTask(Version theTask) {\n\tsynchronized(_taskQueue) {\n\t _taskQueue.add(theTask);\n\t}\n }", "public void invokeLater(Runnable task) {\n queue.add(task);\n }", "public void addQueuedObject(Obstacle obj) {\n\t\tassert inBounds(obj) : \"Object is not in bounds\";\n\t\taddQueue.add(obj);\n\t}", "public void add(String name, Runnable runnable, int seconds) {\n Job job = new Job(name, runnable, seconds);\n jobs.put(name, job);\n job.setRunNow();\n jobQueue.add(job);\n }", "public synchronized void enqueue(Object msg) {\n\t\tqueue.add(msg);\n\n\t\t// if any threads wait on empty queue then wake them up\n\t\tnotifyAll();\n\t}", "public void addItem(QueueItem item) {\n qItems.add(item);\n\n //long previousItemSize=item.getSize();\n long previousItemSize = ((QueueItem) qItems.lastElement()).getSize();\n long rate = calculateDelay(item.getSize());\n QueueWorkerThread worker = new QueueWorkerThread(getContext(), item);\n\n synchronized (fileGroupToItemMap) {\n fileGroupToItemMap.put(item.getName(), worker);\n }\n\n if (qItems.size() == 1) {\n Debug.log(\n this,\n \"CollabQueue, item: \" + item.getName() + //NoI18n\t\n \" scheduling with nodelay and with rate: \" + rate\n ); //NoI18n\t\t\t\t\n worker.scheduleAtFixedRate(0, rate);\n } else {\n long delay = calculateDelay(previousItemSize);\n Debug.log(\n this,\n \"CollabQueue, item: \" + item.getName() + //NoI18n\n \" scheduling for: \" + delay + \" with rate: \" + rate\n ); //NoI18n\t\t\t\n worker.scheduleAtFixedRate(delay, rate);\n }\n }", "boolean addJob(PrintJob job);", "public synchronized void enqueue(Task task) {\n tasks.add(task);\n }", "public void addJob(Process p) \n {\n \tif(p != null)\n \t\tprocesses.add(p);\n }", "public void addIntoQueue(Integer block_id){\n if(this.queue_set){\n if(this.queue.contains(block_id) == false){\n this.queue.add(block_id);\n }\n }\n }", "public void add(Object element) {\n queue.put( new DelayedElement( element ) );\n }", "@Override\n public synchronized JobStatus submitJob(JobID jobid, JobConf jobConf) throws IOException {\n if(jobTable.containsKey(jobid)){\n return jobTable.get(jobid).getStatus();\n }\n JobInProgress job = new JobInProgress(jobid, this, jobConf);\n \n //TODO: need to check Queue later\n if(!jobQueue.offer(job)){\n LOG.info(\"submitJob: Cannot enqueue the job\");\n return null;\n }\n \n return addJob(jobid, job);\n \n }", "@Override\n protected void insertJobInQueueUponStart (final J job, final double time)\n {\n if (job == null)\n throw new IllegalArgumentException ();\n if ((! isJob (job)) || isJobInServiceArea (job))\n throw new IllegalArgumentException ();\n getDelegateJob (job); // Sanity on existence of delegate job.\n }", "public void queueMessage(ByteBuffer bb) {\n\t\tqueue.add(bb);\n\t\tprocessOut();\n\t\tupdateInterestOps();\n\t}", "public synchronized void enqueue(T thing) {\r\n\t\twhile (queue.size()==maxSize){\r\n\t\t\ttry{\r\n\t\t\t\tthis.wait();\r\n\t\t\t} catch(InterruptedException e){\r\n\t\t\t\tSystem.out.println(\"Interruption during enqueue\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tqueue.addLast(thing);\r\n\t\tthis.notifyAll();\r\n\t}", "public void addJob(String jobID, String jobTitle, String jobType,\n String salary, String jobDescription, String expirationDate,\n String contactEmail) {\n //Will check if the amount is less than 100 jobs added\n //then Will add the job to the end of the arrayList\n //will return true if added else return false\n currentJob = new Job(contactEmail, jobType, jobID, jobDescription, salary, jobTitle, expirationDate);\n if(jobs.size() <= 100)\n {\n jobs.add(currentJob);\n String success = String.format(\"================JOB POSTING SUCCESS================\\n\" +\n \"A new job has been posted with following details:\\n\" +\n \"Job ID: %s\\n\" +\n \"Job Name: %s\\n\" +\n \"Job Type: %s\\n\" +\n \"Salary: %s\\n\" +\n \"Job Description: %s\\n\" +\n \"Expiration Date: %s\\n\" +\n \"Contact email: %s\\n\", jobID, jobTitle, jobType, salary, jobDescription, expirationDate, contactEmail);\n\n System.out.println(success);\n } else {\n String success = String.format(\"================JOB POSTING FAILURE ================\\n\" +\n \"THERE ARE MORE THAN 100 JOBS IN THE SYSTEM:\\n\");\n System.out.println(success);\n }\n }", "public void enqueue ()\n {\n count++;\n questionList.add(newQuestion);\n //System.out.println(\"Question #\"+ totNumQ + \" is added to the queue.\");\n }", "public void queueMessage(ByteBuffer bb) {\n queue.add(bb);\n processOut();\n updateInterestOps();\n }", "public void addDependentJob(IJob job);", "public void addToQueue(LuceneAction action, Document document) throws Exception {\n\t\tqueue.offer(new LuceneQueueObject(action, document));\n\t\tlogger.trace(\"Added document to queue, current queue size: \" + queue.size());\n\n\t\t// queue is getting full before the regular run() is running.\n\t\tif (queue.size() >= MAXQUEUESIZE ) {\n\t\t\tlogger.error(\"Queue overflow. Can cause memory errors. Queue size = \" + queue.size());\n\t\t\tthrow new Exception(\"Queue overflow. Can cause memory errors. Queue size = \" + queue.size());\n\t\t}\n\t\tif (queue.size() >= batchSize) {\n\t\t\tlogger.trace(\"Start processing based on size\");\n\t\t\trunIndexer();\n\t\t}\n\t}", "public void addCommand(CommandInfo command) {\n\t\ttry {\n\t\t\tcommandsQueue.put(command);\n\t\t} catch(InterruptedException exception) {\n\t\t\texception.printStackTrace();\n\t\t}\n\t}", "void addCommand(final Runnable command)\n {\n synchronized (command_queue)\n {\n // New maximum queue length (+1 for the one about to get added)\n if (command_queue.size() >= max_size_reached)\n max_size_reached = command_queue.size() + 1;\n command_queue.addLast(command);\n }\n }", "private void add(Pair<MarketDataRequestAtom,Event> inData)\n {\n getQueue().add(inData);\n }", "void enqueue(E newEntry);", "public void addToQueue(String path) {\n ArrayList<String> temp = Global.uploadMetaData;\n\n boolean inQueue = checkInQueue(path, temp);\n\n if (!inQueue) {\n temp.add(path);\n }\n\n Global.uploadMetaData = temp;\n }", "public boolean addToSortedQueue(ArrayList<Integer> job) throws RemoteException;", "@Override\n public CompletableFuture<Void> addTask(String queueName, GarbageCollector.TaskInfo task) {\n Preconditions.checkNotNull(queueName, \"queueName\");\n Preconditions.checkNotNull(task, \"task\");\n try {\n val processor = eventProcessorMap.get(queueName);\n Preconditions.checkArgument(null != processor, \"Attempt to add to non existent queue (%s).\", queueName);\n return Futures.toVoid(processor.add(SERIALIZER.serialize(task), Duration.ofMillis(1000)));\n } catch (Throwable e) {\n return CompletableFuture.failedFuture(e);\n }\n }", "public void add(String name, Runnable runnable, int seconds, Date nextRun) {\n Job job = new Job(name, runnable, seconds);\n jobs.put(name, job);\n job.setRunNow();\n jobQueue.add(job);\n }", "public void addJobToWaitingList(CommonCommand newJob) {\n \t\tif (null != localMonitor)\n \t\t\tlocalMonitor.newJobToWaitingList(newJob);\n \t}", "public static void writeNewJob(Job job) {\n DatabaseReference database = FirebaseDatabase.getInstance().getReference();\n database.child(\"jobs\").push().setValue(job);\n }", "public void enqueue(E e) {\n\t\tlist.addLast(e);\n\t}", "public void addJob(Class<? extends Job> jobClass) {\n CronExp cronExp = (CronExp) jobClass.getAnnotation(CronExp.class);\n addJob(cronExp.value(), jobClass);\n }", "private void addNewFinishedJobItem(Job job) {\n FinishedJobItemView finishedJobItemView = new FinishedJobItemView(this, job);\n finishedJobItemViews.add(finishedJobItemView);\n finishedJobsLinearLayout.addView(finishedJobItemView);\n }", "public void add(IEvent event){\r\n\t\tqueue.add(event);\r\n\t}", "public void addPlayer(HeroClass newJob){job.add(newJob);}", "public void enqueue(E item) {\n addLast(item);\n }", "public <T> void addToRequestQueue(Request<T> request) {\n getRequestQueue().add(request); // Add the specified request to the request queue\n }", "public void enqueue(String message) {\n\t\tqueue.add (message);\n\t}", "public void enqueue(Object o) {\n queue.enqueue(o);\n }", "public <T> void addToRequestQueue(Request<T> req, String tag) {\n req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);\n req.setRetryPolicy(new DefaultRetryPolicy(20 * 1000, 0,\n DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));\n\n getRequestQueue().add(req);\n }", "public <T> void addToRequestQueue(Request<T> req, String tag) {\n req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);\n req.setRetryPolicy(new DefaultRetryPolicy(5000, 2, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));\n getRequestQueue().add(req);\n }", "public void add(Object o) {\n Logger.log(\"DEBUG\", \"Data to add to queue: \" + o.toString());\n while(isLocked()) {\n try {\n Thread.sleep(10);\n }\n catch(InterruptedException ie) {\n // do nothing\n }\n }\n addToTail(o);\n LAST_WRITE_TIME = now();\n }", "public <T> void addToRequestQueue(Request<T> req, String tag) {\n // set the default tag if tag is empty\n req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);\n\n VolleyLog.d(\"Adding request to queue: %s\", req.getUrl());\n\n getRequestQueue().add(req);\n }", "public void append(Serializable message){\n taskQueue.addLast(message);\n unlockWaiter();//unblocks for taskQueue\n unlockPoolWaiter();//unblocks for threadPool\n }", "public void add(Square s) {\n\t\tqueue.enqueue(s);\n\t}", "public <T> void addToRequestQueue(Request<T> req, String tag) {\n req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);\n req.setRetryPolicy(new DefaultRetryPolicy(90 * 1000, 0, 1.0f));\n getRequestQueue().add(req);\n }", "public void addQ (Question Q)\n {\n newQuestion = Q;\n \n enqueue();\n }", "public void addNewJob(String jobId, String shipTo, String shipperContact, String paymentDue){\n JobInfo job = new JobInfo(shipTo,\n shipperContact,\n paymentDue,\n address,\n String.valueOf(latitude),\n String.valueOf(longitude));\n Map<String, Object> postValues = job.toMap();\n Map<String, Object> childUpdates = new HashMap<>();\n childUpdates.put(\"deliverybot/jobs/\" + jobId + \"/info\", postValues);\n firebaseDatabaseReference.updateChildren(childUpdates);\n\n if (selectedDriver.isEmpty())\n firebaseDatabaseReference.child(\"deliverybot/jobs/\" + jobId + \"/status\").setValue(\"Unassigned\");\n else\n firebaseDatabaseReference.child(\"deliverybot/jobs/\" + jobId + \"/status\").setValue(\"Assigned\");\n firebaseDatabaseReference.child(\"deliverybot/jobs/\" + jobId + \"/driver\").setValue(selectedDriver);\n\n // Add route information to firebase\n Route route = new Route(address,\n String.valueOf(latitude),\n String.valueOf(longitude),\n selectedDriver);\n Map<String, Object> postRouteUpdate = route.toMap();\n Map<String, Object> routeChildUpdates = new HashMap<>();\n routeChildUpdates.put(\"deliverybot/routes/\" + jobId, postRouteUpdate);\n firebaseDatabaseReference.updateChildren(routeChildUpdates);\n String toastMessage = getResources().getString(R.string.job_creation_toast);\n Toast.makeText(getApplicationContext(), toastMessage, Toast.LENGTH_LONG).show();\n finish();\n }", "public void enqueue(E element) {\n\t\tadd(element);\n\t}", "void enqueue(E item);", "public void attachJob(Job job) {\n\t\tthis.job = job.copy();\n\t}", "public void moveJob(String from, String to, JobInProgress job) {\n synchronized (queues) {\n removeJob(from, job);\n addJob(to, job);\n }\n }", "public OneTimeJob(BlockingQueue<?> queue, BlockingQueue<Results> results){\n \tthis.queue = queue;\n //System.out.println(\"OneTimeJob thread with ID = \n\t\t//\t\t\t\" + this.getId() + \" has been started!\");\n this.results = results;\n }", "public void add(Runnable task) {\n synchronized (mComIOQueue) {\n mComIOQueue.add(task);\n mComIOQueue.notify();\n }\n }", "public void enqueue (E element);", "public void enqueue(E e) {\n\t\t\tsynchronized (this.pq) {\n\t\t\t\tthis.pq.add(e);\n//\t\t\t\tSystem.out.println(\"insert \" + e);\n\t\t\t}\n\t\t\tthis.sem.release();\n\t}", "void enqueue(T item) {\n contents.addAtTail(item);\n }", "private void addMessageToQueue( byte[] buffer ){\n \tsynchronized (this.messages) {\n byte message[] = new byte[buffer.length\n - Constants.MESSAGE_ID_LEN - 1];\n for (int i = Constants.MESSAGE_ID_LEN + 1; i < buffer.length; i++) {\n message[i - Constants.MESSAGE_ID_LEN - 1] = buffer[i];\n }\n messages.add(message);\n }\n }", "public <T> void addToRequestQueue(Request<T> req, String tag) {\n\t\treq.setTag(TextUtils.isEmpty(tag) ? TAG : tag);\n\t\tgetRequestQueue().add(req);\n\t}", "public <T> void addToRequestQueue(Request<T> req, String tag) {\n\t\treq.setTag(TextUtils.isEmpty(tag) ? TAG : tag);\n\t\tgetRequestQueue().add(req);\n\t}", "public void enqueue(Person person) {\r\n saf.add(person);\r\n }", "public void submit(final Job job, final long delay, final TimeUnit unit) {\n final long runAt = System.nanoTime()\n + TimeUnit.NANOSECONDS.convert(delay, unit);\n deque.add(new DelayedJob(job, runAt));\n }", "public <T> void addToRequestQueue(Request<T> req, String tag) {\n req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);\n getRequestQueue().add(req);\n }", "public <T> void addToRequestQueue(Request<T> req, String tag) {\n req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);\n getRequestQueue().add(req);\n }", "public <T> void addToRequestQueue(Request<T> req, String tag) {\n req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);\n getRequestQueue().add(req);\n }", "public <T> void addToRequestQueue(Request<T> req, String tag) {\n req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);\n getRequestQueue().add(req);\n }", "public void addRequest(T request) {\n\t\tinputQueue.add(request);\n\t}", "public static void enqueue(Object object) {\n queue.addLast(object);\n }", "public boolean enqueue(QueueUrl q){\n\t\treturn this.queues.get(getPriority(q)).enqueue(q);\n\t}", "public <T> void addToRequestQueue(Request<T> req, String tag) {\n // set the default tag if tag is empty\n req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);\n getRequestQueue().add(req);\n }", "public <T> void addToRequestQueue(Request<T> req, String tag) {\r\n // set the default tag if tag is empty\r\n req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);\r\n getRequestQueue().add(req);\r\n }", "void enqueue(String object);", "public void push(final String queueName, final String item);", "public static synchronized void insert(JeyEvent e) {\n queue.addLast(e);\r\n EventQueue.class.notifyAll();\r\n }", "public void queueMessage(Message message);", "void enqueue(E e);", "private boolean addJob(DownloadJob downloadJob) {\n\t\tboolean contain = false;\n\t\tif (jobs != null) {\n\t\t\tString id = downloadJob.getJobId();\n\t\t\tfor (DownloadJob job : jobs) {\n\t\t\t\tif (id.equals(job.getJobId())) {\n\t\t\t\t\tcontain = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!contain) {\n\t\t\t\tjobs.add(0, downloadJob);\n\t\t\t}\n\t\t} else {\n\t\t\tjobs = new ArrayList<DownloadJob>();\n\t\t\tjobs.add(downloadJob);\n\t\t\tcontain = false;\n\t\t}\n\n\t\treturn !contain;\n\t}", "String addJob(final Job job,\n final boolean simulate) {\n String token = null;\n synchronized (this.queue) {\n for (JobExecutionData data : this.queue) {\n if (data.getJob().equals(job) && data.getSimulate() == simulate) {\n throw new IllegalStateException(\"Job '\" + job.getClass().getName()\n + \"' is already in queue for execution.\");\n }\n }\n if (null != this.currentRunning && this.currentRunning.job.equals(job)\n && this.currentRunning.getSimulate() == simulate) {\n throw new IllegalStateException(\"Job '\" + job.getClass().getName()\n + \"' is already in queue for execution.\");\n }\n token = JobTokenUtil.getInstance().createToken(job, this.systemInfo, simulate);\n this.queue.offer(new JobExecutionData(job, simulate, token));\n }\n return token;\n }", "public void add(E element){\n\t\tArrayQueue<E> temp = new ArrayQueue<E>();\n\t\ttemp.enqueue(element);\n\t\tQ.enqueue(temp);\n\t}", "@Override\n\tpublic void run() {\n\t\tlong starttime = System.currentTimeMillis();\n\n\t\tboolean started = statusMap.get(type);\n\t\tif (!started) {\n\n\t\t\tstatusMap.put(type, true);\n\t\t\tlogger.info(\n\t\t\t\t\t\"task of id add to queue of busType : {} started,current milestone : {}\",\n\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type), milestone);\n\t\t\ttry {\n\t\t\t\tIdGeneratorQueue queue = QueueUtil\n\t\t\t\t\t\t.getIdGeneratorQueue(AptConstants.BUS_NAME_MAP.get(type));\n\n\t\t\t\tif (null == queue) {\n\t\t\t\t\tlogger.error(\n\t\t\t\t\t\t\t\"task of add id to queue faile , no queue of name: {} finded\",\n\t\t\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlogger.info(\"queue : {} has {} id not uesed.\", queue.getSize());\n\t\t\t\tlong nextMilestone = generatorService.nextMilestone(type);\n\t\t\t\tlogger.info(\"task of add id to queue,nextMilestone is {}\", nextMilestone);\n\n\t\t\t\tif (nextMilestone <= milestone) {\n\t\t\t\t\tlogger.error(\n\t\t\t\t\t\t\t\"task of get next milestone error,nextMileStone is smaller, busType: {},miletone : {}\",\n\t\t\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type), milestone);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlong start = milestone + 1;\n\t\t\t\tlong end = nextMilestone + 1;\n\n\t\t\t\tlogger.info(\"start add id to queue : {},start : {},end : {}\",\n\t\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type), start, end);\n\t\t\t\tqueue.setMileStone(nextMilestone);\n\t\t\t\t//填充数据 满等待\n\t\t\t\tfor (long i = start; i <= end; i++) {\n\t\t\t\t\tqueue.putId(i);\n\t\t\t\t}\n\t\t\t\tlogger.info(\"success add id to queue! busType : {}\",\n\t\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type));\n\t\t\t\tstatusMap.put(type, false);\n\n\t\t\t} catch (Exception e) {\n\t\t\t\tlogger.error(\"task of id add to queue of busType : {} failed \",\n\t\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type));\n\t\t\t\tlogger.error(\"\", e);\n\t\t\t}\n\t\t}\n\t\tlong endtime = System.currentTimeMillis();\n\n\t\tlogger.info(\"task off add to queue ended,busType : {},usetime : {}\",\n\t\t\t\tAptConstants.BUS_NAME_MAP.get(type), endtime - starttime);\n\t}", "private void push(GameAction action) {\n this.queue.add(action);\n }", "private void scheduleJob() {\n\n }", "private void workOnQueue() {\n }" ]
[ "0.77380764", "0.7626499", "0.7376506", "0.71404994", "0.7068605", "0.6992445", "0.68056065", "0.6755601", "0.66199696", "0.65960467", "0.6568895", "0.6478909", "0.6440794", "0.6440387", "0.633042", "0.6328836", "0.6320404", "0.6285971", "0.6261707", "0.6183698", "0.6162745", "0.61547804", "0.6148891", "0.61440283", "0.6137104", "0.61312824", "0.61286825", "0.6104533", "0.60928446", "0.60899174", "0.608549", "0.6081825", "0.60671633", "0.6049284", "0.60394675", "0.6036313", "0.6014136", "0.6000674", "0.5996254", "0.59959984", "0.5959805", "0.5953266", "0.5936944", "0.5927531", "0.5925049", "0.5915654", "0.591129", "0.5908976", "0.5895778", "0.5882171", "0.5882118", "0.5880517", "0.58734137", "0.5872602", "0.58725876", "0.5871708", "0.5863582", "0.5860384", "0.58587587", "0.5855611", "0.58537185", "0.58509606", "0.5844624", "0.58348", "0.5832386", "0.58246565", "0.58235407", "0.5808184", "0.5796525", "0.57932067", "0.5782304", "0.5758141", "0.5757813", "0.5739011", "0.57310236", "0.5730334", "0.572729", "0.572729", "0.5715817", "0.56949997", "0.56849146", "0.56849146", "0.56849146", "0.56849146", "0.56793076", "0.56773955", "0.56562734", "0.56439304", "0.564247", "0.5639739", "0.5635759", "0.5618327", "0.5601834", "0.55952525", "0.5591938", "0.55783796", "0.5575557", "0.5573602", "0.557355", "0.5570946", "0.55706584" ]
0.0
-1
Return the amount of jobs remaining in the queue
int remains();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public int queueLength() {\n return this.job_queue.size();\n }", "public int queueSize() {\n\t\treturn queue.size();\t\n\t}", "public int queueSize() {\n return executor.getQueue().size();\n }", "public int size(){\r\n\t\treturn queue.size();\r\n\t}", "long getExcutorTasksInWorkQueueCount();", "public int size() {\n return this.queue.size();\n }", "public int size() {\n return _queue.size();\n }", "public int size() {\n return queue.size();\n }", "public int size() {\n\t\treturn queue.size();\n\t}", "public long getQueueSize(){\n return queue.size();\n }", "public int getCount() {\n return queue.size();\n }", "int getQueueSize();", "public int UnassignedCount() {\n \t\treturn jobqueue.size();\n \t}", "public int getQueueSize() {\n return queue.getQueueSize();\n }", "public int getQueueSize() {\r\n\t\treturn this.queue.size();\r\n\t}", "int getJobsCount();", "int getJobsCount();", "int getJobsCount();", "public int size() {\n processQueue();\n return weakCache.size();\n }", "public int getRunnableCount() {\n return queue.size();\n }", "public int size()\n\t{\n\t\treturn requestQueue != null ? requestQueue.size() : 0;\n\t}", "public static int totalWait(Queue Storage, int m){\n\t\tint wait = 0;\n\t\tfor(int i = 0; i<m; i++){\n\t\t\tJob temp = (Job)Storage.dequeue();\n\t\t\twait += temp.getWaitTime();\n\t\t\tStorage.enqueue(temp);\n\t\t}\n\t\treturn wait;\n\t}", "public static int size() {\n System.out.println();\n System.out.println(\"The size of the queue is: \" + queue.size());\t \n return queue.size();\n }", "long countJobs();", "public int remainingCapacity() throws QueueException\r\n {\r\n if(measurementQueue==null) throw new QueueException(\"CINCAMIMIS Queue not found\");\r\n \r\n return measurementQueue.remainingCapacity();\r\n }", "public abstract int getQueueLength();", "final int getQueueSize() {\n // suppress momentarily negative values\n return Math.max(0, sp - base);\n }", "public int getJobsCount() {\n return jobs_.size();\n }", "public int CompletedCount() {\n \t\treturn jobcomplete.size();\n \t}", "public java.lang.Integer getJobsInQueue() {\n return jobsInQueue;\n }", "public int numVehiclesInQueue() {\r\n\t\treturn vehiclesInQueue.size();\r\n\t}", "public int getOutgoingQueueSize();", "public int numberOfRequestsEnqueued() {\n int totalRequests = 0;\n for (ElevatorController controller : elevatorControllers.values()) {\n totalRequests += controller.getRequestsQueue().size();\n }\n return totalRequests;\n }", "int getNumBufferedBytes() {\n ChannelBuffer buf;\n int IOQueued;\n for (IOQueued = 0, buf = inQueueHead;\n buf != null; buf = buf.next) {\n IOQueued += buf.nextAdded - buf.nextRemoved;\n }\n return IOQueued;\n }", "Integer backlogCapacity();", "public int size() \r\n {\r\n if(measurementQueue==null) return 0;\r\n \r\n return measurementQueue.size();\r\n }", "public int queue() \n { return waiting; }", "public int getJobsCount() {\n if (jobsBuilder_ == null) {\n return jobs_.size();\n } else {\n return jobsBuilder_.getCount();\n }\n }", "public long getPendingMessageCount() {\n return (long) this.incUpdateQueue.size();\n }", "public void incTotalOfQueueEntries() {\n totalOfQueueEntries++;\n }", "public synchronized int getSize() {\r\n\t\treturn queueManagers.size();\r\n\t}", "public long getPendingTasks()\n {\n return getTaskCount() - getCompletedTaskCount();\n }", "@Override\n public int getJobCount () {\n return pool.getJobCount();\n }", "public int numberOfPendingTasks() {\n return allBatchesStream().mapToInt(Batch::getPendingCount).sum();\n }", "protected int numberRemainingTickets()\n\t{\n\t\treturn tickets.size();\n\t}", "public static int getPendingRequests() {\n\t\treturn writeQueue.size() + requestsBeingSending.intValue();\n\t}", "int getEnqueuedBlockRequestsNumber() {\n int count = 0;\n for (StdPeerMessage pm : sendQueue) {\n if (pm.type == StdPeerMessage.REQUEST) {\n count++;\n }\n }\n return count;\n }", "public int inputQueueSize() {\n\t\tsynchronized (inputQueue) {\n\t\t\treturn inputQueue.size();\n\t\t}\n\t}", "int remaining();", "public int getRemaining(){\n\t\treturn count+1;\n\t}", "public int getNumQueues() {\n return queues.size();\n }", "int getNumBarriers() {\n return queue.size();\n }", "public int getTotalWait() {\n return totalWait;\n }", "public int getTotalWorkerCount() {\n return this.workerCount;\n }", "int getUserQuestJobsCount();", "int getNumEvents() {\n int cnt = eventCount;\n for (Entry entry : queue) {\n cnt += entry.eventCount;\n }\n return cnt;\n }", "public long getRemainingEstimate() {\n return addedFrontWork.size() + addedBackWork.size();\n }", "@Nonnegative\n @CheckReturnValue\n public abstract int getRemainingRequests();", "public Long remaining() {\n return this.remaining;\n }", "private int getTotalNumberOfJobs() {\r\n\t\tlog.info(\"Searching for all jobs ...\");\r\n\t\tlog.info(\" \");\r\n\r\n\t\tint jobs = 0;\r\n\t\tConnection conn = null;\r\n\t\tStatement stmt = null;\r\n\t\tResultSet rs = null;\r\n\t\tString qs = \"select count(*) from batchjobinstance where startDateTime > now() + interval -1 day\";\r\n\t\ttry {\r\n\t\t\tconn = dataSource.getConnection();\r\n\t\t\tstmt = conn.createStatement();\r\n\t\t\trs = stmt.executeQuery(qs);\r\n\t\t\tif (rs.next()) {\r\n\t\t\t\tjobs = rs.getInt(1);\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\tlog.error(\"Exception encountered while attempting to retrieve all jobs: \" + e.toString() + \"; \" + e.getMessage(), e);\r\n\t\t\tlog.error(\"SQL statement: \" + qs);\r\n\t\t} finally {\r\n\t\t\tif (rs != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\trs.close();\r\n\t\t\t\t} catch (SQLException sqle) {\r\n\t\t\t\t\tlog.error(\"SQL error on rs.close(): \" + sqle.toString() + \"; \" + sqle.getMessage(), sqle);\r\n\t\t\t\t}\r\n\t\t\t\trs = null;\r\n\t\t\t}\r\n\t\t\tif (stmt != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tstmt.close();\r\n\t\t\t\t} catch (SQLException sqle) {\r\n\t\t\t\t\tlog.error(\"SQL error on stmt.close(): \" + sqle.toString() + \"; \" + sqle.getMessage(), sqle);\r\n\t\t\t\t}\r\n\t\t\t\tstmt = null;\r\n\t\t\t}\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 sqle) {\r\n\t\t\t\t\tlog.error(\"SQL error on conn.close(): : \" + sqle.toString() + \"; \" + sqle.getMessage(), sqle);\r\n\t\t\t\t}\r\n\t\t\t\tconn = null;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlog.info(jobs + \" job(s) found\");\r\n\t\tlog.info(\" \");\r\n\r\n\t\treturn jobs;\r\n\t}", "@Override\n public int getMaxJobsPerAcquisition() {\n return myMaxJobsPerAcquisition;\n }", "public long getRemaining() {\n\t\treturn disk_mgr.getRemaining();\n\t}", "public int size()\n {\n return tasks.size();\n }", "public int getSize() {\n return tasks.size();\n }", "public int queueArrayLength(){\n\t\treturn queueArray.length;\n\t}", "int numberOfWorkingWorkers();", "public int waitForMessages() throws InterruptedException {\n return waitForMessages(40, null);\n }", "public long getRemainingWork(FieldContext fieldContext) {\n\t\treturn 0;\n\t}", "long getConsumedWorkUnits();", "public int getUserQuestJobsCount() {\n return userQuestJobs_.size();\n }", "public Integer getWorkSize(){\r\n\t\treturn work.size();\t\t\r\n\t}", "protected abstract long waitOnQueue();", "private int jobLength(){\n LocalDate completedLocalDate = LocalDate.of(this.dateCompleted.getYear(), \n this.dateCompleted.getMonth(), this.dateCompleted.getDay());\n \n LocalDate startedLocalDate = LocalDate.of(this.dateStarted.getYear(), \n this.dateStarted.getMonth(), this.dateStarted.getDay());\n \n return startedLocalDate.until(completedLocalDate).getDays();\n }", "public int size()\n\t{\n\t\tif(isEmpty())\n\t\t\treturn 0;\n\t\tif(isFull())\n\t\t\treturn queueArray.length;\n\t\t\n\t\tint i=front;\n\t\tint sz=0;\n\t\tif(front<=rear)\n\t\t\twhile(i<=rear)\n\t\t\t{\n\t\t\t\tsz++;\n\t\t\t\ti++;\n\t\t\t}\n\t\telse\n\t\t{\n\t\t\twhile(i<=queueArray.length-1)\n\t\t\t{\n\t\t\t\tsz++;\n\t\t\t\ti++;\n\t\t\t}\n\t\t\ti=0;\n\t\t\twhile(i<=rear)\n\t\t\t{\n\t\t\t\tsz++;\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\treturn sz;\n\t}", "public int getSize() {\n return this.tasks.size();\n }", "public int getCachedTasksSize() {\n return cachedTasks.size();\n }", "public int getUserQuestJobsCount() {\n if (userQuestJobsBuilder_ == null) {\n return userQuestJobs_.size();\n } else {\n return userQuestJobsBuilder_.getCount();\n }\n }", "long getExecutorCompletedTaskCount();", "public int getDequeueCount() {\n\t\treturn m_DequeueCount;\n\t}", "long getWriterQueueLength();", "Long getRunningCount();", "int getProgressCount();", "int getProgressCount();", "int getProgressCount();", "public int getScheduledMessageCount() throws Exception\n {\n return destination.queue.getScheduledMessageCount();\n }", "public static int maxWait(Queue Storage, int m){\n\t\tint wait = 0;\n\t\tfor(int i = 0; i<m; i++){\n\t\t\tJob temp = (Job)Storage.dequeue();\n\t\t\tif(wait < temp.getWaitTime()) wait = temp.getWaitTime();\n\t\t\tStorage.enqueue(temp);\n\t\t}\n\t\treturn wait;\n\t}", "public long getCompletedTasks()\n {\n return getCompletedTaskCount();\n }", "protected long getLiveSetSize() {\n\t\t// Sum of bytes removed from the containers.\n\t\tlong removed = 0;\n\n\t\tfor (int i = 0; i < sets.length; i++)\n\t\t\tremoved += sets[i].getContainer().getBytesRemoved();\n\n\t\t/*\n\t\t * The total number of butes still alive is the throughput minus the number of\n\t\t * bytes either removed from the container or never added in the first place.\n\t\t */\n\t\tlong size = getThroughput() - removed - producerThreadPool.getBytesNeverAdded();\n\n\t\treturn (size > 0) ? size : 0;\n\t}", "@Override\n\tpublic int remainingCapacity() {\n\t\treturn 0;\n\t}", "int numberOfWorkers();", "int numOfRemainingBlocks() {\n return blocks.size();\n }", "public int getRemainingPcs()\n\t{\n\t\treturn pieces.length - existing.cardinality();\n\t}", "public int getAvailableCount();", "public boolean isAvailable(){\r\n return blockingQueue.size() < maxWorkQueueSize;\r\n }", "public java.lang.Integer getJobsRunning() {\n return jobsRunning;\n }", "public int size() {\n\t\t//Because we're the only consumer, we know nothing will be removed while\n\t\t//we're computing the size, so we know there are at least (rear - front)\n\t\t//elements already added.\n\t\treturn (int)(rear.get() - front.get());\n\t}", "int getDeliveredCount();", "public int getRemainingBeanCount() {\n\t\t// TODO: Implement\n\t\t// System.out.println(\"remainig size: \" + remainingBeans.size());\n\t\treturn remainingBeans.size();\n\t}", "public void refreshQueueCount(){\n queueCountLabel.setText(\"Count: \" + String.valueOf(builder.size()));\n }", "public int remaining() {\r\n\t\treturn limit - cursor;\r\n\t}", "public int getRemainingCapacity() { // get the remaining capacity\n\t\treturn maximumCapacity - cargoCapacity;\n\t}" ]
[ "0.78045654", "0.7508764", "0.74538493", "0.7450142", "0.7441278", "0.74403083", "0.74009204", "0.7373301", "0.736181", "0.73556846", "0.7330397", "0.73235035", "0.7297441", "0.7258423", "0.7170157", "0.71541256", "0.71541256", "0.71541256", "0.7153289", "0.707045", "0.70510876", "0.7042119", "0.7017983", "0.6960266", "0.69222057", "0.6891474", "0.68788713", "0.68774784", "0.6857394", "0.68448305", "0.6814077", "0.67816395", "0.6769489", "0.6768613", "0.67650425", "0.6763047", "0.6727368", "0.670332", "0.66766346", "0.6674087", "0.66662604", "0.6648429", "0.66097116", "0.66045266", "0.65766186", "0.6564567", "0.65200365", "0.65085614", "0.648944", "0.6487956", "0.64857733", "0.64388764", "0.6387888", "0.6356612", "0.63547266", "0.6349396", "0.6348596", "0.63477296", "0.6345066", "0.6335829", "0.6326735", "0.63146776", "0.6298098", "0.6296761", "0.62927437", "0.6291194", "0.6290425", "0.62636536", "0.6252013", "0.625161", "0.62425065", "0.6219762", "0.6215925", "0.62039894", "0.62037563", "0.6190306", "0.6165833", "0.6164728", "0.61626035", "0.6154141", "0.61458373", "0.6145448", "0.6145448", "0.6145448", "0.611078", "0.6109347", "0.6097204", "0.6096174", "0.6090927", "0.6087107", "0.6086805", "0.6082014", "0.60659343", "0.60374063", "0.6016255", "0.601177", "0.6011222", "0.5990993", "0.5990065", "0.5989395", "0.59767103" ]
0.0
-1
test put and get
public void testPutGetWMS() { initCache(); //test a cache put and get WMSTile wco1 = getDefaultWMSCacheObject("q1", 100, true); wmsCache.put(wco1.getQuery(), wco1.getColourmode(), PointType.POINT_001, wco1); WMSTile wco2 = getDefaultWMSCacheObject("q2", 100, true); wmsCache.put(wco2.getQuery(), wco2.getColourmode(), PointType.POINT_001, wco2); //test get returns the correct object assertTrue(compareWMSObjects(wmsCache.get(wco1.getQuery(), wco1.getColourmode(), PointType.POINT_001), wco1)); assertTrue(compareWMSObjects(wmsCache.get(wco2.getQuery(), wco2.getColourmode(), PointType.POINT_001), wco2)); //get from cache an object that does not exist returns a placeholder WMSTile wcop = wmsCache.get("", "", PointType.POINT_00001); assertNotNull(wcop); assertTrue(!wcop.getCached()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void putTest(){\n Map<String, Object> putRequestMap = new HashMap<>();\n putRequestMap.put(\"title\", \"Title 3\");\n putRequestMap.put(\"body\", \"Body 3\");\n\n given().contentType(ContentType.JSON)\n .body(putRequestMap)\n .pathParam(\"id\",1)\n .when().put(\"/posts/{id}\")\n .then().statusCode(200)\n .body(\"title\",is(\"Title 3\"),\n \"body\",is(\"Body 3\"),\n \"id\",is(1));\n }", "@Test\r\n public void testPut() {\r\n System.out.println(\"put\");\r\n ClienteEmpresa cliente = null;\r\n ClienteDAO instance = new ClienteDAO();\r\n instance.put(cliente);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "@Test\n\tpublic void get_test()\n\t{\n\t\tb.set(1,2,'x');\n\t\tassertEquals(b.get(1,2),'x');\n\t}", "@Test\n public void testPutGet() {\n cache.put(\"A\", \"first\");\n cache.put(\"C\", \"second\");\n cache.put(\"C\", \"third\");\n \n assertEquals(\"first\", cache.get(\"A\"));\n assertEquals(\"third\", cache.get(\"C\"));\n }", "@Test\n void testPutReturnsRightValue() {\n MyList l = new MyList();\n l.put(\"key\", \"value\");\n\n assertEquals(\"value\", l.put(\"key\", \"another value\"));\n }", "@Test\n public void testPut_NonExisting() {\n configureAnswer();\n\n testObject.put(\"Hello\", \"World\");\n\n verify(helper).fireAdd(entry(\"Hello\", \"World\"));\n\n verifyNoMoreInteractions(helper);\n }", "@Test\n void testGetReturnsRightValueAfterMultiplePuts() {\n MyList l = new MyList();\n for (int i = 0; i < 10; i++)\n l.put(\"key\" + i, \"value\" + i);\n\n assertEquals(\"value4\", l.get(\"key4\"));\n }", "@Override\n\tpublic void doPut(HttpRequest request, AbstractHttpResponse response)\n\t\t\tthrows IOException {\n\t\t\n\t}", "@Test\n public void test_get_2() throws Exception {\n User user1 = createUser(1, true);\n\n User res = instance.get(user1.getId());\n\n assertNull(\"'get' should be correct.\", res);\n }", "@Test \n\tpublic void get() \n\t{\n\t\tassertTrue(true);\n\t}", "void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;", "@Test\n void testPutReturnsRightValueAfterMultiplePuts() {\n MyList l = new MyList();\n for (int i = 0; i < 10; i++)\n l.put(\"key\" + i, \"value\" + i);\n\n assertEquals(\"value5\", l.put(\"key5\", \"another value\"));\n }", "@Test\n void testPutReturnsNull() {\n MyList l = new MyList();\n l.put(\"key\", \"value\");\n\n assertEquals(null, l.put(\"another key\", \"another value\"));\n }", "@Test\n public void testPut_ExistingNoChange() {\n map.put(\"Hello\", \"World\");\n configureAnswer();\n\n testObject.put(\"Hello\", \"World\");\n\n verifyZeroInteractions(helper);\n }", "@Test\n public void testClientPut() {\n GridCacheDynamicLoadOnClientTest.clientNode.cache(GridCacheDynamicLoadOnClientTest.PERSON_CACHE).put((-100), new GridCacheDynamicLoadOnClientTest.Person((-100), \"name-\"));\n Assert.assertEquals(((GridCacheDynamicLoadOnClientTest.CACHE_ELEMENT_COUNT) + 1), GridCacheDynamicLoadOnClientTest.clientNode.cache(GridCacheDynamicLoadOnClientTest.PERSON_CACHE).size());\n }", "@Test\n public void testPut_Existing() {\n map.put(\"Hello\", \"Old World\");\n configureAnswer();\n\n testObject.put(\"Hello\", \"World\");\n\n verify(helper).fireReplace(entry(\"Hello\", \"Old World\"), entry(\"Hello\", \"World\"));\n\n verifyNoMoreInteractions(helper);\n }", "public boolean isPutOrGet() {\r\n return putOrGet;\r\n }", "@RequestMapping(value = \"/test\", method = RequestMethod.PUT)\n public void test() {}", "@Test\n public void shouldReturnBadRequestIfPutMethodIsMadeAndNeitherNewValueNorExpectedValueAreSetInSetValue() {\n SetValue emptyValue = new SetValue();\n assertThatResourceMethodReturnsStatus(\n client().resource(REQUEST_URI).type(MediaType.APPLICATION_JSON_TYPE).entity(emptyValue),\n \"PUT\",\n ClientResponse.Status.BAD_REQUEST);\n }", "@Test\n public void testGet() throws Exception {\n map.set(\"key-1\", \"value-1\", 10);\n \n Assert.assertEquals(map.get(\"key-1\"), \"value-1\");\n \n map.set(\"key-1\", \"value-2\", 10);\n \n Assert.assertEquals(map.get(\"key-1\"), \"value-2\");\n \n map.set(\"key-2\", \"value-1\", 10);\n \n Assert.assertEquals(map.get(\"key-2\"), \"value-1\");\n }", "@Test\n public void put() throws Exception {\n underTest.put(\"start\");\n underTest.put(\"star\");\n underTest.put(\"starter\");\n assert (underTest.contains(\"star\") == true);\n }", "public void setPutOrGet(boolean value) {\r\n this.putOrGet = value;\r\n }", "@Test\n public void testSimpleUpdates() {\n String key = \"UpdatesWithoutConflict\";\n\n put(key);\n put(key);\n\n remove(key);\n }", "@Test\n void testPutInsertsValue() {\n MyList l = new MyList();\n l.put(\"key\", \"value\");\n\n assertEquals(true, l.contains(\"key\"));\n }", "@Test\n\tpublic void testPutAccessReodersElement() {\n\t\tmap.put(\"key1\", \"value1\");\n\n\t\tSet<String> keySet = map.keySet();\n\t\tassertEquals(\"Calling get on an element did not move it to the front\", \"key1\",\n\t\t\tkeySet.iterator().next());\n\n\t\t// move 2 to the top/front\n\t\tmap.put(\"key2\", \"value2\");\n\t\tassertEquals(\"Calling get on an element did not move it to the front\", \"key2\",\n\t\t\tkeySet.iterator().next());\n\t}", "public void handlePut( HttpExchange exchange ) throws IOException {\n\n }", "@Test\n\tpublic void testUpdateTicketOk() {\n\t}", "@Test\n public void testPutHandlesOtherExceptionsCorrectly() throws Exception {\n\n doTestPutHandlesExceptionsCorrectly(false);\n }", "public void testMapGet() {\r\n }", "@PUT\n @Path(\"/update\")\n public void put() {\n System.out.println(\"PUT invoked\");\n }", "@Test\n public void testGet() {\n System.out.println(\"get\");\n int id = 0;\n Address result = instance.get(id);\n assertTrue(result.validate());\n \n }", "public void test_01() {\n\t\tpostobject jsonobjectdata = new postobject();\n\n\t\tjsonobjectdata.setID(\"5\");\n\t\tjsonobjectdata.settitle(\"updated Mr\");\n\t\tjsonobjectdata.setfirst_name(\"updated Rahaman\");\n\t\tjsonobjectdata.setauthor(\"updated Ata\");\n\n\t\tResponse reponse = given().\n\t\t\t\tbody(jsonobjectdata).\n\t\t\t\twhen().\n\t\t\t\tcontentType(ContentType.JSON).\n\t\t\t\tput(\"http://localhost:3000/posts/05\");\n\n\t\tSystem.out.println(\"updated response data \"+ reponse.asString());\t\t\n\t}", "private void do_test_put_get_personId(@SuppressWarnings(\"unused\") PersonId personId) {\n // First put Google Login Token.\n OAuth2OwnerTokenEntity googLoginToken =\n getOwnerTokenEntiy(GOOGLE_LOGIN, providerUserId).build();\n doTestPutGet(googLoginToken, googLogintokenManager);\n\n // Now put Google Doc Token\n OAuth2OwnerTokenEntity googDocToken =\n getOwnerTokenEntiy(GOOGLE_DOC, null /* non-login token */).build();\n doTestPutGet(googDocToken, googDocTokenManager);\n\n // Now some negative Testing.\n\n // Negative Test : Try to persiste Login Token with Null ProviderUserId.\n try {\n doTestPutGet(getOwnerTokenEntiy(GOOGLE_LOGIN, null).build(), googLogintokenManager);\n fail(\"should have failed.\");\n } catch (BlankStringException e) {\n // Expected\n }\n\n // Negative Test : Try to persiste Non-Login Token with non-null ProviderUserId.\n try {\n doTestPutGet(getOwnerTokenEntiy(GOOGLE_LOGIN, getRandomString()).build(),\n googDocTokenManager);\n fail(\"should have failed.\");\n } catch (IllegalArgumentException e) {\n // Expected\n }\n\n // Negative Test : Try to persist one type of token with another type of tokenManager.\n try {\n doTestPutGet(googLoginToken, googDocTokenManager);\n fail(\"should have failed.\");\n } catch (IllegalArgumentException e) {\n // Expected\n }\n }", "@Test\n public void putId() throws Exception {\n Role role = create(new Role(\"roleName\"));\n\n //Change a field of the object that has to be updated\n role.setName(\"roleNameChanged\");\n RESTRole restRole = new RESTRole(role);\n\n //Perform the put request to update the object and check the fields of the returned object\n try {\n mvc.perform(MockMvcRequestBuilders.put(\"/auth/roles/{id}\", UUIDUtil.UUIDToNumberString(role.getUuid()))\n .header(\"Content-Type\", \"application/json\")\n .header(\"Authorization\", authPair[0])\n .header(\"Function\", authPair[1])\n .content(TestUtil.convertObjectToJsonBytes(restRole))\n )\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$.name\", equalTo(restRole.getName())));\n } catch (AssertionError e) {\n remove(role.getUuid());\n throw e;\n }\n\n //Test if changes actually went in effect in the database\n try {\n role = get(role.getUuid());\n try {\n assertEquals(\"name field not updated correctly\", \"roleNameChanged\", role.getName());\n } finally {\n //Clean up database for other tests\n remove(role.getUuid());\n }\n } catch (ObjectNotFoundException e) {\n fail(\"Could not retrieve the put object from the actual database\");\n }\n }", "@Test\n public void test002_Insert_And_Get() {\n try {\n HashTableADT test = new HashTable<Integer, String>();\n test.insert(1, \"2\");\n test.insert(2, \"3\");\n test.insert(3, \"4\");\n if (test.get(1) != \"2\") { //checks if get returns the correct values\n fail(\"insert or get didn't work\");\n }\n if (test.get(2) != \"3\") {\n fail(\"insert or get didn't work\");\n }\n if (test.get(3) != \"4\") {\n fail(\"insert or get didn't work\");\n }\n } catch (Exception e) {\n fail(\"Exception shouldn't be thrown\");\n }\n }", "public void testGet() {\n System.out.println(\"get\");\n String key = \"\";\n int modo= 0;\n ObjectTempSwapWizard instance = new ObjectTempSwapWizard(modo);\n Object expResult = null;\n Object result = instance.get(key);\n assertEquals(expResult, result);\n }", "T put(T obj) throws DataElementPutException, RepositoryAccessDeniedException;", "@Test\n public void updateById() {\n User user = new User();\n user.setId(1259474874313797634L);\n user.setAge(30);\n boolean ifUpdate = user.updateById();\n System.out.println(ifUpdate);\n }", "@Test\n public void testPutGetElementJava() throws Exception {\n\n Status somethingThatIsSerializable = Status.STATUS_ALIVE;\n byte[] serializedForm = MemoryEfficientByteArrayOutputStream.serialize(somethingThatIsSerializable).getBytes();\n\n ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(serializedForm);\n\n assertEquals(404, HttpUtil.get(\"http://localhost:9090/ehcache/rest/sampleCache2/1\").getResponseCode());\n int status = HttpUtil.put(\"http://localhost:9090/ehcache/rest/sampleCache2/1\", \"application/x-java-serialized-object\",\n byteArrayInputStream);\n assertEquals(201, status);\n\n HttpURLConnection urlConnection = HttpUtil.get(\"http://localhost:9090/ehcache/rest/sampleCache2/1\");\n assertEquals(200, urlConnection.getResponseCode());\n assertTrue(urlConnection.getContentType().matches(\"application/x-java-serialized-object\"));\n byte[] bytes = HttpUtil.inputStreamToBytes(urlConnection.getInputStream());\n urlConnection.disconnect();\n\n final ByteArrayInputStream instr = new ByteArrayInputStream(bytes);\n final ObjectInputStream objectInputStream = new ObjectInputStream(instr);\n Status somethingThatIsSerializable2 = (Status) objectInputStream.readObject();\n\n assertEquals(somethingThatIsSerializable, somethingThatIsSerializable2);\n }", "@Test\n public void testEditTravel_DataAccessExceptionGetUser() throws Exception {\n when(databaseMock.getUser(anyInt())).thenThrow(new DataAccessException(\"\"));\n \n mockMVC.perform(put(\"/user/1/travel/1\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(dto))\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isInternalServerError());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "public ResponseTranslator put() {\n setMethod(\"PUT\");\n return doRequest();\n }", "@Test\n\tpublic void test_update_user_success(){\n\t\tUser user = new User(null, \"fengt\", \"[email protected]\", \"12345678\");\n\t\ttemplate.put(REST_SERVICE_URI + \"/20\" + ACCESS_TOKEN + token, user);\n\t}", "@Override\n\tpublic void put() {\n\t\tSystem.out.println(\"this is put\");\n\t}", "@Test\n @Override\n public void testMapGet() {\n }", "@Test\n public void testEditTravel_NumberFormatExceptionGetUser() throws Exception {\n \n mockMVC.perform(put(\"/user/a/travel/1\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(dto))\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isInternalServerError());\n \n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n public void testEditTravel_RecordNotFoundExceptionGetUser() throws Exception {\n when(databaseMock.getUser(anyInt())).thenThrow(new RecordNotFoundException());\n \n mockMVC.perform(put(\"/user/1/travel/1\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(dto))\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNotFound());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n void updateSuccess () {\n TestEntity testEntity = buildEntity();\n Api2 instance = new Api2();\n Long result = instance.save(testEntity);\n\n String name = \"Edited name\";\n boolean check = false;\n String description = \"edited description\";\n\n if (result != null) {\n testEntity.setName(name);\n testEntity.setCheck(check);\n testEntity.setDescription(description);\n instance.update(testEntity);\n\n Optional<TestEntity> optionalTestEntity = instance.getById(TestEntity.class, testEntity.getId());\n assertTrue(optionalTestEntity.isPresent());\n\n if (optionalTestEntity.isPresent()) {\n TestEntity entity = optionalTestEntity.get();\n\n assertEquals(entity.getName(), name);\n assertEquals(entity.getDescription(), description);\n assertEquals(entity.isCheck(), check);\n } else {\n fail();\n }\n } else {\n fail();\n }\n }", "@Test\n public void test_get_3() throws Exception {\n User user1 = createUser(1, false);\n\n User res = instance.get(user1.getId());\n\n assertEquals(\"'get' should be correct.\", user1.getUsername(), res.getUsername());\n assertEquals(\"'get' should be correct.\", user1.getDefaultTab(), res.getDefaultTab());\n assertEquals(\"'get' should be correct.\", user1.getNetworkId(), res.getNetworkId());\n assertEquals(\"'get' should be correct.\", user1.getRole().getId(), res.getRole().getId());\n assertEquals(\"'get' should be correct.\", user1.getFirstName(), res.getFirstName());\n assertEquals(\"'get' should be correct.\", user1.getLastName(), res.getLastName());\n assertEquals(\"'get' should be correct.\", user1.getEmail(), res.getEmail());\n assertEquals(\"'get' should be correct.\", user1.getTelephone(), res.getTelephone());\n assertEquals(\"'get' should be correct.\", user1.getStatus().getId(), res.getStatus().getId());\n }", "@Test\n public void testExposesUpdate() throws Exception {\n Link customer = findCustomersLinks().iterator().next();\n byte[] bytes = Files.readAllBytes(Paths.get(\"src/test/resources/customer-update.txt\"));\n\n mockMvc\n .perform(put(customer.getHref())\n .contentType(MediaType.APPLICATION_JSON)\n .content(bytes))\n .andExpect(status().isNoContent());\n\n MockHttpServletResponse response2 = request(customer.getHref());\n\n assertThat(\"Firstname field was updated correctly\",\n JsonPath.read(response2.getContentAsString(), \"firstname\").toString(),\n is(\"Ralph\"));\n }", "@Test\n\tpublic void testPutOfMessageAndUptesItTypeToSpecialThenTypeIsUpdatedInTheDatabase() throws Exception{\n\t\tDummyBoundary newBoundary = new DummyBoundary(null, \"dummy\");\n\t\tnewBoundary.setType(Type.NONE);\n\n\t\tDummyBoundary boundaryOnServer = \n\t\t this.restTemplate\n\t\t\t.postForObject(\n\t\t\t\t\tthis.url, \n\t\t\t\t\tnewBoundary, \n\t\t\t\t\tDummyBoundary.class);\n\t\t\n\t\tString id = boundaryOnServer \n\t\t\t.getId();\n\t\t\n\t\t// WHEN I PUT with update of type to be SPECIAL\n\t\tDummyBoundary update = new DummyBoundary();\n\t\tupdate.setType(Type.SPECIAL);\n\t\t\n\t\tthis.restTemplate\n\t\t\t.put(this.url + \"/{id}\", update, id);\n\t\t\n\t\t// THEN the database contains a message with same id and type: SPECIAL\n\t\tassertThat(this.restTemplate\n\t\t\t\t.getForObject(this.url + \"/{id}\", DummyBoundary.class, id))\n\t\t\t.extracting(\"id\", \"type\")\n\t\t\t.containsExactly(id, update.getType());\n\t\t\n\t}", "@Override\n protected void doPut(HttpServletRequest requete, HttpServletResponse reponse) throws ServletException, IOException {\n Integer idSousTournoiAValider = tentativeRecuperationIdSousTournoi(requete);\n if (idSousTournoiAValider == null){\n envoyerReponseMauvaisId(reponse);\n }\n else{\n SousTournoiSimplifieDto sousTournoiValide = sousTournoiService.validerSousTournoi(idSousTournoiAValider);\n if(sousTournoiValide != null){\n envoyerReponseRecuperationSousTournoiSimplifie(sousTournoiValide, reponse);\n }\n else{\n envoyerReponseSousTournoiIntrouvable(reponse);\n }\n }\n }", "@Test\n public void testEditTravel_RecordNotFoundExceptionUpdateTravel() throws Exception {\n doThrow(new RecordNotFoundException()).when(databaseMock).updateTravel(anyInt(), anyInt(), any(Travel.class));\n \n mockMVC.perform(put(\"/user/1/travel/1\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(dto))\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNotFound());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verify(databaseMock, times(1)).updateTravel(anyInt(), anyInt(), any(Travel.class));\n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n public void testGet()\n {\n SsOhMap m = new SsOhMap();\n m.put(\"a\", \"1\");\n m.put(\"b\", \"2\");\n m.put(\"a\", \"3\");\n\n assertEquals(\"3\", m.get(\"a\"));\n m.free();\n }", "public void testPut() {\n title();\n for (int i = 1; i <= TestEnv.parallelism; i++) {\n this.parallelism = i;\n super.testPut();\n }\n }", "public Result get(Get get) throws IOException;", "@Test\n public void testPutReturnsCorrectVersion() throws Exception {\n initialiseOptimisticPersister();\n\n // Configure attributes for database to return - the get is used for logging\n // only, so does not really matter.\n GetAttributesRequest simpleDBRequest = new GetAttributesRequest(testSimpleDBDomainName,\n testItemName);\n simpleDBRequest.setConsistentRead(true);\n GetAttributesResult getAttributesResult = new GetAttributesResult();\n mockery.checking(new Expectations() {\n {\n allowing(mockSimpleDBClient).getAttributes(with(equal(simpleDBRequest)));\n will(returnValue(getAttributesResult));\n }\n });\n\n mockery.checking(new Expectations() {\n {\n allowing(mockSimpleDBClient).putAttributes(with(anything()));\n }\n });\n\n ReplaceableAttribute testAttribute = new ReplaceableAttribute();\n testAttribute.setName(\"Name\");\n testAttribute.setValue(\"Value\");\n\n int initialVersion = 42; // Arbitrary\n\n // ACT\n int finalVersion = optimisticPersister.put(testItemName, Optional.of(initialVersion),\n testAttribute);\n\n // ASSERT\n assertTrue(\"The returned version should be one higher than the initial version\",\n finalVersion == (initialVersion + 1));\n }", "@Test\n\tpublic void update() throws Exception {\n\t\tMockito.when(productService.updateProductPriceInfo(Mockito.anyLong(), Mockito.anyFloat())).thenReturn(true);\n\t\tRequestBuilder requestBuilder = MockMvcRequestBuilders.put(\"/products/13860428\")\n\t\t\t\t.accept(MediaType.APPLICATION_JSON).content(expected).contentType(MediaType.APPLICATION_JSON);\n\t\tMvcResult result = mockMvc.perform(requestBuilder).andReturn();\n\n\t\tMockHttpServletResponse response = result.getResponse();\n\n\t\tassertEquals(HttpStatus.OK.value(), response.getStatus());\n\n\t}", "@Test\n void updateSuccess() {\n String Vin = \"1111111111111111X\";\n Car carToUpdate = carDao.getById(1);\n carToUpdate.setVin(Vin);\n carDao.saveOrUpdate(carToUpdate);\n Car retrievedCar = carDao.getById(1);\n assertEquals(carToUpdate, retrievedCar);\n }", "@org.junit.Test\n public void get() throws Exception {\n assertEquals(null, hashTable.get(\"savon\"));\n assertEquals(\"camp\", hashTable.get(\"math\"));\n hashTable.put(\"math\", \"club\");\n assertEquals(\"club\", hashTable.get(\"math\"));\n }", "@Test\n public void testSongGettersSetters() {\n Integer id = 4;\n String title=\"title\",uri = \"uri\";\n\n Song song = new Song();\n song.setId(id);\n song.setTitle(title);\n song.setUri(uri);\n\n assertEquals(\"Problem with id\",id, song.getId());\n assertEquals(\"Problem with title\",title, song.getTitle());\n assertEquals(\"Problem with uri\",uri, song.getUri());\n }", "@Override\n public final void doPut() {\n try {\n checkPermissions(getRequest());\n if (id == null) {\n throw new APIMissingIdException(getRequestURL());\n }\n\n final String inputStream = getInputStream();\n if (inputStream.length() == 0) {\n api.runUpdate(id, new HashMap<String, String>());\n return;\n }\n\n Item.setApplyValidatorMandatoryByDefault(false);\n final IItem item = getJSonStreamAsItem();\n api.runUpdate(id, getAttributesWithDeploysAsJsonString(item));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }", "@Test\n public void testEdit() {\n System.out.println(\"edit\");\n curso _curso = new curso();\n cursoDAO instance = new cursoDAO();\n boolean expResult = false;\n boolean result = instance.edit(_curso);\n assertEquals(expResult, result);\n \n }", "@Test\r\n\tpublic void test_updateEmployeeDetail() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"id\", \"2\")//\r\n\t\t\t\t.body(new EmployeeDto(2L, \"sunil\", \"changed\", \"[email protected]\"))//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.put(\"/api/v1/employee\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200)//\r\n\t\t\t\t.body(\"id\", equalTo(2))//\r\n\t\t\t\t.body(\"firstName\", equalTo(\"sunil\"))//\r\n\t\t\t\t.body(\"lastName\", equalTo(\"changed\"))//\r\n\t\t\t\t.body(\"emailId\", equalTo(\"[email protected]\"));\r\n\r\n\t}", "@Test \n public void testGet() {\n System.out.println(\"get\");\n al.add(1);\n al.add(8);\n Integer a = 1;\n Integer b = 8;\n assertEquals(a, al.get(0));\n assertEquals(b, al.get(1));\n \n }", "@Test\n\t@Override\n\tpublic void testUpdateObjectNotFoundJson() throws Exception {\n\t}", "ISObject put(String key, ISObject stuff) throws UnexpectedIOException;", "@Test\n public void testFailureWithDrawInSufficientFund() throws IOException, URISyntaxException {\n URI uri = builder.setPath(\"/accounts/2/withdraw/1000\").build();\n\n HttpPut request = new HttpPut(uri);\n request.setHeader(\"Content-type\", \"application/json\");\n HttpResponse response = client.execute(request);\n int statusCode = response.getStatusLine().getStatusCode();\n assertTrue(statusCode == 500);\n }", "@Test\n public void testEdit() throws Exception {\n // create citation entity to reflect the change that happens after calling edit\n Citation entity = getSampleCitation();\n\n // pretend the entity was edited and return new entity\n doNothing().when(Service).editUrl(any(String.class), any(String.class));\n when(Service.retrieveCitation(any(String.class))).thenReturn(entity);\n\n // test to see that the correct view is returned\n ModelAndView mav = Controller.edit(\"\", \"\");\n Assert.assertEquals(\"result\", mav.getViewName());\n\n // test to see that Json is formated properly\n Map<String, Object> map = mav.getModel();\n String jsonObject = (String) map.get(\"message\");\n testJsonObject(jsonObject, entity);\n }", "@Test\r\n public void testGet() {\r\n System.out.println(\"get\");\r\n Long codigoCliente = null;\r\n ClienteDAO instance = new ClienteDAO();\r\n ClienteEmpresa expResult = null;\r\n ClienteEmpresa result = instance.get(codigoCliente);\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "@Test\n public void editIngredient_CorrectInformation(){\n int returned = testDatabase.getIngredient(\"salt\");\n testDatabase.deleteIngredient(returned);\n Ingredient newIngredient = new Ingredient(ingredientID, \"salt\");\n testDatabase.editIngredient(newIngredient);\n Ingredient retrieved = testDatabase.getIngredient(ingredientID);\n assertEquals(\"editIngredient - Correct Name\", \"salt\", retrieved.getName());\n assertEquals(\"editIngredient - Correct ID\", ingredientID, retrieved.getKeyID());\n }", "@Test\r\n\tpublic void updateProductDetails() {\r\n\r\n\t\tRestAssured.baseURI = \"http://localhost:9000/products\";\r\n\t\tRequestSpecification request = RestAssured.given();\r\n\t\tJSONObject requestParams = new JSONObject();\r\n\t\trequestParams.put(\"name\", \"Banana\");\r\n\t\trequest.header(\"Content-Type\", \"application/json\");\r\n\t\trequest.body(requestParams.toString());\r\n\t\tResponse response = request.put(\"/5\");\r\n\t\tSystem.out.println(\"Update Responce Body ----->\" + response.asString());\r\n\t\tint statusCode = response.getStatusCode();\r\n\t\tAssert.assertEquals(statusCode, 200);\r\n\r\n\t}", "public interface PutValidation {\n}", "public boolean put(T obj);", "@Test\n public void test_get_1() throws Exception {\n clearDB();\n\n User res = instance.get(Long.MAX_VALUE);\n\n assertNull(\"'get' should be correct.\", res);\n }", "public void doPut(String uri, T t) throws AbstractRequestException, AbstractClientRuntimeException {\n OmcpClient omcpClient = this.osirisConnectionFactory.getConnection();\n Response omcpResponse = omcpClient.doPut(uri, t);\n this.osirisConnectionFactory.closeConnection(omcpClient);\n OmcpUtil.handleOmcpResponse(omcpResponse);\n }", "@Test \n\tpublic void edit() \n\t{\n\t\tassertTrue(true);\n\t}", "@Test\n public void testPutDel() {\n cache.put(\"A\", \"first\");\n cache.put(\"B\", \"second\");\n cache.put(\"C\", \"third\");\n cache.put(\"D\", \"fourth\");\n cache.put(\"E\", \"fifth\");\n cache.del(\"A\");\n cache.del(\"B\");\n cache.put(\"F\", \"sixth\");\n cache.put(\"G\", \"seventh\");\n\n assertEquals(\"third\", cache.get(\"C\"));\n assertEquals(\"fourth\", cache.get(\"D\"));\n assertEquals(\"fifth\", cache.get(\"E\"));\n assertEquals(\"sixth\", cache.get(\"F\"));\n assertEquals(\"seventh\", cache.get(\"G\"));\n assertNull(cache.get(\"A\"));\n }", "@Override\n protected void executeLowLevelRequest() {\n doPutItem();\n }", "@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}", "@Test\n\t@Override\n\tpublic void testUpdateObjectOKJson() throws Exception {\n\t}", "@Test\n\tpublic void testEditUser() {\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\tHttpEntity<String> entity = new HttpEntity<String>(null, headers);\n\t\tResponseEntity<String> response = restTemplate.exchange(getRootUrl() + \"/edit-user?id=4\",HttpMethod.GET, entity, String.class);\n\t\tassertEquals(200,response.getStatusCodeValue());\n\t}", "@Test\r\n public void testUpdate() {\r\n }", "@Ignore\n\tpublic void testExecuteRequestClientActionPutBug181() throws Exception {\n\t\tString testFileName = \"test2.txt\";\n\t\tString irodsFileName = \"test2.txt\";\n\n\t\tString absPath = scratchFileUtils.createAndReturnAbsoluteScratchPath(IRODS_TEST_SUBDIR_PATH);\n\t\tString putFileName = FileGenerator.generateFileOfFixedLengthGivenName(absPath, testFileName, 100);\n\n\t\tString targetIrodsFileName = testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties(\n\t\t\t\ttestingProperties, IRODS_TEST_SUBDIR_PATH) + \"/\" + irodsFileName;\n\n\t\tIRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties);\n\n\t\tIRODSAccessObjectFactory accessObjectFactory = irodsFileSystem.getIRODSAccessObjectFactory();\n\t\tStringBuilder builder = new StringBuilder();\n\t\tbuilder.append(\n\t\t\t\t\"myiput||acObjPutWithDateAndChksumAsAVUs(*rodsPath,*mainResource,*localFilePath,*inputChecksum,*outstatus)|nop\\n\");\n\t\tbuilder.append(\"*rodsPath=\");\n\t\tbuilder.append(targetIrodsFileName);\n\t\tbuilder.append(\"%*mainResource=\");\n\t\tbuilder.append(testingProperties.get(TestingPropertiesHelper.IRODS_RESOURCE_KEY));\n\t\tbuilder.append(\"%*localFilePath=\");\n\t\tbuilder.append(putFileName);\n\t\tbuilder.append(\"%*inputChecksum=\");\n\t\tbuilder.append(LocalFileUtils.computeCRC32FileCheckSumViaAbsolutePath(putFileName));\n\t\tbuilder.append(\"\\n\");\n\n\t\tbuilder.append(\"*ruleExecOut\");\n\t\tString ruleString = builder.toString();\n\n\t\tRuleProcessingAO ruleProcessingAO = accessObjectFactory.getRuleProcessingAO(irodsAccount);\n\n\t\tIRODSRuleExecResult result = ruleProcessingAO.executeRule(ruleString);\n\n\t\tIRODSFile putFile = irodsFileSystem.getIRODSFileFactory(irodsAccount).instanceIRODSFile(targetIrodsFileName);\n\n\t\tAssert.assertTrue(\"file does not exist\", putFile.exists());\n\n\t\tAssert.assertNotNull(\"did not get a response\", result);\n\t\tAssert.assertEquals(\"did not get results for client side operation\", 1,\n\t\t\t\tresult.getOutputParameterResults().size());\n\n\t}", "@Test\r\n public void testPutdata() {\r\n System.out.println(\"putdata\");\r\n String name = \"\";\r\n ArrayList<File> picfiles = null;\r\n int num = 0;\r\n connection instance = new connection();\r\n instance.putdata(name, picfiles, num);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "HttpPut putRequest(HttpServletRequest request, String address) throws IOException;", "@Test\n /* testUpdateRecord\n * testing update exist record in Save.Json\n * */\n public void testUpdateRecord() {\n testAddRecord();\n\n score = 300;\n level = 3;\n name = \"test1\";\n\n saveReader.updateRecord(indexOfReturned, \"name\", name);\n assertEquals(\"True : name field updated successfully\", name, saveReader.LoadsList.get(indexOfReturned).name);\n\n saveReader.updateRecord(indexOfReturned, \"score\", score);\n assertEquals(\"True : score field updated successfully\", score, saveReader.LoadsList.get(indexOfReturned).score);\n\n saveReader.updateRecord(indexOfReturned, \"level\", level);\n assertEquals(\"True : level field updated successfully\", level, saveReader.LoadsList.get(indexOfReturned).level);\n }", "public void test_02() {\n\n\t\tResponse reponse = given().\n\t\t\t\tbody(\"{\\\"first_name\\\": \\\"updated by PATCH Rahaman\\\"}\").\n\t\t\t\twhen().\n\t\t\t\tcontentType(ContentType.JSON).\n\t\t\t\tpatch(\"http://localhost:3000/posts/05\");\n\n\t\tSystem.out.println(\"updated response data \"+ reponse.asString());\t\t\t\n\t}", "@Test\r\n public void testEGet_int() {\r\n System.out.println(\"get\");\r\n \r\n \r\n UsuarioDao instance = new UsuarioDao();\r\n Usuario obj = instance.getByUserName(\"admin\");\r\n \r\n int usuarioId = obj.getId();\r\n \r\n Usuario result = instance.get(usuarioId);\r\n \r\n assertEquals(usuarioId, result.getId());\r\n }", "@Test\n public void test_getTelephone() {\n String value = \"new_value\";\n instance.setTelephone(value);\n\n assertEquals(\"'getTelephone' should be correct.\",\n value, instance.getTelephone());\n }", "@Test\r\n void testUpdateMedicine() throws Exception{\r\n\r\n String URI = \"/medicine/update/{medicineId}\";\r\n Medicine medicine = new Medicine();\r\n\t\tmedicine.setMedicineId(134);\r\n\t\tmedicine.setMedicineName(\"crosin\");\r\n\t\tmedicine.setMedicineCost(200);\r\n\t\t\r\n\t\tString jsonInput = this.converttoJson(medicine);\r\n Mockito.when(medicineService.updateMedicineById(Mockito.any(),Mockito.anyString())).thenReturn(medicine);\r\n MvcResult mvcResult = this.mockMvc.perform(MockMvcRequestBuilders.put(URI ,105).accept(MediaType.APPLICATION_JSON).content(jsonInput).contentType(MediaType.APPLICATION_JSON)).andReturn();\r\n MockHttpServletResponse mockHttpServletResponse = mvcResult.getResponse();\r\n String jsonOutput = mockHttpServletResponse.getContentAsString();\r\n assertNotNull(jsonOutput);\r\n }", "@Test\n public void testGetSets() {\n ref.setKey(\"test23\");\n assertEquals(\"test23\", ref.getKey());\n ref.setAuthor(\"test23\");\n assertEquals(\"test23\", ref.getAuthor());\n ref.setEditor(\"test23\");\n assertEquals(\"test23\", ref.getEditor());\n ref.setTitle(\"test23\");\n assertEquals(\"test23\", ref.getTitle());\n ref.setBooktitle(\"test23\");\n assertEquals(\"test23\", ref.getBooktitle());\n ref.setYear(\"1839\");\n assertEquals(\"1839\", ref.getYear());\n ref.setPublisher(\"Otava\");\n assertEquals(\"Otava\", ref.getPublisher());\n ref.setJournal(\"test23\");\n assertEquals(\"test23\", ref.getJournal());\n ref.setVolume(\"3\");\n assertEquals(\"3\", ref.getVolume());\n ref.setNumber(\"123\");\n assertEquals(\"123\", ref.getNumber());\n ref.setSeries(\"test23\");\n assertEquals(\"test23\", ref.getSeries());\n ref.setEdition(\"3rd\");\n assertEquals(\"3rd\", ref.getEdition());\n ref.setPages(\"12-35\");\n assertEquals(\"12-35\", ref.getPages());\n ref.setMonth(\"May\");\n assertEquals(\"May\", ref.getMonth());\n ref.setNote(\"test23\");\n assertEquals(\"test23\", ref.getNote());\n }", "@Test\n\tpublic void testUpdateTask() {\n\t}", "@Test\r\n public void testUpdate() {\r\n assertTrue(false);\r\n }", "@Test\n public void noUpdateWhenNotValidParams() {\n }", "@Test\n void getByIdSuccess() {\n //Get User\n GenericDao<User> userDao = new GenericDao(User.class);\n User user = userDao.getById(2);\n\n //Create Test Car\n Car testCar = new Car(1,user,\"2016\",\"Jeep\",\"Wrangler\",\"1C4BJWFG2GL133333\");\n\n //Ignore Create/Update times\n testCar.setCreateTime(null);\n testCar.setUpdateTime(null);\n\n //Get Existing Car\n Car retrievedCar = carDao.getById(1);\n assertNotNull(retrievedCar);\n\n //Compare Cars\n assertEquals(testCar,retrievedCar);\n }", "@Test\n public void editUserWithoutToken() throws Exception {\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(put(\"/johndoe/profile\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.FORBIDDEN.value());\n assertThat(response.getContentAsString()).isEmpty();\n }", "@Test\n void testGetReturnsNull() {\n MyList l = new MyList();\n l.put(\"key\", \"value\");\n\n assertEquals(null, l.get(\"not key\"));\n }", "@Override\n public MockResponse handleUpdate(RecordedRequest request) {\n return process(request, putHandler);\n }", "@Test\n public void testUpdateExample() throws Exception{\n MvcResult result = this.mockMvc.perform(get(\"/api/example/{id}\",50))\n .andExpect(status().is2xxSuccessful())\n .andReturn();\n\n // Parses it\n Example example = convertFromJson(result.getResponse().getContentAsString(), Example.class);\n \n // Change name value\n example.setName(\"Test 27\");\n\n // Updates it and checks if it was updated\n this.mockMvc.perform(put(\"/api/example\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(convertToJson(example)))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$.name\", equalTo(\"Test 27\")));\n }", "@Test\n public void testEditTravel_RecordNotFoundExceptionTravelId() throws Exception {\n mockMVC.perform(put(\"/user/1/travel/404\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(dto))\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNotFound());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }" ]
[ "0.68479466", "0.6837224", "0.6802931", "0.67672694", "0.6745401", "0.6488087", "0.6453102", "0.6444768", "0.6415685", "0.6412539", "0.64085215", "0.6395766", "0.6381701", "0.6344605", "0.63382226", "0.6290388", "0.62769353", "0.62626153", "0.6233996", "0.6222347", "0.61826426", "0.61481947", "0.6122144", "0.6115156", "0.6114449", "0.60988224", "0.6087286", "0.606409", "0.60599726", "0.60531193", "0.6042046", "0.6033629", "0.60305524", "0.6029644", "0.6026648", "0.60222185", "0.5990747", "0.59373707", "0.592822", "0.591103", "0.5909642", "0.5902977", "0.58806384", "0.5864835", "0.5857555", "0.58556855", "0.58544594", "0.58430594", "0.58310837", "0.5822227", "0.58078414", "0.58074224", "0.57996833", "0.5793945", "0.57863724", "0.57862633", "0.57782525", "0.57764566", "0.57745695", "0.5765309", "0.5756362", "0.5749226", "0.57380915", "0.572003", "0.56887716", "0.56834555", "0.56775844", "0.56738216", "0.56721693", "0.56690806", "0.566794", "0.56627035", "0.5659569", "0.5659455", "0.5658562", "0.56570387", "0.5656376", "0.56543696", "0.564532", "0.56449217", "0.56328034", "0.5631505", "0.5624762", "0.5622207", "0.5619389", "0.56182534", "0.56115896", "0.561027", "0.5604552", "0.560127", "0.5599182", "0.5594768", "0.55931365", "0.55875903", "0.5586948", "0.5583806", "0.55788827", "0.55775636", "0.5575646", "0.55703735" ]
0.58693415
43
test cache size management 1. when > cache size records put, nulls will be returned until cachecleaner has done its job.
public void testSizeManagementWMS() { initCache(); ArrayList<WMSTile> wcos = new ArrayList<WMSTile>(); long putSize = 0; long maxSize = 0; int cacheSizeDropCount = 0; for (int i = 0; i < 1000; i++) { WMSTile wco = getDefaultWMSCacheObject("q" + i, 50, true); putSize += wco.getSize(); wcos.add(wco); long size = wmsCache.getSize(); if (size < maxSize) { maxSize = size; cacheSizeDropCount++; } else { maxSize = size; } boolean result = wmsCache.put(wco.getQuery(), wco.getColourmode(), PointType.POINT_1, wco); //test if cache is full the put was unsuccessful //allow for cachecleaner to have reduced the size between put and test boolean test = (wmsCache.getSize() + wco.getSize() > wmsCache.getMaxCacheSize()) == !result; if (test == false) { assertTrue((size + wco.getSize() > wmsCache.getMaxCacheSize()) == !result); } assertTrue(wmsCache.getSize() <= wmsCache.getMaxCacheSize()); } //test size calcuations are operating assertTrue(putSize > 10000); //test cache cleaner was run more than once assertTrue(cacheSizeDropCount > 1); //test cache size is under max assertTrue(wmsCache.getSize() <= wmsCache.getMaxCacheSize()); //test gets. Anything that is a placeholder will be null. int cachedCount = 0; for (int i = 0; i < wcos.size(); i++) { WMSTile getwco = wmsCache.get(wcos.get(i).getQuery(), wcos.get(i).getColourmode(), PointType.POINT_1); if (getwco.getCached()) { assertTrue(compareWMSObjects(wcos.get(i), getwco)); cachedCount++; } } //test if at least 2 objects were cached at the end assertTrue(cachedCount > 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testCoh3710_size()\n {\n doExpiryOpTest(new Runnable()\n {\n public void run()\n {\n assertEquals(0, getNamedCache(getCacheName0()).size());\n }\n });\n }", "@Override\n\tpublic int getSizeToCache() {\n\t\treturn 0;\n\t}", "public int getCacheSize();", "@Override\n\tpublic long getCacheSize() {\n\t\treturn 0;\n\t}", "@Test\n public void testFindViaCache() {\n Integer hitRate1 = hitRate;\n Integer foundId = accessPointDimensionDao.foreignKeyValueFor(connection, AccessPointIdentifier.TEST);\n assertEquals(hitRate1, hitRate); // No change expected yet\n \n Integer hitRate2 = hitRate;\n Integer foundId2 = accessPointDimensionDao.foreignKeyValueFor(connection, AccessPointIdentifier.TEST);\n assertEquals(hitRate, new Integer(hitRate2+1)); // A cache hit is expected\n }", "@Override\n public int getCacheSize() {\n return 4 + 20 * 88;\n }", "@Override\n\tpublic void setSizeToCache(int sizeToCache) {\n\t\t\n\t}", "@Override\n public int getCacheSize() {\n return 4 * 1024 * 1024;\n }", "int getCacheConcurrency();", "long getCacheHits();", "@Test\n public void testCoh3710_get()\n {\n doExpiryOpTest(new Runnable()\n {\n public void run()\n {\n assertNull(getNamedCache(getCacheName0()).get(Integer.valueOf(1)));\n }\n });\n }", "@Test\n public void testCoh3710_isEmpty()\n {\n doExpiryOpTest(new Runnable()\n {\n public void run()\n {\n assertTrue(getNamedCache(getCacheName0()).isEmpty());\n }\n });\n }", "@Override\n\t\tprotected int sizeOf(CacheKey key, CacheInfo cacheInfo) {\n\t\t\tif (cacheInfo == null)\n\t\t\t\treturn 0;\n\t\t\treturn cacheInfo.size;\n\t\t}", "@Override\n public int getCacheSize() {\n return 4 + 20 * (4 + 4 + 8);\n }", "@Override\n\tpublic long getMaxCacheSize() {\n\t\treturn 0;\n\t}", "@Test\n public void testCoh3710()\n {\n doExpiryOpTest(new Runnable()\n {\n public void run() { getNamedCache(getCacheName0()).clear(); }\n });\n }", "int getCurrentCacheSize();", "@Override\n public boolean put(CacheObject<K, V> cacheObject){\n K key = cacheObject.getKey();\n if ((this.maxSize > 0) && !this.cache.containsKey(key) && (this.cache.size() == this.maxSize)){\n // if add new element than exceed maximum limit\n return false;\n }\n\n this.cache.put(key, cacheObject);\n\n return true;\n }", "public int getCacheSize(){ return Integer.parseInt(cacheSize.getText()); }", "@Test\n\tpublic void testQueryCaching(){\n\t\tqueryCache();\n\t\tqueryCache2();\n\t}", "Builder withCacheSizeInMiB(int sizeInMiB);", "int getCacheSizeInMiB();", "long getCacheMisses();", "public interface ContentCache extends Cache<List<byte[]>>{\n int notCacheSize();\n}", "@Test\n public void testPutGet() {\n cache.put(\"A\", \"first\");\n cache.put(\"C\", \"second\");\n cache.put(\"C\", \"third\");\n \n assertEquals(\"first\", cache.get(\"A\"));\n assertEquals(\"third\", cache.get(\"C\"));\n }", "@Override\n public int getCacheSize() {\n return 4 + this.arraySet.getTotalBytesSize();\n }", "public void setCacheSize(int size) {\n\t\t_cacheSize = size;\n\t}", "int getCachedCount();", "@Test\n public void testCoh3710_containsKey()\n {\n doExpiryOpTest(new Runnable()\n {\n public void run()\n {\n assertFalse(getNamedCache(getCacheName0()).containsKey(Integer.valueOf(1)));\n }\n });\n }", "public TransactionBuilder setCacheSize(long size);", "public int getCacheSize() {\n\t\treturn _cacheSize;\n\t}", "public interface ICache {\n\t\n\t/**\n\t * <p>\n\t * get the Cached Object from cache pool by the cache String key\n\t * @param key\n\t * @return\n\t */\n\tpublic Object get(String key);\n\t\n\t\n\t\n\t/**\n\t * <p>\n\t * \n\t * @param key\n\t * @return old cache object \n\t */\n\tpublic Object put(String key,Object value);\n\t\n\t/**\n\t * <p>\n\t * get the Cached Object from cache pool by the cache String key quietly,\n\t * without update the statistic data\n\t * @param key\n\t * @return\n\t */\n\tpublic Object getQuiet(String key);\n\t\n\t\n\t/**\n\t * <p>\n\t * remove the cached object from cache pool by the cache String key\n\t * @param key\n\t * @return\n\t */\n\tpublic Object remove(String key);\n\t\n\t/**\n\t * <p>\n\t * free specied size mem\n\t * @param size unit in Byte\n\t * @return\n\t */\n\tpublic long free(long size);\n\t\n\t\n\t/**\n\t * <p>\n\t * flush to the underly resource\n\t */\n\tpublic void flush();\n\t\n}", "@Override\n public boolean put(K key, V object){\n if ((this.maxSize > 0) && !this.cache.containsKey(key) && (this.cache.size() == this.maxSize)){\n // if add new element than exceed maximum limit\n return false;\n }\n\n CacheObject<K, V> cacheObject = new CacheObject<>(key, object);\n this.cache.put(key, cacheObject);\n\n return true;\n }", "@Test\n public void testCoh3710_getAll()\n {\n doExpiryOpTest(new Runnable()\n {\n public void run()\n {\n assertEquals(NullImplementation.getMap(),\n getNamedCache(getCacheName0()).getAll(\n Collections.singleton(Integer.valueOf(1))));\n }\n });\n }", "public int size() {\n return cache.size();\n }", "public int size()\n {\n // check if the cache needs flushing\n checkFlush();\n\n return super.size();\n }", "BigDecimal getCacheSpaceAvailable();", "@Override\n public synchronized int size() {\n if ((System.currentTimeMillis() - this.lastCheck) > this.CACHE_TIME) {\n update();\n }\n return super.size();\n }", "@Override\n\tpublic int size() {\n\t\treadLock.lock();\n\t\ttry {\n\t\t\treturn cache.size();\n\t\t} finally {\n\t\t\treadLock.unlock();\n\t\t}\n\t}", "public void testConcurrency() throws InterruptedException {\n initCache();\n\n final ArrayList<WMSTile> wcos = new ArrayList<WMSTile>();\n final ArrayList<Integer> test = new ArrayList<Integer>();\n final LinkedBlockingQueue<Integer> idxs = new LinkedBlockingQueue<Integer>();\n\n Collection<Callable<Integer>> tasks = new ArrayList<Callable<Integer>>();\n\n for (int i = 0; i < 30000; i++) {\n wcos.add(getDefaultWMSCacheObject(\"q\" + i, 50, true));\n test.add(-1);\n idxs.put(i);\n\n //put and get task\n tasks.add(new Callable<Integer>() {\n\n public Integer call() throws Exception {\n //put\n int i = idxs.take();\n boolean ok = wmsCache.put(wcos.get(i).getQuery(), wcos.get(i).getColourmode(), PointType.POINT_1, wcos.get(i));\n\n //get\n if (ok) {\n WMSTile wco = wmsCache.get(wcos.get(i).getQuery(), wcos.get(i).getColourmode(), PointType.POINT_1);\n if (wco.getCached()) {\n if (compareWMSObjects(wco, wcos.get(i))) {\n test.set(i, 1);\n } else {\n test.set(i, 0);\n }\n }\n }\n return i;\n }\n });\n }\n ExecutorService executorService = Executors.newFixedThreadPool(100);\n executorService.invokeAll(tasks);\n\n //test cache cleaner operated correctly\n assertTrue(wmsCache.getSize() <= wmsCache.getMaxCacheSize());\n\n //test for presence of invalid test comparisons\n int invalid = 0;\n int valid = 0;\n for (int i = 0; i < test.size(); i++) {\n if (test.get(i) == 0) {\n invalid++;\n } else if (test.get(i) == 1) {\n valid++;\n }\n }\n assertTrue(valid > 0);\n assertTrue(invalid == 0);\n }", "public void testSize(Method m) {\n String newCacheName = \"repl-size\";\n startCaches(newCacheName);\n List<HotRodClient> newClients = createClients(newCacheName);\n try {\n TestSizeResponse sizeStart = newClients.get(0).size();\n assertStatus(sizeStart, Success);\n assertEquals(0, sizeStart.size);\n for (int i = 0; i < 20; i++) {\n newClients.get(1).assertPut(m, \"k-\" + i, \"v-\" + i);\n }\n TestSizeResponse sizeEnd = newClients.get(1).size();\n assertStatus(sizeEnd, Success);\n assertEquals(20, sizeEnd.size);\n } finally {\n newClients.forEach(HotRodClient::stop);\n }\n }", "public int getCacheSize() {\n return cache.size();\n }", "@Test\n public void simpleAPITypeEnforcementObject() {\n\n\n //configure the cache\n MutableConfiguration<Object, Object> config = new MutableConfiguration<>();\n config.setTypes(Object.class, Object.class);\n\n //create the cache\n Cache<Object, Object> cache = cacheManager.createCache(\"simpleCache4\", config);\n\n //can put different things in\n cache.put(1, \"something\");\n cache.put(pistachio.getName(), pistachio);\n cache.put(tonto.getName(), tonto);\n cache.put(bonzo.getName(), bonzo);\n cache.put(juno.getName(), juno);\n cache.put(talker.getName(), talker);\n try {\n cache.put(skinny.getName(), skinny);\n } catch(Exception e) {\n //not serializable expected\n }\n //can get them out\n assertNotNull(cache.get(1));\n assertNotNull(cache.get(pistachio.getName()));\n\n //can remove them\n assertTrue(cache.remove(1));\n assertTrue(cache.remove(pistachio.getName()));\n }", "@Test\n\tpublic void testReadFromExsistingHostWithFreeCache(){\n\t\t\n\t\tIDataCollector dataCollector = prepareDataMock1(10);\n\t\tEstimator estimator = prepareEstimator(dataCollector);\n\t\t\n\t\t//When\n\t\tlong readTime = estimator.getReadEstimation(\"Host 1\", 10 * 1024);\n\t\t\n\t\t//Then\n\t\tAssert.assertEquals(40000, readTime);\t\t\n\t}", "@Test\n public void expiry10m() {\n Cache<Integer, Integer> c = new Cache2kBuilder<Integer, Integer>() {}\n .expireAfterWrite(10, TimeUnit.MINUTES)\n /* ... set loader ... */\n .build();\n target.setCache(c);\n DefaultResiliencePolicy p = extractDefaultPolicy();\n assertEquals(TimeUnit.MINUTES.toMillis(10), p.getResilienceDuration());\n assertEquals(TimeUnit.MINUTES.toMillis(10), p.getMaxRetryInterval());\n assertEquals(TimeUnit.MINUTES.toMillis(1), p.getRetryInterval());\n }", "@Test\n public void cachedContractor_whenDeleted_shouldNotBeAvailableInCache() {\n personService.deletePerson(\"17a36637-04d4-4357-9c6b-10a755dbbcdd\");\n assertEquals(Optional.empty(), Optional.ofNullable(cacheManager.getCache(\"person2\"))\n .map(cache -> cache.get(\"17a36637-04d4-4357-9c6b-10a755dbbcdd\", Person.class)));\n }", "public int getPkCacheSize() {\n return 0;\n }", "@Override\n public boolean isCaching() {\n return false;\n }", "public int size() {\r\n\t\treturn cache.size();\r\n\t}", "@Test\n public void testCoh3710_aggregateKeys()\n {\n doExpiryOpTest(new Runnable()\n {\n public void run()\n {\n Object oResult = getNamedCache(getCacheName0()).aggregate(\n Collections.singleton(Integer.valueOf(1)), new Count());\n assertEquals(Integer.valueOf(0), oResult);\n }\n });\n }", "int getSize() {\n synchronized (lock) {\n return cache.size();\n }\n }", "@Test\n public void testClientPut() {\n GridCacheDynamicLoadOnClientTest.clientNode.cache(GridCacheDynamicLoadOnClientTest.PERSON_CACHE).put((-100), new GridCacheDynamicLoadOnClientTest.Person((-100), \"name-\"));\n Assert.assertEquals(((GridCacheDynamicLoadOnClientTest.CACHE_ELEMENT_COUNT) + 1), GridCacheDynamicLoadOnClientTest.clientNode.cache(GridCacheDynamicLoadOnClientTest.PERSON_CACHE).size());\n }", "@Test(timeout = 4000)\n public void test05() throws Throwable {\n LinkedList<byte[][]> linkedList0 = new LinkedList<byte[][]>();\n FBCachedFetcher fBCachedFetcher0 = new FBCachedFetcher(linkedList0, (FBObjectListener.FetcherListener) null);\n fBCachedFetcher0.setFetchSize(220);\n boolean boolean0 = FileSystemHandling.shouldAllThrowIOExceptions();\n assertTrue(boolean0);\n }", "private CacheWrapper<AccessPointIdentifier, Integer> createCache() {\n return new CacheWrapper<AccessPointIdentifier, Integer>() {\n \n @Override\n public void put(AccessPointIdentifier key, Integer value) {\n cache.put(key, value);\n }\n \n @Override\n public Integer get(AccessPointIdentifier key) {\n if (cache.containsKey(key)) {\n hitRate++;\n }\n return cache.get(key);\n }\n \n \n };\n }", "@Test\n @Ignore\n public void testReadAllCached() {\n System.out.println(\"readAllCached\");\n Identifier id = null;\n IndexDaoImpl instance = null;\n List<Index> expResult = null;\n List<Index> result = instance.readAllCached(id);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "int getMaximumCacheSize();", "@Test\r\n\tpublic void testBlobCache() {\n\t\tRandomOrgCache<String[]> c = rocs[1].createBlobCache(5, 8);\r\n\t\tc.stop();\r\n\r\n\t\ttry {\r\n\t\t\tc.get();\r\n\t\t\tcollector.addError(new Error(\"should have thrown NoSuchElementException\"));\r\n\t\t} catch (NoSuchElementException e) {}\r\n\t\t\r\n\t\tc.resume();\r\n\t\t\r\n\t\tString[] got = null;\r\n\t\t\r\n\t\twhile (got == null) {\r\n\t\t\ttry {\r\n\t\t\t\tgot = c.get();\r\n\t\t\t} catch (NoSuchElementException e) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(50);\r\n\t\t\t\t} catch (InterruptedException e1) {\r\n\t\t\t\t\tcollector.addError(new Error(\"shouldn't have been interrupted!\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcollector.checkThat(got, notNullValue());\r\n\t}", "@Test\n public void capacityTest() {\n // TODO: test capacity\n }", "@Test(timeout = 4000)\n public void test16() throws Throwable {\n LinkedList<byte[][]> linkedList0 = new LinkedList<byte[][]>();\n linkedList0.add((byte[][]) null);\n FBCachedFetcher fBCachedFetcher0 = new FBCachedFetcher(linkedList0, (FBObjectListener.FetcherListener) null);\n assertTrue(fBCachedFetcher0.isBeforeFirst());\n \n fBCachedFetcher0.updateRow((byte[][]) null);\n fBCachedFetcher0.isEmpty();\n assertFalse(fBCachedFetcher0.isAfterLast());\n }", "@Test\n public void testEntryFaultinCount() {\n try {\n assertNotNull(cache);\n LocalRegion rgn = (LocalRegion) cache.getRegion(SEPARATOR + regionName);\n assertNotNull(rgn);\n\n DiskRegionStats diskRegionStats = rgn.getDiskRegion().getStats();\n assertTrue(\"Entry count not 0 \", new Long(0).equals(lifoStats.getCounter()));\n\n // put five entries into the region\n for (int i = 0; i < 8; i++) {\n rgn.put(\"key\" + i, \"value\" + i);\n }\n\n assertEquals(\n \"LRU eviction entry count and entries overflown to disk count from diskstats is not equal \",\n lifoStats.getEvictions(), diskRegionStats.getNumOverflowOnDisk());\n assertNull(\"Entry value in VM is not null\", rgn.getValueInVM(\"key6\"));\n rgn.get(\"key6\");\n assertEquals(\"Not equal to number of entries present in VM : \", 6L,\n diskRegionStats.getNumEntriesInVM());\n assertEquals(\"Not equal to number of entries present on disk : \", 2L,\n diskRegionStats.getNumOverflowOnDisk());\n\n } catch (Exception ex) {\n ex.printStackTrace();\n fail(\"Test failed\");\n }\n }", "@Override\n\tpublic void setCacheSize(long bps) {\n\t\t\n\t}", "@Test\n public void simpleAPIWithGenericsAndNoTypeEnforcement() {\n\n MutableConfiguration config = new MutableConfiguration<String, Integer>();\n Cache<Identifier, Dog> cache = cacheManager.createCache(cacheName, config);\n\n\n //Types are restricted\n //Cannot put in wrong types\n //cache.put(1, \"something\");\n\n //can put in\n cache.put(pistachio.getName(), pistachio);\n cache.put(tonto.getName(), tonto);\n\n //cannot get out wrong key types\n //assertNotNull(cache.get(1));\n assertNotNull(cache.get(pistachio.getName()));\n assertNotNull(cache.get(tonto.getName()));\n\n //cannot remove wrong key types\n //assertTrue(cache.remove(1));\n assertTrue(cache.remove(pistachio.getName()));\n assertTrue(cache.remove(tonto.getName()));\n\n }", "@Test\n public void testCompact_Overflow_Caching_Enabled() throws Exception {\n\n File file = new File(System.getProperty(\"java.io.tmpdir\") + File.separator\n + \"oasis-collection-testCompact_Overflow_Caching_Enabled\");\n file.mkdirs();\n file.deleteOnExit();\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2, file);\n Collection c = Arrays.asList(1, 1, 7, 7, 1, 1, 1, 1);\n instance.enableCache();\n instance.addAll(c);\n\n instance.remove(2);\n instance.compact();\n instance.disableCache();\n\n assertNumberFilesInDirectory(instance.instanceStore(), 2);\n\n }", "@Test\n\tpublic void testReadFromNewHostWithFreeCache(){\n\t\t\n\t\tIDataCollector dataCollector = prepareDataMock1(10);\n\t\tEstimator estimator = prepareEstimator(dataCollector);\n\t\t\n\t\t//When\n\t\tlong readTime = estimator.getReadEstimation(\"Host 3\", 10 * 1024);\n\t\t\n\t\t//Then\n\t\tAssert.assertEquals(30000, readTime);\n\t}", "@Override\r\n public void setCaching(int parseInt) {\n\r\n }", "@SneakyThrows\n\t@Test\n\tpublic void testHsetTtl() {\n\t\tString value = JedisUtils.HASH.hget(\"testMap\", \"testField\");\n\t\tassertNull(value);\n\t}", "@Test\n public void testPutDel() {\n cache.put(\"A\", \"first\");\n cache.put(\"B\", \"second\");\n cache.put(\"C\", \"third\");\n cache.put(\"D\", \"fourth\");\n cache.put(\"E\", \"fifth\");\n cache.del(\"A\");\n cache.del(\"B\");\n cache.put(\"F\", \"sixth\");\n cache.put(\"G\", \"seventh\");\n\n assertEquals(\"third\", cache.get(\"C\"));\n assertEquals(\"fourth\", cache.get(\"D\"));\n assertEquals(\"fifth\", cache.get(\"E\"));\n assertEquals(\"sixth\", cache.get(\"F\"));\n assertEquals(\"seventh\", cache.get(\"G\"));\n assertNull(cache.get(\"A\"));\n }", "@Test\n public void genericsEnforcementAndStricterTypeEnforcementFromCaching() {\n\n //configure the cache\n MutableConfiguration config = new MutableConfiguration<>();\n config.setTypes(Identifier.class, Hound.class);\n Cache<Identifier, Dog> cache = cacheManager.createCache(cacheName, config);\n\n //Types are restricted and types are enforced\n //Cannot put in wrong types\n //cache.put(1, \"something\");\n\n //can put in\n cache.put(pistachio.getName(), pistachio);\n //can put in with generics but possibly not with configuration as not a hound\n try {\n cache.put(tonto.getName(), tonto);\n } catch (ClassCastException e) {\n //expected but not mandatory. The RI throws these.\n }\n\n //cannot get out wrong key types\n //assertNotNull(cache.get(1));\n assertNotNull(cache.get(pistachio.getName()));\n //not necessarily\n //assertNotNull(cache.get(tonto.getName()));\n\n //cannot remove wrong key types\n //assertTrue(cache.remove(1));\n assertTrue(cache.remove(pistachio.getName()));\n //not necessarily\n //assertTrue(cache.remove(tonto.getName()));\n }", "@Test\n public void testCoh3710_containsValue()\n {\n doExpiryOpTest(new Runnable()\n {\n public void run()\n {\n assertFalse(getNamedCache(getCacheName0()).containsValue(Integer.valueOf(1)));\n }\n });\n }", "public void cacheResult(DataEntry dataEntry);", "public InMemoryResponseCache() {\n\t\tthis( 250*1024 ); // 250 KB cache\n\t}", "@Test\n\tpublic void testReadFromOnlyHostWithFullCache(){\n\t\t\n\t\tIDataCollector dataCollector = prepareDataMock2(100);\n\t\tEstimator estimator = prepareEstimator(dataCollector);\n\t\t\n\t\t//When\n\t\tlong readTime = estimator.getReadEstimation(\"Host 1\", 10 * 1024);\n\t\t\n\t\t//Then\n\t\tAssert.assertEquals(10000, readTime);\t\t\t\t\n\t}", "public Cache(Integer size) {\n this.size = size;\n recentlyUsed = new ArrayList<K>();\n cache = new HashMap<>();\n }", "@Bean\n\tpublic CacheManager cacheManager() {\n \tCaffeineCacheManager cacheManager = new CaffeineCacheManager();\n \tcacheManager.setCacheSpecification(\"maximumSize=500,expireAfterWrite=60m\");\n \treturn cacheManager;\n\t}", "int cacheRowsWhenScan();", "@Test\n public void sizeTest()\n {\n assertEquals(0, map.size());\n\n int count = 0;\n for (int i = 0; i < 10; i++)\n {\n map.put(i, i);\n assertEquals(++count, map.size());\n }\n\n assertEquals(count, map.size());\n map.clear();\n assertEquals(0, map.size());\n }", "private void subLengthFromCacheSize(final IndexedDiskElementDescriptor value)\r\n {\r\n contentSize.addAndGet((value.len + IndexedDisk.HEADER_SIZE_BYTES) / -1024 - 1);\r\n }", "private void flushCache()\n {\n Entry<Integer, String> eldestEntry;\n File oldestFile;\n long eldestFileSize;\n int count = 0;\n\n int MAX_DELETE_FILE = 4;\n int MAX_CACHE_FILE_ALLOW = 1000;\n\n while (count < MAX_DELETE_FILE && (cacheSize > MAX_CACHE_FILE_ALLOW || cacheByteSize > maxCacheByteSize))\n {\n eldestEntry = mLinkedHashMap.entrySet().iterator().next();\n oldestFile = new File(eldestEntry.getValue());\n eldestFileSize = oldestFile.length();\n mLinkedHashMap.remove(eldestEntry.getKey());\n oldestFile.delete();\n cacheSize = mLinkedHashMap.size();\n cacheByteSize -= eldestFileSize;\n count++;\n }// while (count < MAX_DELETE_FILE && (cacheSize > MAX_CACHE_FILE_ALLOW || cacheByteSize > maxCacheByteSize))\n }", "@PostConstruct\n public void initCache() {\n cache = Collections.synchronizedMap(new HashMap<>(cacheCapacity, 1));\n }", "@Test\n public void testCacheClear(final TestContext aContext) {\n final Async asyncTask = aContext.async();\n final Future<Integer> vertImageWidth = deployNewVerticle(myConfigs).compose(verticleID -> {\n myVertID = verticleID;\n\n return putObjectS3(VERT_PATH).compose(success -> {\n return getImageWidth();\n });\n });\n\n vertImageWidth.compose(width -> {\n final Future<Integer> horiImageWidth = sendMessage(IMAGE_KEY).compose(success -> {\n return putObjectS3(HORI_PATH);\n }).compose(success -> {\n return getImageWidth();\n });\n\n return horiImageWidth.compose(horiWidth -> {\n if (horiWidth != width) {\n return sendMessage(IMAGE_KEY);\n }\n\n return sendMessage(IMAGE_KEY).compose(success -> {\n return Future.failedFuture(LOGGER.getMessage(MessageCodes.BUCKETEER_610));\n });\n });\n }).onSuccess(result -> {\n myAmazonS3.deleteObject(s3Bucket, IMAGE_JPX);\n TestUtils.complete(asyncTask);\n }).onFailure(failure -> {\n myAmazonS3.deleteObject(s3Bucket, IMAGE_JPX);\n LOGGER.error(failure.getMessage());\n aContext.fail();\n });\n }", "private void addPrecious(CacheRepositoryEntry entry)\n {\n try {\n long size = entry.getSize();\n synchronized (_precious) {\n if (_precious.add(entry.getPnfsId())) {\n _preciousSpace += size;\n }\n }\n } catch (CacheException e) {\n _log.error(\"failed to get entry size : \" + e.getMessage());\n }\n }", "@Test\n public void testPutOverrideTTL() throws Exception {\n long beforeCreated = System.currentTimeMillis();\n Thread.sleep(10);\n String originalString = \"The rain in Spain falls mainly on the plain\";\n ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(originalString.getBytes());\n\n assertEquals(404, HttpUtil.get(\"http://localhost:9090/ehcache/rest/sampleCache2/1\").getResponseCode());\n Header header = new Header(\"ehcacheTimeToLiveSeconds\", \"10\");\n int status = HttpUtil.put(\"http://localhost:9090/ehcache/rest/sampleCache2/1\", \"text/plain\", byteArrayInputStream, header);\n assertEquals(201, status);\n\n HttpURLConnection urlConnection = HttpUtil.get(\"http://localhost:9090/ehcache/rest/sampleCache2/1\");\n assertEquals(200, urlConnection.getResponseCode());\n\n Thread.sleep(15000);\n urlConnection = HttpUtil.get(\"http://localhost:9090/ehcache/rest/sampleCache2/1\");\n assertEquals(404, urlConnection.getResponseCode());\n\n header = new Header(\"ehcacheTimeToLiveSeconds\", \"garbage\");\n status = HttpUtil.put(\"http://localhost:9090/ehcache/rest/sampleCache2/1\", \"text/plain\", byteArrayInputStream, header);\n assertEquals(201, status);\n\n //Should have not parsed\n Thread.sleep(15000);\n urlConnection = HttpUtil.get(\"http://localhost:9090/ehcache/rest/sampleCache2/1\");\n assertEquals(200, urlConnection.getResponseCode());\n\n\n header = new Header(\"ehcacheTimeToLiveSeconds\", null);\n status = HttpUtil.put(\"http://localhost:9090/ehcache/rest/sampleCache2/1\", \"text/plain\", byteArrayInputStream, header);\n assertEquals(201, status);\n\n //Should have not parsed\n Thread.sleep(15000);\n urlConnection = HttpUtil.get(\"http://localhost:9090/ehcache/rest/sampleCache2/1\");\n assertEquals(200, urlConnection.getResponseCode());\n\n //the header is case insensitive\n header = new Header(\"EhcachetImeToLiveSeconds\", \"1\");\n status = HttpUtil.put(\"http://localhost:9090/ehcache/rest/sampleCache2/1\", \"text/plain\", byteArrayInputStream, header);\n assertEquals(201, status);\n\n Thread.sleep(5000);\n urlConnection = HttpUtil.get(\"http://localhost:9090/ehcache/rest/sampleCache2/1\");\n assertEquals(404, urlConnection.getResponseCode());\n\n\n }", "@Before\n public void setUp() {\n baseConfig.setString(\"cache\", \"changes\", \"memoryLimit\", \"0\");\n baseConfig.setString(\"cache\", \"projects\", \"memoryLimit\", \"0\");\n }", "@Test\n public void testLIFOStatsUpdation() {\n try {\n assertNotNull(cache);\n LocalRegion rgn = (LocalRegion) cache.getRegion(SEPARATOR + regionName);\n assertNotNull(rgn);\n\n // check for is LIFO Enable\n assertTrue(\"Eviction Algorithm is not LIFO\",\n (((EvictionAttributesImpl) rgn.getAttributes().getEvictionAttributes()).isLIFO()));\n\n // put four entries into the region\n for (int i = 0; i < 8; i++) {\n rgn.put((long) i, (long) i);\n }\n\n assertTrue(\"In Memory entry count not 5 \",\n new Long(5).equals(lifoStats.getCounter()));\n\n // varifies evicted entry values are null in memory\n assertTrue(\"In memory \", rgn.entries.getEntry(5L).isValueNull());\n assertTrue(\"In memory \", rgn.entries.getEntry(6L).isValueNull());\n assertTrue(\"In memory \", rgn.entries.getEntry(7L).isValueNull());\n\n // get an entry back\n Long value = (Long) rgn.get(4L);\n value = (Long) rgn.get(5L);\n value = (Long) rgn.get(6L);\n\n // check for entry value\n assertTrue(\"Value not matched \", value.equals(6L));\n assertNull(\"Entry value in VM is not null\", rgn.getValueInVM(7L));\n\n assertTrue(\"Entry count not 7 \", new Long(7).equals(lifoStats.getCounter()));\n // check for destory\n rgn.destroy(3L);\n assertTrue(\"Entry count not 6 \", new Long(6).equals(lifoStats.getCounter()));\n // check for invalidate\n rgn.invalidate(1L);\n assertTrue(\"Entry count not 5 \", new Long(5).equals(lifoStats.getCounter()));\n // check for remove\n rgn.put(8L, 8L);\n rgn.remove(2L);\n assertTrue(\"Entry count not 4 \", new Long(4).equals(lifoStats.getCounter()));\n } catch (Exception ex) {\n ex.printStackTrace();\n fail(\"Test failed\");\n }\n\n }", "private void ensureCapacity() {\r\n\t\t\tdouble loadFactor = getLoadFactor();\r\n\r\n\t\t\tif (loadFactor >= CAPACITY_THRESHOLD)\r\n\t\t\t\trehash();\r\n\t\t}", "public void setCached() {\n }", "@Test\n public void testEntryEvictionCount() {\n try {\n assertNotNull(cache);\n Region rgn = cache.getRegion(SEPARATOR + regionName);\n assertNotNull(rgn);\n\n assertTrue(\"Entry count not 0 \", new Long(0).equals(lifoStats.getCounter()));\n // put four entries into the region\n for (int i = 0; i < 8; i++) {\n rgn.put((long) i, (long) i);\n }\n\n assertTrue(\"1)Total eviction count is not correct \",\n new Long(3).equals(lifoStats.getEvictions()));\n rgn.put(8L, 8L);\n rgn.get(5L);\n assertTrue(\"2)Total eviction count is not correct \",\n new Long(4).equals(lifoStats.getEvictions()));\n } catch (Exception ex) {\n ex.printStackTrace();\n fail(\"Test failed\");\n }\n }", "@BeforeAll\n static void cacheManager() {\n }", "@Test\n\tpublic void testGetApplicationCacheStore()\n\t{\n\t\tApplicationCacheStore applicationCacheStore = null;//cacheManager.getApplicationCacheStore();\n\t\t// application cache will not be null.\n\t\t// there should always be an application cache\n\t\tAssert.assertNotNull(applicationCacheStore);\n\n\t\t// since the cache is empty, this should be null\n\t\tString value = (String) applicationCacheStore.getCacheValue(\"KEY\");\n\t\tAssert.assertNull(value, null);\n\n\t\t// store some values and read it again\n\t\tCacheValueDTO cacheValue = new CacheValueDTO(\"KEY\", \"VALUE\");\n\t\tapplicationCacheStore.setCacheValue(cacheValue);\n\t\tvalue = (String) applicationCacheStore.getCacheValue(\"KEY\");\n\t\tAssert.assertEquals(value, \"VALUE\");\n\t}", "@Test\r\n public void testGetUUIDItemTypeFromCache() {\n assertEquals(new Long(1), queries.getUUIDItemTypeId(\"patient\"));\r\n getSimpleJdbcTemplate().update(\"delete from uuid_item_type where xml_name like 'patient'\");\r\n //make sure the entry is not in the database\r\n assertEquals(0, (getSimpleJdbcTemplate().queryForList(\" select * from uuid_item_type where xml_name like 'patient'\")).size());\r\n // Read it from cache\r\n assertEquals(new Long(1), queries.getUUIDItemTypeId(\"patient\"));\r\n }", "public Cache(int size) {\r\n\t\t\r\n\t\tcache = new LinkedList<T>();\r\n\t\tmaxStorage = size;\r\n\t}", "@Override\n\tpublic boolean isCaching() {\n\t\treturn false;\n\t}", "long storageSize();", "interface ICacheUtil {\n void put(Object key, Object value, long expiredTime, TimeUnit unit);\n Object get(Object key);\n void remove(Object key);\n void clear();\n boolean isExists(Object key);\n}", "public MRUCache(int size, CacheDataFactory<K, V> fact, CacheSource<K,V> source) {\r\n factory = fact;\r\n this.source = source;\r\n buckets = new AtomicReference[nextPrime(size + (int)(size * .15))];\r\n for (int i = 0, tot = buckets.length; i < tot; i++) {\r\n buckets[i] = new AtomicReference<CacheData<K, V>>(null);\r\n }\r\n }", "@Test\n public void testGetExecutionStatsLocked_Caching() {\n spyOn(mQuotaController);\n doNothing().when(mQuotaController).invalidateAllExecutionStatsLocked();\n\n final long now = JobSchedulerService.sElapsedRealtimeClock.millis();\n mQuotaController.saveTimingSession(0, \"com.android.test\",\n createTimingSession(now - (23 * HOUR_IN_MILLIS), 10 * MINUTE_IN_MILLIS, 5), false);\n mQuotaController.saveTimingSession(0, \"com.android.test\",\n createTimingSession(now - (7 * HOUR_IN_MILLIS), 10 * MINUTE_IN_MILLIS, 5), false);\n mQuotaController.saveTimingSession(0, \"com.android.test\",\n createTimingSession(now - (2 * HOUR_IN_MILLIS), 10 * MINUTE_IN_MILLIS, 5), false);\n mQuotaController.saveTimingSession(0, \"com.android.test\",\n createTimingSession(now - (6 * MINUTE_IN_MILLIS), 3 * MINUTE_IN_MILLIS, 5), false);\n final ExecutionStats originalStatsActive;\n final ExecutionStats originalStatsWorking;\n final ExecutionStats originalStatsFrequent;\n final ExecutionStats originalStatsRare;\n synchronized (mQuotaController.mLock) {\n originalStatsActive = mQuotaController.getExecutionStatsLocked(\n 0, \"com.android.test\", ACTIVE_INDEX);\n originalStatsWorking = mQuotaController.getExecutionStatsLocked(\n 0, \"com.android.test\", WORKING_INDEX);\n originalStatsFrequent = mQuotaController.getExecutionStatsLocked(\n 0, \"com.android.test\", FREQUENT_INDEX);\n originalStatsRare = mQuotaController.getExecutionStatsLocked(\n 0, \"com.android.test\", RARE_INDEX);\n }\n\n // Advance clock so that the working stats shouldn't be the same.\n advanceElapsedClock(MINUTE_IN_MILLIS);\n // Change frequent bucket size so that the stats need to be recalculated.\n setDeviceConfigLong(QcConstants.KEY_WINDOW_SIZE_FREQUENT_MS, 6 * HOUR_IN_MILLIS);\n\n ExecutionStats expectedStats = new ExecutionStats();\n expectedStats.allowedTimePerPeriodMs = originalStatsActive.allowedTimePerPeriodMs;\n expectedStats.windowSizeMs = originalStatsActive.windowSizeMs;\n expectedStats.jobCountLimit = originalStatsActive.jobCountLimit;\n expectedStats.sessionCountLimit = originalStatsActive.sessionCountLimit;\n expectedStats.expirationTimeElapsed = originalStatsActive.expirationTimeElapsed;\n expectedStats.executionTimeInWindowMs = originalStatsActive.executionTimeInWindowMs;\n expectedStats.bgJobCountInWindow = originalStatsActive.bgJobCountInWindow;\n expectedStats.executionTimeInMaxPeriodMs = originalStatsActive.executionTimeInMaxPeriodMs;\n expectedStats.bgJobCountInMaxPeriod = originalStatsActive.bgJobCountInMaxPeriod;\n expectedStats.sessionCountInWindow = originalStatsActive.sessionCountInWindow;\n expectedStats.inQuotaTimeElapsed = originalStatsActive.inQuotaTimeElapsed;\n final ExecutionStats newStatsActive;\n synchronized (mQuotaController.mLock) {\n newStatsActive = mQuotaController.getExecutionStatsLocked(\n 0, \"com.android.test\", ACTIVE_INDEX);\n }\n // Stats for the same bucket should use the same object.\n assertTrue(originalStatsActive == newStatsActive);\n assertEquals(expectedStats, newStatsActive);\n\n expectedStats.allowedTimePerPeriodMs = originalStatsWorking.allowedTimePerPeriodMs;\n expectedStats.windowSizeMs = originalStatsWorking.windowSizeMs;\n expectedStats.jobCountLimit = originalStatsWorking.jobCountLimit;\n expectedStats.sessionCountLimit = originalStatsWorking.sessionCountLimit;\n expectedStats.expirationTimeElapsed = originalStatsWorking.expirationTimeElapsed;\n expectedStats.executionTimeInWindowMs = originalStatsWorking.executionTimeInWindowMs;\n expectedStats.bgJobCountInWindow = originalStatsWorking.bgJobCountInWindow;\n expectedStats.sessionCountInWindow = originalStatsWorking.sessionCountInWindow;\n expectedStats.inQuotaTimeElapsed = originalStatsWorking.inQuotaTimeElapsed;\n final ExecutionStats newStatsWorking;\n synchronized (mQuotaController.mLock) {\n newStatsWorking = mQuotaController.getExecutionStatsLocked(\n 0, \"com.android.test\", WORKING_INDEX);\n }\n assertTrue(originalStatsWorking == newStatsWorking);\n assertNotEquals(expectedStats, newStatsWorking);\n\n expectedStats.allowedTimePerPeriodMs = originalStatsFrequent.allowedTimePerPeriodMs;\n expectedStats.windowSizeMs = originalStatsFrequent.windowSizeMs;\n expectedStats.jobCountLimit = originalStatsFrequent.jobCountLimit;\n expectedStats.sessionCountLimit = originalStatsFrequent.sessionCountLimit;\n expectedStats.expirationTimeElapsed = originalStatsFrequent.expirationTimeElapsed;\n expectedStats.executionTimeInWindowMs = originalStatsFrequent.executionTimeInWindowMs;\n expectedStats.bgJobCountInWindow = originalStatsFrequent.bgJobCountInWindow;\n expectedStats.sessionCountInWindow = originalStatsFrequent.sessionCountInWindow;\n expectedStats.inQuotaTimeElapsed = originalStatsFrequent.inQuotaTimeElapsed;\n final ExecutionStats newStatsFrequent;\n synchronized (mQuotaController.mLock) {\n newStatsFrequent = mQuotaController.getExecutionStatsLocked(\n 0, \"com.android.test\", FREQUENT_INDEX);\n }\n assertTrue(originalStatsFrequent == newStatsFrequent);\n assertNotEquals(expectedStats, newStatsFrequent);\n\n expectedStats.allowedTimePerPeriodMs = originalStatsRare.allowedTimePerPeriodMs;\n expectedStats.windowSizeMs = originalStatsRare.windowSizeMs;\n expectedStats.jobCountLimit = originalStatsRare.jobCountLimit;\n expectedStats.sessionCountLimit = originalStatsRare.sessionCountLimit;\n expectedStats.expirationTimeElapsed = originalStatsRare.expirationTimeElapsed;\n expectedStats.executionTimeInWindowMs = originalStatsRare.executionTimeInWindowMs;\n expectedStats.bgJobCountInWindow = originalStatsRare.bgJobCountInWindow;\n expectedStats.sessionCountInWindow = originalStatsRare.sessionCountInWindow;\n expectedStats.inQuotaTimeElapsed = originalStatsRare.inQuotaTimeElapsed;\n final ExecutionStats newStatsRare;\n synchronized (mQuotaController.mLock) {\n newStatsRare = mQuotaController.getExecutionStatsLocked(\n 0, \"com.android.test\", RARE_INDEX);\n }\n assertTrue(originalStatsRare == newStatsRare);\n assertEquals(expectedStats, newStatsRare);\n }", "@Test\n public void noFilteringAllowsRepeatedResults() {\n final Dataset dataset = new Dataset(\"TEST1\", \"sql\");\n\n List<String> entry1 = new ArrayList<>();\n entry1.add(\"abcd\");\n entry1.add(\"123\");\n\n List<String> entry2 = new ArrayList<>();\n entry2.add(\"wxyz\");\n entry2.add(\"789\");\n\n List<String> entry3 = new ArrayList<>();\n entry3.add(\"wxyz\"); // same key as entry2\n entry3.add(\"456\");\n\n List<String> entry4 = new ArrayList<>();\n entry4.add(\"efgh\");\n entry4.add(\"001\");\n\n List<List<String>> queryResults = new ArrayList<>();\n queryResults.add(entry1);\n queryResults.add(entry2);\n queryResults.add(entry3);\n queryResults.add(entry4);\n\n // given\n dataset.populateCache(queryResults, 100L);\n\n // when\n final List<String> result1 = dataset.getCachedResult();\n final List<String> result2 = dataset.getCachedResult();\n final List<String> result3 = dataset.getCachedResult();\n final List<String> result4 = dataset.getCachedResult();\n\n // then\n assertEquals(\"Wrong result 1\", entry1, result1);\n assertEquals(\"Wrong result 2\", entry2, result2);\n assertEquals(\"Wrong result 3\", entry3, result3);\n assertEquals(\"Wrong result 4\", entry4, result4);\n\n // and\n try {\n dataset.getCachedResult();\n fail(\"Expected to run out of data\");\n\n } catch (IllegalStateException ex) {\n assertEquals(\"Wrong error\", \"No more data available for dataset: TEST1\", ex.getMessage());\n }\n\n // and\n assertEquals(\"Wrong cache size\", Optional.of(4), dataset.getMetrics().getCacheSize());\n assertEquals(\"Wrong timing\", Optional.of(100L), dataset.getMetrics().getTimingMilliseconds());\n assertEquals(\"Wrong cache requested\", Optional.of(5), dataset.getMetrics().getCacheRequested());\n assertEquals(\"Wrong filtered out\", Optional.empty(), dataset.getMetrics().getFilteredOut());\n }", "@Test\n public void testCompact_Mid_Segment_Caching_Enabled() throws Exception {\n\n File file = new File(System.getProperty(\"java.io.tmpdir\") + File.separator\n + \"oasis-collection-testCompact_Last_Segment_Caching_Enabled\");\n file.mkdirs();\n file.deleteOnExit();\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2, file);\n Collection c = Arrays.asList(1, 1, 7, 7, 1, 1, 1, 1);\n instance.enableCache();\n instance.addAll(c);\n\n instance.remove(5);\n instance.compact();\n instance.disableCache();\n\n assertNumberFilesInDirectory(instance.instanceStore(), 2);\n\n }", "boolean isCachingEnabled();", "@Test\n public void testCompact_Last_Segment_Caching_Enabled() throws Exception {\n\n File file = new File(System.getProperty(\"java.io.tmpdir\") + File.separator\n + \"oasis-collection-testCompact_Last_Segment_Caching_Enabled\");\n file.mkdirs();\n file.deleteOnExit();\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2, file);\n Collection c = Arrays.asList(1, 1, 7, 7, 1, 1, 1, 1);\n instance.enableCache();\n instance.addAll(c);\n\n instance.remove(7);\n instance.disableCache();\n\n assertNumberFilesInDirectory(instance.instanceStore(), 2);\n\n }" ]
[ "0.7546581", "0.6633429", "0.65371966", "0.64556134", "0.63786477", "0.63126737", "0.63126415", "0.6309612", "0.629017", "0.62738216", "0.62587506", "0.61997354", "0.6177747", "0.61754835", "0.6151304", "0.6125984", "0.61073613", "0.60626596", "0.60537416", "0.6049678", "0.6023606", "0.60220426", "0.6021598", "0.6004726", "0.5991712", "0.59641206", "0.59609896", "0.5929122", "0.5880529", "0.58753586", "0.58648986", "0.5852028", "0.5847188", "0.5837251", "0.5829572", "0.58185214", "0.58146155", "0.58058304", "0.58001596", "0.579342", "0.57871425", "0.57820356", "0.57725215", "0.5746967", "0.5730541", "0.57142144", "0.5696469", "0.56834406", "0.5674745", "0.5670724", "0.5664263", "0.5659749", "0.56511945", "0.564943", "0.5646965", "0.5646752", "0.56407994", "0.5632488", "0.5624455", "0.5619648", "0.5617998", "0.5616979", "0.5610096", "0.56073576", "0.560591", "0.5601506", "0.5595715", "0.5594979", "0.55935687", "0.5572849", "0.5570723", "0.55669826", "0.5561461", "0.55531955", "0.5541878", "0.5539624", "0.5519205", "0.5516751", "0.5513373", "0.5509592", "0.5507802", "0.5502413", "0.5497924", "0.54956394", "0.5494961", "0.549258", "0.54905874", "0.5490232", "0.54894257", "0.5482029", "0.54679745", "0.54636115", "0.5463044", "0.5458261", "0.54571396", "0.5452945", "0.54527694", "0.54494804", "0.5444514", "0.5437382" ]
0.6928442
1
test that cache does operate with concurrent requests 1. perform many puts and gets on multiple threads
public void testConcurrency() throws InterruptedException { initCache(); final ArrayList<WMSTile> wcos = new ArrayList<WMSTile>(); final ArrayList<Integer> test = new ArrayList<Integer>(); final LinkedBlockingQueue<Integer> idxs = new LinkedBlockingQueue<Integer>(); Collection<Callable<Integer>> tasks = new ArrayList<Callable<Integer>>(); for (int i = 0; i < 30000; i++) { wcos.add(getDefaultWMSCacheObject("q" + i, 50, true)); test.add(-1); idxs.put(i); //put and get task tasks.add(new Callable<Integer>() { public Integer call() throws Exception { //put int i = idxs.take(); boolean ok = wmsCache.put(wcos.get(i).getQuery(), wcos.get(i).getColourmode(), PointType.POINT_1, wcos.get(i)); //get if (ok) { WMSTile wco = wmsCache.get(wcos.get(i).getQuery(), wcos.get(i).getColourmode(), PointType.POINT_1); if (wco.getCached()) { if (compareWMSObjects(wco, wcos.get(i))) { test.set(i, 1); } else { test.set(i, 0); } } } return i; } }); } ExecutorService executorService = Executors.newFixedThreadPool(100); executorService.invokeAll(tasks); //test cache cleaner operated correctly assertTrue(wmsCache.getSize() <= wmsCache.getMaxCacheSize()); //test for presence of invalid test comparisons int invalid = 0; int valid = 0; for (int i = 0; i < test.size(); i++) { if (test.get(i) == 0) { invalid++; } else if (test.get(i) == 1) { valid++; } } assertTrue(valid > 0); assertTrue(invalid == 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getCacheConcurrency();", "@Test\n public void testPutGet() {\n cache.put(\"A\", \"first\");\n cache.put(\"C\", \"second\");\n cache.put(\"C\", \"third\");\n \n assertEquals(\"first\", cache.get(\"A\"));\n assertEquals(\"third\", cache.get(\"C\"));\n }", "@Test\n\tpublic void sameThreadPoolDueToAffinity() throws Exception {\n\t\tString previousCore = null;\n\t\tfor (int i = 0; i < 100; i++) {\n\n\t\t\t// GET entry\n\t\t\tMockHttpResponse response = this.server.send(MockHttpServer.mockRequest(\"/\"));\n\t\t\tString html = response.getEntity(null);\n\t\t\tassertEquals(200, response.getStatus().getStatusCode(), \"Should be successful: \" + html);\n\n\t\t\t// Parse out the core\n\t\t\tPattern pattern = Pattern.compile(\".*CORE-(\\\\d+)-.*\", Pattern.DOTALL);\n\t\t\tMatcher matcher = pattern.matcher(html);\n\t\t\tassertTrue(matcher.matches(), \"Should be able to obtain thread affinity core\");\n\t\t\tString core = matcher.group(1);\n\n\t\t\t// Ensure same as previous core (ignoring first call)\n\t\t\tif (previousCore != null) {\n\t\t\t\tassertEquals(previousCore, core, \"Should be locked to same core\");\n\t\t\t}\n\n\t\t\t// Set up for next call\n\t\t\tpreviousCore = core;\n\t\t}\n\t}", "@Test(timeOut = 30_000)\n public void testValueLoaderWithLocking() throws Exception {\n //given\n final SpringRemoteCacheManager springRemoteCacheManager = new SpringRemoteCacheManager(remoteCacheManager);\n final SpringCache cache = springRemoteCacheManager.getCache(TEST_CACHE_NAME);\n\n CountDownLatch waitUntilThread1LocksValueGetter = new CountDownLatch(1);\n\n //when\n Future<String> thread1 = fork(() -> cache.get(\"test\", () -> {\n waitUntilThread1LocksValueGetter.countDown();\n// /TimeUnit.MILLISECONDS.sleep(10);\n return \"thread1\";\n }));\n\n Future<String> thread2 = fork(() -> {\n waitUntilThread1LocksValueGetter.await();\n return cache.get(\"test\", () -> \"thread2\");\n });\n\n String valueObtainedByThread1 = thread1.get();\n String valueObtainedByThread2 = thread2.get();\n\n Cache.ValueWrapper valueAfterGetterIsDone = cache.get(\"test\");\n\n //then\n assertNotNull(valueAfterGetterIsDone);\n assertEquals(\"thread1\", valueAfterGetterIsDone.get());\n assertEquals(\"thread1\", valueObtainedByThread1);\n assertEquals(\"thread1\", valueObtainedByThread2);\n }", "@Test\n public void readLockShareTest() throws InterruptedException {\n final TestUse testUse = new TestUse();\n int threadNum = 10;\n final CountDownLatch countDownLatch = new CountDownLatch(threadNum);\n final ConcurrentHashMap concurrentHashMap = new ConcurrentHashMap();\n for (int i = 0; i < threadNum; i++) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n boolean result = testUse.ifGetReadLockIn2Milliseconds();\n Assert.assertTrue(result);\n if (result) {\n concurrentHashMap.put(Thread.currentThread().getName(), \"value\");\n }\n countDownLatch.countDown();\n }\n }).start();\n }\n countDownLatch.await();\n Assert.assertEquals(threadNum, concurrentHashMap.size());\n }", "@Test\n public void iterateTests() throws Exception {\n final int nThreads = 100;\n ExecutorService executor = Executors.newFixedThreadPool(nThreads);\n final AtomicReference<Throwable> ex = new AtomicReference<>(null);\n final int nTasks = 10_000;\n final CountDownLatch latch = new CountDownLatch(nTasks);\n final ConcurrentHashMap<Integer, Future<?>> map = new ConcurrentHashMap<>();\n for (int i = 0; i < nTasks; i++) {\n final int j = i;\n map.put(j, executor.submit(new Runnable() {\n public void run() {\n try {\n testSubmitSilentWithParamMutation();\n testSubmitSilentWithParamMutationUncacheable();\n } catch (Throwable t) {\n ex.compareAndSet(null, t);\n } finally {\n latch.countDown();\n map.remove(j);\n }\n }}));\n }\n System.out.println(\"Waiting on latch\");\n while (!latch.await(30, TimeUnit.SECONDS)) {\n System.out.println(\"Waiting, \" + latch.getCount() + \" outstanding\");\n System.out.println(\"Waiting keys \" + map.keySet());\n }\n executor.shutdown();\n System.out.println(\"Waiting, on executor\");\n executor.awaitTermination(30, TimeUnit.SECONDS);\n executor.shutdownNow();\n if (ex.get() != null) {\n Assert.assertNull(ex.get());\n }\n }", "@Test\r\n\tpublic void testIntegerCache_2() {\n\t\tRandomOrgCache<String[]> c = rocs[0].createIntegerCache(5, 50, 100, false, 16, 5);\r\n\t\tc.stop();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tc.get();\r\n\t\t\tcollector.addError(new Error(\"should have thrown NoSuchElementException\"));\r\n\t\t} catch (NoSuchElementException e) {}\r\n\t\t\r\n\t\tcollector.checkThat(c.isPaused(), equalTo(true));\r\n\t\tc.resume();\r\n\t\t\r\n\t\tString[] got = null;\r\n\t\t\r\n\t\t// Testing RandomOrgCache function get()\r\n\t\twhile (got == null) {\r\n\t\t\ttry {\r\n\t\t\t\tgot = c.get();\r\n\t\t\t} catch (NoSuchElementException e) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(50);\r\n\t\t\t\t} catch (InterruptedException e1) {\r\n\t\t\t\t\tcollector.addError(new Error(\"shouldn't have been interrupted!\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcollector.checkThat(got, notNullValue());\r\n\t}", "@Test\n\tpublic void testQueryCaching(){\n\t\tqueryCache();\n\t\tqueryCache2();\n\t}", "@Test\n public void testCoh3710_get()\n {\n doExpiryOpTest(new Runnable()\n {\n public void run()\n {\n assertNull(getNamedCache(getCacheName0()).get(Integer.valueOf(1)));\n }\n });\n }", "@Test\n public void testSet() throws InterruptedException {\n\n final String k = \"mLock\";\n final String v = \"mValue\";\n\n// long l = 10;\n// Boolean isGetLock = redisTemplate.opsForValue().setIfAbsent(k, v, l, TimeUnit.SECONDS);\n// if (isGetLock) {\n// System.out.println(Thread.currentThread().getName() + \"获得锁成功\");\n// }\n\n\n// redisTemplate.opsForValue().set(\"k6\", \"v6\");\n// Duration duration = Duration.ofSeconds(10);\n// redisTemplate.expire(k, duration);\n// TimeUnit.SECONDS.sleep(10);\n// for (int i = 0; i < 100; i++) {\n// new Thread(() -> {\n// Boolean isGetLock = redisTemplate.opsForValue().setIfAbsent(k, v, 100, TimeUnit.SECONDS);\n//\n// if (isGetLock) {\n// System.out.println(Thread.currentThread().getName() + \"获得锁成功\");\n// } else {\n// System.out.println(Thread.currentThread().getName() + \"获得锁失败\");\n// }\n// }, \"thread-\" + i).start();\n// }\n\n for (int i = 0; i < 100; i++) {\n String key = \"kk\" +i;\n String value = \"vv\" + i;\n\n redisTemplate.opsForValue().set(key, value);\n// new Thread(new Task(key, value, redisTemplate)).start();\n// new Thread(() -> {\n// System.out.println(\"set \" + key + \":\" +value);\n// redisTemplate.opsForValue().set(key, value);\n//\n// if(key.equals(\"kk99\")) {\n// System.out.println(\"haha\");\n// }\n// }).start();\n }\n }", "@Test\n public void testParallelOnce() {\n final int count = 100000;\n final int threads = 4;\n final int perThread = count / threads;\n Cache<Integer, Integer> c =\n builder()\n .entryCapacity(-1)\n .weigher((key, value) -> value)\n .maximumWeight(MAX_VALUE)\n .build();\n AtomicInteger offset = new AtomicInteger();\n Runnable inserter = () -> {\n int start = offset.getAndAdd(perThread);\n int end = start + perThread;\n for (int i = start; i < end; i++) {\n c.put(i, i);\n }\n for (int i = start; i < end; i++) {\n c.remove(i);\n }\n };\n ThreadingStressTester tst = new ThreadingStressTester();\n tst.setOneShotMode(true);\n tst.setOneShotTimeoutMillis(MAX_FINISH_WAIT_MILLIS);\n tst.addTask(threads, inserter);\n tst.run();\n assertThat(getInfo().getTotalWeight())\n .as(\"total weight is 0\")\n .isEqualTo(0);\n }", "@Test\n\tpublic void test3() throws InterruptedException {\n\t\tDeadElementCallBack<String, Integer> callback = new DeadElementCallBack<String, Integer>() {\n\n\t\t\t@Override\n\t\t\tpublic void notify(String key, Integer elements) {\n\t\t\t}\n\t\t}; \n\t\tLRUCache<String, Integer> cache = new LRUCache<String, Integer>(2000, 2, callback);\n\t\tcache.put(\"hello\", 1);\n\t\tcache.put(\"yo\", 2);\n\t\tcache.put(\"hola\", 4);\n\t\tThread.sleep(1500);\n\t\tcache.get(\"yo\"); // Using a value.\n\t\tThread.sleep(1000);\n\t\tcache.put(\"sup\", 3);\n\t\tassertTrue(cache.size() == 3);\n\t\tassertTrue(cache.get(\"sup\") != null);\n\t\tassertTrue(cache.get(\"yo\") != null);\n\t}", "@Test\r\n\tpublic void testBlobCache() {\n\t\tRandomOrgCache<String[]> c = rocs[1].createBlobCache(5, 8);\r\n\t\tc.stop();\r\n\r\n\t\ttry {\r\n\t\t\tc.get();\r\n\t\t\tcollector.addError(new Error(\"should have thrown NoSuchElementException\"));\r\n\t\t} catch (NoSuchElementException e) {}\r\n\t\t\r\n\t\tc.resume();\r\n\t\t\r\n\t\tString[] got = null;\r\n\t\t\r\n\t\twhile (got == null) {\r\n\t\t\ttry {\r\n\t\t\t\tgot = c.get();\r\n\t\t\t} catch (NoSuchElementException e) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(50);\r\n\t\t\t\t} catch (InterruptedException e1) {\r\n\t\t\t\t\tcollector.addError(new Error(\"shouldn't have been interrupted!\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcollector.checkThat(got, notNullValue());\r\n\t}", "private void run() {\n m_store = new SimpleCache<Integer, Car>(CacheTemplateDemo.class.getName(), 4000, this);\n m_store.setExpireCacheCheck(1000);\n TestThread thread = new TestThread();\n thread.start();\n try {\n thread.join();\n } catch (InterruptedException excep) {\n excep.printStackTrace();\n }\n System.out.println(\"Finished\");\n }", "@Test\n public void writeLockIsolationTest() throws InterruptedException {\n final TestUse testUse = new TestUse();\n final ConcurrentHashMap concurrentHashMap = new ConcurrentHashMap();\n int threadNum = 50;\n final CountDownLatch countDownLatch = new CountDownLatch(threadNum);\n for (int i = 0; i < threadNum; i++) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n concurrentHashMap.put(testUse.minusCountInWriteLock(), \"value\");\n countDownLatch.countDown();\n }\n }).start();\n }\n countDownLatch.await();\n Assert.assertEquals(950, testUse.count);\n }", "@Test\n public void testSameKeyAccessDiffCacheMulti()\n {\n doStressTest(\"IdxTestSKADCM\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(oKeyNatural, oKeyNatural);\n }\n },\n /*nServers*/3, /*cRollingRestart*/0);\n }", "private static void useCachedThreadPool() {\n ExecutorService executor = Executors.newCachedThreadPool();\n\n System.out.println(((ThreadPoolExecutor) executor).getActiveCount());\n\n\n executor.execute(() -> {\n System.out.println(\"==========\");\n });\n\n System.out.println(((ThreadPoolExecutor) executor).getActiveCount());\n\n IntStream.range(0, 100).boxed().forEach(i -> {\n executor.execute(() -> {\n sleepSeconds(10);\n System.out.println(Thread.currentThread().getName() + \"[\" + i + \"]\");\n });\n });\n sleepSeconds(1);\n System.out.println(((ThreadPoolExecutor) executor).getActiveCount());\n }", "public void testSizeManagementWMS() {\n initCache();\n \n ArrayList<WMSTile> wcos = new ArrayList<WMSTile>();\n long putSize = 0;\n long maxSize = 0;\n int cacheSizeDropCount = 0;\n for (int i = 0; i < 1000; i++) {\n WMSTile wco = getDefaultWMSCacheObject(\"q\" + i, 50, true);\n putSize += wco.getSize();\n\n wcos.add(wco);\n long size = wmsCache.getSize();\n\n if (size < maxSize) {\n maxSize = size;\n cacheSizeDropCount++;\n } else {\n maxSize = size;\n }\n\n boolean result = wmsCache.put(wco.getQuery(), wco.getColourmode(), PointType.POINT_1, wco);\n\n //test if cache is full the put was unsuccessful\n //allow for cachecleaner to have reduced the size between put and test\n boolean test = (wmsCache.getSize() + wco.getSize() > wmsCache.getMaxCacheSize()) == !result;\n if (test == false) {\n assertTrue((size + wco.getSize() > wmsCache.getMaxCacheSize()) == !result);\n }\n\n assertTrue(wmsCache.getSize() <= wmsCache.getMaxCacheSize());\n }\n\n //test size calcuations are operating\n assertTrue(putSize > 10000);\n\n //test cache cleaner was run more than once\n assertTrue(cacheSizeDropCount > 1);\n\n //test cache size is under max\n assertTrue(wmsCache.getSize() <= wmsCache.getMaxCacheSize());\n\n //test gets. Anything that is a placeholder will be null.\n int cachedCount = 0;\n for (int i = 0; i < wcos.size(); i++) {\n WMSTile getwco = wmsCache.get(wcos.get(i).getQuery(), wcos.get(i).getColourmode(), PointType.POINT_1);\n if (getwco.getCached()) {\n assertTrue(compareWMSObjects(wcos.get(i), getwco));\n cachedCount++;\n }\n }\n\n //test if at least 2 objects were cached at the end\n assertTrue(cachedCount > 1);\n }", "public void testDiskIO() {\n DiskIOThreadPool threadPool = cache.getThreadPool();\n final int N = 103 + rng.nextInt(256);\n byte[][] data = new byte[N][];\n byte[][] key = new byte[N][];\n NodeID[] id = new NodeID[N];\n\n PutBack[] putBack = new PutBack[N];\n for (int i = 0; i < N; i++) {\n int len = 64 + rng.nextInt(128);\n data[i] = new byte[len];\n rng.nextBytes(data[i]);\n key[i] = sha1.digest(data[i]);\n id[i] = new NodeID(key[i]);\n putBack[i] = new PutBack();\n cache.acceptWriteJob(id[i], data[i], putBack[i]);\n }\n waitForCallBacks(putBack);\n for (int i = 0; i < N ; i++) {\n assertEquals(\"callback \" + i + \" not OK: \",\n CallBack.OK, putBack[i].status);\n }\n GetBack[] getBack = new GetBack[N];\n for (int i = 0; i < N; i++) {\n getBack[i] = new GetBack();\n cache.acceptReadJob(id[i], getBack[i]);\n }\n waitForCallBacks(getBack);\n for (int i = 0; i < N ; i++ ) {\n assertEquals(CallBack.OK, getBack[i].status);\n byte[] diskData = getBack[i].data;\n assertNotNull(diskData);\n assertEquals(data[i].length, diskData.length);\n for (int j = 0; j < data[i].length; j++)\n assertEquals (\"data[\" + i + \"][\" + j + \"] discrepency: \",\n data[i][j], diskData[j]);\n }\n }", "@Test\n public void testInsertAndEvict() {\n final int count = 100000;\n final int threads = 4;\n final int perThread = count / threads;\n Cache<Integer, Integer> c =\n builder()\n .entryCapacity(-1)\n .weigher((key, value) -> value)\n .maximumWeight(100)\n .build();\n AtomicInteger offsetInsert = new AtomicInteger();\n Runnable inserter = () -> {\n int start = offsetInsert.getAndAdd(perThread);\n int end = start + perThread;\n for (int i = start; i < end; i++) {\n c.put(i, i);\n }\n };\n ThreadingStressTester tst = new ThreadingStressTester();\n tst.setTestTimeMillis(4000);\n tst.addTask(threads, inserter);\n tst.run();\n for (int k : c.keys()) {\n c.remove(k);\n }\n assertThat(getInfo().getTotalWeight())\n .as(\"total weight is 0\")\n .isEqualTo(0);\n }", "@Test\n public void testConcurrentMapClearAndRegionPutOperation() {\n try {\n CacheUtils.getCache();\n isInitDone = false;\n Query q =\n qs.newQuery(\"SELECT DISTINCT * FROM \" + SEPARATOR + \"portfolio where status = 'active'\");\n QueryObserverHolder.setInstance(new QueryObserverAdapter() {\n\n @Override\n public void afterIndexLookup(Collection coll) {\n indexUsed = true;\n }\n\n @Override\n public void beforeRerunningIndexCreationQuery() {\n // Spawn a separate thread here which does a put opertion on region\n Thread th = new Thread(() -> {\n // Assert that the size of region is now 0\n assertTrue(region.size() == 0);\n region.put(\"\" + 8, new Portfolio(8));\n });\n th.start();\n ThreadUtils.join(th, 30 * 1000);\n assertTrue(region.size() == 1);\n }\n });\n SelectResults set = (SelectResults) q.execute();\n if (set.size() == 0 || !indexUsed) {\n fail(\"Either Size of the result set is zero or Index is not used \");\n }\n indexUsed = false;\n region.clear();\n set = (SelectResults) q.execute();\n if (set.size() != 1 || !indexUsed) {\n fail(\"Either Size of the result set is not one or Index is not used \");\n }\n } catch (Exception e) {\n e.printStackTrace();\n fail(e.toString());\n } finally {\n isInitDone = false;\n CacheUtils.restartCache();\n }\n }", "public void testCache() {\n MethodKey m = new MethodKey(\"aclass\", \"amethod\", new Object[]{1, \"fads\", new Object()});\n String mValue = \"my fancy value\";\n MethodKey m1 = new MethodKey(\"aclass\", \"amethod1\", new Object[]{1, \"fads\", new Object()});\n String mValue1 = \"my fancy value1\";\n MethodKey m2 = new MethodKey(\"aclass\", \"amethod2\", new Object[]{1, \"fads\", new Object()});\n String mValue2 = \"my fancy value2\";\n\n GenericCache.setValue(m, mValue);\n GenericCache.setValue(m1, mValue1);\n GenericCache.setValue(m2, mValue2);\n\n assertEquals(GenericCache.getValue(m), mValue);\n assertEquals(GenericCache.getValue(m1), mValue1);\n assertEquals(GenericCache.getValue(m2), mValue2);\n }", "long getCacheHits();", "@Test\n public void testFindViaCache() {\n Integer hitRate1 = hitRate;\n Integer foundId = accessPointDimensionDao.foreignKeyValueFor(connection, AccessPointIdentifier.TEST);\n assertEquals(hitRate1, hitRate); // No change expected yet\n \n Integer hitRate2 = hitRate;\n Integer foundId2 = accessPointDimensionDao.foreignKeyValueFor(connection, AccessPointIdentifier.TEST);\n assertEquals(hitRate, new Integer(hitRate2+1)); // A cache hit is expected\n }", "@InSequence(10)\n @Test\n @OperateOnDeployment(\"dep1\")\n public void wakeUpCacheA() throws IOException {\n getCache();\n }", "@Test\n public void testSameKeyAccessDiffCache()\n {\n doStressTest(\"IdxTestSKADC\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(oKeyNatural, oKeyNatural);\n }\n },\n /*nServers*/1, /*cRollingRestart*/0);\n }", "@Test\n public void testCollidingKeyAccessDiffCache()\n {\n doStressTest(\"IdxTestCKADC\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(\n oKeyNatural, getSurrogateKey(cache, oKeyNatural, Base.getRandom().nextInt(20)));\n }\n },\n /*nServers*/1, /*cRollingRestart*/0);\n }", "@Test\n public void testCoh3710_containsKey()\n {\n doExpiryOpTest(new Runnable()\n {\n public void run()\n {\n assertFalse(getNamedCache(getCacheName0()).containsKey(Integer.valueOf(1)));\n }\n });\n }", "@Test\n public void writeTryLockSuccessTest() throws InterruptedException {\n final TestUse testUse = new TestUse();\n final ConcurrentHashMap concurrentHashMap = new ConcurrentHashMap();\n int threadNum = 5;\n final CountDownLatch countDownLatch = new CountDownLatch(threadNum);\n for (int i = 0; i < threadNum; i++) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n testUse.minusCountInWriteTryLock();\n countDownLatch.countDown();\n }\n }).start();\n }\n countDownLatch.await();\n Assert.assertNotSame(1000, testUse.count);\n }", "protected void doStressTest_(String sTest, String sCacheMain, String sCacheAux,\n ValueExtractor extractor, final CompositeKeyCreator keyCreator,\n int nServers, int cRollingRestart)\n {\n boolean fRollingRestart = cRollingRestart > 0;\n MemberHandler memberHandler = new MemberHandler(\n CacheFactory.ensureCluster(), sTest,\n /*fExternalKill*/true, /*fGraceful*/true);\n for (int i = 0; i < nServers; i++)\n {\n memberHandler.addServer();\n }\n\n final EntryProcessor processor = new BackdoorMutatingProcessor(sCacheAux);\n final NamedCache cache0 = getNamedCache(sCacheMain);\n final NamedCache cache1 = getNamedCache(sCacheAux);\n final boolean[] afExiting = fRollingRestart ? new boolean[1] : null;\n\n DistributedCacheService service = (DistributedCacheService) cache0.getCacheService();\n Eventually.assertThat(invoking(service).getOwnershipEnabledMembers().size(), is(nServers));\n\n cache0.addIndex(extractor, false, null);\n if (cache0 != cache1)\n {\n cache1.addIndex(extractor, false, null);\n }\n\n class LoadThread\n extends Thread\n {\n public void run()\n {\n Random rand = new Random();\n for (int i = 0; afExiting != null ? !afExiting[0] : i < 5000; i++)\n {\n Object oKey = Integer.valueOf(rand.nextInt(25));\n cache0.invoke(keyCreator.getCompositeKey(oKey, cache0), processor);\n }\n }\n }\n\n Thread thd0 = new LoadThread();\n Thread thd1 = new LoadThread();\n Thread thd2 = new LoadThread();\n Thread thd3 = new LoadThread();\n Thread thd4 = new LoadThread();\n\n thd0.start();\n thd1.start();\n thd2.start();\n thd3.start();\n thd4.start();\n\n if (fRollingRestart)\n {\n doRollingRestart(memberHandler, cRollingRestart, new WaitForNodeSafeRunnable(service));\n Eventually.assertThat(invoking(service).getOwnershipEnabledMembers().size(), is(nServers));\n\n afExiting[0] = true;\n }\n\n try\n {\n thd0.join();\n thd1.join();\n thd2.join();\n thd3.join();\n thd4.join();\n }\n catch (InterruptedException e)\n {\n fail(\"test was interrupted: \" + e);\n }\n\n assertFalse(\"Expected changes to \" + cache1.getCacheName()\n + \" are not present\", cache1.isEmpty());\n\n validateIndex(cache0);\n if (cache0 != cache1)\n {\n validateIndex(cache1);\n }\n\n memberHandler.dispose();\n }", "@RequestMapping(\"/syncAddRedisValue\")\n public void syncAddRedisValue(){\n ExecutorService pool = Executors.newFixedThreadPool(100);\n for(int i = 0 ; i < 100; i++){\n pool.execute(new Runnable() {\n @Override\n public void run() {\n try {\n Thread.currentThread().sleep(4000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n redisByJedisUtil.incr(\"yang\");\n System.out.println(Thread.currentThread().getName() + \" 执行结束!\");\n }\n });\n }\n pool.shutdown();\n }", "@Test\n public void testBug35945() throws Exception {\n PORT1 = server1.invoke(HAInterestTestCase::createServerCache);\n server1.invoke(HAInterestTestCase::createEntriesK1andK2);\n createClientPoolCacheConnectionToSingleServer(getName(),\n getServerHostName(server1.getHost()));\n registerK1AndK2();\n verifyRefreshedEntriesFromServer();\n\n server1.invoke(HAInterestTestCase::stopServer);\n verifyDeadAndLiveServers(1, 0);\n // put on stopped server\n server1.invoke(HAInterestTestCase::putK1andK2);\n // spawn a thread to put on server , which will acquire a lock on entry\n setClientServerObserverForBeforeInterestRecovery();\n server1.invoke(HAInterestTestCase::startServer);\n verifyDeadAndLiveServers(0, 1);\n waitForBeforeInterestRecoveryCallBack();\n // verify updated value of k1 as a refreshEntriesFromServer\n final Region r1 = cache.getRegion(SEPARATOR + REGION_NAME);\n assertNotNull(r1);\n\n WaitCriterion wc = new WaitCriterion() {\n private String excuse;\n\n @Override\n public boolean done() {\n Entry e1 = r1.getEntry(k1);\n Entry e2 = r1.getEntry(k2);\n Object v1 = null;\n if (e1 != null) {\n try {\n v1 = e1.getValue();\n } catch (EntryDestroyedException ignore) {\n // handled to fix GEODE-296\n }\n }\n if (e1 == null || !server_k1_updated.equals(v1)) {\n excuse = \"v1=\" + v1;\n return false;\n }\n Object v2 = null;\n if (e2 != null) {\n try {\n v2 = e2.getValue();\n } catch (EntryDestroyedException ignore) {\n // handled to fix GEODE-296\n }\n }\n if (e2 == null || !server_k2.equals(v2)) {\n excuse = \"v2=\" + v2;\n return false;\n }\n return true;\n }\n\n @Override\n public String description() {\n return excuse;\n }\n };\n GeodeAwaitility.await().untilAsserted(wc);\n }", "@Test\n public void testRandomAccessSameCache()\n {\n doStressTest(\"IdxTestRASC\", getCacheName0(), getCacheName0(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(oKeyNatural, Base.getRandom().nextInt(20));\n }\n },\n /*nServers*/1, /*cRollingRestart*/0);\n }", "@Test\n public void testCompactRangeIndexOnPR() {\n Host host = Host.getHost(0);\n VM vm0 = host.getVM(0);\n VM vm1 = host.getVM(1);\n VM vm2 = host.getVM(2);\n VM vm3 = host.getVM(3);\n setCacheInVMs(vm0, vm1, vm2, vm3);\n vm0.invoke(helper.getCacheSerializableRunnableForPRAccessorCreate(regionName, redundancy,\n Portfolio.class));\n\n vm1.invoke(\n helper.getCacheSerializableRunnableForPRCreate(regionName, redundancy, Portfolio.class));\n\n vm2.invoke(\n helper.getCacheSerializableRunnableForPRCreate(regionName, redundancy, Portfolio.class));\n\n vm3.invoke(\n helper.getCacheSerializableRunnableForPRCreate(regionName, redundancy, Portfolio.class));\n\n vm0.invoke(helper.getCacheSerializableRunnableForPRIndexCreate(regionName, indexName,\n indexedExpression, fromClause, alias));\n\n\n AsyncInvocation<?>[] asyncInvs = new AsyncInvocation[12];\n\n asyncInvs[0] =\n vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize));\n\n asyncInvs[1] = vm1.invokeAsync(\n helper.getCacheSerializableRunnableForPRRandomOps(regionName, stepSize, (2 * stepSize)));\n\n asyncInvs[2] = vm2.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (2 * stepSize), (3 * stepSize)));\n\n asyncInvs[3] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (3 * (stepSize)), totalDataSize));\n\n asyncInvs[4] =\n vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize));\n\n asyncInvs[5] = vm1.invokeAsync(\n helper.getCacheSerializableRunnableForPRRandomOps(regionName, stepSize, (2 * stepSize)));\n\n asyncInvs[6] = vm2.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (2 * stepSize), (3 * stepSize)));\n\n asyncInvs[7] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (3 * (stepSize)), totalDataSize));\n\n asyncInvs[8] =\n vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize));\n\n asyncInvs[9] = vm1.invokeAsync(\n helper.getCacheSerializableRunnableForPRRandomOps(regionName, stepSize, (2 * stepSize)));\n\n asyncInvs[10] = vm2.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (2 * stepSize), (3 * stepSize)));\n\n asyncInvs[11] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName,\n (3 * (stepSize)), totalDataSize));\n\n for (AsyncInvocation<?> inv : asyncInvs) {\n ThreadUtils.join(inv, 60 * 000);\n }\n\n for (AsyncInvocation<?> inv : asyncInvs) {\n if (inv.exceptionOccurred()) {\n Assert.fail(\"Random region operation failed on VM_\" + inv.getId(), inv.getException());\n }\n }\n vm0.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));\n\n vm1.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));\n\n vm2.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));\n\n vm3.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));\n }", "@Test\n public void testCoh3710_getAll()\n {\n doExpiryOpTest(new Runnable()\n {\n public void run()\n {\n assertEquals(NullImplementation.getMap(),\n getNamedCache(getCacheName0()).getAll(\n Collections.singleton(Integer.valueOf(1))));\n }\n });\n }", "@Test\n public void readTryLockShareTest() throws InterruptedException {\n final TestUse testUse = new TestUse();\n final CountDownLatch countDownLatch = new CountDownLatch(5);\n final List<Integer> result = new ArrayList<Integer>();\n for (int i = 0; i < 5; i++) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n Integer r = testUse.getCountInReadTryLock(2000);\n if(r!=null){\n result.add(r);\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n countDownLatch.countDown();\n }\n }).start();\n }\n countDownLatch.await();\n Assert.assertEquals(5, result.size());\n }", "@Test\n public void testSecondChance() {\n cache.put(\"A\", \"first\");\n cache.put(\"B\", \"second\");\n cache.put(\"C\", \"third\");\n cache.put(\"D\", \"fourth\");\n cache.put(\"E\", \"fifth\");\n cache.get(\"A\");\n cache.get(\"B\");\n cache.put(\"F\", \"sixth\");\n cache.put(\"G\", \"seventh\");\n \n assertEquals(\"first\", cache.get(\"A\"));\n assertEquals(\"second\", cache.get(\"B\"));\n assertNull(cache.get(\"C\"));\n }", "@Test\n public void testCoh3710()\n {\n doExpiryOpTest(new Runnable()\n {\n public void run() { getNamedCache(getCacheName0()).clear(); }\n });\n }", "@Test\r\n public void testThreaded() throws Exception {\r\n\r\n final ClientValue<Integer> value = new ClientValue<>();\r\n\r\n List<SetCheckValue> runs = new ArrayList<>();\r\n\r\n for (int i = 0; i < 500; i++) {\r\n runs.add(new SetCheckValue(value, i, false));\r\n }\r\n runAll(runs);\r\n checkForSuccess(runs);\r\n for (int i = 0; i < 500; i++) {\r\n runs.add(new SetCheckValue(value, i, true));\r\n }\r\n\r\n runAll(runs);\r\n checkForSuccess(runs);\r\n }", "@Test\n public void testGetElementJavaPerfTest() throws Exception {\n\n Status somethingThatIsSerializable = Status.STATUS_ALIVE;\n byte[] serializedForm = MemoryEfficientByteArrayOutputStream.serialize(somethingThatIsSerializable).getBytes();\n\n assertEquals(404, HttpUtil.get(\"http://localhost:9090/ehcache/rest/sampleCache2/1\").getResponseCode());\n\n net.sf.ehcache.server.soap.jaxws.Element element = new net.sf.ehcache.server.soap.jaxws.Element();\n element.setKey(\"1\");\n element.setValue(serializedForm);\n cacheService.put(\"sampleCache2\", element);\n\n long begin = System.currentTimeMillis();\n for (int i = 0; i < 100; i++) {\n HttpURLConnection urlConnection = HttpUtil.get(\"http://localhost:9090/ehcache/rest/sampleCache2/1\");\n assertEquals(200, urlConnection.getResponseCode());\n }\n long end = System.currentTimeMillis();\n LOG.info(\"Get time: \" + (end - begin) / 100f);\n }", "public void testPut() {\n title();\n for (int i = 1; i <= TestEnv.parallelism; i++) {\n this.parallelism = i;\n super.testPut();\n }\n }", "public void testPutGetWMS() {\n initCache();\n \n //test a cache put and get\n WMSTile wco1 = getDefaultWMSCacheObject(\"q1\", 100, true);\n wmsCache.put(wco1.getQuery(), wco1.getColourmode(), PointType.POINT_001, wco1);\n\n WMSTile wco2 = getDefaultWMSCacheObject(\"q2\", 100, true);\n wmsCache.put(wco2.getQuery(), wco2.getColourmode(), PointType.POINT_001, wco2);\n\n //test get returns the correct object\n assertTrue(compareWMSObjects(wmsCache.get(wco1.getQuery(), wco1.getColourmode(), PointType.POINT_001), wco1));\n assertTrue(compareWMSObjects(wmsCache.get(wco2.getQuery(), wco2.getColourmode(), PointType.POINT_001), wco2));\n\n //get from cache an object that does not exist returns a placeholder\n WMSTile wcop = wmsCache.get(\"\", \"\", PointType.POINT_00001);\n assertNotNull(wcop);\n assertTrue(!wcop.getCached());\n }", "@SuppressWarnings(\"unchecked\")\n\t\tpublic void run() {\n long throughputMeasurementStartTime = System.currentTimeMillis();\n\n byte[] reply;\n int reqId;\n int req = 0;\n\n Storage st = new Storage(nTXs);\n\n System.out.println(\"Executing experiment for \" + nTXs + \" ops\");\n\n for (int i = 0; i < nTXs; i++, req++) {\n long last_send_instant = System.nanoTime();\n if (dos) {\n reqId = proxy.generateRequestId((readOnly) ? TOMMessageType.UNORDERED_REQUEST : TOMMessageType.ORDERED_REQUEST); \n proxy.TOMulticast(request, reqId, (readOnly) ? TOMMessageType.UNORDERED_REQUEST : TOMMessageType.ORDERED_REQUEST); \n\n } else {\n \tif(readOnly) {\n \t\treply = proxy.invokeUnordered(request);\n \t} else {\n \t\treply = proxy.invokeOrdered(request);\n \t}\n }\n st.store(System.nanoTime() - last_send_instant);\n\n if (timeout > 0) {\n //sleeps timeout ms before sending next request\n try {\n\t\t\t\t\t\tThread.sleep(timeout);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n } \n\n } \n writeReportJSON(throughputMeasurementStartTime, st); \n }", "@Test(dataProvider = \"uris\")\n void testWithCustomSubscriber(String uri) throws Exception {\n HttpClient client = HttpClient.newBuilder().sslContext(sslContext).build();\n\n Map<HttpRequest, String> requests = new HashMap<>();\n for (int i=0;i<CONCURRENT_REQUESTS; i++) {\n HttpRequest request = HttpRequest.newBuilder(URI.create(uri + \"?\" + i))\n .build();\n requests.put(request, BODIES[i]);\n }\n\n // initial connection to seed the cache so next parallel connections reuse it\n client.sendAsync(HttpRequest.newBuilder(URI.create(uri)).build(), discard(null)).join();\n\n // will reuse connection cached from the previous request ( when HTTP/2 )\n CompletableFuture.allOf(requests.keySet().parallelStream()\n .map(request -> client.sendAsync(request, CustomSubscriber.handler))\n .map(cf -> cf.thenCompose(ConcurrentResponses::assert200ResponseCode))\n .map(cf -> cf.thenCompose(response -> assertbody(response, requests.get(response.request()))))\n .toArray(CompletableFuture<?>[]::new))\n .join();\n }", "@Test\r\n\tpublic void testIntegerSequenceCache_2() {\n\t\tRandomOrgCache<String[][]> c = rocs[0].createIntegerSequenceCache(2, 5, 0, 10, false, 16, 3);\r\n\t\tc.stop();\r\n\r\n\t\ttry {\r\n\t\t\tc.get();\r\n\t\t\tcollector.addError(new Error(\"should have thrown NoSuchElementException\"));\r\n\t\t} catch (NoSuchElementException e) {}\r\n\t\t\r\n\t\tc.resume();\r\n\t\t\r\n\t\tString[][] got = null;\r\n\t\t\r\n\t\twhile (got == null) {\r\n\t\t\ttry {\r\n\t\t\t\tgot = c.get();\r\n\t\t\t} catch (NoSuchElementException e) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(50);\r\n\t\t\t\t} catch (InterruptedException e1) {\r\n\t\t\t\t\tcollector.addError(new Error(\"shouldn't have been interrupted!\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcollector.checkThat(got, notNullValue());\r\n\t}", "@Test\n public void testInsertRemoveSeparate() {\n final int count = 100000;\n final int threads = 4;\n final int perThread = count / threads;\n Cache<Integer, Integer> c =\n builder()\n .entryCapacity(-1)\n .weigher((key, value) -> value)\n .maximumWeight(MAX_VALUE)\n .build();\n AtomicInteger offsetInsert = new AtomicInteger();\n AtomicInteger offsetRemove = new AtomicInteger();\n Runnable inserter = () -> {\n int start = offsetInsert.getAndAdd(perThread);\n int end = start + perThread;\n for (int i = start; i < end; i++) {\n c.put(i, i);\n }\n };\n Runnable remover = () -> {\n int start = offsetRemove.getAndAdd(perThread);\n int end = start + perThread;\n for (int i = start; i < end; i++) {\n c.remove(i);\n }\n };\n ThreadingStressTester tst = new ThreadingStressTester();\n tst.setTestTimeMillis(4000);\n tst.addTask(threads, inserter);\n tst.addTask(threads, remover);\n tst.run();\n for (int k : c.keys()) {\n c.remove(k);\n }\n assertThat(getInfo().getTotalWeight())\n .as(\"total weight is 0\")\n .isEqualTo(0);\n }", "private static void testLongLoop() {\n test(1000 * 1000 * 1000);\n //uncomment the following line to see the hand-written cache performance\n //testManual( 1000 * 1000 * 1000 );\n }", "private static void testLongLoop() {\n test(1000 * 1000 * 1000);\n //uncomment the following line to see the hand-written cache performance\n //testManual( 1000 * 1000 * 1000 );\n }", "@Test(dataProvider = \"uris\")\n void testAsString(String uri) throws Exception {\n HttpClient client = HttpClient.newBuilder().sslContext(sslContext).build();\n\n Map<HttpRequest, String> requests = new HashMap<>();\n for (int i=0;i<CONCURRENT_REQUESTS; i++) {\n HttpRequest request = HttpRequest.newBuilder(URI.create(uri + \"?\" + i))\n .build();\n requests.put(request, BODIES[i]);\n }\n\n // initial connection to seed the cache so next parallel connections reuse it\n client.sendAsync(HttpRequest.newBuilder(URI.create(uri)).build(), discard(null)).join();\n\n // will reuse connection cached from the previous request ( when HTTP/2 )\n CompletableFuture.allOf(requests.keySet().parallelStream()\n .map(request -> client.sendAsync(request, asString()))\n .map(cf -> cf.thenCompose(ConcurrentResponses::assert200ResponseCode))\n .map(cf -> cf.thenCompose(response -> assertbody(response, requests.get(response.request()))))\n .toArray(CompletableFuture<?>[]::new))\n .join();\n }", "private CacheWrapper<AccessPointIdentifier, Integer> createCache() {\n return new CacheWrapper<AccessPointIdentifier, Integer>() {\n \n @Override\n public void put(AccessPointIdentifier key, Integer value) {\n cache.put(key, value);\n }\n \n @Override\n public Integer get(AccessPointIdentifier key) {\n if (cache.containsKey(key)) {\n hitRate++;\n }\n return cache.get(key);\n }\n \n \n };\n }", "@InSequence(20)\n @Test\n @OperateOnDeployment(\"dep2\")\n public void wakeUpCacheB() throws IOException {\n waitForSync();\n getCache();\n }", "@Test\n public void testPutDel() {\n cache.put(\"A\", \"first\");\n cache.put(\"B\", \"second\");\n cache.put(\"C\", \"third\");\n cache.put(\"D\", \"fourth\");\n cache.put(\"E\", \"fifth\");\n cache.del(\"A\");\n cache.del(\"B\");\n cache.put(\"F\", \"sixth\");\n cache.put(\"G\", \"seventh\");\n\n assertEquals(\"third\", cache.get(\"C\"));\n assertEquals(\"fourth\", cache.get(\"D\"));\n assertEquals(\"fifth\", cache.get(\"E\"));\n assertEquals(\"sixth\", cache.get(\"F\"));\n assertEquals(\"seventh\", cache.get(\"G\"));\n assertNull(cache.get(\"A\"));\n }", "@Test\n public void testClientPut() {\n GridCacheDynamicLoadOnClientTest.clientNode.cache(GridCacheDynamicLoadOnClientTest.PERSON_CACHE).put((-100), new GridCacheDynamicLoadOnClientTest.Person((-100), \"name-\"));\n Assert.assertEquals(((GridCacheDynamicLoadOnClientTest.CACHE_ELEMENT_COUNT) + 1), GridCacheDynamicLoadOnClientTest.clientNode.cache(GridCacheDynamicLoadOnClientTest.PERSON_CACHE).size());\n }", "@Test\r\n\tpublic void testIntegerSequenceCache_1() {\n\t\tRandomOrgCache<int[][]> c = rocs[0].createIntegerSequenceCache(2, 5, 0, 10);\r\n\t\tc.stop();\r\n\r\n\t\ttry {\r\n\t\t\tc.get();\r\n\t\t\tcollector.addError(new Error(\"should have thrown NoSuchElementException\"));\r\n\t\t} catch (NoSuchElementException e) {}\r\n\t\t\r\n\t\tc.resume();\r\n\t\t\r\n\t\tint[][] got = null;\r\n\t\t\r\n\t\twhile (got == null) {\r\n\t\t\ttry {\r\n\t\t\t\tgot = c.get();\r\n\t\t\t} catch (NoSuchElementException e) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(50);\r\n\t\t\t\t} catch (InterruptedException e1) {\r\n\t\t\t\t\tcollector.addError(new Error(\"shouldn't have been interrupted!\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcollector.checkThat(got, notNullValue());\r\n\t}", "private void getCache(Context context) throws IOException {\n\t\t // Read file from distributed caches - each line is a item/itemset with its frequent\n\n \t// get caches files.\n\t\tfor (int i = 0; i < 10; i++)\n\t\t\tSystem.out.println(\"SETUP ------ MAPPER ----------- GET FREQUENT ITEMS--------------\");\n\t\t\n\t\t\n\t\t// URI to locate cachefile, ex URI a = new URI(\"http://www.foo.com\");\n\t\tList<URI> uris = Arrays.asList(context.getCacheFiles());\n\t\t\n\t\tSystem.out.println(\"Reading cached files\");\n\t\t// read cache files which contains candidates?\n\t\t\n\t\tnItems = 0;\n\t\t\n\t\tfor (URI uri : uris) {\n\t\t\tPath p = new Path(uri);\n\t\t\tSystem.out.println(\"Loading \" + uri.toString());\n\t\t\tFileSystem fs = FileSystem.get(context.getConfiguration());\n\t\t\tInputStreamReader ir = new InputStreamReader(fs.open(p));\n\t\t\tBufferedReader data = new BufferedReader(ir);\n\t \twhile (data.ready()) { \t\t\n\t \t\tString line=data.readLine();\n\t \t\tif (line.matches(\"\\\\s*\")) continue; // be friendly with empty lines\n\t \t\tString[] numberStrings = line.split(\"\\t\");\n\t \t\t\n \n\t \t\tint frequentItem = Integer.parseInt(numberStrings[0]);\n \t\t\tif (!hashItems.containsKey(frequentItem)) {\n\t \t\t\t\thashItems.put(frequentItem, nItems);\n\t \t\t\t\tnItems++;\n\t \t\t\t}\n\t \t\t}\n\t \t\t\n\t \t} \n\n }", "@Test\r\n\tpublic void testStringCache() {\n\t\tRandomOrgCache<String[]> c = rocs[1].createStringCache(5, 5, \"abcds\");\r\n\t\tc.stop();\r\n\r\n\t\ttry {\r\n\t\t\tc.get();\r\n\t\t\tcollector.addError(new Error(\"should have thrown NoSuchElementException\"));\r\n\t\t} catch (NoSuchElementException e) {}\r\n\t\t\r\n\t\tc.resume();\r\n\t\t\r\n\t\tString[] got = null;\r\n\t\t\r\n\t\twhile (got == null) {\r\n\t\t\ttry {\r\n\t\t\t\tgot = c.get();\r\n\t\t\t} catch (NoSuchElementException e) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(50);\r\n\t\t\t\t} catch (InterruptedException e1) {\r\n\t\t\t\t\tcollector.addError(new Error(\"shouldn't have been interrupted!\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcollector.checkThat(got, notNullValue());\r\n\t}", "@Override\n public void start() {\n KeyValueLib.dataCenters.put(dataCenter1, 1);\n KeyValueLib.dataCenters.put(dataCenter2, 2);\n KeyValueLib.dataCenters.put(dataCenter3, 3);\n final RouteMatcher routeMatcher = new RouteMatcher();\n final HttpServer server = vertx.createHttpServer();\n server.setAcceptBacklog(32767);\n server.setUsePooledBuffers(true);\n server.setReceiveBufferSize(4 * 1024);\n\n mapPutLock = new ReentrantLock();\n getMap = new HashMap<String, PriorityQueue<String>>();\n queuePutLocks = new HashMap<String, ReentrantLock>();\n\n mapGetLock = new ReentrantLock();\n getMap = new HashMap<String, PriorityQueue<String>>();\n queueGetLocks = new ReentrantLock();\n\n dcLock = new HashMap<String, ReentrantLock>();\n keyLockMap = new HashMap<String, KeyLock>();\n\n routeMatcher.get(\"/put\", new Handler<HttpServerRequest>() {\n @Override\n public void handle(final HttpServerRequest req) {\n MultiMap map = req.params();\n final String key = map.get(\"key\");\n final String value = map.get(\"value\");\n // You may use the following timestamp for ordering requests\n final String timestamp = new Timestamp(\n System.currentTimeMillis() + TimeZone.getTimeZone(\"EST\").getRawOffset()).toString();\n\n // lock the map\n mapGetLock.lock();\n mapPutLock.lock();\n\n if (!putMap.containsKey(key)) {\n getMap.put(key, new PriorityQueue<String>());\n putMap.put(key, new PriorityQueue<String>());\n queueGetLocks.put(key, new ReentrantLock());\n queuePutLocks.put(key, new ReentrantLock());\n keyLockMap.put(key, new KeyLock());\n }\n\n putMap.get(key).add(timestamp);\n\n // unlock the map\n mapGetLock.unlock();\n mapPutLock.unlock();\n \n Thread t = new Thread(new Runnable() {\n public void run() {\n // TODO: Write code for PUT operation here.\n // Each PUT operation is handled in a different thread.\n // Highly recommended that you make use of helper\n // functions.\n }\n \n private void replicatePut(String key, String value, String timestamp) {\n queueGetLocks.get(key).lock();\n queuePutLocks.get(key).lock();\n \n while ((putMap.get(key).peek()!=null && !putMap.get(key).peek().equals(timestamp)) \n || (getMap.get(key).peek()!=null && Long.parseLong(getMap.get(key).peek()) > Long.parseLong(timestamp))) {\n \n queueGetLocks.get(key).unlock();\n queuePutLocks.get(key).unlock();\n try {\n synchronized (keyLockMap.get(key)) {\n keyLockMap.get(key).wait();\n }\n } catch(Exception e){\n \n }\n \n queueGetLocks.get(key).lock();\n queuePutLocks.get(key).lock();\n }\n \n queueGetLocks.get(key).unlock();\n queuePutLocks.get(key).unlock();\n\n try{\n KeyValueLib.PUT(dataCenter1, key, value);\n KeyValueLib.PUT(dataCenter2, key, value);\n KeyValueLib.PUT(dataCenter3, key, value);\n } catch (Exception e){\n System.out.println(\"Exception happens in Put\");\n }\n\n queuePutLocks.get(key).lock();\n putMap.get(key).remove(timestamp);\n queuePutLocks.get(key).unlock();\n \n keyLockMap.get(key).notifyAll();\n return;\n\n }\n\n \n });//runnable\n t.start();\n req.response().end(); // Do not remove this\n }\n });\n\n routeMatcher.get(\"/get\", new Handler<HttpServerRequest>() {\n @Override\n public void handle(final HttpServerRequest req) {\n MultiMap map = req.params();\n final String key = map.get(\"key\");\n final String loc = map.get(\"loc\");\n // You may use the following timestamp for ordering requests\n final String timestamp = new Timestamp(\n System.currentTimeMillis() + TimeZone.getTimeZone(\"EST\").getRawOffset()).toString();\n Thread t = new Thread(new Runnable() {\n public void run() {\n // TODO: Write code for GET operation here.\n // Each GET operation is handled in a different thread.\n // Highly recommended that you make use of helper\n // functions.\n req.response().end(\"0\"); // Default response = 0\n }\n });\n t.start();\n }\n });\n\n routeMatcher.get(\"/storage\", new Handler<HttpServerRequest>() {\n @Override\n public void handle(final HttpServerRequest req) {\n MultiMap map = req.params();\n storageType = map.get(\"storage\");\n // This endpoint will be used by the auto-grader to set the\n // consistency type that your key-value store has to support.\n // You can initialize/re-initialize the required data structures\n // here\n req.response().end();\n }\n });\n\n routeMatcher.noMatch(new Handler<HttpServerRequest>() {\n @Override\n public void handle(final HttpServerRequest req) {\n req.response().putHeader(\"Content-Type\", \"text/html\");\n String response = \"Not found.\";\n req.response().putHeader(\"Content-Length\", String.valueOf(response.length()));\n req.response().end(response);\n req.response().close();\n }\n });\n server.requestHandler(routeMatcher);\n server.listen(8080);\n }", "Builder withCacheConcurrency(int concurrency);", "@Test\n public void testCollidingKeyAccessDiffCacheMultiRollingRestart()\n {\n doStressTest(\"IdxTestCKADCMRR\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(\n oKeyNatural, getSurrogateKey(cache, oKeyNatural, Base.getRandom().nextInt(20)));\n }\n },\n /*nServers*/3, /*cRollingRestart*/5);\n }", "@Test\n public void testSameKeyAccessDiffCacheMultiRollingRestart()\n {\n doStressTest(\"IdxTestSKADCMRR\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(oKeyNatural, oKeyNatural);\n }\n },\n /*nServers*/3, /*cRollingRestart*/5);\n }", "@Test\n\tpublic void addNormalConcurrentTP10_1000() throws Exception {\n\t\tExecutorService exec = Executors.newFixedThreadPool(10);\n\t\tfinal AtomicInteger count = new AtomicInteger(0);\n\t\t\n\t\tretryManager.registerCallback(new RetryCallback() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean onEvent(RetryHolder retry) throws Exception {\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}, TYPE);\n\t\t\n\t\tfor (int i=0;i<1000;i++) {\n\t\t\texec.submit(new Runnable() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tRetryHolder holder = new RetryHolder(\"id-local\"+ count.getAndIncrement(), TYPE,new Exception(),\"Object\");\n\t\t\t\t\t\n\t\t\t\t\tretryManager.addRetry(holder);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\texec.shutdown();\n\t\texec.awaitTermination(10, TimeUnit.SECONDS);\n\t\tint localQueueSize = retryManager.getLocalQueuer().size(TYPE);\n\t\tAssert.assertEquals(0,localQueueSize);\n\t\tAssert.assertEquals(1000, retryManager.getH1().getMap(TYPE).size() );\n\t\t\t\t\n\t\t//synchronous add, check immediately\t\t\n\t\tfor (int i=0;i<1000;i++ ) {\n\t\t\tAssert.assertNotNull(\n\t\t\t\t\tretryManager.getH1().getMap(TYPE).get(\"id-local\"+i)\n\t\t\t\t\t);\n\t\t\tretryManager.removeRetry(\"id-local\"+i, TYPE);\n\t\t}\n\t\t\n\t}", "@Test\n public void multithreaded() throws Exception {\n Session session = mock(Session.class);\n DeduplicatingExecutor executor =\n new DeduplicatingExecutor(session, TimeUnit.SECONDS.toMillis(1L));\n BoundStatement statement = mock(BoundStatement.class);\n when(session.executeAsync(statement))\n .thenAnswer(invocationOnMock -> mock(ResultSetFuture.class));\n\n int loopCount = 1000;\n CountDownLatch latch = new CountDownLatch(loopCount);\n ExecutorService exec = Executors.newFixedThreadPool(10);\n\n Collection<ListenableFuture<?>> futures = new ConcurrentLinkedDeque<>();\n for (int i = 0; i < loopCount; i++) {\n exec.execute(() -> {\n futures.add(executor.maybeExecuteAsync(statement, \"foo\"));\n futures.add(executor.maybeExecuteAsync(statement, \"bar\"));\n latch.countDown();\n });\n }\n latch.await();\n\n ImmutableSet<ListenableFuture<?>> distinctFutures = ImmutableSet.copyOf(futures);\n\n assertThat(distinctFutures).hasSize(2);\n\n // expire the result\n Thread.sleep(1000L);\n\n // Sanity check: we don't memoize after we should have expired.\n assertThat(executor.maybeExecuteAsync(statement, \"foo\"))\n .isNotIn(distinctFutures);\n assertThat(executor.maybeExecuteAsync(statement, \"bar\"))\n .isNotIn(distinctFutures);\n }", "@Test\n\tpublic void testFetch_AddNewCacheFiles() throws FileNotFoundException {\n\n\t\tFIFOFileCache fifoFileCache = FIFOFileCache.getInstance();\n\t\tSystem.out.println(\"Inside the code I set HashMap size 4 So from the 5th element it is going to start FIFO implementation if new element will come\");\n\t\tString expected = \"This is File a.txt content.\";\n\t\tString actual = fifoFileCache.fetch(\"a.txt\");\n\t\tassertThat(actual, is(expected));\n\t}", "@PostConstruct\n public void initCache() {\n cache = Collections.synchronizedMap(new HashMap<>(cacheCapacity, 1));\n }", "@Test\n public void writeTryReadLockTest() throws InterruptedException {\n final TestUse testUse = new TestUse();\n int readThreadNum = 1;\n final CountDownLatch countDownLatch = new CountDownLatch(1);\n final List<Integer> result = new ArrayList<Integer>();\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n result.add(testUse.getCountInReadTryLock(2000));\n countDownLatch.countDown();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }).start();\n countDownLatch.await();\n Assert.assertEquals(1000, result.get(0).intValue());\n }", "long getCacheMisses();", "public interface ICache {\n\t\n\t/**\n\t * <p>\n\t * get the Cached Object from cache pool by the cache String key\n\t * @param key\n\t * @return\n\t */\n\tpublic Object get(String key);\n\t\n\t\n\t\n\t/**\n\t * <p>\n\t * \n\t * @param key\n\t * @return old cache object \n\t */\n\tpublic Object put(String key,Object value);\n\t\n\t/**\n\t * <p>\n\t * get the Cached Object from cache pool by the cache String key quietly,\n\t * without update the statistic data\n\t * @param key\n\t * @return\n\t */\n\tpublic Object getQuiet(String key);\n\t\n\t\n\t/**\n\t * <p>\n\t * remove the cached object from cache pool by the cache String key\n\t * @param key\n\t * @return\n\t */\n\tpublic Object remove(String key);\n\t\n\t/**\n\t * <p>\n\t * free specied size mem\n\t * @param size unit in Byte\n\t * @return\n\t */\n\tpublic long free(long size);\n\t\n\t\n\t/**\n\t * <p>\n\t * flush to the underly resource\n\t */\n\tpublic void flush();\n\t\n}", "private void updateCache(long counter) {\n vertx.eventBus().rxSend(\"posting::get\", null)\n .toObservable()\n /* TODO:\n * 1. Log received string\n * 2. Deserialize received string to List<Posting>\n * 3. Add exponential backoff using .retryWhen\n */\n .subscribe();\n\n }", "@Test\n public void testGetExecutionStatsLocked_Caching() {\n spyOn(mQuotaController);\n doNothing().when(mQuotaController).invalidateAllExecutionStatsLocked();\n\n final long now = JobSchedulerService.sElapsedRealtimeClock.millis();\n mQuotaController.saveTimingSession(0, \"com.android.test\",\n createTimingSession(now - (23 * HOUR_IN_MILLIS), 10 * MINUTE_IN_MILLIS, 5), false);\n mQuotaController.saveTimingSession(0, \"com.android.test\",\n createTimingSession(now - (7 * HOUR_IN_MILLIS), 10 * MINUTE_IN_MILLIS, 5), false);\n mQuotaController.saveTimingSession(0, \"com.android.test\",\n createTimingSession(now - (2 * HOUR_IN_MILLIS), 10 * MINUTE_IN_MILLIS, 5), false);\n mQuotaController.saveTimingSession(0, \"com.android.test\",\n createTimingSession(now - (6 * MINUTE_IN_MILLIS), 3 * MINUTE_IN_MILLIS, 5), false);\n final ExecutionStats originalStatsActive;\n final ExecutionStats originalStatsWorking;\n final ExecutionStats originalStatsFrequent;\n final ExecutionStats originalStatsRare;\n synchronized (mQuotaController.mLock) {\n originalStatsActive = mQuotaController.getExecutionStatsLocked(\n 0, \"com.android.test\", ACTIVE_INDEX);\n originalStatsWorking = mQuotaController.getExecutionStatsLocked(\n 0, \"com.android.test\", WORKING_INDEX);\n originalStatsFrequent = mQuotaController.getExecutionStatsLocked(\n 0, \"com.android.test\", FREQUENT_INDEX);\n originalStatsRare = mQuotaController.getExecutionStatsLocked(\n 0, \"com.android.test\", RARE_INDEX);\n }\n\n // Advance clock so that the working stats shouldn't be the same.\n advanceElapsedClock(MINUTE_IN_MILLIS);\n // Change frequent bucket size so that the stats need to be recalculated.\n setDeviceConfigLong(QcConstants.KEY_WINDOW_SIZE_FREQUENT_MS, 6 * HOUR_IN_MILLIS);\n\n ExecutionStats expectedStats = new ExecutionStats();\n expectedStats.allowedTimePerPeriodMs = originalStatsActive.allowedTimePerPeriodMs;\n expectedStats.windowSizeMs = originalStatsActive.windowSizeMs;\n expectedStats.jobCountLimit = originalStatsActive.jobCountLimit;\n expectedStats.sessionCountLimit = originalStatsActive.sessionCountLimit;\n expectedStats.expirationTimeElapsed = originalStatsActive.expirationTimeElapsed;\n expectedStats.executionTimeInWindowMs = originalStatsActive.executionTimeInWindowMs;\n expectedStats.bgJobCountInWindow = originalStatsActive.bgJobCountInWindow;\n expectedStats.executionTimeInMaxPeriodMs = originalStatsActive.executionTimeInMaxPeriodMs;\n expectedStats.bgJobCountInMaxPeriod = originalStatsActive.bgJobCountInMaxPeriod;\n expectedStats.sessionCountInWindow = originalStatsActive.sessionCountInWindow;\n expectedStats.inQuotaTimeElapsed = originalStatsActive.inQuotaTimeElapsed;\n final ExecutionStats newStatsActive;\n synchronized (mQuotaController.mLock) {\n newStatsActive = mQuotaController.getExecutionStatsLocked(\n 0, \"com.android.test\", ACTIVE_INDEX);\n }\n // Stats for the same bucket should use the same object.\n assertTrue(originalStatsActive == newStatsActive);\n assertEquals(expectedStats, newStatsActive);\n\n expectedStats.allowedTimePerPeriodMs = originalStatsWorking.allowedTimePerPeriodMs;\n expectedStats.windowSizeMs = originalStatsWorking.windowSizeMs;\n expectedStats.jobCountLimit = originalStatsWorking.jobCountLimit;\n expectedStats.sessionCountLimit = originalStatsWorking.sessionCountLimit;\n expectedStats.expirationTimeElapsed = originalStatsWorking.expirationTimeElapsed;\n expectedStats.executionTimeInWindowMs = originalStatsWorking.executionTimeInWindowMs;\n expectedStats.bgJobCountInWindow = originalStatsWorking.bgJobCountInWindow;\n expectedStats.sessionCountInWindow = originalStatsWorking.sessionCountInWindow;\n expectedStats.inQuotaTimeElapsed = originalStatsWorking.inQuotaTimeElapsed;\n final ExecutionStats newStatsWorking;\n synchronized (mQuotaController.mLock) {\n newStatsWorking = mQuotaController.getExecutionStatsLocked(\n 0, \"com.android.test\", WORKING_INDEX);\n }\n assertTrue(originalStatsWorking == newStatsWorking);\n assertNotEquals(expectedStats, newStatsWorking);\n\n expectedStats.allowedTimePerPeriodMs = originalStatsFrequent.allowedTimePerPeriodMs;\n expectedStats.windowSizeMs = originalStatsFrequent.windowSizeMs;\n expectedStats.jobCountLimit = originalStatsFrequent.jobCountLimit;\n expectedStats.sessionCountLimit = originalStatsFrequent.sessionCountLimit;\n expectedStats.expirationTimeElapsed = originalStatsFrequent.expirationTimeElapsed;\n expectedStats.executionTimeInWindowMs = originalStatsFrequent.executionTimeInWindowMs;\n expectedStats.bgJobCountInWindow = originalStatsFrequent.bgJobCountInWindow;\n expectedStats.sessionCountInWindow = originalStatsFrequent.sessionCountInWindow;\n expectedStats.inQuotaTimeElapsed = originalStatsFrequent.inQuotaTimeElapsed;\n final ExecutionStats newStatsFrequent;\n synchronized (mQuotaController.mLock) {\n newStatsFrequent = mQuotaController.getExecutionStatsLocked(\n 0, \"com.android.test\", FREQUENT_INDEX);\n }\n assertTrue(originalStatsFrequent == newStatsFrequent);\n assertNotEquals(expectedStats, newStatsFrequent);\n\n expectedStats.allowedTimePerPeriodMs = originalStatsRare.allowedTimePerPeriodMs;\n expectedStats.windowSizeMs = originalStatsRare.windowSizeMs;\n expectedStats.jobCountLimit = originalStatsRare.jobCountLimit;\n expectedStats.sessionCountLimit = originalStatsRare.sessionCountLimit;\n expectedStats.expirationTimeElapsed = originalStatsRare.expirationTimeElapsed;\n expectedStats.executionTimeInWindowMs = originalStatsRare.executionTimeInWindowMs;\n expectedStats.bgJobCountInWindow = originalStatsRare.bgJobCountInWindow;\n expectedStats.sessionCountInWindow = originalStatsRare.sessionCountInWindow;\n expectedStats.inQuotaTimeElapsed = originalStatsRare.inQuotaTimeElapsed;\n final ExecutionStats newStatsRare;\n synchronized (mQuotaController.mLock) {\n newStatsRare = mQuotaController.getExecutionStatsLocked(\n 0, \"com.android.test\", RARE_INDEX);\n }\n assertTrue(originalStatsRare == newStatsRare);\n assertEquals(expectedStats, newStatsRare);\n }", "public void testAsyncMapPutGet() throws Throwable {\n TestCluster<AsyncMap<String, String>> cluster = TestCluster.<AsyncMap<String, String>>builder()\n .withActiveMembers(3)\n .withPassiveMembers(2)\n .withUriFactory(id -> String.format(\"local://test%d\", id))\n .withClusterFactory(members -> new ClusterConfig().withProtocol(new LocalProtocol()).withMembers(members))\n .withResourceFactory(config -> AsyncMap.create(\"test\", config, new AsyncMapConfig().withLog(new BufferedLog())))\n .build();\n expectResume();\n cluster.open().thenRun(this::resume);\n await(5000);\n \n AsyncMap<String, String> map = cluster.activeResources().iterator().next();\n expectResume();\n map.put(\"foo\", \"Hello world!\").thenRun(() -> {\n map.get(\"foo\").thenAccept(result -> {\n threadAssertEquals(result, \"Hello world!\");\n resume();\n });\n });\n await(5000);\n }", "@Test\n public void testGetCacheControlDataExistsInPrivateCache() {\n MockHttpSession mockSession = new MockHttpSession();\n MockHttpServletRequest httpRequest = new MockHttpServletRequest();\n httpRequest.setSession(mockSession);\n MockHttpServletRequest nextHttpRequest = new MockHttpServletRequest();\n nextHttpRequest.setSession(mockSession);\n\n MockPortletWindowId portletWindowId = new MockPortletWindowId(\"123\");\n MockPortletDefinitionId portletDefinitionId = new MockPortletDefinitionId(789);\n\n // use private cache\n when(portletDescriptor.getCacheScope()).thenReturn(\"private\");\n when(portletDescriptor.getExpirationCache()).thenReturn(300);\n\n when(portletWindowRegistry.getPortletWindow(httpRequest, portletWindowId))\n .thenReturn(portletWindow);\n when(portletWindowRegistry.getPortletWindow(nextHttpRequest, portletWindowId))\n .thenReturn(portletWindow);\n when(portletWindow.getPortletWindowId()).thenReturn(portletWindowId);\n when(portletWindow.getPortletEntity()).thenReturn(portletEntity);\n when(portletWindow.getWindowState()).thenReturn(WindowState.NORMAL);\n when(portletWindow.getPortletMode()).thenReturn(PortletMode.VIEW);\n when(portletEntity.getPortletDefinitionId()).thenReturn(portletDefinitionId);\n when(portletDefinitionRegistry.getParentPortletDescriptor(portletDefinitionId))\n .thenReturn(portletDescriptor);\n\n when(urlSyntaxProvider.getPortalRequestInfo(httpRequest)).thenReturn(portalRequestInfo);\n\n final CacheState<CachedPortletData<PortletRenderResult>, PortletRenderResult> cacheState =\n cacheControlService.getPortletRenderState(httpRequest, portletWindowId);\n final CacheControl cacheControl = cacheState.getCacheControl();\n assertFalse(cacheControl.isPublicScope());\n\n cacheControl.setETag(\"123456\");\n\n final PortletRenderResult portletResult = new PortletRenderResult(\"title\", null, 0, 1);\n final String content = \"<p>Cached content</p>\";\n\n final CachedPortletData<PortletRenderResult> cachedPortletData =\n new CachedPortletData<PortletRenderResult>(\n portletResult,\n content,\n null,\n null,\n cacheControl.isPublicScope(),\n cacheControl.getETag(),\n -2);\n\n cacheControlService.cachePortletRenderOutput(\n portletWindowId, nextHttpRequest, cacheState, cachedPortletData);\n\n when(urlSyntaxProvider.getPortalRequestInfo(nextHttpRequest)).thenReturn(portalRequestInfo);\n\n final CacheState<CachedPortletData<PortletRenderResult>, PortletRenderResult>\n afterCacheState =\n cacheControlService.getPortletRenderState(nextHttpRequest, portletWindowId);\n // retrieve cachecontrol again, and return should have etag set\n // note using 'nextHttpRequest'\n Assert.assertEquals(\"123456\", afterCacheState.getCacheControl().getETag());\n }", "public void testSimpleConcurrentPercolator() throws Exception {\n assertAcked(prepareCreate(\"index\").addMapping(\"type\", \"field1\", \"type=long\", \"field2\", \"type=string\")); // random # shards better has a mapping!\n ensureGreen();\n\n final BytesReference onlyField1 = XContentFactory.jsonBuilder().startObject().startObject(\"doc\")\n .field(\"field1\", 1)\n .endObject().endObject().bytes();\n final BytesReference onlyField2 = XContentFactory.jsonBuilder().startObject().startObject(\"doc\")\n .field(\"field2\", \"value\")\n .endObject().endObject().bytes();\n final BytesReference bothFields = XContentFactory.jsonBuilder().startObject().startObject(\"doc\")\n .field(\"field1\", 1)\n .field(\"field2\", \"value\")\n .endObject().endObject().bytes();\n\n client().prepareIndex(\"index\", \"type\", \"1\").setSource(XContentFactory.jsonBuilder().startObject()\n .field(\"field1\", 1)\n .field(\"field2\", \"value\")\n .endObject()).execute().actionGet();\n\n client().prepareIndex(\"index\", PercolatorService.TYPE_NAME, \"test1\")\n .setSource(XContentFactory.jsonBuilder().startObject().field(\"query\", termQuery(\"field2\", \"value\")).endObject())\n .execute().actionGet();\n client().prepareIndex(\"index\", PercolatorService.TYPE_NAME, \"test2\")\n .setSource(XContentFactory.jsonBuilder().startObject().field(\"query\", termQuery(\"field1\", 1)).endObject())\n .execute().actionGet();\n refresh(); // make sure it's refreshed\n\n final CountDownLatch start = new CountDownLatch(1);\n final AtomicBoolean stop = new AtomicBoolean(false);\n final AtomicInteger counts = new AtomicInteger(0);\n final AtomicReference<Throwable> exceptionHolder = new AtomicReference<>();\n Thread[] threads = new Thread[scaledRandomIntBetween(2, 5)];\n final int numberOfPercolations = scaledRandomIntBetween(1000, 10000);\n\n for (int i = 0; i < threads.length; i++) {\n Runnable r = new Runnable() {\n @Override\n public void run() {\n try {\n start.await();\n while (!stop.get()) {\n int count = counts.incrementAndGet();\n if ((count > numberOfPercolations)) {\n stop.set(true);\n }\n PercolateResponse percolate;\n if (count % 3 == 0) {\n percolate = client().preparePercolate().setIndices(\"index\").setDocumentType(\"type\")\n .setSource(bothFields)\n .execute().actionGet();\n assertThat(percolate.getMatches(), arrayWithSize(2));\n assertThat(convertFromTextArray(percolate.getMatches(), \"index\"), arrayContainingInAnyOrder(\"test1\", \"test2\"));\n } else if (count % 3 == 1) {\n percolate = client().preparePercolate().setIndices(\"index\").setDocumentType(\"type\")\n .setSource(onlyField2)\n .execute().actionGet();\n assertThat(percolate.getMatches(), arrayWithSize(1));\n assertThat(convertFromTextArray(percolate.getMatches(), \"index\"), arrayContaining(\"test1\"));\n } else {\n percolate = client().preparePercolate().setIndices(\"index\").setDocumentType(\"type\")\n .setSource(onlyField1)\n .execute().actionGet();\n assertThat(percolate.getMatches(), arrayWithSize(1));\n assertThat(convertFromTextArray(percolate.getMatches(), \"index\"), arrayContaining(\"test2\"));\n }\n }\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n } catch (Throwable e) {\n exceptionHolder.set(e);\n Thread.currentThread().interrupt();\n }\n }\n };\n threads[i] = new Thread(r);\n threads[i].start();\n }\n\n start.countDown();\n for (Thread thread : threads) {\n thread.join();\n }\n\n Throwable assertionError = exceptionHolder.get();\n if (assertionError != null) {\n assertionError.printStackTrace();\n }\n assertThat(assertionError + \" should be null\", assertionError, nullValue());\n }", "@Test\n public void testCipherCache() throws Exception {\n Cipher cipher = Cipher.getInstance(\"AES/OFB8/NoPadding\"); // corresponds to the protection initialized above\n long start = System.currentTimeMillis();\n for(int i=0; i<max; i++) {\n cipher.init(Cipher.ENCRYPT_MODE, key, iv); \n byte[] ciphertext = cipher.doFinal(plaintext);\n }\n long stop = System.currentTimeMillis();\n log.debug(\"testCipherCache {} ms\", stop-start);\n }", "@Test\n public void iterateTestsSame() throws Exception {\n final int nThreads = 100;\n ExecutorService executor = Executors.newFixedThreadPool(nThreads);\n final AtomicReference<Throwable> ex = new AtomicReference<>(null);\n final int nTasks = 10_000;\n final CountDownLatch latch = new CountDownLatch(nTasks);\n final ConcurrentHashMap<Integer, String> map = new ConcurrentHashMap<>();\n for (int i = 0; i < nTasks; i++) {\n final int j = i;\n executor.submit(new Runnable() {\n public void run() {\n try {\n map.put(j, \"foo\");\n testSubmitSilentWithParamMutationSameCommand(new Consumer<String>() {\n @Override\n public void accept(String s) {\n map.remove(j);\n if (\"FAIL\".equals(s)) {\n ex.compareAndSet(null, new Exception(\"WE HAD AN ERROR in \" + j));\n }\n }\n }\n );\n } catch (Throwable t) {\n ex.compareAndSet(null, t);\n } finally {\n latch.countDown();\n }\n }});\n }\n System.out.println(\"Waiting on latch\");\n while (!latch.await(30, TimeUnit.SECONDS)) {\n System.out.println(\"Waiting, \" + latch.getCount() + \" outstanding\");\n System.out.println(\"Waiting keys \" + map.keySet().size());\n }\n executor.shutdown();\n System.out.println(\"Waiting, on executor\");\n executor.awaitTermination(30, TimeUnit.SECONDS);\n executor.shutdownNow();\n if (ex.get() != null) {\n // If this fails, there has been at least one error.\n Assert.assertNull(ex.get());\n }\n }", "@Test\n void highConcurrencyOnSingleConnection() {\n SingleConnection singleConnection =\n options.getSingleConnectionFactory().apply(\"localhost\", server.httpPort());\n assumeTrue(singleConnection != null);\n\n int count = 50;\n String method = \"GET\";\n String path = \"/success\";\n URI uri = resolveAddress(path);\n\n CountDownLatch latch = new CountDownLatch(1);\n ExecutorService pool = Executors.newFixedThreadPool(4);\n for (int i = 0; i < count; i++) {\n int index = i;\n Runnable job =\n () -> {\n try {\n latch.await();\n } catch (InterruptedException e) {\n throw new AssertionError(e);\n }\n try {\n Integer result =\n testing.runWithSpan(\n \"Parent span \" + index,\n () -> {\n Span.current().setAttribute(\"test.request.id\", index);\n return singleConnection.doRequest(\n path,\n Collections.singletonMap(\"test-request-id\", String.valueOf(index)));\n });\n assertThat(result).isEqualTo(200);\n } catch (Throwable throwable) {\n if (throwable instanceof AssertionError) {\n throw (AssertionError) throwable;\n }\n throw new AssertionError(throwable);\n }\n };\n pool.submit(job);\n }\n latch.countDown();\n\n List<Consumer<TraceAssert>> assertions = new ArrayList<>();\n for (int i = 0; i < count; i++) {\n assertions.add(\n trace -> {\n SpanData rootSpan = trace.getSpan(0);\n // Traces can be in arbitrary order, let us find out the request id of the current one\n int requestId = Integer.parseInt(rootSpan.getName().substring(\"Parent span \".length()));\n\n trace.hasSpansSatisfyingExactly(\n span ->\n span.hasName(rootSpan.getName())\n .hasKind(SpanKind.INTERNAL)\n .hasNoParent()\n .hasAttributesSatisfyingExactly(\n equalTo(AttributeKey.longKey(\"test.request.id\"), requestId)),\n span -> assertClientSpan(span, uri, method, 200, null).hasParent(rootSpan),\n span ->\n assertServerSpan(span)\n .hasParent(trace.getSpan(1))\n .hasAttributesSatisfyingExactly(\n equalTo(AttributeKey.longKey(\"test.request.id\"), requestId)));\n });\n }\n\n testing.waitAndAssertTraces(assertions);\n\n pool.shutdown();\n }", "public void testFairPutWithTake() {\n final SynchronousQueue q = new SynchronousQueue(true);\n Thread t = new Thread(new Runnable() {\n public void run() {\n int added = 0;\n try {\n q.put(new Object());\n ++added;\n q.put(new Object());\n ++added;\n q.put(new Object());\n ++added;\n q.put(new Object());\n ++added;\n\t\t\tthreadShouldThrow();\n } catch (InterruptedException e){\n assertTrue(added >= 1);\n }\n }\n });\n try {\n t.start();\n Thread.sleep(SHORT_DELAY_MS);\n q.take();\n Thread.sleep(SHORT_DELAY_MS);\n t.interrupt();\n t.join();\n } catch (Exception e){\n unexpectedException();\n }\n }", "@Test\n public void test5() throws Exception {\n CuratorFramework client = ZKConfig.getClient();\n final NodeCache nodeCache = new NodeCache(client, \"/test/test1\", false);\n nodeCache.getListenable().addListener(new NodeCacheListener() {\n @Override\n public void nodeChanged() throws Exception {\n logger.info(\"getCurrentData:\" + nodeCache.getCurrentData());\n logger.info(\"stat : \"+nodeCache.getCurrentData().getStat());\n logger.info(\"path : \"+nodeCache.getCurrentData().getPath());\n logger.info(\"data : \"+new String(nodeCache.getCurrentData().getData()));\n }\n });\n nodeCache.start();\n while(true);\n }", "@Test\n public void eternal_retry0s() {\n Cache<Integer, Integer> c = new Cache2kBuilder<Integer, Integer>() {}\n .eternal(true)\n .retryInterval(0, TimeUnit.SECONDS)\n /* ... set loader ... */\n .build();\n target.setCache(c);\n assertTrue(extractHandler() instanceof TimingHandler.EternalImmediate);\n }", "@Test\n public void testCoh3710_size()\n {\n doExpiryOpTest(new Runnable()\n {\n public void run()\n {\n assertEquals(0, getNamedCache(getCacheName0()).size());\n }\n });\n }", "@Test\r\n\tpublic void testIntegerSequenceCache_3() {\n\t\tRandomOrgCache<int[][]> c = rocs[0].createIntegerSequenceCache(4, LENGTH, MIN, MAX);\r\n\t\tc.stop();\r\n\r\n\t\ttry {\r\n\t\t\tc.get();\r\n\t\t\tcollector.addError(new Error(\"should have thrown NoSuchElementException\"));\r\n\t\t} catch (NoSuchElementException e) {}\r\n\t\t\r\n\t\tc.resume();\r\n\t\t\r\n\t\tint[][] got = null;\r\n\t\t\r\n\t\twhile (got == null) {\r\n\t\t\ttry {\r\n\t\t\t\tgot = c.get();\r\n\t\t\t} catch (NoSuchElementException e) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(50);\r\n\t\t\t\t} catch (InterruptedException e1) {\r\n\t\t\t\t\tcollector.addError(new Error(\"shouldn't have been interrupted!\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcollector.checkThat(got, notNullValue());\r\n\t}", "void cache(String key, T value) throws IOException;", "@SuppressWarnings(\"unused\")\n\t@Override\n\tpublic void run() {\n\t\tList<LineageCacheEntry> lockedOrLiveEntries = new ArrayList<>();\n\t\tint count = 0;\n\n\t\t// Stop if 1) Evicted the request number of entries, 2) The parallel\n\t\t// CPU instruction is ended, and 3) No non-live entries left in the cache.\n\t\tlong t0 = DMLScript.STATISTICS ? System.nanoTime() : 0;\n\t\t/*while (!LineageGPUCacheEviction.isGPUCacheEmpty())\n\t\t{\n\t\t\tif (LineageCacheConfig.STOPBACKGROUNDEVICTION)\n\t\t\t\t// This logic reduces #evictions if the cpu instructions is so small\n\t\t\t\t// that it ends before the background thread reaches this condition.\n\t\t\t\t// However, this check decreases race conditions.\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tif (numEvicts > 0 && count > numEvicts)\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tLineageCacheEntry le = LineageGPUCacheEviction.pollFirstEntry();\n\t\t\tGPUObject cachedGpuObj = le.getGPUObject();\n\t\t\tGPUObject headGpuObj = cachedGpuObj.lineageCachedChainHead != null\n\t\t\t\t\t? cachedGpuObj.lineageCachedChainHead : cachedGpuObj;\n\t\t\t// Check and continue if any object in the linked list is locked\n\t\t\tboolean lockedOrLive = false;\n\t\t\tGPUObject nextgpuObj = headGpuObj;\n\t\t\twhile (nextgpuObj!= null) {\n\t\t\t\tif (!nextgpuObj.isrmVarPending() || nextgpuObj.isLocked()) // live or locked\n\t\t\t\t\tlockedOrLive = true;\n\t\t\t\tnextgpuObj = nextgpuObj.nextLineageCachedEntry;\n\t\t\t}\n\t\t\tif (lockedOrLive) {\n\t\t\t\tlockedOrLiveEntries.add(le);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// TODO: First remove the gobj chains that don't contain any live and dirty objects.\n\t\t\t//currentAvailableMemory += headGpuObj.getSizeOnDevice();\n\n\t\t\t// Copy from device to host for all live and dirty objects\n\t\t\tboolean copied = false;\n\t\t\tnextgpuObj = headGpuObj;\n\t\t\twhile (nextgpuObj!= null) {\n\t\t\t\t// Keeping isLinCached as True here will save data deletion by copyFromDeviceToHost\n\t\t\t\tif (!nextgpuObj.isrmVarPending() && nextgpuObj.isDirty()) { //live and dirty\n\t\t\t\t\tnextgpuObj.copyFromDeviceToHost(null, true, true);\n\t\t\t\t\tcopied = true;\n\t\t\t\t}\n\t\t\t\tnextgpuObj.setIsLinCached(false);\n\t\t\t\tnextgpuObj = nextgpuObj.nextLineageCachedEntry;\n\t\t\t}\n\n\t\t\t// Copy from device cache to CPU lineage cache if not already copied\n\t\t\tLineageGPUCacheEviction.copyToHostCache(le, null, copied);\n\n\t\t\t// For all the other objects, remove and clear data (only once)\n\t\t\tnextgpuObj = headGpuObj;\n\t\t\tboolean freed = false;\n\t\t\tsynchronized (nextgpuObj.getGPUContext().getMemoryManager().getGPUMatrixMemoryManager().gpuObjects) {\n\t\t\t\twhile (nextgpuObj!= null) {\n\t\t\t\t\t// If not live or live but not dirty\n\t\t\t\t\tif (nextgpuObj.isrmVarPending() || !nextgpuObj.isDirty()) {\n\t\t\t\t\t\tif (!freed) {\n\t\t\t\t\t\t\tnextgpuObj.clearData(null, true);\n\t\t\t\t\t\t\t//FIXME: adding to rmVar cache causes multiple failures due to concurrent\n\t\t\t\t\t\t\t//access to the rmVar cache and other data structures. VariableCP instruction\n\t\t\t\t\t\t\t//and other instruction free memory and add to rmVar cache in parallel to\n\t\t\t\t\t\t\t//the background eviction task, which needs to be synchronized.\n\t\t\t\t\t\t\tfreed = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnextgpuObj.clearGPUObject();\n\t\t\t\t\t}\n\t\t\t\t\tnextgpuObj = nextgpuObj.nextLineageCachedEntry;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Clear the GPUOjects chain\n\t\t\tGPUObject currgpuObj = headGpuObj;\n\t\t\twhile (currgpuObj.nextLineageCachedEntry != null) {\n\t\t\t\tnextgpuObj = currgpuObj.nextLineageCachedEntry;\n\t\t\t\tcurrgpuObj.lineageCachedChainHead = null;\n\t\t\t\tcurrgpuObj.nextLineageCachedEntry = null;\n\t\t\t\tnextgpuObj.lineageCachedChainHead = null;\n\t\t\t\tcurrgpuObj = nextgpuObj;\n\t\t\t}\n\n\t\t\t//if(currentAvailableMemory >= size)\n\t\t\t\t// This doesn't guarantee allocation due to fragmented freed memory\n\t\t\t//\tA = cudaMallocNoWarn(tmpA, size, null); \n\t\t\tif (DMLScript.STATISTICS) {\n\t\t\t\tLineageCacheStatistics.incrementGpuAsyncEvicts();\n\t\t\t}\n\t\t\tcount++;\n\t\t}\n\n\t\t// Add the locked entries back to the eviction queue\n\t\tif (!lockedOrLiveEntries.isEmpty())\n\t\t\tLineageGPUCacheEviction.addEntryList(lockedOrLiveEntries);\n\t\t\n\t\tif (DMLScript.STATISTICS) //TODO: dedicated statistics for lineage\n\t\t\tGPUStatistics.cudaEvictTime.add(System.nanoTime() - t0); */\n\t}", "@Test\r\n\tpublic void testConcurentUpdate() throws InterruptedException, ExecutionException{\r\n\t\tfinal Annotations annos = new Annotations();\r\n\t\t// Apply these annos to this node.\r\n\t\tannos.setId(KeyFactory.keyToString(node.getId()));\r\n\t\tannos.addAnnotation(\"stringKey\", \"String\");\r\n\t\t\r\n\t\tLoopingAnnotaionsWoker workerOne = new LoopingAnnotaionsWoker(dboAnnotationsDao, 10, annos);\r\n\t\tLoopingAnnotaionsWoker workerTwo = new LoopingAnnotaionsWoker(dboAnnotationsDao, 10, annos);\r\n\t\t// Start both workers\r\n\t\tExecutorService pool = Executors.newFixedThreadPool(2);\r\n\t\tFuture<Boolean> furtureOne = pool.submit(workerOne);\r\n\t\tFuture<Boolean> furtureTwo = pool.submit(workerTwo);\r\n\t\t// Wait for the threads to finish.\r\n\r\n\t\tassertTrue(furtureOne.get());\r\n\t\tassertTrue(furtureTwo.get());\r\n\r\n\t\t// There should be no duplication.\r\n\t\tAnnotations clone = dboAnnotationsDao.getAnnotations(node.getId());\r\n\t\t// There should be no duplication.\r\n\t\tassertNotNull(clone);\r\n\t\tCollection list = clone.getAllValues(\"stringKey\");\r\n\t\tassertNotNull(list);\r\n\t\tassertEquals(\"There should only be one value for this annotations. That means multiple threads caused duplication!\", 1, list.size());\r\n\t\tassertEquals(\"String\", list.iterator().next() );\r\n\t}", "@Override\n\tpublic void run() {\n\t\tfor (int i=0; i<10; i++){\n\t\t\tstorage.put();\n\t\t}\n\t}", "public void testForNThreads();", "public void cacheResult(java.util.List<DataEntry> dataEntries);", "@Test\n public void testGetAll() throws Exception {\n JumpCloneImplant existing;\n Map<Integer, Map<Integer, JumpCloneImplant>> listCheck = new HashMap<>();\n\n existing = new JumpCloneImplant(jumpCloneID, typeID);\n existing.setup(testAccount, 7777L);\n existing = CachedData.update(existing);\n listCheck.put(jumpCloneID, new HashMap<>());\n listCheck.get(jumpCloneID)\n .put(typeID, existing);\n\n existing = new JumpCloneImplant(jumpCloneID + 10, typeID + 10);\n existing.setup(testAccount, 7777L);\n existing = CachedData.update(existing);\n listCheck.put(jumpCloneID + 10, new HashMap<>());\n listCheck.get(jumpCloneID + 10)\n .put(typeID + 10, existing);\n\n // Associated with different account\n existing = new JumpCloneImplant(jumpCloneID, typeID);\n existing.setup(otherAccount, 7777L);\n CachedData.update(existing);\n\n // Not live at the given time\n existing = new JumpCloneImplant(jumpCloneID + 3, typeID + 3);\n existing.setup(testAccount, 9999L);\n CachedData.update(existing);\n\n // EOL before the given time\n existing = new JumpCloneImplant(jumpCloneID + 4, typeID + 4);\n existing.setup(testAccount, 7777L);\n existing.evolve(null, 7977L);\n CachedData.update(existing);\n\n List<JumpCloneImplant> result = CachedData.retrieveAll(8888L,\n (contid, at) -> JumpCloneImplant.accessQuery(testAccount,\n contid, 1000,\n false, at,\n AttributeSelector.any(),\n AttributeSelector.any()));\n Assert.assertEquals(listCheck.size(), result.size());\n for (JumpCloneImplant next : result) {\n int jumpCloneID = next.getJumpCloneID();\n int typeID = next.getTypeID();\n Assert.assertTrue(listCheck.containsKey(jumpCloneID));\n Assert.assertTrue(listCheck.get(jumpCloneID)\n .containsKey(typeID));\n Assert.assertEquals(listCheck.get(jumpCloneID)\n .get(typeID), next);\n }\n\n }", "@Test\n public void testConsumerAccessExceptionDuringBatchRun() throws ExecutionException, InterruptedException {\n List<Chunk> chunkList = new ArrayList<>();\n //generate chunks\n int numOfChunksToUpload = 1000;\n while (numOfChunksToUpload > 0) {\n chunkList.add(generateChunk(10));\n numOfChunksToUpload--;\n }\n\n //Start a producer thread\n ExecutorService executorService = Executors.newFixedThreadPool(2);\n ProducerThread producerThread = new ProducerThread(\"Producer1\", chunkList, 20, new ApplicationService());\n Future<String> producerResult = executorService.submit(producerThread);\n //Wait for batch run to start\n Thread.sleep(10);\n //Start a consumer thread in parallel\n Future<String> result = executorService.submit(new ConsumerThread(\"Consumer1\", 1, new ApplicationService()));\n //Consumer threads gets null value of instrument id price\n assertNull(result.get());\n log.info(\"Producer result:\" + producerResult.get());\n\n }", "public void testNewCachedThreadPool2() {\n final ExecutorService e = Executors.newCachedThreadPool(new SimpleThreadFactory());\n try (PoolCleaner cleaner = cleaner(e)) {\n e.execute(new NoOpRunnable());\n e.execute(new NoOpRunnable());\n e.execute(new NoOpRunnable());\n }\n }", "protected void handleGets(final CommandMessage command, final Channel channel) {\n final Future<CacheElement[]> futureResponse = cache.get(Collections.<Key>singleton(command.key));\r\n commandQueue.enqueueFutureResponse(new AsyncGetMultiCommand(command, channel, futureResponse));\r\n }", "@Test\n public void eternal() {\n Cache<Integer, Integer> c = new Cache2kBuilder<Integer, Integer>() {}\n .eternal(true)\n /* ... set loader ... */\n .build();\n target.setCache(c);\n assertTrue(extractHandler() instanceof TimingHandler.EternalImmediate);\n }", "@Test\n void shouldIncrementCounter100kTimes() throws InterruptedException {\n Collection<Thread> threads = new ArrayList<>();\n for (int threadIdx = 0; threadIdx < 20; threadIdx++) {\n Thread thread = new Thread(() -> {\n for (int i = 0; i < 100_000 / 20; i++) {\n counter.increment();\n }\n });\n thread.start();\n threads.add(thread);\n }\n for (Thread thread : threads) {\n thread.join();\n }\n\n // then: counter value should be 100k\n assertEquals(100_000, counter.total(),\n \"Counter wasn't incremented expected number of times\");\n }", "@Test\n void highConcurrency() {\n int count = 50;\n String method = \"GET\";\n URI uri = resolveAddress(\"/success\");\n\n CountDownLatch latch = new CountDownLatch(1);\n\n ExecutorService pool = Executors.newFixedThreadPool(4);\n for (int i = 0; i < count; i++) {\n int index = i;\n Runnable job =\n () -> {\n try {\n latch.await();\n } catch (InterruptedException e) {\n throw new AssertionError(e);\n }\n try {\n Integer result =\n testing.runWithSpan(\n \"Parent span \" + index,\n () -> {\n Span.current().setAttribute(\"test.request.id\", index);\n return doRequest(\n method,\n uri,\n Collections.singletonMap(\"test-request-id\", String.valueOf(index)));\n });\n assertThat(result).isEqualTo(200);\n } catch (Throwable throwable) {\n if (throwable instanceof AssertionError) {\n throw (AssertionError) throwable;\n }\n throw new AssertionError(throwable);\n }\n };\n pool.submit(job);\n }\n latch.countDown();\n\n List<Consumer<TraceAssert>> assertions = new ArrayList<>();\n for (int i = 0; i < count; i++) {\n assertions.add(\n trace -> {\n SpanData rootSpan = trace.getSpan(0);\n // Traces can be in arbitrary order, let us find out the request id of the current one\n int requestId = Integer.parseInt(rootSpan.getName().substring(\"Parent span \".length()));\n\n trace.hasSpansSatisfyingExactly(\n span ->\n span.hasName(rootSpan.getName())\n .hasKind(SpanKind.INTERNAL)\n .hasNoParent()\n .hasAttributesSatisfyingExactly(\n equalTo(AttributeKey.longKey(\"test.request.id\"), requestId)),\n span -> assertClientSpan(span, uri, method, 200, null).hasParent(rootSpan),\n span ->\n assertServerSpan(span)\n .hasParent(trace.getSpan(1))\n .hasAttributesSatisfyingExactly(\n equalTo(AttributeKey.longKey(\"test.request.id\"), requestId)));\n });\n }\n\n testing.waitAndAssertTraces(assertions);\n\n pool.shutdown();\n }", "public void run() {\n long creationInterval = MILLISEC_PER_SEC / this.generationRate;\n\n int curIndex = 0;\n long startTime, endTime, diff, sleepTime, dur = this.test_duration;\n\n do {\n // startTime = System.nanoTime();\n startTime = System.currentTimeMillis();\n\n Request r = new DataKeeperRequest((HttpClient) this.clients[curIndex], this.appserverID, this.url);\n curIndex = (curIndex + 1) % clientsPerNode;\n this.requests.add(r);\n\n try {\n r.setEnterQueueTime();\n this.requestQueue.put(r);\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n\n // endTime = System.nanoTime();\n endTime = System.currentTimeMillis();\n diff = endTime - startTime;\n dur -= diff;\n sleepTime = creationInterval - diff;\n if (sleepTime < 0) {\n continue;\n }\n\n try {\n // Thread.sleep(NANO_PER_MILLISEC / sleepTime, (int) (NANO_PER_MILLISEC % sleepTime));\n Thread.sleep(sleepTime);\n } catch (InterruptedException e) {\n throw new RuntimeException(e);\n }\n\n dur -= sleepTime;\n } while (dur > 0);\n\n try {\n this.requestQueue.put(new ExitRequest());\n this.requestQueueHandler.join();\n } catch (InterruptedException e) {\n throw new RuntimeException(e);\n }\n }", "public void cacheResult(DataEntry dataEntry);", "@Test\n public void clientRequest() {\n List<Thread> threadList = new LinkedList<>(); \n\tfor (int i = 0; i < clientNumber; i ++){\n\t SimpleClient clientx = new SimpleClient(i+1);\n\t threadList.add(clientx);\n\t clientx.start();\n\t}\n\tfor (Thread thread : threadList){\n\t try {\n\t\tthread.join();\n\t } catch (InterruptedException ex) {\n\t\tLogger.getLogger(ServiceProfileClientTest.class.getName()).log(Level.SEVERE, null, ex);\n\t }\n\t}\n\t\n\n\t\n\t\n\tSystem.out.println(\"SetReq = \" + setReq);\n\tSystem.out.println(\"TotalTimeSet = \" + totalSetTime);\n\tSystem.out.println(\"LastProcTime = \" + lastSetTime);\n\tSystem.out.println(\"AverageProcRate = \" + setReq.get()*1000000/(totalSetTime.get()));\n\t\n\tSystem.out.println(\"GetReq = \" + getReq);\n\tSystem.out.println(\"TotalTimeGet = \" + totalGetTime);\n\tSystem.out.println(\"LastProcTime = \" + lastGetTime);\n\tSystem.out.println(\"AverageProcRate = \" + getReq.get()*1000000/(totalGetTime.get()));\n\t\n\tSystem.out.println(\"RemvReq = \" + removeReq);\n\tSystem.out.println(\"TotalTimeRemove = \" + totalRemoveTime);\n\tSystem.out.println(\"LastProcTime = \" + lastRemoveTime);\n\tSystem.out.println(\"AverageTimeProcRate = \" + removeReq.get()*1000000/(totalRemoveTime.get()));\n }", "@Test(timeout = 30000)\n public void testConcurrentModifications() throws Exception {\n assertFalse(\"Something is wrong\", CurrentUnitOfWork.isStarted());\n final UUID aggregateId = UUID.randomUUID();\n commandBus.dispatch(asCommandMessage(new CreateStubAggregateCommand(aggregateId)));\n ExecutorService service = Executors.newFixedThreadPool(THREAD_COUNT);\n final AtomicLong counter = new AtomicLong(0);\n List<Future<?>> results = new LinkedList<>();\n for (int t = 0; t < 30; t++) {\n results.add(service.submit(() -> {\n try {\n commandBus.dispatch(asCommandMessage(new UpdateStubAggregateCommand(aggregateId)));\n commandBus.dispatch(asCommandMessage(new ProblematicCommand(aggregateId)),\n SilentCallback.INSTANCE);\n commandBus.dispatch(asCommandMessage(new LoopingCommand(aggregateId)));\n counter.incrementAndGet();\n } catch (Exception ex) {\n throw new RuntimeException(ex);\n }\n }));\n }\n service.shutdown();\n while (!service.awaitTermination(3, TimeUnit.SECONDS)) {\n System.out.println(\"Did \" + counter.get() + \" batches\");\n }\n\n for (Future<?> result : results) {\n if (result.isDone()) {\n result.get();\n }\n }\n assertEquals(91, registeringEventHandler.getCapturedEvents().size());\n validateDispatchingOrder();\n }", "@Test(timeout = 10000)\n public void testMultipleCallsReturnTheSameObjectInDifferentThreads() throws Exception {\n\n // Create 10000 tasks and inside each callable instantiate the singleton class\n final List<Callable<S>> tasks = new ArrayList<>();\n for (int i = 0; i < 10000; i++) {\n tasks.add(this.singletonInstanceMethod::get);\n }\n\n // Use up to 8 concurrent threads to handle the tasks\n final ExecutorService executorService = Executors.newFixedThreadPool(8);\n final List<Future<S>> results = executorService.invokeAll(tasks);\n\n // wait for all of the threads to complete\n final S expectedInstance = this.singletonInstanceMethod.get();\n for (Future<S> res : results) {\n final S instance = res.get();\n assertNotNull(instance);\n assertSame(expectedInstance, instance);\n }\n\n // tidy up the executor\n executorService.shutdown();\n\n }", "public void testAsyncMapPutMany() throws Throwable {\n TestCluster<AsyncMap<String, String>> cluster = TestCluster.<AsyncMap<String, String>>builder()\n .withActiveMembers(3)\n .withPassiveMembers(2)\n .withUriFactory(id -> String.format(\"local://test%d\", id))\n .withClusterFactory(members -> new ClusterConfig().withProtocol(new LocalProtocol()).withMembers(members))\n .withResourceFactory(config -> AsyncMap.create(\"test\", config, new AsyncMapConfig().withConsistency(Consistency.WEAK).withLog(new BufferedLog().withSegmentInterval(1024).withFlushOnWrite(true))))\n .build();\n\n expectResume();\n cluster.open().thenRun(this::resume);\n await(5000);\n \n AsyncMap<String, String> map = cluster.activeResources().iterator().next();\n expectResume();\n putMany(map).thenRun(this::resume);\n await(5000);\n }", "@Test\n\tpublic static void testNonThreadLocal() {\n\t\tExecutorService service = Executors.newCachedThreadPool();\n\n\t\tRunnable task = new Runnable() {\n\t\t\tNonThreadLocal<AtomicInteger> tlocal = new NonThreadLocal<AtomicInteger>() {\n\t\t\t\t@Override\n\t\t\t\tpublic AtomicInteger initialValue() {\n\t\t\t\t\treturn new AtomicInteger(1);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tpublic void run() {\n\t\t\t\tSystem.out.println(Thread.currentThread().getName() + \" start with value: \" + tlocal.get());\n\t\t\t\ttry {\n\t\t\t\t\tTimeUnit.SECONDS.sleep(1);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tint res;\n//\t\t\t\tsynchronized (\"ABC\") {\n\t\t\t\t\tres = tlocal.get().addAndGet(1);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tTimeUnit.SECONDS.sleep(1);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\ttlocal.set(new AtomicInteger(res));\n//\t\t\t\t}\n\t\t\t\tSystem.out.println(Thread.currentThread().getName() + \" ends with value: \" + res);\n\t\t\t}\n\t\t};\n\t\tfor (int i = 0; i < 5; i++)\n\t\t\tservice.submit(task);\n\t\tservice.shutdown();\n\n\t}" ]
[ "0.7167642", "0.70300496", "0.67935026", "0.6744582", "0.66920906", "0.65740556", "0.6528434", "0.64675474", "0.64473534", "0.64433664", "0.6430538", "0.638059", "0.6332969", "0.6269611", "0.626471", "0.6218464", "0.621292", "0.6194396", "0.61620516", "0.6124683", "0.61214274", "0.6119232", "0.61191154", "0.6100495", "0.60789573", "0.6078638", "0.6074908", "0.6073969", "0.60550076", "0.60463744", "0.6008314", "0.60000336", "0.598535", "0.59656286", "0.5958232", "0.59475684", "0.5937095", "0.59318215", "0.5931536", "0.5928138", "0.5916375", "0.5900424", "0.58980775", "0.5896426", "0.5889914", "0.5888171", "0.5880314", "0.5880314", "0.58686435", "0.58582914", "0.5851171", "0.5828136", "0.58257955", "0.58202916", "0.58166564", "0.58160925", "0.5792294", "0.57843494", "0.5783789", "0.57635045", "0.57575643", "0.57536626", "0.5750991", "0.5741335", "0.5723501", "0.57169676", "0.57090193", "0.5701908", "0.5700239", "0.5699834", "0.56953365", "0.5691992", "0.5685166", "0.56819016", "0.56812096", "0.5673008", "0.5672433", "0.5663415", "0.56566525", "0.5645993", "0.56358504", "0.5632903", "0.5628041", "0.56255144", "0.5623988", "0.56201637", "0.56164014", "0.56108993", "0.560931", "0.560788", "0.55994713", "0.55974835", "0.55880505", "0.5585182", "0.55829465", "0.5574385", "0.55562323", "0.5549269", "0.5548527", "0.5543104" ]
0.780849
0
callback method used to get the action the robot wish to perform
public abstract Action getAction();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getOnAction();", "String getAction();", "String getAction();", "int getAction();", "void determineNextAction();", "public void performAction();", "public int getAction() {\n return action;\n }", "public int getAction() {\n return action_;\n }", "public void action() {\n action.action();\n }", "int getActionCommand();", "public int getAction()\n {\n return m_action;\n }", "public A getAction() {\r\n\t\treturn action;\r\n\t}", "public abstract void onAction();", "public int getAction() {\n\t\treturn action;\n\t}", "public String getAction () {\n return action;\n }", "public String getAction() {\n\t\treturn action.get();\n\t}", "public String getAction() {\n return action;\n }", "@Override\n\tpublic String getAction() {\n\t\treturn action;\n\t}", "public int getAction() {\n return action_;\n }", "public String getAction() {\n return action;\n }", "public String getAction() {\n return action;\n }", "public String getAction() {\n return action;\n }", "public void executeAction( String actionInfo );", "abstract public void performAction();", "public String getAction() {\r\n\t\treturn action;\r\n\t}", "public String getAction() {\n return this.action;\n }", "public void handleAction(Action action){\n\t\tSystem.out.println(action.getActionType().getName() + \" : \" + action.getValue());\n\t\tDroneClientMain.runCommand(\"python george_helper.py \" + action.getActionType().getName().toLowerCase() + \" \" + action.getValue());\n\t}", "String getActionName(Closure action);", "public abstract void action();", "public abstract void action();", "public abstract void action();", "public abstract void action();", "public String getAction() {\n\t\treturn action;\n\t}", "public String getAction() {\n\t\treturn action;\n\t}", "public String getAction() {\n\t\treturn action;\n\t}", "public String getAction() {\n\t\treturn action;\n\t}", "public Action getAction() {\n\treturn action;\n }", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "public void takeAction(BoardGameController.BoardBugAction action)\n {\n\n }", "public void doAction(){}", "abstract protected String performAction(String input);", "public boolean[] getAction()\n {\n cleanActions();\n \n //Execute BT to get the action to do.\n m_behaviorTree.execute();\n \n //keep track of last set of actions.\n //recordActions();\n\n if(m_resetThisCycle)\n {\n resetAgent();\n }\n\n //And this is the action that must be taken:\n return action;\n }", "@Override\n\tpublic void action() {\n\n\t}", "public void performAction() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "@Override\n\tpublic void action() {\n\t\tSystem.out.println(\"action now!\");\n\t}", "@Override\r\n\tpublic void action() {\n\t\t\r\n\t}", "public Action getAction() {\n return action;\n }", "@Override\n public void action() {\n System.out.println(\"Matchmaker Behaviour\");\n addBehaviour(new RequestToMatchMakerBehaviour());\n\n }", "interface Action {\n /**\n * Executes the action. Called upon state entry or exit by an automaton.\n */\n void execute();\n }", "public void actionOffered();", "public abstract String getIntentActionString();", "public abstract ActionInMatch act();", "void actionCompleted(ActionLookupData actionLookupData);", "public RvSnoopAction getAction(String command);", "public int getActionType();", "public void toSelectingAction() {\n }", "public int getUserAction()\n {\n return userAction;\n }", "public void act() \r\n {\r\n // Add your action code here.\r\n }", "public void act() \r\n {\r\n // Add your action code here.\r\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void action() {\n }", "@Override\n\tpublic void action() {\n\t\tACLMessage msgRx = myAgent.receive();\n\t\tif (msgRx != null && msgRx.getPerformative() == ACLMessage.REQUEST) {\n\t\t\tContentManager contentManager = myAgent.getContentManager();\n\t\t\tSystem.out.println(\"RECEIVED = \" + msgRx.getContent());\n\t\t\tmsgRx.setLanguage(\"fipa-sl\");\n\t\t\tmsgRx.setOntology(\"blocks-ontology\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tContentElementList elementList = (ContentElementList) contentManager\n\t\t\t\t\t\t.extractContent(msgRx);\n\n\t\t\t\tIterator elementIterator = elementList.iterator();\n\n\t\t\t\twhile (elementIterator.hasNext()) {\n\t\t\t\t\tAction action = (Action) elementIterator.next();\n\t\t\t\t\t((Environment) myAgent).getWorld().getActionList().add((Executable) (action.getAction()));\n//\t\t\t\t\t((Executable) (action.getAction()))\n//\t\t\t\t\t\t\t.execute((Environment) myAgent);\n\t\t\t\t}\n\n\t\t\t} catch (UngroundedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (CodecException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (OntologyException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else {\n\t\t\tblock();\n\t\t}\n\t\t\n\t}", "public ActionReader getAction(String name);", "public void selectAction(){\r\n\t\t\r\n\t\t//Switch on the action to be taken i.e referral made by health care professional\r\n\t\tswitch(this.referredTo){\r\n\t\tcase DECEASED:\r\n\t\t\tisDeceased();\r\n\t\t\tbreak;\r\n\t\tcase GP:\r\n\t\t\treferToGP();\r\n\t\t\tbreak;\r\n\t\tcase OUTPATIENT:\r\n\t\t\tsendToOutpatients();\r\n\t\t\tbreak;\r\n\t\tcase SOCIALSERVICES:\r\n\t\t\treferToSocialServices();\r\n\t\t\tbreak;\r\n\t\tcase SPECIALIST:\r\n\t\t\treferToSpecialist();\r\n\t\t\tbreak;\r\n\t\tcase WARD:\r\n\t\t\tsendToWard();\r\n\t\t\tbreak;\r\n\t\tcase DISCHARGED:\r\n\t\t\tdischarge();\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t\r\n\t\t}//end switch\r\n\t}", "public String getActionArg() {\n\t\treturn actionArg;\n\t}", "public SoHandleEventAction getAction() { return eventAction; }", "private void act() {\n\t\tmyAction.embodiment();\n\t}", "String getActionName();", "@Nullable\n @Generated\n @Selector(\"action\")\n public native SEL action();", "public int getActionCommand() {\n return actionCommand_;\n }", "public PDAction getE() {\n/* 71 */ COSDictionary e = (COSDictionary)this.actions.getDictionaryObject(\"E\");\n/* 72 */ PDAction retval = null;\n/* 73 */ if (e != null)\n/* */ {\n/* 75 */ retval = PDActionFactory.createAction(e);\n/* */ }\n/* 77 */ return retval;\n/* */ }", "public PDAction getFo() {\n/* 187 */ COSDictionary fo = (COSDictionary)this.actions.getDictionaryObject(\"Fo\");\n/* 188 */ PDAction retval = null;\n/* 189 */ if (fo != null)\n/* */ {\n/* 191 */ retval = PDActionFactory.createAction(fo);\n/* */ }\n/* 193 */ return retval;\n/* */ }", "public void action(BotInstance bot, Message message);", "public interface Action {\n String execute(GameController gameController);\n}", "com.cantor.drop.aggregator.model.CFTrade.TradeAction getAction();", "@Override\n public void onResult(final AIResponse result) {\n DobbyLog.i(\"Action: \" + result.getResult().getAction());\n }", "public PDAction getBl() {\n/* 216 */ COSDictionary bl = (COSDictionary)this.actions.getDictionaryObject(\"Bl\");\n/* 217 */ PDAction retval = null;\n/* 218 */ if (bl != null)\n/* */ {\n/* 220 */ retval = PDActionFactory.createAction(bl);\n/* */ }\n/* 222 */ return retval;\n/* */ }", "public abstract Action takeTurn();", "public void selected(String action);", "public String getDocAction();", "public String getDocAction();", "public String getActionName() {\n\t\treturn this.function;\n\t}", "public String getAction() {\n Object ref = action_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n action_ = s;\n return s;\n }\n }", "public void processAction(CIDAction action);", "@Override\n\tpublic TurnAction selectAction() {\n\t\tJSONObject message = new JSONObject();\n\t\tmessage.put(\"function\", \"select\");\n\t\tmessage.put(\"type\", \"action\");\n\n\t\tthis.sendInstruction(message);\n\t\tString selected = this.getResponse();\n\t\treturn TurnAction.valueOf(selected);\n\t}", "public interface AppAction\n{\n void login(String name, String password, Handler handler);\n\n void access(Handler handler, String ...s);\n\n void gdata(Handler handler, List<EHentaiMangaInfo> list);\n\n void getMangaInfo(Handler handler);\n\n void getNews(Handler handler);\n\n void getNews(Handler handler, String title, String page);\n\n void getImg( String url, ImageView imageView,AppActionImpl.Callback<Void> callback,int height,int width);\n}", "public int getActionCommand() {\n return actionCommand_;\n }", "public void act();", "public interface AutofillAssistantActionHandler {\n /**\n * Returns the names of available AA actions.\n *\n * <p>This method starts AA on the current tab, if necessary, and waits for the first results.\n * Once AA is started, the results are reported immediately.\n *\n * @param userName name of the user to use when sending RPCs. Might be empty.\n * @param experimentIds comma-separated set of experiment ids. Might be empty\n * @param arguments extra arguments to include into the RPC. Might be empty.\n * @param callback callback to report the result to\n */\n void listActions(String userName, String experimentIds, Bundle arguments,\n Callback<Set<String>> callback);\n\n /**\n * Returns the available AA actions to be reported to the direct actions framework.\n *\n * <p>This method simply returns the list of actions known to AA. An empty string array means\n * either that the controller has not yet been started or there are no actions available for the\n * current website.\n *\n * @return Array of strings with the names of known actions.\n */\n String[] getActions();\n\n /** Performs onboarding and returns the result to the callback. */\n void performOnboarding(String experimentIds, Callback<Boolean> callback);\n\n /**\n * Performs an AA action.\n *\n * <p>If this method returns {@code true}, a definition for the action was successfully started.\n * It can still fail later, and the failure will be reported to the UI.\n *\n * @param name action name, might be empty to autostart\n * @param experimentIds comma-separated set of experiment ids. Might be empty.\n * @param arguments extra arguments to pass to the action. Might be empty.\n * @param callback to report the result to\n */\n void performAction(\n String name, String experimentIds, Bundle arguments, Callback<Boolean> callback);\n}", "public String getAction() {\n Object ref = action_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n action_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "String[] getActions();" ]
[ "0.7656903", "0.7320204", "0.7320204", "0.7106855", "0.70529294", "0.7019947", "0.69890344", "0.6937019", "0.6936713", "0.69239736", "0.6923399", "0.6890222", "0.685129", "0.6850046", "0.68443537", "0.6839363", "0.6815559", "0.68024504", "0.6798403", "0.6759916", "0.6759916", "0.6759916", "0.6738808", "0.67298573", "0.67240316", "0.67164063", "0.6713912", "0.6707287", "0.66579694", "0.66579694", "0.66579694", "0.66579694", "0.6643658", "0.6643658", "0.6643658", "0.6643658", "0.6607785", "0.6589924", "0.6589924", "0.6589924", "0.6568893", "0.6565597", "0.6555891", "0.65537965", "0.65376884", "0.6528763", "0.65068305", "0.6505002", "0.646058", "0.6441903", "0.64310324", "0.6428623", "0.64175135", "0.64138085", "0.6411276", "0.6409247", "0.64014655", "0.6394619", "0.6381949", "0.6371251", "0.6371251", "0.6361494", "0.6361494", "0.6361494", "0.6361494", "0.6361494", "0.6361494", "0.6361494", "0.6361494", "0.6347003", "0.63206124", "0.6320341", "0.6291612", "0.6289632", "0.62844074", "0.62727314", "0.6264437", "0.62576324", "0.6227613", "0.6223162", "0.6204309", "0.61816424", "0.6169304", "0.6166718", "0.61504143", "0.61474055", "0.6147007", "0.6146411", "0.6144318", "0.6144318", "0.61315584", "0.61272115", "0.6125262", "0.61240596", "0.61206484", "0.61137766", "0.6113421", "0.60918254", "0.6090768", "0.60894966" ]
0.7075148
4
callback method used to notify scan result (if robot last action type was SCAN)
public abstract void notifyScanResult(int distancesToWallsInEachDirection);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onScanResult(final IScanResult result);", "@Override\r\n\tpublic void onScanComplete() \r\n\t{\n\t\tif(_scanActionMode != null)\r\n\t\t\t_scanActionMode.finish();\r\n\t}", "void onDeviceFound(TxRxScanResult scanResult);", "@Override\n public void onScanResult(int callbackType, ScanResult result) {\n processResult(result);\n }", "public interface ScanResultsAvailable {\n public void onReceiveScanResults();\n}", "@Override\n public boolean execute(String action, JSONArray args, CallbackContext callbackContext) {\n this.callbackContext = callbackContext;\n\n if (action.equals(\"scan\")) {\n scan();\n \n } else {\n return false;\n }\n return true;\n }", "protected abstract void scanResultCallback(int order, AbstractVerifyAdapter verifyProcess);", "@MainThread\n void onChannelScanFinished();", "public interface ScanListener {\n void onSuccess(String scanData);\n\n void onError(String errorMsg);\n}", "public interface ScanListener {\n public abstract void onScanned();\n}", "@Override\n public void onReceive(Context context, Intent intent) {\n Log.i(\"WiFi SCAN\", \"RESULT RETURN:\"+new Date().getTime());\n synchronized (scanned) {\n scanned.notify();\n }\n //throw new UnsupportedOperationException(\"Not yet implemented\");\n }", "boolean isScanDone();", "private void onScanActionSelected() {\n\t\tIntent intent = new Intent(this, ScanActivity.class);\n\t\tstartActivity(intent);\n\t}", "public interface TxRxScanCallback {\n\n /**\n * Callback immediately after the scan has been stopped.\n */\n void afterStopScan();\n\n /**\n * Callback when a BLE device has been found.\n *\n * @param scanResult the result of a scan operation for BLE Devices\n */\n void onDeviceFound(TxRxScanResult scanResult);\n}", "@Override\n public void onScanFinished() {\n Log.d(TAG, \"Scan Finished\");\n if(dicePlus == null){\n BluetoothManipulator.startScan();\n }\n }", "void afterStopScan();", "public abstract void startSingleScan();", "private void onScanActionSelected() {\n Intent intent = new Intent(this, ScanActivity.class);\n startActivity(intent);\n }", "private void goodScan() {\n resultIcon.setImageDrawable(getDrawable(R.drawable.ic_check_solid));\n resultIcon.setVisibility(View.VISIBLE);\n\n this.quantity--;\n this.instructions.setText(String.format(\n getString(R.string.activity_scan_item__instructions),\n this.quantity, this.name\n ));\n\n if (this.quantity == 0) {\n // All done!\n Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n doneScanning();\n }\n }, 500);\n\n } else {\n // Add listener back after two (2) seconds\n Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n ScannerFragment scannerFragment = (ScannerFragment) getFragmentManager().findFragmentById(R.id.fragment_container);\n scannerFragment.setListener2(scannerListener);\n\n resultIcon.setVisibility(View.GONE);\n }\n }, 2000);\n }\n }", "@Override\n public void onScanResult(int callbacktype, final ScanResult result) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n mLeDeviceListAdapter.addDevice(result.getDevice());\n mLeDeviceListAdapter.notifyDataSetChanged();\n }\n });\n }", "@Override\r\n\tpublic void onScanProgress(ThreadResult result) \r\n\t{\n\t\tif(result.device != null)\r\n\t\t{\r\n\t\t\t_deviceListView.addOrUpdateDevice(result.device);\r\n\t\t\tsaveDevice(result.device, _network.getRouter().getBssid());\r\n\t\t\trefreshPinger();\r\n\t\t\tsetDevicesLiveCount(_network.getRouter());\r\n\t\t}\r\n\t}", "public interface BluetoothScanListener {\n void onScanResult(int callbackType, ScanResult result);\n void onBatchScanResults(List<ScanResult> results);\n void onScanFailed(int errorCode);\n}", "void discoverFinished();", "void onResult(int ret);", "@Override\n public void scanActuatorsStopped() {\n }", "@Override\n public void onScanned(Barcode barcode) {\n super.onScanned(barcode);\n\n //on Scan completed close the scanner\n if (isScanning.get()) {\n getChildFragmentManager()\n .beginTransaction()\n .remove(getChildFragmentManager().findFragmentById(R.id.scannerFragment))\n .commit();\n }\n\n isScanning.set(false);\n\n /*\n * this works when if user scan the exist\n * code without scanning the enter code\n */\n boolean waitingForEnterCode = !getUpdatedPendingEntryEvent();\n if (barcode.rawValue.equals(EXIT) && waitingForEnterCode) {\n String message = \"Its look like that you haven't scan the Enter Code \" + new String(Character.toChars(0x1F622));\n showAlertDialog(message);\n return;\n }\n\n /*\n * this works when user scan the enter code again\n * without scanning the exit code\n */\n boolean waitingForExitCode = getUpdatedPendingEntryEvent();\n if (barcode.rawValue.equals(ENTER) && waitingForExitCode) {\n String message = \"you have already scan the Enter code First scan a Exist \" + new String(Character.toChars(0x1F622));\n showAlertDialog(message);\n return;\n }\n\n if (barcode.rawValue.equals(Constants.IQRCode.ENTER)) {\n viewmodel.updateScannedValueWhenEnter();\n updatePendingEntryEvent(true);\n } else if (barcode.rawValue.equals(EXIT)) {\n viewmodel.updateScannedValueWhenExist();\n updatePendingEntryEvent(false);\n } else {\n Toast.makeText(getActivity(), \"no action specified\", Toast.LENGTH_SHORT).show();\n }\n }", "public void on_code_read(String result){\n Intent intent = new Intent(ScanActivity.this, TargetActivity.class);\n intent.putExtra(\"result\", result);\n startActivity(intent);\n }", "public native void onScannerStatusNative(String Status);", "interface ScanCallback {\n void cb(Metric metric);\n }", "@MainThread\n void onChannelScanStarted();", "@Override\n public void onScanStarted() {\n Log.d(TAG, \"Scan Started\");\n }", "public void onResultConsumed() {\n }", "@Override\n protected void onPostExecute(Void v) {\n super.onPostExecute(v);\n\n\n callbackListener.onScanResults(serviceResults);\n }", "public interface IBleScanCallback {\n\n /**\n * Callback when a BLE advertisement has been found.\n *\n * @param result scan result\n */\n void onScanResult(final IScanResult result);\n}", "protected void notifyScanFinished() {\n for (ScanListener l : listeners) l.scanFinished(contextId);\n }", "@Override\n public void onResult(final AIResponse result) {\n DobbyLog.i(\"Action: \" + result.getResult().getAction());\n }", "public interface ScanCallBack {\n void getDevices(final BluetoothDevice bluetoothDevice, final int rssi);\n}", "public void onScanCompleted(String path, Uri uri) {\n }", "public void scanningComplete() {\n\t\tif (!state.equals(ControlState.READY)) {\r\n\t\t\tthrow new RuntimeException(\"ReturnBookControl: cannot call scanningComplete except in READY state\");\r\n\t\t}\t\r\n\t\tuserInterface.setState(ReturnBookUI.UI_STATE.COMPLETED);\t\t\r\n\t}", "@Override\n protected void onPreExecute() {\n callbackListener.onScanStart(\"Running a deep scan... this will take awhile...\");\n super.onPreExecute();\n }", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\tswitch (requestCode) {\n\t\tcase SCAN_BACK_CODE:\n\t\t\tif (resultCode == RESULT_OK) {\n\t\t\t\tBundle bundle = data.getExtras();\n\n\t\t\t\t// 发送消息到服务器\n\t\t\t\tString result = bundle.getString(\"result\");\n\t\t\t\tLog.d(\"TAG\", \"Scan result --> result = \" + result);\n\t\t\t\tif (result.contains(\"~\")) {\n\t\t\t\t\tLog.d(\"TAG\",\n\t\t\t\t\t\t\t\"Scan result.contains(~) : \" + result.contains(\"~\"));\n\t\t\t\t\tString[] context = result.split(\"~\");\n\t\t\t\t\tLog.d(\"TAG\", \"Scan result --> SERVER_IP = \" + context[0]);\n\t\t\t\t\tLog.d(\"TAG\",\n\t\t\t\t\t\t\t\"Scan result --> SERVER_PORT = \"\n\t\t\t\t\t\t\t\t\t+ Integer.parseInt(context[1]));\n\t\t\t\t}\n\n\t\t\t\tif (result.contains(\"=\")) {\n\t\t\t\t\tLog.d(\"TAG\",\n\t\t\t\t\t\t\t\"Scan result.contains(=) : \" + result.contains(\"=\"));\n\t\t\t\t\tString[] context = result.split(\"=\");\n\t\t\t\t\tString sessionId = context[1];\n\t\t\t\t}\n\t\t\t\twifiIpState.setText(result);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "public void onScanCompleted(String path, Uri uri) {\n }", "void searchFinished (Search search);", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\t\n\t // Make sure the request was successful\n\t if (resultCode == RESULT_OK) {\n\t Bundle resultBundle = data.getExtras();\n\t String decodedData = resultBundle.getString(\"DATA_RESULT\");\n\t String scanAction = resultBundle.getString(\"SCAN_ACTION\");\n\t\t \n\t\t if(scanAction != null && scanAction.equalsIgnoreCase(SCAN_TYPE)){\n\t\t\t // With the decoded data use session.get entity etc... then call server to get entity info\n\t\t\t try{\n\t\t\t\t processData(decodedData);\n\t\t\t }catch(Exception e){\n\t\t\t\t Toast.makeText(this, \"Unknown barcode format: please scan a valid barcode\", Toast.LENGTH_LONG).show();\n\t\t\t\t launchScanner(SCAN_TYPE);\n\t\t\t }\n\t\t\t \n\t\t }else{\n\t\t\t Toast.makeText(this, \"NO SCANNING ACTION\", Toast.LENGTH_LONG).show();\n\t\t\t launchScanner(SCAN_TYPE);\n\t\t }\n\t\t \n\t }else{\n\t\t finish();\t\t \n\t }\t \n\t}", "@Override\n public void onScanCompleted(String path, Uri uri) {\n }", "void onResult(AIResponse result);", "@Override\r\n public void onResult(boolean result)\r\n {\n if(result){\r\n handler.sendMessage(handler.obtainMessage(SHOWTOAST, \"Start Calibration ,successful\"));\r\n }\r\n else{\r\n handler.sendMessage(handler.obtainMessage(SHOWTOAST, \"Start Calibration ,fail\"));\r\n }\r\n }", "public void onScannedRobot() {\r\n\t\t// Turn gun to point at the scanned robot\r\n\t\tturnGunTo(scannedAngle);\r\n\r\n\t\t// Fire!\r\n\t\tfire(1);\r\n\t}", "public interface OnRSSISuccessListener {\r\n public void onSuccess(int rssi);\r\n}", "public void handleSimStatusCompleted() {\n }", "protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n switch (requestCode) {\n case 0:\n try {\n if (resultCode == Activity.RESULT_OK) {\n String scanResult = data.getStringExtra(Constants.SCAN_RESULT);\n // set scanner result to text view on main screen\n TextView textView = (TextView) findViewById(R.id.scanResult);\n textView.setText(scanResult);\n\n Log.v(TAG, \"Bar Code ==: \" + scanResult);\n\n //new KiiPushBroadcastReceiver().sendGroupNotification(Constants.GROUPID, Constants.TOPICNAME, scanResult);\n //send scan result to server\n AsyncTaskSendData asyncTaskToSendData = new AsyncTaskSendData(getApplicationContext());\n asyncTaskToSendData.execute(scanResult);\n\n try{\n Thread.sleep(1000);\n }catch(InterruptedException e) {\n Log.e(TAG, \"thread sleep: \" + e.getMessage());\n }\n\n exitScanner2();\n\n break;\n } else if (resultCode == Activity.RESULT_CANCELED && data != null) {\n String error = data.getStringExtra(Constants.ERROR_INFO);\n if (!TextUtils.isEmpty(error)) {\n // Toast.makeText(this, error, Toast.LENGTH_SHORT).show();\n Log.e(TAG, \"Bar Code\" +\n \" error ==: \" + error);\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n break;\n }\n }", "@Override\n public void handleResult(Result result) {\n Log.w(\"handleResult\", result.getText());\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Scan result\");\n builder.setMessage(result.getText());\n AlertDialog alertDialog = builder.create();\n alertDialog.show();\n\n\n //Resume scanning\n //mScannerView.resumeCameraPreview(this);\n }", "@Override\r\n\tpublic boolean results()\r\n\t{\r\n\t\treturn this.results(this.getRobot());\r\n\t}", "public void setOkToScan(boolean okToScan)\n {\n _okToScan = okToScan;\n }", "@Override\n public void scanActuatorsParked() {\n }", "@Override\n public void run() {\n int i = SCAN_NUM;\n\t\t\t\tMessage msg1 = new Message();\n\t\t\t\tmsg1.what = WIFI_REFRESH;\n\t\t\t\tmwifiHandler.sendMessage(msg1);\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(2000);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n refreshWifi();\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(500);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tMessage msg = new Message();\n\t\t\t\tmsg.what = WIFI_REFRESH_FINISH;\n\t\t\t\tmwifiHandler.sendMessage(msg);\n }", "public void callback();", "public void scan() {\n Intent intentScan = new Intent(SCAN_INTENT);\n intentScan.addCategory(Intent.CATEGORY_DEFAULT);\n // avoid calling other phonegap apps\n intentScan.setPackage(this.cordova.getActivity().getApplicationContext().getPackageName());\n\n this.cordova.startActivityForResult((CordovaPlugin) this, intentScan, REQUEST_CODE);\n }", "public void callback() {\n }", "void actionCompleted(ActionLookupData actionLookupData);", "@Override\n\tpublic void onScanViewButtonClick() {\n\t\t\n\t}", "@Override\n public void onClick(View v) {\n qrScan.initiateScan();\n }", "@Override\n public void onScanFailed() {\n Log.d(TAG, \"Scan Failed\");\n BluetoothManipulator.startScan();\n }", "private void onScanFragmentScanResult(Bitmap bitmap, ScanResult2[] results) {\n ScannerFragment scannerFragment = (ScannerFragment) getFragmentManager().findFragmentById(R.id.fragment_container);\n scannerFragment.setListener2(null);\n\n ScanResult2 result = results[0];\n\n if (result.getText().equals(this.upc)) {\n goodScan();\n } else {\n badScan();\n }\n }", "public void serviceSearchCompleted(int transID, int respCode) {\n }", "void determineNextAction();", "@Override\r\n\tpublic void onScanViewButtonClick() {\n\r\n\t}", "public boolean isOkToScan()\n {\n return _okToScan;\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);\n if (result != null) {\n if (result.getContents() == null) {\n Toast.makeText(this, \"Result Not Found\", Toast.LENGTH_LONG).show();\n } else {\n partNumber = result.getContents();\n new BackgroundTaskScanQrCode().execute();\n }\n } else {\n super.onActivityResult(requestCode, resultCode, data);\n }\n }", "@Override\n\t\t\tpublic void onScanSuccess(String data) {\n\t\t\t\tif(App.mode_continu==2){\n\t\t\t\t\tif(data.equals(lastData)){//去重\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tlastData=data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tperformPasteAction(data);\n\t\t\t}", "interface OnResultListener {\n void onFinished();\n }", "@Override\n public void run() {\n switch (id) {\n case UPDATE_UI_FLAG:\n Log.d(TAG, \"[updateScanDialog] UPDATE_UI_FLAG !!\");\n break;\n\n case SCAN_DEVICE_ADD_FLAG:\n Log.d(TAG, \"[updateScanDialog] SCAN_DEVICE_ADD_FLAG !!\");\n if (!mScannedDeviceList.contains(device)) {\n if (mDeviceManager.findDevice(device) == null) {\n Log.d(TAG, \"[updateScanDialog] call to add device\");\n mScannedDeviceList.add(device);\n }\n }\n break;\n\n case SCAN_DEVICE_REMOVE_FLAG:\n Log.d(TAG, \"[updateScanDialog] SCAN_DEVICE_REMOVE_FLAG !!\");\n if (!mScannedDeviceList.contains(device)) {\n Log.d(TAG, \"[updateScanDialog] NOT contained in the list\");\n return;\n }\n mScannedDeviceList.remove(device);\n break;\n\n default:\n Log.d(TAG, \"[updateScanDialog] unrecongnized id\");\n return;\n }\n Log.d(TAG, \"[updateScanDialog] call to notify scan dialog\");\n ScanDeviceAlertDialog.notifyUi();\n }", "@Override\n public void handleResult(com.google.zxing.Result rawResult) {\n if (rawResult.getText().length() < 4) {\n mScannerView.resumeCameraPreview(SimpleScanner.this);\n Toast.makeText(this, \"Wrong QR Code\", Toast.LENGTH_SHORT).show();\n } else {\n Result = rawResult.getText().substring(0, 4);\n MachineID = rawResult.getText().substring(Result.length());\n if (Result.equals(Verification)) {\n Intent i = new Intent(SimpleScanner.this, DetailBreakdownPage2.class);\n String currentResponseDateFinish = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\", Locale.getDefault()).format(new Date());\n i.putExtra(\"MachineID\", MachineID);\n i.putExtra(\"ResponseDateFinish\", currentResponseDateFinish);\n i.putExtra(\"Line\", Line);\n i.putExtra(\"Station\", Station);\n i.putExtra(\"PIC\", PIC);\n startActivity(i);\n } else {\n mScannerView.resumeCameraPreview(SimpleScanner.this);\n Toast.makeText(this, \"Station tidak sesuai\", Toast.LENGTH_SHORT).show();\n }\n }\n }", "@Test\n public void scanListenerReceivesAllResults() throws RemoteException {\n WifiScanner.ScanSettings requestSettings1 = createRequest(channelsToSpec(2400), 0,\n 0, 20, WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN);\n int requestId1 = 12;\n ScanResults results1 = ScanResults.create(0, 2400);\n\n WifiScanner.ScanSettings requestSettings2 = createRequest(channelsToSpec(2450, 5175), 0,\n 0, 20, WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN);\n int requestId2 = 13;\n ScanResults results2 = ScanResults.create(0, 2450, 5175, 2450);\n\n WifiScanner.ScanSettings requestSettings3 = createRequest(channelsToSpec(5150), 0,\n 0, 20, WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN);\n int requestId3 = 15;\n ScanResults results3 = ScanResults.create(0, 5150, 5150, 5150, 5150);\n\n WifiNative.ScanSettings nativeSettings2and3 = createSingleScanNativeSettingsForChannels(\n WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN, channelsToSpec(2450, 5175, 5150));\n ScanResults results2and3 = ScanResults.merge(results2, results3);\n\n int listenerRequestId = 13;\n\n\n startServiceAndLoadDriver();\n\n when(mWifiScannerImpl.startSingleScan(any(WifiNative.ScanSettings.class),\n any(WifiNative.ScanEventHandler.class))).thenReturn(true);\n\n Handler handler = mock(Handler.class);\n BidirectionalAsyncChannel controlChannel = connectChannel(handler);\n InOrder handlerOrder = inOrder(handler);\n InOrder nativeOrder = inOrder(mWifiScannerImpl);\n\n // Run scan 1\n sendSingleScanRequest(controlChannel, requestId1, requestSettings1, null);\n\n mLooper.dispatchAll();\n WifiNative.ScanEventHandler eventHandler1 = verifyStartSingleScan(nativeOrder,\n computeSingleScanNativeSettings(requestSettings1));\n verifySuccessfulResponse(handlerOrder, handler, requestId1);\n\n\n // Queue scan 2 (will not run because previous is in progress)\n sendSingleScanRequest(controlChannel, requestId2, requestSettings2, null);\n mLooper.dispatchAll();\n verifySuccessfulResponse(handlerOrder, handler, requestId2);\n\n // Queue scan 3 (will not run because previous is in progress)\n sendSingleScanRequest(controlChannel, requestId3, requestSettings3, null);\n mLooper.dispatchAll();\n verifySuccessfulResponse(handlerOrder, handler, requestId3);\n\n // Register scan listener\n registerScanListener(controlChannel, listenerRequestId);\n mLooper.dispatchAll();\n verifySuccessfulResponse(handlerOrder, handler, listenerRequestId);\n\n // dispatch scan 1 results\n when(mWifiScannerImpl.getLatestSingleScanResults())\n .thenReturn(results1.getScanData());\n eventHandler1.onScanStatus(WifiNative.WIFI_SCAN_RESULTS_AVAILABLE);\n\n mLooper.dispatchAll();\n verifyScanResultsReceived(handlerOrder, handler, requestId1, results1.getScanData());\n verifySingleScanCompletedReceived(handlerOrder, handler, requestId1);\n verifyScanResultsReceived(handlerOrder, handler, listenerRequestId, results1.getScanData());\n verify(mContext).sendBroadcastAsUser(any(Intent.class), eq(UserHandle.ALL));\n\n // now that the first scan completed we expect the second and third ones to start\n WifiNative.ScanEventHandler eventHandler2and3 = verifyStartSingleScan(nativeOrder,\n nativeSettings2and3);\n\n // dispatch scan 2 and 3 results\n when(mWifiScannerImpl.getLatestSingleScanResults())\n .thenReturn(results2and3.getScanData());\n eventHandler2and3.onScanStatus(WifiNative.WIFI_SCAN_RESULTS_AVAILABLE);\n\n mLooper.dispatchAll();\n\n verifyMultipleSingleScanResults(handlerOrder, handler, requestId2, results2, requestId3,\n results3, listenerRequestId, results2and3);\n\n assertDumpContainsRequestLog(\"registerScanListener\", listenerRequestId);\n assertDumpContainsCallbackLog(\"singleScanResults\", listenerRequestId,\n \"results=\" + results1.getRawScanResults().length);\n assertDumpContainsCallbackLog(\"singleScanResults\", listenerRequestId,\n \"results=\" + results2and3.getRawScanResults().length);\n }", "@Override\n public void run() {\n String scanNumText = result.getText();\n Toast.makeText(ItemScan.this, scanNumText, Toast.LENGTH_SHORT).show();\n Intent intent = getIntent();\n intent.putExtra(\"Barcode\", scanNumText);\n setResult(Activity.RESULT_OK, getIntent());\n finish();\n }", "public void onActivityResult(int requestCode, int resultCode, Intent intent) {\n\n // get scan result\n IntentResult scanningResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);\n\n\n\n if (scanningResult != null)\n {\n String scanContent = scanningResult.getContents();\n String scanFormat = scanningResult.getFormatName();\n\n TextView scan_format = (TextView) findViewById(R.id.scan_format);\n TextView scan_format2 = (TextView) findViewById(R.id.scan_format2);\n TextView scan_content = (TextView) findViewById(R.id.scan_content);\n TextView scan_content2 = (TextView) findViewById(R.id.scan_content2);\n JSONObject obj=null;\n try{\n\n obj= new JSONObject(scanContent);\n\n }catch(Exception e){\n\n }\n String id= null;\n Boolean machineFound = false;\n // scan_format.setText(\"FORMAT: \" + scanFormat);\n // scan_content.setText(\"CONTENT: \" + scanContent);\n\n try\n {\n HttpRequest req = HttpRequest.getInstance();\n Integer i;\n JSONArray allMachines= (JSONArray) req.getMachine(\"all\", \"data\");\n JSONObject machi [] = new JSONObject[allMachines.length()];\n String listMachine [] = new String[allMachines.length()];\n\n for(i=0;i<allMachines.length();i++)\n {\n machi [i] = allMachines.getJSONObject(i);\n listMachine [i] = machi[i].getString(\"id\");\n if(obj.get(\"id\").equals(listMachine[i]))\n {\n machineFound = true;\n id=listMachine[i];\n }\n }\n\n }\n catch(Exception e)\n {\n String b;\n }\n\n if(machineFound==true)\n {\n Intent intent2 = new Intent(QRcode.this, Freestyle_machine.class);\n intent2.putExtra(\"id\", id);\n startActivity(intent2);\n }\n else\n {\n Toast.makeText(getApplicationContext(), R.string.Try_again,\n Toast.LENGTH_SHORT).show();\n scan_format.setText(R.string.Uncorrect_machine);\n scan_format2.setText(R.string.Scan_again);\n }\n\n return;\n\n\n\n }\n else{\n Toast.makeText(getApplicationContext(), R.string.Try_again,\n Toast.LENGTH_SHORT).show();\n\n }\n\n }", "@Override\n protected void startScan() {\n startAutomaticRefresh();\n }", "public abstract void callback(Instruction instruction);", "@Subscribe(threadMode = ThreadMode.MAIN)\n public void onGreenRobotEvent(ICheckPermissionResult result)\n {\n\n if (userInterfaceManager != null)\n {\n userInterfaceManager.setUserInterface(result);\n }\n\n }", "public void listener() {\n\t\tif (this.command.getMode().equals(Command.MODE_TRACK)) {\n\t\t\tFilterQuery filterQuery = new FilterQuery();\n\t\t\tfilterQuery.track(this.command.getKeywords().toArray(new String[this.command.getKeywords().size()]));\n\t\t\ttwitterStream.addListener(myListener);\n\t\t\ttwitterStream.filter(filterQuery);\n\t\t} else if (this.command.getMode().equals(Command.MODE_SAMPLE)) {\n\t\t\ttwitterStream.addListener(myListener);\n\t\t\ttwitterStream.sample();\n\t\t} else {\n\t\t\t// do search\n\t\t}\n\t}", "@Override\n synchronized public void onTaskCompletionResult() {\n if (DataContainer.getInstance().pullValueBoolean(DataKeys.PLAY_REFERRER_FETCHED, context) && DataContainer.getInstance().pullValueBoolean(DataKeys.GOOGLE_AAID_FETCHED, context)) {\n deviceInformationUtils.prepareInformations();\n deviceInformationUtils.debugData();\n long lastLaunch = pullValueLong(ITrackingConstants.CONF_LAST_LAUNCH_INTERNAL, context);\n trackLaunchHandler(lastLaunch);\n }\n }", "public interface IOnDeviceDetected {\n void onDeviceDetected(ClientScanResult clientScanResult);\n}", "public void onSearchStarted();", "public interface TickerCallBack {\n void search();\n}", "void connectionHandlerResumeScanning();", "public interface AsrEventListener {\n\n public void onAsrResult(String result);\n}", "public void startScanDevice(MokoScanDeviceCallback callback) {\n MokoSupport.getInstance().startScanDevice(callback);\n }", "public interface ResultObserver {\r\n\r\n /**\r\n * Invoked when a result has been stored\r\n *\r\n * @param result - The result of the inspection\r\n */\r\n void newResult(Result result);\r\n}", "public void onReceive(Context c, Intent intent) {\n if (currentScanCounter >= 0) {\n List<ScanResult> x = wifiManager.getScanResults();\n for (ScanResult tmp : x) {\n String key = tmp.BSSID + tmp.frequency;\n if (!results.containsKey(key))\n results.put(key, new AccessPoint(tmp.SSID, tmp.BSSID, tmp.frequency));\n results.get(key).addLevel(tmp.level);\n }\n\n if (currentScanCounter < MIN_SCAN_COUNT) {\n wifiManager.startScan();\n Toast.makeText(getApplicationContext(), \"Do not interrupt while scanning (\" + (MIN_SCAN_COUNT - currentScanCounter) + \")\", Toast.LENGTH_LONG).show();\n currentScanCounter++;\n } else {\n mScan.setEnabled(true);\n mSave.setEnabled(true);\n toggleSecondaryButtons(true);\n currentScanCounter = -2;\n vibrator.vibrate(1000);\n }\n\n } else if (currentScanCounter == -1) {\n //Toast.makeText(getApplicationContext(),\"here1\",Toast.LENGTH_LONG).show();\n if (locationService != null) {\n //Toast.makeText(getApplicationContext(),\"here2\",Toast.LENGTH_LONG).show();\n List<ScanResult> x = wifiManager.getScanResults();\n List<CustomWiFISignal> y = new ArrayList<CustomWiFISignal>();\n for (ScanResult tmp : x) {\n y.add(new CustomWiFISignal(tmp.SSID, tmp.BSSID, tmp.level, tmp.frequency));\n }\n Location location = locationService.getLocationByWifiSignals(y);\n if (location != null)\n {\n synchronized (obj) {\n current_x = location.get_x();\n current_y = location.get_y();\n obj.notify();\n }\n\n if(showXYZ == 1)\n Toast.makeText(getApplicationContext(), \"x:\" + location.get_x() + \" y:\" + location.get_y() + \" z:\" + location.get_floor(), Toast.LENGTH_LONG).show();\n\n }//}\n else\n Toast.makeText(getApplicationContext(), \"No location yet\", Toast.LENGTH_LONG).show();\n\n currentScanCounter = -2;\n showXYZ = 1;\n }\n }\n }", "@Override\n public void onSuccess(Void unusedResult) {\n Discoverer.this.eventListener.trigger(EVENT_LOG, \"Connection requested with: \" + endpointId);\n }", "public interface SearchCallback {\n\n void success(ArrayList<Tweet> result, boolean isNewQuery);\n\n void failure(String e);\n\n}", "@Override\n public void onGetResult(VoiceRecognizerResult result) {\n mResultTv.setText(\"(\" + result.text + \")\");\n\n if (result.isEnd) {\n mRecoState = 0;\n updateBtn(mRecoState);\n }\n }", "public boolean activeScan() throws Exception {\n try {\n LogManager.suitLogger.info(\"Active scan starting...\");\n // api = new ClientApi(ZAP_HOSTNAME, ZAP_SESSION_PORT, ZAP_API_KEY);\n ApiResponse response = api.ascan.scan(WEB_APP_URL, null, null, null, null, null);\n\n String scanid;\n int progress;\n\n // The scan now returns a scan id to support concurrent scanning\n scanid = ((ApiResponseElement) response).getValue();\n LogManager.suitLogger.info(\"scanid : \" + scanid);\n // Poll the status until it completes\n while (true) {\n Thread.sleep(1000);\n progress = Integer.parseInt(((ApiResponseElement) api.ascan.status(scanid)).getValue());\n LogManager.suitLogger.info(\"Active scan progress : \" + progress + \"%\");\n if (progress >= 100) {\n break;\n }\n }\n LogManager.suitLogger.info(\"Active scan completed\");\n return true;\n\n } catch (Exception ex) {\n throw new UnicornZapException(\"Failed to perform penetration testing active scan .. \", ex);\n }\n }", "@Override\n\t\t\tpublic void handleMessage(Message msg) {\n\t\t\t\tswitch (msg.what) {\n\t\t\t\tcase MSG_SEARCH_FINISHED:\n\t\t\t\t\tafterSearch();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tsuper.handleMessage(msg);\n\t\t\t}", "public abstract void startPeriodicallScan();", "public void onTestSuccess(ITestResult result) {\n\t\t\n\t}", "private void onBarcodeDetected(Barcode barcode) {\n Log.d(TAG, \"Detected barcode with value: \" + barcode.displayValue);\n\n Intent returnIntent = new Intent();\n returnIntent.putExtra(INTENT_EXTRA_BARCODE_VALUE, barcode.displayValue);\n setResult(RESULT_OK, returnIntent);\n finish();\n }", "@Override\n public void run() {\n long startTime = System.currentTimeMillis();\n DecodeResult decodeResult = LightScannerManager.getInstance().decode(data);\n long timeCost = System.currentTimeMillis() - startTime;\n// String res = \"timeCost:\" + timeCost + \"\\nresult:\" +\n// ((decodeResult == null || decodeResult.getContent() == null) ? \"null\" : decodeResult.getContent());\n// Log.i(\"Test\", res);\n camera.addCallbackBuffer(data);\n// Intent intent = new Intent();\n// intent.putExtra(\"SCAN_RESULT\", res);\n if(decodeResult.getContent() != null){\n //setResult(RESULT_OK, intent);\n sendSuccessBroadcast(decodeResult.getContent());\n //finish();\n }\n }", "@Override\n\t\tpublic void onGetSuggestionResult(MKSuggestionResult arg0, int arg1) {\n\t\t\t\n\t\t}", "@Override\n public void onClick(View v) {\n IntentIntegrator integ = IntentIntegrator.forSupportFragment(search_Fragement.this);\n integ.setCaptureActivity(CaptureAct.class);\n integ.setOrientationLocked(false);\n integ.setDesiredBarcodeFormats(IntentIntegrator.ALL_CODE_TYPES);\n integ.setPrompt(\"scanning code..\");\n integ.initiateScan();\n\n\n }" ]
[ "0.7161397", "0.7017784", "0.6841524", "0.6838592", "0.6697415", "0.66762465", "0.64858854", "0.6481691", "0.6398427", "0.63424253", "0.6250738", "0.6216722", "0.6148129", "0.6147891", "0.6115946", "0.6110114", "0.61077553", "0.61020845", "0.60988396", "0.6094416", "0.60796344", "0.60736585", "0.6059706", "0.6013305", "0.59847254", "0.59752864", "0.5961406", "0.5944509", "0.5938099", "0.59370536", "0.59367645", "0.5927174", "0.5904276", "0.5900761", "0.58877397", "0.5874235", "0.5846423", "0.58427453", "0.58336025", "0.5817684", "0.5808332", "0.57993245", "0.57854337", "0.57784015", "0.5755559", "0.5751655", "0.57475054", "0.5743784", "0.5741912", "0.5709625", "0.56979793", "0.5687787", "0.5687119", "0.56678665", "0.5648252", "0.5642729", "0.56356025", "0.5620793", "0.5613547", "0.5609541", "0.560868", "0.56018776", "0.55943877", "0.5593174", "0.5576589", "0.5575691", "0.5568963", "0.5561856", "0.55551696", "0.5554761", "0.5552966", "0.55502146", "0.55400044", "0.55327106", "0.5516984", "0.55062735", "0.55009156", "0.5478816", "0.5474565", "0.547164", "0.54563266", "0.54526407", "0.5444593", "0.5443881", "0.5440952", "0.54330856", "0.54173535", "0.5405158", "0.5400935", "0.539991", "0.5395657", "0.5388147", "0.5385579", "0.5379815", "0.5378532", "0.536915", "0.5366673", "0.53643215", "0.5362175", "0.53606063" ]
0.5705539
50
callback method used to notify move result (if robot last action type was MOVE_FORWARD)
public abstract void notifyMoveResult(boolean hasMoved);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void moveSuccessfullyExecuted(Move move) {\n\t\tSystem.out.println(\"executed: \"+move);\r\n\t}", "void onMoveTaken(Piece captured);", "void doneMoving();", "@Override\n\tpublic void onMoveCompleted(MoveEvent arg0) {\n\t\t\n\t}", "void onMove();", "protected void onMove() {\r\n }", "public void notifyMoveAnimationFinished();", "@Override\n\tpublic void moveExecFinished(ReadOnlyBoard board, Counter player,\n\t\t\tCounter nextPlayer) {\n\n\t}", "public void AskForMove();", "@Override\n public void onMove(boolean absolute) {\n \n }", "@Override\r\n\tprotected void onMove() {\n\t\t\r\n\t}", "private void onMovementComplete() {\n Callable<Boolean> movementCompleted;\n Consumer<Method> movementFailed;\n\n synchronized (_mutex) {\n movementCompleted = _movementCompleted;\n movementFailed = _movementFailed;\n\n _movementCompleted = null;\n _movementFailed = null;\n }\n\n boolean bMovementCompleted = false;\n if (movementCompleted != null) {\n try {\n bMovementCompleted = movementCompleted.call();\n } catch (Exception e) {\n _log.error(\"An error occurred while completing a movement.\", e);\n }\n }\n\n if (!bMovementCompleted && movementFailed != null) {\n movementFailed.accept(null);\n }\n }", "boolean isMoveFinished(int tick);", "default void onMoveMade(ScotlandYardView view, Move move) {}", "boolean doMove();", "public void CallBackDelegate(Position newPosition,\r\n\t\t\tBlankPosition newBlankPosition, MoveMethod mm) {\n\t\t\r\n\t}", "@Override\n \t\t\t\tpublic void doMove() {\n \n \t\t\t\t}", "public abstract boolean changeMove();", "private void HandleOnMoveEnd(Board board, Piece turn, boolean success){\n\t}", "@Override\n\tpublic void onMoveError(String msg) {\n\n\t}", "@Override\n public void onMove(float x, float y) {\n }", "public void toMoving() {\n notifyStartMoving(this.getCurrentTurn().getCurrentPlayer().getNickname());\n if (getCurrentTurn().getCurrentPlayer().isHasSpecialMove()) {\n notifyAskForEffect(currentTurn.getCurrentPlayer().getNickname());\n } else {\n notifyChooseWorker(this.getCurrentTurn().getCurrentPlayer().getNickname(), board);\n }\n }", "private void HandleOnMoveStart(Board board, Piece turn){}", "public boolean move();", "public void move() {\n\t\tSystem.out.println(\"Robot Can Move\");\n\t}", "abstract public void moveForward();", "@Override\n public void doOpponentMove(Display disp) {\n listenForMove(disp);\n }", "public abstract void doPerMoveWork();", "@Override\n\t\t\t\tpublic void onActionMove(float x, float y) {\n\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void onActionMove(float x, float y) {\n\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void onActionMove(float x, float y) {\n\n\t\t\t\t}", "@Override\n public void onCameraMoveStarted(int reason) {}", "@Override\n\tpublic void move() {\n\t\tSystem.out.println(\"Can Move\");\n\t}", "public boolean GetMove();", "public void notifyMoveSelected(final Move move);", "void moveForward();", "@Override\n\tpublic void move() {\n\t}", "@Override\n public void move () {\n }", "@Override\n\tpublic void move() {\n\t\t\n\t}", "@Override\n\tpublic void move() {\n\n\t}", "public abstract void move();", "public abstract void move();", "public abstract void move();", "public abstract void move();", "public abstract void move();", "public abstract void move();", "public abstract void move();", "@Override\n public void move() {\n System.out.println(\"I roam here and there\");\n }", "@Override\r\n\tpublic void move() {\n\r\n\t}", "boolean prepareToMove();", "public void move(){\n\t\t\n\t}", "public abstract void move(Position position);", "@Override\n\tpublic void excute() {\n\t\tmoveEvent.move(commandinfo.getValue() * 200);\n\t}", "public void move() {\n\n }", "public void getMove(){\n\t\t\n\t}", "@Override\n\tpublic void move() {\n\t\tSystem.out.println(\"하늘을 날다\");\n\t}", "public void move() {\r\n\t\tSystem.out.print(\"This Tiger moves forward\");\r\n\t}", "@Override\n public void startMove(Location destination, Callable<Boolean> movementCompleted, Consumer<Method> movementFailed, ENaviType naviType, boolean moveStraight) {\n cancelMoveTask();\n if (destination == null || !destination.isValid()) {\n onMovementComplete();\n return;\n }\n\n synchronized (_mutex) {\n _movementCompleted = movementCompleted;\n _movementFailed = movementFailed;\n }\n\n getOwner().getAi().setFindPathCompleted(false);\n _waypoints.add(destination);\n _movementTick = System.currentTimeMillis();\n _navigationType = naviType;\n\n if (_movementTask == null || _movementTask.isDone()) {\n _movementTask = ThreadPool.getInstance().scheduleAiAtFixedRate(this, 0, 150, TimeUnit.MILLISECONDS);\n }\n }", "void onIdentityMove(int fromPosition, int toPosition);", "public void move() {\n if(Objects.nonNull(this.position)) {\n Position position = this.getPosition();\n Function<Position, Position> move = moveRobotInDirectionMap.get(position.getDirection());\n this.position = move.apply(position);\n }\n }", "public void move() {\r\n\t\tmoveCount++;\r\n\t}", "@Override\n public void OnGo(int position) {\n }", "@Override\n public void onCameraMoveStarted(int i) {\n\n }", "public boolean execute(int action, Point nextposition, double x, double y, int direction) {\n Player currentPlayer = getTurn();\n boolean success = false;\n if (action == 0) {\n success = currentPlayer.walk(board, nextposition);\n }\n if (action == 1) {\n success = currentPlayer.putPlank(board, x, y, direction);\n }\n if (action == 2) {\n winner = getPlayer(1-currentPlayer.getLabel());\n return true;\n }\n// if (isWin(getTurn(), getTurn().getPosition())) {\n// return true;\n// }\n // move is valid, finish and switch turns.\n isWin(currentPlayer, currentPlayer.getPosition());\n if (success) {\n finish();\n return true;\n }\n return false;\n }", "void userMoveRequested(int playerIndex);", "public void move() {\n process(2);\n }", "public void move() {\n\r\n\t}", "public void move();", "public void move();", "public boolean moveOn() {\n\t\t\n\t}", "void onTurn(GameIO io, GameState move);", "abstract void move();", "public void receivedInvalidMoveMessage();", "public abstract void makeMove(GameStatus gameStatus);", "public abstract boolean attemptMove(Player currentPlayerObj, Coordinate move);", "public void move() {\r\n\t\tSystem.out.print(\"This Goose moves forward\");\r\n\t}", "@Override\r\n public void act() {\r\n boolean willMove = canMove();\r\n if (isEnd) {\r\n // to show step count when reach the goal\r\n if (!hasShown) {\r\n String msg = stepCount.toString() + \" steps\";\r\n JOptionPane.showMessageDialog(null, msg);\r\n hasShown = true;\r\n }\r\n } else if (willMove) {\r\n move();\r\n // increase step count when move\r\n stepCount++;\r\n // 把当前走过的位置加入栈顶的arrayList\r\n crossLocation.peek().add(getLocation());\r\n // 当前方向的概率+1\r\n probablyDir[getDirection() / 90]++;\r\n } else if (!willMove) {\r\n // 这时候必须一步一步返回栈顶arrayList的开头\r\n ArrayList<Location> curCrossed = crossLocation.peek();\r\n curCrossed.remove(curCrossed.size() - 1);\r\n next = curCrossed.get(curCrossed.size() - 1);\r\n move();\r\n stepCount++;\r\n // 当前方向反向的概率-1\r\n probablyDir[((getDirection() + Location.HALF_CIRCLE)\r\n % Location.FULL_CIRCLE) / Location.RIGHT]--;\r\n if (curCrossed.size() == 1) {\r\n // 返回之后pop\r\n crossLocation.pop();\r\n }\r\n }\r\n }", "@Override\n public void notifyEndMove() {\n try {\n if (getClientInterface() != null)\n getClientInterface().notifyEndMove();\n }\n catch (RemoteException e) {\n System.out.println(\"remote sending end move error\");\n }\n }", "public void calRightMove() {\n }", "public void performFunction() {\n\n if (totalMove >= limit)\n finished = true;\n\n ////////////////////////////////////////\n // Else continue to move node.\n\n else {\n\n newNode.translate(0,move);\n totalMove += move;\n }\n }", "void onMove(Sudoku.State state, Location loc, Numeral num);", "public abstract int makeMove();", "@Override\n\t\t\t\t\t\t\t\t\tpublic void callback(int position) {\n\n\t\t\t\t\t\t\t\t\t}", "@Override\n protected boolean isFinished() {\n SmartDashboard.putNumber(\"TurnCommand Current Heading\", Robot.m_drivetrain.getAngle());\n SmartDashboard.putNumber(\"TurnCommand Target\", Start + TurnGoal);\n if (IsLeft) {\n return Robot.m_drivetrain.getAngle() <= Start + TurnGoal;\n } else {\n return Robot.m_drivetrain.getAngle() >= Start + TurnGoal;\n }\n }", "private Action doNextMove(Action move){\n\t\t// update east or north\n\t\tif (move == Action.East){\n\t\t\teast++;\n\t\t} else if (move == Action.West){\n\t\t\teast--;\n\t\t} else if (move == Action.North){\n\t\t\tnorth++;\n\t\t} else if (move == Action.South){\n\t\t\tnorth--;\n\t\t}\n\t\treturn move;\n\t}", "@Override\n\tpublic void makeNextMove() \n\t{\n\t}", "@Override\n public void gameOver(Result result, Move lastMove) {\n }", "public abstract void Move();", "void moveAdded(int playerIndex, Move move);", "void move();", "public void moveForward(){\n\t\tSystem.out.println(\"Vehicle moved forward\");\n\t}", "default void onActionFrame(GameIO io, GameState move) {}", "boolean makeMove();", "public void move() {\r\n\t\tSystem.out.print(\"This animal moves forward\");\r\n\t}", "@Override\n\tvoid move(int x, int y) {\n\n\t}", "@Override\n public void timePassed() {\n moveOneStep();\n }", "public interface ILogicCallback {\n\n /**\n * Make the move on the game board.\n *\n * @param index The field index, between 0..63.\n * @param player The player, must not be null.\n * @return True if the move was successful or false if not.\n */\n boolean makeMove(int index, Player player);\n\n}", "@Override\r\n public int run() {\n if (robot.rightDrive.isBusy() && robot.leftDrive.isBusy()) {\r\n robot.leftDrive.setPower(leftSpeed);\r\n robot.rightDrive.setPower(rightSpeed);\r\n\r\n /*telemetry.addData(\"MoveByEncoder To\", \"Left: (%2f), Right (%2f)\",\r\n leftTarget, rightTarget);\r\n telemetry.addData(\"MoveByEncoder At\", \"Left: (%2f), Right (%2f)\",\r\n robot.leftDrive.getCurrentPosition(), robot.rightDrive.getCurrentPosition());\r\n telemetry.update();*/\r\n\r\n telemetry.addData(\"Left Pos\", robot.leftDrive.getCurrentPosition());\r\n telemetry.addData(\"Right Pos\", robot.rightDrive.getCurrentPosition());\r\n telemetry.update();\r\n\r\n return 0;\r\n\r\n }\r\n\r\n return nextPos;\r\n }", "public void Move()\n {\n \n }", "void onStartFindDirection();" ]
[ "0.7134273", "0.6976024", "0.6947309", "0.6943718", "0.69080645", "0.68498594", "0.67006445", "0.6609998", "0.6549574", "0.6506367", "0.6501533", "0.6486151", "0.6479275", "0.6460295", "0.64576405", "0.6420539", "0.6384577", "0.6374001", "0.63453525", "0.6318013", "0.6286383", "0.6275896", "0.6274791", "0.62706196", "0.6261652", "0.62546915", "0.62010974", "0.619639", "0.6186626", "0.6186626", "0.6186626", "0.6167992", "0.6153338", "0.6150285", "0.6150033", "0.6139946", "0.61244416", "0.6120979", "0.61080205", "0.6103174", "0.60877126", "0.60877126", "0.60877126", "0.60877126", "0.60877126", "0.60877126", "0.60877126", "0.6078314", "0.60651785", "0.60607934", "0.60533255", "0.60515225", "0.6025807", "0.6009978", "0.60085267", "0.60037273", "0.59903735", "0.5988657", "0.59877545", "0.5984457", "0.5979039", "0.597363", "0.5969185", "0.5957123", "0.5947194", "0.59441113", "0.5942612", "0.5941899", "0.5941899", "0.59299994", "0.59286296", "0.59190124", "0.59168804", "0.5914418", "0.590982", "0.590048", "0.58996904", "0.58930224", "0.58922607", "0.5872748", "0.58697236", "0.5862019", "0.5836318", "0.5833815", "0.58297044", "0.581862", "0.5807964", "0.58066183", "0.5800189", "0.57818556", "0.5772741", "0.57725346", "0.57597595", "0.5754939", "0.57543653", "0.5753037", "0.5749074", "0.5741106", "0.5740431", "0.57365274" ]
0.7783039
0
Create a definition of a subject area.
public GUIDResponse createSubjectArea(String serverName, String userId, ReferenceableRequestBody requestBody) { final String methodName = "createSubjectArea"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); GUIDResponse response = new GUIDResponse(); AuditLog auditLog = null; try { if (requestBody != null) { if (requestBody.getProperties() instanceof SubjectAreaProperties) { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName); SubjectAreaProperties properties = (SubjectAreaProperties)requestBody.getProperties(); String subjectAreaGUID = handler.createSubjectArea(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), properties.getQualifiedName(), properties.getSubjectAreaName(), properties.getDisplayName(), properties.getDescription(), properties.getUsage(), properties.getScope(), properties.getDomainIdentifier(), properties.getAdditionalProperties(), properties.getTypeName(), properties.getExtendedProperties(), new Date(), methodName); response.setGUID(subjectAreaGUID); } else { restExceptionHandler.handleInvalidPropertiesObject(SubjectAreaProperties.class.getName(), methodName); } } else { restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); } } catch (Exception error) { restExceptionHandler.captureExceptions(response, error, methodName, auditLog); } restCallLogger.logRESTCallReturn(token, response.toString()); return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public SubjectareasRecord() {\n\t\tsuper(Subjectareas.SUBJECTAREAS);\n\t}", "public SubjectAreaDefinitionResponse getSubjectAreaDefinitionByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \"getSubjectAreaDefinitionByGUID\";\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaDefinitionResponse response = new SubjectAreaDefinitionResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> subjectAreaHandler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n SubjectAreaElement element = subjectAreaHandler.getBeanFromRepository(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n new Date(),\n methodName);\n if (element != null)\n {\n SubjectAreaDefinition subjectAreaDefinition = new SubjectAreaDefinition(element);\n\n subjectAreaDefinition.setParentSubjectAreaGUID(subjectAreaHandler.getSubjectAreaParentGUID(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n subjectAreaDefinition.setNestedSubjectAreaGUIDs(subjectAreaHandler.getSubjectAreaChildrenGUIDs(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n GovernanceDefinitionHandler<GovernanceDefinitionElement> definitionHandler = instanceHandler.getGovernanceDefinitionHandler(userId, serverName, methodName);\n ElementStubConverter<ElementStub> elementStubConverter = instanceHandler.getElementStubConverter(userId, serverName, methodName);\n List<Relationship> relationships = definitionHandler.getGoverningDefinitionLinks(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n 0,\n 0,\n false,\n false,\n new Date(),\n methodName);\n List<ElementStub> definitions = elementStubConverter.getNewBeans(ElementStub.class, relationships, true, methodName);\n subjectAreaDefinition.setAssociatedGovernanceDefinitions(definitions);\n\n response.setProperties(subjectAreaDefinition);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "AREA createAREA();", "public abstract Area newArea();", "Definition createDefinition();", "public Area() {\n\t}", "public SafetyNetArea createArea(SafetyNetArea area) {\n\n String typeId = area.getPromulgationType().getTypeId();\n log.info(\"Creating SafetyNET area \" + area.getName() + \" for promulgation type \" + typeId);\n\n area.setPromulgationType(promulgationTypeService.getPromulgationType(typeId));\n return saveEntity(area);\n }", "public Subject createSubject(Subject subject);", "public Area() {\n }", "public SubjectareasRecord(Integer id, Integer nedid, Integer typeid, Timestamp created, Timestamp lastmodified) {\n\t\tsuper(Subjectareas.SUBJECTAREAS);\n\n\t\tsetValue(0, id);\n\t\tsetValue(1, nedid);\n\t\tsetValue(2, typeid);\n\t\tsetValue(3, created);\n\t\tsetValue(4, lastmodified);\n\t}", "default TArea createArea(AreaFactory<TContent, TArea> areaSupplier)\n {\n return areaSupplier.createArea();\n }", "PlotAreaType createPlotAreaType();", "@SuppressWarnings(value = \"unused\")\n public VoidResponse linkSubjectAreaToGovernanceDefinition(String serverName,\n String userId,\n String subjectAreaGUID,\n String definitionGUID,\n RelationshipRequestBody requestBody)\n {\n final String methodName = \"linkSubjectAreaToGovernanceDefinition\";\n\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n final String definitionGUIDParameterName = \"definitionGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n if (requestBody.getProperties() != null)\n {\n handler.linkElementToElement(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n requestBody.getProperties().getEffectiveFrom(),\n requestBody.getProperties().getEffectiveTo(),\n new Date(),\n methodName);\n }\n else\n {\n handler.linkElementToElement(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n (InstanceProperties) null,\n null,\n null,\n new Date(),\n methodName);\n }\n }\n else\n {\n handler.linkElementToElement(userId,\n null,\n null,\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n (InstanceProperties) null,\n null,\n null,\n new Date(),\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public void setArea(String area) {\n this.area = area;\n }", "void create(Section section);", "Section createSection();", "public void setArea(String area) {\n this.area = area;\n }", "UMLDomainConcept createUMLDomainConcept();", "DomainConcept createDomainConcept();", "public void setArea(String area) {\n\t\tthis.area = area;\n\t}", "public AssignmentBundle(AssignmentOutline receivedOutline){\n\n this.name = receivedOutline.getName();\n this.outline = receivedOutline;\n }", "SectionsType createSectionsType();", "Assignment createAssignment();", "Assignment createAssignment();", "public void createEnterZoneRule(){\n// ECAAgent.getDefaultECAAgent().createRule(\"enterZoneRule_\"+name,enterZone,\"MAKEFITS.Track.C_enterTheZone\",\"MAKEFITS.Track.A_enterTheZone\",1,CouplingMode.IMMEDIATE ,Context.RECENT);\n ECAAgent.getDefaultECAAgent().createRule(\"enterZoneRule_\"+name,enterZone,\"MAKEFITS.Track.C_enterTheZone\",\"MAKEFITS.Track.A_enterTheZone\",1,CouplingMode.IMMEDIATE ,ParamContext.RECENT);\n // ECAAgent.getDefaultECAAgent().createRule(\"enterZoneRule_\"+name,enterZone,\"MAKEFITS.Track.C_enterTheZone\",\"MAKEFITS.Track.A_enterTheZone\",1,CouplingMode.IMMEDIATE ,ParamContext.CHRONICLE);\n }", "public void createNoSubject() {\n\n }", "ConceptsType createConceptsType();", "Sect1 createSect1();", "SectionType createSectionType();", "private void mapAreaOne()\n\n {\n\n Area area = areaIDMap.get(Constants.FIRST_AREA_ID);\n\n area.areaMap.put(Constants.North, areaIDMap.get(Constants.SECOND_AREA_ID));\n\n area.areaMap.put(Constants.South, areaIDMap.get(Constants.FIFTH_AREA_ID));\n\n area.areaMap.put(Constants.East, areaIDMap.get(Constants.FOURTH_AREA_ID));\n\n area.areaMap.put(Constants.West, areaIDMap.get(Constants.SIXTH_AREA_ID));\n\n area.paths = Constants.NorthSouthEastAndWest;\n\n }", "public Node(Subject subject){\n\t\tthis.sub = subject;\n\t\tthis.color = 0;\n\t\tthis.diameter = 100;\n\t\tthis.movable = true;\n\t\tthis.expanded = false;\n\t\tthis.locked = false;\n\t\tthis.position = new PVector();\n\t\tthis.pane = new Pane(this);\n\t\tthis.color2 = 0;\n\t}", "Schule createSchule();", "@Override\r\n\tpublic void create() {\n\t\tsuper.create();\r\n\t\t// Ground\r\n\t\tBodyDef groundBodyDef = new BodyDef();\r\n\t\tgroundBody = world.createBody(groundBodyDef);\r\n\t\tEdgeShape edgeShape = new EdgeShape();\r\n\t\tedgeShape.set(new Vector2(50.0f, 0.0f), new Vector2(50.0f, 0.0f));\r\n\t\tgroundBody.createFixture(edgeShape, 0.0f);\r\n \r\n\t\tcreateFirstGroupShape();\r\n\t\t// the second group\r\n\t\tcreateSecondGroupShape();\r\n\t}", "public Tarea() {\n\t}", "private Area(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public CommAreaRecord() {\n\t}", "public PathElementIF createTopic(String type, String id);", "Division createDivision();", "public StudyArea(String name, String address, String faculty, boolean hasPort,\n boolean isIndoor, int maxPax) {\n this.name = name;\n this.address = address.trim();\n this.faculty = faculty;\n this.hasPort = hasPort;\n this.isIndoor = isIndoor;\n this.maxPax = maxPax;\n }", "public ConstraintDefinition() {\n\t\tthis(\"\");\n\t}", "public static void createBodyAndType(World world) {\n\t\t\n\t}", "org.hl7.fhir.ResourceReference addNewSubject();", "public void makeBody()\n {\n Texture text;\n if(bounds.getHeight()<bounds.getWidth()) {\n text = new Texture(\"img/wall.jpg\");\n }else{\n text = new Texture(\"img/wall2.jpg\");\n }\n\n Sprite wallSprite;\n wallSprite = new Sprite(text);\n wallSprite.setSize(bounds.getWidth(),bounds.getHeight());\n wallSprite.setOrigin(bounds.getWidth()/2, bounds.getHeight()/2);\n\n BodyDef bodydef = new BodyDef();\n bodydef.type = BodyType.StaticBody;\n bodydef.position.set(position.x,position.y);\n\n PolygonShape shape = new PolygonShape();\n shape.setAsBox(bounds.width/2, bounds.height/2);\n\n FixtureDef def = new FixtureDef();\n def.shape = shape;\n def.friction = 0.5f;\n def.restitution = 0;\n wall = world.createBody(bodydef);\n wall.createFixture(def);\n wall.getFixtureList().get(0).setUserData(\"w\");\n wall.setUserData(wallSprite);\n\n shape.dispose();\n }", "interface Definition extends\n NamespaceAuthorizationRule.DefinitionStages.Blank,\n NamespaceAuthorizationRule.DefinitionStages.WithCreate {\n }", "TIAssignment createTIAssignment();", "protected void generateSubject() {\n codegen.gen(expression.getSubjectExpression(), subjectType);\n }", "public void setArea(Polygon area) {\n\t\tthis.area = area;\n\t}", "protected abstract void defineConstraints();", "public void createRuleOverview() {\n\t\tmainBox.setBorder(BorderFactory.createLineBorder(Color.black));\n\t\tmainBox.add(nameBox);\n\t\tmainBox.add(inputBox);\n\t\tmainBox.add(outputBox);\n\t}", "public void setNombreArea(String p) { this.nombreArea = p; }", "public static void GenerateTextArea(int id)\n\t{\n\t\tareaHeight += 210;\n\t\tHome.createArticle.setPreferredSize(new Dimension(800, areaHeight));\n\t\ti++; \n\t\tgbc.gridx = 0;\n\t\tgbc.gridy = i;\n\t\tgbc.gridwidth = 1;\n\t\tgbc.insets = new Insets(10, 0, 0, 5);\n\t\tgbc.anchor = GridBagConstraints.LINE_END;\n\t\tHome.createArticle.add(textLabels.get(id), gbc);\n\t\t\n\t\tgbc.gridx = 1;\n\t\tgbc.gridwidth = 3;\n\t\tgbc.insets = new Insets(10, 0, 0, 0);\n\t\tgbc.anchor = GridBagConstraints.LINE_START;\n\t\tgbc.weighty = 10;\n\t\tHome.createArticle.add(textAreas.get(id), gbc);\n\t}", "private void setupSubjectPanel() {\n\t\tpnlSubject = new JPanel(new GridBagLayout());\n\t\tgc.fill = GridBagConstraints.HORIZONTAL;\n\t\tgc.anchor = GridBagConstraints.CENTER;\n\t\tgc.insets = new Insets(10, 10, 10, 10);\n\t\tgc.gridx = 0;\n\t\t\n\t\tgc.gridy = 0;\n\t\tgc.gridx = 0; pnlSubject.add(lblSubject, gc);\n\t\tgc.gridx = 1; pnlSubject.add(txtSubject, gc);\n\t\t\n\t\tgc.gridy = 1;\n\t\tgc.gridx = 0; pnlSubject.add(lblDate, gc);\n\t\tgc.gridx = 1; pnlSubject.add(txtDate, gc);\n\t}", "Sect2 createSect2();", "protected void createOrgAnnotations() {\n\t\tString source = \"org.abchip.mimo.core.base.invocation\";\n\t\taddAnnotation\n\t\t (invoiceEClass.getEOperations().get(0),\n\t\t source,\n\t\t new String[] {\n\t\t });\n\t}", "public Schema(String name, String location, String year_established, String area){\n this.name = name;\n this.location = location;\n this.year_established = year_established;\n this.area = area;\n }", "@Test\n\tpublic void driverAssignArea() {\n\t\tfinal Object testingData[][] = {\n\n\t\t\t{\n\t\t\t\t\"chapter3\", \"area3\", null\n\t\t\t},//1. All fine\n\t\t\t{\n\t\t\t\t\"chapter1\", \"area3\", IllegalArgumentException.class\n\t\t\t},//2. A Chapter who have an area, self-assing another area\n\n\t\t};\n\n\t\tfor (int i = 0; i < testingData.length; i++)\n\t\t\tthis.templateAssignArea((String) testingData[i][0], (String) testingData[i][1], (Class<?>) testingData[i][2]);\n\n\t}", "private Subject(SubjectBuilder builder) {\n setDefaultTimezone();\n setDefaultLanguage();\n setOsType();\n setOsVersion();\n setDeviceModel();\n setDeviceVendor();\n\n if (builder.context != null) {\n setContextualParams(builder.context);\n }\n\n Logger.v(TAG, \"Subject created successfully.\");\n }", "public void setSubject(Subject subject);", "protected void createAspectAnnotations() {\n\t\tString source = \"aspect\";\t\n\t\taddAnnotation\n\t\t (partEClass.getEOperations().get(0), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (partEClass.getEOperations().get(1), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (partEClass.getEOperations().get(2), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (partEClass.getEOperations().get(3), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_Value(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_MaxValue(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_MinValue(), \n\t\t source, \n\t\t new String[] {\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_CurrentMass(), \n\t\t source, \n\t\t new String[] {\n\t\t });\n\t}", "public void createSurvey(int tid);", "Para createPara();", "public com.example.grpc.SimpleServiceOuterClass.Area.Builder addAreaBuilder() {\n return getAreaFieldBuilder().addBuilder(\n com.example.grpc.SimpleServiceOuterClass.Area.getDefaultInstance());\n }", "public com.example.grpc.SimpleServiceOuterClass.Area.Builder addAreaBuilder() {\n return getAreaFieldBuilder().addBuilder(\n com.example.grpc.SimpleServiceOuterClass.Area.getDefaultInstance());\n }", "public com.example.grpc.SimpleServiceOuterClass.Area.Builder addAreaBuilder() {\n return getAreaFieldBuilder().addBuilder(\n com.example.grpc.SimpleServiceOuterClass.Area.getDefaultInstance());\n }", "public SAR(String options, String p1Name, String p2Name) {\n\t\tthis.options = options;\n//\t\tSystem.out.println(\"options:\" + this.options);\n\t\tthis.p1Name = p1Name;\n\t\tthis.p2Name = p2Name;\n\n\t\tif (this.options.contains(\"#\")) {\n\t\t\tint index = this.options.indexOf(\"#\");\n\t\t\tthis.experimentType = Integer.parseInt(options.substring(index + 1, index + 2));\n\t\t\tSystem.out.println(\"Experiment type is? \" + this.experimentType);\n\t\t}\n\n\t\tcanvas = new DrawCanvas(); // Construct a drawing canvas (a JPanel)\n\t\tcanvas.setFocusable(true);\n\t\tcanvas.setPreferredSize(new Dimension(CANVAS_WIDTH, CANVAS_HEIGHT));\n\t\tcanvas.setBorder(BorderFactory.createEmptyBorder(2, 5, 4, 5));\n\n\t\t//draw rooms\n\t\tcanvas.setLayout(new GridLayout(ROWS,COLS));\n\t\tfor (int i = 0; i < ROWS; i++)\n\t\t\tfor (int j = 0; j < COLS; j++){\n\t\t\t\tsquares[i][j] = new DrawRoom();\n\t\t\t\tsquares[i][j].setBackground(Color.WHITE);\n\t\t\t\tsquares[i][j].setBorder(BorderFactory.createLineBorder(Color.black));\n\t\t\t\tcanvas.add(squares[i][j]);\n\t\t\t}\n\n\t\t// Setup the title bar (JLabel)\n\t\ttitleBar = new JLabel(new ImageIcon(\"images/title.png\"));\n\t\ttitleBar.setBorder(BorderFactory.createEmptyBorder(2, 5, 4, 5));\n\n\t\t// Setup the status bar (JLabel) to display status message during mission\n\t\tstatusBar = new JLabel(\" \");\n\t\tstatusBar.setFont(new Font(\"Serif\", Font.BOLD, 24));\n\t\tstatusBar.setBorder(BorderFactory.createEmptyBorder(2, 5, 4, 5));\n\n\t\tinstructions = new JTextArea();\n\t\tinstructions.setFont(new Font(\"Serif\", Font.ITALIC, 15));\n\t\tinstructions.setFocusable(false);\n\t\tinstructions.setEditable(false);\n\t\tinstructions.setWrapStyleWord(true);\n\t\tinstructions.setBorder(BorderFactory.createEmptyBorder(2, 5, 4, 5));\n\t\tinstructionsSP = new JScrollPane(instructions);\n\n\t\t//This button is used for tutorial only, and disabled by default\n\t\tbtnNext = new JButton(\"Next\");\n\t\tthis.setBtnNextVisible(false);\n\n\t\t//Initialize tutorial objects and stat variables\n\t\tthis.nullifyTutorialObjectsAndStats();\n\n\t\t//A label (used in tutorial only) to let the user know which page of the tutorial they're on\n\t\t//Disabled by default\n\t\tthis.pageNo = new JLabel(\"Page __ of __\");\n\t\tthis.pageNo.setVisible(false);\n\n\t\t//Put the above button into a horizontal box\n\t\tBox boxHoriz = Box.createHorizontalBox();\n\t\tboxHoriz.add(btnNext);\n\t\tboxHoriz.add(Box.createHorizontalStrut(10));\n\t\tboxHoriz.add(pageNo);\n\n\t\t//Now create a vertical box\n\t\tbox = Box.createVerticalBox();\n\t\tbox.add(instructionsSP);\t//Add the instruction text\n\t\tbox.add(boxHoriz);\t\t\t//Add the horizontal box containing the button above\n\n\t\tContainer cp = getContentPane();\n\t\tcp.setLayout(new BorderLayout());\n\t\tcp.setBackground(Color.WHITE);\n\t\tcp.add(titleBar, BorderLayout.NORTH);\n\t\tcp.add(canvas, BorderLayout.CENTER);\n\t\tcp.add(box, BorderLayout.EAST);\n\t\tcp.add(statusBar, BorderLayout.PAGE_END); // same as SOUTH\n\n\t\tthis.setPreferredSize(new Dimension(1600, 800));\n\n//\t\tToolkit tk = Toolkit.getDefaultToolkit();\n//\t int xSize = ((int) tk.getScreenSize().getWidth());\n//\t int ySize = ((int) tk.getScreenSize().getHeight());\n//\t this.setPreferredSize(new Dimension(xSize, ySize));\n\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tthis.pack(); // pack all the components in this JFrame\n\t\tsetTitle(\"Search & Rescue\");\n\t\tsetVisible(true); // show this JFrame\n\n\n\t\tif (this.options.contains(\"T\")) {\t//tutorial mode\n\t\t\tthis.initTutorial();\t//enable this later once debugging complete\n//\t\t\tthis.initFinalMission();\n\t\t} else {\t\t\t\t\t\t\t//non-tutorial mode\n\n\t\t\t// Setup the instruction area (JTextArea)\n\t\t\tsetInstrText(InstructionMsg.DEFAULT);\n\n\t\t\t(new StartMissionPopupThread()).start();\t//popup GUI to start mission\n\n\t\t\t//custom method to initialize board and players\n\t\t\tthis.initMission();\n\t\t}\n\t\t//end if (this.options.contains(\"T\")) / else\n\t}", "public Subject() {\n\t}", "public ContourEntity(Shape area, String toolTipText) { super(area, toolTipText); }", "public void defineBody()\n {\n if(B2body != null){\n PlayScreen.world.destroyBody(B2body);}\n\n BodyDef bdef = new BodyDef();\n bdef.type = BodyDef.BodyType.KinematicBody;\n B2body = PlayScreen.world.createBody(bdef);\n\n\n calculateTriangle(mirror.getX(), mirror.getY(), mirror.getRotation());\n }", "public Node(Subject subject, GUI gui, PublicationManager manager){\n\t\tthis(subject);\n\t\tthis.gui = (GUI) gui;\n\t\tthis.pane.setGUI(gui);\n\t\tRandom random = new Random();\n\t\tsetPosition(150+ random.nextInt(gui.displayWidth-300), 75+random.nextInt(gui.displayHeight -150 ));\n\t\tdouble citationMultiplier = subject.getScore()> 0 ? Math.log(subject.getScore()) : 0;\n\t\tsetDiameter((int) (10 + 5*citationMultiplier*1.5));\n\t\tthis.color2 = gui.color(0,146,211);\n\t\tthis.manager = manager;\n\t}", "public interface AreaOccupier {\n}", "private IAssignmentElement createAssignment() throws RodinDBException {\n\t\tfinal IMachineRoot mch = createMachine(\"mch\");\n\t\tfinal IEvent event = createEvent(mch, \"event\");\n\t\treturn event.createChild(IAction.ELEMENT_TYPE, null, null);\n\t}", "void createRectangles();", "private static OspfArea areaDetails(JsonNode areaNode) {\n OspfArea area = new OspfAreaImpl();\n String areaId = areaNode.path(AREAID).asText();\n if (isValidIpAddress(areaId)) {\n area.setAreaId(Ip4Address.valueOf(areaId));\n } else {\n log.debug(\"Wrong areaId: {}\", areaId);\n return null;\n }\n String routerId = areaNode.path(ROUTERID).asText();\n if (isValidIpAddress(routerId)) {\n area.setRouterId(Ip4Address.valueOf(routerId));\n } else {\n log.debug(\"Wrong routerId: {}\", routerId);\n return null;\n }\n String routingCapability = areaNode.path(EXTERNALROUTINGCAPABILITY).asText();\n if (isBoolean(routingCapability)) {\n area.setExternalRoutingCapability(Boolean.valueOf(routingCapability));\n } else {\n log.debug(\"Wrong routingCapability: {}\", routingCapability);\n return null;\n }\n String isOpaqueEnabled = areaNode.path(ISOPAQUE).asText();\n if (isBoolean(isOpaqueEnabled)) {\n area.setIsOpaqueEnabled(Boolean.valueOf(isOpaqueEnabled));\n } else {\n log.debug(\"Wrong isOpaqueEnabled: {}\", isOpaqueEnabled);\n return null;\n }\n area.setOptions(OspfUtil.HELLO_PACKET_OPTIONS);\n\n return area;\n }", "public static void main(String[] args) {\n \n Manager manager = new Manager(\"[email protected]\", \"Sally Manager\", \"mgrPass\");\n \n BookAndCancelAppointment bookAndCancelAppointment = new BookAndCancelAppointment();\n \n\n ManageAppointments ma = new ManageAppointments();\n bookAndCancelAppointment.set_ma(ma);\n ma.set_bookAndCancelAppointment(bookAndCancelAppointment);\n\n ManageSystem ms = new ManageSystem();\n ma.set_ms(ms);\n ms.set_ma(ma);\n ms.set_manager(manager);\n \n // Create Subjects\n Subject sub0 = new Subject(\"Intro to Programming\");\n Subject sub1 = new Subject(\"Operating Systems and Networks\");\n Subject sub2 = new Subject(\"Web and Mobile Applications\");\n Subject sub3 = new Subject(\"Computer Architecture\");\n \n // Add subjects to Manager (chosen to only put this uni directional in the implementation since the subject does not need to know the manager, but could be added)\n ms.add_subject(sub0);\n ms.add_subject(sub1);\n ms.add_subject(sub2);\n ms.add_subject(sub3);\n \n // Create Tutors\n TutorData t0 = new TutorData(\"[email protected]\", \"John Tutor\", \"tutpass\");\n TutorData t1 = new TutorData(\"[email protected]\", \"Tutor May\", \"password\");\n TutorData t2 = new TutorData(\"[email protected]\", \"Dave Tutor\", \"tutpassword\");\n TutorData t3 = new TutorData(\"[email protected]\", \"Jane Tutor\", \"passtutor\");\n \n // Add subjects to Manager (needed based on diagram - only implemented uni directional since both directions are not needed)\n ms.add_tutor(t0);\n ms.add_tutor(t1);\n ms.add_tutor(t2);\n ms.add_tutor(t3);\n \n // Add Subjects to Tutors\n t0.add_subject(sub0);\n t0.add_subject(sub1);\n t1.add_subject(sub1);\n t2.add_subject(sub2);\n t2.add_subject(sub3);\n t3.add_subject(sub3);\n t3.add_subject(sub0);\n \n // Create Appointments and add to Tutors\n Date date0 = new Date();\n Date date1 = new Date();\n Date date2 = new Date();\n Date date3 = new Date();\n Date date4 = new Date();\n Date date5 = new Date();\n for(int i = 0; i < 100000; i++){\n int x = 0;\n }\n Date date6 = new Date();\n /*\n String response0 = ma.create_appointment(date0, t0.get_email());\n String response1 = ma.create_appointment(date1, t0.get_email());\n String response2 = ma.create_appointment(date2, t1.get_email());\n String response3 = ma.create_appointment(date3, t2.get_email());\n String response4 = ma.create_appointment(date4, t2.get_email());\n String response5 = ma.create_appointment(date5, t2.get_email());\n String response6 = ma.create_appointment(date6, t2.get_email());\n */\n /* \n Appointment appt0 = new Appointment(date0, 0, t0);\n Appointment appt1 = new Appointment(date1, 1, t0);\n Appointment appt2 = new Appointment(date2, 2, t1);\n Appointment appt3 = new Appointment(date3, 3, t2);\n Appointment appt4 = new Appointment(date4, 4, t2);\n Appointment appt5 = new Appointment(date5, 5, t2);\n Appointment appt6 = new Appointment(date6, 6, t2);\n */\n /* \n // Add appointments to appointment list\n ma.add_appointment(appt0);\n ma.add_appointment(appt1);\n ma.add_appointment(appt2);\n ma.add_appointment(appt3);\n ma.add_appointment(appt4);\n ma.add_appointment(appt5);\n ma.add_appointment(appt6);\n */\n \n /*\n // Create Students\n StudentData s0 = new StudentData(\"[email protected]\", \"John Student\", \"studpass\", 5);\n StudentData s1 = new StudentData(\"[email protected]\", \"Jane Student\", \"pass\", 2);\n StudentData s2 = new StudentData(\"[email protected]\", \"Jack Student\", \"passwo\", 1);\n StudentData s3 = new StudentData(\"[email protected]\", \"Bob Student\", \"studentpass\", 0);\n */\n /* \n // Add students to list\n bookAndCancelAppointment.add_student(s0);\n bookAndCancelAppointment.add_student(s1);\n bookAndCancelAppointment.add_student(s2);\n bookAndCancelAppointment.add_student(s3);\n */\n //test create appointment\n //pass\n System.out.println(ma.create_appointment(date0, t0.get_email()));\n //fail\n System.out.println(ma.create_appointment(date0, t0.get_email()));\n //pass\n System.out.println(ma.create_appointment(date0, t1.get_email()));\n //pass\n System.out.println(ma.create_appointment(date6, t0.get_email()));\n // Add Appointments to Students\n //appt0.student = s1;\n //appt0.booked = true;\n //s1.appointments.add(appt0);\n /* \n // Test Book Appointment method\n \n // Not enough credits case\n System.out.println(bookAndCancelAppointment.bookAppointmentBySubjectAndTime(\"[email protected]\", \"Computer Architecture\", date0));\n \n // Already an appointment booked\n System.out.println(bookAndCancelAppointment.bookAppointmentBySubjectAndTime(\"[email protected]\", \"Web and Mobile Applications\", date1));\n \n // No available tutor case\n System.out.println(bookAndCancelAppointment.bookAppointmentBySubjectAndTime(\"[email protected]\", \"Intro to Programming\", date2));\n \n // Appointment can be booked case\n int s2Credits = s2.numCredits;\n assert(appt4.student == null);\n System.out.println(bookAndCancelAppointment.bookAppointmentBySubjectAndTime(\"[email protected]\", \"Web and Mobile Applications\", date3));\n assert(s2Credits - 1 == s2.numCredits);\n assert(appt4.student == s2);\n // test book by id\n // Not enough credits case\n //System.out.println(bookAndCancelAppointments.BookAppointmentByID(\"[email protected]\", 0));\n \n // Already an appointment booked\n //System.out.println(bookAndCancelAppointments.BookAppointmentByID(\"[email protected]\", 6));\n \n // No available tutor case\n //System.out.println(bookAndCancelAppointments.BookAppointmentByID(\"[email protected]\", 0));\n \n // Appointment can be booked case\n //System.out.println(bookAndCancelAppointments.BookAppointmentByID(\"[email protected]\", 1));\n */\n }", "EM createEM();", "public RoomAreaDoExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public AreaInfoExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "private void createGrpPharmacyDetails() {\n\t\tgrpPharmacyDetails = new Group(getShell(), SWT.NONE);\n\t\tgrpPharmacyDetails.setText(\"Facility Details (shown on labels and reports)\");\n\t\tgrpPharmacyDetails.setBounds(new Rectangle(40, 250, 720, 320));\n\t\tgrpPharmacyDetails.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\t}", "public SubjectAreaResponse getSubjectAreaByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \"getSubjectAreaByGUID\";\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaResponse response = new SubjectAreaResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n response.setElement(handler.getBeanFromRepository(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n new Date(),\n methodName));\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "private RuleDefinition() {\r\n \tthis.id = null;\r\n \tthis.name = null;\r\n \tthis.namespace = null;\r\n this.description = null;\r\n \tthis.typeId = null;\r\n \tthis.propId = null;\r\n this.active = true;\r\n \tthis.proposition = null;\r\n \tthis.actions = null;\r\n \tthis.attributes = null;\r\n this.versionNumber = null;\r\n }", "public AnalysisDef() {}", "interface DefinitionStages {\n /**\n * The first stage of namespace authorization rule definition.\n */\n interface Blank extends AuthorizationRule.DefinitionStages.WithListenOrSendOrManage<WithCreate> {\n }\n\n /**\n * The stage of the definition which contains all the minimum required inputs for\n * the resource to be created (via {@link WithCreate#create()}), but also allows\n * for any other optional settings to be specified.\n */\n interface WithCreate extends Creatable<NamespaceAuthorizationRule> {\n }\n }", "protected void createRect()\r\n\t{\r\n\t\trect = new Rectangle(getX(),getY(),width,height);\r\n\t}", "@Override\r\n\tpublic boolean fillInArea(final XMLTag piece, final Map<String,Object> defined, final Area A, final int direction) throws CMException\r\n\t{\r\n\t\tfinal String layoutType = findStringNow(\"layout\",piece,defined);\r\n\t\tif((layoutType==null)||(layoutType.trim().length()==0))\r\n\t\t\tthrow new CMException(\"Unable to build area without defined layout\");\r\n\t\tfinal LayoutManager layoutManager = getLayoutManager(layoutType);\r\n\t\tif(layoutManager == null)\r\n\t\t\tthrow new CMException(\"Undefined Layout \"+layoutType);\r\n\t\tdefined.put(\"AREA_LAYOUT\",layoutManager.name());\r\n\t\tString size = findStringNow(\"size\",piece,defined);\r\n\t\tif(CMath.isMathExpression(size))\r\n\t\t\tsize=Integer.toString(CMath.parseIntExpression(size));\r\n\t\tif((!CMath.isInteger(size))||(CMath.s_int(size)<=0))\r\n\t\t\tthrow new CMException(\"Unable to build area of size \"+size);\r\n\t\tdefined.put(\"AREA_SIZE\",size);\r\n\t\tfinal List<String> ignoreStats=new XArrayList<String>(new String[]{\"CLASS\",\"NAME\",\"DESCRIPTION\",\"LAYOUT\",\"SIZE\"});\r\n\t\tfillOutStatCodes(A, ignoreStats,\"AREA_\",piece,defined);\r\n\r\n\t\tfinal List<Ability> aV = findAffects(A,piece,defined,null);\r\n\t\tfor(int i=0;i<aV.size();i++)\r\n\t\t{\r\n\t\t\tfinal Ability AB=aV.get(i);\r\n\t\t\tA.setSavable(true);\r\n\t\t\tA.addNonUninvokableEffect(AB);\r\n\t\t}\r\n\t\tfinal List<Behavior> bV = findBehaviors(A,piece,defined);\r\n\t\tfor(int i=0;i<bV.size();i++)\r\n\t\t{\r\n\t\t\tfinal Behavior B=bV.get(i);\r\n\t\t\tB.setSavable(true);\r\n\t\t\tA.addBehavior(B);\r\n\t\t}\r\n\r\n\t\tCMLib.map().addArea(A); // necessary for proper naming.\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\tlayOutRooms(A, layoutManager, CMath.s_int(size), direction, piece, defined);\r\n\t\t\tCMLib.map().delArea(A); // we added it for id assignment, now we are done.\r\n\t\t}\r\n\t\tcatch(final Exception t)\r\n\t\t{\r\n\t\t\tCMLib.map().delArea(A);\r\n\t\t\tCMLib.map().emptyAreaAndDestroyRooms(A);\r\n\t\t\tA.destroy();\r\n\t\t\tif(t instanceof CMException)\r\n\t\t\t\tthrow (CMException)t;\r\n\t\t\tthrow new CMException(t.getMessage(),t);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public VoidResponse addSubjectAreaMemberClassification(String serverName,\n String userId,\n String elementGUID,\n ClassificationRequestBody requestBody)\n {\n final String methodName = \"addSubjectAreaMemberClassification\";\n final String elementGUIDParameterName = \"elementGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n ReferenceableHandler<RelatedElement> handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n if (requestBody.getProperties() instanceof SubjectAreaClassificationProperties)\n {\n SubjectAreaClassificationProperties properties = (SubjectAreaClassificationProperties)requestBody.getProperties();\n\n handler.addSubjectAreaClassification(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n elementGUID,\n elementGUIDParameterName,\n OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME,\n properties.getSubjectAreaName(),\n false,\n false,\n properties.getEffectiveFrom(),\n properties.getEffectiveTo(),\n null,\n methodName);\n }\n else\n {\n restExceptionHandler.handleInvalidPropertiesObject(SubjectAreaClassificationProperties.class.getName(), methodName);\n }\n }\n else\n {\n restExceptionHandler.handleNoRequestBody(userId, methodName, serverName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "GeneralTerm createGeneralTerm();", "public interface ControlArea extends Component {\n\t\n public static final String AREA_BUS_NAME_KEY = \"AREA_BUS_NAME\";\n public static final String AREA_SCHEDULED_EXPORT_KEY = \"AREA_SCHEDULED_EXPORT\";\n public static final String AREA_TOLERANCE_KEY = \"AREA_TOLERANCE\";\n public static final String AREA_CODE_KEY = \"AREA_AREA_CODE\";\n public static final String AREA_NAME_KEY = \"AREA_NAME\";\n\n /**\n * Clone a bus\n * @return\n */\n public ControlArea clone();\n\n \n}", "public Manual(MainMenu mainMenu)\n { \n // Create a new world with 1330x2048 cells with a cell size of 1x1 pixels.\n super(1330, 2048, 1); \n this.mainMenu = mainMenu;\n setThisManual();\n }", "public NCLBody() {}", "public void setArea_id(String area_id) {\n this.area_id = area_id;\n }", "public AreaRenderer() {\n\t\tsuper();\n\t\tthis.endType = AreaRendererEndType.TAPER;\n\t}", "protected void createEnvelope(int id, int group, int inBus, int outBus,\n\t\t\tfloat amp) {\n\n\t\tObject args[] = new Object[12];\n\t\targs[0] = new String(\"ELenv\");\n\t\targs[1] = new Integer(id); // need a unique ID\n\t\targs[2] = new Integer(1); // add to tail of group\n\t\targs[3] = new Integer(group);\n\t\targs[4] = new String(\"inBus\");\n\t\targs[5] = new Integer(inBus); // need a unique bus # here\n\t\targs[6] = new String(\"outChannel\");\n\t\targs[7] = new Integer(outBus);\n\t\targs[8] = new String(\"ampScale\");\n\t\targs[9] = new Float(amp);\n\n\t\tsendMessage(\"/s_new\", args);\n\n\t\t_nodeIdList.add(id);\n\t}", "Prms createPrms();", "PortDefinition createPortDefinition();", "public de.uni_koblenz.jgralabtest.schemas.gretl.pddsl.Chassis createChassis();", "@Transactional\n public SubjectDTO createSubject(SubjectDTO subjectDto) {\n Subject subject = subjectMapper.subjectDTOToSubject(subjectDto);\n //assign roles\n User user = subject.getUser();\n Project project = projectMapper.projectDTOToProject(subjectDto.getProject());\n Role projectParticipantRole = getProjectParticipantRole(project, PARTICIPANT);\n Set<Role> roles = user.getRoles();\n roles.add(projectParticipantRole);\n\n // Set group\n subject.setGroup(getSubjectGroup(project, subjectDto.getGroup()));\n\n // set password and reset keys\n user.setPassword(passwordService.generateEncodedPassword());\n user.setResetKey(passwordService.generateResetKey());\n // setting default language key to \"en\", required to set email context, Find a workaround\n user.setLangKey(\"en\");\n user.setResetDate(ZonedDateTime.now());\n // default subject is activated.\n user.setActivated(true);\n //set if any devices are set as assigned\n if (subject.getSources() != null && !subject.getSources().isEmpty()) {\n subject.getSources().forEach(s -> s.assigned(true).subject(subject));\n }\n if (subject.getEnrollmentDate() == null) {\n subject.setEnrollmentDate(ZonedDateTime.now());\n }\n sourceRepository.saveAll(subject.getSources());\n return subjectMapper.subjectToSubjectReducedProjectDTO(subjectRepository.save(subject));\n }", "protected void createMimoentslotconstraintsAnnotations() {\n\t\tString source = \"mimo-ent-slot-constraints\";\n\t\taddAnnotation\n\t\t (getInvoice_InvoiceStatuses(),\n\t\t source,\n\t\t new String[] {\n\t\t\t \"statusDate\", \"*NOW\"\n\t\t });\n\t}", "@Override\n\tpublic void createAgence(Agence a) {\n\t\t\n\t}", "public void createLeaveZoneRule(){\n ECAAgent.getDefaultECAAgent().createRule(\"leaveZoneRule_\"+name,leaveZone,\"MAKEFITS.Track.C_leaveTheZone\",\"MAKEFITS.Track.A_leaveTheZone\",1,CouplingMode.IMMEDIATE ,ParamContext.CHRONICLE);\n// ECAAgent.getDefaultECAAgent().createRule(\"leaveZoneRule_\"+name,leaveZone,\"MAKEFITS.Track.C_leaveTheZone\",\"MAKEFITS.Track.A_leaveTheZone\",1,CouplingMode.IMMEDIATE ,Context.CHRONICLE);\n }", "DomainElement createDomainElement();" ]
[ "0.62497747", "0.6204926", "0.620395", "0.5832022", "0.57169074", "0.56226754", "0.5565016", "0.55110484", "0.5453611", "0.5396621", "0.53450143", "0.5270414", "0.5268967", "0.5205816", "0.5196598", "0.51926637", "0.5185745", "0.5145061", "0.5126972", "0.51134646", "0.50304484", "0.5003009", "0.49845558", "0.49845558", "0.4966304", "0.49639824", "0.49634054", "0.49355015", "0.4906624", "0.49021792", "0.4897604", "0.489166", "0.48725277", "0.48708528", "0.4868822", "0.48676163", "0.48593685", "0.4821078", "0.48174134", "0.4804162", "0.47987995", "0.47974145", "0.47952566", "0.47911042", "0.4775316", "0.47720072", "0.47589877", "0.47506934", "0.47484878", "0.47368774", "0.47350937", "0.47277197", "0.47260475", "0.4706695", "0.4699617", "0.46966714", "0.4673056", "0.4672451", "0.46709225", "0.4666276", "0.46600088", "0.46596515", "0.46596515", "0.46596515", "0.46576515", "0.4657179", "0.46553567", "0.46514878", "0.46468353", "0.46283835", "0.46141014", "0.46099254", "0.4608739", "0.4606783", "0.4605906", "0.45868587", "0.45818347", "0.4580425", "0.4575625", "0.45637313", "0.45630974", "0.45628574", "0.4555663", "0.45518994", "0.454898", "0.4545523", "0.45399588", "0.45374244", "0.45366168", "0.45338622", "0.452863", "0.45270315", "0.4521526", "0.45197275", "0.4517554", "0.45072633", "0.4506025", "0.45054558", "0.45047852", "0.4502971" ]
0.6074045
3
Update the definition of a subjectArea.
public VoidResponse updateSubjectArea(String serverName, String userId, String subjectAreaGUID, boolean isMergeUpdate, ReferenceableRequestBody requestBody) { final String methodName = "updateSubjectArea"; final String guidParameter = "subjectAreaGUID"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); VoidResponse response = new VoidResponse(); AuditLog auditLog = null; try { if (requestBody != null) { if (requestBody.getProperties() instanceof SubjectAreaProperties) { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName); SubjectAreaProperties properties = (SubjectAreaProperties)requestBody.getProperties(); handler.updateSubjectArea(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), subjectAreaGUID, guidParameter, properties.getQualifiedName(), properties.getSubjectAreaName(), properties.getDisplayName(), properties.getDescription(), properties.getUsage(), properties.getScope(), properties.getDomainIdentifier(), properties.getAdditionalProperties(), properties.getTypeName(), properties.getExtendedProperties(), isMergeUpdate, methodName); } else { restExceptionHandler.handleInvalidPropertiesObject(SubjectAreaProperties.class.getName(), methodName); } } else { restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); } } catch (Exception error) { restExceptionHandler.captureExceptions(response, error, methodName, auditLog); } restCallLogger.logRESTCallReturn(token, response.toString()); return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void update(Area area) {\n\t\tdao.update(area);\n\t}", "@Override\n public final void setArea(JQLayoutArea area)\n {\n if (area != null)\n {\n removeClass(area.getAreaClass().toString());\n }\n this.area = area;\n if (this.area != null)\n {\n addClass(this.area.getAreaClass().toString());\n }\n }", "public void setArea(Polygon area) {\n\t\tthis.area = area;\n\t}", "public SubjectAreaDefinitionResponse getSubjectAreaDefinitionByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \"getSubjectAreaDefinitionByGUID\";\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaDefinitionResponse response = new SubjectAreaDefinitionResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> subjectAreaHandler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n SubjectAreaElement element = subjectAreaHandler.getBeanFromRepository(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n new Date(),\n methodName);\n if (element != null)\n {\n SubjectAreaDefinition subjectAreaDefinition = new SubjectAreaDefinition(element);\n\n subjectAreaDefinition.setParentSubjectAreaGUID(subjectAreaHandler.getSubjectAreaParentGUID(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n subjectAreaDefinition.setNestedSubjectAreaGUIDs(subjectAreaHandler.getSubjectAreaChildrenGUIDs(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n GovernanceDefinitionHandler<GovernanceDefinitionElement> definitionHandler = instanceHandler.getGovernanceDefinitionHandler(userId, serverName, methodName);\n ElementStubConverter<ElementStub> elementStubConverter = instanceHandler.getElementStubConverter(userId, serverName, methodName);\n List<Relationship> relationships = definitionHandler.getGoverningDefinitionLinks(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n 0,\n 0,\n false,\n false,\n new Date(),\n methodName);\n List<ElementStub> definitions = elementStubConverter.getNewBeans(ElementStub.class, relationships, true, methodName);\n subjectAreaDefinition.setAssociatedGovernanceDefinitions(definitions);\n\n response.setProperties(subjectAreaDefinition);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "@Override\n\tpublic int updateArea(Area area) {\n\t\treturn areaMapper.updateArea(area);\n\t}", "public void SetArea(double area) {\n OCCwrapJavaJNI.ShapeAnalysis_FreeBoundData_SetArea(swigCPtr, this, area);\n }", "public void setArea(String area) {\n this.area = area;\n }", "public void setArea(String area) {\n this.area = area;\n }", "public void setArea(String area) {\n\t\tthis.area = area;\n\t}", "@SuppressWarnings(value = \"unused\")\n public VoidResponse linkSubjectAreaToGovernanceDefinition(String serverName,\n String userId,\n String subjectAreaGUID,\n String definitionGUID,\n RelationshipRequestBody requestBody)\n {\n final String methodName = \"linkSubjectAreaToGovernanceDefinition\";\n\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n final String definitionGUIDParameterName = \"definitionGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n if (requestBody.getProperties() != null)\n {\n handler.linkElementToElement(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n requestBody.getProperties().getEffectiveFrom(),\n requestBody.getProperties().getEffectiveTo(),\n new Date(),\n methodName);\n }\n else\n {\n handler.linkElementToElement(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n (InstanceProperties) null,\n null,\n null,\n new Date(),\n methodName);\n }\n }\n else\n {\n handler.linkElementToElement(userId,\n null,\n null,\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n (InstanceProperties) null,\n null,\n null,\n new Date(),\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public\t\tvoid\t\tinvalidateArea(MiBounds area)\n\t\t{\n\t\tsuper.invalidateArea(area);\n\t\t}", "public SafetyNetArea updateArea(SafetyNetArea area) {\n\n String typeId = area.getPromulgationType().getTypeId();\n log.info(\"Updating SafetyNET area \" + area.getName() + \" for promulgation type \" + typeId);\n\n SafetyNetArea original = findAreaByName(typeId, area.getName());\n original.update(area);\n\n return saveEntity(original);\n }", "public void updateSubject(Subject subject) {\r\n\t\tSubject entity = dao.findById(subject.getId());\r\n\t\tif(entity!=null){\r\n\t\t\tentity.setCode(subject.getCode());\r\n\t\t\tentity.setName(subject.getName());\r\n\t\t\tentity.setNumber_of_papers(subject.getNumber_of_papers());\r\n\t\t}\r\n\t}", "Void update(T subject);", "public void setCourseArea(String courseArea) {\n this.courseArea = courseArea;\n }", "public void updateSubject(Subject subject) {\n\t\tsub_dao.updateSubject(subject);\r\n\t\t\r\n\t}", "public void setArea_id(String area_id) {\n this.area_id = area_id;\n }", "public void setArea() {\n\t\tthis.area= height*width;\n\t}", "public void update(Subject e) {\n\t\tsubjectdao.update(e);\n\t}", "public void setSubject(Subject subject);", "public void setArea(String area) {\n this.area = area == null ? null : area.trim();\n }", "public void setArea(String area) {\n this.area = area == null ? null : area.trim();\n }", "@Override\n\tpublic void update(Subject subject) {\n\t\tobserverState = ((ConcreteSubject)subject).getSubjectState();\n\t}", "public void update(Subject subject){\n\t int id = -1;\n SqlSession session = sqlSessionFactory.openSession();\n\n try {\n id = session.update(\"Subject.update\", subject);\n\n } finally {\n session.commit();\n session.close();\n }\n System.out.println(\"update(\"+subject+\") --> updated\");\n }", "@Override\r\n\tpublic DTextArea setHtmlSubject(final String subject) {\r\n\t\tsuper.setHtmlSubject(subject) ;\r\n\t\treturn this ;\r\n\t}", "@Override\n\tpublic void update(MySubject sb) {\n\t\tcanvas = (MyCanvas) sb;\n\n\t}", "@RequestMapping(method = RequestMethod.PUT, value = \"/{subjectId}\")\n\tpublic void updateSubject(@RequestBody Subject subject, @PathVariable Long subjectId) {\n\t\ttry {\n\t\t\tsubjectService.updateSubject(subject, subjectId);\n\t\t} catch (Exception ex) {\n\t\t\tthrow new ServerErrorException(ex.getMessage());\n\t\t}\n\t}", "public void setAreaId(Integer areaId) {\n this.areaId = areaId;\n }", "public void setAreaId(Integer areaId) {\n this.areaId = areaId;\n }", "@SuppressWarnings(value = \"unused\")\n public VoidResponse unlinkSubjectAreaFromGovernanceDefinition(String serverName,\n String userId,\n String subjectAreaGUID,\n String definitionGUID,\n RelationshipRequestBody requestBody)\n {\n final String methodName = \"unlinkSubjectAreaToGovernanceDefinition\";\n\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n final String definitionGUIDParameterName = \"definitionGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n handler.unlinkElementFromElement(userId,\n false,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n methodName);\n }\n else\n {\n handler.unlinkElementFromElement(userId,\n false,\n null,\n null,\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public void setAreaName(String areaName) {\n this.areaName = areaName;\n }", "public void setAreaName(String areaName) {\n this.areaName = areaName;\n }", "public void setNombreArea(String p) { this.nombreArea = p; }", "private void updateTextAreaLenght() {\n //\n }", "public void setSubject(String subj) {\n/* 296 */ getCOSObject().setString(COSName.SUBJ, subj);\n/* */ }", "public void setDefinition(String definition){\n\t\tdefinitionArea.setText(definition);\n\t}", "void setBody(final Body body);", "public SubjectareasRecord() {\n\t\tsuper(Subjectareas.SUBJECTAREAS);\n\t}", "@Override\n\tpublic void update(Subject obj) {\n\t\tif (obj instanceof Enemy) {\n\t\t\tthis.defeated++;\n\t\t}\n\t}", "void updateFrom(RuleDetail ruleDetail);", "public void claShapeArea(){\r\n\t\tshape.calArea();\r\n\t}", "public GUIDResponse createSubjectArea(String serverName,\n String userId,\n ReferenceableRequestBody requestBody)\n {\n final String methodName = \"createSubjectArea\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n GUIDResponse response = new GUIDResponse();\n AuditLog auditLog = null;\n\n try\n {\n if (requestBody != null)\n {\n if (requestBody.getProperties() instanceof SubjectAreaProperties)\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n SubjectAreaProperties properties = (SubjectAreaProperties)requestBody.getProperties();\n\n String subjectAreaGUID = handler.createSubjectArea(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n properties.getQualifiedName(),\n properties.getSubjectAreaName(),\n properties.getDisplayName(),\n properties.getDescription(),\n properties.getUsage(),\n properties.getScope(),\n properties.getDomainIdentifier(),\n properties.getAdditionalProperties(),\n properties.getTypeName(),\n properties.getExtendedProperties(),\n new Date(),\n methodName);\n\n response.setGUID(subjectAreaGUID);\n }\n else\n {\n restExceptionHandler.handleInvalidPropertiesObject(SubjectAreaProperties.class.getName(), methodName);\n }\n }\n else\n {\n restExceptionHandler.handleNoRequestBody(userId, methodName, serverName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "@Override\n\tpublic void computeArea() {\n\t\tthis.area = length * length;\t\t\t\t\n\t}", "public void setSubject(String newValue);", "public void changeSubject(String a) {\r\n subject = a;\r\n }", "public void setSubject(Name subject) {\r\n this.subject = subject;\r\n }", "protected void setCoordinate(GAnchor anchor, Rectangle bounds) {\n\t\tPoint areaPoint = anchor.getAreaPoint(bounds);\n\n\t\t// Correct Location\n\t\tareaPoint.translate(-ANCHOR_WIDTH / 2, -ANCHOR_HEIGHT / 2);\n\n\t\t// Set Frame Of Anchor\n\t\tanchor.setFrame(areaPoint.getX(), areaPoint.getY(), ANCHOR_WIDTH, ANCHOR_HEIGHT);\n\t}", "private void mapAreaOne()\n\n {\n\n Area area = areaIDMap.get(Constants.FIRST_AREA_ID);\n\n area.areaMap.put(Constants.North, areaIDMap.get(Constants.SECOND_AREA_ID));\n\n area.areaMap.put(Constants.South, areaIDMap.get(Constants.FIFTH_AREA_ID));\n\n area.areaMap.put(Constants.East, areaIDMap.get(Constants.FOURTH_AREA_ID));\n\n area.areaMap.put(Constants.West, areaIDMap.get(Constants.SIXTH_AREA_ID));\n\n area.paths = Constants.NorthSouthEastAndWest;\n\n }", "public void setOrgScheduleController(){\n setChanged();\n notifyObservers(orgScheduleController);\n }", "void setBody (DBody body);", "public void setAuthorizedArea(String value) {\n setAttributeInternal(AUTHORIZEDAREA, value);\n }", "@Override\n\tpublic void updateAgence(Agence a) {\n\t\t\n\t}", "private void updateAssessment() {\n Converters c = new Converters();\n\n //get UI fields\n int courseId = thisCourseId;\n String title = editTextAssessmentTitle.getText().toString();\n LocalDate dueDate = c.stringToLocalDate(textViewAssessmentDueDate.getText().toString());\n String status = editTextAssessmentStatus.getText().toString();\n String note = editTextAssessmentNote.getText().toString();\n String type = editTextAssessmentType.getText().toString();\n\n if (title.trim().isEmpty() || dueDate == null || status.trim().isEmpty() || type.trim().isEmpty()) {\n Toast.makeText(this, \"Please complete all fields\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n //instantiate Assessment object\n Assessment assessment = new Assessment(courseId, title, dueDate, status, note, type);\n //since we're updating, add the assessmentId to the assessment object\n assessment.setAssessmentId(thisAssessmentId);\n\n\n //add new assessment\n addEditAssessmentViewModel.update(assessment);\n finish();\n }", "void setSubject(org.hl7.fhir.ResourceReference subject);", "public void setLocationArea(String locationArea) {\n this.locationArea = locationArea;\n }", "public CelestialBody update(CelestialBody body);", "public void setPersonnelSubArea(String personnelSubArea);", "@Override\r\n\tpublic boolean fillInArea(final XMLTag piece, final Map<String,Object> defined, final Area A, final int direction) throws CMException\r\n\t{\r\n\t\tfinal String layoutType = findStringNow(\"layout\",piece,defined);\r\n\t\tif((layoutType==null)||(layoutType.trim().length()==0))\r\n\t\t\tthrow new CMException(\"Unable to build area without defined layout\");\r\n\t\tfinal LayoutManager layoutManager = getLayoutManager(layoutType);\r\n\t\tif(layoutManager == null)\r\n\t\t\tthrow new CMException(\"Undefined Layout \"+layoutType);\r\n\t\tdefined.put(\"AREA_LAYOUT\",layoutManager.name());\r\n\t\tString size = findStringNow(\"size\",piece,defined);\r\n\t\tif(CMath.isMathExpression(size))\r\n\t\t\tsize=Integer.toString(CMath.parseIntExpression(size));\r\n\t\tif((!CMath.isInteger(size))||(CMath.s_int(size)<=0))\r\n\t\t\tthrow new CMException(\"Unable to build area of size \"+size);\r\n\t\tdefined.put(\"AREA_SIZE\",size);\r\n\t\tfinal List<String> ignoreStats=new XArrayList<String>(new String[]{\"CLASS\",\"NAME\",\"DESCRIPTION\",\"LAYOUT\",\"SIZE\"});\r\n\t\tfillOutStatCodes(A, ignoreStats,\"AREA_\",piece,defined);\r\n\r\n\t\tfinal List<Ability> aV = findAffects(A,piece,defined,null);\r\n\t\tfor(int i=0;i<aV.size();i++)\r\n\t\t{\r\n\t\t\tfinal Ability AB=aV.get(i);\r\n\t\t\tA.setSavable(true);\r\n\t\t\tA.addNonUninvokableEffect(AB);\r\n\t\t}\r\n\t\tfinal List<Behavior> bV = findBehaviors(A,piece,defined);\r\n\t\tfor(int i=0;i<bV.size();i++)\r\n\t\t{\r\n\t\t\tfinal Behavior B=bV.get(i);\r\n\t\t\tB.setSavable(true);\r\n\t\t\tA.addBehavior(B);\r\n\t\t}\r\n\r\n\t\tCMLib.map().addArea(A); // necessary for proper naming.\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\tlayOutRooms(A, layoutManager, CMath.s_int(size), direction, piece, defined);\r\n\t\t\tCMLib.map().delArea(A); // we added it for id assignment, now we are done.\r\n\t\t}\r\n\t\tcatch(final Exception t)\r\n\t\t{\r\n\t\t\tCMLib.map().delArea(A);\r\n\t\t\tCMLib.map().emptyAreaAndDestroyRooms(A);\r\n\t\t\tA.destroy();\r\n\t\t\tif(t instanceof CMException)\r\n\t\t\t\tthrow (CMException)t;\r\n\t\t\tthrow new CMException(t.getMessage(),t);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n\t@XmlElement\n\tpublic void setAreaCode(String areaCode) {\n\t\t\n\t}", "void calculateArea() {\n this.setArea(this.getArea()/2);\n }", "public void setCodigoArea(int p) { this.codigoArea = p; }", "public void setCodigoArea(int p) { this.codigoArea = p; }", "public void setBody(AgentBody newBody) {\n\t\tbody = newBody;\n\t}", "public abstract Area newArea();", "@PUT\n\t@Path(\"{areaK}\")\n\t@Consumes({ MediaType.APPLICATION_JSON })\n\t@Produces({ MediaType.APPLICATION_JSON })\n\tpublic Response update(@PathParam(\"areaK\") final Integer areaK, final AreaTO areaTO) {\n\n\t\tfinal Area area = new Area();\n\t\ttry {\n\n\t\t\tPropertyUtils.copyProperties(area, areaTO);\n\n\t\t\tarea.setLastUpdtUserC(this.requestContext.getUserId());\n\t\t\tarea.setLastUpdtY(this.dateTimeSqlService.currentDateTimeSql().getDatetime());\n\t\t\tfinal Integer result = this.areaService.update(area);\n\t\t\tif (result > 0) {\n\t\t\t\tPropertyUtils.copyProperties(areaTO, area);\n\t\t\t}\n\n\t\t} catch (final ApplicationException e) {\n\n\t\t\tfinal ErrorTO erro = new ErrorTO();\n\t\t\terro.setCodigoIncident(e.getLogReferenceCode());\n\n\t\t\tfinal ResourceBundle bundle = ResourceBundle.getBundle(\"ApplicationResources\");\n\n\t\t\tfinal List<ErrorType> erros = e.getErrorTypes();\n\n\t\t\tfor (final ErrorType errorType : erros) {\n\t\t\t\terro.setMessage(bundle.getString(errorType.getKey()));\n\t\t\t}\n\n\t\t\treturn this.buildResponse(erro, Status.INTERNAL_SERVER_ERROR);\n\t\t} catch (final Exception ex) {\n\n\t\t\tfinal ErrorTO erro = new ErrorTO();\n\t\t\terro.setMessage(\"Fatal Error\");\n\n\t\t\treturn this.buildResponse(erro, Status.INTERNAL_SERVER_ERROR);\n\t\t}\n\n\t\treturn buildResponseWithOkStatus(area);\n\t}", "public void setAgreement(Agreement agreement) {\n\t\tthis.agreement = agreement;\n\t}", "public void resize(Point p, ShapeArea area) {\n\t\tp = GMath.rotatePointCounterClockwise(p, getCenterPoint(), rotatedAngle);\n\n\t\t// Resize Frame\n\t\tRectangle resizedFrame = new Rectangle(frame);\n\t\tarea.resizeBounds(p, resizedFrame);\n\t\t\n\t\t// Correct Location \n\t\tif(GSystem.correction) {\n\t\t\tarea.correctLocation(frame, resizedFrame, rotatedAngle);\n\t\t}\n\t\t\n\n\t\t// Set Bounds\n\t\tsetFrame(resizedFrame);\n\t}", "public void setSubject(Subject subject) {\n\t\tthis.subject = subject;\n\t}", "public void setAnalysisBounds(Rectangle bounds) {\n this.bounds = bounds;\n }", "public void markAreaDirty(final Rectangle dirtyArea) {\n if (fullUpdate || (dirtyAreaCounter > 200)) {\n markEverythingDirty();\n return;\n }\n \n dirtyAreaCounter++;\n \n final Rectangle dirtyRect = new Rectangle();\n dirtyRect.set(dirtyArea);\n \n synchronized (dirtyAreas) {\n final ListIterator<Rectangle> listItr = dirtyAreas.listIterator();\n while (listItr.hasNext()) {\n final Rectangle currentDirtyArea = listItr.next();\n if (currentDirtyArea.intersects(dirtyRect)) {\n dirtyRect.add(currentDirtyArea);\n listItr.remove();\n }\n }\n \n dirtyAreas.add(dirtyRect);\n }\n }", "public void configure(final CourseProposalController layout) {\n type = \"course\";\n state = DtoConstants.STATE_DRAFT;\n groupName = LUUIConstants.COURSE_GROUP_NAME;\n\n if (modelDefinition.getMetadata().isCanEdit()) {\n addCluStartSection(layout);\n String sections = getLabel(LUUIConstants.COURSE_SECTIONS);\n\n //ProposalInformation\n //layout.addSection(new String[] {editTabLabel, getLabel(LUConstants.PROPOSAL_INFORMATION_LABEL_KEY)}, generateAuthorsRationaleSection());\n\n layout.addMenu(sections);\n\n\n //Course Content\n layout.addMenuItem(sections, (SectionView) generateCourseInfoSection(initSectionView(CourseSections.COURSE_INFO, LUUIConstants.INFORMATION_LABEL_KEY)));\n layout.addMenuItem(sections, (SectionView) generateGovernanceSection(initSectionView(CourseSections.GOVERNANCE, LUUIConstants.GOVERNANCE_LABEL_KEY)));\n layout.addMenuItem(sections, (SectionView) generateCourseLogisticsSection(initSectionView(CourseSections.COURSE_LOGISTICS, LUUIConstants.LOGISTICS_LABEL_KEY)));\n layout.addMenuItem(sections, generateLearningObjectivesSection());\n\n //Student Eligibility\n layout.addMenuItem(sections, generateCourseRequisitesSection(layout, true));\n\n //Administrative\n layout.addMenuItem(sections, (SectionView) generateActiveDatesSection(initSectionView(CourseSections.ACTIVE_DATES, LUUIConstants.ACTIVE_DATES_LABEL_KEY)));\n layout.addMenuItem(sections, (SectionView) generateFinancialsSection(initSectionView(CourseSections.FINANCIALS, LUUIConstants.FINANCIALS_LABEL_KEY)));\n\n //Authors & Collaborators\n layout.addMenuItem(sections, new CollaboratorSectionView(CourseSections.PEOPLE_PERMISSONS, getLabel(LUUIConstants.SECTION_AUTHORS_AND_COLLABORATORS), COURSE_PROPOSAL_MODEL));\n\n //Documents\n documentTool = new DocumentTool(LUUIConstants.REF_DOC_RELATION_PROPOSAL_TYPE, CourseSections.DOCUMENTS, getLabel(LUUIConstants.TOOL_DOCUMENTS_LABEL_KEY));\n documentTool.setModelDefinition((DataModelDefinition) modelDefinition);\n layout.addMenuItem(sections, documentTool);\n\n //Summary\n summaryConfigurer = GWT.create(CourseSummaryConfigurer.class);\n summaryConfigurer.init(type, state, groupName, (DataModelDefinition) modelDefinition, stmtTypes, (Controller) layout, COURSE_PROPOSAL_MODEL);\n layout.addSpecialMenuItem(summaryConfigurer.generateProposalSummarySection(true), \"Review and Submit\");\n\n //Add common buttons to sections except for sections with specific button behavior\n List<Enum<?>> excludedViews = new ArrayList<Enum<?>>();\n excludedViews.add(CourseSections.DOCUMENTS);\n excludedViews.add(CourseSections.COURSE_REQUISITES);\n layout.addCommonButton(LUUIConstants.COURSE_SECTIONS, layout.getSaveButton(), excludedViews);\n layout.addCommonButton(LUUIConstants.COURSE_SECTIONS, layout.getCancelButton(CourseSections.SUMMARY), excludedViews);\n\n //Specific buttons for certain views\n //TODO people and permissions will use a different button than continue\n layout.addButtonForView(CourseSections.DOCUMENTS, getContinueButton(layout));\n } else {\n summaryConfigurer = GWT.create(CourseSummaryConfigurer.class);\n summaryConfigurer.init(type, state, groupName, (DataModelDefinition) modelDefinition, stmtTypes, (Controller) layout, COURSE_PROPOSAL_MODEL);\n layout.removeMenuNavigation();\n layout.addView(summaryConfigurer.generateProposalSummarySection(false));\n }\n layout.showPrint(true);\n layout.setDefaultView(CourseSections.SUMMARY);\n layout.addContentWidget(layout.getWfUtilities().getProposalStatusLabel());\n final CommentTool commentTool = new CommentTool(CourseSections.COMMENTS, getLabel(LUUIConstants.TOOL_COMMENTS_LABEL_KEY), \"kuali.comment.type.generalRemarks\", \"Proposal Comments\");\n commentTool.setController(layout);\n\n layout.addContentWidget(new KSButton(\"Comments\", ButtonStyle.DEFAULT_ANCHOR, new ClickHandler() {\n\n @Override\n public void onClick(ClickEvent event) {\n commentTool.show();\n }\n }));\n\n\n final DecisionPanel decisionPanel = new DecisionPanel(CourseSections.DECISIONS, getLabel(LUUIConstants.TOOL_DECISION_LABEL_KEY), \"kuali.comment.type.generalRemarks\");\n layout.addView(decisionPanel);\n layout.addContentWidget(new KSButton(\"Decisions\", ButtonStyle.DEFAULT_ANCHOR, new ClickHandler() {\n\n @Override\n public void onClick(ClickEvent event) {\n decisionPanel.show();\n }\n }));\n\n }", "@Override\n\tpublic AreaExecution modifyArea(Area area) {\n\t\treturn null;\n\t}", "void changeSubject(String subject) throws IOException;", "public void setBody(String newValue);", "private void updateSubsetDefinitionRef(final Object source, final SubsetDefinition subsetDefinition) {\n if (logger.isDebugEnabled()) {\n logger.debug(\"updateSubsetDefinitionRef: subsetDefinition: {}\", subsetDefinition);\n }\n\n final SelectorResult result = findOIData(subsetDefinition);\n\n // Create the OIFitsFile structure:\n final OIFitsFile oiFitsSubset;\n\n if (result == null) {\n oiFitsSubset = null;\n } else {\n // TODO: use Merger directly LATER ?\n // Or keep SelectorResult (selection results are more rich than the OIFits data structure)\n\n // create a new fake OIFitsFile:\n oiFitsSubset = new OIFitsFile(OIFitsStandard.VERSION_1);\n\n // Copy used StaNames (all files):\n oiFitsSubset.getUsedStaNamesMap().putAll(oiFitsCollection.getUsedStaNamesMap());\n\n // add all tables:\n for (OIData oiData : result.getSortedOIDatas()) {\n oiFitsSubset.addOiTable(oiData);\n }\n }\n\n if (logger.isDebugEnabled()) {\n logger.debug(\"updateSubsetDefinitionRef: oiFitsSubset: {}\", oiFitsSubset);\n }\n\n subsetDefinition.setOIFitsSubset(oiFitsSubset);\n subsetDefinition.incVersion();\n\n fireSubsetDefinitionChanged(source, subsetDefinition.getId());\n\n // find dependencies:\n for (Plot plot : getPlotList()) {\n if (plot.getSubsetDefinition() != null && plot.getSubsetDefinition().getId().equals(subsetDefinition.getId())) {\n // match\n plot.setSubsetDefinition(subsetDefinition);\n\n // update plot version and fire events (PlotChanged):\n updatePlotRef(source, plot);\n }\n }\n }", "public void setAreaCode(String areaCode) {\n this.areaCode = areaCode;\n }", "@SuppressWarnings(value = \"unused\")\n public VoidResponse deleteSubjectArea(String serverName,\n String userId,\n String subjectAreaGUID,\n ExternalSourceRequestBody requestBody)\n {\n final String methodName = \"deleteSubjectArea\";\n final String guidParameter = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n handler.deleteBeanInRepository(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n subjectAreaGUID,\n guidParameter,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n null,\n false,\n false,\n new Date(),\n methodName);\n }\n else\n {\n handler.deleteBeanInRepository(userId,\n null,\n null,\n subjectAreaGUID,\n guidParameter,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n null,\n false,\n false,\n new Date(),\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "@Override\n public void subscribeToPolicyArea(PolicyArea policyArea, ObserverFactory observerFactory)\n {\n KeywordAddedObserver keywordAddedObserver = observerFactory.makeKeywordAddedNotification(this);\n policyArea.addKeywordAddedObserver(idNum, keywordAddedObserver);\n KeywordTrendingObserver keywordTrendingObserver = observerFactory.makeKeywordTrendingNotification(this);\n policyArea.addKeywordTrendingObserver(idNum, keywordTrendingObserver);\n TalkingPointAddedObserver talkingPointAddedObserver = observerFactory.makeTalkingPointAddedNotification(this);\n policyArea.addTalkingPointAddedObserver(idNum, talkingPointAddedObserver);\n }", "public void setSubject(String subject)\n {\n _subject = subject;\n }", "public void fill(ELandscapeType type, IMapArea area) {\n\t\tList<ShortPoint2D> points = area.stream().filterBounds(width, height).toList();\n\t\tlandscapeEditor.fill(type, points);\n\n\t\tif(backgroundListener != null) {\n\t\t\tint size = points.size();\n\t\t\tfor(int i = 0; i != size; i++) {\n\t\t\t\tShortPoint2D pt = points.get(i);\n\t\t\t\tbackgroundListener.backgroundLineChangedAt(pt.x, pt.y, 1);\n\t\t\t}\n\t\t}\n\t}", "public Builder setAreaNo(int value) {\n \n areaNo_ = value;\n onChanged();\n return this;\n }", "@Override\r\n\tpublic void calcArea() {\n\t\t\r\n\t}", "public void updateArea(boolean rotateObject)\n\t{\n\t\tfloat minX = area.getMinX();\n\t\tfloat minY = area.getMinY();\n\t\tfloat maxX = area.getMaxX();\n\t\tfloat maxY = area.getMaxY();\n\n\t\tVector3D bottomCenterOld =\n\t\t\t\tVectorUtils.average(VectorUtils.to3D(area.getBottomLeft()), VectorUtils.to3D(area.getTopLeft()));\n\t\tdouble xOffset = (position.getX() - bottomCenterOld.getX());\n\t\tdouble yOffset = (position.getY() - bottomCenterOld.getY());\n\n\t\tarea = new Area2D.Float(minX + xOffset, maxX + xOffset, minY + yOffset, maxY + yOffset);\n\n\t\tif (rotateObject) {\n\t\t\tfloat areaHeight = area.getHeight();\n\t\t\tfloat areaWidthHalf = area.getWidth() / 2;\n\t\t\tarea = new Area2D.Float(position.getX(), position.getX() + areaHeight, position.getY() - areaWidthHalf,\n\t\t\t\t\tposition.getY() + areaWidthHalf);\n\t\t}\n\t}", "protected abstract void defineConstraints();", "public static void writingSpecializedArea(String newArea){//writing to objcet to file \n String filePath = \"userData\\\\specializedArea.txt\";\n BufferedWriter bw = null;\n try {//try catch start\n //file function\n File file = new File(filePath);\n \n if (!file.exists()) {//checking the is given file exists\n file.createNewFile();//creating new file\n Exception fileError=new IOException(\"File is not founded\");\n }\n \n FileWriter fw = new FileWriter(file,true);\n \n bw = new BufferedWriter(fw);\n \n bw.write(newArea);\n bw.newLine();\n \n } catch (IOException ioe) {\n System.out.println(ioe);\n ioe.printStackTrace();\n }\n finally{ \n try{\n if(bw!=null){\n bw.close();\n }\n }catch(Exception ex){\n System.out.println(\"Error in closing the BufferedWriter\"+ex);\n }\n }\n }", "public void refreshWithSubject(Subject subject) {\n\t\tcurrentValue = gradeManagementFrame.gradeRepository.getAllBySubjectId(subject);\n\t\twrittenWorkList = gradeManagementFrame.wwRepository.getByWWSubjectID(subject);\n\t\tperformanceTaskList = gradeManagementFrame.ptRepository.getByPTSubjectID(subject);\n\t\tquarterlyAssessmentList = gradeManagementFrame.qaRepository.getByQASubjectID(subject);\n\t\tfireTableStructureChanged();\n\t\tfireTableDataChanged();\n\t}", "public void setNombreCodigoArea(String p) { this.nombreCodigoArea = p; }", "public AssignmentBundle(AssignmentOutline receivedOutline){\n\n this.name = receivedOutline.getName();\n this.outline = receivedOutline;\n }", "public void setSubject(JTextField subject) {\n\t\tthis.subject = subject;\n\t}", "public void setArea(double radius) {\n this.radius = radius;\n }", "public void setBody(Body body) {\n this.body = body;\n }", "public void addSubject(Subject subject) {\n\t\t\r\n\t}", "public void updateOptimalCollisionArea();", "public Builder setArea(\n int index, com.example.grpc.SimpleServiceOuterClass.Area value) {\n if (areaBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureAreaIsMutable();\n area_.set(index, value);\n onChanged();\n } else {\n areaBuilder_.setMessage(index, value);\n }\n return this;\n }", "public Builder setArea(\n int index, com.example.grpc.SimpleServiceOuterClass.Area value) {\n if (areaBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureAreaIsMutable();\n area_.set(index, value);\n onChanged();\n } else {\n areaBuilder_.setMessage(index, value);\n }\n return this;\n }", "public Builder setArea(\n int index, com.example.grpc.SimpleServiceOuterClass.Area value) {\n if (areaBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureAreaIsMutable();\n area_.set(index, value);\n onChanged();\n } else {\n areaBuilder_.setMessage(index, value);\n }\n return this;\n }", "void setBounds(Rectangle rectangle);", "@Override\n\tpublic void updateExam(ExamBean exam) {\n\t\t\n\t}", "public Subject updateSubject(int subjectId, Subject subject) {\r\n\t\tSubject existing = subjectRepository.findById(subjectId).orElse(null);\r\n\t\texisting.setName(subject.getName());\r\n\t\texisting.setSemester(subject.getSemester());\r\n\t\texisting.setSubjectcode(subject.getSubjectcode());\r\n\t\tlogger.info(\"*** Service : Subject updated successfully. ***\");\r\n\t\treturn subjectRepository.save(existing);\r\n\t}", "public void setSubject(String subject)\r\n {\r\n m_subject = subject;\r\n }" ]
[ "0.57344246", "0.5639074", "0.5518399", "0.54971385", "0.54742694", "0.537119", "0.5364774", "0.5359781", "0.5320601", "0.53143126", "0.5213709", "0.51969403", "0.51565504", "0.5098994", "0.5091586", "0.50896", "0.5001323", "0.4983026", "0.49717063", "0.49403697", "0.49233785", "0.49233785", "0.48764777", "0.48587707", "0.48557213", "0.48475268", "0.48172298", "0.4808712", "0.4808712", "0.48071495", "0.48055664", "0.48055664", "0.47978273", "0.47902447", "0.47631568", "0.47567624", "0.47314847", "0.47287297", "0.4716093", "0.46859607", "0.4681026", "0.46691045", "0.46570194", "0.4650678", "0.46217963", "0.46108776", "0.4606082", "0.46057683", "0.4601171", "0.4599675", "0.4592404", "0.4591709", "0.45754132", "0.45733893", "0.45733383", "0.45663068", "0.45521313", "0.45406628", "0.453879", "0.45320454", "0.4519638", "0.4519638", "0.4509846", "0.45095107", "0.45084125", "0.4501811", "0.449303", "0.44904685", "0.44853407", "0.4485229", "0.44739118", "0.44685453", "0.44682986", "0.44680762", "0.44552004", "0.44547594", "0.44517186", "0.44486624", "0.44477975", "0.44414014", "0.44399574", "0.44388607", "0.44335383", "0.44292966", "0.44226944", "0.44106922", "0.44091797", "0.44085738", "0.43902946", "0.43901166", "0.4389213", "0.43860397", "0.43856984", "0.4385387", "0.4385387", "0.4385387", "0.43770596", "0.4367227", "0.43669015", "0.4360811" ]
0.55761045
2
Remove the definition of a subjectArea.
@SuppressWarnings(value = "unused") public VoidResponse deleteSubjectArea(String serverName, String userId, String subjectAreaGUID, ExternalSourceRequestBody requestBody) { final String methodName = "deleteSubjectArea"; final String guidParameter = "subjectAreaGUID"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); VoidResponse response = new VoidResponse(); AuditLog auditLog = null; try { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName); if (requestBody != null) { handler.deleteBeanInRepository(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), subjectAreaGUID, guidParameter, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, null, null, false, false, new Date(), methodName); } else { handler.deleteBeanInRepository(userId, null, null, subjectAreaGUID, guidParameter, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, null, null, false, false, new Date(), methodName); } } catch (Exception error) { restExceptionHandler.captureExceptions(response, error, methodName, auditLog); } restCallLogger.logRESTCallReturn(token, response.toString()); return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void removeArea() {\n \t\tthis.set.remove( this.area );\n \t\tthis.finish();\n \t}", "@Override\n\tpublic AreaExecution removeArea(long areaId) {\n\t\treturn null;\n\t}", "public abstract void remove(SubArea selectedSubArea);", "void unsetSubject();", "@SuppressWarnings(value = \"unused\")\n public VoidResponse unlinkSubjectAreaFromGovernanceDefinition(String serverName,\n String userId,\n String subjectAreaGUID,\n String definitionGUID,\n RelationshipRequestBody requestBody)\n {\n final String methodName = \"unlinkSubjectAreaToGovernanceDefinition\";\n\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n final String definitionGUIDParameterName = \"definitionGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n handler.unlinkElementFromElement(userId,\n false,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n methodName);\n }\n else\n {\n handler.unlinkElementFromElement(userId,\n false,\n null,\n null,\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public Builder clearArea() {\n if (areaBuilder_ == null) {\n area_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000001);\n onChanged();\n } else {\n areaBuilder_.clear();\n }\n return this;\n }", "public Builder clearArea() {\n if (areaBuilder_ == null) {\n area_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000001);\n onChanged();\n } else {\n areaBuilder_.clear();\n }\n return this;\n }", "public Builder clearArea() {\n if (areaBuilder_ == null) {\n area_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000001);\n onChanged();\n } else {\n areaBuilder_.clear();\n }\n return this;\n }", "void unsetConstraints();", "public Builder clearAreaNo() {\n \n areaNo_ = 0;\n onChanged();\n return this;\n }", "protected abstract void removeBodyImpl( Body body );", "public void deleteSubject(String subjectId) {\n\t\t\r\n\t}", "@Override\n\tpublic int deleteArea(int areaId) {\n\t\treturn areaMapper.deleteArea(areaId);\n\t}", "public SubjectAreaDefinitionResponse getSubjectAreaDefinitionByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \"getSubjectAreaDefinitionByGUID\";\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaDefinitionResponse response = new SubjectAreaDefinitionResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> subjectAreaHandler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n SubjectAreaElement element = subjectAreaHandler.getBeanFromRepository(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n new Date(),\n methodName);\n if (element != null)\n {\n SubjectAreaDefinition subjectAreaDefinition = new SubjectAreaDefinition(element);\n\n subjectAreaDefinition.setParentSubjectAreaGUID(subjectAreaHandler.getSubjectAreaParentGUID(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n subjectAreaDefinition.setNestedSubjectAreaGUIDs(subjectAreaHandler.getSubjectAreaChildrenGUIDs(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n GovernanceDefinitionHandler<GovernanceDefinitionElement> definitionHandler = instanceHandler.getGovernanceDefinitionHandler(userId, serverName, methodName);\n ElementStubConverter<ElementStub> elementStubConverter = instanceHandler.getElementStubConverter(userId, serverName, methodName);\n List<Relationship> relationships = definitionHandler.getGoverningDefinitionLinks(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n 0,\n 0,\n false,\n false,\n new Date(),\n methodName);\n List<ElementStub> definitions = elementStubConverter.getNewBeans(ElementStub.class, relationships, true, methodName);\n subjectAreaDefinition.setAssociatedGovernanceDefinitions(definitions);\n\n response.setProperties(subjectAreaDefinition);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "@SuppressWarnings(\"all\")\n public boolean deleteArea(String typeId, String name) {\n\n log.info(\"Deleting SafetyNET area \" + name + \" for promulgation type \" + typeId);\n\n SafetyNetArea original = findAreaByName(typeId, name);\n if (original != null) {\n remove(original);\n return true;\n }\n return false;\n }", "public VoidResponse deleteSubjectAreaMemberClassification(String serverName,\n String userId,\n String elementGUID,\n ExternalSourceRequestBody requestBody)\n {\n final String methodName = \"deleteSubjectAreaMemberClassification\";\n final String elementGUIDParameterName = \"elementGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n ReferenceableHandler<RelatedElement> handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n handler.removeSubjectAreaClassification(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n elementGUID,\n elementGUIDParameterName,\n OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME,\n false,\n false,\n null,\n methodName);\n }\n else\n {\n handler.removeSubjectAreaClassification(userId,\n null,\n null,\n elementGUID,\n elementGUIDParameterName,\n OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME,\n false,\n false,\n null,\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public\t\tvoid\t\tinvalidateArea(MiBounds area)\n\t\t{\n\t\tsuper.invalidateArea(area);\n\t\t}", "void unsetSpecimen();", "@Override\n public void deleteRuleAR() {\n }", "public void unsetPart()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(PART$2, 0);\n }\n }", "public void removeAllRuleRef();", "public void removeSpecification() {\n simSpec = null;\n }", "public Builder removeArea(int index) {\n if (areaBuilder_ == null) {\n ensureAreaIsMutable();\n area_.remove(index);\n onChanged();\n } else {\n areaBuilder_.remove(index);\n }\n return this;\n }", "public Builder removeArea(int index) {\n if (areaBuilder_ == null) {\n ensureAreaIsMutable();\n area_.remove(index);\n onChanged();\n } else {\n areaBuilder_.remove(index);\n }\n return this;\n }", "public Builder removeArea(int index) {\n if (areaBuilder_ == null) {\n ensureAreaIsMutable();\n area_.remove(index);\n onChanged();\n } else {\n areaBuilder_.remove(index);\n }\n return this;\n }", "public void unsetFacilityType()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(FACILITYTYPE$4, 0);\n }\n }", "protected void definitionEnded() {\n\t\tcurrentDefinition = null;\n\t}", "void unsetBodySite();", "public static void removePhysicsBody(PhysicsBody body)\n {\n world.removeRigidBody(body.body);\n bodies.remove(body);\n }", "void unsetScoreAnalysis();", "public final void removeBody( Body body )\n {\n if (this.bodies.remove( body ) )\n {\n removeBodyImpl( body );\n }\n }", "@Override\n public void deleteVisRuleAR() {\n }", "public static void destroyBody() {\n\t\t\n\t}", "public void removeRuleRef(org.semanticwb.model.RuleRef value);", "void unsetIdentifier();", "public void unsetTfoot()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(TFOOT$8, 0);\n }\n }", "public void removeAgent(Agent a)\n/* 81: */ {\n/* 82:132 */ this.mapPanel.removeAgent(a);\n/* 83: */ }", "public void remove(){\n\t\tsetBounds(800, 600, WIDTH, HEIGHT);\n\t}", "public void unassignCourse() {\n assignedCourse = null;\n }", "public void removeAgent() {agent = null;}", "public void removeShape(PhysicsShape shape) {\n\t\tshapes.remove(shape);\n\t}", "public void setArea(String area) {\n this.area = area == null ? null : area.trim();\n }", "public void setArea(String area) {\n this.area = area == null ? null : area.trim();\n }", "public void removeFromCollision(Entity en){\n\t\tif (hitboxCollision.containsKey(en)){\n\t\t\tRectangle hitbox = hitboxCollision.get(en);\n\t\t\tareaCollision.remove(hitbox);\n\t\t\thitboxCollision.remove(en);\n\t\t}\n\t}", "static void reset(double areaWidth, double areaHeight) {\n canvas.getGraphicsContext2D().clearRect(0, 0, 600, 600);\n canvas.setWidth(areaWidth);\n canvas.setHeight(areaHeight);\n window.sizeToScene();\n statisticsPane.clearStatistics();\n time = 0;\n }", "@Test\n public final void testPrintAreaRemove() throws Exception {\n try (Workbook workbook = _testDataProvider.createWorkbook()) {\n workbook.createSheet(\"Test Print Area\");\n workbook.getSheetName(0);\n\n workbook.setPrintArea(0, 0, 1, 0, 0);\n\n String retrievedPrintArea = workbook.getPrintArea(0);\n\n assertNotNull(retrievedPrintArea, \"Print Area not defined for first sheet\");\n\n workbook.removePrintArea(0);\n assertNull(workbook.getPrintArea(0), \"PrintArea was not removed\");\n }\n }", "public void setArea(Polygon area) {\n\t\tthis.area = area;\n\t}", "void removeRegion(Region region);", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\ttry {\n\t\t\t\t\ttextArea.getDocument().remove(0,\n\t\t\t\t\t\t\ttextArea.getDocument().getLength());\n\t\t\t\t\tstandardOut.println(\"Text area cleared\");\n\t\t\t\t} catch (BadLocationException ex) {\n\t\t\t\t\tex.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "public void setArea(String area) {\n this.area = area;\n }", "public void setArea(String area) {\n\t\tthis.area = area;\n\t}", "public void setArea(String area) {\n this.area = area;\n }", "void removeObjectDefinition(int i);", "private SubsetDefinition removeSubsetDefinition(final String id) {\n return Identifiable.removeIdentifiable(id, getSubsetDefinitionList());\n }", "public void removeAnswerListener(AnswerListener anw){\n\t\tlisteners.remove(anw);\n\t}", "protected abstract void removeJointImpl( Joint joint );", "public void deleteSubject(Subject subject) throws StructureManagementException {\n\n\t\ttry {\n\t\t\tsubjectDAO.delete(subject);\n\t\t} catch (Exception e) {\n\t\t\tStructureManagementException ex = new StructureManagementException(\"Subject could not be removed. Cause: \" + e.getMessage());\n\t\t\tthrow ex;\n\t\t}\n\t}", "private void removeQuestion(){\n\t\tif(questionText != null){\n\t\t\tquestionBox.remove(questionText);\n\t\t\tquestionBox.reDraw();\n\t\t}\n\t}", "private PlotDefinition removePlotDefinition(final String id) {\n return Identifiable.removeIdentifiable(id, getPlotDefinitionList());\n }", "public void SetArea(double area) {\n OCCwrapJavaJNI.ShapeAnalysis_FreeBoundData_SetArea(swigCPtr, this, area);\n }", "public void cleanUp(){\n\t\tbody.setActive(false);\n\t}", "void unsetRoadTerrain();", "public void unsetTypeId()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(TYPEID$2, 0);\n }\n }", "public void removeAppointment(Appointment a)\n {\n this.agenda.remove(a);\n }", "@Override\n\tpublic void deleteRuleAfterFirstMvt() {\n\t\t\n\t}", "@Override\n\tpublic AreaExecution removeAreaList(List<Long> areaIdList) {\n\t\treturn null;\n\t}", "public void clear() {\n\t\tnegatedConcepts.clear();\n\t\tnegex.clear();\n\t\tconcepts.clear();\n\t}", "void unsetHeader();", "@Override\n public void remove( )\n {\n FormPortletHome.getInstance( ).remove( this );\n }", "public void secondaryRemoveLeaseRules(com.hps.july.persistence.LeaseRule aLeaseRules) {\n\tthis.getLeaseRulesLink().secondaryRemoveElement(aLeaseRules);\n}", "void unsetBranchOfficeList();", "void unsetValueAttachment();", "public void removeDefense(){\n\t\tcurrentConstruct = null;\n\t\thasDefenseObject = false;\n\t}", "private void clearBody() {\n \n body_ = getDefaultInstance().getBody();\n }", "public void removeConceptLabel(ConceptLabel lbl) {\n\t\tSystem.out.println(\"removing \"+lbl+\" ..\");\n\t\t\n\t\tlbl.setDeleted(true);\n\t\t// tokens.remove(lbl);\n\t\t// System.out.println(\"- \"+tokens);\n\t}", "void unsetSchedule();", "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 clearMsgArea()\n\t{\n\t\tmsgArea.setEditable(true);\n\t\tmsgArea.setText(\"\");\n\t\tmsgArea.setEditable(false);\n\t}", "public void unsetRules()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(RULES$26);\n }\n }", "void clearAssociations();", "void unsetOrganizationPositionList();", "void unsetRegisteredOfficeCity();", "@Override\n\tpublic boolean removeArea(Goodsarea goods) {\n\t\treturn false;\n\t}", "public void unsetIdentifier()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(IDENTIFIER$0, 0);\n }\n }", "public void uninstall() {\n\t\tif (textArea!=null) {\n\t\t\ttimer.stop();\n\t\t\tclear();\n\t\t\ttextArea.removeCaretListener(this);\n\t\t}\n\t}", "public void delete()\n throws ROSRSException {\n annotation.deletePropertyValues(subject, property, merge ? null : value);\n if (annotation.getStatements().isEmpty()) {\n annotation.delete();\n } else {\n annotation.update();\n }\n value = null;\n }", "public void eliminarUnidadMineraArea(String idUnidadMineraArea) {\n\t\tunidadMineraAreaDAO.eliminarUnidadMineraArea(idUnidadMineraArea);\r\n\t}", "void unsetAnchorOffset();", "public void removeByType(long typeId);", "void removeConstraintEntity(IViewEntity entity);", "void unsetDescription();", "void unsetDescription();", "public void removeCourse(String course);", "private void deleteAllQuestionInputTextAreas() {\n UIComponent panel = FacesContext.getCurrentInstance().getViewRoot().findComponent(\"tabsView:tabViewTasksSettings:viewEditPerformanceAppraisalSettingForm:questionsPerformanceAppraisalPanel\");\n panel.getChildren().clear();\n }", "public void deleteBySubject(int id, TripletType type) throws DAOException;", "@Override\n\tpublic void remove(String identifier) {\n\t}", "void unsetNamespace();", "public void unsetContructionType()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(CONTRUCTIONTYPE$24);\r\n }\r\n }", "public void unsetReplyManagementRuleSet()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(REPLYMANAGEMENTRULESET$30, 0);\n }\n }", "protected void removeAppointment(Appointment a) {\n appointments.remove(a);\n }" ]
[ "0.6749771", "0.61756337", "0.609662", "0.5876178", "0.5838116", "0.56890357", "0.56890357", "0.56890357", "0.56149083", "0.5556862", "0.551338", "0.5498059", "0.54783356", "0.54591894", "0.5362972", "0.5343386", "0.5337719", "0.5330469", "0.5326685", "0.5300468", "0.5260445", "0.51974344", "0.5180651", "0.5180651", "0.5180651", "0.517962", "0.5150321", "0.5131816", "0.51280016", "0.5114849", "0.5067635", "0.5018725", "0.50180554", "0.501645", "0.49903798", "0.49891132", "0.498758", "0.49864334", "0.49832037", "0.49793854", "0.49759814", "0.49724028", "0.49724028", "0.4969571", "0.49656627", "0.49584216", "0.49547482", "0.49292284", "0.49070072", "0.49009714", "0.48884678", "0.48842102", "0.48734277", "0.48689777", "0.48681703", "0.48681304", "0.48501202", "0.48465836", "0.48423254", "0.48361444", "0.4835263", "0.48287708", "0.48251507", "0.48171467", "0.48170683", "0.48169476", "0.48098838", "0.48088667", "0.48073053", "0.4802331", "0.47877997", "0.47877795", "0.47847426", "0.47826877", "0.47809094", "0.4775768", "0.4774962", "0.4763036", "0.47587836", "0.47584307", "0.47583276", "0.47517642", "0.47501728", "0.4743932", "0.47429684", "0.4742532", "0.47420812", "0.47417572", "0.47412202", "0.47335622", "0.47185874", "0.47185874", "0.47174367", "0.4716822", "0.47162533", "0.47153318", "0.47138515", "0.47079298", "0.4704952", "0.47045982" ]
0.57937306
5
Link two related subject areas together as part of a hierarchy. A subjectArea can only have one parent but many child subjectAreas.
@SuppressWarnings(value = "unused") public VoidResponse linkSubjectAreasInHierarchy(String serverName, String userId, String parentSubjectAreaGUID, String childSubjectAreaGUID, RelationshipRequestBody requestBody) { final String methodName = "linkSubjectAreasInHierarchy"; final String parentSubjectAreaGUIDParameterName = "parentSubjectAreaGUID"; final String childSubjectAreaGUIDParameterName = "childSubjectAreaGUID"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); VoidResponse response = new VoidResponse(); AuditLog auditLog = null; try { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName); if (requestBody != null) { if (requestBody.getProperties() != null) { handler.linkElementToElement(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), parentSubjectAreaGUID, parentSubjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, childSubjectAreaGUID, childSubjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, false, false, OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID, OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME, null, requestBody.getProperties().getEffectiveFrom(), requestBody.getProperties().getEffectiveTo(), new Date(), methodName); } else { handler.linkElementToElement(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), parentSubjectAreaGUID, parentSubjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, childSubjectAreaGUID, childSubjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, false, false, OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID, OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME, (InstanceProperties) null, null, null, new Date(), methodName); } } else { handler.linkElementToElement(userId, null, null, parentSubjectAreaGUID, parentSubjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, childSubjectAreaGUID, childSubjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, false, false, OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID, OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME, (InstanceProperties) null, null, null, new Date(), methodName); } } catch (Exception error) { restExceptionHandler.captureExceptions(response, error, methodName, auditLog); } restCallLogger.logRESTCallReturn(token, response.toString()); return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(value = \"unused\")\n public VoidResponse unlinkSubjectAreasInHierarchy(String serverName,\n String userId,\n String parentSubjectAreaGUID,\n String childSubjectAreaGUID,\n RelationshipRequestBody requestBody)\n {\n final String methodName = \"unlinkSubjectAreasInHierarchy\";\n\n final String parentSubjectAreaGUIDParameterName = \"parentSubjectAreaGUID\";\n final String childSubjectAreaGUIDParameterName = \"childSubjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n handler.unlinkElementFromElement(userId,\n false,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n parentSubjectAreaGUID,\n parentSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n childSubjectAreaGUID,\n childSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME,\n null,\n methodName);\n }\n else\n {\n handler.unlinkElementFromElement(userId,\n false,\n null,\n null,\n parentSubjectAreaGUID,\n parentSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n childSubjectAreaGUID,\n childSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME,\n null,\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "private void mapAreaOne()\n\n {\n\n Area area = areaIDMap.get(Constants.FIRST_AREA_ID);\n\n area.areaMap.put(Constants.North, areaIDMap.get(Constants.SECOND_AREA_ID));\n\n area.areaMap.put(Constants.South, areaIDMap.get(Constants.FIFTH_AREA_ID));\n\n area.areaMap.put(Constants.East, areaIDMap.get(Constants.FOURTH_AREA_ID));\n\n area.areaMap.put(Constants.West, areaIDMap.get(Constants.SIXTH_AREA_ID));\n\n area.paths = Constants.NorthSouthEastAndWest;\n\n }", "public SubjectareasRecord() {\n\t\tsuper(Subjectareas.SUBJECTAREAS);\n\t}", "public SubjectAreaDefinitionResponse getSubjectAreaDefinitionByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \"getSubjectAreaDefinitionByGUID\";\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaDefinitionResponse response = new SubjectAreaDefinitionResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> subjectAreaHandler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n SubjectAreaElement element = subjectAreaHandler.getBeanFromRepository(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n new Date(),\n methodName);\n if (element != null)\n {\n SubjectAreaDefinition subjectAreaDefinition = new SubjectAreaDefinition(element);\n\n subjectAreaDefinition.setParentSubjectAreaGUID(subjectAreaHandler.getSubjectAreaParentGUID(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n subjectAreaDefinition.setNestedSubjectAreaGUIDs(subjectAreaHandler.getSubjectAreaChildrenGUIDs(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n GovernanceDefinitionHandler<GovernanceDefinitionElement> definitionHandler = instanceHandler.getGovernanceDefinitionHandler(userId, serverName, methodName);\n ElementStubConverter<ElementStub> elementStubConverter = instanceHandler.getElementStubConverter(userId, serverName, methodName);\n List<Relationship> relationships = definitionHandler.getGoverningDefinitionLinks(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n 0,\n 0,\n false,\n false,\n new Date(),\n methodName);\n List<ElementStub> definitions = elementStubConverter.getNewBeans(ElementStub.class, relationships, true, methodName);\n subjectAreaDefinition.setAssociatedGovernanceDefinitions(definitions);\n\n response.setProperties(subjectAreaDefinition);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public void setPersonnelSubArea(String personnelSubArea);", "@SuppressWarnings(value = \"unused\")\n public VoidResponse linkSubjectAreaToGovernanceDefinition(String serverName,\n String userId,\n String subjectAreaGUID,\n String definitionGUID,\n RelationshipRequestBody requestBody)\n {\n final String methodName = \"linkSubjectAreaToGovernanceDefinition\";\n\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n final String definitionGUIDParameterName = \"definitionGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n if (requestBody.getProperties() != null)\n {\n handler.linkElementToElement(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n requestBody.getProperties().getEffectiveFrom(),\n requestBody.getProperties().getEffectiveTo(),\n new Date(),\n methodName);\n }\n else\n {\n handler.linkElementToElement(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n (InstanceProperties) null,\n null,\n null,\n new Date(),\n methodName);\n }\n }\n else\n {\n handler.linkElementToElement(userId,\n null,\n null,\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n (InstanceProperties) null,\n null,\n null,\n new Date(),\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public GUIDResponse createSubjectArea(String serverName,\n String userId,\n ReferenceableRequestBody requestBody)\n {\n final String methodName = \"createSubjectArea\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n GUIDResponse response = new GUIDResponse();\n AuditLog auditLog = null;\n\n try\n {\n if (requestBody != null)\n {\n if (requestBody.getProperties() instanceof SubjectAreaProperties)\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n SubjectAreaProperties properties = (SubjectAreaProperties)requestBody.getProperties();\n\n String subjectAreaGUID = handler.createSubjectArea(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n properties.getQualifiedName(),\n properties.getSubjectAreaName(),\n properties.getDisplayName(),\n properties.getDescription(),\n properties.getUsage(),\n properties.getScope(),\n properties.getDomainIdentifier(),\n properties.getAdditionalProperties(),\n properties.getTypeName(),\n properties.getExtendedProperties(),\n new Date(),\n methodName);\n\n response.setGUID(subjectAreaGUID);\n }\n else\n {\n restExceptionHandler.handleInvalidPropertiesObject(SubjectAreaProperties.class.getName(), methodName);\n }\n }\n else\n {\n restExceptionHandler.handleNoRequestBody(userId, methodName, serverName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public LinkedList<Area> getAreas(){\n\t\treturn areas;\n\t}", "@ManyToOne(optional = true)\r\n\tpublic Area getArea() {\r\n\t\treturn this.area;\r\n\t}", "public void setArea_id(String area_id) {\n this.area_id = area_id;\n }", "private void setUpRelations() {\n g[0].getAuthorities().add(a[0]);\n g[1].getAuthorities().add(a[0]);\n g[1].getAuthorities().add(a[1]);\n g[2].getAuthorities().add(a[2]);\n\n u[0].getGroups().add(g[0]);\n u[0].getOwnAuthorities().add(a[2]);\n u[1].getGroups().add(g[1]);\n u[1].getOwnAuthorities().add(a[2]);\n u[2].getOwnAuthorities().add(a[2]);\n u[2].getOwnAuthorities().add(a[3]);\n u[3].getGroups().add(g[1]);\n u[3].getGroups().add(g[2]);\n merge();\n }", "public void careForPartOf(GUIMain guiMn, Map<Tissue, DefaultMutableTreeNode> ancestor) {\n CollToArrayList convert = new CollToArrayList();\n Tissue tiss = null;\n ArrayList<Tissue> tissArray = convert.treeToTissue(ancestor);\n Iterator<Tissue> iter2 = tissArray.iterator();\n while (iter2.hasNext()) {\n tiss = iter2.next();\n NodeLeaf leaf = new NodeLeaf(tiss, \"./data/images/iconTissue.gif\");\n if (tiss.partOf != null) {\n DefaultMutableTreeNode tissTree = null;\n\n // first add the tissue\n DefaultMutableTreeNode tree = ancestor.get(tiss);\n guiMn.simMain.st.removeObject(guiMn, tree, true);\n DefaultMutableTreeNode otherTissueTree = ancestor.get(tiss.partOf);\n DefaultMutableTreeNode newParent = (DefaultMutableTreeNode) otherTissueTree;\n tissTree = guiMn.simMain.st.addObject(guiMn, newParent, leaf, true);\n\n // now add compartments\n ArrayList<CompartmentSBML> listComps = tiss.getInternVolumes();\n // loop over compartments in this Tissues\n Iterator<CompartmentSBML> compIterator = listComps.iterator();\n while (compIterator.hasNext()) {\n CompartmentSBML comp = compIterator.next();\n if (comp == null) {\n System.out.println(\"error null compartment 2\");\n }\n leaf = new NodeLeaf(tiss, \"./data/images/compartment.gif\");\n leaf.setName(comp.getName());\n leaf.setCompartment(comp);\n if (comp.outside == null) {\n DefaultMutableTreeNode compBranch = guiMn.simMain.st.addObject(guiMn, tissTree, leaf, true);\n// System.out.println(\"add leaf (careForPartOf): \" + leaf.getName() + \" to tissue \" + tissTree);\n }\n }\n\n }\n }\n }", "public void setAreaId(Integer areaId) {\n this.areaId = areaId;\n }", "public void setAreaId(Integer areaId) {\n this.areaId = areaId;\n }", "@Test\n\tpublic void driverAssignArea() {\n\t\tfinal Object testingData[][] = {\n\n\t\t\t{\n\t\t\t\t\"chapter3\", \"area3\", null\n\t\t\t},//1. All fine\n\t\t\t{\n\t\t\t\t\"chapter1\", \"area3\", IllegalArgumentException.class\n\t\t\t},//2. A Chapter who have an area, self-assing another area\n\n\t\t};\n\n\t\tfor (int i = 0; i < testingData.length; i++)\n\t\t\tthis.templateAssignArea((String) testingData[i][0], (String) testingData[i][1], (Class<?>) testingData[i][2]);\n\n\t}", "public abstract Area newArea();", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Area)) {\n return false;\n }\n Area other = (Area) object;\n if ((this.idArea == null && other.idArea != null) || (this.idArea != null && !this.idArea.equals(other.idArea))) {\n return false;\n }\n return true;\n }", "public VoidResponse updateSubjectArea(String serverName,\n String userId,\n String subjectAreaGUID,\n boolean isMergeUpdate,\n ReferenceableRequestBody requestBody)\n {\n final String methodName = \"updateSubjectArea\";\n final String guidParameter = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n if (requestBody != null)\n {\n if (requestBody.getProperties() instanceof SubjectAreaProperties)\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n SubjectAreaProperties properties = (SubjectAreaProperties)requestBody.getProperties();\n\n handler.updateSubjectArea(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n subjectAreaGUID,\n guidParameter,\n properties.getQualifiedName(),\n properties.getSubjectAreaName(),\n properties.getDisplayName(),\n properties.getDescription(),\n properties.getUsage(),\n properties.getScope(),\n properties.getDomainIdentifier(),\n properties.getAdditionalProperties(),\n properties.getTypeName(),\n properties.getExtendedProperties(),\n isMergeUpdate,\n methodName);\n }\n else\n {\n restExceptionHandler.handleInvalidPropertiesObject(SubjectAreaProperties.class.getName(), methodName);\n }\n }\n else\n {\n restExceptionHandler.handleNoRequestBody(userId, methodName, serverName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public SubjectAreaResponse getSubjectAreaByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \"getSubjectAreaByGUID\";\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaResponse response = new SubjectAreaResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n response.setElement(handler.getBeanFromRepository(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n new Date(),\n methodName));\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "private void postProcessComp(GUIMain guiMn, Tissue tiss,\n DefaultMutableTreeNode tissueBranch, CompartmentSBML insideComp\n ) {\n// System.out.println(\"\\nentering postProcessComp, insideComp id: \" + insideComp.getIdentity());\n if (insideComp.getIdentity().contentEquals(\"C_c\")) {\n int y = 0;\n }\n NodeLeaf insideLeaf;\n if (insideComp.outside != null) {\n CompartmentSBML outsideComp;\n\n outsideComp = findOutsideComp(tiss, insideComp);\n if (outsideComp == null) {\n System.out.println(\"\\noutsideCompDMT call to processComp: \" + insideComp.getIdentity());\n return ;\n }\n\n DefaultMutableTreeNode outsideCompDMT = null;\n while (outsideCompDMT == null) {\n outsideCompDMT = compToTree(tissueBranch, outsideComp);\n if (outsideCompDMT == null) {\n// System.out.println(\"\\noutsideCompDMT call to processComp: \" + insideComp.getIdentity());\n processComp(guiMn, outsideComp, tissueBranch);\n }\n }\n \n String outsideCompId = outsideComp.getIdentity();\n if (insideComp.outside.contentEquals(outsideCompId)) { // FIXME \n // we found the compartment pointer\n insideLeaf = new NodeLeaf(tiss, \"./data/images/compartment.gif\");\n String namu = insideComp.getIdentity();\n insideLeaf.setName(namu);\n insideLeaf.setCompartment(insideComp);\n\n // does this object already exist, if so attach its children to this object parent\n DefaultMutableTreeNode pathExistLeaf = guiMn.simMain.st.contains(tissueBranch, insideLeaf);\n if (pathExistLeaf == null) {\n guiMn.simMain.st.addObject(guiMn, outsideCompDMT, insideLeaf, true);\n// System.out.println(\"add insideLeaf 3: \" + insideLeaf + \" to outsideCompDMT; \" + outsideCompDMT);\n return;\n } else {\n // this object already exists, remove it from its old position\n guiMn.simMain.st.removeObject(guiMn, pathExistLeaf, true);\n \n // attach its children to this object parent\n guiMn.simMain.st.addObject(guiMn, outsideCompDMT, pathExistLeaf, true);\n// System.out.println(\"add pathExistLeaf to outsideCompDMT; \" + outsideCompDMT);\n // FIXME remove old pathExistLeaf\n return;\n }\n } else {\n// System.out.println(\"leaving 1\");\n }\n } else {\n// System.out.println(\"leaving 2\");\n }\n\n return;\n }", "public void setArea(String area) {\n this.area = area;\n }", "@Override\n\tpublic AreaExecution addArea(Area area) {\n\t\treturn null;\n\t}", "public void setArea(String area) {\n this.area = area;\n }", "@AutoEscape\n\tpublic String getPersonnelSubArea();", "public abstract void remove(SubArea selectedSubArea);", "public void setArea(String area) {\n\t\tthis.area = area;\n\t}", "public AreaRenderer() {\n\t\tsuper();\n\t\tthis.endType = AreaRendererEndType.TAPER;\n\t}", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Area)) {\r\n return false;\r\n }\r\n Area other = (Area) object;\r\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public final void setArea(JQLayoutArea area)\n {\n if (area != null)\n {\n removeClass(area.getAreaClass().toString());\n }\n this.area = area;\n if (this.area != null)\n {\n addClass(this.area.getAreaClass().toString());\n }\n }", "public void setAreaName(String areaName) {\n this.areaName = areaName;\n }", "public void setAreaName(String areaName) {\n this.areaName = areaName;\n }", "public SubjectHierarchy getSubjectHierarchy();", "public boolean generatesReferenceAreas() {\n return false;\n }", "public ClientSideImageMap addRectangleArea(AbstractLink link, int x1, int y1, int x2, int y2)\r\n\t{\r\n\t\tareas.add(link);\r\n\t\tlink.add(new Area(rectangleCoordinates(x1, y1, x2, y2), RECTANGLE));\r\n\t\treturn this;\r\n\t}", "public static void main(String[] args) \r\n\t{\nBAssociation b= new BAssociation();\r\nb.a= new Aassociation();\r\nb.a.areaofRectangle(5, 6);\r\n\t\t\r\n\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Area)) {\n return false;\n }\n Area other = (Area) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "public void addSubject(Subject subject) {\n\t\tsub_dao.addSubject(subject);\r\n\t\t\r\n\t}", "private static OspfArea areaDetails(JsonNode areaNode) {\n OspfArea area = new OspfAreaImpl();\n String areaId = areaNode.path(AREAID).asText();\n if (isValidIpAddress(areaId)) {\n area.setAreaId(Ip4Address.valueOf(areaId));\n } else {\n log.debug(\"Wrong areaId: {}\", areaId);\n return null;\n }\n String routerId = areaNode.path(ROUTERID).asText();\n if (isValidIpAddress(routerId)) {\n area.setRouterId(Ip4Address.valueOf(routerId));\n } else {\n log.debug(\"Wrong routerId: {}\", routerId);\n return null;\n }\n String routingCapability = areaNode.path(EXTERNALROUTINGCAPABILITY).asText();\n if (isBoolean(routingCapability)) {\n area.setExternalRoutingCapability(Boolean.valueOf(routingCapability));\n } else {\n log.debug(\"Wrong routingCapability: {}\", routingCapability);\n return null;\n }\n String isOpaqueEnabled = areaNode.path(ISOPAQUE).asText();\n if (isBoolean(isOpaqueEnabled)) {\n area.setIsOpaqueEnabled(Boolean.valueOf(isOpaqueEnabled));\n } else {\n log.debug(\"Wrong isOpaqueEnabled: {}\", isOpaqueEnabled);\n return null;\n }\n area.setOptions(OspfUtil.HELLO_PACKET_OPTIONS);\n\n return area;\n }", "private void loadAreas() {\r\n\t\tareas = map.getAreas();\r\n\t\tfor (Area area : areas) {\r\n\t\t\tfor (AreaOrMonster monster : area.getChildren()) {\r\n\t\t\t\tmonster.getImageView().setX(monster.getX() * scalingFactor);\r\n\t\t\t\tmonster.getImageView().setY(monster.getY() * scalingFactor);\r\n\t\t\t\troot.getChildren().add(monster.getImageView());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public String getArea_id() {\n return area_id;\n }", "public void setArea(Polygon area) {\n\t\tthis.area = area;\n\t}", "public interface AreaMapper extends MyMapper<Area> {\n List<Area> getAreas();\n}", "private void createAreas(ElectionEvent electionEvent, Locale locale) {\n\n\t\tCountry norge = new Country(\"47\", \"Norge\", electionEvent);\n\t\tentityManager.persist(norge);\n\n\t\tCountyStatus countyStatusApproved = (CountyStatus) entityManager.createQuery(\"select cs from CountyStatus cs where cs.id = \"\n\t\t\t\t+ (Integer) CountyStatusEnum.APPROVED_CONFIGURATION.id()).getSingleResult();\n\t\tCounty osloFylke = new County(\"03\", \"Oslo\", norge);\n\t\tosloFylke.setLocale(locale);\n\t\tosloFylke.setCountyStatus(countyStatusApproved);\n\t\tentityManager.persist(osloFylke);\n\n\t\tMunicipalityStatus statusApproved = (MunicipalityStatus) entityManager.createQuery(\"select ms from MunicipalityStatus ms where ms.id = \"\n\t\t\t\t+ (Integer) MunicipalityStatusEnum.APPROVED_CONFIGURATION.id()).getSingleResult();\n\n\t\tMunicipality osloKommune = new Municipality(AreaPath.OSLO_MUNICIPALITY_ID, \"Oslo\", osloFylke);\n\t\tosloKommune.setLocale(locale);\n\t\tosloKommune.setMunicipalityStatus(statusApproved);\n\t\tosloKommune.setElectronicMarkoffs(true);\n\t\tosloKommune.setRequiredProtocolCount(true);\n\t\tosloKommune.setTechnicalPollingDistrictsAllowed(true);\n\t\tentityManager.persist(osloKommune);\n\n\t\tBorough bydelGamleOslo = new Borough(\"030101\", \"Gamle Oslo\", osloKommune);\n\t\tbydelGamleOslo.setMunicipality1(false);\n\t\tentityManager.persist(bydelGamleOslo);\n\n\t\tPollingDistrict kampenSkole = new PollingDistrict(\"0103\", \"Kampen skole\", bydelGamleOslo);\n\t\tkampenSkole.setMunicipality(false);\n\t\tkampenSkole.setParentPollingDistrict(false);\n\t\tkampenSkole.setTechnicalPollingDistrict(false);\n\t\tentityManager.persist(kampenSkole);\n\t}", "@Override\r\n\tpublic double area() {\r\n\r\n\t\treturn this.sideA*this.sideB;\r\n\t}", "public AssociationEndsPropertyPanel(PropertiesPanel propertiesPanel) {\n super(Collections.singletonList(PropertyKind.ASSOCIATION_ENDS_LINK), propertiesPanel);\n\n JPanel panel = retrievePanel();\n Util.setFixedSize(panel, 230, 50);\n\n panel.setLayout(new GridBagLayout());\n\n // initializes the two labels for the two association ends\n // the foreground colors are set to BLUE and the cursors are set to hand cursor\n labelAssociationEnd1 = new JLabel();\n labelAssociationEnd1.setForeground(new Color(4, 87, 162));\n labelAssociationEnd1.setCursor(new Cursor(Cursor.HAND_CURSOR));\n labelAssociationEnd2 = new JLabel();\n labelAssociationEnd2.setForeground(new Color(4, 87, 162));\n labelAssociationEnd2.setCursor(new Cursor(Cursor.HAND_CURSOR));\n\n panel.setBorder(BorderFactory.createTitledBorder(\"Association Ends\"));\n\n GridBagConstraints constraints = new GridBagConstraints();\n constraints.gridx = 0;\n constraints.gridy = 0;\n constraints.weightx = 1;\n constraints.weighty = 1;\n constraints.fill = GridBagConstraints.BOTH;\n constraints.insets = new Insets(-5, 40, 0, 0);\n panel.add(labelAssociationEnd1, constraints);\n constraints.gridx = 1;\n constraints.insets = new Insets(-5, 0, 0, 0);\n panel.add(labelAssociationEnd2, constraints);\n\n // Creates an MouseListener instance and assign it to the two labels for association ends\n MouseListener listener = new MouseAdapter() {\n /**\n * <p>\n * Invoked when the mouse has been clicked on a component.\n * </p>\n *\n * <p>\n * When the <code>JLabel</code> is clicked, this method will be invoked\n * </p>\n *\n * @param e an event which indicates that a mouse action occurred in a component\n */\n public void mouseClicked(MouseEvent e) {\n JLabel label = (JLabel) e.getSource();\n\n // The logic will be executed only when all the configured model elements have\n // the same first and second association ends\n if (label.getText().length() > 0) {\n Association association = (Association) getConfiguredModelElements().get(0);\n List<AssociationEnd> ends = association.getConnections();\n\n if (label == labelAssociationEnd1) {\n // configure the panel with the first association end\n if (ends.size() > 0) {\n //getPropertiesPanel().fireSelectionChangeEvent(association);\n getPropertiesPanel().configurePanel(ends.get(0));\n getPropertiesPanel().fireSelectionChangeEvent(ends.get(0));\n\n // set it visible back, since listeners may hide it\n getPropertiesPanel().setVisible(true);\n }\n } else {\n // configure the panel with the second association end\n if (ends.size() > 1) {\n getPropertiesPanel().configurePanel(ends.get(1));\n getPropertiesPanel().fireSelectionChangeEvent(ends.get(1));\n\n // set it visible back, since listeners may hide it\n getPropertiesPanel().setVisible(true);\n }\n }\n }\n }\n };\n\n // install the mouse listener to the two labels\n labelAssociationEnd1.addMouseListener(listener);\n labelAssociationEnd2.addMouseListener(listener);\n }", "private void removeArea() {\n \t\tthis.set.remove( this.area );\n \t\tthis.finish();\n \t}", "@GetMapping(value = \"/area/{bid}\")\n JsonResp<AreaVO> getArea(@PathVariable int bid,\n @RequestParam(value = \"parent\", defaultValue = \"false\") boolean parent,\n @RequestParam(value = \"children\", defaultValue = \"false\") boolean children);", "public Association associate(Node otherNode, QName associationTypeQName, Directionality directionality, ObjectNode object);", "@Test\n\tpublic void testAddLinkOkMultNtoNTreeSet() {\n\t\t// configure collection properties of Location and ClosingPeriod\n\t\t// to use TreeSet as collection implementing class\n\t\t((TypePropertyCollection) (new Location()).getProperty(\"closedons\").getType())\n\t\t\t\t.setCollectionClass(TreeSet.class);\n\t\t((TypePropertyCollection) (new ClosingPeriod()).getProperty(\"locations\").getType())\n\t\t\t\t.setCollectionClass(TreeSet.class);\n\t\ttstNMAssociationInverse();\n\t}", "@Override\n\tpublic int insertArea(Area area) {\n\t\treturn areaMapper.insertArea(area);\n\t}", "private void buildMapArea(MapBuilderBase mapBuilder) {\n\t\tmap = new Tile[width][height];\n\n\t\tthis.name = mapBuilder.buildMap(map);\n\t\tupdateValues();\n\n\t\t// TODO: pathfinding precalculations?\n\n\t\t// Log.debug(\"Calculating path maps...\");\n\t\t// pointGraph = new PointGraph();\n\t\t// for (int x = 0; x < width; x++) {\n\t\t// for (int y = 0; y < height; y++) {\n\t\t// if (getTileAt(x, y).isPassable)\n\t\t// pointGraph.addVertex(new Vertex(new Point(x, y)));\n\t\t// }\n\t\t// }\n\t\t// pointGraph.calculateEdges();\n\t\t// Log.debug(\"done\");\n\t}", "public Area getDiscussionForumArea()\r\n {\r\n LOG.debug(\"getDiscussionForumArea\");\r\n \r\n if (usingHelper)\r\n {\r\n return helper.getDiscussionForumArea();\r\n }\r\n return areaManager.getDiscusionArea();\r\n }", "private void calculateAreas() {\n\n\t\t/*\n\t\t * Each section is a trapezoid, so that the area is given by:\n\t\t * \n\t\t * (thicknessAtMainSpar + thicknessAtSecondarySpar)*distanceBetweenSpars*0.5\n\t\t * \n\t\t */\n\t\tint nSections = this._thicknessAtMainSpar.size();\n\t\tfor(int i=0; i<nSections; i++)\n\t\t\tthis._prismoidsSectionsAreas.add(\n\t\t\t\t\tAmount.valueOf(\n\t\t\t\t\t\t\t(this._thicknessAtMainSpar.get(i).plus(this._thicknessAtSecondarySpar.get(i)))\n\t\t\t\t\t\t\t.times(this._distanceBetweenSpars.get(i)).times(0.5).getEstimatedValue(),\n\t\t\t\t\t\t\tSI.SQUARE_METRE\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t}", "public void addSubject(Subject subject) {\n\t\t\r\n\t}", "public Lvl_Sub_Rel(String subject_name,int subject_id,String additional_level_ids){\n this.subject_name = subject_name;\n this.subject_id = subject_id;\n this.additional_level_ids = additional_level_ids; \n }", "protected void groupBoardArea(){\n for (int i = 0; i < norseCityArea.getComponents().length; i++){\n if (norseCityArea.getComponent(i) instanceof JLabel){\n norseCity.add((JLabel)norseCityArea.getComponent(i));\n }\n }\n for (int i = 0; i < greekCityArea.getComponents().length; i++){\n if (greekCityArea.getComponent(i) instanceof JLabel){\n greekCity.add((JLabel)greekCityArea.getComponent(i));\n }\n }\n for (int i = 0; i < egyptCityArea.getComponents().length; i++){\n if (egyptCityArea.getComponent(i) instanceof JLabel){\n egyptCity.add((JLabel)egyptCityArea.getComponent(i));\n }\n }\n for (int i = 0; i < norseProductArea.getComponents().length; i++){\n if (norseProductArea.getComponent(i) instanceof JLabel){\n norseProduction.add((JLabel)norseProductArea.getComponent(i));\n }\n }\n for (int i = 0; i < greekProductArea.getComponents().length; i++){\n if (greekProductArea.getComponent(i) instanceof JLabel){\n greekProduction.add((JLabel)greekProductArea.getComponent(i));\n }\n }\n for (int i = 0; i < egyptProductArea.getComponents().length; i++){\n if (egyptProductArea.getComponent(i) instanceof JLabel){\n egyptProduction.add((JLabel)egyptProductArea.getComponent(i));\n }\n }\n }", "public Area() {\n\t}", "public String getAreaName()\n {\n return this.areaName;\n }", "@Override\n protected void mergeModel_Organization( Model target, Model source, boolean sourceDominant,\n Map<Object, Object> context )\n {\n Organization src = source.getOrganization();\n if ( source.getOrganization() != null )\n {\n Organization tgt = target.getOrganization();\n if ( tgt == null )\n {\n target.setOrganization( tgt = new Organization() );\n mergeOrganization( tgt, src, sourceDominant, context );\n }\n }\n }", "public SubjectAreaResponse getSubjectAreaByName(String serverName,\n String userId,\n String qualifiedName)\n {\n final String methodName = \"getSubjectAreaByName\";\n final String qualifiedNameParameterName = \"qualifiedName\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaResponse response = new SubjectAreaResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n response.setElement(handler.getSubjectArea(userId,\n qualifiedName,\n qualifiedNameParameterName,\n false,\n false,\n new Date(),\n methodName));\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "private void compose() {\n for(Group group : inputGroupList){\n if(group.getGroups().size() > 0){\n LinkedList<Integer> upperGroups = group.getGroups();\n for(int i = 0; i < upperGroups.size(); i++){\n int id = upperGroups.get(i);\n Group upper = findById(id);\n upper.addChild(group);\n }\n } else{\n root.addChild(group);\n }\n }\n for(Address adr : inputAddressList){\n if(adr.getGroups().size() > 0){\n LinkedList<Integer> upperGroups = adr.getGroups();\n for(int i = 0; i < upperGroups.size(); i++){\n int id = upperGroups.get(i);\n Group upper = findById(id);\n upper.addChild(adr);\n adr.addParent(upper);\n }\n } else{\n root.addChild(adr);\n }\n }\n\n assert(root.getChildren().size() > 0);\n }", "public void setCityAreasConquered(ArrayList<CityArea> cityAreasConquered) {\n\t\tthis.cityAreasConquered = cityAreasConquered;\n\t}", "public void setCourseArea(String courseArea) {\n this.courseArea = courseArea;\n }", "@Override\n\t\tpublic Exchange aggregate(Exchange oldEx, Exchange newEx) {\n\t\t\tif (action == Action.DELETE) {\n\t\t\t\tTraitHierarchy thNew = oldEx.getIn().getBody(TraitHierarchy.class);\n\t\t\t\tLong deptId = thNew.getId();\n\t\t\t\tTraitHierarchy th = newEx.getIn().getBody(TraitHierarchy.class);\n\t\t\t\tWork<TraitHierarchy> work = new Work<TraitHierarchy>(TraitHierarchy.class, th, new TraitHierarchy(deptId, EMPTY), action);\n\t\t\t\toldEx.getIn().setBody(work);\n\t\t\t} else if (action == Action.UPDATE) {\n\t\t\t\tTraitHierarchy thOld = newEx.getIn().getBody(TraitHierarchy.class);\n\t\t\t\tTraitHierarchy thNew = oldEx.getIn().getBody(TraitHierarchy.class);\n\t\t\t\tisParentDeptMoved(thOld, thNew);\n\t\t\t\tWork<TraitHierarchy> work = new Work<TraitHierarchy>(TraitHierarchy.class, thOld, thNew, action);\n\t\t\t\toldEx.getIn().setBody(work);\n\t\t\t} else {\n\t\t\t\tTraitHierarchy th = (TraitHierarchy) oldEx.getIn().getHeader(TRAIT_HIERARCHY);\n\t\t\t\tLong parentId = (Long) newEx.getIn().getBody();\n\t\t\t\tif (parentId != null) {\n\t\t\t\t\tth.setParentId(parentId);\n\t\t\t\t}\n\t\t\t\toldEx.getOut().setBody(th);\n\t\t\t}\n\t\t\treturn oldEx;\n\t\t}", "@Override\n public void visit(PublicArea s) {}", "public Association associate(Node otherNode, QName associationTypeQName, Directionality directionality);", "@Test\n\tpublic void testAddLinkOkMultNtoNLinkedHashSet() {\n\t\t// configure collection properties of Location and ClosingPeriod\n\t\t// to use TreeSet as collection implementing class\n\t\t((TypePropertyCollection) (new Location()).getProperty(\"closedons\").getType())\n\t\t\t\t.setCollectionClass(LinkedHashSet.class);\n\t\t((TypePropertyCollection) (new ClosingPeriod()).getProperty(\"locations\").getType())\n\t\t\t\t.setCollectionClass(LinkedHashSet.class);\n\t\ttstNMAssociationInverse();\n\t}", "@Override\r\n\t\t\tpublic void ancestorMoved(AncestorEvent event) {\n\t\t\t\t\r\n\t\t\t}", "public Area getArea(Area area) {\r\n\t\treturn this.getArea(area.getId());\r\n\t}", "@Override\n public List<Area> getAllAreas() {\n return new ArrayList<>(areas.values());\n }", "@Override\r\n\t\t\tpublic void ancestorMoved(AncestorEvent event) {\n\t\t\t}", "public ClientSideImageMap addShapeArea(AbstractLink link, Shape shape)\r\n\t{\r\n\t\tareas.add(link);\r\n\t\tlink.add(new Area(shapeCoordinates(shape), POLYGON));\r\n\t\treturn this;\r\n\t}", "void setMaxAreaAddresses(int maxAreaAddresses);", "void setMaxAreaAddresses(int maxAreaAddresses);", "public SafetyNetArea createArea(SafetyNetArea area) {\n\n String typeId = area.getPromulgationType().getTypeId();\n log.info(\"Creating SafetyNET area \" + area.getName() + \" for promulgation type \" + typeId);\n\n area.setPromulgationType(promulgationTypeService.getPromulgationType(typeId));\n return saveEntity(area);\n }", "private static void joinWithRoot(AVLTree t1, IAVLNode x, AVLTree t2) \r\n {\t\t\r\n\t\t\t if (t1.getRoot().getKey() < x.getKey() && t2.getRoot().getKey() > x.getKey()) {\r\n\t\t\t\t x.setLeft(t1.getRoot());\r\n\t\t\t\t t1.getRoot().setParent(x);\r\n\t\t\t\t \r\n\t\t\t\t x.setRight(t2.getRoot());\r\n\t\t\t\t t2.getRoot().setParent(x);\r\n\t\t\t\t \r\n\t\t\t\t t1.setRoot(x);\r\n\t\t\t\t int newSize = t1.getRoot().getLeft().getSize() + t1.getRoot().getRight().getSize() + 1;\r\n\t\t\t\t int newHeight = Math.max(t1.getRoot().getLeft().getHeight(),t1.getRoot().getRight().getHeight())+1;\r\n\t\t\t\t t1.getRoot().setSize(newSize);\r\n\t\t\t\t t1.getRoot().setHeight(newHeight);\r\n\t\t\t\t t1.maximum = t2.maximum; \r\n\t\t\t }\r\n\t\t\t //case 2\r\n\t\t\t else {\r\n\t\t\t\t x.setRight(t1.getRoot());\r\n\t\t\t\t t1.getRoot().setParent(x);\r\n\t\t\t\t \r\n\t\t\t\t x.setLeft(t2.getRoot());\r\n\t\t\t\t t2.getRoot().setParent(x);\r\n\t\t\t\t \r\n\t\t\t\t t1.setRoot(x);\r\n\t\t\t\t int newSize = t1.getRoot().getLeft().getSize() + t1.getRoot().getRight().getSize() + 1;\r\n\t\t\t\t int newHeight = Math.max(t1.getRoot().getLeft().getHeight(),t1.getRoot().getRight().getHeight())+1;\r\n\t\t\t\t t1.getRoot().setSize(newSize);\r\n\t\t\t\t t1.getRoot().setHeight(newHeight);\r\n\t\t\t\t t1.minimum = t2.minimum; \r\n\t\t\t }\r\n\t\t }", "public void setParent(Concept _parent) { parent = _parent; }", "public String getAreaName() {\n return areaName;\n }", "public String getAreaName() {\n return areaName;\n }", "AREA createAREA();", "public void relate(HNode id, Object o);", "public com.example.grpc.SimpleServiceOuterClass.Area.Builder addAreaBuilder() {\n return getAreaFieldBuilder().addBuilder(\n com.example.grpc.SimpleServiceOuterClass.Area.getDefaultInstance());\n }", "public com.example.grpc.SimpleServiceOuterClass.Area.Builder addAreaBuilder() {\n return getAreaFieldBuilder().addBuilder(\n com.example.grpc.SimpleServiceOuterClass.Area.getDefaultInstance());\n }", "public com.example.grpc.SimpleServiceOuterClass.Area.Builder addAreaBuilder() {\n return getAreaFieldBuilder().addBuilder(\n com.example.grpc.SimpleServiceOuterClass.Area.getDefaultInstance());\n }", "@Override\n\tpublic void areaTotal() {\n\t\tsolido.areaTotal = solido.areaLateral + solido.areaBase;\n\t}", "@Override\r\n\tpublic String toString() {\r\n\r\n\t\treturn \"My rectangle's Areas is \"+area();\r\n\t}", "@Test\n\tpublic void harderLinkTest() {\n\t\tCompassRoom eastRoom = new CompassRoom(\"eastRoom\");\n\t\tCompassRoom westRoom = new CompassRoom(\"westRoom\");\n\t\t// Link rooms.\n\t\twestRoom.linkTo(CompassDirections.East, eastRoom); // [west] -> [east]\n\t\teastRoom.linkTo(CompassDirections.West, westRoom); // [west] <- [east]\n\t\t\n\t\tassertEquals(\"westRoom should link east to eastRoom.\",\n\t\t\t\teastRoom, westRoom.getExitRoom(CompassDirections.East));\n\t\tassertEquals(\"eastRoom should link west to westRoom.\",\n\t\t\t\twestRoom, eastRoom.getExitRoom(CompassDirections.West));\n\t\tassertEquals(\"westRoom should not have a west exit.\",\n\t\t\t\tnull, westRoom.getExitRoom(CompassDirections.West));\n\t\tassertEquals(\"eastRoom should not have an east exit.\",\n\t\t\t\tnull, eastRoom.getExitRoom(CompassDirections.East));\n\t}", "@POST\n\t@Consumes({ MediaType.APPLICATION_JSON })\n\t@Produces({ MediaType.APPLICATION_JSON })\n\tpublic Response add(final AreaTO areaTO) {\n\n\t\tfinal AreaTO resultTO = new AreaTO();\n\n\t\ttry {\n\n\t\t\tArea area = new Area();\n PropertyUtils.copyProperties(area, areaTO);\n\t\t\tfinal Users user = this.usersService.findByCDSID(this.requestContext.getUserId());\n\t\t\tarea.setCountryC(FunctionsUtils.validateInteger(user.getCountryDbC()));\n\t\t\tarea.setCreatedY(this.dateTimeSqlService.currentDateTimeSql().getDatetime());\n\t\t\tarea.setCreatedUserC(this.requestContext.getUserId());\n\t\t\tarea.setStatusR(1);\n\n\t\t\tarea = this.areaService.insertAndReturnObj(area);\n\t\t\tPropertyUtils.copyProperties(resultTO, area);\n\n\t\t} catch (final ApplicationException e) {\n\n\t\t\tfinal ErrorTO erro = new ErrorTO();\n\t\t\terro.setCodigoIncident(e.getLogReferenceCode());\n\n\t\t\tfinal ResourceBundle bundle = ResourceBundle.getBundle(\"ApplicationResources\");\n\n\t\t\tfinal List<ErrorType> erros = e.getErrorTypes();\n\n\t\t\tfor (final ErrorType errorType : erros) {\n\t\t\t\terro.setMessage(bundle.getString(errorType.getKey()));\n\t\t\t}\n\n\t\t\treturn this.buildResponse(erro, Status.INTERNAL_SERVER_ERROR);\n\t\t} catch (final Exception ex) {\n\n\t\t\tfinal ErrorTO erro = new ErrorTO();\n\t\t\terro.setMessage(\"Fatal Error\");\n\n\t\t\treturn this.buildResponse(erro, Status.INTERNAL_SERVER_ERROR);\n\t\t}\n\n\t\treturn buildResponseWithOkStatus(resultTO);\n\t}", "public void linkRoom(Map linkMap){\n\n\n\t\t//complete the link\n\t\tPoint stair1 = STAIR_POINT;\n\t\tPoint stair2;\n\n\n\t\tRectangle[] rooms2 = linkMap.getRooms();\n\t\tstair2 = MapRand.randPoint(MapRand.innerRectangle(rooms2[MapRand.randInt(rooms2.length -1)]));\n\n\t\t//ensure staircase gets a free space\n\t\twhile ((linkMap.getTile(stair2.x, stair2.y).getItemCount() > 0) || (linkMap.getTile(stair2.x, stair2.y).isOccupied() == true)){\n\t\t\tstair2 = MapRand.randPoint(MapRand.innerRectangle(rooms2[MapRand.randInt(rooms2.length -1)]));\n\t\t}\n\n\n\t\t//create the special staircase link\n\t\tthis.map.setTile(stair1.x, stair1.y, new StairTile(this.map, linkMap, stair1, stair2, true));\n\t\tlinkMap.setTile(stair2.x, stair2.y, new StairTile(linkMap, this.map, stair2, stair1));\n\n\t}", "@Override\r\n\t\t\t\t\t\t\tpublic void ancestorMoved(AncestorEvent event) {\n\t\t\t\t\t\t\t}", "@Override\r\n\tpublic void createContents(Composite viewArea, Map<String, Image> imageMap) {\n\t\tgraph = new Graph(viewArea, SWT.None);\r\n\t\tnodes = new LinkedList<GraphNode>();\r\n\t\tconnections = new LinkedList<GraphConnection>();\r\n\r\n\t\tString[] name = { \"Core\", \"Outline\", \"Package Explorer\", \"JUnit\",\r\n\t\t\t\t\"JavaDoc\", \"Debug\" };\r\n\t\tfor (int i = 0; i < name.length; i++) {\r\n\t\t\tnodes.add(new GraphNode(graph, SWT.None, name[i]));\r\n\t\t}\r\n\r\n\t\tconnections.add(CreateConnection(\"Core\", \"Outline\"));\r\n\t\tgraph.setLayoutAlgorithm(new SpringLayoutAlgorithm(\r\n\t\t\t\tLayoutStyles.NO_LAYOUT_NODE_RESIZING), true);\r\n\t\tgraph.addSelectionListener(new SelectionListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void widgetSelected(SelectionEvent arg0) {\r\n\t\t\t\tSystem.out.println(arg0);\r\n\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent arg0) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t}", "public void setClickedNodeArea(Ellipse2D clickedNodeArea) {\r\n\t\tthis.clickedNodeArea = clickedNodeArea;\r\n\t}", "public Integer getAreaId() {\n return areaId;\n }", "public Integer getAreaId() {\n return areaId;\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Carea)) {\r\n return false;\r\n }\r\n Carea other = (Carea) object;\r\n if ((this.idDir == null && other.idDir != null) || (this.idDir != null && !this.idDir.equals(other.idDir))) {\r\n return false;\r\n }\r\n return true;\r\n }", "public List expand()\r\n {\r\n boolean isComp1 = isComposite(boundable1);\r\n boolean isComp2 = isComposite(boundable2);\r\n \r\n /**\r\n * HEURISTIC: If both boundable are composite,\r\n * choose the one with largest area to expand.\r\n * Otherwise, simply expand whichever is composite.\r\n */\r\n if (isComp1 && isComp2) {\r\n if (area(boundable1) > area(boundable2)) {\r\n return expand(boundable1, boundable2);\r\n }\r\n else {\r\n return expand(boundable2, boundable1); \r\n }\r\n }\r\n else if (isComp1) {\r\n return expand(boundable1, boundable2);\r\n }\r\n else if (isComp2) {\r\n return expand(boundable2, boundable1);\r\n }\r\n \r\n throw new IllegalArgumentException(\"neither boundable is composite\");\r\n }", "public Area() {\n }", "public void drawTree(GUIMain guiMn, MenuDoAction menu, DoNewInsertOpenModel doNewInsertOpenModel) {\n DefaultMutableTreeNode tissueBranch;\n HumanBody body = null;\n\n if (guiMn.simMain.solver == null) {\n System.err.println(\"The model files are not correct\\n\");\n }\n HostModel host = guiMn.simMain.solver.getHostModelToSolve().getHostModel();\n body = host.getPlacentalia();\n Map<Tissue, DefaultMutableTreeNode> ancestor = new HashMap<>();\n if (body.getNumOrganSystems() > 0) {\n Iterator<PhysioSystem> iter = body.getOrganSystems().iterator();\n\n // loop over PhysioSystems (usually there is only one)\n while (iter.hasNext()) {\n PhysioSystem organsys = iter.next();\n NodeLeaf organSystem = new NodeLeaf(organsys, \"./data/images/iconOrganSystem.gif\");\n DefaultMutableTreeNode organBranch = guiMn.simMain.st.addObject(guiMn, organSystem);\n ArrayList<Tissue> tissues = organsys.tissues;\n Iterator<Tissue> tissueIterator = tissues.iterator();\n\n // loop over Tissues in this PhysioSystem\n while (tissueIterator.hasNext()) {\n NodeLeaf leaf = null;\n\n Tissue tiss = tissueIterator.next();\n if (tiss.getName() == null) {\n System.out.println(\"Error null Tissue\");\n }\n NodeLeaf leafTissue = new NodeLeaf(tiss, \"./data/images/iconTissue.gif\");\n tissueBranch = guiMn.simMain.st.addObject(guiMn, organBranch, leafTissue, true);\n ancestor.put(tiss, tissueBranch);\n ArrayList<CompartmentSBML> comps = tiss.getInternVolumes();\n Iterator<CompartmentSBML> compIterator = comps.iterator();\n\n // loop over compartments in this Tissues\n while (compIterator.hasNext()) {\n CompartmentSBML compa = compIterator.next();\n leaf = processComp(guiMn, compa, tissueBranch);\n }\n // Post processing for \"outside\" field\n ArrayList<CompartmentSBML> compbis = tiss.getInternVolumes();\n Iterator<CompartmentSBML> postIterator = compbis.iterator();\n // loop over compartments in this Tissue\n CompartmentSBML compInside;\n while (postIterator.hasNext()) {\n compInside = postIterator.next();\n if(compInside == null)\n {\n System.out.println(\"No id in model: \" + compInside.getName());\n }\n postProcessComp(guiMn, tiss, tissueBranch, compInside);\n }\n // now there are still compartments in root that are at the wrong place\n } // end of Tissue loop\n } // end of Physiological systems loop\n }\n // when a tissue is embedded in another tissue \n careForPartOf(guiMn, ancestor);\n }", "public void setPersonnelArea(String personnelArea);", "public void addAgent(Agent a)\n/* 86: */ {\n/* 87:139 */ this.mapPanel.addAgent(a);\n/* 88: */ }" ]
[ "0.55676174", "0.5322456", "0.51372737", "0.5050443", "0.49892792", "0.49657714", "0.47530723", "0.4724283", "0.47151855", "0.46638596", "0.46433288", "0.46254793", "0.46075368", "0.46075368", "0.46007305", "0.4559703", "0.45590234", "0.45327145", "0.45271364", "0.44742703", "0.44712186", "0.44643307", "0.4454617", "0.44496486", "0.44479984", "0.441799", "0.44161004", "0.44012383", "0.4392663", "0.43919718", "0.43919718", "0.43781346", "0.4341986", "0.43399695", "0.4332395", "0.4331393", "0.42793605", "0.42690957", "0.42653355", "0.4261687", "0.42557684", "0.42483306", "0.4218143", "0.4209323", "0.42032593", "0.4195447", "0.41897207", "0.41861877", "0.4166394", "0.41580138", "0.41573358", "0.4157196", "0.41537657", "0.41450167", "0.41394487", "0.41380814", "0.41337693", "0.41295192", "0.41256052", "0.41211438", "0.41195202", "0.411724", "0.41131377", "0.41010532", "0.40954912", "0.40941945", "0.4092848", "0.40837485", "0.407258", "0.40704158", "0.40645152", "0.40636045", "0.40628338", "0.40628338", "0.40606207", "0.40572035", "0.4054375", "0.40475583", "0.40475583", "0.40391693", "0.4035645", "0.40345177", "0.40345177", "0.40345177", "0.40291864", "0.40282476", "0.40250537", "0.40218514", "0.40208745", "0.40203795", "0.40174657", "0.40111887", "0.4008685", "0.4008685", "0.40044627", "0.400431", "0.39981985", "0.3996963", "0.39929613", "0.39927775" ]
0.65888536
0
Remove the link between two subjectAreas in the subjectArea hierarchy.
@SuppressWarnings(value = "unused") public VoidResponse unlinkSubjectAreasInHierarchy(String serverName, String userId, String parentSubjectAreaGUID, String childSubjectAreaGUID, RelationshipRequestBody requestBody) { final String methodName = "unlinkSubjectAreasInHierarchy"; final String parentSubjectAreaGUIDParameterName = "parentSubjectAreaGUID"; final String childSubjectAreaGUIDParameterName = "childSubjectAreaGUID"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); VoidResponse response = new VoidResponse(); AuditLog auditLog = null; try { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName); if (requestBody != null) { handler.unlinkElementFromElement(userId, false, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), parentSubjectAreaGUID, parentSubjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, childSubjectAreaGUID, childSubjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, false, false, OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID, OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME, null, methodName); } else { handler.unlinkElementFromElement(userId, false, null, null, parentSubjectAreaGUID, parentSubjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, childSubjectAreaGUID, childSubjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, false, false, OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID, OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME, null, methodName); } } catch (Exception error) { restExceptionHandler.captureExceptions(response, error, methodName, auditLog); } restCallLogger.logRESTCallReturn(token, response.toString()); return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void removeArea() {\n \t\tthis.set.remove( this.area );\n \t\tthis.finish();\n \t}", "public abstract void remove(SubArea selectedSubArea);", "void unsetFurtherRelations();", "public void secondaryRemoveLeaseRules(com.hps.july.persistence.LeaseRule aLeaseRules) {\n\tthis.getLeaseRulesLink().secondaryRemoveElement(aLeaseRules);\n}", "public void delIncomingRelations();", "public void unassociate(Node otherNode, QName associationTypeQName, Directionality directionality);", "public void unsetIntersectingRoadwayRef()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(INTERSECTINGROADWAYREF$20);\r\n }\r\n }", "public void onUnlink()\n {\n getTextArea().setFocus(true);\n// clientJupiter.generate(treeOperationFactory.createLink(clientJupiter.getSiteId(),\n// getTextArea().getDocument().getSelection().getRangeAt(0), linkConfig.getUrl()));\n Console.getInstance().log(\"RTP: onUnlink\");\n }", "void unsetSubject();", "public void delRelations();", "void clearAssociations();", "@SuppressWarnings(value = \"unused\")\n public VoidResponse unlinkSubjectAreaFromGovernanceDefinition(String serverName,\n String userId,\n String subjectAreaGUID,\n String definitionGUID,\n RelationshipRequestBody requestBody)\n {\n final String methodName = \"unlinkSubjectAreaToGovernanceDefinition\";\n\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n final String definitionGUIDParameterName = \"definitionGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n handler.unlinkElementFromElement(userId,\n false,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n methodName);\n }\n else\n {\n handler.unlinkElementFromElement(userId,\n false,\n null,\n null,\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public void removeAgent(Agent a)\n/* 81: */ {\n/* 82:132 */ this.mapPanel.removeAgent(a);\n/* 83: */ }", "protected abstract void removeJointImpl( Joint joint );", "public void supprimer() {\n origine.aretes_sortantes.supprimer(this);\n destination.aretes_entrantes.supprimer(this);\n origine.successeurs.supprimer(destination);\n destination.predecesseurs.supprimer(origine);\n position.supprimerElement();\n }", "void removeIsBoundaryNodeOf(Boundary oldIsBoundaryNodeOf);", "private static void RemoveEdge(Point a, Point b)\n {\n //Here we use a lambda expression/predicate to express that we're looking for a match in list\n //Either if (n.A == a && n.B == b) or if (n.A == b && n.B == a)\n edges.removeIf(n -> n.A == a && n.B == b || n.B == a && n.A == b);\n }", "public void removeAllRuleRef();", "@SuppressWarnings(value = \"unused\")\n public VoidResponse deleteSubjectArea(String serverName,\n String userId,\n String subjectAreaGUID,\n ExternalSourceRequestBody requestBody)\n {\n final String methodName = \"deleteSubjectArea\";\n final String guidParameter = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n handler.deleteBeanInRepository(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n subjectAreaGUID,\n guidParameter,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n null,\n false,\n false,\n new Date(),\n methodName);\n }\n else\n {\n handler.deleteBeanInRepository(userId,\n null,\n null,\n subjectAreaGUID,\n guidParameter,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n null,\n false,\n false,\n new Date(),\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "@Test\n\tpublic void testRemoveLinkComponent() {\n\t\tSubmenu root = new Submenu(\"root\");\n\t\tMenuItem item1 = new MenuItem(\"item1\");\n\t\troot.addMenuentry(item1);\n\t\tSubmenu submenu1 = new Submenu(\"submenu1\");\n\t\troot.addMenuentry(submenu1);\n\n\t\troot.removeMenuentry(submenu1);\n\t\tAssert.assertEquals(1, root.getMenuentrys().size());\n\t\tAssert.assertSame(item1, root.getMenuentrys().iterator().next());\n\t\tAssert.assertNull(submenu1.getParentBean());\n\t\troot.removeMenuentry(item1);\n\t\tAssert.assertEquals(0, root.getMenuentrys().size());\n\t\tAssert.assertNull(item1.getParentBean());\n\t}", "private void clearEdgeLinks() {\n edges.clear();\n //keep whole tree to maintain its position when it is expanded (within scroll pane bounds)\n Node rootNode = nodes.get(0);\n VBox rootVBox = (VBox) rootNode.getContainerPane().getParent();\n rootVBox.layout();\n Bounds rootNodeChildrenVBoxBounds = rootNode.getChildrenVBox().getBoundsInLocal();\n rootVBox.setLayoutY(Math.abs(rootVBox.getLayoutY() - ((rootNodeChildrenVBoxBounds.getHeight()) - rootNode.getHeight()) / 2 + rootNode.getLayoutY()));\n rootVBox.layout();\n\n for (int i = 0; i < nodes.size(); i++) {\n Pane containerPane = nodes.get(i).getContainerPane();\n //reposition node to the center of its children\n ObservableList<javafx.scene.Node> genericNodes = nodes.get(i).getChildrenVBox().getChildren();\n if (!genericNodes.isEmpty()) {\n nodes.get(i).setLayoutY(((nodes.get(i).getChildrenVBox().getBoundsInLocal().getHeight()) - rootNode.getHeight()) / 2);\n }\n\n for (int j = 0; j < containerPane.getChildren().size(); j++) {\n if (containerPane.getChildren().get(j) instanceof Edge) {\n containerPane.getChildren().remove(j);\n j--;\n }\n }\n }\n redrawEdges(rootNode);\n }", "public void removeNodeAfterThis() {\r\n\t\tif ( link != null ) {\r\n\t\t\tlink = link.link;\r\n\t\t} // end precondition\r\n\t}", "private void removeCrossReference ()\n\t{\n\t\tif (crossReference != null)\n\t\t{\n\t\t\tcrossReferences.remove (crossReference);\n\t\t}\n\t}", "@Override\n \tpublic void removeIsCitedBy(Reference reference) {\n \t\tList<Reference> isCitedBy = getIsCitedBy();\n \t\t// check for no existing relationship\n \t\tif (reference == null || !isCitedBy.contains(reference))\n \t\t\treturn;\n \t\t// remove both sides of relationship\n \t\treference.getCitationList().remove(this);\n \t\tisCitedBy.remove(reference);\n \n \t}", "public void removeEdge(Node p_a, Node p_b) {\n\t\tEdge edge = makeEdge(p_a, p_b);\n\t\tedges.remove(edge);\n\t}", "@SuppressWarnings(value = \"unused\")\n public VoidResponse linkSubjectAreasInHierarchy(String serverName,\n String userId,\n String parentSubjectAreaGUID,\n String childSubjectAreaGUID,\n RelationshipRequestBody requestBody)\n {\n final String methodName = \"linkSubjectAreasInHierarchy\";\n\n final String parentSubjectAreaGUIDParameterName = \"parentSubjectAreaGUID\";\n final String childSubjectAreaGUIDParameterName = \"childSubjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n if (requestBody.getProperties() != null)\n {\n handler.linkElementToElement(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n parentSubjectAreaGUID,\n parentSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n childSubjectAreaGUID,\n childSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME,\n null,\n requestBody.getProperties().getEffectiveFrom(),\n requestBody.getProperties().getEffectiveTo(),\n new Date(),\n methodName);\n }\n else\n {\n handler.linkElementToElement(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n parentSubjectAreaGUID,\n parentSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n childSubjectAreaGUID,\n childSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME,\n (InstanceProperties) null,\n null,\n null,\n new Date(),\n methodName);\n }\n }\n else\n {\n handler.linkElementToElement(userId,\n null,\n null,\n parentSubjectAreaGUID,\n parentSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n childSubjectAreaGUID,\n childSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME,\n (InstanceProperties) null,\n null,\n null,\n new Date(),\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "void unsetAnchorOffset();", "public void unassociate(Node targetNode, QName associationTypeQName);", "public void deleteSubject(String subjectId) {\n\t\t\r\n\t}", "@Override\n\tpublic AreaExecution removeArea(long areaId) {\n\t\treturn null;\n\t}", "public void secondaryRemoveChangeLogDetailses(com.hps.july.persistence.ChangeLogDetails aChangeLogDetailses) {\n\tthis.getChangeLogDetailsesLink().secondaryRemoveElement(aChangeLogDetailses);\n}", "void removeDirectedEdge(final Node first, final Node second)\n {\n if (first.connectedNodes.contains(second))\n first.connectedNodes.remove(second);\n\n }", "public boolean deleteArc(arc link) {\r\n\t\tif (link.getStartNode() == this)\r\n\t\t\toutcoming.remove(link);\r\n\t\telse if (link.getEndNode() == this)\r\n\t\t\tincoming.remove(link);\r\n\t\telse\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "public void removeAllAgents()\n/* 76: */ {\n/* 77:125 */ this.mapPanel.removeAllAgents();\n/* 78: */ }", "public void removeAgent(String layer, Agent a)\n/* 175: */ {\n/* 176:247 */ this.mapPanel.removeAgent(layer, a);\n/* 177: */ }", "public void unsetRoadwayRef()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(ROADWAYREF$16);\r\n }\r\n }", "public void removeAgent() {agent = null;}", "private void linkRemoved(Link link) {\n\n\t}", "void unsetConstraints();", "public void delRelations(XDI3Segment arcXri);", "@Override\r\n\tpublic boolean unlink(E src, E dst) {\r\n\t\tVertex<E> s = vertices.get(src);\r\n\t\tVertex<E> d = vertices.get(dst);\r\n\t\tif(s != null && d != null) {\r\n\t\t\tadjacencyLists.get(src).remove(new Edge<E>(s.getElement(), d.getElement(), 1)); //remove edge (s,d)\r\n\t\t\tif(!isDirected) { //Remove the other edge if this graph is undirected\r\n\t\t\t\tadjacencyLists.get(dst).remove(new Edge<E>(d.getElement(), s.getElement(), 1));\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void remove() {\r\n\t\theadNode.link = headNode.link.link;\r\n\t\tsize--;\r\n\t}", "public void unlinkLR()\n {\n this.L.R = this.R;\n this.R.L = this.L;\n }", "public void removeBranch() {\n if (LogWriter.needsLogging(LogWriter.TRACE_DEBUG))\n LogWriter.logMessage(LogWriter.TRACE_DEBUG, \"removeBranch()\");\n Via via=(Via)sipHeader;\n \n via.removeParameter(Via.BRANCH);\n }", "void removeOutgoing(NavArc arc) {\r\n assert arc != null;\r\n assert arc.getFromVertex() == this : arc;\r\n\r\n boolean success = outgoing.remove(arc);\r\n assert success : arc;\r\n }", "void removeNode(ANode<T> a) {\n if (this.equals(a)) {\n this.remove();\n }\n else {\n this.next.removeNode(a);\n }\n }", "public void removeFromCollections() {\n \n if (assignmentResponse != null) {\n Set parentCollection = assignmentResponse.getAnswers();\n if (parentCollection != null) parentCollection.remove(this);\n }\n if (question != null) {\n Set parentCollection = question.getAnswers();\n if (parentCollection != null) parentCollection.remove(this);\n }\n Vital3Utils.removeMultipleFromCollections(comments);\n }", "public void unlinkUD()\n {\n this.U.D = this.D;\n this.D.U = this.U;\n }", "boolean removeLink(Link link);", "private void deleteConnections() {\n for (int i = 0; !this.sourceConnections.isEmpty(); ) {\n LinkElement wire = (LinkElement) this.sourceConnections.get(i);\n wire.detachSource();\n wire.detachTarget();\n this.graphElement.removeEdge(wire.getEdgeId(), wire);\n }\n\n for (int i = 0; !this.targetConnections.isEmpty(); ) {\n LinkElement wire = (LinkElement) this.targetConnections.get(i);\n wire.detachSource();\n wire.detachTarget();\n this.graphElement.removeEdge(wire.getEdgeId(), wire);\n }\n }", "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 }", "void unsetBranchOfficeList();", "private void RemoveRootNode() {\n\t\t\n\t\troot_map.remove(this);\n\t\tis_node_set = false;\n\t\tif(left_ptr == null && right_ptr == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tleft_ptr.RemoveRootNode();\n\t\tright_ptr.RemoveRootNode();\n\t}", "public XMessage deleteAssignments(OpProjectSession session, XMessage request) {\r\n List superLocators = (List) (request.getArgument(SUPER_SUBJECT_IDS));\r\n List subLocators = (List) (request.getArgument(SUB_SUBJECT_IDS));\r\n // assuming that both lists are of same size!\r\n\r\n Iterator super_iter = superLocators.iterator();\r\n Iterator sub_iter = subLocators.iterator();\r\n if (super_iter.hasNext()) {\r\n OpBroker broker = session.newBroker();\r\n OpTransaction t = broker.newTransaction();\r\n try {\r\n while (super_iter.hasNext() && sub_iter.hasNext()) {\r\n OpLocator superLocator = OpLocator.parseLocator((String) (super_iter.next()));\r\n OpLocator subLocator = OpLocator.parseLocator((String) (sub_iter.next()));\r\n OpGroup super_group = serviceIfcImpl.getGroupById(session, broker, superLocator.getID());\r\n if (subLocator.getPrototype().getInstanceClass() == OpUser.class) {\r\n // user to group\r\n OpUser user = serviceIfcImpl.getUserById(session, broker, subLocator.getID());\r\n serviceIfcImpl.removeUserFromGroup(session, broker, user, super_group);\r\n }\r\n else {\r\n // group to group\r\n OpGroup group = serviceIfcImpl.getGroupById(session, broker, subLocator.getID());\r\n serviceIfcImpl.removeGroupFromGroup(session, broker, group, super_group);\r\n }\r\n }\r\n t.commit();\r\n }\r\n catch (XServiceException exc) {\r\n t.rollback();\r\n XMessage reply = new XMessage();\r\n reply.setError(exc.getError());\r\n return (reply);\r\n }\r\n finally {\r\n broker.close();\r\n }\r\n }\r\n return null;\r\n }", "public void removeFromCollision(Entity en){\n\t\tif (hitboxCollision.containsKey(en)){\n\t\t\tRectangle hitbox = hitboxCollision.get(en);\n\t\t\tareaCollision.remove(hitbox);\n\t\t\thitboxCollision.remove(en);\n\t\t}\n\t}", "@Override\r\n\tpublic boolean deleteMovieConnection(String actor1, String actor2, String movieName)\r\n\t{\r\n\t\tActor act1 = new Actor(actor1);\r\n\t\tActor act2 = new Actor(actor2);\r\n\t\t\r\n\t\tif(graph.containsEdge(act1,act2 ) == true)\r\n\t\t{\r\n\t\t\tgraph.removeEdge(act1, act2, 1, movieName);\r\n\t\t\t\r\n\t\t\treturn true;\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "@Override\n\tpublic void removeLayoutComponent(Component comp) {\n\t\tif (center == comp)\n\t\t\tcenter = null;\n\t\telse\n\t\t\tedge.remove(comp);\n\t}", "public void deletelink(Integer linkId);", "public final void clearLinks() {\n\t\tlockMe(this);\n\t\tlinks.clear();\n\t\tlinksFromDistance.clear();\n\t\tlinksToDistance.clear();\n\t\tunlockMe(this);\n\t}", "void remove(Shape shape)\n {\n // If the children list contains the shape\n // then remove it and set its parent to null\n // breaking the two-way connection\n if(contains(shape))\n {\n children.remove(shape);\n shape.setParent(null);\n }\n }", "public static void delMid2(Node mid)\n {\n if (null != mid && null != mid.next)\n {\n mid.data = mid.next.data;\n mid.next = mid.next.next;\n }\n }", "@Test\n\tpublic void testRemoveLinkComponentDeleteOrphanedFromDoc() {\n\t\tAddressBook adrbook = new AddressBook();\n\t\tDocument doc = new Document(adrbook);\n\t\tAssert.assertSame(doc.findBeansByType(\"org.rapidbeans.test.codegen.AddressBook\").get(0), doc.getRoot());\n\t\tPerson martin = new Person(new String[] { \"Bl�mel\", \"Martin\", \"19641014\" });\n\t\tadrbook.addPerson(martin);\n\t\tAssert.assertSame(martin, ((ReadonlyListCollection<?>) adrbook.getPersons()).get(0));\n\t\tAssert.assertSame(martin, doc.findBeansByType(\"org.rapidbeans.test.codegen.Person\").get(0));\n\t\tAddress fasanstreet = new Address();\n\t\tfasanstreet.setStreet(\"Fasanenstra�e\");\n\t\tadrbook.addAddress(fasanstreet);\n\t\tAssert.assertNull(fasanstreet.getInhabitants());\n\t\tfasanstreet.addInhabitant(martin);\n\t\tAssert.assertEquals(1, fasanstreet.getInhabitants().size());\n\t\tAssert.assertSame(fasanstreet, martin.getAddress());\n\t\tadrbook.removeAddress(fasanstreet);\n\t\tAssert.assertEquals(0, fasanstreet.getInhabitants().size());\n\t}", "public void cutNode ()\n {\n copyNode();\n deleteNode();\n }", "@Override\n public void deleteRelationshipBetweenPhysicalAndPhysical(PhysicalObject physicalObjectA,\n PhysicalObject physicalObjectB) {\n assert false : \"shouldn't call this method\";\n }", "public void removeArc(T start, T end) {\n\t\tSet<T> adjacents=arcs.get(start);\n\t\tadjacents.remove(end);\n\t}", "protected void removeReference()\n {\n }", "void removeLine(PNode c){\n\t\tLinkSet ls = null;\n\t\tLink l = null;\n\t\tLinkSet ls1 = new LinkSet();\n\t\tfor(int i=0;i<linksets.size();i++){\n\t\t\tfor(int j=0;j<linksets.get(i).getLinks().size();j++){\n\t\t\t\tif(c==linksets.get(i).getLinks().get(j).getNode1()||c==linksets.get(i).getLinks().get(j).getNode2()){\n\t\t\t\t\tls = linksets.get(i);\n\t\t\t\t\tl = ls.getLinks().get(j);\n\t\t\t\t\tls.removeLink(l);\n\t\t\t\t\tif(ls.getLinks().size()==0){\n\t\t\t\t\t\tlinksets.remove(ls);//remove linkset if it is empty\n\t\t\t\t\t\tls = null;\n\t\t\t\t\t\tl = null;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(ls!=null){\n\t\t\tLink tlink = null;\n\t\t\tfor(Link lnk: ls.getLinks()){\n\t\t\t\tif(lnk.getNode1().getOwner()==l.getNode1().getOwner() && lnk.getNode1().getSignal()==l.getNode1().getSignal()\n\t\t\t\t\t\t|| lnk.getNode2().getOwner()==l.getNode1().getOwner() && lnk.getNode2().getSignal()==l.getNode1().getSignal()){\n\t\t\t\t\ttlink = lnk;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\tif(tlink!=null){\n\t\t\t\tls1.addLink(tlink);\n\t\t\t\tls.removeLink(tlink);\n\t\t\t\tcheckForNextLink(ls1, ls, tlink);\n\t\t\t}\n\t\t\tif(ls.getLinks().size()==0){\n\t\t\t\tlinksets.remove(ls);\n\t\t\t}\n\t\t\tlinksets.add(ls1);\n\t\t}\n\t\tfor(int i=0; i<links.size();i++){\n\t\t\tLink lnk = links.get(i);\n\t\t\tif (c == lnk.getNode1() || c == lnk.getNode2()){\n\t\t\t\tlayer.removeChild(links.get(i).getPPath());\n\t\t\t\tlinks.remove(i);\n\t\t\t\tremoveLine(c);\n\t\t\t}\n\t\t}\n\t}", "void clearLinks();", "public void trimRoutes(){\n Station firstStation = null;\n Station s = null;\n Link link = null;\n if (trainState instanceof TrainReady)\n s = ((TrainReady) trainState).getStation();\n if (trainState instanceof TrainArrive)\n link = ((TrainArrive) trainState).getLink();\n if (trainState instanceof TrainDepart)\n link = ((TrainDepart) trainState).getLink();\n\n if (trainState instanceof TrainReady){\n firstStation = s;\n } else if (trainState instanceof TrainArrive){\n firstStation = link.getTo();\n } else if (trainState instanceof TrainDepart){\n firstStation = link.getFrom();\n }\n\n Iterator<Route> routeIterator = routes.iterator();\n while (routeIterator.hasNext()) {\n Route route = routeIterator.next();\n Iterator<Link> iter = route.getLinkList().iterator();\n while (iter.hasNext()){\n Link track = iter.next();\n if (!track.getFrom().equals(firstStation))\n iter.remove();\n else\n break;\n }\n if (route.getLinkList().size() == 0) {\n routeIterator.remove();\n }\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 }", "boolean removeAssociation(AssociationEnd association);", "@Override\n\tpublic void borrarArco(Ciudad c1, Ciudad c2) {\n\t\tgetVertice(c1).removeArc(c2);\n\t\tthis.cantArcos--;\n\t}", "public void secondaryRemoveLeaseTaskStarts(com.hps.july.persistence.LeaseTaskStart aLeaseTaskStarts) {\n\tthis.getLeaseTaskStartsLink().secondaryRemoveElement(aLeaseTaskStarts);\n}", "@PortedFrom(file = \"Taxonomy.h\", name = \"deFinalise\")\n public void deFinalise() {\n boolean upDirection = true;\n TaxonomyVertex bot = getBottomVertex();\n for (TaxonomyVertex p : bot.neigh(upDirection)) {\n p.removeLink(!upDirection, bot);\n }\n bot.clearLinks(upDirection);\n willInsertIntoTaxonomy = true; // it's possible again to add entries\n }", "protected void doDeleteBoth() {\r\n\t\tif (renderer.surface != null) {\r\n\t\t\tUndoableMapEdit undo = new UndoableMapEdit(renderer.surface);\r\n\t\t\tdeleteEntitiesOf(renderer.surface.basemap, renderer.selectedRectangle, false);\r\n\t\t\tdeleteEntitiesOf(renderer.surface.buildingmap, renderer.selectedRectangle, true);\r\n\t\t\tundo.setAfter();\r\n\t\t\taddUndo(undo);\r\n\t\t\trepaint();\r\n\t\t}\r\n\t}", "private void clearRoutePolyline() {\n\t\tif (routePolyline != null) {\n\t\t\troutePolyline.remove();\n\t\t\troutePolyline = null;\n\t\t}\n\t}", "public void removeOrganMistake() {\n records.remove(selectedRecord);\n DonorReceiver account = accountManager.getAccountsByNHI(selectedRecord.getNhi()).get(selectedRecord.getNhi());\n TransplantWaitingList.removeOrganMistake(selectedRecord, accountManager);\n PageNav.loadNewPage(PageNav.TRANSPLANTLIST);\n }", "public void removeMaster() {\n master = null;\n }", "private void removeEdgeJointPointDest(Vector<Edge> edges) {\n\t\tfor (Edge e: edges) {\n\t\t\t\tEdge currentEdge = e;\n\t\t\t\tremoveEdge(e);\n\t\t\t\twhile (shapes.contains(currentEdge.getDest()) && currentEdge.getDest() instanceof JoinPoint) {\n\t\t\t\t\tJoinPoint join = (JoinPoint) currentEdge.getDest();\n\t\t\t\t\tshapes.remove(join);\n\t\t\t\t\tcurrentEdge = (Edge) join.getDest();\n\t\t\t\t\tremoveEdge(currentEdge);\n\t\t\t\t}\n\t\t}\n\t}", "public void delRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri);", "public void removeByCopiedFrom(long copiedFrom);", "void unsetRoadTerrain();", "public void removeRelationship(String classNameFrom, String classNameTo)\n\t{\n\t\tstoreViewState();\n\t\tproject.removeRelationship(classNameFrom, classNameTo);\n\t\tcheckStatus();\n\t}", "public abstract void removeEdge(int from, int to);", "public void removeLink(int vertexA, int vertexB) {\n\t\ttry {\n\t\t\t// Remove link from A to B\n\t\t\tArrayList<Integer> neighbors = this.adjListMap.get(vertexA);\n\t\t\tneighbors.remove((Integer) vertexB);\n\t\t\tthis.adjListMap.put(vertexA, neighbors);\n\n\t\t\t// Remove a link from B to A\n\t\t\tneighbors = this.adjListMap.get(vertexB);\n\t\t\tneighbors.remove((Integer) vertexA);\n\t\t\tthis.adjListMap.put(vertexB, neighbors);\n\n\t\t\t// Update reachability matrix on every link removal\n\t\t\tbuildReachabilityMatrix(this.adjListMap);\n\t\t} catch (NullPointerException e) {\n\t\t\tSystem.out.println(\"Vertices are out of range. It should be < \" + this.maxNumVertices);\n\t\t}\n\n\t}", "public void unsetObservationDataLink()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(OBSERVATIONDATALINK$18);\r\n }\r\n }", "void retainOutlineAndBoundaryGrid() {\n\t\tfor (final PNode child : getChildrenAsPNodeArray()) {\n\t\t\tif (child != selectedThumbOutline && child != yellowSIcolumnOutline && child != boundary) {\n\t\t\t\tremoveChild(child);\n\t\t\t}\n\t\t}\n\t\tcreateOrDeleteBoundary();\n\t}", "private void unsubscribe() {\n subscriber=null;\n }", "public void removeFromParent();", "public void deleteSubject(Subject object) {\n\t\tsub_dao.deleteSubject(object);\r\n\t}", "void removeRoute(McastRoute route);", "protected abstract void removeBodyImpl( Body body );", "@Override\n\tpublic synchronized Arc removeArc(PetrinetNode source, PetrinetNode target) {\n\t\tArc a = this.removeFromEdges(source, target, this.arcs);\n\t\treturn a;\n\t}", "public void unassignAsteroidToShip(Asteroid asteroid) {\n\t\tasteroidToShip.remove(asteroid.getId());\n\t}", "abstract void removeNodeReferences(Node<T> node);", "@Override\n\tpublic int deleteArea(int areaId) {\n\t\treturn areaMapper.deleteArea(areaId);\n\t}", "void removeEdge(int x, int y);", "void removeNode(ANode<T> a) {\n if (!a.equals(header)) {\n header.removeNodeFirst(a);\n }\n }", "public void manyToManyDeleteOwningSideTest() throws Exception {\n EntityManager em = createEntityManager();\n \n em.getTransaction().begin();\n \n EntityA a1 = new EntityA();\n a1.setName(\"EntityA1\");\n EntityB b1 = new EntityB();\n b1.setName(\"EntityB1\");\n\n a1.getBs().add(b1);\n b1.getAs().add(a1);\n\n em.persist(a1);\n\n em.getTransaction().commit();\n\n Integer idA1 = a1.getId();\n Integer idB1 = b1.getId();\n \n em.getTransaction().begin();\n \n // remove the relationship\n a1.getBs().remove(b1);\n b1.getAs().remove(a1);\n\n // remove the non-owning side\n em.remove(a1);\n try {\n em.getTransaction().commit();\n } catch (RuntimeException ex) {\n if (em.getTransaction().isActive()) {\n em.getTransaction().rollback();\n }\n em.close();\n \n throw ex;\n }\n \n clearCache();\n \n assertTrue(\"EntityA a1 should have been removed!\", \n em.createQuery(\"SELECT a FROM EntityA a WHERE a.id = ?1\").setParameter(1, idA1).getResultList().size() == 0);\n assertTrue(\"EntityB b1 should not have been removed!\", \n em.createQuery(\"SELECT b FROM EntityB b WHERE b.id = ?1\").setParameter(1, idB1).getResultList().size() != 0);\n\n em.close();\n }", "private void unassignAllSources(Subject subject) {\n subject.getSources().forEach(source -> {\n source.setAssigned(false);\n source.setSubject(null);\n source.setDeleted(true);\n sourceRepository.save(source);\n });\n subject.getSources().clear();\n }" ]
[ "0.62013704", "0.6026708", "0.5791289", "0.5702083", "0.5634145", "0.5581981", "0.55649316", "0.5564393", "0.54370594", "0.5426797", "0.5417833", "0.5302369", "0.5292429", "0.5265178", "0.526267", "0.52620286", "0.5253213", "0.5232699", "0.52255696", "0.52188075", "0.5190005", "0.51770246", "0.5143774", "0.51360774", "0.51194954", "0.5109984", "0.5101822", "0.5097954", "0.508666", "0.5084712", "0.5062133", "0.50454694", "0.50446415", "0.5038862", "0.5032442", "0.50263876", "0.50261134", "0.5023477", "0.5021056", "0.5012129", "0.49922448", "0.49829307", "0.4978438", "0.49773392", "0.49737158", "0.4973257", "0.49701428", "0.49659255", "0.4964885", "0.49438298", "0.49414822", "0.49411538", "0.49389756", "0.49305817", "0.49272677", "0.49212798", "0.49035746", "0.48988795", "0.4895931", "0.48919702", "0.48809004", "0.48741734", "0.4872587", "0.48715585", "0.4865835", "0.48542553", "0.48479638", "0.48463404", "0.48297787", "0.48172784", "0.48136833", "0.4809478", "0.4805055", "0.4804909", "0.48016685", "0.479971", "0.47953132", "0.47890607", "0.4782909", "0.4782011", "0.47785228", "0.47757947", "0.4772824", "0.47721654", "0.4772004", "0.4771264", "0.47710302", "0.4766577", "0.4765181", "0.47649583", "0.47619426", "0.47533342", "0.4752686", "0.47490564", "0.47471943", "0.47462934", "0.4746287", "0.4743654", "0.47430798", "0.47392234" ]
0.6079353
1
Link a subject area to a governance definition that controls how the assets in the subjectArea should be governed.
@SuppressWarnings(value = "unused") public VoidResponse linkSubjectAreaToGovernanceDefinition(String serverName, String userId, String subjectAreaGUID, String definitionGUID, RelationshipRequestBody requestBody) { final String methodName = "linkSubjectAreaToGovernanceDefinition"; final String subjectAreaGUIDParameterName = "subjectAreaGUID"; final String definitionGUIDParameterName = "definitionGUID"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); VoidResponse response = new VoidResponse(); AuditLog auditLog = null; try { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName); if (requestBody != null) { if (requestBody.getProperties() != null) { handler.linkElementToElement(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), definitionGUID, definitionGUIDParameterName, OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME, subjectAreaGUID, subjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, false, false, OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID, OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME, null, requestBody.getProperties().getEffectiveFrom(), requestBody.getProperties().getEffectiveTo(), new Date(), methodName); } else { handler.linkElementToElement(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), definitionGUID, definitionGUIDParameterName, OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME, subjectAreaGUID, subjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, false, false, OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID, OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME, (InstanceProperties) null, null, null, new Date(), methodName); } } else { handler.linkElementToElement(userId, null, null, definitionGUID, definitionGUIDParameterName, OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME, subjectAreaGUID, subjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, false, false, OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID, OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME, (InstanceProperties) null, null, null, new Date(), methodName); } } catch (Exception error) { restExceptionHandler.captureExceptions(response, error, methodName, auditLog); } restCallLogger.logRESTCallReturn(token, response.toString()); return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public SubjectAreaDefinitionResponse getSubjectAreaDefinitionByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \"getSubjectAreaDefinitionByGUID\";\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaDefinitionResponse response = new SubjectAreaDefinitionResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> subjectAreaHandler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n SubjectAreaElement element = subjectAreaHandler.getBeanFromRepository(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n new Date(),\n methodName);\n if (element != null)\n {\n SubjectAreaDefinition subjectAreaDefinition = new SubjectAreaDefinition(element);\n\n subjectAreaDefinition.setParentSubjectAreaGUID(subjectAreaHandler.getSubjectAreaParentGUID(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n subjectAreaDefinition.setNestedSubjectAreaGUIDs(subjectAreaHandler.getSubjectAreaChildrenGUIDs(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n GovernanceDefinitionHandler<GovernanceDefinitionElement> definitionHandler = instanceHandler.getGovernanceDefinitionHandler(userId, serverName, methodName);\n ElementStubConverter<ElementStub> elementStubConverter = instanceHandler.getElementStubConverter(userId, serverName, methodName);\n List<Relationship> relationships = definitionHandler.getGoverningDefinitionLinks(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n 0,\n 0,\n false,\n false,\n new Date(),\n methodName);\n List<ElementStub> definitions = elementStubConverter.getNewBeans(ElementStub.class, relationships, true, methodName);\n subjectAreaDefinition.setAssociatedGovernanceDefinitions(definitions);\n\n response.setProperties(subjectAreaDefinition);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public SubjectareasRecord() {\n\t\tsuper(Subjectareas.SUBJECTAREAS);\n\t}", "@SuppressWarnings(value = \"unused\")\n public VoidResponse unlinkSubjectAreaFromGovernanceDefinition(String serverName,\n String userId,\n String subjectAreaGUID,\n String definitionGUID,\n RelationshipRequestBody requestBody)\n {\n final String methodName = \"unlinkSubjectAreaToGovernanceDefinition\";\n\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n final String definitionGUIDParameterName = \"definitionGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n handler.unlinkElementFromElement(userId,\n false,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n methodName);\n }\n else\n {\n handler.unlinkElementFromElement(userId,\n false,\n null,\n null,\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "org.hl7.fhir.ResourceReference addNewSubject();", "void setSubject(org.hl7.fhir.ResourceReference subject);", "public void addSubject(Subject subject) {\n\t\t\r\n\t}", "public void setAgreement(Agreement agreement) {\n\t\tthis.agreement = agreement;\n\t}", "public void setArea(String area) {\n this.area = area;\n }", "@Override\n\tpublic void createAgence(Agence a) {\n\t\t\n\t}", "public void setSubject(Subject subject);", "public void setArea(String area) {\n this.area = area;\n }", "public void setCourseArea(String courseArea) {\n this.courseArea = courseArea;\n }", "private void addTermsOfLoanAgreement() throws DocumentException {\n paragraph = new Paragraph(CommonString.getTermsOfAgreement(isSwedish), SECTION_TITLE_FONT);\n\n addEmptyLine(paragraph, 1);\n paragraph.add(new Paragraph(CommonString.getLoanPolicy(isSwedish), TEXT_FONT));\n paragraph.add(new Paragraph(CommonString.getPrimaryBorrowerAgreement(isSwedish), TEXT_FONT));\n addEmptyLine(paragraph, 1);\n\n document.add(paragraph);\n adminDocument.add(paragraph);\n }", "public void setArea(String area) {\n\t\tthis.area = area;\n\t}", "@SuppressWarnings(value = \"unused\")\n public VoidResponse linkSubjectAreasInHierarchy(String serverName,\n String userId,\n String parentSubjectAreaGUID,\n String childSubjectAreaGUID,\n RelationshipRequestBody requestBody)\n {\n final String methodName = \"linkSubjectAreasInHierarchy\";\n\n final String parentSubjectAreaGUIDParameterName = \"parentSubjectAreaGUID\";\n final String childSubjectAreaGUIDParameterName = \"childSubjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n if (requestBody.getProperties() != null)\n {\n handler.linkElementToElement(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n parentSubjectAreaGUID,\n parentSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n childSubjectAreaGUID,\n childSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME,\n null,\n requestBody.getProperties().getEffectiveFrom(),\n requestBody.getProperties().getEffectiveTo(),\n new Date(),\n methodName);\n }\n else\n {\n handler.linkElementToElement(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n parentSubjectAreaGUID,\n parentSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n childSubjectAreaGUID,\n childSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME,\n (InstanceProperties) null,\n null,\n null,\n new Date(),\n methodName);\n }\n }\n else\n {\n handler.linkElementToElement(userId,\n null,\n null,\n parentSubjectAreaGUID,\n parentSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n childSubjectAreaGUID,\n childSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME,\n (InstanceProperties) null,\n null,\n null,\n new Date(),\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public void setPersonnelSubArea(String personnelSubArea);", "public void addSubject(Subject s) {\n // TODO implement here\n }", "public void setArea_id(String area_id) {\n this.area_id = area_id;\n }", "public void setDomain(Concept _domain) { domain = _domain; }", "public GUIDResponse createSubjectArea(String serverName,\n String userId,\n ReferenceableRequestBody requestBody)\n {\n final String methodName = \"createSubjectArea\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n GUIDResponse response = new GUIDResponse();\n AuditLog auditLog = null;\n\n try\n {\n if (requestBody != null)\n {\n if (requestBody.getProperties() instanceof SubjectAreaProperties)\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n SubjectAreaProperties properties = (SubjectAreaProperties)requestBody.getProperties();\n\n String subjectAreaGUID = handler.createSubjectArea(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n properties.getQualifiedName(),\n properties.getSubjectAreaName(),\n properties.getDisplayName(),\n properties.getDescription(),\n properties.getUsage(),\n properties.getScope(),\n properties.getDomainIdentifier(),\n properties.getAdditionalProperties(),\n properties.getTypeName(),\n properties.getExtendedProperties(),\n new Date(),\n methodName);\n\n response.setGUID(subjectAreaGUID);\n }\n else\n {\n restExceptionHandler.handleInvalidPropertiesObject(SubjectAreaProperties.class.getName(), methodName);\n }\n }\n else\n {\n restExceptionHandler.handleNoRequestBody(userId, methodName, serverName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public void setPersonnelArea(String personnelArea);", "public void recibirId(AreaInvestigacion a) {\r\n\t\tarea = a;\r\n\t}", "public StudentSubjectLink() {\n this(DSL.name(\"student_subject_link\"), null);\n }", "public VoidResponse addSubjectAreaMemberClassification(String serverName,\n String userId,\n String elementGUID,\n ClassificationRequestBody requestBody)\n {\n final String methodName = \"addSubjectAreaMemberClassification\";\n final String elementGUIDParameterName = \"elementGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n ReferenceableHandler<RelatedElement> handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n if (requestBody.getProperties() instanceof SubjectAreaClassificationProperties)\n {\n SubjectAreaClassificationProperties properties = (SubjectAreaClassificationProperties)requestBody.getProperties();\n\n handler.addSubjectAreaClassification(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n elementGUID,\n elementGUIDParameterName,\n OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME,\n properties.getSubjectAreaName(),\n false,\n false,\n properties.getEffectiveFrom(),\n properties.getEffectiveTo(),\n null,\n methodName);\n }\n else\n {\n restExceptionHandler.handleInvalidPropertiesObject(SubjectAreaClassificationProperties.class.getName(), methodName);\n }\n }\n else\n {\n restExceptionHandler.handleNoRequestBody(userId, methodName, serverName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public void setAreaId(Integer areaId) {\n this.areaId = areaId;\n }", "public void setAreaId(Integer areaId) {\n this.areaId = areaId;\n }", "public interface NonhumanSubjectDataDocumentSection extends org.eclipse.mdht.uml.cda.Section {\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionTemplateId'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.templateId->exists(id : datatypes::II | id.root = \\'2.16.840.1.113883.10.20.23.14\\')'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionTemplateId(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionClassCode'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.classCode=vocab::ActClass::DOCSECT'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionClassCode(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionMoodCode'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.moodCode=vocab::ActMood::EVN'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionMoodCode(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionCodeP'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='(self.code.oclIsUndefined() or self.code.isNullFlavorUndefined()) implies (not self.code.oclIsUndefined())'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionCodeP(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionCode'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='(self.code.oclIsUndefined() or self.code.isNullFlavorUndefined()) implies (not self.code.oclIsUndefined() and self.code.oclIsKindOf(datatypes::CE) and \\nlet value : datatypes::CE = self.code.oclAsType(datatypes::CE) in \\nvalue.code = \\'NHStbd\\' and value.codeSystem = \\'2.16.840.1.113883.3.26.1.1\\')'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionCode(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionText'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='not self.text.oclIsUndefined()'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionText(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionTitle'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='(self.title.oclIsUndefined() or self.title.isNullFlavorUndefined()) implies (not self.title.oclIsUndefined())'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionTitle(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionNon-human Subject Demographics'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->one(entry : cda::Entry | not entry.act.oclIsUndefined() and entry.act.oclIsKindOf(sdtm::NonhumanSubjectDemographics) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionNonhumanSubjectDemographics(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionNon-human Disposition'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->one(entry : cda::Entry | not entry.act.oclIsUndefined() and entry.act.oclIsKindOf(sdtm::NonhumanDisposition) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionNonhumanDisposition(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionSubject Element'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.act.oclIsUndefined() and entry.act.oclIsKindOf(sdtm::SubjectElement) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionSubjectElement(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionNon-human Exposure'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.substanceAdministration.oclIsUndefined() and entry.substanceAdministration.oclIsKindOf(sdtm::NonhumanExposure) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionNonhumanExposure(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionBody Weight'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::BodyWeight) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionBodyWeight(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionBody Weight Gain'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::BodyWeightGain) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionBodyWeightGain(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionClinical Observation'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::ClinicalObservation) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionClinicalObservation(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionDeath Diagnosis'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->one(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::DeathDiagnosis) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionDeathDiagnosis(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionFood and Water Consumption'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::FoodandWaterConsumption) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionFoodandWaterConsumption(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionNon-human Laboratory Test Result'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::NonhumanLaboratoryTestResult) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionNonhumanLaboratoryTestResult(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionMacroscopic Finding'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::MacroscopicFinding) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionMacroscopicFinding(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionMicroscopic Findings'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::MicroscopicFinding) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionMicroscopicFindings(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionOrgan Measurement'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::OrganMeasurement) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionOrganMeasurement(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionPalpable Mass'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::PalpableMass) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionPalpableMass(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionPharmacokinetic Concentration Finding'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::PharmacokineticConcentrationFinding) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionPharmacokineticConcentrationFinding(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionSubject Characteristic'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::SubjectCharacteristic) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionSubjectCharacteristic(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionTumor Finding'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::TumorFinding) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionTumorFinding(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionVital Sign'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::VitalSign) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionVitalSign(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionECG Test Result'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::ECGTestResult) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionECGTestResult(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionStudy Subject Event'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::StudySubjectEvent) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionStudySubjectEvent(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionStudy Subject Finding'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::StudySubjectFinding) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionStudySubjectFinding(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionStudy Subject Intervention'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.substanceAdministration.oclIsUndefined() and entry.substanceAdministration.oclIsKindOf(sdtm::StudySubjectIntervention) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionStudySubjectIntervention(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionComment'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::Comment) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionComment(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='Non-human Subject Data Document SectionPharmacokinetic Parameter Finding'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.nullFlavor <> vocab::NullFlavor::NI implies entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(sdtm::PharmacokineticParameterFinding) and entry.typeCode = vocab::x_ActRelationshipEntry::COMP)'\"\n\t * @generated\n\t */\n\tboolean validateNonhumanSubjectDataDocumentSectionPharmacokineticParameterFinding(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getNon-human Subject Demographics'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getActs()->select(act : cda::Act | not act.oclIsUndefined() and act.oclIsKindOf(sdtm::NonhumanSubjectDemographics))->asSequence()->any(true).oclAsType(sdtm::NonhumanSubjectDemographics)'\"\n\t * @generated\n\t */\n\tNonhumanSubjectDemographics getNonhumanSubjectDemographics();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getNon-human Disposition'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getActs()->select(act : cda::Act | not act.oclIsUndefined() and act.oclIsKindOf(sdtm::NonhumanDisposition))->asSequence()->any(true).oclAsType(sdtm::NonhumanDisposition)'\"\n\t * @generated\n\t */\n\tNonhumanDisposition getNonhumanDisposition();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getSubject Elements'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getActs()->select(act : cda::Act | not act.oclIsUndefined() and act.oclIsKindOf(sdtm::SubjectElement)).oclAsType(sdtm::SubjectElement)'\"\n\t * @generated\n\t */\n\tEList<SubjectElement> getSubjectElements();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getNon-human Exposures'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getSubstanceAdministrations()->select(substanceAdministration : cda::SubstanceAdministration | not substanceAdministration.oclIsUndefined() and substanceAdministration.oclIsKindOf(sdtm::NonhumanExposure)).oclAsType(sdtm::NonhumanExposure)'\"\n\t * @generated\n\t */\n\tEList<NonhumanExposure> getNonhumanExposures();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getBody Weights'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::BodyWeight)).oclAsType(sdtm::BodyWeight)'\"\n\t * @generated\n\t */\n\tEList<BodyWeight> getBodyWeights();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getBody Weight Gains'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::BodyWeightGain)).oclAsType(sdtm::BodyWeightGain)'\"\n\t * @generated\n\t */\n\tEList<BodyWeightGain> getBodyWeightGains();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getClinical Observations'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::ClinicalObservation)).oclAsType(sdtm::ClinicalObservation)'\"\n\t * @generated\n\t */\n\tEList<ClinicalObservation> getClinicalObservations();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getDeath Diagnosis'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::DeathDiagnosis))->asSequence()->any(true).oclAsType(sdtm::DeathDiagnosis)'\"\n\t * @generated\n\t */\n\tDeathDiagnosis getDeathDiagnosis();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getFood and Water Consumptions'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::FoodandWaterConsumption)).oclAsType(sdtm::FoodandWaterConsumption)'\"\n\t * @generated\n\t */\n\tEList<FoodandWaterConsumption> getFoodandWaterConsumptions();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getNon-human Laboratory Test Results'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::NonhumanLaboratoryTestResult)).oclAsType(sdtm::NonhumanLaboratoryTestResult)'\"\n\t * @generated\n\t */\n\tEList<NonhumanLaboratoryTestResult> getNonhumanLaboratoryTestResults();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getMacroscopic Findings'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::MacroscopicFinding)).oclAsType(sdtm::MacroscopicFinding)'\"\n\t * @generated\n\t */\n\tEList<MacroscopicFinding> getMacroscopicFindings();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getMicroscopic Findingss'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::MicroscopicFinding)).oclAsType(sdtm::MicroscopicFinding)'\"\n\t * @generated\n\t */\n\tEList<MicroscopicFinding> getMicroscopicFindingss();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getOrgan Measurements'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::OrganMeasurement)).oclAsType(sdtm::OrganMeasurement)'\"\n\t * @generated\n\t */\n\tEList<OrganMeasurement> getOrganMeasurements();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getPalpable Masss'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::PalpableMass)).oclAsType(sdtm::PalpableMass)'\"\n\t * @generated\n\t */\n\tEList<PalpableMass> getPalpableMasss();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getPharmacokinetic Concentration Findings'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::PharmacokineticConcentrationFinding)).oclAsType(sdtm::PharmacokineticConcentrationFinding)'\"\n\t * @generated\n\t */\n\tEList<PharmacokineticConcentrationFinding> getPharmacokineticConcentrationFindings();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getSubject Characteristics'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::SubjectCharacteristic)).oclAsType(sdtm::SubjectCharacteristic)'\"\n\t * @generated\n\t */\n\tEList<SubjectCharacteristic> getSubjectCharacteristics();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getTumor Findings'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::TumorFinding)).oclAsType(sdtm::TumorFinding)'\"\n\t * @generated\n\t */\n\tEList<TumorFinding> getTumorFindings();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getVital Signs'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::VitalSign)).oclAsType(sdtm::VitalSign)'\"\n\t * @generated\n\t */\n\tEList<VitalSign> getVitalSigns();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getECG Test Results'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::ECGTestResult)).oclAsType(sdtm::ECGTestResult)'\"\n\t * @generated\n\t */\n\tEList<ECGTestResult> getECGTestResults();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getStudy Subject Events'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::StudySubjectEvent)).oclAsType(sdtm::StudySubjectEvent)'\"\n\t * @generated\n\t */\n\tEList<StudySubjectEvent> getStudySubjectEvents();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getStudy Subject Findings'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::StudySubjectFinding)).oclAsType(sdtm::StudySubjectFinding)'\"\n\t * @generated\n\t */\n\tEList<StudySubjectFinding> getStudySubjectFindings();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getStudy Subject Interventions'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getSubstanceAdministrations()->select(substanceAdministration : cda::SubstanceAdministration | not substanceAdministration.oclIsUndefined() and substanceAdministration.oclIsKindOf(sdtm::StudySubjectIntervention)).oclAsType(sdtm::StudySubjectIntervention)'\"\n\t * @generated\n\t */\n\tEList<StudySubjectIntervention> getStudySubjectInterventions();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::Comment)).oclAsType(sdtm::Comment)'\"\n\t * @generated\n\t */\n\tEList<Comment> getComments();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/2.0.0/UML originalName='getPharmacokinetic Parameter Findings'\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(sdtm::PharmacokineticParameterFinding)).oclAsType(sdtm::PharmacokineticParameterFinding)'\"\n\t * @generated\n\t */\n\tEList<PharmacokineticParameterFinding> getPharmacokineticParameterFindings();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tpublic NonhumanSubjectDataDocumentSection init();\n /**\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @generated\n */\n public NonhumanSubjectDataDocumentSection init(Iterable<? extends org.eclipse.mdht.emf.runtime.util.Initializer<? extends EObject>> initializers);\n}", "public void addSubject(Subject subject) {\n\t\tsub_dao.addSubject(subject);\r\n\t\t\r\n\t}", "public void setAcademicRequirements(String academicRequirements) {\r\n this.academicRequirements = academicRequirements;\r\n }", "public void setSubject(Name subject) {\r\n this.subject = subject;\r\n }", "public AreaInfoExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public AssignmentBundle(AssignmentOutline receivedOutline){\n\n this.name = receivedOutline.getName();\n this.outline = receivedOutline;\n }", "public void setAreaName(String areaName) {\n this.areaName = areaName;\n }", "public void setAreaName(String areaName) {\n this.areaName = areaName;\n }", "@Override\r\n\tpublic DTextArea setHtmlSubject(final String subject) {\r\n\t\tsuper.setHtmlSubject(subject) ;\r\n\t\treturn this ;\r\n\t}", "public void setArea(Polygon area) {\n\t\tthis.area = area;\n\t}", "public String getCourseArea() {\n return courseArea;\n }", "public StudyArea(String name, String address, String faculty, boolean hasPort,\n boolean isIndoor, int maxPax) {\n this.name = name;\n this.address = address.trim();\n this.faculty = faculty;\n this.hasPort = hasPort;\n this.isIndoor = isIndoor;\n this.maxPax = maxPax;\n }", "public Resolution linkToOrganization() {\r\n Organization o = this.myIsern.getSingleOrganization(this.linkItem);\r\n if (o == null) {\r\n this.name = this.linkItem;\r\n this.added = false;\r\n return new RedirectResolution(ADD_ORG_PAGE).flash(this);\r\n }\r\n else {\r\n this.name = this.linkItem;\r\n this.type = o.getType();\r\n this.contact = o.getContact();\r\n \r\n this.affiliatedResearchers = \r\n this.converter.listToString(o.getAffiliatedResearchers().getAffiliatedResearcher());\r\n \r\n this.country = o.getCountry();\r\n \r\n this.researchKeywords = \r\n this.converter.listToString(o.getResearchKeywords().getResearchKeyword());\r\n \r\n this.researchDescription = o.getResearchDescription();\r\n this.homePage = o.getHomePage();\r\n \r\n this.edited = false;\r\n this.editing = true;\r\n return new RedirectResolution(EDIT_ORG_PAGE).flash(this);\r\n }\r\n }", "private void _generateATa(TaInfo ta) {\n\t String id = _getId(CS_C_GRADSTUD, ta.indexInGradStud);\n writer_.startAboutSection(CS_C_TA, id);\n if(globalVersionTrigger){\t \t \n \t writer_log.addPropertyInstance(id, RDF.type.getURI(), ontology+\"#TeachingAssistant\", true);\t \t \t \t \n }\n writer_.addProperty(CS_P_TAOF, _getId(CS_C_COURSE, ta.indexInCourse), true);\n if(globalVersionTrigger){\t \t \n \t writer_log.addPropertyInstance(id, ontology+\"#teachingAssistantOf\", _getId(CS_C_COURSE, ta.indexInCourse), true);\t \t \t \t \n }\n writer_.endSection(CS_C_TA);\n }", "public void setSubject(String subject)\n {\n _subject = subject;\n }", "public void add(Subject e) {\n\t\tsubjectdao.add(e);\n\t}", "public VoidResponse updateSubjectArea(String serverName,\n String userId,\n String subjectAreaGUID,\n boolean isMergeUpdate,\n ReferenceableRequestBody requestBody)\n {\n final String methodName = \"updateSubjectArea\";\n final String guidParameter = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n if (requestBody != null)\n {\n if (requestBody.getProperties() instanceof SubjectAreaProperties)\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n SubjectAreaProperties properties = (SubjectAreaProperties)requestBody.getProperties();\n\n handler.updateSubjectArea(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n subjectAreaGUID,\n guidParameter,\n properties.getQualifiedName(),\n properties.getSubjectAreaName(),\n properties.getDisplayName(),\n properties.getDescription(),\n properties.getUsage(),\n properties.getScope(),\n properties.getDomainIdentifier(),\n properties.getAdditionalProperties(),\n properties.getTypeName(),\n properties.getExtendedProperties(),\n isMergeUpdate,\n methodName);\n }\n else\n {\n restExceptionHandler.handleInvalidPropertiesObject(SubjectAreaProperties.class.getName(), methodName);\n }\n }\n else\n {\n restExceptionHandler.handleNoRequestBody(userId, methodName, serverName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public void setAuthorizedArea(String value) {\n setAttributeInternal(AUTHORIZEDAREA, value);\n }", "public interface EntityOrAssetRule extends Rule {\n /**\n * Return the component id of the Entity or Asset that this rule should\n * belong to.\n * @return The component id.\n */\n public String getComponentId();\n \n /**\n * Given a mission objective and a system, find the corresponding component\n * to this rule, and add this rule to that component.\n * @param objective The mission objective.\n * @param system The system containing the component for this rule.\n */\n public void addToComponent(String objective, OpSystem system);\n}", "org.hl7.fhir.ResourceReference getSubject();", "@Test\n public void testProcessProtocolResearchAreaBusinessRules() throws Exception {\n ProtocolDocument document = getNewProtocolDocument();\n setProtocolRequiredFields(document);\n // check case 1\n assertTrue(rule.processProtocolResearchAreaBusinessRules(document));\n \n // check case 2\n ProtocolResearchArea dummyPRA0 = new ProtocolResearchArea();\n ResearchArea dummyRA0 = new ResearchArea();\n dummyRA0.setActive(true);\n dummyPRA0.setResearchAreas(dummyRA0);\n \n ProtocolResearchArea dummyPRA1 = new ProtocolResearchArea();\n ResearchArea dummyRA1 = new ResearchArea();\n dummyRA1.setActive(true);\n dummyPRA1.setResearchAreas(dummyRA1);\n \n ProtocolResearchArea dummyPRA2 = new ProtocolResearchArea();\n ResearchArea dummyRA2 = new ResearchArea();\n dummyRA2.setActive(true);\n dummyPRA2.setResearchAreas(dummyRA2);\n \n ProtocolResearchArea dummyPRA3 = new ProtocolResearchArea();\n ResearchArea dummyRA3 = new ResearchArea();\n dummyRA3.setActive(true);\n dummyPRA3.setResearchAreas(dummyRA3);\n \n List<ProtocolResearchAreaBase> pras = new ArrayList<ProtocolResearchAreaBase>();\n pras.add(dummyPRA0);\n pras.add(dummyPRA1);\n pras.add(dummyPRA2);\n pras.add(dummyPRA3);\n \n document.getProtocol().setProtocolResearchAreas(pras);\n \n assertTrue(document.getProtocol().getProtocolResearchAreas(0).getResearchAreas().isActive());\n assertTrue(document.getProtocol().getProtocolResearchAreas(1).getResearchAreas().isActive());\n assertTrue(document.getProtocol().getProtocolResearchAreas(2).getResearchAreas().isActive());\n assertTrue(document.getProtocol().getProtocolResearchAreas(3).getResearchAreas().isActive());\n \n assertTrue(rule.processProtocolResearchAreaBusinessRules(document));\n \n // check case 3\n assertTrue(document.getProtocol().getProtocolResearchAreas(0).getResearchAreas().isActive());\n \n dummyRA1.setActive(false);\n assertFalse(document.getProtocol().getProtocolResearchAreas(1).getResearchAreas().isActive());\n \n assertTrue(document.getProtocol().getProtocolResearchAreas(2).getResearchAreas().isActive());\n \n dummyRA3.setActive(false);\n assertFalse(document.getProtocol().getProtocolResearchAreas(3).getResearchAreas().isActive());\n \n assertFalse(rule.processProtocolResearchAreaBusinessRules(document));\n String errorPropertyKey = INACTIVE_RESEARCH_AREAS_PREFIX + SEPERATOR + \"1.3.\";\n assertError(errorPropertyKey, KeyConstants.ERROR_PROTOCOL_RESEARCH_AREA_INACTIVE);\n }", "public interface AreaOccupier {\n}", "public SafetyNetArea createArea(SafetyNetArea area) {\n\n String typeId = area.getPromulgationType().getTypeId();\n log.info(\"Creating SafetyNET area \" + area.getName() + \" for promulgation type \" + typeId);\n\n area.setPromulgationType(promulgationTypeService.getPromulgationType(typeId));\n return saveEntity(area);\n }", "private void mapAreaOne()\n\n {\n\n Area area = areaIDMap.get(Constants.FIRST_AREA_ID);\n\n area.areaMap.put(Constants.North, areaIDMap.get(Constants.SECOND_AREA_ID));\n\n area.areaMap.put(Constants.South, areaIDMap.get(Constants.FIFTH_AREA_ID));\n\n area.areaMap.put(Constants.East, areaIDMap.get(Constants.FOURTH_AREA_ID));\n\n area.areaMap.put(Constants.West, areaIDMap.get(Constants.SIXTH_AREA_ID));\n\n area.paths = Constants.NorthSouthEastAndWest;\n\n }", "public RoomAreaDoExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "org.hl7.fhir.CodeableConcept addNewBodySite();", "public void setSubject(Subject subject) {\n\t\tthis.subject = subject;\n\t}", "public void changeSubject(String a) {\r\n subject = a;\r\n }", "public interface IBuildingBoundariesRuleBook extends RuleBook {\n}", "protected abstract void defineConstraints();", "public void setSrcAreaOfExpertise(String value) {\r\n setAttributeInternal(SRCAREAOFEXPERTISE, value);\r\n }", "DomainConcept createDomainConcept();", "protected void generateSubject() {\n codegen.gen(expression.getSubjectExpression(), subjectType);\n }", "public SubjectAreaResponse getSubjectAreaByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \"getSubjectAreaByGUID\";\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaResponse response = new SubjectAreaResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n response.setElement(handler.getBeanFromRepository(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n new Date(),\n methodName));\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public void setSubject(List<String> subject) {\n\t this.subject = subject;\n\t}", "public abstract Area newArea();", "Course(Subject subject){\n \t\tthis.subject = subject;\n\t\tdaysToRun = subject.getDuration();\n\t\tenrolled = new ArrayList<Student>();\n\t\tcancelled = false;\n\t\tfinished = false;\n \t}", "public static void main(String[] args) \r\n\t{\nBAssociation b= new BAssociation();\r\nb.a= new Aassociation();\r\nb.a.areaofRectangle(5, 6);\r\n\t\t\r\n\t}", "public void setSubject(String subject) {\n this.subject = subject;\n }", "public void setSubject(String subject) {\n this.subject = subject;\n }", "@Override\n\tpublic void visit(OWLObjectPropertyAssertionAxiom axiom) {\n\n\t\taddFact(RewritingVocabulary.TRIPLE, //\n\t\t\t\taxiom.getSubject().asOWLNamedIndividual().getIRI(), //\n\t\t\t\taxiom.getProperty().asOWLObjectProperty().getIRI(), //\n\t\t\t\taxiom.getObject().asOWLNamedIndividual().getIRI() //\n\t\t);\n\t}", "public void setAssesment(Assessment assesment) {\n this.assessment = assesment;\n }", "@Test\n\tpublic void driverAssignArea() {\n\t\tfinal Object testingData[][] = {\n\n\t\t\t{\n\t\t\t\t\"chapter3\", \"area3\", null\n\t\t\t},//1. All fine\n\t\t\t{\n\t\t\t\t\"chapter1\", \"area3\", IllegalArgumentException.class\n\t\t\t},//2. A Chapter who have an area, self-assing another area\n\n\t\t};\n\n\t\tfor (int i = 0; i < testingData.length; i++)\n\t\t\tthis.templateAssignArea((String) testingData[i][0], (String) testingData[i][1], (Class<?>) testingData[i][2]);\n\n\t}", "public String getArea_id() {\n return area_id;\n }", "public Agreement getAgreement() {\n\t\treturn this.agreement;\n\t}", "public void addResearchCompany(ResearchCompany rc) {\r\n\t\ttry{\r\n\t\t\tcompanyDirectory.add(rc);\r\n\t\t} catch(IllegalArgumentException e) {\r\n\t\t\tthrow new IllegalArgumentException(e.getMessage());\r\n\t\t}\r\n\t\t\r\n\t}", "public String getSubjectOfBiography() {return subjectOfBiography;}", "RentalAgency createRentalAgency();", "@Override\n\t@XmlElement\n\tpublic void setAreaCode(String areaCode) {\n\t\t\n\t}", "public StudentSubjectLink(String alias) {\n this(DSL.name(alias), STUDENT_SUBJECT_LINK);\n }", "public void addBusinessFilterToReferencedLink(ViewerFilter filter);", "public AccrualRule(){}", "@ManyToOne(optional = true)\r\n\tpublic Area getArea() {\r\n\t\treturn this.area;\r\n\t}", "void addAssociation(AssociationEnd association);", "public void setAreaOfInterest(ReferencedEnvelope aoe) {\n PBounds cRect = getCamera().getViewBounds();\n ReferencedEnvelope envelope = new ReferencedEnvelope(getCRS());\n\n double dx = aoe.getWidth() / cRect.getWidth();\n double dy = aoe.getHeight() / cRect.getHeight();\n\n double scale;\n double wid, hi;\n if (dx > dy) {\n scale = dx;\n } else { //dy > dx\n scale = dy;\n }\n wid = scale * cRect.getWidth();\n hi = scale * cRect.getHeight();\n\n double w2 = wid / 2.0;\n double h2 = hi / 2.0;\n\n envelope.init(aoe.getMedian(0) - w2, aoe.getMedian(0) + w2, aoe.getMedian(1) - h2, aoe.getMedian(1) + h2);\n setAreaOfInterest_preScaled(envelope);\n }", "public void setAreaCode(String areaCode) {\n this.areaCode = areaCode;\n }", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "@Override\n\tpublic void updateAgence(Agence a) {\n\t\t\n\t}", "public StudentSubjectLink(Name alias) {\n this(alias, STUDENT_SUBJECT_LINK);\n }", "Builder addCopyrightHolder(Organization value);", "public void configure(final CourseProposalController layout) {\n type = \"course\";\n state = DtoConstants.STATE_DRAFT;\n groupName = LUUIConstants.COURSE_GROUP_NAME;\n\n if (modelDefinition.getMetadata().isCanEdit()) {\n addCluStartSection(layout);\n String sections = getLabel(LUUIConstants.COURSE_SECTIONS);\n\n //ProposalInformation\n //layout.addSection(new String[] {editTabLabel, getLabel(LUConstants.PROPOSAL_INFORMATION_LABEL_KEY)}, generateAuthorsRationaleSection());\n\n layout.addMenu(sections);\n\n\n //Course Content\n layout.addMenuItem(sections, (SectionView) generateCourseInfoSection(initSectionView(CourseSections.COURSE_INFO, LUUIConstants.INFORMATION_LABEL_KEY)));\n layout.addMenuItem(sections, (SectionView) generateGovernanceSection(initSectionView(CourseSections.GOVERNANCE, LUUIConstants.GOVERNANCE_LABEL_KEY)));\n layout.addMenuItem(sections, (SectionView) generateCourseLogisticsSection(initSectionView(CourseSections.COURSE_LOGISTICS, LUUIConstants.LOGISTICS_LABEL_KEY)));\n layout.addMenuItem(sections, generateLearningObjectivesSection());\n\n //Student Eligibility\n layout.addMenuItem(sections, generateCourseRequisitesSection(layout, true));\n\n //Administrative\n layout.addMenuItem(sections, (SectionView) generateActiveDatesSection(initSectionView(CourseSections.ACTIVE_DATES, LUUIConstants.ACTIVE_DATES_LABEL_KEY)));\n layout.addMenuItem(sections, (SectionView) generateFinancialsSection(initSectionView(CourseSections.FINANCIALS, LUUIConstants.FINANCIALS_LABEL_KEY)));\n\n //Authors & Collaborators\n layout.addMenuItem(sections, new CollaboratorSectionView(CourseSections.PEOPLE_PERMISSONS, getLabel(LUUIConstants.SECTION_AUTHORS_AND_COLLABORATORS), COURSE_PROPOSAL_MODEL));\n\n //Documents\n documentTool = new DocumentTool(LUUIConstants.REF_DOC_RELATION_PROPOSAL_TYPE, CourseSections.DOCUMENTS, getLabel(LUUIConstants.TOOL_DOCUMENTS_LABEL_KEY));\n documentTool.setModelDefinition((DataModelDefinition) modelDefinition);\n layout.addMenuItem(sections, documentTool);\n\n //Summary\n summaryConfigurer = GWT.create(CourseSummaryConfigurer.class);\n summaryConfigurer.init(type, state, groupName, (DataModelDefinition) modelDefinition, stmtTypes, (Controller) layout, COURSE_PROPOSAL_MODEL);\n layout.addSpecialMenuItem(summaryConfigurer.generateProposalSummarySection(true), \"Review and Submit\");\n\n //Add common buttons to sections except for sections with specific button behavior\n List<Enum<?>> excludedViews = new ArrayList<Enum<?>>();\n excludedViews.add(CourseSections.DOCUMENTS);\n excludedViews.add(CourseSections.COURSE_REQUISITES);\n layout.addCommonButton(LUUIConstants.COURSE_SECTIONS, layout.getSaveButton(), excludedViews);\n layout.addCommonButton(LUUIConstants.COURSE_SECTIONS, layout.getCancelButton(CourseSections.SUMMARY), excludedViews);\n\n //Specific buttons for certain views\n //TODO people and permissions will use a different button than continue\n layout.addButtonForView(CourseSections.DOCUMENTS, getContinueButton(layout));\n } else {\n summaryConfigurer = GWT.create(CourseSummaryConfigurer.class);\n summaryConfigurer.init(type, state, groupName, (DataModelDefinition) modelDefinition, stmtTypes, (Controller) layout, COURSE_PROPOSAL_MODEL);\n layout.removeMenuNavigation();\n layout.addView(summaryConfigurer.generateProposalSummarySection(false));\n }\n layout.showPrint(true);\n layout.setDefaultView(CourseSections.SUMMARY);\n layout.addContentWidget(layout.getWfUtilities().getProposalStatusLabel());\n final CommentTool commentTool = new CommentTool(CourseSections.COMMENTS, getLabel(LUUIConstants.TOOL_COMMENTS_LABEL_KEY), \"kuali.comment.type.generalRemarks\", \"Proposal Comments\");\n commentTool.setController(layout);\n\n layout.addContentWidget(new KSButton(\"Comments\", ButtonStyle.DEFAULT_ANCHOR, new ClickHandler() {\n\n @Override\n public void onClick(ClickEvent event) {\n commentTool.show();\n }\n }));\n\n\n final DecisionPanel decisionPanel = new DecisionPanel(CourseSections.DECISIONS, getLabel(LUUIConstants.TOOL_DECISION_LABEL_KEY), \"kuali.comment.type.generalRemarks\");\n layout.addView(decisionPanel);\n layout.addContentWidget(new KSButton(\"Decisions\", ButtonStyle.DEFAULT_ANCHOR, new ClickHandler() {\n\n @Override\n public void onClick(ClickEvent event) {\n decisionPanel.show();\n }\n }));\n\n }", "AREA createAREA();" ]
[ "0.58370477", "0.55527776", "0.5449102", "0.54165924", "0.5388373", "0.5146859", "0.5124984", "0.51085216", "0.5106169", "0.50933254", "0.5090245", "0.50737303", "0.5038639", "0.49586785", "0.49063617", "0.48667303", "0.48621497", "0.48343104", "0.48048252", "0.47416204", "0.47246283", "0.4703283", "0.46756434", "0.46680823", "0.46630096", "0.46630096", "0.46575165", "0.46568358", "0.46476546", "0.4640177", "0.46256894", "0.462004", "0.46159852", "0.46159852", "0.4611064", "0.4609491", "0.46000183", "0.45914868", "0.45899716", "0.45815584", "0.45719093", "0.45620292", "0.45515928", "0.45513564", "0.45507544", "0.45489955", "0.4546945", "0.45413285", "0.45369777", "0.45146787", "0.45138478", "0.45093268", "0.4507066", "0.45015636", "0.44934753", "0.44932902", "0.44771278", "0.44739127", "0.4471022", "0.44676435", "0.44573018", "0.44548118", "0.44547558", "0.44419113", "0.4441014", "0.4441014", "0.4432537", "0.44160214", "0.4409778", "0.4397347", "0.43919605", "0.43911883", "0.43858194", "0.43812513", "0.43751293", "0.4373716", "0.43734944", "0.43732873", "0.43702495", "0.43661952", "0.43626067", "0.4357564", "0.43544656", "0.43544656", "0.43544656", "0.43544656", "0.43544656", "0.43544656", "0.43544656", "0.43544656", "0.43544656", "0.43544656", "0.43544656", "0.43544656", "0.43544656", "0.43506", "0.43455064", "0.4343192", "0.43396038", "0.43368918" ]
0.6726549
0
Remove the link between a subjectArea and a governance definition.
@SuppressWarnings(value = "unused") public VoidResponse unlinkSubjectAreaFromGovernanceDefinition(String serverName, String userId, String subjectAreaGUID, String definitionGUID, RelationshipRequestBody requestBody) { final String methodName = "unlinkSubjectAreaToGovernanceDefinition"; final String subjectAreaGUIDParameterName = "subjectAreaGUID"; final String definitionGUIDParameterName = "definitionGUID"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); VoidResponse response = new VoidResponse(); AuditLog auditLog = null; try { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName); if (requestBody != null) { handler.unlinkElementFromElement(userId, false, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), definitionGUID, definitionGUIDParameterName, OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME, subjectAreaGUID, subjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, false, false, OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID, OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME, null, methodName); } else { handler.unlinkElementFromElement(userId, false, null, null, definitionGUID, definitionGUIDParameterName, OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME, subjectAreaGUID, subjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, false, false, OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID, OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME, null, methodName); } } catch (Exception error) { restExceptionHandler.captureExceptions(response, error, methodName, auditLog); } restCallLogger.logRESTCallReturn(token, response.toString()); return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void deleteAgence(Agence a) {\n\t\t\n\t}", "public void removeRuleRef(org.semanticwb.model.RuleRef value);", "@Test\n\tpublic void testRemoveLinkComponentDeleteOrphanedFromDoc() {\n\t\tAddressBook adrbook = new AddressBook();\n\t\tDocument doc = new Document(adrbook);\n\t\tAssert.assertSame(doc.findBeansByType(\"org.rapidbeans.test.codegen.AddressBook\").get(0), doc.getRoot());\n\t\tPerson martin = new Person(new String[] { \"Bl�mel\", \"Martin\", \"19641014\" });\n\t\tadrbook.addPerson(martin);\n\t\tAssert.assertSame(martin, ((ReadonlyListCollection<?>) adrbook.getPersons()).get(0));\n\t\tAssert.assertSame(martin, doc.findBeansByType(\"org.rapidbeans.test.codegen.Person\").get(0));\n\t\tAddress fasanstreet = new Address();\n\t\tfasanstreet.setStreet(\"Fasanenstra�e\");\n\t\tadrbook.addAddress(fasanstreet);\n\t\tAssert.assertNull(fasanstreet.getInhabitants());\n\t\tfasanstreet.addInhabitant(martin);\n\t\tAssert.assertEquals(1, fasanstreet.getInhabitants().size());\n\t\tAssert.assertSame(fasanstreet, martin.getAddress());\n\t\tadrbook.removeAddress(fasanstreet);\n\t\tAssert.assertEquals(0, fasanstreet.getInhabitants().size());\n\t}", "public void deletelink(Integer linkId);", "public void removeAllRuleRef();", "@SuppressWarnings(value = \"unused\")\n public VoidResponse linkSubjectAreaToGovernanceDefinition(String serverName,\n String userId,\n String subjectAreaGUID,\n String definitionGUID,\n RelationshipRequestBody requestBody)\n {\n final String methodName = \"linkSubjectAreaToGovernanceDefinition\";\n\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n final String definitionGUIDParameterName = \"definitionGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n if (requestBody.getProperties() != null)\n {\n handler.linkElementToElement(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n requestBody.getProperties().getEffectiveFrom(),\n requestBody.getProperties().getEffectiveTo(),\n new Date(),\n methodName);\n }\n else\n {\n handler.linkElementToElement(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n (InstanceProperties) null,\n null,\n null,\n new Date(),\n methodName);\n }\n }\n else\n {\n handler.linkElementToElement(userId,\n null,\n null,\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n (InstanceProperties) null,\n null,\n null,\n new Date(),\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public void secondaryRemoveLeaseRules(com.hps.july.persistence.LeaseRule aLeaseRules) {\n\tthis.getLeaseRulesLink().secondaryRemoveElement(aLeaseRules);\n}", "public void onUnlink()\n {\n getTextArea().setFocus(true);\n// clientJupiter.generate(treeOperationFactory.createLink(clientJupiter.getSiteId(),\n// getTextArea().getDocument().getSelection().getRangeAt(0), linkConfig.getUrl()));\n Console.getInstance().log(\"RTP: onUnlink\");\n }", "@Override\n public void deleteRuleAR() {\n }", "public void unassociate(Node otherNode, QName associationTypeQName, Directionality directionality);", "public void removeSemanticLink(IBusinessObject dest, LinkKind type)\n throws OculusException;", "public void unsetRoadwayRef()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(ROADWAYREF$16);\r\n }\r\n }", "public void _unlinkAttributeDef(AttributeDef attributeDef1)\n {\n attributeDef.remove(attributeDef1);\n ch.ehi.uml1_4.changepropagation.MetaModel.getInstance().notifyChange(new ch.ehi.uml1_4.changepropagation.MetaModelChange(this,\"_unlinkAttributeDef\"));\n return;\n }", "boolean removeLink(Link link);", "boolean removeAssociation(AssociationEnd association);", "@Override\n public void deleteVisRuleAR() {\n }", "public void unsetObservationDataLink()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(OBSERVATIONDATALINK$18);\r\n }\r\n }", "@PostMapping(path = \"/governance-metrics/{metricGUID}/governance-definitions/{governanceDefinitionGUID}/unlink\")\n\n public VoidResponse clearGovernanceDefinitionMetric(@PathVariable String serverName,\n @PathVariable String userId,\n @PathVariable String metricGUID,\n @PathVariable String governanceDefinitionGUID,\n @RequestBody RelationshipRequestBody requestBody)\n {\n return restAPI.clearGovernanceDefinitionMetric(serverName, userId, metricGUID, governanceDefinitionGUID, requestBody);\n }", "void unsetFurtherRelations();", "void clearAssociations();", "public void delIncomingRelations();", "public void delRelations();", "private void linkRemoved(Link link) {\n\n\t}", "public void unassociate(Node targetNode, QName associationTypeQName);", "public void removeDefense(){\n\t\tcurrentConstruct = null;\n\t\thasDefenseObject = false;\n\t}", "private void removeArea() {\n \t\tthis.set.remove( this.area );\n \t\tthis.finish();\n \t}", "public void unsetIntersectingRoadwayRef()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(INTERSECTINGROADWAYREF$20);\r\n }\r\n }", "@Override\n\tpublic int delLink(Link link) {\n\t\treturn 0;\n\t}", "void unsetBranchOfficeList();", "public void deleteLink(IHyperLink link)\n throws OculusException;", "public abstract void remove(SubArea selectedSubArea);", "public void removeAgent() {agent = null;}", "void deleteByOrgId(String csaOrgId);", "public void delete()\n throws ROSRSException {\n annotation.deletePropertyValues(subject, property, merge ? null : value);\n if (annotation.getStatements().isEmpty()) {\n annotation.delete();\n } else {\n annotation.update();\n }\n value = null;\n }", "public void removeFromLinesOfBusiness(entity.AppCritLineOfBusiness element);", "public VoidResponse deleteSubjectAreaMemberClassification(String serverName,\n String userId,\n String elementGUID,\n ExternalSourceRequestBody requestBody)\n {\n final String methodName = \"deleteSubjectAreaMemberClassification\";\n final String elementGUIDParameterName = \"elementGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n ReferenceableHandler<RelatedElement> handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n handler.removeSubjectAreaClassification(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n elementGUID,\n elementGUIDParameterName,\n OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME,\n false,\n false,\n null,\n methodName);\n }\n else\n {\n handler.removeSubjectAreaClassification(userId,\n null,\n null,\n elementGUID,\n elementGUIDParameterName,\n OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME,\n false,\n false,\n null,\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public void removeServiceEntry(String linkName);", "@Override\n \tpublic void removeIsCitedBy(Reference reference) {\n \t\tList<Reference> isCitedBy = getIsCitedBy();\n \t\t// check for no existing relationship\n \t\tif (reference == null || !isCitedBy.contains(reference))\n \t\t\treturn;\n \t\t// remove both sides of relationship\n \t\treference.getCitationList().remove(this);\n \t\tisCitedBy.remove(reference);\n \n \t}", "void deleteTAlgmntBussRule(Integer ruleId);", "public void removeByRuleID(String serviceProviderCode, Long ruleID) throws AAException, RemoteException;", "void deleteRule(long ruleID, boolean dropPendingCmdlets) throws IOException;", "public void removeOrganMistake() {\n records.remove(selectedRecord);\n DonorReceiver account = accountManager.getAccountsByNHI(selectedRecord.getNhi()).get(selectedRecord.getNhi());\n TransplantWaitingList.removeOrganMistake(selectedRecord, accountManager);\n PageNav.loadNewPage(PageNav.TRANSPLANTLIST);\n }", "public void delRelations(XDI3Segment arcXri);", "public void delRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri);", "protected void removeReference()\n {\n }", "private void removeCrossReference ()\n\t{\n\t\tif (crossReference != null)\n\t\t{\n\t\t\tcrossReferences.remove (crossReference);\n\t\t}\n\t}", "@Override\n\tpublic void deleteRuleAfterFirstMvt() {\n\t\t\n\t}", "public void removeAppointment(Appointment a)\n {\n this.agenda.remove(a);\n }", "public void removeAgent(Agent a)\n/* 81: */ {\n/* 82:132 */ this.mapPanel.removeAgent(a);\n/* 83: */ }", "public void removeDeviceServiceLink();", "public void removeAgent(String layer, Agent a)\n/* 175: */ {\n/* 176:247 */ this.mapPanel.removeAgent(layer, a);\n/* 177: */ }", "@Test\n\tpublic void testRemoveLinkWithInverse() {\n\t\tAddress adr = new Address();\n\t\tadr.getType().setIdGenerator(new IdGeneratorNumeric());\n\t\tAssert.assertEquals(1, ((IdNumeric) adr.getId()).getNumber());\n\t\tPerson martin = new Person(\"\\\"Martin\\\" \\\"Bl�mel\\\" \\\"19641014\\\"\");\n\t\tPerson jojo = new Person(\"\\\"Johannes\\\" \\\"Bl�mel\\\" \\\"19641014\\\"\");\n\t\tadr.addInhabitant(martin);\n\t\tadr.addInhabitant(jojo);\n\n\t\tadr.removeInhabitant(jojo);\n\n\t\tAssert.assertEquals(1, adr.getInhabitants().size());\n\t\tIterator<?> iter = adr.getInhabitants().iterator();\n\t\tAssert.assertSame(martin, iter.next());\n\t\tAssert.assertSame(adr, martin.getAddress());\n\t\tAssert.assertNull(jojo.getAddress());\n\n\t\t// removing last link via remove link produces\n\t\t// an empty collection but no null value\n\t\tadr.removeInhabitant(martin);\n\n\t\tAssert.assertEquals(0, adr.getInhabitants().size());\n\t\tAssert.assertNull(jojo.getAddress());\n\t\tAssert.assertNull(martin.getAddress());\n\t}", "public void removeConceptLabel(ConceptLabel lbl) {\n\t\tSystem.out.println(\"removing \"+lbl+\" ..\");\n\t\t\n\t\tlbl.setDeleted(true);\n\t\t// tokens.remove(lbl);\n\t\t// System.out.println(\"- \"+tokens);\n\t}", "@SuppressWarnings(value = \"unused\")\n public VoidResponse deleteSubjectArea(String serverName,\n String userId,\n String subjectAreaGUID,\n ExternalSourceRequestBody requestBody)\n {\n final String methodName = \"deleteSubjectArea\";\n final String guidParameter = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n handler.deleteBeanInRepository(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n subjectAreaGUID,\n guidParameter,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n null,\n false,\n false,\n new Date(),\n methodName);\n }\n else\n {\n handler.deleteBeanInRepository(userId,\n null,\n null,\n subjectAreaGUID,\n guidParameter,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n null,\n false,\n false,\n new Date(),\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "@Override\n\tpublic AreaExecution removeArea(long areaId) {\n\t\treturn null;\n\t}", "void removeNode(ANode<T> a) {\n if (!a.equals(header)) {\n header.removeNodeFirst(a);\n }\n }", "public void removeByA_A(java.lang.String articleId, boolean approved);", "public void deleteSubject(String subjectId) {\n\t\t\r\n\t}", "public void deregisterScope(OntologyScope scope);", "public void clearLinks(){\r\n varContextObject=null; \r\n varContextFields=null; \r\n }", "public void unassignCourse() {\n assignedCourse = null;\n }", "public void delHsExtendedRef(SomeRelation value){\n ((ExtendedRefHSDMO) core).delHsExtendedRef(value);\n }", "@SuppressWarnings(value = \"unused\")\n public VoidResponse unlinkSubjectAreasInHierarchy(String serverName,\n String userId,\n String parentSubjectAreaGUID,\n String childSubjectAreaGUID,\n RelationshipRequestBody requestBody)\n {\n final String methodName = \"unlinkSubjectAreasInHierarchy\";\n\n final String parentSubjectAreaGUIDParameterName = \"parentSubjectAreaGUID\";\n final String childSubjectAreaGUIDParameterName = \"childSubjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n handler.unlinkElementFromElement(userId,\n false,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n parentSubjectAreaGUID,\n parentSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n childSubjectAreaGUID,\n childSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME,\n null,\n methodName);\n }\n else\n {\n handler.unlinkElementFromElement(userId,\n false,\n null,\n null,\n parentSubjectAreaGUID,\n parentSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n childSubjectAreaGUID,\n childSubjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_HIERARCHY_TYPE_NAME,\n null,\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public void removeAnswerListener(AnswerListener anw){\n\t\tlisteners.remove(anw);\n\t}", "public void removeByArticle(java.lang.String articleId);", "public void removeByArticle(java.lang.String articleId);", "public void deleteAnio()\r\n {\r\n this._has_anio= false;\r\n }", "void removeHasInstitutionHomePage(Object oldHasInstitutionHomePage);", "protected abstract void removeJointImpl( Joint joint );", "public void _unlinkSupplier(ModelElement supplier1);", "@Test\n\tpublic void deleteA_useA() {\n\t\tHenshinResourceSet resourceSet = new HenshinResourceSet(PATH);\n\n\t\t// Load the module:\n\t\tModule module = resourceSet.getModule(\"simpleTgRules.henshin\", false);\n\n\t\tUnit deleteAUnit = module.getUnit(\"deleteA\");\n\t\tRule deleteARule = (Rule) deleteAUnit;\n\n\t\tUnit useAwithBUnit = module.getUnit(\"useA\");\n\t\tRule useAwithBRule = (Rule) useAwithBUnit;\n\n\t\tConflictAnalysis atomicCoreCPA = new ConflictAnalysis(deleteARule, useAwithBRule);\n\t\tList<ConflictAtom> computedConflictAtoms = atomicCoreCPA.computeConflictAtoms();\n\t\tAssert.assertEquals(1, computedConflictAtoms.size());\n\t\tSystem.out.println(\"number of conflict atoms: \" + computedConflictAtoms.size());\n\t\tfor (ConflictAtom conflictAtom : computedConflictAtoms) {\n\t\t\tSystem.out.println(conflictAtom);\n\t\t}\n\n\t\tAtomCandidateComputation candComp = new AtomCandidateComputation(deleteARule, useAwithBRule);\n\t\tList<Span> conflictAtomCandidates = candComp.computeAtomCandidates();\n\t\tSet<MinimalConflictReason> reasons = new HashSet<>();//\n\t\tfor (Span candidate : conflictAtomCandidates) {\n\t\t\tnew MinimalReasonComputation(deleteARule, useAwithBRule).computeMinimalConflictReasons(candidate, reasons);\n\t\t}\n\t\tAssert.assertEquals(1, reasons.size());\n\n\t\tSet<MinimalConflictReason> minimalConflictReasons = reasons;\n\t\tSystem.out.println(\"number of minimal conflict reasons: \" + minimalConflictReasons.size());\n\t\tfor (Span minimalConflictReason : minimalConflictReasons) {\n\t\t\tSystem.out.println(minimalConflictReason);\n\t\t}\n\t}", "void removeHas_certainty(Object oldHas_certainty);", "void unsetAuditingCompany();", "void deleteExam(Module module, Exam target);", "public void removeAssociation(String handle) {\n\n Connection connection = IdentityDatabaseUtil.getDBConnection();\n PreparedStatement prepStmt = null;\n\n try {\n\n if (isAssociationExist(connection, handle)) {\n prepStmt = connection.prepareStatement(OpenIDSQLQueries.REMOVE_ASSOCIATION);\n prepStmt.setString(1, handle);\n prepStmt.execute();\n connection.commit();\n if(log.isDebugEnabled()) {\n log.debug(\"Association \" + handle + \" successfully removed from the database\");\n }\n } else {\n if(log.isDebugEnabled()) {\n log.debug(\"Association \" + handle + \" does not exist in the database\");\n }\n }\n\n } catch (SQLException e) {\n log.error(\"Failed to remove the association \" + handle, e);\n } finally {\n IdentityDatabaseUtil.closeStatement(prepStmt);\n IdentityDatabaseUtil.closeConnection(connection);\n }\n }", "protected void removeAppointment(Appointment a) {\n appointments.remove(a);\n }", "public void removeLastAssociation()\n\t{\n\t\tfinal Association a = associations.elementAt(associations.size()-1);\n\t\ta.B.assCount--;\n\t\ta.A.assCount--;\n\t\tassociations.remove(associations.size()-1);\n\t\tuser_responses--;\n\t}", "public void deleteIndividualAcl(Individual i);", "private void removeContentAfterIndexLink()\r\n \t{\r\n \t\tdeleteNodes(XPath.AFTER_INDEX_LINK.query);\r\n \t}", "@Override\n\tpublic void deleteByOid(int oaId) {\n\t\tdesignMapper.deleteByOid(oaId);\n\t}", "void removeHasAlcoholBloodContent(Object oldHasAlcoholBloodContent);", "@PostMapping(path = \"/elements/{elementGUID}/classify-with-governance-expectations/delete\")\n\n public VoidResponse clearGovernanceExpectations(@PathVariable String serverName,\n @PathVariable String userId,\n @PathVariable String elementGUID,\n @RequestBody ExternalSourceRequestBody requestBody)\n {\n return restAPI.clearGovernanceExpectations(serverName, userId, elementGUID, requestBody);\n }", "void unsetHasAuditingCompany();", "@SuppressWarnings(\"all\")\n public boolean deleteArea(String typeId, String name) {\n\n log.info(\"Deleting SafetyNET area \" + name + \" for promulgation type \" + typeId);\n\n SafetyNetArea original = findAreaByName(typeId, name);\n if (original != null) {\n remove(original);\n return true;\n }\n return false;\n }", "@Override\n\tpublic ResultMessage delOrganization(OrganizationVO vo) throws RemoteException {\n\t\treturn ResultMessage.success;\n\t}", "void removeConstraintRelation(IViewRelation relation);", "@Override\r\n\tpublic void deleteAdress(Adress adress) {\n\t\tem.remove(em.merge(adress));;\r\n\t}", "void unsetOrganizationPositionList();", "public void unsetContructionType()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(CONTRUCTIONTYPE$24);\r\n }\r\n }", "void unsetSubject();", "public void unsetReligiousAffiliationCode()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(RELIGIOUSAFFILIATIONCODE$16, 0);\n }\n }", "void unsetAnchorOffset();", "public boolean deleteArc(arc link) {\r\n\t\tif (link.getStartNode() == this)\r\n\t\t\toutcoming.remove(link);\r\n\t\telse if (link.getEndNode() == this)\r\n\t\t\tincoming.remove(link);\r\n\t\telse\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "public void removePaper(ConferencePaper pape){\r\n\t\tpapers.remove(pape);\r\n\t}", "public static void remove( AttributeType documentAttributeType )\n {\n _dao.delete( documentAttributeType );\n }", "public void removeByA_P_L_A(java.lang.String articleId, long groupId,\n\t\tjava.lang.String language, boolean approved);", "void removeIsBoundaryNodeOf(Boundary oldIsBoundaryNodeOf);", "public void deleteaccItem(String acc_no, String library_id, String sub_library_id) {\n Session session = HibernateUtil.getSessionFactory().openSession();\n Transaction tx = null;\n //Object acqdocentry = null;\n\n try {\n tx = session.beginTransaction();\n \n Query query = session.createQuery(\"DELETE FROM AccessionRegister WHERE accessionNo = :accessionNo and id.libraryId = :libraryId and id.sublibraryId = :subLibraryId\");\n\n query.setString(\"accessionNo\", acc_no);\n query.setString(\"libraryId\", library_id);\n query.setString(\"subLibraryId\", sub_library_id);\n query.executeUpdate();\n tx.commit();\n \n }catch (RuntimeException e) {\n\n tx.rollback();\n e.printStackTrace();\n } finally {\n session.close();\n }\n }", "public void removeDefinition(String destKey) {\n synchronized (this) {\n if (this.defs != null && !defs.isEmpty()) {\n SapDefinition def = this.defs.remove(destKey);\n if (def != null) {\n LOGGER.debug(\"Deleting the destination name '{}' from Destination Data Event Listener\", destKey);\n eventListener.deleted(destKey);\n }\n }\n }\n }", "@Override\n\tpublic int deleteArea(int areaId) {\n\t\treturn areaMapper.deleteArea(areaId);\n\t}" ]
[ "0.6035027", "0.58663505", "0.5811549", "0.57919645", "0.5770359", "0.5698504", "0.5694095", "0.56698024", "0.5662364", "0.55477595", "0.55325073", "0.5501097", "0.5493904", "0.5491938", "0.54724723", "0.5448573", "0.54353243", "0.53577286", "0.5352179", "0.534702", "0.5339157", "0.5338951", "0.5338415", "0.52938753", "0.5284321", "0.52636296", "0.5259915", "0.5227616", "0.522009", "0.52143055", "0.52049416", "0.51938826", "0.5192717", "0.51740164", "0.515986", "0.514259", "0.51198226", "0.51087314", "0.5106927", "0.5095443", "0.50642526", "0.50570834", "0.5051037", "0.5045668", "0.5017499", "0.4992473", "0.49806798", "0.49787444", "0.49757043", "0.49749193", "0.49643072", "0.49460647", "0.49363902", "0.4929814", "0.4923991", "0.49132103", "0.48974583", "0.4896467", "0.48925465", "0.48916966", "0.48870847", "0.48780838", "0.48768124", "0.48733407", "0.48664835", "0.48664835", "0.48654917", "0.4864839", "0.4863241", "0.4861476", "0.48569223", "0.4856745", "0.48512676", "0.48505172", "0.48468614", "0.48450992", "0.48434377", "0.48413354", "0.48357478", "0.48319837", "0.48259872", "0.48248604", "0.48184085", "0.48177752", "0.48090017", "0.4808671", "0.48067188", "0.47954604", "0.47911635", "0.47762182", "0.47729456", "0.4772452", "0.47681165", "0.47679457", "0.47650245", "0.47629017", "0.47603905", "0.47601983", "0.47577423", "0.47538576" ]
0.6600468
0
Return information about a specific subject area.
public SubjectAreaResponse getSubjectAreaByGUID(String serverName, String userId, String subjectAreaGUID) { final String methodName = "getSubjectAreaByGUID"; final String subjectAreaGUIDParameterName = "subjectAreaGUID"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); SubjectAreaResponse response = new SubjectAreaResponse(); AuditLog auditLog = null; try { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName); response.setElement(handler.getBeanFromRepository(userId, subjectAreaGUID, subjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, false, false, new Date(), methodName)); } catch (Exception error) { restExceptionHandler.captureExceptions(response, error, methodName, auditLog); } restCallLogger.logRESTCallReturn(token, response.toString()); return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getInformation(ITextViewer textViewer, IRegion subject) {\n \t\treturn \"not null\"; //$NON-NLS-1$\n \t}", "public SubjectInfo getSubjectInfo() {\r\n\t\treturn subjectInfo;\r\n\t}", "public SubjectInfo getSubject() {\n return this.subject;\n }", "public abstract String getArea();", "public String getSubject() {\n/* 286 */ return getCOSObject().getString(COSName.SUBJ);\n/* */ }", "public String getCourseArea() {\n return courseArea;\n }", "public String getArea() {\n\t\treturn area;\n\t}", "public String getArea() {\n return area;\n }", "public String getArea() {\n return area;\n }", "public String getArea() {\n return area;\n }", "public String getArea() {\n return area;\n }", "public String getArea() {\n return this.area;\n }", "public String getAreaName()\n {\n return this.areaName;\n }", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n if (areaBuilder_ == null) {\n return area_.get(index);\n } else {\n return areaBuilder_.getMessage(index);\n }\n }", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n if (areaBuilder_ == null) {\n return area_.get(index);\n } else {\n return areaBuilder_.getMessage(index);\n }\n }", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n if (areaBuilder_ == null) {\n return area_.get(index);\n } else {\n return areaBuilder_.getMessage(index);\n }\n }", "public String getAreaName() {\n return areaName;\n }", "public String getAreaName() {\n return areaName;\n }", "public SubjectAreaDefinitionResponse getSubjectAreaDefinitionByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \"getSubjectAreaDefinitionByGUID\";\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaDefinitionResponse response = new SubjectAreaDefinitionResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> subjectAreaHandler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n SubjectAreaElement element = subjectAreaHandler.getBeanFromRepository(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n new Date(),\n methodName);\n if (element != null)\n {\n SubjectAreaDefinition subjectAreaDefinition = new SubjectAreaDefinition(element);\n\n subjectAreaDefinition.setParentSubjectAreaGUID(subjectAreaHandler.getSubjectAreaParentGUID(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n subjectAreaDefinition.setNestedSubjectAreaGUIDs(subjectAreaHandler.getSubjectAreaChildrenGUIDs(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n GovernanceDefinitionHandler<GovernanceDefinitionElement> definitionHandler = instanceHandler.getGovernanceDefinitionHandler(userId, serverName, methodName);\n ElementStubConverter<ElementStub> elementStubConverter = instanceHandler.getElementStubConverter(userId, serverName, methodName);\n List<Relationship> relationships = definitionHandler.getGoverningDefinitionLinks(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n 0,\n 0,\n false,\n false,\n new Date(),\n methodName);\n List<ElementStub> definitions = elementStubConverter.getNewBeans(ElementStub.class, relationships, true, methodName);\n subjectAreaDefinition.setAssociatedGovernanceDefinitions(definitions);\n\n response.setProperties(subjectAreaDefinition);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "java.lang.String getSubject();", "java.lang.String getSubject();", "java.lang.String getSubject();", "public SubjectAreaResponse getSubjectAreaByName(String serverName,\n String userId,\n String qualifiedName)\n {\n final String methodName = \"getSubjectAreaByName\";\n final String qualifiedNameParameterName = \"qualifiedName\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaResponse response = new SubjectAreaResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n response.setElement(handler.getSubjectArea(userId,\n qualifiedName,\n qualifiedNameParameterName,\n false,\n false,\n new Date(),\n methodName));\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public void setArea(String area) {\n this.area = area;\n }", "String getSubject();", "String getSubject();", "public void setArea(String area) {\n this.area = area;\n }", "public void setArea(String area) {\n\t\tthis.area = area;\n\t}", "public Subject getSubject() {\n\t\treturn subject;\n\t}", "public Subject getSubject();", "public String getSubject()\r\n {\r\n return (m_subject);\r\n }", "public Name getSubject() {\r\n return subject;\r\n }", "private static OspfArea areaDetails(JsonNode areaNode) {\n OspfArea area = new OspfAreaImpl();\n String areaId = areaNode.path(AREAID).asText();\n if (isValidIpAddress(areaId)) {\n area.setAreaId(Ip4Address.valueOf(areaId));\n } else {\n log.debug(\"Wrong areaId: {}\", areaId);\n return null;\n }\n String routerId = areaNode.path(ROUTERID).asText();\n if (isValidIpAddress(routerId)) {\n area.setRouterId(Ip4Address.valueOf(routerId));\n } else {\n log.debug(\"Wrong routerId: {}\", routerId);\n return null;\n }\n String routingCapability = areaNode.path(EXTERNALROUTINGCAPABILITY).asText();\n if (isBoolean(routingCapability)) {\n area.setExternalRoutingCapability(Boolean.valueOf(routingCapability));\n } else {\n log.debug(\"Wrong routingCapability: {}\", routingCapability);\n return null;\n }\n String isOpaqueEnabled = areaNode.path(ISOPAQUE).asText();\n if (isBoolean(isOpaqueEnabled)) {\n area.setIsOpaqueEnabled(Boolean.valueOf(isOpaqueEnabled));\n } else {\n log.debug(\"Wrong isOpaqueEnabled: {}\", isOpaqueEnabled);\n return null;\n }\n area.setOptions(OspfUtil.HELLO_PACKET_OPTIONS);\n\n return area;\n }", "public String getArea_id() {\n return area_id;\n }", "public String getSubject() {\n return subject;\n }", "public String getSubject() {\n return subject;\n }", "public String getSubject() {\n return subject;\n }", "Collection<LocatorIF> getSubjectIdentifiers();", "public String getSubject()\r\n {\r\n return subject;\r\n }", "@RequestMapping(value = \"/{subjectId}\")\n\tpublic Subject getSubject(@PathVariable Long subjectId) {\n\t\tSubject subject = subjectService.getSubject(subjectId);\n\t\tif (subject == null)\n\t\t\tthrow new ObjectNotFoundException(\"Subject not found of id-\" + subjectId);\n\t\treturn subject;\n\t}", "public String getSubject() {\r\n\t\treturn subject;\r\n\t}", "public String getSubject() {\r\n\t\treturn subject;\r\n\t}", "public String getSubject() {\n return this.subject;\n }", "public String getSubject() {\n return this.subject;\n }", "public SubjectareasRecord() {\n\t\tsuper(Subjectareas.SUBJECTAREAS);\n\t}", "public String getAuthorizedArea() {\n return (String)getAttributeInternal(AUTHORIZEDAREA);\n }", "public String getSubject() {\n\t\treturn subject;\n\t}", "public String getSubject() {\n\t\treturn subject;\n\t}", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n return area_.get(index);\n }", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n return area_.get(index);\n }", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n return area_.get(index);\n }", "public Subject getSubjectByName(String name);", "@Override\n\tpublic java.lang.String getAreaName() {\n\t\treturn _locMstLocation.getAreaName();\n\t}", "public abstract I_SessionName getSubjectName();", "public Subject getSubject(int subjectId) {\r\n\r\n\t\tif (subjectRepository.existsById(subjectId)) {\r\n\t\t\tlogger.info(\"*** Service : Displaying Subject with id ***\" + subjectId);\r\n\r\n\t\t}\r\n\r\n\t\treturn subjectRepository.findById(subjectId).orElse(null);\r\n\r\n\t}", "public Subject getSubject(){\n\t\treturn sub;\n\t}", "public String getSubjectOfBiography() {return subjectOfBiography;}", "public String toString() {\n return subjectName;\n }", "public String areaCode() {\n return areaCode;\n }", "Object getSubject();", "public void setCourseArea(String courseArea) {\n this.courseArea = courseArea;\n }", "Subject getSubject(){\n\t\treturn subject;\n\t}", "public String toString ()\n\t{\n\t\treturn new String (\"[\" + ancho+ \", \" + alto + \"], Area = \" + area);\n\t}", "public String toString()\n {\n return getClass().getName() + \"[name=\" + name + \",area=\" + area + \"]\";\n }", "public void getSubjectOfInterest() {\n\t\t// Output the present vector\n\t\tSystem.out.println(this.name + \" subjects of interest are: \" + this.subjectsOfInterest);\n\t\t// return this.subjectsOfInterest;\n\t}", "public int getIdSubject() {\n\t\treturn idSubject;\n\t}", "public int getArea() {\n\t\treturn area;\n\t}", "public Long getSubjectId() {\n\t\treturn subjectId;\n\t}", "public String getLocationArea() {\n return locationArea;\n }", "public int getAreaNo() {\n return areaNo_;\n }", "public void testAreaInfo()\n\t{\n\t\tGameArea ga = new GameArea();\n\t\tga.areaInfo();\n\t\tga.setConditionsMet(true);\n\t\tga.setAreaProgress(1);\n\t\tga.areaInfo();\n\t\tga.areaInfo();\n\t\tga.setLoot(null);\n\t\tga.areaInfo();\n\t}", "public String getAreaCode() \n\t{\n\t\treturn getNumber().substring(1,4);\n\t}", "public String getFirstSubject() {\n String subject = \"\";\n try {\n JSONArray array = sr.getJSONArray(\"subject\");\n JSONObject entry = array.getJSONObject(0);\n subject += entry.getString(\"name\"); \n return subject; \n } catch (Exception f) {\n return \"NA\"; \n } \n }", "public String getSubject() {\n\t\treturn txtSubject.getText();\n\t}", "@Override\r\n\tpublic void getarea(int a) {\n\t\t\r\n\t}", "public int getAreaNo() {\n return areaNo_;\n }", "public String getmSubject() {\n return mSubject;\n }", "public String getAreaName() {\n\t\tif (areaName == null) {\n\t\t\tProtectedRegion p = getPlot();\n\t\t\tPlotInfo info = plugin.getPlotInfo(worldName, p.getId());\n\t\t\tif (info != null) {\n\t\t\t\tareaName = info.areaName;\n\t\t\t}\n\t\t}\n\t\treturn areaName;\n\t}", "public static void subject(int course) {\r\n String subject1 = (\"physics\");\r\n String subject2 = (\"sap\");\r\n String subject3 = (\"cs\");\r\n //String subject4 = (\"N/A\");\r\n\r\n System.out.println(\r\n \"Please enter a number to choose a subject to study for. 1.)\" + subject1 + \" 2.)\" + subject2 + (\" 3.)\") + subject3\r\n + \".\");\r\n }", "@AutoEscape\n\tpublic String getPersonnelSubArea();", "public Subject getEachSubject(int subject_id) {\n\t\treturn sub_dao.getEachSubject(subject_id);\r\n\t}", "public String getAreaCode() {\n return areaCode;\n }", "public String getAreaCode() {\n return areaCode;\n }", "public native vector kbAreaGetCenter(int areaID);", "@Test\n public void getSubjectTypeInfoTest() throws Exception {\n IPSubject subjType = new IPSubject();\n \n SubjectTypeInfo typeInfo = subjType.getSubjectTypeInfo();\n assertEquals(\"IP\", typeInfo.getName());\n assertEquals(false, typeInfo.isExternal());\n }", "public abstract int getArea();", "public Map<String, Object> getSubjectLocation() {\n return this.geoLocationPairs;\n }", "public String getAreaCode() {\n return this.areaCode;\n }", "private static String[] getActualCoursesDetailInfo(ActualCourse actualCourse) {\n String startTime = DateHandlerUtils.dateToString(DateFormatConstants.YYYY_MM_DD_HH_MM, actualCourse.getCourseStartTime());\n String endTime = DateHandlerUtils.dateToString(DateFormatConstants.HH_MM, actualCourse.getCourseEndTime());\n String time = startTime + EmailConstant.MIDDLE_LINE + endTime;\n String[] data = new String[] { replaceNullDataToTBD(actualCourse.getCourseName()), replaceNullDataToTBD(actualCourse.getCourseRoomNum()),\n replaceNullDataToTBD(time), replaceNullDataToTBD(actualCourse.getCourseTrainer()) };\n return data;\n }", "public Integer getAreaId() {\n return areaId;\n }", "public Integer getAreaId() {\n return areaId;\n }", "X500Principal getSubject();", "public List<Subject> getSubject() {\n\t\treturn sub_dao.getSubject();\r\n\t}", "org.hl7.fhir.ResourceReference getSubject();", "public SubjectHierarchy getSubjectHierarchy();", "public com.example.grpc.SimpleServiceOuterClass.AreaOrBuilder getAreaOrBuilder(\n int index) {\n if (areaBuilder_ == null) {\n return area_.get(index); } else {\n return areaBuilder_.getMessageOrBuilder(index);\n }\n }", "public com.example.grpc.SimpleServiceOuterClass.AreaOrBuilder getAreaOrBuilder(\n int index) {\n if (areaBuilder_ == null) {\n return area_.get(index); } else {\n return areaBuilder_.getMessageOrBuilder(index);\n }\n }", "public com.example.grpc.SimpleServiceOuterClass.AreaOrBuilder getAreaOrBuilder(\n int index) {\n if (areaBuilder_ == null) {\n return area_.get(index); } else {\n return areaBuilder_.getMessageOrBuilder(index);\n }\n }", "public void getSubject() {\n System.out.println(\"give any Subject: \");\n String subject = input.next();\n for (Card s: cards) {\n if (s.subjectOfBook.equals(subject)) {\n System.out.println(s.titleOfBook + \" \" + s.autherOfBook + \" \" + s.subjectOfBook);\n } \n }\n System.out.println(\"not Found\");\n }", "public String getSubject() {\n UnstructuredField field = obtainField(FieldName.SUBJECT);\n if (field == null)\n return null;\n\n return field.getValue();\n }" ]
[ "0.6016494", "0.5982568", "0.5982008", "0.5884644", "0.58367455", "0.5714853", "0.5680528", "0.56710076", "0.5664328", "0.5664328", "0.5664328", "0.56290734", "0.5575278", "0.5566822", "0.5566822", "0.5566822", "0.5519611", "0.5519611", "0.5517835", "0.5511427", "0.5511427", "0.5511427", "0.5464322", "0.5439761", "0.54240304", "0.54240304", "0.5404571", "0.53795534", "0.5366434", "0.53226703", "0.5312326", "0.5306956", "0.52872664", "0.5284383", "0.5277639", "0.5277639", "0.52770245", "0.5267577", "0.5263271", "0.52435976", "0.5228699", "0.5228699", "0.52271193", "0.52271193", "0.52174103", "0.5217406", "0.52101654", "0.52101654", "0.5191312", "0.5191312", "0.5191312", "0.51888394", "0.5163108", "0.5158337", "0.51527786", "0.51471716", "0.51454633", "0.51140594", "0.5098836", "0.50896055", "0.50839597", "0.50791746", "0.5069901", "0.5065782", "0.50564635", "0.5049997", "0.5044434", "0.5041896", "0.50311506", "0.5029353", "0.5019304", "0.50191724", "0.50135237", "0.5013188", "0.5000991", "0.49934748", "0.49884674", "0.49865398", "0.49835724", "0.4981586", "0.49792016", "0.49765602", "0.49765602", "0.49741095", "0.49618962", "0.49617878", "0.49604037", "0.49555296", "0.4947554", "0.49427345", "0.49427345", "0.49375078", "0.49320722", "0.49282748", "0.49199086", "0.49188575", "0.49188575", "0.49188575", "0.4915209", "0.4903954" ]
0.59165734
3
Return information about a specific subject area.
public SubjectAreaResponse getSubjectAreaByName(String serverName, String userId, String qualifiedName) { final String methodName = "getSubjectAreaByName"; final String qualifiedNameParameterName = "qualifiedName"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); SubjectAreaResponse response = new SubjectAreaResponse(); AuditLog auditLog = null; try { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName); response.setElement(handler.getSubjectArea(userId, qualifiedName, qualifiedNameParameterName, false, false, new Date(), methodName)); } catch (Exception error) { restExceptionHandler.captureExceptions(response, error, methodName, auditLog); } restCallLogger.logRESTCallReturn(token, response.toString()); return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getInformation(ITextViewer textViewer, IRegion subject) {\n \t\treturn \"not null\"; //$NON-NLS-1$\n \t}", "public SubjectInfo getSubject() {\n return this.subject;\n }", "public SubjectInfo getSubjectInfo() {\r\n\t\treturn subjectInfo;\r\n\t}", "public SubjectAreaResponse getSubjectAreaByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \"getSubjectAreaByGUID\";\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaResponse response = new SubjectAreaResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n response.setElement(handler.getBeanFromRepository(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n new Date(),\n methodName));\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public abstract String getArea();", "public String getSubject() {\n/* 286 */ return getCOSObject().getString(COSName.SUBJ);\n/* */ }", "public String getCourseArea() {\n return courseArea;\n }", "public String getArea() {\n\t\treturn area;\n\t}", "public String getArea() {\n return area;\n }", "public String getArea() {\n return area;\n }", "public String getArea() {\n return area;\n }", "public String getArea() {\n return area;\n }", "public String getArea() {\n return this.area;\n }", "public String getAreaName()\n {\n return this.areaName;\n }", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n if (areaBuilder_ == null) {\n return area_.get(index);\n } else {\n return areaBuilder_.getMessage(index);\n }\n }", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n if (areaBuilder_ == null) {\n return area_.get(index);\n } else {\n return areaBuilder_.getMessage(index);\n }\n }", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n if (areaBuilder_ == null) {\n return area_.get(index);\n } else {\n return areaBuilder_.getMessage(index);\n }\n }", "public String getAreaName() {\n return areaName;\n }", "public String getAreaName() {\n return areaName;\n }", "public SubjectAreaDefinitionResponse getSubjectAreaDefinitionByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \"getSubjectAreaDefinitionByGUID\";\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaDefinitionResponse response = new SubjectAreaDefinitionResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> subjectAreaHandler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n SubjectAreaElement element = subjectAreaHandler.getBeanFromRepository(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n new Date(),\n methodName);\n if (element != null)\n {\n SubjectAreaDefinition subjectAreaDefinition = new SubjectAreaDefinition(element);\n\n subjectAreaDefinition.setParentSubjectAreaGUID(subjectAreaHandler.getSubjectAreaParentGUID(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n subjectAreaDefinition.setNestedSubjectAreaGUIDs(subjectAreaHandler.getSubjectAreaChildrenGUIDs(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n GovernanceDefinitionHandler<GovernanceDefinitionElement> definitionHandler = instanceHandler.getGovernanceDefinitionHandler(userId, serverName, methodName);\n ElementStubConverter<ElementStub> elementStubConverter = instanceHandler.getElementStubConverter(userId, serverName, methodName);\n List<Relationship> relationships = definitionHandler.getGoverningDefinitionLinks(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n 0,\n 0,\n false,\n false,\n new Date(),\n methodName);\n List<ElementStub> definitions = elementStubConverter.getNewBeans(ElementStub.class, relationships, true, methodName);\n subjectAreaDefinition.setAssociatedGovernanceDefinitions(definitions);\n\n response.setProperties(subjectAreaDefinition);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "java.lang.String getSubject();", "java.lang.String getSubject();", "java.lang.String getSubject();", "public void setArea(String area) {\n this.area = area;\n }", "String getSubject();", "String getSubject();", "public void setArea(String area) {\n this.area = area;\n }", "public void setArea(String area) {\n\t\tthis.area = area;\n\t}", "public Subject getSubject() {\n\t\treturn subject;\n\t}", "public Subject getSubject();", "public String getSubject()\r\n {\r\n return (m_subject);\r\n }", "public Name getSubject() {\r\n return subject;\r\n }", "private static OspfArea areaDetails(JsonNode areaNode) {\n OspfArea area = new OspfAreaImpl();\n String areaId = areaNode.path(AREAID).asText();\n if (isValidIpAddress(areaId)) {\n area.setAreaId(Ip4Address.valueOf(areaId));\n } else {\n log.debug(\"Wrong areaId: {}\", areaId);\n return null;\n }\n String routerId = areaNode.path(ROUTERID).asText();\n if (isValidIpAddress(routerId)) {\n area.setRouterId(Ip4Address.valueOf(routerId));\n } else {\n log.debug(\"Wrong routerId: {}\", routerId);\n return null;\n }\n String routingCapability = areaNode.path(EXTERNALROUTINGCAPABILITY).asText();\n if (isBoolean(routingCapability)) {\n area.setExternalRoutingCapability(Boolean.valueOf(routingCapability));\n } else {\n log.debug(\"Wrong routingCapability: {}\", routingCapability);\n return null;\n }\n String isOpaqueEnabled = areaNode.path(ISOPAQUE).asText();\n if (isBoolean(isOpaqueEnabled)) {\n area.setIsOpaqueEnabled(Boolean.valueOf(isOpaqueEnabled));\n } else {\n log.debug(\"Wrong isOpaqueEnabled: {}\", isOpaqueEnabled);\n return null;\n }\n area.setOptions(OspfUtil.HELLO_PACKET_OPTIONS);\n\n return area;\n }", "public String getArea_id() {\n return area_id;\n }", "public String getSubject() {\n return subject;\n }", "public String getSubject() {\n return subject;\n }", "public String getSubject() {\n return subject;\n }", "Collection<LocatorIF> getSubjectIdentifiers();", "public String getSubject()\r\n {\r\n return subject;\r\n }", "@RequestMapping(value = \"/{subjectId}\")\n\tpublic Subject getSubject(@PathVariable Long subjectId) {\n\t\tSubject subject = subjectService.getSubject(subjectId);\n\t\tif (subject == null)\n\t\t\tthrow new ObjectNotFoundException(\"Subject not found of id-\" + subjectId);\n\t\treturn subject;\n\t}", "public String getSubject() {\r\n\t\treturn subject;\r\n\t}", "public String getSubject() {\r\n\t\treturn subject;\r\n\t}", "public String getSubject() {\n return this.subject;\n }", "public String getSubject() {\n return this.subject;\n }", "public String getAuthorizedArea() {\n return (String)getAttributeInternal(AUTHORIZEDAREA);\n }", "public SubjectareasRecord() {\n\t\tsuper(Subjectareas.SUBJECTAREAS);\n\t}", "public String getSubject() {\n\t\treturn subject;\n\t}", "public String getSubject() {\n\t\treturn subject;\n\t}", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n return area_.get(index);\n }", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n return area_.get(index);\n }", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n return area_.get(index);\n }", "public Subject getSubjectByName(String name);", "@Override\n\tpublic java.lang.String getAreaName() {\n\t\treturn _locMstLocation.getAreaName();\n\t}", "public abstract I_SessionName getSubjectName();", "public Subject getSubject(int subjectId) {\r\n\r\n\t\tif (subjectRepository.existsById(subjectId)) {\r\n\t\t\tlogger.info(\"*** Service : Displaying Subject with id ***\" + subjectId);\r\n\r\n\t\t}\r\n\r\n\t\treturn subjectRepository.findById(subjectId).orElse(null);\r\n\r\n\t}", "public Subject getSubject(){\n\t\treturn sub;\n\t}", "public String getSubjectOfBiography() {return subjectOfBiography;}", "public String toString() {\n return subjectName;\n }", "public String areaCode() {\n return areaCode;\n }", "Object getSubject();", "public void setCourseArea(String courseArea) {\n this.courseArea = courseArea;\n }", "Subject getSubject(){\n\t\treturn subject;\n\t}", "public String toString ()\n\t{\n\t\treturn new String (\"[\" + ancho+ \", \" + alto + \"], Area = \" + area);\n\t}", "public String toString()\n {\n return getClass().getName() + \"[name=\" + name + \",area=\" + area + \"]\";\n }", "public void getSubjectOfInterest() {\n\t\t// Output the present vector\n\t\tSystem.out.println(this.name + \" subjects of interest are: \" + this.subjectsOfInterest);\n\t\t// return this.subjectsOfInterest;\n\t}", "public int getIdSubject() {\n\t\treturn idSubject;\n\t}", "public int getArea() {\n\t\treturn area;\n\t}", "public Long getSubjectId() {\n\t\treturn subjectId;\n\t}", "public String getLocationArea() {\n return locationArea;\n }", "public int getAreaNo() {\n return areaNo_;\n }", "public void testAreaInfo()\n\t{\n\t\tGameArea ga = new GameArea();\n\t\tga.areaInfo();\n\t\tga.setConditionsMet(true);\n\t\tga.setAreaProgress(1);\n\t\tga.areaInfo();\n\t\tga.areaInfo();\n\t\tga.setLoot(null);\n\t\tga.areaInfo();\n\t}", "public String getAreaCode() \n\t{\n\t\treturn getNumber().substring(1,4);\n\t}", "public String getFirstSubject() {\n String subject = \"\";\n try {\n JSONArray array = sr.getJSONArray(\"subject\");\n JSONObject entry = array.getJSONObject(0);\n subject += entry.getString(\"name\"); \n return subject; \n } catch (Exception f) {\n return \"NA\"; \n } \n }", "public String getSubject() {\n\t\treturn txtSubject.getText();\n\t}", "@Override\r\n\tpublic void getarea(int a) {\n\t\t\r\n\t}", "public int getAreaNo() {\n return areaNo_;\n }", "public String getAreaName() {\n\t\tif (areaName == null) {\n\t\t\tProtectedRegion p = getPlot();\n\t\t\tPlotInfo info = plugin.getPlotInfo(worldName, p.getId());\n\t\t\tif (info != null) {\n\t\t\t\tareaName = info.areaName;\n\t\t\t}\n\t\t}\n\t\treturn areaName;\n\t}", "public String getmSubject() {\n return mSubject;\n }", "public static void subject(int course) {\r\n String subject1 = (\"physics\");\r\n String subject2 = (\"sap\");\r\n String subject3 = (\"cs\");\r\n //String subject4 = (\"N/A\");\r\n\r\n System.out.println(\r\n \"Please enter a number to choose a subject to study for. 1.)\" + subject1 + \" 2.)\" + subject2 + (\" 3.)\") + subject3\r\n + \".\");\r\n }", "@AutoEscape\n\tpublic String getPersonnelSubArea();", "public Subject getEachSubject(int subject_id) {\n\t\treturn sub_dao.getEachSubject(subject_id);\r\n\t}", "public String getAreaCode() {\n return areaCode;\n }", "public String getAreaCode() {\n return areaCode;\n }", "public native vector kbAreaGetCenter(int areaID);", "public abstract int getArea();", "public Map<String, Object> getSubjectLocation() {\n return this.geoLocationPairs;\n }", "@Test\n public void getSubjectTypeInfoTest() throws Exception {\n IPSubject subjType = new IPSubject();\n \n SubjectTypeInfo typeInfo = subjType.getSubjectTypeInfo();\n assertEquals(\"IP\", typeInfo.getName());\n assertEquals(false, typeInfo.isExternal());\n }", "public String getAreaCode() {\n return this.areaCode;\n }", "public Integer getAreaId() {\n return areaId;\n }", "public Integer getAreaId() {\n return areaId;\n }", "private static String[] getActualCoursesDetailInfo(ActualCourse actualCourse) {\n String startTime = DateHandlerUtils.dateToString(DateFormatConstants.YYYY_MM_DD_HH_MM, actualCourse.getCourseStartTime());\n String endTime = DateHandlerUtils.dateToString(DateFormatConstants.HH_MM, actualCourse.getCourseEndTime());\n String time = startTime + EmailConstant.MIDDLE_LINE + endTime;\n String[] data = new String[] { replaceNullDataToTBD(actualCourse.getCourseName()), replaceNullDataToTBD(actualCourse.getCourseRoomNum()),\n replaceNullDataToTBD(time), replaceNullDataToTBD(actualCourse.getCourseTrainer()) };\n return data;\n }", "X500Principal getSubject();", "public List<Subject> getSubject() {\n\t\treturn sub_dao.getSubject();\r\n\t}", "org.hl7.fhir.ResourceReference getSubject();", "public com.example.grpc.SimpleServiceOuterClass.AreaOrBuilder getAreaOrBuilder(\n int index) {\n if (areaBuilder_ == null) {\n return area_.get(index); } else {\n return areaBuilder_.getMessageOrBuilder(index);\n }\n }", "public com.example.grpc.SimpleServiceOuterClass.AreaOrBuilder getAreaOrBuilder(\n int index) {\n if (areaBuilder_ == null) {\n return area_.get(index); } else {\n return areaBuilder_.getMessageOrBuilder(index);\n }\n }", "public com.example.grpc.SimpleServiceOuterClass.AreaOrBuilder getAreaOrBuilder(\n int index) {\n if (areaBuilder_ == null) {\n return area_.get(index); } else {\n return areaBuilder_.getMessageOrBuilder(index);\n }\n }", "public SubjectHierarchy getSubjectHierarchy();", "public void getSubject() {\n System.out.println(\"give any Subject: \");\n String subject = input.next();\n for (Card s: cards) {\n if (s.subjectOfBook.equals(subject)) {\n System.out.println(s.titleOfBook + \" \" + s.autherOfBook + \" \" + s.subjectOfBook);\n } \n }\n System.out.println(\"not Found\");\n }", "public Area getArea(Area area) {\r\n\t\treturn this.getArea(area.getId());\r\n\t}" ]
[ "0.6013288", "0.5978578", "0.59778625", "0.59181774", "0.58855367", "0.58345175", "0.5713292", "0.56811994", "0.56718147", "0.56650966", "0.56650966", "0.56650966", "0.5629674", "0.55752593", "0.5569739", "0.5569739", "0.5569739", "0.5519934", "0.5519934", "0.5519584", "0.55095047", "0.55095047", "0.55095047", "0.54424524", "0.5422346", "0.5422346", "0.5407295", "0.5381911", "0.53642845", "0.5321121", "0.5309483", "0.5304494", "0.52876896", "0.52857167", "0.5275643", "0.5275643", "0.52749693", "0.52662635", "0.52610016", "0.52427673", "0.52266145", "0.52266145", "0.5224903", "0.5224903", "0.5216324", "0.5216086", "0.5208011", "0.5208011", "0.5194185", "0.5194185", "0.5194185", "0.51881343", "0.51635027", "0.5156494", "0.5151447", "0.5145892", "0.51417553", "0.5111012", "0.5098298", "0.50880235", "0.50839514", "0.5076926", "0.5070141", "0.5065", "0.5053379", "0.50484574", "0.5045033", "0.5040337", "0.50319934", "0.5029386", "0.5019987", "0.5018328", "0.5012608", "0.5010391", "0.50021386", "0.49936348", "0.49868935", "0.49857834", "0.49823642", "0.49814528", "0.49772212", "0.49758354", "0.49758354", "0.49757388", "0.49627", "0.4959061", "0.49582842", "0.49545825", "0.4944517", "0.4944517", "0.49433407", "0.4935318", "0.49289858", "0.49257067", "0.49210486", "0.49210486", "0.49210486", "0.49184492", "0.49138892", "0.4903465" ]
0.54653543
23
Return information about the defined subject areas.
public SubjectAreaListResponse getSubjectAreasForDomain(String serverName, String userId, int domainIdentifier, int startFrom, int pageSize) { final String methodName = "getSubjectAreasForDomain"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); SubjectAreaListResponse response = new SubjectAreaListResponse(); AuditLog auditLog = null; try { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName); List<SubjectAreaElement> subjectAreas = handler.getSubjectAreasByDomain(userId, domainIdentifier, startFrom, pageSize, false, false, new Date(), methodName); response.setElementList(subjectAreas); } catch (Exception error) { restExceptionHandler.captureExceptions(response, error, methodName, auditLog); } restCallLogger.logRESTCallReturn(token, response.toString()); return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void printAllAreas() {\r\n\t for (int i = 0; i <= 2967; i++) {\r\n\t System.out.println(\"Load Shedding Inforamtion: \" + LSItemsArray[i].getInformation()\r\n + \": Corresponding Areas: \" + LSItemsArray[i].getAreas());\r\n\r\n\t }\r\n\t }", "public abstract String getArea();", "public SubjectareasRecord() {\n\t\tsuper(Subjectareas.SUBJECTAREAS);\n\t}", "public LinkedList<Area> getAreas(){\n\t\treturn areas;\n\t}", "@Override\r\n\tpublic String toString() {\r\n\r\n\t\treturn \"My rectangle's Areas is \"+area();\r\n\t}", "public void testAreaInfo()\n\t{\n\t\tGameArea ga = new GameArea();\n\t\tga.areaInfo();\n\t\tga.setConditionsMet(true);\n\t\tga.setAreaProgress(1);\n\t\tga.areaInfo();\n\t\tga.areaInfo();\n\t\tga.setLoot(null);\n\t\tga.areaInfo();\n\t}", "Collection<LocatorIF> getSubjectIdentifiers();", "public String getArea() {\n return this.area;\n }", "public String getArea() {\n return area;\n }", "public String getArea() {\n return area;\n }", "public String getArea() {\n return area;\n }", "public String getArea() {\n return area;\n }", "public String getArea() {\n\t\treturn area;\n\t}", "public String getInformation(ITextViewer textViewer, IRegion subject) {\n \t\treturn \"not null\"; //$NON-NLS-1$\n \t}", "public String getAreaName()\n {\n return this.areaName;\n }", "public java.util.List<com.example.grpc.SimpleServiceOuterClass.Area> getAreaList() {\n if (areaBuilder_ == null) {\n return java.util.Collections.unmodifiableList(area_);\n } else {\n return areaBuilder_.getMessageList();\n }\n }", "public java.util.List<com.example.grpc.SimpleServiceOuterClass.Area> getAreaList() {\n if (areaBuilder_ == null) {\n return java.util.Collections.unmodifiableList(area_);\n } else {\n return areaBuilder_.getMessageList();\n }\n }", "public java.util.List<com.example.grpc.SimpleServiceOuterClass.Area> getAreaList() {\n if (areaBuilder_ == null) {\n return java.util.Collections.unmodifiableList(area_);\n } else {\n return areaBuilder_.getMessageList();\n }\n }", "@Override\n public List<Area> getAllAreas() {\n return new ArrayList<>(areas.values());\n }", "public AreaProperties getProperties() {\n return this.properties;\n }", "public String getAuthorizedArea() {\n return (String)getAttributeInternal(AUTHORIZEDAREA);\n }", "public String toString()\n {\n return getClass().getName() + \"[name=\" + name + \",area=\" + area + \"]\";\n }", "public String getAreaName() {\n return areaName;\n }", "public String getAreaName() {\n return areaName;\n }", "public String toString ()\n\t{\n\t\treturn new String (\"[\" + ancho+ \", \" + alto + \"], Area = \" + area);\n\t}", "public AreaInfoExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public static void printAreas(String information) {\r\n //String information = stage + \"_\" + day + \"_\" + startTime;\r\n boolean bool = false;\r\n for (int i = 0; i <= 2976; i ++) {\r\n opCount++;\r\n if (LSItemsArray[i].getInformation().equals(information)){\r\n System.out.println(\"Load Shedding Inforamtion: \" + LSItemsArray[i].getInformation()\r\n + \": Corresponding Areas: \" + LSItemsArray[i].getAreas());\r\n bool = true;\r\n break;\r\n }\r\n\r\n }\r\n if (bool == false)\r\n System.out.println(\"Areas not found\");\r\n }", "public String getCourseArea() {\n return courseArea;\n }", "int getAreaCount();", "int getAreaCount();", "int getAreaCount();", "@Override\n\tpublic String getTareas() {\n\t\treturn \"TAREA COMERCIAL 3: VENDE MUCHO TODOS LOS DÍAS\";\n\t}", "public java.util.List<com.example.grpc.SimpleServiceOuterClass.Area> getAreaList() {\n return area_;\n }", "public java.util.List<com.example.grpc.SimpleServiceOuterClass.Area> getAreaList() {\n return area_;\n }", "public java.util.List<com.example.grpc.SimpleServiceOuterClass.Area> getAreaList() {\n return area_;\n }", "private void calculateAreas() {\n\n\t\t/*\n\t\t * Each section is a trapezoid, so that the area is given by:\n\t\t * \n\t\t * (thicknessAtMainSpar + thicknessAtSecondarySpar)*distanceBetweenSpars*0.5\n\t\t * \n\t\t */\n\t\tint nSections = this._thicknessAtMainSpar.size();\n\t\tfor(int i=0; i<nSections; i++)\n\t\t\tthis._prismoidsSectionsAreas.add(\n\t\t\t\t\tAmount.valueOf(\n\t\t\t\t\t\t\t(this._thicknessAtMainSpar.get(i).plus(this._thicknessAtSecondarySpar.get(i)))\n\t\t\t\t\t\t\t.times(this._distanceBetweenSpars.get(i)).times(0.5).getEstimatedValue(),\n\t\t\t\t\t\t\tSI.SQUARE_METRE\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t}", "public SubjectAreaDefinitionResponse getSubjectAreaDefinitionByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \"getSubjectAreaDefinitionByGUID\";\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaDefinitionResponse response = new SubjectAreaDefinitionResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> subjectAreaHandler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n SubjectAreaElement element = subjectAreaHandler.getBeanFromRepository(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n new Date(),\n methodName);\n if (element != null)\n {\n SubjectAreaDefinition subjectAreaDefinition = new SubjectAreaDefinition(element);\n\n subjectAreaDefinition.setParentSubjectAreaGUID(subjectAreaHandler.getSubjectAreaParentGUID(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n subjectAreaDefinition.setNestedSubjectAreaGUIDs(subjectAreaHandler.getSubjectAreaChildrenGUIDs(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n GovernanceDefinitionHandler<GovernanceDefinitionElement> definitionHandler = instanceHandler.getGovernanceDefinitionHandler(userId, serverName, methodName);\n ElementStubConverter<ElementStub> elementStubConverter = instanceHandler.getElementStubConverter(userId, serverName, methodName);\n List<Relationship> relationships = definitionHandler.getGoverningDefinitionLinks(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n 0,\n 0,\n false,\n false,\n new Date(),\n methodName);\n List<ElementStub> definitions = elementStubConverter.getNewBeans(ElementStub.class, relationships, true, methodName);\n subjectAreaDefinition.setAssociatedGovernanceDefinitions(definitions);\n\n response.setProperties(subjectAreaDefinition);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public int getAreaCount() {\n return area_.size();\n }", "public int getAreaCount() {\n return area_.size();\n }", "public int getAreaCount() {\n return area_.size();\n }", "public Map getTutorInfo() {\n //Create a map of arraylists to hold all data\n Map<Integer, ArrayList<String>> info = new HashMap<Integer, ArrayList<String>>();\n\n //Grab info from screen\n EditText t = (EditText) findViewById(R.id.BioField);\n ArrayList<String> bioField = new ArrayList<String>();\n bioField.add(t.getText().toString());\n\n //Put info in Map\n info.put(1, bioField);\n info.put(2, subjectList);\n\n return info;\n }", "public void showDetails(){\r\n\t\tSystem.out.println(\"Length is : \"+getLength());\r\n\t\tSystem.out.println(\"Width is : \"+getWidth());\r\n\t\tSystem.out.println(\"Area Of Rectangle is : \"+area());\r\n\t}", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n if (areaBuilder_ == null) {\n return area_.get(index);\n } else {\n return areaBuilder_.getMessage(index);\n }\n }", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n if (areaBuilder_ == null) {\n return area_.get(index);\n } else {\n return areaBuilder_.getMessage(index);\n }\n }", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n if (areaBuilder_ == null) {\n return area_.get(index);\n } else {\n return areaBuilder_.getMessage(index);\n }\n }", "@Override\r\n\tpublic void getarea(int a) {\n\t\t\r\n\t}", "public Map<String, Object> getSubjectLocation() {\n return this.geoLocationPairs;\n }", "@Override\n\tpublic java.lang.String getAreaName() {\n\t\treturn _locMstLocation.getAreaName();\n\t}", "public abstract int getArea();", "public int getArea() {\n\t\treturn area;\n\t}", "public SubjectAreaResponse getSubjectAreaByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \"getSubjectAreaByGUID\";\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaResponse response = new SubjectAreaResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n response.setElement(handler.getBeanFromRepository(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n new Date(),\n methodName));\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public SubjectAreaResponse getSubjectAreaByName(String serverName,\n String userId,\n String qualifiedName)\n {\n final String methodName = \"getSubjectAreaByName\";\n final String qualifiedNameParameterName = \"qualifiedName\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaResponse response = new SubjectAreaResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n response.setElement(handler.getSubjectArea(userId,\n qualifiedName,\n qualifiedNameParameterName,\n false,\n false,\n new Date(),\n methodName));\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "@Override\r\n\tpublic List<Areas> queryAllHArea() {\n\t\treturn adi.queryAllHArea();\r\n\t}", "public List<ACSubjectInfo> getSubjects() {\n return subjects;\n }", "public java.util.List<? extends com.example.grpc.SimpleServiceOuterClass.AreaOrBuilder> \n getAreaOrBuilderList() {\n if (areaBuilder_ != null) {\n return areaBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(area_);\n }\n }", "public java.util.List<? extends com.example.grpc.SimpleServiceOuterClass.AreaOrBuilder> \n getAreaOrBuilderList() {\n if (areaBuilder_ != null) {\n return areaBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(area_);\n }\n }", "public java.util.List<? extends com.example.grpc.SimpleServiceOuterClass.AreaOrBuilder> \n getAreaOrBuilderList() {\n if (areaBuilder_ != null) {\n return areaBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(area_);\n }\n }", "public String getAreaName() {\n\t\tif (areaName == null) {\n\t\t\tProtectedRegion p = getPlot();\n\t\t\tPlotInfo info = plugin.getPlotInfo(worldName, p.getId());\n\t\t\tif (info != null) {\n\t\t\t\tareaName = info.areaName;\n\t\t\t}\n\t\t}\n\t\treturn areaName;\n\t}", "public String getArea_id() {\n return area_id;\n }", "AREA createAREA();", "public String getLocationArea() {\n return locationArea;\n }", "public String areaCode() {\n return areaCode;\n }", "public String[] getSubjects() {\n/* 329 */ return getStringArray(\"subject\");\n/* */ }", "public int getArea()\n {\n return area;\n }", "@Override\r\n\tpublic List<Area> getAreaList() {\n\t\tList<Area> areaList = areaDao.selectArea();\r\n\t\tSystem.out.println(areaList);\r\n\t\t\r\n\t\treturn areaList;\r\n\t}", "public void getArea() {\n\t\ts = (double) (a + b + c) / 2;\n\t\tarea = Math.sqrt(s * (s - a) * (s - b) * (s - c));\n\t\tSystem.out.println(\"Area: \" + area);\n\t}", "@Override\n\tpublic List<Area> getAreaList() {\n\t\treturn areaDao.queryArea();\n\t}", "public List getSubjectVariables() {\r\n return subjectVariables;\r\n }", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n return area_.get(index);\n }", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n return area_.get(index);\n }", "public com.example.grpc.SimpleServiceOuterClass.Area getArea(int index) {\n return area_.get(index);\n }", "public String getSubjects() {\r\n return subjects;\r\n }", "public List<Area> listarAreas(){\r\n return cVista.listarAreas();\r\n }", "public void getSubjectOfInterest() {\n\t\t// Output the present vector\n\t\tSystem.out.println(this.name + \" subjects of interest are: \" + this.subjectsOfInterest);\n\t\t// return this.subjectsOfInterest;\n\t}", "@Override\n\tpublic void area() {\n\t\tSystem.out.println(\"------------------------------\");\n\t\tSystem.out.println(this.name+\"的面积:\"+land1high*land1);\n\t}", "@Override\n public String toString() {\n return this.area + \"/\" + this.aisle + \"/\" + this.x + \"/\" + this.y + \"/\" + this.z;\n }", "@Override\n public float getArea() {\n int wart = 0;\n if (!roomList.isEmpty()){\n for (Room room : roomList){\n if (room instanceof Localization){\n wart += room.getArea();\n }\n }\n\n }\n return wart;\n }", "AdministrativeArea getAdministrativeArea();", "double getArea();", "double getArea();", "@AutoEscape\n\tpublic String getPersonnelSubArea();", "public double getArea();", "public double getArea();", "public double getArea();", "@AutoEscape\n\tpublic String getPersonnelArea();", "public void mostrarTareas(){\n System.out.println(\"Tareas existentes:\");\n System.out.println(tareas);\n }", "public SubjectInfo getSubjectInfo() {\r\n\t\treturn subjectInfo;\r\n\t}", "public ArrayList<AreaInfo> queryAreas(){\n\t\tArrayList<AreaInfo> areaInfos = new ArrayList<AreaInfo>();\n\t\t\n\t\ttry {\n\t\t\tmMysqlConnection = DriverManager\n\t\t\t\t.getConnection(getConnectionURI());\n\t\t\t\n\t\t\tmStatement = mMysqlConnection.createStatement();\n\t\t\tmResultSet = mStatement\n\t\t\t\t\t.executeQuery(\"select * from \" + mDbName + \".\" + TABLE_AREA);\n\t\t\t\n\t\t\t// store information of each area in the areInfos list\n\t\t\twhile (mResultSet.next()) {\n\t\t\t\tAreaInfo info = new AreaInfo();\n\t\t\t\t\n\t\t\t\tinfo.setAreaId( mResultSet.getInt(COLUMN_ID) );\n\t\t\t\tinfo.setAreaName( mResultSet.getString(COLUMN_NAME) );\n\t\t\t\tinfo.setAreaDescription( mResultSet.getString(COLUMN_DESCRIPTION) );\t\t\t\t\n\t\t\t\tinfo.setVersion( mResultSet.getInt(COLUMN_VERSION) );\n\t\t\t\t\n\t\t\t\tareaInfos.add(info);\n\t\t\t}\n\t\t\t\n\t\t\t// query tickets of an area\n\t\t\tfor(AreaInfo info : areaInfos){\n\t\t\t\tList< de.tudresden.inf.rn.mobilis.services.xhunt.proxy.Ticket> ticketTypes \n\t\t\t\t\t= new ArrayList< de.tudresden.inf.rn.mobilis.services.xhunt.proxy.Ticket >();\n\t\t\t\tArrayList<Ticket> tickets = queryAreaTickets(info.getAreaId());\n\t\t\t\t\n\t\t\t\tfor(Ticket ticket : tickets){\n\t\t\t\t\tticketTypes.add( new de.tudresden.inf.rn.mobilis.services.xhunt.proxy.Ticket( ticket.getId(), ticket.getName() ));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tinfo.setTickets( ticketTypes );\n\t\t\t}\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.severe(\"!EXCEPTION: \" + e.getMessage());\n\t\t}\n\t\t\n\t\tflush();\n\t\t\n\t\treturn areaInfos;\n\t}", "public void setArea(String area) {\n this.area = area;\n }", "public void setArea(String area) {\n this.area = area;\n }", "private static OspfArea areaDetails(JsonNode areaNode) {\n OspfArea area = new OspfAreaImpl();\n String areaId = areaNode.path(AREAID).asText();\n if (isValidIpAddress(areaId)) {\n area.setAreaId(Ip4Address.valueOf(areaId));\n } else {\n log.debug(\"Wrong areaId: {}\", areaId);\n return null;\n }\n String routerId = areaNode.path(ROUTERID).asText();\n if (isValidIpAddress(routerId)) {\n area.setRouterId(Ip4Address.valueOf(routerId));\n } else {\n log.debug(\"Wrong routerId: {}\", routerId);\n return null;\n }\n String routingCapability = areaNode.path(EXTERNALROUTINGCAPABILITY).asText();\n if (isBoolean(routingCapability)) {\n area.setExternalRoutingCapability(Boolean.valueOf(routingCapability));\n } else {\n log.debug(\"Wrong routingCapability: {}\", routingCapability);\n return null;\n }\n String isOpaqueEnabled = areaNode.path(ISOPAQUE).asText();\n if (isBoolean(isOpaqueEnabled)) {\n area.setIsOpaqueEnabled(Boolean.valueOf(isOpaqueEnabled));\n } else {\n log.debug(\"Wrong isOpaqueEnabled: {}\", isOpaqueEnabled);\n return null;\n }\n area.setOptions(OspfUtil.HELLO_PACKET_OPTIONS);\n\n return area;\n }", "public String getNombreArea() { return (this.nombreArea == null) ? \"\" : this.nombreArea; }", "public com.example.grpc.SimpleServiceOuterClass.AreaOrBuilder getAreaOrBuilder(\n int index) {\n return area_.get(index);\n }", "public com.example.grpc.SimpleServiceOuterClass.AreaOrBuilder getAreaOrBuilder(\n int index) {\n return area_.get(index);\n }", "public com.example.grpc.SimpleServiceOuterClass.AreaOrBuilder getAreaOrBuilder(\n int index) {\n return area_.get(index);\n }", "public java.util.List<? extends com.example.grpc.SimpleServiceOuterClass.AreaOrBuilder> \n getAreaOrBuilderList() {\n return area_;\n }", "public java.util.List<? extends com.example.grpc.SimpleServiceOuterClass.AreaOrBuilder> \n getAreaOrBuilderList() {\n return area_;\n }", "public java.util.List<? extends com.example.grpc.SimpleServiceOuterClass.AreaOrBuilder> \n getAreaOrBuilderList() {\n return area_;\n }", "private void mapAreaOne()\n\n {\n\n Area area = areaIDMap.get(Constants.FIRST_AREA_ID);\n\n area.areaMap.put(Constants.North, areaIDMap.get(Constants.SECOND_AREA_ID));\n\n area.areaMap.put(Constants.South, areaIDMap.get(Constants.FIFTH_AREA_ID));\n\n area.areaMap.put(Constants.East, areaIDMap.get(Constants.FOURTH_AREA_ID));\n\n area.areaMap.put(Constants.West, areaIDMap.get(Constants.SIXTH_AREA_ID));\n\n area.paths = Constants.NorthSouthEastAndWest;\n\n }", "public String getSubject() {\n/* 286 */ return getCOSObject().getString(COSName.SUBJ);\n/* */ }" ]
[ "0.60744494", "0.5970356", "0.5945063", "0.58944607", "0.58462304", "0.57586503", "0.5724986", "0.5699859", "0.56917435", "0.5687435", "0.5687435", "0.5687435", "0.56828934", "0.5672447", "0.5660366", "0.5601047", "0.5601047", "0.5601047", "0.5585816", "0.5570091", "0.5527149", "0.5518111", "0.5514284", "0.5514284", "0.5510274", "0.5495553", "0.5399913", "0.53584206", "0.53497607", "0.53497607", "0.53497607", "0.5331078", "0.5320109", "0.5320109", "0.5320109", "0.53118944", "0.5305246", "0.5304871", "0.5304871", "0.5304871", "0.5280359", "0.5224348", "0.52119005", "0.52119005", "0.52119005", "0.5206966", "0.52015054", "0.51995915", "0.51729965", "0.5170672", "0.51655036", "0.5163203", "0.5162773", "0.514855", "0.51473075", "0.51473075", "0.51473075", "0.51417905", "0.51414406", "0.5128476", "0.5111868", "0.51085675", "0.50982547", "0.5081956", "0.5074445", "0.5073787", "0.5060327", "0.50537324", "0.50391126", "0.50391126", "0.50391126", "0.50327283", "0.5031133", "0.50293595", "0.5026903", "0.50201917", "0.50182855", "0.501768", "0.5010656", "0.5010656", "0.50086284", "0.5007973", "0.5007973", "0.5007973", "0.5000265", "0.49933875", "0.4986066", "0.49744526", "0.49730998", "0.49670917", "0.49614054", "0.49475554", "0.49449253", "0.49449253", "0.49449253", "0.49437723", "0.49437723", "0.49437723", "0.49436164", "0.49404314" ]
0.50360715
71
Return information about a specific subject area and its linked governance definitions.
public SubjectAreaDefinitionResponse getSubjectAreaDefinitionByGUID(String serverName, String userId, String subjectAreaGUID) { final String methodName = "getSubjectAreaDefinitionByGUID"; final String subjectAreaGUIDParameterName = "subjectAreaGUID"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); SubjectAreaDefinitionResponse response = new SubjectAreaDefinitionResponse(); AuditLog auditLog = null; try { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); SubjectAreaHandler<SubjectAreaElement> subjectAreaHandler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName); SubjectAreaElement element = subjectAreaHandler.getBeanFromRepository(userId, subjectAreaGUID, subjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, false, false, new Date(), methodName); if (element != null) { SubjectAreaDefinition subjectAreaDefinition = new SubjectAreaDefinition(element); subjectAreaDefinition.setParentSubjectAreaGUID(subjectAreaHandler.getSubjectAreaParentGUID(userId, subjectAreaGUID, subjectAreaGUIDParameterName, false, false, new Date(), methodName)); subjectAreaDefinition.setNestedSubjectAreaGUIDs(subjectAreaHandler.getSubjectAreaChildrenGUIDs(userId, subjectAreaGUID, subjectAreaGUIDParameterName, false, false, new Date(), methodName)); GovernanceDefinitionHandler<GovernanceDefinitionElement> definitionHandler = instanceHandler.getGovernanceDefinitionHandler(userId, serverName, methodName); ElementStubConverter<ElementStub> elementStubConverter = instanceHandler.getElementStubConverter(userId, serverName, methodName); List<Relationship> relationships = definitionHandler.getGoverningDefinitionLinks(userId, subjectAreaGUID, subjectAreaGUIDParameterName, OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME, null, 0, 0, false, false, new Date(), methodName); List<ElementStub> definitions = elementStubConverter.getNewBeans(ElementStub.class, relationships, true, methodName); subjectAreaDefinition.setAssociatedGovernanceDefinitions(definitions); response.setProperties(subjectAreaDefinition); } } catch (Exception error) { restExceptionHandler.captureExceptions(response, error, methodName, auditLog); } restCallLogger.logRESTCallReturn(token, response.toString()); return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(value = \"unused\")\n public VoidResponse linkSubjectAreaToGovernanceDefinition(String serverName,\n String userId,\n String subjectAreaGUID,\n String definitionGUID,\n RelationshipRequestBody requestBody)\n {\n final String methodName = \"linkSubjectAreaToGovernanceDefinition\";\n\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n final String definitionGUIDParameterName = \"definitionGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n if (requestBody.getProperties() != null)\n {\n handler.linkElementToElement(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n requestBody.getProperties().getEffectiveFrom(),\n requestBody.getProperties().getEffectiveTo(),\n new Date(),\n methodName);\n }\n else\n {\n handler.linkElementToElement(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n (InstanceProperties) null,\n null,\n null,\n new Date(),\n methodName);\n }\n }\n else\n {\n handler.linkElementToElement(userId,\n null,\n null,\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n (InstanceProperties) null,\n null,\n null,\n new Date(),\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public AreaInfoExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "private static OspfArea areaDetails(JsonNode areaNode) {\n OspfArea area = new OspfAreaImpl();\n String areaId = areaNode.path(AREAID).asText();\n if (isValidIpAddress(areaId)) {\n area.setAreaId(Ip4Address.valueOf(areaId));\n } else {\n log.debug(\"Wrong areaId: {}\", areaId);\n return null;\n }\n String routerId = areaNode.path(ROUTERID).asText();\n if (isValidIpAddress(routerId)) {\n area.setRouterId(Ip4Address.valueOf(routerId));\n } else {\n log.debug(\"Wrong routerId: {}\", routerId);\n return null;\n }\n String routingCapability = areaNode.path(EXTERNALROUTINGCAPABILITY).asText();\n if (isBoolean(routingCapability)) {\n area.setExternalRoutingCapability(Boolean.valueOf(routingCapability));\n } else {\n log.debug(\"Wrong routingCapability: {}\", routingCapability);\n return null;\n }\n String isOpaqueEnabled = areaNode.path(ISOPAQUE).asText();\n if (isBoolean(isOpaqueEnabled)) {\n area.setIsOpaqueEnabled(Boolean.valueOf(isOpaqueEnabled));\n } else {\n log.debug(\"Wrong isOpaqueEnabled: {}\", isOpaqueEnabled);\n return null;\n }\n area.setOptions(OspfUtil.HELLO_PACKET_OPTIONS);\n\n return area;\n }", "public String getCourseArea() {\n return courseArea;\n }", "public SubjectAreaResponse getSubjectAreaByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \"getSubjectAreaByGUID\";\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaResponse response = new SubjectAreaResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n response.setElement(handler.getBeanFromRepository(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n new Date(),\n methodName));\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public String getAreaName()\n {\n return this.areaName;\n }", "public String getAreaName() {\n return areaName;\n }", "public String getAreaName() {\n return areaName;\n }", "public void testAreaInfo()\n\t{\n\t\tGameArea ga = new GameArea();\n\t\tga.areaInfo();\n\t\tga.setConditionsMet(true);\n\t\tga.setAreaProgress(1);\n\t\tga.areaInfo();\n\t\tga.areaInfo();\n\t\tga.setLoot(null);\n\t\tga.areaInfo();\n\t}", "public static void printAllAreas() {\r\n\t for (int i = 0; i <= 2967; i++) {\r\n\t System.out.println(\"Load Shedding Inforamtion: \" + LSItemsArray[i].getInformation()\r\n + \": Corresponding Areas: \" + LSItemsArray[i].getAreas());\r\n\r\n\t }\r\n\t }", "public String getInformation(ITextViewer textViewer, IRegion subject) {\n \t\treturn \"not null\"; //$NON-NLS-1$\n \t}", "public SubjectareasRecord() {\n\t\tsuper(Subjectareas.SUBJECTAREAS);\n\t}", "public String getSrcAreaOfExpertise() {\r\n return (String) getAttributeInternal(SRCAREAOFEXPERTISE);\r\n }", "public String getSubjectOfBiography() {return subjectOfBiography;}", "public String getAgency() {\r\n return agency;\r\n }", "public String getArea() {\n\t\treturn area;\n\t}", "public abstract String getArea();", "Collection<LocatorIF> getSubjectIdentifiers();", "public LinkedList<Area> getAreas(){\n\t\treturn areas;\n\t}", "public String getArea() {\n return area;\n }", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public String getArea_id() {\n return area_id;\n }", "public Agreement getAgreement() {\n\t\treturn this.agreement;\n\t}", "public String getArea() {\n return area;\n }", "public String getArea() {\n return area;\n }", "public String getArea() {\n return area;\n }", "String getOrganization();", "public Iterable<StudentQualificationOrgDetail> getOrganizationData(){\n\t\t\n\t\treturn sqcOrgRepository.findAll();\n\t}", "public String getArea() {\n return this.area;\n }", "public SubjectInfo getSubjectInfo() {\r\n\t\treturn subjectInfo;\r\n\t}", "org.hl7.fhir.ResourceReference getSubject();", "@AutoEscape\n\tpublic String getPersonnelSubArea();", "public String getAuthorizedArea() {\n return (String)getAttributeInternal(AUTHORIZEDAREA);\n }", "@AutoEscape\n\tpublic String getPersonnelArea();", "public List<Agent> listOfAgentByArea(String servicePointCode);", "ImmutableList<SchemaOrgType> getAboutList();", "AdministrativeArea getAdministrativeArea();", "public void viewDetails(){\n for(int i = 0; i < roads.size(); i++){\n System.out.println(roads.get(i).getName());\n System.out.println(roads.get(i).getNorthStatus() + \" - \" + roads.get(i).getNorthAdvisory());\n System.out.println(roads.get(i).getSouthStatus() + \" - \" + roads.get(i).getSouthAdvisory() + \"\\n\");\n }\n }", "public String toString ()\n\t{\n\t\treturn new String (\"[\" + ancho+ \", \" + alto + \"], Area = \" + area);\n\t}", "public SubjectInfo getSubject() {\n return this.subject;\n }", "private static String[] getActualCoursesDetailInfo(ActualCourse actualCourse) {\n String startTime = DateHandlerUtils.dateToString(DateFormatConstants.YYYY_MM_DD_HH_MM, actualCourse.getCourseStartTime());\n String endTime = DateHandlerUtils.dateToString(DateFormatConstants.HH_MM, actualCourse.getCourseEndTime());\n String time = startTime + EmailConstant.MIDDLE_LINE + endTime;\n String[] data = new String[] { replaceNullDataToTBD(actualCourse.getCourseName()), replaceNullDataToTBD(actualCourse.getCourseRoomNum()),\n replaceNullDataToTBD(time), replaceNullDataToTBD(actualCourse.getCourseTrainer()) };\n return data;\n }", "public java.lang.String getCity( EAIMMCtxtIfc theCtxt) throws EAIException ;", "public String getAreaCode() {\n return areaCode;\n }", "public String getAreaCode() {\n return areaCode;\n }", "ImmutableList<SchemaOrgType> getEducationalAlignmentList();", "public String getAreaCode() {\n return this.areaCode;\n }", "public String aadAuthority() {\n return this.aadAuthority;\n }", "public String areaCode() {\n return areaCode;\n }", "public String getAcademicRequirements() {\r\n return academicRequirements;\r\n }", "public ArrayList getMandalDetails(DataSource ds, String district_id) throws SADAREMDBException,SQLException;", "ImmutableList<SchemaOrgType> getAccessibilityHazardList();", "public Area getArea(Area area) {\r\n\t\treturn this.getArea(area.getId());\r\n\t}", "public void setCourseArea(String courseArea) {\n this.courseArea = courseArea;\n }", "public String getAreaCode() \n\t{\n\t\treturn getNumber().substring(1,4);\n\t}", "@gw.internal.gosu.parser.ExtendedProperty\n public typekey.AccidentDetailPEL getAccidentDetail();", "public SubjectHierarchy getSubjectHierarchy();", "public SubjectAreaResponse getSubjectAreaByName(String serverName,\n String userId,\n String qualifiedName)\n {\n final String methodName = \"getSubjectAreaByName\";\n final String qualifiedNameParameterName = \"qualifiedName\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaResponse response = new SubjectAreaResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n response.setElement(handler.getSubjectArea(userId,\n qualifiedName,\n qualifiedNameParameterName,\n false,\n false,\n new Date(),\n methodName));\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "@SuppressWarnings(value = \"unused\")\n public VoidResponse unlinkSubjectAreaFromGovernanceDefinition(String serverName,\n String userId,\n String subjectAreaGUID,\n String definitionGUID,\n RelationshipRequestBody requestBody)\n {\n final String methodName = \"unlinkSubjectAreaToGovernanceDefinition\";\n\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n final String definitionGUIDParameterName = \"definitionGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n handler.unlinkElementFromElement(userId,\n false,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n methodName);\n }\n else\n {\n handler.unlinkElementFromElement(userId,\n false,\n null,\n null,\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public String toString()\n {\n return getClass().getName() + \"[name=\" + name + \",area=\" + area + \"]\";\n }", "public void roadList(){\n for(int i = 0; i < roads.size(); i++){\n System.out.println(i + \" \" + roads.get(i).start.getCityName() + \", \" + roads.get(i).end.getCityName());\n }\n }", "String getAssignmentApproaches();", "@Override\n\tpublic java.lang.String getAreaName() {\n\t\treturn _locMstLocation.getAreaName();\n\t}", "public String getAllSubjectName() {\n\t\tString sub = Messages.getString(\"AccessSub.0\"); //$NON-NLS-1$\n\t\t// Defined connection, rs and cs to connect and query database\n\t\tcn = LibConnection.getConnection();\n\t\ttry {\n\t\t\tcsDetails = cn.prepareCall(LibProcedure.GET_ALL_SUBNAME);\n\t\t\trsDetails = csDetails.executeQuery();\n\t\t\twhile (rsDetails.next()) {\n\t\t\t\tsub += rsDetails.getString(1)\n\t\t\t\t\t\t+ Messages.getString(\"AccessSub.1\"); //$NON-NLS-1$\n\t\t\t}\n\t\t\treturn sub;\n\t\t} catch (SQLException ex) {\n\t\t\tex.printStackTrace();\n\t\t} finally {\n\t\t\t// close all connect\n\t\t\tLibConnection.close(rsDetails);\n\t\t\tLibConnection.close(csDetails);\n\t\t\tLibConnection.close(cn);\n\t\t}\n\t\treturn Messages.getString(\"AccessSub.2\"); //$NON-NLS-1$\n\t}", "public List<Map<String,String>> getCCIData(int iusid, int timeperiodid,\n\t\t\tint areaId);", "org.hl7.fhir.CodeableConcept getBodySite();", "public java.lang.String getCA() {\n return CA;\n }", "@ApiModelProperty(value = \"Details of the organization as provided to the issuer.\")\n public OrganizationDetails getOrgDetails() {\n return orgDetails;\n }", "public List<ACSubjectInfo> getSubjects() {\n return subjects;\n }", "public void showDetails(){\r\n\t\tSystem.out.println(\"Length is : \"+getLength());\r\n\t\tSystem.out.println(\"Width is : \"+getWidth());\r\n\t\tSystem.out.println(\"Area Of Rectangle is : \"+area());\r\n\t}", "String legalTerms();", "public Response getOrgByIdentifiers(String accountIdentifier, String orgIdentifier) {\n RequestSpecification requestSpecification = genericRequestBuilder.getRequestSpecificationObjectNG();\n requestSpecification.pathParam(\"accountIdentifier\", accountIdentifier);\n requestSpecification.pathParam(\"orgIdentifier\", orgIdentifier);\n log.info(\"Get the Org details for the account: \" + accountIdentifier);\n Response response = genericRequestBuilder.getCall(requestSpecification, OrgConstants.URI_ORG_IDENTIFIERS);\n\n return response;\n }", "public void setArea(String area) {\n this.area = area;\n }", "public String getSubject() {\n/* 286 */ return getCOSObject().getString(COSName.SUBJ);\n/* */ }", "public int getAreaNo() {\n return areaNo_;\n }", "public void getArea() {\n\t\ts = (double) (a + b + c) / 2;\n\t\tarea = Math.sqrt(s * (s - a) * (s - b) * (s - c));\n\t\tSystem.out.println(\"Area: \" + area);\n\t}", "public String getAgentAlias() {\n return (String)getAttributeInternal(AGENTALIAS);\n }", "List<AreaMaster> findByName(String areaName);", "public String getAreaName() {\n\t\tif (areaName == null) {\n\t\t\tProtectedRegion p = getPlot();\n\t\t\tPlotInfo info = plugin.getPlotInfo(worldName, p.getId());\n\t\t\tif (info != null) {\n\t\t\t\tareaName = info.areaName;\n\t\t\t}\n\t\t}\n\t\treturn areaName;\n\t}", "public int getAreaNo() {\n return areaNo_;\n }", "Party getOrganizationParty();", "public void getSubjectOfInterest() {\n\t\t// Output the present vector\n\t\tSystem.out.println(this.name + \" subjects of interest are: \" + this.subjectsOfInterest);\n\t\t// return this.subjectsOfInterest;\n\t}", "public void setArea(String area) {\n this.area = area;\n }", "public String getBuildingarea() {\r\n\t\treturn buildingarea;\r\n\t}", "ImmutableList<SchemaOrgType> getAwardList();", "ImmutableList<SchemaOrgType> getAudienceList();", "@Override\r\n\tpublic String toString() {\r\n\r\n\t\treturn \"My rectangle's Areas is \"+area();\r\n\t}", "ImmutableList<SchemaOrgType> getAccessibilityAPIList();", "String organizationName();" ]
[ "0.5607668", "0.52910304", "0.51649773", "0.5041852", "0.50163937", "0.4921489", "0.49029437", "0.49029437", "0.48730204", "0.4805235", "0.47746584", "0.4768294", "0.47668087", "0.47549576", "0.4735034", "0.47233018", "0.47212762", "0.47040582", "0.46897906", "0.46893087", "0.46874693", "0.46874693", "0.46874693", "0.46874693", "0.46874693", "0.46874693", "0.46874693", "0.46874693", "0.46874693", "0.46874693", "0.46874693", "0.46874693", "0.46874693", "0.4675826", "0.46661893", "0.46648216", "0.46648216", "0.46648216", "0.46405876", "0.46360165", "0.4622327", "0.4609235", "0.4606556", "0.4591912", "0.4584712", "0.45825997", "0.4577346", "0.45606792", "0.45512673", "0.4543363", "0.45431986", "0.4522615", "0.45220265", "0.4507197", "0.45055756", "0.45055756", "0.4504954", "0.44933313", "0.44914863", "0.4486421", "0.44835284", "0.44558164", "0.44425368", "0.44408932", "0.44356763", "0.44353646", "0.443142", "0.4430444", "0.44298828", "0.4419716", "0.44134367", "0.44098356", "0.4408969", "0.4391656", "0.43853036", "0.4384269", "0.43837583", "0.43694547", "0.43688136", "0.43596834", "0.43561572", "0.43509603", "0.43503445", "0.4349596", "0.43469644", "0.43440148", "0.43336397", "0.4322797", "0.4321669", "0.43210626", "0.4319792", "0.43122137", "0.43081582", "0.4307402", "0.43063316", "0.4304214", "0.43021026", "0.4300489", "0.429841", "0.42959344" ]
0.57703966
0
Add a subject area classification to a referenceable element.
public VoidResponse addSubjectAreaMemberClassification(String serverName, String userId, String elementGUID, ClassificationRequestBody requestBody) { final String methodName = "addSubjectAreaMemberClassification"; final String elementGUIDParameterName = "elementGUID"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); VoidResponse response = new VoidResponse(); AuditLog auditLog = null; try { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); ReferenceableHandler<RelatedElement> handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); if (requestBody != null) { if (requestBody.getProperties() instanceof SubjectAreaClassificationProperties) { SubjectAreaClassificationProperties properties = (SubjectAreaClassificationProperties)requestBody.getProperties(); handler.addSubjectAreaClassification(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), elementGUID, elementGUIDParameterName, OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, properties.getSubjectAreaName(), false, false, properties.getEffectiveFrom(), properties.getEffectiveTo(), null, methodName); } else { restExceptionHandler.handleInvalidPropertiesObject(SubjectAreaClassificationProperties.class.getName(), methodName); } } else { restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); } } catch (Exception error) { restExceptionHandler.captureExceptions(response, error, methodName, auditLog); } restCallLogger.logRESTCallReturn(token, response.toString()); return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "org.landxml.schema.landXML11.ClassificationDocument.Classification addNewClassification();", "public void setArea(String area) {\n this.area = area;\n }", "public void setArea(String area) {\n this.area = area;\n }", "public void setArea(String area) {\n\t\tthis.area = area;\n\t}", "@Override\n public final void setArea(JQLayoutArea area)\n {\n if (area != null)\n {\n removeClass(area.getAreaClass().toString());\n }\n this.area = area;\n if (this.area != null)\n {\n addClass(this.area.getAreaClass().toString());\n }\n }", "@Test\n\tpublic void driverAssignArea() {\n\t\tfinal Object testingData[][] = {\n\n\t\t\t{\n\t\t\t\t\"chapter3\", \"area3\", null\n\t\t\t},//1. All fine\n\t\t\t{\n\t\t\t\t\"chapter1\", \"area3\", IllegalArgumentException.class\n\t\t\t},//2. A Chapter who have an area, self-assing another area\n\n\t\t};\n\n\t\tfor (int i = 0; i < testingData.length; i++)\n\t\t\tthis.templateAssignArea((String) testingData[i][0], (String) testingData[i][1], (Class<?>) testingData[i][2]);\n\n\t}", "public void setArea(Polygon area) {\n\t\tthis.area = area;\n\t}", "public void setArea_id(String area_id) {\n this.area_id = area_id;\n }", "public SubjectareasRecord() {\n\t\tsuper(Subjectareas.SUBJECTAREAS);\n\t}", "@Override\n\tpublic int insertArea(Area area) {\n\t\treturn areaMapper.insertArea(area);\n\t}", "public interface AreaOccupier {\n}", "public void claShapeArea(){\r\n\t\tshape.calArea();\r\n\t}", "@Override\n\t@XmlElement\n\tpublic void setAreaCode(String areaCode) {\n\t\t\n\t}", "org.hl7.fhir.ResourceReference addNewSubject();", "public void setAreaId(Integer areaId) {\n this.areaId = areaId;\n }", "public void setAreaId(Integer areaId) {\n this.areaId = areaId;\n }", "public abstract Area newArea();", "public void setPersonnelSubArea(String personnelSubArea);", "public void setCourseArea(String courseArea) {\n this.courseArea = courseArea;\n }", "@SuppressWarnings(value = \"unused\")\n public VoidResponse linkSubjectAreaToGovernanceDefinition(String serverName,\n String userId,\n String subjectAreaGUID,\n String definitionGUID,\n RelationshipRequestBody requestBody)\n {\n final String methodName = \"linkSubjectAreaToGovernanceDefinition\";\n\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n final String definitionGUIDParameterName = \"definitionGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n if (requestBody.getProperties() != null)\n {\n handler.linkElementToElement(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n requestBody.getProperties().getEffectiveFrom(),\n requestBody.getProperties().getEffectiveTo(),\n new Date(),\n methodName);\n }\n else\n {\n handler.linkElementToElement(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n (InstanceProperties) null,\n null,\n null,\n new Date(),\n methodName);\n }\n }\n else\n {\n handler.linkElementToElement(userId,\n null,\n null,\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n (InstanceProperties) null,\n null,\n null,\n new Date(),\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public static void addClassifiedFeature(Classification classification, ClassifiedFeature classifiedFeature) {\n Feature feature = classifiedFeature.getFeature();\n boolean containedInView = ClassificationCache.getInstance().isFeatureContainedInView(classification, feature);\n if (containedInView) {\n classification.getClassifiedFeatures().add(classifiedFeature);\n } else {\n classification.getAutoCompleteFeatures().add(classifiedFeature);\n }\n }", "public ContourEntity(Shape area, String toolTipText) { super(area, toolTipText); }", "private void mapAreaOne()\n\n {\n\n Area area = areaIDMap.get(Constants.FIRST_AREA_ID);\n\n area.areaMap.put(Constants.North, areaIDMap.get(Constants.SECOND_AREA_ID));\n\n area.areaMap.put(Constants.South, areaIDMap.get(Constants.FIFTH_AREA_ID));\n\n area.areaMap.put(Constants.East, areaIDMap.get(Constants.FOURTH_AREA_ID));\n\n area.areaMap.put(Constants.West, areaIDMap.get(Constants.SIXTH_AREA_ID));\n\n area.paths = Constants.NorthSouthEastAndWest;\n\n }", "public void setArea(String area) {\n this.area = area == null ? null : area.trim();\n }", "public void setArea(String area) {\n this.area = area == null ? null : area.trim();\n }", "public AreaInfoExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public void setAreaCode(String areaCode) {\n this.areaCode = areaCode;\n }", "public void SetArea(double area) {\n OCCwrapJavaJNI.ShapeAnalysis_FreeBoundData_SetArea(swigCPtr, this, area);\n }", "@Override\n\tpublic AreaExecution addArea(Area area) {\n\t\treturn null;\n\t}", "public SafetyNetArea createArea(SafetyNetArea area) {\n\n String typeId = area.getPromulgationType().getTypeId();\n log.info(\"Creating SafetyNET area \" + area.getName() + \" for promulgation type \" + typeId);\n\n area.setPromulgationType(promulgationTypeService.getPromulgationType(typeId));\n return saveEntity(area);\n }", "public void addSubject(Subject subject) {\n\t\t\r\n\t}", "public void recibirId(AreaInvestigacion a) {\r\n\t\tarea = a;\r\n\t}", "public void setAreaName(String areaName) {\n this.areaName = areaName;\n }", "public void setAreaName(String areaName) {\n this.areaName = areaName;\n }", "AREA createAREA();", "public void addExample(String classKey, Roi roi, String type) ;", "public void setNombreArea(String p) { this.nombreArea = p; }", "public SubjectAreaDefinitionResponse getSubjectAreaDefinitionByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \"getSubjectAreaDefinitionByGUID\";\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaDefinitionResponse response = new SubjectAreaDefinitionResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> subjectAreaHandler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n SubjectAreaElement element = subjectAreaHandler.getBeanFromRepository(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n new Date(),\n methodName);\n if (element != null)\n {\n SubjectAreaDefinition subjectAreaDefinition = new SubjectAreaDefinition(element);\n\n subjectAreaDefinition.setParentSubjectAreaGUID(subjectAreaHandler.getSubjectAreaParentGUID(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n subjectAreaDefinition.setNestedSubjectAreaGUIDs(subjectAreaHandler.getSubjectAreaChildrenGUIDs(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n GovernanceDefinitionHandler<GovernanceDefinitionElement> definitionHandler = instanceHandler.getGovernanceDefinitionHandler(userId, serverName, methodName);\n ElementStubConverter<ElementStub> elementStubConverter = instanceHandler.getElementStubConverter(userId, serverName, methodName);\n List<Relationship> relationships = definitionHandler.getGoverningDefinitionLinks(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n 0,\n 0,\n false,\n false,\n new Date(),\n methodName);\n List<ElementStub> definitions = elementStubConverter.getNewBeans(ElementStub.class, relationships, true, methodName);\n subjectAreaDefinition.setAssociatedGovernanceDefinitions(definitions);\n\n response.setProperties(subjectAreaDefinition);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public ClientSideImageMap addShapeArea(AbstractLink link, Shape shape)\r\n\t{\r\n\t\tareas.add(link);\r\n\t\tlink.add(new Area(shapeCoordinates(shape), POLYGON));\r\n\t\treturn this;\r\n\t}", "public com.example.grpc.SimpleServiceOuterClass.Area.Builder addAreaBuilder() {\n return getAreaFieldBuilder().addBuilder(\n com.example.grpc.SimpleServiceOuterClass.Area.getDefaultInstance());\n }", "public com.example.grpc.SimpleServiceOuterClass.Area.Builder addAreaBuilder() {\n return getAreaFieldBuilder().addBuilder(\n com.example.grpc.SimpleServiceOuterClass.Area.getDefaultInstance());\n }", "public com.example.grpc.SimpleServiceOuterClass.Area.Builder addAreaBuilder() {\n return getAreaFieldBuilder().addBuilder(\n com.example.grpc.SimpleServiceOuterClass.Area.getDefaultInstance());\n }", "void addHas_certainty(Object newHas_certainty);", "@Override\n\tpublic void visit(OWLClassAssertionAxiom axiom) {\n\n\t\taddFact(RewritingVocabulary.ISA,//\n\t\t\t\taxiom.getIndividual().asOWLNamedIndividual().getIRI(), //\n\t\t\t\taxiom.getClassExpression().asOWLClass().getIRI());\n\t}", "public ContourEntity(Shape area, String toolTipText, String urlText) { super(area, toolTipText, urlText); }", "public Area() {\n\t}", "public VoidResponse deleteSubjectAreaMemberClassification(String serverName,\n String userId,\n String elementGUID,\n ExternalSourceRequestBody requestBody)\n {\n final String methodName = \"deleteSubjectAreaMemberClassification\";\n final String elementGUIDParameterName = \"elementGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n ReferenceableHandler<RelatedElement> handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n handler.removeSubjectAreaClassification(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n elementGUID,\n elementGUIDParameterName,\n OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME,\n false,\n false,\n null,\n methodName);\n }\n else\n {\n handler.removeSubjectAreaClassification(userId,\n null,\n null,\n elementGUID,\n elementGUIDParameterName,\n OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME,\n false,\n false,\n null,\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public Builder addArea(com.example.grpc.SimpleServiceOuterClass.Area value) {\n if (areaBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureAreaIsMutable();\n area_.add(value);\n onChanged();\n } else {\n areaBuilder_.addMessage(value);\n }\n return this;\n }", "public Builder addArea(com.example.grpc.SimpleServiceOuterClass.Area value) {\n if (areaBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureAreaIsMutable();\n area_.add(value);\n onChanged();\n } else {\n areaBuilder_.addMessage(value);\n }\n return this;\n }", "public Builder addArea(com.example.grpc.SimpleServiceOuterClass.Area value) {\n if (areaBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureAreaIsMutable();\n area_.add(value);\n onChanged();\n } else {\n areaBuilder_.addMessage(value);\n }\n return this;\n }", "public void addToCategoryScores(entity.ReviewSummaryCategoryScore element);", "public Area() {\n }", "public ClientSideImageMap addPolygonArea(AbstractLink link, int... coordinates)\r\n\t{\r\n\t\tareas.add(link);\r\n\r\n\t\tlink.add(new Area(polygonCoordinates(coordinates), POLYGON));\r\n\r\n\t\treturn this;\r\n\t}", "public void setClusterArea(String clusterArea) {\r\n this.clusterArea = clusterArea;\r\n }", "void addIsBoundaryNodeOf(Boundary newIsBoundaryNodeOf);", "public void setNombreCodigoArea(String p) { this.nombreCodigoArea = p; }", "@Override\n\t@Transactional\n\tpublic void save(Area area) {\n\t\tdao.save(area);\n\t}", "default TArea createArea(AreaFactory<TContent, TArea> areaSupplier)\n {\n return areaSupplier.createArea();\n }", "public void setAreacode(Integer areacode) {\n this.areacode = areacode;\n }", "@Override\r\n\tpublic void getarea(int a) {\n\t\t\r\n\t}", "@POST\n\t@Consumes({ MediaType.APPLICATION_JSON })\n\t@Produces({ MediaType.APPLICATION_JSON })\n\tpublic Response add(final AreaTO areaTO) {\n\n\t\tfinal AreaTO resultTO = new AreaTO();\n\n\t\ttry {\n\n\t\t\tArea area = new Area();\n PropertyUtils.copyProperties(area, areaTO);\n\t\t\tfinal Users user = this.usersService.findByCDSID(this.requestContext.getUserId());\n\t\t\tarea.setCountryC(FunctionsUtils.validateInteger(user.getCountryDbC()));\n\t\t\tarea.setCreatedY(this.dateTimeSqlService.currentDateTimeSql().getDatetime());\n\t\t\tarea.setCreatedUserC(this.requestContext.getUserId());\n\t\t\tarea.setStatusR(1);\n\n\t\t\tarea = this.areaService.insertAndReturnObj(area);\n\t\t\tPropertyUtils.copyProperties(resultTO, area);\n\n\t\t} catch (final ApplicationException e) {\n\n\t\t\tfinal ErrorTO erro = new ErrorTO();\n\t\t\terro.setCodigoIncident(e.getLogReferenceCode());\n\n\t\t\tfinal ResourceBundle bundle = ResourceBundle.getBundle(\"ApplicationResources\");\n\n\t\t\tfinal List<ErrorType> erros = e.getErrorTypes();\n\n\t\t\tfor (final ErrorType errorType : erros) {\n\t\t\t\terro.setMessage(bundle.getString(errorType.getKey()));\n\t\t\t}\n\n\t\t\treturn this.buildResponse(erro, Status.INTERNAL_SERVER_ERROR);\n\t\t} catch (final Exception ex) {\n\n\t\t\tfinal ErrorTO erro = new ErrorTO();\n\t\t\terro.setMessage(\"Fatal Error\");\n\n\t\t\treturn this.buildResponse(erro, Status.INTERNAL_SERVER_ERROR);\n\t\t}\n\n\t\treturn buildResponseWithOkStatus(resultTO);\n\t}", "public void setPersonnelArea(String personnelArea);", "public void setAreaOfInterest(ReferencedEnvelope aoe) {\n PBounds cRect = getCamera().getViewBounds();\n ReferencedEnvelope envelope = new ReferencedEnvelope(getCRS());\n\n double dx = aoe.getWidth() / cRect.getWidth();\n double dy = aoe.getHeight() / cRect.getHeight();\n\n double scale;\n double wid, hi;\n if (dx > dy) {\n scale = dx;\n } else { //dy > dx\n scale = dy;\n }\n wid = scale * cRect.getWidth();\n hi = scale * cRect.getHeight();\n\n double w2 = wid / 2.0;\n double h2 = hi / 2.0;\n\n envelope.init(aoe.getMedian(0) - w2, aoe.getMedian(0) + w2, aoe.getMedian(1) - h2, aoe.getMedian(1) + h2);\n setAreaOfInterest_preScaled(envelope);\n }", "void setClassificationArray(org.landxml.schema.landXML11.ClassificationDocument.Classification[] classificationArray);", "org.hl7.fhir.ObservationReferenceRange addNewReferenceRange();", "public void fill(ELandscapeType type, IMapArea area) {\n\t\tList<ShortPoint2D> points = area.stream().filterBounds(width, height).toList();\n\t\tlandscapeEditor.fill(type, points);\n\n\t\tif(backgroundListener != null) {\n\t\t\tint size = points.size();\n\t\t\tfor(int i = 0; i != size; i++) {\n\t\t\t\tShortPoint2D pt = points.get(i);\n\t\t\t\tbackgroundListener.backgroundLineChangedAt(pt.x, pt.y, 1);\n\t\t\t}\n\t\t}\n\t}", "PlotAreaType createPlotAreaType();", "@Override\n\t\tpublic void annotate(JCas arg0) throws AnalysisEngineProcessException {\n\t\t\t\n\t\t}", "public void register(Course crs)\r\n {\r\n crs.addProf(this);\r\n }", "public void setLocationArea(String locationArea) {\n this.locationArea = locationArea;\n }", "public void setAreaCode(int value) {\r\n this.areaCode = value;\r\n }", "org.landxml.schema.landXML11.RoadsideDocument.Roadside addNewRoadside();", "@Override\r\n\tpublic boolean fillInArea(final XMLTag piece, final Map<String,Object> defined, final Area A, final int direction) throws CMException\r\n\t{\r\n\t\tfinal String layoutType = findStringNow(\"layout\",piece,defined);\r\n\t\tif((layoutType==null)||(layoutType.trim().length()==0))\r\n\t\t\tthrow new CMException(\"Unable to build area without defined layout\");\r\n\t\tfinal LayoutManager layoutManager = getLayoutManager(layoutType);\r\n\t\tif(layoutManager == null)\r\n\t\t\tthrow new CMException(\"Undefined Layout \"+layoutType);\r\n\t\tdefined.put(\"AREA_LAYOUT\",layoutManager.name());\r\n\t\tString size = findStringNow(\"size\",piece,defined);\r\n\t\tif(CMath.isMathExpression(size))\r\n\t\t\tsize=Integer.toString(CMath.parseIntExpression(size));\r\n\t\tif((!CMath.isInteger(size))||(CMath.s_int(size)<=0))\r\n\t\t\tthrow new CMException(\"Unable to build area of size \"+size);\r\n\t\tdefined.put(\"AREA_SIZE\",size);\r\n\t\tfinal List<String> ignoreStats=new XArrayList<String>(new String[]{\"CLASS\",\"NAME\",\"DESCRIPTION\",\"LAYOUT\",\"SIZE\"});\r\n\t\tfillOutStatCodes(A, ignoreStats,\"AREA_\",piece,defined);\r\n\r\n\t\tfinal List<Ability> aV = findAffects(A,piece,defined,null);\r\n\t\tfor(int i=0;i<aV.size();i++)\r\n\t\t{\r\n\t\t\tfinal Ability AB=aV.get(i);\r\n\t\t\tA.setSavable(true);\r\n\t\t\tA.addNonUninvokableEffect(AB);\r\n\t\t}\r\n\t\tfinal List<Behavior> bV = findBehaviors(A,piece,defined);\r\n\t\tfor(int i=0;i<bV.size();i++)\r\n\t\t{\r\n\t\t\tfinal Behavior B=bV.get(i);\r\n\t\t\tB.setSavable(true);\r\n\t\t\tA.addBehavior(B);\r\n\t\t}\r\n\r\n\t\tCMLib.map().addArea(A); // necessary for proper naming.\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\tlayOutRooms(A, layoutManager, CMath.s_int(size), direction, piece, defined);\r\n\t\t\tCMLib.map().delArea(A); // we added it for id assignment, now we are done.\r\n\t\t}\r\n\t\tcatch(final Exception t)\r\n\t\t{\r\n\t\t\tCMLib.map().delArea(A);\r\n\t\t\tCMLib.map().emptyAreaAndDestroyRooms(A);\r\n\t\t\tA.destroy();\r\n\t\t\tif(t instanceof CMException)\r\n\t\t\t\tthrow (CMException)t;\r\n\t\t\tthrow new CMException(t.getMessage(),t);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public Tarea(String tipo, String area, int unidades) {\n\t\tsetTipo(tipo);\n\t\tsetArea(area);\n\t\tsetUnidades(unidades);\n\t\t//inicialmente no le pertenece a nadie\n\t\tsetAsignada(null);\n\t}", "public void setAccidentCircumstance(typekey.AccidentCircumstancePEL value);", "public JSONObject addAccidentLocation(String area,String district, String region,String road_name, String road_no, String road_kilo_mark, String intersection_name,String intersection_no,String intersection_kilo_mark){\n // Building Parameters\n List<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();\n\n params.add(new BasicNameValuePair(\"tag\", accident_location_tag));\n params.add(new BasicNameValuePair(\"accident_area\", area));\n params.add(new BasicNameValuePair(\"district\", district));\n params.add(new BasicNameValuePair(\"region\", region));\n params.add(new BasicNameValuePair(\"road_name\", road_name ));\n params.add(new BasicNameValuePair(\"road_no\", road_no));\n params.add(new BasicNameValuePair(\"road_kilo_mark\", road_kilo_mark));\n params.add(new BasicNameValuePair(\"intersection_name\", intersection_name));\n params.add(new BasicNameValuePair(\"intersection_no\", intersection_no));\n params.add(new BasicNameValuePair(\"intersection_kilo_mark\", intersection_kilo_mark));\n\n JSONObject json = jsonParser.getJSONFromUrl(accident_locationURL,params);\n return json;\n }", "public void addToLinesOfBusiness(entity.AppCritLineOfBusiness element);", "public T caseArea(Area object)\n {\n return null;\n }", "public static void main(String[] args) \r\n\t{\nBAssociation b= new BAssociation();\r\nb.a= new Aassociation();\r\nb.a.areaofRectangle(5, 6);\r\n\t\t\r\n\t}", "public GUIDResponse createSubjectArea(String serverName,\n String userId,\n ReferenceableRequestBody requestBody)\n {\n final String methodName = \"createSubjectArea\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n GUIDResponse response = new GUIDResponse();\n AuditLog auditLog = null;\n\n try\n {\n if (requestBody != null)\n {\n if (requestBody.getProperties() instanceof SubjectAreaProperties)\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n SubjectAreaProperties properties = (SubjectAreaProperties)requestBody.getProperties();\n\n String subjectAreaGUID = handler.createSubjectArea(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n properties.getQualifiedName(),\n properties.getSubjectAreaName(),\n properties.getDisplayName(),\n properties.getDescription(),\n properties.getUsage(),\n properties.getScope(),\n properties.getDomainIdentifier(),\n properties.getAdditionalProperties(),\n properties.getTypeName(),\n properties.getExtendedProperties(),\n new Date(),\n methodName);\n\n response.setGUID(subjectAreaGUID);\n }\n else\n {\n restExceptionHandler.handleInvalidPropertiesObject(SubjectAreaProperties.class.getName(), methodName);\n }\n }\n else\n {\n restExceptionHandler.handleNoRequestBody(userId, methodName, serverName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public String getArea() {\n return this.area;\n }", "@Override\n\tpublic void add(cp_company cp) {\n\t\t\n\t}", "public void addTarea(String nombreTarea){\n tareas.add(nombreTarea);\n }", "public void addTarea(String nombreTarea){\n tareas.add(nombreTarea);\n }", "abstract double area();", "abstract double area();", "abstract double area();", "abstract double area();", "public void setCodigoArea(int p) { this.codigoArea = p; }", "public void setCodigoArea(int p) { this.codigoArea = p; }", "void addAssociation(Association association);", "private static void addAnnotations(Elements elements, AnnotatedTypeFactory atypeFactory,\n AnnotatedTypeMirror alub,\n ArrayList<AnnotatedTypeMirror> types) {\n Set<AnnotatedTypeMirror> visited = Collections.newSetFromMap(new IdentityHashMap<AnnotatedTypeMirror,Boolean>());\n addAnnotationsImpl(elements, atypeFactory, alub, visited, types);\n }", "public Builder addArea(\n int index, com.example.grpc.SimpleServiceOuterClass.Area value) {\n if (areaBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureAreaIsMutable();\n area_.add(index, value);\n onChanged();\n } else {\n areaBuilder_.addMessage(index, value);\n }\n return this;\n }", "public Builder addArea(\n int index, com.example.grpc.SimpleServiceOuterClass.Area value) {\n if (areaBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureAreaIsMutable();\n area_.add(index, value);\n onChanged();\n } else {\n areaBuilder_.addMessage(index, value);\n }\n return this;\n }", "public Builder addArea(\n int index, com.example.grpc.SimpleServiceOuterClass.Area value) {\n if (areaBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureAreaIsMutable();\n area_.add(index, value);\n onChanged();\n } else {\n areaBuilder_.addMessage(index, value);\n }\n return this;\n }", "public Association associate(Node targetNode, QName associationTypeQName);", "public Shape getAreaColision();", "public abstract void remove(SubArea selectedSubArea);", "public org.hl7.fhir.CodeableConcept addNewFacilityType()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.CodeableConcept target = null;\n target = (org.hl7.fhir.CodeableConcept)get_store().add_element_user(FACILITYTYPE$4);\n return target;\n }\n }", "void addAssociation(String path, String type, String associationPaths,\n String operation) throws RegistryException;" ]
[ "0.5351993", "0.53511214", "0.53422105", "0.52672374", "0.5120787", "0.5111836", "0.49767813", "0.49549225", "0.49321124", "0.48879808", "0.48435298", "0.48148933", "0.47952023", "0.4771809", "0.47707608", "0.47707608", "0.47634935", "0.47505796", "0.4704709", "0.4697659", "0.4689191", "0.46849722", "0.46753278", "0.4673842", "0.4673842", "0.4609944", "0.46060482", "0.46039653", "0.45461234", "0.4525188", "0.45104796", "0.45033264", "0.45001012", "0.45001012", "0.44961113", "0.44959152", "0.44928372", "0.44903845", "0.44884217", "0.44804993", "0.44804993", "0.44804993", "0.44754893", "0.44571277", "0.44501817", "0.4438685", "0.44332752", "0.4431311", "0.4431311", "0.4431311", "0.44273725", "0.44055557", "0.4389885", "0.43722907", "0.43638217", "0.43545663", "0.43456358", "0.43401113", "0.43264836", "0.43256083", "0.43209654", "0.43195397", "0.43161952", "0.43154323", "0.43117046", "0.4309279", "0.4299621", "0.42795837", "0.42777455", "0.42761874", "0.4276014", "0.42625594", "0.42583048", "0.42570916", "0.42566335", "0.42526197", "0.4242369", "0.42422682", "0.42396915", "0.42284513", "0.4219693", "0.42100298", "0.42096448", "0.42096448", "0.42076418", "0.42076418", "0.42076418", "0.42076418", "0.42020097", "0.42020097", "0.41931698", "0.41868007", "0.41784948", "0.41784948", "0.41784948", "0.41773114", "0.41716555", "0.4166663", "0.41622242", "0.41610983" ]
0.6086718
0
Remove a subject area classification from a referenceable.
public VoidResponse deleteSubjectAreaMemberClassification(String serverName, String userId, String elementGUID, ExternalSourceRequestBody requestBody) { final String methodName = "deleteSubjectAreaMemberClassification"; final String elementGUIDParameterName = "elementGUID"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); VoidResponse response = new VoidResponse(); AuditLog auditLog = null; try { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); ReferenceableHandler<RelatedElement> handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); if (requestBody != null) { handler.removeSubjectAreaClassification(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), elementGUID, elementGUIDParameterName, OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, false, false, null, methodName); } else { handler.removeSubjectAreaClassification(userId, null, null, elementGUID, elementGUIDParameterName, OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, false, false, null, methodName); } } catch (Exception error) { restExceptionHandler.captureExceptions(response, error, methodName, auditLog); } restCallLogger.logRESTCallReturn(token, response.toString()); return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void remove(SubArea selectedSubArea);", "private void removeArea() {\n \t\tthis.set.remove( this.area );\n \t\tthis.finish();\n \t}", "public void removeRuleRef(org.semanticwb.model.RuleRef value);", "public void removeAllRuleRef();", "protected void removeReference()\n {\n }", "public void removeAgent(Agent a)\n/* 81: */ {\n/* 82:132 */ this.mapPanel.removeAgent(a);\n/* 83: */ }", "public void removeAgent(String layer, Agent a)\n/* 175: */ {\n/* 176:247 */ this.mapPanel.removeAgent(layer, a);\n/* 177: */ }", "public void removeCvcategory(Cvcategory cvcategory);", "@Override\n public void deleteRuleAR() {\n }", "@Override\n\tpublic AreaExecution removeArea(long areaId) {\n\t\treturn null;\n\t}", "@Override\n public void deleteVisRuleAR() {\n }", "void removeClassification(int i);", "public Centroid removeCentroid();", "void removeCategory(Category category);", "void removeIsBoundaryNodeOf(Boundary oldIsBoundaryNodeOf);", "@Override\r\n\tpublic boolean removeExam(IExam exam) {\n\t\treturn false;\r\n\t}", "protected abstract void removeJointImpl( Joint joint );", "@Override\n\tpublic void remove(String identifier) {\n\t}", "@Override\n \tpublic void removeIsCitedBy(Reference reference) {\n \t\tList<Reference> isCitedBy = getIsCitedBy();\n \t\t// check for no existing relationship\n \t\tif (reference == null || !isCitedBy.contains(reference))\n \t\t\treturn;\n \t\t// remove both sides of relationship\n \t\treference.getCitationList().remove(this);\n \t\tisCitedBy.remove(reference);\n \n \t}", "public void unsetFacilityType()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(FACILITYTYPE$4, 0);\n }\n }", "boolean removeObject(RectangleLatLng rectangle, String id);", "void removeRegion(Region region);", "public void removeFromLinesOfBusiness(entity.AppCritLineOfBusiness element);", "public void removeCollidable(Collidable c) {\r\n environment.removeCollidable(c);\r\n }", "public void unsetIntersectingRoadwayRef()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(INTERSECTINGROADWAYREF$20);\r\n }\r\n }", "@Override\n\tpublic void remove(cp_company cp) {\n\t\t\n\t}", "public void removeByType(long typeId);", "public void removeShape(PhysicsShape shape) {\n\t\tshapes.remove(shape);\n\t}", "public void removeCollidable(Collidable c) {\n this.environment.removeCollidable(c);\n }", "public void removeTile(){\n\t\toccupied = false;\n\t\tcurrentTile = null;\n\t}", "@Override\r\n\tpublic void removeToElement(Student student) {\n\t}", "public void removeFromCollision(Entity en){\n\t\tif (hitboxCollision.containsKey(en)){\n\t\t\tRectangle hitbox = hitboxCollision.get(en);\n\t\t\tareaCollision.remove(hitbox);\n\t\t\thitboxCollision.remove(en);\n\t\t}\n\t}", "public void removeAuxClasss(Collection auxClasss);", "void removeHitListener(HitListener hl);", "void removeHitListener(HitListener hl);", "void removeHitListener(HitListener hl);", "void removeHitListener(HitListener hl);", "public void removeByisActive(Boolean isActive);", "public void removeHitListener(HitListener hl) {\nthis.hitListeners.remove(hl);\n}", "@SuppressWarnings(value = \"unused\")\n public VoidResponse deleteSubjectArea(String serverName,\n String userId,\n String subjectAreaGUID,\n ExternalSourceRequestBody requestBody)\n {\n final String methodName = \"deleteSubjectArea\";\n final String guidParameter = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n handler.deleteBeanInRepository(userId,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n subjectAreaGUID,\n guidParameter,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n null,\n false,\n false,\n new Date(),\n methodName);\n }\n else\n {\n handler.deleteBeanInRepository(userId,\n null,\n null,\n subjectAreaGUID,\n guidParameter,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n null,\n false,\n false,\n new Date(),\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "void removeHas_certainty(Object oldHas_certainty);", "@SuppressWarnings(\"all\")\n public boolean deleteArea(String typeId, String name) {\n\n log.info(\"Deleting SafetyNET area \" + name + \" for promulgation type \" + typeId);\n\n SafetyNetArea original = findAreaByName(typeId, name);\n if (original != null) {\n remove(original);\n return true;\n }\n return false;\n }", "public void unassignCourse() {\n assignedCourse = null;\n }", "@SuppressWarnings(value = \"unused\")\n public VoidResponse unlinkSubjectAreaFromGovernanceDefinition(String serverName,\n String userId,\n String subjectAreaGUID,\n String definitionGUID,\n RelationshipRequestBody requestBody)\n {\n final String methodName = \"unlinkSubjectAreaToGovernanceDefinition\";\n\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n final String definitionGUIDParameterName = \"definitionGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n VoidResponse response = new VoidResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n if (requestBody != null)\n {\n handler.unlinkElementFromElement(userId,\n false,\n requestBody.getExternalSourceGUID(),\n requestBody.getExternalSourceName(),\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n methodName);\n }\n else\n {\n handler.unlinkElementFromElement(userId,\n false,\n null,\n null,\n definitionGUID,\n definitionGUIDParameterName,\n OpenMetadataAPIMapper.GOVERNANCE_DEFINITION_TYPE_NAME,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_GUID,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_GUID,\n OpenMetadataAPIMapper.GOVERNED_BY_TYPE_NAME,\n null,\n methodName);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "void unsetSubject();", "public void removeObstacle(Coord obstacleCoord);", "void unsetSpecimen();", "public void removeFromCategoryScores(entity.ReviewSummaryCategoryScore element);", "public boolean removeCityCard(AnkhMorporkArea a) {\r\n\t\treturn cityCards.remove(new CityAreaCard(a));\r\n\t}", "public void remove( IAnswer answerToRemove );", "public void removeCourse(String course);", "public void remove()\n {\n removed();\n node.shapeRemoved(shape);\n }", "public void removeCompositeComponent(DrawingComponent component)\n\t{\n\t\t\n\t}", "void unsetConstraints();", "void removePerformAt(Facility oldPerformAt);", "public void remove(CIdentity identity) {\n\n\t\tcoreMatcher.remove(identity);\n\t}", "public void removeAgent() {agent = null;}", "public void removeCollidable(Collidable c) {\r\n this.collidObj.remove(c);\r\n }", "public void remove(Shape c) {\n\t\tc.centerXProperty().removeListener(doubleListener);\n\t\tc.centerYProperty().removeListener(doubleListener);\n\t\tc.radiusProperty().removeListener(doubleListener);\n\t\tc.colorProperty().removeListener(colorListener);\n\t\tc.widthProperty().removeListener(doubleListener);\n\t\tc.heightProperty().removeListener(doubleListener);\n\t\tc.arcWidthProperty().removeListener(doubleListener);\n\t\tc.arcHeightProperty().removeListener(doubleListener);\n\t\tc.textProperty().removeListener(textListener);\n\t\tc.typeProperty().removeListener(typeListener);\n\t\tc.deleteProperty().removeListener(deleteListener);\n\t\tdrawData.remove(c);\n\t}", "public void remove(Component c){}", "@Override\n\tpublic int deleteArea(int areaId) {\n\t\treturn areaMapper.deleteArea(areaId);\n\t}", "boolean removeTypedFeature(StructuralFeature typedFeature);", "@Override\n\tpublic boolean removeArea(Goodsarea goods) {\n\t\treturn false;\n\t}", "public void removeMember(Annotation member);", "boolean removeObject(Polygon polygon, String id);", "public void removeBycourse_id(long course_id);", "public void remove(GeometricalObject object);", "void removeBall(Coordinates at);", "void unsetScoreAnalysis();", "void removeConstraintEntity(IViewEntity entity);", "void removeConstraintRelation(IViewRelation relation);", "void remove(GeometricalObject object);", "void unsetValueCodeableConcept();", "void remove(ReferenceData instance) throws DataException;", "@Override\n public void remove(Shape[] shapes) {\n\n }", "public abstract void removeLocation(Location location);", "public void removeCollidable(Collidable c) {\r\n this.collidables.remove(c);\r\n }", "Feature removeFeature(int index);", "public void removeComponent(DrawingComponent component) {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "void removeComponent(Class<? extends Component> componentClass);", "public void removeComponent(Component c);", "@Override\n\t\tpublic void removeLabel(Label label) {\n\n\t\t}", "public void remove( AnyType x )\r\n\t{\r\n\t\troot = remove( x, root );\r\n\t}", "public void remove();", "public void remove();", "public void remove();", "public void remove();", "public void remove();", "@Override\n\t\tpublic void remove() {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void remove() {\n\t\t\t\n\t\t}", "void unsetRoadTerrain();", "public void remove()\n {\n ShapeParent parent = getShapeParent();\n \n if (parent != null)\n {\n parent.remove(this);\n }\n }", "public\t\tvoid\t\tinvalidateArea(MiBounds area)\n\t\t{\n\t\tsuper.invalidateArea(area);\n\t\t}", "public void removeByRuleID(String serviceProviderCode, Long ruleID) throws AAException, RemoteException;", "protected abstract void removeBodyImpl( Body body );", "public void removeByObject()\r\n\t{\n\t}", "public void unsetContructionType()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(CONTRUCTIONTYPE$24);\r\n }\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 removeFromfeatures (org.unitime.timetable.model.RoomFeature roomFeature) {\n \t\tif (null == getFeatures()) \n \t\t\tsetFeatures(new java.util.HashSet());\n \t\tgetFeatures().remove(roomFeature);\n \t}", "public void remove () {}" ]
[ "0.6776431", "0.66257757", "0.59562606", "0.5868304", "0.56958705", "0.5682851", "0.56618565", "0.565781", "0.56219715", "0.550945", "0.54683834", "0.54376656", "0.5423444", "0.5416639", "0.53792405", "0.5376295", "0.53514934", "0.5337452", "0.5329579", "0.5324219", "0.5272189", "0.52656955", "0.52614605", "0.5254138", "0.52506405", "0.5238218", "0.5235891", "0.5233498", "0.5210794", "0.5207624", "0.51966316", "0.51945794", "0.51925945", "0.5171066", "0.5171066", "0.5171066", "0.5171066", "0.5161691", "0.515309", "0.5150007", "0.5148278", "0.5141064", "0.5137122", "0.5136993", "0.5134062", "0.511981", "0.51167536", "0.51163137", "0.51068604", "0.51043767", "0.5100461", "0.5099984", "0.50982296", "0.5095474", "0.5092929", "0.5090286", "0.5079719", "0.507528", "0.5069176", "0.50630164", "0.50615835", "0.5056687", "0.504442", "0.50435406", "0.50411737", "0.50397426", "0.50376844", "0.5026438", "0.50185126", "0.50180584", "0.50163203", "0.5006225", "0.50027966", "0.50008285", "0.49966592", "0.49958298", "0.49946287", "0.4987745", "0.49868962", "0.49847996", "0.49827197", "0.49826047", "0.49810022", "0.49790654", "0.49790654", "0.49790654", "0.49790654", "0.49790654", "0.49717218", "0.49717218", "0.49641052", "0.4962701", "0.4960797", "0.4956481", "0.49534827", "0.49513966", "0.49495965", "0.49486843", "0.4947351", "0.4946811" ]
0.5975293
2
Return information about the contents of a subject area such as the glossaries, reference data sets and quality definitions.
public ElementStubListResponse getMembersOfSubjectArea(String serverName, String userId, String subjectAreaName, int startFrom, int pageSize) { final String methodName = "getMembersOfSubjectArea"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); ElementStubListResponse response = new ElementStubListResponse(); AuditLog auditLog = null; try { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); ReferenceableHandler<ElementStub> handler = instanceHandler.getElementStubHandler(userId, serverName, methodName); response.setElements(handler.getSubjectAreaMembers(userId, subjectAreaName, startFrom, pageSize, false, false, null, methodName)); } catch (Exception error) { restExceptionHandler.captureExceptions(response, error, methodName, auditLog); } restCallLogger.logRESTCallReturn(token, response.toString()); return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getInformation(ITextViewer textViewer, IRegion subject) {\n \t\treturn \"not null\"; //$NON-NLS-1$\n \t}", "public SubjectAreaDefinitionResponse getSubjectAreaDefinitionByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \"getSubjectAreaDefinitionByGUID\";\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaDefinitionResponse response = new SubjectAreaDefinitionResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> subjectAreaHandler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n SubjectAreaElement element = subjectAreaHandler.getBeanFromRepository(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n new Date(),\n methodName);\n if (element != null)\n {\n SubjectAreaDefinition subjectAreaDefinition = new SubjectAreaDefinition(element);\n\n subjectAreaDefinition.setParentSubjectAreaGUID(subjectAreaHandler.getSubjectAreaParentGUID(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n subjectAreaDefinition.setNestedSubjectAreaGUIDs(subjectAreaHandler.getSubjectAreaChildrenGUIDs(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n false,\n false,\n new Date(),\n methodName));\n\n GovernanceDefinitionHandler<GovernanceDefinitionElement> definitionHandler = instanceHandler.getGovernanceDefinitionHandler(userId, serverName, methodName);\n ElementStubConverter<ElementStub> elementStubConverter = instanceHandler.getElementStubConverter(userId, serverName, methodName);\n List<Relationship> relationships = definitionHandler.getGoverningDefinitionLinks(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n null,\n 0,\n 0,\n false,\n false,\n new Date(),\n methodName);\n List<ElementStub> definitions = elementStubConverter.getNewBeans(ElementStub.class, relationships, true, methodName);\n subjectAreaDefinition.setAssociatedGovernanceDefinitions(definitions);\n\n response.setProperties(subjectAreaDefinition);\n }\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public void getSubjectOfInterest() {\n\t\t// Output the present vector\n\t\tSystem.out.println(this.name + \" subjects of interest are: \" + this.subjectsOfInterest);\n\t\t// return this.subjectsOfInterest;\n\t}", "public String getContent();", "public String getSubject() {\n/* 286 */ return getCOSObject().getString(COSName.SUBJ);\n/* */ }", "public ExtractTextByArea() throws IOException {\n\t\tsuper();\n\t\t// TODO Auto-generated constructor stub\n\t}", "public String getSubjectOfBiography() {return subjectOfBiography;}", "Map<String, Object> getContent();", "public void showDetails(){\r\n\t\tSystem.out.println(\"Length is : \"+getLength());\r\n\t\tSystem.out.println(\"Width is : \"+getWidth());\r\n\t\tSystem.out.println(\"Area Of Rectangle is : \"+area());\r\n\t}", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "public abstract String getArea();", "public void testAreaInfo()\n\t{\n\t\tGameArea ga = new GameArea();\n\t\tga.areaInfo();\n\t\tga.setConditionsMet(true);\n\t\tga.setAreaProgress(1);\n\t\tga.areaInfo();\n\t\tga.areaInfo();\n\t\tga.setLoot(null);\n\t\tga.areaInfo();\n\t}", "public SubjectInfo getSubjectInfo() {\r\n\t\treturn subjectInfo;\r\n\t}", "public SubjectInfo getSubject() {\n return this.subject;\n }", "public SubjectareasRecord() {\n\t\tsuper(Subjectareas.SUBJECTAREAS);\n\t}", "public String getCourseArea() {\n return courseArea;\n }", "public String[] getSubjects() {\n/* 329 */ return getStringArray(\"subject\");\n/* */ }", "org.hl7.fhir.ResourceReference getSubject();", "public SubjectAreaResponse getSubjectAreaByGUID(String serverName,\n String userId,\n String subjectAreaGUID)\n {\n final String methodName = \"getSubjectAreaByGUID\";\n final String subjectAreaGUIDParameterName = \"subjectAreaGUID\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaResponse response = new SubjectAreaResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n response.setElement(handler.getBeanFromRepository(userId,\n subjectAreaGUID,\n subjectAreaGUIDParameterName,\n OpenMetadataAPIMapper.SUBJECT_AREA_TYPE_NAME,\n false,\n false,\n new Date(),\n methodName));\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "public String getAcontent() {\n return acontent;\n }", "public String getContentSubject() {\n return contentSubject;\n }", "java.lang.String getContents();", "java.lang.String getContents();", "public abstract String getContentDescription();", "public String getInformation() {\n \treturn \"This is a Maths Assessment\" +\n \t\t\t \"\\nNumber of questions: \" + Integer.toString(numQuestions) + \n \t\t\t \"\\nClosing Date: \" + closingDate;\n }", "@Override\n public String getBody() {\n return mSubject; /*mFile.toString();*/\n }", "String getContents();", "public static void printAllAreas() {\r\n\t for (int i = 0; i <= 2967; i++) {\r\n\t System.out.println(\"Load Shedding Inforamtion: \" + LSItemsArray[i].getInformation()\r\n + \": Corresponding Areas: \" + LSItemsArray[i].getAreas());\r\n\r\n\t }\r\n\t }", "public String bandInfo() {\n return getName(document)\n + \"\\n\" + getLink(link, \"Last.FM\")\n + \"\\n\\n\" + getScrobbles(document)\n + \"\\n\\n\" + yearsActive(document)\n + \"\\n\\n\" + getDescription(document);\n }", "public String getArea() {\n return this.area;\n }", "public Contents getContents(\n )\n {return contents;}", "public String toString ()\n\t{\n\t\treturn new String (\"[\" + ancho+ \", \" + alto + \"], Area = \" + area);\n\t}", "public String getContents() { return contents; }", "public String getArea() {\n return area;\n }", "public abstract String getTextToPrint(JCas aJCas);", "public String getArea() {\n\t\treturn area;\n\t}", "public Object[][] getContents()\n {\n return contents;\n }", "protected String loadDocumentDetails()\r\n\t{\r\n\t\tsetC_Currency_ID (NO_CURRENCY);\r\n\t\tX_M_Production prod = (X_M_Production)getPO();\r\n\t\tsetDateDoc (prod.getMovementDate());\r\n\t\tsetDateAcct(prod.getMovementDate());\r\n\t\t//\tContained Objects\r\n\t\tp_lines = loadLines(prod);\r\n\t\tif (log.isLoggable(Level.FINE)) log.fine(\"Lines=\" + p_lines.length);\r\n\t\treturn null;\r\n\t}", "public List<ACSubjectInfo> getSubjects() {\n return subjects;\n }", "public String getArea() {\n return area;\n }", "public String getArea() {\n return area;\n }", "public String getArea() {\n return area;\n }", "public String getSrcAreaOfExpertise() {\r\n return (String) getAttributeInternal(SRCAREAOFEXPERTISE);\r\n }", "public String getAllSubjectName() {\n\t\tString sub = Messages.getString(\"AccessSub.0\"); //$NON-NLS-1$\n\t\t// Defined connection, rs and cs to connect and query database\n\t\tcn = LibConnection.getConnection();\n\t\ttry {\n\t\t\tcsDetails = cn.prepareCall(LibProcedure.GET_ALL_SUBNAME);\n\t\t\trsDetails = csDetails.executeQuery();\n\t\t\twhile (rsDetails.next()) {\n\t\t\t\tsub += rsDetails.getString(1)\n\t\t\t\t\t\t+ Messages.getString(\"AccessSub.1\"); //$NON-NLS-1$\n\t\t\t}\n\t\t\treturn sub;\n\t\t} catch (SQLException ex) {\n\t\t\tex.printStackTrace();\n\t\t} finally {\n\t\t\t// close all connect\n\t\t\tLibConnection.close(rsDetails);\n\t\t\tLibConnection.close(csDetails);\n\t\t\tLibConnection.close(cn);\n\t\t}\n\t\treturn Messages.getString(\"AccessSub.2\"); //$NON-NLS-1$\n\t}", "public String getContents() {\n\t\treturn contents;\n\t}", "public String getContents() {\n return contents;\n }", "public String getContents()\r\n/* 156: */ {\r\n/* 157:282 */ return this.formulaString;\r\n/* 158: */ }", "protected Object[][] getContents() {\n return RESOURCES;\n }", "public AreaProperties getProperties() {\n return this.properties;\n }", "public Object[][] getContents() {\n return contents;\n }", "public List<Subject> getSubject() {\n\t\treturn sub_dao.getSubject();\r\n\t}", "public List<Subject> getSubjectList() {\r\n\r\n\t\tlogger.info(\"*** Service : Displaying Subject information ***\");\r\n\t\treturn subjectRepository.findAll();\r\n\t}", "@Override\n public Object[] getSections () {\n return alphaIndexer.getSections();\n }", "public String getSubtitle();", "Map getAspectDatas();", "public double[] getScienceArea() {\n double[] size = new double[2];\n\n // the length is determined by the disperser in use\n size[1] = getDisperser().getSlitWidth();\n size[0] = TexesParams.Disperser.SLIT_LENGTH;\n\n return size;\n }", "protected Object[][] getContents() {\r\n return contents;\r\n }", "abstract String getContent();", "@Override\n public Object[][] getContents() {\n return contents;\n }", "public String toString(){\r\n return \"Title: \" + title + \"\\nBody: \" + body;\r\n }", "public SubjectHierarchy getSubjectHierarchy();", "Collection<LocatorIF> getSubjectIdentifiers();", "public ArrayList<roomContents> getContents() {\n return contents;\n }", "@Override\r\n\tpublic String toString() {\r\n\r\n\t\treturn \"My rectangle's Areas is \"+area();\r\n\t}", "public String getAreaName()\n {\n return this.areaName;\n }", "public String getSubjects() {\r\n return subjects;\r\n }", "public String getContents() {\n\treturn this.contents;\n }", "public Item[] getRoomContents() {\n Item[] contentsArray = new Item[contents.size()];\n contentsArray = contents.toArray(contentsArray);\n return contentsArray;\n }", "public void catalogToTextArea(Catalog theCatalog, JTextArea textArea) {\n textArea.setText(\"CONTENTS OF CATALOG:\\n\\n\");\n for (int CDNum = 0; CDNum < theCatalog.getNumItems(); CDNum++) {\n CD cd = (CD) theCatalog.getItem(CDNum);\n // display the title, composer and performer for the CD\n textArea.append(cd.displayStringWithTag() + \"\\n\");\n // display all the tracks, indented using a tab character\n for (int trackNum = 0; trackNum < cd.getNumTracks(); trackNum++) {\n textArea.append(\"\\t\" + cd.getTrack(trackNum) + \"\\n\");\n } // end for trackNum\n } // end for CDNum\n }", "public List getSubjectVariables() {\r\n return subjectVariables;\r\n }", "List<ExamGrSubMeta> getAnswerSheetMeta();", "org.hl7.fhir.CodeableConcept getBodySite();", "public String describeContent(){\n String description;\n if (content != null){\n description = content.getDescription();\n } else {\n description = \"This chest is empty\";\n }\n return description;\n }", "Term getBody();", "com.google.protobuf.ByteString\n getSubjectBytes();", "com.google.protobuf.ByteString\n getSubjectBytes();", "public Term getContent() {\n return content;\n }", "public String toString()\n {\n return getClass().getName() + \"[name=\" + name + \",area=\" + area + \"]\";\n }", "public String getAlbumInfo() {\n String albumInfo = \"\";\n Elements elements = album.getElementsByClass(\"header-new-title\");\n albumInfo += \"<strong>\" + elements.text() + \"</strong> ( \";\n elements = album.getElementsByClass(\"catalogue-metadata-description\");\n albumInfo += elements.get(1).text() + \" )\\n\\n\" + getScrobbles(album);\n\n String wiki = getWiki(albumLink);\n if (wiki.contains(\"<i>Do you know any background info about this?</i>\\n\\n\"))\n return albumInfo + \"\\n\\n\" + wiki;\n if (wiki.length() > 400)\n wiki = wiki.substring(0, 400) + \" ...\";\n\n albumInfo += \"\\n\\n\" + wiki + \"\\n\\n\" + getLink(albumLink + \"/+wiki\", \" Continue on Last.fm\");\n return albumInfo;\n }", "public String getStudyDescription()\n {\n return studyDescription;\n }", "private static String[] getActualCoursesDetailInfo(ActualCourse actualCourse) {\n String startTime = DateHandlerUtils.dateToString(DateFormatConstants.YYYY_MM_DD_HH_MM, actualCourse.getCourseStartTime());\n String endTime = DateHandlerUtils.dateToString(DateFormatConstants.HH_MM, actualCourse.getCourseEndTime());\n String time = startTime + EmailConstant.MIDDLE_LINE + endTime;\n String[] data = new String[] { replaceNullDataToTBD(actualCourse.getCourseName()), replaceNullDataToTBD(actualCourse.getCourseRoomNum()),\n replaceNullDataToTBD(time), replaceNullDataToTBD(actualCourse.getCourseTrainer()) };\n return data;\n }", "@Test\n public void testSpecies() throws IOException, UIMAException {\n /*String Text = \"In this text we talk about humans and mice. Because a mouse is no killifish nor a caenorhabditis elegans. Thus, c. elegans is now abbreviated as well as n. furzeri .\";\n\n JCas jCas = JCasFactory.createText(Text);\n\n //AnalysisEngineDescription engine = createEngineDescription(LinnaeusSpecies.class);\n AnalysisEngineDescription engine = createEngineDescription(LinnaeusSpecies.class);\n SimplePipeline.runPipeline(jCas, engine);\n\n String[] casSpecies = (String[]) JCasUtil.select(jCas, Organism.class).stream().map(a -> a.getCoveredText()).toArray(String[]::new);\n //String[] casID = (String[]) JCasUtil.select(jCas, Organism.class).stream().map(b -> b.getId()).toArray(String[]::new);\n\n String[] testSpecies = new String[] {\"humans\", \"mice\", \"mouse\", \"killifish\", \"caenorhabditis elegans\", \"c. elegans\", \"n. furzeri\"};\n //String[] testID = new String[] {\"9606\", \"10090\", \"10090\", \"34780\", \"6239\", \"6239\", \"105023\"};\n\n assertArrayEquals(testSpecies, casSpecies);*/\n //assertArrayEquals(testID, casID);\n }", "public Map getTutorInfo() {\n //Create a map of arraylists to hold all data\n Map<Integer, ArrayList<String>> info = new HashMap<Integer, ArrayList<String>>();\n\n //Grab info from screen\n EditText t = (EditText) findViewById(R.id.BioField);\n ArrayList<String> bioField = new ArrayList<String>();\n bioField.add(t.getText().toString());\n\n //Put info in Map\n info.put(1, bioField);\n info.put(2, subjectList);\n\n return info;\n }", "public SubjectAreaResponse getSubjectAreaByName(String serverName,\n String userId,\n String qualifiedName)\n {\n final String methodName = \"getSubjectAreaByName\";\n final String qualifiedNameParameterName = \"qualifiedName\";\n\n RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);\n\n SubjectAreaResponse response = new SubjectAreaResponse();\n AuditLog auditLog = null;\n\n try\n {\n auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);\n SubjectAreaHandler<SubjectAreaElement> handler = instanceHandler.getSubjectAreaHandler(userId, serverName, methodName);\n\n response.setElement(handler.getSubjectArea(userId,\n qualifiedName,\n qualifiedNameParameterName,\n false,\n false,\n new Date(),\n methodName));\n }\n catch (Exception error)\n {\n restExceptionHandler.captureExceptions(response, error, methodName, auditLog);\n }\n\n restCallLogger.logRESTCallReturn(token, response.toString());\n return response;\n }", "java.lang.String getSubject();", "java.lang.String getSubject();", "java.lang.String getSubject();", "@Override\n\tpublic String getContents() {\n\t\treturn this.contents;\n\t}" ]
[ "0.582621", "0.5342856", "0.5291587", "0.52572846", "0.5247554", "0.52225095", "0.52207917", "0.5194019", "0.51903063", "0.51759666", "0.51759666", "0.51759666", "0.51759666", "0.51759666", "0.51759666", "0.51759666", "0.51759666", "0.51443017", "0.51443017", "0.51443017", "0.51443017", "0.51443017", "0.51443017", "0.5139956", "0.5086891", "0.5064618", "0.5058515", "0.5053231", "0.5039717", "0.50266576", "0.5025066", "0.49996248", "0.49844235", "0.49698713", "0.496461", "0.496461", "0.49556652", "0.49555212", "0.49523944", "0.49398455", "0.49313036", "0.49273658", "0.49209204", "0.4917081", "0.4901888", "0.4895655", "0.48886466", "0.48816517", "0.4876838", "0.48667333", "0.48630166", "0.48573312", "0.4847353", "0.4847353", "0.4847353", "0.48260993", "0.4823467", "0.48222572", "0.48198557", "0.47994304", "0.47921875", "0.47910073", "0.47843292", "0.4771245", "0.4769752", "0.4767029", "0.4760326", "0.47395742", "0.47392347", "0.4736315", "0.4729761", "0.47200328", "0.47136572", "0.47058037", "0.4703353", "0.4700738", "0.4693809", "0.46933967", "0.46770608", "0.46735793", "0.46639854", "0.46598548", "0.4655493", "0.46550158", "0.46538845", "0.4640139", "0.46271476", "0.46253705", "0.46253705", "0.46234116", "0.4622565", "0.46186826", "0.46172684", "0.46157366", "0.46135783", "0.46130913", "0.46110982", "0.45929864", "0.45929864", "0.45929864", "0.45908454" ]
0.0
-1
Simply selects the home view to render by returning its name.
@RequestMapping(value = "/", method = RequestMethod.GET) public String home(Locale locale, Model model) { logger.info("Welcome home! The client locale is {}.", locale); Date date = new Date(); DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale); String formattedDate = dateFormat.format(date); model.addAttribute("serverTime", formattedDate ); return "home"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@GetMapping(Mappings.HOME)\n\tpublic String showHome() {\n\n\t\treturn ViewNames.HOME;\n\t}", "public String home() {\n if (getUsuario() == null) {\n return \"login.xhtml\";\n }\n // Si el usuario es un ADMINISTRADOR, le lleva a la pagina a la lista de Alumnos\n if (getUsuario().getRol().equals(getUsuario().getRol().ADMINISTRADOR)) {\n return \"ListaAlumnos.xhtml\";\n }\n // Si el usuario es Alumno, le llevará a la página web de INDEX\n // REVISAR\n if (getUsuario().getRol().equals(getUsuario().getRol().ALUMNO)) {\n return \"login.xhtml\";\n }\n return null;\n }", "public String home() {\n if(getUsuario()==null){\r\n return \"login.xhtml\";\r\n }\r\n \r\n // Si el usuario es un administrador, le lleva a la pagina del listado de apadrinados\r\n if(getUsuario().getRol().equals(getUsuario().getRol().ADMINISTRADOR)){\r\n return \"listaninosapadrinados.xhtml\";\r\n }\r\n \r\n // Si el usuario es socio, le lleva a la pagina de apadrinar\r\n if(getUsuario().getRol().equals(getUsuario().getRol().SOCIO)){\r\n return \"apadrinar.xhtml\";\r\n }\r\n return null;\r\n }", "@RequestMapping(\"/home\")\n\tpublic String showHome() {\n\t\treturn \"home\";\n\t}", "public void home_index()\n {\n Home.index(homer);\n }", "public Class getHomePage() {\n return HomePage.class;\n }", "public void displayHome() {\n\t\tclearBackStack();\n\t\tselectItemById(KestrelWeatherDrawerFactory.MAP_OVERVIEW, getLeftDrawerList());\n\t}", "InternationalizedResourceLocator getHomePage();", "@RequestMapping(value = \"/home\")\n\tpublic String home() {\t\n\t\treturn \"index\";\n\t}", "public String getHomePage() {\r\n return this.homePage;\r\n }", "public void toHomeScreen(View view) {\n Intent intent = new Intent(SportHome.this, HomeScreen.class);\n startActivity(intent);\n\n }", "@RequestMapping(\"/\")\n\tpublic String homePage() {\n\t\tlogger.info(\"Index Page Loaded\");\n\t\treturn \"index\";\n\t}", "public static final String getHome() { return home; }", "@RequestMapping(value = \"/\", method = RequestMethod.GET)\n\tpublic String home() {\n\t\treturn \"home\";\n\t}", "String getOssHomepage();", "public static Result home() {\n Skier loggedInSkier = Session.authenticateSession(request().cookie(COOKIE_NAME));\n if(loggedInSkier==null)\n return redirect(\"/\");\n else\n return renderHome(loggedInSkier);\n }", "@RequestMapping(value = {\"/\", \"/home\"}, method = RequestMethod.GET)\n public String goHome(ModelMap model) {\n model.addAttribute(\"loggedinuser\", appService.getPrincipal());\n model.addAttribute(\"pagetitle\", \"Pand-Eco\");\n return \"view_landing_page\";\n }", "@GetMapping(\"/\")\n\tpublic String showHomePage() {\n\t\treturn \"home\";\n\t}", "@RequestMapping(\"home\")\n public String loadHomePage( HttpServletRequest request, final HttpServletResponse response, Model model ) {\n response.setHeader( \"Cache-Control\", \"max-age=0, no-cache, no-store\" );\n\n // Get the title of the application in the request's locale\n model.addAttribute( \"title\", webapp.getMessage( \"webapp.subtitle\", null, request.getLocale() ) );\n\n return \"home\";\n }", "public void homeClicked() {\r\n Pane newRoot = loadFxmlFile(Home.getHomePage());\r\n Home.getScene().setRoot(newRoot);\r\n }", "@RequestMapping(value = \"/\", method = RequestMethod.GET)\n public String home(Model model, Authentication authentication){\n if(authentication != null) {\n User currUser = customUserDetailsService.findByUsername(authentication.getName());\n model.addAttribute(\"user\", currUser);\n }\n // The string \"Index\" that is returned here is the name of the view\n // (the Index.jsp file) that is in the path /main/webapp/WEB-INF/jsp/\n // If you change \"Index\" to something else, be sure you have a .jsp\n // file that has the same name\n return \"Index\";\n }", "public static String getHome() {\n return home;\n }", "public void tohome (View view){\n Intent i = new Intent(this,Intro.class);\n startActivity(i);\n }", "private void setDefaultView() {\n mDefaultFragment = mHomeFragment;\n mDefaultNavItemSelectionId = R.id.navigation_home;\n\n mNavigationView.setSelectedItemId(mDefaultNavItemSelectionId);\n mCurrentFragment = mDefaultFragment;\n switchFragment();\n setActionBarTitle(mDefaultNavItemSelectionId);\n }", "private void loadHome(){\n Intent intent = new Intent(this, NameListActivity.class);\n startActivity(intent);\n finish();\n }", "String home();", "public void goHomeScreen(View view)\n {\n\n Intent homeScreen;\n\n homeScreen = new Intent(this, homeScreen.class);\n\n startActivity(homeScreen);\n\n }", "@Override\n public void showHomeView()\n {\n Intent homeView = new Intent(LoginActivity.this, HomeActivity.class);\n startActivity(homeView);\n }", "public String getHomePage(User currentUser) {\r\n VelocityContext context = getHomePageData(currentUser);\r\n String page = renderView(context, \"pages/home.vm\");\r\n return page;\r\n }", "public void goHome();", "@RequestMapping(value = \"/\", method = RequestMethod.GET)\n\n\t public String home()\n\t {\n\t return \"welcome\";\n\t }", "@Override\n\tpublic int getContentView() {\n\t\treturn R.layout.activity_home;\n\t}", "public void gotoHome(){ application.gotoHome(); }", "@RequestMapping(value=\"/\")\r\npublic ModelAndView homePage(ModelAndView model) throws IOException\r\n{\r\n\tmodel.setViewName(\"home\");\r\n\treturn model;\r\n}", "public abstract int getRootView();", "public JTextPane getHomeName() {\n return this.homeName;\n }", "public void goToHomePage(View view)\n {\n Intent intent = new Intent( this, HomeActivity.class );\n startActivity( intent );\n }", "@RequestMapping(method= RequestMethod.GET, value=\"/staff/home\")\n protected static String getStaffHome() {\n return \"staff-home\";\n }", "public String homepage() {\n return this.home;\n }", "@RequestMapping(value=\"/homepage\")\r\npublic ModelAndView homePage1(ModelAndView model) throws IOException\r\n{\r\n model.setViewName(\"home\");\r\n\treturn model;\r\n}", "@RequestMapping(value=\"/\", method=RequestMethod.GET)\n\tpublic String home() {\n\t\tlogger.info(\"Welcome home!\");\n\t\treturn \"home\";\n\t}", "public void setHomeName(String homeName) {\n this.homeName.setText(homeName);\n }", "@RequestMapping(value = { \"/broadband-user\", \"/broadband-user/login\" })\n\tpublic String userHome(Model model) {\n\t\tmodel.addAttribute(\"title\", \"CyberPark Broadband Manager System\");\n\t\treturn \"broadband-user/login\";\n\t}", "public void showHomeScreen() {\n try {\n FXMLLoader loader1 = new FXMLLoader();\n loader1.setLocation(MainApplication.class.getResource(\"view/HomeScreen.fxml\"));\n AnchorPane anchorPane = (AnchorPane) loader1.load();\n rootLayout.setCenter(anchorPane);\n HomeScreenController controller = loader1.getController();\n controller.setMainApp(this);\n } catch (IOException e) {\n \t\te.printStackTrace();\n \t }\n }", "public void backHome(View view) {\n Intent intent = new Intent(this, home.class);\n startActivity(intent);\n\n }", "@Override\n protected int getLayoutId() {\n return R.layout.fragment_home;\n }", "@RequestMapping(value = \"home.do\", method = RequestMethod.GET)\n public String getHome(HttpServletRequest request, Model model) {\n logger.debug(\"Home page Controller:\");\n return \"common/home\";\n }", "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 }", "public void homeButtonClicked(ActionEvent event) throws IOException {\n Parent homeParent = FXMLLoader.load(getClass().getResource(\"Home.fxml\"));\n Scene homeScene = new Scene(homeParent, 1800, 700);\n\n //gets stage information\n Stage window = (Stage) ((Node) event.getSource()).getScene().getWindow();\n window.setTitle(\"Home Page\");\n window.setScene(homeScene);\n window.show();\n }", "@Override\r\n\tpublic String executa(HttpServletRequest req, HttpServletResponse res) throws Exception {\n\t\treturn \"view/home.html\";\r\n\t}", "public void returnHome(View view) {\n Intent intent = new Intent(GameDetailsActivity.this, HomeActivity.class);\n startActivity(intent);\n }", "public String getHomeClassName()\n {\n if (_homeClass != null)\n return _homeClass.getName();\n else\n return getAPIClassName();\n }", "@RequestMapping(value = \"/\", method = RequestMethod.GET)\n\tpublic String home(Model model) {\n\t\t// logger.info(\"Welcome home! The client locale is {}.\", locale);\n\t\treturn \"home\";\n\t}", "@RequestMapping(\"/\")\n\t public String index(Model model){\n\t return \"homepage\";\n\t }", "@RequestMapping(\"/\")\n\tpublic String welcomeHandler() {\n\n\t\tString viewName = \"welcome\";\n\t\tlogger.info(\"welcomeHandler(): viewName[\" + viewName + \"]\");\n\t\treturn viewName;\n\t}", "protected String getHomePageTitle() { \n return null; \n }", "public String home()\n\t{\n\t\treturn SUCCESS;\n\t}", "@RequestMapping(value=\"/loginForm\", method = RequestMethod.GET)\n\tpublic String home(){\n\n\t\treturn \"loginForm\";\n\t}", "protected void callHome() {\n\t\tIntent intent = new Intent(this, AdminHome.class);\r\n\t\tstartActivity(intent);\r\n\t}", "@RequestMapping(value = {\"/\", \"/home\"}, method = RequestMethod.GET)\n public ModelAndView goToHome(Model m) {\n \tModelAndView mav = new ModelAndView(\"home\");\n \treturn mav;\n }", "public static void selectedHomeScreen(Activity context) {\n\n // Get tracker\n Tracker tracker = ((GlobalEntity) context.getApplicationContext())\n .getTracker(TrackerName.APP_TRACKER);\n if (tracker == null) {\n return;\n }\n\n // Build and send an Event\n tracker.send(new HitBuilders.EventBuilder()\n .setCategory(\"Selected Home Screen\")\n .setAction(\"homeScreenSelect\")\n .setLabel(\n \"homeScreenSelect: \"\n + NavDrawerHomeScreenPreferences\n .getUserHomeScreenChoice(context))\n .build());\n }", "@Override\n\tpublic int getLayoutId() {\n\t\treturn R.layout.fragment_home;\n\t}", "void showHome() {\n\t\tsetContentView(R.layout.home);\r\n\t\tView homeView = findViewById(R.id.home_image);\r\n\t\thomeView.setOnClickListener(new View.OnClickListener() {\r\n\t\t public void onClick(View v) {\r\n\t\t \tstartGame();\r\n\t\t }\r\n\t\t});\r\n\t}", "View getActiveView();", "public void home() {\n\t\tUserUI ui = new UserUI();\n\t\tui.start();\n\t}", "private void navigateToDefaultView() {\n\t\tif (navigator!=null && \"\".equals(navigator.getState())) {\n\t\t\t// TODO: switch the view to the \"dashboard\" view\n\t\t}\n\t}", "@GetMapping(\"/homePage\")\n public String homePage(final Model model) {\n LOGGER.debug(\"method homePage was invoked\");\n model.addAttribute(\"listCarMakes\", carMakeProvider.getCarMakes());\n return \"homepage\";\n }", "@FXML\r\n private void goHomeScreen(ActionEvent event) {\n Stage stage = (Stage) mainGridPane.getScene().getWindow();\r\n\r\n //load up WelcomeScene FXML document\r\n Parent root = null;\r\n try {\r\n root = FXMLLoader.load(getClass().getResource(\"WelcomeChipScene.fxml\"));\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n Scene scene = new Scene(root, 1024, 720);\r\n stage.setTitle(\"Restaurant Reservation System\");\r\n stage.setScene(scene);\r\n stage.show();\r\n }", "@RequestMapping(method = RequestMethod.GET)\r\n public String home(ModelMap model) throws Exception\r\n {\t\t\r\n return \"Home\";\r\n }", "public void goHome(View view) {\n String toastString = \"go home...\";\n Toast.makeText(FriendsList.this,toastString, Toast.LENGTH_SHORT).show();\n\n //TODO\n // go to list screen....\n Intent goToNextScreen = new Intent (this, AccountAccess.class);\n final int result = 1;\n startActivity(goToNextScreen);\n }", "public void switchToHomeScreen() {\n Intent startMain = new Intent(Intent.ACTION_MAIN);\n startMain.addCategory(Intent.CATEGORY_HOME);\n startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(startMain);\n }", "public URI getHome() {\n return this.homeSpace;\n }", "public final String getViewName() {\n\t\treturn viewName;\n\t}", "@RequestMapping(value = \"/\", method = RequestMethod.GET)\r\n\tpublic String index(Model model) {\r\n\r\n\t\treturn \"home\";\r\n\t}", "public Action getIndexApiAction() {\n Thing object = new Thing.Builder()\n .setName(\"HomeView Page\") // TODO: Define a title for the content shown.\n // TODO: Make sure this auto-generated URL is correct.\n .setUrl(Uri.parse(\"http://[ENTER-YOUR-URL-HERE]\"))\n .build();\n return new Action.Builder(Action.TYPE_VIEW)\n .setObject(object)\n .setActionStatus(Action.STATUS_TYPE_COMPLETED)\n .build();\n }", "protected Object getHome()\r\n/* 75: */ throws NamingException\r\n/* 76: */ {\r\n/* 77:159 */ if ((!this.cacheHome) || ((this.lookupHomeOnStartup) && (!isHomeRefreshable()))) {\r\n/* 78:160 */ return this.cachedHome != null ? this.cachedHome : lookup();\r\n/* 79: */ }\r\n/* 80:163 */ synchronized (this.homeMonitor)\r\n/* 81: */ {\r\n/* 82:164 */ if (this.cachedHome == null)\r\n/* 83: */ {\r\n/* 84:165 */ this.cachedHome = lookup();\r\n/* 85:166 */ this.createMethod = getCreateMethod(this.cachedHome);\r\n/* 86: */ }\r\n/* 87:168 */ return this.cachedHome;\r\n/* 88: */ }\r\n/* 89: */ }", "public void launchHomePage() {\n Intent intent = new Intent(LoginActivity.this, HomeActivity.class);\n startActivity(intent);\n }", "@RequestMapping(value = \"/home\", method = RequestMethod.GET)\n\tpublic String openhomePage() {\n/*\t\tlogger.debug(\"Inside Instruction page\");\n*/\t\treturn \"home\";\n\t}", "private Home getHome(final Context ctx)\r\n {\r\n return (Home) ctx.get(this.homeKey_);\r\n }", "public abstract String getView();", "@RequestMapping(value = \"/\", method = RequestMethod.GET)\n public String home(Locale locale, Model model)\n {\n System.out.println(\"Home \" + service.getName());\n model.addAttribute(\"name\", service.getName());\n return \"home\";\n }", "protected String getView() {\r\n/* 216 */ return \"/jsp/RoomView.jsp\";\r\n/* */ }", "public String getView(String viewName) {\n\t\t\n\t\treturn prefix + viewName + suffix;\n\t}", "private void CallHomePage() {\n\t\t\n\t\tfr = new FragmentCategories();\n\t\tFragmentManager fm = getFragmentManager();\n\t\tFragmentTransaction fragmentTransaction = fm.beginTransaction();\n\t\tfragmentTransaction.replace(R.id.fragment_place, fr);\n\t\tfragmentTransaction.addToBackStack(null);\n\t\tfragmentTransaction.commit();\n\n\t}", "@Override\n public int getLayout() {\n return R.layout.activity_home;\n }", "@Override\r\n\tpublic String getViewIdentifier() {\n\t\treturn ClassUtils.getUrl(this);\r\n\t}", "public String toWelcome() {\r\n\t\treturn \"/secured/fragenpool.xhtml\";\r\n\t}", "public java.lang.String getViewName() {\r\n return viewName;\r\n }", "@Test\n public void testHome() {\n GenericServiceMockup<Person> personService = new GenericServiceMockup<Person>();\n homeController.setPrivilegeEvaluator(mockup);\n homeController.setPersonBean(personService);\n ModelAndView result = homeController.home();\n assertEquals(\"Wrong view name for exception page\", HomeController.HOME_VIEW, result.getViewName());\n }", "public String getViewName() {\n return viewName;\n }", "@Override\n\tpublic String getViewIdentifier() {\n\t\treturn ClassUtils.getUrl(this);\n\t}", "@Override\n\tpublic String getViewIdentifier() {\n\t\treturn ClassUtils.getUrl(this);\n\t}", "public String getView();", "public String getView();", "public String getViewName() {\n return viewName;\n }", "public void goToHome() {\n navController.navigate(R.id.nav_home);\n }", "public void goTo(View view) {\n if (stage != null) {\n try {\n Parent root = FXMLLoader.load(getClass().getResource(\"../ui/\" + view.toString() + \".fxml\"));\n stage.setTitle(APP_NAME);\n stage.setScene(new Scene(root, APP_WIDTH, APP_HEIGHT));\n stage.show();\n } catch (IOException e) {\n System.err.println(\"The view \" + \"../ui/\" + view.toString() + \".fxml\" + \" doesn't exist.\");\n e.printStackTrace();\n }\n }\n }", "public void homeButtonClicked(ActionEvent event) throws IOException {\n\t\tSystem.out.println(\"Loading Home...\");\n\t\tAnchorPane pane = FXMLLoader.load(getClass().getResource(\"HomeFXML.fxml\"));\n\t\trootPane.getChildren().setAll(pane);\n\t\t\n\t}", "@RequestMapping(value= {\"/flight-home\",\"/\"})\n\tpublic ModelAndView flightSearchPage() {\n\t\treturn new ModelAndView (\"home\");\n\t}", "public Home clickonHome()\n\t{\n\t\tdriver.findElement(By.xpath(home_xpath)).click();\n\t\treturn new Home(driver);\n\t}", "private void openHome() {\n Intent intent = new Intent(this, WelcomeActivity.class);\n startActivity(intent);\n\n finish();\n }" ]
[ "0.6822435", "0.62661755", "0.6217795", "0.6203774", "0.6201253", "0.6188922", "0.6154045", "0.61244094", "0.61224985", "0.6106122", "0.60122067", "0.6010745", "0.5981612", "0.5978502", "0.5944166", "0.59367555", "0.592576", "0.5908651", "0.59058887", "0.58818066", "0.58613527", "0.58121455", "0.5811624", "0.58028823", "0.5802439", "0.5762883", "0.57537115", "0.5751011", "0.5749866", "0.5730767", "0.5727496", "0.5722341", "0.5720656", "0.5698735", "0.5695897", "0.56883323", "0.5687195", "0.5685818", "0.5684949", "0.56697893", "0.5664493", "0.5647942", "0.5642337", "0.5627158", "0.56144506", "0.56126827", "0.55957377", "0.5583953", "0.55622166", "0.5562069", "0.5552043", "0.55472386", "0.5546804", "0.5546231", "0.55370605", "0.55292726", "0.5520804", "0.5518295", "0.55155826", "0.55142164", "0.5508812", "0.55057514", "0.55033046", "0.55011755", "0.54941577", "0.5478089", "0.5473713", "0.54624504", "0.54620934", "0.5453077", "0.54386073", "0.543825", "0.5432678", "0.5420102", "0.5418831", "0.54147345", "0.54089034", "0.54059035", "0.54056275", "0.54048526", "0.5399382", "0.5395744", "0.53821754", "0.5381454", "0.5380037", "0.5359943", "0.53440213", "0.5341456", "0.5335022", "0.53239334", "0.5321733", "0.5321733", "0.5319319", "0.5319319", "0.53177196", "0.5315844", "0.531458", "0.53058124", "0.53055495", "0.530232", "0.52981293" ]
0.0
-1
Create a new student object and return it
@ResponseBody @RequestMapping(value = "/getstudent/{id}/{name}", method=RequestMethod.GET, produces={"application/json", "application/xml"}) public Student getStudent(HttpServletRequest request, HttpServletResponse response, @PathVariable ("id") int id, @PathVariable("name") String name){ SimpleDateFormat dateFormatter = new SimpleDateFormat("MM/dd/yyyy"); Student student = new Student(id, name, dateFormatter.format(new Date())); List<Course> cources = student.getCourses(); cources.add(new Course("Math", 15)); cources.add(new Course("Politics", 100)); return student; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Student createStudent();", "private Student createStudent(Element studentNode) {\n String serialNumber = studentNode.getAttribute(\"serialNumber\");\n Student b = new Student();\n b.setSerialNumber(serialNumber);\n\n b.setName(getTextFromTagName(studentNode, \"name\"));\n b.setGroup(Integer.valueOf(getTextFromTagName(studentNode, \"group\")));\n b.setId(Long.valueOf(getTextFromTagName(studentNode, \"id\")));\n\n return b;\n }", "void create(Student entity);", "public static Student getRandomStudentObject() {\n return new Student(\"Abc\", \"99\", \"10th\");\n }", "public Student insertStudent() {\n\t\tSystem.out.print(\"\\n--- 학생 정보 등록 ---\\n\");\n\t\tSystem.out.print(\"학생 이름 입력 \");\n\t\tString name = sc.next();\n\t\tSystem.out.print(\"학생 나이 입력 \");\n\t\tint age = sc.nextInt();\n\t\tSystem.out.print(\"학생 주소 입력 \");\n\t\tString addr= sc.next();\n\t\tStudent st = new Student(name, age, addr);\n\t\treturn st;\n\t}", "public void createStudent(String name, String ID){}", "public Student(){}", "public Student() {\n \n }", "public Student() {\r\n }", "public Student() {\n }", "public Student() {\n }", "public Student() {\n }", "public Student(String studentId){\n id = studentId;\n }", "public Student()\n {\n lname = \"Tantiviramanond\";\n fname = \"Anchalee\";\n grade = 12;\n studentNumber = 2185;\n }", "public Student() \r\n {\r\n studentId = 0;\r\n studentName = \"\";\r\n studentMajor = \"\";\r\n }", "public Student build() { \n\t return new Student(this); \n\t }", "public Student(){\n firstName = \"\";\n lastName = \"\";\n bootcamp = \"\";\n id = 42;\n grade = 1.0;\n }", "public StudentRecord() {}", "public static void createRecord() throws IOException {\r\n\t\tstudRecs.add(new Student());\r\n\t\tint i = studRecs.size() - 1;\r\n\t\tStudent tempRecord = studRecs.get(i);\r\n\t\tSystem.out.println(\"Creating Student \" + i + \" (\" + tempRecord.getStudentID() + \")\");\r\n\t\ttempRecord.setFirstName(StudentInput.firstName());\r\n\t\ttempRecord.setLastName(StudentInput.lastName());\r\n\t\ttempRecord.setStreetAddress(StudentInput.streetAddress());\r\n\t\ttempRecord.setCity(StudentInput.city());\r\n\t\ttempRecord.setProvince(StudentInput.province());\r\n\t\ttempRecord.setPostalCode(StudentInput.postalCode());\r\n\t\ttempRecord.setPhoneNumber(StudentInput.phoneNumber());\r\n\t\ttempRecord.setBirthDate(StudentInput.birthDate());\r\n\t\tSystem.out.println(\"Student \" + i + \" (\" + tempRecord.getStudentID() + \")\" + \" Created!\");\r\n\t}", "Student(int i, String n) {\n id = i;\n name = n;\n }", "public Student(int studentId) \r\n {\r\n\r\n this.studentId = studentId;\r\n studentName = \"\";\r\n studentMajor = \"\";\r\n }", "public Student( String name ) {\n sname=name;\n }", "Student4(int i, String n) {\n id = i;\n name = n;\n\n }", "Student(String name){\n this.name = name;\n }", "@Override\r\n\tpublic Student createOrUpdateStudentRecord(Student student) {\r\n\t\t\tstudentDAO.addStudent(student);\r\n\t\treturn student;\r\n\t}", "public E returnStudent(String studentID){}", "@Override\n public StudentDTO createNewStudent(StudentDTO studentDTO) {\n studentRepository.save(studentMapper.studentDTOToStudent(studentDTO));\n log.info(\"Student with id: \" + studentDTO.getId() + \" successfully saved\");\n return studentDTO;\n }", "public Student(String requiredStudentName)\n {\n studentName = requiredStudentName;\n }", "public Student(String name) {\n this.name = name;\n }", "public Student(String studentID) {\r\n\t\tthis.studentID = studentID;\r\n\t}", "NominatedStudentDto create(NominatedStudentDto nominatedStudent, int userId, String userRole);", "Student() {\n // Set all to \"undefined\"/0, but assign unique student ID\n this.firstName = \"Undefined\";\n this.lastName = \"Undefined\";\n this.grade = 0;\n\n // Unique student IDs - increment lastStudentID and set it as this student's student ID\n lastStudentID++;\n this.studentID = lastStudentID;\n }", "private void addStudent() {\n\t\t\n\t\tString lastName = sLastNameTF.getText();\n\t\tString firstName = sFirstNameTF.getText();\n\t\tString schoolName = sSchoolNameTF.getText();\n\t\tchar[] password = sPasswordPF1.getPassword();\n\t\tString sA1 = sSecurityQ1TF.getText();\n\t\tString sQ1 = (String)sSecurityList1.getSelectedItem();\n\t\tString sA2 = sSecurityQ2TF.getText();\n\t\tString sQ2 = (String)sSecurityList2.getSelectedItem();\n\t\tString grade = (String)sGradeList.getSelectedItem();\n\t\t\n\t\tstudent = new Student(lastName, firstName, schoolName, password, sA1, sQ1, sA2, sQ2, grade);\n\t\t\n\t\t//Add student to database\n\t\t\n\t}", "public static void testStudent() {\n Student test = new Student(-1930026144, \"Simon\");\r\n // test the id number\r\n System.out.println(test.getID() == 0);\r\n System.out.println(test.getName() == \"Simon\");\r\n // reset a name\r\n test.setName(\"John\");\r\n // test the new name\r\n System.out.println(test.getName() == \"John\");\r\n // set a grade\r\n test.setGrade('A');\r\n System.out.println(test.getGrade() == 'A');\r\n }", "public Student(String name, String SSN) {\n this.name = name;\n this.SSN = SSN;\n System.out.println(\"Student: \" + name + \", email: \" + generateEmail(name) + \", ID: \" + generateID(SSN));\n }", "public Student() {\r\n\t\tScanner in=new Scanner(System.in);\r\n\t\tSystem.out.print(\"Enter Student first name: \");\r\n\t\tthis.firstName=in.nextLine();\r\n\t\tSystem.out.print(\"Enter Student last name: \");\r\n\t\tthis.lastName=in.nextLine();\r\n\t\tSystem.out.print(\"1.Infant\\n2.child\\n3.junior\\n4.senior\\nEnter student class level: \");\r\n\t\tthis.gradeYear=in.nextInt();\r\n\t\r\n\t\tsetStudentId();\r\n\t\t\r\n\t\t\r\n\t}", "public Student(String name) {\n\n this.name = name;\n }", "public ArrayList makeStudentList() {\r\n ArrayList<String> studenter = new ArrayList();\r\n Student student = new Student();\r\n \r\n \r\n \r\n return studenter;\r\n}", "private static Student newUser(ArrayList<Student> students){\n\t\tStudent newStudent = new Student();\n\t\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter first name:\");\n\t\t\t\tnewStudent.setFirstName(input.nextLine());\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t} while(newStudent.getFirstName() == null);\n\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter last name:\");\n\t\t\t\tnewStudent.setLastName(input.nextLine());\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t} while(newStudent.getLastName() == null);\n\t\t\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter age:\");\n\t\t\t\tnewStudent.setAge(Integer.parseInt(input.nextLine()));\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t} while(newStudent.getAge() == -1);\n\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter gender(M/F):\");\n\t\t\t\tnewStudent.setGender(input.nextLine());\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t} while(newStudent.getGender() == null);\n\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter SSN:\");\n\t\t\t\tnewStudent.setSSN(input.nextLine());\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t} while(newStudent.getSSN() == null);\n\t\t \n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter address:\");\n\t\t\t\tnewStudent.setAddress(input.nextLine());\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t} while(newStudent.getAddress() == null);\n\t\t\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter city:\");\n\t\t\t\tnewStudent.setCity(input.nextLine());\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t} while(newStudent.getCity() == null);\t\t\n\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter state(two character abbreviation):\");\n\t\t\t\tnewStudent.setState(input.nextLine());\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t} while(newStudent.getState() == null);\n\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter zip:\");\n\t\t\t\tnewStudent.setZip(input.nextLine());\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t} while(newStudent.getZip() == null);\n\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter email:\");\n\t\t\t\tnewStudent.setEmail(input.nextLine());\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t} while(newStudent.getEmail() == null);\n\t\t\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter phone:\");\n\t\t\t\tString temp = input.nextLine();\n\t\t\t\t// remove all non-numeric characters\n\t\t\t\ttemp = temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t\t\t\tnewStudent.setPhone(temp);\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t} while(newStudent.getPhone() == null);\n\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter ID (Numeric):\");\n\t\t\t\tnewStudent.setID(Integer.parseInt(input.nextLine()));\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t} while(newStudent.getID() == -1);\n\t\t\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter college:\");\n\t\t\t\tnewStudent.setCollege(input.nextLine());\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t} while(newStudent.getCollege() == null);\n\n\t\tString usr = null;\n\t\tboolean failUsrCheck = false;\n\t\t\n\t\tdo{\n\n\t\t\tSystem.out.println(\"Enter user name:\");\n\t\t\tusr = input.nextLine(); \n\t\t\tfor(Student studentI : students) {\n\t\t\t\tif(usr.equals(studentI.getUsername().replace(\"\\r\",\"\"))){\n\t\t\t\t\tfailUsrCheck = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(failUsrCheck){\n\t\t\t\tSystem.out.println(\"User name already used.\");\n\t\t\t}\n\t\t}while (failUsrCheck);\n\t\tnewStudent.setUsername(usr);\n\n\t\t// Display the block of text with the password requirements\n\t\tSystem.out.println(newStudent.PASSWORD_REQUIREMENTS);\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter password:\");\n\t\t\t\tnewStudent.setPassword(input.nextLine());\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t} while(newStudent.getPassword() == null);\n\t\t\n\t\treturn newStudent;\n\t}", "private Student addStudent(String name, ArrayList<String> studentBranch) {\n\t\treturn new Student(name, studentBranch);\n\t}", "public Student(){//default constructor \r\n ID_COUNTER++;\r\n studentNum = ID_COUNTER;\r\n firstName = \"\";\r\n lastName = \"\";\r\n address = \"\";\r\n loginID = \"\";\r\n numCredits = 0;\r\n totalGradePoints = 0;\r\n }", "Student(String firstName, String lastName, int grade) {\n // Standard constructor assignments\n this.firstName = firstName;\n this.lastName = lastName;\n this.grade = grade;\n\n // Unique student IDs - increment lastStudentID and set it as this student's student ID\n lastStudentID++;\n this.studentID = lastStudentID;\n }", "Student4(int i, String n, int t) {\n id = i;\n name = n;\n age = t;\n\n }", "public Student build() {\n return mStudent;\n }", "public Student(int studentID, String firstName, String lastName) {\n this.studentID = studentID;\n this.firstName = firstName;\n this.lastName = lastName;\n }", "public Student (String first, String last, String id)\r\n\t{\r\n\t\tthis.firstName = first;\r\n\t\tthis.lastName = last;\r\n\t\tthis.studentId = id;\r\n\t}", "public Student(Person person) {\r\n\t\tsuper(person);\r\n\t}", "public Student addStudent(AddOrUpdateStudentDTO student) throws SQLException {\n\n\t\t// try with resources: used when we want for our applicaton to automatically\n\t\t// call the .close() method on whatever \"resource\"\n\t\t// we are using\n\t\t// The connection interface defines a close() method. This method, when invoked,\n\t\t// will disconnect from the database\n\t\t// Whenever we are done with our block of code inside with\n\t\ttry (Connection con = JDBCUtil.getConnection()) {\n\t\t\tString sql = \"INSERT INTO students (student_first_name, student_last_name, student_classification, student_age)\"\n\t\t\t\t\t+ \"VALUES (?,?,?,?)\";\n\n\t\t\tPreparedStatement pstmt = con.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);\n\n\t\t\tpstmt.setString(1, student.getFirstName());\n\t\t\tpstmt.setString(2, student.getFirstName());\n\t\t\tpstmt.setString(3, student.getClassification());\n\t\t\tpstmt.setInt(4, student.getAge());\n\n\t\t\tint numberOfRecordsInserted = pstmt.executeUpdate(); // Instead of execute query like we use for select\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// statement, INSERT, UPDATE, and DELETE will use\n\t\t\t// executeUpdate(). This method returns an integer representing the number of\n\t\t\t// rows that were modified.\n\n\t\t\t// if numbers of records that were inserted is NOT 1, then something went wrong\n\t\t\tif (numberOfRecordsInserted != 1) {\n\t\t\t\tthrow new SQLException(\"Adding a new Student was unsucessful\");\n\t\t\t}\n\n\t\t\tResultSet rs = pstmt.getGeneratedKeys();\n\t\t\trs.next(); // iterating to the first row\n\t\t\tint automaticallyGeneratedId = rs.getInt(1); // grabing the first column information from that \"row\"\n\n\t\t\t// When we return the Student that we created in the database\n\t\t\t// The missing data is the automatically generated ID\n\t\t\t// How do we obtain that id?\n\t\t\treturn new Student(automaticallyGeneratedId, student.getFirstName(), student.getLastName(),\n\t\t\t\t\tstudent.getClassification(), student.getAge());\n\t\t}\n\t}", "Student getStudentById(Long id);", "public Optional<DbStudentEntity> create(\n final Id id,\n final String name,\n final String address,\n final String rollNo,\n final String collegeCode,\n final String courseCode);", "public Student(String name, String gender, String email){\n this.name = name;\n this.gender = gender;\n this.email = email;\n this.course1 = new Course();\n this.course2 = new Course();\n this.course3 = new Course();\n }", "@Override\r\n\t@Transactional\r\n\tpublic void createStudent(Bookmodel s1) {\n\t\tdao.createStudent(s1);\r\n\t}", "@Override\n\t\t\tpublic Student executor(Object... parameters) {\n\t\t\t\tStudent s=new Student();\n\t\t\t\ts.setId(Integer.parseInt(parameters[0].toString()));\n\t\t\t\ts.setName(parameters[1].toString());\n\t\t\t\treturn s;\n\t\t\t}", "public Student(String name) { // constructor\n\t\tthis.name = name; \n\t}", "public StudentDemo(){\r\n \r\n \r\n \r\n }", "Student(String name, double cgpa, int token){\n this.name=name;\n this.cgpa=cgpa;\n this.token=token;\n }", "public static final Account createDefaultStudentAccount() {\n Name name = new Name(\"Bob\");\n Credential credential = new Credential(\"student\", \"student\");\n MatricNumber matricNumber = new MatricNumber(\"A0123456X\");\n PrivilegeLevel privilegeLevel = new PrivilegeLevel(1);\n Account student = new Account(name, credential, matricNumber, privilegeLevel);\n return student;\n }", "public Student addStudent(Student student){\r\n Student.assignId(student);\r\n Student response = repo.save(student);\r\n if(response == null){\r\n StudentChangeEvent event = new StudentChangeEvent(EventType.ADD, student);\r\n notifyObservers(event);\r\n }\r\n return response;\r\n }", "public Student()\r\n {\r\n //This is intended to be empty\r\n }", "Student get(long id);", "public void addStudent(Student student);", "public Student(String firstName, String lastName, int grade) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.grade = grade; \n studentNumber = totalStudents++; // the new student's number is equal the total number of students, therefore, each student number will be unique\n }", "public static void creaStudente(Student stud) {\n\t\ttry {\n\t\t\tRequestContent rp = new RequestContent();\n\t\t\trp.type = RequestType.CREATE_USER;\n\t\t\trp.userType = UserType.STUDENT;\n\t\t\trp.parameters = new Object[] { stud };\n\t\t\tsend(rp);\n\t\t} catch (Exception e) {\n\n\t\t}\n\t}", "public Student( String name , String address ){//constructor with arguments \r\n \tID_COUNTER++;\r\n \tstudentNum = ID_COUNTER;\r\n getFirstAndLastName( name );\r\n this.address = address ;\r\n loginID = makeLoginID() ;\r\n numCredits = 0;\r\n totalGradePoints = 0;\r\n }", "public Student(String name, int studentId) {\n this.name = name;\n this.studentId = studentId;\n this.numberOfCredits = 0;\n this.gpa = 0.0;\n }", "@Override\n\tpublic void createStudent(Student student) {\n\t\tem.persist(student);\n\t}", "public Student(int userId, String firstName, String lastName, String email, String password, int schoolId)\n {\n super(firstName, lastName, email, password, schoolId);\n this.setUserId(userId);\n this.setFirstName(firstName);\n this.setLastName(lastName);\n this.setEmail(email);\n this.setPassword(password);\n this.setSchoolId(schoolId);\n }", "public Student() {\r\n\t\timePrezime = \"Petar Petrovic\";\r\n\t\tfakultet = \"Matematicki\";\r\n\t\tgodina = 1;\r\n\t}", "@Override\n\tpublic Student addStudent(Student std)\n\t {\n\t\t return studentrepo.save(std);\t\t \n\t }", "@Override\n\tpublic void create(Student student) {\n\t\tString query=\"insert into student values('\"+student.getId()+\"','\"+student.getName()+\"','\"+student.getAge()+\"')\";\n\t//\tjdbcTemplate.update(query);\n\t\tint result=jdbcTemplate.update(query);\n\t\tSystem.out.println(result+\"Record Inserted\");\n\t}", "@Override\n public void createStudent(Student student) throws ClassRosterDuplicateIdException, ClassRosterDataValidationException, ClassRosterPersistenceException {\n if (dao.getStudent(student.getStudentId()) != null) {\n throw new ClassRosterDuplicateIdException(\"ERROR: Could not create student. Student Id \" + student.getStudentId() + \" already exists\");\n }\n \n // RULE TWO: is the student valid\n validateStudentData(student);\n \n // RULE THREE: Pass data to DAO\n dao.addStudent(student.getStudentId(), student);\n auditDao.writeAuditEntry(\"Student \" + student.getStudentId() + \" CREATED.\");\n }", "public Student(\n int userId, String firstName, String lastName, String email, String password, int\n schoolId,\n double gpa)\n {\n super(firstName, lastName, email, password, schoolId);\n this.setUserId(userId);\n this.setFirstName(firstName);\n this.setLastName(lastName);\n this.setEmail(email);\n this.setPassword(password);\n this.setSchoolId(schoolId);\n this.setGpa(gpa);\n }", "public Student(int studentId, String studentName, String studentMajor) \r\n {\r\n\r\n setId(studentId);\r\n setName(studentName);\r\n setMajor(studentMajor);\r\n\r\n }", "public Student() { //Default Constructor\n\t\tthis.roll_no=0;\n\t\tthis.full_name=\"\";\n\t\tthis.grade=\"\";\n\t}", "Schulleiter createSchulleiter();", "public void addStudent(Student student) {\n\t\t\r\n\t}", "public Student(String name, String gender,String rollNumber,String mobileNumber){\n this.name = name;\n this.gender = gender;\n this.rollNumber = rollNumber;\n this.mobileNumber = mobileNumber;\n }", "public Student(int id) {\n\t\tthis.id = id;\n\t}", "Person createPerson();", "int insert(Student record);", "int insert(Student record);", "int insert(Student record);", "@PostMapping(\"/students\")\n @Timed\n @RegionBasedInsert\n public ResponseEntity<Student> createStudent(@RequestBody Student student) throws URISyntaxException {\n log.debug(\"REST request to save Student : {}\", student);\n if (student.getId() != null) {\n return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(ENTITY_NAME, \"idexists\", \"A new student cannot already have an ID\")).body(null);\n }\n Student result = studentService.save(student);\n return ResponseEntity.created(new URI(\"/api/students/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))\n .body(result);\n }", "public Student retrieveStudentObject(String studentID) {\r\n\t\tStudent studentToRetrieve = null;\r\n\t\tStudent student = new Student();\r\n\r\n\t\ttry {\r\n\t\t\tList<Student> listOfStudents = student.retrieveAllStudentObjects();\r\n\r\n\t\t\tfor (int i = 0; i < listOfStudents.size(); i++) {\r\n\t\t\t\tif (listOfStudents.get(i).getStudentID().equals(studentID)) {\r\n\t\t\t\t\tstudentToRetrieve = listOfStudents.get(i);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (studentToRetrieve == null) {\r\n\t\t\t\tthrow new Exception();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn studentToRetrieve;\r\n\t}", "public static void main(String[] args) {\n Student student = Student.createInstanceByIdAndFirstName(10 , \"Jhn\");\n Student student1 = Student.createInstanceByIdAndLastName(11, \"Smith\");\n }", "public Student(String nm, int day, int month, int year){\r\n\t\tthis.name = nm;\r\n//\t\tthis.username = createUsername(nm); //creates unique username from Student's name\r\n\r\n\t dateofbirth = LocalDate.of(year, month, day);\r\n\t\tthis.age = getAge();\r\n\t\tStudent.userID = userID++; //ID increments for each new User\r\n\t\t\r\n\t\tthis.username = getUsername();\r\n\t}", "Individual createIndividual();", "private static int addNewStudent(){\n\t\tSystem.out.println(\"===Add New Student To Database===\");\n\t\tScanner string_input = new Scanner(System.in); //gets String input from the user\n\t\tScanner integer_input = new Scanner(System.in); //get integer input from the user\n\t\tStudentDetails new_student = new StudentDetails();\n\t\t\n\t\tString firstname;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter new student's first name: \");\n\t\t\tfirstname = string_input.next();\n\t\t}while(!new_student.setFirstName(firstname)); //loop until name input is valid\n\t\t\n\t\tString middlename;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter new student's middle name (Type 'null' if author has no middle name): \");\n\t\t\tmiddlename = string_input.next();\n\t\t}while(!new_student.setMiddleName(middlename)); //loop until name input is valid\n\t\t\n\t\tString lastname;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter new student's last name: \");\n\t\t\tlastname = string_input.next();\n\t\t}while(!new_student.setLastName(lastname)); //loop until name input is valid\n\t\t\n\t\tint grade;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter new student's grade (9 - 12): \");\n\t\t\tgrade = integer_input.nextInt();\n\t\t}while(!new_student.setGrade(grade)); //loop until name input is valid\n\t\t\n\t\tALL_STUDENTS.add(new_student);\n\t\tint new_studentId = ALL_STUDENTS.size() - 1; //since student was the most recently added element to the ALL_STUDENTS ArrayList, its index should be ALL_STUDENTS.size() - 1. Student's index in this ArrayList should be the new student's Id.\n\t\tnew_student.setId(new_studentId); //set the new student's Id\n\t\t\n\t\treturn new_student.getId();\n\t}", "public Student getStudent() { return student; }", "public TeamStudent() {\r\n\t\t// Default constructor\r\n\t}", "@Test(priority=1)\r\n\tpublic void createStudentSeraliztion() {\r\n\t\t//for seralization i used java object student.\r\n\t\t\r\n\t\tStudent student = new Student();\r\n\t\t//information look at book tutorial-9.\r\n\t\tstudent .setId(102);\r\n\t\tstudent .setFirstName(\"Mango\");\r\n\t\tstudent .setLastName(\"Rasalu\");\r\n\t\tstudent .setEmail(\"[email protected]\");\r\n\t\tstudent .setProgramme(\"King\");\r\n\t\t//Courses have two courses.wer using ArrayList To hold different courses.\r\n\t\tArrayList<String> courseList = new ArrayList<String>();\r\n\t\tcourseList.add(\"java\");\r\n\t\tcourseList.add(\"Selenium\");\r\n\t\tstudent.setCourses(courseList);\r\n\t\tgiven()\r\n\t\t\t.contentType(ContentType.JSON)\r\n\t\t\t.body(student)\r\n\t\t.when()\r\n\t\t\t.post(\"http://localhost:8085/student\")\r\n\t\t.then()\r\n\t\t\t.statusCode(201)\r\n\t\t\t.assertThat()\r\n\t\t\t.body(\"msg\",equalTo(\"student added\"));\r\n\t\t\r\n\t\t\r\n\t}", "StudentRecord createStudentRecord(String firstName, String lastName,\n\t\t\tList<CourseType> coursesRegistered, StudentStatus status, String statusDate,\n\t\t\tString clientId) throws Exception;", "private static Student[] makeStudents() {\n\t\treturn null;\n\t}", "public static Student createEntity(EntityManager em) {\n Student student = new Student()\n .firstName(DEFAULT_FIRST_NAME)\n .middleName(DEFAULT_MIDDLE_NAME)\n .lastName(DEFAULT_LAST_NAME)\n .studentRegNumber(DEFAULT_STUDENT_REG_NUMBER)\n .dateOfBirth(DEFAULT_DATE_OF_BIRTH)\n .regDocType(DEFAULT_REG_DOC_TYPE)\n .registrationDocumentNumber(DEFAULT_REGISTRATION_DOCUMENT_NUMBER)\n .gender(DEFAULT_GENDER)\n .nationality(DEFAULT_NATIONALITY)\n .dateJoined(DEFAULT_DATE_JOINED)\n .deleted(DEFAULT_DELETED)\n .wxtJwtPq55wd(DEFAULT_WXT_JWT_PQ_55_WD);\n // Add required entity\n NextOfKin nextOfKin;\n if (TestUtil.findAll(em, NextOfKin.class).isEmpty()) {\n nextOfKin = NextOfKinResourceIT.createEntity(em);\n em.persist(nextOfKin);\n em.flush();\n } else {\n nextOfKin = TestUtil.findAll(em, NextOfKin.class).get(0);\n }\n student.getRelatives().add(nextOfKin);\n return student;\n }", "public Student getStudent() {\n return student;\n }", "void save(Student student);", "public static void main(String[] args) {\n Student s1 = new Student(\"Azat\");\n Student s2 = new Student(\"Saida\");\n Student s3 = new Student(\"Adil\");\n Student s4 = new Student(\"Sabira\");\n Student s5 = new Student(\"Saniya\");\n\n\n List<Student> cybertekStudents = new ArrayList<>(Arrays.asList(s1, s2, s3, s4, s5));\n\n School cybertek = new School(\"Cybertek\", cybertekStudents);\n\n cybertekStudents.add(new Student(\"Denis\"));\n cybertekStudents.add(new Student(\"Irina\"));\n\n System.out.println(cybertek);\n System.out.println(cybertek.schoolName);\n System.out.println(cybertek.allStudentsList);\n\n Student[] students = {new Student(\"Gulnaz\"),\n new Student(\"Sardar\")};\n cybertek.addNewStudent(students);\n System.out.println(cybertek.allStudentsList);\n\n for (Student each : cybertekStudents) {\n System.out.println(each.studentName);\n //347-785-9417 munavvar\n //donna fro Wic, how she is share info 718 616 4338\n\n\n }\n }", "@PostMapping(\"/api/students\")\n public ResponseEntity createOrUpdateStudent(@RequestBody StudentDto studentRequest) {\n this.studentService.createOrUpdateStudent(studentRequest);\n return ResponseEntity.ok().build();\n }", "static void initializeStudentSystem() {\r\n\r\n Course math = new Course(\"1000\", \"Mathematics\", \"College of Science\");\r\n Course computing = new Course(\"1001\", \"Computing\", \"College of Engineering\");\r\n Course english = new Course(\"1002\", \"English\", \"College of Liberal Arts\");\r\n Course history = new Course(\"1003\", \"History\", \"College of Liberal Arts\");\r\n Course biology = new Course(\"1004\", \"Biology\", \"College of Science\");\r\n courses.put(math.getCRN(), math);\r\n courses.put(computing.getCRN(), computing);\r\n courses.put(english.getCRN(), english);\r\n courses.put(history.getCRN(), history);\r\n courses.put(biology.getCRN(), biology);\r\n //\r\n User admin = new User();\r\n admin.setUsername(\"admin\");\r\n admin.setPassword(\"admin\");\r\n admin.setAccountType(4);\r\n accounts.put(admin.getUsername(), admin);\r\n //\r\n Student defaultStudent = new Student();\r\n defaultStudent.setName(\"Jose Cabrera\");\r\n defaultStudent.setUsername(\"John1\");\r\n defaultStudent.setPassword(\"123\");\r\n defaultStudent.setId(\"80539934\");\r\n defaultStudent.setMajor(\"CS\");\r\n defaultStudent.setAccountType(1);\r\n defaultStudent.setGraduationStatus(21);\r\n accounts.put(\"John1\", defaultStudent);\r\n //\r\n Student defaultStudent2 = new Student();\r\n defaultStudent2.setName(\"Raul Hinostroza\");\r\n defaultStudent2.setUsername(\"John2\");\r\n defaultStudent2.setPassword(\"123\");\r\n defaultStudent2.setId(\"805393\");\r\n defaultStudent2.setMajor(\"CS\");\r\n defaultStudent2.setAccountType(1);\r\n accounts.put(\"John2\", defaultStudent2);\r\n //\r\n Student defaultStudent3 = new Student();\r\n defaultStudent3.setName(\"Max Morales\");\r\n defaultStudent3.setUsername(\"John3\");\r\n defaultStudent3.setPassword(\"123\");\r\n defaultStudent3.setId(\"8053923\");\r\n defaultStudent3.setMajor(\"CS\");\r\n defaultStudent3.setAccountType(1);\r\n accounts.put(\"John3\", defaultStudent3);\r\n defaultStudent.addCourses(\"1000\");\r\n defaultStudent2.addCourses(\"1000\");\r\n defaultStudent3.addCourses(\"1000\");\r\n //\r\n Faculty defaultFaculty = new Faculty();\r\n defaultFaculty.setAccountType(2);\r\n defaultFaculty.setName(\"Smith\");\r\n defaultFaculty.setUsername(\"Smith1\");\r\n defaultFaculty.setPassword(\"123\");\r\n accounts.put(defaultFaculty.getUsername(), defaultFaculty);\r\n //\r\n Staff defaultStaff = new Staff();\r\n defaultStaff.setAccountType(3);\r\n defaultStaff.setName(\"Smith\");\r\n defaultStaff.setUsername(\"Smith2\");\r\n defaultStaff.setPassword(\"123\");\r\n accounts.put(defaultStaff.getUsername(), defaultStaff);\r\n }", "@Test\r\n\tpublic void createAndRetrieveStudent() {\n\t\tStudent duke = Student.find.where().eq(\"studentId\", 1).findUnique();\r\n\r\n\t\t// Check whether inMemoryDatabase() works\r\n\t\t// If not, more than 2 row might be found\r\n\t\tint totalRow = Student.find.findRowCount();\r\n\t\torg.junit.Assert.assertEquals(2, totalRow);\r\n\r\n\t\torg.junit.Assert.assertNotNull(duke);\r\n\t\torg.junit.Assert.assertEquals(1, duke.studentId.longValue());\r\n\t}", "public Student(String myname, int myid){ \r\n\t\tname = myname;\r\n\t\tid = myid;\r\n\t\tgrades[0]= -1;\r\n\t\tgrades[1]= -1;\r\n\t\tgrades[2]= -1;\r\n\r\n\t// use the static variable from StudentArray Class to keep count of the number of student object\r\n\t\tnumberOfStudents++; \r\n\t}" ]
[ "0.8587213", "0.76602536", "0.73838705", "0.73810923", "0.73418975", "0.7271858", "0.7173844", "0.71528345", "0.70362467", "0.7016495", "0.7016495", "0.7016495", "0.7014141", "0.70078033", "0.6999796", "0.6992419", "0.69771415", "0.6924644", "0.6894341", "0.6855247", "0.68438566", "0.6835873", "0.6827509", "0.6825004", "0.67903876", "0.67850757", "0.67711514", "0.669738", "0.6671917", "0.666884", "0.6649698", "0.6641783", "0.6631822", "0.66168344", "0.6599475", "0.65852726", "0.6581801", "0.6573611", "0.6551559", "0.6550456", "0.65422845", "0.6484568", "0.6484243", "0.64784867", "0.64542985", "0.6435152", "0.64295125", "0.6400258", "0.63932055", "0.6392874", "0.639212", "0.6389786", "0.6387693", "0.6380056", "0.63787407", "0.6373857", "0.63636464", "0.63630104", "0.63626534", "0.636156", "0.6361169", "0.6343823", "0.6312509", "0.6309131", "0.6307649", "0.6300041", "0.62996626", "0.6279484", "0.62417674", "0.62374395", "0.6228037", "0.62269044", "0.620826", "0.619547", "0.6188736", "0.61833847", "0.61773425", "0.61759955", "0.6175406", "0.6172446", "0.6172446", "0.6172446", "0.6162407", "0.6161646", "0.6146982", "0.61383206", "0.6136304", "0.6125612", "0.6124588", "0.6124359", "0.6122758", "0.61138207", "0.6112334", "0.6101903", "0.6099813", "0.6085339", "0.60839087", "0.6078495", "0.6075387", "0.6072226", "0.60673904" ]
0.0
-1
button that lets user to go to main screen
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_result); initializeWidgets(); // initialize the widgets on the front end String log = getIntent().getStringExtra("LOG"); // get the log from the main activity using intent int correctAnswers = getIntent().getIntExtra("CorrectAnswers", 0); // get the correct number of answers int totalAnswers = getIntent().getIntExtra("TotalAnswers", 0); // get the total number of answers resultTextView.setText(log); // set the text to textview int correctPercentage = findPercentage(correctAnswers, totalAnswers); // find the percentage of the correct answers int wrongPercentage = findPercentage(totalAnswers - correctAnswers, totalAnswers); // find the percentage of the wrong answers resultTextView.append("\n\n\n\n" + correctPercentage + "% Correct Answer"); // set correct percentage resultTextView.append("\n" + wrongPercentage + "% Wrong Answer"); // set wrong percentage }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void gotoMain(View view) {\n finish();\n }", "void goMainScreen(){\n\t\tcheckSavePwd();\n\t\tActionEvent e = new ActionEvent();\n\t\te.sender = this;\n\t\te.action = ActionEventConstant.ACTION_SWITH_TO_CATEGORY_SCREEN;\n\t\tUserController.getInstance().handleSwitchActivity(e);\n\t}", "public void onMainClick(){\r\n\t\tmyView.advanceToMain();\r\n\t}", "public void backMainButton (View v) {\n Intent nextScreen = new Intent(getBaseContext(), MainActivity.class);\n startActivity(nextScreen);\n }", "private void goToMenu() {\n game.setScreen(new MainMenuScreen(game));\n\n }", "private void goToMenu() {\n\t\tgame.setScreen(new MainMenuScreen(game));\n\n\t}", "public void gotoMain(View v) {\n Intent intent = new Intent(chords.this, MainActivity.class);\n startActivity(intent);\n }", "private void goToMain(){\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n }", "@Override\n public void buttonClick(ClickEvent event) {\n \tgetUI().getNavigator().navigateTo(NAME + \"/\" + contenView);\n }", "private void returnToMain() {\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n }", "public void onClick(View v) {\n Intent nextScreen = new Intent(getApplicationContext(), MainActivity.class);\n startActivity(nextScreen);\n }", "@FXML\r\n\tpublic void goToMain() {\r\n\t\tViewNavigator.loadScene(\"Welcome to WatchPlace\", ViewNavigator.HOME_SCENE);\r\n\t}", "public void returnToMainMenu(View view){\n Intent main_menu_intent = new Intent(this, MainActivity.class);\r\n startActivity(main_menu_intent);\r\n }", "private void redirectToMain() {\n\t\tIntent intent = new Intent(this, Main.class);\r\n\t\tstartActivity(intent);\r\n\t\tfinish();\r\n\t}", "public void backToMain(View view) {\n startActivity(new Intent(getApplicationContext(), GameChoiceActivity.class));\n }", "private void goToMain(){\n Intent intent = new Intent(getBaseContext(), MainActivity.class);\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n Intent returns = new Intent(Welcome.this, Returns.class);\n startActivity(returns);\n\n }", "@Override\n public void jumpActivity() {\n startActivity(new Intent(MainActivity.this, MainActivity.class));\n }", "public void pressMainMenu() {\n }", "public void goToMainMenu(View v){\n startActivity(new Intent(MainActivity.this, frontClass.class));\n }", "void gotoMainIntent() {\r\n // Intenting to start the activity \"main\".\r\n Intent mainIntent = new Intent(this, Main.class);\r\n this.startActivity(mainIntent);\r\n this.finish(); // Splash screen is done now... Needed, otherwise when closing the main activity will result\r\n // in coming back to the splashscreen.\r\n }", "private void backButtonAction() {\n CurrentUI.changeScene(SceneNames.LOGIN);\n }", "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 void navigateToHome() {\n Intent intent = new Intent(this, MainMenu.class);\n startActivity(intent);\n finish();\n }", "@Override\n\tpublic void goToMainMenu() {\n\t\tfinish();\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 }", "public void onClick(View v) {\n Intent intent = new Intent(MainActivity.this, Setup.class);\n startActivity(intent);\n }", "public void onClick(View v) {\n Intent intent = new Intent(MainActivity.this, Setup.class);\n startActivity(intent);\n }", "public void onClick(View v) {\n Intent intent = new Intent(MainActivity.this, Setup.class);\n startActivity(intent);\n }", "private void goToMainScreen() {\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n Intent mainIntent;\n\n MainActivity act = new MainActivity();\n Intent intent = new Intent(getApplication(), MainActivity.class);\n startActivity(intent);\n finish();\n }\n }, SPLASH_DISPLAY_LENGHT);\n }", "private void goMainActivity() {\n Intent i = new Intent(this, MainActivity.class);\n startActivity(i);\n finish();\n }", "public void returnToMainScreen(ActionEvent event) throws IOException {\n Parent root = FXMLLoader.load(getClass().getResource(\"/view/MainScreen.fxml\"));\n Scene scene = new Scene(root);\n Stage window = (Stage) ((Node)event.getSource()).getScene().getWindow();\n window.setScene(scene);\n window.show();\n }", "public void returnToMenu(){\n client.moveToState(ClientState.WELCOME_SCREEN);\n }", "public void gotoHome(){ application.gotoHome(); }", "public void backToMain(View view)\n {\n Intent back = new Intent(this,MainActivity.class);\n startActivity(back);\n finish();\n }", "public void launchMaster()\n {\n \tIntent mIntent = new Intent(MainActivity.this, MasterButtonActivity.class);\n \tstartActivityForResult(mIntent, NEW_MASTER_BUTTON_ACTIVITY);\n }", "private void backToMenu() {\n game.setScreen(new StartScreen(game));\n }", "public void launchMainScreen(View view) {\n startActivity(new Intent(view.getContext(), SearchCreateDeleteActivity.class));\n finish();\n }", "public void goToHome() {\n Intent intent = new Intent(this, MainActivity_3.class);\n startActivity(intent);\n }", "@Override\r\n\tpublic void buttonClick(ClickEvent event) {\r\n\t\tString buttonId = event.getButton().getId();\r\n\t\t\r\n\t\tswitch(buttonId) {\r\n\t\t\r\n\t\t//opens the mainView if the user clicks the gefühlslage button\r\n\t\tcase \"gefuehlslage\":\r\n\t\t\tmenuView.getUI().getNavigator().navigateTo(Views.MAIN_VIEW);\r\n\t\t break;\r\n\t\t \r\n\t\t//opens the diaryView if the user clicks the diary button \r\n\t\tcase \"diary\":\r\n\t\t\tmenuView.getUI().getNavigator().navigateTo(Views.DIARY_VIEW);\r\n\t\t break;\r\n\t\t \r\n\t\t//opens the reportView if the user clicks the report button \r\n\t\tcase \"report\":\r\n\t\t\tmenuView.getUI().getNavigator().navigateTo(Views.REPORT_VIEW);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t//opens the reminderView if the user clicks the reminder button\t\r\n\t\tcase \"reminder\":\r\n\t\t\tmenuView.getUI().getNavigator().navigateTo(Views.REMINDER_VIEW);\r\n\t\t break;\r\n\t\t \r\n\t\t//opens the medInfoView if the user clicks the medication information button \r\n\t\tcase \"medInfo\":\r\n\t\t\tmenuView.getUI().getNavigator().navigateTo(Views.MEDICATION_INFORMATION_VIEW);\r\n\t\t break;\r\n\t\t \r\n\t\t//opens the depErkView if the user clicks the definition depression button \r\n\t\tcase \"depErk\":\r\n\t\t\tmenuView.getUI().getNavigator().navigateTo(Views.DEFINITION_DEPRESSION_VIEW);\r\n\t\t break;\r\n\t\t \r\n\t\t//opens the settingsView if the user clicks the settings button \r\n\t\tcase \"settings\":\r\n\t\t\tmenuView.getUI().getNavigator().navigateTo(Views.SETTINGS_VIEW);\r\n\t\t break;\r\n\t\t \r\n\t\t//opens the sosView if the user clicks the sos button\r\n\t\tcase \"sos\":\r\n\t\t\tmenuView.getUI().getNavigator().navigateTo(Views.SOS_VIEW);\r\n\t\t break;\r\n\t\t \r\n\t\t//opens the chatView if the user clicks the chat button \r\n\t\tcase \"chat\":\r\n\t\t\tmenuView.getUI().getNavigator().navigateTo(Views.CHAT_VIEW);\r\n\t\t break;\r\n\t\t}\r\n\t}", "private void goToMainPage() {\n mAppModel.getErrorBus().removePropertyChangeListener(this);\n mAppModel.removePropertyChangeListener(this);\n mNavigationHandler.goToMainPage();\n }", "@Override\n public void onClick(View v) {\n Intent HomeScreen = new Intent(v.getContext(), MainActivity.class);\n startActivity(HomeScreen);\n }", "private void redirectTO() {\n\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n\n finish();\n }", "@Override\n\tpublic void LeftButtonClick() {\n\t\tfinish();\n\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent in = new Intent(getApplicationContext(),MainActivity.class);\n\t\t\t\tstartActivity(in);\n\t\t\t}", "private void goToMainActivity() {\n\n Intent mainIntent = new Intent(this, MainActivity.class);\n mainIntent.putExtra(DAF_YOMI_DETAILES, mDafYomiDetailes);\n startActivity(mainIntent);\n finish();\n\n }", "private void returnToMainScreen(ActionEvent event) throws IOException {\r\n\r\n Parent parent = FXMLLoader.load(getClass().getResource(\"../view/MainScreen.fxml\"));\r\n Scene scene = new Scene(parent);\r\n Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow();\r\n stage.setScene(scene);\r\n stage.show();\r\n }", "public void clickGoToLogin(){\n\t\t\n\t\tgoToLoginBtn.click();\n\t\t\n\t}", "public void activateButton() {\n\t\tif (isBrowser) this.bringToBack();\r\n\t\tMainActivity.resetXY();\r\n\t}", "public void ClickHome(View view){\n MainActivity.redirectActivity(this,MainActivity.class);\n\n }", "@Override\r\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\tOpenscreen.open(\"/admin_main/first_main.fxml\");\r\n\t\t\t}", "public void startMain(View view) {\n Toast.makeText(LoginActivity.this, \"Login Button Clicked\", Toast.LENGTH_SHORT).show();\n }", "public void navigateToHomePage()\n\t {\n\t if(getAdvertisementbtn().isPresent())\n\t getAdvertisementbtn().click();\n\t }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(LaunchActivity.this, MainActivity.class);\n startActivity(intent);\n }", "@FXML\r\n public void handleOnHomeButtonClick ()\r\n {\r\n mainApp.showMainScreen();\r\n }", "@Override\n public void onClick(View v) {\n navController.navigate(R.id.two);\n }", "@Override\n\t\tpublic void onClick(View v) {\n\t\t\tIntent i1= new Intent(MainActivity.this,page1.class);\n\t\t\tstartActivity(i1);\n\t\t\t\n\t\t}", "private void goToMainActivity(){\n Log.d(TAG, \"goToMainActivity: called\");\n saveUserLogin(login);\n\n Intent intent = new Intent(\"android.intent.action.MapActivity\");\n view.getContext().startActivity(intent);\n }", "public void pressHomeButton() {\n System.out.println(\"TV is already on the home screen\\n\");\n }", "@Override\r\n\tpublic void leftbuttonclick(View view) {\n\t\t Intent intent=new Intent (mContext,MainActivity.class);\r\n\t\t FuBaoApplication.getInstance().setInt(0);\r\n\t\t startActivity(intent);\r\n\t\t\r\n\t}", "@Override\r\n public void onClick(View v) {\n startActivity(new Intent(TwoPlayer.this, MainMenu.class));\r\n finish();\r\n }", "@Override\n\t\t\tpublic void onClick() {\n\t\t\t\tToast.makeText(TestRolateAnimActivity.this, \"正在跳转\", 1000).show();\n\t\t\t\tIntent intentSwitch = new Intent(TestRolateAnimActivity.this,com.example.thirdapp.LocationActivity.class); \n\t\t\t\tstartActivity(intentSwitch);\n\t\t\t\tSystem.out.println(\"4\");\n\t\t\t}", "public void backtoMain()\n {\n Intent i=new Intent(this,MainActivity.class);\n startActivity(i);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent i= new Intent(MainActivity.this,page8.class);\n\t\t\t\tstartActivity(i);\n\t\t\t\t\n\t\t\t}", "public void backToMain(ActionEvent event) throws IOException{\n try {\n FXMLLoader loader = new FXMLLoader(getClass().getResource(\"../view/main.fxml\"));\n root = loader.load();\n MainController controller = loader.getController();\n controller.selectTab(1);\n stage = (Stage)((Node)event.getSource()).getScene().getWindow();\n scene = new Scene(root);\n stage.setScene(scene);\n stage.show();\n } catch (IOException e) {\n showError(true, \"Can not load the protected page.\");\n }\n }", "@Override\r\n public void onClick(View view) {\n Intent intent = new Intent(GuidePage.this, LoginOrRegister.class);\r\n startActivity(intent);\r\n }", "private void goMainActivity() {\n Intent i = new Intent(this, ProfileActivity.class);\n startActivity(i);\n\n //prevents user going back to this screen after signing up\n finish();\n }", "private void goToLoginScreen()\n {\n Intent intent = new Intent(this, Login.class);\n startActivity(intent);\n }", "private void BacktoMainActionPerformed(java.awt.event.ActionEvent evt) {\n new Machines().setVisible(true);\n }", "public void onClick(View view) {\n Intent nextScreen = new Intent(view.getContext(), Mockup1.class);\n startActivityForResult(nextScreen, 0);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent inten = new Intent(Main_Activity.this, Help.class);\n\t\t\t\tstartActivity(inten);\n\t\t\t}", "void mainButtonPressed();", "private void openHome(){\n Intent intent2 = new Intent(AddExercises.this, MainActivity.class);\n startActivity(intent2);\n }", "@Override\n public void onClick(View view) {\n MainActivity.loadStart = true;\n Intent intent = new Intent(WelcomeActivity.this,\n MainActivity.class);\n startActivity(intent);\n finish();\n }", "public void gotoLogin() {\n try {\n LoginController login = (LoginController) replaceSceneContent(\"Login.fxml\");\n login.setApp(this);\n } catch (Exception ex) {\n Logger.getLogger(IndieAirwaysClient.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n public void onClick(View view) {\n startActivity(new Intent(StartActivity.this, MainActivity.class));\n }", "private void goToHome() {\n finish();\n Intent onPropertyView = new Intent(ChatMessage.this, MainActivity.class);\n startActivity(onPropertyView);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tstartActivity(new Intent(MainActivity.this,\n\t\t\t\t\t\tcom.itcuties.android.apps.MainActivity.class));\n\n\t\t\t}", "@Override\n public void onClick(View v) {\n startActivity(new Intent(StartPage.this,MainActivity.class));\n }", "@FXML\r\n void returnToMainMenu(ActionEvent event) throws Exception {\r\n \tGeneralMethods.ChangeScene(\"MainMenu\", \"MainMenu\");\r\n }", "@Click(R.id.ivReturn)\n\tvoid toReturn() {\n\t\tfinish();\n\t}", "@Override\n\t\t\tpublic void onClick() {\n\t\t\t\tToast.makeText(TestRolateAnimActivity.this, \"正在跳转\", 1000).show();\n\t\t\t\tIntent intentSwitch = new Intent(TestRolateAnimActivity.this,com.SamePlacesCommunity.Main.UserServiceActivity.class); \n\t\t\t\tstartActivity(intentSwitch);\n\t\t\t\tSystem.out.println(\"2\");\n\t\t\t}", "@Override\n\tpublic void onClick(View v) {\n\t\tswitch (v.getId()) {\n\t\tcase R.id.iv_address_to_home:\n\t\t\tIntent intent1 = new Intent();\n\t\t\tintent1.setClass(this, MainActivity.class);\n\t\t\tstartActivity(intent1);\n\t\t\tbreak;\n\t\tcase R.id.iv_address_return_mymarket:\n\t\t\tthis.finish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "public void iniciaTelaMenu(View view){\n Intent tela = new Intent(getApplicationContext(), MainActivity.class);\n startActivity(tela);\n finish();\n }", "@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tIntent intent = new Intent(LeadModeActivity.this,MainFrameActivity.class);\n\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t}", "@Override\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tUI.getCurrent().getNavigator().navigateTo(\"CliPantallaBusquedaExpedientes\");\t \n\t\t\t}", "@Override\n\t\tpublic void onClick(View arg0) {\n\t\t\tIntent intent = new Intent(MainActivity.this, MainActivity2.class);\n\t\t\tstartActivity(intent);\n\t\t}", "public void exitToMain(View view) {\n Intent exitToMain = new Intent(getApplicationContext(), MainActivity.class);\n startActivity(exitToMain);\n }", "public void loadJoinScreen(View view) {\r\n // Do stuff in response to button press\r\n Intent intent = new Intent(this, GamePlayActivity.class);\r\n startActivity(intent);\r\n }", "private void gotoPlay() {\n Intent launchPlay = new Intent(this, GameConfig.class);\n startActivity(launchPlay);\n }", "@Override\n\t\t\tpublic void onClick() {\n\t\t\t\tToast.makeText(TestRolateAnimActivity.this, \"正在跳转\", 1000).show();\n\t\t\t\tIntent intentSwitch = new Intent(TestRolateAnimActivity.this,com.SamePlacesCommunity.Main.FeedServiceActivity.class); \n\t\t\t\tstartActivity(intentSwitch);\n\t\t\t\tSystem.out.println(\"1\");\n\t\t\t}", "@Override\n public void onClick(View view) {\n switch (view.getId())\n {\n case R.id.activity_slider_btn_skip:\n Intent loginIntent = new Intent(IntroductionActivity.this, MainActivity.class);\n loginIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(loginIntent);\n finish();\n break;\n }\n }", "public void goToHome() {\n navController.navigate(R.id.nav_home);\n }", "private void moveToMainActivity(){\r\n Intent goToMainActivity = new Intent(workoutActivity.this, BodyGroups.class);\r\n startActivity(goToMainActivity);;\r\n }", "public EmagHomePage clickonContinueButton()\n {\n continueButton.click();\n return new EmagHomePage(driver);\n }", "public void goHome();", "public void goTo() { // Navigate to home page\n\t\tBrowser.goTo(url);\n\t}", "@Override\n\t\tpublic void onClick(View arg0) {\n\t\t\tIntent intent = new Intent();\n\t\t\tintent.setClass(MainPage.this, AddPage.class);\n\t\t\tstartActivityForResult(intent,0);\n\t\t\toverridePendingTransition(R.anim.push_up_in, R.anim.push_up_out);\n\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent i = new Intent(Akun.this, Home.class);\n\t\t\t\tstartActivity(i);\n\t\t\t}", "@Override\r\n public void onClick(View view) {\r\n if(view == switchModeButton){\r\n Intent intent = new Intent(this, MainActivity.class);\r\n startActivityForResult(intent, MainActivity.TRAEMODE_RESIGTER_REQUEST_CODE);\r\n }\r\n }", "private void goToLoginPage() {\n\n startActivity(new Intent(this,LoginActivity.class));\n finish();\n }" ]
[ "0.7511108", "0.74586016", "0.73856884", "0.73531365", "0.7340331", "0.73227566", "0.7320727", "0.7262976", "0.7256168", "0.722315", "0.7207064", "0.7144325", "0.71104914", "0.70724183", "0.70175755", "0.70015997", "0.6970714", "0.6945437", "0.6893761", "0.68913054", "0.68878454", "0.6884513", "0.68634903", "0.68345696", "0.6795878", "0.6791892", "0.6785574", "0.6785574", "0.6785574", "0.6775127", "0.67665625", "0.67581075", "0.6749552", "0.6745808", "0.67454517", "0.67432314", "0.6733425", "0.67214996", "0.6718311", "0.67143714", "0.67112213", "0.67077744", "0.67011774", "0.6696086", "0.66957283", "0.6692583", "0.6690962", "0.6682991", "0.6675814", "0.6673249", "0.6671594", "0.66621405", "0.6654587", "0.6644866", "0.6633142", "0.6625593", "0.6623175", "0.6612173", "0.661017", "0.66099787", "0.66059005", "0.6605158", "0.6602392", "0.65962815", "0.65918696", "0.658053", "0.65788317", "0.6573573", "0.65722895", "0.6565544", "0.6557893", "0.65487707", "0.65443623", "0.6543305", "0.6530555", "0.65280586", "0.6505906", "0.6501773", "0.6492975", "0.64905125", "0.6489723", "0.64815915", "0.6480858", "0.6477417", "0.64739317", "0.6468477", "0.6457773", "0.6456066", "0.6455466", "0.6453438", "0.64499426", "0.6448629", "0.6442766", "0.6439885", "0.6439429", "0.6436294", "0.6435095", "0.64318705", "0.6430331", "0.64300454", "0.64260143" ]
0.0
-1
This method initializes the widgets given on the front end
private void initializeWidgets() { resultTextView = findViewById(R.id.resultTextView); goBackButton = findViewById(R.id.goBackButton); goBackButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initializeWidgets() {\n\t\timg_home = (ImageView) findViewById(R.id.img_home);\n\t\tlv_customer_info = (ListView) findViewById(R.id.lv_customer_info);\n\t\tmc_ed_search = (AutoCompleteTextView) findViewById(R.id.mc_ed_search);\n\t\ttxv_invisible = (TextView) findViewById(R.id.txv_invisible);\n\t\ttxv_invisible.setVisibility(View.GONE);\n\t\tbtn_mc_genrate_invoice = (Button) findViewById(R.id.btn_mc_genrate_invoice);\n\t}", "public void initialize() {\r\n setLayout(new BorderLayout());\r\n add(BorderLayout.CENTER, tabbedPane);\r\n for (Iterator it = widgets.iterator(); it.hasNext();) {\r\n SlotWidget widget = (SlotWidget) it.next();\r\n widget.initialize();\r\n }\r\n }", "private void setUpWidgets(){\n\n }", "public void init()\n {\n buildUI(getContentPane());\n }", "private void initializeWidgets() {\n\t\timg_home = (ImageView) findViewById(R.id.img_home);\n\t\trf_supper_admin_header_name = (TextView) findViewById(R.id.rf_supper_admin_header_name);\n\t\tch_csm = (CheckBox) findViewById(R.id.ch_csm);\n\t\timageView11 = (ImageView) findViewById(R.id.imageView11);\n\t\trf_regi_step3_tv_price = (TextView) findViewById(R.id.rf_regi_step3_tv_price);\n\t\trf_regi_step3_tv_dishname = (TextView) findViewById(R.id.rf_regi_step3_tv_dishname);\n\t\trf_regi_step3_tv_price = (TextView) findViewById(R.id.rf_regi_step3_tv_price);\n\t\trf_regi_step3_txv_starter1 = (TextView) findViewById(R.id.rf_regi_step3_txv_starter1);\n\t\tcsm_ed_starter1 = (EditText) findViewById(R.id.csm_ed_starter1);\n\t\tcsm_ed_starter1_price1 = (EditText) findViewById(R.id.csm_ed_starter1_price1);\n\t\tcsm_tv_starter2 = (TextView) findViewById(R.id.csm_tv_starter2);\n\t\tcsm_ed_starter2 = (EditText) findViewById(R.id.csm_ed_starter2);\n\t\tcsm_ed_starter2_price2 = (EditText) findViewById(R.id.csm_ed_starter2_price2);\n\t\tcsm_tv_starter3 = (TextView) findViewById(R.id.csm_tv_starter3);\n\t\tcsm_ed_starter3 = (EditText) findViewById(R.id.csm_ed_starter3);\n\t\tcsm_ed_starter3_price3 = (EditText) findViewById(R.id.csm_ed_starter3_price3);\n\t\tcsm_tv_course1 = (TextView) findViewById(R.id.csm_tv_course1);\n\t\tcsm_ed_course1 = (EditText) findViewById(R.id.csm_ed_course1);\n\t\tcsm_ed_course1_price1 = (EditText) findViewById(R.id.csm_ed_course1_price1);\n\t\tcsm_tv_course2 = (TextView) findViewById(R.id.csm_tv_course2);\n\t\tcsm_ed_course2 = (EditText) findViewById(R.id.csm_ed_course2);\n\t\tcsm_ed_course2_price2 = (EditText) findViewById(R.id.csm_ed_course2_price2);\n\t\tcsm_tv_course3 = (TextView) findViewById(R.id.csm_tv_course3);\n\t\tcsm_ed_course3 = (EditText) findViewById(R.id.csm_ed_course3);\n\t\tcsm_ed_course3_price3 = (EditText) findViewById(R.id.csm_ed_course3_price3);\n\t\tcsm_tv_dessert1 = (TextView) findViewById(R.id.csm_tv_dessert1);\n\t\tcsm_ed_dessert1 = (EditText) findViewById(R.id.csm_ed_dessert1);\n\t\tcsm_ed_dessert1_price1 = (EditText) findViewById(R.id.csm_ed_dessert1_price1);\n\t\tcsm_tv_dessert2 = (TextView) findViewById(R.id.csm_tv_dessert2);\n\t\tcsm_ed_dessert2 = (EditText) findViewById(R.id.csm_ed_dessert2);\n\t\tcsm_ed_dessert2_price2 = (EditText) findViewById(R.id.csm_ed_dessert2_price2);\n\t\tcsm_tv_dessert3 = (TextView) findViewById(R.id.csm_tv_dessert3);\n\t\tcsm_ed_dessert3 = (EditText) findViewById(R.id.csm_ed_dessert3);\n\t\tcsm_ed_dessert3_price3 = (EditText) findViewById(R.id.csm_ed_dessert3_price3);\n\t\tcsm_step3_drink = (TextView) findViewById(R.id.csm_step3_drink);\n\t\timageView00 = (ImageView) findViewById(R.id.imageView00);\n\t\tcsm_glass_wine = (TextView) findViewById(R.id.csm_glass_wine);\n\t\tcsm_ed_wine_glass_min_price = (EditText) findViewById(R.id.csm_ed_wine_glass_min_price);\n\t\tcsm_tv_min = (TextView) findViewById(R.id.csm_tv_min);\n\t\tcsm_ed_wine_glss_max_price = (EditText) findViewById(R.id.csm_ed_wine_glss_max_price);\n\t\tcsm_max = (TextView) findViewById(R.id.csm_max);\n\t\tcsm_bot_wine = (TextView) findViewById(R.id.csm_bot_wine);\n\t\tcsm_ed_wine_bottel_min_price = (EditText) findViewById(R.id.csm_ed_wine_bottel_min_price);\n\t\tcsm_min1 = (TextView) findViewById(R.id.csm_min1);\n\t\tcsm_ed_wine_bottel_max_price = (EditText) findViewById(R.id.csm_ed_wine_bottel_max_price);\n\t\tcsm_ed_bottel_of_water = (EditText) findViewById(R.id.csm_ed_bottel_of_water);\n\t\tcsm_ed_half_bootel_price = (EditText) findViewById(R.id.csm_ed_half_bootel_price);\n\t\trf_regi_step3_max2 = (TextView) findViewById(R.id.rf_regi_step3_max2);\n\t\trf_regi_step3_stl_wtr2 = (TextView) findViewById(R.id.rf_regi_step3_stl_wtr2);\n\t\tcsm_ed_min_glass_of_champ = (EditText) findViewById(R.id.csm_ed_min_glass_of_champ);\n\t\tcsm_ed_max_bottel_of_champ = (EditText) findViewById(R.id.csm_ed_max_bottel_of_champ);\n\t\tcsm_min_ed_coffee = (EditText) findViewById(R.id.csm_min_ed_coffee);\n\t\tcsm_max_ed_coffee = (EditText) findViewById(R.id.csm_max_ed_coffee);\n\t\tcsm_ed_comment = (EditText) findViewById(R.id.csm_ed_comment);\n\t\tcsm_cancel = (TextView) findViewById(R.id.csm_cancel);\n\t\tcsm_btn_confirme = (Button) findViewById(R.id.csm_btn_confirme);\n\t\tcsm_btn_cancel = (Button) findViewById(R.id.csm_btn_cancel);\n\t}", "private void initWidgets()\r\n {\r\n Log.d(TAG, \"initWidgets: Initiating Widgets\");\r\n mProgressBar=(ProgressBar)findViewById(R.id.progressBar);\r\n btnRegister=(Button)findViewById(R.id.btn_register);\r\n loadingPleaseWait=(TextView)findViewById(R.id.txtPleaseWait);\r\n mEmail=(EditText)findViewById(R.id.input_email);\r\n mPassword=(EditText)findViewById(R.id.input_password);\r\n mUsername=(EditText)findViewById(R.id.input_username);\r\n mContext= RegisterActivity.this;\r\n\r\n loadingPleaseWait.setVisibility(View.GONE);\r\n mProgressBar.setVisibility(View.GONE);\r\n\r\n }", "private void initComponent() {\n\t\taddGrid();\n\t\taddToolBars();\n\t}", "private void addWidgets() {\n\t\tgrid.setHgap(10);\n\t\tgrid.setVgap(5);\n\t\tgrid.setPadding(new Insets(150, 80, 80, 80));\n\t\tgrid.add(lblPort, 0, 1);\n\t\tgrid.add(txtPort, 1, 1);\n\t\tgrid.add(lblAdress, 0, 2);\n\t\tgrid.add(txtAdress, 1, 2);\n\t\tgrid.add(lblNick, 0, 4);\n\t\tgrid.add(txtNickname, 1, 4);\n\t\tgrid.add(lblNickTaken, 1, 5);\n\t\tgrid.add(lblCardDesign, 0, 3);\n\t\tgrid.add(comboBoxCardDesign, 1, 3);\n\t\tgrid.add(btnLogin, 0, 7);\n\t\timvStart.setImage(imageStart);\n\t}", "public void initWidgets(){\n\n g = (Globals)getApplication();\n\n //Application\n context = this;\n res = context.getResources();\n\n //Objekt\n mannschaft = g.getMannschaft();\n statistik = new Statistik();\n statistikwerte = new Statistikwerte();\n isUpdate = getIntent().getExtras().getBoolean(\"Update\");\n\n //Input-Widgets\n heim = (RadioGroup) findViewById(R.id.radioHeimAuswärts);\n gegner = (EditText) findViewById(R.id.gegnerbezeichnung);\n spielerListView = new SwipeMenuEditDelete(this, mannschaft, (SwipeMenuListView)findViewById(R.id.spielerList), new Spieler(), R.layout.swipemenu_item, false, false, false, true);\n anlegen = (Button) findViewById(R.id.stati_Anlegen);\n\n //Variablen\n spieler = new ArrayList<Spieler>();\n kategorien = new ArrayList<Kategorie>();\n datum = new Date();\n\n }", "private void initComponents()\n {\n //LAYOUT\n initLayoutComponents();\n \n //TRANSITION COMPONENTS\n initTransitionComponents();\n \n //SEARCH PANE COMPONENTS\n initSearchComponents();\n \n //RESULTS PANE COMPONENTS\n initResultComponents();\n \n // CRAWLER CONTROLS\n initCrawlerControlsComponents();\n \n // KEYWORD BAR\n initKeywordBarComponents();\n \n //WORKER CONTROLS\n initWorkerComponents();\n \n //URL COMPONENTS\n initURLMenuComponents();\n\n //BASE LAYOUT COMPONENTS\n initBaseLayout();\n }", "private void createWidgets() {\n\t\tgrid = new GridPane();\n\t\ttxtNickname = new TextField();\n\t\ttxtPort = new TextField();\n\t\ttxtAdress = new TextField();\n\n\t\tlblNick = new Label(\"Nickname\");\n\t\tlblNickTaken = new Label();\n\t\tlblPort = new Label(\"Port\");\n\t\tlblAdress = new Label(\"Adress\");\n\t\tlblCardDesign = new Label(\"Carddesign\");\n\n\t\tbtnLogin = new Button(\"\");\n\t\timageStart = new Image(BTNSTARTWOOD, 85, 35, true, true);\n\t\timvStart = new ImageView();\n\n\t\tcardDesignOptions = FXCollections.observableArrayList(\n\t\t\t\t\"original design\", \"pirate design\", \"graveyard design\");\n\t\tcomboBoxCardDesign = new ComboBox<String>(cardDesignOptions);\n\n\t\tcomboBoxCardDesign\n\t\t\t\t.setCellFactory(new Callback<ListView<String>, ListCell<String>>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic ListCell<String> call(ListView<String> list) {\n\t\t\t\t\t\treturn new ExtCell();\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t}", "private void initComponents() {\r\n\r\n setLayout(new java.awt.BorderLayout());\r\n }", "private void initComponents() {\n\t\t\n\t}", "private void initComponents() {\n\t\t\n\t}", "private void initializeWidget() {\n\n\t\ttry {\n\n\t\t\t// ScrollView scrollable_contents = (ScrollView)\n\t\t\t// findViewById(R.id.rf_booking_confirmation_scrollview);\n\t\t\t// getLayoutInflater().inflate(\n\t\t\t// R.layout.booking_confirmation_scroolview_contents,\n\t\t\t// scrollable_contents);\n\n\t\t\t// rf_booking_rg_confirmation_redio = (RadioGroup)\n\t\t\t// findViewById(R.id.rf_booking_rg_confirmation_redio);\n\t\t\t// rf_booking_rd_confirmation_redio_male = (RadioButton)\n\t\t\t// findViewById(R.id.rf_booking_rd_confirmation_redio_male);\n\t\t\t// rf_booking_rd_confirmation_redio_female = (RadioButton)\n\t\t\t// findViewById(R.id.rf_booking_rd_confirmation_redio_female);\n\t\t\trf_booking_first_name = (EditText) findViewById(R.id.rf_booking_first_name);\n\t\t\trf_booking_last_name = (EditText) findViewById(R.id.rf_booking_last_name);\n\t\t\trf_registrationi_email_id = (EditText) findViewById(R.id.rf_registrationi_email_id);\n\t\t\trf_booking_phone_number_box = (EditText) findViewById(R.id.rf_booking_phone_number_box);\n\t\t\trf_booking_comment_text_box = (EditText) findViewById(R.id.rf_booking_comment_text_box);\n\t\t\trf_booking_time_box = (TextView) findViewById(R.id.rf_booking_time_box);\n\t\t\trf_booking_date_box = (TextView) findViewById(R.id.rf_booking_date_box);\n\t\t\trf_booking_plus_box = (TextView) findViewById(R.id.rf_booking_plus_box);\n\t\t\trf_booking_people_box = (TextView) findViewById(R.id.rf_booking_no_people_box);\n\t\t\trf_booking_minus_box = (TextView) findViewById(R.id.rf_booking_minus);\n\t\t\trf_booking_loyalty_notes = (TextView) findViewById(R.id.rf_booking_loyalty_notes);\n\t\t\t\n\t\t\trf_booking_user_loyalty_pts=(TextView)findViewById(R.id.rf_booking_user_loyalty_pts);\n\t\t\t\n\t\t\tif (SharedPreference\n\t\t\t\t\t.get_user_loyalty_pts(getApplicationContext()) != \"\") {\n\t\t\t\tif (SharedPreference.get_user_loyalty_pts(\n\t\t\t\t\t\tgetApplicationContext())\n\t\t\t\t\t\t.length() != 0) {\n\t\t\n\t\t\t\t\tSystem.out\n\t\t\t\t\t.println(\"!!!!!!!!!!!!!!!!!!!!!!!!user_loyalty_pts fetch_after_setting\"\n\t\t\t\t\t\t\t+ SharedPreference\n\t\t\t\t\t\t\t\t\t.get_user_loyalty_pts(getApplicationContext()));\n\n\t\t\t\t\trf_booking_user_loyalty_pts\n\t\t\t\t\t\t\t.setText(SharedPreference\n\t\t\t\t\t\t\t\t\t.get_user_loyalty_pts(getApplicationContext()));\n\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\trf_booking_user_loyalty_pts\n\t\t\t\t.setText(\"0\");\n\n\t\t\t}\n\t\t\t\n\t\t\tif (Global_variable.lp_to_tg_customer != 0) {\n\t\t\t\trf_booking_loyalty_notes\n\t\t\t\t\t\t.setText(getResources().getString(R.string.bc_notes) +\" \"+ Global_variable.lp_to_tg_customer\n\t\t\t\t\t\t\t\t+\" \"+ getResources().getString(R.string.bc_points));\n\t\t\t} else {\n\n\t\t\t}\n\n\t\t\trf_booking_loyalty_pts_value_ = (EditText) findViewById(R.id.rf_booking_loyalty_pts_value_);\n\n\t\t\t// if\n\t\t\t// (SharedPreference.get_user_loyalty_pts(getApplicationContext())\n\t\t\t// != 0) {\n\t\t\t// rf_booking_loyalty_pts_value_.setText(SharedPreference\n\t\t\t// .get_user_loyalty_pts(getApplicationContext()));\n\t\t\t// } else {\n\t\t\t// rf_booking_loyalty_pts_value_.setText(\"0\");\n\t\t\t// }\n\n\t\t\trf_booking_date_icon = (ImageView) findViewById(R.id.rf_booking_date_icon);\n\t\t\trf_booking_time_icon = (ImageView) findViewById(R.id.rf_booking_time_icon);\n\n\t\t\trf_booking_submit_button = (ImageView) findViewById(R.id.rf_booking_submit_button);\n\t\t\t// rf_booking_sp_country_code = (Spinner)\n\t\t\t// findViewById(R.id.rf_booking_sp_country_code);\n\t\t\trf_booking_sp_country_code = (TextView) findViewById(R.id.rf_booking_sp_country_code);\n\n\t\t} catch (NullPointerException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private void initUI() {\n\t\tthis.horizontalLayout = new XdevHorizontalLayout();\n\t\tthis.gridLayout = new XdevGridLayout();\n\t\tthis.button = new XdevButton();\n\t\tthis.button2 = new XdevButton();\n\t\tthis.label = new XdevLabel();\n\n\t\tthis.button.setCaption(\"go to HashdemoView\");\n\t\tthis.button2.setCaption(\"go to CommonView\");\n\t\tthis.label.setValue(\"Go into code tab to view comments\");\n\n\t\tthis.gridLayout.setColumns(2);\n\t\tthis.gridLayout.setRows(2);\n\t\tthis.button.setWidth(200, Unit.PIXELS);\n\t\tthis.button.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.button, 0, 0);\n\t\tthis.button2.setWidth(200, Unit.PIXELS);\n\t\tthis.button2.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.button2, 1, 0);\n\t\tthis.label.setWidth(100, Unit.PERCENTAGE);\n\t\tthis.label.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.label, 0, 1, 1, 1);\n\t\tthis.gridLayout.setComponentAlignment(this.label, Alignment.TOP_CENTER);\n\t\tthis.gridLayout.setSizeUndefined();\n\t\tthis.horizontalLayout.addComponent(this.gridLayout);\n\t\tthis.horizontalLayout.setComponentAlignment(this.gridLayout, Alignment.MIDDLE_CENTER);\n\t\tthis.horizontalLayout.setExpandRatio(this.gridLayout, 10.0F);\n\t\tthis.horizontalLayout.setSizeFull();\n\t\tthis.setContent(this.horizontalLayout);\n\t\tthis.setSizeFull();\n\n\t\tthis.button.addClickListener(event -> this.button_buttonClick(event));\n\t\tthis.button2.addClickListener(event -> this.button2_buttonClick(event));\n\t}", "private void initComponents() {\n\n setLayout(new java.awt.BorderLayout());\n }", "private void initWidgets() {\n\t\tthis.spelling = (EditText) this.findViewById(R.id.EditWord_spelling);\n\t\tthis.cancel = (Button) this.findViewById(R.id.attention_cancel_button);\n\t\tthis.confirm = (Button) this.findViewById(R.id.attention_confirm_button);\n\t\tthis.meanning = (EditText) this.findViewById(R.id.EditWord_meanning);\n\t\tcancel.setOnClickListener(this);\n\t\tconfirm.setOnClickListener(this);\n\t\tif (action.equals(\"edit\")){\n\t\t\tBundle bundle = this.getIntent().getExtras();\n\t\t\tDataAccess data = new DataAccess(this);\n\t\t\tWord word =data.QueryAttention(\"ID ='\"+bundle.getString(\"id\")+\"'\", null).get(0);\n\t\t\tspelling.setText(word.getSpelling());\n\t\t\tmeanning.setText(word.getMeanning());\n\t\t}\n\t}", "private void initUI() {\n }", "public void setupUI() {\r\n\t\t\r\n\t\tvPanel = new VerticalPanel();\r\n\t\thPanel = new HorizontalPanel();\r\n\t\t\r\n\t\titemName = new Label();\r\n\t\titemName.addStyleName(Styles.page_title);\r\n\t\titemDesc = new Label();\r\n\t\titemDesc.addStyleName(Styles.quest_desc);\r\n\t\titemType = new Label();\r\n\t\titemType.addStyleName(Styles.quest_lvl);\r\n\t\t\r\n\t\tVerticalPanel img = new VerticalPanel();\r\n\t\timg.add(new Image(imgDir));\r\n\t\t\r\n\t\tvPanel.add(itemName);\r\n\t\tvPanel.add(itemDesc);\r\n\t\tvPanel.add(img);\r\n\t\tvPanel.add(hPanel);\r\n\t\t\r\n\t\tVerticalPanel mainPanel = new VerticalPanel();\r\n\t\tmainPanel.setWidth(\"100%\");\r\n\t\tvPanel.addStyleName(NAME);\r\n\t\t\r\n\t\tmainPanel.add(vPanel);\r\n \tinitWidget(mainPanel);\r\n }", "private void init() {\n setBackground(LIGHT_GRAY);\n Box layout = new Box(BoxLayout.Y_AXIS);\n\n jump = createButton(\"Jump\", null);\n exit = createButton(\"Exit!\", null);\n fly = createButton(\"Fly\", null);\n Jfloat = createButton(\"Float\", null);\n layout.add(Box.createRigidArea(new Dimension(0, 150)));\n layout.add(jump);\n layout.add(Box.createRigidArea(new Dimension(0, 25)));\n layout.add(Jfloat);\n layout.add(Box.createRigidArea(new Dimension(0, 25)));\n layout.add(fly);\n layout.add(Box.createRigidArea(new Dimension(0, 25)));\n layout.add(exit);\n add(layout);\n }", "private void initialize() {\n this.setLayout(new BorderLayout());\n this.setSize(300, 200);\n this.setPreferredSize(new java.awt.Dimension(450, 116));\n this.add(getListPanel(), java.awt.BorderLayout.CENTER);\n this.add(getButtonPanel(), java.awt.BorderLayout.SOUTH);\n }", "@Override\n\tprotected void setupWidgets() {\n\t\tmHeaderText = (TextView) findViewById(R.id.textViewHeader);\n\t\tmBrandText = (TextView) findViewById(R.id.textViewBrand);\n\t\tmModelText = (TextView) findViewById(R.id.textViewModel);\n\t\tmColorText = (TextView) findViewById(R.id.textViewColor);\n\t\tmSeatsText = (TextView) findViewById(R.id.textViewSeats);\n\t\tmPlateText = (TextView) findViewById(R.id.textViewPlate);\n\t\tmFuelText = (TextView) findViewById(R.id.textViewFuel);\n\t\tmConsumptionText = (TextView) findViewById(R.id.textViewConsumption);\n\t}", "private void init() {\n List<Contructor> list = servisContructor.getAllContructors();\n for (Contructor prod : list) {\n contructor.add(new ContructorViewer(prod));\n }\n\n Label label = new Label(\"Catalog Contructors\");\n label.setLayoutX(140);\n label.setLayoutY(20);\n label.setStyle(\"-fx-font-size:20px\");\n\n initTable();\n table.setLayoutX(120);\n table.setLayoutY(60);\n table.setStyle(\"-fx-font-size:16px\");\n\n GridPane control = new ControlPanel(this, 2).getPanel();\n control.setLayoutX(120);\n control.setLayoutY(300);\n\n panel.setAlignment(Pos.CENTER);\n panel.add(label, 0, 0);\n panel.add(table, 0, 1);\n panel.add(control, 0, 2);\n }", "private void init() {\r\n\t\tthis.setBackground(Color.decode(\"#c5dfed\"));\r\n\r\n\t\tthis.initPanelButtons();\r\n\r\n\t\tUtilityClass.addBorder(this, 20, 20, 20, 20);\r\n\t\t\r\n\t\tthis.title.setFont(ConstantView.FONT_TITLE_CRUD);\r\n\t\tthis.title.setHorizontalAlignment(JLabel.CENTER);\r\n\t\tthis.add(title, BorderLayout.NORTH);\r\n\t\t\r\n\t\tthis.add(panelButtons, BorderLayout.SOUTH);\r\n\t\tthis.jPanelFormClient.setOpaque(false);\r\n\t\tthis.add(jPanelFormClient, BorderLayout.CENTER);\r\n\t}", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "private void initialize() {\r\n this.setSize(new Dimension(800,600));\r\n this.setContentPane(getJPanel());\r\n\r\n List<String> title = new ArrayList<String>();\r\n title.add(\"Select\");\r\n title.add(\"Field Id\");\r\n title.add(\"Field Name\");\r\n title.add(\"Field Type\");\r\n title.add(\"Image\");\r\n\r\n List<JComponent> componentList = new ArrayList<JComponent>();\r\n componentList.add(checkInit);\r\n componentList.add(fieldIdInit);\r\n componentList.add(filedNameInit);\r\n componentList.add(fieldTypeInit);\r\n componentList.add(imageButton);\r\n\r\n String []arrColumn = {\"SELECT\", \"FIELD_ID\", \"FIELD_NAME\", \"FIELD_TYPE\", \"FIELD_VALUE\"};\r\n String []arrTitle = {\"SELECT\", \"FIELD_ID\", \"FIELD_NAME\", \"FIELD_TYPE\", \"FIELD_VALUE\"};\r\n // init grid\r\n grid = new GridUtils(pageSheet, title, componentList, arrColumn, preButton, afterButton, 5, arrTitle);\r\n // set title\r\n grid.setPageInfo(pageInfoLbl);\r\n \r\n searchDetailList();\r\n \r\n initComboBox();\r\n \r\n setTitle(\"Page Select page\");\r\n\t}", "private void initialize() {\r\n\t\t// set specific properties and add inner components.\r\n\t\tthis.setBorder(BorderFactory.createEtchedBorder());\r\n\t\tthis.setSize(300, 400);\r\n\t\tthis.setLayout(new BorderLayout());\r\n\t\taddComponents();\r\n\t}", "private void createWidgets() {\n\n\t\tJPanel filmPanel = createFilmPanel();\n\t\tJPanel musicPanel = createMusicPanel();\n\t\tJPanel unclassPanel = createUnclassifiedPanel();\n\n\t\tthis.add(filmPanel);\n\t\tthis.add(musicPanel);\n\t\tthis.add(unclassPanel);\n\t}", "private void initWidgets()\r\n\t{\r\n\t\t//Set string to be put into question at start\r\n\t\tString labelText = \"Click 'Next Question' button to get a new question, or 'Submit Answer' to check your answer.\";\r\n\t\t\r\n\t\t//Add radio buttons to button group to only allow 1 selection at a time\r\n\t\tgroup.add(option1);\r\n\t\tgroup.add(option2);\r\n\t\tgroup.add(option3);\r\n\t\tgroup.add(option4);\r\n\t\t\r\n\t\t//Add text to labels and format it\r\n\t\tnorthLabel.setText(\"<html><div style='text-align: center;'>\" + labelText + \"</div></html>\");\r\n\t\tnorthLabel.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\t\r\n\t\t//Add text to radio buttons and format them\r\n\t\toption1.setText(\"These are the buttons with which\");\r\n\t\toption2.setText(\"you select your choice.\");\r\n\t\toption3.setText(\"There is only one correct answer, and\");\r\n\t\toption4.setText(\"the quesion will be shown above.\");\r\n\t\toption1.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\toption2.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\toption3.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\toption4.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\t//Set default selected button\r\n\t\toption1.setSelected(true);\r\n\t\t\r\n\t\t//Add this as action listener to buttons\r\n\t\tnextQuestionButton.addActionListener(this);\r\n\t\tsubmitAnswerButton.addActionListener(this);\r\n\t\tleaderboardButtonListener.addObserver(this);\r\n\t\t\r\n\t\t//Add action listener for leaderboard button\r\n\t\tleaderboardButton.addActionListener(leaderboardButtonListener);\r\n\t\t\r\n\t\t//Add question label to north of panel\r\n\t\tthis.add(northLabel, BorderLayout.NORTH);\r\n\t\t\r\n\t\t//Add radio buttons to central panel\r\n\t\tbuttonPanel.add(option1);\r\n\t\tbuttonPanel.add(option2);\r\n\t\tbuttonPanel.add(option3);\r\n\t\tbuttonPanel.add(option4);\r\n\t\t\r\n\t\t//Add central panel to centre of panel\r\n\t\tthis.add(buttonPanel, BorderLayout.CENTER);\r\n\t\t\r\n\t\t//Add buttons to southern panel\r\n\t\tsouthPanel.add(leaderboardButton);\r\n\t\tsouthPanel.add(nextQuestionButton);\r\n\t\tsouthPanel.add(submitAnswerButton);\r\n\t\tsouthPanel.add(scoreLabel);\r\n\t\t\r\n\t\t//Add southern panel to south of panel\r\n\t\tthis.add(southPanel, BorderLayout.SOUTH);\r\n\t}", "public void init()\n\t\t{\n\t\t\t//Makes Lists\n\t\t\tmakeLists();\n\n\t\t\t//layout for GUI\n\t\t\tGridLayout layout = new GridLayout(2,4, 5 ,5);\n\t\t\tsetLayout(layout);\n\n\t\t\t//add panels to window\n\t\t\tadd(Panel_1);\n\t\t\tadd(Panel_2);\n\t\t\tadd(Panel_3);\n\t\t\tadd(Panel_4);\n\n\t\t\t//create buttons\n\t\t\tCalculateButton = new JButton(\"Calculate\");\n\t\t ExitButton = new JButton(\"Exit\");\n\n\t\t\t//connect event handlers to buttons\n\t\t CalculateButton.addActionListener(new ButtonListener());\n\t\t ExitButton.addActionListener(new ButtonListener());\n\n\t\t\t//add buttons to window\n\t\t add(CalculateButton);\n\t\t add(ExitButton);\n\n\t\t //make window visible\n\t\t\tsetVisible(true);\n\t\t}", "public Widget() {\r\n\t\t\r\n\t\twidgets = new LinkedHashMap<Component, String>();\r\n\t\t\r\n\t}", "public void init() {\n initComponents();\n initData();\n }", "private void init() {\n\t\tcreateSubjectField();\n\t\tcreateTextField();\n\t\tcreateButton();\n\t\tsetupSubjectPanel();\n\t\tsetupToDoPanel();\n\n\t\tsetBorder(BorderFactory.createTitledBorder(\"To Do List\"));\n\t\tsetLayout(new BorderLayout());\n\t\tadd(pnlSubject, BorderLayout.NORTH);\n\t\tadd(scroll, BorderLayout.CENTER);\n\t\tadd(pnlButton, BorderLayout.SOUTH);\n\t}", "protected void initialize()\n {\n uiFactory.configureUIComponent(this, UI_PREFIX);\n\n initializeFields();\n initializeLabels();\n initLayout();\n }", "private void init() {\n setLayout(new BorderLayout());\n setBackground(ProgramPresets.COLOR_BACKGROUND);\n add(getTitlePanel(), BorderLayout.NORTH);\n add(getTextPanel(), BorderLayout.CENTER);\n add(getLinkPanel(), BorderLayout.SOUTH);\n }", "public void setupWidgets(){\n // Checkboxes\n CheckBox checkBonus = (CheckBox) getActivity().findViewById(R.id.eCheck_StackYellow);\n CheckBox checkYellowTop = (CheckBox) getActivity().findViewById(R.id.eCheck_StackTop);\n CheckBox checkYellowBottom = (CheckBox) getActivity().findViewById(R.id.eCheck_StackBottom);\n CheckBox checkHP = (CheckBox) getActivity().findViewById(R.id.eCheck_AbleCollect);\n CheckBox checkStacker = (CheckBox) getActivity().findViewById(R.id.eCheck_Stacker);\n CheckBox checkHerder = (CheckBox) getActivity().findViewById(R.id.eCheck_Herder);\n CheckBox checkBinSpecialist = (CheckBox) getActivity().findViewById(R.id.eCheck_BinSpecialist);\n CheckBox checkNoodleSpecialist = (CheckBox) getActivity().findViewById(R.id.eCheck_NoodleSpecialist);\n CheckBox checkInbound = (CheckBox) getActivity().findViewById(R.id.eCheck_Inbound);\n CheckBox checkOther = (CheckBox) getActivity().findViewById(R.id.eCheck_Other);\n }", "private void initComponents() {\n // Create the RGB and the HSB radio buttons.\n createRgbHsbButtons();\n\n \n \n ColorData initial = new ColorData(new RGB(255, 255, 255), 255);\n\n // Create the upper color wheel for the display.\n upperColorWheel = new ColorWheelComp(shell, this, upperWheelTitle);\n // upperColorWheel.setColor(colorArray.get(0));\n upperColorWheel.setColor(initial);\n\n // Create the color bar object that is displayed\n // in the middle of the dialog.\n colorBar = new ColorBarViewer(shell, this, sliderText, cmapParams);\n\n // Create the lower color wheel for the display.\n lowerColorWheel = new ColorWheelComp(shell, this, lowerWheelTitle);\n // lowerColorWheel.setColor(colorArray.get(colorArray.size() - 1));\n lowerColorWheel.setColor(initial);\n\n // Create the bottom control buttons.\n createBottomButtons();\n }", "public void initComponents() {\n\t\taddButton = new JButton(addFlightText);\n\t\tdelayButton = new JButton(delayFlightText);\n\t\tquitButton = new JButton(quitText);\n\t\t// TODO: Add button instanciations for other operations\n\n\t\t// Initialize display area\n\t\tdisplayArea = new JTextArea(LINE_COUNT, LINE_SIZE);\n\t\tdisplayArea.setEditable(false);\n\t\tscrollPane = new JScrollPane(displayArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,\n\t\t\t\tJScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);\n\t}", "private void init() {\n setText(\"Case Name\");\n createFieldsComp();\n GuiUtil.addSeparator(shell, SWT.HORIZONTAL);\n createBottomActionButtons();\n }", "private void initUI() {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\trenderer = new LWJGLRenderer();\n\t\t\tgui = new GUI(stateWidget, renderer);\n\t\t\tthemeManager = ThemeManager.createThemeManager(StateWidget.class.getResource(\"gameui.xml\"), renderer);\n\t\t\tgui.applyTheme(themeManager);\n\t\t\t\n\t\t} catch (LWJGLException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public void init() // set up GUI\n {\n setLayout(new FlowLayout());\n\n customerView = new CustomerView(); // initialize customerView\n \n add(customerView); // add customerView to the GUI\n }", "public abstract void initUiAndListener();", "@Override\n public void init() {\n super.init();\n\n setTheme(\"xtreemfs\");\n\n initLayout();\n initTable();\n initFileDetails();\n initButtons();\n initFilteringControls();\n initUploadState();\n }", "private void initComponents() {\n LOOGER.info(\"Get init components\");\n this.loadButton = new JButton(\"Load\");\n this.fillButton = new JButton(\"Fill\");\n this.deleteButton = new JButton(\"Delete\");\n this.setLayout(new FlowLayout());\n LOOGER.info(\"components exit\");\n }", "public WidgetManager()\n {\n fEditingMode = null;\n fPickingEngine = null;\n fPickingRenderer = null;\n fPickingRenderingEngine = null;\n fRenderer = new WidgetJOGLRenderer(new SimpleJOGLRenderer());\n fRenderingEngine = null;\n fScene = null;\n fWidgets = new HashMap<EditingMode, Widget>();\n fWidgetScene = null;\n }", "protected void initControls() {\n\t\tbind(true);\n\t}", "private void initUI() {\r\n\t\t//Äußeres Panel\r\n\t\tContainer pane = getContentPane();\r\n\t\tGroupLayout gl = new GroupLayout(pane);\r\n\t\tpane.setLayout(gl);\r\n\t\t//Abstende von den Containern und dem äußeren Rand\r\n\t\tgl.setAutoCreateContainerGaps(true);\r\n\t\tgl.setAutoCreateGaps(true);\r\n\t\t//TextFeld für die Ausgabe\r\n\t\tJTextField output = view.getTextField();\r\n\t\t//Die jeweiligen Panels für die jeweiigen Buttons\r\n\t\tJPanel brackets = view.getBracketPanel();\r\n\t\tJPanel remove = view.getTop2Panel();\r\n\t\tJPanel numbers = view.getNumbersPanel();\r\n\t\tJPanel last = view.getBottomPanel();\r\n\t\t//Anordnung der jeweiligen Panels durch den Layout Manager\r\n\t\tgl.setHorizontalGroup(gl.createParallelGroup().addComponent(output).addComponent(brackets).addComponent(remove).addComponent(numbers).addComponent(last));\r\n\t\tgl.setVerticalGroup(gl.createSequentialGroup().addComponent(output).addComponent(brackets).addComponent(remove).addComponent(numbers).addComponent(last));\r\n\t\tpack();\r\n\t\tsetTitle(\"Basic - Taschenrechner\");\r\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\r\n\t\tsetResizable(false);\r\n\t}", "public void init()\r\n\t{\r\n\r\n\t\tsetLayout(new BorderLayout());\r\n\t\t\r\n\t\tb1=new Button(\"Ok\");\r\n\t\tadd(b1,BorderLayout.SOUTH);\r\n\t\t\r\n\t\t//GRID LAYOUT\r\n\r\n\t\t/*setLayout(new GridLayout(1,2));\r\n\t\tb1=new Button(\"Submit\");\r\n\t\tadd(b1);\r\n\t\tb2=new Button(\"Submit\");\r\n\t\tadd(b2);*/\r\n\r\n\t\t//CARD LAYOUT\r\n\r\n\t\t/*setLayout(new CardLayout(100,200));\r\n\t\tt1=new TextField(20);\r\n\t\tadd(b1);*/\r\n\t\r\n\t\t/*t2=new TextField(\"Submit\");\r\n\t\tadd(b2);*/\r\n\t\t//b1.addActionListener(this);\r\n\t\t\t\t\r\n\t\t\r\n\t\r\n\t\t\t\r\n\t\t\r\n\t}", "public void initGui()\n {\n StringTranslate var1 = StringTranslate.getInstance();\n int var2 = this.func_73907_g();\n\n for (int var3 = 0; var3 < this.options.keyBindings.length; ++var3)\n {\n this.controlList.add(new GuiSmallButton(var3, var2 + var3 % 2 * 160, this.height / 6 + 24 * (var3 >> 1), 70, 20, this.options.getOptionDisplayString(var3)));\n }\n\n this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, var1.translateKey(\"gui.done\")));\n this.screenTitle = var1.translateKey(\"controls.minimap.title\");\n }", "public void init() {\n fIconkit = new Iconkit(this);\n\n\t\tsetLayout(new BorderLayout());\n\n fView = createDrawingView();\n\n Panel attributes = createAttributesPanel();\n createAttributeChoices(attributes);\n add(\"North\", attributes);\n\n Panel toolPanel = createToolPalette();\n createTools(toolPanel);\n add(\"West\", toolPanel);\n\n add(\"Center\", fView);\n Panel buttonPalette = createButtonPanel();\n createButtons(buttonPalette);\n add(\"South\", buttonPalette);\n\n initDrawing();\n setBufferedDisplayUpdate();\n setupAttributes();\n }", "@Override\r\n\tprotected void initUI() {\n\r\n\t}", "private void init() {\r\n\r\n createGUI();\r\n\r\n setSize(new Dimension(600, 600));\r\n setTitle(\"Grid - Regular Grid Renderer\");\r\n }", "private void initializePanels()\r\n\t{\r\n\t\tthis.subscribersPanel = new SubscribersPanel(DIMENSIONS);\r\n\t\tthis.consolePanel = new ConsolePanel(DIMENSIONS);\r\n\r\n\t\tthis.parametersPanel = new ParametersPanel(DIMENSIONS);\r\n\t\tthis.parametersPanel.setSize(DIMENSIONS);\r\n\r\n\t\tthis.mainPanel = new MainPanel(parametersPanel, this);\r\n\t\tthis.mainPanel.setSize(DIMENSIONS);\r\n\r\n\t\tshowParametersPanel();\r\n\t}", "private void compInit() throws Exception {\n // Clean up deferred observations from previous UT dates\n DeferredProgramList.cleanup();\n\n // Input Panel Setup\n WidgetPanel inputPanel = new WidgetPanel(\n new Hashtable<String, String>(), widgetBag);\n\n _widgetPanel = inputPanel;\n calibrationMenu = new CalibrationsPanel();\n buildStagingPanel();\n\n // Table setup\n try {\n msbQTM = new MSBQueryTableModel();\n } catch (Exception e) {\n logger.error(\"Unable to create table model\", e);\n e.printStackTrace();\n exitQT();\n }\n\n infoPanel = new InfoPanel(msbQTM, localQuerytool, this);\n\n ProjectTableModel ptm = new ProjectTableModel();\n projectTableSetup(ptm);\n tableSetup();\n\n logger.info(\"Table setup\");\n\n resultsPanel = new JScrollPane(table);\n resultsPanel.getViewport().setScrollMode(JViewport.BLIT_SCROLL_MODE);\n projectPane = new JScrollPane(projectTable);\n projectPane.getViewport().setScrollMode(JViewport.BLIT_SCROLL_MODE);\n\n tablePanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, projectPane,\n resultsPanel);\n tablePanel.setDividerSize(0);\n tablePanel.validate();\n\n tablePanel.setMinimumSize(new Dimension(-1, 100));\n\n topPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, infoPanel,\n tabbedPane);\n topPanel.setMinimumSize(new Dimension(-1, 450));\n topPanel.setDividerSize(0);\n topPanel.validate();\n\n // Build Menu\n buildMenu();\n\n logger.info(\"Menu built\");\n\n setLayout(new BorderLayout());\n add(topPanel, BorderLayout.NORTH);\n add(tablePanel, BorderLayout.CENTER);\n\n // Read the configuration to determine the widgets\n try {\n inputPanel.parseConfig(WIDGET_CONFIG_FILE);\n } catch (IOException e) {\n logger.fatal(\"Widget Panel Parse Failed\", e);\n }\n\n logger.info(\"Widget config parsed\");\n }", "public void initGui()\n {\n StringTranslate var2 = StringTranslate.getInstance();\n int var4 = this.height / 4 + 48;\n\n this.controlList.add(new GuiButton(1, this.width / 2 - 100, var4 + 24 * 1, \"Offline Mode\"));\n this.controlList.add(new GuiButton(2, this.width / 2 - 100, var4, \"Online Mode\"));\n\n this.controlList.add(new GuiButton(3, this.width / 2 - 100, var4 + 48, var2.translateKey(\"menu.mods\")));\n\t\tthis.controlList.add(new GuiButton(0, this.width / 2 - 100, var4 + 72 + 12, 98, 20, var2.translateKey(\"menu.options\")));\n\t\tthis.controlList.add(new GuiButton(4, this.width / 2 + 2, var4 + 72 + 12, 98, 20, var2.translateKey(\"menu.quit\")));\n this.controlList.add(new GuiButtonLanguage(5, this.width / 2 - 124, var4 + 72 + 12));\n }", "public void init() {\n setLayout(new BorderLayout());\n }", "private void initUi() {\n mToolbsr = (Toolbar) findViewById(R.id.toolbar);\n setSupportActionBar(mToolbsr);\n\n fab = (FloatingActionButton) findViewById(R.id.fab);\n mDrawerLayout = (DrawerLayout) findViewById(R.id.drawerLayout);\n mNavigationView = (NavigationView) findViewById(R.id.nav_view);\n\n tabLayout = (TabLayout) findViewById(R.id.tabs);\n viewPager = (ViewPager) findViewById(R.id.viewpager);\n }", "private void initialize()\n {\n this.setPreferredSize(new com.ulcjava.base.application.util.Dimension(549,426));\n this.add(getComboBox(), com.ulcjava.base.application.ULCBorderLayoutPane.NORTH);\n }", "public BBDJPAAdminGUI() {\n initComponents();\n\n myInit();\n }", "private void initUI() {\r\n\t\tthis.verticalLayout = new XdevVerticalLayout();\r\n\t\tthis.verticalLayout2 = new XdevVerticalLayout();\r\n\t\r\n\t\tthis.setSpacing(false);\r\n\t\tthis.setMargin(new MarginInfo(false));\r\n\t\tthis.verticalLayout.setSpacing(false);\r\n\t\tthis.verticalLayout.setMargin(new MarginInfo(false));\r\n\t\tthis.verticalLayout2.setMargin(new MarginInfo(false));\r\n\t\r\n\t\tthis.verticalLayout2.setSizeFull();\r\n\t\tthis.verticalLayout.addComponent(this.verticalLayout2);\r\n\t\tthis.verticalLayout.setComponentAlignment(this.verticalLayout2, Alignment.MIDDLE_CENTER);\r\n\t\tthis.verticalLayout.setExpandRatio(this.verticalLayout2, 20.0F);\r\n\t\tthis.verticalLayout.setSizeFull();\r\n\t\tthis.addComponent(this.verticalLayout);\r\n\t\tthis.setComponentAlignment(this.verticalLayout, Alignment.MIDDLE_CENTER);\r\n\t\tthis.setExpandRatio(this.verticalLayout, 10.0F);\r\n\t\tthis.setSizeFull();\r\n\t\r\n\t\tthis.addContextClickListener(event -> this.this_contextClick(event));\r\n\t}", "private void init() {\n\t\tinitDesign();\n\t\tinitHandlers();\n\t}", "protected void setupUI() {\r\n this.setLayout(new GridLayout((this.needDefaultValue) ? 3 : 2, 2));\r\n\r\n this.nameLabel = new JLabel(this.nameLabelText);\r\n this.add(this.nameLabel);\r\n this.add(this.nameTextField);\r\n\r\n this.typeLabel = new JLabel(this.typeLabelText);\r\n this.add(this.typeLabel);\r\n this.add(this.typeDropDown);\r\n\r\n if (this.needDefaultValue) {\r\n this.defValLabel = new JLabel(this.defValLabelText);\r\n this.add(this.defValLabel);\r\n this.add(this.defValueTextField);\r\n }\r\n }", "private void initialize() {\n\tif (setup == false) {\n\t elementList.add(new GUISlider());\n\t elementList.add(new GUIChart());\n\t elementList.add(new GUIStatsDisplay());\n\t elementList.add(new GUIPID());\n\t elementList.add(new GUITimer());\n\t elementList.add(new GUINumericUpDown());\n\t setup = true;\n\t}\n }", "@Override\n\tpublic void initializeControls() {\n\t\t\n\t}", "private void initialiseUI()\n { \n // The actual data go in this component.\n String defaultRootElement = \"icr:regionSetData\";\n JPanel contentPanel = initialiseContentPanel(defaultRootElement);\n pane = new JScrollPane(contentPanel);\n \n panelLayout = new GroupLayout(this);\n\t\tthis.setLayout(panelLayout);\n\t\tthis.setBackground(DAOConstants.BG_COLOUR);\n\n\t\tpanelLayout.setAutoCreateContainerGaps(true);\n\n panelLayout.setHorizontalGroup(\n\t\t\tpanelLayout.createParallelGroup()\n\t\t\t.addComponent(pane, 10, 520, 540)\n );\n\n panelLayout.setVerticalGroup(\n\t\t\tpanelLayout.createSequentialGroup()\n .addComponent(pane, 10, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)\n );\n }", "private void initializeComponents()\r\n\t{\n\t\tmain = (JPanel) this.getContentPane();\r\n\t\tmain.setLayout(new BorderLayout());\r\n\t\t\r\n\t\tpanelNorth = new JPanel(new FlowLayout());\r\n\t\tpanelSouth = new JPanel(new FlowLayout());\r\n\t\t\r\n\t\tlbKiez = new JLabel(\"Kiez quiz lijst\");\r\n\t\tcbxRapporten = new JComboBox<String>(new String[]{\"OpdrachtenPerCategorie\", \"QuizzenSorteerd\"});\r\n\t\ttxtRapport = new JTextArea();\r\n\t\tchbDatumDecor = new JCheckBox(\"Add datum\");\r\n\t\tchbAuteurDecor = new JCheckBox(\"Add auteur\");\r\n\t\t\r\n\t\tpanelNorth.add(lbKiez);\r\n\t\tpanelNorth.add(cbxRapporten);\r\n\t\t\r\n\t\tpanelSouth.add(chbDatumDecor);\r\n\t\tpanelSouth.add(chbAuteurDecor);\r\n\t\t\r\n\t\tmain.add(panelNorth, BorderLayout.NORTH);\r\n\t\tmain.add(txtRapport, BorderLayout.CENTER);\r\n\t\tmain.add(panelSouth, BorderLayout.SOUTH);\r\n\t}", "private void initialize() {\n this.setLayout(new CardLayout());\n this.setName(this.extension.getMessages().getString(\"spiderajax.options.title\"));\n \t if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {\n \t \tthis.setSize(391, 320);\n \t }\n this.add(getPanelProxy(), getPanelProxy().getName()); \n \t}", "private void initComponents() {\n rootLayout = new Grid();\n rootLayout.setWidth(new Extent(100, Extent.PERCENT));\n rootLayout.setSize(2);\n add(rootLayout);\n Empsn_Label= new nextapp.echo2.app.Label();\n Empsn_Label.setText(\"N_TIME_BEAR.EMPSN\");\n rootLayout.add(Empsn_Label);\n \n Empsn_DscField = new dsc.echo2app.component.DscField();\n Empsn_DscField.setId(\"Empsn_DscField\");\n Empsn_DscField.setWidth(new Extent(4, Extent.CM));\n rootLayout.add(Empsn_DscField);\n \n\t}", "private void initialize() {\r\n\r\n // add default buttons\r\n addButton(getToggleButton(),\"toggle\");\r\n addButton(getFinishButton(),\"finish\");\r\n addButton(getCancelButton(),\"cancel\");\r\n addActionListener(new ActionListener() {\r\n\r\n public void actionPerformed(ActionEvent e) {\r\n String cmd = e.getActionCommand();\r\n if(\"toggle\".equalsIgnoreCase(cmd)) change();\r\n else if(\"finish\".equalsIgnoreCase(cmd)) finish();\r\n else if(\"cancel\".equalsIgnoreCase(cmd)) cancel();\r\n }\r\n\r\n });\r\n\r\n }", "private void initGui() {\n initSeekBar();\n initDateFormatSpinner();\n GuiHelper.defineButtonOnClickListener(view, R.id.settings_buttonSave, this);\n\n }", "private void initViews() {\n\t\tet_area = (EditText) findViewById(R.id.et_area);\r\n\t\tbtn_search = (Button) findViewById(R.id.btn_search);\r\n\t\tll_main = (LinearLayout) findViewById(R.id.ll_main);\r\n\t}", "public void initComponents();", "void initUI();", "protected void addCalendarWidgets() {\n\n calendarMenu = new MenuBar();\n clubName = new Label();\n nameLayout = new EVerticalLayout(clubName);\n clubNamePanel = new Panel(nameLayout);\n\n addCalendarMenuItems();\n\n addComponents(calendarMenu, clubNamePanel, calendar);\n clubNamePanel.setSizeUndefined();\n\n clubName.setStyleName(ValoTheme.LABEL_BOLD);\n setComponentAlignment(clubNamePanel, Alignment.MIDDLE_CENTER);\n setComponentAlignment(calendarMenu, Alignment.MIDDLE_CENTER);\n\n addComponents(calendarMenu, clubNamePanel, calendar);\n // nameLayout.setComponentAlignment(clubName, Alignment.MIDDLE_CENTER);\n clubNamePanel.setSizeUndefined();\n\n clubName.setStyleName(ValoTheme.LABEL_BOLD);\n setComponentAlignment(clubNamePanel, Alignment.MIDDLE_CENTER);\n setComponentAlignment(calendarMenu, Alignment.MIDDLE_CENTER);\n }", "private void setupUI() \n\t{\n\t\t\n\t\tthis.setLayout( new FormLayout() );\n\t\tmyInterfaceContainer = new Composite( this, SWT.NONE );\n\t\tmyInterfaceContainer.setLayoutData( FormDataMaker.makeFullFormData());\n\t\t\n\t\tsetupInterfaceContainer();\n\t}", "private void init() {\n refreshLayout = new TurbolinksSwipeRefreshLayout(getContext(), null);\n addView(refreshLayout, 0);\n }", "public void initialize() {\n Platform.runLater(() -> {\n initializeDisplayText();\n buildComboBoxes();\n countryComboBoxListener();\n setCharLimitOnFields();\n if (action.equals(Constants.UPDATE)) {\n fillExistingCustomer();\n }\n });\n }", "private void initialize() {\n layout = new HorizontalLayout();\n\n workspaceTabs = new TabSheet();\n\n WorkspacePanel panel = new WorkspacePanel(\"Workspace 1\");\n workspaceTabs.addTab(panel).setCaption(\"Workspace 1\");\n DropHandler dropHandler = searchMenu.createDropHandler(panel.getBaseLayout());\n panel.setDropHandler(dropHandler);\n\n layout.addComponent(workspaceTabs);\n\n setContent(layout);\n }", "public void init() {\n \t\tWindow main = new Window(\"Table demo\");\n \t\tsetMainWindow(main);\n \n \t\t// set the application to use Corporate -theme\n \t\tsetTheme(\"corporate\");\n \n \t\t// Add link back to index.html\n \t\tmain.addComponent(menuLink);\n \n \t\t// create demo database\n \t\tsampleDatabase = new SampleDatabase();\n \n \t\t// Main window contains heading, two buttons, table and label\n \t\tmain.addComponent(new Label(\"<h2>Table demo</h2>\" + ACTION_DESCRIPTION,\n \t\t\t\tLabel.CONTENT_XHTML));\n \t\tOrderedLayout layout = new OrderedLayout(\n \t\t\t\tOrderedLayout.ORIENTATION_HORIZONTAL);\n \t\tlayout.addComponent(tableVisibility);\n \t\tlayout.addComponent(tableEnabler);\n \t\tlayout.addComponent(tableCaption);\n \t\tmain.addComponent(layout);\n \t\tmain.addComponent(table);\n \t\tmain.addComponent(tableLastAction);\n \t\tmain.addComponent(embeddedToolkitLink);\n \t\tmain.addComponent(tableDemoLink);\n \n \t\t// initialize demo components\n \t\tinitTable();\n \t}", "@Override\n\tpublic void initGui()\n {\n this.controlList.clear();\n //Keyboard.enableRepeatEvents(true);\n\n int var1 = (this.width - this.bookImageWidth) / 2;\n int var2 = (this.height - this.bookImageHeight - 40) / 2;\n this.controlList.add(this.buttonNextPage = new GuiButtonNextPage(1, var1 + 120, var2 + 154, true));\n this.controlList.add(this.buttonPreviousPage = new GuiButtonNextPage(2, var1 + 38, var2 + 154, false));\n this.controlList.add(this.buttonIndex = new GuiButtonNextPage(8, var1 + 28, var2 + 10, false));\n this.controlList.add(this.buttonMenu1 = new GuiButtonSelect(3, var1 + 35, var2 + 30, 110, 20, \"\"));\n this.controlList.add(this.buttonMenu2 = new GuiButtonSelect(4, var1 + 35, var2 + 55, 110, 20, \"\"));\n this.controlList.add(this.buttonMenu3 = new GuiButtonSelect(5, var1 + 35, var2 + 80, 110, 20, \"\"));\n this.controlList.add(this.buttonMenu4 = new GuiButtonSelect(6, var1 + 35, var2 + 105, 110, 20, \"\"));\n this.controlList.add(this.buttonMenu5 = new GuiButtonSelect(7, var1 + 35, var2 + 130, 110, 20, \"\"));\n this.controlList.add(this.bookmark = new GuiButtonBookmark(9, var1 + 142, var2 + 7, false));\n this.updateButtons();\n }", "public AdminUI() {\n initComponents();\n wdh=new WebDataHandler();\n initList();\n }", "private void initializateGUI() {\n\t\t\n\t\t\n\t\tthis.menuBar = buildMenuBar();\n\t\t\n\t\tthis.toolBar = buildToolBar();\n\t\t\n\t\tthis.container = (JComponent) ContainerViewFactory.getInstance().getContainerView(null);\n\t\t\n\t\tthis.status = buildStatusBar();\n\t\t\n\t\tscrollPane = new JScrollPane();\n\t\tscrollPane.getViewport().add(this.container);\n\t\t\n\t\ttextResources.getString(\"application.title\").ifPresent(super::setTitle);\n\n\t\tif (this.menuBar != null) {\n\t\t\tsuper.setJMenuBar(this.menuBar);\n\t\t}\n\t\tsuper.setPreferredSize(MINIMUM_SIZE);\n\t\tsuper.setMinimumSize(MINIMUM_SIZE);\n\t\tsuper.setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));\n\n\t\tsuper.getRootPane().setPreferredSize(MINIMUM_SIZE);\n\t\tsuper.getRootPane().setMinimumSize(MINIMUM_SIZE);\t\t\n\t\tsuper.getRootPane().setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));\n\t\t\n\t\tsuper.setLayout(new BorderLayout());\n\t\t\n\t\tsuper.add(toolBar, BorderLayout.NORTH);\n\t\tsuper.add(scrollPane, BorderLayout.CENTER);\n\t\tsuper.add(status, BorderLayout.SOUTH);\n\t\t\n\t\tsuper.addWindowListener(new WindowAdapter() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void windowOpened(WindowEvent e) {\n\t\t\t\tinitializationDialog = buildInitializationAction();\n\t\t\t\tinitializationDialog.setVisible(true);\n\t\t\t\tinitializationDialog.toFront();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void windowClosing(WindowEvent e) {\n\t\t\t\tconfirmExitAction();\n\t\t\t}\n\t\t});\n\t\tthis.handlerInitializateGUI();\n\t}", "private void initUI() {\n\t\tfileInputPanel.setLayout(new GridBagLayout());\n\n\t\tGridBagConstraints gridBagConstraints = new GridBagConstraints();\n\t\tgridBagConstraints.insets = new Insets(10, 5, 10, 5);\n\t\tgridBagConstraints.anchor = GridBagConstraints.NORTH;\n\t\tgridBagConstraints.gridwidth = 2;\n\n\t\tJLabel title = new JLabel(\"Welcome to ANNie\");\n\t\ttitle.setFont(new Font(\"Serif\", Font.BOLD, 36));\n\n\t\tfileInputPanel.add(title, gridBagConstraints);\n\n\t\tgridBagConstraints.gridwidth = 1;\n\t\tgridBagConstraints.insets = new Insets(10, 5, 10, 5);\n\n\t\tfileInputPanel.setBorder(BorderFactory.createLineBorder(Color.black));\n\n\t\tcreateFileDropdownArea(gridBagConstraints);\n\t\tcreateLabelSelectArea(gridBagConstraints);\n\t\tcreateButtons(gridBagConstraints);\n\t}", "private void initializePanels() {\n queueInfoPanel.setBackground(new Color(236, 125, 51));\n queueButtonsPanel.setBackground(new Color(93, 118, 161));\n createLabelForPanel(queueInfoPanel);\n createButtonsForPanel(queueButtonsPanel);\n }", "public abstract Widget onInitialize();", "public void init() {\n\t\t//Inits the WEST interactors\n\t\tstatusfield = new JTextField(TEXT_FIELD_SIZE);\n\t\tstatusbutton = new JButton(\"Change Status\");\n\t\tpicturefield = new JTextField(TEXT_FIELD_SIZE);\n\t\tpicturebutton = new JButton(\"Change Picture\");\n\t\tfriendfield = new JTextField(TEXT_FIELD_SIZE);\n\t\tfriendbutton = new JButton(\"Add Friend\");\n\t\t\n\t\tadd(statusfield, WEST);\n\t\tadd(statusbutton, WEST);\n\t\tadd(new JLabel(EMPTY_LABEL_TEXT), WEST);\n\t\tadd(picturefield, WEST);\n\t\tadd(picturebutton, WEST);\n\t\tadd(new JLabel(EMPTY_LABEL_TEXT), WEST);\n\t\tadd(friendfield, WEST);\n\t\tadd(friendbutton, WEST);\n\t\t\n\t\tstatusfield.addActionListener(this);\n\t\tfriendfield.addActionListener(this);\n\t\tpicturefield.addActionListener(this);\n\t\t\n\t\t//Inits the NORTH interactors\n\t\tJLabel namelabel = new JLabel(\"Name\");\n\t\tnamefield = new JTextField(TEXT_FIELD_SIZE);\n\t\tJButton add_button = new JButton(\"Add\");\n\t\tJButton delete_button = new JButton(\"Delete\");\n\t\tJButton lookup_button = new JButton(\"Lookup\");\n\t\t\n\t\tadd(namelabel, NORTH);\n\t\tadd(namefield, NORTH);\n\t\tadd(add_button, NORTH);\n\t\tadd(delete_button, NORTH);\n\t\tadd(lookup_button, NORTH);\n\t\t\n\t\taddActionListeners();\n\t\tcanvas = new FacePamphletCanvas();\n\t\tadd(canvas);\n }", "private void initializeLayout(){\n String title = mStrInfo;\n String subtitle = mClientItem.clientName;\n mHomeToolbar.setGymRatToolbarTitle(title, subtitle);\n\n //initialize maids\n initializeMaid();\n\n //initialize bottom navigation\n initializeBottomNavigation();\n }", "private void initView() {\n\t\timg_back = (ImageView) findViewById(R.id.img_back_updatejob);\n\t\tedt_content = (EditText) findViewById(R.id.edt_content_updatejob);\n\t\tedt_course = (EditText) findViewById(R.id.edt_course_updatejob);\n\t\tbtn_delete = (Button) findViewById(R.id.btn_delete_updatejob);\n\t\tbtn_update = (Button) findViewById(R.id.btn_update_updatejob);\n\t}", "public void initGUI(){\n\t\t\n\t\t//the layout is a new BorderLayout\n\t\tsetLayout(new BorderLayout());\n\t\t\n\t\t//the label will be north\t\n\t\tadd(createHeroList(), BorderLayout.NORTH);\n\t\t\n\t\t//the questions will be displayed center\t\t\n\t\tadd(createQuestions(), BorderLayout.CENTER);\n\t\t//the button panel should be south\n\t\tadd(createAnswerButtonPanel(), BorderLayout.SOUTH);\n\t\t\n\t\t\n\t\t \n\t}", "private void initUIElements() \n\t{\n\t\t// Init UI element collections.\n\t\tbarcharts\t\t= new HashMap<String, BarChart>();\n\t\t//spinners\t\t= new HashMap<String, Spinner<Float>>();\n\t\trangeSliders\t= new HashMap<String, RangeSlider>();\n\t\tvBoxes\t\t\t= new HashMap<String, VBox>();\n\t\t\n\t\t// Remove deprecated UI elements in parameter configuration grid pane.\n\t\tint vboxCount = 0;\n\t\tfor (Object child : parameterConfiguration_gridPane.getChildren().toArray()) {\n\t\t\tNode node = (Node)child;\n\t\t\t\n\t\t\t//System.out.println(node.getClass().getName());\n\t\t\tswitch (node.getClass().getName()) \n\t\t\t{\n\t \t\t// Replace TextFields with numeric steppers / spinners.\n\t \t\tcase \"javafx.scene.control.TextField\":\n\t \t\t\t// Set initial values.\n\t \t\t\tif (node.getId().contains(\"min\"))\n\t \t\t\t\t((TextField)node).setText(\"0\");\n\t \t\t\telse\n\t \t\t\t\t((TextField)node).setText(\"100\");\n\t \t\tbreak;\n\t \t\t\n\t \t\tcase \"javafx.scene.layout.VBox\":\n\t \t\t\tVBox currentVBox = ((VBox)node);\n\t \t\t\t// Look for Sliders in VBox nodes; replace with RangeSliders.\n\t \t\t\tfor (Object vboxChild : currentVBox.getChildren().toArray()) {\n\t \t\t\t\tNode vboxNode = (Node)vboxChild;\n\t \t\t\t\t\n\t \t\t\t\tif (vboxNode.getClass().getName() == \"javafx.scene.control.Slider\") {\n\t \t\t\t\t\tcurrentVBox.getChildren().remove(vboxNode);\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\t// Store references to VBoxes.\n\t \t\t\tswitch(vboxCount++)\n\t \t\t\t{\n\t \t\t\t\tcase 0:\n\t \t\t\t\t\tvBoxes.put(\"alpha\", currentVBox);\n\t \t\t\t\tbreak;\n\t \t\t\t\t\n\t \t\t\t\tcase 1:\n\t \t\t\t\t\tvBoxes.put(\"eta\", currentVBox);\n\t \t\t\t\tbreak;\n\t \t\t\t\t\n\t \t\t\t\tcase 2:\n\t \t\t\t\t\tvBoxes.put(\"kappa\", currentVBox);\n\t \t\t\t\tbreak;\n\t \t\t\t}\n\t \t\tbreak;\n\t \t}\n\t }\n\t\t\n\t\t// Init barcharts.\n\t\tinitBarcharts();\n\t\t\n\t\t// Init range sliders.\n\t\tinitRangeSliders();\n\t\t\n\t\t// Init textfields.\n\t\tinitTextFields();\n\t\t\n\t\t// Init combobox.\n\t\tinitComboBoxes();\n\t}", "public void init() {\r\n this.getChildren().clear();\r\n \r\n setAlignment(Pos.TOP_CENTER);\r\n setVgap(10);\r\n setHgap(10);\r\n setPadding(new Insets(25, 25, 25, 25));\r\n \r\n descriptionField.setMaxWidth(250);\r\n \r\n add(titleLabel, 0, 0);\r\n add(titleField, 1, 0);\r\n \r\n add(descLabel, 0, 1);\r\n add(descriptionField, 1, 1);\r\n \r\n add(urlLabel, 0, 2);\r\n add(urlField, 1, 2);\r\n \r\n add(addLabel, 0, 3);\r\n add(addIntensityBox, 1, 3);\r\n \r\n add(moviesLabel, 0, 4);\r\n add(includesMoviesBox, 1, 4);\r\n \r\n add(showsLabel, 0, 5);\r\n add(includesShowsBox, 1, 5);\r\n \r\n add(loginLabel, 0, 6);\r\n add(requiresLoginBox, 1, 6);\r\n \r\n \r\n add(addMovieSiteButton, 1, 7);\r\n \r\n addMovieSiteButton.setOnAction(e -> {\r\n String name = titleField.getText();\r\n String desc = descriptionField.getText();\r\n String url = urlField.getText();\r\n \r\n String addText = addIntensityBox.getText();\r\n \r\n int addIntensity = Integer.parseInt(addText.isEmpty() ? \"0\" : addText );\r\n boolean movies = includesMoviesBox.isSelected();\r\n boolean shows = includesShowsBox.isSelected();\r\n boolean login = requiresLoginBox.isSelected();\r\n \r\n if (name.matches(\"(\\\\p{L}){4,}\") && url.matches(\"www\\\\.[a-z0-9A-Z]{2,}\\\\.[a-z]+\")) {\r\n new MovieSite(name, desc, url, addIntensity, movies, shows, login);\r\n \r\n controller.getMainAppView().onMovieSitesClick(new ActionEvent());\r\n } else {\r\n \r\n controller.alert(\"Chyba\", \"\", \"Vyplňte alespoň název (alespoň 4 znaky a bez mezer) a url stránky (ve tvaru www.[jméno].[doména]!\");\r\n }\r\n \r\n \r\n \r\n \r\n });\r\n }", "private void initUI() {\n mLocalContainer = findViewById(R.id.local_video_view_container);\n mRemoteContainer = findViewById(R.id.remote_video_view_container);\n\n mCallBtn = findViewById(R.id.btn_call);\n mMuteBtn = findViewById(R.id.btn_mute);\n mSwitchCameraBtn = findViewById(R.id.btn_switch_camera);\n }", "public void init()\r\n {\r\n\t\t/* initialize the widget */\r\n\t\tint width = gl.getWidth();\r\n\t\tint height = gl.getHeight();\r\n\r\n\t\t// Initialize the rendering viewport size to OpenGL\r\n\t\tgl.viewport( 0, 0, width, height );\r\n\t\tgl.matrixMode( GL.PROJECTION );\t// Set up the camera mode\r\n\t\tgl.loadIdentity();\t\t\t\t\t// Reset the transformation matrix\r\n\t\tif (width <= height)\r\n\t\t\tgl.ortho (-50.0, 50.0, -50.0*(double)height/(double)width,\r\n\t\t\t\t 50.0*(double)height/(double)width, -1.0, 1.0);\r\n\t\telse\r\n\t\t\tgl.ortho (-50.0*(double)width/(double)height,\r\n\t\t\t 50.0*(double)width/(double)height, -50.0, 50.0, -1.0, 1.0);\r\n\t\tgl.matrixMode( GL.MODELVIEW );\t\t// Reset to model transforms\r\n }", "private void initGUI() {\r\n this.setLayout(new RiverLayout());\r\n\r\n /**\r\n * Add the following selectively\r\n */\r\n titledSearchResultsPanel = new Cab2bTitledPanel(\"Search Results :- \" + \"Total results ( \"\r\n + allElements.size() + \" )\");\r\n GradientPaint gp = new GradientPaint(new Point2D.Double(.05d, 0), new Color(185, 211, 238),\r\n new Point2D.Double(.95d, 0), Color.WHITE);\r\n titledSearchResultsPanel.setTitlePainter(new BasicGradientPainter(gp));\r\n titledSearchResultsPanel.setBorder(new EmptyBorder(0, 0, 0, 0));\r\n titledSearchResultsPanel.setTitleFont(new Font(\"SansSerif\", Font.BOLD, 11));\r\n titledSearchResultsPanel.setTitleForeground(Color.BLACK);\r\n\r\n pagination = initPagination(allElements);\r\n\r\n searchResultsPanel = new Cab2bPanel(new BorderLayout(0, 5));\r\n\r\n Cab2bComboBox serviceURLCombo = new Cab2bComboBox(serviceURLComboContents);\r\n serviceURLCombo.setPreferredSize(new Dimension(250, 20));\r\n serviceURLCombo.addActionListener(new ServiceURLSelectionListener());\r\n Cab2bPanel comboContainer = new Cab2bPanel(new RiverLayout(5, 5));\r\n \r\n JLabel jLabel = new JLabel(\"Results From\");\r\n jLabel.setForeground(new Cab2bHyperlink().getUnclickedColor());\r\n \r\n \r\n comboContainer.add(\"left\", jLabel);\r\n comboContainer.add(\"tab\", serviceURLCombo);\r\n\r\n searchResultsPanel.add(BorderLayout.NORTH, comboContainer);\r\n\r\n searchResultsPanel.add(BorderLayout.CENTER, pagination);\r\n initDataListSummaryPanel();\r\n initDataListButtons();\r\n\r\n Cab2bPanel buttonPanel = new Cab2bPanel(new RiverLayout(8, 0));\r\n buttonPanel.add(addToDataListButton);\r\n buttonPanel.add(m_applyAllButton);\r\n searchResultsPanel.add(BorderLayout.SOUTH, buttonPanel);\r\n\r\n m_addSummaryParentPanel = new Cab2bPanel(new BorderLayout());\r\n m_addSummaryParentPanel.add(searchResultsPanel, BorderLayout.CENTER);\r\n m_addSummaryParentPanel.add(myDataListParentPanel, BorderLayout.EAST);\r\n titledSearchResultsPanel.setContentContainer(m_addSummaryParentPanel);\r\n this.add(\"p vfill hfill\", titledSearchResultsPanel);\r\n }", "public BridgingUI() {\n initComponents();\n initUserActions();\n }", "@Override\r\n public void initializeComponents() {\r\n nameTf = new ITextField(\"name\");\r\n nameTf.addEditedListener(this, \"name\");\r\n\r\n separatorTf = new ITextField(\"Separator\");\r\n separatorTf.addEditedListener(this, \"separator\");\r\n }", "private void initGui(){\n // TODO: add code for GUI initialization for a given auction\n }", "private void initComponents() {\n\t\t\tpreviewLabel = new JLabel();\n\t\t\tpreview2Label = new JLabel();\n\t\t\tdescLabel = new JLabel();\n\n\t\t\t//======== this ========\n\t\t\tsetLayout(new MigLayout(\n\t\t\t\t\"insets 0,hidemode 3\",\n\t\t\t\t// columns\n\t\t\t\t\"[left]\",\n\t\t\t\t// rows\n\t\t\t\t\"[]0\" +\n\t\t\t\t\"[]\"));\n\n\t\t\t//---- previewLabel ----\n\t\t\tpreviewLabel.setText(\"preview\");\n\t\t\tadd(previewLabel, \"cell 0 0\");\n\t\t\tadd(preview2Label, \"cell 0 0\");\n\n\t\t\t//---- descLabel ----\n\t\t\tdescLabel.setText(\"description\");\n\t\t\tdescLabel.putClientProperty(\"FlatLaf.styleClass\", \"small\");\n\t\t\tdescLabel.setEnabled(false);\n\t\t\tadd(descLabel, \"cell 0 1\");\n\t\t\t// JFormDesigner - End of component initialization //GEN-END:initComponents\n\t\t}", "@Override\n\tpublic void init() {\n\t\tsetMainWindow(new Window(\"Module Demo Application\", tabs));\n\t\ttabs.setSizeFull();\n\t}" ]
[ "0.78779227", "0.74776936", "0.74715966", "0.72881913", "0.72501093", "0.7164392", "0.7108229", "0.7105446", "0.70780367", "0.70474845", "0.7021927", "0.69945115", "0.6985899", "0.6985899", "0.6979071", "0.69722474", "0.6951141", "0.6949804", "0.69389576", "0.6925009", "0.69162923", "0.6893023", "0.6867025", "0.68560654", "0.6810244", "0.6806749", "0.68043107", "0.6782683", "0.6764577", "0.67620903", "0.6759991", "0.6759642", "0.67581606", "0.67574525", "0.6757229", "0.6751315", "0.6734158", "0.672081", "0.6713078", "0.6703046", "0.6702402", "0.66902864", "0.668685", "0.66805065", "0.66782737", "0.66780174", "0.666577", "0.6665603", "0.66635627", "0.66379595", "0.66286135", "0.6621218", "0.65964365", "0.6594299", "0.6573972", "0.6570183", "0.65647906", "0.6558122", "0.6547942", "0.6545575", "0.65425146", "0.6540164", "0.65359145", "0.65336734", "0.65303487", "0.65297574", "0.6519548", "0.65139", "0.65032", "0.6501266", "0.6495414", "0.64929414", "0.6491258", "0.64912057", "0.6490035", "0.6482841", "0.648026", "0.6479047", "0.64742935", "0.6472968", "0.6466287", "0.64582306", "0.6457023", "0.6455801", "0.6455053", "0.64501023", "0.6447929", "0.6444136", "0.64395255", "0.643657", "0.6434689", "0.64339817", "0.6428933", "0.6427338", "0.6426579", "0.6416345", "0.6415105", "0.64148", "0.64028203", "0.64014417" ]
0.688462
22
If the physical back button on the device is clicked
@Override public void onBackPressed() { super.onBackPressed(); finish(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean onBackPressed();", "boolean onBackPressed();", "public abstract boolean onBackPressed(boolean isSystemBackKey);", "public abstract boolean onBackPressed();", "public boolean onBackPressed() {\n \treturn m_renderer.onBackPressed();\n }", "void onGoBackButtonClick();", "@Override\n // Detect when the back button is pressed\n public void onBackPressed() {\n\n // Let the system handle the back button\n\n super.onBackPressed();\n\n }", "public void keyBackIsPressed(){}", "@Override\n\tpublic boolean onBackPressed() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean onBackPressed() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean onNaviBackClick() {\n\t\treturn false;\n\t}", "public void onBackPressed() {\n backbutton();\n }", "@Override\r\n\tpublic void backButton() {\n\t\t\r\n\t}", "@Override\n\t\tpublic boolean handleBackPressed() {\n\t\t\treturn false;\n\t\t}", "@Override\n\tpublic void onBackPressed() {\n\t\texitApplication().onClick(null);\n\t\tsuper.onBackPressed();\n\t}", "public void back()\n\t{\n\t\tdriver.findElementById(OR.getProperty(\"BackButton\")).click();\n\t}", "@Override\r\n\tpublic boolean onKeyDown(int keyCode, KeyEvent event) {\r\n\t\t//handle click on back button\r\n\t if (keyCode == KeyEvent.KEYCODE_BACK) {\r\n\t \t//return to previous screen\r\n\t \treturnToPriviousActivityWithoutDevice();\r\n\t }\r\n\t return super.onKeyDown(keyCode, event);\r\n\t}", "@Override\n public void backButton() {\n\n\n }", "@Override\n\tpublic void onBackPressed()\n\t\t{\n\t\tbackPressed();\n\t\t}", "@Override\n public void onBackPressed() {\n if(web.canGoBack()){\n web.goBack();\n } else {\n super.onBackPressed();\n }\n }", "@Override\n\tpublic void backButton() {\n\n\t}", "@Override\r\n\tpublic void onBackPressed() {\n\t\tbackButtonHandler();\r\n\t\treturn;\r\n\t}", "@Override\n public boolean onKeyDown(int keyCode, KeyEvent event) {\n // TODO Auto-generated method stub\n if((keyCode == KeyEvent.KEYCODE_BACK) && web5.canGoBack())\n {\n web5.goBack();\n return true;\n }\n return super.onKeyDown(keyCode, event);\n }", "@Override\n public boolean onKeyDown(int keyCode,KeyEvent event){\n if (keyCode == KeyEvent.KEYCODE_BACK) {\n return true;\n }\n return false;\n }", "public void onBackPressed() {\r\n }", "@Override\n public boolean onKeyDown(int keyCode, KeyEvent event) {\n if(keyCode==KeyEvent.KEYCODE_BACK){\n return back();\n }\n return super.onKeyDown(keyCode, event);\n }", "@Override\n\tpublic void onBackPressed() {\n\t\t\n\t}", "@Override\n\tpublic void onBackPressed() {\n\t\tBack();\n\t}", "private void checkForBack() {\n if (Gdx.input.isKeyJustPressed(Input.Keys.BACK) || Gdx.input.isKeyJustPressed(Input.Keys.ESCAPE) ||\n BackButton.isPressed()) {\n Gdx.input.vibrate(50);\n dispose();\n game.setScreen(new MainMenuView(game));\n }\n }", "@Override\n public void onBackPressed(){\n System.out.println(\"---------------- No debe hacer nada -------------------------------\");\n }", "public void goBack() {\n goBackBtn();\n }", "@Override\n public void onBackPressed() {}", "@Override\n\tpublic void onBackPressed() {\n\n\t\tnavigatetoAppointmentsListingScreen(\"false\");\n\t}", "@Override\r\n public boolean onKeyDown(int keyCode, KeyEvent event) {\r\n if ((keyCode == KeyEvent.KEYCODE_BACK)) {\r\n \tfinish();\r\n \t\r\n return true;\r\n }\r\n return super.onKeyDown(keyCode, event);\r\n }", "@Override\r\n\tpublic void onBackPressed()\r\n\t{\r\n\t\tif (flipper.getDisplayedChild() != 0)\r\n\t\t{\r\n\t\t\tflipper.showPrevious();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tsuper.onBackPressed();\r\n\t\t}\r\n\t}", "@Override\n public void backPressed(){\n }", "@Override\n public boolean onKeyDown(int keyCode, KeyEvent event) {\n if (keyCode == KeyEvent.KEYCODE_BACK) {\n return false;\n }\n return false;\n }", "@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return false;\n }", "@Override\n public boolean onKeyDown(int keyCode, KeyEvent event) {\n if (keyCode == KeyEvent.KEYCODE_BACK) {\n report(true);\n return true;\n } else\n return super.onKeyDown(keyCode, event);\n }", "@Override\n\tpublic void onBackPressed() {\n\n\t}", "@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return super.onSupportNavigateUp();\n }", "@Override\n\tpublic void onBackPressed() {\n\t}", "@Override\n\tpublic void onBackPressed() {\n\t}", "@Override\n\tpublic void onBackPressed() {\n\t}", "@Override\n\tpublic void onBackPressed() {\n\t}", "@Override\n public void onBackPressed() {\n backToHome();\n }", "@Override\r\n public void onBackPressed() {\n }", "@Override\n\tpublic void onBackPressed()\n\t{\n\t}", "@Override\n \tpublic void onBackPressed() {\n \t}", "@Override\n public void onBackPressed() { }", "@Override\r\n public boolean onKeyDown(int keyCode, KeyEvent event) {\r\n if (keyCode == KeyEvent.KEYCODE_BACK) {\r\n return true;\r\n } else {\r\n return super.onKeyDown(keyCode, event);\r\n }\r\n }", "public void clickBackButton() {\n\t\tbackButton.click();\n\n\t}", "private void backButton() {\n navigate.goPrev(this.getClass(), stage);\n }", "@Override\n public boolean onKeyDown(int keyCode, KeyEvent event) {\n if (keyCode == KeyEvent.KEYCODE_BACK) {\n if (onBack()) return true;\n }\n return super.onKeyDown(keyCode, event);\n }", "@Override\n public void onBackPressed()\n {\n mIsBackButtonPressed = true;\n super.onBackPressed();\n \n }", "@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }", "@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }", "@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }", "@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }", "@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }", "@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }", "@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }", "@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }", "public boolean onSupportNavigateUp() {\n onBackPressed();\n return true;\n }", "@Override\n public void onBackPressed()\n {\n if(backButtonCount >= 1)\n {\n Intent intent = new Intent(Intent.ACTION_MAIN);\n intent.addCategory(Intent.CATEGORY_HOME);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n }\n else\n {\n Toast.makeText(this, \"Press the back button once again to close the application.\", Toast.LENGTH_SHORT).show();\n backButtonCount++;\n }\n }", "@Override\r\n\tpublic void onBackPressed() {\n\r\n\t}", "@Override\r\n\tpublic void onBackPressed() {\n\r\n\t}", "private void onBack() {\n\t\tIntent startMain = new Intent(Intent.ACTION_MAIN);\r\n\t\tstartMain.addCategory(Intent.CATEGORY_HOME);\r\n\t\tstartMain.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // //FLAG_ACTIVITY_NEW_TASK\r\n\t\tstartActivity(startMain);\r\n\t}", "public void onBackButton() {\n WindowLoader wl = new WindowLoader(backButton);\n wl.load(\"MenuScreen\", getInitData());\n RETURN_AUDIO.play(Double.parseDouble(getInitData().get(\"SFXVol\")));\n }", "@Override\n protected boolean canGoBack() {\n return false;\n }", "@Override\n public boolean onKeyDown(int keyCode, KeyEvent event) {\n if ((keyCode == KeyEvent.KEYCODE_BACK) && wpBrowser.canGoBack()) {\n wpBrowser.goBack();\n return true;\n }\n // If it wasn't the Back key or there's no web page history, bubble up to the default\n // system behavior (probably exit the activity)\n return super.onKeyDown(keyCode, event);\n }", "@Override\n\tpublic boolean onBackPressedListener() {\n\t\treturn false;\n\t}", "public boolean onKeyDown(int keyCode, KeyEvent event) {\n \n if (keyCode == KeyEvent.KEYCODE_BACK)\n {\n \tback_page();\n } \n return super.onKeyDown(keyCode, event);\n }", "@Override\n\tpublic void onBackPressed() {\n\treturn;\n\t}", "public void onBackPressed()\n {\n }", "public void back() {\n Views.goBack();\n }", "@Override\n public boolean onSupportNavigateUp(){\n onBackPressed();\n return true;\n }", "@Override\n public void onBackPressed() {\n }", "@Override\n public void onBackPressed() {\n }", "@Override\n public void onBackPressed() {\n }", "@Override\n public void onBackPressed() {\n }", "@Override\n public void onBackPressed() {\n }", "@Override\n public void onBackPressed() {\n }", "@Override\n public void onBackPressed() {\n }", "@Override\n public void onBackPressed() {\n }", "@Override\n public void onBackPressed() {\n }", "@Override\n public void onBackPressed() {\n }", "@Override\n public void onBackPressed() {\n }", "@Override\n public void onBackPressed() {\n }", "@Override\n public void onBackPressed() {\n }", "@Override\n public void onBackPressed() {\n }", "@Override\n public void onBackPressed() {\n }", "@Override\n public void onBackPressed() {\n }", "void onUpOrBackClick();", "@Override\n public boolean onSupportNavigateUp(){\n onBackPressed();\n return true;\n }", "@Override\r\n\tpublic void onBackPressed(){\r\n\t\tLog.d(TAG, \"Back Button Pushed\");\r\n\t\tIntent goHomeIntent = new Intent(Intent.ACTION_MAIN);\r\n\t\tgoHomeIntent.addCategory(Intent.CATEGORY_HOME);\r\n\t\tgoHomeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n\t\tstartActivity(goHomeIntent);\r\n\t}", "@Override\n public void onBackPressed()\n {\n\n }", "@Override\n\tpublic void onBackPressed() {\n\t\treturn;\n\t}", "@Override\n public boolean onKeyDown(int keyCode, KeyEvent event) {\n if ((keyCode == KeyEvent.KEYCODE_BACK) && view.canGoBack()) {\n view.goBack();\n return true;\n }\n // If it wasn't the Back key or there's no web page history, bubble up to the default\n // system behavior (probably exit the activity)\n return super.onKeyDown(keyCode, event);\n }", "public boolean goBack() {\n if (historyStack.size() > 0) {\n switchToScreen(historyStack.pop(), true, lastTransition != null ? lastTransition : TransitionAnimation.getTransition(TransitionAnimationType.RIGHT_TO_LEFT));\n return true;\n }\n return false;\n }", "@Override\n public void onBackPressed() {\n if (!mTouchAnyWhere) {\n super.onBackPressed();\n return;\n }\n\n goBackDialog();\n }" ]
[ "0.83247775", "0.83247775", "0.8159554", "0.8036157", "0.7942018", "0.7762353", "0.7672141", "0.7638245", "0.75826216", "0.75826216", "0.758181", "0.75771785", "0.7565594", "0.7539933", "0.7503665", "0.74922836", "0.74879956", "0.7439152", "0.7420973", "0.7413047", "0.74114656", "0.7405207", "0.73920876", "0.73855084", "0.7385194", "0.73645175", "0.73634434", "0.73577714", "0.734719", "0.7342719", "0.73352814", "0.73291147", "0.7321984", "0.73128134", "0.7312721", "0.7307791", "0.7297043", "0.72941905", "0.72912306", "0.728335", "0.72832644", "0.72798336", "0.72798336", "0.72798336", "0.72798336", "0.72796077", "0.7276083", "0.7273458", "0.7273068", "0.72585493", "0.7256115", "0.7253028", "0.7251371", "0.7247424", "0.72453076", "0.72420937", "0.72420937", "0.72420937", "0.72420937", "0.72420937", "0.72420937", "0.72420937", "0.72420937", "0.7240528", "0.7233508", "0.7229856", "0.7229856", "0.722702", "0.72269356", "0.72238064", "0.72227204", "0.72133744", "0.72039974", "0.72009593", "0.71963817", "0.7196266", "0.71874744", "0.71847785", "0.71847785", "0.71847785", "0.71847785", "0.71847785", "0.71847785", "0.71847785", "0.71847785", "0.71847785", "0.71847785", "0.71847785", "0.71847785", "0.71847785", "0.71847785", "0.71847785", "0.71847785", "0.71835685", "0.71690464", "0.7164989", "0.7164223", "0.7160102", "0.7155782", "0.715401", "0.714891" ]
0.0
-1
Construct a builder based upon the specified passive oracle.
public Builder(PassiveOracle<I, O> passiveOracle) { super(passiveOracle); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract ODatabaseInternal<?> newDatabase();", "private Builder() {\n super(baconhep.TTau.SCHEMA$);\n }", "public OracleDataSourceFactory()\n {\n super();\n System.out.println(\"Constructed OracleDataSourceFactory\");\n }", "private Builder() {\n super(edu.pa.Rat.SCHEMA$);\n }", "ORGateway createORGateway();", "public DriverForCreateBuilder() {\r\n driverForCreate = new DriverForCreate();\r\n }", "private SingleMatch matchBuilder() {\n\t\treturn new SingleMatch(currentMatchSettings.getSequenceLength(), currentMatchSettings.getAttempts(),\n\t\t\t\tcurrentMatchSettings.getGameViewFactory(), currentMatchSettings.getBreakerFactory(),\n\t\t\t\tcurrentMatchSettings.getMakerFactory());\n\t}", "private Builder() {\n super(gr.grnet.aquarium.message.avro.gen.UserAgreementMsg.SCHEMA$);\n }", "private String createOracleConnString(String[] paramArray)\n\t\t\tthrows AFTException {\n\n\t\tLOGGER.debug(\"User passed Oracle DB type\");\n\n\t\tString connString = null;\n\n\t\tString[] connPropertyNames = new String[] { \"uid\", \"pwd\", \"host\",\n\t\t\t\t\"port\", \"sid\" };\n\n\t\tString paramList = Arrays.asList(paramArray).toString();\n\n\t\t// if user has not provided SID\n\t\tif (!paramList.toLowerCase().contains(\"sid\")) {\n\t\t\terrorMessage = \"Parameter does not include SID. \"\n\t\t\t\t\t+ \"Please refer to wiki FAQ on how to create connection string for Oracle database\";\n\t\t\tLOGGER.error(errorMessage);\n\t\t\tthrow new AFTException(errorMessage);\n\t\t}\n\n\t\t// if user has not provided UID\n\t\tif (!paramList.toLowerCase().contains(\"uid\")) {\n\t\t\terrorMessage = \"Parameter does not include Username. \"\n\t\t\t\t\t+ \"Please refer to wiki FAQ on how to create connection string for Oracle database\";\n\t\t\tLOGGER.error(errorMessage);\n\t\t\tthrow new AFTException(errorMessage);\n\t\t}\n\n\t\t// if user has not provided PWD\n\t\tif (!paramList.toLowerCase().contains(\"pwd\")) {\n\t\t\terrorMessage = \"Parameter does not include Password. \"\n\t\t\t\t\t+ \"Please refer to wiki FAQ on how to create connection string for Oracle database\";\n\t\t\tLOGGER.error(errorMessage);\n\t\t\tthrow new AFTException(errorMessage);\n\t\t}\n\n\t\tMap<String, String> connPropertyValues = new HashMap<String, String>();\n\n\t\tconnPropertyValues = extractPropertyValues(paramArray,\n\t\t\t\tconnPropertyNames);\n\n\t\tconnString = \"jdbc:oracle:thin:@\";\n\n\t\tif (connPropertyValues.containsKey(\"host\")) {\n\t\t\tconnString = connString + connPropertyValues.get(\"host\");\n\t\t}\n\n\t\tif (connPropertyValues.containsKey(\"port\")) {\n\t\t\tconnString = connString + \":\" + connPropertyValues.get(\"port\");\n\t\t}\n\n\t\tif (connPropertyValues.containsKey(\"sid\")) {\n\t\t\tconnString = connString + \":\" + connPropertyValues.get(\"sid\");\n\t\t}\n\n\t\tif (connPropertyValues.containsKey(\"uid\")) {\n\n\t\t\tconnUidPwdProp.put(\"uid\", connPropertyValues.get(\"uid\"));\n\n\t\t\tconnUidPwdProp.put(\"pwd\", connPropertyValues.get(\"pwd\"));\n\t\t}\n\n\t\tconnPropertyValues.clear();\n\n\t\treturn connString;\n\t}", "public PaymentType builder()\n {\n return new PaymentType(this);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "private Builder() {\n super(SCHEMA$);\n }", "public GantBuilder ( ) { }", "private Builder() {\n super(net.explorys.samhat.z12.r837.X837Ins_2305_CR7_HomeHealthCarePlanInformation.SCHEMA$);\n }", "private PatternBuilder() { }", "public static Builder builder(String host, String name, String password) {\n\t\treturn new Builder(host, name, password);\n\t}", "private StrategyChainBuilder() {\n\t}", "public Builder() {}", "public Builder() {}", "public Builder() {}", "public void createCon(){\n\t\ttry {\n\t\t\tClass.forName(\"oracle.jdbc.driver.OracleDriver\");\n\t\t\tcon=DriverManager.getConnection(\"jdbc:oracle:thin:@172.26.132.40:1521:ORCLILP\", \"a63d\", \"a63d\");\n\t\t} catch (ClassNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\n\t\t\te.printStackTrace();\n\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\n\t\t\te.printStackTrace();\n\n\t\t}\n\n\n\t}", "public BDPlan makePlan(BDNameMappings nameMappings) {\n\t\tBDPlan plan = new BDPlan(m_statement, nameMappings);\n\t\tplan.generatePlan();\n\t\t\n\t\treturn plan;\n\t}", "public XULTemplateBuilder getBuilder() //readonly\n\t{\n\t\tif(xulTemplateBuilder == null && getDatabase() != null) {\n\t\t\tRDFService rdfService = null; //TODO get the RDFService\n\t\t\txulTemplateBuilder = new XULTemplateBuilderImpl(rdfService, this);\n\t\t}\n\t\treturn xulTemplateBuilder;\n\t}", "AllocAlternative createAllocAlternative();", "public abstract ManagedChannelBuilder<?> builderForTarget(String str);", "static Builder builder() {\n return new SourceContextImpl.Builder();\n }", "static SchemaBuilder newInstance() {\n return new SchemaBuilderImpl();\n }", "private Builder() {\n super(TransferSerialMessage.SCHEMA$);\n }", "private Triplet(Builder builder) {\n super(builder);\n }", "public DocumentBuilder newDocumentBuilder()\n throws ParserConfigurationException {\n return(new DocumentBuilderImpl(this.isNamespaceAware(),\n this.isValidating()));\n }", "private Builder() {}", "@Contract(\" -> new\")\n public static @NotNull Builder getBuilder()\n {\n return new Builder();\n }", "public abstract CertPathBuilderResult engineBuild(CertPathParameters params)\n throws CertPathBuilderException, InvalidAlgorithmParameterException;", "private Relay nullRelayBuilder() {\n\t\tRelay relay = new Relay();\n\n\t\trelay.setAdvertisedBandwidth(null);\n\t\trelay.setAllegedFamily(null);\n\t\trelay.setASName(null);\n\t\trelay.setASNumber(null);\n\t\trelay.setBandwidthBurst(null);\n\t\trelay.setBandwidthRate(null);\n\t\trelay.setCityName(null);\n\t\trelay.setConsensusWeight(null);\n\t\trelay.setConsensusWeightFraction(null);\n\t\trelay.setContact(null);\n\t\trelay.setCountryCode(null);\n\t\trelay.setCountryName(null);\n\t\trelay.setDirAddress(null);\n\t\trelay.setExitPolicy(null);\n\t\trelay.setExitPolicySummary(null);\n\t\trelay.setExitPolicyV6Summary(null);\n\t\trelay.setFamily(null);\n\t\trelay.setFirstSeen(null);\n\t\trelay.setFlags(null);\n\t\trelay.setHostName(null);\n\t\trelay.setLastChangedAddressOrPort(null);\n\t\trelay.setLastRestarted(null);\n\t\trelay.setLastSeen(null);\n\t\trelay.setLatitude(null);\n\t\trelay.setLongitude(null);\n\t\trelay.setMeasured(null);\n\t\trelay.setMiddleProbability(null);\n\t\trelay.setNickname(null);\n\t\trelay.setObservedBandwidth(null);\n\t\trelay.setOrAddresses(null);\n\t\trelay.setPlatform(null);\n\t\trelay.setRecommendedVersion(null);\n\t\trelay.setRegionName(null);\n\t\trelay.setRunning(null);\n\n\t\treturn relay;\n\t}", "public Connection abrirOracle(){\r\n \r\n \r\n try{\r\n \r\n DriverManager.registerDriver(new oracle.jdbc.OracleDriver()); //usando el JDBC de oracle\r\n con=DriverManager.getConnection(\"jdbc:oracle:thin:@localhost:1521:orcl\",\"system\",\"system\");//consiguiendo una conexion en el localhost\r\n ts=con.createStatement(rs.TYPE_SCROLL_INSENSITIVE,rs.CONCUR_UPDATABLE);\r\n System.out.println(\"La conexion se realizon con exito\");//mensaje de demostraciòn de una conexiòn existosa\r\n \r\n \r\n }catch(Exception e){\r\n System.out.println(\"error de conexion: \"+e.toString());\r\n }\r\n return con;\r\n }", "protected DocumentBuilder getBuilder() {\n /** @todo check for rentrency problems when reusing the parser **/\n if (builder == null) {\n try {\n builder = Parser.getDocumentBuilder(new ParserErrorHandler());\n }\n catch (ParserConfigurationException ex) {\n Logger logger = Logger.getLogger(this.getClass());\n logger.error(ex);\n throw new EJBException(ex);\n }\n }\n return builder;\n }", "public Reservation build() throws BuilderException \n{\n\tif (date == null) {\n\t\tthrow new BuilderException(\"Valid date not found\");\n\t}\n\tif (city == null) {\n\t\tthrow new BuilderException(\"Valid city not found\");\n\t}\n\tif (headcount < MINHEAD) {\n\t\tthrow new BuilderException(\n\t\t\t\"Minimum headcount is \" + MINHEAD); \n\t}\n\tif (dollarsPerHead * headcount < MINTOTAL) {\n\t\tthrow new BuilderException(\n\t\t\t\"Minimum total cost is \" + MINTOTAL); \n\t}\n\treturn new Reservation(\n\t\tdate, \n\t\theadcount, \n\t\tcity, \n\t\tdollarsPerHead, \n\t\thasSite); \n}", "public static CapitalIndexedBondSecurity.Builder builder() {\n return new CapitalIndexedBondSecurity.Builder();\n }", "private static Connection newConnection() throws SQLException {\n\t\tOracleDataSource ods = new OracleDataSource();\n\t\tods.setURL(dburl);\n\t\tConnection conn = ods.getConnection();\n\t\treturn conn;\n\t}", "public OpenKitImpl(AbstractOpenKitBuilder builder) {\n\n logger = builder.getLogger();\n privacyConfiguration = PrivacyConfiguration.from(builder);\n openKitConfiguration = OpenKitConfiguration.from(builder);\n\n timingProvider = new DefaultTimingProvider();\n threadIDProvider = new DefaultThreadIDProvider();\n sessionIDProvider = new DefaultSessionIDProvider();\n\n beaconCache = new BeaconCacheImpl(logger);\n beaconCacheEvictor = new BeaconCacheEvictor(logger, beaconCache, BeaconCacheConfiguration.from(builder), timingProvider);\n\n HTTPClientConfiguration httpClientConfig = HTTPClientConfiguration.from(openKitConfiguration);\n beaconSender = new BeaconSender(logger, httpClientConfig, new DefaultHTTPClientProvider(logger), timingProvider);\n\n logOpenKitInstanceCreation(logger, openKitConfiguration);\n }", "public Builder() {\n\t\t}", "private Builder() {\n super(org.apache.gora.cascading.test.storage.TestRow.SCHEMA$);\n }", "public AbstractGemBuilder createBuilder(String parserType) {\n\t\tParserType type = ParserType.valueOf(parserType.toUpperCase());\n\t\tswitch (type) {\n\t\tcase DOM:\n\t\t\treturn new DomBuilder();\n\t\tcase SAX:\n\t\t\treturn new SaxBuilder();\n\t\tcase STAX:\n\t\t\treturn new StaxBuilder();\n\t\tdefault:\n\t\t\tthrow new EnumConstantNotPresentException(type.getDeclaringClass(), type.name());\n\t\t}\n\t}", "private Builder() {\n super(net.explorys.samhat.z12.r837.X837Pro_2420D_REF_SupervisingProviderSecondaryIdentification.SCHEMA$);\n }", "private Builder() {\n super(sparqles.avro.analytics.EPViewInteroperability.SCHEMA$);\n }", "public static DocumentBuilder getDocumentBuilder()\n\t\t\tthrows ParserConfigurationException {\n\t\tif (db == null) {\n\t\t\tdb = dbFactory.newDocumentBuilder();\n\t\t}\n\n\t\treturn db;\n\t}", "public abstract ManagedChannelBuilder<?> builderForAddress(String str, int i);", "private CreateDatabaseRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private ENFAutomaton build() {\n final Set<State> states = new HashSet<State>(this.states.values());\n final Set<State> acceptStates = new HashSet<State>(this.acceptStates.values());\n\n final Set<Input> alphabet = alphabetBuilder.build();\n\n final ENFAutomatonTransferFunction transferFunction = transferFunctionBuilder.build(this.states);\n\n return new ENFAutomaton(states, acceptStates, alphabet, transferFunction, initial);\n }", "public Leilao builder() {\n\t\treturn this.leilao;\r\n\t}", "private Builder() {\n super(sparqles.avro.discovery.DGETInfo.SCHEMA$);\n }", "private Builder() {\n\t\t}", "public static ProductBuilder builder() {\n return ProductBuilder.of();\n }", "@NonNull\n public static ActiveSessionTriggerBuilder newActiveSessionTriggerBuilder() {\n return new ActiveSessionTriggerBuilder();\n }", "private JavaRuleContext buildTestJavaRuleContext() {\n Map<String, Object> ruleParameters = new HashMap<>();\n ruleParameters.put(JDBCBuildMapRule.ARG_APPLICATION, new Application());\n ruleParameters.put(JDBCBuildMapRule.ARG_SCHEMA, new Schema());\n ruleParameters.put(JDBCBuildMapRule.ARG_STATE, Collections.emptyMap());\n ruleParameters.put(JDBCBuildMapRule.ARG_RESULT_SET, mock(ResultSet.class));\n ruleParameters.put(JDBCBuildMapRule.ARG_CONNECTION, mock(Connection.class));\n return new JavaRuleContext(this.sailPointContext, ruleParameters);\n }", "public static Object builder() {\n\t\treturn null;\r\n\t}", "public Builder() { }", "static Builder builder() {\n return new Builder();\n }", "public AriBuilder builder() {\n if ( builder == null ) {\n throw new IllegalArgumentException(\"This version has no builder. Library error for :\" + this.name());\n } else {\n return builder;\n }\n }", "SourceBuilder createService();", "public static Builder create() {\n\t\treturn new Builder();\n\t}", "public static Builder create() {\n\t\treturn new Builder();\n\t}", "public static Object builder() {\n\t\treturn null;\n\t}", "public abstract ODatabaseInternal<?> openDatabase();", "long createDatabase(long actor, String nameToDisplay, long proteinDBType, long sizeInBytes, boolean bPublic, boolean bReversed, ExperimentCategory category);", "public static Builder builder(){ return new Builder(); }", "private PBPoker(Builder builder) {\n super(builder);\n }", "private Builder() {\n super(com.politrons.avro.AvroPerson.SCHEMA$);\n }", "public static AmqpTransportConfig create() {\n\t\tfinal AmqpTransportConfig res = new AmqpTransportConfig();\n\t\tres.setBuilder(BUILDER);\n\t\treturn res;\n\t}", "@Inject\n public Builder() {\n }", "public google.maps.fleetengine.v1.LicensePlate.Builder getLicensePlateBuilder() {\n \n onChanged();\n return getLicensePlateFieldBuilder().getBuilder();\n }", "Connection createConnection();", "public static Builder<?> builder() {\n return new Builder2();\n }", "public static DBA getDBA() {\n return new DBA(database, databaseUser, databasePassword);\n }", "ActivationExpression createActivationExpression();", "static Builder builder(SourceContext source) {\n return new SourceContextImpl.Builder((SourceContextImpl) source);\n }", "public static DocumentBuilder createDocumentBuilder() {\n\t\treturn createDocumentBuilder(DefaultEntityResolver.getInstance());\n\t}", "public PooledConnection newInstance() {\n return new PooledConnection(pool);\n }", "public static Builder builder ()\n {\n\n return new Builder ();\n\n }", "private Builder() {\n super(Gel_BioInf_Models.VirtualPanel.SCHEMA$);\n }", "public tns2toadListener(tnsnamesParser parser, String user, String oracleHome) \n {\n this.parser = parser;\n\n // Default user to connect as, may be null.\n this.user = user.toUpperCase();\n\n // If connecting as SYS, we need to connect as SYSDBA, otherwise, Normal.\n // Don't be fooled - this doesn't work ...\n // if (this.user == \"SYS\") {...}\n // Effing Java!\n if (this.user.equals(\"SYS\"))\n {\n this.connectAs=\"ConnectAs=SYSDBA\";\n }\n\n this.user = \"User=\" + this.user;\n\n // We might get passed an Oracle Home to use, otherwise, default.\n this.oracleHome = \"OracleHome=\" + oracleHome;\n }", "private void setupDB(){\n try {\n Class.forName(\"oracle.jdbc.driver.OracleDriver\");\n String url = \"jdbc:oracle:thin:@localhost:1521:orcl\";\n String username = \"sys as sysdba\"; //Provide username for your database\n String password = \"oracle\"; //provide password for your database\n\n con = DriverManager.getConnection(url, username, password);\n }\n catch(Exception e){\n System.out.println(e);\n }\n }" ]
[ "0.53396386", "0.52014226", "0.51301074", "0.5125255", "0.50394064", "0.50161636", "0.49924222", "0.49742386", "0.49295086", "0.49208605", "0.49180937", "0.49180937", "0.49180937", "0.49180937", "0.49180937", "0.49180937", "0.49180937", "0.49180937", "0.49180937", "0.49180937", "0.49180937", "0.49180937", "0.49180937", "0.49180937", "0.49180937", "0.49180937", "0.49180937", "0.49180937", "0.49180937", "0.49180937", "0.48729405", "0.48704603", "0.4847169", "0.48428613", "0.48267704", "0.4796481", "0.4796481", "0.4796481", "0.47933087", "0.47834736", "0.47753066", "0.47738883", "0.4765538", "0.4756149", "0.47521895", "0.47458422", "0.47314644", "0.4699769", "0.46993968", "0.46918628", "0.46764967", "0.46716687", "0.4670451", "0.46690905", "0.46676132", "0.46606597", "0.4640582", "0.46324286", "0.46317068", "0.46308023", "0.4627581", "0.4625784", "0.4622193", "0.4619668", "0.46190313", "0.46147063", "0.4606201", "0.46047902", "0.46033785", "0.46024093", "0.45923567", "0.45862645", "0.45652455", "0.45612404", "0.45582253", "0.45563188", "0.45538008", "0.4550388", "0.45443675", "0.45443675", "0.45419878", "0.4541857", "0.4540074", "0.45381615", "0.4535746", "0.45302224", "0.45283148", "0.45269266", "0.45247474", "0.45141378", "0.4511263", "0.45097062", "0.45037258", "0.44991192", "0.44979578", "0.4490928", "0.44871455", "0.44820607", "0.44818965", "0.44812122" ]
0.8257077
0
TODO Autogenerated method stub
@Override public String execute() throws Exception { HttpSession session = ServletActionContext.getRequest().getSession(); String prefix=(String)session.getAttribute("prefix"); MemoryMessage memoryMessage=(MemoryMessage) session.getAttribute("memMessage"); this.chart=new DrawPictureImpl().drawMemBarChart(prefix, memoryMessage); return "success"; }
{ "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
Test constructor argument's with wrong values. max is zero
@Test(expected=IllegalArgumentException.class) public void testConstructor_max0() { new LengthMax(0); fail(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test(expected=NullPointerException.class)\r\n public void testConstructor_nextNull() {\r\n \r\n new LengthMax(max, null);\r\n \r\n fail();\r\n \r\n }", "@Test(expected=IllegalArgumentException.class)\n\tpublic void testZerosException() throws IllegalArgumentException {\n\t int min=3, mid=5, max=10, bigger=Integer.MAX_VALUE, smaller=Integer.MIN_VALUE;\n\t assertEquals( 0, MaxDiTre.max(0, 0, 0) );\n\t}", "@Test\n\tpublic void testConstructor3ParametersNegInput() {\n\t\ttry {\n\t\t\tnew CountDownTimer(-2, 3, 4);\n\t\t}\n\t\tcatch (IllegalArgumentException e) {\n\t\t\tassertTrue(e != null);\n\t\t}\n\n\t\ttry {\n\t\t\tnew CountDownTimer(2, -3, 4);\n\t\t}\n\t\tcatch (IllegalArgumentException e) {\n\t\t\tassertTrue(e != null);\n\t\t}\n\n\t\ttry {\n\t\t\tnew CountDownTimer(2, 3, -4);\n\t\t}\n\t\tcatch (IllegalArgumentException e) {\n\t\t\tassertTrue(e != null);\n\t\t}\n\t}", "@Test (expected = IllegalArgumentException.class)\n\tpublic void testLessThanZero(){\n\t\tDistance d = new Distance(-1, 1);\n\t\t\n\t}", "@Test\n public void whenGivenMoreThanThreeArgument_ShouldReturnMax() {\n FindMaximum max = new FindMaximum(20,30,10,50,60,70,99);\n Object X= max.checkMaximumValue();\n Integer expected=99;\n Assert.assertEquals(expected,X);\n }", "@Test\n public void testConstructorInvalidInputs() {\n try {\n Rectangle r5 = new Rectangle(-7, 4, new Color(255, 0, 0),\n new Position2D(50, 75));\n fail();\n } catch (IllegalArgumentException e) {\n // pass!\n }\n try {\n Rectangle r6 = new Rectangle(7, -4, new Color(255, 0, 0),\n new Position2D(50, 75));\n fail();\n } catch (IllegalArgumentException e) {\n // pass!\n }\n try {\n Rectangle r7 = new Rectangle(7, 4, null, new Position2D(50, 75));\n fail();\n } catch (IllegalArgumentException e) {\n // pass!\n }\n try {\n Rectangle r8 = new Rectangle(7, 4, new Color(255, 0, 0), null);\n fail();\n } catch (IllegalArgumentException e) {\n // pass!\n }\n try {\n Rectangle r9 = new Rectangle(-7, 4, null, null);\n fail();\n } catch (IllegalArgumentException e) {\n // pass!\n }\n }", "@Test\r\n public void anotherConstructorMinMax() throws Exception {\r\n assertEquals(5, (int) sIntRev.first());\r\n assertEquals(1, (int) sIntRev.last());\r\n }", "public void testCtorIllegalArgumentException() {\r\n try {\r\n new FileSystemPersistence(0);\r\n fail(\"if the int argument is not positive, throw IllegalArgumentException\");\r\n } catch (IllegalArgumentException e) {\r\n // good\r\n }\r\n try {\r\n new FileSystemPersistence(-1);\r\n fail(\"if the int argument is not positive, throw IllegalArgumentException\");\r\n } catch (IllegalArgumentException e) {\r\n // good\r\n }\r\n }", "@Test\r\n public void testBadConstructor() {\r\n try {\r\n SnakeSquare instance = new SnakeSquare(33,44);\r\n fail();\r\n } catch (IllegalArgumentException e) { }\r\n }", "@Test\n public void whenSecondIsMax() {\n Max max = new Max();\n int rsl = max.max(0, 3, -1);\n assertThat(rsl, is(3));\n }", "@Test\n public void whenFirstMoreSecondAndSecondMoreThird() {\n Max maximum = new Max();\n int result = maximum.max(3, 2, 1);\n assertThat(result, is(3));\n }", "public LessThanZeroException() {}", "public static boolean testAlphabetListConstructorBadInput() {\r\n try {\r\n AlphabetList list1 = new AlphabetList(-2);\r\n } catch (IllegalArgumentException e) {\r\n if (e.getMessage() != null && e.getMessage()\r\n .contains(\"capacity of this list must be a non-zero a positive integer.\"))\r\n\r\n return true;\r\n }\r\n return false;\r\n }", "@Test\n public void whenThirdIsMax() {\n Max max = new Max();\n int rsl = max.max(0, 1, 2);\n assertThat(rsl, is(2));\n }", "@Test\n\tpublic void whenFirstMoreSecondAndThird() {\n\t\tMax max = new Max();\n\t\tint result = max.max(5, 3, 1);\n\t\tint expected = 5;\n\t\tassertThat(result, is(expected));\n\t}", "@Test\n public void testConstructor3Negative()\n {\n final BinaryEncoder encoder = new BinaryEncoder(-8, 8, 1.0);\n assertThat(encoder.getMin(), is(-8.0));\n assertThat(encoder.getMax(), is(8.0));\n assertThat(encoder.getDelta(), is(1.0));\n assertThat(encoder.getLength(), is(4));\n }", "@Test\n\tpublic void testNegMinNegMaxNegMax(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( -min, MaxDiTre.max(-min, -max, -min) );\n\t}", "public Max()\r\n {\r\n }", "@Test\n\tpublic void testNegMaxNegMinNegMax(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( -min, MaxDiTre.max(-max, -min, -max) );\n\t}", "@Test\n\tpublic void testNegMaxNegMaxNegMin(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( -min, MaxDiTre.max(-max, -max, -min) );\n\t}", "private int validateMaxValue(int maxValue) {\n\t\tif (!(maxValue >= 1)) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"DawsonBallotItem Error - maxValue must be geater or equal to 1. Invalid value = \" + maxValue);\n\t\t}\n\t\treturn maxValue;\n\t}", "@Test\n public void whenFirstIsMax() {\n Max max = new Max();\n int rsl = max.max(3, 2, 1);\n assertThat(rsl, is(3));\n }", "@Test\n\tpublic void testMaximumNumber() {\n\t\tdouble tmpRndVal = 0.0;\n\t\tdouble tmpRndVal2 = 0.0;\n\t\tdouble tmpResult = 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\ttmpResult = Math.max(tmpRndVal, tmpRndVal2);\n\t\t\tassertTrue( (tmpResult == ac.maximumNumber(tmpRndVal, tmpRndVal2))\n\t\t\t\t\t|| (0.0 == ac.maximumNumber(tmpRndVal, tmpRndVal2)) );\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\ttmpResult = Math.max(tmpRndVal, tmpRndVal2);\n\t\t\tassertTrue((tmpResult == ac.maximumNumber(tmpRndVal, tmpRndVal2))\n\t\t\t|| (0.0 == ac.maximumNumber(tmpRndVal, tmpRndVal2)) \n\t\t\t|| (-0.123456789 == ac.maximumNumber(tmpRndVal, tmpRndVal2)));\n\t\t}\n\t\t\n\t\t//testing with zero\n\t\tdouble zero = 0.0;\n\t\tdouble inpResult = 0.0;\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tinpResult = Math.max(zero, zero);\n\t\t\t//System.out.println(inpResult + \" ############\");\n\t\t\tassertTrue( (inpResult == ac.maximumNumber(zero, zero)) );\n\t\t}\n\t\t\n\t}", "@Test (expected = IllegalArgumentException.class)\n\tpublic void testConstructor3ParametersNegSecond() {\n\t\tnew CountDownTimer(2, 3, -4);\n\t}", "@Test\n public void testMinMaxNumber() {\n NumberValue minNumber = factory.getMinNumber();\n NumberValue maxNumber = factory.getMaxNumber();\n MatcherAssert.assertThat(minNumber + \" < \" + maxNumber, minNumber.compareTo(maxNumber), lessThan(0));\n }", "@Test(timeout = 4000)\n public void test000() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n long long0 = (-665L);\n long long1 = 14L;\n Range.Builder range_Builder0 = new Range.Builder(14L);\n Range.Builder range_Builder1 = null;\n try {\n range_Builder1 = new Range.Builder(14L, (-665L));\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // length can not be negative\n //\n verifyException(\"org.jcvi.jillion.core.Range$Builder\", e);\n }\n }", "public void testConstructorA1() {\r\n try {\r\n new BidUpdateHandler(\" \", \"bidId\", \"maxAmount\");\r\n fail(\"IllegalArgumentException is expected\");\r\n } catch (IllegalArgumentException e) {\r\n // ok.\r\n }\r\n }", "@Test\n\tpublic void whenSecondMoreFirstAndThird() {\n\t\tMax max = new Max();\n\t\tint result = max.max(2, 7, 3);\n\t\tint expected = 7;\n\t\tassertThat(result, is(expected));\n\t}", "public void testConstructorA5() {\r\n try {\r\n new BidUpdateHandler(\"auctionId\", null, \"maxAmount\");\r\n fail(\"IllegalArgumentException is expected\");\r\n } catch (IllegalArgumentException e) {\r\n // ok.\r\n }\r\n }", "@Test(expected = IllegalArgumentException.class)\r\n public void constructorExceptionTest(){\n Owner invalid = new Owner(\"First\", \"Last\", \"333\");\r\n }", "@Test\n public void errCase() {\n MaximumSwap s = new MaximumSwap();\n int ans = s.maximumSwap(98368);\n assertEquals(98863, ans);\n }", "@Test (expected = IllegalArgumentException.class)\n\tpublic void testConstructor3ParametersNegMinute() {\n\t\tnew CountDownTimer(2, -3, 4);\n\t}", "public void testConstructorA2() {\r\n try {\r\n new BidUpdateHandler(\"auctionId\", \" \", \"maxAmount\");\r\n fail(\"IllegalArgumentException is expected\");\r\n } catch (IllegalArgumentException e) {\r\n // ok.\r\n }\r\n }", "public void testCtor1Accuracy() {\n ContestEligibilityValidatorException exception = new ContestEligibilityValidatorException();\n assertNotNull(\"Unable to instantiate ContestEligibilityValidatorException.\", exception);\n }", "void testConstructor(Tester t) {\n t.checkConstructorException(\n new IllegalArgumentException(\"The board must be atleast 2 x 1 in size\"), \"LightEmAll\", 0,\n 0);\n t.checkConstructorException(\n new IllegalArgumentException(\"The board must be atleast 2 x 1 in size\"), \"LightEmAll\", 1,\n 0);\n t.checkConstructorException(\n new IllegalArgumentException(\"The board must be atleast 2 x 1 in size\"), \"LightEmAll\", 0,\n 1);\n t.checkConstructorException(\n new IllegalArgumentException(\"The board must be atleast 2 x 1 in size\"), \"LightEmAll\", 1,\n 1);\n t.checkConstructorException(\n new IllegalArgumentException(\"The board must be atleast 2 x 1 in size\"), \"LightEmAll\", -5,\n -10);\n }", "void setMaxValue();", "@Test(expected = IllegalArgumentException.class)\n public void testNegNumFlightConstructor() throws ParseException{\n Flight myFlight = new Flight(-10, \"SEA\", \"JFK\", \"11/20/2020\", 100.00); \n }", "public void testCtor_Failure1() {\r\n try {\r\n new TCAuthToken(-2);\r\n fail(\"IllegalArgumentException is expected.\");\r\n } catch (IllegalArgumentException e) {\r\n //success\r\n }\r\n }", "@Model\n private boolean isValidMaxVelocity(double max){\n \treturn !(max > SPEED_OF_LIGHT || !Helper.isValidDouble(max) || max < 0);\n }", "@Test (expected = IllegalArgumentException.class)\n\tpublic void testConstructor3ParametersNegHour() {\n\t\tnew CountDownTimer(-2, 3, 4);\n\t}", "public void testCreationWithInvalidArguments() throws Exception {\n try {\n new Experiment(null, 1L, Arrays.asList(1L));\n fail(\"Expected exception.\");\n } catch (NullPointerException expectedSoIgnore) {}\n\n try {\n new Experiment(experimentDb, 0L, Arrays.asList(1L));\n fail(\"Expected IllegalArgumentException.\");\n } catch (IllegalArgumentException expectedSoIgnore) {}\n\n try {\n new Experiment(experimentDb, 1L, null);\n fail(\"Expected IllegalArgumentException.\");\n } catch (IllegalArgumentException expectedSoIgnore) {}\n\n try {\n new Experiment(experimentDb, 1L, Collections.<Long>emptyList());\n fail(\"Expected IllegalArgumentException.\");\n } catch (IllegalArgumentException expectedSoIgnore) {}\n }", "@Test\n public void whenFirstLessThanSecond() {\n Max maximum = new Max();\n int result = maximum.max(1, 2);\n assertThat(result, is(2));\n }", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void outConstructorTest1(){\r\n\t\tnew PointGrade(0);\r\n\t}", "@Test\n\tpublic void whenThirdMoreFirstAndSecond() {\n\t\tMax max = new Max();\n\t\tint result = max.max(2, 7, 9);\n\t\tint expected = 9;\n\t\tassertThat(result, is(expected));\n\t}", "@Test\n public void whenFirstEqualsSecond() {\n Max maximum = new Max();\n int result = maximum.max(2, 2);\n assertThat(result, is(2));\n }", "@Test\n\tpublic void threeValuesWhenGetMaximumReturnCorrectValue1() {\n\t\tint actualResult = Maximum.testMaximum(12, 4, 6);\n\t\tAssert.assertEquals(12, actualResult);\n\t}", "@Test (expected = IllegalArgumentException.class)\n\tpublic void testAddDistance3() {\n\t\tDistance d5 = new Distance(Integer.MAX_VALUE, 1);\n\t\tDistance d6 = new Distance(Integer.MIN_VALUE, 1);\n\t\td5.addDistance(d5, d6);\n\t}", "private boolean isValidOption(int choice, int maxChoice)\n {\n return choice > 0 && choice <= maxChoice;\n }", "@Test(timeout = 4000)\n public void test07() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1284));\n FieldWriter fieldWriter0 = null;\n try {\n fieldWriter0 = new FieldWriter(classWriter0, (-1284), \"\", \"\", \"\", classWriter0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // value wheel.asm.ClassWriter@5\n //\n verifyException(\"wheel.asm.ClassWriter\", e);\n }\n }", "@Test\n public void testConstructorNegativeCost() {\n String name = \"A modifier\";\n int cost = -1;\n\n assertThrows( IllegalArgumentException.class, () -> {\n Modifier m = new Modifier(name, cost) {\n @Override\n public int getValue() {\n return 0;\n }\n };\n });\n }", "@Test(timeout = 4000)\n public void test06() throws Throwable {\n long long0 = (-1903L);\n // Undeclared exception!\n try { \n Range.ofLength((-1903L));\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // must be >=0\n //\n verifyException(\"org.jcvi.jillion.core.Range$Builder\", e);\n }\n }", "public void testCtor2() {\r\n try {\r\n new BloomFilter(Integer.MAX_VALUE, new DefaultHashFunctionFamily(10000));\r\n fail(\"The length of bitset is too large.\");\r\n } catch(IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "public void testCtor_Failure() {\r\n try {\r\n new TCAuthToken(0);\r\n fail(\"IllegalArgumentException is expected.\");\r\n } catch (IllegalArgumentException e) {\r\n //success\r\n }\r\n }", "@Test(expected = IllegalArgumentException.class)\n public void testCheckPositiveFailure() {\n Helper.checkPositive(0, \"obj\", \"method\", LogManager.getLog());\n }", "@Test\n public void testMax() {\n System.out.println(\"max\");\n int a = 2;\n int b = 3;\n Tuan4 instance = new Tuan4();\n int expResult = 3;\n int result = instance.max(a, b);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n }", "@Test\n public void testConstructorZeroCost() {\n String name = \"A modifier\";\n int cost = 0;\n\n assertThrows( IllegalArgumentException.class, () -> {\n Modifier m = new Modifier(name, cost) {\n @Override\n public int getValue() {\n return 0;\n }\n };\n });\n }", "@Test\n public void whenFirstGreaterThanSecond() {\n Max maximum = new Max();\n int result = maximum.max(2, 1);\n assertThat(result, is(2));\n }", "@Test\n\tpublic void excepWidthMaxRange()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew Game(\"BoulderDash\", 768, 768);\n\t\t\tfail(\"Schould throw exception when width > 768\");\n\t\t}\n\t\tcatch(final Exception e)\n\t\t{\n\t\t\tfinal String expected = \"width out range\";\n\t\t\tassertEquals(expected, e.getMessage());\n\t\t}\n\t}", "@Test\n public void whenFirstLessSecond() {\n Max maximum = new Max();\n int result = maximum.max(1, 2);\n assertThat(result, is(2));\n }", "public void testConstructorA4() {\r\n try {\r\n new BidUpdateHandler(null, \"bidId\", \"maxAmount\");\r\n fail(\"IllegalArgumentException is expected\");\r\n } catch (IllegalArgumentException e) {\r\n // ok.\r\n }\r\n }", "@Test\n\tpublic void whenSecondMoreFirst() {\n\t\tMax max = new Max();\n\t\tint result = max.max(2, 7);\n\t\tint expected = 7;\n\t\tassertThat(result, is(expected));\n\t}", "public void test_ConstructorI() {\n cw = new CharArrayWriter(90);\n assertEquals(\"Test 1: Incorrect writer created.\", 0, cw.size());\n\n try {\n cw = new CharArrayWriter(-1);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException e) {\n // Expected.\n }\n }", "@Test(expected = IllegalArgumentException.class)\n public void testConstructorNegativeSecondsOne(){\n \tCountDownTimer s = new CountDownTimer(5, 5, -10);\n }", "@Test\n @DisplayName(\"Valid\")\n public void testValidConstructor() {\n assertDoesNotThrow(() -> {\n Settings settings = new Settings();\n assertAll(() -> assertEquals(0, settings.getStreamID()),\n () -> assertEquals(SETTINGS_TYPE, settings.getCode()));\n\n });\n }", "@Test(expected = IllegalArgumentException.class)\n public void testConstructorNegativeMinutesOne(){\n \tCountDownTimer s = new CountDownTimer(5, -5, 5);\n }", "@Test(expected = IllegalArgumentException.class)\n public void testConstructorNegativeHoursOne(){\n \tCountDownTimer s = new CountDownTimer(-5, 5, 20);\n }", "@Test\n\tpublic void excepHeighthMaxRange()\n\t{\n\t\ttry\n\t\t{\n\t\t\tnew Game(\"BoulderDash\", 768, 768);\n\t\t\tfail(\"Schould throw exception when width > 768\");\n\t\t}\n\t\tcatch(final Exception e)\n\t\t{\n\t\t\tfinal String expected = \"width out range\";\n\t\t\tassertEquals(expected, e.getMessage());\n\t\t}\n\t}", "boolean isSetMaximum();", "public void testCtor1() {\r\n try {\r\n new DbBaseFilterFactory(null);\r\n fail(\"IllegalArgumentException expected.\");\r\n } catch (IllegalArgumentException iae) {\r\n //good\r\n }\r\n }", "@Test\n public void testValidHashMax() \n\t{\n\tLaboonCoin l = new LaboonCoin();\n\tboolean result = l.validHash(8,0);\n\tassertEquals(result, true);\n }", "public LengthCheck(int maxLength) {\n this.maxLength = maxLength;\n }", "@Test(expected = IllegalArgumentException.class)\n public void Test03_1() {\n component = new DamageEffectComponent(EffectEnum.DAMAGE_BUFF, 3, -20);\n }", "@Test\n\tpublic void testMaxMaxMax(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( max, MaxDiTre.max(max, max, max) );\n\t}", "@Test\n\tpublic void testSet_Out_Range() {\n\t\t try {\n\t\t\t SET setarray= new SET( new int[]{-1,1002});\n\t\t }\n\t\t catch (Exception e) {\n\t\t\t assertEquals(\"Value out of range\", e.getMessage());\n\t\t }\n\t}", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void outConstructorTest2(){\r\n\t\tnew PointGrade(21);\r\n\t}", "@Test(expected = IllegalArgumentException.class)\n public void Test04() {\n component = new DamageEffectComponent(EffectEnum.DAMAGE_BUFF, -3, 20);\n }", "@Test(timeout = 4000)\n public void test055() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n // Undeclared exception!\n try { \n Range.of(range_CoordinateSystem0, (-2147483648L), (-2147483649L));\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // length can not be negative\n //\n verifyException(\"org.jcvi.jillion.core.Range$Builder\", e);\n }\n }", "public negativeNumberException() {\r\n\t \t \r\n\t }", "@Test\n public void errCase2() {\n MaximumSwap s = new MaximumSwap();\n int ans = s.maximumSwap(1993);\n assertEquals(9913, ans);\n }", "@Test(timeout = 4000)\n public void test31() throws Throwable {\n Discretize discretize0 = new Discretize();\n discretize0.setIgnoreClass(true);\n discretize0.m_NumBins = (-3104);\n discretize0.m_MakeBinary = true;\n try { \n discretize0.setInputFormat((Instances) null);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // Can't ignore class when changing the number of attributes!\n //\n verifyException(\"weka.filters.unsupervised.attribute.Discretize\", e);\n }\n }", "@Test(expected = IllegalArgumentException.class)\n public void factorialOfNegativeNumber() {\n factorialAlgorithm.factorial(-4);\n }", "@Test(timeout = 4000)\n public void test003() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.ZERO_BASED;\n // Undeclared exception!\n try { \n Range.of(range_CoordinateSystem0, 2147483646L, (-9223372036854775808L));\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // Range coordinates 2147483646, -9223372036854775808 are not valid Zero Based coordinates\n //\n verifyException(\"org.jcvi.jillion.core.Range$Builder\", e);\n }\n }", "@Test\n\tpublic void testMaxSmallerBigger(){\n\t int min=3, mid=5, max=10, bigger=Integer.MAX_VALUE, smaller=Integer.MIN_VALUE;\n\t assertEquals( bigger, MaxDiTre.max(max, smaller, bigger) );\n\t}", "@Test\n\tpublic void testMaxMinMax(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( max, MaxDiTre.max(max, min, max) );\n\t}", "@Test(expected = IllegalArgumentException.class)\n public void testCreateIllegalMalayMoney() {\n setFactory(\"MalayMoneyFactory\");\n moneyFactory.createMoney(0.9);\n }", "@Test(timeout = 4000)\n public void test006() throws Throwable {\n // Undeclared exception!\n try { \n Range.of(3253L, 1198L);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // length can not be negative\n //\n verifyException(\"org.jcvi.jillion.core.Range$Builder\", e);\n }\n }", "@Test(expected = IllegalArgumentException.class)\n public void testArgumentsNotHaveAValue() {\n System.out.println(\"Arguments do not have n\");\n assertThat(Arguments.valueOf(\"n\"), is(nullValue()));\n }", "@Test\n\tvoid testConstructor() {\n\t\tassertDoesNotThrow(() -> {UdpCommunicator communicator = this.getCommunicatorImplementation(64324);});\n\t\tassertThrows(IllegalArgumentException.class, () -> {UdpCommunicator communicator = this.getCommunicatorImplementation(-54);});\n\t\tassertThrows(IllegalArgumentException.class, () -> {UdpCommunicator communicator = this.getCommunicatorImplementation(70000);});\n\t}", "void validateValue(long val) {\n\n if ((min != null && val < min) || (max != null && val > max)) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"Value, \");\n sb.append(val);\n sb.append(\", is outside of the allowed range\");\n throw new IllegalArgumentException(sb.toString());\n }\n }", "@Ignore\n @Test\n public void testCheckPrimeBorder_3() {\n assertTrue(checkerNumber.checkPrime(Integer.MAX_VALUE));\n }", "@Test\n\tpublic void testMinMaxMax(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( max, MaxDiTre.max(min, max, max) );\n\t}", "@Test\r\n public void testConstructor() {\r\n System.out.println(\"testConstructor\");\r\n try{\r\n new AddMetaInfoToGameService(2L, 3L, 5000);\r\n new AddMetaInfoToGameService(2L, 3L, 0);\r\n //fail();\r\n }catch(Exception e){\r\n e.getMessage();\r\n }\r\n }", "@Test\n public void labelIsNotOutOfRange() {\n propertyIsNot(\n StringUtil.createJString(MAX_RANGE_255 + 1),\n null,\n CodeI18N.FIELD_SIZE,\n \"label property must not be of size lesser than 0 and larger than \" + MAX_RANGE_255 + \" characters\"\n );\n }", "@Test\n\tpublic void whenFirstMoreSecond() {\n\t\tMax max = new Max();\n\t\tint result = max.max(5, 3);\n\t\tint expected = 5;\n\t\tassertThat(result, is(expected));\n\t}", "@Test(expected = IllegalArgumentException.class)\n public void testConstructorWeekEqualZero() {\n int week = 0;\n PlannedActivity plannedActivity = new PlannedActivity(0,\n new Site(\"factory\", \"area\"), new Typology(\"typology\"), \"descriton\", 0, true, week,\n new Procedure(\"name\", \"smp\"), \"workspaceNotes\");\n }", "@Test\n\tpublic void testBiggerMaxSmaller(){\n\t int min=3, mid=5, max=10, bigger=Integer.MAX_VALUE, smaller=Integer.MIN_VALUE;\n\t assertEquals( bigger, MaxDiTre.max(bigger, max, smaller) );\n\t}", "@Test\n @Order(3)\n void testInvalidClassId() {\n assertNull(noArgsRegistry.getConstructor(0));\n }", "@Test\n\tpublic void testSmallerBiggerMax(){\n\t int min=3, mid=5, max=10, bigger=Integer.MAX_VALUE, smaller=Integer.MIN_VALUE;\n\t assertEquals( bigger, MaxDiTre.max(smaller, bigger, max) );\n\t}", "@Override\r\n public boolean isValidParameterCount(int parameterCount) {\n return parameterCount> 0;\r\n }", "public void testCtorIllegalArgumentException() {\r\n String text = \"A piece of text\";\r\n byte[] bytes = text.getBytes();\r\n InputStream is = new ByteArrayInputStream(bytes);\r\n try {\r\n new InputStreamBytesIterator(is, 0);\r\n fail(\"if the int argument is not positive, throw IllegalArgumentException\");\r\n } catch (IllegalArgumentException e) {\r\n // good\r\n }\r\n\r\n try {\r\n new InputStreamBytesIterator(is, -10);\r\n fail(\"if the int argument is not positive, throw IllegalArgumentException\");\r\n } catch (IllegalArgumentException e) {\r\n // good\r\n }\r\n }" ]
[ "0.69965005", "0.6831237", "0.65116113", "0.64757574", "0.64565253", "0.6424823", "0.6394776", "0.63853693", "0.63596636", "0.6338208", "0.63282955", "0.62706745", "0.62646174", "0.62100697", "0.6192001", "0.619053", "0.6171836", "0.6165343", "0.6158362", "0.6153231", "0.61458397", "0.614447", "0.607933", "0.60537714", "0.60518605", "0.6044215", "0.603685", "0.60334104", "0.60238594", "0.60137856", "0.5970602", "0.5968757", "0.595797", "0.59495693", "0.5946924", "0.5917634", "0.5917298", "0.5916446", "0.5914097", "0.59016687", "0.59005475", "0.58901846", "0.5881504", "0.58805287", "0.58796453", "0.5874258", "0.58719915", "0.5864129", "0.5860319", "0.58578616", "0.58491385", "0.58318055", "0.5819177", "0.580805", "0.5806566", "0.5801378", "0.57752323", "0.5774281", "0.57733214", "0.5771246", "0.577023", "0.5769384", "0.57653683", "0.57469684", "0.5745906", "0.5741989", "0.5738059", "0.5734568", "0.5727849", "0.57227665", "0.5708642", "0.5692855", "0.5691708", "0.5682704", "0.5669582", "0.5661937", "0.56618387", "0.56599474", "0.56559193", "0.5653583", "0.5648679", "0.5641482", "0.56374466", "0.5631858", "0.5629002", "0.5628525", "0.56231207", "0.56165916", "0.5615164", "0.56042075", "0.5599", "0.55983144", "0.5592142", "0.5590822", "0.5584668", "0.55727786", "0.55711126", "0.55676", "0.55648637", "0.5550945" ]
0.7988593
0
Test constructor argument's with wrong values. next is null.
@Test(expected=NullPointerException.class) public void testConstructor_nextNull() { new LengthMax(max, null); fail(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testLinkList()\n {\n // passing head as null to constructor is not allowed\n //\n try\n {\n new LinkList(null);\n fail(\"Passing null for head should throw\");\n }\n catch(IllegalArgumentException e)\n {\n assertTrue(true);\n }\n catch(Exception e)\n {\n fail(\"Unexpected exception.\");\n }\n\n try\n {\n new LinkList(\"foo\", null);\n fail(\"Passing null for tail should throw an IllegalArgumentException\");\n }\n catch(IllegalArgumentException e)\n {\n assertTrue(true);\n }\n catch(Exception e)\n {\n fail(\"Unexpected exception.\");\n }\n }", "public void testConstructorNPE3() {\r\n try {\r\n new SimpleCreditCardValidator(\"test\", null);\r\n fail(\"an NPE is expected\");\r\n }\r\n catch (NullPointerException npe) {\r\n //pass\r\n }\r\n }", "public void testCtor_Failure() {\r\n try {\r\n new TCAuthToken(0);\r\n fail(\"IllegalArgumentException is expected.\");\r\n } catch (IllegalArgumentException e) {\r\n //success\r\n }\r\n }", "@Test(expected = IllegalArgumentException.class)\r\n public void constructorExceptionTest(){\n Owner invalid = new Owner(\"First\", \"Last\", \"333\");\r\n }", "public void testConstructorNPE2() {\r\n try {\r\n new SimpleCreditCardValidator(null, new ValidationLUHN());\r\n fail(\"an NPE is expected\");\r\n }\r\n catch (NullPointerException npe) {\r\n //pass\r\n }\r\n }", "public void testCtor_Failure1() {\r\n try {\r\n new TCAuthToken(-2);\r\n fail(\"IllegalArgumentException is expected.\");\r\n } catch (IllegalArgumentException e) {\r\n //success\r\n }\r\n }", "public void testConstructorNPE1() {\r\n try {\r\n new SimpleCreditCardValidator(null);\r\n fail(\"an NPE is expected\");\r\n }\r\n catch (NullPointerException npe) {\r\n //pass\r\n }\r\n }", "@Test(expected=IllegalArgumentException.class)\n\tpublic void testNullRandomNumberGeneratorThrowsIllegalArgumentException() {\n\t\t//Act\n\t\tnew VisitorIterator(seed, cityMock, null, printerMock, visitorMock);\n\t}", "@Test\n public void testConstructorInvalidInputs() {\n try {\n Rectangle r5 = new Rectangle(-7, 4, new Color(255, 0, 0),\n new Position2D(50, 75));\n fail();\n } catch (IllegalArgumentException e) {\n // pass!\n }\n try {\n Rectangle r6 = new Rectangle(7, -4, new Color(255, 0, 0),\n new Position2D(50, 75));\n fail();\n } catch (IllegalArgumentException e) {\n // pass!\n }\n try {\n Rectangle r7 = new Rectangle(7, 4, null, new Position2D(50, 75));\n fail();\n } catch (IllegalArgumentException e) {\n // pass!\n }\n try {\n Rectangle r8 = new Rectangle(7, 4, new Color(255, 0, 0), null);\n fail();\n } catch (IllegalArgumentException e) {\n // pass!\n }\n try {\n Rectangle r9 = new Rectangle(-7, 4, null, null);\n fail();\n } catch (IllegalArgumentException e) {\n // pass!\n }\n }", "@Test\r\n\tvoid testPolynomConstructor() {\r\n\t\tIterator<Monom>it=polynomEx.iteretor();\r\n\t\tassertFalse(\"Checks that the polynom's arrayList is null:\",it.hasNext());\r\n\t}", "@Test\r\n public void testBadConstructor() {\r\n try {\r\n SnakeSquare instance = new SnakeSquare(33,44);\r\n fail();\r\n } catch (IllegalArgumentException e) { }\r\n }", "public void testConstructorA1() {\r\n try {\r\n new BidUpdateHandler(\" \", \"bidId\", \"maxAmount\");\r\n fail(\"IllegalArgumentException is expected\");\r\n } catch (IllegalArgumentException e) {\r\n // ok.\r\n }\r\n }", "@Test\n @DisplayName(\"Valid\")\n public void testValidConstructor() {\n assertDoesNotThrow(() -> {\n Settings settings = new Settings();\n assertAll(() -> assertEquals(0, settings.getStreamID()),\n () -> assertEquals(SETTINGS_TYPE, settings.getCode()));\n\n });\n }", "public void testConstructorWithInvalidPorts() {\n\t\tint[] invalidPorts = new int[2];\n\t\tinvalidPorts[0] = -1;\n\t\tinvalidPorts[1] = 66000;\n\t\tfor(int i=0; i<invalidPorts.length; i++) {\n\t\t\ttry {\n\t\t\t\tRemoteFileDesc rfd = \n\t\t\t\t\tnew RemoteFileDesc(\"www.limewire.org\", invalidPorts[i], \n\t\t\t\t\t\t\t\t\t 10, \"test\",\n\t\t\t\t\t\t\t\t\t 10, TEST_GUID, 10, false, 3,\n\t\t\t\t\t\t\t\t\t false, null, null, false, false,\"\",\n 0, null, -1);\n\t\t\t\tfail(\"rfd1 should have received an exception for invalid port: \"+\n\t\t\t\t\t rfd.getPort());\n\t\t\t} catch(IllegalArgumentException e) {\n\t\t\t\t// this is expected\n\t\t\t}\n\t\t}\n\t}", "public static boolean testAlphabetListConstructorBadInput() {\r\n try {\r\n AlphabetList list1 = new AlphabetList(-2);\r\n } catch (IllegalArgumentException e) {\r\n if (e.getMessage() != null && e.getMessage()\r\n .contains(\"capacity of this list must be a non-zero a positive integer.\"))\r\n\r\n return true;\r\n }\r\n return false;\r\n }", "public void testConstructorIAE1() {\r\n try {\r\n new SimpleCreditCardValidator(\"\");\r\n fail(\"an IAE is expected\");\r\n }\r\n catch (IllegalArgumentException npe) {\r\n //pass\r\n }\r\n }", "void testConstructor(Tester t) {\n t.checkConstructorException(\n new IllegalArgumentException(\"The board must be atleast 2 x 1 in size\"), \"LightEmAll\", 0,\n 0);\n t.checkConstructorException(\n new IllegalArgumentException(\"The board must be atleast 2 x 1 in size\"), \"LightEmAll\", 1,\n 0);\n t.checkConstructorException(\n new IllegalArgumentException(\"The board must be atleast 2 x 1 in size\"), \"LightEmAll\", 0,\n 1);\n t.checkConstructorException(\n new IllegalArgumentException(\"The board must be atleast 2 x 1 in size\"), \"LightEmAll\", 1,\n 1);\n t.checkConstructorException(\n new IllegalArgumentException(\"The board must be atleast 2 x 1 in size\"), \"LightEmAll\", -5,\n -10);\n }", "public void testConstructorWithValidPorts() {\n\t\tint[] validPorts = new int[2];\n\t\tvalidPorts[0] = 10000;\n\t\tvalidPorts[1] = 6000;\n\t\tfor(int i=0; i<validPorts.length; i++) {\n\t\t\ttry {\n\t\t\t\tRemoteFileDesc rfd = \n\t\t\t\t\tnew RemoteFileDesc(\"www.limewire.org\", validPorts[i], \n\t\t\t\t\t\t\t\t\t 10, \"test\",\n\t\t\t\t\t\t\t\t\t 10, TEST_GUID, 10, false, 3,\n\t\t\t\t\t\t\t\t\t false, null, null, false, false,\"\",\n 0, null, -1);\n\t\t\t} catch(IllegalArgumentException e) {\n\t\t\t\tfail(\"rfd1 should not have received an exception for valid port: \"+\n\t\t\t\t\t validPorts[i], e);\n\t\t\t}\n\t\t}\n\t}", "@Test(expected=IllegalArgumentException.class)\n\tpublic void testNullVisitorThrowsIllegalArgumentException() {\n\t\t//Act\n\t\tnew VisitorIterator(seed, cityMock, randMock, printerMock, null);\n\t}", "public void testCtor1_NullNewWayPoint() {\n try {\n new WayPointEvent(edge, null, offset);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }", "public void testCtor1() {\r\n try {\r\n new DbBaseFilterFactory(null);\r\n fail(\"IllegalArgumentException expected.\");\r\n } catch (IllegalArgumentException iae) {\r\n //good\r\n }\r\n }", "private void validCheck ()\n\t{\n\t\tassert allButLast != null || cachedFlatListOrMore != null;\n\t}", "public void testConstructorA2() {\r\n try {\r\n new BidUpdateHandler(\"auctionId\", \" \", \"maxAmount\");\r\n fail(\"IllegalArgumentException is expected\");\r\n } catch (IllegalArgumentException e) {\r\n // ok.\r\n }\r\n }", "@Test(expected=IllegalArgumentException.class)\n\tpublic void testNullCityThrowsIllegalArgumentException() {\n\t\t//Act\n\t\tnew VisitorIterator(seed, null, randMock, printerMock, visitorMock);\n\t}", "public void testConstructorIAE2() {\r\n try {\r\n new SimpleCreditCardValidator(\"\", new ValidationLUHN());\r\n fail(\"an IAE is expected\");\r\n }\r\n catch (IllegalArgumentException npe) {\r\n //pass\r\n }\r\n }", "public void testCtorIllegalArgumentException() {\r\n String text = \"A piece of text\";\r\n byte[] bytes = text.getBytes();\r\n InputStream is = new ByteArrayInputStream(bytes);\r\n try {\r\n new InputStreamBytesIterator(is, 0);\r\n fail(\"if the int argument is not positive, throw IllegalArgumentException\");\r\n } catch (IllegalArgumentException e) {\r\n // good\r\n }\r\n\r\n try {\r\n new InputStreamBytesIterator(is, -10);\r\n fail(\"if the int argument is not positive, throw IllegalArgumentException\");\r\n } catch (IllegalArgumentException e) {\r\n // good\r\n }\r\n }", "@Test\n\tpublic void testConstructor3ParametersNegInput() {\n\t\ttry {\n\t\t\tnew CountDownTimer(-2, 3, 4);\n\t\t}\n\t\tcatch (IllegalArgumentException e) {\n\t\t\tassertTrue(e != null);\n\t\t}\n\n\t\ttry {\n\t\t\tnew CountDownTimer(2, -3, 4);\n\t\t}\n\t\tcatch (IllegalArgumentException e) {\n\t\t\tassertTrue(e != null);\n\t\t}\n\n\t\ttry {\n\t\t\tnew CountDownTimer(2, 3, -4);\n\t\t}\n\t\tcatch (IllegalArgumentException e) {\n\t\t\tassertTrue(e != null);\n\t\t}\n\t}", "@Test\r\n\tpublic void testTile1AndTile2ArgumentConstructorNullTileException() {\n\t\tboolean ex = false;\r\n\t\t\t\t\r\n\t\ttry {\r\n\t\t\tPlayerMove move = new PlayerMove(null, tile2);\r\n\t\t} catch (PlayerMove.NullTileRuntimeException e) {\r\n\t\t\tex = true;\r\n\t\t}\r\n\t\t\r\n\t\tassertTrue(ex);\r\n\t\t\r\n\t\t// First good, second null\t\t\r\n\t\tex = false;\r\n\t\t\t\t\r\n\t\ttry {\r\n\t\t\tPlayerMove move = new PlayerMove(tile1, null);\r\n\t\t} catch (PlayerMove.NullTileRuntimeException e) {\r\n\t\t\tex = true;\r\n\t\t}\r\n\t\t\r\n\t\tassertTrue(ex);\r\n\t\t\r\n\t\t// Both null\t\t\r\n\t\tex = false;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tPlayerMove move = new PlayerMove(null, null);\r\n\t\t} catch (PlayerMove.NullTileRuntimeException e) {\r\n\t\t\tex = true;\r\n\t\t}\r\n\t\t\r\n\t\tassertTrue(ex);\r\n\t}", "@Test\n public void testConstructor() {\n assertNotEquals(null, up);\n }", "public boolean next () throws Exception;", "public void testConstructorA5() {\r\n try {\r\n new BidUpdateHandler(\"auctionId\", null, \"maxAmount\");\r\n fail(\"IllegalArgumentException is expected\");\r\n } catch (IllegalArgumentException e) {\r\n // ok.\r\n }\r\n }", "public void testConstructorA6() {\r\n try {\r\n new BidUpdateHandler(\"auctionId\", \"bidId\", null);\r\n fail(\"IllegalArgumentException is expected\");\r\n } catch (IllegalArgumentException e) {\r\n // ok.\r\n }\r\n }", "@BeforeAll\n static void constructorTest(){\n assertThrows(NullPointerException.class,()->new FileData((String)null,100));\n //the file cannot be null\n assertThrows(NullPointerException.class,()->new FileData((File)null,100));\n //the block size of file must be positive integer\n assertThrows(IllegalArgumentException.class,()->new FileData(filePath,0));\n assertThrows(IllegalArgumentException.class,()->new FileData(filePath,-1));\n assertThrows(IllegalArgumentException.class,()->new FileData(filePath, -100));\n\n\n }", "@Test(expected=IllegalArgumentException.class)\n\tpublic void testNullPrinterthrowsIllegalArgumentException() {\n\t\t//Act\n\t\tnew VisitorIterator(seed, cityMock, randMock, null, visitorMock);\n\t}", "@Test\n @DisplayName(\"Valid\")\n public void testConstructorStreamID() {\n assertDoesNotThrow(() -> {\n Settings settings = new Settings();\n settings.setStreamID(0);\n assertEquals(0, settings.getStreamID());\n });\n }", "@Test\n public void constructorNullNextNotificationLogId() {\n new NotificationLog(currentNotificationLogId, null, previousNotificationLogId, notifications, true);\n }", "public void testConstructorB1() {\r\n try {\r\n new BidUpdateHandler((Element) null);\r\n fail(\"IllegalArgumentException is expected\");\r\n } catch (IllegalArgumentException e) {\r\n // ok.\r\n }\r\n }", "public void testCtor_NullState() {\n try {\n new AddActionStateAction(null, activityGraph, manager);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }", "public static void initNext() { //ініціалізація лічильника нульовим значенням\n next = 0;\n }", "@Test\n void test_ArgsConstructor() {\n assertThrows(\n IllegalArgumentException.class, () -> new ValidationContextFactoryImpl(null, null));\n assertThrows(\n IllegalArgumentException.class, () -> new ValidationContextFactoryImpl(null, null));\n\n ValidationContext<Bean> ctx =\n new ValidationContextFactoryImpl(propertyNameObtainerFactory, null).buildFor(new Bean());\n\n assertTrue(ctx.isNull(Bean::getString1));\n }", "public void testCtor1_NullOffset() {\n try {\n new WayPointEvent(edge, wayPoint, null);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }", "@Test\n @Order(3)\n void testInvalidClassId() {\n assertNull(noArgsRegistry.getConstructor(0));\n }", "public void testConstructorA3() {\r\n try {\r\n new BidUpdateHandler(\"auctionId\", \"bidId\", \" \");\r\n fail(\"IllegalArgumentException is expected\");\r\n } catch (IllegalArgumentException e) {\r\n // ok.\r\n }\r\n }", "public void testCtor2_NullOffset() {\n try {\n new WayPointEvent(edge, 0, null);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }", "@Test\r\n public void shouldReturnFalseIfNoAnyEvenNumbers() {\r\n it = new EvenIterator(new int[]{1});\r\n assertThat(it.hasNext(), is(false));\r\n }", "public boolean next() throws StandardException;", "@Test\n public void exampleTest1() {\n \ttry {\n \t\tVersion version = new Version(null);\n \t} catch(IllegalArgumentException e) {\n \t\tAssert.assertEquals(errorVersionMustNotBeNull, e.getMessage());\n \t} catch(Exception e) {\n \t\tAssert.fail(\"No exception thrown when null version passed to constructor: \"+e.getClass().getName()+\" \"+e.getMessage());\n \t}\n }", "public void testCtor_NullManager() {\n try {\n new AddActionStateAction(state, activityGraph, null);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }", "@Test(expected=IllegalArgumentException.class)\r\n public void testConstructor_max0() {\r\n \r\n new LengthMax(0);\r\n fail();\r\n \r\n }", "public void testCtorNPE() {\r\n try {\r\n new UploadRequestValidator(null);\r\n fail(\"if the argument is null, throw NullPointerExcetpion\");\r\n } catch (NullPointerException e) {\r\n // good\r\n }\r\n }", "@Test\n\tpublic void testInvalidCtor() {\n\t\tSnacksHot nachos = new SnacksHot(\"Chips\", 3, \"100gr\", \"img/icons/box.png\");\n\t\tList<Snack> getraenkeListe = new ArrayList<Snack>();\n\t\ttry {\n\t\t\tgetraenkeListe.add( new SnacksHot(\"Chips\", 3, \"100gr\", \"img/icons/box.png\"));\n\t\t} catch (Exception e) {\n\t\t\t// hier erwarten wir tatsächlich, das uns die exception um die ohren fliegt\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\tassertEquals(\"No object should be created for invalid IBAN\", null, getraenkeListe);\n\t}", "public void testConstructorA4() {\r\n try {\r\n new BidUpdateHandler(null, \"bidId\", \"maxAmount\");\r\n fail(\"IllegalArgumentException is expected\");\r\n } catch (IllegalArgumentException e) {\r\n // ok.\r\n }\r\n }", "@Test\n @DisplayName(\"Valid\")\n public void testConstructorStreamID() {\n assertDoesNotThrow(() -> {\n Settings settings = new Settings();\n assertEquals(0, settings.getStreamID());\n });\n }", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void outConstructorTest1(){\r\n\t\tnew PointGrade(0);\r\n\t}", "public void testTokenTypeStringStringLengthConstructor(){\r\n //Testing throwing of exception for violation of precondition\r\n // type != null\r\n try{\r\n token = new Token(null, \"\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n //Testing throwing of exception for violation of precondition\r\n // type != EOF => value != null\r\n try{\r\n token = new Token(TokenType.STRING, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.SCHEMES, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.FACTS, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.RULES, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.QUERIES, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.COLON_DASH, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.COLON, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.COMMA, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.PERIOD, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.LEFT_PAREN, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.RIGHT_PAREN, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.Q_MARK, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n\r\n //Testing throwing of exception for violation of precondition\r\n // type != EOF and type != STRING => |value| > 0\r\n\r\n try{\r\n token = new Token(TokenType.SCHEMES, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.FACTS, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.RULES, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.QUERIES, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.COLON_DASH, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.COLON, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.COMMA, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.PERIOD, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.LEFT_PAREN, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.RIGHT_PAREN, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.Q_MARK, null, 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n //Testing throwing of exception for violation of precondition\r\n // type == SCHEMES => value == \"Schemes\" -- ignoring case\r\n try{\r\n token = new Token(TokenType.SCHEMES, \"scheme\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n //Testing throwing of exception for violation of precondition\r\n // type == FACTS => value == \"Facts\" -- ignoring case\r\n try{\r\n token = new Token(TokenType.FACTS, \"Fact\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n //Testing throwing of exception for violation of precondition\r\n // type == RULES => value == \"Rules\" -- ignoring case\r\n try{\r\n token = new Token(TokenType.RULES, \"Rule\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n //Testing throwing of exception for violation of precondition\r\n // type == QUERIES => value == \"Queries\" -- ignoring case\r\n try{\r\n token = new Token(TokenType.QUERIES, \"Query\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n //Testing throwing of exception for violation of precondition\r\n // type == COLON_DASH => value == \":-\" -- ignoring case\r\n try{\r\n token = new Token(TokenType.COLON_DASH, \":\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.COLON_DASH, \"-\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.COLON_DASH, \"::-\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n //Testing throwing of exception for violation of precondition\r\n // type == COLON => value == \":\" -- ignoring case\r\n try{\r\n token = new Token(TokenType.COLON, \"a\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.COLON, \"::\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n //Testing throwing of exception for violation of precondition\r\n // type == COMMA => value == \",\" -- ignoring case\r\n try{\r\n token = new Token(TokenType.COMMA, \";\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n //Testing throwing of exception for violation of precondition\r\n // type == PERIOD => value == \".\" -- ignoring case\r\n try{\r\n token = new Token(TokenType.PERIOD, \",\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n //Testing throwing of exception for violation of precondition\r\n // type == LEFT_PAREN => value == \"(\" -- ignoring case\r\n try{\r\n token = new Token(TokenType.LEFT_PAREN, \")\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.LEFT_PAREN, \"[\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.LEFT_PAREN, \"{\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.LEFT_PAREN, \"9\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n //Testing throwing of exception for violation of precondition\r\n // type == RIGHT_PAREN => value == \")\" -- ignoring case\r\n try{\r\n token = new Token(TokenType.RIGHT_PAREN, \"(\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.RIGHT_PAREN, \"]\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.RIGHT_PAREN, \"}\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.RIGHT_PAREN, \"0\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n //Testing throwing of exception for violation of precondition\r\n // type == Q_MARK => value == \"?\" -- ignoring case\r\n try{\r\n token = new Token(TokenType.Q_MARK, \"!\", 1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n //Testing throwing of exception for violation of precondition\r\n // lineNunmber >= 1\r\n try{\r\n token = new Token(TokenType.Q_MARK, \"?\", 0);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.Q_MARK, \"?\", -1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n //Testing throwing of exception for violation of precondition\r\n // type = ID => the length is > 0, the first character must be a\r\n // letter and all of the rest must be letters or digits.\r\n try{\r\n token = new Token(TokenType.ID, \"\", -1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.ID, \"1\", -1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.ID, \"a?\", -1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n try{\r\n token = new Token(TokenType.ID, \"a1b2.\", -1);\r\n assertTrue(false);\r\n }catch(ParserException e){\r\n assertTrue(true);\r\n };\r\n\r\n\r\n try{ //all of the follow can but should not throw exceptions.\r\n //Thus we wrap them in a try block, but, shoud never use it.\r\n\r\n //Testing EOF constructor\r\n token = new Token(TokenType.EOF, null, 2);\r\n assertTrue(token.getTokenType() == TokenType.EOF);\r\n assertTrue(token.getValue().equals(\"\"));\r\n assertTrue(token.getLineNumber() == 2);\r\n\r\n token = new Token(TokenType.EOF, \"cat\", 50);\r\n assertTrue(token.getTokenType() == TokenType.EOF);\r\n assertTrue(token.getValue().equals(\"\"));\r\n assertTrue(token.getLineNumber() == 50);\r\n\r\n //Testing the STRING constructor\r\n token = new Token(TokenType.STRING, \"\", 30);\r\n assertTrue(token.getTokenType() == TokenType.STRING);\r\n assertTrue(token.getValue().equals(\"''\"));\r\n assertTrue(token.getLineNumber() == 30);\r\n\r\n token = new Token(TokenType.STRING, \"'a'\", 30);\r\n assertTrue(token.getTokenType() == TokenType.STRING);\r\n assertTrue(token.getValue().equals(\"''a''\"));\r\n assertTrue(token.getLineNumber() == 30);\r\n\r\n //Testing the ID constructor\r\n token = new Token(TokenType.ID, \"a\", 3);\r\n assertTrue(token.getTokenType() == TokenType.ID);\r\n assertTrue(token.getValue().equals(\"a\"));\r\n assertTrue(token.getLineNumber() == 3);\r\n\r\n token = new Token(TokenType.ID, \"A123456789\", 3);\r\n assertTrue(token.getTokenType() == TokenType.ID);\r\n assertTrue(token.getValue().equals(\"A123456789\"));\r\n assertTrue(token.getLineNumber() == 3);\r\n\r\n token = new Token(TokenType.ID, \"z2\", 3);\r\n assertTrue(token.getTokenType() == TokenType.ID);\r\n assertTrue(token.getValue().equals(\"z2\"));\r\n assertTrue(token.getLineNumber() == 3);\r\n\r\n //Testing SCHEMES constructor\r\n token = new Token(TokenType.SCHEMES, \"schemes\", 1);\r\n assertTrue(token.getTokenType() == TokenType.SCHEMES);\r\n assertTrue(token.getValue().equals(\"schemes\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n token = new Token(TokenType.SCHEMES, \"SCHEMES\", 1);\r\n assertTrue(token.getTokenType() == TokenType.SCHEMES);\r\n assertTrue(token.getValue().equals(\"SCHEMES\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n token = new Token(TokenType.SCHEMES, \"Schemes\", 1);\r\n assertTrue(token.getTokenType() == TokenType.SCHEMES);\r\n assertTrue(token.getValue().equals(\"Schemes\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n //Testing FACTS constructor\r\n token = new Token(TokenType.FACTS, \"facts\", 1);\r\n assertTrue(token.getTokenType() == TokenType.FACTS);\r\n assertTrue(token.getValue().equals(\"facts\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n token = new Token(TokenType.FACTS, \"FACTS\", 1);\r\n assertTrue(token.getTokenType() == TokenType.FACTS);\r\n assertTrue(token.getValue().equals(\"FACTS\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n token = new Token(TokenType.FACTS, \"Facts\", 1);\r\n assertTrue(token.getTokenType() == TokenType.FACTS);\r\n assertTrue(token.getValue().equals(\"Facts\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n //Testing RULES constructor\r\n token = new Token(TokenType.RULES, \"rules\", 1);\r\n assertTrue(token.getTokenType() == TokenType.RULES);\r\n assertTrue(token.getValue().equals(\"rules\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n token = new Token(TokenType.RULES, \"RULES\", 1);\r\n assertTrue(token.getTokenType() == TokenType.RULES);\r\n assertTrue(token.getValue().equals(\"RULES\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n token = new Token(TokenType.RULES, \"RULEs\", 1);\r\n assertTrue(token.getTokenType() == TokenType.RULES);\r\n assertTrue(token.getValue().equals(\"RULEs\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n //Testing QUERIES constructor\r\n token = new Token(TokenType.QUERIES, \"queries\", 1);\r\n assertTrue(token.getTokenType() == TokenType.QUERIES);\r\n assertTrue(token.getValue().equals(\"queries\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n token = new Token(TokenType.QUERIES, \"QUERIES\", 1);\r\n assertTrue(token.getTokenType() == TokenType.QUERIES);\r\n assertTrue(token.getValue().equals(\"QUERIES\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n token = new Token(TokenType.QUERIES, \"Queries\", 1);\r\n assertTrue(token.getTokenType() == TokenType.QUERIES);\r\n assertTrue(token.getValue().equals(\"Queries\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n //Testing COLON_DASH constructor\r\n token = new Token(TokenType.COLON_DASH, \":-\", 1);\r\n assertTrue(token.getTokenType() == TokenType.COLON_DASH);\r\n assertTrue(token.getValue().equals(\":-\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n //Testing COLON constructor\r\n token = new Token(TokenType.COLON, \":\", 1);\r\n assertTrue(token.getTokenType() == TokenType.COLON);\r\n assertTrue(token.getValue().equals(\":\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n //Testing COMMA constructor\r\n token = new Token(TokenType.COMMA, \",\", 1);\r\n assertTrue(token.getTokenType() == TokenType.COMMA);\r\n assertTrue(token.getValue().equals(\",\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n //Testing PERIOD constructor\r\n token = new Token(TokenType.PERIOD, \".\", 1);\r\n assertTrue(token.getTokenType() == TokenType.PERIOD);\r\n assertTrue(token.getValue().equals(\".\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n //Testing LEFT_PAREN constructor\r\n token = new Token(TokenType.LEFT_PAREN, \"(\", 1);\r\n assertTrue(token.getTokenType() == TokenType.LEFT_PAREN);\r\n assertTrue(token.getValue().equals(\"(\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n //Testing RIGHT_PAREN constructor\r\n token = new Token(TokenType.RIGHT_PAREN, \")\", 1);\r\n assertTrue(token.getTokenType() == TokenType.RIGHT_PAREN);\r\n assertTrue(token.getValue().equals(\")\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n //Testing Q_MARK constructor\r\n token = new Token(TokenType.Q_MARK, \"?\", 1);\r\n assertTrue(token.getTokenType() == TokenType.Q_MARK);\r\n assertTrue(token.getValue().equals(\"?\"));\r\n assertTrue(token.getLineNumber() == 1);\r\n\r\n }catch(ParserException e){\r\n System.err.println(\"ERROR in TokenTest::\" +\r\n \"testTokenTypeStringStringLengthConstructor(\" +\r\n \"TokenType,String,int)\\n\" +\r\n \"Should NOT be able to get here\");\r\n };\r\n }", "@Test(expected = IllegalArgumentException.class)\r\n\tpublic void outConstructorTest2(){\r\n\t\tnew PointGrade(21);\r\n\t}", "public void testCreationWithInvalidArguments() throws Exception {\n try {\n new Experiment(null, 1L, Arrays.asList(1L));\n fail(\"Expected exception.\");\n } catch (NullPointerException expectedSoIgnore) {}\n\n try {\n new Experiment(experimentDb, 0L, Arrays.asList(1L));\n fail(\"Expected IllegalArgumentException.\");\n } catch (IllegalArgumentException expectedSoIgnore) {}\n\n try {\n new Experiment(experimentDb, 1L, null);\n fail(\"Expected IllegalArgumentException.\");\n } catch (IllegalArgumentException expectedSoIgnore) {}\n\n try {\n new Experiment(experimentDb, 1L, Collections.<Long>emptyList());\n fail(\"Expected IllegalArgumentException.\");\n } catch (IllegalArgumentException expectedSoIgnore) {}\n }", "@Test\n public void test1() throws Throwable {\n\t\tfr.inria.diversify.sosie.logger.LogWriter.writeTestStart(576,\"org.apache.commons.collections4.iterators.NodeListIteratorEvoSuiteTest.test1\");\n NodeListIterator nodeListIterator0 = null;\n try {\n nodeListIterator0 = new NodeListIterator((Node) null);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // node must not be null!\n //\n }\n }", "public void testCtorNullPointerException() {\r\n try {\r\n new InputStreamBytesIterator(null, 22);\r\n fail(\"if inputStream is null, throw NullPointerException\");\r\n } catch (NullPointerException e) {\r\n // good\r\n }\r\n }", "@Test\n public void validate_Constructor() {\n try {\n Service testService = new Service(\"Camera Installation\", 250, \"category_test\");\n assertEquals(\"Service getter Failed - name\", \"Camera Installation\", testService.getName());\n assertEquals(\"Service getter Failed - rate\", 250, testService.getRate());\n assertEquals(\"Service getter Failed - categoryID\", \"category_test\", testService.getCategoryKey());\n } catch (InvalidDataException e) {\n fail(\"Availability construction failed. Error: \" + e.getMessage());\n }\n\n // Make sure InvalidDataException is thrown for invalid data\n try {\n new Service(\"Illegal-service+name\", 45, \"categoryKey\");\n fail(\"Service Constructor Failed - Illegal Name\");\n } catch (InvalidDataException ignore) {}\n try {\n new Service(\"service name\", -45, \"categoryKey\");\n fail(\"Service Constructor Failed - Illegal rate\");\n } catch (InvalidDataException ignore) {}\n try {\n new Service(\"service name\", 45, \"\");\n fail(\"Service Constructor Failed - Illegal category key\");\n } catch (InvalidDataException ignore) {}\n\n }", "public void testCtorIllegalArgumentException() {\r\n try {\r\n new FileSystemPersistence(0);\r\n fail(\"if the int argument is not positive, throw IllegalArgumentException\");\r\n } catch (IllegalArgumentException e) {\r\n // good\r\n }\r\n try {\r\n new FileSystemPersistence(-1);\r\n fail(\"if the int argument is not positive, throw IllegalArgumentException\");\r\n } catch (IllegalArgumentException e) {\r\n // good\r\n }\r\n }", "public void testCtor_NullActivityGraph() {\n try {\n new AddActionStateAction(state, null, manager);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }", "private int checkConstructor(ASTVariableDeclaratorId node, Object data) {\n Node parent = node.getParent();\n if (parent.getNumChildren() >= 2) {\n ASTAllocationExpression allocationExpression = parent.getChild(1)\n .getFirstDescendantOfType(ASTAllocationExpression.class);\n ASTArgumentList list = null;\n if (allocationExpression != null) {\n list = allocationExpression.getFirstDescendantOfType(ASTArgumentList.class);\n }\n\n if (list != null) {\n ASTLiteral literal = list.getFirstDescendantOfType(ASTLiteral.class);\n if (!isAdditive(list) && literal != null && literal.isStringLiteral()) {\n return 1;\n }\n return processAdditive(data, 0, list, node);\n }\n }\n return 0;\n }", "@Test\n public final void testConstructorEmpty() {\n Set<String> s = this.constructorTest();\n Set<String> sExpected = this.constructorRef();\n /*\n * Assert that values of variables match expectations\n */\n assertEquals(sExpected, s);\n }", "@Test\n public final void testConstructorNonEmpty() {\n Set<String> s = this.createFromArgsTest(\"a\", \"b\", \"c\");\n Set<String> sExpected = this.createFromArgsRef(\"a\", \"b\", \"c\");\n /*\n * Assert that values of variables match expectations\n */\n assertEquals(sExpected, s);\n }", "@Test\r\n\tpublic void ConstructorTest() {\r\n\t\tMove move = new Move(3, 3);\r\n\t\tCheckersMove checkersMove = new CheckersMove(new Move(2, 2), move);\r\n\t\tassertFalse(!checkersMove.getDest().equals(move));\r\n\t}", "@Test\n public void tr4()\n {\n Graph graph = new Graph(2);\n assertThrows(IllegalArgumentException.class, () -> graph.reachable(null, null));\n }", "@Test\n public void whenTreeIsBlankThanHasNextIsFalse() {\n assertThat(this.tree.iterator().hasNext(), is(false));\n }", "protected Sampler nextIsNull() throws NextIsNullException {\n reInitialize();\n return null;\n }", "public void testCtor_NullComment() {\n try {\n new CutCommentAction(null, null);\n fail(\"IllegalArgumentException is expected!\");\n } catch (IllegalArgumentException e) {\n // expected\n }\n }", "@Test(expected = IllegalArgumentException.class)\r\n public void testCreationFromNullOrigin()\r\n {\r\n final Circle c = new Circle(null, 0);\r\n c.equals(null);\r\n }", "@Test\n public void nextTest() {\n this.it.next();\n this.it.next();\n assertThat(\"work3\", is(this.it.next()));\n }", "public void testCtorStr_Failure1() throws Exception {\n try {\n new RenameConverter(null);\n fail(\"IllegalArgumentException is expected.\");\n } catch (IllegalArgumentException e) {\n //success\n }\n }", "public void testConstructor_String_InvalidReplyCode() {\n try {\n new StaticReplyCommandHandler(-1);\n fail(\"Expected AssertFailedException\");\n }\n catch (AssertFailedException expected) {\n LOG.info(\"Expected: \" + expected);\n }\n }", "@Test(timeout = 4000)\n public void test07() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1284));\n FieldWriter fieldWriter0 = null;\n try {\n fieldWriter0 = new FieldWriter(classWriter0, (-1284), \"\", \"\", \"\", classWriter0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // value wheel.asm.ClassWriter@5\n //\n verifyException(\"wheel.asm.ClassWriter\", e);\n }\n }", "@Test\n\tvoid testConstructor() {\n\t\tassertDoesNotThrow(() -> {UdpCommunicator communicator = this.getCommunicatorImplementation(64324);});\n\t\tassertThrows(IllegalArgumentException.class, () -> {UdpCommunicator communicator = this.getCommunicatorImplementation(-54);});\n\t\tassertThrows(IllegalArgumentException.class, () -> {UdpCommunicator communicator = this.getCommunicatorImplementation(70000);});\n\t}", "@Test\n public void whenAddTwoNodesAndNextTwiceThenHasNextFalse() {\n tree.addChild(nodeOne, \"1\");\n nodeOne.addChild(nodeTwo, \"2\");\n Iterator iter = tree.iterator();\n iter.next();\n iter.next();\n assertThat(iter.hasNext(), is(false));\n }", "public void testCtor1_NullEdge() {\n try {\n new WayPointEvent(null, wayPoint, offset);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }", "@org.junit.Test(timeout = 10000)\n public void testConstructorWithDomain_cf38574_cf40507_failAssert12() {\n // AssertGenerator generate try/catch block with fail statement\n try {\n com.twilio.http.Request request = new com.twilio.http.Request(com.twilio.http.HttpMethod.GET, com.twilio.rest.Domains.IPMESSAGING.toString(), \"/v1/uri\");\n // MethodAssertGenerator build local variable\n Object o_5_0 = request.getMethod();\n // AssertGenerator replace invocation\n java.util.Map<java.lang.String, java.util.List<java.lang.String>> o_testConstructorWithDomain_cf38574__7 = // StatementAdderMethod cloned existing statement\nrequest.getPostParams();\n // AssertGenerator add assertion\n java.util.HashMap map_608565383 = new java.util.HashMap<Object, Object>();\torg.junit.Assert.assertEquals(map_608565383, o_testConstructorWithDomain_cf38574__7);;\n // StatementAdderOnAssert create null value\n java.lang.String vc_8162 = (java.lang.String)null;\n // StatementAdderOnAssert create random local variable\n java.lang.String vc_8161 = new java.lang.String();\n // StatementAdderOnAssert create null value\n com.twilio.http.Request vc_8158 = (com.twilio.http.Request)null;\n // StatementAdderMethod cloned existing statement\n vc_8158.setAuth(vc_8161, vc_8162);\n // MethodAssertGenerator build local variable\n Object o_19_0 = request.getUrl();\n org.junit.Assert.fail(\"testConstructorWithDomain_cf38574_cf40507 should have thrown NullPointerException\");\n } catch (java.lang.NullPointerException eee) {\n }\n }", "public void testCtor_NullPropertiesPanel() {\n try {\n new ConcurrencyPropertyPanel(null);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }", "public void test_ConstructorI() {\n cw = new CharArrayWriter(90);\n assertEquals(\"Test 1: Incorrect writer created.\", 0, cw.size());\n\n try {\n cw = new CharArrayWriter(-1);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException e) {\n // Expected.\n }\n }", "@Test\n public void testIsValid_NullProducesOrNullAccepts() {\n CollectorWithNullProducesOrAndAccepts collector = new CollectorWithNullProducesOrAndAccepts();\n Set errors = validator.validate(collector);\n assertFalse(errors.isEmpty());\n }", "public SequenceNumberTest() {}", "@Test(timeout = 4000)\n public void test16() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(9);\n FieldWriter fieldWriter0 = new FieldWriter(classWriter0, 1596, \"ConstantVlue\", \"xWJwacYp%f=Qk\", \"eprF6eZaPtd\", (Object) null);\n Object object0 = new Object();\n FieldWriter fieldWriter1 = null;\n try {\n fieldWriter1 = new FieldWriter(classWriter0, 2, \"The list of names must not be null\", \"The list of names must not be null\", \":qO^Q~\", object0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // value java.lang.Object@6f18df94\n //\n verifyException(\"wheel.asm.ClassWriter\", e);\n }\n }", "boolean usesNext() {\n return next != null;\n }", "@Test\r\n public void testConstructor() {\r\n System.out.println(\"testConstructor\");\r\n try{\r\n new AddMetaInfoToGameService(2L, 3L, 5000);\r\n new AddMetaInfoToGameService(2L, 3L, 0);\r\n //fail();\r\n }catch(Exception e){\r\n e.getMessage();\r\n }\r\n }", "public boolean mayContainSequenceConstructor() {\r\n return true;\r\n }", "public boolean mayContainSequenceConstructor() {\r\n return true;\r\n }", "@Test\n public void testIsValid() {\n assertTrue(scoutDec.isValid());\n scoutDec.setParameters(new DirectionParameters(null));\n assertFalse(scoutDec.isValid());\n }", "@Test (expected = IllegalArgumentException.class)\n\tpublic void testConstructor3ParametersNegSecond() {\n\t\tnew CountDownTimer(2, 3, -4);\n\t}", "public static boolean testAlphabetListAddBadInput1() {\r\n AlphabetList list1 = new AlphabetList(4);\r\n try {\r\n list1.add(null);\r\n } catch (NullPointerException e) {\r\n return true;\r\n }\r\n return false;\r\n }", "public void testCtor2_NullEdge() {\n try {\n new WayPointEvent(null, 0, offset);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }", "@Test (expected = IllegalArgumentException.class)\n\tpublic void testConstructorString1ParameterAlpha() {\n\t\tnew CountDownTimer(\"a\");\n\t}", "@Test\n public void whenCheckNextPositionShouldReturnContainValueFalse() {\n PrimeNumbersIterator pni = new PrimeNumbersIterator(new int[]{1, 5, -5, 4});\n\n pni.next();\n pni.next();\n boolean result = pni.hasNext();\n\n assertThat(result, is(false));\n }", "@Test\n public void hasNextFalseTest() {\n this.it.next();\n this.it.next();\n this.it.next();\n this.it.next();\n this.it.hasNext();\n this.it.hasNext();\n assertThat(false, is(this.it.hasNext()));\n }", "@Test(expected = IllegalArgumentException.class)\n public void testArgumentsNotHaveAValue() {\n System.out.println(\"Arguments do not have n\");\n assertThat(Arguments.valueOf(\"n\"), is(nullValue()));\n }", "public void testCtor() {\r\n assertNotNull(\"Failed to create a new Year instance.\", new Year());\r\n }", "@Test(expected = IllegalArgumentException.class)\n public void testNegNumFlightConstructor() throws ParseException{\n Flight myFlight = new Flight(-10, \"SEA\", \"JFK\", \"11/20/2020\", 100.00); \n }", "public MyLinkedList() {\n first = null;\n n = 0;\n }", "public LinkedListIterator(){\n position = null;\n previous = null; \n isAfterNext = false;\n }" ]
[ "0.6338891", "0.61251086", "0.6106086", "0.6089708", "0.6089124", "0.60659426", "0.6037448", "0.5933434", "0.5923131", "0.5897468", "0.5835397", "0.5834437", "0.5824793", "0.5775248", "0.57606006", "0.57389724", "0.5704783", "0.56898475", "0.5671301", "0.56515217", "0.56507474", "0.56486166", "0.56483555", "0.5643061", "0.5630465", "0.5609075", "0.5602881", "0.5601813", "0.56004936", "0.5587479", "0.5577147", "0.55711365", "0.5563226", "0.55520964", "0.5544547", "0.55392045", "0.55367357", "0.55252564", "0.5524505", "0.5504191", "0.54798985", "0.54767734", "0.5471974", "0.54673207", "0.5463247", "0.546002", "0.5459438", "0.5450513", "0.5450487", "0.5446857", "0.5445443", "0.54362094", "0.54346955", "0.5427999", "0.5423044", "0.5415345", "0.54134744", "0.5398709", "0.5396622", "0.539539", "0.53896725", "0.5384339", "0.53778285", "0.53736645", "0.53704953", "0.53650534", "0.5355682", "0.53484094", "0.53471464", "0.5341606", "0.5338876", "0.5332501", "0.53296846", "0.5321523", "0.5314789", "0.5313192", "0.53018624", "0.52803457", "0.5277757", "0.52737063", "0.5272549", "0.526932", "0.52675456", "0.5267002", "0.5259207", "0.5258794", "0.5256996", "0.5256996", "0.52558464", "0.52542025", "0.5252936", "0.52375406", "0.52325934", "0.52276236", "0.5221653", "0.521983", "0.52146363", "0.51999915", "0.51933086", "0.51891935" ]
0.7058151
0
Test execusion with a null input.
@Test public void testExecute_inputNull() { assertThat((Object)processor.execute(null, ANONYMOUS_CSVCONTEXT)).isNull(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void noneNullArgumentIsNullTest() throws GeneralException {\n for (String noneNullArgument : SAMLCorrelationRule.NONE_NULL_ARGUMENTS_NAME) {\n\n JavaRuleContext testRuleContext = buildTestJavaRuleContext();\n testRuleContext.getArguments().remove(noneNullArgument);\n\n assertThrows(GeneralException.class, () -> testRule.execute(testRuleContext));\n verify(testRule).internalValidation(eq(testRuleContext));\n verify(testRule, never()).internalExecute(eq(testRuleContext), any());\n }\n }", "boolean getCalledOnNullInput();", "public boolean canProcessNull() {\n return false;\n }", "@Test\n public void testWithNullString() throws org.nfunk.jep.ParseException\n {\n String string = null;\n Stack<Object> parameters = CollectionsUtils.newParametersStack(string);\n function.run(parameters);\n assertEquals(TRUE, parameters.pop());\n }", "public void testCheckNull() {\n Util.checkNull(\"\", \"test\");\n }", "@Test\n public void testWithNonEmptyString() throws org.nfunk.jep.ParseException\n {\n Stack<Object> parameters = CollectionsUtils.newParametersStack(\"test\");\n function.run(parameters);\n assertEquals(FALSE, parameters.pop());\n }", "@Test(expected = SuperCsvCellProcessorException.class)\n\tpublic void testWithNull() {\n\t\tprocessor.execute(null, ANONYMOUS_CSVCONTEXT);\n\t}", "@Test\n\tpublic void testNull() throws Exception {\n\t\ttestWith(null);\n\t}", "public void testCheckNull() {\n Util.checkNull(\" \", \"test\");\n }", "@Test public void gracefullyEndsForEmptyInputs() {\n\t\tAssert.assertNotNull(parser.parse(new String[0], new CliOptions()));\n\t}", "@Test\n public void testWithEmptyString() throws org.nfunk.jep.ParseException\n {\n Stack<Object> parameters = CollectionsUtils.newParametersStack(\"\");\n function.run(parameters);\n assertEquals(TRUE, parameters.pop());\n }", "@Test\n public void testMultiplyAllNumbersWithNullInput() {\n assertEquals(null, calculator.multiplyAllNumbers(null));\n }", "@Test\n public void testSumAllNumbersWithNullInput() {\n \t//this test currently fails on purpose\n assertEquals(null, calculator.sumAllNumbers(null));\n }", "public TestCase isNull( Object obj );", "@Test(expected = NullPointerException.class)\n public void formatBooleanNullAsInputTest() {\n Boolean someBoolean = null;\n Format.formatBoolean(someBoolean);\n }", "public void testInvalidInput(){\n\t\tString input = \"bye\";\n\t\tString actual = operation.processOperation(input);\n\t\tString expected = \"bye bye could not be performed\";\n\t\tassertEquals(expected,actual);\n\t}", "@Override\n\tpublic void visit(IsNullExpression arg0) {\n\t\t\n\t}", "private void assertNullHandling(UMLMessageArgument msgArg) throws Exception\r\n\t{\r\n\t\tif(msgArg!=null)\r\n\t\t\tassertFalse(msgArg.equals((UMLMessageArgument)null));\r\n\t\tif(msgArg!=null)\r\n\t\t\tassertFalse(msgArg.equals((Object)null));\r\n\t\tif(msgArg!=null)\r\n\t\t\tassertFalse(msgArg.equals((UMLSymbol)null));\r\n\t}", "@Override\n\tpublic void visit(IsNullExpression arg0) {\n\n\t}", "@Test\n public void testNullInputPerturbDataSet() throws Exception {\n int[] result = NoiseGenerator.perturbDataSet(null, 2);\n Assert.assertTrue(result == null);\n }", "@Test\n\tvoid testCheckNull1() {\n\t\tassertFalse(DataChecker.checkNull(new Integer(42)));\n\t}", "@Test\n public void testCheckNull() {\n Helper.checkNull(\"non-null\", \"non-null name\");\n }", "@Test(expected = SuperCsvCellProcessorException.class)\n\tpublic void testWithEmptyString() {\n\t\tprocessor.execute(\"\", ANONYMOUS_CSVCONTEXT);\n\t}", "@Test\n \tpublic void testWithNullValue() {\n \t\tAssert.assertFalse(f1.equals(fnull));\n \t}", "public TestCase notNull( Object obj );", "@Test\n\t\tpublic void testEmpty() throws LexicalException, SyntaxException {\n\t\t\tString input = \"\"; //The input is the empty string. \n\t\t\tthrown.expect(SyntaxException.class);\n\t\t\tPLPParser parser = makeParser(input);\n\t\t\t@SuppressWarnings(\"unused\")\n\t\t\tProgram p = parser.parse();\n\t\t}", "@Test\n void nullTest() {\n assertNull(sFloat1.toScrabbleInt());\n assertNull(sFloat1.and(sFloat2));\n assertNull(sFloat1.or(sFloat2));\n assertNull(sFloat1.toScrabbleBool());\n assertNull(sFloat1.toScrabbleBinary());\n assertNull(sFloat1.addToString(new ScrabbleString(\"Hello World\")));\n }", "@Test(expected = IllegalArgumentException.class)\n\tpublic void testSumShouldGiveBackExceptionIfInputIsNull() {\n\t\tString input = null;\n\t\tString separator = \",\";\n\t\t// THEN\n\t\tunderTest.sum(input, separator);\n\t}", "@Test\n public void nonNullStringPass() {\n }", "AstroArg empty();", "public void testHandleGUIEvent_null() {\n try {\n eventManager.handleGUIEvent(null);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "public void testCallableNPE3() {\n try {\n Callable c = Executors.callable((PrivilegedAction) null);\n shouldThrow();\n } catch (NullPointerException success) {}\n }", "public void testValidNullPointerException() {\r\n assertNotNull(\"setup fails\", uploadRequestValidator);\r\n try {\r\n uploadRequestValidator.valid(null);\r\n fail(\"if argument is null, throw NullPointerException\");\r\n } catch (NullPointerException e) {\r\n // good\r\n }\r\n }", "@Test(expected=IllegalArgumentException.class)\n\tpublic void testPickUpNull() {\n\t\tPlayer player = new Player(new Square(), 0);\n\t\tplayer.pickUp(null);\n\t}", "@Test\n\tpublic void testValidateUpdateQueryWithNullValue1() {\n\t\twhen(repoItem.getPropertyValue(RuleProperty.TARGET)).thenReturn(DefaultRuleAssetValidator.SEARCH_PAGES);\n\t\tupdates.add(mockAssetView(\"query\", null));\t\t\n\t\tdefaultRuleAssetValidator.validateUpdateAsset(editorInfo, updates, null);\n\t\tverify(assetService).addError(eq(RuleProperty.QUERY), anyString());\t\n\t}", "@Test\n public void testEmptyTaintContainsNullTaint() {\n Taint t = Taint.emptyTaint();\n assertTrue(t.containsLabel(null));\n }", "@Test(expected = IllegalArgumentException.class)\r\n public void testDetectWithNullData() throws Exception {\r\n instance.detect(null);\r\n }", "@Test\n public void testCheckNullForInjectedValue() {\n Helper.checkNullForInjectedValue(\"obj\", \"obj\");\n }", "@Test\r\n public void test_performLogic_Accuracy2() throws Exception {\r\n instance.performLogic(null);\r\n }", "@Test\n\tpublic void testValidateUpdateTargetWithNullQuery1() {\n\t\tupdates.add(mockAssetView(\"target\", DefaultRuleAssetValidator.SEARCH_PAGES));\n\t\tupdates.add(mockAssetView(\"query\", null));\t\t\n\t\tdefaultRuleAssetValidator.validateUpdateAsset(editorInfo, updates, null);\n\t\tverify(assetService).addError(eq(RuleProperty.QUERY), anyString());\t\t\n\t}", "@Test\n\tpublic void testEmpty() throws LexicalException, SyntaxException {\n\t\tString input = \"\"; // The input is the empty string. This is not legal\n\t\tshow(input); // Display the input\n\t\tScanner scanner = new Scanner(input).scan(); // Create a Scanner and initialize it\n\t\tshow(scanner); // Display the Scanner\n\t\tSimpleParser parser = new SimpleParser(scanner); // Create a parser\n\t\tthrown.expect(SyntaxException.class);\n\t\ttry {\n\t\t\tparser.parse(); // Parse the program\n\t\t} catch (SyntaxException e) {\n\t\t\tshow(e);\n\t\t\tthrow e;\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test101() throws Throwable {\n StringBuilder stringBuilder0 = new StringBuilder();\n stringBuilder0.append(\"alter materialized viewjcsh%4%|@v9\");\n SQLUtil.addOptionalCondition((String) null, stringBuilder0);\n assertEquals(\"alter materialized viewjcsh%4%|@v9 or null\", stringBuilder0.toString());\n }", "@Test\r\n\tpublic void testNoArg() {\r\n\t\tAssert.assertEquals(\"test[]\", new FunctionImpl.FunctionBuilderImpl(\"test\").build().toQ());\r\n\t}", "boolean isNoOp();", "@Override\n public boolean getCalledOnNullInput() {\n return calledOnNullInput_;\n }", "@Test\n public void nonNullString() {\n }", "public void testOrNPE1() {\r\n try {\r\n validator.or(null);\r\n fail(\"an NPE is expected\");\r\n }\r\n catch (NullPointerException npe) {\r\n //pass\r\n }\r\n }", "@Test\n\tvoid testCheckNull3() {\n\t\tassertTrue(DataChecker.checkNull((Object)null));\n\t}", "public void testCallableNPE4() {\n try {\n Callable c = Executors.callable((PrivilegedExceptionAction) null);\n shouldThrow();\n } catch (NullPointerException success) {}\n }", "@Test\n public void applicationNullTest() throws GeneralException {\n JavaRuleContext testRuleContext = buildTestJavaRuleContext();\n testRuleContext.getArguments().remove(JDBCBuildMapRule.ARG_APPLICATION);\n\n assertThrows(GeneralException.class, () -> jdbcBuildMapRule.execute(testRuleContext));\n verify(jdbcBuildMapRule).internalValidation(eq(testRuleContext));\n verify(jdbcBuildMapRule, never()).internalExecute(eq(testRuleContext), any());\n }", "public static String dispNull (String input) {\n //because of short circuiting, if it's null, it never checks the length.\n if (input == null || input.length() == 0)\n return \"N/A\";\n else\n return input;\n }", "public static String dispNull (String input) {\n //because of short circuiting, if it's null, it never checks the length.\n if (input == null || input.length() == 0)\n return \"N/A\";\n else\n return input;\n }", "@Test\n public void isInputDataValidTestWithBadInput() {\n boolean invoke = Deencapsulation.invoke(modificationFibonacci, \"isInputDataValid\", \"a\");\n assertFalse(invoke);\n }", "public static String dispNull (String input) {\n //because of short circuiting, if it's null, it never checks the length.\n if (input == null || input.length() == 0)\n return \"N/A\";\n else\n return input;\n }", "public void testTransformWithNullElement() throws Exception {\n try {\n instance.transform(null, document, caller);\n fail(\"IllegalArgumentException is excepted[\" + suhClassName + \"].\");\n } catch (IllegalArgumentException iae) {\n // pass\n }\n }", "public void testNullOtac()\n {\n assertTrue(!errors.hasErrors());\n form.setVerificationCode(null);\n validator.validate(form, errors);\n assertTrue(errors.hasErrors());\n }", "public void testNull () throws IOException\n {\n Stream stream;\n\n stream = new Stream (null);\n assertTrue (\"erroneous character\", -1 == stream.read ());\n }", "public void testCallableNPE1() {\n try {\n Callable c = Executors.callable((Runnable) null);\n shouldThrow();\n } catch (NullPointerException success) {}\n }", "boolean isNoop();", "@Test\n public void stateNullTest() throws GeneralException {\n JavaRuleContext testRuleContext = buildTestJavaRuleContext();\n testRuleContext.getArguments().remove(JDBCBuildMapRule.ARG_STATE);\n\n assertThrows(GeneralException.class, () -> jdbcBuildMapRule.execute(testRuleContext));\n verify(jdbcBuildMapRule).internalValidation(eq(testRuleContext));\n verify(jdbcBuildMapRule, never()).internalExecute(eq(testRuleContext), any());\n }", "@Ignore\n\t@Test\n\tpublic void testParamNull() {\n\t\tregisterParamException(null, keyString, valueString);\n\t\tregisterParamException(groupString, null, valueString);\n\t\tregisterParamException(groupString, keyString, null);\n\t}", "public final boolean getInputAllowNull() {\n\t\treturn wInputAllowNull;\n\t}", "@Override\n public boolean getCalledOnNullInput() {\n return calledOnNullInput_;\n }", "@Test\n\tpublic void testValidateUpdateQueryWithNullValue2() {\n\t\twhen(repoItem.getPropertyValue(RuleProperty.TARGET)).thenReturn(DefaultRuleAssetValidator.ALL_PAGES);\n\t\tupdates.add(mockAssetView(\"query\", null));\t\t\n\t\tdefaultRuleAssetValidator.validateUpdateAsset(editorInfo, updates, null);\n\t\tverify(assetService, never()).addError(anyString(), anyString());\n\t}", "@Test(expected=IllegalArgumentException.class)\n\tpublic void testcontainsUniqueCharsNaiveNullString() {\n\t\tQuestion11.containsUniqueCharsNaive(null);\n\t}", "public void testGetInputArguments() {\n List<String> args = mb.getInputArguments();\n assertNotNull(args);\n for (String string : args) {\n assertNotNull(string);\n assertTrue(string.length() > 0);\n }\n }", "@Test\n\tvoid testCheckNulls1() {\n\t\tassertTrue(DataChecker.checkNulls(null));\n\t}", "public void testMouseClickedIfMouseEventNull() {\n try {\n editBoxTrigger.mouseClicked(null);\n } catch (Exception e) {\n fail(\"No exception is excpected.\");\n }\n }", "@Test\n public void testIsNullCriteria1() throws Exception {\n String sql = \"Select a From db.g Where a IS NULL\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, \"a\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, \"db.g\");\n\n Node criteriaNode = verify(queryNode, Query.CRITERIA_REF_NAME, IsNullCriteria.ID);\n verifyElementSymbol(criteriaNode, IsNullCriteria.EXPRESSION_REF_NAME, \"a\");\n \n verifySql(\"SELECT a FROM db.g WHERE a IS NULL\", fileNode);\n }", "@Test(expected = IllegalArgumentException.class)\n public void testArgumentsNotHaveAValue() {\n System.out.println(\"Arguments do not have n\");\n assertThat(Arguments.valueOf(\"n\"), is(nullValue()));\n }", "public static void main(String[] args) {\n testSplitterNullOrEmpty();\n }", "public static String displayNull (String input)\r\n {\r\n //because of short circuiting, if it's null, it never checks the length.\r\n if (input == null || input.length() == 0)\r\n return \"N/A\";\r\n else\r\n return input;\r\n }", "@Test(expected=IllegalArgumentException.class)\n public void validNotNullTestWhenInputIsNull(){\n Validator.validateNotNull(null);\n //THEN exception thrown\n }", "@Test\r\n\t@LoadData(dataLoader=ProdutosDataLoader.class)\r\n\tpublic void consultaSaldoProdutoNullTest() {\r\n\t\t\r\n\t\ttry {\r\n\t\t\testoqueFacade.consultarEstoque((Produto)null);\r\n\t\t\tAssert.fail();\r\n\t\t} catch (NullParameterException e) {\r\n\t\t\tAssert.assertTrue(e.hasCode(ExceptionCodes.MOVIMENTACAO_ESTOQUE.SALDO_PRODUTO_REQUIRED));\r\n\t\t}\r\n\t\t\t\r\n\t}", "public void testHandleActionEvent_null() throws Exception {\n try {\n eventManager.handleActionEvent(null);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "boolean checkNull();", "@Test\n public void isGameOverNull()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final CheckersAdjudicator adjudicator = injector.injectAdjudicator();\n\n // Run / Verify.\n assertFalse(adjudicator.isGameOver(null));\n }", "public void testNullMode()\r\n {\r\n try\r\n {\r\n new IncludeDirective( null, null, \"value\", PROPERTIES );\r\n fail( \"no-NPE\" );\r\n }\r\n catch( NullPointerException e )\r\n {\r\n // success\r\n }\r\n }", "@Test(timeout = 4000)\n public void test183() throws Throwable {\n Submit submit0 = new Submit((Component) null, \" (position:\", \"kIh 4+,VlA$]12\");\n String string0 = submit0.eval((Object) null);\n assertEquals(\"null\", string0);\n }", "private boolean checkInput(String[] cred){\n\t\tfor(int i =0; i < cred.length;i++){\n\t\t\tif(cred[i].equals(\"\") || cred[i].equals(null)){\n\t\t\t\treturn false; \n\t\t\t}\n\t\t}\n\t\treturn true; \n\t}", "@Test\n\tvoid testCheckNull2() {\n\t\tassertTrue(DataChecker.checkNull(null));\n\t}", "@Test\n\tpublic void takingNullNodeTest()\n\t{\n\t\ttry\n\t\t{\n\t\t\tOsmXmlToSQLiteDatabaseConverter converter = new OsmXmlToSQLiteDatabaseConverter(new MapObjectsIdFinderFake());\n\t\t\tconverter.takeNode(null);\n\t\t\tfail();\n\t\t}\n\t\tcatch (IllegalArgumentException ex)\n\t\t{\n\t\t\t// ok\n\t\t}\n\t}", "@Test \n\tvoid test3() {\n\t\tassertTrue(!r1.getOutput().isEmpty());\n\t}", "@Test\n public void testIsNullValidName() {\n FieldVerifier service = new FieldVerifier();\n String name = null;\n boolean result = service.isValidName(name);\n assertEquals(false, result);\n }", "boolean isNullOmittable();", "@Test\n\t@DisplayName(\"combinacion == null || combinacionSecreta == null\") \n\tvoid combinacionNulaFacilTest(){ \n\t\tCombinacion combinacionFacil = null;\n\t\tCombinacion combinacionSecretaFacil = null;\n\t\t\n\t\tAssertions.assertThrows(NullPointerException.class, () -> {\n\t\t\tcombinacionFacil.calcularResultado(combinacionSecretaFacil);\n\t\t});\n\t}", "@Override\n\tpublic String input() throws Exception {\n\t\treturn null;\n\t}", "@Override\n\tpublic String input() throws Exception {\n\t\treturn null;\n\t}", "@Override\n\tpublic String connectionTest(String testInput) {\n\t\treturn null;\n\t}", "@Test(expected = CopilotServiceInitializationException.class)\n public void testCheckNullForInjectedValueFailure() {\n Helper.checkNullForInjectedValue(null, \"obj\");\n }", "@Test\n\tvoid testeNomeNull()\n\t{\n\t\ttry\n\t\t{\n\t\t\tcontatoBasico = new Contato(null, \"Gaudencio\", \"123\");\n\t\t\tfail(\"Esperava erro ao passar nome nulo\");\n\t\t}catch(NullPointerException npe)\n\t\t{\n\t\t\t\n\t\t}\n\n\t}", "private void checkForEmptyLine() throws OutmatchingParametersToMethodCall {\n if (this.params.isEmpty() && method.getParamAmount() != 0) {\n throw new OutmatchingParametersToMethodCall();\n } else if (method.getParamAmount() == 0 && !this.params.isEmpty()) {\n throw new OutmatchingParametersToMethodCall();\n }\n }", "public void testTransformWithNullCaller() throws Exception {\n try {\n instance.transform(element, document, null);\n fail(\"IllegalArgumentException is excepted[\" + suhClassName + \"].\");\n } catch (IllegalArgumentException iae) {\n // pass\n }\n }", "@Test\n public void parseReturnsNullIfNotInteger() {\n assertNull(InputProcessing.tryParse(\"assdf\"));\n }", "public void testRemoveActionEventListener1_null1() {\n try {\n eventManager.removeActionEventListener(null, UndoableAction.class);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "private void checkFormNullInput(Point[] points) {\n // No null inputs are allowed\n if (points == null) throw new IllegalArgumentException();\n\n for (Point p : points) {\n // No null elements are allowed\n if (p == null) {\n throw new IllegalArgumentException();\n }\n }\n }", "public void testObtenerPalabrasClave() {\n \tString prueba = null; \n \t\tassertNull(prueba);\n }", "public void testCheckNull_NullArg() {\n try {\n Util.checkNull(null, \"test\");\n\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException e) {\n // good\n }\n }", "public void testCheckNull_NullArg() {\n try {\n Util.checkNull(null, \"test\");\n\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException e) {\n // good\n }\n }", "@Test\n public void AppNoParams() {\n try{\n App.main(new String[]{});\n }catch(RuntimeException re){\n assertEquals(re.getMessage(),\"Insufficient arguments given. Needs [input file] [# processors]\");\n }\n }" ]
[ "0.69402635", "0.6675134", "0.6580598", "0.6480455", "0.64759845", "0.64374304", "0.6394552", "0.63752544", "0.635831", "0.631132", "0.63046986", "0.6285367", "0.62180215", "0.62019134", "0.6124993", "0.60830104", "0.6068091", "0.60644436", "0.60468847", "0.6036192", "0.6031126", "0.60292405", "0.59868705", "0.595184", "0.5939309", "0.5906964", "0.5886279", "0.58840007", "0.5878531", "0.58690983", "0.5864323", "0.585608", "0.58391255", "0.5829074", "0.57942003", "0.5790177", "0.57814854", "0.5775856", "0.57704943", "0.574951", "0.5749011", "0.5745667", "0.5729985", "0.57221425", "0.57217187", "0.5720594", "0.5719946", "0.57149625", "0.5708763", "0.5705618", "0.57006866", "0.57006866", "0.5697952", "0.5695368", "0.569185", "0.56871635", "0.5684539", "0.56743413", "0.56685156", "0.5667872", "0.56669205", "0.5665509", "0.56592417", "0.5656744", "0.56537944", "0.5648575", "0.5647868", "0.5640312", "0.5639287", "0.5638316", "0.56364644", "0.563213", "0.5629636", "0.5627939", "0.56259876", "0.56243163", "0.56196946", "0.5610643", "0.5609884", "0.56048936", "0.560039", "0.559898", "0.5598741", "0.5595942", "0.55901074", "0.5582755", "0.5580155", "0.5580155", "0.55779386", "0.55772007", "0.556886", "0.5566159", "0.5564119", "0.5559773", "0.55592555", "0.555505", "0.5549891", "0.55489916", "0.55489916", "0.5546738" ]
0.7720591
0
Test execusion with valid value.
@Test public void testExecute_inputValid() { { String input = maxStr; assertThat((Object)processor.execute(input, ANONYMOUS_CSVCONTEXT)).isEqualTo(input); assertThat((Object)processorChain.execute(input, ANONYMOUS_CSVCONTEXT)).isEqualTo(input); } { String input = maxStr.substring(0, max-1); assertThat((Object)processor.execute(input, ANONYMOUS_CSVCONTEXT)).isEqualTo(input); assertThat((Object)processorChain.execute(input, ANONYMOUS_CSVCONTEXT)).isEqualTo(input); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void isInputDataValidTest() {\n boolean invoke = Deencapsulation.invoke(modificationFibonacci, \"isInputDataValid\", \"1\");\n assertTrue(invoke);\n }", "@Test\n public void isInputDataValidTestWithBadInput() {\n boolean invoke = Deencapsulation.invoke(modificationFibonacci, \"isInputDataValid\", \"a\");\n assertFalse(invoke);\n }", "public boolean isCValueValid();", "@Test\n\tvoid test() {\n\t\t\n\t\tuserInput ui = new userInput();\n\t\t\n\t\tboolean test0 = ui.isValidChildcareType(0);\n\t\tboolean test1 = ui.isValidChildcareType(1);\n\t\tboolean test2 = ui.isValidChildcareType(2);\n\t\tboolean test3 = ui.isValidChildcareType(3);\n\t\tboolean test4 = ui.isValidChildcareType(4);\n\t\tboolean test5 = ui.isValidChildcareType(5);\n\t\tboolean test6 = ui.isValidChildcareType(-1);\n\t\t\n\t\tassertEquals(test0, false);\n\t\tassertEquals(test1, true);\n\t\tassertEquals(test2, true);\n\t\tassertEquals(test3, true);\n\t\tassertEquals(test4, true);\n\t\tassertEquals(test5, false);\n\t\tassertEquals(test6, false);\n\t}", "@Test\n public void test() {\n assertFalse(checkZeroOnes(\"111000\"));\n }", "public abstract Value validateValue(Value value);", "@Test\n public void parse_invalidValueFollowedByValidValue_success() {\n Index targetIndex = INDEX_FIRST_EVENT;\n String userInput = targetIndex.getOneBased() + INVALID_EVENT_NAME_DESC + EVENT_NAME_DESC_MA2101\n + VALID_FLAG_ALL;\n EditEventDescriptor descriptor = new EditEventDescriptorBuilder()\n .withEventName(VALID_EVENT_NAME_MA2101).build();\n EditCommand expectedCommand = new EditCommand(targetIndex, descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n\n // other valid values specified\n userInput = targetIndex.getOneBased() + INVALID_EVENT_NAME_DESC + EVENT_NAME_DESC_MA2101\n + DESCRIPTION_DESC_MA2101 + VENUE_DESC_MA2101 + VALID_FLAG_ALL;\n descriptor = new EditEventDescriptorBuilder().withEventName(VALID_EVENT_NAME_MA2101)\n .withDescription(VALID_DESCRIPTION_MA2101).withVenue(VALID_VENUE_MA2101).build();\n expectedCommand = new EditCommand(targetIndex, descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n }", "@Test\n public void tc__VerifyValue_EnviromentValue() throws Exception\n {\n EN.BeginTest( TestName );\n\n // Testscript in Schlüsselwort-Notation\n EN.SelectWindow( \"Rechner\" );\n\n // Soll/Ist-Vergleich: Ist das Richtige Fenster gesetzt?\n // Check the Name, Called Method and Value of Actuel object\n assertEquals( \"NO VALUE\", myClipBoard.getValue().get( 0 ) );\n assertEquals( 1, myClipBoard.getValue().size() );\n assertEquals( \"Rechner\", myClipBoard.getObjectName() );\n assertEquals( \"SelectWindow()\", myClipBoard.getMethod() );\n\n EN.SetValue( \"All_MethodsObj\", \"${TCN}\" );\n // Umgebungsvariable eingeben\n EN.VerifyValue( \"All_MethodsObj\", \"${TCN}\" );\n\n // Check the Name, Called Method and Value of Actuel object\n assertEquals( TestName, myClipBoard.getValue().get( 0 ) );\n assertEquals( 1, myClipBoard.getValue().size() );\n\n assertEquals( \"Rechner.All_MethodsObj\", myClipBoard.getObjectName() );\n assertEquals( \"VerifyValue()\", myClipBoard.getMethod() );\n }", "@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 }", "@Test(expectedExceptions=InvalidArgumentValueException.class)\n public void argumentValidationTest() {\n String[] commandLine = new String[] {\"--value\",\"521\"};\n\n parsingEngine.addArgumentSource( ValidatingArgProvider.class );\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n\n ValidatingArgProvider argProvider = new ValidatingArgProvider();\n parsingEngine.loadArgumentsIntoObject( argProvider );\n\n Assert.assertEquals(argProvider.value.intValue(), 521, \"Argument is not correctly initialized\");\n\n // Try some invalid arguments\n commandLine = new String[] {\"--value\",\"foo\"};\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n }", "@Test\n public void parse_invalidValueFollowedByValidValue_success() {\n Index targetIndex = INDEX_FIRST;\n String userInput = targetIndex.getOneBased() + INVALID_PHONE_DESC + PHONE_DESC_BABES;\n EditBeneficiaryDescriptor descriptor = new EditBeneficiaryDescriptorBuilder()\n .withPhone(VALID_PHONE_BABES).build();\n EditBeneficiaryCommand expectedCommand = new EditBeneficiaryCommand(targetIndex, descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n\n // other valid values specified\n userInput = targetIndex.getOneBased() + EMAIL_DESC_BABES + INVALID_PHONE_DESC + ADDRESS_DESC_BABES\n + PHONE_DESC_BABES;\n descriptor = new EditBeneficiaryDescriptorBuilder().withPhone(VALID_PHONE_BABES).withEmail(VALID_EMAIL_BABES)\n .withAddress(VALID_ADDRESS_BABES).build();\n expectedCommand = new EditBeneficiaryCommand(targetIndex, descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n }", "public boolean validateValue(Object value) {\n return true;\n }", "public void testCheck()\r\n {\n DataUtil.check(9, \"This is a test!\");\r\n }", "public void testInvalidInput(){\n\t\tString input = \"bye\";\n\t\tString actual = operation.processOperation(input);\n\t\tString expected = \"bye bye could not be performed\";\n\t\tassertEquals(expected,actual);\n\t}", "@Test\n public void parse_invalidValueFollowedByValidValue_success() {\n Index targetIndex = INDEX_FIRST_RECIPE;\n String userInput = targetIndex.getOneBased() + INVALID_INGREDIENTS_DESC + INGREDIENTS_DESC_EGGS_ON_TOAST;\n EditRecipeDescriptor descriptor = new EditRecipeDescriptorBuilder()\n .withIngredients(VALID_INGREDIENTS_EGGS_ON_TOAST).build();\n ModifyCommand expectedCommand = new ModifyCommand(targetIndex, descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n\n // other valid values specified\n userInput = targetIndex.getOneBased() + INSTRUCTIONS_DESC_EGGS_ON_TOAST + INVALID_INGREDIENTS_DESC\n + INGREDIENTS_DESC_EGGS_ON_TOAST;\n descriptor =\n new EditRecipeDescriptorBuilder().withIngredients(VALID_INGREDIENTS_EGGS_ON_TOAST)\n .withInstructions(VALID_INSTRUCTIONS_EGGS_ON_TOAST).build();\n expectedCommand = new ModifyCommand(targetIndex, descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n }", "void checkValid();", "@Test\n public void testIsValidInteger() {\n System.out.println(\"isValidInteger\");\n String integer = \"6.8\";\n boolean expResult = false;\n boolean result = ValidVariables.isValidInteger(integer);\n assertEquals(expResult, result);\n }", "@Test\r\n public void testVerificaPossibilidade0() {\r\n String result = usucapiao.verificaRequisitos();\r\n assertEquals(\"false\", result);\r\n }", "@Test\r\n public void testGetValorValido() {\r\n PapelMoeda instance = new PapelMoeda(100, 100);\r\n int expResult = 100;\r\n int result = instance.getValor();\r\n assertEquals(expResult, result);\r\n }", "@Test\n public void testValideInstructionExecute() {\n \n RoverConfiguration result = instruction.execute(initConfiguration);\n assertEquals(expectedConfiguration, result);\n }", "@Test\n public void parse_invalidValueFollowedByValidValue_success() {\n Index targetIndex = INDEX_FIRST;\n String userInput = targetIndex.getOneBased() + INVALID_NAME_DESC + NAME_DESC_VIVOCITY;\n EditLocationDescriptor descriptor = new EditLocationDescriptorBuilder().withName(VALID_NAME_VIVOCITY).build();\n EditLocationCommand expectedCommand = new EditLocationCommand(\n new IndexIdPairStub(targetIndex, null), descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n\n // other valid values specified\n userInput = targetIndex.getOneBased() + INVALID_NAME_DESC + ADDRESS_DESC_VIVOCITY + NAME_DESC_VIVOCITY;\n descriptor = new EditLocationDescriptorBuilder().withAddress(VALID_ADDRESS_VIVOCITY)\n .withName(VALID_NAME_VIVOCITY).build();\n expectedCommand = new EditLocationCommand(new IndexIdPairStub(targetIndex, null), descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n }", "public boolean check(int value);", "@Test\n @Disabled\n public void testValidateMatriculaCoche() {\n assertFalse(RegExprMain.validateMatriculaCoche(\"543 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"5432 JTD\"));\n assertFalse(RegExprMain.validateMatriculaCoche(\"5433 JAD\"));\n assertFalse(RegExprMain.validateMatriculaCoche(\"54333 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"5432 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"6784 CLD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"4563 BVB\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"6789 LMN\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"2435 JKD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"4567 GJD\"));\n \n\n }", "@Test\n public void parse_invalidValueFollowedByValidValue_success() {\n Index targetIndex = INDEX_FIRST;\n String userInput = targetIndex.getOneBased() + INVALID_PHONE_DESC + PHONE_DESC_BOB;\n ClientDescriptor descriptor = new ClientDescriptorBuilder().withPhone(VALID_PHONE_BOB).build();\n EditClientCommand expectedCommand = new EditClientCommand(targetIndex, descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n\n // other valid values specified\n userInput = targetIndex.getOneBased() + EMAIL_DESC_BOB + INVALID_PHONE_DESC + ADDRESS_DESC_BOB\n + PHONE_DESC_BOB;\n descriptor = new ClientDescriptorBuilder().withPhone(VALID_PHONE_BOB).withEmail(VALID_EMAIL_BOB)\n .withAddress(VALID_ADDRESS_BOB).build();\n expectedCommand = new EditClientCommand(targetIndex, descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n }", "public void testSingleVar() { assertValid(\"int a;\"); }", "protected abstract int isValidInput();", "@Test\n public void testCardSelectionIsValid_TRUE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n }", "@Override\n\tpublic boolean evaluar(Calculable cal) {\n\t\treturn false;\n\t}", "@Override\n public void verifyResult() {\n assertThat(calculator.getResult(), is(4));\n }", "@Test(expected = Exception.class)\n public void testCardSelectionIsValid_FALSE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n \n }", "boolean isValidValue(String value);", "@Test\n public void testValidateValue()\n {\n FacesContext context = mock(FacesContext.class);\n UIComponent component = mock(UIComponent.class);\n \n when(m_AttributeModel.getType()).thenReturn(AttributeDefinition.INTEGER);\n m_SUT = new ConfigPropModelImpl(m_AttributeModel);\n \n try\n {\n m_SUT.validateValue(context, component, \"not int\");\n fail(\"Validation exception should be thrown.\");\n }\n catch (ValidatorException exception)\n {\n //ExpectedException\n assertThat(exception.getFacesMessage().getSummary(), is(\"Value Invalid Type!\"));\n }\n \n try\n {\n m_SUT.validateValue(context, component, \"34\");\n }\n catch (ValidatorException exception)\n {\n fail(\"Validation should have passed and therefore no exception should be thrown.\");\n }\n }", "@Test\n public void testInvokingStringMethodAndEvaluateWithWrongValue() {\n\n // Calling the String-Method and it should be avaluated with an int, the result should be false\n MethodInvokingEventCondition invokingEventCondition = new MethodInvokingEventCondition(DummyAdapterEvent.class,\n DummyAdapterEvent.METHOD_RETURNS_STRING, INT_TO_MATCH);\n\n Assert.assertFalse(invokingEventCondition.evaluate(dummyAdapterEvent));\n }", "private static void checkValidity(boolean valid) throws InvalidExpression\r\n {\r\n if(!valid)\r\n {\r\n throw new InvalidExpression(\"The expression entered is not valid\");\r\n }\r\n }", "@Test\n public void testIsValidAddress() {\n System.out.println(\"isValidAddress\");\n String address = \"Trion Ierarxon 86, Larissa\";\n boolean expResult = true;\n boolean result = ValidVariables.isValidAddress(address);\n assertEquals(expResult, result);\n }", "@Test\r\n public void testVerificaPossibilidade3() {\r\n usucapiao.setAnimusDomini(true);\r\n usucapiao.setPosseMansa(true);\r\n usucapiao.setPossePassifica(true);\r\n String result = usucapiao.verificaRequisitos();\r\n assertEquals(\"false\", result);\r\n }", "@Test\n public void parse_invalidValueFollowedByValidValue_success() {\n Index targetIndex = INDEX_FIRST;\n String userInput = targetIndex.getOneBased() + INVALID_PHONE_DESC + PHONE_DESC_BOB;\n OrderDescriptor descriptor = new OrderDescriptorBuilder().withClientPhone(VALID_PHONE_BOB).build();\n EditOrderCommand expectedCommand = new EditOrderCommand(targetIndex, descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n\n // other valid values specified\n userInput = targetIndex.getOneBased() + RECIPE_NAME_DESC_LAKSA + INVALID_PHONE_DESC + ADDRESS_DESC_BOB\n + PHONE_DESC_BOB;\n descriptor = new OrderDescriptorBuilder().withClientPhone(VALID_PHONE_BOB)\n .withClientAddress(VALID_ADDRESS_BOB).withRecipeName(VALID_RECIPE_NAME_LAKSA).build();\n expectedCommand = new EditOrderCommand(targetIndex, descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n }", "@org.junit.Test\r\n public void testPositiveScenario() {\n boolean result = Validation.validateSAPhoneNumber(\"+27712612199\");// function should return true\r\n assertEquals(true, result);\r\n\r\n }", "public abstract boolean isValidValue(String input);", "@Test\n public void cidade_invalida(){\n\n assertThat(cache.isValid(\"Alentejo\")).isEqualTo(false);\n }", "boolean checkValidity();", "@Test\r\n public void testVerificaPossibilidade() {\r\n usucapiao.setAnimusDomini(true);\r\n String result = usucapiao.verificaRequisitos();\r\n assertEquals(\"false\", result);\r\n }", "@Test\n public void testVerifyNome() {\n System.out.println(\"verifyNome\");\n boolean expResult = true;\n boolean result = uv.verifyNome(u);\n assertEquals(expResult, result);\n }", "private void commitEdit (int validValue)\r\n\t{\r\n\t\tm_value = validValue;\r\n\t}", "@Test\r\n public void testVerificaPossibilidade2() {\r\n usucapiao.setAnimusDomini(true);\r\n usucapiao.setPosseMansa(true);\r\n String result = usucapiao.verificaRequisitos();\r\n assertEquals(\"false\", result);\r\n }", "public Boolean validate(R answerFromTest);", "@Test\n\tpublic void testValidateUpdateQueryWithValidValue1() {\n\t\twhen(repoItem.getPropertyValue(RuleProperty.TARGET)).thenReturn(DefaultRuleAssetValidator.SEARCH_PAGES);\n\t\tupdates.add(mockAssetView(\"query\", \"validValue\"));\t\t\n\t\tdefaultRuleAssetValidator.validateUpdateAsset(editorInfo, updates, null);\n\t\tverify(assetService, never()).addError(anyString(), anyString());\n\t}", "@Test\r\n public void testVerificaPossibilidade4() {\r\n usucapiao.setAnimusDomini(true);\r\n usucapiao.setPosseMansa(true);\r\n usucapiao.setPossePassifica(true);\r\n usucapiao.setPosseIninterrupta(true);\r\n String result = usucapiao.verificaRequisitos();\r\n assertEquals(\"false\", result);\r\n }", "protected void validateValue(T value) {\n }", "@Test\n\tpublic void testIsValid()\n\t{\n\t\tSystem.out.println(\"isValid\");\n\n\t\tUserTypeCode userTypeCode = new UserTypeCode();\n\t\tuserTypeCode.setCode(\"Test\");\n\t\tuserTypeCode.setDescription(\"Test\");\n\n\t\tValidationModel validateModel = new ValidationModel(userTypeCode);\n\t\tvalidateModel.setConsumeFieldsOnly(true);\n\n\t\tboolean expResult = true;\n\t\tboolean result = ValidationUtil.isValid(validateModel);\n\t\tassertEquals(expResult, result);\n\n\t\tvalidateModel = new ValidationModel(userTypeCode);\n\n\t\texpResult = false;\n\t\tresult = ValidationUtil.isValid(validateModel);\n\t\tassertEquals(expResult, result);\n\t}", "private boolean isValidInput() {\n\t\treturn true;\n\t}", "@Test\r\n public void testVerificaPossibilidade5() {\r\n usucapiao.setAnimusDomini(true);\r\n usucapiao.setPosseMansa(true);\r\n usucapiao.setPossePassifica(true);\r\n usucapiao.setPosseIninterrupta(true);\r\n usucapiao.setBemComumCasal(true);\r\n String result = usucapiao.verificaRequisitos();\r\n assertEquals(\"false\", result);\r\n }", "private boolean isInputValid() {\n return true;\n }", "@Test\r\n\tpublic void testIsPatientEligible() {\r\n\t\tAssert.assertTrue(oic.isPatientEligible(\"1\"));\r\n\t\tAssert.assertFalse(oic.isPatientEligible(\"2\"));\r\n\t\t\r\n\t\tAssert.assertFalse(oic.isPatientEligible(\"ab\"));\r\n\t\tAssert.assertFalse(oic.isPatientEligible(\"1.2\"));\r\n\t\t\r\n\t\tAssert.assertFalse(oic.isPatientEligible(\"510\"));\r\n\t}", "@Test\n public void testIsValidTap() {\n setUpCorrect();\n assertTrue(boardManager.isValidTap(11));\n assertTrue(boardManager.isValidTap(14));\n assertFalse(boardManager.isValidTap(10));\n }", "@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}", "@Test\n\tpublic void secindForInputChecker() {\n\t\tchar charTest = 'c';\n\t\tboolean result = false;\n\t\ttry {\n\t\t\tresult = object1.inputChecker(charTest);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tboolean ExpectedResult = true;\n\t\tassertEquals(ExpectedResult, result);\n\n\t}", "@Test\n public void testIsValidPhonenumber() {\n System.out.println(\"isValidPhonenumber\");\n String phonenumber = \"gd566666666666666666666666666666666666666\";\n boolean expResult = false;\n boolean result = ValidVariables.isValidPhonenumber(phonenumber);\n assertEquals(expResult, result);\n }", "private boolean checkValue(){\n\t\tfor (int i = 0; i <binary.length();i++){\n\t\t\tif(Character.getNumericValue(binary.charAt(i))>'1' || binary.length()>32 || binary.length()\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t%4 != 0){\n\t\t\t\tSystem.out.println(\"Invalid Input\");\n\t\t\t\tpw.println(\"Invalid Input\");\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\t\t\n\t}", "@Test\n\tpublic void forInputChecker() {\n\t\tchar charTest = 'c';\n\t\tboolean result = false;\n\t\ttry {\n\t\t\tresult = object1.inputChecker(charTest);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tboolean ExpectedResult = true;\n\t\tassertEquals(ExpectedResult, result);\n\n\t}", "@Test\n public void tc_VerifyValue_MemorizedValue() throws Exception\n {\n EN.BeginTest( TestName );\n\n // Testscript in Schlüsselwort-Notation\n EN.SelectWindow( \"Rechner\" );\n\n // Soll/Ist-Vergleich: Ist das Richtige Fenster gesetzt?\n // Check the Name, Called Method and Value of Actuel object\n assertEquals( \"NO VALUE\", myClipBoard.getValue().get( 0 ) );\n assertEquals( 1, myClipBoard.getValue().size() );\n assertEquals( \"Rechner\", myClipBoard.getObjectName() );\n assertEquals( \"SelectWindow()\", myClipBoard.getMethod() );\n\n // Set Value in \"Memory\"\n OKW_Memorize_Sngltn.getInstance().set( \"Key1\", \"The one and only Value\" );\n\n // Wert in \"All_MethodsObj\" setzen.\n EN.SetValue( \"All_MethodsObj\", \"The one and only Value\" );\n // Prüfung des Schlüsselwortes?\n EN.VerifyValue( \"All_MethodsObj\", \"${Key1}\" );\n\n // Check the Name, Called Method and Value of Actuel object\n //assertEquals( \"Wert 1\", myClipBoard.getValue().get( 0 ) );\n assertEquals( 1, myClipBoard.getValue().size() );\n\n assertEquals( \"Rechner.All_MethodsObj\", myClipBoard.getObjectName() );\n assertEquals( \"VerifyValue()\", myClipBoard.getMethod() );\n }", "public abstract boolean verifyInput();", "@Test\n public void testCheckForXssAttack1(){\n\n Assert.assertFalse(xssValidator.checkForXssAttack(WRONG_DATA));\n }", "@Test\n public void tc__VerifyTablecellValue_EnviromentValue() throws Exception\n {\n EN.BeginTest( TestName );\n\n // Testscript in Schlüsselwort-Notation\n EN.SelectWindow( \"Rechner\" );\n\n // Soll/Ist-Vergleich: Ist das Richtige Fenster gesetzt?\n // Check the Name, Called Method and Value of Actuel object\n assertEquals( \"NO VALUE\", myClipBoard.getValue().get( 0 ) );\n assertEquals( 1, myClipBoard.getValue().size() );\n assertEquals( \"Rechner\", myClipBoard.getObjectName() );\n assertEquals( \"SelectWindow()\", myClipBoard.getMethod() );\n\n EN.SetValue( \"All_MethodsObj\", \"${TCN}\" );\n // Umgebungsvariable eingeben\n EN.VerifyTablecellValue( \"All_MethodsObj\", \"X\", \"Y\", \"${TCN}\" );\n\n // Check the Name, Called Method and Value of Actuel object\n assertEquals( 3, myClipBoard.getValue().size() );\n assertEquals( TestName, myClipBoard.getValue().get( 0 ) );\n assertEquals( \"X\", myClipBoard.getValue().get( 1 ) );\n assertEquals( \"Y\", myClipBoard.getValue().get( 2 ) );\n\n assertEquals( \"Rechner.All_MethodsObj\", myClipBoard.getObjectName() );\n assertEquals( \"VerifyTablecellValue()\", myClipBoard.getMethod() );\n }", "@Test(expectedExceptions=NumberFormatException.class)\r\n\tpublic void chkNumberFrmtExcep(){\r\n\t\tString x=\"100A\";\r\n\t\tint f=Integer.parseInt(x);//it will throw exception bcoz x=100A, if it is 100 it will not throw exception\r\n\t}", "boolean hasVal();", "boolean hasVal();", "@Test\r\n public void testIsValidTap() {\r\n assertTrue(boardManager3.isValidTap(7));\r\n assertTrue(boardManager3.isValidTap(5));\r\n assertFalse(boardManager3.isValidTap(0));\r\n }", "@Test\n @Disabled\n public void testValidateTLF() {\n assertTrue(RegExprMain.validateTLF(\"622 24 64 59\"));\n assertTrue(RegExprMain.validateTLF(\"634 84 34 54\"));\n assertTrue(RegExprMain.validateTLF(\"645 74 44 53\"));\n assertFalse(RegExprMain.validateTLF(\"656 154 54 56\"));\n assertTrue(RegExprMain.validateTLF(\"656 14 54 56\"));\n assertTrue(RegExprMain.validateTLF(\"667 54 74 55\"));\n assertFalse(RegExprMain.validateTLF(\"656 16 5 56\"));\n assertFalse(RegExprMain.validateTLF(\"656 15A 54 56\"));\n assertTrue(RegExprMain.validateTLF(\"611 34 84 57\"));\n assertFalse(RegExprMain.validateTLF(\"6564 15 54 56\"));\n \n\n }", "public void testInvalid() {\n\t\tassertNotNull(\"Should have compiler available (for testing to be available)\", this.compiler);\n\t}", "@Test\n\n public void shouldNotBeAbleToInputAlphaCharactersInTradeInValueField() {\n//1. Enter B in the Trade-In Value field\n//2. Enter z in the Trade-In Value field\n }", "protected abstract boolean isInputValid();", "@Override\n\tpublic boolean validataBetNum(String result) throws Exception {\n\t\treturn false;\n\t}", "public void validate(DataRecord value) {\n\r\n\t}", "@Test\n\n public void shouldNotBeAbleToInputAlphaCharactersInAmountOwedOnTradeField() {\n//1. Enter B in the Trade-In Value field\n//2. Enter z in the Trade-In Value field\n }", "@Test\n public void test5(){\n Assert.assertFalse(0>1, \"verify 0 not big then 1 \");\n }", "@Test\r\n public void testVerificaPossibilidade6() {\r\n usucapiao.setAnimusDomini(true);\r\n usucapiao.setPosseMansa(true);\r\n usucapiao.setPossePassifica(true);\r\n usucapiao.setPosseIninterrupta(true);\r\n usucapiao.setBemComumCasal(true);\r\n usucapiao.setCompanheiroAbandonou(true);\r\n String result = usucapiao.verificaRequisitos();\r\n assertEquals(\"false\", result);\r\n }", "boolean isEvaluable();", "@org.junit.Test\r\n public void testNegativeScenario() {\n boolean result = Validation.validateSAPhoneNumber(\"071261219\");// function should return false\r\n assertEquals(false, result);\r\n\r\n }", "@Test(expected = IllegalArgumentException.class)\n public void testArgumentsNotHaveAValue() {\n System.out.println(\"Arguments do not have n\");\n assertThat(Arguments.valueOf(\"n\"), is(nullValue()));\n }", "boolean isValue();", "@Test\r\n public void testVerificaPossibilidade7() {\r\n usucapiao.setAnimusDomini(true);\r\n usucapiao.setPosseMansa(true);\r\n usucapiao.setPossePassifica(true);\r\n usucapiao.setPosseIninterrupta(true);\r\n usucapiao.setBemComumCasal(true);\r\n usucapiao.setCompanheiroAbandonou(true);\r\n usucapiao.setRegistroDeOutroImovel(true);\r\n usucapiao.setTamanhoTerreno(251);\r\n String result = usucapiao.verificaRequisitos();\r\n assertEquals(\"false\", result);\r\n }", "@Test\n public void tc_VerifyIsActive_MemorizedValue() throws Exception\n {\n EN.BeginTest( TestName );\n\n // Testscript in Schlüsselwort-Notation\n EN.SelectWindow( \"Rechner\" );\n\n // Soll/Ist-Vergleich: Ist das Richtige Fenster gesetzt?\n // Check the Name, Called Method and Value of Actuel object\n assertEquals( \"NO VALUE\", myClipBoard.getValue().get( 0 ) );\n assertEquals( 1, myClipBoard.getValue().size() );\n assertEquals( \"Rechner\", myClipBoard.getObjectName() );\n assertEquals( \"SelectWindow()\", myClipBoard.getMethod() );\n\n // Set Value in \"Memory\"\n OKW_Memorize_Sngltn.getInstance().set( \"Key1\", \"YES\" );\n\n // Wert in \"All_MethodsObj\" setzen.\n EN.SetValue( \"All_MethodsObj\", \"YES\" );\n // Prüfung des Schlüsselwortes?\n EN.VerifyIsActive( \"All_MethodsObj\", \"${Key1}\" );\n\n // Check the Name, Called Method and Value of Actuel object\n assertEquals( \"YES\", myClipBoard.getValue().get( 0 ) );\n assertEquals( 1, myClipBoard.getValue().size() );\n\n assertEquals( \"Rechner.All_MethodsObj\", myClipBoard.getObjectName() );\n assertEquals( \"VerifyIsActive()\", myClipBoard.getMethod() );\n }", "@Test\n public void testPrimeNumberChecker() {\n System.out.println(\"Parameterized Number is : \" + inputNumber);\n assertEquals(expectedResult,\n primo.validate(inputNumber));\n }", "@org.junit.Test\n public void testEstParfaitOK() {\n //given\n long n = 6;\n Parfait instance = new Parfait();\n\n //when\n boolean result = instance.estParfait(n);\n\n //then\n Assert.assertTrue(\"OK\", result);\n }", "@Test\n public void tc__VerifyValueWCM_EnviromentVar() throws Exception\n {\n\n EN.BeginTest( TestName );\n\n // Testscript in Schlüsselwort-Notation\n EN.SelectWindow( \"Rechner\" );\n\n // Soll/Ist-Vergleich: Ist das Richtige Fenster gesetzt?\n // Check the Name, Called Method and Value of Actuel object\n assertEquals( \"NO VALUE\", myClipBoard.getValue().get( 0 ) );\n assertEquals( 1, myClipBoard.getValue().size() );\n assertEquals( \"Rechner\", myClipBoard.getObjectName() );\n assertEquals( \"SelectWindow()\", myClipBoard.getMethod() );\n\n // Wert in \"All_MethodsObj\" setzen.\n EN.SetValue( \"All_MethodsObj\", \"${TCN}\" );\n // Umgebungsvariable eingeben\n EN.VerifyValueREGX( \"All_MethodsObj\", \"${TCN}\" );\n\n // Check the Name, Called Method and Value of Actuel object\n assertEquals( TestName, myClipBoard.getValue().get( 0 ) );\n assertEquals( 1, myClipBoard.getValue().size() );\n\n assertEquals( \"Rechner.All_MethodsObj\", myClipBoard.getObjectName() );\n assertEquals( \"VerifyValue()\", myClipBoard.getMethod() );\n }", "@Test\r\n public void testVerificaPossibilidade9() {\r\n usucapiao.setAnimusDomini(true);\r\n usucapiao.setPosseMansa(true);\r\n usucapiao.setPossePassifica(true);\r\n usucapiao.setPosseIninterrupta(true);\r\n usucapiao.setBemComumCasal(true);\r\n usucapiao.setCompanheiroAbandonou(true);\r\n usucapiao.setRegistroDeOutroImovel(true);\r\n usucapiao.setTamanhoTerreno(250);\r\n usucapiao.setPrazo(2);\r\n String result = usucapiao.verificaRequisitos();\r\n assertEquals(\"possivel-agora\", result);\r\n }", "public void testInvalidNoType() { assertInvalid(\"a\"); }", "public static double expectedExec(double value)\n throws IllegalArgumentException\n {\n return value * ( MAX_VALUE + getFactorExec() );\n }", "@Test\n public void testValiderNumeroSoin() {\n \n assertTrue(soin1.validerNumeroSoin());\n assertFalse(soin4.validerNumeroSoin());\n assertTrue(soin2.validerNumeroSoin());\n }", "@Test\n public void testIsValidarFecha() {\n System.out.println(\"isValidarFecha\");\n String fecha = \"06/09/2018\";\n boolean expResult = true;\n boolean result = Entradas.isValidarFecha(fecha);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n \n }", "@Test\n public void testValiderLaCouvertureDuSoin() {\n \n assertTrue(soin1.validerLaCouvertureDuSoin());\n soin3.setPourcentage(2.0);\n assertFalse(soin3.validerLaCouvertureDuSoin());\n soin3.setPourcentage(-1.1);\n assertFalse(soin3.validerLaCouvertureDuSoin());\n assertTrue(soin2.validerLaCouvertureDuSoin());\n }", "@Test\n public void testSalaire() {\n Assert.assertTrue(e.calculSalaire() == 15 * 20 + e.getSalaire());\n }", "private void testExpression(ASTExpression exp, ASTTerm expectedResult) {\n System.out.print(\"eval[\" + exp + \"] = \");\n ASTTerm result = null;\n try {\n result = interpreter.evaluate(exp);\n } catch (Exception e) {\n fail(e.getMessage());\n }\n System.out.println(result);\n\n assertEquals(expectedResult, result);\n }", "public boolean checkVaild() throws IOException;", "private void assertFail(int value) {\n try {\n converter.convertRomanNumber(value);\n fail();\n } catch (Exception e) {\n }\n }", "@Test\n public void tc_VerifyValueREGX_MemorizedValue() throws Exception\n {\n EN.BeginTest( TestName );\n\n // Testscript in Schlüsselwort-Notation\n EN.SelectWindow( \"Rechner\" );\n\n // Soll/Ist-Vergleich: Ist das Richtige Fenster gesetzt?\n // Check the Name, Called Method and Value of Actuel object\n assertEquals( \"NO VALUE\", myClipBoard.getValue().get( 0 ) );\n assertEquals( 1, myClipBoard.getValue().size() );\n assertEquals( \"Rechner\", myClipBoard.getObjectName() );\n assertEquals( \"SelectWindow()\", myClipBoard.getMethod() );\n\n // Set Value in \"Memory\"\n OKW_Memorize_Sngltn.getInstance().set( \"Key1\", \".* one and .* Value\" );\n\n EN.SetValue( \"All_MethodsObj\", \"The one and only Value\" );\n // Kommen auch mehrere Sollwerte im Objekt ab?\n EN.VerifyValueREGX( \"All_MethodsObj\", \"${Key1}\" );\n\n // Check the Name, Called Method and Value of Actuel object\n //assertEquals( \"Wert 1\", myClipBoard.getValue().get( 0 ) );\n assertEquals( 1, myClipBoard.getValue().size() );\n\n assertEquals( \"Rechner.All_MethodsObj\", myClipBoard.getObjectName() );\n assertEquals( \"VerifyValue()\", myClipBoard.getMethod() );\n }", "@Override\n\t\t\tpublic boolean test(Integer t) {\n\t\t\t\treturn false;\n\t\t\t}", "@Test\n public void testCheckForXssAttack2(){\n\n Assert.assertTrue(xssValidator.checkForXssAttack(RIGHT_DATA));\n }", "boolean allowsValue (final String str, final ValidationContext vc)\n {\n try\n {\n getValue (str, vc);\n return true;\n }\n catch (final DatatypeException e)\n {\n return false;\n }\n }" ]
[ "0.66025835", "0.6453457", "0.6362088", "0.62935495", "0.6281482", "0.626156", "0.6219137", "0.6218132", "0.6174303", "0.6151714", "0.61464345", "0.6118035", "0.6113422", "0.6101612", "0.60902977", "0.60765207", "0.6058583", "0.605772", "0.60446566", "0.60276985", "0.59868455", "0.59752756", "0.59628046", "0.59573627", "0.5946433", "0.5940219", "0.59337485", "0.59295714", "0.59241205", "0.59181476", "0.5913615", "0.59080213", "0.59030074", "0.5893843", "0.58855474", "0.5878103", "0.5867733", "0.58588606", "0.58577776", "0.58528936", "0.5837562", "0.582826", "0.5819228", "0.58142495", "0.5813363", "0.5803253", "0.579857", "0.5790307", "0.578623", "0.57809675", "0.57794166", "0.5776005", "0.5775883", "0.57708675", "0.57570285", "0.5753372", "0.5737255", "0.5732391", "0.5731511", "0.5720813", "0.5718316", "0.5717775", "0.57048386", "0.5703991", "0.56974375", "0.56929857", "0.56929857", "0.569292", "0.5688984", "0.56849825", "0.56717503", "0.5666347", "0.5661418", "0.5659576", "0.5655898", "0.5651509", "0.56488657", "0.5638042", "0.5634788", "0.56331193", "0.56308544", "0.562831", "0.5625933", "0.56206894", "0.5618509", "0.5614279", "0.5611817", "0.5607016", "0.5602013", "0.55997336", "0.5591994", "0.5591142", "0.55896574", "0.5588503", "0.558658", "0.5580117", "0.55689275", "0.55607975", "0.55540556", "0.5552501" ]
0.5584396
95
Adds a row of components to the given container.
protected static void addRow(Container container, GridBagConstraints gbc, JComponent... components) { if(components.length == 0) { return; } for(int c = 0; c < components.length; c++) { if(c == components.length - 1) { gbc.gridwidth = GridBagConstraints.REMAINDER; } container.add(components[c], gbc); gbc.gridx++; } gbc.gridwidth = 1; gbc.gridx = 0; gbc.gridy++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addRow() {\n ArrayList<EscapeBlock> row = new ArrayList<>();\n grid.add(row);\n \n for (int j = 0; j < gridWidth; j++) {\n EscapeBlock block = new EscapeBlock(j, gridHeight);\n block.setLocation(margin + j * (Block.length+1) ,\n margin + topMargin + gridHeight * (Block.length+1)); \n \n this.add(block); // add to the JPanel \n row.add(block); // and to the row\n }\n \n gridHeight++;\n }", "public GridBagPanel addRow(Component... components)\n {\n if (myGBC.gridx == GridBagConstraints.RELATIVE)\n {\n setGridx(0);\n }\n if (myGBC.gridy == GridBagConstraints.RELATIVE)\n {\n setGridy(0);\n }\n\n for (Component component : components)\n {\n add(component);\n incrementGridx();\n }\n setGridx(0);\n incrementGridy();\n return this;\n }", "@Override\n\tpublic void addRow() {\n\t\tif(this.numCols == 0){\n\t\t\tthis.numCols++;\n\t\t}\n\t\tthis.numRows++;\n\t}", "private void addComponents() {\n LOOGER.info(\"Get add Components Entry\");\n // Adding loadButton to first row.\n this.add(loadButton);\n\n // Adding fillButton to first row.\n this.add(fillButton);\n\n // Adding deleteButton to first row.\n this.add(deleteButton);\n LOOGER.info(\"add Components exit\");\n }", "public void addRow(Row row) {\r\n\t\trows.add(row);\r\n\t}", "private void addComponent(Container container,Component c,int x,int y,int width,int height)\n {\n c.setBounds(x,y,width,height);\n container.add(c);\n }", "void addToContainer(Container container);", "private void addComponent(Component component, // the Component to add\n int row, // add Component at cell row 0..?\n int column, // add Component at cell column 0..?\n int width, // let the Component span this many cells wide\n int height) { // let the Component span this many cells high\n constraints.gridx = column; // store the four parameters in the constraints\n constraints.gridy = row;\n constraints.gridwidth = width;\n constraints.gridheight = height;\n layout.setConstraints(component, constraints); // set the constraints on the layout manager\n add(component); // before add the actual component to the Applet\n }", "public void addRow(ResultRow row) {\r\n rows.add(row);\r\n }", "public void addRow(Row r) {\n\t\tcontainingRows.add(r);\n\t}", "public int addRow() {\n\t\t// Create a new row with nothing in it\n\t\tList row = new ArrayList();\n\t\treturn(addRow(row));\n\t}", "public void addRow(String... cols)\r\n {\r\n rows.add(cols);\r\n }", "public void add(String[] row) {\r\n\t\tthis.df.add(row);\r\n\t}", "@Override\n public void add(Component c) {\n children.add(c);\n }", "private void addToLayout(Container container, Component c, int x, int y) {\n GridBagConstraints constraints = new GridBagConstraints();\n\n constraints.gridx = x;\n constraints.gridy = y;\n constraints.weightx = 0.0;\n constraints.fill = GridBagConstraints.HORIZONTAL;\n\n container.add(c, constraints);\n }", "public void addComponentsToContainer()\n {\n\t container.add(welcome);\n container.add(amountLabel);\n container.add(amountText);\n container.add(depositButton);\n }", "public void addComponentsToContainer() {\n container.add(userLabel);\n container.add(passwordLabel);\n container.add(userTextField);\n container.add(passwordField);\n container.add(loginButton);\n container.add(exitButton);\n\n }", "public static void addRow(String[] arg0, String[] arg1) {\n tableModel.addRow(arg0, arg1);\n updateSummaryTable();\n inputModel.addRow(arg0[0], arg1.length / 2);\n updateInputTable();\n }", "public void addRow(String rowName);", "public void addRow(int[] row) {\n board[counter] = row;\n counter += 1;\n if (counter == 9) {\n startingBoard = copyBoard();\n }\n }", "public void addRow(TableViewRow row) {\n this.rows.add(row);\n }", "public void addRow() {\n tableModel.insertRow(this.getRowCount(), new String[]{});\n this.setModel(tableModel);\n\n }", "public void addRow(EntityBean e) {\n rows.add(e);\n updateTotalPageNumbers();\n }", "public void addComponent(Component c);", "public void addRow( int before ) {\n\t\tint size = (rows+1) * cols;\n\t\tfloat[] x = new float[size];\n\t\tfloat[] y = new float[size];\n\n\t\trows++;\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tfor (int row = 0; row < rows; row++) {\n\t\t\tfor (int col = 0; col < cols; col++) {\n\t\t\t\tint k = j+col;\n\t\t\t\tint l = i+col;\n\t\t\t\tif ( row == before ) {\n\t\t\t\t\tx[k] = (xGrid[l]+xGrid[k])/2;\n\t\t\t\t\ty[k] = (yGrid[l]+yGrid[k])/2;\n\t\t\t\t} else {\n\t\t\t\t\tx[k] = xGrid[l];\n\t\t\t\t\ty[k] = yGrid[l];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( row != before-1 )\n\t\t\t\ti += cols;\n\t\t\tj += cols;\n\t\t}\n\t\txGrid = x;\n\t\tyGrid = y;\n\t}", "public boolean addRow(TableRow row) {\n\n if (row.getContent().size() != columns.size())\n throw new IllegalArgumentException(\"El nombre de columnes de la nova fila no coincideix amb les de la taula\");\n\n for (String column : getColumnNames())\n if (!row.getContent().containsKey(column))\n throw new IllegalArgumentException(\"La nova fila no conté la columna: \" + column);\n\n return dataStructure.add(row);\n }", "public void addComponents(final Component... components) {\r\n\t\t_hSplit.addComponents(components);\r\n\t}", "protected void addRow(TextButton buttonToAdd)\n {\n table.add(buttonToAdd).width(centre/3.0f);\n table.row();\n }", "private void addRow() {\n\t\t\n\t\tArrayList<Invader> lastRow = enemyArray.get(enemyArray.size() - 1);\n\t\tArrayList<Invader> newRow = new ArrayList<Invader>();\n\t\t\t\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tnewRow.add(new Invader(\n\t\t\t\t\tlastRow.get(i).getX(),\n\t\t\t\t\tlastRow.get(i).getY() + 40,\n\t\t\t\t\tPLAYER_WIDTH,\n\t\t\t\t\tPLAYER_WIDTH,\n\t\t\t\t\t2));\n\t\t}\n\t\t\n\t\tenemyArray.add(newRow);\n\t}", "public void addNewRow(Vector row) throws IllegalStateException{\r\n if(flagAddStatusRow){\r\n row.add(numberOfcolumns, new Integer(IS_INSERTED)); //Set status for row is add new\r\n }else{\r\n row.setElementAt(new Integer(IS_NO_CHANGE), numberOfcolumns);\r\n }\r\n data.add(row);\r\n }", "public void addComponents(Component... components);", "void addComponents();", "@Override\n\tpublic void addChild(IComponent c) {\n\t\tcomponents.add(c);\n\t}", "public void addRow () {\n CSVRow row = CSVRow.createEmptyLine(nbOfColumns, this);\n addRow(row);\n }", "private void addrowActionPerformed(java.awt.event.ActionEvent evt) {\n if(count == max_row-1){\n JOptionPane.showMessageDialog(null, \"Maximum of 10 rows can be added\",\"Failed!!\",JOptionPane.ERROR_MESSAGE);\n return;\n }\n count++; \n combo1[count] = new javax.swing.JComboBox(); \n for(int i=1;i<=5;i++){\n combo1[count].addItem(\"Item \" + i);\n } \n combo2[count] = new javax.swing.JComboBox(); \n for(int i=1;i<=5;i++){\n combo2[count].addItem(\"Item \" + i);\n } \n text1[count] = new javax.swing.JTextField(); \n jPanel2.setLayout(new GridLayout(0,3,20,20));\n jPanel2.add(combo1[count]);\n jPanel2.add(combo2[count]);\n jPanel2.add(text1[count]);\n jPanel2.revalidate();\n jPanel2.repaint();\n }", "void newRow(List<C> row) throws Exception;", "private void addComponents(Container content){\r\n\r\n content.add(getRentPane());\r\n content.add(getSellPane());\r\n\r\n }", "public void addRow(double[] rowValues) {\n rows++;\n matrix.add(rowValues);\n }", "void addContainer (Container toAdd){\n\t\t\tthis.receptacle.add(toAdd);}", "private void addComponentsToPane(final Container pane) {\n pane.setLayout(new BorderLayout());\n JScrollPane header = getHeader();\n JScrollPane center = getCenter();\n\n pane.add(header, BorderLayout.PAGE_START);\n\t pane.add(center, BorderLayout.CENTER);\n }", "void addComponent(Component component);", "public abstract void addItems(IconButtonRow iconButtonRow);", "public void add(Component c){}", "private void addRows() {\n this.SaleList.forEach(Factura -> {\n this.modelo.addRow(new Object[]{\n Factura.getId_Factura(),\n Factura.getPersona().getNombre(),\n Factura.getFecha().getTimestamp(),\n Factura.getCorreo(),\n Factura.getGran_Total()});\n });\n }", "public void addChildren(Container aContainer)\r\n {\r\n Component comp;\r\n for (int i=0;i<aContainer.getComponentCount();i++)\r\n {\r\n comp = aContainer.getComponent(i);\r\n addComponent(comp);;\r\n \r\n if (comp instanceof Container)\r\n {\r\n addChildren((Container) comp);\r\n }\r\n }\r\n }", "public void addComponents(){\r\n\r\n\t\t\tfor(int i=0; i < fieldNum ; i++){ \r\n\t\t\t\tadd(labels[i]);\r\n\t\t\t\tif(i==3){\r\n\t\t\t\t\tadd(fields[i]);\r\n\t\t\t\t\tfor(int k=1;k<ingredientFields.size();k++)\r\n\t\t\t\t\t\tadd(ingredientFields.get(k));\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t\tadd(fields[i]);\r\n\t\t\t}\r\n\r\n\t\t}", "int addRow(RowData row_data) throws IOException;", "void addRowsLock();", "public void addComponent(Component component){\n components.add(component);\n }", "public void addContainer(GameObject container) {\n if(!containers.contains(container)) {\n containers.add(container);\n } else {\n System.out.println(\"addContainer(): This container is already added.\");\n }\n }", "public void addRow(DataRow dataRow) {\n this.dataRows.add(dataRow);\n }", "private void addComponentsToLayout() {\n//\t\tAdd the \"Add project\" button to the list\n\t\taddComponent(addProject);\n\t\t\n//\t\tIf the user don't have any projects, add the \"No projects\" label instead of the list\n\t\tif(projectRows.size() == 0){\n\t\t\taddComponent(new Label(T.get(\"LABEL_NO_PROJECTS_EXISTS\")));\n\t\t}\n//\t\tOtherwise add all project rows to the list\n\t\telse{\n\t\t\tfor (ProjectRow projectRow : projectRows) {\n\t\t\t\taddComponent(projectRow);\n\t\t\t}\n\t\t}\n\t\t\n\t\tmainView.selectProject();\n\t}", "private void addComponentToMainLayout(){\n\n // RelativeLayout params were very useful here\n // the addRule method is the key to arrange the components properly\n RelativeLayout.LayoutParams componentB_Params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);\n componentB_Params.addRule(RelativeLayout.RIGHT_OF, this.tableA.getId());\n\n RelativeLayout.LayoutParams componentC_Params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);\n componentC_Params.addRule(RelativeLayout.BELOW, this.tableA.getId());\n\n RelativeLayout.LayoutParams componentD_Params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);\n componentD_Params.addRule(RelativeLayout.RIGHT_OF, this.scrollViewC.getId());\n componentD_Params.addRule(RelativeLayout.BELOW, this.horizontalScrollViewB.getId());\n\n // 'this' is a relative layout,\n // we extend this table layout as relative layout as seen during the creation of this class\n this.addView(this.tableA);\n this.addView(this.horizontalScrollViewB, componentB_Params);\n this.addView(this.scrollViewC, componentC_Params);\n this.addView(this.scrollViewD, componentD_Params);\n\n }", "public void addRow(final Object[] rowData) {\n\t\t((DefaultTableModel) this.model).addRow(rowData);\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\taddRow();\n\t\t\t}", "private void addComponent( Component component,\n\t\t\t\t\t\t\t int column, int row,\n\t\t\t\t\t\t\t int width, int height,\n\t\t\t\t\t\t\t int weightx, int weighty,\n\t\t\t\t\t\t\t Insets insets, int anchor, int fill )\n\t{\n\t\tgridBagConstraints.gridx = column; // set the gridx constraint\n\t\tgridBagConstraints.gridy = row; // set the gridy constraint\n\t\tgridBagConstraints.gridwidth = width; // set the gridwidth constraint\n\t\tgridBagConstraints.gridheight = height; // set the gridheight constraint\n\t\tgridBagConstraints.weightx = weightx; // set the weightx constraint\n\t\tgridBagConstraints.weighty = weighty; // set the weighty constraint\n\t\tgridBagConstraints.insets = insets; // set the insets constraint\n\t\tgridBagConstraints.anchor = anchor; // set the anchor constraint\n\t\tgridBagConstraints.fill = fill; // set the fill constraint\n\t\tgridBagLayout.setConstraints( component, gridBagConstraints ); // set the constraints for the component\n\t\tadd( component ); // add the component to the frame\n\t}", "protected void add (Component component, int x, int y, int width, int height) {\n add(component,x,y,width,height,GridBagConstraints.BOTH,GridBagConstraints.NORTHWEST,0,0,0,0,0,0);\n }", "public void addLayoutComponent(Component component, Object constraints) { }", "private void addComponents(Container pane) {\n // Reset pane\n pane.removeAll();\n\n GridLayout mainLayout = new GridLayout(4,3);\n JPanel mainPanel = new JPanel();\n mainPanel.setLayout(mainLayout);\n\n // Setting up button sizes\n JButton b = new JButton(\"Filler button\");\n Dimension buttonSize = b.getPreferredSize();\n Dimension preferredSize = new Dimension(\n (int)(buttonSize.getWidth() * 7.5) + newGUI.maxGap,\n (int)(buttonSize.getHeight() * 3.5) + newGUI.maxGap * 2);\n mainPanel.setPreferredSize(preferredSize);\n\n // Add the main panel buttons\n mainPanel.add(commands);\n mainPanel.add(availableCommands);\n mainPanel.add(new JLabel());\n mainPanel.add(enterButton);\n\n pane.add(mainPanel, BorderLayout.NORTH);\n pane.add(new JSeparator(), BorderLayout.CENTER);\n }", "public void addRow(CoverFooterItemType input_data){\r\n if (input_data != null){\r\n data.add(input_data);\r\n int row_num = data.size();\r\n this.fireTableRowsInserted(row_num,row_num);\r\n }\r\n }", "public void addData(String[] row) {\n this.data.add(row);\n }", "public void AddRow(String Table, String Value)\r\n {\n }", "public void incrementRow() {\n setRowAndColumn(row + 1, column);\n }", "public void addLayoutComponent(Component comp, Object constraints) {}", "public void addRow(String customer, String product, String month, int quantity) {\n\t\t//create a object of Report2_Row by invoke the construct method.\n\t\tReport2_Row row = new Report2_Row(customer, product, month, quantity);\n\t\t//add the object of Report2_Row to the list\n\t\tlist.add(row);\n\t}", "public void addComponent(Component c) {\n for (Component C : components) {\n if (c.getClass().equals(C.getClass())) {\n return;\n }\n }\n components.add(c);\n c.setObject(this);\n }", "public void addContent(Component... components) {\n this.contentLayout.add(components);\n }", "public void addRow(Spedizione spedizione){\n spedizioni.add(spedizione);\n fireTableChanged(new TableModelEvent(this));\n }", "protected void addComponents() {\n JPanel contentPanel = new JPanel();\n contentPanel.setLayout(new GridBagLayout());\n GridBagConstraints c = new GridBagConstraints();\n c.insets = new Insets(5, 5, 5, 5);\n\n addFront(contentPanel, c);\n addBack(contentPanel, c);\n addTag(contentPanel, c);\n\n addButtons(contentPanel, c);\n\n add(contentPanel);\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\taddRow();\n\t\t\t}", "public void add(Component component) {\n\t\tcomponents.add(component);\n\t}", "public void addRow(ResultSetRow row) throws SQLException {\n/* 231 */ notSupported();\n/* */ }", "public void addTo( JPanel jpnlContainer ) {\n jpnlContainer.removeAll();\n\n //add object(s) to the container.\n jpnlContainer.add( this );\n\n //update the container JPanel\n jpnlContainer.revalidate();\n jpnlContainer.repaint();\n }", "private void addRow(EMultipleAnswerType eMultipleAnswerType, String title, boolean answer){\n final View row;\n\n // *Setting the row xml:\n if(eMultipleAnswerType == EMultipleAnswerType.SINGLE_CHOICE){\n row = layoutInflater.inflate(ROW_SINGLE_CHOICE_LAYOUT, null);\n } else {\n row = layoutInflater.inflate(ROW_MULTIPLE_CHOICE_LAYOUT, null);\n }\n\n // *Hiding removeBtn:\n ImageButton removeBtn = (ImageButton) row.findViewById(ROW_REMOVE_BTN_ID);\n removeBtn.setVisibility(View.GONE);\n\n // *RadioButton listener:\n final CompoundButton compoundButton = (CompoundButton) row.findViewById(ROW_COMPOUND_BTN_ID);\n compoundButtonController.addCompoundButton(compoundButton);\n\n // *Fill the text and check state of the row:\n compoundButton.setText(title);\n compoundButton.setChecked(answer);\n\n rowContainer.addView(row);\n }", "@Override\n\tpublic boolean addRows(Collection<T> valuesIn) {\n\t\tQueue<T> valuesToAdd = new LinkedList<>(valuesIn);\n\t\t\n\t\tlong curRow = this.getNumRows();\n\t\t\n\t\twhile(!valuesToAdd.isEmpty()){\n\t\t\tthis.addRow();\n\t\t\tfor(long i = 0; i < this.getNumCols(); i++){\n\t\t\t\t//add values to new row\n\t\t\t\tif(valuesToAdd.isEmpty()){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tthis.setValue(i, curRow, valuesToAdd.poll());\n\t\t\t}\n\t\t\tcurRow++;\n\t\t}\n\t\treturn true;\n\t}", "@Override\n\tpublic void add(Component comp) {\n\t\t_childComponents.add(comp);\n\t}", "public void addContainer( LdifContainer container )\n {\n containerList.add( container );\n \n if ( container instanceof LdifChangeRecord )\n {\n hasChanges = true;\n }\n }", "public void addComponent(JComponent component, int row, int col, int width, int height, int anchor, int fill) {\n \n constraints.gridx = col;\n constraints.gridy = row;\n constraints.gridwidth = width;\n constraints.gridheight = height;\n constraints.anchor = anchor;\n double weightx = 0.0;\n double weighty = 0.0;\n \n // only use extra horizontal or vertical space if component\n // spans more than one column and/or row.\n if(width > 1) weightx = 1.0;\n if(height > 1) weighty = 1.0;\n \n switch(fill) {\n case GridBagConstraints.HORIZONTAL:\n constraints.weightx = weightx;\n constraints.weighty = 0.0;\n break;\n case GridBagConstraints.VERTICAL:\n constraints.weighty = weighty;\n constraints.weightx = 0.0;\n break;\n case GridBagConstraints.BOTH:\n constraints.weightx = weightx;\n constraints.weighty = weighty;\n break;\n case GridBagConstraints.NONE:\n constraints.weightx = 0.0;\n constraints.weighty = 0.0;\n break;\n default:\n break;\n }\n constraints.fill = fill;\n add(component, constraints);\n }", "@Override\n\tpublic void addComponent(Component c) {\n\t\troot.addComponent(c);\n\t}", "private void addColumn() {\n for (int j = 0; j < gridHeight; j++) {\n EscapeBlock block = new EscapeBlock(gridWidth,j);\n block.setLocation(margin + gridWidth * (Block.length+1) ,\n margin + topMargin + j * (Block.length+1)); \n this.add(block);\n grid.get(j).add(block);\n }\n gridWidth++;\n }", "public static void addComponentsToPane(Container pane) {\r\n pane.setLayout(new FlowLayout());\r\n pane.add(new JLabel(\"Faculty: \"));\r\n pane.add(facultyChoice);\r\n pane.add(new JLabel(\"Year: \"));\r\n yearField.setPreferredSize(new Dimension(50, 25));\r\n yearField.setToolTipText(\"YYYY format\");\r\n int now = LocalDate.now().getYear();\r\n if(LocalDate.now().getMonth().compareTo(Month.SEPTEMBER) <= 0){\r\n now--;\r\n }\r\n yearField.setText(\"\" + now);\r\n pane.add(yearField);\r\n \r\n pane.add(new JLabel(\"Semester: \"));\r\n semesterChoice.add(\"1\"); semesterChoice.add(\"2\");\r\n semesterChoice.setPreferredSize(new Dimension(50, 25));\r\n pane.add(semesterChoice);\r\n \r\n pane.add(new JLabel(\"Subjects: \"));\r\n\r\n subjectsArea.setPreferredSize(new Dimension(400, 50)); \r\n subjectsArea.setToolTipText(\"Enter subject's codes separated by semicolon ';'\");\r\n subjectsArea.setLineWrap(true);\r\n JScrollPane scroll = new JScrollPane(subjectsArea, \r\n JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);\r\n JPanel bigPanel = new JPanel(); \r\n bigPanel.setLayout(new BorderLayout());\r\n bigPanel.setPreferredSize(subjectsArea.getPreferredSize());\r\n bigPanel.add(scroll, BorderLayout.CENTER);\r\n pane.add(bigPanel);\r\n \r\n addButton.addActionListener((ActionEvent evt) -> {\r\n addButtonActionPerformed(evt);\r\n });\r\n pane.add(addButton);\r\n \r\n deleteButton.setToolTipText(\"Deletes all added subjects\");\r\n deleteButton.addActionListener((ActionEvent evt) -> {\r\n deleteButtonActionPerformed(evt);\r\n });\r\n pane.add(deleteButton);\r\n \r\n pane.setComponentOrientation(\r\n ComponentOrientation.LEFT_TO_RIGHT);\r\n }", "private void buildRow(int x, int y, int rowBricks) {\r\n\t\tfor (int i = 0; i < rowBricks; i++) {\r\n\t\t\tadd(makeBrick(x, y));\r\n\t\t\tx += BRICK_WIDTH;\r\n\t\t}\r\n\t}", "public Builder addRows(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureRowsIsMutable();\n rows_.add(value);\n onChanged();\n return this;\n }", "public void addRow (int index)\n\t{\n\t\tm_data.rows.add(index, new ArrayList<Object>());\n\t\tm_data.rowsMeta.add(index, null);\n\t}", "public IRow addToLayout(DesignGridLayout layout, int colSpan) {\n JPanel p = new JPanel();\r\n p.setLayout(new BorderLayout());\r\n//\t\tp.add(label, BorderLayout.LINE_START);\r\n p.add(txtPath, BorderLayout.CENTER);\r\n p.add(btnBrowse, BorderLayout.LINE_END);\r\n return layout.row().grid(label).add(p);\r\n }", "private void addRowToGrid(GridPane targetGrid, int rowIndex, String leftText, String rightText) {\n Label leftLabel = ViewGeneratorUtil.constructLabel(leftText, ViewStyleUtil.STYLE_TEXT_4);\n Label rightLabel = ViewGeneratorUtil.constructLabel(rightText, ViewStyleUtil.STYLE_TEXT_4);\n rightLabel.setWrapText(true);\n targetGrid.addRow(rowIndex, leftLabel, rightLabel);\n }", "public void addRow(String itemName, String itemPrice, String username) {\n LinearLayout parentLayout = findViewById(R.id.itemList);\n\n // Create layout for new item\n LinearLayout l = new LinearLayout(this);\n l.setOrientation(LinearLayout.HORIZONTAL);\n LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 100);\n layoutParams.bottomMargin = 10;\n l.setBackgroundResource(R.drawable.customborder);\n l.setLayoutParams(layoutParams);\n\n // Create item_name textview\n TextView name_textview = new TextView(this);\n name_textview.setText(itemName);\n name_textview.setTextSize(24);\n LinearLayout.LayoutParams nameParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT);\n nameParams.weight = 1;\n name_textview.setLayoutParams(nameParams);\n\n // Create price textview\n TextView price_textview = new TextView(this);\n price_textview.setText(\"$\"+itemPrice);\n price_textview.setTextSize(24);\n LinearLayout.LayoutParams priceParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT);\n priceParams.weight = 1;\n price_textview.setLayoutParams(priceParams);\n\n // Create username textview\n TextView username_textview = new TextView(this);\n username_textview.setText(username);\n username_textview.setTextSize(24);\n LinearLayout.LayoutParams usernameParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT);\n usernameParams.weight = 1;\n username_textview.setLayoutParams(usernameParams);\n\n // Add views to layout\n l.addView(name_textview);\n l.addView(price_textview);\n l.addView(username_textview);\n parentLayout.addView(l);\n\n }", "private static void addItem(IndexedContainer container, String[] propertyIds, String[] fields) {\n\t if (propertyIds.length != fields.length) {\n\t throw new IllegalArgumentException(\"Hmmm - Different number of columns to fields in the record\");\n\t }\n\t Object itemId = container.addItem();\n\t Item item = container.getItem(itemId);\n\t for (int i = 0; i < fields.length; i++) {\n\t String propertyId = propertyIds[i];\n\t String field = fields[i];\n\t item.getItemProperty(propertyId).setValue(field);\n\t }\n\t }", "public static void rowPlus() {\n\t\tnRow++;\n\t\tbuildBoard();\n\t\tfor (int c = 0; c < nCol; c++)\n\t\t\tboard[c][nRow - 1] = pItem.getItem(rnd[c][nRow - 1] = random.nextDouble());\n\t\tRightPanel.updateTextBoardInfo();\n\t}", "public final void addComponent(final T container,\n final T component, int x, double weightx) {\n addComponent(container, component, x, weightx,\n GridBagConstraints.LINE_START, GridBagConstraints.BOTH);\n }", "public void appendInOneRow(PropertyComponent... propertyComponents) {\r\n Preconditions.checkArgument(propertyComponents.length * 2 <= layout.getColumnCount() - 1, \"There is not enough room for the components to be added\");\r\n\r\n int currentColumn = DEFAULT_COMPONENT_COLUMN;\r\n for (int i = 0; i < propertyComponents.length; i++) {\r\n PropertyComponent propertyComponent = propertyComponents[i];\r\n if (i == 0) {\r\n append(null, null, propertyComponent.getComponent(), \"left,center\", currentColumn, DEFAULT_COLUMN_SPAN);\r\n } else {\r\n addComponentToRow(null, propertyComponent.getComponent(), \"left,center\", currentColumn, getRowCount(), DEFAULT_COLUMN_SPAN);\r\n }\r\n currentColumn += 2;\r\n }\r\n }", "@Override\n\tpublic void add(Component component) {\n\t\tlist.add(component);\n\t}", "public int addRow(List row) {\n\t\tdata.add(row);\n\t\tfireTableRowsInserted(data.size()-1, data.size()-1);\n\t\treturn(data.size() -1);\n\t}", "public void add(List<IShape> component)\n\t{\n\t\tfilterShapes(component);\n\t\tfilterGroups(component);\n\t}", "public void addComponent(JComponent component, int row, int col) {\n addComponent(component, row, col, C_WIDTH, C_HEIGHT, C_WEST, C_NONE);\n }", "int addAllComponents(RecordSet inputRecords);", "TableRow componentBTableRow(){\n\n TableRow componentBTableRow = new TableRow(this.context);\n int headerFieldCount = this.headerObjects.size();\n\n TableRow.LayoutParams params = new TableRow.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.MATCH_PARENT);\n// params.setMargins(-1, 0, 0, 0);\n\n for(int x=0; x<(headerFieldCount-1); x++){\n View view = headerObjects.get(x+1);\n\n componentBTableRow.addView(view, params);\n }\n\n\n return componentBTableRow;\n }", "private void addComponent(Component comp, int x, int y, int width) {\n if (comp.getClass().equals(JButton.class)) {\n gbc.fill = GridBagConstraints.HORIZONTAL;\n }\n gbc.gridx = x;\n gbc.gridy = y;\n gbc.gridwidth = width;\n frame.add(comp, gbc);\n }", "@Kroll.method\n\tpublic void appendRow(Object rows, @Kroll.argument(optional = true) KrollDict animation)\n\t{\n\t\tfinal List<TableViewRowProxy> rowList = new ArrayList<>();\n\n\t\tif (rows instanceof Object[]) {\n\n\t\t\t// Handle array of rows.\n\t\t\tfor (Object rowObj : (Object[]) rows) {\n\t\t\t\tfinal TableViewRowProxy row = processRow(rowObj);\n\n\t\t\t\tif (row != null) {\n\t\t\t\t\trowList.add(row);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfinal TableViewRowProxy row = processRow(rows);\n\n\t\t\t// Handle single row.\n\t\t\tif (row != null) {\n\t\t\t\trowList.add(row);\n\t\t\t}\n\t\t}\n\t\tif (rowList.size() == 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Prevent updating rows during iteration.\n\t\tshouldUpdate = false;\n\n\t\t// Append rows to last section.\n\t\tfor (TableViewRowProxy row : rowList) {\n\n\t\t\t// Create section if one does not exist.\n\t\t\t// Or create new section if `headerTitle` is specified.\n\t\t\tif (this.sections.size() == 0\n\t\t\t\t|| row.hasPropertyAndNotNull(TiC.PROPERTY_HEADER)\n\t\t\t\t|| row.hasPropertyAndNotNull(TiC.PROPERTY_HEADER_TITLE)\n\t\t\t) {\n\t\t\t\tfinal TableViewSectionProxy section = new TableViewSectionProxy();\n\n\t\t\t\t// Set `headerTitle` of section from row.\n\t\t\t\tsection.setProperty(TiC.PROPERTY_HEADER_TITLE,\n\t\t\t\t\trow.getProperties().optString(TiC.PROPERTY_HEADER_TITLE,\n\t\t\t\t\t\trow.getProperties().getString(TiC.PROPERTY_HEADER)));\n\n\t\t\t\tsection.setParent(this);\n\t\t\t\tthis.sections.add(section);\n\t\t\t}\n\n\t\t\t// Obtain last section.\n\t\t\tfinal TableViewSectionProxy section = this.sections.get(this.sections.size() - 1);\n\n\t\t\t// Override footer of section.\n\t\t\tsection.setProperty(TiC.PROPERTY_FOOTER_TITLE,\n\t\t\t\trow.getProperties().optString(TiC.PROPERTY_FOOTER_TITLE,\n\t\t\t\t\trow.getProperties().getString(TiC.PROPERTY_FOOTER)));\n\n\t\t\t// Add row to section.\n\t\t\tsection.add(row);\n\t\t}\n\n\t\t// Allow updating rows after iteration.\n\t\tshouldUpdate = true;\n\t\tupdate();\n\t}", "private void getRows() {\n int count = metroTileView.getChildCount();\n for (int i=0; i<count; i++) {\n LinearLayout layout = (LinearLayout) metroTileView.getChildAt(i);\n rows.add(layout);\n }\n }" ]
[ "0.69011694", "0.6869621", "0.66180265", "0.63249326", "0.63175404", "0.6175119", "0.6172397", "0.6106604", "0.60863984", "0.60273355", "0.6020524", "0.59465796", "0.5906514", "0.5905961", "0.58680195", "0.58496916", "0.58369476", "0.58348244", "0.57696766", "0.5744918", "0.5743346", "0.57383496", "0.5735452", "0.5702243", "0.5675525", "0.56689954", "0.5658887", "0.5652855", "0.5645858", "0.56442434", "0.5638326", "0.5638246", "0.5636843", "0.5620356", "0.56090456", "0.56045294", "0.5602154", "0.5601394", "0.5594314", "0.55875814", "0.5577478", "0.55697733", "0.5557392", "0.5550965", "0.5547569", "0.5529482", "0.55252", "0.5514024", "0.55018646", "0.5464236", "0.54624724", "0.54186255", "0.53916925", "0.5385264", "0.5365376", "0.53436595", "0.5340589", "0.5307127", "0.5303219", "0.52985466", "0.5289653", "0.52866364", "0.52865106", "0.5282005", "0.52677625", "0.526161", "0.5254731", "0.5249461", "0.524575", "0.5243979", "0.5241143", "0.52400327", "0.523376", "0.5229014", "0.5219423", "0.5213109", "0.5184334", "0.5184272", "0.5183346", "0.5176859", "0.515807", "0.5151744", "0.5149772", "0.5147976", "0.514717", "0.5144632", "0.5141209", "0.5139738", "0.51327926", "0.51254785", "0.51204693", "0.5104508", "0.50866455", "0.5061598", "0.5059902", "0.505965", "0.5057545", "0.5052757", "0.5051338", "0.5046468" ]
0.79799885
0
Shuts down the database. No other operations are accepted after this call.
public void shutdown() throws DatabaseAccessException { try { this.connection.close(); } catch (SQLException e) { throw new DatabaseAccessException(Failure.CONNECTION); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void shutDownDB(){\n\t\ttry\n {\n // the shutdown=true attribute shuts down Derby\n\t\t\tDriverManager.getConnection(\"jdbc:derby:\" + dbName + \";shutdown=true\");\n\n // To shut down a specific database only, but keep the\n // engine running (for example for connecting to other\n // databases), specify a database in the connection URL:\n //DriverManager.getConnection(\"jdbc:derby:\" + dbName + \";shutdown=true\");\n }\n catch (SQLException se)\n {\n if (( (se.getErrorCode() == 45000)\n && (\"08006\".equals(se.getSQLState()) ))) {\n // we got the expected exception\n System.out.println(\"Derby shut down normally\");\n // Note that for single database shutdown, the expected\n // SQL state is \"08006\", and the error code is 45000.\n } else {\n // if the error code or SQLState is different, we have\n // an unexpected exception (shutdown failed)\n System.err.println(\"Derby did not shut down normally\");\n printSQLException(se);\n }\n }\n }", "public void closeAndDeleteDB() {\n\t\tboolean gotSQLExc = false;\n\t\ttry {\n\t\t\tthis.deleteAllTable();\n\t\t\tconn.close();\n //DriverManager.getConnection(\"jdbc:derby:;shutdown=true\"); \n \n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tif (e.getSQLState().equals(\"XJ015\") ) {\t\t\n\t gotSQLExc = true;\n\t } else e.printStackTrace();\n\t\t}\n//\t\t\n//\t\tif (!gotSQLExc) {\n//\t \t System.out.println(\"Database did not shut down normally\");\n//\t } else {\n//\t System.out.println(\"Database shut down normally\");\t\n//\t }\n\t\t\n\t}", "public void shutdown() {\r\n \t\tMsg.debugMsg(DB_REGULAR.class, \"Database is shutting down\");\r\n \t\tStatement st;\r\n \t\ttry {\r\n \t\t\tst = conn.createStatement();\r\n \t\t\tst.execute(\"SHUTDOWN\");\r\n \t\t} catch (SQLException e) {\r\n \t\t\te.printStackTrace();\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\t\te.printStackTrace();\r\n \t\t\t\t} // if there are no other open connection\r\n \t\t\t}\r\n \t\t}\r\n \t}", "public void shutdown()\n\t{\n\t\ttry\n\t\t{\n\t\t\tsave();\n\t\t\tgetPreparedStatement(\"SHUTDOWN\").executeUpdate();\n\t\t\tgetConnection().close();\n\t\t} \n\t\tcatch (SQLException e)\n\t\t{\n\t\t\tm_logger.error(\"Couldn't cleanly shutdown.\", e);\n\t\t}\n\t}", "public static void shutdown(){\r\n\t//releases the connection to the dB\r\n\t\t try\r\n\t {\r\n\t if (statement != null)\r\n\t {\r\n\t statement.close();\r\n\t }\r\n\t if (connection != null)\r\n\t {\r\n\t DriverManager.getConnection(dbURL + \";shutdown=true\");\r\n\t connection.close();\r\n\t } \r\n\t }\r\n\t catch (SQLException sqle){\r\n\t //there will always be successful shutdown indicating that Derby has shutdown and that there is no connection. \r\n\t }\r\n\t}", "public static void closeDatabase() {\n if (instance != null) {\n instance.kill();\n instance = null;\n }\n }", "public void shutDown(){\n sequence128db.shutDown();\n }", "public void tearDown() throws PersistenceException, SQLException {\n if (_db.isActive()) { _db.rollback(); }\n _db.close();\n _conn.close();\n }", "@After\n public void destroyDatabase() {\n dbService.closeCurrentSession();\n dbService.getDdlInitializer()\n .cleanDB();\n }", "public void closeDB() {\n\t\ttry {\n\t\t\tconn.close();\n\t\t\tconn = null;\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(\"Failed to close database connection: \" + e);\n\t\t}\n\t}", "private static void disconnectDatabase(){\n\t\ttry{\n\t\t\tif (connection != null) connection.close();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "protected void shutdownDatabase(boolean deleteDb) {\n if (tx != null) {\n tx.success();\n tx.close();\n tx = null;\n }\n beforeShutdown();\n if (graphDb != null) {\n graphDb.shutdown();\n graphDb = null;\n }\n if (deleteDb) {\n deleteDatabase(true);\n }\n }", "private static void removeDB()\n {\n if(getStatus().equals(\"no database\"))\n return;\n\n dropTable(\"myRooms\");\n dropTable(\"myReservations\");\n }", "public void close() {\r\n closeDatabase();\r\n }", "private void closeDatabase() {\r\n try {\r\n if ( connect != null ) {\r\n connect.close();\r\n }\r\n } catch ( Exception e ) {\r\n System.err.println( \"ERROR: Could not close database connection, \" + e.getMessage() );\r\n } finally {\r\n connect = null;\r\n }\r\n }", "public void disconnectDB() {\n try {\n this.conn.close();\n } catch (SQLException e) {\n e.printStackTrace();\n } finally {\n if (this.conn != null) {\n try {\n this.conn.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n }\n }", "@Override\n public void disconnect() {\n\n // silently return if connection is closed\n if (!is_open) {\n return;\n }\n\n // close connection and statement, shutdown driver\n try {\n statement.close();\n connection.close();\n DriverManager.getConnection(\"jdbc:derby:\" + db_name + \";shutdown=true\");\n is_open = false;\n } catch (SQLException e) {\n System.out.println(\"Java DB connection did not shutdown successfully.\");\n }\n\n //System.out.println(\"Java DB connection shutdown successfully!\");\n\n }", "@After\n public void clearup() {\n try {\n pm.close();\n DriverManager.getConnection(\"jdbc:derby:memory:test_db;drop=true\");\n } catch (SQLException se) {\n if (!se.getSQLState().equals(\"08006\")) {\n // SQLState 08006 indicates a success\n se.printStackTrace();\n }\n }\n }", "public static void closeDatabase() {\n\t\ttry {\n\t\t\tif (status == OPEN_SUCCESS) {\n\t\t\t\tif (stmt != null)\n\t\t\t\t\tstmt.close();\n\t\t\t\tif (c != null)\n\t\t\t\t\tc.close();\n\t\t\t\tlogger.info(\"Closed database successfully\");\n\t\t\t} else {\n\t\t\t\tlogger.warn(\"Can not close: previous operation failed.\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tstatus = OPEN_FAILED;\n\t\t\tlogger.warn(e.getClass().getName() + \": \" + e.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public void closeDB() {\n\t\tboolean gotSQLExc = false;\n\t\ttry {\n\t\t\tconn.close();\n //DriverManager.getConnection(\"jdbc:derby:;shutdown=true\"); \n \n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tif (e.getSQLState().equals(\"XJ015\") ) {\t\t\n\t gotSQLExc = true;\n\t } else e.printStackTrace();\n\t\t}\n\t\t\n\t}", "public void close() {\n if (db.isOpen()) {\n db.close();\n }\n }", "void dropDatabase();", "public void destroy() {\n closeSqlDbConnections();\n\n\n }", "public void closeDatabase() {\n hoardDBOpenHelper.close();\n }", "public void closeDB() throws SQLException\r\n {\r\n conn.close();\r\n }", "@Override\r\n\tpublic void deleteDatabase() {\r\n\t\tlog.info(\"Enter deleteDatabase\");\r\n\r\n\t\t\r\n\t\tConnection connection = null;\t\t\r\n\t\ttry {\r\n\t\t\tconnection = jndi.getConnection(\"jdbc/libraryDB\");\t\t\r\n\t\t\t\r\n\r\n\t\t\t \r\n\t\t\t\tPreparedStatement pstmt = connection.prepareStatement(\"Drop Table Users_Table; \"); \r\n\t\t\t\tpstmt.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\tpstmt = connection.prepareStatement(\"Drop Table Cams_Table; \"); \r\n\t\t\t\tpstmt.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\tpstmt = connection.prepareStatement(\"Drop Table User_Cam_Mapping_Table; \"); \r\n\t\t\t\tpstmt.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\tpstmt = connection.prepareStatement(\"Drop Table Cam_Images_Table; \"); \r\n\t\t\t\tpstmt.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Datenbank wurde erfolgreich zurueckgesetzt!\");\t\t\t\t\r\n\t\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Fehler: \"+e.getMessage());\r\n\t\t\tlog.error(\"Error: \"+e.getMessage());\r\n\t\t} finally {\r\n\t\t\tcloseConnection(connection);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public void dbDisconnect() {\n Logger.write(\"INFO\", \"DB\", \"Disconnecting from database\");\n try {\n dbConnection.close();\n } catch(Exception e) { //Exception logged to disk, program allowed to continue\n Logger.write(\"FATAL\", \"DB\", \"Could not disconnect: \" + e.getClass().getName() + \": \" + e.getMessage() );\n }\n \n if (!Crypto.encryptDB(password))\n Logger.write(\"FATAL\", \"DB\", \"failed to encrypt database\");\n }", "public void destroy() {\n\t\ttry {\n\t\t\tdestroy(10000);\n\t\t}\n\t\tcatch(SQLException e) {}\n\t}", "public final void close() {\n\t\ttry {\n\t\t\tcon.commit( ); // Commit any updates\n\t\t\tcon.close ( );\n\t\t}\n\t\tcatch ( Exception e ) {\n\t\t\tnotify( \"Db.close\", e );\n\t\t};\n\t}", "public void disconnectFromDatabase() \r\n { \r\n if ( !connectedToDatabase ) \r\n return;\r\n \r\n try \r\n { \r\n statement.close(); \r\n connection.close(); \r\n } \r\n catch ( SQLException sqlException ) \r\n { \r\n sqlException.printStackTrace(); \r\n } \r\n finally\r\n { \r\n connectedToDatabase = false; \r\n } \r\n }", "public void desconectar() {\r\n try {\r\n conexionDB.close();\r\n } catch (SQLException e) {\r\n System.out.println(e.getMessage());\r\n }\r\n }", "void shutdown() throws SQLException;", "public void close(){\n this.db.close();\n }", "public void close() {\n\t\t\tdb.close();\n\t\t}", "public void close() {\n db.close();\n }", "public void close() {\n db.close();\n }", "public void schliessen() {\n mDb.close();\n }", "public void schliessen() {\n try {\n mDb.close();\n } catch (SQLException ex) {\n System.out.println(ex);\n }\n }", "private static void clearDB()\n {\n if(getStatus().equals(\"no database\"))\n return;\n\n clearTable(\"myRooms\");\n clearTable(\"myReservations\");\n }", "public void dropDB() throws SQLException {\n\t \t\tStatement stmt = cnx.createStatement();\n\t \t\tString[] tables = {\"account\", \"consumer\", \"transaction\"};\n\t \t\tfor (int i=0; i<3;i++) {\n\t \t\t\tString query = \"DELETE FROM \" + tables[i];\n\t \t\t\tstmt.executeUpdate(query);\n\t \t\t}\n\t \t}", "public synchronized void close() {\n\n mOpenCounter--;\n\n if(mOpenCounter == 0) {\n // Closing database\n mDatabase.close();\n }\n }", "public void shutdown()\r\n\t{\r\n\t\tgraphDb.shutdown();\r\n\t\tSystem.out.println(\"Shutdown-Done!\");\r\n\t}", "public void unsetDb()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(DB$2, 0);\r\n }\r\n }", "@Override\n\tpublic void closeDB() {\n\t\tcommonDao.closeDB();\n\t}", "@Override\n\tpublic void destroy() {\n\t\ttry {\n//\t\t\tif(stmt!=null&&!stmt.isClosed()){\n//\t\t\t\tstmt.close();\n//\t\t\t}\n\t\t\tif(conn!=null&&conn.isClosed()){\n\t\t\t\tconn.close();\n\t\t\t}\n\t\t} catch (SQLException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tsuper.destroy();\n\t}", "public void close(){\n\t\tif(tr != null && tr.inTransaction()){\n\t\t\ttr.rollback();\n\t\t}\n\t\ttry{\n\t\t\tif(db != null)\n\t\t\t\tdb.close();\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public void close() {\n closeDB();\n }", "public void destroyDatabase(){\n \n \t\t//Make sure database exist so you don't attempt to delete nothing\n \t\tmyDB = openOrCreateDatabase(dbFinance, MODE_PRIVATE, null);\n \n \t\t//Make sure database is closed before deleting; not sure if necessary\n \t\tif (myDB != null){\n \t\t\tmyDB.close();\n \t\t}\n \n \t\ttry{\n \t\t\tthis.deleteDatabase(dbFinance);\n \t\t}\n \t\tcatch(Exception e){\n \t\t\tToast.makeText(this, \"Error Deleting Database!!!\\n\\n\" + e, Toast.LENGTH_LONG).show();\n \t\t}\n \n \t\t//Navigate User back to dashboard\n \t\tIntent intentDashboard = new Intent(Options.this, Main.class);\n \t\tintentDashboard.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n \t\tstartActivity(intentDashboard);\n \n \t}", "public void desconectarBD( ) throws SQLException\r\n\t{ \r\n\t\tconexion.close( );\r\n\t\tString down = config.getProperty( \"admin.db.shutdown\" );\r\n\t\ttry\r\n\t\t{\r\n\t\t\tDriverManager.getConnection( down );\r\n\t\t}\r\n\t\tcatch( SQLException e )\r\n\t\t{\r\n\r\n\t\t}\r\n\t\tverificarInvariante();\r\n\t}", "public void close() {\n \t\tdb.close();\n \t}", "public void wipeDB() {\n\t\tSQLiteDatabase db = nodeData.getReadableDatabase();\n\t\tdb.delete(EventDataSQLHelper.TABLE, null, null);\n\t\tdb.close();\n }", "public static void dbClose(String databaseName) throws Exception {\n DataBaseConnection.closeConnection(databaseName);\n }", "@After\n\tpublic void cleanUp() {\n\t\tsuper.unload();\n\n\t\t// shutdown the database\n\t\tif (db != null) {\n\t\t\tdb.shutDownDb();\n\t\t}\n\t\tassertTrue(Files.deleteDir(tmpDir));\n\t}", "public void resetDB()\n\t{\n\t\tshutdown();\n\t\t\n\t\tif(Files.exists(m_databaseFile))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tFiles.deleteIfExists(m_databaseFile);\n\t\t\t} catch (IOException e)\n\t\t\t{\n\t\t\t}\n\t\t}\n\t\t\n\t\tloadDatabase();\n\t\tupdateCommitNumber();\n\t\tupdateDatabase();\n\t}", "@Override\n public void destroy()\n {\n if(conn != null)\n try {\n conn.close();\n } catch (SQLException ex) {\n\n }\n }", "public void close() {\n if (database != null) {\n this.database.close();\n }\n }", "public void close() {\n if (database != null) {\n this.database.close();\n }\n }", "public void close() {\n if (database != null) {\n this.database.close();\n }\n }", "public void close() {\n if (database != null) {\n this.database.close();\n }\n }", "@Override\n\tprotected void onDestroy() {\n\t\t\n\t\tsuper.onDestroy();\n\t\t\n\t\tcloseDB();\n\t}", "private void closeDB() {\n/* 29 */ Connection conn = null;\n/* 30 */ PreparedStatement pstmt = null;\n/* 31 */ ResultSet rs = null;\n/* */ \n/* */ try {\n/* 34 */ if (rs != null) rs.close(); \n/* 35 */ if (pstmt != null) pstmt.close(); \n/* 36 */ if (conn != null) conn.close(); \n/* 37 */ System.out.println(\"DB 접속 해제\");\n/* 38 */ } catch (Exception e) {\n/* 39 */ e.printStackTrace();\n/* */ } \n/* */ }", "public void destroy(){\n if(myConnection != null){\n try{\n myConnection.close();\n }\n catch(SQLException e ){\n System.out.println(e);\n }\n }\n }", "public void deleteDB() {\n File dbFile = new File(dbPath + dbName);\n if (dbFile.exists()) {\n dbFile.delete();\n }\n }", "public void close(){\n\t\tif(dbReadable != null && dbReadable.isOpen()){\n\t\t\tdbReadable.close();\n\t\t\tdbReadable = null;\n\t\t}\n\t\t\n\t\tif(dbWritable != null && dbWritable.isOpen()){\n\t\t\tdbWritable.close();\n\t\t\tdbWritable = null;\n\t\t}\n\t}", "public void CloseDB() {\n \n }", "@Override\r\n public void tearDown() throws Exception {\r\n super.tearDown();\r\n\r\n db.endTransaction();\r\n db = null;\r\n\r\n dbOpenHelper.close();\r\n dbOpenHelper = null;\r\n }", "@Override\n public void shutdown() {\n log.debug(\"Shutting down Ebean ..\");\n\n // TODO: Verificar si es necesario des-registrar el driver\n this.ebeanServer.shutdown(true, false);\n }", "public void dropDatabase(String dbName) throws Exception;", "private void deleteDatabase() {\n mOpenHelper.close();\r\n Context context = getContext();\r\n NoteDatabase.deleteDatabase(context);\r\n mOpenHelper = new NoteDatabase(getContext());\r\n }", "public static void deleteDatabase() {\n\n deleteDatabaseHelper(Paths.get(DATA_DIR));\n\n }", "@Override\n\tpublic void closeDB()\n\t{\n\n\t}", "private void close() {\n\t\t\tDB.close(m_rs, m_pstmt);\n\t\t\tm_rs = null;\n\t\t\tm_pstmt = null;\n\t\t}", "public static void shutdown() {\n getSessionFactory().close();\n }", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tdb.close();\t\r\n\t}", "private void closeConnection() { // TEMPORARILY PUBLIC\n if (db != null) {\n db.close();\n }\n }", "public void close(){\n myDB.close();\n myDataBase.close();\n }", "public void disconnect()\r\n\t{\r\n\t\tthis.database = null;\r\n\t\ttry \r\n\t\t{\r\n\t\t\tif (konekcija != null && !konekcija.isClosed())\r\n\t\t\t{\r\n\t\t\t\tConnectionClass.closeConnection();\r\n\t\t\t\tSystem.out.println(\"Konekcija zatvorena: \"+ konekcija.toString());\r\n\t\t\t}\r\n\t\t} \r\n\t\tcatch (SQLException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Test\n public void teardown() throws SQLException {\n PreparedStatement ps = con.prepareStatement(\"delete from airline.user where username = \\\"username\\\";\");\n ps.executeUpdate();\n this.con.close();\n this.con = null;\n this.userDAO = null;\n this.testUser = null;\n }", "public void shutDown() throws CouponSystemException, SQLException {\r\n\r\n\t\ttry {\r\n\t\t\tConnectionPool.getInstance().closeAllCon();\r\n\t\t} catch (CouponSystemException e) {\r\n\t\t\tCouponSystemException coupSyEx = new CouponSystemException(\"Failed to close all connections\");\r\n\t\t\tthrow coupSyEx;\r\n\t\t}\r\n\t}", "public void closeDB() {\n\t\tSQLiteDatabase db = this.getReadableDatabase();\n\t\tif (db != null && db.isOpen())\n\t\t\tdb.close();\n\t}", "public void closeDatabase(){\n mDbHelper.close();\n }", "public void close() {\n try {\n connect.close();\n } catch (SQLException ex) {\n System.err.println(\"Error while closing db connection\" + ex.toString());\n }\n }", "@After\n public void tearDown() {\n try(Connection con = DB.sql2o.open()) {\n String deleteClientsQuery = \"DELETE FROM clients *;\";\n String deleteStylistsQuery = \"DELETE FROM stylists *;\";\n con.createQuery(deleteClientsQuery).executeUpdate();\n con.createQuery(deleteStylistsQuery).executeUpdate();\n }\n }", "public void disconnect() {\n DatabaseGlobalAccess.getInstance().getEm().close();\n DatabaseGlobalAccess.getInstance().getEmf().close();\n }", "public void disconnect(){\n try {\n if(conn!=null){\n conn.close();\n System.out.println(\"Closed connection to the Database\");\n }else{\n System.out.println(\"Not closed connection to the Database\");\n }\n } catch (SQLException e) {\n System.out.println(\"ERROR, Cannot close the connection\" + e.getSQLState());\n }\n catch (NullPointerException e){\n System.out.println(\"ERROR, Not Created previous connection to the database\");\n e.getStackTrace();\n }\n }", "private void closeDB() {\n locationDBAdapter.close();\n }", "public void clearDatabase() {\n\n\t\tObjectSet<Article> articles = db.query(Article.class);\n\t\tarticles.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<CreditCard> creditCards = db.query(CreditCard.class);\n\t\tcreditCards.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<Customer> customers = db.query(Customer.class);\n\t\tcustomers.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<Order> orders = db.query(Order.class);\n\t\torders.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<OrderDetail> orderDetails = db.query(OrderDetail.class);\n\t\torderDetails.stream()\n\t\t\t.forEach(db::delete);\n\t\t\n\t\tSystem.out.println(\"\\nBase de dades esborrada per complet\");\n\t}", "protected void onExit(){\n conMgr.closeDbDriver();\n }", "@Override\n public void onDestroy() {\n super.onDestroy();\n closeDB();\n }", "public void ExitConection(){\n try {\n resultSet.close();\n preparedStatement.close();\n conection.close();\n } catch (Exception e) {\n// MessageEmergent(\"Fail ExitConection(): \"+e.getMessage());\n }\n }", "public void closeConnection() {\n\t\ttry {\n\t\t\tconn.close();\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"ERROR: cannot close connection to local database\");\n\t\t}\n\t}", "public void close()\r\n {\r\n DBHelper.close();\r\n }", "public static void disconnectDB(Connection conn){\n try {\n //STEP 6: Clean-up environment\n conn.close();\n } catch (SQLException se) {\n //Handle errors for JDBC\n se.printStackTrace();\n } catch (Exception e) {\n //Handle errors for Class.forName\n e.printStackTrace();\n } finally {\n //finally block used to close resources\n try {\n if (conn != null) {\n conn.close();\n }\n } catch (SQLException se) {\n se.printStackTrace();\n }//end finally try\n }//end try\n }", "@AfterClass\n\tpublic static void closeDataSource() throws SQLException {\n\t\tdataSource.destroy();\n\t}", "@AfterClass\n\tpublic static void closeDataSource() throws SQLException {\n\t\tdataSource.destroy();\n\t}", "public void close() {\n\t\t_dbHelper.close();\n\t}", "public void close() {\n\t\tif (this.session instanceof DatabaseSession) {\n\t\t\t((DatabaseSession) this.session).logout();\n\t\t}\n\t\tthis.session.release();\n\t}", "public void closeConnection() {\n try {\n //check if the connection is not null close it and make it null.\n if (this.dbConnection != null) {\n this.dbConnection.close();\n this.dbConnection = null;\n }\n } catch (SQLException ex) {\n System.err.println(\"Exception in closing the connection\");\n System.err.println(ex.getMessage());\n }\n }", "protected void tearDown() throws Exception {\r\n dao = null;\r\n this.closeLastJDBCConnections();\r\n super.tearDown();\r\n }", "public void closeConnection() {\n //It's important to close the connection when you are done with it\n try {\n connection.close();\n DriverManager.getConnection(JDBC_URL + \";shutdown=true\"); // shut Derby down, See: https://db.apache.org/derby/papers/DerbyTut/embedded_intro.html#shutdown\n } catch (SQLException ignore) {\n LOGGER.log(Level.SEVERE, \"Unable to close DB connection due to error {0}\", ignore.getMessage());\n\n // Alternative: Cascade the original exception (or rewrap it as a more specific exception)\n // Here, we just log it \n }\n }" ]
[ "0.77395964", "0.76746297", "0.7577482", "0.7463126", "0.7433678", "0.74199665", "0.73941076", "0.72131395", "0.7161446", "0.7104907", "0.70335245", "0.7028965", "0.69634247", "0.69485176", "0.69341993", "0.6898423", "0.68462735", "0.68272495", "0.68116623", "0.68068135", "0.6717232", "0.671553", "0.6708492", "0.66957104", "0.66501987", "0.6645276", "0.66255355", "0.6617089", "0.6597102", "0.6584548", "0.6577952", "0.6573261", "0.6568439", "0.65670455", "0.6565809", "0.6565809", "0.65544003", "0.654957", "0.65220577", "0.65179676", "0.65164024", "0.6505855", "0.65017074", "0.64927804", "0.649025", "0.64741874", "0.645967", "0.6458059", "0.64568555", "0.645011", "0.6443651", "0.6409023", "0.64066017", "0.63921505", "0.63916856", "0.63783544", "0.63783544", "0.63783544", "0.63783544", "0.6352256", "0.63395023", "0.6334604", "0.63306123", "0.6323678", "0.6319092", "0.6306474", "0.6302165", "0.6299028", "0.62787217", "0.62783605", "0.62737966", "0.62591", "0.6249853", "0.62419015", "0.6236057", "0.62246245", "0.621497", "0.6203349", "0.61778694", "0.61748284", "0.6169951", "0.6169035", "0.61638165", "0.6156023", "0.61470306", "0.6145137", "0.6140515", "0.6135283", "0.6134822", "0.6125188", "0.61149764", "0.6110961", "0.60967803", "0.6093664", "0.6093664", "0.60893863", "0.60883915", "0.6088357", "0.60880405", "0.6084123" ]
0.68540037
16
Loads the required jdbc driver
private void initDriver() throws InvalidDriverException { try { Class.forName(this.driverName); } catch (ClassNotFoundException e) { // unable to load driver; invalid throw new InvalidDriverException(Failure.DRIVER); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void loadDbDriver(){\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tLOGGER.severe(\"!EXCEPTION: \" + e.getMessage());\n\t\t}\n\t}", "private static void loadDriver() {\n\t\ttry {\n\t\t\tClass.forName(\"org.sqlite.JDBC\");\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void loadDriver() \n\t{\n\t\ttry \n\t\t{\n\t\t\t Class.forName(\"org.postgresql.Driver\");\n\t\t} \n\t\tcatch(ClassNotFoundException cnfe) \n\t\t{\n\t\t\tDBErrorHandler.handle(\"DriverLoad\");\n\t\t}\n\t}", "private void loadDriver() {\n /*\n * The JDBC driver is loaded by loading its class.\n * If you are using JDBC 4.0 (Java SE 6) or newer, JDBC drivers may\n * be automatically loaded, making this code optional.\n *\n * In an embedded environment, this will also start up the Derby\n * engine (though not any databases), since it is not already\n * running. In a client environment, the Derby engine is being run\n * by the network server framework.\n *\n * In an embedded environment, any static Derby system properties\n * must be set before loading the driver to take effect.\n */\n try {\n Class.forName(driver).newInstance();\n System.out.println(\"Loaded the appropriate driver\");\n } catch (ClassNotFoundException cnfe) {\n System.err.println(\"\\nUnable to load the JDBC driver \" + driver);\n System.err.println(\"Please check your CLASSPATH.\");\n cnfe.printStackTrace(System.err);\n } catch (InstantiationException ie) {\n System.err.println(\n \"\\nUnable to instantiate the JDBC driver \" + driver);\n ie.printStackTrace(System.err);\n } catch (IllegalAccessException iae) {\n System.err.println(\n \"\\nNot allowed to access the JDBC driver \" + driver);\n iae.printStackTrace(System.err);\n }\n }", "private static void loadDriver() {\n try {\n Class.forName(\"org.h2.Driver\");\n } catch (ClassNotFoundException e) {\n Logger.getLogger(Model.class.getName()).log(Level.WARNING, \"Unable to load H2 driver\", e);\n }\n\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n } catch (ClassNotFoundException e) {\n Logger.getLogger(Model.class.getName()).log(Level.WARNING, \"Unable to load mysql driver\", e);\n }\n }", "private static void loadDriver() {\n\t\ttry {\n\t\t\tClass.forName(\"org.postgresql.Driver\").newInstance();\n\t\t} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {\n\t\t\tSystem.err.println(\"Canít load driver. Verify CLASSPATH\");\n\t\t\tSystem.err.println(e.getMessage());\n\t\t}\n\n\t}", "private void loadDatabaseDrivers () throws ClassNotFoundException\n\t{\n\t\tClass.forName(\"nl.cwi.monetdb.jdbc.MonetDriver\");\n\t\tClass.forName(\"net.sourceforge.jtds.jdbc.Driver\");\n\t\tClass.forName(\"org.postgresql.Driver\");\n\t}", "public static void loadDBDriver() {\r\n\t\ttry {\r\n\t\t\tClass.forName(\"org.postgresql.Driver\");\r\n\t\t\tSystem.out.println(\"Success loading Driver!\");\r\n\t\t} catch (Exception exception) {\r\n\t\t\tSystem.out.println(\"Fail loading Driver!\");\r\n\t\t\texception.printStackTrace();\r\n\t\t}\r\n\t}", "protected void loadDriver() {\n try {\n Class.forName(\"org.relique.jdbc.csv.CsvDriver\");\n this.setConnection(DriverManager.getConnection(\"jdbc:relique:csv:\" + this.getDirectory()));\n this.setStatement(this.getConnection().createStatement());\n } catch (ClassNotFoundException ex) {\n ex.printStackTrace(System.out);\n System.exit(1);\n } catch (SQLException ex) {\n ex.printStackTrace(System.out);\n System.exit(1);\n }\n }", "public static Connection loadDriver() throws SQLException {\r\n try {\r\n Class.forName(Driver);\r\n } catch (ClassNotFoundException ex) {\r\n System.out.println(ex.getMessage());\r\n }\r\n con = DriverManager.getConnection(ConnectionString, user, pwd);\r\n return con;\r\n }", "public static boolean loadDriver() {\n\t\ttry {\r\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\").newInstance();\r\n\t\t\treturn true;\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(errorMesage(e));\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private boolean loadDriver() {\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n } catch(ClassNotFoundException ex) {\n Logger.getLogger(MySQLMariaDBConnector.class.getName()).log(Level.SEVERE, null, ex);\n return false;\n }\n return true;\n }", "String getJdbcDriverClassName();", "private void ucitajDrajver()throws Exception{\r\n db.loadDriver();\r\n }", "public static void init() throws ClassNotFoundException {\n Class.forName(\"com.mysql.jdbc.Driver\");\n }", "public void setJDBCDriver(Driver jdbcDriver)\n throws SQLException\n {\n DriverConfig driver;\n \n if (_driverList.size() > 0)\n driver = _driverList.get(0);\n else\n driver = createDriver();\n \n driver.setDriver(jdbcDriver);\n }", "public String getDriver() {\n return jdbcDriver;\n }", "private String discoverDriverClassName(URLClassLoader urlClassLoader) throws IOException {\n String className = null;\n URL resource = urlClassLoader.findResource(\"META-INF/services/java.sql.Driver\");\n if (resource != null) {\n BufferedReader br = null;\n try {\n br = new BufferedReader(new InputStreamReader(resource.openStream()));\n className = br.readLine();\n } finally {\n if (br != null) {\n br.close();\n }\n }\n }\n return className;\n }", "public Driver getDriver() throws SQLException {\n\n if (!loaded) {\n synchronized (driverLoadLock) {\n try {\n loadDriver();\n } catch (SQLException sqle) {\n failure = sqle;\n } catch (Exception e) {\n failure = new SQLException(\"Unable to load driver\", e);\n }\n loaded = true;\n }\n }\n\n if (failure != null) {\n throw failure;\n }\n return driver;\n }", "private void baueVerbindung() throws SQLException, ClassNotFoundException\n\t{\n\t\tClass.forName(\"com.mysql.cj.jdbc.Driver\");\n\t\tconnec = DriverManager.getConnection(url+datenbank,user,password);\n\t}", "private static void connectDatabase(){\n\t\t// register the driver\n\t\ttry{\n\t\t\tClass.forName(DRIVER).newInstance();\n\t\t\tconnection = DriverManager.getConnection(CONNECTION_URL);\n\t\t} catch (IllegalAccessException | InstantiationException | ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override\n\tpublic void connect() throws SQLException {\n if (jdbcConnection == null || jdbcConnection.isClosed()) {\n try {\n Class.forName(\"com.mysql.cj.jdbc.Driver\");\n } catch (ClassNotFoundException e) {\n throw new SQLException(e);\n }\n jdbcConnection = DriverManager.getConnection(\n jdbcURL, jdbcUsername, jdbcPassword);\n }\t\t \n\t\t\n\t}", "private void connect() throws SQLException, ClassNotFoundException,\n\t\t\tInstantiationException, IllegalAccessException {\n\t\tClass.forName(driver);\n\n\t\t// Setup the connection with the DB\n\t\tconnection = DriverManager.getConnection(url + dbName, userName,\n\t\t\t\tpassword);\n\t}", "public void conectar_bd() throws SQLException, ClassNotFoundException {\n\t\t\n\t\tClass.forName(\"com.mysql.cj.jdbc.Driver\");\n\t\tconn = DriverManager.getConnection(url, user,pass);\n\n\t}", "private static void getConnection() throws ClassNotFoundException, SQLException {\n\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\tconnection = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/yuechu\", \"root\", \"1\");\n\t}", "public static void dbConnect() throws SQLException, ClassNotFoundException {\n try {\n Class.forName(JDBC_DRIVER);\n } catch (ClassNotFoundException e) {\n System.out.println(\"Where is your MySQL JDBC Driver?\");\n e.printStackTrace();\n throw e;\n }\n\n try {\n conn = DriverManager.getConnection(url, userName, password);\n } catch (SQLException e) {\n System.out.println(\"Connection Failed! Check output console\" + e);\n e.printStackTrace();\n throw e;\n }\n }", "@Override\n public void initializeConnection() throws SQLException, ClassNotFoundException {\n \n Class.forName(\"com.mysql.jdbc.Driver\");\n //setConnection(DriverManager.getConnection(\"jdbc:mysql://localhost/rabidusDB\",\"root\",\"password\"));\n setConnection(DriverManager.getConnection( host + \":3306/\" + databaseName, user, password));\n \n }", "public void setDriver(String driver) throws BuildException {\n jdbcDriver = driver;\n }", "public String getJdbcDriver()\n {\n return getDriverDobj() == null ? \"\" : getDriverDobj().getDriver();\n }", "public static Connection fetchDBConnection() throws ClassNotFoundException,SQLException\n\t{\n\t//load type IV MySql supplies JDBC driver class, under method area(meta space)\n\t\tClass.forName(\"com.mysql.cj.jdbc.Driver\");\n\t\t//get the fix connection to DB\n\t\tString url=\"jdbc:mysql://localhost:3306/acts?useSSl=false\";\n\t\treturn DriverManager.getConnection(url, \"root\", \"manoj1997\");\n\t}", "public static void init() throws ClassNotFoundException\n {\n url = \"jdbc:derby://localhost:1527/ticket_booking\";\n username = \"nbuser\";\n password = \"nbuser\";\n\n /**\n * Links to the driver for Java DB (JDBC)\n */\n\n Class.forName(\"org.apache.derby.jdbc.ClientDriver\");\n }", "@PostConstruct\n @SuppressWarnings(\"EmptyCatchBlock\")\n public synchronized void init() {\n try {\n Driver driver = DriverManager.getDriver(URL_PREFIX);\n LOGGER.error(\"LoggingDriver already installed; removing\");\n try {\n DriverManager.deregisterDriver(driver);\n } catch (SQLException e) {\n throw new IllegalStateException(\"Unable to de-register logging JDBC driver\", e);\n }\n } catch (SQLException expected) {\n // ignore\n }\n\n try {\n DriverManager.registerDriver(this);\n } catch (SQLException e) {\n throw new IllegalStateException(\"Unable to register logging JDBC driver\", e);\n }\n }", "public String getJdbcDriver() {\n if(isJakartaNamespace()) {\n return \"jakarta.persistence.jdbc.driver\";\n }\n return \"javax.persistence.jdbc.driver\";\n }", "public static boolean loadDriver(String driverClassName) {\r\n return loadDriver(DbUtils.class.getClassLoader(), driverClassName);\r\n }", "private DbHandler()\n\t{\n\t\ttry\n\t\t{\n\t\t\t// Check if library exists\n\t\t\tClass.forName(DRIVER_CLASS);\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tIO.dbOutF(\"Failed to load the SQLite JDBC Driver.\");\n\t\t}\n\t}", "public Connection getConnection() throws SQLException, ClassNotFoundException{\n\t\t\t Class.forName(\"com.mysql.jdbc.Driver\");\n\t\t\t System.out.println(\"MySQL JDBC Driver Registered\");\n\t\t\t return connection = DriverManager.getConnection(\"jdbc:mysql://www.papademas.net:3306/510labs?\", \"db510\",\"510\");\n\t}", "public java.sql.Driver getDriver() throws SQLException\n\t{\n\t\tif (s_driver == null)\n\t\t{\n\t\t\ts_driver = new org.postgresql.Driver();\n\t\t\tDriverManager.registerDriver (s_driver);\n\t\t\tDriverManager.setLoginTimeout (Database.CONNECTION_TIMEOUT);\n\t\t}\n\t\treturn s_driver;\n\t}", "public static Connection initializeDatabase()\n throws SQLException, ClassNotFoundException\n {\n \t\n \tString dbDriver = \"com.mysql.cj.jdbc.Driver\";\n String dbURL = \"jdbc:mysql://localhost:3306/\";\n // Database name, database user and password to access\n String dbName = \"jaltantra_db\";\n String dbUsername = \"root\";\n String dbPassword = \"jaldb@2050\";\n \n Class.forName(dbDriver);\n Connection conn = DriverManager.getConnection(dbURL + dbName ,dbUsername, dbPassword);\n return conn;\n }", "public ConnexionBD() throws ClassNotFoundException, SQLException {\n\t\tClass.forName(\"com.mysql.jdbc.Driver\") ;\n\t\tconnexion = DriverManager.getConnection(dbURL,user,password) ;\n\t}", "@OnScheduled\n public void registerCalciteDriver() {\n try {\n DriverManager.registerDriver(new org.apache.calcite.jdbc.Driver());\n } catch (final SQLException e) {\n throw new ProcessException(\"Failed to load Calcite JDBC Driver\", e);\n }\n }", "@SuppressWarnings(\"unchecked\")\npublic final void initDatabase()throws SQLException {\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n con =(Connection) DriverManager.getConnection(\"jdbc:mysql://localhost:3306/yajnab?zeroDateTimeBehavior=convertToNull\",\"root\",\"11\"); \n } \n catch (ClassNotFoundException | SQLException e) {\n }\n }", "private void initialize() {\n try {\n Class.forName(\"org.postgresql.Driver\");\n } catch (ClassNotFoundException e) {\n LOGGER.error(\"DB: Unable to find sql driver.\", e);\n throw new AppRuntimeException(\"Unable to find sql driver\", e);\n }\n\n DbCred cred = getDbCred();\n this.connection = getConnection(cred);\n this.isInitialized.set(Boolean.TRUE);\n }", "private void setupDatabase()\n {\n try\n {\n Class.forName(\"com.mysql.jdbc.Driver\");\n }\n catch (ClassNotFoundException e)\n {\n simpleEconomy.getLogger().severe(\"Could not load database driver.\");\n simpleEconomy.getServer().getPluginManager().disablePlugin(simpleEconomy);\n e.printStackTrace();\n }\n\n try\n {\n connection = DriverManager\n .getConnection(String.format(\"jdbc:mysql://%s/%s?user=%s&password=%s\",\n simpleEconomy.getConfig().getString(\"db.host\"),\n simpleEconomy.getConfig().getString(\"db.database\"),\n simpleEconomy.getConfig().getString(\"db.username\"),\n simpleEconomy.getConfig().getString(\"db.password\")\n ));\n\n // Loads the ddl from the jar and commits it to the database.\n InputStream input = getClass().getResourceAsStream(\"/ddl.sql\");\n try\n {\n String s = IOUtils.toString(input);\n connection.createStatement().execute(s);\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try\n {\n input.close();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n }\n catch (SQLException e)\n {\n simpleEconomy.getLogger().severe(\"Could not connect to database.\");\n simpleEconomy.getServer().getPluginManager().disablePlugin(simpleEconomy);\n e.printStackTrace();\n }\n }", "public void setDriverDobj(JdbcDriver driver)\n {\n _driver = driver;\n }", "public Connection connect(){\n try{\n Class.forName(\"com.mysql.jdbc.Driver\");\n System.out.println(\"Berhasil koneksi ke JDBC Driver MySQL\");\n }catch(ClassNotFoundException ex){\n System.out.println(\"Tidak Berhasil Koneksi ke JDBC Driver MySQL\");\n }\n //koneksi ke data base\n try{\n String url=\"jdbc:mysql://localhost:3306/enginemounting\";\n koneksi=DriverManager.getConnection(url,\"root\",\"\");\n System.out.println(\"Berhasil koneksi ke Database\");\n }catch(SQLException e){\n System.out.println(\"Tidak Berhasil Koneksi ke Database\");\n }\n return koneksi;\n}", "public Login() throws SQLException, ClassNotFoundException {\n DriverManager.registerDriver(new com.mysql.jdbc.Driver());\n Class.forName(\"com.mysql.jdbc.Driver\");\n conn = DriverManager.getConnection(\"jdbc:mysql://localhost/adminDB\", \"root\", \"\");\n }", "public Connection getConnection() throws ClassNotFoundException, SQLException {\n logger.info(\"Create DB connection\");\n Class.forName(\"com.mysql.cj.jdbc.Driver\");\n return DriverManager.getConnection(\n \"jdbc:mysql://localhost:3306/prod\",\"root\",\"rootroot\");\n }", "public interface JdbcDrivers {\r\n\r\n\tpublic static final String DERBY_EMBEDDED = \"org.apache.derby.jdbc.EmbeddedDriver\";\r\n\tpublic static final String MYSQL = \"com.mysql.jdbc.Driver\";\r\n}", "public void openConnection(){\r\n try {\r\n Driver dr = new FabricMySQLDriver();\r\n DriverManager.registerDriver(dr);\r\n log.info(\"registrable driver\");\r\n } catch (SQLException e) {\r\n log.error(e.getMessage());\r\n e.printStackTrace();\r\n }\r\n try {\r\n connection = DriverManager.getConnection(URL, USERNAME, PASSWORD);\r\n log.info(\"get connection\");\r\n } catch (SQLException e) {\r\n log.error(e.getMessage());\r\n e.printStackTrace();\r\n }\r\n }", "public Connection getConnection() throws ClassNotFoundException, SQLException\n\t{\n\t /* Class.forName(\"org.postgresql.Driver\");*/\n\t\tcon=dataSource.getConnection();\n\t\treturn con;\t\n\t}", "private void connectToDB() {\n try {\n Class.forName(\"org.postgresql.Driver\");\n this.conn = DriverManager.getConnection(prs.getProperty(\"url\"),\n prs.getProperty(\"user\"), prs.getProperty(\"password\"));\n } catch (SQLException e1) {\n e1.printStackTrace();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n }", "public void Initialize() throws DBException {\n // Divide jndi and url\n StringTokenizer st = new StringTokenizer(m_dbURL, \",\");\n m_jndiName \t= st.nextToken();\n m_dbURL \t= st.nextToken();\n \n if (m_jndiName != null) {\n try {\n Context ctx = new InitialContext();\n s_ds = (DataSource) ctx.lookup(m_jndiName); \n } catch (Exception e) {\n System.out.println(\"err\"+e);\n SystemLog.getInstance().getErrorLog().error(\"ERR,HSQLDBTomCTRL,getInit-JNDI,\" + e, e);\n }\n }\n\t \n\t\t//\t\tLoad class incase faliure\n\t\t try {\n\t\t\tClass.forName(\"org.hsqldb.jdbcDriver\");\t\t\t\n\t\t} catch (ClassNotFoundException e1) {\t\t\t\n\t\t\te1.printStackTrace();\n\t\t}\t\t\n\t}", "void getConnectiondb() throws SQLException, ClassNotFoundException{\n // TODO code application logic here\n \n String user = \"root\";\n String pass = \"test\";\n\n myConn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/aud_jdbms\", user, pass);\n \n\n \n }", "public Connection connectdb(){\n Connection con = null;\n try {\n Class.forName(\"com.mysql.cj.jdbc.Driver\");\n con = DriverManager.getConnection(url, user, pass);\n } catch (ClassNotFoundException | SQLException ex) {\n Logger.getLogger(ILocker.class.getName()).log(Level.SEVERE, null, ex);\n }\n return con;\n }", "static Connection fetchDBConnection(String drvrClass,String url,String userName,String password) throws ClassNotFoundException,SQLException\n\t{\n\t\t//load Type IV JDBC driver\n\t\tClass.forName(drvrClass);\n\t\treturn DriverManager.getConnection(url, userName,password);\n\t}", "public static JdbcOption getDefaultDatabaseFromFile(String configFile) throws Exception {\n\t\tJdbcOption jdbc = new JdbcOption();\n\n\t\tDocument document;\n\t\tFile file = new File(configFile);\n\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\t\tfactory.setNamespaceAware(true);\n\t\tDocumentBuilder builder = factory.newDocumentBuilder();\n\t\tdocument = builder.parse(file);\n\n\t\tElement root = document.getDocumentElement();\n\n\t\tNodeList nodeList = root.getElementsByTagName(Constants.XML_TAG_DATASOURCE);\n\t\tfor (int i = 0; i < nodeList.getLength(); i++) {\n\t\t\tNode node = nodeList.item(i);\n\t\t\tNamedNodeMap attrs = node.getAttributes();\n\t\t\tString isDefault = getText(attrs, Constants.XML_TAG_DEFAULT);\n\n\t\t\tif (!\"\".equals(nullToString(isDefault)) && Boolean.valueOf(nullToString(isDefault))) {\n\t\t\t\t// isDefault 값이 null이 아니고 true인 경우 - default return\n\t\t\t\tString name = getText(attrs, Constants.XML_TAG_NAME);\n\t\t\t\tString type = getText(attrs, Constants.XML_TAG_TYPE);\n\t\t\t\tString driverJar = getText(attrs, Constants.XML_TAG_DRIVER_PATH);\n\t\t\t\tString driverClassName = getText(attrs, Constants.XML_TAG_DRIVER_CLASS_NAME);\n\t\t\t\tString url = getText(attrs, Constants.XML_TAG_URL);\n\t\t\t\tString username = getText(attrs, Constants.XML_TAG_USERNAME);\n\t\t\t\tString password = EncryptUtil.decrypt(getText(attrs, Constants.XML_TAG_PASSWORD));\n\t\t\t\tString schema = getText(attrs, Constants.XML_TAG_SCHEMA);\n\t\t\t\tString dialect = getText(attrs, Constants.XML_TAG_DIALECT);\n\t\t\t\tString driverGroupId = getText(attrs, Constants.XML_TAG_DRIVER_GROUPID);\n\t\t\t\tString driverArtifactId = getText(attrs, Constants.XML_TAG_DRIVER_ARTIFACTID);\n\t\t\t\tString driverVersion = getText(attrs, Constants.XML_TAG_DRIVER_VERSION);\n\t\t\t\tString useDbSpecific = getText(attrs, Constants.XML_TAG_USE_DB_SPECIFIC);\n\t\t\t\tString runExplainPlan = getText(attrs, Constants.XML_TAG_RUN_EXPLAIN_PLAN);\n\n\t\t\t\tjdbc.setDbName(name);\n\t\t\t\tjdbc.setDbType(type);\n\t\t\t\tjdbc.setDriverJar(driverJar);\n\t\t\t\tjdbc.setDriverClassName(driverClassName);\n\t\t\t\tjdbc.setUrl(url);\n\t\t\t\tjdbc.setUserName(username);\n\t\t\t\tjdbc.setPassword(password);\n\t\t\t\tjdbc.setSchema(schema);\n\t\t\t\tjdbc.setDialect(dialect);\n\t\t\t\tjdbc.setMvnGroupId(driverGroupId);\n\t\t\t\tjdbc.setMvnArtifactId(driverArtifactId);\n\t\t\t\tjdbc.setMvnVersion(driverVersion);\n\t\t\t\tjdbc.setUseDbSpecific(Boolean.valueOf(useDbSpecific));\n\t\t\t\tjdbc.setRunExplainPaln(Boolean.valueOf(runExplainPlan));\n\t\t\t\tjdbc.setDefault(Boolean.valueOf(isDefault));\n\t\t\t}\n\t\t}\n\t\treturn jdbc;\n\t}", "public static void initConnection() throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException{\r\n\t\t//create database connection only once\r\n\t\tif(dbCon == null){\t\r\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\r\n\t\t\tdbCon = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/wip?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC\",\"root\",\"\");\r\n\t\t}\r\n\t}", "public void loadConfiguration() {\n Properties prop = new Properties();\n String propFileName = \".env_\" + this.dbmode.name().toLowerCase();\n InputStream inputStream = getClass().getClassLoader().getResourceAsStream(propFileName);\n try {\n if (inputStream != null) {\n prop.load(inputStream);\n } else {\n System.err.println(\"property file '\" + propFileName + \"' not found in the classpath\");\n }\n this.jdbc = prop.getProperty(\"jdbc\");\n this.host = prop.getProperty(\"host\");\n this.port = prop.getProperty(\"port\");\n this.database = prop.getProperty(\"database\");\n this.user = prop.getProperty(\"user\");\n this.password = prop.getProperty(\"password\");\n // this.sslFooter = prop.getProperty(\"sslFooter\");\n } catch (Exception e) {\n System.err.println(\"can't read property file\");\n }\n try {\n inputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private SQLConnector() throws IOException, SQLException {\n\t\tProperties props = readProperties();\n\t\tString drivers = props.getProperty(\"jdbc.drivers\");\n\t\tif (drivers != null) System.setProperty(\"jdbc.drivers\", drivers);\n\t\tString url = props.getProperty(\"jdbc.url\");\n\t\tString username = props.getProperty(\"jdbc.username\");\n\t\tString password = props.getProperty(\"jdbc.password\");\n\n\t\tconnection = DriverManager.getConnection( url, username, password);\n\t}", "protected void initializeDB() {\r\n try {\r\n // Load the JDBC driver\r\n // Class.forName(\"oracle.jdbc.driver.OracleDriver\");\r\n Class.forName(\"com.mysql.jdbc.Driver \");\r\n\r\n System.out.println(\"Driver registered\");\r\n\r\n // Establish connection\r\n /*Connection conn = DriverManager.getConnection\r\n (\"jdbc:oracle:thin:@drake.armstrong.edu:1521:orcl\",\r\n \"scott\", \"tiger\"); */\r\n Connection conn = DriverManager.getConnection(\r\n \"jdbc:mysql://localhost/javabook\" , \"scott\", \"tiger\");\r\n System.out.println(\"Database connected\");\r\n\r\n // Create a prepared statement for querying DB\r\n pstmt = conn.prepareStatement(\r\n \"select * from Scores where name = ?\");\r\n }\r\n catch (Exception ex) {\r\n System.out.println(ex);\r\n }\r\n }", "public void createConnection() {\n\t\tif (path != null) {\n\t\t\ttry {\n\t\t\t\tconn = DriverManager.getConnection(path);\n\t\t\t} catch(SQLException se){\n\t\t\t //Handle errors for JDBC\n\t\t\t se.printStackTrace();\n\t\t\t }catch(Exception e){\n\t\t\t //Handle errors for Class.forName\n\t\t\t e.printStackTrace();\n\t\t\t }\n\t\t}\n\t}", "public void connect() {\n try {\n Class.forName(\"com.mysql.jdbc.Connection\");\n //characterEncoding=latin1&\n //Class.forName(\"org.apache.derby.jdbc.EmbeddedDriver\");\n //Connection conn = new Connection();\n url += \"?characterEncoding=latin1&useConfigs=maxPerformance&useSSL=false\";\n conn = DriverManager.getConnection(url, userName, password);\n if (conn != null) {\n System.out.println(\"Established connection to \"+url+\" Database\");\n }\n }\n catch(SQLException e) {\n throw new IllegalStateException(\"Cannot connect the database \"+url, e);\n }\n catch(ClassNotFoundException e) {\n e.printStackTrace();\n }\n\n }", "public static synchronized Connection getConnection() throws SQLException {\r\n if (driver == null) {\r\n try {\r\n Class jdbcDriverClass = Class.forName(DRIVER);\r\n driver = (Driver) jdbcDriverClass.newInstance();\r\n DriverManager.registerDriver(driver);\r\n } catch (Exception e) {\r\n System.out.println(\"Fallo en cargar el driver jdbc\");\r\n }\r\n }\r\n return DriverManager.getConnection(URL, USUARIO, PASS);\r\n }", "synchronized void initDataSource()\n throws SQLException\n {\n if (_isStarted)\n return;\n \n _isStarted = true;\n \n for (int i = 0; i < _driverList.size(); i++) {\n DriverConfig driver = _driverList.get(i);\n \n driver.initDataSource(_isTransactional, _isSpy);\n }\n \n try {\n if (_isTransactional && _tm == null) {\n Object obj = new InitialContext().lookup(\"java:comp/TransactionManager\");\n \n if (obj instanceof TransactionManager)\n _tm = (TransactionManager) obj;\n }\n } catch (NamingException e) {\n throw new SQLExceptionWrapper(e);\n }\n }", "private static Connection connect(String url) throws SQLException {\n\ttry {\r\n\t\tDatabaseUtil.loadDatabaseDriver(url);\r\n\t} catch (ClassNotFoundException e) {\r\n\t\tlog.error(\"Could not find JDBC driver class.\", e);\r\n\t\tthrow (SQLException) e.fillInStackTrace();\r\n\t}\r\n\r\n\t// Step 2: Establish the connection to the database.\r\n\tString username = Context.getRuntimeProperties().getProperty(\r\n\t\"connection.username\");\r\n\tString password = Context.getRuntimeProperties().getProperty(\r\n\t\"connection.password\");\r\n\tlog.debug(\"connecting to DATABASE: \" + OpenmrsConstants.DATABASE_NAME\r\n\t\t\t+ \" USERNAME: \" + username + \" URL: \" + url);\r\n\treturn DriverManager.getConnection(url, username, password);\r\n}", "private static void connect() {\n\t\ttry {\n\t\t\tif (connection == null) {\n\t\t\t\tClass.forName(\"org.mariadb.jdbc.Driver\");\n\t\t\t\tconnection = DriverManager.getConnection(url, user, password);\n\t\t\t\tconnection.setAutoCommit(false);\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\n\t\t}\n\t}", "private static void setConnection(){\n try{\n Class.forName(\"com.mysql.jdbc.Driver\");\n con = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/novel_rental\",\"root\",\"\");\n } catch (Exception e) {\n Logger.getLogger(NovelRepository.class.getName()).log(Level.SEVERE, null, e);\n System.out.println(e.getMessage());\n }\n }", "@Override\n public void connect() {\n\n //System.out.println(\"-------Embedded Java DB Connection Testing --------\");\n\n // silently return if connection is open\n if (is_open) {\n return;\n }\n\n // check for correct classpath\n try {\n Class.forName(\"org.apache.derby.jdbc.EmbeddedDriver\");\n } catch (ClassNotFoundException e) {\n System.out.println(\"Java DB Driver not found. Add the classpath to your module.\");\n e.printStackTrace();\n return;\n }\n\n //System.out.println(\"Java DB driver registered!\");\n\n // try to connect to edu.wpi.cs3733d18.teamS.database with given name\n try {\n DriverManager.registerDriver(new EmbeddedDriver());\n connection = DriverManager.getConnection(\"jdbc:derby:\" + db_name + \";create=true\");\n\n // set auto commit to false to control what is committed\n connection.setAutoCommit(false);\n\n // create a new statement\n statement = connection.createStatement();\n\n // open the connection\n is_open = true;\n } catch (SQLException e) {\n System.out.println(\"Could not connect to edu.wpi.cs3733d18.teamS.database: \" + db_name + \"\\n\" +\n e.getMessage());\n e.printStackTrace();\n }\n\n //System.out.println(\"Java DB connection established!\");\n\n }", "public void connect() throws ClassNotFoundException, SQLException {\n }", "@Override\n public void contextInitialized(ServletContextEvent servletContextEvent) {\n this.driver = new OracleDriver(); // load and instantiate the class\n boolean skipRegistration = false;\n Enumeration<Driver> drivers = DriverManager.getDrivers();\n while (drivers.hasMoreElements()) {\n Driver driver = drivers.nextElement();\n if (driver instanceof OracleDriver) {\n OracleDriver alreadyRegistered = (OracleDriver) driver;\n if (alreadyRegistered.getClass() == this.driver.getClass()) {\n // same class in the VM already registered itself\n skipRegistration = true;\n this.driver = alreadyRegistered;\n break;\n }\n }\n }\n\n try {\n if (!skipRegistration) {\n DriverManager.registerDriver(driver);\n }// else {\n// LOG.debug(\"driver was registered automatically\");\n //}\n //LOG.info(String.format(\"registered jdbc driver: %s v%d.%d\", driver,\n // driver.getMajorVersion(), driver.getMinorVersion()));\n } catch (SQLException e) {\n // LOG.error(\n// \"Error registering oracle driver: \" +\n// \"database connectivity might be unavailable!\",\n// e);\n throw new RuntimeException(e);\n }\n }", "private void initializeDriverManagerConnection(ConnectionInfo connectionInfo) {\n\n Connection connection = null;\n\n if (connectionInfo.getConnectionProperties() == null) {\n throw new DataSourceInitializationException(\"No existing context and no connection properties\");\n }\n\n if (connectionInfo.getConnectionProperties().getDriverClass() == null) {\n throw new DataSourceInitializationException(\"No jdbc driver class specified!\");\n }\n\n try {\n //initialize driver and register it with DriverManager\n Class.forName(connectionInfo.getConnectionProperties().getDriverClass());\n\n //prepare to initialize connection\n String databaseUrl = connectionInfo.getConnectionProperties().getDatabaseURL();\n String userName = connectionInfo.getConnectionProperties().getUserName();\n String userPassword = connectionInfo.getConnectionProperties().getPassword();\n int loginTimeout = connectionInfo.getConnectionProperties().getLoginTimeout();\n\n DriverManager.setLoginTimeout(loginTimeout);\n if( (userName == null || userName.length() ==0) && (userPassword == null || userPassword.length()==0) ){\n //no username or password suplied\n connection = DriverManager.getConnection(databaseUrl);\n }else{\n connection = DriverManager.getConnection(databaseUrl, userName, userPassword);\n }\n\n if(connection == null){\n throw new DataSourceInitializationException(\"Error initializing connection : null\");\n }\n\n connection.setAutoCommit(false);\n setConnection(connection);\n\n\n }catch(ClassNotFoundException cnf){\n throw new DataSourceInitializationException(\"JDBC Driver '\" + connectionInfo.getConnectionProperties().getDriverClass() + \"' not found\", cnf);\n }catch(SQLException sqle){\n throw new DataSourceInitializationException(sqle.getMessage(), sqle);\n }\n\n }", "public Connection getConnection() {\r\n try {\r\n Class.forName(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\");\r\n String url = \"jdbc:sqlserver://localhost:1433;databaseName=NMCNPM;user=sa;password=12345\";\r\n// Class.forName(resourceBundle.getString(\"driverName\"));\r\n// String url = resourceBundle.getString(\"url\");\r\n Connection connection = DriverManager.getConnection(url);\r\n return connection;\r\n } catch (SQLException | ClassNotFoundException e) {\r\n return null;\r\n }\r\n }", "private Connection getConnection()\n/* */ throws Exception\n/* */ {\n/* 1371 */ DBParamsParser dbparamsparser = null;\n/* */ try {\n/* 1373 */ Thread.sleep(3000L);\n/* 1374 */ dbparamsparser = DBParamsParser.getInstance(new File(\".\" + File.separator + \"conf\" + File.separator + \"database_params.conf\"));\n/* */ }\n/* */ catch (Exception exception) {\n/* 1377 */ exception.printStackTrace();\n/* 1378 */ return null;\n/* */ }\n/* 1380 */ String s = dbparamsparser.getURL();\n/* 1381 */ Object obj = null;\n/* 1382 */ Object obj1 = null;\n/* */ try {\n/* 1384 */ Driver driver = (Driver)Class.forName(dbparamsparser.getDriverName()).newInstance();\n/* 1385 */ Properties properties = new Properties();\n/* 1386 */ properties.put(\"user\", dbparamsparser.getUserName());\n/* 1387 */ if (dbparamsparser.getPassword() != null)\n/* */ {\n/* 1389 */ properties.put(\"password\", dbparamsparser.getPassword());\n/* */ }\n/* 1391 */ return driver.connect(s, properties);\n/* */ }\n/* */ catch (Exception exception1) {}\n/* */ \n/* 1395 */ return null;\n/* */ }", "public AccesoBD(String driver,String url, String user, String password) throws ClassNotFoundException, SQLException {\n //Class.forName(driver);\n conn = DriverManager.getConnection(url,user,password);\n stmt = conn.createStatement();\n }", "public void connect(){\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n } catch (ClassNotFoundException ex) {\n System.out.println(\"ClassNotFoundException in connect()\");\n }\n try {\n connection = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/pmt\", \"root\", \"\");\n } catch (SQLException ex) {\n System.out.println(\"SQLException in connect()\");\n }\n \n }", "public void connect()\n\t{\n\t\t//Database driver required for connection\n\t\tString jdbcDriver = \"com.mysql.jdbc.Driver\";\n\t\t\n\t\ttry\n\t\t{\n\t\t\t//Loading JDBC Driver class at run-time\n\t\t\tClass.forName(jdbcDriver);\n\t\t}\n\t\tcatch (Exception excp)\n\t\t{\n\t\t\tlog.error(\"Unexpected exception occurred while attempting user schema DB connection... \" + excp.getMessage());\n\t\t}\t\t\n\t\t\n\t\tlog.info(\"Initiating connection to user schema database \" + dbUrl + \"...\");\n\t\t\n\t\ttry\n\t\t{\n\t\t\tdbConnection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n\t\t}\n\t\tcatch (SQLException sqle)\n\t\t{\n\t\t\tdbConnection = null;\n\t\t\tlog.error(\"SQLException occurred while connecting to user schema database... \" + sqle.getMessage());\n\t\t}\n\t}", "public void buildConnect() {\n\t\ttry {\n\t\t\tClass.forName(jdbcDriver);\n\t\t\tconnection= DriverManager.getConnection(dbUrl, user, passwd);\n\t\t\tstatement= connection.createStatement();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public DbConnection() throws SQLException, ClassNotFoundException {\r\n\t\tClass.forName (DRIVER);\r\n\t\tconn = DriverManager.getConnection(CONNECTION, \"JavaDev\", \"password\");\r\n\t\tstmt = conn.createStatement();\r\n\t}", "public void connectToDB(){\n\ttry {\n\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\tconnection=DriverManager.getConnection(\"jdbc:mysql://localhost:3306/patient\",\"root\",\"7417899737\");\n\t} catch (ClassNotFoundException e) {\n\t\t\n\t\te.printStackTrace();\n\t} catch (SQLException e) {\n\t\t\n\t\te.printStackTrace();\n\t}\n\t\n}", "public void testGetDriver1() throws TelosysToolsException {\n\t\tgetDriverFromFile( TestsEnv.getTestFileAbsolutePath(\"/myfolder1/derbyclient.jar\") );\r\n\t}", "public static Connection getConnection() throws SQLException, ClassNotFoundException{\n \tClass.forName(\"com.mysql.jdbc.Driver\");\n return DriverManager.getConnection(databaseUrl, databaseUsername, databasePassword);\n }", "private boolean connect() throws ClassNotFoundException, SQLException {\r\n\r\n\t\tClass.forName(\"com.mysql.jdbc.Driver\");\r\n\r\n\t\tif (dbConnection == null || dbConnection.isClosed()) {\r\n\t\t\tdbConnection = DriverManager.getConnection(Conf.getDbPath(), Conf.getDbUser(), Conf.getDbPassword());\r\n\t\t\tif (!dbConnection.isValid(10)) {\r\n\t\t\t\tConf.setDbLog(false);\r\n\t\t\t\treturn false;\r\n\t\t\t} else\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static Connection getConnection() throws ClassNotFoundException, SQLException {\r\n\t\tString username=\"root\";\r\n\t\tString password=\"123\";\r\n\t\tClass.forName(\"com.mysql.cj.jdbc.Driver\");\r\n\t\tConnection connection = DriverManager.getConnection(\"jdbc:mysql://localhost:3308/bkdb?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC\", username, password);\r\n\t\treturn connection;\r\n\t}", "@Override\r\n public void initialize(URL url, ResourceBundle rb) {\r\n try {\r\n con = DriverManager.getConnection(\"jdbc:derby://localhost:1527/BracuConnect\", \"sayeem\", \"17101009\");\r\n } catch (SQLException e) {\r\n }\r\n }", "private void getConnection() {\r\n\r\n\t\ttry {\r\n\t\t\tClass.forName(driver);\r\n\t\t\tconn = DriverManager.getConnection(url, id, pw);\r\n\t\t\tSystem.out.println(\"[접속성공]\");\r\n\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\tSystem.out.println(\"error: 드라이버 로딩 실패 -\" + e);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(\"error:\" + e);\r\n\t\t}\r\n\r\n\t}", "@Override\r\n public void init(ServletConfig config) throws ServletException {\r\n super.init(config);\r\n\r\n try {\r\n Class.forName(\"org.postgresql.Driver\");\r\n } catch (ClassNotFoundException ex) {\r\n Logger.getLogger(ShowRoutes.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "private static void dbConnect() {\r\n\t\tif (conn == null)\r\n\t\t\ttry {\r\n\t\t\t\tconn = DriverManager.getConnection(\"jdbc:mysql://localhost/sims?user=root&password=12345&useSSL=true\");\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t}", "public void initConnection() throws DatabaseConnectionException, SQLException {\n\t\t\tString connectionString = DBMS+\"://\" + SERVER + \":\" + PORT + \"/\" + DATABASE;\n\t\t\ttry{\n\t\t\t\tClass.forName(DRIVER_CLASS_NAME).newInstance();\n\t\t\t}catch(Exception e){\n\t\t\t\tSystem.err.println(\"IMPOSSIBILE TROVARE DRIVER\");\n\t\t\t\n\t\t\t}\n\t\t\ttry{\n\t\t\t\tconn=DriverManager.getConnection(connectionString, USER_ID, PASSWORD);\n\t\t\t\t\n\t\t\t}catch(SQLException e){\n\t\t\t\tSystem.err.println(\"IMPOSSIBILE STABILIRE CONNESSIONE DATABASE\");\n\t\t\t\t\n\t\t\t}\n\t\t}", "private TestDriverImpl getTestDriver(VerboseStream stream)\n throws IOException, ClassNotFoundException, SQLException\n {\n if (null == _driver) {\n try {\n Class.forName(\"jdbc.db.TestDriverImpl\");\n }\n catch (ClassNotFoundException e) {\n stream.writeVerbose(\"Test driver class not found\");\n throw e;\n }\n \n try {\n _driver = (TestDriverImpl)DriverManager.getDriver(TestDriverImpl.TEST_URL_START);\n }\n catch (SQLException e)\n {\n stream.writeVerbose(\"Failed to get test driver\");\n throw e;\n }\n }\n\n return _driver;\n }", "public static Connection connectDB(){\n Connection conn = null; //initialize the connection\n try {\n //STEP 2: Register JDBC driver\n Class.forName(\"org.apache.derby.jdbc.ClientDriver\");\n\n //STEP 3: Open a connection\n System.out.println(\"Connecting to database...\");\n conn = DriverManager.getConnection(DB_URL);\n } catch (SQLException se) {\n //Handle errors for JDBC\n se.printStackTrace();\n } catch (Exception e) {\n //Handle errors for Class.forName\n e.printStackTrace();\n }\n return conn;\n }", "public void init(){\n\n stmt = null;\n\n try{\n\n Class.forName(\"com.mysql.jdbc.Driver\");\n myConnection=DriverManager.getConnection(DBUrl,userName,password);\n stmt=myConnection.createStatement();\n }\n catch(ClassNotFoundException | SQLException e){\n System.out.println(\"Failed to get connection\");\n }\n return;\n }", "public static Connection getConnection() throws SQLException, ClassNotFoundException{\n Class.forName(\"com.mysql.jdbc.Driver\");\n\n //STEP 3: Open a connection\n conn = DriverManager.getConnection(DB_URL,USER,PASS);\n \n return conn;\n }", "public void connectDB() {\n\t\t\tString connectionURL = \"jdbc:derby://localhost:1527/DerbyBPI;create=true\";\n\t\t //String connectionURL = \"jdbc:derby:DerbyBPI;create=true\";\n\t\t //String connectionURL = \"jdbc:derby://localhost:1527/\"+dbName+\";create=true\";\n\t\t// String connectionURL = \"jdbc:derby://ORCDatabase:1527/\"+dbName+\";create=true\";\n\n\t try {\t \n\t\t\tClass.forName(driver).newInstance(); \n\t System.out.println(driver + \" loaded. \");\n\t \n\t } catch(java.lang.ClassNotFoundException e) {\n\t System.err.print(\"ClassNotFoundException: \");\n\t System.err.println(e.getMessage());\n\t System.out.println(\"\\n >>> Please check your CLASSPATH variable <<<\\n\");\n\t } catch (InstantiationException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalAccessException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tconn = DriverManager.getConnection(connectionURL);\n\t\t\tSystem.out.println(\"******* Connected to database \" + dbName);\t \n \n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\n\t \n\t \n\t\t}", "public void initConnection() throws SQLException{\n\t\tuserCon = new UserDBHandler(\"jdbc:mysql://127.0.0.1:3306/users\", \"admin\", \"admin\");\n\t\tproductCon = new ProductDBHandler(\"jdbc:mysql://127.0.0.1:3306/products\", \"admin\", \"admin\");\n\t}", "@SuppressWarnings(\"finally\")\n\tprivate static Connection openConnection() throws SQLException\n\t{\n\t\tConnection conn = null;\n\t\ttry\n\t\t{\n\t\t\tString url = Constants.getDatabaseConnectionURL();\n\t\t\tString username = Constants.getDatabaseUserName();\n\t\t\tString password = Constants.getDatabasePassword();\t\n\t\t\tClass.forName(k_driver);\n\t\t\t\t\n\t\t\tconn = DriverManager.getConnection(url, username, password);\n\t\t\t\n\t\t\tcurrSession = conn;\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tSystem.out.println(\"Class Loader Exception!\");\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\treturn conn;\n\t\t}\n\t}", "public static void init()\n {\n try\n {\n // The newInstance() call is a work around for some broken Java implementations\n Class.forName(\"com.mysql.jdbc.Driver\").newInstance();\n\n // Create a new configuration object\n BoneCPConfig config = new BoneCPConfig();\n\n // Setup the configuration\n config.setJdbcUrl(\"jdbc:mysql://cs304.c0mk5mvcjljr.us-west-2.rds.amazonaws.com/cs304\"); // jdbc url specific to your database, eg jdbc:mysql://127.0.0.1/yourdb\n config.setUsername(\"cs304\");\n config.setPassword(\"ubccs304\");\n config.setConnectionTestStatement(\"SELECT 1\");\n config.setConnectionTimeout(10, TimeUnit.SECONDS);\n config.setMinConnectionsPerPartition(5);\n config.setMaxConnectionsPerPartition(10);\n config.setPartitionCount(1);\n\n // Setup the connection pool\n _pool = new BoneCP(config);\n\n // Log\n LogManager.getLogger(DatabasePoolManager.class).info(\"Database configuration initialized\");\n }\n catch (Exception ex)\n {\n // Log\n LogManager.getLogger(DatabasePoolManager.class).fatal(\"Could not initialize Database configuration\", ex);\n }\n\n }", "private Connection ConnectDB(){\n try{\n Class.forName(DB_driver);\n conn = DriverManager.getConnection(DB_path);\n return conn;\n }catch(ClassNotFoundException | SQLException e){\n JOptionPane.showMessageDialog(null,e);\n return null;\n }\n }", "public void conexaoL() {\n try {\n System.setProperty(\"jdbc.Drivers\", driver);\n con = DriverManager.getConnection(caminho, usuario, senha);\n //JOptionPane.showMessageDialog(null, \"Conectou\");\n } catch (SQLException ex) {\n JOptionPane.showMessageDialog(null, \"Falha ao se conectar com banco de Dados:\\n\" + ex);\n new ArquivoLog(\"...Erros 1\"+ex);\n }\n }", "public static void initialize()\n\t{\n\t\tProperties props = new Properties();\n\t\tFileInputStream in = new fileInputStream(\"database.properties\");\n\t\tprops.load(in);\n\t\tin.close();\n\t\tString drivers = props.getProperty(\"jdbc.drivers\");\n\t\tif (drivers != null)\n\t\t\tSystem.setProperty(\"jdbc.drivers\", drivers);\n\t\tString url = props.getProperty(\"jdbc.url\");\n\t\tString username = props.getProperty(\"jdbc.username\");\n\t\tString password = props.getProperty(\"jdbc.password\");\n\t\t\n\t\tSystem.out.println(\"url=\"+url+\" user=\"+username+\" password=\"+password);\n\n\t\tdbConnect = DriverManager.getConnection( url, username, password);\n\t\t\n\t\tinitializeDatabase();\n\t}", "private void connect() {\n try {\n Class.forName(\"org.sqlite.JDBC\");\n this.conn = DriverManager.getConnection(\"jdbc:sqlite:settings.db\");\n } catch (ClassNotFoundException | SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n System.exit(0);\n }\n }" ]
[ "0.77760947", "0.77297163", "0.7524254", "0.7476981", "0.73795915", "0.734371", "0.7261652", "0.71881324", "0.709627", "0.6998567", "0.6809303", "0.68021697", "0.66484696", "0.66413456", "0.6540229", "0.6433752", "0.6356116", "0.6295927", "0.62827754", "0.62730545", "0.6269995", "0.6184596", "0.61796606", "0.6171033", "0.6164001", "0.6147772", "0.6123766", "0.6098382", "0.6065611", "0.60572624", "0.60502875", "0.6049799", "0.60259247", "0.6016352", "0.59914714", "0.5935313", "0.5929768", "0.589736", "0.5896938", "0.58905077", "0.58801585", "0.5873191", "0.58620614", "0.5858589", "0.5856076", "0.5832943", "0.58268905", "0.5821564", "0.58063936", "0.5803748", "0.57886946", "0.5779484", "0.57767975", "0.5775951", "0.57680494", "0.5750529", "0.5723261", "0.5714526", "0.5713343", "0.57119805", "0.5708812", "0.57067114", "0.5689767", "0.56817317", "0.56738997", "0.567059", "0.56528676", "0.5643995", "0.56360275", "0.56323594", "0.5630966", "0.56281966", "0.5624851", "0.5623423", "0.56198215", "0.5611647", "0.55981743", "0.5596556", "0.5592901", "0.5586245", "0.55855954", "0.5581506", "0.5564335", "0.55271965", "0.55196404", "0.5516305", "0.55153096", "0.54907775", "0.5480909", "0.5480706", "0.5461569", "0.5449007", "0.54443413", "0.5441448", "0.54405344", "0.5439235", "0.5436555", "0.54327434", "0.5427987", "0.5424045" ]
0.5543653
83
Establishes a connection with the database
private void initConnection() throws DatabaseAccessException { try { this.connection = DriverManager.getConnection(this.driver + ":" + this.path); } catch (SQLException e) { // unable to create the connection; access error throw new DatabaseAccessException(Failure.CONNECTION); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void connect() {\n\n DatabaseGlobalAccess.getInstance().setEmf(Persistence.createEntityManagerFactory(\"PU_dashboarddb\"));\n DatabaseGlobalAccess.getInstance().setEm(DatabaseGlobalAccess.getInstance().getEmf().createEntityManager());\n DatabaseGlobalAccess.getInstance().getDatabaseData();\n DatabaseGlobalAccess.getInstance().setDbReachable(true);\n }", "public void connect(){\n if (connected) {\n // connection already established\n return;\n }\n // Create connection to Database\n Properties props = new Properties();\n props.setProperty(\"user\", DB_USER);\n props.setProperty(\"password\", DB_PASSWORD);\n //props.setProperty(\"ssl\", \"true\");\n //\"Connecting to database...\"\n try {\n Class.forName(\"org.postgresql.Driver\");\n String connection_string = generateURL();\n dbConnect = DriverManager.getConnection(connection_string, props);\n //\"Connection established\"\n status = \"Connection established\";\n connected = true;\n } catch (SQLException e) {\n //\"Connection failed: SQL error\"\n status = \"Connection failed: \" + e.getMessage();\n connected = false;\n } catch (Exception e) {\n //\"Connection failed: unknown error\"\n status = \"Connection failed: \" + e.getMessage();\n connected = false;\n }\n }", "private void connect() {\n if (this.connection == null && !this.connected) {\n try {\n this.connection = DriverManager.getConnection(this.dbUrl, this.dbUser, this.dbPassword);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n }", "public void connectToDatabase(){\n\t\ttry{\n\t\t connection = DriverManager.getConnection(dbConfig.getUrl(), dbConfig.getUser(), dbConfig.getPassword());\n\t\t System.out.println(\"Successfully connected to database.\");\n\t\t} catch (Exception e){\n\t\t\tSystem.out.println(\"An error occurred while attempting to connect to the database.\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "private void connectToDB() throws Exception\n\t{\n\t\tcloseConnection();\n\t\t\n\t\tcon = Env.getConnectionBradawl();\n\t}", "public void establishConnection() throws SQLException {\n if (!connectToDB(\"jdbc:mysql://localhost/EmployeesProject\")) {\n createDBAndTable();\n }\n }", "private Connection connect() {\n String url = \"jdbc:sqlite:\" + dbPath + dbName;\n Connection con = null;\n try {\n con = DriverManager.getConnection(url);\n }\n catch (SQLException e) {\n System.out.println(\"ERROR: \" + e.getMessage());\n }\n\n return con;\n }", "public void openConnection(){\n\n\t\tString dbIP = getConfig().getString(\"mysql.ip\");\n\t\tString dbDB = getConfig().getString(\"mysql.databaseName\");\n\t\tString dbUN = getConfig().getString(\"mysql.username\");\n\t\tString dbPW = getConfig().getString(\"mysql.password\");\n\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\tconnection = DriverManager.getConnection(\"jdbc:mysql://\" + dbIP + \"/\" + dbDB, dbUN, dbPW);\n\t\t\tgetLogger().info(\"Connected to databse!\");\n\t\t} catch (SQLException ex) {\n\t\t\t// handle any errors\n\t\t\tgetLogger().info(\"SQLException: \" + ex.getMessage());\n\t\t\tgetLogger().info(\"SQLState: \" + ex.getSQLState());\n\t\t\tgetLogger().info(\"VendorError: \" + ex.getErrorCode());\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tgetLogger().info(\"Gabe, you done goof'd!\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private void makeConnection() {\n try {\n InitialContext ic = new InitialContext();\n DataSource ds = (DataSource) ic.lookup(dbName);\n\n con = ds.getConnection();\n } catch (Exception ex) {\n throw new EJBException(\"Unable to connect to database. \" + ex.getMessage());\n }\n }", "private static void connect() {\n\t\ttry {\n\t\t\tif (connection == null) {\n\t\t\t\tClass.forName(\"org.mariadb.jdbc.Driver\");\n\t\t\t\tconnection = DriverManager.getConnection(url, user, password);\n\t\t\t\tconnection.setAutoCommit(false);\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\n\t\t}\n\t}", "public void DBConnect() {\n \tdatabase = new DatabaseAccess();\n \tif (database != null) {\n \t\ttry {\n \t\t\tString config = getServletContext().getInitParameter(\"dbConfig\");\n \t\t\tdatabase.GetConnectionProperties(config);\n \t\t\tdatabase.DatabaseConnect();\n \t\t}\n \t\tcatch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}\n }", "private void connectToDB() {\n try {\n Class.forName(\"org.postgresql.Driver\");\n this.conn = DriverManager.getConnection(prs.getProperty(\"url\"),\n prs.getProperty(\"user\"), prs.getProperty(\"password\"));\n } catch (SQLException e1) {\n e1.printStackTrace();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n }", "public static void establishConnection()throws IOException, SQLException {\n connection= DriverManager.getConnection(\n Configuration.fileReader(\"dbhostname\"),\n Configuration.fileReader(\"dbusername\"),\n Configuration.fileReader(\"dbpassword\"));\n statement=connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);\n }", "private static void connectDatabase(){\n\t\t// register the driver\n\t\ttry{\n\t\t\tClass.forName(DRIVER).newInstance();\n\t\t\tconnection = DriverManager.getConnection(CONNECTION_URL);\n\t\t} catch (IllegalAccessException | InstantiationException | ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public static void createConnection() {\n\n try{\n Class.forName(\"com.mysql.cj.jdbc.Driver\");\n connection = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/mydb\", \"tobymac208\", \"Sparta_!3712\");\n // Database how now been successfully connected.\n System.err.println(\"Database was successfully connected.\");\n }catch (ClassNotFoundException e) {\n System.err.println(\"Class not found.\");\n }catch (SQLException e) {\n System.err.println(\"SQL exception thrown.\");\n }\n }", "public void openConnection() throws SQLException {\n DriverManager.registerDriver(new com.mysql.jdbc.Driver());\n this.dbConnection = DriverManager.getConnection(\n this.url,\n this.username,\n this.password);\n\n this.dbConnection.setAutoCommit(false);\n this.connected = true;\n\n Logger logger = Logger.getAnonymousLogger();\n logger.log(Level.INFO, \"Database connection successful\");\n\n }", "public void connectToDb() {\n try {\n con = DriverManager.getConnection(url, user, password);\n } catch (SQLException ex) {\n JOptionPane.showMessageDialog(null, \"Erro: \" + ex.getMessage(), \"Mensagem de Erro\", JOptionPane.ERROR_MESSAGE);\n }\n\n }", "public void createConnection()\n\t{\n\t\ttry\n {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n // Get a connection\n conn = DriverManager.getConnection(dbURL, \"root\", \"root\"); \n System.out.println(\"Connected...\");\n }\n catch (Exception except)\n {\n except.printStackTrace();\n }\n\t}", "private Connection connect() throws SQLException {\n\t\treturn DriverManager.getConnection(\"jdbc:sqlite:database/scddata.db\");\n\t}", "private void openConnection() {\n try {\n dbConnection\n = DriverManager.getConnection(url, user, password);\n } catch (SQLException ex) {\n System.err.println(\"Exception in connecting to mysql database\");\n System.err.println(ex.getMessage());\n }\n }", "public static Connection establishConnection() {\n\t\tProperties props = new Properties();\n\t\tprops.setProperty(\"gssEncMode\", \"disable\");\n\t\tprops.setProperty(\"user\", \"pi\");\n\t\tprops.setProperty(\"password\", \"Bdw040795\"); // Should probably find a way to not have password in plaintext\n\t\tprops.setProperty(\"sslmode\", \"disable\");\n\t\tConnection WeatherDB;\n\t\ttry {\n\t\tWeatherDB = DriverManager.getConnection(\"jdbc:postgresql://10.0.0.100:5433/weather_app\", props);\n\t\treturn WeatherDB;\n\t\t} catch (SQLException e) {\n\t\te.printStackTrace();\n\t\tWeatherDB = null;\n\t\treturn WeatherDB;\n\t\t}\n\t}", "private Connection connect() {\n // SQLite connection string\n \tString url = \"jdbc:sqlite:DataBase/\" + database;\n Connection conn = null;\n try {\n conn = DriverManager.getConnection(url);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n return conn;\n }", "public void setupConnection()\n\t{\n\t\ttry\n\t\t{\n\t\t\tdatabaseConnection = DriverManager.getConnection(connectionString);\n\t\t}\n\t\tcatch (SQLException currentException)\n\t\t{\n\t\t\tdisplaySQLErrors(currentException);\n\t\t}\n\t}", "public void initializeConnection(){\n try{\n dbConnect = DriverManager.getConnection(DBURL, USERNAME, PASSWORD);\n } catch (SQLException ex){\n ex.printStackTrace();\n }\n }", "private Connection dbConnection() {\n\t\t\n\t\t///\n\t\t/// declare local variables\n\t\t///\n\t\t\n\t\tConnection result = null;\t// holds the resulting connection\n\t\t\n\t\t// try to make the connection\n\t\ttry {\n\t\t\tClass.forName(\"org.sqlite.JDBC\");\n\t\t\tresult = DriverManager.getConnection(CONNECTION_STRING);\n\t\t} catch (Exception ex) {\n\t\t\tSystem.out.println(ex.getMessage());\n\t\t}\n\t\t\n\t\t// return the resulting connection\n\t\treturn result;\n\t\t\n\t}", "protected void openConnection() {\n\t\ttry {\n\t\t\tconn = DriverManager.getConnection(\"jdbc:sqlite:\" + name);\n\t\t\tif (conn == null) {\n\t\t\t\tconnectionOpened = false;\n\t\t\t} else {\n\t\t\t\tconnectionOpened = true;\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"Connect problem: \" + e.getMessage());\n\t\t\tconn = null;\n\t\t}\n\t}", "public Connection createConnection() {\n Connection c = null;\n try {\n Class.forName(\"org.sqlite.JDBC\");\n c = DriverManager.getConnection(\"jdbc:sqlite:ase_i3.db\");\n } catch (Exception e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n return null;\n }\n System.out.println(\"Database connection succeed.\");\n return c;\n }", "private Connection connect_db() {\n MysqlDataSource dataSource = new MysqlDataSource();\n dataSource.setUser(db_user);\n dataSource.setPassword(db_pass);\n dataSource.setServerName(db_url);\n dataSource.setDatabaseName(db_database);\n\n Connection conn = null;\n try {\n conn = dataSource.getConnection();\n conn.setAutoCommit(false);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n return conn;\n }", "public DatabaseManager() {\n try {\n con = DriverManager.getConnection(DB_URL, \"root\", \"marko\");\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public Connection ConnectDB() throws SQLException {\r\n String db=\"jdbc:postgresql://localhost:5432/Employee\";\r\n String user=\"postgres\";\r\n String pass=\"admin\";\r\n\r\n return DriverManager.getConnection(db,user,pass);\r\n\r\n }", "public static void openConnection() {\n try {\n connection = DriverManager.getConnection(\"jdbc:oracle:thin:@localhost:1521:XE\", \"system\", \"kevin2000\");\n connection.setAutoCommit(true);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "private void openConnection () {\n\t\ttry {\n\t\t\tconnection = DriverManager.getConnection(\n\t\t\t\t\tPasswordProtector.HOST,\n\t\t\t\t\tPasswordProtector.USER,\n\t\t\t\t\tPasswordProtector.PASSWORD);\n\t\t\t} catch (SQLException e) {\n\t\t\t\tSystem.err.println(e.getMessage());\n\t\t\t}\n\t}", "private void setupDB(){\n try {\n Class.forName(\"oracle.jdbc.driver.OracleDriver\");\n String url = \"jdbc:oracle:thin:@localhost:1521:orcl\";\n String username = \"sys as sysdba\"; //Provide username for your database\n String password = \"oracle\"; //provide password for your database\n\n con = DriverManager.getConnection(url, username, password);\n }\n catch(Exception e){\n System.out.println(e);\n }\n }", "public static Connection initializeDatabase()\n throws SQLException, ClassNotFoundException\n {\n \t\n \tString dbDriver = \"com.mysql.cj.jdbc.Driver\";\n String dbURL = \"jdbc:mysql://localhost:3306/\";\n // Database name, database user and password to access\n String dbName = \"jaltantra_db\";\n String dbUsername = \"root\";\n String dbPassword = \"jaldb@2050\";\n \n Class.forName(dbDriver);\n Connection conn = DriverManager.getConnection(dbURL + dbName ,dbUsername, dbPassword);\n return conn;\n }", "void connect() {\n try {\n Class.forName(\"com.mysql.jdbc.Driver\"); // Driver is located in src/mysql-connector...\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n\n System.out.println(\"Connecting to database...\");\n\n try {\n // Make the connection\n con = DriverManager.getConnection(DB_URL, USER, PASS);\n System.out.println(\"Connection established!\");\n System.out.println(\"Creating statement...\");\n\n // Create a statement (not for output)\n st = con.createStatement();\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public void openConnection() throws Exception {\r\n configProps.load(new FileInputStream(configFilename));\r\n\r\n jSQLDriver = configProps.getProperty(\"flightservice.jdbc_driver\");\r\n jSQLUrl = configProps.getProperty(\"flightservice.url\");\r\n jSQLUser = configProps.getProperty(\"flightservice.sqlazure_username\");\r\n jSQLPassword = configProps.getProperty(\"flightservice.sqlazure_password\");\r\n\r\n /* load jdbc drivers */\r\n Class.forName(jSQLDriver).newInstance();\r\n\r\n /* open connections to the flights database */\r\n conn = DriverManager.getConnection(jSQLUrl, // database\r\n jSQLUser, // user\r\n jSQLPassword); // password\r\n\r\n conn.setAutoCommit(true); //by default automatically commit after each statement\r\n\r\n /* You will also want to appropriately set the transaction's isolation level through:\r\n conn.setTransactionIsolation(...)\r\n See Connection class' JavaDoc for details.\r\n */\r\n }", "protected void openConnection() throws SQLException {\n connection = DriverManager.getConnection(\"jdbc:mysql://stusql.dcs.shef.ac.uk/team021\", \"team021\", \"5f4306d9\");\n }", "private static Connection getConnection() throws SQLException, IOException {\n Properties properties = new Properties();\n properties.setProperty(\"user\", \"root\");\n properties.setProperty(\"password\", \"bulgariavarna\");\n\n return DriverManager.getConnection(CONNECTION_STRING + \"minions_db\", properties);\n }", "public void openConnection(){\r\n try {\r\n Driver dr = new FabricMySQLDriver();\r\n DriverManager.registerDriver(dr);\r\n log.info(\"registrable driver\");\r\n } catch (SQLException e) {\r\n log.error(e.getMessage());\r\n e.printStackTrace();\r\n }\r\n try {\r\n connection = DriverManager.getConnection(URL, USERNAME, PASSWORD);\r\n log.info(\"get connection\");\r\n } catch (SQLException e) {\r\n log.error(e.getMessage());\r\n e.printStackTrace();\r\n }\r\n }", "public Connection connect() {\n // SQLite connection string\n String url = \"jdbc:sqlite:c:/Carapaca/server/db/database.db\";\n Connection conn = null;\n try {\n conn = DriverManager.getConnection(url);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n return conn;\n }", "public void connect() {\n try {\n Class.forName(\"com.mysql.jdbc.Connection\");\n //characterEncoding=latin1&\n //Class.forName(\"org.apache.derby.jdbc.EmbeddedDriver\");\n //Connection conn = new Connection();\n url += \"?characterEncoding=latin1&useConfigs=maxPerformance&useSSL=false\";\n conn = DriverManager.getConnection(url, userName, password);\n if (conn != null) {\n System.out.println(\"Established connection to \"+url+\" Database\");\n }\n }\n catch(SQLException e) {\n throw new IllegalStateException(\"Cannot connect the database \"+url, e);\n }\n catch(ClassNotFoundException e) {\n e.printStackTrace();\n }\n\n }", "public static Connection getConnectionToDB() {\n\t\tProperties properties = getProperties();\n\n\t\ttry {\n\t\t\tmyConnection = DriverManager.getConnection(JDBC_URL, properties);\n\t\t\treturn myConnection;\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "protected static Connection connect() throws SQLException, ClassNotFoundException {\r\n String url = \"jdbc:sqlite:\" + databasePath;\r\n Connection conn;\r\n\r\n Class.forName(DRIVER);\r\n SQLiteConfig config = new SQLiteConfig();\r\n config.enforceForeignKeys(true);\r\n conn = DriverManager.getConnection(url, config.toProperties());\r\n\r\n return conn;\r\n }", "public static Connection getConnection() {\n Connection con = null;\n try {\n Class.forName(\"org.hsqldb.jdbcDriver\");\n con = DriverManager.getConnection(\n \"jdbc:hsqldb:mem:avdosdb\", \"sa\", \"\");\n } catch(Exception e) {\n e.printStackTrace();\n }\n return con;\n }", "public Connection DbConnection() throws Exception {\n Class.forName(\"com.mysql.jdbc.Driver\");\n\n // Creating a new connection\n // String myDB = \"jdbc:sqlite:C:\\\\Users\\\\kapersky\\\\Documents\\\\NetBeansProjects\\\\Library Management System\\\\src\\\\librarydb.db\";\n String myDB = \"jdbc:mysql://localhost:3306/librarydb\";\n con = DriverManager.getConnection(myDB, \"root\", \"\");\n return con;\n\n }", "public Connection getConnection() throws ClassNotFoundException, SQLException {\n logger.info(\"Create DB connection\");\n Class.forName(\"com.mysql.cj.jdbc.Driver\");\n return DriverManager.getConnection(\n \"jdbc:mysql://localhost:3306/prod\",\"root\",\"rootroot\");\n }", "private Connection openConnection() throws SQLException {\r\n\t\tConnection dbConnection = DriverManager.getConnection(databaseURL, username, password);\r\n\t\treturn dbConnection;\r\n\t}", "private static void dbConnect() {\r\n\t\tif (conn == null)\r\n\t\t\ttry {\r\n\t\t\t\tconn = DriverManager.getConnection(\"jdbc:mysql://localhost/sims?user=root&password=12345&useSSL=true\");\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t}", "public void connectToDb(){\n\t log.info(\"Fetching the database name and other details ... \");\n\t dbConnect.setDbName(properties.getProperty(\"dbName\"));\n\t dbConnect.setUsrName(properties.getProperty(\"dbUsrname\"));\n\t dbConnect.setPassword(properties.getProperty(\"dbPassword\"));\n\t dbConnect.setSQLType(properties.getProperty(\"sqlServer\").toLowerCase());\n\t log.info(\"Trying to connect to the database \"+dbConnect.getDbName()+\" ...\\n with user name \"+dbConnect.getUsrname()+\" and password ****** \");\n\t dbConnect.connectToDataBase(dbConnect.getSQLType(), dbConnect.getDbName(), dbConnect.getUsrname(), dbConnect.getPswd());\n\t log.info(\"Successfully connected to the database \"+dbConnect.getDbName());\n }", "private Connection openConnection() throws SQLException, ClassNotFoundException {\n DriverManager.registerDriver(new oracle.jdbc.OracleDriver());\n\n String host = \"localhost\";\n String port = \"1521\";\n String dbName = \"xe\"; //\"coen280\";\n String userName = \"temp\";\n String password = \"temp\";\n\n // Construct the JDBC URL \n String dbURL = \"jdbc:oracle:thin:@\" + host + \":\" + port + \":\" + dbName;\n return DriverManager.getConnection(dbURL, userName, password);\n }", "public Connection connect() throws SQLException {\n Connection connection = null;\n try {\n Class.forName(\"org.sqlite.JDBC\");\n String url = \"jdbc:sqlite:\" + dbName;\n connection = DriverManager.getConnection(url);\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n return connection;\n }", "private void connectDatabase(){\n }", "public void initConnection() throws DatabaseConnectionException, SQLException {\n\t\t\tString connectionString = DBMS+\"://\" + SERVER + \":\" + PORT + \"/\" + DATABASE;\n\t\t\ttry{\n\t\t\t\tClass.forName(DRIVER_CLASS_NAME).newInstance();\n\t\t\t}catch(Exception e){\n\t\t\t\tSystem.err.println(\"IMPOSSIBILE TROVARE DRIVER\");\n\t\t\t\n\t\t\t}\n\t\t\ttry{\n\t\t\t\tconn=DriverManager.getConnection(connectionString, USER_ID, PASSWORD);\n\t\t\t\t\n\t\t\t}catch(SQLException e){\n\t\t\t\tSystem.err.println(\"IMPOSSIBILE STABILIRE CONNESSIONE DATABASE\");\n\t\t\t\t\n\t\t\t}\n\t\t}", "public void OpenDB() {\n\t\tString JDriver = \"com.microsoft.sqlserver.jdbc.SQLServerDriver\";// 数据库驱动\n\t\tSystem.out.println(\"数据库驱动成功\");\n\t\tString connectDB = \"jdbc:sqlserver://localhost:1433;DatabaseName=bookstoreDB\";// 数据库连接\n\t\ttry {\n\t\t\tClass.forName(JDriver);// 加载数据库引擎,返回给定字符串名的类\n\t\t} catch (ClassNotFoundException e) {// e.printStackTrace();\n\t\t\tSystem.out.println(\"加载数据库引擎失败\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\ttry {\n\t\t\tconDB = DriverManager.getConnection(connectDB, \"sa\", \"123456\");// 连接数据库对象\n\t\t\tSystem.out.println(\"连接数据库成功\");\n\t\t\tstaDB = conDB.createStatement();\n\t\t} // 创建SQL命令对象\n\t\tcatch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"数据库连接错误\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "private Connection createConnection() {\n try {\n return DriverManager.getConnection(\"jdbc:mysql://\" + host + \":\" + port + \"/\" + db, user, password);\n } catch (SQLException e) {\n e.printStackTrace();\n return null;\n }\n }", "private void connect() {\n try {\n Class.forName(\"org.sqlite.JDBC\");\n this.conn = DriverManager.getConnection(\"jdbc:sqlite:settings.db\");\n } catch (ClassNotFoundException | SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n System.exit(0);\n }\n }", "public Connection connectToDb() throws Exception\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\r\n\t\t\tString url= \"jdbc:mysql://83.212.122.254:3306/travlos\";\r\n\t\t\tString username=\"travlos\";\r\n\t\t\tString password=\"travlos\";\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"found\");\r\n\t\t\t\r\n\t\t\t\r\n\t\tConnection con=null;\t\r\n\t\t\tcon=DriverManager.getConnection(url, username, password);\r\n\t\t\tStatement statement= con.createStatement();\r\n\t\t\t\r\n\t System.out.println(\"egine syndesh!\");\r\n\t return con;\r\n\t\t\r\n\t\t}\r\n\t\tcatch (SQLException ee)\r\n\t\t{\r\n\t\t\tthrow new RuntimeException(\"cannot connect the database!\", ee);\r\n\t\t}\r\n\t\r\n\t\r\n\t}", "private Connection connect() {\n\t String url = \"jdbc:sqlite:\" + this.db;\r\n\t Connection conn = null;\r\n\t try {\r\n\t \t// Incercam conexiunea la baza de date\r\n\t conn = DriverManager.getConnection(url);\r\n\t } catch (SQLException e) {\r\n\t System.out.println(e.getMessage());\r\n\t }\r\n\t return conn; // returnam conexiunea, daca aceasta s-a facut fara erori\r\n\t }", "public void openDB() {\n\n\t\t// Connect to the database\n\t\tString url = \"jdbc:mysql://localhost:2000/X__367_2020?user=X__367&password=X__367\";\n\t\t\n\t\ttry {\n\t\t\tconn = DriverManager.getConnection(url);\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"using url:\"+url);\n\t\t\tSystem.out.println(\"problem connecting to MariaDB: \"+ e.getMessage());\t\t\t\n\t\t\t//e.printStackTrace();\n\t\t}\n\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 Connection openConnection(){\n try {\n c = DriverManager.getConnection(\"jdbc:sqlite:LIB.db\");\n s = c.createStatement();\n\n System.out.println(\"Database connection open\");\n return c;\n }catch (SQLException e) {\n System.err.println(\"Opening connection failed: \" + e.getMessage());\n }\n return null;\n }", "public Connection createConnection(){\n Connection conn = null;\n registerDriver();\n createURL();\n\n try {\n conn = DriverManager.getConnection(urlDB,username,password);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n System.out.println((conn != null)?\"You made it, take control your database now!\":\"Failed to make connection!\");\n\n return conn;\n}", "public static void setUpConnection()\n\t{\n\t\ttry{\n\t\t\t//The information necessary to create a connection to the database, need to figure out what this will be\n\t\n\t\t\n\t\t\t// Register driver by finding the class that corresponds do it \n\t\t\tString driverName = \"oracle.jdbc.OracleDriver\"; \n\t\t\tClass.forName(driverName);\n\t\t\n\t\t\tconn = DriverManager.getConnection(URL, USR, PWD);\n\t\t\n\t\t\tSystem.out.println(\"Connected to C325.\");\n\t\t}catch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void apriConnessione() throws SQLException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, ClassNotFoundException {\n\t\tString password, user;\n\t\tDatabaseProps dbConf = config.getDb();\n\n\t\tClass.forName(dbConf.getDriver()).getDeclaredConstructor().newInstance();\n\n\t\tuser = dbConf.getUsername();\n\t\tpassword = dbConf.getPassword();\n\n\t\tString uri = String.format(\"jdbc:%s://%s:%d/%s\", dbConf.getDbms(), dbConf.getHost(), dbConf.getPort(), dbConf.getName());\n\n\t\tconnessioneDB = DriverManager.getConnection(uri, user, password);\n\t}", "private void setupDatabase() throws SQLException {\n\t\tdb.open(\"localhost\", 3306, \"wow\", \"greeneconomyapple\");\n\t\tdb.use(\"auctionscan\");\n\t}", "public void connectDB() {\n\t\tSystem.out.println(\"CONNECTING TO DB\");\n\t\tSystem.out.print(\"Username: \");\n\t\tusername = scan.nextLine();\n\t\tConsole console = System.console(); // Hides password input in console\n\t\tpassword = new String(console.readPassword(\"Password: \"));\n\t\ttry {\n\t\t\tDriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());\n\t\t\tconnection = DriverManager.getConnection(url, username, password);\n\t\t} catch(Exception Ex) {\n\t\t\tSystem.out.println(\"Error connecting to database. Machine Error: \" + Ex.toString());\n\t\t\tEx.printStackTrace();\n\t\t\tSystem.out.println(\"\\nCONNECTION IS REQUIRED: EXITING\");\n\t\t\tSystem.exit(0); // No need to make sure connection is closed since it wasn't made\n\t\t}\n\t}", "private void openDatabase() {\r\n if ( connect != null )\r\n return;\r\n\r\n try {\r\n // Setup the connection with the DB\r\n String host = System.getenv(\"DTF_TEST_DB_HOST\");\r\n String user = System.getenv(\"DTF_TEST_DB_USER\");\r\n String password = System.getenv(\"DTF_TEST_DB_PASSWORD\");\r\n read_only = true;\r\n if (user != null && password != null) {\r\n read_only = false;\r\n }\r\n if ( user == null || password == null ) {\r\n user = \"guest\";\r\n password = \"\";\r\n }\r\n Class.forName(\"com.mysql.jdbc.Driver\"); // required at run time only for .getConnection(): mysql-connector-java-5.1.35.jar\r\n connect = DriverManager.getConnection(\"jdbc:mysql://\"+host+\"/qa_portal?user=\"+user+\"&password=\"+password);\r\n } catch ( Exception e ) {\r\n System.err.println( \"ERROR: DescribedTemplateCore.openDatabase() could not open database connection, \" + e.getMessage() );\r\n }\r\n }", "void createConnection();", "private Database() throws SQLException {\n con = DriverManager.getConnection(\"jdbc:oracle:thin:@localhost:1521:MusicAlbums\", \"c##dba\", \"sql\");\n }", "public Connection connectdb(){\n Connection con = null;\n try {\n Class.forName(\"com.mysql.cj.jdbc.Driver\");\n con = DriverManager.getConnection(url, user, pass);\n } catch (ClassNotFoundException | SQLException ex) {\n Logger.getLogger(ILocker.class.getName()).log(Level.SEVERE, null, ex);\n }\n return con;\n }", "public static void openCon() throws ClassNotFoundException, SQLException {\r\n\t\tClass.forName(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\");\r\n\r\n\t\tconn = DriverManager.getConnection(AGlobalComponents.dbConString);\r\n\t\tif (conn != null) {\r\n\t\t\tSystem.out.println(\"Successfully: Connected to Database\");\r\n\t\t} else\r\n\t\t\tSystem.out.println(\"Connection returned null!\");\r\n\t}", "private void establishConnection() throws ClassNotFoundException, SQLException {\r\n\t \t\t\r\n\t\t\tClass.forName(\"oracle.jdbc.driver.OracleDriver\");\r\n\t String conUrl = \"jdbc:oracle:thin:@localhost:1521:XE\";\r\n\t String uname = \"system\";\r\n\t\t\tString pwd = \"sathar205\";\r\n\t con = DriverManager.getConnection(conUrl,uname,pwd);\r\n\t }", "private JDBCConnection() {\n System.out.println(\"Created JDBC Connection Object\");\n \n try {\n // Connect to JDBC data base\n connection = DriverManager.getConnection(DATABASE_URL, DATABASE_USERNAME, DATABASE_PASSWORD);\n } catch (SQLException e) {\n // If there is an error, lets just print the error\n System.err.println(e.getMessage());\n }\n }", "protected Connection createConnection() {\n Properties connectionProperties = new Properties();\n JdbcPropertyAdapter adapter = getPropertyAdapter(dbType, properties);\n adapter.getExtraProperties(connectionProperties);\n\n String url = translator.getUrl(properties);\n logger.info(\"Opening connection to: \" + url);\n Connection connection;\n try {\n connection = DriverManager.getConnection(url, connectionProperties);\n connection.setAutoCommit(false);\n } catch (SQLException x) {\n throw translator.translate(x);\n }\n return connection;\n }", "public static Connection getConnection() {\n try {\n String dbURL = \"jdbc:mysql://\" + HOST + \":3306/soccer\" ;\n Class.forName(DRIVER);\n Connection connection = DriverManager.getConnection(dbURL, USERNAME, PASSWORD);\n return connection;\n } catch (Exception e) {\n System.out.println(\"Error in Database.getConnection: \" + e.getMessage());\n return null;\n }\n }", "public static Connection getConnection() throws Exception{\r\n\t\t\tConnection dbConn = null;\r\n\t try{\r\n\t\tString url = \"jdbc:mysql://localhost:3307/durgadb\";\r\n\t\tClass.forName(\"com.mysql.cj.jdbc.Driver\");\r\n\t\tdbConn = DriverManager.getConnection(url, \"root\", \"root\");\r\n\t\t}\r\n\t catch (SQLException sqle) {\r\n\t\t sqle.printStackTrace();\r\n\t\t throw sqle;\r\n\t\t}\r\n catch(Exception e) {\r\n\t\t e.printStackTrace();\r\n\t\t throw e;\r\n\t\t}\r\n\treturn dbConn;\r\n\t}", "public static void establishConnection() {\n try {\n PropertiesLoader loader = new PropertiesLoader();\n String sshUser = loader.loadProperty().getProperty(\"sshUser\");\n String sshPassword = loader.loadProperty().getProperty(\"sshPassword\");\n String sshHost = loader.loadProperty().getProperty(\"sshHost\");\n int sshPort = Integer.parseInt(loader.loadProperty().getProperty(\"sshPort\"));\n String remoteHost = loader.loadProperty().getProperty(\"remoteHost\");\n int localPort = Integer.parseInt(loader.loadProperty().getProperty(\"localPort\"));\n int remotePort = Integer.parseInt(loader.loadProperty().getProperty(\"remotePort\"));\n\n String dbUrl = loader.loadProperty().getProperty(\"dbUrl\");\n String dbUser = loader.loadProperty().getProperty(\"dbUser\");\n String dbPassword = loader.loadProperty().getProperty(\"dbPassword\");\n\n DatabaseManager.doSshTunnel(sshUser, sshPassword, sshHost, sshPort, remoteHost, localPort, remotePort);\n connection = DriverManager.getConnection(dbUrl, dbUser, dbPassword);\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "public Connection connectDB (){\n try{\n Class.forName(\"org.sqlite.JDBC\");\n Connection conn = DriverManager.getConnection(\"jdbc:sqlite:awesomexDB.db\");\n //System.out.println(\"connection estd...\");\n return conn;\n } catch(Exception e){\n System.out.println(\"unable to connect\");\n return null;\n }\n }", "public void getConnection() throws RtpException {\n /* Create the database connection */\n try {\n conn = Connector.connect(cInfo, credentials, null);\n } catch (RtpException rtpe) {\n throw rtpe;\n } catch (Exception e) {\n throw new RtpException(\"Database Connection has failed for:\" + cInfo.toString(), e);\n }\n\n log.info(\"Database Connected Successfully. ID: {}\", conn.toString());\n }", "private void connect() {\n\t\t//\n\t\ttry {\n\t\t\tconn = DriverManager.getConnection(logInfo, user, pwd);\n\t\t\tsmt = conn.createStatement();\n\t\t\tif (conn != null) {\n\t\t\t\tSystem.out.println(\"[System:] Postgres Connection successful\");\n\t\t\t\tstatus = true;\n\t\t\t} else {\n\t\t\t\tSystem.err.println(\"Failed to make connection!\");\n\t\t\t\tstatus = false;\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(\"Connection Failed!\");\n\t\t\te.printStackTrace();\n\t\t\tstatus = false;\n\t\t}\n\t\t\n\t}", "public void connect()\n\t{\n\t\t//Database driver required for connection\n\t\tString jdbcDriver = \"com.mysql.jdbc.Driver\";\n\t\t\n\t\ttry\n\t\t{\n\t\t\t//Loading JDBC Driver class at run-time\n\t\t\tClass.forName(jdbcDriver);\n\t\t}\n\t\tcatch (Exception excp)\n\t\t{\n\t\t\tlog.error(\"Unexpected exception occurred while attempting user schema DB connection... \" + excp.getMessage());\n\t\t}\t\t\n\t\t\n\t\tlog.info(\"Initiating connection to user schema database \" + dbUrl + \"...\");\n\t\t\n\t\ttry\n\t\t{\n\t\t\tdbConnection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n\t\t}\n\t\tcatch (SQLException sqle)\n\t\t{\n\t\t\tdbConnection = null;\n\t\t\tlog.error(\"SQLException occurred while connecting to user schema database... \" + sqle.getMessage());\n\t\t}\n\t}", "@Override\r\n protected void connect() {\r\n try {\r\n this.setDatabase();\r\n } catch (SQLException e) {\r\n Log.w(NoteTraitDataSource.class.getName(), \"Error setting database.\");\r\n }\r\n }", "public static void createConnection() {\n\t\ttry {\r\n\t\t\tClass.forName(\"org.apache.derby.jdbc.EmbeddedDriver\").newInstance(); //specifies driver\r\n\t\t\t\r\n\t\t\tconn = DriverManager.getConnection(host); //Get a connection \r\n\t\t\tJOptionPane.showMessageDialog(null, \"Database Connection Successful\"); //this notifies the user that the program has sucessfully connected to the database\r\n\t\t} catch (Exception except) {\r\n\t\t\texcept.printStackTrace(); //for debugging purposes\r\n\t\t\tSystem.out.println(\"Database connection failed: \" + except.getMessage()); //for debugging purposes\r\n\t\t\tComponent frame = null; //new frame\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Database connection failed: \" + except.getMessage()); //this notifies the user that the program has not sucessfully connected to the database\r\n\t\t}\r\n\t}", "public DbConnection() throws SQLException, ClassNotFoundException {\r\n\t\tClass.forName (DRIVER);\r\n\t\tconn = DriverManager.getConnection(CONNECTION, \"JavaDev\", \"password\");\r\n\t\tstmt = conn.createStatement();\r\n\t}", "private Connection connect() {\n\t\tConnection con = null;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\n\t\t\t// Provide the correct details: DBServer/DBName, username, password\n\t\t\tcon = DriverManager.getConnection(\"jdbc:mysql://127.0.0.1:3306/paymentdb?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC\", \"root\", \"\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn con;\n\t}", "private Connection database() {\n Connection con = null;\n String db_url = \"jdbc:mysql://localhost:3306/hospitalms\";\n String db_driver = \"com.mysql.jdbc.Driver\";\n String db_username = \"root\";\n String db_password = \"\";\n \n try {\n Class.forName(db_driver);\n con = DriverManager.getConnection(db_url,db_username,db_password);\n } \n catch (SQLException | ClassNotFoundException ex) { JOptionPane.showMessageDialog(null,ex); }\n return con;\n }", "public Connection connect(){\n try{\n \n Class.forName(\"org.apache.derby.jdbc.ClientDriver\").newInstance();\n conn = DriverManager.getConnection(dbUrl, name, pass);\n System.out.println(\"connected\");\n }\n catch(Exception e){\n System.out.println(\"connection problem\");\n }\n return conn;\n }", "public static Connection connectDB(){\n Connection conn = null; //initialize the connection\n try {\n //STEP 2: Register JDBC driver\n Class.forName(\"org.apache.derby.jdbc.ClientDriver\");\n\n //STEP 3: Open a connection\n System.out.println(\"Connecting to database...\");\n conn = DriverManager.getConnection(DB_URL);\n } catch (SQLException se) {\n //Handle errors for JDBC\n se.printStackTrace();\n } catch (Exception e) {\n //Handle errors for Class.forName\n e.printStackTrace();\n }\n return conn;\n }", "private Connection getConnection() throws SQLException { //gets and returns a connection to the database at the file path specified when the object was instantiated\n return DriverManager.getConnection(\"jdbc:sqlite:\" + databasePath); //returns the connection to the specified database\n }", "public static Connection createConnection() {\n\t\treturn new FabricaDeConexoes().getConnection();\n\t}", "private void setupDatabase()\n {\n try\n {\n Class.forName(\"com.mysql.jdbc.Driver\");\n }\n catch (ClassNotFoundException e)\n {\n simpleEconomy.getLogger().severe(\"Could not load database driver.\");\n simpleEconomy.getServer().getPluginManager().disablePlugin(simpleEconomy);\n e.printStackTrace();\n }\n\n try\n {\n connection = DriverManager\n .getConnection(String.format(\"jdbc:mysql://%s/%s?user=%s&password=%s\",\n simpleEconomy.getConfig().getString(\"db.host\"),\n simpleEconomy.getConfig().getString(\"db.database\"),\n simpleEconomy.getConfig().getString(\"db.username\"),\n simpleEconomy.getConfig().getString(\"db.password\")\n ));\n\n // Loads the ddl from the jar and commits it to the database.\n InputStream input = getClass().getResourceAsStream(\"/ddl.sql\");\n try\n {\n String s = IOUtils.toString(input);\n connection.createStatement().execute(s);\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try\n {\n input.close();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n }\n catch (SQLException e)\n {\n simpleEconomy.getLogger().severe(\"Could not connect to database.\");\n simpleEconomy.getServer().getPluginManager().disablePlugin(simpleEconomy);\n e.printStackTrace();\n }\n }", "private void connect() throws SQLException, ClassNotFoundException,\n\t\t\tInstantiationException, IllegalAccessException {\n\t\tClass.forName(driver);\n\n\t\t// Setup the connection with the DB\n\t\tconnection = DriverManager.getConnection(url + dbName, userName,\n\t\t\t\tpassword);\n\t}", "public Connection getDBConnection() {\n Connection con = connectDB();\n createTables(con);\n return con;\n }", "public static Connection createDBConnection() throws ClassNotFoundException, SQLException\r\n\t{\r\n\t\tString strDbUser = properties.getProperty(\"jdbc.username\"); // database login username\r\n String strDbPassword = properties.getProperty(\"jdbc.password\"); // database login password\r\n String remoteHost = properties.getProperty(\"remote.host\"); // remote host url (ie cloud server url\t\r\n String remotePort = properties.getProperty(\"remote.port\"); // remote post number\r\n String databaseName = properties.getProperty(\"databaseName\");\r\n Connection con;\r\n \r\n System.out.println(\"Trying connection \");\r\n \r\n\t\tClass.forName(\"org.postgresql.Driver\");\r\n// \tClass.forName(\"com.mysql.jdbc.Driver\");\r\n// con = DriverManager.getConnection(\"jdbc:mysql://127.0.0.1:\"+tunnelPort+\"/cos420?user=\"+strDbUser+\"&password=\"+strDbPassword);\r\n\t\tString connectString = \"jdbc:postgresql://\" + remoteHost +\":\" + remotePort + \"/\"+databaseName; \r\n\t\tcon = DriverManager.getConnection(connectString , strDbUser,strDbPassword);\r\n\r\n \tif(!con.isClosed())\r\n System.out.println(\"Successfully connected to Postgres server using TCP/IP...\");\r\n\r\n return con;\r\n\t}", "public Connection connect(String filename) throws SQLException {\n //System.out.printf(\"Connecting to the database %s.%n\", filename);\n /* \n * Connect to the database (file). If the file does not exist, create it.\n */\n Connection db_connection = DriverManager.getConnection(SQLITEDBPATH + filename);\n //System.out.printf(\"Connection to the database has been established.%n\");\n /* \n * Get the database metadata.\n */\n DatabaseMetaData meta = db_connection.getMetaData();\n //System.out.printf(\"The driver name is %s.%n\", meta.getDriverName());\n \n return db_connection;\n }", "public Connection connect() {\n\t\t\n\n\t\ttry {\n\t\t\tconnection = DriverManager.getConnection(URL, USERNAME, PASSWORD);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"Creating connection\");\n\t\treturn connection;\n\n\t}", "public Connection openDBConnection() {\n try {\n // Load driver and link to driver manager\n Class.forName(\"oracle.jdbc.OracleDriver\");\n // Create a connection to the specified database\n Connection myConnection = DriverManager.getConnection(\"jdbc:oracle:thin:@//cscioraclesrv.ad.csbsju.edu:1521/\" +\n \"csci.cscioraclesrv.ad.csbsju.edu\",\"TEAM5\", \"mnz\");\n return myConnection;\n } catch (Exception E) {\n E.printStackTrace();\n }\n return null;\n }", "public void connect() throws NamingException, SQLException {\n if (con != null) disconnect();\n try {\n \tString url = \"jdbc:postgresql://localhost/stocksim\";\n \tProperties props = new Properties();\n props.setProperty(\"user\", \"ubuntu\");\n props.setProperty(\"password\", \"reverse\");\n con = DriverManager.getConnection(url, props);\n \n // Prepare statements:\n for (PreparedStatementID i: PreparedStatementID.values()) {\n PreparedStatement preparedStatement = con.prepareStatement(i.sql);\n _preparedStatements.put(i, preparedStatement);\n }\n } catch (SQLException e) {\n if (con != null) disconnect();\n throw e;\n }\n }", "public static Connection createConnection() throws Exception {\n \tClass.forName(DRIVER);\n \treturn DriverManager.getConnection(DBURL, USERNAME, PASSWORD); \t\n }", "public static void connect()\n {\n conn = null;\n try {\n Class.forName(\"org.postgresql.Driver\");\n conn = DriverManager.getConnection(url, user, password);\n System.out.println(\"Connected to Server Successfully.\");\n }catch(Exception e) {\n System.out.println(e.getMessage());\n }\n }" ]
[ "0.7779754", "0.76710576", "0.75907123", "0.7553362", "0.75532997", "0.7540515", "0.7519467", "0.75130993", "0.7469781", "0.7467281", "0.74406964", "0.74337405", "0.7388202", "0.7355787", "0.73447925", "0.732867", "0.73208916", "0.73151237", "0.7311713", "0.7306438", "0.7292192", "0.7279264", "0.72710997", "0.7269276", "0.72613704", "0.72506773", "0.7246502", "0.724303", "0.7242451", "0.7238125", "0.72250026", "0.71990776", "0.7197936", "0.7170197", "0.71682805", "0.71659446", "0.71631056", "0.7159405", "0.71566", "0.7140844", "0.71274334", "0.71193755", "0.71189505", "0.71119434", "0.7106557", "0.70910215", "0.7088077", "0.707616", "0.7072839", "0.7069668", "0.70643425", "0.70634013", "0.7057338", "0.7034691", "0.70316464", "0.7022793", "0.70218205", "0.70214045", "0.702001", "0.70155025", "0.70024574", "0.69983613", "0.69977367", "0.69971836", "0.6995652", "0.6992597", "0.6973575", "0.6970479", "0.6967937", "0.6965082", "0.6963249", "0.6958459", "0.69576895", "0.6957652", "0.69543886", "0.6953738", "0.6953633", "0.69534606", "0.6952086", "0.6947712", "0.69474196", "0.6941901", "0.6939403", "0.69374585", "0.69331825", "0.6926833", "0.6924084", "0.69185984", "0.6916545", "0.6915828", "0.6906706", "0.6906661", "0.6901198", "0.6901184", "0.68987924", "0.68974745", "0.6890618", "0.6887156", "0.68859977", "0.6884287" ]
0.6925689
86
Sets the SQLite specific pragmas to boost the performance
private void initConfig() throws DatabaseAccessException { Statement stmt = null; try { stmt = this.connection.createStatement(); // With synchronous OFF, SQLite continues without syncing // as soon as it has handed data off to the operating system. stmt.execute("PRAGMA synchronous = OFF;"); // The MEMORY journaling mode stores the rollback journal in volatile RAM. // This saves disk I/O but at the expense of database safety and integrity. stmt.execute("PRAGMA journal_mode = MEMORY;"); // The journal_size_limit pragma may be used to limit the size of rollback-journal. // -1 means no limit. stmt.execute("PRAGMA journal_size_limit = -1;"); // If the argument N is negative, then the number of cache pages // is adjusted to use approximately N*1024 bytes of memory. stmt.execute("PRAGMA cache_size = -50000;"); // Once an encoding has been set for a database, it cannot be changed. stmt.execute("PRAGMA encoding = \"UTF-8\";"); // When temp_store is MEMORY temporary tables and indices are kept // in as if they were pure in-memory databases memory. stmt.execute("PRAGMA temp_store = MEMORY;"); stmt.close(); } catch (SQLException e) { throw new DatabaseAccessException(Failure.CONFIG); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPragma(String pragma)\r\n/* 299: */ {\r\n/* 300:450 */ set(\"Pragma\", pragma);\r\n/* 301: */ }", "private void m145783m() {\n if (this.f119478k) {\n mo115433a(\"PRAGMA query_only = 1\", null, null);\n }\n }", "public PragmaAnnotation() {\n super();\n }", "public String getPragma()\r\n/* 304: */ {\r\n/* 305:458 */ return getFirst(\"Pragma\");\r\n/* 306: */ }", "public static void setFullSql(boolean flag) {\r\n fullSql = flag;\r\n }", "@Override\npublic void onConfigure( final SQLiteDatabase db ){\n\tsuper.onConfigure( db );\n\n\tdb.disableWriteAheadLogging();\n}", "private void setScriptFormatCorrectly()\n\t{\n\t\tint scriptFormatNeeded = 0;\n\t\tif(isMime(m_databaseFile, GZIP_MAGIC_NUMBERS))\n\t\t{\n\t\t\tm_logger.debug(\"Database is gzipped\");\n\t\t\tscriptFormatNeeded = 3;\n\t\t}\n\t\t\n\t\tboolean propsExists = Files.exists(m_databasePropertiesFile);\n\t\t\n\t\tProperties properties = new Properties();\n\t\ttry {\n\t\t properties.load(new FileInputStream(m_databasePropertiesFile.toFile()));\n\t\t} catch (IOException e) {\n\t\t}\n\t\t\n\t\tproperties.setProperty(\"hsqldb.script_format\", \"\" + scriptFormatNeeded);\n\t\tif(! propsExists) // write other info\n\t\t{\n\t\t\tproperties.setProperty(\"version\",\"2.2.8\");\n\t\t\tproperties.setProperty(\"modified\", \"yes\");\n\t\t}\n\t\t\n\t\t// Write properties file.\n\t\ttry {\n\t\t properties.store(new FileOutputStream(m_databasePropertiesFile.toFile()), null);\n\t\t} catch (IOException e) {\n\t\t}\n\t\t\n\t}", "public PragmaAnnotation(String pragma) {\n super();\n put(\"pragma\", pragma);\n }", "@Override\n public Options prepareForBulkLoad() {\n dbOptions.setMaxBackgroundFlushes(4);\n columnFamilyOptions.setDisableAutoCompactions(true);\n columnFamilyOptions.setLevel0FileNumCompactionTrigger(1 << 30);\n columnFamilyOptions.setLevel0SlowdownWritesTrigger(1 << 30);\n columnFamilyOptions.setLevel0StopWritesTrigger(1 << 30);\n return this;\n }", "public String toString() {\n if (skip_print) {\n return \"\";\n }\n String ret = \"#pragma \";\n String pragma = get(\"pragma\");\n if (pragma != null) {\n ret += pragma + \" \";\n }\n if (this.getClass() == PragmaAnnotation.class) { // pure pragma printing\n for (String key : keySet()) {\n if (!key.equals(\"pragma\")) {\n ret += key + \" \" + get(key) + \" \";\n }\n }\n }\n return ret;\n }", "private void m145781k() {\n int i = this.f119477j.f119583i;\n StringBuilder sb = new StringBuilder(\"PRAGMA synchronous=\");\n sb.append(i);\n mo115433a(sb.toString(), null, null);\n }", "private void ini_CacheDB()\r\n\t{\r\n\t\tLogger.DEBUG(\"ini_CacheDB\");\r\n\t\t// chk if exist filter preset splitter \"#\" and Replace\r\n\r\n\t}", "public Cursor pragma(String table_name) {\n SQLiteDatabase db = mydbHelper.getWritableDatabase();\n return db.rawQuery(\"PRAGMA table_info(\" + table_name + \")\", null);\n }", "public static boolean Pragma(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"Pragma\")) return false;\n if (!nextTokenIs(b, PRAGMA_BEGIN)) return false;\n boolean r, p;\n Marker m = enter_section_(b, l, _NONE_, PRAGMA, null);\n r = consumeToken(b, PRAGMA_BEGIN);\n p = r; // pin = 1\n r = r && report_error_(b, Pragma_1(b, l + 1));\n r = p && report_error_(b, EQName(b, l + 1)) && r;\n r = p && report_error_(b, Pragma_3(b, l + 1)) && r;\n r = p && consumeToken(b, PRAGMA_END) && r;\n exit_section_(b, l, m, r, p, null);\n return r || p;\n }", "protected String preprocessSQL(String sql, QueryParameters parameters, Dialect dialect)\n \t\t\tthrows HibernateException {\n \n \t\tsql = applyLocks( sql, parameters.getLockOptions(), dialect );\n \n \t\treturn getFactory().getSettings().isCommentsEnabled() ?\n \t\t\t\tprependComment( sql, parameters ) : sql;\n \t}", "void setInitSql(String value);", "private void applyDatabasePerformanceOptions() throws SQLException, SoarException, IOException\n {\n // cache\n if(params.driver.get().equals(\"org.sqlite.JDBC\"))\n {\n // TODO: Generalize this. Move to a resource somehow.\n final long cacheSize = params.cache_size.get();\n \n try(Statement s = db.getConnection().createStatement())\n {\n s.execute(\"PRAGMA cache_size = \" + cacheSize);\n }\n }\n \n // optimization\n if(params.optimization.get() == Optimization.performance)\n {\n // If /org/jsoar/kernel/smem/<driver>.performance.sql is found on\n // the class path, execute the statements in it.\n final String perfResource = params.driver.get() + \".performance.sql\";\n final String fullPath = \"/\" + getClass().getCanonicalName().replace('.', '/') + \"/\" + perfResource;\n \n LOG.info(\"Applying performance settings from '{}'.\", fullPath);\n try(InputStream perfStream = getClass().getResourceAsStream(perfResource);)\n {\n if(perfStream != null)\n {\n JdbcTools.executeSql(db.getConnection(), perfStream, null /*\n * no\n * filter\n */);\n }\n else\n {\n LOG.warn(\"Could not find performance resource at '{}'. No performance settings applied.\", fullPath);\n }\n }\n }\n \n // page_size\n if(params.driver.get().equals(\"org.sqlite.JDBC\"))\n {\n final PageChoices pageSize = params.page_size.get();\n \n long pageSizeLong = 0;\n \n switch(pageSize)\n {\n case page_16k:\n pageSizeLong = 16 * 1024;\n break;\n case page_1k:\n pageSizeLong = 1 * 1024;\n break;\n case page_2k:\n pageSizeLong = 2 * 1024;\n break;\n case page_32k:\n pageSizeLong = 32 * 1024;\n break;\n case page_4k:\n pageSizeLong = 4 * 1024;\n break;\n case page_64k:\n pageSizeLong = 64 * 1024;\n break;\n case page_8k:\n pageSizeLong = 8 * 1024;\n break;\n default:\n break;\n }\n \n try(Statement s = db.getConnection().createStatement())\n {\n s.execute(\"PRAGMA page_size = \" + pageSizeLong);\n }\n }\n }", "String getInitSql();", "@Override\n public int getDatabaseMajorVersion() {\n return 1;\n }", "String getPostDeclareSql();", "private void upgradeDatabaseFrom3To4(SQLiteDatabase db) {\n db.execSQL(\"UPDATE OR IGNORE fields SET flags = \" + Field.TYPE_COUNTED_STRING_DISCRETE +\n \" WHERE measurement IN (SELECT id FROM measurements WHERE name = 'org.mozilla.searches.counts')\");\n }", "private void initClauses() {\n if (!mIsInitialized) {\n if (ConnectionUtil.getDBProductID() == ConnectionUtil.DB_ORACLE ||\n ConnectionUtil.getDBProductID() == ConnectionUtil.DB_MYSQL) {\n mForUpdateClause = \" FOR UPDATE \";\n } else if (ConnectionUtil.getDBProductID() == ConnectionUtil.DB_SQLSERVER) {\n mWithClause = \" WITH (ROWLOCK, UPDLOCK) \";\n }\n mIsInitialized = true;\n }\n\n }", "public T casePragmaDirective(PragmaDirective object)\n\t{\n\t\treturn null;\n\t}", "private void setSql() {\n sql = sqlData.getSql();\n }", "private void setQuerySQL(Settings set) {\n SEARCH_DATA_BASE = set.getValue(\"sql.searchDataBase\");\n CREATE_DATA_BASE = set.getValue(\"sql.createDataBase\");\n SEARCH_TABLE_VACANCY = set.getValue(\"sql.searchTableVacancy\");\n CREATE_TABLE_VACANCY = set.getValue(\"sql.createTableVacancy\");\n ADD_VACANCY = set.getValue(\"sql.addVacancy\");\n COUNT = set.getValue(\"sql.count\");\n MAX_DATE = set.getValue(\"sql.maxDate\");\n }", "private boolean includePrimaryKeyColumns() {\n\t\treturn false;\r\n\t}", "private void m145773d(String str) {\n String c = mo115440c(\"PRAGMA journal_mode\", null, null);\n if (!c.equalsIgnoreCase(str)) {\n try {\n StringBuilder sb = new StringBuilder(\"PRAGMA journal_mode=\");\n sb.append(str);\n if (mo115440c(sb.toString(), null, null).equalsIgnoreCase(str)) {\n return;\n }\n } catch (SQLiteDatabaseLockedException unused) {\n }\n StringBuilder sb2 = new StringBuilder(\"Could not change the database journal mode of '\");\n sb2.append(this.f119477j.f119576b);\n sb2.append(\"' from '\");\n sb2.append(c);\n sb2.append(\"' to '\");\n sb2.append(str);\n sb2.append(\"' because the database is locked. This usually means that there are other open connections to the database which prevents the database from enabling or disabling write-ahead logging mode. Proceeding without changing the journal mode.\");\n Log.m146012b(\"WCDB.SQLiteConnection\", sb2.toString());\n }\n }", "public static void setDebug(boolean db) {\n\n\t\tdebug = db;\n\n\t}", "public boolean isUseStrict()\n {\n return (isPragma() && getModule().toKeyword().isStrictKeyword());\n }", "@Override\n public void noteConfiguration() {\n preprocessBean = new KeepColumnPreProcessorBean();\n super.noteConfiguration();\n }", "void enableFastLatin() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00eb in method: android.icu.impl.coll.CollationDataBuilder.enableFastLatin():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.icu.impl.coll.CollationDataBuilder.enableFastLatin():void\");\n }", "private void m145782l() {\n this.f119477j.f119578d |= 16;\n if ((this.f119477j.f119578d & 16) == 0) {\n String locale = this.f119477j.f119580f.toString();\n nativeRegisterLocalizedCollators(this.f119482o, locale);\n if (!this.f119478k) {\n try {\n mo115433a(\"CREATE TABLE IF NOT EXISTS android_metadata (locale TEXT)\", null, null);\n String c = mo115440c(\"SELECT locale FROM android_metadata UNION SELECT NULL ORDER BY locale DESC LIMIT 1\", null, null);\n if (c == null || !c.equals(locale)) {\n mo115433a(\"BEGIN\", null, null);\n mo115433a(\"DELETE FROM android_metadata\", null, null);\n mo115433a(\"INSERT INTO android_metadata (locale) VALUES(?)\", new Object[]{locale}, null);\n mo115433a(\"REINDEX LOCALIZED\", null, null);\n mo115433a(\"COMMIT\", null, null);\n }\n } catch (RuntimeException e) {\n StringBuilder sb = new StringBuilder(\"Failed to change locale for db '\");\n sb.append(this.f119477j.f119576b);\n sb.append(\"' to '\");\n sb.append(locale);\n sb.append(\"'.\");\n throw new SQLiteException(sb.toString(), e);\n } catch (Throwable th) {\n mo115433a(\"ROLLBACK\", null, null);\n throw th;\n }\n }\n }\n }", "String getStartTransactionSql();", "@Converted(kind = Converted.Kind.MANUAL_COMPILATION,\n source = \"${LLVM_SRC}/llvm/tools/clang/lib/Parse/ParsePragma.cpp\", line = 2078,\n FQN=\"(anonymous namespace)::PragmaUnrollHintHandler::HandlePragma\", NM=\"_ZN12_GLOBAL__N_123PragmaUnrollHintHandler12HandlePragmaERN5clang12PreprocessorENS1_20PragmaIntroducerKindERNS1_5TokenE\",\n cmd=\"jclank.sh -java-options=${SPUTNIK}/modules/org.clang.parse/llvmToClangType ${LLVM_SRC}/llvm/tools/clang/lib/Parse/ParsePragma.cpp -nm=_ZN12_GLOBAL__N_123PragmaUnrollHintHandler12HandlePragmaERN5clang12PreprocessorENS1_20PragmaIntroducerKindERNS1_5TokenE\")\n //</editor-fold>\n @Override public void HandlePragma(Preprocessor /*&*/ PP, \n PragmaIntroducerKind Introducer, \n Token /*&*/ Tok)/* override*/ {\n unique_ptr_array<Token> TokenArray = null;\n JavaCleaner $c$ = $createJavaCleaner();\n try {\n // Incoming token is \"unroll\" for \"#pragma unroll\", or \"nounroll\" for\n // \"#pragma nounroll\".\n Token PragmaName = new Token(Tok);\n PP.Lex(Tok);\n PragmaLoopHintInfo /*P*/ Info = /*FIXME:*//*new (PP.getPreprocessorAllocator())*/ new PragmaLoopHintInfo();\n if (Tok.is(tok.TokenKind.eod)) {\n // nounroll or unroll pragma without an argument.\n Info.PragmaName.$assign(PragmaName);\n Info.Option.startToken();\n } else if ($eq_StringRef(PragmaName.getIdentifierInfo().getName(), /*STRINGREF_STR*/\"nounroll\")) {\n $c$.clean($out_DiagnosticBuilder$C_char$ptr$C($c$.track(PP.Diag(Tok.getLocation(), diag.warn_pragma_extra_tokens_at_eol)), \n /*KEEP_STR*/\"nounroll\"));\n return;\n } else {\n // Unroll pragma with an argument: \"#pragma unroll N\" or\n // \"#pragma unroll(N)\".\n // Read '(' if it exists.\n boolean ValueInParens = Tok.is(tok.TokenKind.l_paren);\n if (ValueInParens) {\n PP.Lex(Tok);\n }\n \n Token Option/*J*/= new Token();\n Option.startToken();\n if (ParseLoopHintValue(PP, Tok, new Token(PragmaName), new Token(Option), ValueInParens, $Deref(Info))) {\n return;\n }\n \n // In CUDA, the argument to '#pragma unroll' should not be contained in\n // parentheses.\n if (PP.getLangOpts().CUDA && ValueInParens) {\n $c$.clean($c$.track(PP.Diag(Info.Toks.$at(0).getLocation(), \n diag.warn_pragma_unroll_cuda_value_in_parens)));\n }\n if (Tok.isNot(tok.TokenKind.eod)) {\n $c$.clean($out_DiagnosticBuilder$C_char$ptr$C($c$.track(PP.Diag(Tok.getLocation(), diag.warn_pragma_extra_tokens_at_eol)), \n /*KEEP_STR*/\"unroll\"));\n return;\n }\n }\n \n // Generate the hint token.\n TokenArray = llvm.make_unique(new Token [] { new Token() });\n TokenArray.$at(0).startToken();\n TokenArray.$at(0).setKind(tok.TokenKind.annot_pragma_loop_hint);\n TokenArray.$at(0).setLocation(PragmaName.getLocation());\n TokenArray.$at(0).setAnnotationEndLoc(PragmaName.getLocation());\n TokenArray.$at(0).setAnnotationValue((reinterpret_cast(/*static_cast*/Object/*void P*/ .class, (Info))));\n PP.EnterTokenStream($c$.track(new unique_ptr_array<Token>(JD$Move.INSTANCE, std.move(TokenArray))), 1, \n /*DisableMacroExpansion=*/ false); $c$.clean();\n } finally {\n if (TokenArray != null) { TokenArray.$destroy(); }\n $c$.$destroy();\n }\n }", "public StrColumn getSkipPDBREMARK500() {\n return delegate.getColumn(\"skip_PDB_REMARK_500\", DelegatingStrColumn::new);\n }", "public MyFirstTransformation(ClawPragma directive) {\n super(directive);\n }", "static public void setLevel( byte level ) {\n Debug.level=level;\n }", "@Override\n public String getSqlOrder() {\n return SQL_ORDER;\n }", "public interface SQLV4 {\n\n //数据统计\n String ALTER_TABLE_DATASTATISTICS_TYPE = \"ALTER TABLE \" + DataStatisticsTable.TABLE_DATA_STATISTICS\n + \" ADD COLUMN \" + DataStatisticsTable.COLUMN_DATA_TYPE + \" INTEGER DEFAULT 0\";\n}", "public void enableParceler(boolean enable) {\n usesParcelerOption = enable;\n }", "private static void pragmaExtract(IASTPreprocessorPragmaStatement pragmaStatement) {\n\t\tchar[] message = pragmaStatement.getMessage();\n\n\t\tif (message.length >= 1) {\n\t\t\tif ((message[0] == '\\\"') && (message[message.length - 1] == '\\\"'))\n\t\t\t\tvxlFragment.append(VxlManager.pragmaDirective(\"\\\"\" + StringProcessor.processString(\n\t\t\t\t\t\tnew String(pragmaStatement.getMessage()).substring(1, pragmaStatement.getMessage().length - 1))\n\t\t\t\t\t\t+ \"\\\"\"));\n\t\t\telse\n\t\t\t\tvxlFragment.append(VxlManager.pragmaDirective(\n\t\t\t\t\t\t\"\\\"\" + StringProcessor.processString(new String(pragmaStatement.getMessage())) + \"\\\"\"));\n\t\t}\n\t}", "@Test\n public void testSqlMmRead() throws SQLException {\n\n GeometryColumnsUtils.testSqlMmRead(geoPackage, null);\n\n }", "private void m5296a() {\n C2261g.m9760a(1052673, \"Android \" + VERSION.RELEASE);\n C2261g.m9760a(1052674, Build.BRAND);\n C2261g.m9760a(1052675, Build.MODEL);\n C2261g.m9760a(1056769, getResources().getConfiguration().locale.getCountry());\n C2261g.m9760a(1056770, getResources().getConfiguration().locale.getLanguage());\n C2261g.m9760a(1060865, m5297b());\n }", "public boolean isUseFields()\n {\n return (isPragma() && getModule().toKeyword().isFieldsKeyword());\n }", "public void setColumnDelay(float columnDelay) {\n/* 109 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public void setDbTable(String v) {this.dbTable = v;}", "public boolean isPragma()\n {\n Token token = getModule();\n\n if (!token.isNull())\n {\n return Keyword.isPragma(getModule().getContent());\n }\n\n return false;\n }", "public PreparedSql generatePreparedSql(String prefix);", "protected void setupDBColumns() \n\t{\n\t\tthis.dbColumnNames = new Vector<String>();\n\t\tthis.dbColumnNames.addElement(\"ID\");\n\t}", "public void setup() {\r\n // These setters could be used to override the default.\r\n // this.setDatabasePolicy(new null());\r\n // this.setJDBCHelper(JDBCHelperFactory.create());\r\n this.setTableName(\"chm62edt_habitat_syntaxa\");\r\n this.setTableAlias(\"A\");\r\n this.setReadOnly(true);\r\n\r\n this.addColumnSpec(\r\n new CompoundPrimaryKeyColumnSpec(\r\n new StringColumnSpec(\"ID_HABITAT\", \"getIdHabitat\",\r\n \"setIdHabitat\", DEFAULT_TO_ZERO, NATURAL_PRIMARY_KEY),\r\n new StringColumnSpec(\"ID_SYNTAXA\", \"getIdSyntaxa\",\r\n \"setIdSyntaxa\", DEFAULT_TO_EMPTY_STRING,\r\n NATURAL_PRIMARY_KEY)));\r\n this.addColumnSpec(\r\n new StringColumnSpec(\"RELATION_TYPE\", \"getRelationType\",\r\n \"setRelationType\", DEFAULT_TO_NULL));\r\n this.addColumnSpec(\r\n new StringColumnSpec(\"ID_SYNTAXA_SOURCE\", \"getIdSyntaxaSource\",\r\n \"setIdSyntaxaSource\", DEFAULT_TO_EMPTY_STRING, REQUIRED));\r\n\r\n JoinTable syntaxa = new JoinTable(\"chm62edt_syntaxa B\", \"ID_SYNTAXA\",\r\n \"ID_SYNTAXA\");\r\n\r\n syntaxa.addJoinColumn(new StringJoinColumn(\"NAME\", \"setSyntaxaName\"));\r\n syntaxa.addJoinColumn(new StringJoinColumn(\"AUTHOR\", \"setSyntaxaAuthor\"));\r\n this.addJoinTable(syntaxa);\r\n\r\n JoinTable syntaxasource = new JoinTable(\"chm62edt_syntaxa_source C\",\r\n \"ID_SYNTAXA_SOURCE\", \"ID_SYNTAXA_SOURCE\");\r\n\r\n syntaxasource.addJoinColumn(new StringJoinColumn(\"SOURCE\", \"setSource\"));\r\n syntaxasource.addJoinColumn(\r\n new StringJoinColumn(\"SOURCE_ABBREV\", \"setSourceAbbrev\"));\r\n syntaxasource.addJoinColumn(new IntegerJoinColumn(\"ID_DC\", \"setIdDc\"));\r\n this.addJoinTable(syntaxasource);\r\n }", "void setNeedColumnInfo(boolean needColumnInfo);", "public boolean useOnFullReformat() {\n return true;\n }", "private void initSqlTypeMap() {\n\t\tif (sqlTypeMap == null) {\n\t\t\tsqlTypeMap = new TreeMap<String, String>();\n\t\t}\n\t\tsqlTypeMap.put(\"--void--\", \"0\");\n\t\tFieldHandlerUtils.initSqlTypeMap(sqlTypeMap);\n\t}", "public final void mo8995d(Cursor cursor) {\n String[] columnNames = cursor.getColumnNames();\n if (columnNames != null) {\n int length = columnNames.length;\n for (int i = 0; i < length; i++) {\n int hashCode = columnNames[i].hashCode();\n if (dkV == hashCode) {\n this.field_appId = cursor.getString(i);\n } else if (dlS == hashCode) {\n this.field_version = cursor.getInt(i);\n } else if (dmb == hashCode) {\n this.field_source = cursor.getInt(i);\n } else if (dmc == hashCode) {\n this.field_hitCount = cursor.getInt(i);\n } else if (dmd == hashCode) {\n this.field_reportId = cursor.getInt(i);\n } else if (diR == hashCode) {\n this.xDa = cursor.getLong(i);\n }\n }\n }\n }", "@Bean\n public JpaVendorAdapter jpaVendorAdapter() {\n HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();\n adapter.setShowSql(false);\n return adapter;\n }", "public void sql(boolean sql) {\n this.sql = sql;\n }", "private String getCodeFragmentTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CODE_FRAGMENT(\");\n \t\tbuilder.append(\"CODE_FRAGMENT_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"OWNER_FILE_ID LONG,\");\n \t\tbuilder.append(\"CRD_ID LONG,\");\n \t\tbuilder.append(\"START_REVISION_ID LONG,\");\n \t\tbuilder.append(\"END_REVISION_ID LONG,\");\n \t\tbuilder.append(\"HASH LONG,\");\n \t\tbuilder.append(\"HASH_FOR_CLONE LONG,\");\n \t\tbuilder.append(\"START_LINE INTEGER,\");\n \t\tbuilder.append(\"END_LINE INTEGER,\");\n \t\tbuilder.append(\"SIZE INTEGER\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "protected void setDigitTags() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: android.icu.impl.coll.CollationDataBuilder.setDigitTags():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.icu.impl.coll.CollationDataBuilder.setDigitTags():void\");\n }", "final void setQryclsimpEnabled(boolean flag) {\n qryclsimpEnabled_ = flag;\n }", "protected void setFastSyncBundle(Bundle b) {\n\t\tb.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true);\n\t}", "public T casePragma(Pragma object) {\n\t\treturn null;\n\t}", "protected void preUpdateSchema(CiDb db) throws OrmException, SQLException {\n }", "void k2h_bump_debug_level();", "public static void main(String args[]){\n String sql = \"select * from TBLS limit 2\";\n String sqlComplex = \"select testpartition.filename,format_.o,title.s,identifier.o,id.o,date_.o \" +\n \"from testpartition join format_ on (testpartition.filename=format_.s) \" +\n \"join title on (testpartition.filename=title.s) \" +\n \"join identifier on (testpartition.filename=identifier.s) \" +\n \"join id on (testpartition.filename=id.s) \" +\n \"join date_ on (testpartition.filename=date_.s) \" +\n \"where testpartition.gid0=1 and testpartition.sid=2 and testpartition.fid<100000 and testpartition.pfid=0\";\n String sqlOriginal = \"select idTable.filename,format_.o,title.s,identifier.o,id.o,date_.o \" +\n \"from idTable join format_ on (idTable.filename=format_.s) \" +\n \"join title on (idTable.filename=title.s) \" +\n \"join identifier on (idTable.filename=identifier.s) \" +\n \"join id on (idTable.filename=id.s) \" +\n \"join date_ on (idTable.filename=date_.s) \" +\n \"where idTable.gid0=1 and idTable.sid=2 and idTable.fid<100000\";\n\n QueryRewrite my = new QueryRewrite(sqlOriginal);\n String sqlRewrite = my.rewrite();\n System.out.println(sqlRewrite);\n\n\n }", "private void setAnsiMode() throws SQLException {\n Statement s = conn.createStatement();\n s.executeUpdate(\"SET sql_mode = 'ansi'\");\n s.close();\n }", "public void setDialect(String s) {\n if (s == null) dialect = \"DEFAULT\";\n else dialect = s;\n }", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t\t//\r\n\t\tsetContentView(R.layout.db_manager);\r\n\t\t\r\n\t\t//\r\n\t\tsetListeners();\r\n\r\n\t\t// TEMP\r\n//\t\tmodify_table();\r\n//\t\tString[] colNames = getColNames();\r\n//\t\tList<String> colNames = getColNames();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public void setPrettyPrint(boolean prettyPrint)\n/* */ {\n/* 136 */ this.prettyPrint = Boolean.valueOf(prettyPrint);\n/* 137 */ configurePrettyPrint();\n/* */ }", "public boolean isUseBase()\n {\n return (isPragma() && getModule().toKeyword().isBaseKeyword());\n }", "@Override\n\tpublic void setDebugMode(int debugMode) {\n\n\t}", "public void setSpringEnabled(boolean r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00eb in method: android.widget.ColorListView.setSpringEnabled(boolean):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.widget.ColorListView.setSpringEnabled(boolean):void\");\n }", "public void addVertexShader(String fileName);", "private void m145776f() {\n if (this.f119485r != null) {\n if (this.f119485r.cipher != null) {\n StringBuilder sb = new StringBuilder(\"PRAGMA cipher=\");\n sb.append(C46434h.m145972a(this.f119485r.cipher));\n mo115433a(sb.toString(), null, null);\n }\n if (this.f119485r.kdfIteration != 0) {\n StringBuilder sb2 = new StringBuilder(\"PRAGMA kdf_iter=\");\n sb2.append(this.f119485r.kdfIteration);\n mo115433a(sb2.toString(), null, null);\n }\n StringBuilder sb3 = new StringBuilder(\"PRAGMA cipher_use_hmac=\");\n sb3.append(this.f119485r.hmacEnabled);\n mo115433a(sb3.toString(), null, null);\n }\n }", "IParser setPrettyPrint(boolean thePrettyPrint);", "@Test(timeout = 4000)\n public void test66() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String string0 = SQLUtil.normalize(\"/*n9mv+\", false);\n assertEquals(\"/* n9mv +\", string0);\n }", "void setTransactionSchema(Schema transactionSchema);", "public void setTraceCompressed(boolean compressed)\r\n {\r\n this.traceCompressed = compressed;\r\n }", "public boolean getUsePrecompiled();", "@Override\n public void onCreate(SQLiteDatabase db) {\n db.execSQL(SQL_CREATE_HIGHSCORES);\n }", "@Override\n public void onCreate(SQLiteDatabase db) {\n executeSQLScript(db, \"sql/cstigo_v\" + DATABASE_VERSION + \".sql\");\n }", "@Test(timeout = 4000)\n public void test004() throws Throwable {\n boolean boolean0 = SQLUtil.isDDL(\"alter materialized viewjcsh%4%|@v9\");\n assertTrue(boolean0);\n }", "private final synchronized void m46512Q() {\n if (!this.f40735q) {\n if (!this.f40731m.mo39849e()) {\n if (VERSION.SDK_INT < 18) {\n acd.m45777b(\"Disabling hardware acceleration on an AdView.\");\n m46513R();\n return;\n }\n acd.m45777b(\"Enabling hardware acceleration on an AdView.\");\n m46514S();\n return;\n }\n }\n acd.m45777b(\"Enabling hardware acceleration on an overlay.\");\n m46514S();\n }", "public final void mo115445a(StringBuilder sb, boolean z) {\n sb.append(this.f119491c);\n if (this.f119494f) {\n sb.append(\" took \");\n sb.append(this.f119490b - this.f119489a);\n sb.append(\"ms\");\n } else {\n sb.append(\" started \");\n sb.append(System.currentTimeMillis() - this.f119489a);\n sb.append(\"ms ago\");\n }\n sb.append(\" - \");\n sb.append(m145803a());\n if (this.f119492d != null) {\n sb.append(\", sql=\\\"\");\n sb.append(SQLiteConnection.m145769c(this.f119492d));\n sb.append(\"\\\"\");\n }\n if (this.f119498j > 0) {\n sb.append(\", tid=\");\n sb.append(this.f119498j);\n }\n if (this.f119495g != null && this.f119495g.getMessage() != null) {\n sb.append(\", exception=\\\"\");\n sb.append(this.f119495g.getMessage());\n sb.append(\"\\\"\");\n }\n }", "@SuppressWarnings(\"unchecked\")\n @Override\n public void connectedConfiguration(Connection conn) throws SQLException {\n super.connectedConfiguration(conn);\n firebirdVersion = determineFirebirdVersion(conn);\n determineRangeSyntax();\n\n if (firebirdVersion == FB_VERSION_21)\n selectWordSet.add(\"WITH\");\n if (!(firebirdVersion == FB_VERSION_21)) {\n crossJoinClause = \"JOIN\";\n requiresConditionForCrossJoin = true;\n }\n if (firebirdVersion == FB_VERSION_15) {\n stringLengthFunction = \"STRLEN({0})\";\n trimLeadingFunction = \"LTRIM({0})\";\n trimTrailingFunction = \"RTRIM({0})\";\n trimBothFunction = \"LTRIM(RTRIM({0}))\";\n alterSequenceSQL = alterSequenceSQLFB15;\n createSequenceSQL = createSequenceSQLFB15;\n }\n }", "@Ignore(\"test in testPGNT0102002, testPGNT0101001, testPGNT0101002\")\n public void testDAM30507001() {\n }", "public final void mo5392bA(boolean z) {\n }", "public AccessSqlParser ()\n\t{\n\t}", "public void setOnOptimization(boolean b) {\n this.onOptimization = b;\n }", "public ListSqlHelper() {\n\t\t// for bran creation\n\t}", "void setIndentLevel(int level);", "protected void initializer() {\n\t\tselect = new DBSelect();\n\t\ttry {\n\t\t\tselect.setDriverName(\"com.ibm.as400.access.AS400JDBCDriver\");\n\t\t\tselect.setUrl(\"jdbc:as400://192.168.101.14\");\n\t\t\tselect.setCommand(\n\t\t\t\"SELECT DISTINCT artitda.codaat, articulo.descma, articulo.des1ma, articulo.des2ma, articulo.unvema, SUBSTR(VARCHAR(ARTITDA.CODAAT), 1, 2) as departamento, SUBSTR(VARCHAR(ARTITDA.CODAAT), 3, 2) as lineaseccion, costos.coslllca, artitda.prevat, artitda.impuat as impuesto, articulo.empvma as empaque, articulo.povema as descuentoempaque, articulo.deemma as descuentoempleado, articulo.esrema, articulo.fecama \t\t\tFROM SISTEMA.ARTICULO as articulo inner join COMPRAS.LMLCA03 as costos on (articulo.codama = costos.artillca) inner join COMPRAS.ARTITDA as artitda on (articulo.codama = artitda.codaat) \t\t\tWHERE artitda.codaat IN (SELECT articulo.codama FROM SISTEMA.ARTICULO as articulo, COMPRAS.ARTITDA as artitda \t\t\tWHERE (CAST (ARTITDA.TIENAT AS SMALLINT) = 3) AND (ARTICULO.ESREMA = 'V') AND (ARTITDA.EXACAT <> 0) AND ((SUBSTR(VARCHAR(ARTITDA.CODAAT), 1, 2) = '90') OR (ARTITDA.CODAAT < 3500000)) and (articulo.codama = artitda.codaat) )\"); \n\t\t\t\t//\"SELECT * FROM COMPRAS.ARTITDA, SISTEMA.ARTICULO WHERE (COMPRAS.ARTITDA.CODAAT = SISTEMA.ARTICULO.CODAMA) AND (CAST (COMPRAS.ARTITDA.TIENAT AS SMALLINT) = 3) AND (SISTEMA.ARTICULO.ESREMA = 'V') AND (COMPRAS.ARTITDA.EXACAT <> 0) AND ((SUBSTR(VARCHAR(COMPRAS.ARTITDA.CODAAT), 1, 2) = '90') OR (COMPRAS.ARTITDA.CODAAT < 3500000))\");\n\t\t\t//\"SELECT count(*) FROM SISTEMA.ARTICULO as articulo inner join COMPRAS.ARTITDA as artitda on (articulo.codama = artitda.codaat) WHERE (CAST (ARTITDA.TIENAT AS SMALLINT) = 3) AND (ARTICULO.ESREMA = 'V') AND (ARTITDA.EXACAT <> 0) AND ((SUBSTR(VARCHAR(ARTITDA.CODAAT), 1, 2) = '90') OR (ARTITDA.CODAAT < 3500000))\"\t\t\t\n\t\t\t//DBParameterMetaData parmMetaData = select.getParameterMetaData();\n\t\t} catch (SQLException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "@Override\n\tpublic void glSetup(Context cx) {\n\t\tmShader = ShaderHelper.glGenerateShader(cx, \"vertex_shader\",\n\t\t\t\t\"scene_enhance_fragment_shader\", \"aPosition\", \"uMVPMatrix\",\n\t\t\t\t\"uTexture\", \"uTextureCurve\");\n\n\t}", "public StatementPerformanceAnalyzer() {\n super(\"statement_performance_analyzer\", Sys.SYS);\n\n addInParameter(IN_ACTION);\n addInParameter(IN_TABLE);\n addInParameter(IN_VIEWS);\n }", "public void toggleDebugMode() {\r\n DEBUG = !DEBUG;\r\n }", "@Test(timeout = 4000)\n public void test118() throws Throwable {\n DefaultDBColumn defaultDBColumn0 = new DefaultDBColumn(\"KiLhxfMHqE4D5vsD?\", (DBTable) null, 326, \"org.antlr.runtime.Token\");\n ConstraintDescriptorList constraintDescriptorList0 = new ConstraintDescriptorList();\n constraintDescriptorList0.add((DBColumn) defaultDBColumn0);\n constraintDescriptorList0.add((DBColumn) defaultDBColumn0);\n String string0 = SQLUtil.renderColumnNames((List<DBColumn>) constraintDescriptorList0);\n assertEquals(\"KiLhxfMHqE4D5vsD?, KiLhxfMHqE4D5vsD?\", string0);\n }", "@Override\n\tpublic void setDebugMode(boolean debug) {\n\n\t}", "static public int defaultCompressThreshold () { throw new RuntimeException(); }", "void setLeading(boolean leading);", "private static boolean determineShowSql(CommandLine optionLine)\n {\n return optionLine.hasOption(Environment.SHOW_SQL);\n }", "void onConfigure(SQLiteDatabase database);", "void onConfigure(SQLiteDatabase database);" ]
[ "0.5542168", "0.5243701", "0.51763344", "0.5079699", "0.5015162", "0.5008015", "0.50019693", "0.4953234", "0.4801788", "0.47795826", "0.47503713", "0.46028474", "0.45639306", "0.45267174", "0.44981563", "0.44656962", "0.44053996", "0.43903527", "0.43853402", "0.43673974", "0.4350214", "0.4337084", "0.42974073", "0.4273679", "0.42600155", "0.42520106", "0.42274985", "0.4226239", "0.42049024", "0.41947097", "0.4177467", "0.41773367", "0.417595", "0.4174261", "0.4166033", "0.4147726", "0.4146399", "0.4136257", "0.41106918", "0.4100397", "0.40995297", "0.4097804", "0.4097475", "0.40950203", "0.4086277", "0.40842047", "0.4081559", "0.40807024", "0.40806645", "0.40771368", "0.40736812", "0.40665066", "0.4055317", "0.4044892", "0.40414065", "0.40264487", "0.4022152", "0.40199468", "0.39896882", "0.39851642", "0.39674988", "0.39670607", "0.39649084", "0.39482254", "0.39447892", "0.39438498", "0.39404368", "0.39401856", "0.3934782", "0.3932794", "0.39258045", "0.39175695", "0.3917139", "0.39036322", "0.38971692", "0.38969627", "0.38941", "0.3892948", "0.3887226", "0.38850304", "0.3882408", "0.38818485", "0.38804683", "0.38795996", "0.3877905", "0.38744754", "0.38728136", "0.38702592", "0.3867501", "0.38662875", "0.38623548", "0.38614342", "0.3861053", "0.3858766", "0.38586986", "0.38583875", "0.38564357", "0.3851982", "0.384773", "0.38441384", "0.38441384" ]
0.0
-1
Checks if the database layout exists already and create new one if needed
private void initLayout() throws DatabaseAccessException, IncompatibleVersionException { Statement stmt = null; ResultSet rs; int version = -1; try { stmt = this.connection.createStatement(); rs = stmt.executeQuery("SELECT Version FROM Metadata;"); version = rs.getInt(1); stmt.close(); if (version != DatabaseConfiguration.LAYOUTVERSION) { throw new IncompatibleVersionException(Failure.VERSION); } } catch (SQLException e) { // if there isn't at least the Metadata table with the Version field, we operate on a clean database createTables(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createNewSchema() throws SQLException {\n ResultSet resultSet = databaseStatement.executeQuery(\"select count(datname) from pg_database\");\n int uniqueID = 0;\n if(resultSet.next()) {\n uniqueID = resultSet.getInt(1);\n }\n if(uniqueID != 0) {\n uniqueID++;\n databaseStatement.executeQuery(\"CREATE DATABASE OSM\"+uniqueID+\";\");\n }\n }", "private static void initializeDatabase()\n\t{\n\t\tResultSet resultSet = dbConnect.getMetaData().getCatalogs();\n\t\tStatment statement = dbConnect.createStatement();\n\t\t\n\t\tif (resultSet.next())\n\t\t{\n\t\t\tstatement.execute(\"USE \" + resultSet.getString(1));\n\t\t\tstatement.close();\n\t\t\tresultSet.close();\n\t\t\treturn; //A database exists already\n\t\t}\n\t\tresultSet.close();\n\t\t//No database exists yet, create it.\n\t\t\n\t\tstatement.execute(\"CREATE DATABASE \" + dbName);\n\t\tstatement.execute(\"USE \" + dbName);\n\t\tstatement.execute(createTableStatement);\n\t\tstatement.close();\n\t\treturn;\n\t}", "private void prepareLayout() {\n\n\t\tm_layouts = new ArrayList<SQLTableLayout>();\n\n\t\t//\n\t\t// construct the table tag\n\t\t//\n\t\tSQLTableLayout layout = new SQLTableLayout(TAG_TABLE_NAME);\n\t\tlayout.addFieldToSQLTableLayout(TAG_FIELD_ID, \"INTEGER primary key\",\n\t\t\t\t\"tag id\");\n\t\tlayout.addFieldToSQLTableLayout(TAG_FIELD_NAME, \"TEXT\", \"tag name\");\n\t\tlayout.addFieldToSQLTableLayout(TAG_FIELD_CREATE_DATE, \"TEXT\",\n\t\t\t\t\"creation date of tag\");\n\t\tlayout.addFieldToSQLTableLayout(TAG_FIELD_USAGE, \"INTEGER\",\n\t\t\t\t\"tag usage in repository\");\n\t\tm_layouts.add(layout);\n\n\t\t//\n\t\t// construct the table file\n\t\t//\n\t\tlayout = new SQLTableLayout(FILE_TABLE_NAME);\n\t\tlayout.addFieldToSQLTableLayout(FILE_FIELD_ID, \"INTEGER primary key\",\n\t\t\t\t\"file id\");\n\t\tlayout.addFieldToSQLTableLayout(FILE_FIELD_PATH, \"TEXT\", \"path of file\");\n\t\tlayout.addFieldToSQLTableLayout(FILE_FIELD_TYPE, \"TEXT\", \"type of file\");\n\t\tlayout.addFieldToSQLTableLayout(FILE_FIELD_CREATE_DATE, \"TEXT\",\n\t\t\t\t\"creation date of file\");\n\t\tlayout.addFieldToSQLTableLayout(FILE_FIELD_HASH_SUM, \"TEXT\",\n\t\t\t\t\"hash sum of file\");\n\t\tm_layouts.add(layout);\n\n\t\t//\n\t\t// construct the mapping table\n\t\t//\n\t\tlayout = new SQLTableLayout(MAP_TABLE_NAME);\n\t\tlayout.addFieldToSQLTableLayout(MAP_FIELD_ID, \"INTEGER primary key\",\n\t\t\t\t\"map id\");\n\t\tlayout.addFieldToSQLTableLayout(MAP_FIELD_FILE, \"INTEGER\", \"file id\");\n\t\tlayout.addFieldToSQLTableLayout(MAP_FIELD_TAG, \"INTEGER\", \"tag id\");\n\t\tm_layouts.add(layout);\n\n\t\t//\n\t\t// construct the directory table\n\t\t//\n\t\tlayout = new SQLTableLayout(DIRECTORY_TABLE_NAME);\n\t\tlayout.addFieldToSQLTableLayout(DIRECTORY_FIELD_ID,\n\t\t\t\t\"INTEGER primary key\", \"directory id\");\n\t\tlayout.addFieldToSQLTableLayout(DIRECTORY_FIELD_PATH, \"TEXT\",\n\t\t\t\t\"path of directory\");\n\t\tm_layouts.add(layout);\n\n\t\t//\n\t\t// construct pending file table\n\t\t//\n\t\tlayout = new SQLTableLayout(PENDING_FILE_TABLE_NAME);\n\t\tlayout.addFieldToSQLTableLayout(PENDING_FIELD_ID,\n\t\t\t\t\"INTEGER primary key\", \"pending id\");\n\t\tlayout.addFieldToSQLTableLayout(PENDING_FIELD_PATH, \"TEXT\",\n\t\t\t\t\"pending path of file\");\n\t\tm_layouts.add(layout);\n\n\t\t//\n\t\t// construct synchronized table\n\t\t//\n\t\tlayout = new SQLTableLayout(SYNC_TABLE_NAME);\n\t\tlayout.addFieldToSQLTableLayout(SYNC_FIELD_ID, \"INTEGER primary key\",\n\t\t\t\t\"sync id\");\n\t\tlayout.addFieldToSQLTableLayout(SYNC_FIELD_PATH, \"TEXT\",\n\t\t\t\t\"path of synced file\");\n\t\tlayout.addFieldToSQLTableLayout(SYNC_FIELD_DATE, \"TEXT\", \"sync date\");\n\t\tlayout.addFieldToSQLTableLayout(SYNC_FIELD_TAGS, \"TEXT\",\n\t\t\t\t\"tags of synced file\");\n\t\tlayout.addFieldToSQLTableLayout(SYNC_FIELD_HASH_SUM, \"TEXT\",\n\t\t\t\t\"hash sum of synced file\");\n\t\tm_layouts.add(layout);\n\t}", "private void createDatabase() {\n String parentPath = mContext.getDatabasePath(DBNAME).getParent();\n String path = mContext.getDatabasePath(DBNAME).getPath();\n\n File file = new File(parentPath);\n if (!file.exists()) {\n if (!file.mkdir()) {\n Log.w(TAG, \"Unable to create database directory\");\n return;\n }\n }\n\n InputStream is = null;\n OutputStream os = null;\n try {\n is = mContext.getAssets().open(DBNAME);\n os = new FileOutputStream(path);\n\n byte[] buffer = new byte[1024];\n int length;\n while ((length = is.read(buffer)) > 0) {\n os.write(buffer, 0, length);\n }\n os.flush();\n SharedPreferences prefs = PreferenceManager\n .getDefaultSharedPreferences(mContext);\n SharedPreferences.Editor editor = prefs.edit();\n editor.putInt(SP_KEY_DB_VER, DATABASE_VERSION);\n editor.commit();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (is != null) {\n try {\n is.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n if (os != null) {\n try {\n os.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }", "public void dbCreate() throws IOException\n {\n boolean dbExist = dbCheck();\n\n if(!dbExist)\n {\n //By calling this method an empty database will be created into the default system patt\n //of the application so we can overwrite that db with our db.\n this.getReadableDatabase(); // create a new empty database in the correct path\n try\n {\n //copy the data from the database in the Assets folder to the new empty database\n copyDBFromAssets();\n }\n catch(IOException e)\n {\n throw new Error(\"Error copying database\");\n }\n }\n }", "private boolean databaseExists() {\n SQLiteDatabase checkDB = null;\n try {\n String myPath = DATABASE_PATH + DATABASE_NAME;\n checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);\n } catch (SQLiteException e) {\n Log.i(\"burra\",\"Database \"+DATABASE_PATH+DATABASE_NAME+\"not found. Will copy from assets folder\");\n }\n if(null!=checkDB){\n checkDB.close();\n return true;\n }\n return false;\n }", "public void createDataBase() throws IOException {\n\n boolean dbExist = checkDataBase();\n\n if(dbExist){\n //do nothing - database already exist\n }else{\n\n //By calling this method and empty database will be created into the default system path\n //of your application so we are gonna be able to overwrite that database with our database.\n this.getReadableDatabase();\n\n try {\n\n copyDataBase();\n\n } catch (IOException e) {\n\n throw new Error(\"Error copying database\");\n\n }\n }\n\n }", "public void createDataBase() throws IOException {\n\n boolean dbExist = checkDataBase();\n\n if(dbExist){\n //do nothing - database already exist\n }else{\n\n //By calling this method and empty database will be created into the default system path\n //of your application so we are gonna be able to overwrite that database with our database.\n this.getReadableDatabase();\n\n try {\n\n copyDataBase();\n\n } catch (IOException e) {\n\n throw new Error(\"Error copying database\");\n\n }\n }\n\n }", "public synchronized void createIfNotExists(SQLiteDatabase db) {\n db.execSQL(SQL_CREATE_DATASOURCE);\n }", "public void createDB() {\n\t\ttry {\n\t\t\tBufferedReader br= new BufferedReader(new FileReader(\"db_schema.txt\"));\n\t\t\tString line= null;\n\t\t\tStringBuilder sb= new StringBuilder();\n\t\t\twhile ((line=br.readLine())!=null){\n\t\t\t\tsb.append(line);\n\t\t\t\tif(sb.length()>0 && sb.charAt(sb.length()-1)==';'){//see if it is the end of one line of command\n\t\t\t\t\tstatement.executeUpdate(sb.toString());\n\t\t\t\t\tsb= new StringBuilder();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private boolean createDatabase(CreateDatabaseStatement cds) {\n\t\tif(dbs.containsKey(cds.dbname)) {\n\t\t\tSystem.out.println(\"Error: Can't create database \" + cds.dbname + \"; database exists\");\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\tDatabase newdb = new Database();\n\t\t\tdbs.put(cds.dbname, newdb);\n\t\t\treturn true;\n\t\t\t\n\t\t}\n\t}", "protected void relocateDatabaseIfNeeded() {\n File databaseDir = new File(config.dataDir(), Constants.DATABASE_DIR);\n File blocksDir = new File(databaseDir, \"block\");\n\n if (blocksDir.exists()) {\n LeveldbDatabase db = new LeveldbDatabase(blocksDir);\n byte[] header = db.get(Bytes.merge((byte) 0x00, Bytes.of(0L)));\n db.close();\n\n if (header == null || header.length < 33) {\n logger.info(\"Unable to decode genesis header. Quit relocating\");\n } else {\n String hash = Hex.encode(Arrays.copyOfRange(header, 1, 33));\n switch (hash) {\n case \"1d4fb49444a5a14dbe68f5f6109808c68e517b893c1e9bbffce9d199b5037c8e\":\n moveDatabase(databaseDir, config.databaseDir(Network.MAINNET));\n break;\n case \"abfe38563bed10ec431a4a9ad344a212ef62f6244c15795324cc06c2e8fa0f8d\":\n moveDatabase(databaseDir, config.databaseDir(Network.TESTNET));\n break;\n default:\n logger.info(\"Unable to recognize genesis hash. Quit relocating\");\n }\n }\n }\n }", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"FITTING_TABLE\\\" (\" + //\n \"\\\"NAME\\\" TEXT PRIMARY KEY NOT NULL ,\" + // 0: name\n \"\\\"DB_NAME\\\" TEXT,\" + // 1: dbName\n \"\\\"CATEGORY\\\" TEXT,\" + // 2: category\n \"\\\"DES\\\" TEXT,\" + // 3: des\n \"\\\"LAYOUT_RESOURCE_ID\\\" INTEGER);\"); // 4: layoutResourceID\n }", "private void createTables() throws DatabaseAccessException {\n\t\tStatement stmt = null;\n\t\tPreparedStatement prepStmt = null;\n\n\t\ttry {\n\t\t\tstmt = this.connection.createStatement();\n\n\t\t\t// be sure to drop all tables in case someone manipulated the database manually\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS DynamicConstraints;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Features;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Groups;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Metadata;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Objects;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS StaticConstraints;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Subspaces;\");\n\n\t\t\t// populate database with tables.. by using ugly sql\n\t\t\tstmt.executeUpdate(\"CREATE TABLE DynamicConstraints(Id INTEGER PRIMARY KEY AUTOINCREMENT,\"\n\t\t\t\t\t+ \" Operator INTEGER, FeatureReference INTEGER,\"\n\t\t\t\t\t+ \" GroupReference INTEGER, Value FLOAT, Active BOOLEAN);\");\n\t\t\tstmt.executeUpdate(\"CREATE TABLE Features(Id INTEGER PRIMARY KEY AUTOINCREMENT,\" + \" Name VARCHAR(\"\n\t\t\t\t\t+ DatabaseConfiguration.VARCHARLENGTH + \"), OutlierFlag BOOLEAN, Min FLOAT, Max FLOAT);\");\n\t\t\tstmt.executeUpdate(\"CREATE TABLE Groups(Id INTEGER PRIMARY KEY AUTOINCREMENT, Name VARCHAR(\"\n\t\t\t\t\t+ DatabaseConfiguration.VARCHARLENGTH + \"),\"\n\t\t\t\t\t+ \" Visibility BOOLEAN, Color INTEGER, ColorCalculatedByFeature INTEGER, Description TEXT);\");\n\t\t\tstmt.executeUpdate(\"CREATE TABLE Metadata(Version INTEGER);\");\n\n\t\t\t// Object table is created in initFeatures, to boost performance\n\n\t\t\tstmt.executeUpdate(\"CREATE TABLE StaticConstraints(Id INTEGER, GroupReference INTEGER,\"\n\t\t\t\t\t+ \" ObjectReference INTEGER, Active BOOLEAN);\");\n\t\t\tstmt.executeUpdate(\"CREATE TABLE Subspaces(Id INTEGER, FeatureReference INTEGER,\" + \" Name VARCHAR(\"\n\t\t\t\t\t+ DatabaseConfiguration.VARCHARLENGTH + \"));\");\n\n\t\t\tstmt.close();\n\n\t\t\t// after creating the tables, write the layout version\n\t\t\tprepStmt = this.connection.prepareStatement(\"INSERT INTO Metadata VALUES(?);\");\n\t\t\tprepStmt.setInt(1, DatabaseConfiguration.LAYOUTVERSION);\n\t\t\tprepStmt.execute();\n\n\t\t\tprepStmt.close();\n\n\t\t} catch (SQLException e) {\n\t\t\tthrow new DatabaseAccessException(Failure.LAYOUT);\n\t\t}\n\t}", "private void createDataBase() throws IOException {\n\n boolean dbExist = checkDataBase();\n\n if (dbExist) {\n // do nothing - database already exist\n Log.d(\"DATABASE\",\"Database Exit Already.\");\n\n } else {\n\n // Create Folder\n String newFolder = \"/games\";\n String extStorageDirectory = Environment.getExternalStorageDirectory().toString();\n File myNewFolder = new File(extStorageDirectory + newFolder);\n myNewFolder.mkdir();\n\n // Create Folder\n// newFolder = \"/FishRisk/Game\";\n// extStorageDirectory = Environment.getExternalStorageDirectory().toString();\n// myNewFolder = new File(extStorageDirectory + newFolder);\n// myNewFolder.mkdir();\n\n // Create Folder\n newFolder = \"/games/Report\";\n extStorageDirectory = Environment.getExternalStorageDirectory().toString();\n myNewFolder = new File(extStorageDirectory + newFolder);\n myNewFolder.mkdir();\n\n // Create Folder\n newFolder = \"/games/Config\";\n extStorageDirectory = Environment.getExternalStorageDirectory().toString();\n myNewFolder = new File(extStorageDirectory + newFolder);\n myNewFolder.mkdir();\n\n //copyConfigFile();\n\n // By calling this method an empty database will be created into\n // the default system path\n // of your application so we are gonna be able to overwrite that\n // database with our database.\n this.getReadableDatabase();\n\n try {\n copyDataBase();\n copyConfigFile();\n } catch (IOException e) {\n\n throw new Error(\"Error copying database\");\n }\n }\n }", "private void m14053d() {\n try {\n File file = new File(f18051l);\n File file2 = new File(f18052m);\n if (!file.exists()) {\n file.mkdirs();\n }\n if (!file2.exists()) {\n file2.createNewFile();\n }\n if (file2.exists()) {\n SQLiteDatabase openOrCreateDatabase = SQLiteDatabase.openOrCreateDatabase(file2, null);\n openOrCreateDatabase.execSQL(\"CREATE TABLE IF NOT EXISTS bdcltb09(id CHAR(40) PRIMARY KEY,time DOUBLE,tag DOUBLE, type DOUBLE , ac INT);\");\n openOrCreateDatabase.execSQL(\"CREATE TABLE IF NOT EXISTS wof(id CHAR(15) PRIMARY KEY,mktime DOUBLE,time DOUBLE, ac INT, bc INT, cc INT);\");\n openOrCreateDatabase.setVersion(1);\n openOrCreateDatabase.close();\n }\n this.f18053a = true;\n } catch (Exception e) {\n }\n }", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists ? \"IF NOT EXISTS \" : \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"\" + TABLENAME + \"\\\" (\" + //\n \"\\\"\" + COLUMNNAME_ID + \"\\\" INTEGER PRIMARY KEY AUTOINCREMENT,\" + // 0: id\n \"\\\"\" + COLUMNNAME_TITLE + \"\\\" TEXT NOT NULL,\" + // 1: title\n \"\\\"\" + COLUMNNAME_THUMBURL + \"\\\" TEXT,\" + // 2: thumburl\n \"\\\"\" + COLUMNNAME_SOURCEURL + \"\\\" TEXT,\" + // 3: sourceurl\n \"\\\"\" + COLUMNNAME_HEIGHT + \"\\\" INTEGER,\" + // 4: height\n \"\\\"\" + COLUMNNAME_WIDTH + \"\\\" INTEGER,\" + // 5: width\n \"\\\"\" + COLUMNNAME_ISCOLLECTION + \"\\\" INTEGER DEFAULT 0);\"); // 6: iscollection\n }", "public void createInitialLayout(IPageLayout layout) {\n \n\t}", "public void createDatabase() throws IOException {\n boolean dbExists = checkDatabase();\n\n if (dbExists) {\n // Do nothing - database already exists\n } else {\n // By calling this method an empty database will be created into the\n // default system path of our application so we are going to be able\n // to overwrite the database with our database.\n this.getReadableDatabase();\n\n try {\n copyDatabase();\n } catch (IOException e) {\n throw new Error(\"Error copying database\");\n }\n }\n }", "public void createDataBase() throws IOException{\n \n \tboolean dbExist = checkDataBase();\n \t\n \n \tif(dbExist){\n \t\t//do nothing - database already exists\n \t\tLog.d(\"Database Check\", \"Database Exists\");\n\n \t}else{\n \t\tLog.d(\"Database Check\", \"Database Doesn't Exist\");\n \t\tthis.close();\n \t\t//By calling this method and empty database will be created into the default system path\n //of your application so we are gonna be able to overwrite that database with our database.\n \tthis.getReadableDatabase();\n \tthis.close();\n \ttry {\n \t\t\tcopyDataBase();\n \t\t\tLog.d(\"Database Check\", \"Database Copied\");\n \n \t\t} catch (IOException e) {\n \t\tLog.d(\"I/O Error\", e.toString());\n\n \t\tthrow new Error(\"Error copying database\");\n \t}\n \tcatch (Exception e) { \n \t\tLog.d(\"Exception in createDatabase\", e.toString());\n \t\t\n \t}\n \t}\n \n }", "private boolean dbCheck() {\n SQLiteDatabase db = null;\n try\n {\n String dbPath = DB_PATH + DB_NAME;\n Log.e(\"database\",\"path created \");\n Log.d(\"dbPath\", dbPath);\n db = SQLiteDatabase.openDatabase(dbPath, null, SQLiteDatabase.OPEN_READWRITE);\n Log.e(\"database\",\"open database \");\n db.setLocale(Locale.getDefault());\n Log.e(\"database\",\"set locale \");\n db.setVersion(1);\n Log.e(\"database\",\"version set\");\n }catch (SQLiteException e)\n {\n e.printStackTrace();\n Log.d(\"SQLHelper\", \"couldnt find database\");\n\n }\n if (db !=null)\n {\n db.close();\n }\n return db != null ? true : false;\n }", "public void createDatabase() throws IOException {\n boolean dbExist = checkDataBase();\n// if(dbExist) {\n// Log.d(\"E\", \"Database exists.\");\n// try {\n// copyDataBase();\n// } catch (IOException e) {\n// Log.e(\"Error\", e.getMessage());\n// }\n// } else {\n// try {\n// copyDataBase();\n// } catch (IOException e) {\n// Log.e(\"Error1\", e.getMessage());\n// }\n// }\n\n if (!dbExist) {\n this.getReadableDatabase();\n this.close();\n try {\n //Copy the database from assests\n copyDataBase();\n Log.e(TAG, \"createDatabase database created\");\n } catch (IOException mIOException) {\n throw new Error(\"ErrorCopyingDataBase\");\n }\n }\n\n }", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"ANSWERS_QUESTION\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: id\n \"\\\"ID_QUESTION\\\" TEXT,\" + // 1: idQuestion\n \"\\\"ID_ANSWER\\\" TEXT,\" + // 2: idAnswer\n \"\\\"DESCRIPTION\\\" TEXT,\" + // 3: description\n \"\\\"VALUE\\\" INTEGER,\" + // 4: value\n \"\\\"POINTS\\\" INTEGER,\" + // 5: points\n \"\\\"ENABLE\\\" INTEGER,\" + // 6: enable\n \"\\\"TXT_SECOND_QUESTION\\\" TEXT);\"); // 7: txtSecondQuestion\n }", "private void checkDatabaseStructure(DatabaseUpdateType update) {\n }", "public void createDatabase() throws IOException{\r\n\r\n boolean dbDoesExist = checkDatabase();\r\n if(!dbDoesExist)\r\n {\r\n // Create or open db if db is not connected\r\n this.getReadableDatabase();\r\n try{\r\n createNewDB();\r\n }catch (IOException e){\r\n throw new Error(\"DB Copy Failed\");\r\n }\r\n }\r\n }", "public void createTableIfNotExists() {\n SQLiteDatabase db = this.getWritableDatabase();\n\n db.execSQL(\"CREATE TABLE IF NOT EXISTS \" + TABLE_NAME + \" (\"\n + _id + \" INTEGER PRIMARY KEY AUTOINCREMENT, \"\n + smilePercentage + \" INTEGER NOT NULL, \"\n + dateStart + \" TEXT NOT NULL, \"\n + dateEnd + \" TEXT NOT NULL, \"\n + userName + \" TEXT NOT NULL);\");\n db.close();\n\n }", "private void createDatabase() throws SQLException\r\n {\r\n myStmt.executeUpdate(\"create database \" + dbname);\r\n }", "private void initialize() {\n if (databaseExists()) {\n SharedPreferences prefs = PreferenceManager\n .getDefaultSharedPreferences(mContext);\n int dbVersion = prefs.getInt(SP_KEY_DB_VER, 1);\n if (DATABASE_VERSION != dbVersion) {\n File dbFile = mContext.getDatabasePath(DBNAME);\n if (!dbFile.delete()) {\n Log.w(TAG, \"Unable to update database\");\n }\n }\n }\n if (!databaseExists()) {\n createDatabase();\n }\n }", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"MAIN_MENU\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: id\n \"\\\"NAME\\\" TEXT,\" + // 1: name\n \"\\\"TIPS\\\" TEXT,\" + // 2: tips\n \"\\\"CLICK_ID\\\" INTEGER,\" + // 3: clickId\n \"\\\"BTN_TEXT\\\" TEXT,\" + // 4: btnText\n \"\\\"TYPE\\\" TEXT,\" + // 5: type\n \"\\\"POSITION\\\" INTEGER NOT NULL );\"); // 6: position\n }", "public void createDataBase() throws IOException {\n boolean dbExist = checkDataBase();\n\n if (dbExist) {\n\n } else {\n this.getReadableDatabase();\n try {\n copyDataBase();\n } catch (IOException e) {\n Log.e(\"tle99 - create\", e.getMessage());\n }\n }\n }", "private void setupDb(){\n try {\n openConnection();\n s.executeUpdate(\"CREATE TABLE IF NOT EXISTS LIB (NAME text UNIQUE , TYPE text, LANGUAGE text, INTRUSIVE text, OPENSOURCE text)\");\n }catch (SQLException e) {\n System.err.println(e.getMessage());\n }finally {\n if (c != null){\n close(c);\n }\n }\n }", "private void createDB() {\n try {\n Statement stat = conn.createStatement();\n stat.execute(\"CREATE TABLE settings (name TEXT, state);\");\n stat.execute(\"CREATE TABLE expressions (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n stat.execute(\"CREATE TABLE summaries (id INTEGER PRIMARY KEY ASC, expression_id INTEGER, title TEXT, abstract TEXT);\");\n stat.execute(\"CREATE TABLE history (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n } catch (SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n System.exit(0);\n }\n }", "public static void createDatabase() throws SQLException {\n\t\tSystem.out.println(\"DROP database IF EXISTS project02;\");\n\t\tstatement = connection.prepareStatement(\"DROP database IF EXISTS project02;\");\n\t\tstatement.executeUpdate();\n\t\tSystem.out.println(\"CREATE database project02;\");\n\t\tstatement = connection.prepareStatement(\"CREATE database project02;\");\n\t\tstatement.executeUpdate();\n\t\tSystem.out.println(\"USE project02;\");\n\t\tstatement = connection.prepareStatement(\"USE project02;\");\n\t\tstatement.executeUpdate();\n\t}", "public boolean checkIfDatabaseExists() {\r\n return database.exists();\r\n }", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"GAME_FILL_ITEM\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY UNIQUE ,\" + // 0: id\n \"\\\"TITLE\\\" TEXT,\" + // 1: title\n \"\\\"ANSWER\\\" INTEGER NOT NULL ,\" + // 2: answer\n \"\\\"FIRST_ANSWER\\\" TEXT,\" + // 3: first_answer\n \"\\\"SECOND_ANSWER\\\" TEXT,\" + // 4: second_answer\n \"\\\"THIRD_ANSWER\\\" TEXT,\" + // 5: third_answer\n \"\\\"FOURTH_ANSWER\\\" TEXT);\"); // 6: fourth_answer\n }", "public void setCheckDatabaseExistence(boolean checkDatabaseExistence) {\n this.checkDatabaseExistence = checkDatabaseExistence;\n }", "void createDatabaseOnDevice() throws IOException {\n boolean databaseExists = checkIfDatabaseOnDevice();\n\n if (!databaseExists) {\n this.getReadableDatabase();\n\n try {\n copyDatabaseToDevice();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "private boolean checkDatabase() {\n SQLiteDatabase checkDB = null;\n\n try {\n String dbPath = DB_PATH + DB_NAME;\n checkDB = SQLiteDatabase.openDatabase(\n dbPath, \n null,\n SQLiteDatabase.NO_LOCALIZED_COLLATORS // Open without support for localized collators. setLocate() will do nothing.\n );\n } catch (SQLiteException e) {\n // Do nothing - database doesn't exist yet\n }\n\n if (checkDB != null) {\n checkDB.close();\n }\n\n return checkDB != null ? true : false;\n }", "private void recreateDatabaseSchema() {\n\t\t// Fetch database schema\n\t\tlogger.info(\"Reading database schema from file\");\n\t\tString[] schemaSql = loadFile(\"blab_schema.sql\", new String[] { \"--\", \"/*\" }, \";\");\n\n\t\tConnection connect = null;\n\t\tStatement stmt = null;\n\t\ttry {\n\t\t\t// Get the Database Connection\n\t\t\tlogger.info(\"Getting Database connection\");\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\tconnect = DriverManager.getConnection(Constants.create().getJdbcConnectionString());\n\n\t\t\tstmt = connect.createStatement();\n\n\t\t\tfor (String sql : schemaSql) {\n\t\t\t\tsql = sql.trim(); // Remove any remaining whitespace\n\t\t\t\tif (!sql.isEmpty()) {\n\t\t\t\t\tlogger.info(\"Executing: \" + sql);\n\t\t\t\t\tSystem.out.println(\"Executing: \" + sql);\n\t\t\t\t\tstmt.executeUpdate(sql);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (ClassNotFoundException | SQLException ex) {\n\t\t\tlogger.error(ex);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (stmt != null) {\n\t\t\t\t\tstmt.close();\n\t\t\t\t}\n\t\t\t} catch (SQLException ex) {\n\t\t\t\tlogger.error(ex);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif (connect != null) {\n\t\t\t\t\tconnect.close();\n\t\t\t\t}\n\t\t\t} catch (SQLException ex) {\n\t\t\t\tlogger.error(ex);\n\t\t\t}\n\t\t}\n\t}", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"LOCAL_BEAN\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: id\n \"\\\"saveTime\\\" INTEGER NOT NULL ,\" + // 1: saveTime\n \"\\\"showTitle\\\" TEXT,\" + // 2: showTitle\n \"\\\"showDetail\\\" TEXT,\" + // 3: showDetail\n \"\\\"lat\\\" REAL NOT NULL ,\" + // 4: lat\n \"\\\"lng\\\" REAL NOT NULL ,\" + // 5: lng\n \"\\\"telephone\\\" TEXT,\" + // 6: telephone\n \"\\\"type\\\" INTEGER NOT NULL ,\" + // 7: type\n \"\\\"business\\\" TEXT);\"); // 8: business\n }", "DatabaseTable_DataSource(SQLiteDatabase db) {\n createIfNotExists(db);\n }", "private boolean checkDataBase() {\n\n SQLiteDatabase checkDB = null;\n\n try {\n String myPath = DB_PATH + DATABASE_NAME;\n checkDB = SQLiteDatabase.openDatabase(myPath, null,\n SQLiteDatabase.OPEN_READONLY);\n\n } catch (SQLiteException e) {\n\n // database doesn't exist yet.\n Log.d(\"DATABASE\",\"Database doesn't exist yet.\");\n }\n\n if (checkDB != null) {\n checkDB.close();\n }\n return checkDB != null;\n }", "private boolean checkDataBase() {\r\n SQLiteDatabase checkDB = null;\r\n try {\r\n checkDB = SQLiteDatabase.openDatabase(\"/data/data/me.shubhamgoswami.adharshilasurvey/adharShila.db\", null,\r\n SQLiteDatabase.OPEN_READONLY);\r\n checkDB.close();\r\n } catch (SQLiteException e) {\r\n // database doesn't exist yet.\r\n }\r\n return checkDB != null;\r\n }", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"FEATURE\\\" (\" + //\n \"\\\"ID\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: id\n \"\\\"ADVERTISEMENT_ID\\\" INTEGER,\" + // 1: advertisementId\n \"\\\"DESCRIPTION\\\" TEXT);\"); // 2: description\n }", "private boolean checkDataBase(){\n\n SQLiteDatabase checkDB = null;\n\n try{\n String myPath = DB_PATH + DB_NAME;\n checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);\n\n }catch(SQLiteException e){\n\n //database does't exist yet.\n\n }\n\n if(checkDB != null){\n\n checkDB.close();\n\n }\n\n return checkDB != null ? true : false;\n }", "private boolean checkDataBase(){\n\n SQLiteDatabase checkDB = null;\n\n try{\n String myPath = DB_PATH + DB_NAME;\n checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);\n\n }catch(SQLiteException e){\n\n //database does't exist yet.\n\n }\n\n if(checkDB != null){\n\n checkDB.close();\n\n }\n\n return checkDB != null ? true : false;\n }", "public boolean updateInformationSchemaTable(){\n\t\tSchema currentSchema = Schema.getSchemaInstance();\n\t\tString currentSchemaName = currentSchema.getCurrentSchema();\n\t\tboolean isFound = false;\n\t\ttry {\n\t\t\tRandomAccessFile tablesTableFile = new RandomAccessFile(\"information_schema.table.tbl\", \"rw\");\n\n\t\t\t//Searching to see if the information schema is present or not\n\t\t\twhile(tablesTableFile.getFilePointer() < tablesTableFile.length()){\n\t\t\t\tString readSchemaName = \"\";\n\t\t\t\tbyte varcharLength = tablesTableFile.readByte();\n\t\t\t\tfor(int j = 0; j < varcharLength; j++)\n\t\t\t\t\treadSchemaName += (char)tablesTableFile.readByte();\n\n\t\t\t\tif(readSchemaName.equals(currentSchemaName)){\n\t\t\t\t\tString readTableName = \"\";\n\t\t\t\t\tbyte varcharTableLength = tablesTableFile.readByte();\n\t\t\t\t\tfor(int j = 0; j < varcharTableLength; j++)\n\t\t\t\t\t\treadTableName += (char)tablesTableFile.readByte();\n\n\t\t\t\t\tif(readTableName.equals(tableName)){\n\t\t\t\t\t\tisFound = true;\n\t\t\t\t\t\tSystem.out.println(\"Table '\" + tableName + \"' already exits...\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\ttablesTableFile.readLong();\n\t\t\t\t} else {\n\t\t\t\t\tbyte traverseLength = tablesTableFile.readByte();\n\t\t\t\t\tfor(int j = 0; j < traverseLength; j++)\n\t\t\t\t\t\ttablesTableFile.readByte();\n\t\t\t\t\ttablesTableFile.readLong();\n\t\t\t\t}\t\n\t\t\t}\n\n\t\t\tif(!isFound){\n\t\t\t\t//Traversing to the end of file\n\t\t\t\ttablesTableFile.seek(tablesTableFile.length());\n\t\t\t\ttablesTableFile.writeByte(currentSchemaName.length()); // TABLE_SCHEMA\n\t\t\t\ttablesTableFile.writeBytes(currentSchemaName);\n\t\t\t\ttablesTableFile.writeByte(tableName.length()); // TABLE_NAME\n\t\t\t\ttablesTableFile.writeBytes(tableName);\n\t\t\t\ttablesTableFile.writeLong(0); // TABLE_ROWS\n\t\t\t}\n\n\t\t\ttablesTableFile.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\t\n\t\treturn isFound;\n\t}", "public void createNewDB(String DB_Name) {\n //SQL statement\n String query = \"CREATE database if NOT EXISTS \" + DB_Name;\n\n try {\n //Connection\n stmt = con.createStatement();\n //Execute statement\n stmt.executeUpdate(query);\n System.out.println(\"\\n--Database \" + DB_Name + \" created--\");\n } catch (SQLException ex) {\n //Handle SQL exceptions\n System.out.println(\"\\n--Statement did not execute--\");\n ex.printStackTrace();\n }\n }", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"SHEET\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: id\n \"\\\"SHEET_DATE\\\" INTEGER NOT NULL ,\" + // 1: sheetDate\n \"\\\"RUNNER_ID\\\" INTEGER NOT NULL );\"); // 2: runnerId\n }", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"'MESSAGE_CONFIG' (\" + //\n \"'ID' INTEGER PRIMARY KEY NOT NULL ,\" + // 0: id\n \"'FOLLOW_ME' INTEGER,\" + // 1: followMe\n \"'SUPPORT_ME' INTEGER,\" + // 2: supportMe\n \"'SPONSOR_ME' INTEGER,\" + // 3: sponsorMe\n \"'COMMENT_ME' INTEGER,\" + // 4: commentMe\n \"'RECEIVE_ORG' INTEGER,\" + // 5: receiveOrg\n \"'RECIVE_SELLER' INTEGER,\" + // 6: reciveSeller\n \"'RECIVE_USER' INTEGER,\" + // 7: reciveUser\n \"'RECIVE_FOLLOWER' INTEGER,\" + // 8: reciveFollower\n \"'RECIVE_FOLLOWING' INTEGER);\"); // 9: reciveFollowing\n }", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"'COMMENTARIES' (\" + //\n \"'_id' INTEGER PRIMARY KEY ,\" + // 0: id\n \"'NEWS_ID' INTEGER,\" + // 1: NewsId\n \"'CONTENT' TEXT,\" + // 2: Content\n \"'AUTHOR' TEXT,\" + // 3: Author\n \"'DATE' TEXT,\" + // 4: Date\n \"'USER_ID' TEXT);\"); // 5: UserId\n }", "boolean isNewDatabase() {\n String sql = \"SELECT tbl_name FROM sqlite_master WHERE tbl_name=?\";\n\n return query(new QueryStatement<Boolean>(sql) {\n @Override\n public void prepare(PreparedStatement statement) throws SQLException {\n statement.setString(1, tableName);\n }\n\n @Override\n public Boolean processResults(ResultSet set) throws SQLException {\n return !set.next();\n }\n });\n }", "public static void createDatabaseIfNotExists() throws DaoException {\n\n Path data = Paths.get(DATA_DIR);\n if (!Files.exists(data)) {\n try {\n Files.createDirectory(data);\n Files.createDirectory(Paths.get(DATA_DIR, ACCOUNT_DATA_DIR));\n } catch (IOException ex) {\n throw new DaoException(\"Could not create data directory\", ex);\n }\n }\n\n }", "boolean hasDatabase();", "public static boolean createDBDir() {\n return (new File(path)).mkdirs();\n }", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"LIVE_KIND_OBJ\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: keyL\n \"\\\"COL_NAME\\\" TEXT NOT NULL ,\" + // 1: colName\n \"\\\"COL_ID\\\" TEXT NOT NULL ,\" + // 2: colId\n \"\\\"HAVE_CHILDREN\\\" INTEGER NOT NULL ,\" + // 3: haveChildren\n \"\\\"CHAL_NUM\\\" INTEGER NOT NULL ,\" + // 4: chalNum\n \"\\\"PAGE_NUM\\\" INTEGER NOT NULL ,\" + // 5: pageNum\n \"\\\"C_KNUM\\\" INTEGER NOT NULL ,\" + // 6: cKNum\n \"\\\"P_TYPE\\\" INTEGER NOT NULL );\"); // 7: pType\n // Add Indexes\n db.execSQL(\"CREATE UNIQUE INDEX \" + constraint + \"IDX_LIVE_KIND_OBJ_COL_ID_COL_NAME ON \\\"LIVE_KIND_OBJ\\\"\" +\n \" (\\\"COL_ID\\\" ASC,\\\"COL_NAME\\\" ASC);\");\n }", "@Override\n\t\tpublic void onCreate(SQLiteDatabase database) {\n\t\t\tcreateTable(database);\n\n\t\t}", "void computeNewLayout();", "Database createDatabase();", "private static void doCreate(SQLiteDatabase db) {\r\n Logger.info(Logger.Type.GHOST_SMS, \"*** execute doCreate\");\r\n final Version version = new Version(VERSION_1, Names.GHOST_SMS, DateTimeUtils.currentDateWithoutSeconds());\r\n Versions.insert(db, version);\r\n doUpgrade(db, version.version);\r\n }", "private void createSchema() throws Exception\n {\n LOG.info(\"Creating schema\");\n HibernateUtil.currentSession();\n }", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"GROUP_INFO_ENTITY\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: id\n \"\\\"GROUP_ID\\\" TEXT UNIQUE ,\" + // 1: groupId\n \"\\\"GROUP_NAME\\\" TEXT,\" + // 2: groupName\n \"\\\"GROUP_AVATA\\\" TEXT);\"); // 3: groupAvata\n }", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"'RECYCLE_SCAN' (\" + //\n \"'_id' INTEGER PRIMARY KEY ,\" + // 0: id\n \"'L_PDTG_BATCH' INTEGER NOT NULL ,\" + // 1: lPdtgBatch\n \"'RECYCLE_SCAN_TIME' INTEGER NOT NULL ,\" + // 2: recycleScanTime\n \"'SCAN_CODE' TEXT NOT NULL ,\" + // 3: scanCode\n \"'STATUS' TEXT NOT NULL ,\" + // 4: status\n \"'EDIT_TIME' INTEGER,\" + // 5: editTime\n \"'USER_NAME' TEXT NOT NULL ,\" + // 6: userName\n \"'RECYCLE_TYPE' INTEGER NOT NULL ,\" + // 7: recycleType\n \"'RECYCLE_TYPE_VALUE' TEXT NOT NULL );\"); // 8: recycleTypeValue\n }", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"livechina_chinnel\\\" (\" + //\n \"\\\"TITLE\\\" TEXT PRIMARY KEY NOT NULL ,\" + // 0: title\n \"\\\"URL\\\" TEXT,\" + // 1: url\n \"\\\"TYPE\\\" TEXT,\" + // 2: type\n \"\\\"ORDER\\\" TEXT);\"); // 3: order\n }", "public void dbCreate() {\n Logger.write(\"INFO\", \"DB\", \"Creating database\");\n try {\n if (!Database.DBDirExists())\n Database.createDBDir();\n dbConnect(false);\n for (int i = 0; i < DBStrings.createDB.length; i++)\n execute(DBStrings.createDB[i]);\n } catch (Exception e) {\n Logger.write(\"FATAL\", \"DB\", \"Failed to create databse: \" + e);\n }\n }", "public void createDatabaseFromAssets() throws IOException {\n try {\n copyDatabase();\n }\n catch (IOException e) {\n LogUtility.NoteLog(e);\n throw new Error(\"Error copying database\");\n }\n }", "public void create() {\n\t\t\tdb.execSQL(AGENCYDB_CREATE+\".separete,.import agency.txt agency\");\n\t\t\tdb.execSQL(STOPSDB_CREATE+\".separete,.import stop_times.txt stop_times\");\n\t\t\t\n\t\t\t// Add 2 agencies for testing\n\t\t\t\n\t\t\t\n\t\t\tdb.setVersion(DATABASE_VERSION);\n\t\t}", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"GROUP_INFO_BEAN\\\" (\" + //\n \"\\\"GROUP_ID\\\" TEXT PRIMARY KEY NOT NULL ,\" + // 0: GroupID\n \"\\\"GROUP_NAME\\\" TEXT,\" + // 1: GroupName\n \"\\\"HEAD_ICON\\\" TEXT,\" + // 2: HeadIcon\n \"\\\"ALL_COUNT\\\" INTEGER NOT NULL ,\" + // 3: AllCount\n \"\\\"ON_LINE_COUNT\\\" INTEGER NOT NULL ,\" + // 4: OnLineCount\n \"\\\"USER_ID\\\" TEXT);\"); // 5: userId\n }", "@Override\n public void onCreate(SQLiteDatabase sqLiteDatabase) {\n String sql = \"drop table \" + MelodyData.CreateDB._TABLENAME;\n sqLiteDatabase.execSQL(AccompanimentData.CreateDB._CREATE);\n sqLiteDatabase.execSQL(MelodyData.CreateDB._CREATE);\n }", "public void createTableIfAbsent() {\n try (Statement statement = connection.createStatement()) {\n\n statement.executeUpdate(\"CREATE TABLE IF NOT EXISTS `BookReview`(\" +\n \" id INTEGER PRIMARY KEY AUTOINCREMENT,\" +\n \" title VARCHAR(100),\" +\n \" author_id INTEGER,\" +\n \" FOREIGN KEY (`author_id`) REFERENCES `authors`(`id`)\" +\n \")\");\n\n } catch (SQLException e) {\n throw new BookDaoException(e);\n }\n }", "private Integer createDatabaseSchema(JsonSQLite jsonSQL) {\n int changes = Integer.valueOf(-1);\n boolean success = true;\n // create the PRAGMAS\n ArrayList<String> pragmas = new ArrayList<String>();\n pragmas.add(\"PRAGMA user_version = 1;\");\n pragmas.add(\"PRAGMA foreign_keys = ON;\");\n\n JSObject result1 = this.execSQL(pragmas.toArray(new String[pragmas.size()]));\n changes = result1.getInteger(\"changes\");\n if (changes == -1) return changes;\n\n // create the database schema\n ArrayList<String> statements = new ArrayList<String>();\n statements.add(\"BEGIN TRANSACTION;\");\n\n for (int i = 0; i < jsonSQL.getTables().size(); i++) {\n if (jsonSQL.getTables().get(i).getSchema().size() > 0) {\n if (jsonSQL.getMode().equals(\"full\")) {\n String stmt = new StringBuilder(\"DROP TABLE IF EXISTS \")\n .append(jsonSQL.getTables().get(i).getName())\n .append(\";\")\n .toString();\n statements.add(stmt);\n }\n String stmt = new StringBuilder(\"CREATE TABLE IF NOT EXISTS \")\n .append(jsonSQL.getTables().get(i).getName())\n .append(\" (\")\n .toString();\n for (int j = 0; j < jsonSQL.getTables().get(i).getSchema().size(); j++) {\n if (j == jsonSQL.getTables().get(i).getSchema().size() - 1) {\n if (jsonSQL.getTables().get(i).getSchema().get(j).getColumn() != null) {\n stmt =\n new StringBuilder(stmt)\n .append(jsonSQL.getTables().get(i).getSchema().get(j).getColumn())\n .append(\" \")\n .append(jsonSQL.getTables().get(i).getSchema().get(j).getValue())\n .toString();\n } else if (jsonSQL.getTables().get(i).getSchema().get(j).getForeignkey() != null) {\n stmt =\n new StringBuilder(stmt)\n .append(\"FOREIGN KEY (\")\n .append(jsonSQL.getTables().get(i).getSchema().get(j).getForeignkey())\n .append(\") \")\n .append(jsonSQL.getTables().get(i).getSchema().get(j).getValue())\n .toString();\n }\n } else {\n if (jsonSQL.getTables().get(i).getSchema().get(j).getColumn() != null) {\n stmt =\n new StringBuilder(stmt)\n .append(jsonSQL.getTables().get(i).getSchema().get(j).getColumn())\n .append(\" \")\n .append(jsonSQL.getTables().get(i).getSchema().get(j).getValue())\n .append(\",\")\n .toString();\n } else if (jsonSQL.getTables().get(i).getSchema().get(j).getForeignkey() != null) {\n stmt =\n new StringBuilder(stmt)\n .append(\"FOREIGN KEY (\")\n .append(jsonSQL.getTables().get(i).getSchema().get(j).getForeignkey())\n .append(\") \")\n .append(jsonSQL.getTables().get(i).getSchema().get(j).getValue())\n .append(\",\")\n .toString();\n }\n }\n }\n stmt = new StringBuilder(stmt).append(\");\").toString();\n statements.add(stmt);\n }\n if (jsonSQL.getTables().get(i).getIndexes().size() > 0) {\n for (int j = 0; j < jsonSQL.getTables().get(i).getIndexes().size(); j++) {\n String stmt = new StringBuilder(\"CREATE INDEX IF NOT EXISTS \")\n .append(jsonSQL.getTables().get(i).getIndexes().get(j).getName())\n .append(\" ON \")\n .append(jsonSQL.getTables().get(i).getName())\n .append(\" (\")\n .append(jsonSQL.getTables().get(i).getIndexes().get(j).getColumn())\n .append(\");\")\n .toString();\n statements.add(stmt);\n }\n }\n }\n\n if (statements.size() > 1) {\n statements.add(\"COMMIT TRANSACTION;\");\n JSObject result = this.execSQL(statements.toArray(new String[statements.size()]));\n changes = result.getInteger(\"changes\");\n if (changes == -1) {\n success = false;\n }\n } else {\n changes = Integer.valueOf(0);\n }\n if (!success) {\n changes = Integer.valueOf(-1);\n }\n return changes;\n }", "@Override\r\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_MACHINE);\r\n\r\n // Create tables again\r\n onCreate(db);\r\n }", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"'P7P4' (\" + //\n \"'_id' INTEGER PRIMARY KEY ,\" + // 0: id\n \"'LFDC' INTEGER,\" + // 1: lfdc\n \"'LFPE' INTEGER,\" + // 2: lfpe\n \"'LFCD' INTEGER,\" + // 3: lfcd\n \"'LFAU' INTEGER,\" + // 4: lfau\n \"'ORIGEN' INTEGER,\" + // 5: origen\n \"'OBSER' TEXT,\" + // 6: obser\n \"'ID_FORMULARIO' INTEGER);\"); // 7: id_formulario\n }", "private boolean checkDataBase()\r\n {\r\n SQLiteDatabase checkDB = null;\r\n try {\r\n String myPath = DB_PATH;\r\n checkDB\r\n = SQLiteDatabase\r\n .openDatabase(\r\n myPath, null,\r\n SQLiteDatabase.OPEN_READONLY);\r\n }\r\n catch (SQLiteException e) {\r\n\r\n // database doesn't exist yet.\r\n Log.e(\"message\", \"\" + e);\r\n }\r\n if (checkDB != null) {\r\n checkDB.close();\r\n }\r\n return checkDB != null;\r\n }", "public void createNewDataBase() {\n try (Connection conn = DriverManager.getConnection(url)) {\n if (conn != null) {\n DatabaseMetaData meta = conn.getMetaData();\n createNewTable();\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "protected void setupDB() {\n\t\tlog.info(\"------------------------------------------\");\n\t\tlog.info(\"Initialization database started\");\n\t\tlog.info(\"ddl: db-config.xml\");\n\t\tlog.info(\"------------------------------------------\");\n\t\ttry {\n\t\t\tfinal List<String> lines = Files.readAllLines(Paths.get(this.getClass()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getClassLoader()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getResource(\"create-campina-schema.sql\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.toURI()), Charset.forName(\"UTF-8\"));\n\n\t\t\tfinal List<String> statements = new ArrayList<>(lines.size());\n\t\t\tString statement = \"\";\n\t\t\tfor (String string : lines) {\n\t\t\t\tstatement += \" \" + string;\n\t\t\t\tif (string.endsWith(\";\")) {\n\t\t\t\t\tstatements.add(statement);\n\t\t\t\t\tstatement = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry (final Connection con = conManager.getConnection(Boolean.FALSE)) {\n\t\t\t\ttry (final PreparedStatement pstmt = con.prepareStatement(\"DROP SCHEMA IF EXISTS campina\")) {\n\t\t\t\t\tpstmt.executeUpdate();\n\t\t\t\t}\n\t\t\t\tfor (String string : statements) {\n\t\t\t\t\tlog.info(\"Executing ddl: \" + string);\n\t\t\t\t\ttry (final PreparedStatement pstmt = con.prepareStatement(string)) {\n\t\t\t\t\t\tpstmt.executeUpdate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (SQLException e) {\n\t\t\t\tthrow new IllegalStateException(\"Could not setup db\", e);\n\t\t\t}\n\t\t} catch (Throwable e) {\n\t\t\tlog.error(\"Could not setup database\", e);\n\t\t\tthrow new IllegalStateException(\"ddl file load failed\", e);\n\t\t}\n\t\tlog.info(\"------------------------------------------\");\n\t\tlog.info(\"Initialization database finished\");\n\t\tlog.info(\"------------------------------------------\");\n\t}", "private void createDatabase(final String databaseName) {\n\n try {\n final Connection connection =\n DriverManager.getConnection(url + databaseName, databaseProperties);\n\n try {\n NaviLogger.info(\"[i] Generating database tables for %s.\", databaseName);\n connection.prepareStatement(AbstractSQLProvider.parseResourceAsSQLFile(\n this.getClass().getResourceAsStream(TEST_DATA_DIRECTORY + \"database_schema.sql\")))\n .execute();\n } catch (final IOException exception) {\n CUtilityFunctions.logException(exception);\n }\n\n final File testDataDir = new File(\n \"./third_party/zynamics/javatests/com/google/security/zynamics/binnavi/testdata/\"\n + databaseName + \"/\");\n\n final CopyManager manager = new CopyManager((BaseConnection) connection);\n\n for (final File currentFile : testDataDir.listFiles()) {\n try (FileReader reader = new FileReader(currentFile)) {\n final String tableName = currentFile.getName().split(\".sql\")[0];\n NaviLogger.info(\"[i] Importing: %s.%s from %s\", databaseName, tableName,\n currentFile.getAbsolutePath());\n manager.copyIn(\"COPY \" + tableName + \" FROM STDIN\", reader);\n } catch (final IOException exception) {\n CUtilityFunctions.logException(exception);\n }\n }\n\n try {\n NaviLogger.warning(\"[i] Generating constraints for %s.\", databaseName);\n connection.prepareStatement(AbstractSQLProvider.parseResourceAsSQLFile(\n this.getClass().getResourceAsStream(TEST_DATA_DIRECTORY + \"database_constraints.sql\")))\n .execute();\n } catch (final IOException exception) {\n CUtilityFunctions.logException(exception);\n }\n\n final String findSequencesQuery = \"SELECT 'SELECT SETVAL(' ||quote_literal(S.relname)|| \"\n + \"', MAX(' ||quote_ident(C.attname)|| ') ) FROM ' ||quote_ident(T.relname)|| ';' \"\n + \" FROM pg_class AS S, pg_depend AS D, pg_class AS T, pg_attribute AS C \"\n + \" WHERE S.relkind = 'S' AND S.oid = D.objid AND D.refobjid = T.oid \"\n + \" AND D.refobjid = C.attrelid AND D.refobjsubid = C.attnum ORDER BY S.relname; \";\n\n try (PreparedStatement statement = connection.prepareStatement(findSequencesQuery);\n ResultSet resultSet = statement.executeQuery()) {\n while (resultSet.next()) {\n final PreparedStatement fixSequence = connection.prepareStatement(resultSet.getString(1));\n fixSequence.execute();\n }\n } catch (final SQLException exception) {\n CUtilityFunctions.logException(exception);\n }\n\n } catch (final SQLException exception) {\n CUtilityFunctions.logException(exception);\n }\n }", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"'P5P10' (\" + //\n \"'_id' INTEGER PRIMARY KEY ,\" + // 0: id\n \"'ARMF' INTEGER,\" + // 1: armf\n \"'PCTF' INTEGER,\" + // 2: pctf\n \"'ESAL' INTEGER,\" + // 3: esal\n \"'BEN' INTEGER,\" + // 4: ben\n \"'CDEL' INTEGER,\" + // 5: cdel\n \"'DTRA' INTEGER,\" + // 6: dtra\n \"'FOTL' INTEGER,\" + // 7: fotl\n \"'ORIGEN' INTEGER,\" + // 8: origen\n \"'OBSER' TEXT,\" + // 9: obser\n \"'ID_FORMULARIO' INTEGER);\"); // 10: id_formulario\n }", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"'LOCAL_SUB_TYPE_ID' (\" + //\n \"'TYPE_ID' TEXT PRIMARY KEY NOT NULL ,\" + // 0: typeId\n \"'LOCAL_UPDATE_TIME' INTEGER,\" + // 1: localUpdateTime\n \"'LOCALNAME' TEXT);\"); // 2: localname\n }", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"'SELLER' (\" + //\n \"'ID' INTEGER PRIMARY KEY NOT NULL ,\" + // 0: id\n \"'MEMBER_ID' INTEGER,\" + // 1: memberId\n \"'NAME' TEXT,\" + // 2: name\n \"'PIC' TEXT,\" + // 3: pic\n \"'GENDER' INTEGER,\" + // 4: gender\n \"'AGE' INTEGER,\" + // 5: age\n \"'MOBILE_PHONE' INTEGER,\" + // 6: mobilePhone\n \"'EMAIL' TEXT,\" + // 7: email\n \"'LEVEL' INTEGER,\" + // 8: level\n \"'CREATE_TIME' TEXT,\" + // 9: createTime\n \"'BE_GOOD_TYPE' TEXT,\" + // 10: beGoodType\n \"'MANAGE_EVENT_COUNT' INTEGER,\" + // 11: manageEventCount\n \"'SALE_AMOUNT_COUNT' INTEGER,\" + // 12: saleAmountCount\n \"'AUDIENCE_AMOUNT_COUNT' INTEGER,\" + // 13: audienceAmountCount\n \"'FOLLOWING_COUNT' INTEGER,\" + // 14: followingCount\n \"'FOLLOWERS_COUNT' INTEGER,\" + // 15: followersCount\n \"'SUPPORT_COUNT' INTEGER);\"); // 16: supportCount\n }", "private boolean checkDataBase() {\n// boolean checkDB = false;\n File dbfile = null;\n try {\n String myPath = DBLOCATION + DBNAME;\n dbfile = new File(myPath);\n// checkDB = dbfile.exists();\n } catch (SQLiteException e) {\n }\n// return checkDB;\n return dbfile.exists();\n }", "@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TODO_TABLE);\n //Create tables again\n onCreate(db);\n }", "public void initDb() {\n String createVac = \"create table if not exists vacancies(id serial primary key,\"\n + \"name varchar(1500) NOT NULL UNIQUE, url varchar (1500), description text, dateVac timestamp);\";\n try (Statement st = connection.createStatement()) {\n st.execute(createVac);\n } catch (SQLException e) {\n LOG.error(e.getMessage());\n }\n }", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"'TABLE__STATUS' (\" + //\n \"'_ID' INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: _id\n \"'STATUS_ID' INTEGER UNIQUE ,\" + // 1: statusId\n \"'STATUS_NAME' TEXT);\"); // 2: statusName\n }", "@Override\n public void onUpgrade(SQLiteDatabase db, int arg1, int arg2) {\n db.execSQL(\"DROP TABLE IF EXIST\" + TABLE_NAME);\n onCreate(db);\n\n }", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"NEWS\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY ,\" + // 0: _id\n \"\\\"IMGURL\\\" TEXT,\" + // 1: imgurl\n \"\\\"HAS_CONTENT\\\" TEXT,\" + // 2: has_content\n \"\\\"DOCURL\\\" TEXT,\" + // 3: docurl\n \"\\\"TIME\\\" TEXT,\" + // 4: time\n \"\\\"TITLE\\\" TEXT,\" + // 5: title\n \"\\\"CHANNELNAME\\\" TEXT,\" + // 6: channelname\n \"\\\"ID\\\" INTEGER NOT NULL );\"); // 7: id\n }", "public static void createTable(SQLiteDatabase db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"HEALTH_RECORD__STATUS\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY ,\" + // 0: id\n \"\\\"UPDATE_TYPE\\\" TEXT,\" + // 1: updateType\n \"\\\"PERSON_ID\\\" TEXT UNIQUE ,\" + // 2: personId\n \"\\\"MACHINE_NO\\\" TEXT,\" + // 3: machineNo\n \"\\\"NAME\\\" TEXT,\" + // 4: name\n \"\\\"RECORD_RESULT_CODE\\\" TEXT,\" + // 5: recordResultCode\n \"\\\"RECORD_RESULT_DESC\\\" TEXT);\"); // 6: recordResultDesc\n }", "public void copyDatabaseFromAsset() {\n\n /** Just to calculate time How much it will take to copy database */\n //Utility t = new Utility();\n\n\t\t/* Insert Database */\n DBHelper db = new DBHelper(this);\n\n try {\n boolean dbExist = db.isDataBaseAvailable();\n\n if (!dbExist)\n db.copyDataBaseFromAsset();\n\n /* Force fully calling onCreate to create table of Favourite*/\n //db.onCreate(db.getWritableDatabase());\n\n } catch (Exception e) {\n AppLogger.writeLog(\"state \" + TAG + \" -- \" + e.toString());\n\n if (AppConstants.DEBUG)\n Log.e(\"\", e.toString());\n }\n }", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"EXAM_QUESTION\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: id\n \"\\\"TITLE\\\" TEXT,\" + // 1: title\n \"\\\"TYPE\\\" INTEGER NOT NULL ,\" + // 2: type\n \"\\\"ANSWER_A\\\" TEXT,\" + // 3: answerA\n \"\\\"ANSWER_B\\\" TEXT,\" + // 4: answerB\n \"\\\"ANSWER_C\\\" TEXT,\" + // 5: answerC\n \"\\\"ANSWER_D\\\" TEXT,\" + // 6: answerD\n \"\\\"REAL_ANSWER\\\" TEXT);\"); // 7: realAnswer\n }", "public boolean databaseExists() {\n return defaultDatabaseExists();\n }", "@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)\n {\n if(newVersion > oldVersion){\n try {\n this.dbCreate();\n }catch (Exception e){\n e.printStackTrace();\n }\n }\n }", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"USER\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY AUTOINCREMENT ,\" + // 0: id\n \"\\\"NAME\\\" TEXT,\" + // 1: name\n \"\\\"AGE\\\" INTEGER NOT NULL ,\" + // 2: age\n \"\\\"INTRO\\\" TEXT,\" + // 3: intro\n \"\\\"SCORE\\\" INTEGER NOT NULL ,\" + // 4: score\n \"\\\"LEVEL\\\" INTEGER NOT NULL ,\" + // 5: level\n \"\\\"LEVEL2\\\" INTEGER NOT NULL );\"); // 6: level2\n }", "public void startDatabase(SQLiteDatabase db)\n {\n\n String sqlNotas = \"CREATE TABLE IF NOT EXISTS NOTAS (\"\n + \"TITULO text,\"\n + \"CONTEUDO text\"\n +\")\";\n\n\n //db.execSQL(dropNotas);\n db.execSQL(sqlNotas);\n\n }", "public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"SECURITY_ITEMS\\\" (\" + //\n \"\\\"_id\\\" INTEGER PRIMARY KEY ,\" + // 0: id\n \"\\\"IS_SELECTE\\\" INTEGER NOT NULL ,\" + // 1: isSelecte\n \"\\\"EXAMINE_PERIOD_DESC\\\" TEXT,\" + // 2: examinePeriodDesc\n \"\\\"EXAMINE_TIME\\\" TEXT,\" + // 3: examineTime\n \"\\\"EXAMINE_SITE\\\" TEXT,\" + // 4: examineSite\n \"\\\"EXAMINE_LOCATION\\\" TEXT,\" + // 5: examineLocation\n \"\\\"EXAMINE_PROJECT\\\" TEXT,\" + // 6: examineProject\n \"\\\"EXAMINE_CONTEXT\\\" TEXT,\" + // 7: examineContext\n \"\\\"STATE\\\" TEXT,\" + // 8: state\n \"\\\"CHECKER\\\" TEXT,\" + // 9: checker\n \"\\\"CHECKER_ID\\\" TEXT,\" + // 10: checkerId\n \"\\\"REMARK\\\" TEXT);\"); // 11: remark\n }", "boolean hasColumnLayout();", "private void createSchemaInfo() {\n\t\tfor (String tableName : tableSchemas.keySet()) {\n\t\t\tERWinSchemaInfo schemaInfo = new ERWinSchemaInfo();\n\t\t\tschemaInfo.setType(\"user\");\n\t\t\tschemaInfo.setUniqueName(tableName);\n\t\t\tschemaInfos.put(tableName, schemaInfo);\n\t\t}\n\n\t\tinitCache();\n\t\tparseKeyGroupGroups();\n\n\t\tparseEntityProps();\n\t\tparseRelationGroups();\n\t\tparseAttributes();\n\n\t\tcreateSchemaDDL();\n\t}", "private TableLayoutDesc makeMinimalValidLayout() {\n RowKeyFormat2 format = makeHashPrefixedRowKeyFormat();\n\n makeHashPrefixedRowKeyFormat();\n return TableLayoutDesc.newBuilder()\n .setName(\"table_name\")\n .setKeysFormat(format)\n .setVersion(TABLE_LAYOUT_VERSION)\n .setLocalityGroups(Lists.newArrayList(\n makeMinimalLocalityGroup()\n ))\n .build();\n }", "private void createDatabase() throws Exception{\n Statement stm = this.con.createStatement();\n stm.execute(\"CREATE DATABASE IF NOT EXISTS \" + database +\n \" DEFAULT CHARACTER SET utf8 COLLATE utf8_persian_ci\");\n }", "private boolean databaseExists() {\n File dbFile = mContext.getDatabasePath(DBNAME);\n return dbFile.exists();\n }", "public boolean checkDataBase(){\n \n \tSQLiteDatabase checkDB = null;\n \tLog.d(\"We're Here\", \"DatabaseHelper.checkDataBase()\");\n \ttry{\n \t\tString myPath = DB_PATH + DB_NAME;\n \t\tcheckDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);\n \n \t}catch(SQLiteException e){\n \n \t\tLog.d(\"We're Here\", \"Database doesn't exist\");\n \t\tLog.d(\"Database Error\", e.toString());\n \n \t}\n \tcatch (Exception e) { \n \t\tLog.d(\"Exception in checkDatabase\", e.toString());\n \t\t\n \t}\n \n \tif(checkDB != null){\n \n \t\tcheckDB.close();\n \n \t}\n \n \treturn checkDB != null;\n }" ]
[ "0.6325513", "0.5870481", "0.5865111", "0.5765307", "0.57004976", "0.56544256", "0.5637524", "0.5637524", "0.5630174", "0.5621281", "0.5613548", "0.5600538", "0.55982774", "0.55538213", "0.55401266", "0.5536526", "0.55310106", "0.5498053", "0.5463387", "0.54586565", "0.5456868", "0.5440561", "0.5432447", "0.54043376", "0.53868014", "0.5348477", "0.53223515", "0.5320189", "0.5317037", "0.53039473", "0.52628535", "0.5244172", "0.52404374", "0.52371866", "0.52310663", "0.52261", "0.52244914", "0.5220727", "0.5219516", "0.5218429", "0.521149", "0.5198092", "0.5194313", "0.5194104", "0.5190652", "0.5190652", "0.5187382", "0.5173101", "0.5167057", "0.5162086", "0.51560754", "0.5154384", "0.5154202", "0.5151147", "0.5145212", "0.51376134", "0.5132912", "0.512794", "0.51250166", "0.51227033", "0.5115029", "0.5114138", "0.5109224", "0.5107442", "0.5104944", "0.50942457", "0.5094052", "0.50909054", "0.50845534", "0.5083351", "0.5082322", "0.50735444", "0.5072448", "0.50641114", "0.5061853", "0.5058279", "0.50523704", "0.5043464", "0.5042184", "0.5042", "0.5039379", "0.5032851", "0.503104", "0.5028862", "0.5021977", "0.5019563", "0.5018199", "0.5010947", "0.5010647", "0.5010338", "0.5008696", "0.500823", "0.5001369", "0.49989408", "0.4998771", "0.4996579", "0.49830368", "0.49826908", "0.49782512", "0.49711522" ]
0.66593176
0
Creates a new database with all tables
private void createTables() throws DatabaseAccessException { Statement stmt = null; PreparedStatement prepStmt = null; try { stmt = this.connection.createStatement(); // be sure to drop all tables in case someone manipulated the database manually stmt.executeUpdate("DROP TABLE IF EXISTS DynamicConstraints;"); stmt.executeUpdate("DROP TABLE IF EXISTS Features;"); stmt.executeUpdate("DROP TABLE IF EXISTS Groups;"); stmt.executeUpdate("DROP TABLE IF EXISTS Metadata;"); stmt.executeUpdate("DROP TABLE IF EXISTS Objects;"); stmt.executeUpdate("DROP TABLE IF EXISTS StaticConstraints;"); stmt.executeUpdate("DROP TABLE IF EXISTS Subspaces;"); // populate database with tables.. by using ugly sql stmt.executeUpdate("CREATE TABLE DynamicConstraints(Id INTEGER PRIMARY KEY AUTOINCREMENT," + " Operator INTEGER, FeatureReference INTEGER," + " GroupReference INTEGER, Value FLOAT, Active BOOLEAN);"); stmt.executeUpdate("CREATE TABLE Features(Id INTEGER PRIMARY KEY AUTOINCREMENT," + " Name VARCHAR(" + DatabaseConfiguration.VARCHARLENGTH + "), OutlierFlag BOOLEAN, Min FLOAT, Max FLOAT);"); stmt.executeUpdate("CREATE TABLE Groups(Id INTEGER PRIMARY KEY AUTOINCREMENT, Name VARCHAR(" + DatabaseConfiguration.VARCHARLENGTH + ")," + " Visibility BOOLEAN, Color INTEGER, ColorCalculatedByFeature INTEGER, Description TEXT);"); stmt.executeUpdate("CREATE TABLE Metadata(Version INTEGER);"); // Object table is created in initFeatures, to boost performance stmt.executeUpdate("CREATE TABLE StaticConstraints(Id INTEGER, GroupReference INTEGER," + " ObjectReference INTEGER, Active BOOLEAN);"); stmt.executeUpdate("CREATE TABLE Subspaces(Id INTEGER, FeatureReference INTEGER," + " Name VARCHAR(" + DatabaseConfiguration.VARCHARLENGTH + "));"); stmt.close(); // after creating the tables, write the layout version prepStmt = this.connection.prepareStatement("INSERT INTO Metadata VALUES(?);"); prepStmt.setInt(1, DatabaseConfiguration.LAYOUTVERSION); prepStmt.execute(); prepStmt.close(); } catch (SQLException e) { throw new DatabaseAccessException(Failure.LAYOUT); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createNewDataBase() {\n try (Connection conn = DriverManager.getConnection(url)) {\n if (conn != null) {\n DatabaseMetaData meta = conn.getMetaData();\n createNewTable();\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "private void createDatabase() throws SQLException\r\n {\r\n myStmt.executeUpdate(\"create database \" + dbname);\r\n }", "public static void createDataBase() {\n final Configuration conf = new Configuration();\n\n addAnnotatedClass(conf);\n\n conf.configure();\n new SchemaExport(conf).create(true, true);\n }", "public void dbCreate() {\n Logger.write(\"INFO\", \"DB\", \"Creating database\");\n try {\n if (!Database.DBDirExists())\n Database.createDBDir();\n dbConnect(false);\n for (int i = 0; i < DBStrings.createDB.length; i++)\n execute(DBStrings.createDB[i]);\n } catch (Exception e) {\n Logger.write(\"FATAL\", \"DB\", \"Failed to create databse: \" + e);\n }\n }", "public void createNewSchema() throws SQLException {\n ResultSet resultSet = databaseStatement.executeQuery(\"select count(datname) from pg_database\");\n int uniqueID = 0;\n if(resultSet.next()) {\n uniqueID = resultSet.getInt(1);\n }\n if(uniqueID != 0) {\n uniqueID++;\n databaseStatement.executeQuery(\"CREATE DATABASE OSM\"+uniqueID+\";\");\n }\n }", "Database createDatabase();", "public static void createDatabase() throws SQLException {\n\t\tSystem.out.println(\"DROP database IF EXISTS project02;\");\n\t\tstatement = connection.prepareStatement(\"DROP database IF EXISTS project02;\");\n\t\tstatement.executeUpdate();\n\t\tSystem.out.println(\"CREATE database project02;\");\n\t\tstatement = connection.prepareStatement(\"CREATE database project02;\");\n\t\tstatement.executeUpdate();\n\t\tSystem.out.println(\"USE project02;\");\n\t\tstatement = connection.prepareStatement(\"USE project02;\");\n\t\tstatement.executeUpdate();\n\t}", "private void createDB() {\n try {\n Statement stat = conn.createStatement();\n stat.execute(\"CREATE TABLE settings (name TEXT, state);\");\n stat.execute(\"CREATE TABLE expressions (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n stat.execute(\"CREATE TABLE summaries (id INTEGER PRIMARY KEY ASC, expression_id INTEGER, title TEXT, abstract TEXT);\");\n stat.execute(\"CREATE TABLE history (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n } catch (SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n System.exit(0);\n }\n }", "private static void initializeDatabase()\n\t{\n\t\tResultSet resultSet = dbConnect.getMetaData().getCatalogs();\n\t\tStatment statement = dbConnect.createStatement();\n\t\t\n\t\tif (resultSet.next())\n\t\t{\n\t\t\tstatement.execute(\"USE \" + resultSet.getString(1));\n\t\t\tstatement.close();\n\t\t\tresultSet.close();\n\t\t\treturn; //A database exists already\n\t\t}\n\t\tresultSet.close();\n\t\t//No database exists yet, create it.\n\t\t\n\t\tstatement.execute(\"CREATE DATABASE \" + dbName);\n\t\tstatement.execute(\"USE \" + dbName);\n\t\tstatement.execute(createTableStatement);\n\t\tstatement.close();\n\t\treturn;\n\t}", "public void createDB() {\n\t\ttry {\n\t\t\tBufferedReader br= new BufferedReader(new FileReader(\"db_schema.txt\"));\n\t\t\tString line= null;\n\t\t\tStringBuilder sb= new StringBuilder();\n\t\t\twhile ((line=br.readLine())!=null){\n\t\t\t\tsb.append(line);\n\t\t\t\tif(sb.length()>0 && sb.charAt(sb.length()-1)==';'){//see if it is the end of one line of command\n\t\t\t\t\tstatement.executeUpdate(sb.toString());\n\t\t\t\t\tsb= new StringBuilder();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void createDatabase() throws Exception{\n Statement stm = this.con.createStatement();\n stm.execute(\"CREATE DATABASE IF NOT EXISTS \" + database +\n \" DEFAULT CHARACTER SET utf8 COLLATE utf8_persian_ci\");\n }", "public void setupDB()\r\n\t{\n\tjdbcTemplateObject.execute(\"DROP TABLE IF EXISTS employee1 \");\r\n\r\n\tjdbcTemplateObject.\r\n\texecute(\"CREATE TABLE employee1\"\r\n\t+ \"(\" + \"name VARCHAR(255), id SERIAL)\");\r\n\t}", "void createDb(String dbName);", "private void createTables() {\n\n\t\tAutoDao.createTable(db, true);\n\t\tAutoKepDao.createTable(db, true);\n\t\tMunkaDao.createTable(db, true);\n\t\tMunkaEszkozDao.createTable(db, true);\n\t\tMunkaKepDao.createTable(db, true);\n\t\tMunkaTipusDao.createTable(db, true);\n\t\tPartnerDao.createTable(db, true);\n\t\tPartnerKepDao.createTable(db, true);\n\t\tProfilKepDao.createTable(db, true);\n\t\tSoforDao.createTable(db, true);\n\t\tTelephelyDao.createTable(db, true);\n\t\tPushMessageDao.createTable(db, true);\n\n\t}", "public void createIntegrationTestDatabase() throws SQLException {\n\n final Connection connection = DriverManager.getConnection(url + \"postgres\", databaseProperties);\n\n connection.prepareStatement(\"DROP DATABASE IF EXISTS test_disassembly\").execute();\n connection.prepareStatement(\"DROP DATABASE IF EXISTS test_import\").execute();\n connection.prepareStatement(\"DROP DATABASE IF EXISTS test_empty\").execute();\n\n connection.prepareStatement(\"CREATE DATABASE test_disassembly\").execute();\n connection.prepareStatement(\"CREATE DATABASE test_import\").execute();\n connection.prepareStatement(\"CREATE DATABASE test_empty\").execute();\n\n connection.close();\n\n createDatabase(TEST_IMPORT);\n createDatabase(TEST_DISASSEMBLY);\n }", "public static void createDB(String name) {\n\t\ttry {\n\t\t\tString Query = \"CREATE DATABASE \" + name;\n\t\t\tStatement st = conexion.createStatement();\n\t\t\tst.executeUpdate(Query);\n\t\t\tSystem.out.println(\"DB creada con exito!\");\n\n\t\t\tJOptionPane.showMessageDialog(null, \"Se ha creado la DB \" + name + \"de forma exitosa.\");\n\t\t} catch (SQLException ex) {\n\t\t\tSystem.out.println(ex.getMessage());\n\t\t\tSystem.out.println(\"Error creando la DB.\");\n\t\t}\n\t}", "public void createTables()\n {\n String[] sqlStrings = createTablesStatementStrings();\n String sqlString;\n Statement statement;\n\n System.out.println(\"Creating table(s):\" +\n Arrays.toString(tableNames));\n for (int i=0; i<sqlStrings.length; i++)\n try\n {\n statement = connect.createStatement();\n\n sqlString = sqlStrings[i];\n\n System.out.println(\"SQL: \" + sqlString);\n\n statement.executeUpdate(sqlString);\n }\n catch (SQLException ex)\n {\n System.out.println(\"Error creating table: \" + ex);\n Logger.getLogger(DatabaseManagementDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void createDatabase(String dbName, String owner) throws Exception;", "@Override\n\tpublic void onCreate(SQLiteDatabase database) {\n\t\tcreateTables(database);\n\t}", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tString[] tables = CREATE_TABLES.split(\";\");\n\t\tfor(String SQL : tables){\n\t\t db.execSQL(SQL);\n\t\t}\n\t}", "public static void createAllTables(SQLiteDatabase db, boolean ifNotExists) {\n UserDao.createTable(db, ifNotExists);\n SbjectDao.createTable(db, ifNotExists);\n SourceDao.createTable(db, ifNotExists);\n }", "public void creatDataBase(String dbName);", "@Override\n\t\tpublic void onCreate(SQLiteDatabase database) {\n\t\t\tcreateTable(database);\n\n\t\t}", "public void initDb() {\n String createVac = \"create table if not exists vacancies(id serial primary key,\"\n + \"name varchar(1500) NOT NULL UNIQUE, url varchar (1500), description text, dateVac timestamp);\";\n try (Statement st = connection.createStatement()) {\n st.execute(createVac);\n } catch (SQLException e) {\n LOG.error(e.getMessage());\n }\n }", "public void createDatabase() throws IOException {\n boolean dbExists = checkDatabase();\n\n if (dbExists) {\n // Do nothing - database already exists\n } else {\n // By calling this method an empty database will be created into the\n // default system path of our application so we are going to be able\n // to overwrite the database with our database.\n this.getReadableDatabase();\n\n try {\n copyDatabase();\n } catch (IOException e) {\n throw new Error(\"Error copying database\");\n }\n }\n }", "public static void createAllTables(SQLiteDatabase db, boolean ifNotExists) {\n\t\tProvinceDao.createTable(db, ifNotExists);\n\t\tCityDao.createTable(db, ifNotExists);\n\t\tCityAreaDao.createTable(db, ifNotExists);\n\t}", "public void createDB() {\n String url = \"jdbc:sqlite:stats.db\";\n Statement stmt = null;\n try (Connection conn = DriverManager.getConnection(url)) {\n stmt = conn.createStatement();\n String query = \"CREATE TABLE IF NOT EXISTS games \"\n + \"(ownships int, \"\n + \"ownremaining int, \"\n + \"aiships int,\"\n + \"airemaining int, \"\n + \"turns int)\";\n\n stmt.executeUpdate(query);\n\n } catch (SQLException ex) {\n System.out.println(ex.getMessage());\n }\n }", "public void createDatabase(String sDBName) throws SQLException{\n\t\tloadDriver();\n\t\tConnection conn = DriverManager.getConnection(protocol + dbName\n + \";create=true\", new Properties());\n\t\tcloseJDBCResources(conn);\t\t\n\t}", "public void createDatabase(String databaseName)\n\t{\n\t\tclearConnection();\n\t\ttry\n\t\t{\n\t\t\tStatement createDatabaseStatement = databaseConnection.createStatement();\n\t\t\t\n\t\t\tint result = createDatabaseStatement.executeUpdate(\"CREATE DATABASE IF NOT EXISTS \" + databaseName + \";\");\n\t\t}\n\t\tcatch (SQLException currentSQLError)\n\t\t{\n\t\t\tdisplaySQLErrors(currentSQLError);\n\t\t}\n\t}", "public void createDatabase() throws IOException{\r\n\r\n boolean dbDoesExist = checkDatabase();\r\n if(!dbDoesExist)\r\n {\r\n // Create or open db if db is not connected\r\n this.getReadableDatabase();\r\n try{\r\n createNewDB();\r\n }catch (IOException e){\r\n throw new Error(\"DB Copy Failed\");\r\n }\r\n }\r\n }", "private void createTables() throws SQLException\r\n {\r\n createTableMenuItems();\r\n createTableOrdersWaiting();\r\n }", "void go() {\n\t\tthis.conn = super.getConnection();\n\t\tcreateCustomersTable();\n\t\tcreateBankersTable();\n\t\tcreateCheckingAccountsTable();\n\t\tcreateSavingsAccountsTable();\n\t\tcreateCDAccountsTable();\n\t\tcreateTransactionsTable();\n\t\tcreateStocksTable();\n\t\tif(createAdminBanker) addAdminBanker();\n\t\tSystem.out.println(\"Database Created\");\n\n\t}", "public static void createDatabase() throws ArcException {\n\t\tcreateDatabase(userWithRestrictedRights);\t\t\n\t}", "public static void createAllTables(SQLiteDatabase db, boolean ifNotExists) {\n UserDao.createTable(db, ifNotExists);\n TopCategoriesDao.createTable(db, ifNotExists);\n CategoriesDao.createTable(db, ifNotExists);\n BrandsDao.createTable(db, ifNotExists);\n StoreDao.createTable(db, ifNotExists);\n PostDao.createTable(db, ifNotExists);\n ProductDao.createTable(db, ifNotExists);\n BrandUpdatesDao.createTable(db, ifNotExists);\n TipsDao.createTable(db, ifNotExists);\n RelatedProductsDao.createTable(db, ifNotExists);\n PostCollectionDao.createTable(db, ifNotExists);\n }", "public void createNewDB(String DB_Name) {\n //SQL statement\n String query = \"CREATE database if NOT EXISTS \" + DB_Name;\n\n try {\n //Connection\n stmt = con.createStatement();\n //Execute statement\n stmt.executeUpdate(query);\n System.out.println(\"\\n--Database \" + DB_Name + \" created--\");\n } catch (SQLException ex) {\n //Handle SQL exceptions\n System.out.println(\"\\n--Statement did not execute--\");\n ex.printStackTrace();\n }\n }", "public void createDataBase() throws IOException{\n \n \tboolean dbExist = checkDataBase();\n \t\n \n \tif(dbExist){\n \t\t//do nothing - database already exists\n \t\tLog.d(\"Database Check\", \"Database Exists\");\n\n \t}else{\n \t\tLog.d(\"Database Check\", \"Database Doesn't Exist\");\n \t\tthis.close();\n \t\t//By calling this method and empty database will be created into the default system path\n //of your application so we are gonna be able to overwrite that database with our database.\n \tthis.getReadableDatabase();\n \tthis.close();\n \ttry {\n \t\t\tcopyDataBase();\n \t\t\tLog.d(\"Database Check\", \"Database Copied\");\n \n \t\t} catch (IOException e) {\n \t\tLog.d(\"I/O Error\", e.toString());\n\n \t\tthrow new Error(\"Error copying database\");\n \t}\n \tcatch (Exception e) { \n \t\tLog.d(\"Exception in createDatabase\", e.toString());\n \t\t\n \t}\n \t}\n \n }", "public static void createAllTables(Database db, boolean ifNotExists) {\n DiaryReviewDao.createTable(db, ifNotExists);\n EncourageSentenceDao.createTable(db, ifNotExists);\n ImportDateDao.createTable(db, ifNotExists);\n ScheduleTodoDao.createTable(db, ifNotExists);\n TargetDao.createTable(db, ifNotExists);\n TomatoTodoDao.createTable(db, ifNotExists);\n UpTempletDao.createTable(db, ifNotExists);\n UserDao.createTable(db, ifNotExists);\n }", "public void createTable()\n throws DBException\n {\n try {\n DBProvider.createTable(this);\n } catch (SQLException sqe) {\n throw new DBException(\"Table creation\", sqe);\n }\n }", "DataBase createDataBase();", "private void createDatabase(final String databaseName) {\n\n try {\n final Connection connection =\n DriverManager.getConnection(url + databaseName, databaseProperties);\n\n try {\n NaviLogger.info(\"[i] Generating database tables for %s.\", databaseName);\n connection.prepareStatement(AbstractSQLProvider.parseResourceAsSQLFile(\n this.getClass().getResourceAsStream(TEST_DATA_DIRECTORY + \"database_schema.sql\")))\n .execute();\n } catch (final IOException exception) {\n CUtilityFunctions.logException(exception);\n }\n\n final File testDataDir = new File(\n \"./third_party/zynamics/javatests/com/google/security/zynamics/binnavi/testdata/\"\n + databaseName + \"/\");\n\n final CopyManager manager = new CopyManager((BaseConnection) connection);\n\n for (final File currentFile : testDataDir.listFiles()) {\n try (FileReader reader = new FileReader(currentFile)) {\n final String tableName = currentFile.getName().split(\".sql\")[0];\n NaviLogger.info(\"[i] Importing: %s.%s from %s\", databaseName, tableName,\n currentFile.getAbsolutePath());\n manager.copyIn(\"COPY \" + tableName + \" FROM STDIN\", reader);\n } catch (final IOException exception) {\n CUtilityFunctions.logException(exception);\n }\n }\n\n try {\n NaviLogger.warning(\"[i] Generating constraints for %s.\", databaseName);\n connection.prepareStatement(AbstractSQLProvider.parseResourceAsSQLFile(\n this.getClass().getResourceAsStream(TEST_DATA_DIRECTORY + \"database_constraints.sql\")))\n .execute();\n } catch (final IOException exception) {\n CUtilityFunctions.logException(exception);\n }\n\n final String findSequencesQuery = \"SELECT 'SELECT SETVAL(' ||quote_literal(S.relname)|| \"\n + \"', MAX(' ||quote_ident(C.attname)|| ') ) FROM ' ||quote_ident(T.relname)|| ';' \"\n + \" FROM pg_class AS S, pg_depend AS D, pg_class AS T, pg_attribute AS C \"\n + \" WHERE S.relkind = 'S' AND S.oid = D.objid AND D.refobjid = T.oid \"\n + \" AND D.refobjid = C.attrelid AND D.refobjsubid = C.attnum ORDER BY S.relname; \";\n\n try (PreparedStatement statement = connection.prepareStatement(findSequencesQuery);\n ResultSet resultSet = statement.executeQuery()) {\n while (resultSet.next()) {\n final PreparedStatement fixSequence = connection.prepareStatement(resultSet.getString(1));\n fixSequence.execute();\n }\n } catch (final SQLException exception) {\n CUtilityFunctions.logException(exception);\n }\n\n } catch (final SQLException exception) {\n CUtilityFunctions.logException(exception);\n }\n }", "public void createTable(Database database) throws SQLException{\n\t\tdatabase.createTable(PEOPLE_TABLE_NAME, PEOPLE_TABLE_CREATION_ARGS);\n\t}", "protected void createTable() throws Exception {\n startService();\n assertEquals(true, sqlDbManager.isReady());\n\n Connection conn = sqlDbManager.getConnection();\n assertNotNull(conn);\n assertFalse(sqlDbManager.tableExists(conn, \"testtable\"));\n assertTrue(sqlDbManager.createTableIfMissing(conn, \"testtable\",\n\t\t\t\t\t TABLE_CREATE_SQL));\n assertTrue(sqlDbManager.tableExists(conn, \"testtable\"));\n sqlDbManager.logTableSchema(conn, \"testtable\");\n assertFalse(sqlDbManager.createTableIfMissing(conn, \"testtable\",\n\t\t\t\t\t TABLE_CREATE_SQL));\n }", "public void createDB(){\r\n\t\t\r\n\t\t Connection connection = null;\r\n\t try\r\n\t {\r\n\t // create a database connection\r\n\t connection = DriverManager.getConnection(\"jdbc:sqlite:project.sqlite\");\r\n\t Statement statement = connection.createStatement();\r\n\t statement.setQueryTimeout(30); // set timeout to 30 sec.\r\n\r\n\t statement.executeUpdate(\"drop table if exists task\");\r\n\t statement.executeUpdate(\"create table task (taskId integer primary key asc, description string, status string, createDate datetime default current_timestamp)\");\r\n\t statement.executeUpdate(\"insert into task values(1, 'leo', 'Active', null)\");\r\n\t statement.executeUpdate(\"insert into task values(2, 'yui', 'Complete', null)\");\r\n\t }\r\n\t catch(SQLException ex){\r\n\t \tthrow new RuntimeException(ex);\r\n\t }\r\n\t\t\r\n\t}", "private void setupDb(){\n try {\n openConnection();\n s.executeUpdate(\"CREATE TABLE IF NOT EXISTS LIB (NAME text UNIQUE , TYPE text, LANGUAGE text, INTRUSIVE text, OPENSOURCE text)\");\n }catch (SQLException e) {\n System.err.println(e.getMessage());\n }finally {\n if (c != null){\n close(c);\n }\n }\n }", "public void dbCreate() throws IOException\n {\n boolean dbExist = dbCheck();\n\n if(!dbExist)\n {\n //By calling this method an empty database will be created into the default system patt\n //of the application so we can overwrite that db with our db.\n this.getReadableDatabase(); // create a new empty database in the correct path\n try\n {\n //copy the data from the database in the Assets folder to the new empty database\n copyDBFromAssets();\n }\n catch(IOException e)\n {\n throw new Error(\"Error copying database\");\n }\n }\n }", "public void createDataBase() throws IOException {\n boolean dbExist = checkDataBase();\n\n if (dbExist) {\n\n } else {\n this.getReadableDatabase();\n try {\n copyDataBase();\n } catch (IOException e) {\n Log.e(\"tle99 - create\", e.getMessage());\n }\n }\n }", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tLog.v(\"open onCreate\", \"Creating all the tables\");\n\n\t\ttry {\n\t\t\n\t\t\tdb.execSQL(CREATE_TABLE1);\n\t\t} catch (SQLiteException ex) {\n\t\t\tLog.v(\"open exception caught\", ex.getMessage());\n\n\t\t}\n\t}", "public void createNewDatabase(String dbName) {\r\n\t\t// connects to given database - relative path points to inside project folder\r\n\t\ttry {\r\n\t\t\tConnection conn = this.connect(dbName);\t\t\t\t\t\t// open connection\r\n\t\t\tif (conn != null) {\r\n\t\t\t\tDatabaseMetaData meta = conn.getMetaData();\r\n\t\t\t\tSystem.out.println(\"The driver name is \" + meta.getDriverName());\r\n\t\t\t\tSystem.out.println(\"A new database has been created.\");\r\n\t\t\t}\r\n\t\t\tconn.close(); \t\t\t\t\t\t\t\t\t\t\t\t// close connection\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "public void create(Connection db) throws SQLException {\n if (tableName == null) {\n throw new SQLException(\"Table Name not specified\");\n }\n\n Statement st = db.createStatement();\n\n if (dbType == DatabaseUtils.POSTGRESQL) {\n if (hasSequence()) {\n st.executeUpdate(\"CREATE SEQUENCE \" + sequenceName);\n }\n }\n\n StringBuffer sql = new StringBuffer();\n sql.append(\"CREATE TABLE \" + tableName + \" (\");\n\n String primaryKey = \"\";\n Iterator fields = columns.iterator();\n while (fields.hasNext()) {\n DatabaseColumn thisColumn = (DatabaseColumn) fields.next();\n if (thisColumn.isPrimaryKey()) {\n primaryKey = thisColumn.getName();\n sql.append(thisColumn.getCreateSQL(dbType, sequenceName));\n } else {\n sql.append(thisColumn.getCreateSQL(dbType));\n }\n if (fields.hasNext()) {\n sql.append(\",\");\n }\n }\n if (dbType == DatabaseUtils.ORACLE) {\n sql.append(\", PRIMARY KEY (\" + primaryKey + \")\");\n }\n sql.append(\");\");\n st.executeUpdate(sql.toString());\n st.close();\n }", "public static void SetupDB() {\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS User(email TEXT,name TEXT, displayPic BLOB);\");\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS FriendList(ID INTEGER PRIMARY KEY, email TEXT,name TEXT, displayPic BLOB);\");\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS Category(ID INTEGER PRIMARY KEY,name TEXT);\");\n\t}", "@POST\n @Produces({\"application/json\"})\n public String createDb() throws WebApplicationException {\n HibernateEntityManager emAdm = PersistenceManager.getInstance().getEntityManagerAdmin();\n SQLQuery qCreate = emAdm.getSession().createSQLQuery(\"CREATE DATABASE test_jeff template=postgis\");\n try{\n qCreate.executeUpdate();\n }catch(SQLGrammarException e){\n System.out.println(\"Error !!\" + e.getSQLException());\n emAdm.close();\n return e.getSQLException().getLocalizedMessage();\n }\n emAdm.close();\n Map properties = new HashMap();\n //change the connection string to the new db\n properties.put(\"hibernate.connection.url\", \"jdbc:postgresql_postGIS://192.168.12.36:5432/test_jeff\");\n EntityManagerFactory emf = Persistence.createEntityManagerFactory(\"dataPU\", properties); \n return \"Yeah\";\n }", "@Override\n\tpublic void createTable() {\n\t\tSystem.out.println(\"++++++++++++++++++++++++++++++++++++++++++++++\");\n\t\ttry {\n\t\t\tTableUtils.createTable(connectionSource, UserEntity.class);\n\t\t\tTableUtils.createTable(connectionSource, Downloads.class);\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\");\n\t\t}\n\t}", "public void createDB(String filename) throws SQLException {\n //System.out.printf(\"Connecting to the database %s.%n\", filename);\n /* \n * Connect to the database (file). If the file does not exist, create it.\n */\n Connection db_connection = DriverManager.getConnection(SQLITEDBPATH + filename);\n this.createTables(db_connection);\n this.initTableCities(db_connection);\n this.initTableTeams(db_connection);\n //System.out.printf(\"Connection to the database has been established.%n\");\n db_connection.close();\n //System.out.printf(\"Connection to the database has been closed.%n\");\n }", "protected void setupDB() {\n\t\tlog.info(\"------------------------------------------\");\n\t\tlog.info(\"Initialization database started\");\n\t\tlog.info(\"ddl: db-config.xml\");\n\t\tlog.info(\"------------------------------------------\");\n\t\ttry {\n\t\t\tfinal List<String> lines = Files.readAllLines(Paths.get(this.getClass()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getClassLoader()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getResource(\"create-campina-schema.sql\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.toURI()), Charset.forName(\"UTF-8\"));\n\n\t\t\tfinal List<String> statements = new ArrayList<>(lines.size());\n\t\t\tString statement = \"\";\n\t\t\tfor (String string : lines) {\n\t\t\t\tstatement += \" \" + string;\n\t\t\t\tif (string.endsWith(\";\")) {\n\t\t\t\t\tstatements.add(statement);\n\t\t\t\t\tstatement = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry (final Connection con = conManager.getConnection(Boolean.FALSE)) {\n\t\t\t\ttry (final PreparedStatement pstmt = con.prepareStatement(\"DROP SCHEMA IF EXISTS campina\")) {\n\t\t\t\t\tpstmt.executeUpdate();\n\t\t\t\t}\n\t\t\t\tfor (String string : statements) {\n\t\t\t\t\tlog.info(\"Executing ddl: \" + string);\n\t\t\t\t\ttry (final PreparedStatement pstmt = con.prepareStatement(string)) {\n\t\t\t\t\t\tpstmt.executeUpdate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (SQLException e) {\n\t\t\t\tthrow new IllegalStateException(\"Could not setup db\", e);\n\t\t\t}\n\t\t} catch (Throwable e) {\n\t\t\tlog.error(\"Could not setup database\", e);\n\t\t\tthrow new IllegalStateException(\"ddl file load failed\", e);\n\t\t}\n\t\tlog.info(\"------------------------------------------\");\n\t\tlog.info(\"Initialization database finished\");\n\t\tlog.info(\"------------------------------------------\");\n\t}", "public void createDataBase() throws IOException {\n\n boolean dbExist = checkDataBase();\n\n if(dbExist){\n //do nothing - database already exist\n }else{\n\n //By calling this method and empty database will be created into the default system path\n //of your application so we are gonna be able to overwrite that database with our database.\n this.getReadableDatabase();\n\n try {\n\n copyDataBase();\n\n } catch (IOException e) {\n\n throw new Error(\"Error copying database\");\n\n }\n }\n\n }", "public void createDataBase() throws IOException {\n\n boolean dbExist = checkDataBase();\n\n if(dbExist){\n //do nothing - database already exist\n }else{\n\n //By calling this method and empty database will be created into the default system path\n //of your application so we are gonna be able to overwrite that database with our database.\n this.getReadableDatabase();\n\n try {\n\n copyDataBase();\n\n } catch (IOException e) {\n\n throw new Error(\"Error copying database\");\n\n }\n }\n\n }", "public void createTables(){\n Map<String, String> name_type_map = new HashMap<>();\n List<String> primaryKey = new ArrayList<>();\n try {\n name_type_map.put(KEY_SINK_NAME, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_SINK_ADDRESS, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_SINK_DETAIL, MyDatabase.TYPE_VARCHAR);\n primaryKey.add(KEY_SINK_ADDRESS);\n myDatabase.createTable(TABLE_SINK, name_type_map, primaryKey, null);\n }catch (MySQLException e){ //数据表已存在\n e.print();\n }\n try {\n name_type_map.clear();\n name_type_map.put(KEY_NODE_NAME, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_PARENT, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_DETAIL, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_ADDRESS,MyDatabase.TYPE_VARCHAR);\n primaryKey.clear();\n primaryKey.add(KEY_NODE_PARENT);\n primaryKey.add(KEY_NODE_ADDRESS);\n myDatabase.createTable(TABLE_NODE, name_type_map, primaryKey, null);\n }catch (MySQLException e){\n e.print();\n }\n\n try {\n name_type_map.clear();\n name_type_map.put(KEY_NODE_ADDRESS, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_PARENT, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_DATA_TIME, MyDatabase.TYPE_TIMESTAMP);\n name_type_map.put(KEY_DATA_VAL, MyDatabase.TYPE_FLOAT);\n primaryKey.clear();\n primaryKey.add(KEY_DATA_TIME);\n primaryKey.add(KEY_NODE_ADDRESS);\n primaryKey.add(KEY_NODE_PARENT);\n myDatabase.createTable(TABLE_DATA, name_type_map, primaryKey, null);\n }catch (MySQLException e) {\n e.print();\n }\n }", "@Override\n public void onCreate(SQLiteDatabase sqLiteDatabase) {\n String sql = \"drop table \" + MelodyData.CreateDB._TABLENAME;\n sqLiteDatabase.execSQL(AccompanimentData.CreateDB._CREATE);\n sqLiteDatabase.execSQL(MelodyData.CreateDB._CREATE);\n }", "public static void createAllTables(SQLiteDatabase db, boolean ifNotExists) {\n CriuzesDao.createTable(db, ifNotExists);\n Criuzes_TMPDao.createTable(db, ifNotExists);\n CabinsDao.createTable(db, ifNotExists);\n Cabins_TMPDao.createTable(db, ifNotExists);\n ExcursionsDao.createTable(db, ifNotExists);\n Excursions_TMPDao.createTable(db, ifNotExists);\n GuestsDao.createTable(db, ifNotExists);\n Guests_TMPDao.createTable(db, ifNotExists);\n }", "public void createTable() {\n\t\tString QUERY = \"CREATE TABLE person (id INT PRIMARY KEY, name VARCHAR(32) NOT NULL, phoneNumber VARCHAR(18) NOT NULL)\";\n\t\ttry (Connection con = DriverManager.getConnection(URL, USER, PASSWORD);\n\t\t\t\tStatement stmt = con.createStatement();) {\n\t\t\tstmt.executeUpdate(QUERY);\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(\"SQL Exception\");\n\t\t}\n\n\t}", "public boolean createAllTables (){\n try {\n this.execute(CREATE_PEOPLE);\n this.execute(CREATE_AUTHOR);\n this.execute(CREATE_EMPLOYEE);\n this.execute(CREATE_MEETING);\n this.execute(CREATE_COVERPRICE);\n this.execute(CREATE_PRICEPARAMETERS);\n this.execute(CREATE_ORDER);\n this.execute(CREATE_CORRECTIONS);\n this.execute(CREATE_BOOK);\n this.execute(CREATE_COVERLINK);\n return true;\n } catch (SQLException | IOException | ClassNotFoundException e) {\n log.error(e);\n return false;\n }\n }", "protected void createInitialTables() throws SQLException {\n\t\n\t\t// create one table per type with the corresponding attributes\n\t\tfor (String type: entityType2attributes.keySet()) {\n\t\t\tcreateTableForEntityType(type);\n\t\t}\n\t\t\n\t\t// TODO indexes !\n\t\t\n\t}", "private void createNewDatabase() throws ConnectException {\n try (Connection sqlConnection = connect()) {\n if (sqlConnection != null) {\n sqlConnection.getMetaData();\n sqlConnection.close();\n }\n\n } catch (SQLException e) {\n LOGGER.error(\"Error when trying to create new database: {}\\n{}\", e.getMessage(), e);\n }\n }", "public void createTable() throws DatabaseException\n\t{\n\t\tConnection connection = DatabaseManager.getSingleton().getConnection();\n\t\ttry\n\t\t{\n\t\t\tClosingPreparedStatement stmt = new ClosingPreparedStatement(connection,\n\t\t\t\t\t\"DROP TABLE IF EXISTS QuestStates\");\n\t\t\tstmt.executeUpdate();\n\t\t\tstmt.close();\n\n\t\t\tstmt = new ClosingPreparedStatement(connection,\n\t\t\t\t\t\"Create TABLE QuestStates (playerID INT NOT NULL, questID INT NOT NULL , questState INT NOT NULL, needingNotification BOOLEAN NOT NULL)\");\n\t\t\tstmt.executeUpdate();\n\t\t} catch (SQLException e)\n\t\t{\n\t\t\tthrow new DatabaseException(\"Unable to create the Quest table\", e);\n\t\t}\n\t}", "@Before\n public void createDatabase() {\n dbService.getDdlInitializer()\n .initDB();\n kicCrud = new KicCrud();\n }", "@Override\n\tpublic void onCreate(SQLiteDatabase db, ConnectionSource connectionSource) {\n\t\ttry {\n\t\t\tLog.i(DatabaseHelper.class.getName(), \"onCreate\");\n\t\t\tTableUtils.createTable(connectionSource, Place.class);\n\t\t\tTableUtils.createTable(connectionSource, Lock.class);\n\t\t\tTableUtils.createTable(connectionSource, User.class);\n\t\t\tTableUtils.createTable(connectionSource, Locator.class);\n\t\t} catch (SQLException e) {\n\t\t\tLog.e(DatabaseHelper.class.getName(), \"Can't create database\", e);\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "public static void createAllTables(SQLiteDatabase db, boolean ifNotExists) {\n TipsDao.createTable(db, ifNotExists);\n }", "public void createTable() {\r\n\t\tclient.createTable();\r\n\t}", "public static LocalDatabase dbSetup(String name)\n\t{\n\t\tLocalDatabase local = new LocalDatabase(name);\n\t\tlocal.loadDriver();\n\t\tlocal.openConnection();\n\t\tlocal.createTablePersons();\n\t\tlocal.createTableListenings();\n\t\tlocal.createTableRecordings();\n\t\tlocal.closeConnection();\n\t\treturn local;\n\t}", "public void CreateTables() {\n\t\ttry {\n\t\t\tString schema = Schema.META;\n\t\t\tInstall_DBMS_MetaData(schema.getBytes(),0);\n\n\t\t\t// load and install QEPs\n\t\t\tClass<?>[] executionPlans = new Class[] { QEP.class };\n\t\t\tQEPng.loadExecutionPlans(TCell_QEP_IDs.class, executionPlans);\n\t\t\tQEPng.installExecutionPlans(db);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void initTables() {\n try (Connection connection = this.getConnection();\n Statement statement = connection.createStatement()) {\n statement.execute(INIT.CREATE_CITIES.toString());\n statement.execute(INIT.CREATE_ROLES.toString());\n statement.execute(INIT.CREATE_MUSIC.toString());\n statement.execute(INIT.CREATE_ADDRESS.toString());\n statement.execute(INIT.CREATE_USERS.toString());\n statement.execute(INIT.CREATE_USERS_TO_MUSIC.toString());\n } catch (SQLException e) {\n logger.error(e.getMessage(), e);\n }\n }", "private static void createTablesInDatabase (Statement statement) throws SQLException {\n //Создание таблиц в БД\n statement.execute(\"CREATE TABLE role ( ID INT(11) NOT NULL AUTO_INCREMENT COMMENT 'Primary Key' , \" +\n \"Role VARCHAR(50) NOT NULL , PRIMARY KEY (ID)) ENGINE = InnoDB CHARACTER set UTF8 COLLATE UTF8_general_ci;\");\n statement.execute(\"CREATE TABLE users ( ID INT(11) NOT NULL AUTO_INCREMENT , First_Name VARCHAR(20) NOT NULL, \" +\n \"Middle_Name VARCHAR(20) NOT NULL , Last_Name VARCHAR(20) NOT NULL , Passport VARCHAR(100) NOT NULL, \" +\n \"Address VARCHAR(100) NOT NULL , Phone VARCHAR(13) NOT NULL, Login VARCHAR(50) NOT NULL , \" +\n \"Password VARCHAR(50) NOT NULL , Email VARCHAR(100) NOT NULL , FK_Role INT(11) NOT NULL , PRIMARY KEY (ID), \" +\n \"Foreign Key (FK_Role) REFERENCES role(ID)) ENGINE = InnoDB CHARACTER set UTF8 COLLATE UTF8_general_ci;\");\n statement.execute(\"CREATE TABLE account (ID INT(11) NOT NULL AUTO_INCREMENT, Balans DECIMAL(50) NOT NULL, \" +\n \"State ENUM('Working','Lock') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, \" +\n \"FK_Users INT(11) NOT NULL, PRIMARY KEY (ID), Foreign Key (FK_Users) REFERENCES users(ID)) \" +\n \"ENGINE = InnoDB CHARACTER set UTF8 COLLATE UTF8_general_ci;\");\n statement.execute(\"CREATE TABLE payment ( ID INT(11) NOT NULL AUTO_INCREMENT, FK_Account_Source INT(11) NOT NULL, \" +\n \"FK_Account_Destination INT(11) NOT NULL , Description VARCHAR(200) NOT NULL , Amount DECIMAL(50) NOT NULL , \" +\n \"Paydate Date NOT NULL , PRIMARY KEY (ID), Foreign Key (FK_Account_Source) REFERENCES account(ID), \" +\n \"Foreign Key (FK_Account_Destination) REFERENCES account(ID)) ENGINE = InnoDB \" +\n \"CHARACTER set UTF8 COLLATE UTF8_general_ci;\");\n }", "private void install()\n {\n Statement stmt;\n \n try {\n stmt = this.dbh.createStatement();\n stmt.setQueryTimeout(30);\n } catch (SQLException e) {\n Logger.getRootLogger().error(\"Unable to create Sqlite-statement\", e);\n System.exit(1);\n return; // not necessary\n }\n \n Logger.getRootLogger().info(\"Installing tables\");\n \n try {\n // create `channels` table\n stmt.executeUpdate(\"\" +\n \t\t\"CREATE TABLE IF NOT EXISTS `channels` (\" +\n \t\t \"`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\" +\n \t\t \"`name` VARCHAR(100) NOT NULL UNIQUE,\" +\n \t\t \"`owner` VARCHAR(100) NOT NULL\" +\n \t\t\")\"\n );\n\n // create `plugins` table\n stmt.executeUpdate(\"\" +\n \t\t\"CREATE TABLE IF NOT EXISTS `plugins` (\" +\n \t\t \"`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\" +\n \t\t \"`type` INTEGER NOT NULL DEFAULT 1,\" +\n \t\t \"`package` VARCHAR(100) NOT NULL UNIQUE,\" +\n \t\t \"`version` VARCHAR(10) NOT NULL DEFAULT '1',\" +\n \t\t \"`author` VARCHAR(50) NOT NULL DEFAULT 'anonymus'\" +\n \t\t\")\"\n );\n \n // create `plugins_to_channels` table\n stmt.executeUpdate(\"\" +\n \t\t\"CREATE TABLE IF NOT EXISTS `plugins_to_channels` (\" +\n \t\t \"`channel_id` INTEGER NOT NULL,\" +\n \t\t \"`plugin_id` INTEGER NOT NULL,\" +\n \t\t \"PRIMARY KEY(`channel_id` DESC, `plugin_id` DESC)\" +\n \t\t\")\"\n );\n } catch (SQLException e) {\n Logger.getRootLogger().fatal(\"Unable to install required Database-tables\", e);\n System.exit(1);\n }\n }", "private void initDb() throws SQLException {\n statement = conn.createStatement();\n for (String sql : TABLES_SQL) {\n statement.executeUpdate(sql);\n }\n }", "private void createTables() throws ConnectException {\n try (Connection connection = connect(); Statement statement = connection.createStatement()) {\n for (Table table : Table.values()) {\n createTable(table, statement);\n }\n LOGGER.debug(\"Created tables successfully\");\n } catch (SQLException e) {\n LOGGER.error(\"Error while creating Tables in database: {}\\n{}\", e.getMessage(), e);\n }\n }", "@Override\r\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tFormDAO.createTable(db);\r\n//\t\tCreate table ENumber\r\n\t\tENumberDAO.createTable(db);\r\n\t\t\r\n\r\n\t}", "private static void createDatabase(String restrictedUser) throws ArcException {\n\t\tGenericPreparedStatementBuilder query;\n\n\t\t// clean database\n\t\tquery = new GenericPreparedStatementBuilder();\n\t\tquery.append(\"DROP SCHEMA IF EXISTS \" + DataObjectService.ARC_METADATA_SCHEMA + \" CASCADE;\");\n\t\tquery.append(\"DROP SCHEMA IF EXISTS \" + testSandbox1 + \" CASCADE;\");\n\t\tquery.append(\"DROP SCHEMA IF EXISTS public CASCADE;\");\n\t\tUtilitaireDao.get(0).executeRequest(c, query);\n\t\t\n\t\tBddPatcher patcher=new BddPatcher();\n\t\tpatcher.getProperties().setGitCommitId(newVersion);\n\t\tpatcher.getProperties().setDatabaseRestrictedUsername(userWithRestrictedRights);\n\n\t\t// metadata schema creation\n\t\tpatcher.bddScript(c);\n\t\t// sandbox schema creation\n\t\tpatcher.bddScript(c, testSandbox1, testSandbox2, testSandbox8);\n\t\t\n\t}", "@Override\n\tpublic void onCreate(SQLiteDatabase database) {\n\t\tAppDBTableCreation.onCreate(database);\n\t}", "@Override\n\tpublic void onCreate(SQLiteDatabase db, ConnectionSource source) {\n\n\t\ttry {\n\t\t\tTableUtils.createTable(source, Priority.class);\n\t\t\tTableUtils.createTable(source, Category.class);\n\t\t\tTableUtils.createTable(source, Task.class);\n\t\t} catch (SQLException ex) {\n\t\t\tLog.e(LOG, \"error creating tables\", ex);\n\t\t}\n\n\t}", "private void createtables() throws SQLException {\n\n\t\tString createDB = \"CREATE DATABASE IF NOT EXISTS attendancemanager\";\n\n\t\tString useDB = \"use attendancemanager\";\n\n\t\tString regUserTable = \"CREATE TABLE IF NOT EXISTS `registered_users` ( `FullName` varchar(20) DEFAULT NULL, `UserName` varchar(20) NOT NULL, `Password` varchar(20) DEFAULT NULL, PRIMARY KEY (`UserName`))\";\n\n\t\tString attendanceTable = \"CREATE TABLE IF NOT EXISTS `attendance` ( `Username` varchar(20) NOT NULL, `Subject` varchar(20) NOT NULL, `Date` date NOT NULL, `Present` int(5) DEFAULT NULL, `Total_Attendance` int(6) DEFAULT NULL, PRIMARY KEY (`Username`,`Subject`,`Date`), CONSTRAINT `attendance_ibfk_1` FOREIGN KEY (`Username`) REFERENCES `registered_users` (`UserName`))\";\n\n\t\tString attendancegoalTable = \"CREATE TABLE IF NOT EXISTS `attendancegoal` ( `Username` varchar(20) NOT NULL, `Goal` int(4) DEFAULT NULL, PRIMARY KEY (`Username`), CONSTRAINT `attendancegoal_ibfk_1` FOREIGN KEY (`Username`) REFERENCES `registered_users` (`UserName`))\";\n\n\t\tString attendancesubjectTable = \"CREATE TABLE IF NOT EXISTS `attendancesubject` ( `Username` varchar(20) NOT NULL, `subjects` varchar(20) NOT NULL, `Last_Action` int(11) DEFAULT '-1', `LastActionDate` date DEFAULT NULL, PRIMARY KEY (`Username`,`subjects`), CONSTRAINT `attendancesubject_ibfk_1` FOREIGN KEY (`Username`) REFERENCES `registered_users` (`UserName`))\";\n\n\t\tString timetableTable = \"CREATE TABLE IF NOT EXISTS `timetable` ( `Username` varchar(20) NOT NULL, `Day` varchar(20) NOT NULL, `Period` int(2) NOT NULL, `Subject` varchar(20) DEFAULT NULL, PRIMARY KEY (`Username`,`Day`,`Period`), KEY `Username` (`Username`,`Subject`), CONSTRAINT `timetable_ibfk_1` FOREIGN KEY (`Username`, `Subject`) REFERENCES `attendancesubject` (`Username`, `subjects`) ON DELETE CASCADE ON UPDATE CASCADE)\";\n\n\t\tMySqlInitConn.statement.executeUpdate(createDB);\n\t\tMySqlInitConn.statement.executeUpdate(useDB);\n\t\tMySqlInitConn.statement.executeUpdate(regUserTable);\n\t\tMySqlInitConn.statement.executeUpdate(attendanceTable);\n\t\tMySqlInitConn.statement.executeUpdate(attendancegoalTable);\n\t\tMySqlInitConn.statement.executeUpdate(attendancesubjectTable);\n\t\tMySqlInitConn.statement.executeUpdate(timetableTable);\n\n\t}", "private void setupDatabase()\n {\n try\n {\n Class.forName(\"com.mysql.jdbc.Driver\");\n }\n catch (ClassNotFoundException e)\n {\n simpleEconomy.getLogger().severe(\"Could not load database driver.\");\n simpleEconomy.getServer().getPluginManager().disablePlugin(simpleEconomy);\n e.printStackTrace();\n }\n\n try\n {\n connection = DriverManager\n .getConnection(String.format(\"jdbc:mysql://%s/%s?user=%s&password=%s\",\n simpleEconomy.getConfig().getString(\"db.host\"),\n simpleEconomy.getConfig().getString(\"db.database\"),\n simpleEconomy.getConfig().getString(\"db.username\"),\n simpleEconomy.getConfig().getString(\"db.password\")\n ));\n\n // Loads the ddl from the jar and commits it to the database.\n InputStream input = getClass().getResourceAsStream(\"/ddl.sql\");\n try\n {\n String s = IOUtils.toString(input);\n connection.createStatement().execute(s);\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try\n {\n input.close();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n }\n catch (SQLException e)\n {\n simpleEconomy.getLogger().severe(\"Could not connect to database.\");\n simpleEconomy.getServer().getPluginManager().disablePlugin(simpleEconomy);\n e.printStackTrace();\n }\n }", "public void createAndPopulateDatabase(ArrayList<MenuItem> food, ArrayList<MenuItem> bev) throws SQLException\r\n {\r\n createDatabase();\r\n connectToDatabase();\r\n createTables();\r\n populateTables(food, bev);\r\n }", "@Override\n\tpublic Database createDatabase(Type type) throws FSException {\n\t\treturn new DummyDatabase();\n\t}", "public void createNewTable() {\n String dropOld = \"DROP TABLE IF EXISTS card;\";\n\n // SQL statement for creating a new table\n String sql = \"CREATE TABLE IF NOT EXISTS card (\\n\"\n + \"id INTEGER PRIMARY KEY AUTOINCREMENT, \\n\"\n + \"number TEXT, \\n\"\n + \"pin TEXT,\\n\"\n + \"balance INTEGER DEFAULT 0\"\n + \");\";\n\n try (Connection connection = connect();\n Statement stmt = connection.createStatement()) {\n\n //drop old table\n stmt.execute(dropOld);\n\n //create a new table\n stmt.execute(sql);\n } catch (SQLException e) {\n System.out.println(\"Exception3: \" + e.getMessage());\n }\n }", "private void CreatTable() {\n String sql = \"CREATE TABLE IF NOT EXISTS \" + TABLE_NAME\n + \" (name varchar(30) primary key,password varchar(30));\";\n try{\n db.execSQL(sql);\n }catch(SQLException ex){}\n }", "public static void createNewDatabaseFile(String startPath)\r\n throws ConnectionFailedException, DatabaseException {\r\n boolean databaseCreated;\r\n try {\r\n databaseCreated = database.createNewFile();\r\n if (!databaseCreated) {\r\n throw new IOException(\"Cannot create file\");\r\n }\r\n\r\n URL databaseResource = Objects.requireNonNull(Paths.get(\r\n startPath + \"resources/database/database.sql\").toUri().toURL());\r\n String decodedPath = URLDecoder.decode(databaseResource.getPath(), \"UTF-8\");\r\n\r\n try (BufferedReader in = new BufferedReader(new FileReader(decodedPath))) {\r\n StringBuilder sqlQuery = new StringBuilder();\r\n while (in.ready()) {\r\n sqlQuery.append(in.readLine());\r\n if (sqlQuery.toString().endsWith(\";\")) {\r\n createBasicSqlTable(sqlQuery.toString());\r\n sqlQuery = new StringBuilder();\r\n }\r\n }\r\n }\r\n } catch (IOException e) {\r\n throwException(e);\r\n }\r\n }", "public void createDBSchema() throws NoConnectionToDBException, SQLException, IOException {\n \n InputStream in = EDACCApp.class.getClassLoader().getResourceAsStream(\"edacc/resources/edacc.sql\");\n if (in == null) {\n throw new SQLQueryFileNotFoundException();\n }\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\n String line;\n String text = \"\";\n String l;\n while ((line = br.readLine()) != null) {\n if (!(l = line.replaceAll(\"\\\\s\", \"\")).isEmpty() && !l.startsWith(\"--\")) {\n text += line + \" \";\n }\n }\n in.close();\n Vector<String> queries = new Vector<String>();\n String query = \"\";\n String delimiter = \";\";\n int i = 0;\n while (i < text.length()) {\n if (text.toLowerCase().startsWith(\"delimiter\", i)) {\n i += 10;\n delimiter = text.substring(i, text.indexOf(' ', i));\n i = text.indexOf(' ', i);\n } else if (text.startsWith(delimiter, i)) {\n queries.add(query);\n i += delimiter.length();\n query = \"\";\n } else {\n query += text.charAt(i);\n i++;\n }\n }\n if (!query.replaceAll(\" \", \"\").equals(\"\")) {\n queries.add(query);\n }\n boolean autoCommit = getConn().getAutoCommit();\n try {\n getConn().setAutoCommit(false);\n Statement st = getConn().createStatement();\n for (String q : queries) {\n st.execute(q);\n }\n st.close();\n getConn().commit();\n } catch (SQLException e) {\n getConn().rollback();\n throw e;\n } finally {\n getConn().setAutoCommit(autoCommit);\n }\n }", "private void createTable() {\n try (Statement st = this.conn.createStatement()) {\n st.execute(\"CREATE TABLE IF NOT EXISTS users (user_id SERIAL PRIMARY KEY, name VARCHAR(100) NOT NULL, \"\n + \"login VARCHAR(100) UNIQUE NOT NULL, email VARCHAR(100) NOT NULL, createDate TIMESTAMP NOT NULL);\");\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "private void initDatabase() {\n\n String sql = \"CREATE TABLE IF NOT EXISTS books (\\n\"\n + \"\tISBN integer PRIMARY KEY,\\n\"\n + \"\tBookName text NOT NULL,\\n\"\n + \" AuthorName text NOT NULL, \\n\"\n + \"\tPrice integer\\n\"\n + \");\";\n\n try (Connection conn = DriverManager.getConnection(urlPath);\n Statement stmt = conn.createStatement()) {\n System.out.println(\"Database connected\");\n stmt.execute(sql);\n\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "private void createSchema() throws Exception\n {\n LOG.info(\"Creating schema\");\n HibernateUtil.currentSession();\n }", "public static void createTable(SQLiteDatabase db, Class<?> clz) {\n// StringBuilder builder=new StringBuilder();\n// Field[] fields=clz.getDeclaredFields();\n// for (int i=0;i<fields.length;i++){\n// Field field=fields[i];\n// builder.append(getOneColumnStmt(field));\n// if (i!=fields.length-1)\n// builder.append(\",\");\n// }\n// String sql=\"create table \"+getTableName(clz)+\"(\"+builder+\")\";\n// db.execSQL(sql);\n ArrayList<String> stmts=getCreateTableStmt(clz);\n for (String stmt:stmts) {\n db.execSQL(stmt);\n }\n }", "@Override\n public void onCreate(SQLiteDatabase database, ConnectionSource connectionSource) {\n\n try {\n TableUtils.createTableIfNotExists(connectionSource, MessageBoard.class);\n TableUtils.createTableIfNotExists(connectionSource, User.class);\n TableUtils.createTableIfNotExists(connectionSource, ChatServerBean.class);\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void onCreate(SQLiteDatabase db){\n //execute the SQL statements to actually create the specified tables\n db.execSQL(SQL_CREATE_PRODUCTS_TABLE);\n db.execSQL(SQL_CREATE_SUPPLIERS_TABLE);\n db.execSQL(SQL_CREATE_CATEGORIES_TABLE);\n }", "@Override\n public void onCreate(SQLiteDatabase db) {\n\n db.execSQL(CategoryTable.getCreateTableSqlString());\n db.execSQL(ReminderTable.getCreateTableSqlString());\n }", "public void createTables() {\n\t\t// A try catch is needed in case the sql statement is invalid\n\t\ttry {\n\t\t\t// Create connection and statement\n\t\t\tconnection = connector.getConnection();\n\t\t\tstatement = connection.createStatement();\n\n\t\t\t// Create tables if they do not exist already\n\t\t\tString user_sql = \"CREATE TABLE IF NOT EXISTS \" + user_table + \" (id INTEGER NOT NULL AUTO_INCREMENT,\"\n\t\t\t\t\t+ \" username VARCHAR(10) UNIQUE NOT NULL,\" + \" password VARCHAR(15) NOT NULL,\"\n\t\t\t\t\t+ \" name VARCHAR(20) NOT NULL,\" + \" lastname VARCHAR(20) NOT NULL,\"\n\t\t\t\t\t+ \" email VARCHAR(40) UNIQUE NOT NULL,\" + \" isAdmin BOOLEAN NOT NULL,\" + \" PRIMARY KEY (id))\";\n\n\t\t\tString player_sql = \"CREATE TABLE IF NOT EXISTS \" + player_table + \" (id INTEGER NOT NULL AUTO_INCREMENT,\"\n\t\t\t\t\t+ \" idTeam INTEGER NOT NULL,\" + \" name VARCHAR(20) NOT NULL,\" + \" lastname VARCHAR(20) NOT NULL,\"\n\t\t\t\t\t+ \" dateOfBirth DATE NOT NULL,\" + \" height INTEGER NOT NULL,\" + \" PRIMARY KEY (id))\";\n\n\t\t\tString team_sql = \"CREATE TABLE IF NOT EXISTS \" + team_table + \" (id INTEGER NOT NULL AUTO_INCREMENT,\"\n\t\t\t\t\t+ \" name VARCHAR(20) UNIQUE NOT NULL,\" + \" coach VARCHAR(20) UNIQUE NOT NULL,\"\n\t\t\t\t\t+ \" city VARCHAR(20) NOT NULL,\" + \" dateFoundation DATE NOT NULL,\" + \" PRIMARY KEY (id))\";\n\n\t\t\tString match_sql = \"CREATE TABLE IF NOT EXISTS \" + match_table + \" (id INTEGER NOT NULL AUTO_INCREMENT,\"\n\t\t\t\t\t+ \" idHome INTEGER NOT NULL,\" + \" idAway INTEGER NOT NULL,\" + \" matchDate DATE NOT NULL,\"\n\t\t\t\t\t+ \" referee VARCHAR(20) NOT NULL,\" + \" PRIMARY KEY (id))\";\n\n\t\t\tString stats_sql = \"CREATE TABLE IF NOT EXISTS \" + stats_table + \" (id INTEGER NOT NULL AUTO_INCREMENT,\"\n\t\t\t\t\t+ \" idMatch INTEGER NOT NULL,\" + \" goalsHome INTEGER NOT NULL,\" + \" goalsAway INTEGER NOT NULL,\"\n\t\t\t\t\t+ \" numberOfCorners INTEGER NOT NULL,\" + \" numberOfFouls INTEGER NOT NULL,\" + \" PRIMARY KEY (id))\";\n\n\t\t\t// Inform the user that the table has been created just the first\n\t\t\t// time\n\t\t\tif (statement.executeUpdate(user_sql) > 0) {\n\t\t\t\tSystem.out.println(\"User table succesfully created\");\n\t\t\t}\n\t\t\tif (statement.executeUpdate(player_sql) > 0) {\n\t\t\t\tSystem.out.println(\"Player table succesfully created\");\n\t\t\t}\n\t\t\tif (statement.executeUpdate(team_sql) > 0) {\n\t\t\t\tSystem.out.println(\"Team table succesfully created\");\n\t\t\t}\n\t\t\tif (statement.executeUpdate(match_sql) > 0) {\n\t\t\t\tSystem.out.println(\"Match table succesfully created\");\n\t\t\t}\n\t\t\tif (statement.executeUpdate(stats_sql) > 0) {\n\t\t\t\tSystem.out.println(\"Stats table succesfully created\");\n\t\t\t}\n\t\t\t// Closing the connection\n\t\t\tstatement.close();\n\t\t\tconnection.close();\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "private void setupDatabase() throws SQLException {\n\t\tdb.open(\"localhost\", 3306, \"wow\", \"greeneconomyapple\");\n\t\tdb.use(\"auctionscan\");\n\t}", "public void createDatabase() throws IOException {\n boolean dbExist = checkDataBase();\n// if(dbExist) {\n// Log.d(\"E\", \"Database exists.\");\n// try {\n// copyDataBase();\n// } catch (IOException e) {\n// Log.e(\"Error\", e.getMessage());\n// }\n// } else {\n// try {\n// copyDataBase();\n// } catch (IOException e) {\n// Log.e(\"Error1\", e.getMessage());\n// }\n// }\n\n if (!dbExist) {\n this.getReadableDatabase();\n this.close();\n try {\n //Copy the database from assests\n copyDataBase();\n Log.e(TAG, \"createDatabase database created\");\n } catch (IOException mIOException) {\n throw new Error(\"ErrorCopyingDataBase\");\n }\n }\n\n }", "void createDatabaseOnDevice() throws IOException {\n boolean databaseExists = checkIfDatabaseOnDevice();\n\n if (!databaseExists) {\n this.getReadableDatabase();\n\n try {\n copyDatabaseToDevice();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "@Override\n public void onCreate(SQLiteDatabase db) {\n new Tables(db).makeContactTable();\n new Tables(db).makeTalkTable();\n new Tables(db).makeConferenceTable();\n new Tables(db).makeNotificationTable();\n }", "private void createTables(Connection db_connection) throws SQLException {\n /*\n * Use Statement to execute SQL.\n */\n Statement statement = db_connection.createStatement();\n /*\n * Clear the *cities* table and create it according to the schema.\n */\n statement.executeUpdate(\"DROP TABLE IF EXISTS cities;\");\n //System.out.printf(\"Creating table *cities*.%n\");\n statement.executeUpdate(\"CREATE TABLE cities (\"\n + \"city_id_pk INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\"\n + \"city_name TEXT NOT NULL,\"\n + \"city_state TEXT NOT NULL);\");\n //System.out.printf(\"Table *cities* has been created.%n\");\n /*\n * Enforce foreign keys.\n * https://sqlite.org/pragma.html\n */\n statement.execute(\"PRAGMA foreign_keys = ON;\");\n /*\n * Clear the *teams* table and create it according to the schema.\n */\n statement.executeUpdate(\"DROP TABLE IF EXISTS teams;\");\n //System.out.printf(\"Creating table *teams*.%n\");\n statement.executeUpdate(\"CREATE TABLE teams (\"\n + \"team_id_pk INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\"\n + \"team_name TEXT NOT NULL,\"\n + \"team_conference TEXT NOT NULL,\"\n + \"team_division TEXT NOT NULL,\"\n + \"team_site TEXT NOT NULL,\"\n + \"city_id,\"\n + \"FOREIGN KEY (city_id) REFERENCES cities(city_id_pk));\");\n //System.out.printf(\"Table *teams* has been created.%n\");\n }" ]
[ "0.78887326", "0.77307534", "0.75181794", "0.74612695", "0.7383135", "0.7380979", "0.73178935", "0.72695374", "0.7219089", "0.7164893", "0.7133134", "0.7095077", "0.7091545", "0.7087526", "0.7053697", "0.70472986", "0.70310396", "0.7005308", "0.6973489", "0.69490135", "0.6873856", "0.68525213", "0.68311757", "0.68111104", "0.6804961", "0.6788305", "0.67872995", "0.67806137", "0.6780487", "0.67438924", "0.6739172", "0.67389387", "0.6705232", "0.66980046", "0.668836", "0.6663724", "0.66584206", "0.664989", "0.6646997", "0.6635892", "0.66318065", "0.6619066", "0.6602389", "0.65993303", "0.65836656", "0.65799206", "0.65710664", "0.6562635", "0.6550988", "0.6550936", "0.6540331", "0.6534893", "0.6534766", "0.6522757", "0.6510299", "0.6510299", "0.649714", "0.6483138", "0.6479784", "0.64652175", "0.6456096", "0.64533025", "0.64484435", "0.64421785", "0.6415434", "0.64125156", "0.6408481", "0.6405221", "0.6389468", "0.6371464", "0.6367755", "0.6357557", "0.63396007", "0.6329623", "0.6328533", "0.632125", "0.6302152", "0.62990415", "0.6298016", "0.6284553", "0.6282947", "0.6276147", "0.6264357", "0.62587863", "0.6253323", "0.6240031", "0.6237319", "0.6215718", "0.62068844", "0.6206839", "0.6206305", "0.6200646", "0.6197588", "0.61860824", "0.61855483", "0.61836344", "0.61820644", "0.61708546", "0.6167383", "0.61524934" ]
0.68428546
22
Returns the database connection.
public Connection getConnection() { return this.connection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DatabaseConnection getDatabaseConnection() {\n return query.getDatabaseConnection();\n }", "public Connection getConnection() {\n if(connection == null) throw new RuntimeException(\"Attempt to get database connection before it was initialized\");\n return connection;\n }", "public static DatabaseConnection getDb() {\n return db;\n }", "public Connection getConnection() {\n try {\n return ds.getConnection();\n } catch (SQLException e) {\n System.err.println(\"Error while connecting to database: \" + e.toString());\n }\n return null;\n }", "public Connection getConnection() {\n try {\n return DriverManager.getConnection(\"jdbc:sqlite:\" + dbName);\n } catch (SQLException e) {\n return null;\n }\n }", "public Connection getConnection() throws SQLException {\n\t\treturn Database.getConnection();\n\t}", "private Connection getDBConnection() {\n\n\t\tConnection dbConnection = null;\n\n\t\ttry {\n\n\t\t\tClass.forName(dbDriver);\n\n\t\t} catch (ClassNotFoundException e) {\n\n\t\t\tLOGGER.error(e.getMessage());\n\n\t\t}\n\n\t\ttry {\n\n\t\t\tdbConnection = DriverManager.getConnection(dbConnectionURL, dbUser, dbPassword);\n\t\t\treturn dbConnection;\n\n\t\t} catch (SQLException e) {\n\n\t\t\tLOGGER.error(e.getMessage());\n\n\t\t}\n\n\t\treturn dbConnection;\n\n\t}", "public static Connection getConnection() {\n\t\ttry {\n\t\t\treturn DBUtil.getInstance().ds.getConnection();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\n\t}", "public static Connection getDbConnection() throws SQLException {\n return getDbConnection(FxContext.get().getDivisionId());\n }", "public static Connection getConnection()\n {\n if (ds == null) {\n try {\n initCtx = new InitialContext();\n envCtx = (Context) initCtx.lookup(\"java:comp/env\");\n ds = (DataSource) envCtx.lookup(dbName);\n }\n catch (javax.naming.NamingException e) {\n Logger.log(Logger.ERROR, \"A problem occurred while retrieving a DataSource object\");\n Logger.log(Logger.ERROR, e.toString());\n }\n }\n\n Connection dbCon = null;\n try {\n dbCon = ds.getConnection();\n }\n catch (java.sql.SQLException e) {\n Logger.log(Logger.ERROR, \"A problem occurred while connecting to the database.\");\n Logger.log(Logger.ERROR, e.toString());\n }\n return dbCon;\n }", "public Connection getDbConnect() {\n return dbConnect;\n }", "public Connection getDatabaseConnection() {\n return con;\n }", "public static Connection getConnection() {\n\t\t\n\t\treturn conn;\n\t}", "public Connection connection()\n {\n String host = main.getConfig().getString(\"db.host\");\n int port = main.getConfig().getInt(\"db.port\");\n String user = main.getConfig().getString(\"db.user\");\n String password = main.getConfig().getString(\"db.password\");\n String db = main.getConfig().getString(\"db.db\");\n\n MysqlDataSource dataSource = new MysqlDataSource();\n dataSource.setServerName(host);\n dataSource.setPort(port);\n dataSource.setUser(user);\n if (password != null ) dataSource.setPassword(password);\n dataSource.setDatabaseName(db);\n Connection connection = null;\n try\n {\n connection = dataSource.getConnection();\n }\n catch (SQLException sqlException)\n {\n sqlException.printStackTrace();\n }\n return connection;\n }", "public Connection getDBConnection() {\n Connection con = connectDB();\n createTables(con);\n return con;\n }", "public IDatabaseConnection getConnection() {\n try {\n DatabaseConnection databaseConnection = new DatabaseConnection(getDataSource().getConnection());\n editConfig(databaseConnection.getConfig());\n return databaseConnection;\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "private static Connection getDBConnection() {\n\n\t\tConnection dbConnection = null;\n\n\t\ttry {\n\n\t\t\tClass.forName(DB_DRIVER);\n\n\t\t} catch (ClassNotFoundException e) {\n\n\t\t\tSystem.out.println(e.getMessage());\n\n\t\t}\n\n\t\ttry {\n\n\t\t\tdbConnection = DriverManager.getConnection(DB_CONNECTION, DB_USER,\n\t\t\t\t\tDB_PASSWORD);\n\t\t\treturn dbConnection;\n\n\t\t} catch (SQLException e) {\n\n\t\t\tSystem.out.println(e.getMessage());\n\n\t\t}\n\n\t\treturn dbConnection;\n\n\t}", "public Connection getDBConnection()\r\n {\r\n Connection conn = null;\r\n try\r\n {\r\n // Quitamos los drivers\r\n Enumeration e = DriverManager.getDrivers();\r\n while (e.hasMoreElements())\r\n {\r\n DriverManager.deregisterDriver((Driver) e.nextElement());\r\n }\r\n DriverManager.registerDriver(new com.geopista.sql.GEOPISTADriver());\r\n String sConn = aplicacion.getString(UserPreferenceConstants.LOCALGIS_DATABASE_URL);\r\n conn = DriverManager.getConnection(sConn);\r\n AppContext app = (AppContext) AppContext.getApplicationContext();\r\n conn = app.getConnection();\r\n conn.setAutoCommit(false);\r\n } catch (Exception e)\r\n {\r\n return null;\r\n }\r\n return conn;\r\n }", "private Connection getConnection() {\n if ( conn==null ) {\n conn = Util.getConnection( \"root\", \"\" );\n }\n return conn;\n }", "public Connection getConexao() {\t\n\t\ttry {\n\t\t\t\n\t\t\tif (this.conn!=null) {\n\t\t\t\treturn this.conn;\n\t\t\t}\n\t\t\t\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\tconn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/\"+this.db,this.user,this.pass);\n\t\t\t\n\t\t} catch(Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\treturn this.conn;\n\t}", "public Connection getConnection(){\n try{\n if(connection == null || connection.isClosed()){\n connection = FabricaDeConexao.getConnection();\n return connection;\n } else return connection;\n } catch (SQLException e){throw new RuntimeException(e);}\n }", "protected Connection connection() {\n\t\tif (connection == null) {\n\t\t\ttry {\n\t\t\t\tdblogger.info(\"Connecting to \" + connectionUrlString);\n\t\t\t\tconnection = DriverManager.getConnection(connectionUrlString,\n\t\t\t\t\t\tusername, password);\n\t\t\t} catch (SQLException exception) {\n\t\t\t\tdblogger.fatal(\"Failed to connect to database using \"\n\t\t\t\t\t\t+ connectionUrlString + \" User: \" + username\n\t\t\t\t\t\t+ \" Password: \" + password);\n\t\t\t\tthrow new IllegalStateException(\n\t\t\t\t\t\t\"Failed to connect to the database using \"\n\t\t\t\t\t\t\t\t+ connectionUrlString\n\t\t\t\t\t\t\t\t+ \". Please contact your DBA.\");\n\t\t\t}\n\t\t}\n\t\treturn connection;\n\t}", "public static Connection getConnection() {\n \t\treturn connPool.getConnection();\n \t}", "public static Connection getConnection() {\n\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tconn = getConnectionPool().getConnection();\n\t\t} catch (Exception e) {\n\n\t\t\tthrow new SystemException(\"Getting Connection from DB Connection Pool\",e,SystemCode.UNABLE_TO_EXECUTE);\n\t\t}\n\t\treturn conn;\n\n\t}", "public static String getConnectionDB(){\n return \"jdbc:mysql://\" + hostname +\":\"+ port+\"/\" + database;\n }", "private Connection dbConnection() {\n\t\t\n\t\t///\n\t\t/// declare local variables\n\t\t///\n\t\t\n\t\tConnection result = null;\t// holds the resulting connection\n\t\t\n\t\t// try to make the connection\n\t\ttry {\n\t\t\tClass.forName(\"org.sqlite.JDBC\");\n\t\t\tresult = DriverManager.getConnection(CONNECTION_STRING);\n\t\t} catch (Exception ex) {\n\t\t\tSystem.out.println(ex.getMessage());\n\t\t}\n\t\t\n\t\t// return the resulting connection\n\t\treturn result;\n\t\t\n\t}", "public Connection getConnection() {\n if (con == null) {\n try {\n con = DriverManager.getConnection(url, user, password);\n return con;\n } catch (SQLException e) {\n System.err.println(e.getMessage());\n }\n }\n\n return con;\n }", "public Connection getConnection() {\n try {\n return dataSource.getConnection();\n } catch (SQLException e) {\n e.printStackTrace();\n return null;\n }\n }", "public static Connection getConnection() throws SQLException {\n\t\t// Create a connection reference var\n\t\tConnection con = null;\n\n\t\t// Int. driver obj from our dependency, connect w/ JDBC\n\t\tDriver postgresDriver = new Driver();\n\t\tDriverManager.registerDriver(postgresDriver);\n\n\t\t// Get database location/credentials from environmental variables\n\t\tString url = System.getenv(\"db_url\");\n\t\tString username = System.getenv(\"db_username\");\n\t\tString password = System.getenv(\"db_password\");\n\t\t\n\t\t// Connect to db and assign to con var.\n\t\tcon = DriverManager.getConnection(url, username, password);\n\n\t\t// Return con, allowing calling class/method etc to use the connection\n\t\treturn con;\n\t}", "private Connection getDBConnection(){\n\t\tConnection conn = null;\n\t\t\t\t\n\t\ttry{\n\t\t\t\t// name of the database\n\t\t\tClass.forName(\"org.sqlite.JDBC\");\n\t\t} catch(ClassNotFoundException e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\t\t\t\n\t\ttry{\n\t\t\t// type of the database file\n\t\t\tString url = \"jdbc:sqlite:vehicles.sqlite\";\n\t\t\tconn = DriverManager.getConnection(url);\n\t\t}catch(SQLException e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\treturn conn;\n\t}", "@Override\n\tpublic DBConnection getDBConnection() {\n\t\t\n\t\tSystem.out.println(\"Started to create DB Connection Object\");\n\t\tDBConnection connection = new DBConnection();\n\t\tconnection.setImplementorName(\"MySQL Implementation\");\n\t\tSystem.out.println(\"Completed to create DB Connection Object\");\n\t\treturn connection;\n\t}", "public static Connection getDBInstance() {\r\n\t\tif (db == null)\r\n\t\t\ttry {\r\n\t\t\t\tloadDBDriver();\r\n\t\t\t\tdb = DriverManager.getConnection(url, user, password);\r\n\t\t\t} catch (SQLException 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\treturn db;\r\n\t}", "protected Connection getConnection()\n {\n Connection connection = null;\n try\n {\n connection = DriverManager.getConnection(url, user, password);\n }\n catch (SQLException ex)\n {\n Logger.getLogger(DB_Utils.class.getName()).log(Level.SEVERE, null, ex);\n }\n return connection;\n }", "public Connection getConnection() {\n\t\t\tConnection conn = null;\n\t\t\tProperties prop = new Properties();\n\n\t\t\ttry {\n\t\t\t\tString url = \"jdbc:postgresql://java2010rev.cfqzgdfohgof.us-east-2.rds.amazonaws.com:5432/postgres?currentSchema=jensquared\";\n\t\t\t\tString username = \"jenny77\";\n\t\t\t\tString password = \"zeus1418\";\n//\t\t\t\tClassLoader loader = Thread.currentThread().getContextClassLoader();\n//\t prop.load(loader.getResourceAsStream(\"database.properties\"));\n//\t\t\t\tconn = DriverManager.getConnection(prop.getProperty(\"url\"),\n//\t\t\t\t\t\tprop.getProperty(\"username\"),prop.getProperty(\"password\"));\n\t\t\t\tconn = DriverManager.getConnection(url, username, password);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n//\t\t\t} catch (FileNotFoundException e) {\n//\t\t\t\t// TODO Auto-generated catch block\n//\t\t\t\te.printStackTrace();\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\treturn conn;\n\t\t}", "private Connection getConnection() {\n if (_connection != null) return _connection;\n\n Element ncElement = getNetcdfElement();\n \n //See if we can get the database connection from a JNDI resource.\n String jndi = ncElement.getAttributeValue(\"jndi\");\n if (jndi != null) {\n try {\n Context initCtx = new InitialContext();\n Context envCtx = (Context) initCtx.lookup(\"java:comp/env\");\n DataSource ds = (DataSource) envCtx.lookup(jndi);\n _connection = ds.getConnection();\n } catch (Exception e) {\n String msg = \"Failed to get database connection from JNDI: \" + jndi;\n _logger.error(msg, e);\n throw new TSSException(msg, e);\n }\n return _connection;\n }\n\n //Make the connection ourselves.\n String connectionString = ncElement.getAttributeValue(\"connectionString\");\n String dbUser = ncElement.getAttributeValue(\"dbUser\");\n String dbPassword = ncElement.getAttributeValue(\"dbPassword\");\n String jdbcDriver = ncElement.getAttributeValue(\"jdbcDriver\");\n \n try {\n Class.forName(jdbcDriver);\n _connection = DriverManager.getConnection(connectionString, dbUser, dbPassword);\n } catch (Exception e) {\n String msg = \"Failed to get database connection: \" + connectionString;\n _logger.error(msg, e);\n throw new TSSException(msg, e);\n } \n \n return _connection;\n }", "public static Connection GetConnection() throws SQLException {\n return connectionPool.getConnection();\n }", "public Connection getConnection(){\n\t\tif(connection == null){\r\n\t\t\tinitConnection();\r\n\t\t}\r\n\t\treturn connection;\r\n\t}", "public static Connection getConnection() {\n\t\treturn null;\r\n\t}", "public static Connection getConnection() {\n\t\treturn null;\n\t}", "public Connection getConnection() {\n\t// register the JDBC driver\n\ttry {\n\t Class.forName(super.driver);\n\t} catch (ClassNotFoundException e) {\n\t e.printStackTrace();\n\t}\n \n\t// create a connection\n\tConnection connection = null;\n\ttry {\n\t connection = DriverManager.getConnection (super.jdbc_url,super.getu(), super.getp());\n\t} catch (SQLException e) {\n\t e.printStackTrace();\n\t}\n\treturn connection;\n }", "private Connection getConnection() {\n\t\tlog.debug(\"getConnection start\");\n\t\tif (con != null)\n\t\t\treturn con;\n\t\tString url = \"jdbc:mysql://localhost:3306/\" + db;\n\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\").newInstance();\n\t\t\tlog.debug(\"getConnection obtained driver\");\n\t\t\tcon = DriverManager.getConnection(url, user, password);\n\t\t\tlog.debug(\"getConnection got connection\");\n\t\t} catch (Exception ex) {\n\t\t\tlog.error(\"getConnection: error:\" + ex.getMessage(), ex);\n\t\t\treturn null;\n\t\t}\n\t\treturn con;\n\t}", "public Connection getConnection() throws SQLException {\n\t\tif (connection == null) {\n\t\t\tconnection = ConnectBDD.jdbcConnexion();\n\t\t}\n\t\treturn connection;\n\t}", "public static Connection getConn() {\n return conn;\n }", "private Connection getConnection() {\n Connection conn = null;\n\n // Force the class loader to load the JDBC driver\n try { \n // The newInstance() call is a work around for some \n // broken Java implementations\n Class.forName(jdbcDriver).newInstance(); \n } catch (Exception ex) { \n System.err.println(\"Failed to load the JDBC driver: \" + jdbcDriver);\n }\n\n // Include the username and password on the URL\n StringBuffer url = new StringBuffer();\n url.append(jdbcUrl);\n if (jdbcUsername != null) {\n url.append(\"?user=\" + jdbcUsername);\n if (jdbcPassword != null) {\n url.append(\"&password=\" + jdbcPassword);\n }\n }\n\n // Establish a connection to the database\n try {\n conn = DriverManager.getConnection(url.toString());\n } catch (SQLException ex) {\n System.err.println(\"Failed to establish a database connection: url=\" + url.toString());\n System.err.println(\"SQLException: \" + ex.getMessage()); \n System.err.println(\"SQLState: \" + ex.getSQLState()); \n System.err.println(\"VendorError: \" + ex.getErrorCode()); \n ex.printStackTrace();\n }\n\n return conn;\n }", "public static Connection getConnection() {\r\n\t\tsetProperties();\r\n\t\tConnection connection = null;\r\n\t\ttry {\r\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\r\n\t\t\tconnection = (Connection) DriverManager.getConnection(DBURL,\r\n\t\t\t\t\tproperties);\r\n//\t\t\tSystem.err.println(\"Connection Established\");\r\n\t\t} catch (SQLException e) {\r\n\t\t\tlogger.error(\"connection Not Established\");\r\n\t\t\tlogger.error(\"\", e);\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\tlogger.error(\"\", e);\r\n\t\t}\r\n\t\treturn connection;\r\n\t}", "public static Connection getConnection() {\r\n\t\tConnection conn = null;\r\n\t\ttry {\r\n\t\t\tClass.forName(DB_DRIVER);\r\n\t\t\tconn = DriverManager.getConnection(DRIVER_URL, DB_USERNAME,\r\n\t\t\t\t\tDB_PASSWORD);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn conn;\r\n\t}", "public static Connection getConnection() {\n return singleInstance.createConnection();\n }", "public static Connection getConnectionToDB() {\n\t\tProperties properties = getProperties();\n\n\t\ttry {\n\t\t\tmyConnection = DriverManager.getConnection(JDBC_URL, properties);\n\t\t\treturn myConnection;\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "public Connection getConnection() {\n this.connect();\n return this.connection;\n }", "public Connection getConnection() {\r\n\tConnection result = null;\r\n\tif (isConnected()) {\r\n\t result = conn;\r\n\t}\r\n\treturn result;\r\n }", "@Override\n\tpublic Connection getConnection() throws SQLException {\n\t\tConnection conn;\n\t\tconn = ConnectionFactory.getInstance().getConnection();\n\t\treturn conn;\n\t}", "public static Connection getInstanceConnection(){\r\n\t\ttry {\r\n\t\t\tif(conn==null) {\r\n\t\t\t\tconn=DriverManager.getConnection(url, userDb, pwdDb);\r\n\t\t\t\tSystem.out.println(\"Connexion �tablie avec la base\");\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(\"Probl�me de connexion\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn conn;\r\n\t}", "public DatabaseClient getDb() {\n return db;\n }", "public Connection getConnection()\n\t{\n\t\treturn connection;\n\t}", "public static Connection getConnection() {\r\n\r\n\t\tConfigLoader loader = new ConfigLoader();\r\n\t\tProperties properties = null;\r\n\t\t;\r\n\t\ttry {\r\n\t\t\tproperties = loader.loadConfigurations();\r\n\t\t} catch (IOException e) {\r\n\t\t\tlogger.error(e.getStackTrace().toString());\r\n\t\t}\r\n\t\tConnection connection = null;\r\n\t\ttry {\r\n\t\t\tString url = properties.getProperty(\"hsqldb.url\");\r\n\t\t\tString user = properties.getProperty(\"hsqldb.user\");\r\n\t\t\tString password = properties.getProperty(\"hsqldb.password\");\r\n\t\t\tlogger.info(\"Connecting to hsqlDB with db:\" + url);\r\n\t\t\tconnection = DriverManager.getConnection(url, user, password);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tlogger.error(e.getStackTrace().toString());\r\n\t\t}\r\n\t\treturn connection;\r\n\t}", "public static Connection getConnection() {\n Connection conn = null;\n\n try {\n DataSource dataSource = (DataSource) new InitialContext().lookup(\"jdbc/library\");\n conn = dataSource.getConnection();\n } catch (SQLException | NamingException e) {\n LOG.error(e.getMessage(), e);\n }\n return conn;\n }", "public Connection getConnection() throws SQLException {\r\n if (user != null) {\r\n return dataSource.getConnection(user, password);\r\n } else {\r\n return dataSource.getConnection();\r\n }\r\n }", "public static MyConnection getConnection() throws SQLException{\n\t\treturn MyConnection.getConnection();\n\t}", "public static Connection getConnection() {\n if (connection == null) {\n try {\n connect();\n } catch (IOException e) {\n if (sc != null) {\n sc.log(\"connect \", e);\n }\n }\n }\n if (connection == null) {\n if (sc != null) {\n sc.log(\"BigtableHelper-No Connection\");\n }\n }\n return connection;\n }", "public static Connection getDBConnection(){\n\t\tConnection conn = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\t/*InputStream is = DBConfig.class.getClass().\r\n\t\t\t\t\tgetResourceAsStream(\"/resources/db.properties\");\r\n\t\t\tprop.load(is);\r\n\t\t\tClass.forName(prop.getProperty(\"drivername\"));\r\n\t\t\tconn = DriverManager.getConnection(prop.getProperty(\"jdbcurl\"),\r\n\t\t\t\t\tprop.getProperty(\"username\"),prop.getProperty(\"password\"));*/\r\n\t\t\t\r\n\t\t\tClass.forName(\"oracle.jdbc.driver.OracleDriver\");\r\n\t\t\tconn = DriverManager.getConnection(\"jdbc:oracle:thin:@localhost:1521:orcl\",\"fred\",\"flintstone\");\r\n\t\t\t/*Statement stmt = conn.createStatement();\r\n\t\t\tResultSet rs = stmt.executeQuery(\"SELECT LOCATION_NAME FROM LOCATIONS\");\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\tSystem.out.println(rs.getString(\"LOCATION_NAME\"));\r\n\t\t\t}*/\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} /*catch (FileNotFoundException e){\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}*/\r\n\t\t\r\n\t\treturn conn;\r\n\t}", "public final DBI getConnect() {\n try {\n Class.forName(\"com.mysql.cj.jdbc.Driver\");\n // String dbc = System.getenv(\"DB_CONNECTION\");\n // if (dbc == null || dbc.equals(\"\")) {\n // dbc = \"localhost:3306\";\n // }\n // DBI dbi = new DBI(\"jdbc:mysql://\" + dbc + \"/MLPXX?allowPublicKeyRetrieval=true&useSSL=false\", \"MLPXX\", \"MLPXX\");\n DBI dbi = new DBI(\"jdbc:mysql://localhost:3306/MLPXX?allowPublicKeyRetrieval=true&useSSL=false\", \"MLPXX\", \"MLPXX\");\n\n //DBI dbi = new DBI(\"jdbc:mysql://\" + dbc + \"/MLPXX?useSSL=false\", \"MLPXX\", \"MLPXX\");\n // dbi.setSQLLog(new PrintStreamLog());\n return dbi;\n } catch (ClassNotFoundException e) {\n //return null;\n throw new RuntimeException(e);\n }\n }", "public Connection getConnection() throws SQLException {\r\n return connection;\r\n }", "public Database getDatabase() {\n return dbHandle;\n }", "public static Connection getConnection() throws Exception {\n\t\treturn jdbcConnectionPool.getConnection();\r\n\r\n\t\t// return getInstance().dataSourse.getConnection();\r\n\t}", "public Connection getConnection() {\n java.sql.Connection connection = null;\n try {\n connection = DriverManager.getConnection(\n \"jdbc:postgresql://cslvm74.csc.calpoly.edu:5432/bfung\", \"postgres\",\n \"\");\n } catch (SQLException e) {\n System.out.println(\"Connection Failed! Check output console\");\n e.printStackTrace();\n return null;\n }\n return connection;\n }", "static Connection getDBConnection(){\r\n\t\t if(mainConnection != null)\r\n\t\t\t return mainConnection;\r\n\t\t \r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\t// loading Oracle Driver\r\n\t\t \t\tSystem.out.print(\"Looking for Oracle's jdbc-odbc driver ... \");\r\n\t\t\t \tDriverManager.registerDriver(new oracle.jdbc.OracleDriver());\r\n\t\t\t \tSystem.out.println(\", Loaded.\");\r\n\r\n\t\t\t\t\tString URL = \"jdbc:oracle:thin:@localhost:1521:orcl\";\r\n\t\t\t \tString userName = \"system\";\r\n\t\t\t \tString password = \"password\";\r\n\r\n\t\t\t \tSystem.out.print(\"Connecting to DB...\");\r\n\t\t\t \tmainConnection = DriverManager.getConnection(URL, userName, password);\r\n\t\t\t \tSystem.out.println(\", Connected!\");\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\tSystem.out.println( \"Error while connecting to DB: \"+ e.toString() );\r\n\t\t \t\te.printStackTrace();\r\n\t\t \t\tSystem.exit(-1);\r\n\t\t \t\t}\r\n\t\t\t\treturn mainConnection;\r\n\t\t \r\n\t}", "public static Connection getConnection() {\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tconn = getConnectionPool().getConnection();\n\t\t\t// will get a thread-safe connection from the BoneCP connection\n\t\t\t// pool.\n\t\t\t// synchronization of the method will be done inside BoneCP source\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn conn;\n\t}", "public Connection getConnection() {\n return conn;\n }", "public Connection getConnection() {\n return conn;\n }", "private Connection getConnection() throws ClassNotFoundException, SQLException {\n\n log.info(\"Get DB connection\");\n\n String url = AppConfig.getInstance().getProperty(\"db.URL\") +\n AppConfig.getInstance().getProperty(\"db.schema\") +\n AppConfig.getInstance().getProperty(\"db.options\");\n String sDBUser = AppConfig.getInstance().getProperty(\"db.user\");\n String sDBPassword = AppConfig.getInstance().getProperty(\"db.password\");\n\n if (sDBUser != null && sDBPassword != null && sDBPassword.startsWith(\"crypt:\")) {\n AltEncrypter cypher = new AltEncrypter(\"cypherkey\" + sDBUser);\n sDBPassword = cypher.decrypt(sDBPassword.substring(6));\n }\n\n return DriverManager.getConnection(url, sDBUser, sDBPassword);\n }", "public static Connection getInstance() {\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tconn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/restaurant?useSSL=false\", \"root\", \"1234\");\n\t\t} catch (SQLException e) {\n\t\t\te.getStackTrace();\n\t\t}\n\t\treturn conn;\n\t}", "public final Connection getConnection() throws SQLException {\n\t\treturn this.ds != null ? this.ds.getConnection() : DriverManager\n\t\t\t\t.getConnection(this.url);\n\t}", "public final Connection getConnection() throws SQLException {\n\t\tString[] threadCredentials = (String[]) this.threadBoundCredentials.get();\n\t\tif (threadCredentials != null) {\n\t\t\treturn doGetConnection(threadCredentials[0], threadCredentials[1]);\n\t\t}\n\t\telse {\n\t\t\treturn doGetConnection(this.username, this.password);\n\t\t}\n\t}", "public static Connection getConnection() {\n Connection localConnection = connection;\n if (localConnection == null) synchronized (DB_ConnectionProvider.class) {\n\n // multi thread supported, double checker lock\n\n localConnection = connection;\n if (localConnection == null) {\n try {\n Class.forName(\"oracle.jdbc.driver.OracleDriver\");\n // oracle driver: oracle.jdbc.driver.OracleDriver\n // mysql driver: com.mysql.jdbc.Driver\n connection = localConnection = DriverManager.getConnection(\n \"jdbc:oracle:thin:@localhost:1521:XE\", USERNAME, PASSWORD);\n // mysql url: jdbc:mysql://localhost:3306/world\n // oracle url: jdbc:oracle:thin:@localhost:1521:XE\n } catch (Exception ex) {\n System.out.println(\"Could not connect with the database.\");\n }\n }\n }\n return localConnection;\n }", "public static Connection getCon() {\n Connection con= null;\n try{\n Class.forName(driver);\n con = DriverManager.getConnection(dBUrl);\n } catch (SQLException e) {\n e.printStackTrace();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n return con;\n }", "public Connection getConnection() throws SQLException {\n return new ConnectionWrapper(currentPreparedStatement.getConnection());\n }", "public static Connection getConnection() {\n Connection con = null;\n try {\n Class.forName(\"org.hsqldb.jdbcDriver\");\n con = DriverManager.getConnection(\n \"jdbc:hsqldb:mem:avdosdb\", \"sa\", \"\");\n } catch(Exception e) {\n e.printStackTrace();\n }\n return con;\n }", "public static Connection getConnection() throws SQLException{\n\t\tif( conn != null ){\n\t\t\treturn conn;\n\t\t}else{\n\t\t\topenConnection();\n\t\t\treturn conn;\n\t\t}\n\t}", "private Connection getConnection() throws SQLException { //gets and returns a connection to the database at the file path specified when the object was instantiated\n return DriverManager.getConnection(\"jdbc:sqlite:\" + databasePath); //returns the connection to the specified database\n }", "public Connection getConnection() throws SQLException{\n return ds.getConnection();\n }", "public static DbConnection getInstance() {\n if (!DbConnectionHolder.INSTANCE.isInitialized.get()) {\n synchronized (lock) {\n DbConnectionHolder.INSTANCE.initialize();\n }\n }\n return DbConnectionHolder.INSTANCE;\n }", "public static Connection connect() throws SQLException {\n\t\tif (connection != null) {\n\t\t\treturn connection;\n\t\t} else {\n\n\t\t\tDBConnection db = new DBConnection();\n\t\t\treturn db.connection;\n\t\t}\n\n\t}", "public String getConnection()\n {\n return this.connection;\n }", "Connection getConnection() {\n\t\treturn connection;\n\t}", "public static Connection getConnection() {\r\n\t\tConnection connection = null;\r\n\t\ttry {\r\n\t\t\tString dbDirectory = \"C:/Users/MAX-Student/Desktop/java/db\";\r\n\t\t\tSystem.setProperty(\"derby.system.home\", dbDirectory);\r\n\r\n\t\t\t// set the db url, username, and password\r\n\t\t\tString url = \"jdbc:derby:InspirationalDB\";\r\n\t\t\tString username = \"\";\r\n\t\t\tString password = \"\";\r\n\r\n\t\t\tconnection = DriverManager.getConnection(url, username, password);\r\n\t\t\treturn connection;\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\tfor (Throwable t : e)\r\n\t\t\t\tt.printStackTrace(); // for debugging\r\n\t\t\treturn null;\r\n\t\t }\r\n\t}", "public static Connection getConnection(){\n\t\t/***********************************************************************\n\t\t * Method................................................getConnection *\n\t\t * Author..........................................................JLH *\n\t\t *---------------------------------------------------------------------*\n\t\t * This method obtains a connection to the database *\n\t\t * *\n\t\t * Return Value \t\t\t\t\t\t\t\t\t\t\t\t\t *\n\t\t * (Connection) conn: Returns a connection to the database or null if *\n\t\t * one cannot be obtained. *\n\t\t ***********************************************************************/\n\t\tConnection conn=null;\n\t\t \n\t\ttry {\n\t\t Class.forName(\"com.mysql.jdbc.Driver\"); \n\t\t conn = DriverManager.getConnection(\"jdbc:mysql://70.178.114.2:3306/stagecraft?user=root&password=Security_Pr0bs12!@\");\n\t\t}\n\t\tcatch (SQLException ex) {\n\t\t System.out.println(\"Error: \" + ex);\n\t\t return null;\n\t\t}\n\t\tcatch(NullPointerException ex) {\n\t\t\tSystem.out.println(\"Error: \" + ex);\n\t\t \treturn null;\n\t\t} catch (ClassNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t}\n\t return conn;\t\t\n\t}", "public Connection getConnection(){\n try {\n return connectionFactory.getConnection(); // wird doch schon im Konstruktor von TodoListApp aufgerufen ???\n } catch (SQLException e) {\n e.printStackTrace();\n throw new RuntimeException(e);\n }\n }", "private Connection getConnection() throws SQLException, ClassNotFoundException {\n return connectionBuilder.getConnection();\n }", "protected Connection getConnection() {\n return con;\n }", "public String getDbconnstr() {\n return dbconnstr;\n }", "public static Connection getConnection() {\r\n\t\tString DRIVER_CLASS = \"com.mysql.cj.jdbc.Driver\";\r\n\t\ttry {\r\n\t\t\tClass.forName(DRIVER_CLASS).getDeclaredConstructor().newInstance();\r\n\t\t} catch(Exception e) {\r\n\t\t\tthrow new RuntimeException(e);\r\n\t\t}\r\n\t\tjava.sql.Connection conn = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tconn = DriverManager.getConnection(DatabaseInfo.url, DatabaseInfo.username, DatabaseInfo.password);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new RuntimeException(e);\r\n\t\t}\r\n\t\treturn conn;\r\n\t}", "private Connection getDb() throws TzException {\n if (conn != null) {\n return conn;\n }\n\n try {\n dbPath = cfg.getDbPath();\n\n if (debug()) {\n debug(\"Try to open db at \" + dbPath);\n }\n\n conn = DriverManager.getConnection(\"jdbc:h2:\" + dbPath,\n \"sa\", \"\");\n\n final ResultSet rset =\n conn.getMetaData().getTables(null, null,\n aliasTable, null);\n if (!rset.next()) {\n clearDb();\n loadInitialData();\n }\n } catch (final Throwable t) {\n // Always bad.\n error(t);\n throw new TzException(t);\n }\n\n return conn;\n }", "private static Connection getConnection(){\n Connection conn = THREAD_CONNECTION.get();\n if(conn == null){\n try {\n conn = DATA_SOURCE.getConnection();\n } catch (SQLException e) {\n e.printStackTrace();\n LOGGER.error(\"getConnection error\", e);\n throw new RuntimeException(e);\n } finally {\n THREAD_CONNECTION.set(conn);\n }\n }\n AssertUtil.notNull(conn);\n return conn;\n }", "public static Connection getConnection() {\n try {\n String dbURL = \"jdbc:mysql://\" + HOST + \":3306/soccer\" ;\n Class.forName(DRIVER);\n Connection connection = DriverManager.getConnection(dbURL, USERNAME, PASSWORD);\n return connection;\n } catch (Exception e) {\n System.out.println(\"Error in Database.getConnection: \" + e.getMessage());\n return null;\n }\n }", "private Connection getConn(){\n \n return new util.ConnectionPar().getConn();\n }", "public static Connection getConnection() throws SQLException {\n\t\ttry {\n\t\t\tClass.forName(\"oracle.jdbc.driver.OracleDriver\"); //registering Oracle Driver\n\t\t}\n\t\tcatch(ClassNotFoundException ex) {\n\t\t\tex.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\tString url = System.getenv(\"DB_URL\"); // best not to hard code in your db credentials ! \n\t\tString username = System.getenv(\"DB_USERNAME\");\n\t\tString password = System.getenv(\"DB_PASSWORD\");\n\t\tif(connection == null || connection.isClosed()) {\n\t\t\tconnection = DriverManager.getConnection(url, username, password);\n\t\t\tSystem.out.println(connection.getMetaData().getDriverName());\n\t\t}\n\t\treturn connection;\n\t}", "private synchronized Connection getConnection() throws SQLException {\n return datasource.getConnection();\r\n }", "public Connection getConnection() {\n return connection;\n }", "public static Connection getConnection() {\n try {\n return DriverManager.getConnection(CONNECTION_STRING);\n } catch (final SQLException e) {\n throw new RuntimeException(e);\n }\n }", "public Connection getConnection() throws SQLServerException\n {\n return ds.getConnection();\n }" ]
[ "0.82745546", "0.82193875", "0.8089118", "0.80346507", "0.79920435", "0.7988019", "0.79052126", "0.7890331", "0.78707033", "0.78678", "0.7846189", "0.7836675", "0.78134084", "0.7810837", "0.7799963", "0.7738605", "0.7734664", "0.76906776", "0.76396114", "0.7629801", "0.7612261", "0.76051617", "0.7591813", "0.75544786", "0.7553451", "0.75380266", "0.75307393", "0.7517341", "0.75139755", "0.75113547", "0.7505155", "0.7491263", "0.74854285", "0.7483699", "0.74554867", "0.7449574", "0.7435252", "0.7432373", "0.7429046", "0.74249554", "0.741035", "0.74077976", "0.7406063", "0.7401417", "0.7400147", "0.738739", "0.738715", "0.73833424", "0.73758864", "0.7375681", "0.7370017", "0.7348744", "0.73303527", "0.73303217", "0.7324972", "0.73243284", "0.7321543", "0.7311447", "0.7302312", "0.7299148", "0.7279329", "0.7278063", "0.72759795", "0.7269004", "0.72683376", "0.7264629", "0.72585386", "0.72574985", "0.72574985", "0.72563607", "0.72521496", "0.72473717", "0.7235563", "0.7221498", "0.7212442", "0.72104716", "0.72061455", "0.7203636", "0.71923935", "0.71910566", "0.7190771", "0.7181295", "0.717976", "0.7175882", "0.7168794", "0.7159356", "0.7127049", "0.71245885", "0.7124541", "0.7123912", "0.71112794", "0.7106924", "0.71021366", "0.70984036", "0.7095476", "0.7093884", "0.709275", "0.7091652", "0.708785", "0.70735025" ]
0.71411514
86
Returns true if database exists but is empty. True also could indicate a read error. Check if Database is readable before using this method.
public boolean isEmpty() { Statement stmt = null; ResultSet rs = null; int count = 0; try { stmt = this.connection.createStatement(); // without features we are not able to operate correctly rs = stmt.executeQuery("SELECT COUNT(Id) FROM Features;"); count = rs.getInt(1); stmt.close(); } catch (SQLException e) { // for now, do not handle read exceptions, b/c exception here also indicates the failure to get features } return (0 == count); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkIfDatabaseExists() {\r\n return database.exists();\r\n }", "public boolean databaseExists() {\n return defaultDatabaseExists();\n }", "public synchronized boolean existsDatabase() throws IOException {\n return existsDatabase(database.get(), null);\n }", "public boolean databaseExists() {\n\t\treturn defaultDatabaseExists();\n\t}", "private boolean databaseExists() {\n File dbFile = mContext.getDatabasePath(DBNAME);\n return dbFile.exists();\n }", "boolean hasDatabase();", "private boolean checkDataBase(){\n\n SQLiteDatabase checkDB = null;\n\n try{\n String myPath = DB_PATH + DB_NAME;\n checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);\n\n }catch(SQLiteException e){\n\n //database does't exist yet.\n\n }\n\n if(checkDB != null){\n\n checkDB.close();\n\n }\n\n return checkDB != null ? true : false;\n }", "private boolean checkDataBase(){\n\n SQLiteDatabase checkDB = null;\n\n try{\n String myPath = DB_PATH + DB_NAME;\n checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);\n\n }catch(SQLiteException e){\n\n //database does't exist yet.\n\n }\n\n if(checkDB != null){\n\n checkDB.close();\n\n }\n\n return checkDB != null ? true : false;\n }", "private boolean checkDataBase()\r\n {\r\n SQLiteDatabase checkDB = null;\r\n try {\r\n String myPath = DB_PATH;\r\n checkDB\r\n = SQLiteDatabase\r\n .openDatabase(\r\n myPath, null,\r\n SQLiteDatabase.OPEN_READONLY);\r\n }\r\n catch (SQLiteException e) {\r\n\r\n // database doesn't exist yet.\r\n Log.e(\"message\", \"\" + e);\r\n }\r\n if (checkDB != null) {\r\n checkDB.close();\r\n }\r\n return checkDB != null;\r\n }", "private boolean checkDataBase() {\n\n\t\tFile dbFile = null;\n\t\ttry {\n\t\t\t// String myPath = DATABASE_PATH + DATABASE_NAME;\n\t\t\t// checkDB = SQLiteDatabase.openDatabase(myPath, null,\n\t\t\t// SQLiteDatabase.OPEN_READONLY);\n\t\t\tdbFile = new File(DATABASE_PATH + DATABASE_NAME);\n\t\t\treturn dbFile.exists();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t/*if(checkDB != null){\n\t\t checkDB.close();}\n\t\t return checkDB != null ? true : false;*/\n\t\treturn dbFile != null ? true : false;\n\t}", "private boolean checkDataBase() {\n\n SQLiteDatabase checkDB = null;\n\n try {\n String myPath = DB_PATH + DATABASE_NAME;\n checkDB = SQLiteDatabase.openDatabase(myPath, null,\n SQLiteDatabase.OPEN_READONLY);\n\n } catch (SQLiteException e) {\n\n // database doesn't exist yet.\n Log.d(\"DATABASE\",\"Database doesn't exist yet.\");\n }\n\n if (checkDB != null) {\n checkDB.close();\n }\n return checkDB != null;\n }", "public boolean hasDatabase() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "private boolean checkDatabase() {\n SQLiteDatabase checkDB = null;\n\n try {\n String dbPath = DB_PATH + DB_NAME;\n checkDB = SQLiteDatabase.openDatabase(\n dbPath, \n null,\n SQLiteDatabase.NO_LOCALIZED_COLLATORS // Open without support for localized collators. setLocate() will do nothing.\n );\n } catch (SQLiteException e) {\n // Do nothing - database doesn't exist yet\n }\n\n if (checkDB != null) {\n checkDB.close();\n }\n\n return checkDB != null ? true : false;\n }", "public boolean isSetDb()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(DB$2) != 0;\r\n }\r\n }", "public boolean hasDatabase() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "private boolean checkDataBase() {\n// boolean checkDB = false;\n File dbfile = null;\n try {\n String myPath = DBLOCATION + DBNAME;\n dbfile = new File(myPath);\n// checkDB = dbfile.exists();\n } catch (SQLiteException e) {\n }\n// return checkDB;\n return dbfile.exists();\n }", "public boolean checkDataBase(){\n \n \tSQLiteDatabase checkDB = null;\n \tLog.d(\"We're Here\", \"DatabaseHelper.checkDataBase()\");\n \ttry{\n \t\tString myPath = DB_PATH + DB_NAME;\n \t\tcheckDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);\n \n \t}catch(SQLiteException e){\n \n \t\tLog.d(\"We're Here\", \"Database doesn't exist\");\n \t\tLog.d(\"Database Error\", e.toString());\n \n \t}\n \tcatch (Exception e) { \n \t\tLog.d(\"Exception in checkDatabase\", e.toString());\n \t\t\n \t}\n \n \tif(checkDB != null){\n \n \t\tcheckDB.close();\n \n \t}\n \n \treturn checkDB != null;\n }", "public boolean isSetDatabase() {\r\n return this.database != null;\r\n }", "public boolean isSetDatabase() {\r\n return this.database != null;\r\n }", "public boolean isSetDatabase() {\r\n return this.database != null;\r\n }", "public boolean isSetDatabase() {\r\n return this.database != null;\r\n }", "public boolean isSetDatabase() {\r\n return this.database != null;\r\n }", "private boolean databaseExists() {\n SQLiteDatabase checkDB = null;\n try {\n String myPath = DATABASE_PATH + DATABASE_NAME;\n checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);\n } catch (SQLiteException e) {\n Log.i(\"burra\",\"Database \"+DATABASE_PATH+DATABASE_NAME+\"not found. Will copy from assets folder\");\n }\n if(null!=checkDB){\n checkDB.close();\n return true;\n }\n return false;\n }", "private boolean checkDataBase() {\r\n SQLiteDatabase checkDB = null;\r\n try {\r\n checkDB = SQLiteDatabase.openDatabase(\"/data/data/me.shubhamgoswami.adharshilasurvey/adharShila.db\", null,\r\n SQLiteDatabase.OPEN_READONLY);\r\n checkDB.close();\r\n } catch (SQLiteException e) {\r\n // database doesn't exist yet.\r\n }\r\n return checkDB != null;\r\n }", "public boolean checkDataBase() {\n SQLiteDatabase sQLiteDatabase;\n try {\n SQLiteDatabase sQLiteDatabase2;\n sQLiteDatabase = sQLiteDatabase2 = SQLiteDatabase.openDatabase((String)(DB_PATH + DB_NAME), (SQLiteDatabase.CursorFactory)null, (int)0);\n }\n catch (SQLiteException var1_4) {\n return false;\n }\n if (sQLiteDatabase != null) {\n sQLiteDatabase.close();\n }\n boolean bl = false;\n if (sQLiteDatabase == null) return bl;\n return true;\n }", "private boolean checkDataBase() {\n SQLiteDatabase checkDb = null;\n try {\n String path = DB_PATH + DB_NAME;\n checkDb = SQLiteDatabase.openDatabase(path, null,\n SQLiteDatabase.OPEN_READONLY);\n } catch (SQLException e) {\n Log.e(this.getClass().toString(), \"Error while checking db\");\n }\n //Android doesn’t like resource leaks, everything should \n // be closed\n if (checkDb != null) {\n checkDb.close();\n }\n return checkDb != null;\n }", "private boolean checkDataBase() {\n SQLiteDatabase tempDB = null;\n try {\n String myPath = DB_PATH + DB_NAME;\n tempDB = SQLiteDatabase.openDatabase(myPath, null,\n SQLiteDatabase.OPEN_READWRITE);\n } catch (SQLiteException e) {\n Log.e(\"tle99 - check\", e.getMessage());\n }\n if (tempDB != null)\n tempDB.close();\n return tempDB != null ? true : false;\n }", "public boolean testDatabaseExists()\r\n {\r\n try {\r\n myStmt = myConn.createStatement();\r\n myRs = myStmt.executeQuery(\"show databases like '\" + dbname + \"'\");\r\n if (myRs.next())\r\n return true;\r\n return false;\r\n } catch (SQLException ex) {\r\n Logger.getLogger(SQLConnector.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return false;\r\n }", "public static boolean DBExists() {\n File edb = new File(path + \"/turtlenet.db.aes\");\n File db = new File(path + \"/turtlenet.db\");\n return db.exists() || edb.exists();\n }", "public boolean databaseExists(String dbName) throws Exception;", "public Boolean isDatabaseReady() {\n\t\tif (databaseIsReady == false) {\n\t\t\tdatabaseIsReady = tableExists(SERVICE_STATE_TABLE);\n\t\t}\n\t\treturn databaseIsReady;\n\t}", "public boolean isDBConnected() {\n\t\ttry {\n\t\t\treturn !conn.isClosed();\n\t\t} catch (SQLException e) {\n\t\t\treturn false;\n\t\t}\n\t}", "private void checkDB() {\n\t\tif (couchDB_ip == null) {\n\t\t\tsetCouchDB_ip();\n\t\t}\n\n\t\tif (!databaseExist) {\n\n\t\t\tsynchronized (databaseExist) {\n\n\t\t\t\tif (!databaseExist) {\n\n\t\t\t\t\tif (couchDB_USERNAME != null\n\t\t\t\t\t\t\t&& !couchDB_USERNAME.trim().isEmpty()\n\t\t\t\t\t\t\t&& couchDB_PASSWORD != null\n\t\t\t\t\t\t\t&& !couchDB_PASSWORD.trim().isEmpty()) {\n\t\t\t\t\t\tUsernamePasswordCredentials creds = new UsernamePasswordCredentials(\n\t\t\t\t\t\t\t\tcouchDB_USERNAME, couchDB_PASSWORD);\n\t\t\t\t\t\tauthentication = BasicScheme.authenticate(creds,\n\t\t\t\t\t\t\t\t\"US-ASCII\", false).toString();\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (CouchDBUtil.checkDB(getCouchDB_ip(), couchDB_NAME,\n\t\t\t\t\t\t\t\tauthentication)) {\n\n\t\t\t\t\t\t\tdatabaseExist = true;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tCouchDBUtil.createDb(getCouchDB_ip(), couchDB_NAME,\n\t\t\t\t\t\t\t\t\tauthentication);\n\t\t\t\t\t\t\tdatabaseExist = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (MalformedURLException e) {\n\t\t\t\t\t\tlogger.info(\"Impossible to access CouchDB\", e);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private boolean exists() {\n try {\n DatabaseMetaData md = conn.getMetaData();\n ResultSet rs = md.getTables(null, null, \"settings\", null);\n return rs.next();\n } catch (SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n System.exit(0);\n return false;\n }\n }", "public static boolean DBDirExists() {\n File dir = new File(path);\n return dir.exists();\n }", "private boolean checkIfDatabaseOnDevice() {\n SQLiteDatabase tempDB = null;\n try {\n String myPath = DB_PATH + DB_NAME;\n tempDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE);\n } catch (SQLiteException e) {\n e.printStackTrace();\n }\n if (tempDB != null)\n tempDB.close();\n return tempDB != null;\n }", "public synchronized boolean existsDatabase(final String storageType) throws IOException {\n checkConnected();\n return existsDatabase(getStorageName(), storageType);\n }", "boolean dbExists(String dbName);", "boolean databaseExists(String databaseName) throws CatalogException;", "public boolean isRunning(){\r\n try{\r\n List<String> dbNames = mongo.getDatabaseNames();\r\n if(!dbNames.isEmpty()){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n } catch (MongoException e){\r\n// e.printStackTrace();\r\n return false;\r\n }\r\n }", "boolean isNewDatabase() {\n String sql = \"SELECT tbl_name FROM sqlite_master WHERE tbl_name=?\";\n\n return query(new QueryStatement<Boolean>(sql) {\n @Override\n public void prepare(PreparedStatement statement) throws SQLException {\n statement.setString(1, tableName);\n }\n\n @Override\n public Boolean processResults(ResultSet set) throws SQLException {\n return !set.next();\n }\n });\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 }", "private boolean dbCheck() {\n SQLiteDatabase db = null;\n try\n {\n String dbPath = DB_PATH + DB_NAME;\n Log.e(\"database\",\"path created \");\n Log.d(\"dbPath\", dbPath);\n db = SQLiteDatabase.openDatabase(dbPath, null, SQLiteDatabase.OPEN_READWRITE);\n Log.e(\"database\",\"open database \");\n db.setLocale(Locale.getDefault());\n Log.e(\"database\",\"set locale \");\n db.setVersion(1);\n Log.e(\"database\",\"version set\");\n }catch (SQLiteException e)\n {\n e.printStackTrace();\n Log.d(\"SQLHelper\", \"couldnt find database\");\n\n }\n if (db !=null)\n {\n db.close();\n }\n return db != null ? true : false;\n }", "boolean isDbInitialized() {return dbInitialized;}", "public boolean exists() {\n try {\n return open() != null;\n } catch (IOException e) {\n return false;\n }\n }", "public boolean isDBValid(){\r\n return noInduk != null && !noInduk.isEmpty();\r\n }", "private boolean inDatabase() {\r\n \t\treturn inDatabase(0, null);\r\n \t}", "@Override\r\n\tpublic boolean isDatabaseAvailable(UserDatabase userDatabase) {\n\t\t\r\n\t\treturn false;\r\n\t}", "public synchronized boolean existsDatabase(final String iDatabaseName, final String storageType)\n throws IOException {\n checkConnected();\n return remote.exists(iDatabaseName, user, password);\n }", "@Override\n public boolean isEmpty() throws DaoException {\n return isEmpty(TABLE_NAME);\n }", "public boolean exists(String databaseName) {\n return context.databaseExists(databaseName);\n }", "public boolean isSetDbName() {\n return this.dbName != null;\n }", "public boolean isMonomerStoreEmpty() {\r\n return (this.monomerDB == null || this.monomerDB.values() == null || this.monomerDB.values().size() == 0);\r\n }", "public boolean isCompetitionDB() throws NoConnectionToDBException, SQLException {\n if (isCompetitionDB != null) {\n return isCompetitionDB;\n }\n PreparedStatement ps = getConn().prepareStatement(\"SELECT competition FROM DBConfiguration\");\n ResultSet rs = ps.executeQuery();\n if (rs.next()) {\n isCompetitionDB = rs.getBoolean(\"competition\");\n return isCompetitionDB;\n }\n return false;\n }", "boolean hasDatabaseSpec();", "public boolean checkDbStructure(){\n\t\tboolean isStructureOk = false;\n\t\t\n\t\ttry {\n\t\t\tmMysqlConnection = DriverManager\n\t\t\t\t.getConnection(getConnectionURI());\n\t\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Description, Version from \" + mDbName + \".\" + TABLE_AREA);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select Area_ID, Route_ID from \" + mDbName + \".\" + TABLE_AREA_HAS_ROUTES);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Ticket_ID, Name, StartName, EndName from \" + mDbName + \".\" + TABLE_ROUTE);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select Route_ID, Station_ID, Position from \" + mDbName + \".\" + TABLE_ROUTE_HAS_STATIONS);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Abbreviation, Latitude, Longitude from \" + mDbName + \".\" + TABLE_STATION);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Icon, Is_Superior from \" + mDbName + \".\" + TABLE_TICKET);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\t\n\t\t\tisStructureOk = true;\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.severe(\"!EXCEPTION: \" + e.getMessage());\n\t\t\tisStructureOk = false;\n\t\t}\n\t\t\n\t\treturn isStructureOk;\n\t}", "private void checkDataBase() {\n final Config dbConfig = config.getConfig(\"db\");\n\n checkArgument(!isNullOrEmpty(dbConfig.getString(\"driver\")), \"db.driver is not set!\");\n checkArgument(!isNullOrEmpty(dbConfig.getString(\"url\")), \"db.url is not set!\");\n\n dbConfig.getString(\"user\");\n dbConfig.getString(\"password\");\n dbConfig.getObject(\"additional\");\n }", "public boolean isEmpty () {\n DBHandler handler = new DBHandler(this,null,null,1);\n Cursor c = handler.getEvent();\n String print = \"\";\n c.moveToFirst();\n\n do {\n } while (c.moveToNext());\n if(c.getCount() == 0) return true;\n else return false;\n }", "private boolean tableExistsAndIsOK() throws SQLException {\n trace(\"tableExistsAndIsOK\");\n boolean result;\n Statement stmt = _connection.createStatement();\n try {\n stmt.setMaxRows(1);\n String command = \"SELECT \" + LONG_VALUE + \" FROM \" + _tableName;\n ResultSet rs = stmt.executeQuery(command);\n rs.close();\n result = true;\n } catch (SQLException e) {\n result = false;\n }\n stmt.close();\n return result;\n }", "public boolean exists() throws LRException\n\t{\n\t\tDataHRecordData myData=(DataHRecordData)getData();\n\t\tgetBackground();\n\t\ttry { return myData.record.exists(background.getClient()); }\n\t\tcatch (LDBException e) { setStatus(e); }\n\t\treturn false;\n\t}", "public boolean hasDatabaseSpec() {\n return databaseSpecBuilder_ != null || databaseSpec_ != null;\n }", "public boolean isOpen()\r\n {\r\n if(connection != null)\r\n {\r\n try\r\n {\r\n return !connection.isClosed();\r\n } catch(SQLException exception)\r\n {\r\n LOG.log(Level.SEVERE, \"\", exception);\r\n }\r\n }\r\n return false;\r\n }", "@Test\n\tpublic void testExistsDB() throws Exception {\n\t\tassertExists(\"The Rodin database should exist\", rodinDB);\n\t}", "public boolean isDbConnected(Connection dbConnection) {\n try {\n return !dbConnection.isClosed();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return false;\n }", "public boolean isDbToUpdate() {\n\t\treturn !(this.properties.getProperty(SoundLooperProperties.KEY_DB_TO_UPDATE, \"0\").equals(\"0\"));\n\t}", "public static boolean hasConnection() {\n \t\treturn connPool.getConnectionCount() > 0;\n \t}", "public boolean exist() {\n\t\treturn false;\n\t}", "@Test\n public void testIsEmpty() throws Exception {\n DatabaseProperties prop = cveDb.getDatabaseProperties();\n assertNotNull(prop);\n //no exception means the call worked... whether or not it is empty depends on if the db is new\n //assertEquals(expResult, result);\n }", "@java.lang.Override\n public boolean hasDatabaseSpec() {\n return databaseSpec_ != null;\n }", "public boolean initializeDB() {\n return false;\n }", "public boolean exists() {\n return exists(Datastore.fetchDefaultService());\n }", "public static boolean isFullSql() {\r\n return fullSql;\r\n }", "@Override\n public boolean isAlreadyInDb () {\n try {\n load( idDevice );\n } catch ( EntityNotFoundException e ) {\n return false;\n }\n return true;\n }", "public boolean statsFilled() throws SQLException {\n\t\ttry {\n\t\t\tif (getStats().last() == true) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\treturn false;\n\t}", "public void setCheckDatabaseExistence(boolean checkDatabaseExistence) {\n this.checkDatabaseExistence = checkDatabaseExistence;\n }", "private boolean checkDatabase(CommandPreferences preferences) {\n\n //checking class type of Preferences\n Logger.log(LogType.DEBUG, \"Class name of Preferences: \" + preferences.getClass().getName());\n prefClass = preferences.getClass();\n\n\n Logger.log(LogType.INFO, \"Checking Database connection...\");\n try (Connection connection = DriverManager.getConnection(purl, puser, ppassword)) {\n Logger.log(LogType.INFO, \"Database connected!\");\n isInit = true;\n con = connection;\n\n url = purl;\n user = puser;\n password = ppassword;\n\n } catch (SQLException e) {\n Logger.log(LogType.ERROR, \"Could not connect to Databse! \" + e);\n return false;\n }\n Logger.log(LogType.INFO, \"Database connection established.\");\n Logger.log(LogType.INFO, \"Checking Database setup: Tables...\");\n\n if (!checkTableExists(tablename)) return false;\n Logger.log(LogType.INFO, \"Checking Database setup: Columns...\");\n Logger.log(LogType.DEBUG, preferences.getClass().getFields().length + \"\");\n for (Field f : preferences.getClass().getFields()) {\n Logger.log(LogType.DEBUG, \"Field[\" + f.getName() + \"] \" + f.getType());\n if (!checkColumnExists(f.getName(), f)) return false;\n }\n Logger.log(LogType.INFO, \"Database check complete! starting...\");\n prefStructure = preferences;\n return true;\n }", "private boolean checkBackupDir() {\n if (!dbBackupDir.exists()) {\n return dbBackupDir.mkdir();\n }\n return true;\n }", "public abstract boolean isDatabaseSet();", "public boolean initializeDatabase() {\n try {\n initializeCategory();\n initializeExpense();\n initializeIncome();\n initializeBalance();\n initializeUser();\n } catch (Throwable t) {\n\n System.out.println(t.getMessage());\n return false;\n }\n return true;\n }", "public static boolean createDBDir() {\n return (new File(path)).mkdirs();\n }", "public boolean tableExists()\n throws DBException\n {\n DBConnection dbc = null;\n Statement stmt = null;\n ResultSet rs = null;\n boolean innodb = this.isMySQLInnoDB();\n try {\n int provID = DBProvider.getProvider().getID();\n\n /* connection */\n dbc = DBConnection.getDBConnection_read();\n\n /* check for SQLServer */\n if (provID == DBProvider.DB_SQLSERVER) {\n // - SQLServer \"COUNT(*)\"\n // - expect SQLException if does not exist\n boolean CUSTOM_SQLSERVER_EXISTS = false;\n String existsSel;\n if (CUSTOM_SQLSERVER_EXISTS) {\n // -- A full \"COUNT(*)\" runs slow on SQL Server.\n // -- \"SELECT COUNT(*) FROM (SELECT TOP 1 * FROM MSeventdata ) t\"\n StringBuffer sb = new StringBuffer();\n sb.append(\"SELECT COUNT(*) FROM (SELECT TOP 1 * FROM \");\n sb.append(this.getTranslatedTableName());\n sb.append(\" ) t;\"); // <-- is trailing \";\" required??\n existsSel = sb.toString();\n } else {\n // -- \"SELECT COUNT(*) FROM table\" \n DBSelect<gDBR> dsel = new DBSelect<gDBR>(this); \n dsel.setSelectedFields(DBProvider.FLD_COUNT()); // tableExists: non MySQL/InnoDB\n existsSel = dsel.toString();\n }\n stmt = dbc.execute(existsSel); // may throw DBException, SQLException\n return true; // assume exists if no SQLException\n }\n\n /* check for non-MySQL */\n if (provID != DBProvider.DB_MYSQL) {\n // -- non-MySQL \"COUNT(*)\" \n // - \"SELECT COUNT(*) FROM table\"\n // - expect SQLException if does not exist\n DBSelect<gDBR> dsel = new DBSelect<gDBR>(this); \n dsel.setSelectedFields(DBProvider.FLD_COUNT()); // tableExists: non MySQL/InnoDB\n stmt = dbc.execute(dsel.toString()); // may throw DBException, SQLException\n return true; // assume exists if no SQLException\n }\n\n // ---------------------------------------------\n // MySQL below\n // SELECT COUNT(*) FROM (SELECT * FROM EventData LIMIT 1) EventData;\n\n /* InnoDB? */\n if (innodb) {\n // do not use \"COUNT(*)\" for table existance on InnoDB\n // \"SHOW COLUMNS FROM table\"\n //Print.logInfo(\"Using 'show columns' method for table existence ... \" + this.getTranslatedTableName());\n String xtableName = this.getTranslatedTableName();\n String sqlExists = \"SHOW COLUMNS FROM \" + this.getTranslatedTableName();\n stmt = dbc.execute(sqlExists); // may throw DBException, SQLException\n //rs = stmt.getResultSet();\n return true; // assume exists if no SQLException\n }\n\n /* get table existence */\n if (DBFactory.mysqlTableExistsUseSelectCount()) {\n /* VERY slow on Windows or InnoDB */ \n // \"SELECT COUNT(*) FROM table\"\n DBSelect<gDBR> dsel = new DBSelect<gDBR>(this); \n dsel.setSelectedFields(DBProvider.FLD_COUNT()); // tableExists: non MySQL/InnoDB\n stmt = dbc.execute(dsel.toString()); // may throw DBException, SQLException\n //rs = stmt.getResultSet();\n return true; // assume exists if no SQLException\n }\n\n /* alternate method for MySQL */ \n // \"SHOW COLUMNS FROM table\"\n //Print.logInfo(\"Using 'show columns' method for table existence ... \" + this.getTranslatedTableName());\n String xtableName = this.getTranslatedTableName();\n String sqlExists = \"SHOW COLUMNS FROM \" + this.getTranslatedTableName();\n stmt = dbc.execute(sqlExists); // may throw DBException, SQLException\n //rs = stmt.getResultSet();\n return true; // assume exists if no SQLException\n\n } catch (SQLException sqe) {\n\n String sqlMsg = sqe.getMessage();\n int errCode = sqe.getErrorCode();\n if (errCode == SQLERR_TABLE_NONEXIST) { // MySQL: ?\n return false;\n } else\n if (errCode == SQLERR_UNKNOWN_DATABASE) { // MySQL: ?\n String dbName = DBProvider.getDBName();\n Print.logError(\"Database does not exist '\" + dbName + \"'\"); // thus, table does not exist\n return false;\n } else\n if (errCode == MSQL_ERR_INVALID_OBJECT) { // SQLServer: :\n return false;\n } else\n if (sqlMsg.indexOf(\"does not exist\") >= 0) { // PostgreSQL: ?\n return false;\n } else {\n String dbName = DBProvider.getDBName();\n throw new DBException(\"Table Existance '\" + dbName + \"'\", sqe);\n }\n\n } finally {\n if (rs != null) { try { rs.close(); } catch (Throwable t) {} }\n if (stmt != null) { try { stmt.close(); } catch (Throwable t) {} }\n DBConnection.release(dbc);\n }\n\n }", "private boolean initDB() {\n\t\tDataBaseHelper myDbHelper = new DataBaseHelper(this);\n\t\tif (!myDbHelper.checkDataBase()) {\n\t\t\tmyDbHelper.dbDelete();\n\t\t\tdownloadDB();\n\t\t\treturn false;\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tif (!myDbHelper.openDataBase()) {\n\t\t\t\t\tLog.e(TAG, \"Unable to open database\");\n\t\t\t\t\tstopService();\n\t\t\t\t\tmyDbHelper.dbDelete();\n\t\t\t\t\tdownloadDB();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.e(TAG, \"Unable to open database\", e);\n\t\t\t\tstopService();\n\t\t\t\tmyDbHelper.dbDelete();\n\t\t\t\tdownloadDB();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tstartSync();\n\t\t\t\treturn initUI();\n\t\t\t} catch (Exception ioe) {\n\t\t\t\tLog.e(TAG, \"Unable to launch activity\");\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\t}", "final boolean checkAlive() {\r\n\t\t\r\n\t\tif (this.conn == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tif (this.conn.isClosed()) {\r\n\t\t\t\tthis.conn = null;\r\n\t\t\t\treturn false;\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 = null;\r\n\t\t\t\treturn false;\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\treturn true;\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\tthis.conn = null;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private boolean isTableInDb() throws SQLException\n {\n final String sqlQuery = \"SELECT name FROM sqlite_master WHERE type='table' AND name='\" + TABLE_NAME +\n \"'\";\n\n try (\n final PreparedStatement statement = database.connection().prepareStatement(sqlQuery);\n final ResultSet resultSet = statement.executeQuery();\n )\n {\n if (!resultSet.next())\n return false;\n\n // read table name\n final String tableName = resultSet.getString(1);\n if (resultSet.wasNull() || !tableName.equals(TABLE_NAME))\n return false;\n }\n\n return true;\n }", "@Override\n\tpublic boolean checkdbconfig() {\n\t\t// get path\n\t\tString path = context.getRealPath(\"/\");\n\t\tString dbpath = path + Utility.DB_PATH;\n\t\tString dbconfig = \"\";\n\t\tFileInputStream fileInputStreamSystemSettings = null;\n\t\tProperties prop = new Properties();\n\t\ttry {\n\t\t\tfileInputStreamSystemSettings = new FileInputStream(dbpath);\n\t\t\ttry {\n\t\t\t\tprop.load(fileInputStreamSystemSettings);\n\t\t\t\tdbconfig = prop.getProperty(\"jdbc.dbconfig\");\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tfileInputStreamSystemSettings.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tif (dbconfig.equalsIgnoreCase(\"Y\")) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "abstract boolean tableExist() throws SQLException;", "public boolean isExists() {\n return getIndexOperations().exists();\n }", "public boolean doesGroupsTableExist() {\r\n\r\n\t\t// Variable Declarations\r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement stmt = null;\r\n\r\n\t\ttry {\r\n\t\t\t// Connect to Database\r\n\t\t\tClass.forName(JDBC_DRIVER);\r\n\t\t\tconn = DriverManager.getConnection(DATABASE, USER, PASS);\r\n\r\n\t\t\t// Create SQL Statement\r\n\t\t\tString sql = \"SELECT name FROM sqlite_master\";\r\n\t\t\tstmt = conn.prepareStatement(sql);\r\n\r\n\t\t\t// Get ResultSet by Column Name\r\n\t\t\tResultSet rs = stmt.executeQuery();\r\n\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tString tName = rs.getString(\"name\");\r\n\t\t\t\tif (tName.equals(\"groups\")) {\r\n\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException se) {\r\n\t\t\t// Handle Errors for JDBC\r\n\t\t\tse.printStackTrace();\r\n\t\t} catch (Exception ex) {\r\n\t\t\t// Handle Errors for Class\r\n\t\t\tex.printStackTrace();\r\n\t\t} finally {\r\n\t\t\t// Close Resources\r\n\t\t\ttry {\r\n\t\t\t\tif (stmt != null)\r\n\t\t\t\t\tstmt.close();\r\n\t\t\t} catch (SQLException se2) {\r\n\t\t\t} // Nothing to do\r\n\r\n\t\t\ttry {\r\n\t\t\t\tif (conn != null)\r\n\t\t\t\t\tconn.close();\r\n\t\t\t} catch (SQLException se) {\r\n\t\t\t\tse.printStackTrace();\r\n\t\t\t} // End Finally Try/Catch\r\n\t\t} // End Try/Catch\r\n\r\n\t\treturn false;\r\n\t}", "public static boolean containsDatabase(String dbName){\n return DATABASES.containsKey(dbName);\n }", "public abstract boolean exists() throws AccessException;", "public boolean checkDb() {\n\t\t\n\t\tint userId = Auth.getCurrentUser().getId();\n\t\tString sql = \"select id from PersonalDetails where id='\"+userId+\"'\";\n\t\tint gotId;\n\t\t//connectToDb();\n\t\t\n\t\ttry(Connection conn = myDb;\n\t\t\tStatement stmt = conn.createStatement();\n\t\t\tResultSet rs = stmt.executeQuery(sql)){\n\t\t\tgotId = rs.getInt(\"id\");\n\t\t}catch(SQLException e){\n\t\t\t\n\t\t\tmyDb = null;\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(gotId == userId) {\n\t\t\treturn true;\n\t\t}else {\n\t\t\t//return false;\n\t\t\treturn false;\n\t\t}\n\n\t}", "public boolean initDB() {\n System.out.println(\"initDB\");\n\n boolean initOK = false;\n\n String s;\n StringBuilder sb = new StringBuilder();\n\n try {\n FileReader fr = new FileReader(new File(\"resources\\\\initDB.sql\"));\n BufferedReader br = new BufferedReader(fr);\n\n while ((s = br.readLine()) != null) {\n sb.append(s);\n }\n br.close();\n\n String[] inst = sb.toString().split(\";\");\n\n Statement stmt = getConnection().createStatement();\n\n for (int i = 0, instLength = inst.length; i < instLength; i++) {\n String anInst = inst[i];\n if (!anInst.trim().equals(\"\")) {\n System.out.println(i + \": \" + anInst);\n\n try {\n stmt.executeUpdate(anInst);\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n }\n }\n\n initOK = true;\n } catch (FileNotFoundException ex) {\n ex.printStackTrace();\n// throw new RuntimeException(ex);\n } catch (SQLException ex) {\n ex.printStackTrace();\n// throw new RuntimeException(ex);\n } catch (IOException ex) {\n ex.printStackTrace();\n// throw new RuntimeException(ex);\n } catch (NullPointerException ex) {\n ex.printStackTrace();\n }\n\n return initOK;\n }", "public void testEmptyDbSetup() 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 ConfigurationUtil.setCurrentConfigFromProps(props);\n\n sqlDbManager = new SqlDbManager();\n theDaemon.setDbManager(sqlDbManager);\n sqlDbManager.initService(theDaemon);\n assertTrue(sqlDbManager.setUpDatabase(0));\n sqlDbManager.setTargetDatabaseVersion(0);\n sqlDbManager.startService();\n assertTrue(sqlDbManager.isReady());\n\n Connection conn = sqlDbManager.getConnection();\n assertNotNull(conn);\n assertFalse(sqlDbManager.tableExists(conn, SqlDbManager.OBSOLETE_METADATA_TABLE));\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\tif (entityType2tableName.isEmpty())\n\t\t\treturn true;\n\t\t\n\t\t// the hard way \n\t\ttry {\n\t\t\tStatement st = connection.createStatement(\n\t\t\t\t\tResultSet.TYPE_SCROLL_INSENSITIVE,\n\t\t ResultSet.CONCUR_READ_ONLY);\n\t\t\t\n\t\t\tfor (String tableName: entityType2tableName.values()) {\n\t\t\t\t//ResultSet set = st.executeQuery(\"SELECT * FROM \"+tableName+\";\");\n\t\t\t\t\n\t\t\t\tResultSet set = st.executeQuery(\"SELECT * FROM \"+tableName+\" LIMIT 1\");\n\t\t\t\t\n\t\t\t\tif (!set.next())\n\t\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}\n\t\t} catch (SQLException e1) {\n\t\t\te1.printStackTrace();\n\t\t\tthrow new RuntimeException(\"Error while checking if the table is empty\",e1);\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "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 check() {\r\n logger.info(\"ADIT monitor - Checking database and application.\");\r\n\r\n checkApplication();\r\n\r\n checkDBConnection();\r\n checkDBRead(this.getMonitorConfiguration().getTestDocumentId());\r\n }", "public boolean isExists() {\n\t\treturn exists();\n\t}", "public boolean exists()\n\t{\n\n\t\treturn true;\n\t}", "private static boolean tableExists(Connection con, String table)\n {\n int numRows = 0;\n try\n {\n DatabaseMetaData dbmd = con.getMetaData();\n ResultSet rs = dbmd.getTables(null, null, table.toUpperCase(), null);\n while (rs.next())\n {\n ++numRows;\n }\n }\n catch (SQLException e)\n {\n String theError = e.getSQLState();\n System.out.println(\"Can't query DB metadata: \" + theError);\n System.exit(1);\n }\n return numRows > 0;\n }", "@Override\n public boolean isValid() {\n return (connection != null && session != null && session.isOpen());\n }" ]
[ "0.8108975", "0.7978209", "0.79259896", "0.7884726", "0.7625655", "0.72534883", "0.71571267", "0.71571267", "0.7137354", "0.7111336", "0.70884603", "0.707043", "0.7054246", "0.70041406", "0.6995858", "0.6995327", "0.6991315", "0.6971858", "0.6971858", "0.6971858", "0.6971858", "0.6971858", "0.6967499", "0.69305146", "0.6925768", "0.6923606", "0.6913745", "0.68976575", "0.68816257", "0.68128294", "0.68028307", "0.67580944", "0.6732146", "0.66802543", "0.6662096", "0.65201944", "0.65136665", "0.6449829", "0.6396098", "0.6376074", "0.634003", "0.63020355", "0.6288488", "0.62841606", "0.62783134", "0.6254885", "0.6205021", "0.61688435", "0.6149971", "0.6132114", "0.6126722", "0.61090255", "0.60812396", "0.606416", "0.60607475", "0.6027647", "0.60079944", "0.6005232", "0.5993301", "0.59906554", "0.59811735", "0.59507287", "0.59242135", "0.59153897", "0.5906043", "0.5905949", "0.5901284", "0.5889094", "0.5850405", "0.5844169", "0.58002514", "0.5796867", "0.5784448", "0.5784057", "0.5779617", "0.5761263", "0.5744474", "0.5734746", "0.57299894", "0.56920743", "0.56704754", "0.5666282", "0.5660976", "0.5649226", "0.56146026", "0.56035256", "0.55920947", "0.558028", "0.5561799", "0.5544902", "0.5542792", "0.55339676", "0.5519793", "0.54832524", "0.54819024", "0.54776525", "0.5474257", "0.5455941", "0.5439213", "0.5434663" ]
0.57231015
79
Stores a range of new objects in the database. Stores the object's values for each feature within the range of objects
public void pushObject(float[][] objects) throws DatabaseAccessException { PreparedStatement prepStmt = null; // dynamically insert values in columns of a object row String sql = "INSERT INTO Objects VALUES(NULL"; for (int i = 1; i <= objects[0].length; ++i) { sql += ", ?"; } sql += ");"; try { prepStmt = this.connection.prepareStatement(sql); // for each object for (float[] values : objects) { // for each value in the object for (int featureId = 1; featureId <= values.length; ++featureId) { prepStmt.setFloat(featureId, values[featureId - 1]); } prepStmt.addBatch(); } // do not atomically write each insert, but write them all at once, thus boosting write performance this.connection.setAutoCommit(false); prepStmt.executeBatch(); this.connection.setAutoCommit(true); prepStmt.close(); } catch (SQLException e) { throw new DatabaseAccessException(Failure.WRITE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateFeaturesMinMax() throws DatabaseAccessException {\n\t\tStatement stmt;\n\t\tResultSet rs;\n\n\t\ttry {\n\t\t\tstmt = this.connection.createStatement();\n\t\t\trs = stmt.executeQuery(\"SELECT Id FROM Features;\");\n\t\t\tArrayList<Integer> featureIds = new ArrayList<Integer>();\n\t\t\twhile (rs.next()) {\n\t\t\t\tfeatureIds.add(rs.getInt(\"Id\"));\n\t\t\t}\n\t\t\tstmt.close();\n\n\t\t\tfor (Integer id : featureIds) {\n\t\t\t\tstmt = this.connection.createStatement();\n\t\t\t\trs = stmt.executeQuery(\"SELECT MIN(\\\"\" + id + \"\\\"), MAX(\\\"\" + id + \"\\\") FROM Objects;\");\n\t\t\t\tfloat min = rs.getFloat(1);\n\t\t\t\tfloat max = rs.getFloat(2);\n\t\t\t\trs.close();\n\t\t\t\tstmt.close();\n\n\t\t\t\tPreparedStatement prepStmt = this.connection\n\t\t\t\t\t\t.prepareStatement(\"UPDATE Features SET Min=?, Max=? WHERE Id=?\");\n\t\t\t\tprepStmt.setFloat(1, min);\n\t\t\t\tprepStmt.setFloat(2, max);\n\t\t\t\tprepStmt.setInt(3, id);\n\t\t\t\tprepStmt.execute();\n\t\t\t\tprepStmt.close();\n\t\t\t}\n\t\t} catch (SQLException ex) {\n\t\t\tthrow new DatabaseAccessException(Failure.WRITE);\n\t\t}\n\t}", "org.hl7.fhir.ObservationReferenceRange addNewReferenceRange();", "public void initFeatures(String[] features, boolean[] outlierFlags) throws DatabaseAccessException {\n\t\tStatement stmt = null;\n\t\tPreparedStatement prepStmt = null;\n\n\t\t// build sql table query: Id | \"1\" | \"2\" | ... by doing this, we are able to store all values in one row\n\t\tString sql = \"CREATE TABLE IF NOT EXISTS Objects(Id INTEGER PRIMARY KEY AUTOINCREMENT\";\n\t\tfor (int i = 1; i <= features.length; ++i) {\n\t\t\t// escaping the id is important, due to the fact that we named the row that way (e.g. \"1\")\n\t\t\tsql += \", \\\"\" + i + \"\\\" FLOAT\";\n\t\t}\n\t\tsql += \");\";\n\n\t\ttry {\n\t\t\tstmt = this.connection.createStatement();\n\n\t\t\t// objects table creation\n\t\t\tstmt.executeUpdate(sql);\n\n\t\t\tstmt.close();\n\n\t\t\tprepStmt = this.connection.prepareStatement(\"INSERT INTO Features VALUES(NULL, ?, ?, 0, 1);\");\n\n\t\t\t// add all insertions to the batch\n\t\t\tfor (int i = 0; i < features.length; ++i) {\n\t\t\t\tprepStmt.setString(1, features[i]);\n\t\t\t\tprepStmt.setBoolean(2, outlierFlags[i]);\n\n\t\t\t\tprepStmt.addBatch();\n\t\t\t}\n\n\t\t\t// perform the transaction\n\t\t\tthis.connection.setAutoCommit(false);\n\t\t\tprepStmt.executeBatch();\n\t\t\tthis.connection.setAutoCommit(true);\n\n\t\t\tprepStmt.close();\n\n\t\t} catch (SQLException e) {\n\t\t\tthrow new DatabaseAccessException(Failure.WRITE);\n\t\t}\n\t}", "@Override\n public void saveValues() {\n \n }", "private void addRangeIntegers() {\r\n ent_2_i.put(\"< 0\", -1); ent_2_i.put(\"== 0\", 0); ent_2_i.put(\"== 1\", 1); ent_2_i.put(\"< 10\", 10);\r\n ent_2_i.put(\"< 100\", 100); ent_2_i.put(\"< 1K\", 1000); ent_2_i.put(\"< 10K\", 10000); ent_2_i.put(\"< 100K\", 100000);\r\n ent_2_i.put(\"> 100K\", 1000000);\r\n }", "private void insertData() {\n for (int i = 0; i < 3; i++) {\n RecipeEntity books = factory.manufacturePojo(RecipeEntity.class);\n em.persist(books);\n data.add(books);\n }\n }", "public void bulkAdd(){\n employees.add(new Employee(23.0, 15000.0, \"Shayan\"));\n employees.add(new Employee(22.0, 60000.0, \"Rishabh\"));\n employees.add(new Employee(23.0, 45000.0, \"Ammar\"));\n employees.add(new Employee(25.0, 30000.0, \"Fahad\"));\n employees.add(new Employee(21.0, 50000.0, \"Ankur\"));\n }", "protected void saveValues() {\n dataModel.persist();\n }", "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 }", "org.hl7.fhir.ObservationReferenceRange insertNewReferenceRange(int i);", "private void insertData() {\r\n PodamFactory factory = new PodamFactoryImpl();\r\n for (int i = 0; i < 3; i++) {\r\n MonitoriaEntity entity = factory.manufacturePojo(MonitoriaEntity.class);\r\n\r\n em.persist(entity);\r\n data.add(entity);\r\n }\r\n }", "private void writeObject(Object object) {\r\n\t\tsession.saveOrUpdate(object);\r\n\r\n\t\t// Since can writing large amount of data should use Hibernate \r\n\t\t// batching to make sure don't run out memory.\r\n\t\tcounter++;\r\n\t\tif (counter % HibernateUtils.BATCH_SIZE == 0) {\r\n\t\t\tsession.flush();\r\n\t\t\tsession.clear();\r\n\t\t}\r\n\t}", "private void collectForRange(Date startDate, Date endDate) {\n Flux<SolarFlare> flux = solarFlareMapper.transferCollectionToEntityFlux(\n donkiClient.getBetweenRange(startDate, endDate)\n );\n solarFlareRepository.saveAll(flux)\n .count()\n .subscribe(total -> log.info(\"Collected {} data sets solar flares\", total));\n }", "void storeObject(RectangleLatLng rectangle, String id);", "@Override\n\tpublic void save(final GeoAttributes geoAttributes) {\n\t\tPreConditions.checkNull(geoAttributes, \"geoAttributes must not be null\");\n\t\tfinal InetAddress startInetAddress = geoAttributes.getStartInetAddress();\n\t\tfinal InetAddress endInetAddress = geoAttributes.getEndInetAddress();\n\t\tfinal GeoEntity geoEntity = geoAttributes.getGeoEntity();\n\n\t\tif(startInetAddress instanceof Inet6Address\n\t\t\t\t&& endInetAddress instanceof Inet6Address)\n\t\t{\n\t\t\tfinal BigInteger startIpBigInt = IPUtils.ipv6ToBigInteger(startInetAddress);\n\t\t\tIPV6_REPOSITORY.put(startIpBigInt,geoEntity);\n\t\t}\n\t\telse if (startInetAddress instanceof Inet4Address\n\t\t\t\t&& endInetAddress instanceof Inet4Address)\n\t\t{\n\t\t\tfinal Integer startIpNum = InetAddresses.coerceToInteger(startInetAddress);\n\t\t\tIPV4_REPOSITORY.put(startIpNum,geoEntity);\n\t\t}\n\t\telse{\n\t\t\t//Well, this case should never happen. Maybe I'll throw in an exception later.\n\t\t\tlogger.warn(\"This shouldn't ever happen\");\n\t\t}\n\t}", "@Override\n\tpublic void post(BookCopies object) throws SQLException {\n\t\t\n\t}", "private void persistEntities(List<Entity> entities) {\n jdbcTemplate.batchUpdate(\n \"insert into entity (id, num, realm, shard, timestamp_range, type) \"\n + \"values (?, ?, ?, ?, ?::int8range, ?::entity_type)\",\n entities,\n entities.size(),\n (ps, entity) -> {\n ps.setLong(1, entity.getId());\n ps.setLong(2, entity.getNum());\n ps.setLong(3, entity.getRealm());\n ps.setLong(4, entity.getShard());\n ps.setString(5, PostgreSQLGuavaRangeType.INSTANCE.asString(entity.getTimestampRange()));\n ps.setString(6, entity.getType().toString());\n });\n\n jdbcTemplate.batchUpdate(\n \"insert into entity_history (id, num, realm, shard, timestamp_range, type) \"\n + \"values (?, ?, ?, ?, ?::int8range, ?::entity_type)\",\n entities,\n entities.size(),\n (ps, entity) -> {\n ps.setLong(1, entity.getId());\n ps.setLong(2, entity.getNum());\n ps.setLong(3, entity.getRealm());\n ps.setLong(4, entity.getShard());\n ps.setString(5, PostgreSQLGuavaRangeType.INSTANCE.asString(entity.getTimestampRange()));\n ps.setString(6, entity.getType().toString());\n });\n }", "private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n ViajeroEntity entity = factory.manufacturePojo(ViajeroEntity.class);\n\n em.persist(entity);\n data.add(entity);\n }\n }", "public void storeValues() throws SQLException { //store values into the database\n \tstoreValuesDump();\n \tstoreValuesMatl();\n }", "private void saveExpositionInDB(String badgeID, int expoSiteId, int expoMonth, int expoYear,\n Date expoDateBegin, Date expoDateEnd, String expoValue)\n throws SQLException {\n\n // do not process exposition is its value is 'M'.\n if(expoValue.equalsIgnoreCase(\"M\")){\n Logger.log(\"Skipped exposition because value is 'M'. (\"+badgeID+\",\"+expoMonth+\",\"+expoValue+\")\",Logger.ERROR_LEVEL_INFO);\n }\n else{\n try{\n // check if value is an integer, otherwise, skip\n Integer.parseInt(expoValue);\n\n // find badgePersonId exposed to this exposition\n psGetPersonIds.setString(1,badgeID);\n psGetPersonIds.setInt(2,expoSiteId);\n psGetPersonIds.setString(3,expoYear+\"\");\n psGetPersonIds.setString(4,expoYear+\"\");\n psGetPersonIds.setTimestamp(5,new Timestamp(expoDateBegin.getTime()));\n psGetPersonIds.setTimestamp(6,new Timestamp(expoDateEnd.getTime()));\n psGetPersonIds.setTimestamp(7,new Timestamp(expoDateBegin.getTime()));\n psGetPersonIds.setTimestamp(8,new Timestamp(expoDateEnd.getTime()));\n ResultSet rs = psGetPersonIds.executeQuery();\n\n // convert to site-id to site-name\n String expoSite = \"\";\n if(expoSiteId==1) expoSite = \"DOEL\";\n else if(expoSiteId==2) expoSite = \"TIHANGE\";\n else if(expoSiteId==3) expoSite = \"IRE\";\n else if(expoSiteId==4) expoSite = \"OTHER\";\n\n // at least one badge found, so add the expoValue to table Items.\n int personCount = 0, personid;\n while(rs.next()){\n // get personid belonging to the found badge\n personid = rs.getInt(\"BadgePersonId\");\n\n // create 3 items to be stored\n itemVOs = new Vector();\n\n // expoValue\n itemType = PREFIX+\"ITEM_TYPE_DOSIMETRY_\"+expoSite+\"_GLOBAL_MONTH\"+expoMonth;\n itemVO = new ItemVO(new Integer(IdentifierFactory.getInstance().getTemporaryNewIdentifier()),itemType,expoValue,new Date(),null);\n itemVOs.add(itemVO);\n\n // badgeID\n itemType = PREFIX+\"ITEM_TYPE_DOSIMETRY_BADGEID_\"+expoSite;\n itemVO = new ItemVO(new Integer(IdentifierFactory.getInstance().getTemporaryNewIdentifier()),itemType,badgeID,new Date(),null);\n itemVOs.add(itemVO);\n\n // expoYear\n itemType = PREFIX+\"ITEM_TYPE_DOSIMETRY_REGISTRATIONYEAR\";\n itemVO = new ItemVO(new Integer(IdentifierFactory.getInstance().getTemporaryNewIdentifier()),itemType,expoYear+\"\",new Date(),null);\n itemVOs.add(itemVO);\n\n storeTransaction(personid,itemVOs,expoSite,expoYear);\n personCount++;\n }\n\n rs.close();\n psGetPersonIds.close();\n // rs empty, no badge found\n if(personCount == 0){\n Logger.log(\"No Badges with BadgeId (\"+badgeID+\") for site (\"+expoSite+\",\"+expoSiteId+\") found in year (\"+expoYear+\").\",Logger.ERROR_LEVEL_INFO);\n }\n }\n // expoValue is no integer\n catch(NumberFormatException e){\n Logger.log(\"Exposition value is no Integer. (\"+badgeID+\",\"+expoMonth+\",\"+expoValue+\")\",Logger.ERROR_LEVEL_ERROR);\n if(Debug.enabled) Debug.println(\"ERROR : Exposition value is no Integer. (\"+badgeID+\",\"+expoMonth+\",\"+expoValue+\")\");\n }\n }\n }", "@Override\n\tpublic void put(Integer id, BookCopies object) throws SQLException {\n\t\t\n\t}", "void bulkInsertOrReplace (List<Consumption> entities);", "private void saveObjects() {\n\t\tgo.setMeteors(meteors);\n\t\tgo.setExplosions(explosions);\n\t\tgo.setTargets(targets);\n\t\tgo.setRockets(rockets);\n\t\tgo.setCrosses(crosses);\n\t\tgo.setEarth(earth);\n\t}", "void setObject(int index, Object value, int sqlType, int scale)\n throws SQLException;", "@Override\r\n public void addRangeClass(AgeClass rgCls)\r\n {\n \r\n range.add(rgCls);\r\n }", "private void insertData() {\n for (int i = 0; i < 3; i++) {\n PodamFactory factory = new PodamFactoryImpl();\n VisitaEntity entity = factory.manufacturePojo(VisitaEntity.class);\n em.persist(entity);\n data.add(entity);\n }\n }", "public void create() {\r\n for(int i=0; i< 50; i++){\r\n long id = (new Date()).getTime();\r\n Benefit newBeneficio = new Benefit();\r\n newBeneficio.setId(\"\"+id); \r\n newBeneficio.setCategory(\"almacenes \"+id);\r\n newBeneficio.setDescription(\"description \"+id);\r\n newBeneficio.setDiscount(i);\r\n newBeneficio.setStart_date(\"start_date \"+id);\r\n newBeneficio.setEnd_date(\"end_date \"+id);\r\n newBeneficio.setReview(\"review \"+id);\r\n newBeneficio.setTitle(\"title \"+id);\r\n newBeneficio.setLogo(\"logo \"+id);\r\n newBeneficio.setTwitter(\"twitter \"+id);\r\n newBeneficio.setFacebook(\"facebook \"+id);\r\n newBeneficio.setUrl(\"url \"+ id);\r\n \r\n Address address = new Address();\r\n address.setCity(\"Santiago \"+ id);\r\n address.setCountry(\"Santiago \"+ id);\r\n address.setLine_1(\"Linea 1 \"+ id);\r\n address.setLine_2(\"Linea 2 \"+ id);\r\n address.setLine_3(\"Linea 3 \"+ id);\r\n address.setPostcode(\"\" + id);\r\n address.setState(\"Region Metropolitana \"+ id);\r\n \r\n Location location = new Location();\r\n double[] cordenadas = {-77.99283,-33.9980};\r\n location.setCoordinates(cordenadas);\r\n location.setDistance(5.445);\r\n location.setType(\"Point\");\r\n \r\n Lobby lobby = new Lobby();\r\n lobby.setHours(\"HORA \"+ + id);\r\n \r\n newBeneficio = service.persist(newBeneficio);\r\n LOGGER.info(newBeneficio.toString());\r\n }\r\n }", "@Override\n public void migrate(OccupiedLocations ols) {\n for (Population pop:ols.copyList()) {\n setCoordinate(pop.getCoordinate());\n\n Population migrating_pop = pop.collectMigrants(getRate());\n if (migrating_pop.getSize() > 0) {\n migrating_pop.setCoordinate(getPicker().pick());\n migrating_pop.setResource(0.0);\n\n // alter *actual* populations\n ols.addOrMix(migrating_pop);\n }\n }\n }", "private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n VueltasConDemoraEnOficinaEntity entity = factory.manufacturePojo(VueltasConDemoraEnOficinaEntity.class);\n \n em.persist(entity);\n data.add(entity);\n }\n }", "CollectionRange createCollectionRange();", "public void add_Range(Range range_to_add){\n this.range_vector.add(range_to_add);\n }", "public abstract void insertRange(int start, double value, int count,\r\n int validSize);", "public void setRange(Range range) { setRange(range, true, true); }", "private void insertData() \n {\n for (int i = 0; i < 3; i++) {\n TarjetaPrepagoEntity entity = factory.manufacturePojo(TarjetaPrepagoEntity.class);\n em.persist(entity);\n data.add(entity);\n }\n for(int i = 0; i < 3; i++)\n {\n PagoEntity pagos = factory.manufacturePojo(PagoEntity.class);\n em.persist(pagos);\n pagosData.add(pagos);\n\n }\n \n data.get(2).setSaldo(0.0);\n data.get(2).setPuntos(0.0);\n \n double valor = (Math.random()+1) *100;\n data.get(0).setSaldo(valor);\n data.get(0).setPuntos(valor); \n data.get(1).setSaldo(valor);\n data.get(1).setPuntos(valor);\n \n }", "public void saveFenceInSqliteDB(String name, String address, String city, String province, Double lat, Double lng, String range, String number, String textSMS, int event) {\n boolean active = true; // default whan you add a geofence is active\n boolean match = false; // default whan you add a geofence is not in fence\n\n int id = Controller.insertFenceOnSQLiteDB(name, address, city, province, lat + \"\", lng + \"\", range, 1, number, textSMS, event);\n Fence f = new Fence(id, name, address, city, province, lat, lng, Float.parseFloat(range), active, match, number, textSMS, event);\n Controller.fences.add(f);\n Toast.makeText(this.getContext(), \"Added the fence: \" + f.getName() + \"!\", Toast.LENGTH_LONG).show();\n }", "public abstract void setRange(double value, int start, int count);", "public void saveSensorsDB() throws Exception {\n\n\t\t//Get JDBC connection\n\t\tConnection connection = null;\n\t\tStatement stmt = null;\n\t\tConnectDB conn = new ConnectDB();\n\t\tconnection = conn.getConnection();\n\n\t\tstmt = connection.createStatement();\n\t\tfor (int key : getMap().keySet()) {\n\t\t\tSubArea value = getMap().get(key);\n\t\t\tint fireValue = (value.isFireSensor()) ? 1 : 0;\n\t\t\tint burglaryValue = (value.isBurglarySensor()) ? 1 : 0;\n\t\t\t//Save Fire and Burglary sensors\n\t\t\tString sql = \"UPDATE section SET fireSensor=\" + fireValue\n\t\t\t\t\t+ \", burglarySensor=\" + burglaryValue + \" WHERE id=\" + key;\n\t\t\tstmt.executeUpdate(sql);\n\t\t}\n\n\t}", "private void insertData() \n {\n for(int i = 0; i < 2; i++){\n RazaEntity razaEntity = factory.manufacturePojo(RazaEntity.class);\n em.persist(razaEntity);\n razaData.add(razaEntity);\n }\n for (int i = 0; i < 3; i++) {\n EspecieEntity especieEntity = factory.manufacturePojo(EspecieEntity.class);\n if(i == 0)\n {\n especieEntity.setRazas(razaData);\n }\n em.persist(especieEntity);\n especieData.add(especieEntity);\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 }", "RangeValue createRangeValue();", "private void add_range(Question q)\n\t{\n\t\tlog.debug(\"Question \" + q.getQid() + \" is getting checked for ranges\");\n\t\tString min = doc.selectSingleNode(\"//document/question_attributes/rows/row[qid=\" + q.getQid() + \" and attribute='min_num_value_n']/value\").getText();\n\t\tString max = doc.selectSingleNode(\"//document/question_attributes/rows/row[qid=\" + q.getQid() + \" and attribute='max_num_value_n']/value\").getText();\n\n\t\tif (min != \"\") {\n\t\t\tq.setFloat_range_min(min);\n\t\t}\n\t\tif (max != \"\") {\n\t\t\tq.setFloat_range_max(max);\n\t\t}\n\t\tlog.debug(\"range check finished\");\n\t}", "private void populateData() {\r\n\t\tfor(int i = 0; i < this.incomeRanges.length; i++) {\r\n\t\t\tthis.addData(new Data(incomeRanges[i], 0), true);\r\n\t\t}\t// end for\r\n\t}", "private void insertData() {\n\n for (int i = 0; i < 3; i++) {\n ProveedorEntity proveedor = factory.manufacturePojo(ProveedorEntity.class);\n BonoEntity entity = factory.manufacturePojo(BonoEntity.class);\n int noOfDays = 8;\n Date dateOfOrder = new Date();\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(dateOfOrder);\n calendar.add(Calendar.DAY_OF_YEAR, noOfDays);\n Date date = calendar.getTime();\n entity.setExpira(date);\n noOfDays = 1;\n calendar = Calendar.getInstance();\n calendar.setTime(dateOfOrder);\n calendar.add(Calendar.DAY_OF_YEAR, noOfDays);\n date = calendar.getTime();\n entity.setAplicaDesde(date);\n entity.setProveedor(proveedor);\n em.persist(entity);\n ArrayList lista=new ArrayList<>();\n lista.add(entity);\n proveedor.setBonos(lista);\n em.persist(proveedor);\n pData.add(proveedor);\n data.add(entity); \n }\n }", "private void addSomeItemsToDB () throws Exception {\n/*\n Position pos;\n Course course;\n Ingredient ing;\n\n PositionDAO posdao = new PositionDAO();\n CourseDAO coursedao = new CourseDAO();\n IngredientDAO ingdao = new IngredientDAO();\n\n ing = new Ingredient(\"Mozzarella\", 10,30);\n ingdao.insert(ing);\n\n // Salads, Desserts, Main course, Drinks\n pos = new Position(\"Pizza\");\n posdao.insert(pos);\n\n course = new Course(\"Salads\", \"Greek\", \"Cucumber\", \"Tomato\", \"Feta\");\n coursedao.insert(course);\n\n ing = new Ingredient(\"-\", 0,0);\n ingdao.insert(ing);\n */\n }", "void storeObject(PointLatLng point, String id);", "public void addBestelling(Bestelling bestelling) {\n\r\n DatabaseConnection connection = new DatabaseConnection();\r\n if(connection.openConnection())\r\n {\r\n // If a connection was successfully setup, execute the INSERT statement\r\n\r\n connection.executeSQLInsertStatement(\"INSERT INTO bestelling (`bestelId`, `tafelId`) VALUES(\" + bestelling.getId() + \",\" + bestelling.getTafelId() + \");\");\r\n\r\n for(Drank d : bestelling.getDranken()) {\r\n connection.executeSQLInsertStatement(\"INSERT INTO drank_bestelling (`DrankID`, `BestelId`, `hoeveelheid`) VALUES (\" + d.getDrankId() + \",\" + bestelling.getId() + \", `1`\");\r\n }\r\n\r\n for(Gerecht g : bestelling.getGerechten()) {\r\n connection.executeSQLInsertStatement(\"INSERT INTO gerecht_bestelling (`GerechtID`, `BestelId`, `hoeveelheid`) VALUES (\" + g.getGerechtId() + \",\" + bestelling.getId() + \", `1`\");\r\n }\r\n\r\n\r\n //Close DB connection\r\n connection.closeConnection();\r\n }\r\n\r\n }", "protected abstract E put(R range, V value);", "private void saveLocations(){\n\n final LocationsDialog frame = this;\n WorkletContext context = WorkletContext.getInstance();\n\n LocationsTableModel model = (LocationsTableModel) locationsTable.getModel();\n final HashMap<Integer, Location> dirty = model.getDirty();\n\n\n for(Integer id : dirty.keySet()) {\n Location location = dirty.get(id);\n\n\n if (!Helper.insert(location, \"Locations\", context)) {\n System.out.print(\"insert failed!\");\n }\n\n }// end for\n\n model.refresh();\n\n }", "@Override\n\tpublic void insertRecordWithTimeRange(LiveInfoEntity liveInfo, long starttime, long endtime) {\n\n\t}", "com.microsoft.schemas.crm._2011.contracts.ArrayOfObjectiveRelation addNewObjectives();", "public void putFeatures(List<FeatureData> featureData, CoinData coin){\n String sql = \"SELECT id FROM Coin, Country WHERE \" +\n \"Coin.Country_id = Country.id AND \" +\n \"County.Name = '\" + coin.country + \"' AND \" +\n \"Coin.Value = \" + coin.value + \";\";\n Cursor cursor = database.rawQuery(sql, null);\n cursor.moveToFirst();\n int coinId = cursor.getInt(0);\n cursor.close();\n\n // put the feature data into the database\n for (FeatureData feature: featureData) {\n ContentValues values = new ContentValues();\n values.put(\"Type\", feature.type);\n values.put(\"Coin_id\", coinId);\n values.put(\"Keypoints\", MatSerializer.matToBytes(feature.keypoints));\n values.put(\"Descriptor\", MatSerializer.matToBytes(feature.descriptor));\n values.put(\"Mask\", MatSerializer.matToBytes(feature.mask));\n database.insert(\"Feature\", null, values);\n }\n }", "void setObject(int index, Object value) throws SQLException;", "synchronized public static void storeData(ArrayList<DataObject> data, ProcessSteps step) {\n ArrayList<Document> dataDocs = DataConverter.convertDataObjectToDocument(data);\n MongoDatabase database = getDatabase(step);\n // Groups the objects by the simple name of their class.\n // This can create conflicts in cases where DataObjects have duplicated names.\n // This also means that multiple types of DataObjects can be collected in the same step.\n // The approach of using multiple objects is preferable, as it is more easily manageable than using nested objects.\n database.getCollection(data.get(0).getClass().getSimpleName()).insertMany(dataDocs);\n }", "stockFilePT102.StockDocument.Stock insertNewStock(int i);", "private void persistFactions(Set<FactionWorth> factions) throws SQLException {\n Set<FactionWorth> createdFactions = insertFactions(factions);\n\n // Add newly created chunk positions to the identity cache.\n cacheFactionIds(createdFactions);\n }", "public SampletypeBean[] save(SampletypeBean[] pObjects) throws SQLException \n {\n for (int iIndex = 0; iIndex < pObjects.length; iIndex ++){\n save(pObjects[iIndex]);\n }\n return pObjects;\n }", "public void storeSnpLocation(Map<String, Set<Location>> snpToLocations) {\n for (String snpRsId : snpToLocations.keySet()) {\n\n Set<Location> snpLocationsFromMapping = snpToLocations.get(snpRsId);\n\n // Check if the SNP exists\n SingleNucleotidePolymorphism snpInDatabase =\n singleNucleotidePolymorphismRepository.findByRsId(snpRsId);\n if(snpInDatabase == null){\n snpInDatabase =\n singleNucleotidePolymorphismQueryService.findByRsIdIgnoreCase(snpRsId);\n }\n\n if (snpInDatabase != null) {\n\n // Store all new location objects\n Collection<Location> newSnpLocations = new ArrayList<>();\n\n for (Location snpLocationFromMapping : snpLocationsFromMapping) {\n\n String chromosomeNameFromMapping = snpLocationFromMapping.getChromosomeName();\n if (chromosomeNameFromMapping != null) {\n chromosomeNameFromMapping = chromosomeNameFromMapping.trim();\n }\n\n Integer chromosomePositionFromMapping = snpLocationFromMapping.getChromosomePosition();\n// if (chromosomePositionFromMapping != null) {\n// chromosomePositionFromMapping = chromosomePositionFromMapping.trim();\n// }\n\n Region regionFromMapping = snpLocationFromMapping.getRegion();\n String regionNameFromMapping = null;\n if (regionFromMapping != null) {\n if (regionFromMapping.getName() != null) {\n regionNameFromMapping = regionFromMapping.getName().trim();\n }\n }\n\n // Check if location already exists\n Location existingLocation =\n locationRepository.findByChromosomeNameAndChromosomePositionAndRegionName(\n chromosomeNameFromMapping,\n chromosomePositionFromMapping,\n regionNameFromMapping);\n\n\n if (existingLocation != null) {\n newSnpLocations.add(existingLocation);\n }\n // Create new location\n else {\n Location newLocation = locationCreationService.createLocation(chromosomeNameFromMapping,\n chromosomePositionFromMapping,\n regionNameFromMapping);\n\n newSnpLocations.add(newLocation);\n }\n }\n\n // If we have new locations then link to snp and save\n if (newSnpLocations.size() > 0) {\n\n // Set new location details\n snpInDatabase.setLocations(newSnpLocations);\n // Update the last update date\n snpInDatabase.setLastUpdateDate(new Date());\n singleNucleotidePolymorphismRepository.save(snpInDatabase);\n }\n else {getLog().warn(\"No new locations to add to \" + snpRsId);}\n\n }\n\n // SNP doesn't exist, this should be extremely rare as SNP value is a copy\n // of the variant entered by the curator which\n // by the time mapping is started should already have been saved\n else {\n // TODO WHAT WILL HAPPEN FOR MERGED SNPS\n getLog().error(\"Adding location for SNP not found in database, RS_ID:\" + snpRsId);\n throw new RuntimeException(\"Adding location for SNP not found in database, RS_ID: \" + snpRsId);\n\n }\n\n }\n }", "void assignRange() {\n rangeIndex = (int) Math.floor(value / step);\n }", "com.bagnet.nettracer.ws.core.pojo.xsd.WSScanPoints insertNewScans(int i);", "@Override\n\tpublic void visit(OWLObjectPropertyRangeAxiom axiom) {\n\t\taddFact(RewritingVocabulary.RANGE, //\n\t\t\t\taxiom.getProperty().asOWLObjectProperty().getIRI(),//\n\t\t\t\taxiom.getRange().asOWLClass().getIRI());\n\n\t}", "public void saveNew() {\r\n String name, compName;\r\n double price;\r\n int id, inv, max, min, machId;\r\n //Gets the ID of the last part in the inventory and adds 1 to it \r\n id = Inventory.getAllParts().get(Inventory.getAllParts().size() - 1).getId() + 1;\r\n name = nameField.getText();\r\n inv = Integer.parseInt(invField.getText());\r\n price = Double.parseDouble(priceField.getText());\r\n max = Integer.parseInt(maxField.getText());\r\n min = Integer.parseInt(minField.getText());\r\n\r\n if (inHouseSelected) {\r\n machId = Integer.parseInt(machineOrCompanyField.getText());\r\n Part newPart = new InHouse(id, name, price, inv, min, max, machId);\r\n Inventory.addPart(newPart);\r\n } else {\r\n compName = machineOrCompanyField.getText();\r\n Part newPart = new Outsourced(id, name, price, inv, min, max, compName);\r\n Inventory.addPart(newPart);\r\n }\r\n\r\n }", "public void insert(T object) {\n\t createInternalStorage(object.getIndexes().length);\n\t for(int i=0;i<object.getIndexes().length;i++) {\n\t\tLinkedList<T> value = internalStorage.get(i).get(object.getIndexes()[i]);\n\t\tif (value == null) {\n\t\t value = new LinkedList<T>();\n\t\t internalStorage.get(i).put(object.getIndexes()[i], value);\n\t\t}\n\t\tvalue.add(object);\n\t }\n\t\t\n\t}", "int insertSelective(SalGrade record);", "public void saveManyHistory() {\n Map<String, String> status = new HashMap<>();\n String userID = \"15\";\n List<User> allUsers = dumpDao.getAllUsers();\n Random random = new Random();\n for (int x = 0; x < 1000; x++) {\n System.out.println(\"Loop Counter : \" + x);\n userID = allUsers.get(random.nextInt(allUsers.size() - 1)).getId().toString();\n int numberOfHistory = random.nextInt(20);\n for (int y = 0; y < numberOfHistory + 1; y++) {\n System.out.println(\"\\nHistory Save\\n\");\n History history = new History();\n history.setUserId(userID);//will be set from service.\n history.setDate(DateUtil.getDate().toString());\n history.setLocation(DumpData.getLocation());\n history.setPatientDescription(DumpData.getPatientDescription());\n history.setRefferedBy(DumpData.getRefferedBy());\n history.setNote(DumpData.getNote());\n history.setUserId(userID);\n dao_history_i.save(history);\n System.out.println(history.getId());\n }//for\n }\n// bug : data are not being save\n// for (int x = 0; x < 100; x++) {\n// System.out.println(\"\\nHistory Save\\n\");\n// History history = new History();\n// history.setUserId(userID);//will be set from service.\n// history.setDate(DateUtil.getDate().toString());\n// history.setLocation(DumpData.getLocation());\n// history.setPatientDescription(DumpData.getPatientDescription());\n// history.setRefferedBy(DumpData.getRefferedBy());\n// history.setNote(DumpData.getNote());\n// history.setUserId(userID);\n// entityManager.persist(history);\n// System.out.println(history.getId());\n// }\n\n// bug : data are not being save\n// History history = new History();\n// history.setUserId(userID);//will be set from service.\n// history.setDate(DateUtil.getDate().toString());\n// history.setLocation(DumpData.getLocation());\n// history.setPatientDescription(DumpData.getPatientDescription());\n// history.setRefferedBy(DumpData.getRefferedBy());\n// history.setNote(DumpData.getNote());\n// history.setUserId(userID);\n// entityManager.persist(history);\n// System.out.println(history.getId());\n //working, insertion of history, just for one.\n// for (int x = 0; x < 10; x++) {\n// System.out.println(\"\\nHistory Save\\n\");\n// History history = new History();\n// history.setUserId(userID);//will be set from service.\n// history.setDate(DateUtil.getDate().toString());\n// history.setLocation(DumpData.getLocation());\n// history.setPatientDescription(DumpData.getPatientDescription());\n// history.setRefferedBy(DumpData.getRefferedBy());\n// history.setNote(DumpData.getNote());\n// history.setUserId(userID);\n// dao_history_i.save(history);\n// System.out.println(history.getId());\n// }//for\n }", "public void addDataRange(long beginning, long ending, Line line){\n }", "boolean store(List<Person> persons) throws ServiceException;", "private void insertData() {\r\n \r\n TeatroEntity teatro = factory.manufacturePojo(TeatroEntity.class);\r\n em.persist(teatro);\r\n FuncionEntity funcion = factory.manufacturePojo(FuncionEntity.class);\r\n List<FuncionEntity> lista = new ArrayList();\r\n lista.add(funcion);\r\n em.persist(funcion);\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n sala.setFuncion(lista);\r\n em.persist(sala);\r\n data.add(sala);\r\n }\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n em.persist(sala);\r\n sfdata.add(sala);\r\n }\r\n \r\n }", "public void addtoDB(String plate,String date,double km,ObservableList<Service> serv){\n \n plate = convertToDBForm(plate);\n \n try {\n stmt = conn.createStatement();\n } catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n if(!checkTableExists(plate)){ \n try {\n stmt.execute(\"CREATE TABLE \" + plate + \"(DATA VARCHAR(12),QNT DOUBLE,DESC VARCHAR(50),PRICE DOUBLE,KM DOUBLE);\");\n }catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }\n \n for(int i=0;i<serv.size();i++){\n \n double qnt = serv.get(i).getQnt();\n String desc = serv.get(i).getDesc();\n double price = serv.get(i).getPrice();\n \n try {\n stmt.executeUpdate(\"INSERT INTO \" + plate + \" VALUES('\" + date + \"',\" + Double.toString(qnt) + \",'\" + desc + \"',\" + Double.toString(price) + \",\" + Double.toString(km) + \");\");\n }catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }\n \n try {\n stmt.close();\n } catch (SQLException ex) {\n Logger.getLogger(DBHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n\n }", "void insertOrUpdate(StockList stockList) throws Exception;", "org.landxml.schema.landXML11.DecisionSightDistanceDocument.DecisionSightDistance insertNewDecisionSightDistance(int i);", "int insert(TDictAreas record);", "public void createNewHouseAndAddToList(){\n\t\t\tHouse newHouse = new House();\r\n\t\t\tString id = createAutomaticallyID().trim();\r\n\t\t\tnewHouse.setId(id);\r\n\t\t\tnewHouse.setPrice(Double.parseDouble(priceTextField.getText().trim()));\r\n\t\t\tnewHouse.setNumberOfBathrooms(Integer.parseInt(bathroomsTextField.getText().trim()));\r\n\t\t\tnewHouse.setAirConditionerFeature(airConditionerComboBox.getSelectedItem().toString());\r\n\t\t\tnewHouse.setNumberOfRooms(Integer.parseInt(roomsTextField.getText().trim()));\r\n\t\t\tnewHouse.setSize(Double.parseDouble(sizeTextField.getText().trim()));\r\n\t\t\t\r\n\t\t\toriginalHouseList.add(newHouse);//first adding newHouse to arrayList\r\n\t\t\tcopyEstateAgent.setHouseList(originalHouseList);//then set new arrayList in copyEstateAgent\r\n\r\n\t\t}", "org.landxml.schema.landXML11.SpeedsDocument.Speeds insertNewSpeeds(int i);", "private void insertData() {\n\n cliente = factory.manufacturePojo(ClienteEntity.class);\n em.persist(cliente);\n for (int i = 0; i < 3; i++) {\n FormaPagoEntity formaPagoEntity = factory.manufacturePojo(FormaPagoEntity.class);\n formaPagoEntity.setCliente(cliente);\n em.persist(formaPagoEntity);\n data.add(formaPagoEntity);\n }\n }", "public void saveChangesInSQLiteDB(String name, String address, String city, String province, String range, String number, String textSMS, int event) {\n\n Double[] latLng = this.getLatLngByAddress(address, city, province);\n if (latLng == null)\n return;\n Double lat = latLng[0];\n Double lng = latLng[1];\n if(update)\n this.updateFenceInSqliteDB(name, address, city, province, lat, lng, range, number, textSMS, event);\n else\n this.saveFenceInSqliteDB(name, address, city, province, lat, lng, range, number, textSMS, event);\n\n this.fragmentTransaction();\n }", "@Override\r\n public void store(long key, O object) throws OBException {\n }", "public AllowedValues(final RangeType range){\n \n valueOrRange = new ArrayList<>();\n valueOrRange.add(range);\n }", "@Override\r\n\tpublic void save(Score obj) {\n\t\tiscoreDAO.save(obj);\r\n\t}", "Range createRange();", "com.exacttarget.wsdl.partnerapi.ObjectDefinition insertNewObjectDefinition(int i);", "private void enterDiffValuesIntoDB() {\n Location senderLocation = new Location(\"\");\n senderLocation.setLatitude(Double.parseDouble(databaseHandler.getSingleExperimentInfoValue(experimentNumber, DatabaseHandler.SENDER_LATITUDE)));\n senderLocation.setLongitude(Double.parseDouble(databaseHandler.getSingleExperimentInfoValue(experimentNumber, DatabaseHandler.SENDER_LONGITUDE)));\n\n Location receiverLocation = new Location(\"\");\n receiverLocation.setLatitude(Double.parseDouble(databaseHandler.getSingleExperimentInfoValue(experimentNumber, DatabaseHandler.RECEIVER_LATITUDE)));\n receiverLocation.setLongitude(Double.parseDouble(databaseHandler.getSingleExperimentInfoValue(experimentNumber, DatabaseHandler.RECEIVER_LONGITUDE)));\n String distance = Float.toString(senderLocation.distanceTo(receiverLocation));\n databaseHandler.setValueInExpInfo(distance, \"actual_distance\", experimentNumber);\n\n float altDiff = Float.parseFloat(databaseHandler.getSingleExperimentInfoValue(experimentNumber, DatabaseHandler.SENDER_ALTITUDE))\n - Float.parseFloat(databaseHandler.getSingleExperimentInfoValue(experimentNumber, DatabaseHandler.RECEIVER_ALTITUDE));\n String altitudeDifference = Float.toString(altDiff);\n databaseHandler.setValueInExpInfo(altitudeDifference, \"altitude_difference\", experimentNumber);\n\n getWeatherData();\n }", "int insertSelective(ScoreProduct record);", "public void save() {\n //write lift information to datastore\n LiftDataAccess lda = new LiftDataAccess();\n ArrayList<Long>newKeys = new ArrayList<Long>();\n for (Lift l : lift) {\n newKeys.add(lda.insert(l));\n }\n\n //write resort information to datastore\n liftKeys = newKeys;\n dao.update(this);\n }", "public Object writeReplace() {\n return new SerializedForm(this.ranges);\n }", "public PreferenceBean[] save(PreferenceBean[] pObjects) throws SQLException \n {\n for (int iIndex = 0; iIndex < pObjects.length; iIndex ++){\n save(pObjects[iIndex]);\n }\n return pObjects;\n }", "private void setUsedValuesByBox(int startRow, int endRow, int startColumn, int endColumn) {\n\n List<Number> box = numbers.stream()\n .filter(n -> n.getRow() >= startRow)\n .filter(n -> n.getRow() <= endRow)\n .filter(n -> n.getColumn() >= startColumn)\n .filter(n -> n.getColumn() <= endColumn)\n .collect(Collectors.toList());\n\n box.forEach(n -> {\n if (n.getValue() == 0){\n List<Integer> usedNumbers = box.stream().filter(num -> num.getValue() > 0)\n .map(Number::getValue)\n .collect(Collectors.toList());\n \n //Figure out where the numbers are different\n if (n.getUsedValues() == null){\n n.setUsedValues(usedNumbers);\n }\n else {\n n.setUsedValues(\n CollectionUtils.union(n.getUsedValues(), usedNumbers)\n .stream().collect(Collectors.toList()));\n }\n }\n });\n }", "private void insertData() {\n \n for (int i = 0; i < 4; i++) {\n EmpleadoEntity entity = factory.manufacturePojo(EmpleadoEntity.class);\n entity.setSolicitudes(new ArrayList<>());\n entity.setPropuestas(new ArrayList<>());\n entity.setInvitaciones(new ArrayList<>());\n entity.setTipoEmpleado(TipoEmpleado.TRADUCTOR);\n if(i == 0)\n {\n SolicitudEntity solicitud = factory.manufacturePojo(SolicitudEntity.class);\n em.persist(solicitud);\n entity.getSolicitudes().add(solicitud);\n solicitud.setEmpleado(entity);\n solicitudesData.add(solicitud);\n }\n else if (i == 1)\n {\n InvitacionEntity invitacion = factory.manufacturePojo(InvitacionEntity.class);\n em.persist(invitacion);\n entity.getInvitaciones().add(invitacion); \n invitacion.setEmpleado(entity);\n invitacionesData.add(invitacion);\n }\n else if (i == 2){\n PropuestaEntity propuesta = factory.manufacturePojo(PropuestaEntity.class);\n em.persist(propuesta);\n entity.getPropuestas().add(propuesta);\n propuesta.setEmpleado(entity);\n propuestasData.add(propuesta);\n }\n em.persist(entity);\n data.add(entity);\n }\n }", "@Override\r\n\tpublic final void saveObjectData() throws BillingSystemException{\n\t}", "@Override\n public void save(ArrayList<League> leagues) {\n\n }", "int insertSelective(TDictAreas record);", "int insert(ScoreProduct record);", "@Override\n public void setValue(Value[] values) throws ValueFormatException,\n VersionException, LockException, ConstraintViolationException,\n RepositoryException {\n \n }", "public void addRangeValue(final T newValue) {\n\t\tvalues.add(newValue);\n\t}", "DbQuery setRangeFilter(int startValue, int endValue) {\n return setRangeFilter((double) startValue, (double) endValue);\n }", "abstract public Range createRange();", "public void insert (Object object) throws IOException {\n assert indexWriter != null : \"IndexWriter is uninitialized. Initialize it before inserting.\";\n insert(AppUtils.getMapFromObject(object));\n }", "public void addToTable(Attribute object) {\n\t\tlist.add(object);\n\t\toracle.add(object.getFriendlyName());\n\t\tdataProvider.flush();\n\t\tdataProvider.refresh();\n\t}", "public interface FeatureIndexer extends Serializable {\n\n /**\n * Finds the IDs of features with the given spatio-temporal constraints. If\n * any constraint is <code>null</code> it is considered to be unconstrained\n * in that dimension.\n * \n * @param horizontalExtent\n * The {@link BoundingBox} which features must have positions in.\n * @param verticalExtent\n * The vertical range which features must have positions in.\n * @param timeExtent\n * The time range which features must have positions in.\n * @param variableIds\n * The variable IDs which features must contain\n * @return A {@link Collection} of IDs for features which match all of the\n * given constraints\n */\n public Collection<String> findFeatureIds(BoundingBox horizontalExtent,\n Extent<Double> verticalExtent, Extent<DateTime> timeExtent,\n Collection<String> variableIds);\n\n /**\n * @return All feature IDs present in this {@link FeatureIndexer}\n */\n public Set<String> getAllFeatureIds();\n\n /**\n * Adds features to this indexer. Features are defined in terms of\n * {@link FeatureBounds} objects which define the spatial boundaries of\n * point features\n * \n * @param features\n */\n public void addFeatures(List<FeatureBounds> features);\n\n /**\n * A class representing the spatial bounds of a feature with a single point.\n * This is used to index features.\n */\n public static class FeatureBounds implements Serializable {\n private static final long serialVersionUID = 1L;\n String id;\n BoundingBox hBbox;\n Extent<Double> verticalExtent;\n Extent<Long> timeExtent;\n Collection<String> variableIds;\n\n public FeatureBounds(String id, HorizontalPosition horizontalPosition,\n Extent<Double> verticalExtent, Extent<DateTime> timeExtent,\n Collection<String> variableIds) {\n this(id, new BoundingBoxImpl(horizontalPosition.getX(), horizontalPosition.getY(),\n horizontalPosition.getX(), horizontalPosition.getY(),\n horizontalPosition.getCoordinateReferenceSystem()), verticalExtent, timeExtent,\n variableIds);\n }\n\n public FeatureBounds(String id, BoundingBox hBbox, Extent<Double> verticalExtent,\n Extent<DateTime> timeExtent, Collection<String> variableIds) {\n super();\n /*\n * We need at least an ID and a horizontal position.\n * \n * If vertical position or time are missing (i.e. null), give them\n * the maximum possible extent so that they will always be included\n * in any query.\n */\n if (id == null || hBbox == null) {\n throw new IllegalArgumentException(\n \"Must provide a non-null ID and horizontal bounding box to index a feature\");\n }\n this.id = id;\n this.hBbox = hBbox;\n if (verticalExtent != null) {\n this.verticalExtent = verticalExtent;\n } else {\n this.verticalExtent = Extents.newExtent(-Double.MAX_VALUE, Double.MAX_VALUE);\n }\n if (timeExtent != null) {\n this.timeExtent = Extents.newExtent(timeExtent.getLow().getMillis(),\n timeExtent.getHigh().getMillis());\n } else {\n this.timeExtent = Extents.newExtent(-Long.MAX_VALUE, Long.MAX_VALUE);\n }\n this.variableIds = variableIds;\n }\n\n /**\n * Convenience method to generate a {@link FeatureBounds} object from a\n * {@link ProfileFeature}\n * \n * @param feature\n * A {@link ProfileFeature} to calculate the bounds for\n * @return The appropriate {@link FeatureBounds}\n */\n public static FeatureBounds fromProfileFeature(ProfileFeature feature) {\n return new FeatureBounds(feature.getId(), feature.getHorizontalPosition(),\n feature.getDomain().getCoordinateExtent(),\n Extents.newExtent(feature.getTime(), feature.getTime()),\n feature.getVariableIds());\n }\n\n /**\n * Convenience method to generate a {@link FeatureBounds} object from a\n * {@link PointSeriesFeature}\n * \n * @param feature\n * A {@link PointSeriesFeature} to calculate the bounds for\n * @return The appropriate {@link FeatureBounds}\n */\n public static FeatureBounds fromPointSeriesFeature(PointSeriesFeature feature) {\n VerticalPosition zPos = feature.getVerticalPosition();\n Extent<Double> zExtent = null;\n if (zPos != null) {\n zExtent = Extents.newExtent(zPos.getZ(), zPos.getZ());\n }\n return new FeatureBounds(feature.getId(), feature.getHorizontalPosition(), zExtent,\n feature.getDomain().getCoordinateExtent(), feature.getVariableIds());\n }\n\n /**\n * Convenience method to generate a {@link FeatureBounds} object from a\n * {@link TrajectoryFeature}\n * \n * @param feature\n * A {@link TrajectoryFeature} to calculate the bounds for\n * @return The appropriate {@link FeatureBounds}\n */\n public static FeatureBounds fromProfileFeature(TrajectoryFeature feature) {\n return new FeatureBounds(feature.getId(), feature.getDomain().getCoordinateBounds(),\n feature.getDomain().getVerticalExtent(), feature.getDomain().getTimeExtent(),\n feature.getVariableIds());\n }\n }\n}", "public void saveAllData(Collection<Data> inAll, User inUser)\n\t{\n\t\tPropertyDetails details = getPropertyDetailsArchive().getPropertyDetailsCached(getSearchType());\n\n\t\tfor (Object object: inAll)\n\t\t{\n\t\t\tData data = (Data)object;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tupdateElasticIndex(details, data);\n\t\t\t\tgetXmlSearcher().saveAllData(inAll, inUser); //locks\n\t\t\t}\n\t\t\tcatch(Throwable ex)\n\t\t\t{\n\t\t\t\tlog.error(\"problem saving \" + data.getId() , ex);\n\t\t\t\tthrow new OpenEditException(ex);\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void create() {\n theMap = new ObjectSet<>(2048, 0.5f);\n generate();\n }" ]
[ "0.56665766", "0.55797845", "0.5278782", "0.52635175", "0.52348375", "0.52110505", "0.5202527", "0.51577216", "0.5144822", "0.5144724", "0.5105805", "0.50951403", "0.5072661", "0.50166225", "0.5008701", "0.5001918", "0.49960798", "0.4991921", "0.49917704", "0.49781394", "0.49716425", "0.4964431", "0.4962977", "0.49576482", "0.49460688", "0.49452147", "0.4944003", "0.49270183", "0.49182266", "0.4897044", "0.48968145", "0.48952207", "0.489477", "0.48823658", "0.48689204", "0.48557746", "0.4844841", "0.4826769", "0.48135516", "0.4811047", "0.47986987", "0.47932008", "0.47907275", "0.47885504", "0.4786448", "0.47856018", "0.47789186", "0.4778894", "0.4767467", "0.4766306", "0.4763549", "0.4760354", "0.4756516", "0.47442332", "0.47434238", "0.47381362", "0.47062388", "0.4705436", "0.47012228", "0.4700162", "0.4699548", "0.46903023", "0.46895298", "0.46791002", "0.46766642", "0.4668418", "0.46557662", "0.46512073", "0.46480772", "0.46452048", "0.46407512", "0.4638285", "0.4630677", "0.46269974", "0.46148133", "0.46132794", "0.4610347", "0.46096578", "0.4606754", "0.4605327", "0.4600662", "0.4596659", "0.459617", "0.45911035", "0.45891777", "0.4588081", "0.45868525", "0.45832548", "0.45781675", "0.45738143", "0.45721027", "0.45706522", "0.45689717", "0.4563163", "0.45629275", "0.45571145", "0.45521834", "0.4551784", "0.45502773", "0.45497236" ]
0.5851106
0
Initializes all features, based on their name.
public void initFeatures(String[] features, boolean[] outlierFlags) throws DatabaseAccessException { Statement stmt = null; PreparedStatement prepStmt = null; // build sql table query: Id | "1" | "2" | ... by doing this, we are able to store all values in one row String sql = "CREATE TABLE IF NOT EXISTS Objects(Id INTEGER PRIMARY KEY AUTOINCREMENT"; for (int i = 1; i <= features.length; ++i) { // escaping the id is important, due to the fact that we named the row that way (e.g. "1") sql += ", \"" + i + "\" FLOAT"; } sql += ");"; try { stmt = this.connection.createStatement(); // objects table creation stmt.executeUpdate(sql); stmt.close(); prepStmt = this.connection.prepareStatement("INSERT INTO Features VALUES(NULL, ?, ?, 0, 1);"); // add all insertions to the batch for (int i = 0; i < features.length; ++i) { prepStmt.setString(1, features[i]); prepStmt.setBoolean(2, outlierFlags[i]); prepStmt.addBatch(); } // perform the transaction this.connection.setAutoCommit(false); prepStmt.executeBatch(); this.connection.setAutoCommit(true); prepStmt.close(); } catch (SQLException e) { throw new DatabaseAccessException(Failure.WRITE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract void initUnSupportedFeatures();", "private void createFeatures() {\n\t\tfeatures = new Feature[NUM_FEATURES];\n\n\t\t// Create dummy feature\n\t\tfeatures[0] = new DummyFeature(width, height, 0, 0 - THRESHOLD);\n\n\t\t// Create the rest of the features\n\t\tfor (int i = 1; i < NUM_FEATURES; i++) {\n\t\t\tfeatures[i] = new Feature(width, height, i);\n\t\t}\n\t}", "public Feature(String name) {\n\t\tthis(name.split(\"\\\\.\"));\n\t}", "public void initialize(String name) {\n name = getAbbreviatedName(name);\n\n points = faFile.getPoints(name);\n counter = 0;\n setSize(faFile.getDimension(name));\n }", "public Features() {\n\t\tsuper();\n\t\t// TODO Auto-generated constructor stub\n\t}", "private Map<String, Feature> initializeFeatures(GameState state) {\n // initializes the features (values will be set within getFeatures)\n Map<String, Feature> features = new HashMap<>();\n\n // adds the 'global' features\n features.put(FeatureNames.RESOURCES_OWN, new Feature(FeatureNames.RESOURCES_OWN, 0, 0, 20));\n features.put(FeatureNames.RESOURCES_OPP, new Feature(FeatureNames.RESOURCES_OPP, 0, 0, 20));\n features.put(FeatureNames.GAME_TIME, new Feature(FeatureNames.GAME_TIME, 0, 0, 12000));\n features.put(FeatureNames.BIAS, new Feature(FeatureNames.BIAS, 1, 0, 1));\n\n // adds the 'per-quadrant' features\n int horizQuadLength = state.getPhysicalGameState().getWidth() / numQuadrants;\n int vertQuadLength = state.getPhysicalGameState().getHeight() / numQuadrants;\n\n int tilesPerQuadrant = horizQuadLength * vertQuadLength;\n\n // FIXME hardcoded to the HP of the base (which is the highest in microRTS)\n int maxHitPoints = 10;\n\n // the first two for traverse the quadrants\n for (int horizQuad = 0; horizQuad < numQuadrants; horizQuad++) {\n for (int vertQuad = 0; vertQuad < numQuadrants; vertQuad++) {\n\n // the third for traverses the players\n for (int player = 0; player < 2; player++) {\n String healthFeatName = FeatureNames.avgHealthPerQuad(horizQuad, vertQuad, player);\n\n features.put(healthFeatName, new Feature(healthFeatName, 0, 0, tilesPerQuadrant * maxHitPoints));\n\n // the fourth for traverses the unit types\n for (UnitType type : state.getUnitTypeTable().getUnitTypes()) {\n if (type.isResource)\n continue; // ignores resources\n String countFeatName = FeatureNames.unitsOfTypePerQuad(horizQuad, vertQuad, player, type);\n features.put(countFeatName, new Feature(countFeatName, 0, 0, tilesPerQuadrant));\n }\n }\n }\n }\n\n return features;\n }", "public FeatureCollection() {\n//\t\tif (featureTypes!=null) {\n//\t\t\tavailableFeatureTypes = featureTypes;\n//\t\t}\n\t}", "public static void init() throws IOException {\n\t\tGenericFeatVect.init();\n\t}", "void setFeatures(Features f) throws Exception;", "public DefaultFeatureTable() {\n }", "private void initialize(String name)\n\t{\n\t\tkinect = KinectController.getInstance();\n\t\tsetName(name);\n\t\trules = new ArrayList<BodyPoseRule>();\n\t}", "private void initSpriteProviders(final String name) {\n for (final SpriteProvider sp : spriteProviders) {\n sp.init(name);\n }\n }", "private void initFruits() {\n\t\tthis.fruits.clear();\n\t\tGraphFruit fruit = new GraphFruit();\n\t\tList<String> f = game.getFruits();\n\t\tfor(String s : f) {\n\t\t\tfruit.initFruit(s);\n\t\t\tthis.fruits.add(fruit);\n\t\t}\n\t}", "protected void initializePopulation () {\n\t\tfor (int i = 0; i < this.speciesSize; i++) {\n\t\t\tthis.detectors.add(DetectorFactory.makeDetector(this.featuresLength, this.typeBias, this.generalityBias));\n\t\t}\n\t}", "private void loadInitializationAttributes() {\n \t\tURL url = BootLoader.getInstallURL();\n \n \t\t// load any initialization attributes. These are the default settings for\n \t\t// key attributes (eg. default primary feature) supplied by the packaging team.\n \t\t// They are always reloaded on startup to pick up any changes due to\n \t\t// \"native\" updates.\n \t\tProperties initProps = new Properties();\n \t\tInputStream is = null;\n \t\ttry {\n \t\t\tURL initURL = new URL(url, CONFIG_FILE_INIT);\n \t\t\tis = initURL.openStream();\n \t\t\tinitProps.load(is);\n \t\t\tif (DEBUG)\n \t\t\t\tdebug(\"Defaults from \" + initURL.toExternalForm()); //$NON-NLS-1$\n \t\t} catch (IOException e) {\n \t\t\treturn; // could not load default settings\n \t\t} finally {\n \t\t\tif (is != null) {\n \t\t\t\ttry {\n \t\t\t\t\tis.close();\n \t\t\t\t} catch (IOException e) {\n \t\t\t\t\t// ignore ...\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\t// use default settings if supplied\n \t\tString initId = loadAttribute(initProps, INIT_DEFAULT_FEATURE_ID, null);\n \t\tif (initId != null) {\n \t\t\tString application = loadAttribute(initProps, INIT_DEFAULT_FEATURE_APPLICATION, null);\n \t\t\tString initPluginId = loadAttribute(initProps, INIT_DEFAULT_PLUGIN_ID, null);\n \t\t\tif (initPluginId==null)\n \t\t\t\tinitPluginId = initId;\n \t\t\tIFeatureEntry fe = findConfiguredFeatureEntry(initId);\n \n \t\t\tif (fe == null) {\n \t\t\t\t// bug 26896 : setup optimistic reconciliation if the primary feature has changed or is new\n \t\t\t\tcmdFirstUse = true;\n \t\t\t\t// create entry if not exists\n \t\t\t\tfe = createFeatureEntry(initId, null, initPluginId, null, true, application, null);\n \t\t\t} else\n \t\t\t\t// update existing entry with new info\n \t\t\t\tfe = createFeatureEntry(initId, fe.getFeatureVersion(), fe.getFeaturePluginIdentifier(), fe.getFeaturePluginVersion(), fe.canBePrimary(), application, fe.getFeatureRootURLs());\n \t\t\tconfigureFeatureEntry(fe);\n \t\t\tdefaultFeature = initId;\n \t\t\tif (DEBUG) {\n \t\t\t\tdebug(\" Default primary feature: \" + defaultFeature); //$NON-NLS-1$\n \t\t\t\tif (application != null)\n \t\t\t\t\tdebug(\" Default application : \" + application); //$NON-NLS-1$\n \t\t\t}\n \t\t}\n \t}", "@Override\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\t\n\t\tnumberOfSentimentRelatedFeatures = 0;\n\t\tnumberOfPunctuationFeatures = 0;\n\t\tnumberOfStylisticFeatures = 0;\n\t\tnumberOfSemanticFeatures = 0;\n\t\tnumberOfUnigramFeatures = 0;\n\t\tnumberOfTopWordsFeatures = 0;\n\t\tnumberOfPatternFeatures = 0;\n\t\t\n\t\t// Sets of features used\n\t\tif (Features.isUseSentimentFeatures()) {\n\t\t\tsentimentRelatedFeatures.setSelected(true);\n\t\t}\t\t\n\t\t\n\t\tif (Features.isUsePunctuationFeatures()) {\n\t\t\tpunctuationFeatures.setSelected(true);\n\t\t}\n\t\t\n\t\tif (Features.isUseStylisticFeatures()) {\n\t\t\tstylisticFeatures.setSelected(true);\n\t\t}\n\t\t\n\t\tif (Features.isUseSemanticFeatures()) {\n\t\t\tsemanticFeatures.setSelected(true);\n\t\t}\n\t\t\n\t\tif (Features.isUseUnigramFeatures()) {\n\t\t\tunigramFeatures.setSelected(true);\n\t\t}\n\t\t\n\t\tif (Features.isUseTopWords()) {\n\t\t\ttopWordsFeatures.setSelected(true);\n\t\t}\n\t\t\n\t\tif (Features.isUsePatternFeatures()) {\n\t\t\tpatternFeatures.setSelected(true);\n\t\t}\n\t\t\n\t\t// Count of sentiment-related features\n\t\tnumberOfSentimentFeaturesLabel.setText(\"\" + numberOfSentimentRelatedFeatures);\n\t\tif(numberOfSentimentRelatedFeatures==0) {\n\t\t\tnumberOfSentimentFeaturesLabel.setTextFill(Color.RED);\n\t\t} else {\n\t\t\tnumberOfSentimentFeaturesLabel.setTextFill(Color.GREEN);\n\t\t}\n\t\tcountOfSentimentRelatedFeatures = new SimpleIntegerProperty(0);\n\t\tReadOnlyIntegerProperty.readOnlyIntegerProperty(countOfSentimentRelatedFeatures).addListener((v, oldValue, newValue) -> {\n\t\t\tif (!newValue.equals(oldValue)) {\n\t\t\t\tnumberOfSentimentFeaturesLabel.setText(\"\" + numberOfSentimentRelatedFeatures);\n\t\t\t}\n\t\t\tif (newValue.intValue()==0) {\n\t\t\t\tnumberOfSentimentFeaturesLabel.setTextFill(Color.RED);\n\t\t\t} else {\n\t\t\t\tnumberOfSentimentFeaturesLabel.setTextFill(Color.GREEN);\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t// Count of Punctuation Features\n\t\tnumberOfPunctuationFeaturesLabel.setText(\"\" + numberOfPunctuationFeatures);\n\t\tif (numberOfPunctuationFeatures==0) {\n\t\t\tnumberOfPunctuationFeaturesLabel.setTextFill(Color.RED);\n\t\t} else {\n\t\t\tnumberOfPunctuationFeaturesLabel.setTextFill(Color.GREEN);\n\t\t}\n\t\t\n\t\tcountOfPunctuationFeatures = new SimpleIntegerProperty(0);\n\t\tReadOnlyIntegerProperty.readOnlyIntegerProperty(countOfPunctuationFeatures).addListener((v, oldValue, newValue) -> {\n\t\t\tif (!newValue.equals(oldValue)) {\n\t\t\t\tnumberOfPunctuationFeaturesLabel.setText(\"\" + numberOfPunctuationFeatures);\n\t\t\t}\n\t\t\tif (newValue.intValue()==0) {\n\t\t\t\tnumberOfPunctuationFeaturesLabel.setTextFill(Color.RED);\n\t\t\t} else {\n\t\t\t\tnumberOfPunctuationFeaturesLabel.setTextFill(Color.GREEN);\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t// Count of Stylistic Features\n\t\tnumberOfStylisticFeaturesLabel.setText(\"\" + numberOfStylisticFeatures);\n\t\tif (numberOfStylisticFeatures==0) {\n\t\t\tnumberOfStylisticFeaturesLabel.setTextFill(Color.RED);\n\t\t} else {\n\t\t\tnumberOfStylisticFeaturesLabel.setTextFill(Color.GREEN);\n\t\t}\n\t\t\n\t\tcountOfStylisticFeatures = new SimpleIntegerProperty(0);\n\t\tReadOnlyIntegerProperty.readOnlyIntegerProperty(countOfStylisticFeatures).addListener((v, oldValue, newValue) -> {\n\t\t\tif (!newValue.equals(oldValue)) {\n\t\t\t\tnumberOfStylisticFeaturesLabel.setText(\"\" + numberOfStylisticFeatures);\n\t\t\t}\n\t\t\tif (newValue.intValue()==0) {\n\t\t\t\tnumberOfStylisticFeaturesLabel.setTextFill(Color.RED);\n\t\t\t} else {\n\t\t\t\tnumberOfStylisticFeaturesLabel.setTextFill(Color.GREEN);\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t// Count of Semantic Features\n\t\tnumberOfSemanticFeaturesLabel.setText(\"\" + numberOfSemanticFeatures);\n\t\tif (numberOfSemanticFeatures==0) {\n\t\t\tnumberOfSemanticFeaturesLabel.setTextFill(Color.RED);\n\t\t} else {\n\t\t\tnumberOfSemanticFeaturesLabel.setTextFill(Color.GREEN);\n\t\t}\n\t\t\n\t\tcountOfSemanticFeatures = new SimpleIntegerProperty(0);\n\t\tReadOnlyIntegerProperty.readOnlyIntegerProperty(countOfSemanticFeatures).addListener((v, oldValue, newValue) -> {\n\t\t\tif (!newValue.equals(oldValue)) {\n\t\t\t\tnumberOfSemanticFeaturesLabel.setText(\"\" + numberOfSemanticFeatures);\n\t\t\t}\n\t\t\tif (newValue.intValue()==0) {\n\t\t\t\tnumberOfSemanticFeaturesLabel.setTextFill(Color.RED);\n\t\t\t} else {\n\t\t\t\tnumberOfSemanticFeaturesLabel.setTextFill(Color.GREEN);\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t// Count of Unigram Features\n\t\tnumberOfUnigramFeaturesLabel.setText(\"\" + numberOfUnigramFeatures);\n\t\tif (numberOfUnigramFeatures==0) {\n\t\t\tnumberOfUnigramFeaturesLabel.setTextFill(Color.RED);\n\t\t} else {\n\t\t\tnumberOfUnigramFeaturesLabel.setTextFill(Color.GREEN);\n\t\t}\n\t\t\n\t\tcountOfUnigramFeatures = new SimpleIntegerProperty(0);\n\t\tReadOnlyIntegerProperty.readOnlyIntegerProperty(countOfUnigramFeatures).addListener((v, oldValue, newValue) -> {\n\t\t\tif (!newValue.equals(oldValue)) {\n\t\t\t\tnumberOfUnigramFeaturesLabel.setText(\"\" + numberOfUnigramFeatures);\n\t\t\t}\n\t\t\tif (newValue.intValue()==0) {\n\t\t\t\tnumberOfUnigramFeaturesLabel.setTextFill(Color.RED);\n\t\t\t} else {\n\t\t\t\tnumberOfUnigramFeaturesLabel.setTextFill(Color.GREEN);\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t// Count of Top Words Features\n\t\tnumberOfTopWordsFeaturesLabel.setText(\"\" + numberOfTopWordsFeatures);\n\t\tif (numberOfTopWordsFeatures == 0) {\n\t\t\tnumberOfTopWordsFeaturesLabel.setTextFill(Color.RED);\n\t\t} else {\n\t\t\tnumberOfTopWordsFeaturesLabel.setTextFill(Color.GREEN);\n\t\t}\n\t\t\n\t\tcountOfTopWordsFeatures = new SimpleIntegerProperty(0);\n\t\tReadOnlyIntegerProperty.readOnlyIntegerProperty(countOfTopWordsFeatures).addListener((v, oldValue, newValue) -> {\n\t\t\tif (!newValue.equals(oldValue)) {\n\t\t\t\tnumberOfTopWordsFeaturesLabel.setText(\"\" + numberOfTopWordsFeatures);\n\t\t\t}\n\t\t\tif (newValue.intValue()==0) {\n\t\t\t\tnumberOfTopWordsFeaturesLabel.setTextFill(Color.RED);\n\t\t\t} else {\n\t\t\t\tnumberOfTopWordsFeaturesLabel.setTextFill(Color.GREEN);\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t// Count of Pattern Features\n\t\tnumberOfPatternFeaturesLabel.setText(\"\" + numberOfPatternFeatures);\n\t\tif (numberOfPatternFeatures == 0) {\n\t\t\tnumberOfPatternFeaturesLabel.setTextFill(Color.RED);\n\t\t} else {\n\t\t\tnumberOfPatternFeaturesLabel.setTextFill(Color.GREEN);\n\t\t}\n\t\t\n\t\tcountOfPatternFeatures = new SimpleIntegerProperty(0);\n\t\tReadOnlyIntegerProperty.readOnlyIntegerProperty(countOfPatternFeatures).addListener((v, oldValue, newValue) -> {\n\t\t\tif (!newValue.equals(oldValue)) {\n\t\t\t\tnumberOfPatternFeaturesLabel.setText(\"\" + numberOfPatternFeatures);\n\t\t\t}\n\t\t\tif (newValue.intValue()==0) {\n\t\t\t\tnumberOfPatternFeaturesLabel.setTextFill(Color.RED);\n\t\t\t} else {\n\t\t\t\tnumberOfPatternFeaturesLabel.setTextFill(Color.GREEN);\n\t\t\t}\n\t\t});\n\t\t\n\t\t// Initialize the count of features in case of the user chooses to import the feature set\n\t\tinitializeSentimentFeaturesCount();\n\t\tinitializePunctuationFeaturesCount();\n\t\tinitializeStylisticFeaturesCount();\n\t\tinitializeSemanticFeaturesCount();\n\t\tinitializeUnigramFeaturesCount();\n\t\tinitializeTopWordsFeaturesCount();\n\t\tinitializePatternFeaturesCount();\n\t\t\n\t\t\n\t}", "private void initialize() {\n this.traitMap = new HashMap<T, ITrait<T>>();\n this.traitList = new ArrayList<ITrait<T>>();\n this.observers = Collections.synchronizedList(new ArrayList<IStatisticsObserver>());\n this.dimensionName = \"UNNAMED\";\n\n }", "private void initializeAll() {\n initialize(rows);\n initialize(columns);\n initialize(boxes);\n }", "public void init() {\n initLayers();\n for (int i = 0; i < indivCount; i++) {\n ArrayList<Layer> iLayers = new ArrayList<>();\n for (Layer l : layers)\n iLayers.add(l.cloneSettings());\n individuals[i] = new Individual(iLayers);\n }\n }", "private void init() {\n filmCollection = new FilmCollection();\n cameraCollection = new CameraCollection();\n }", "void addFeatures(Features features);", "public void init(){\r\n\t\tbuild(0);\r\n\t\taddFestiveCity(1);\r\n\t}", "@PostConstruct\n public void init() {\n this.facts.addAll(checkExtractor.obtainFactList());\n this.facts.addAll(facebookExtractor.obtainFactList());\n this.facts.addAll(googleExtractor.obtainFactList());\n this.facts.addAll(linkedinExtractor.obtainFactList());\n this.facts.addAll(twitterExtractor.obtainFactList());\n\n this.checkHeader = this.utils.generateDatasetHeader(this.checkExtractor.obtainFactList());\n this.facebookHeader = this.utils.generateDatasetHeader(this.facebookExtractor.obtainFactList());\n this.googleHeader = this.utils.generateDatasetHeader(this.googleExtractor.obtainFactList());\n this.linkedinHeader = this.utils.generateDatasetHeader(this.linkedinExtractor.obtainFactList());\n this.twitterHeader = this.utils.generateDatasetHeader(this.twitterExtractor.obtainFactList());\n }", "public void initialize() {\n setThisFacility(null);\n loadData();\n initCols();\n\n }", "public void initialize(String name, Element element) throws Exception {\r\n\t\tsuper.initialize(name, element);\r\n\t\t\r\n\t\tif (log.isDebugEnabled()) {\r\n\t\t\tlog.debug(\"Initialising SVM classifier\");\r\n\t\t}\r\n\t\t\r\n\t\tNodeList elements = element.getElementsByTagName(\"vocabulary\");\r\n\t\tif (elements.getLength() != 1) {\r\n\t\t\tthrow new Exception(\"Found invalid vocabulary elements for concept: \" + name);\r\n\t\t}\r\n\t\tvocabulary = ((Element) elements.item(0)).getTextContent();\r\n\t\t\r\n\t\tif (log.isDebugEnabled()) {\r\n\t\t\tlog.debug(\"Found vocabulary: \" + vocabulary);\r\n\t\t}\r\n\t\t\r\n\t\telements = element.getElementsByTagName(\"include\");\r\n\t\tint docId = 0;\r\n\t\tfor(int i = 0; i < elements.getLength(); i++) {\r\n\t\t\tElement e = (Element) elements.item(i);\r\n\t\t\tConcept c = getConcept(e.getTextContent(), \"class\");\r\n\t\t\tc.setId(String.valueOf(docId++));\r\n\t\t\tuniverse.add(c);\r\n\t\t}\r\n\t\telements = element.getElementsByTagName(\"exclude\");\r\n\t\tfor(int i = 0; i < elements.getLength(); i++) {\r\n\t\t\tElement e = (Element) elements.item(i);\r\n\t\t\tConcept c = getConcept(e.getTextContent(), \"other\");\r\n\t\t\tc.setId(String.valueOf(docId++));\r\n\t\t\tuniverse.add(c);\r\n\t\t}\r\n\t\t\r\n\t\tString label = \"class\";\r\n\t\t/* Use null as value for the VectorSpace parameter forcing a new\r\n\t\t * VectorSpace instance to be created. Subsequently new Vectors are\r\n\t\t * added to the space. Note that each Modeller can be associated with\r\n\t\t * a single Concept. If more than one concept needs to be identified,\r\n\t\t * use a Modeller instance for each concept (label) and share\r\n\t\t * the space between them. */\r\n\t\tsvm = new Modeller(new GaussianKernel(5), label, new VectorSpace());\r\n\t\t// create a vector for each document in the universe\r\n\t\tfor(Iterator<String> i = universe.getCategorySet().iterator(); i.hasNext(); ) {\r\n\t\t\tString documentId = i.next();\r\n\t\t\tint n = 0;\r\n\t\t\tdouble[] x = new double[universe.getTermCount()];\r\n\t\t\tfor(String j : universe.getTerms())\r\n\t\t\t\tx[n++] = universe.getConceptTermFrequency(j, documentId);\r\n\t\t\t// normalise support vectors\r\n\t\t\tXY sv = new XY(x, universe.getConcept(documentId).getLabel(), true);\r\n\t\t\tsvm.addVector(sv);\r\n\t\t}\r\n\t\tif (log.isDebugEnabled()) {\r\n\t\t\tlog.debug(\"Starting training...\");\r\n\t\t}\r\n\t\tsvm.train();\r\n\t\tif (log.isDebugEnabled()) {\r\n\t\t\tlog.debug(\"Done training...\");\r\n\t\t}\r\n\t}", "static void initRuntimeConstructors(ITermFactory tf) {\n CFGNode.initializeConstructor(tf);\n ICFGNode.Kind.initializeConstructor(tf);\n Set.initializeConstructor(tf);\n Map.initializeConstructor(tf);\n EmptyMapOrSet.initializeConstructor(tf);\n Name.initializeConstructor(tf);\n FullSetLattice.ISetImplementation.initializeConstructor(tf);\n TermIndex.initializeConstructor(tf);\n }", "public void init(String... names) throws IOException;", "public void loadFeatures(Class<?> classToRun) throws Exception {\n List<Features> annos = FeaturesRunner.getScanner().getAnnotations(classToRun, Features.class);\n for (Features anno : annos) {\n for (Class<? extends RunnerFeature> cl : anno.value()) {\n loadFeature(new HashSet<>(), cl);\n }\n }\n\n }", "public void initialize() {\n sceneSwitch = SceneSwitch.getInstance();\n addTypes();\n }", "public Feature(String name,int id) {\n\t\tthis(name.split(\"\\\\.\"),id);\n\t}", "public MdnFeatures()\n {\n }", "void init() {\n\t\tinitTypes();\n\t\tinitGlobalFunctions();\n\t\tinitFunctions();\n\t\tinitClasses();\n\t}", "public void setFeatureFactory(FeatureFactory featureFactory) {\n factory = featureFactory;\n }", "public void addFeatures(Feature... f) {\r\n addFeatures(Arrays.asList(f));\r\n }", "private void init() {\n\n\t\tinitializeLists();\n\t\tcreateTiles();\n\t\tcreateTileViews();\n\t\tshuffleTiles();\n\n\t}", "@Override\n public void initialize() {\n for (final PluginInfo<AbstractVolumeManagerPlugin> info : getPlugins()) {\n String name = info.getName();\n if (name == null || name.isEmpty()) {\n name = info.getClassName();\n }\n // Add the plugin to the list of known animals.\n plugins.put(name, info);\n }\n }", "public static void init()\n {\n\n addShapeless();\n\n addShaped();\n }", "public void initialize(Model model){\r\n\t\tArrayList<String> elements = new ArrayList<String>();\r\n\t\tfor(int i = 0; i < model.getElements().size(); i++){\r\n\t\t\telements.add(model.getElements().get(i).getId());\r\n\t\t}\r\n\t\t\r\n\t\tFeature base = new Feature(\"base\", \"mandatory\", \"root\", elements);\r\n\t\tthis.mandatoryFeatures.add(base);\r\n\t\tFeatureGroup variants = new FeatureGroup(\"variants\", \"alternative\", \"root\");\r\n\t\tthis.alternativeFeatureGroup.add(variants);\r\n\t\t\r\n\t\t//New 02/12/201/\r\n\t\tFeature newVariant = new Feature(model.getId()+\"_Variant\", \"variant\", this.alternativeFeatureGroup.get(0).getId());\r\n\t\tthis.addVariant(newVariant);\r\n\t\t//-New 02/12/201/\r\n\t}", "public void setUp() {\r\n name1 = new Name(\"A\", \"B\");\r\n name2 = new Name(\"John\", \"Smith\", \"William\");\r\n name3 = new Name(\"Mary\", \"Will\");\r\n name4 = new Name(\"William\", \"Will\");\r\n }", "public static void init() {\n\t\tregisterRecipes();\n\t\tregisterShapelessRecipes();\n\t\tregisterSmeltingRecipes();\n\t}", "@Override\n\tpublic void init () {\n\t\tframeBuffers = new FrameBuffer[getPassQuantity()];\n\t\tpassShaderProviders = new ShaderProvider[getPassQuantity()];\n\n\t\tfor (int i = 0; i < getPassQuantity(); i++) {\n\t\t\tinit(i);\n\t\t}\n\t}", "private void generalFeatureExtraction () {\n Logger.log(\"Counting how many calls each method does\");\n Chain<SootClass> classes = Scene.v().getApplicationClasses();\n try {\n for (SootClass sclass : classes) {\n if (!isLibraryClass(sclass)) {\n System.out.println(ConsoleColors.RED_UNDERLINED + \"\\n\\n 🔍🔍 Checking invocations in \" +\n sclass.getName() + \" 🔍🔍 \" + ConsoleColors.RESET);\n List<SootMethod> methods = sclass.getMethods();\n for (SootMethod method : methods) {\n featuresMap.put(method, new Features(method));\n }\n }\n }\n } catch (Exception e) { \n }\n System.out.println(\"\\n\");\n }", "public void setFeatureIndex(int i) {\n featureIndex = i;\n }", "private void initializeFeatures() {\n\t\tint buttonLength = 2*super.getXLength()/3;\n\t\tint buttonHeight = super.getYLength()/6;\n\t\tint startX = super.getXPos() + super.getXLength()/2 - buttonLength/2; \n\t\tint startY = super.getYPos() + super.getYLength()/2 - buttonHeight/2;\n\t\tint spacingBetweenButtons = 10; \n\t\tstart = new StartButton(parent,startX,startY,buttonLength,buttonHeight);\n\t\tinstructions = new InstructionsButton(parent,startX,startY + spacingBetweenButtons+buttonHeight,buttonLength,buttonHeight);\n\t\tquit = new QuitButton(parent,startX,startY + 2*(buttonHeight + spacingBetweenButtons),buttonLength,buttonHeight);\n\t}", "public static void initialize(){\r\n\t\tinitialize(new CurrentClassGetter().getClassName());\r\n\t}", "public void addFeatures(@Nonnull Collection<Feature> f) {\r\n features.addAll(f);\r\n }", "private void initData() {\n\t\tnamesInfo = new NameSurferDataBase(fileName);\n\n\t}", "public abstract void initLayers();", "private void initialize() {\n\t\tinitializeModel();\n\t\tinitializeBoundary();\n\t\tinitializeController();\n\t}", "@Before\n public void init() {\n this.testMethodName = this.getTestMethodName();\n this.initialize();\n }", "public FeatureExtraction() {\n\t}", "public void init() {\n\t\tfor (Node node : nodes)\n\t\t\tnode.init();\n\t}", "public void initKnownFunctions(){\r\n DotTree.Graph g = getGraph();\r\n\r\n for (DotTree.Edge e:g.edges){\r\n Function f = new Function(e.attributes.get(\"label\"));\r\n if (knownFunctions.containsKey(f.name)) f = knownFunctions.get(f.name);\r\n else {\r\n knownFunctions.put(f.name, f);\r\n }\r\n\r\n // compute available entry states\r\n for (DotTree.NodePair p:e.getNodePairs()){\r\n f.entryStates.add(new State(p.x.id));\r\n }\r\n }\r\n for (String name:knownFunctions.keySet()){\r\n if (name.matches(getParamS(\"ignoredFunctions\")))\r\n knownFunctions.remove(name);\r\n }\r\n\r\n }", "protected void initialize() {\n\t\trequires(simpleVision);\r\n\t}", "public void init() {\r\n\tlog.info(\"OsylManagerServiceImpl service init() \");\r\n\t// register functions\r\n\tfor (Iterator<String> i = functionsToRegister.iterator(); i.hasNext();) {\r\n\t String function = i.next();\r\n\t functionManager.registerFunction(function);\r\n\t}\r\n }", "public void initialize() {\n // TODO\n }", "public void initOperation() {\n\t\tinitialized = true;\r\n\t}", "private void init() {\r\n\tlocals = new float[maxpoints * 3];\r\n\ti = new float[] {1, 0, 0};\r\n\tj = new float[] {0, 1, 0};\r\n\tk = new float[] {0, 0, 1};\r\n\ti_ = new float[] {1, 0, 0};\r\n\tk_ = new float[] {0, 0, 1};\r\n }", "public void init() {\n\t\t// Read the data text file and load up the local database\n\t\tinitData();\n\n\t\t// Create the labels and the textbox\n\t\taddNameLabel();\n\t\taddNameBox();\n\t\taddGraphButton();\n\t\taddClearButton();\n\n\t\t// Set up the graph object\n\t\tgraph = new NameSurferGraph();\n\t\tadd(graph);\n\n\t}", "public void setUpData(final FeatureCollection collection) {\n if (map == null) {\n return;\n }\n featureCollection = collection;\n setupSource();\n setUpImage();\n setUpMarkerLayer();\n // setupClusterSource();\n setUpInfoWindowLayer();\n\n }", "private void initializeFishTokens() {\n\t\tfishTokenOccurences.put(FishTokenType.ONE_FISH, 11);\n\t\tfishTokenOccurences.put(FishTokenType.TWO_FISH, 10);\n\t\tfishTokenOccurences.put(FishTokenType.THREE_FISH, 8);\n\t\tfishTokenOccurences.put(FishTokenType.OLD_BOOT, 1);\n\t}", "protected void init()\r\n\t{\n\t\tif (ConfigManager.getInstance().getIsCrossClassify() && WekaTool.dataStageOn)\r\n\t\t{\r\n\t\t\t//System.out.println(\"in init for data stage\");\r\n\t\t\tsrcDirUrl = ConfigManager.getInstance().getTrainPath();\r\n\t\t\tdestDirUrl = ConfigManager.getInstance().getTrainPath() +\r\n\t\t\t File.separator + \"output\";\r\n\t\t\t//System.out.println(\"srcDirUrl = \" + srcDirUrl);\r\n\t\t\t//System.out.println(\"destDirUrl = \" + destDirUrl);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//System.out.println(\"here, good\");\r\n\t\t\tsrcDirUrl = getSrcDirUrl();\r\n\t\t\tdestDirUrl = getDestDirUrl();\r\n\t\t}\r\n\t\tdatalibSVMUrl = getLibSVMDirUrl();\r\n\t\ttry {\r\n\t\t\tsrcDir = Utils.getDir(srcDirUrl);\r\n\t\t\tdestDir = Utils.getDir(destDirUrl);\r\n\t\t} catch (Exception e)\r\n\t\t{\r\n\t\t}\r\n\t}", "public void loadNames() {\n\t\tloadNames(false);\n\t}", "public void increaseFeatureCount() {\n this.featureCount++;\n }", "public void initializeAll() {\n getConsole_inclusionFactor().getSelectionModel().selectFirst();\n getConsole_sortingDirection().getSelectionModel().selectFirst();\n getConsole_firstSortingFactor().getSelectionModel().selectFirst();\n getConsole_secondSortingFactor().getSelectionModel().selectFirst();\n getAction_inclusionFactor().getSelectionModel().selectFirst();\n getAction_sortingDirection().getSelectionModel().selectFirst();\n getAction_firstSortingFactor().getSelectionModel().selectFirst();\n getAction_secondSortingFactor().getSelectionModel().selectFirst();\n getAction_Status().getSelectionModel().selectFirst();\n getAction_Member().getSelectionModel().selectFirst();\n getAction_Team().getSelectionModel().selectFirst();\n \n }", "private\t\tvoid\t\tinitialize()\n\t\t{\n\t\tif (iterateThroughAllLayers && editor.hasLayers())\n\t\t\t{\n\t\t\thasLayers = true;\n\t\t\tif (!startAtTop)\n\t\t\t\tlayerNum = 0;\n\t\t\telse\n\t\t\t\tlayerNum = editor.getNumberOfLayers() - 1;\n\t\t\t\n\t\t\titerator = new MiContainerIterator(\n\t\t\t\teditor.getLayer(layerNum), !startAtTop, \n\t\t\t\titerateIntoPartsOfParts, iterateIntoAttachmentsOfParts);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\titerator = new MiContainerIterator(\n\t\t\t\teditor.getCurrentLayer(), !startAtTop, \n\t\t\t\titerateIntoPartsOfParts, iterateIntoAttachmentsOfParts);\n\t\t\t}\n\t\t}", "private void initialize() {\n\t\troot = new Group();\n\t\tgetProperties();\n\t\tsetScene();\n\t\tsetStage();\n\t\tsetGUIComponents();\n\t}", "Feature createFeature();", "public void setFeatures(List<String> features) {\n this.features = features;\n }", "public void init() {\r\n\t\tsuper.init();\r\n\t\tfor (int i = 0; i < _composites.size(); i++) {\r\n\t\t\t_composites.get(i).init();\t\t\t\r\n\t\t} \r\n\t}", "public void init(){\n\t\tcoreNumber = this.readIntValueFromFile(MAX_CORE_ID) + 1;\n\t\tparseAvailableFrequencies();\n\t\t\n\t\tmBaseCpuSpeedTimes = new long[cpuFrequencies.length];\n\t\tmRelCpuSpeedTimes = new long[cpuFrequencies.length];\t\t\t\t\n\t\tcores = new Core[coreNumber];\n\t\tfor(int i = 0; i < coreNumber; i++){\n\t\t\tcores[i] = new Core(i);\n\t\t\tcores[i].init();\n\t\t}\n\t}", "private void initialize()\r\n\t{\r\n\t\tif (!isFilterOn())\r\n\t\t\treturn;\r\n\t\tselectTools = selectApi = selectExtra = selectGeneric = false;\r\n\t\tselectTools = \r\n\t\t\t\tpackageTypeSet.contains(PackageType.build_tools) ||\r\n\t\t\t\tpackageTypeSet.contains(PackageType.platform_tools) ||\r\n\t\t\t\tpackageTypeSet.contains(PackageType.tools);\r\n\t\tselectApi =\r\n\t\t\t\tpackageTypeSet.contains(PackageType.platforms) ||\r\n\t\t\t\tpackageTypeSet.contains(PackageType.add_ons) ||\r\n\t\t\t\tpackageTypeSet.contains(PackageType.system_images) ||\r\n\t\t packageTypeSet.contains(PackageType.sources);\r\n\t\tselectExtra = packageTypeSet.contains(PackageType.extras);\r\n\t\t\r\n\t\tfor (int i = 0; i < GENERIC_PACKAGE_TYPES.length; ++i)\r\n\t\t\tif (packageTypeSet.contains(GENERIC_PACKAGE_TYPES[i])) {\r\n\t\t\t\tselectGeneric = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t}", "public void initialize() {\n // empty for now\n }", "public void initialize() {\r\n }", "public void initialize() {\n }", "public void init(String collectionName) {\n\r\n }", "public void initialize() {\n\t}", "public void initialize() {\n\t}", "private void initialize() {\n }", "public void addFeatures(IFeature feature);", "public BaseFeat(String inName)\n {\n super(inName, TYPE);\n }", "public void init() {\r\n\r\n\t}", "public void initializePackageContents()\n\t{\n\t\tif (isInitialized) return;\n\t\tisInitialized = true;\n\n\t\t// Initialize package\n\t\tsetName(eNAME);\n\t\tsetNsPrefix(eNS_PREFIX);\n\t\tsetNsURI(eNS_URI);\n\n\t\t// Initialize data types\n\t\tinitEDataType(featureNotFoundExceptionEDataType, FeatureNotFoundException.class, \"FeatureNotFoundException\", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);\n\t}", "void initial()\n\t{\n\t\tint i;\n\t\tfor(i=0;i<FoodNumber;i++)\n\t\t{\n\t\tinit(i);\n\t\t}\n\t\tGlobalMin=f[0];\n\t for(i=0;i<D;i++)\n\t GlobalParams[i]=Foods[0][i];\n\n\n\t}", "public void initOptions(String[] args) {\n\t\tCL_Initializer.CL_init(args);\n\t\tCL_Initializer.checkParsing(args);\n\t\tCL_Initializer.initImagingScheme();\n\t\tCL_Initializer.initDataSynthesizer();\n\t}", "@Override\n public void initialize() {\n drivetrain.resetEncoders();\n }", "private static void initializeNames() {\n _names.add(\"Raymond\");\n _names.add(\"Mia\");\n _names.add(\"Maximus\");\n _names.add(\"Thomas\");\n _names.add(\"Candice\");\n\n _names.add(\"Maggie\");\n _names.add(\"Grant\");\n _names.add(\"Joni\");\n _names.add(\"Shirley\");\n _names.add(\"Alaska\");\n\n _names.add(\"Alice\");\n _names.add(\"Bob\");\n _names.add(\"Clark\");\n _names.add(\"Bill\");\n _names.add(\"Mike\");\n\n _names.add(\"Sara\");\n _names.add(\"Jim\");\n _names.add(\"Laura\");\n _names.add(\"Steve\");\n _names.add(\"Chris\");\n }", "@BeforeClass public static void initialiseScenario(){\n SelectionScenario.initialiseScenario();\n }", "public static void init() {\n FunctionRegistry reg = new FunctionRegistry() ;\n ARQFunctions.load(reg);\n StandardFunctions.loadStdDefs(reg) ;\n StandardFunctions.loadOtherDefs(reg) ;\n set(ARQ.getContext(), reg) ;\n }", "public void initialize() {\n }", "private void initSetUp()\n\t{\n\t\tthis.setActionName(NAME);\n\t\tthis.setDescription(DESCRIPTION);\n\t\tthis.setMagic(IS_MAGIC);\n\t\tthis.setAttack(IS_ATTACK);\n\t\tthis.setTargetSelf(IS_TARGET_SELF);\n\t\tthis.setInternalName(INTERNAL_NAME);\n\t}", "public void initialize (String tagTableFile, String featureFile) {\n\t\tmene.resetForTraining(featureFile);\n\t\tannotator.readTagTable (tagTableFile);\n\t}", "private void initialize() {\n\t}", "@Override\n public void initialize()\n {\n super.initialize();\n log.info(\"Initialize \" + name);\n Map<String, Collection<?>> beans;\n generator = service.getRandomSeedRepo().\n getRandomSeed(\"EvSocialClass-\" + name, 1, \"initialize\");\n\n Config.recycle();\n config = Config.getInstance();\n config.configure(service.getServerConfiguration());\n\n beans = config.getBeans();\n unpackBeans(beans);\n\n // Create and set up the customer instances\n evCustomers = new ArrayList<EvCustomer>();\n if (null == customerAttributeList) {\n // boot session - dynamic configuration\n configureForBoot(beans);\n }\n else {\n // sim session - restore from boot record\n configureForSim(beans);\n }\n }", "public void init() {\n\t\t\n\t\t\n\t\tprepareGaborFilterBankConcurrent();\n\t\t\n\t\tprepareGaborFilterBankConcurrentEnergy();\n\t}", "public void initClusters(){\n\t\tUnitRow unitRow = data.getUnitRow();\n\t\tUnit currentUnit = null;\n\t\tLeaf leaf = null;\n\n\t\tfor (int i = 0; i < unitRow.getLength(); i++){\n\t\t\tcurrentUnit = unitRow.getUnit(i);\n\t\t\tleaf = new Leaf(currentUnit);\n\t\t\tclusters.add(leaf);\n\t\t}\n\t\tSystem.out.println(\"Clusters initialized.\");\n\t}", "abstract Feature createFeature(boolean enabled, int count);", "protected void initialize() {\n // Attribute Load\n this.attributeMap.clear();\n this.attributeMap.putAll(this.loadAttribute());\n // RuleUnique Load\n this.unique = this.loadRule();\n // Marker Load\n this.marker = this.loadMarker();\n // Reference Load\n this.reference = this.loadReference();\n }", "public void initialize()\n {\n \t// Luodaan manager-luokat\n EffectManager.getInstance();\n MessageManager.getInstance();\n CameraManager.getInstance();\n\n // Luodaan pelitilan eri osat\n backgroundManager = new BackgroundManager(wrapper);\n \tweaponManager = new WeaponManager();\n hud = new Hud(context, weaponManager);\n touchManager = new TouchManager(dm, surfaceView, context, hud, weaponManager);\n gameMode = new GameMode(gameActivity, this, dm, context, hud, weaponManager);\n \n // Järjestellään Wrapperin listat uudelleen\n wrapper.sortDrawables();\n wrapper.generateAiGroups();\n \n // Merkitään kaikki ladatuiksi\n allLoaded = true;\n }", "private void init() {\n }", "private void init() {\n }" ]
[ "0.64552516", "0.64230394", "0.62868917", "0.6198602", "0.61975974", "0.61679834", "0.6155254", "0.61280817", "0.6113674", "0.6082714", "0.60772073", "0.59193736", "0.589788", "0.5893397", "0.58445287", "0.583822", "0.5813872", "0.57920486", "0.57314295", "0.57202065", "0.57151806", "0.56911445", "0.5677087", "0.56727016", "0.5670239", "0.5670059", "0.5655631", "0.5652799", "0.56511927", "0.5635862", "0.56267023", "0.56150436", "0.56044", "0.55871785", "0.55719304", "0.5549069", "0.55449164", "0.5541726", "0.55224454", "0.5522411", "0.5507369", "0.5504528", "0.5489811", "0.5484753", "0.54738593", "0.54738295", "0.5472141", "0.5443658", "0.543271", "0.54286045", "0.5424041", "0.54011637", "0.5397451", "0.5364153", "0.53639495", "0.5353752", "0.5350411", "0.53445846", "0.53351885", "0.5331189", "0.5327975", "0.5324233", "0.53236663", "0.53113425", "0.5304287", "0.5303365", "0.5300306", "0.52904034", "0.5288419", "0.52843755", "0.52618074", "0.52571994", "0.52536535", "0.52451295", "0.52402014", "0.52293164", "0.5229081", "0.5229081", "0.52253926", "0.5210524", "0.5210017", "0.5207416", "0.5199766", "0.5197738", "0.5193429", "0.5192638", "0.518855", "0.51849234", "0.51846665", "0.5181495", "0.51771766", "0.5177078", "0.5172147", "0.51715475", "0.5166506", "0.5161684", "0.51562", "0.5156137", "0.5151806", "0.51482147", "0.51482147" ]
0.0
-1
Stores a new subspace.
public void pushSubspace(int id, int[] featureReference, String name) throws DatabaseAccessException { PreparedStatement prepStmt = null; try { prepStmt = this.connection.prepareStatement("INSERT INTO Subspaces VALUES(?, ?, ?);"); // the id is unique for this subspace prepStmt.setInt(1, id); // add all insertions to the batch for (int featureId : featureReference) { prepStmt.setInt(2, featureId); prepStmt.setString(3, name); prepStmt.addBatch(); } // perform the transaction this.connection.setAutoCommit(false); prepStmt.executeBatch(); this.connection.setAutoCommit(true); prepStmt.close(); } catch (SQLException e) { throw new DatabaseAccessException(Failure.WRITE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setDataSpace(DataSpace newDataSpace) {\n\t\tdataspace = newDataSpace;\n\t}", "public void addSpaceStation()\n\t{\n\t\t//if a space station is already spawned, one will not be added\n\t\tif (gameObj[5].size() == 0)\n\t\t{\n\t\t\tgameObj[5].add(new SpaceStation());\n\t\t\tSystem.out.println(\"SpaceStation added\");\n\t\t}else{\n\t\t\tSystem.out.println(\"A space station is already spawned\");\n\t\t}\n\t}", "public static Space addSpace(Context context) throws XMPPException {\n\t\tint spaceID = MainApplication.space_counter++;\n\t\tSpace space = new Space(context, false, String.valueOf(spaceID), true/*MainApplication.user_primary*/);\n\t\tSpace.allSpaces.put(space.getRoomID(), space);\n\t\t\n\t\tnotification_View.launch(\"sidechat\");\n\t\t\n\t\tif(D) Log.d(TAG, \"Created a new space with ID:\" + spaceID);\n\t\treturn space;\n\t}", "public void addSpaceStation()\n\t{\n\t\t//if a space station is already spawned, one will not be added\n\n\t\tgameObj.add(new SpaceStation(getHeight(), getWidth()));\n\t\tSystem.out.println(\"Space station added\");\n\t\tnotifyObservers();\n\t}", "public void storeState(StateInfo stateInfo) {\n \n// Thread.dumpStack();\n super.storeState(stateInfo); \n \n JJStateInfo info = (JJStateInfo) stateInfo;\n info.setSubStates(lexan.getStateInfo());\n \n if (DEBUG) debug.println(\"Storing state [\"+ offset + \",\" + tokenOffset + \"]: \" + info + \"@\" + stopOffset); // NOI18N\n \n }", "public Space()\n {\n this._valuesToPut = new ArrayList<>();\n this._defaultSpace = false;\n this._lock = false;\n }", "public com.walgreens.rxit.ch.cda.StrucDocSub addNewSub()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocSub target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocSub)get_store().add_element_user(SUB$2);\n return target;\n }\n }", "@Override\r\n public void setHspace(String hspace) {\n }", "public void insert(String key) {\n if (getRoot().getN() == 2 * T_VAR - 1) {\n splitRoot();\n }\n getRoot().insert(key.toLowerCase());\n }", "@Override\r\n public void setVspace(String vspace) {\n }", "private void recordCopyingSpaceAgainstCopiedSpace(Space newSpace, Space originalSpace) {\n ConfluenceBandanaContext bandanaContext = new ConfluenceBandanaContext(newSpace);\n bandanaManager.setValue(bandanaContext, BANDANA_KEY_COPYING_SPACE_KEY, originalSpace.getKey());\n }", "public static void store() {\r\n//\t\tSystem.out.println(\"mar\"+readMAR().getStr());\r\n\t\tString mar = new String(readMAR().getStr());\r\n\t\tTraceINF.write(\"Write memory \"+mar);\r\n\t\tFormatstr content = new Formatstr();\r\n\t\t\r\n\t\tcontent = readMBR();\r\n\t\tgetBank(mar)[Integer.parseInt(mar.substring(0, mar.length() - 2), 2)] = content.getStr();\r\n\t\tTraceINF.write(\"Write finished.\");\r\n\t}", "public void setStorageplace(int newStorageplace) {\n\tstorageplace = newStorageplace;\n}", "public void setSpace(AddressSpace space) throws SledException {\n\t\tif (val.getClass() != BinaryExpression.class)\n\t\t\tthrow new SledException(\"Can't add space to an ExpressionTerm that does not contain a BinaryExpression\");\n\t\t((BinaryExpression) val).setSpace(space);\n\t}", "public List<Space> getSubSpaces() {\n\t\treturn subSpaces;\n\t}", "public void ensureSpace(int space) {\n ensureCapacity(length + space);\n }", "public void addResourceSpace(Resource r,int srt){\n t.put(r.getName(),new SupplyNode(r,srt));\n t.get(r.getName()).setCurrent(srt);\n }", "public void store(@Nullable String spaceName, SwapKey key, @Nullable byte[] val, SwapContext ctx)\n throws IgniteSpiException;", "public synchronized void writeStore() {\n FileOutputStream fileStream = null;\n\n try {\n File storeFile = new File(getStoreName());\n File oldStoreFile = new File(oldStoreName);\n\n if (oldStoreFile.exists()) {\n oldStoreFile.delete();\n }\n\n if (storeFile.exists()) {\n storeFile.renameTo(oldStoreFile);\n }\n\n File newStoreFile = new File(getStoreName());\n\n // Make sure the needed directories exists\n if (!newStoreFile.getParentFile().exists()) {\n newStoreFile.getParentFile().mkdirs();\n }\n\n fileStream = new FileOutputStream(newStoreFile);\n ObjectOutputStream outStream = new ObjectOutputStream(fileStream);\n outStream.writeObject(store);\n } catch (Exception e) {\n LOGGER.log(Level.WARNING, Utility.expandStackTraceToString(e));\n } finally {\n if (fileStream != null) {\n try {\n fileStream.close();\n } catch (IOException e) {\n LOGGER.log(Level.WARNING, Utility.expandStackTraceToString(e));\n }\n }\n }\n }", "public void setCapacity( int space ) {\n\t if (space <= length) return;\n\t int newLength = resize.computeResize( length, space );\n\t \n if (newLength != length) {\n list = (newLength == 0) ? null : makeList( newLength );\n }\n\t}", "@Override\r\n\tpublic void addStorageUnit() {\r\n\t}", "@Override\n\tpublic void save(Session sess, Subject sub) {\n\t\tsess.save(sub);\n\t}", "private void createWorkSpace() {\n\t\tif(promptForWorkSpaceName() != null){\n\t\t\tmyWorkSpaceListener.createWorkSpace(promptForWorkSpaceName());\n\t\t}\n\t}", "public void setCargoSpace(int cargoSpace) {\n this.cargoSpace = cargoSpace;\n }", "public void saveNew() {\r\n String name, compName;\r\n double price;\r\n int id, inv, max, min, machId;\r\n //Gets the ID of the last part in the inventory and adds 1 to it \r\n id = Inventory.getAllParts().get(Inventory.getAllParts().size() - 1).getId() + 1;\r\n name = nameField.getText();\r\n inv = Integer.parseInt(invField.getText());\r\n price = Double.parseDouble(priceField.getText());\r\n max = Integer.parseInt(maxField.getText());\r\n min = Integer.parseInt(minField.getText());\r\n\r\n if (inHouseSelected) {\r\n machId = Integer.parseInt(machineOrCompanyField.getText());\r\n Part newPart = new InHouse(id, name, price, inv, min, max, machId);\r\n Inventory.addPart(newPart);\r\n } else {\r\n compName = machineOrCompanyField.getText();\r\n Part newPart = new Outsourced(id, name, price, inv, min, max, compName);\r\n Inventory.addPart(newPart);\r\n }\r\n\r\n }", "public void saveFile() {\r\n File savedFile = new File(fileName);\r\n\r\n try (FileWriter fw = new FileWriter(savedFile)) {\r\n fw.write(workSpace.getText());\r\n\r\n fw.close();\r\n } catch (IOException ex) {\r\n JOptionPane.showMessageDialog(null, \"There was an error saving the file\");\r\n }\r\n }", "@Test\n public void putStorageSameKey() {\n byte[] txDataMethodArguments = ABIUtil.encodeMethodArguments(\"putStorageSameKey\");\n AvmRule.ResultWrapper resultWrapper = avmRule.call(from, dappAddr, BigInteger.ZERO, txDataMethodArguments, energyLimit, energyPrice);\n Assert.assertTrue(resultWrapper.getReceiptStatus().isSuccess());\n Assert.assertEquals(35281 + 74 * 5 +\n RuntimeMethodFeeSchedule.BlockchainRuntime_avm_setStorage +\n 4 * RuntimeMethodFeeSchedule.BlockchainRuntime_avm_resetStorage + 500, energyLimit - resultWrapper.getTransactionResult().getEnergyRemaining());\n }", "public static Space addExistingSpace(Context context, boolean isMainSpace, String roomID) {\n\t\tSpace space = null;\n\t\ttry {\n\t\t\tspace = new Space(context, isMainSpace, roomID, false/*owner*/);\n\t\t//\tUser owner = \n\t\t\tPrivateSpaceIconView psIcon=new PrivateSpaceIconView(Space.getMainSpace().getContext(),space);\n\t\t\tspace.getSpaceController().setPSIV(psIcon);\n\t\t\tMainApplication.screen.getActivity().invalidatePSIconView(psIcon);\n\t\t\tMainApplication.screen.getActivity().invalidateSpaceView();\n\t\t\tLog.v(\"SpaceController\", \"this space has \" + space.getAllParticipants().size() + \" people\");\n\t\t\t\n\t\t} catch (XMPPException e) {\n\t\t\tLog.v(\"SpaceController\", \"Could not make an existing space for you\");\n\t\t}\n\t\treturn space;\n\t}", "public Space getSubSpace(String spaceName) {\t\n\t\treturn (Space)MappingUtil.getObject(spaceName); \n\t}", "void replaceStorage(OStorage iNewStorage);", "public void store() throws BackingStoreException {\n\t\tString timeText = time.getText();\n\t\tpreference.setDuration(timeText.isEmpty() ? 0 : Long.valueOf(time.getText()));\n\t\tpreference.setFails(fail.getSelection());\n\t\tpreference.store();\n\t}", "public static void saveSongInNewPlaylist()\n {\n int playlistNumber = (PlaylistXmlFile.getNumberOfPlaylist()+1);\n Artist artist = new Artist (\"Unknown Artist\",1);\n Song song = new Song (JSoundsMainWindowViewController.songName,artist,1,0,findGender(songName));\n PlaylistXmlFile.savePlaylistSongsInDataBase(song,playlistNumber);\n }", "@Override\r\n public void store(long key, O object) throws OBException {\n }", "protected Space getSpaceInstance(int number) throws Exception {\n Space space = new Space();\n space.setDisplayName(\"my space \" + number);\n space.setPrettyName(space.getDisplayName());\n space.setRegistration(Space.OPEN);\n space.setDescription(\"add new space \" + number);\n space.setType(DefaultSpaceApplicationHandler.NAME);\n space.setVisibility(Space.PUBLIC);\n space.setRegistration(Space.VALIDATION);\n space.setPriority(Space.INTERMEDIATE_PRIORITY);\n space.setGroupId(\"/space/space\" + number);\n space.setAvatarUrl(\"my-avatar-url\");\n String[] managers = new String[] {rootIdentity.getRemoteId()};\n String[] members = new String[] {rootIdentity.getRemoteId()};\n String[] invitedUsers = new String[] {};\n String[] pendingUsers = new String[] {};\n space.setInvitedUsers(invitedUsers);\n space.setPendingUsers(pendingUsers);\n space.setManagers(managers);\n space.setMembers(members);\n space.setUrl(space.getPrettyName());\n space.setAvatarLastUpdated(System.currentTimeMillis());\n this.spaceService.saveSpace(space, true);\n tearDownSpaceList.add(space);\n return space;\n }", "public void setStorage(com.hps.july.persistence.StoragePlaceAccessBean newStorage) {\n\tstorage = newStorage;\n}", "public void insert (String val, Node ptr) {\n\n int toIndex = findKeyIndex(val);\n\n // if not full then just insert the key\n if (!full()) {\n insertSimple(val,ptr,toIndex);\n return;\n }\n // otherwise make a new right sibling for the current node, redistribute.\n Node ns = null;\n if (toIndex>lastindex) {\n ns = new InternalNode(degree,null,val,ptr,next,(Node) this);\n } else {\n ns = new InternalNode(degree, null,keys[lastindex], ptrs[lastindex], next,(Node) this);\t\n lastindex--;\n insertSimple(val,ptr,toIndex);\n }\n\n String toParent = redistribute();\n // recursively insert into parent if exists\n if (getParent()!=null) parentref.getNode().insert(toParent, ns);\t\t\t\t\n else new InternalNode(degree,this,toParent,ns,null,null);\n }", "private Space getSpaceInstance(SpaceService spaceService, int number)\n throws Exception {\n Space space = new Space();\n space.setDisplayName(\"my space \" + number);\n space.setPrettyName(space.getDisplayName());\n space.setRegistration(Space.OPEN);\n space.setDescription(\"add new space \" + number);\n space.setType(DefaultSpaceApplicationHandler.NAME);\n space.setVisibility(Space.OPEN);\n space.setRegistration(Space.VALIDATION);\n space.setPriority(Space.INTERMEDIATE_PRIORITY);\n space.setGroupId(SpaceUtils.SPACE_GROUP + \"/\" + space.getPrettyName());\n space.setUrl(space.getPrettyName());\n String[] managers = new String[] { \"demo\", \"john\" };\n String[] members = new String[] { \"raul\", \"ghost\" };\n String[] invitedUsers = new String[] { \"mary\", \"paul\"};\n String[] pendingUsers = new String[] { \"jame\"};\n space.setInvitedUsers(invitedUsers);\n space.setPendingUsers(pendingUsers);\n space.setManagers(managers);\n space.setMembers(members);\n spaceService.saveSpace(space, true);\n return space;\n }", "public void setSpacing(double space) {\n\tthis.space = space;\n }", "public void store() {\r\n\t\tdata = busExt.get();\r\n\t}", "private void saveNewCatalog() {\n\n\t}", "public void insertSpaceport(Spaceport spaceport) throws SQLException {\r\n connection();\r\n String insert = \"insert into spaceport values (?, ?, ?);\";\r\n PreparedStatement ps = conexion.prepareStatement(insert);\r\n ps.setString(1, spaceport.getName());\r\n ps.setString(2, spaceport.getPlanet());\r\n ps.setString(3, spaceport.getGalaxy());\r\n ps.executeUpdate();\r\n ps.close();\r\n disconnect();\r\n }", "public static void gained() {\n\t\tPig.alterStorage(true);\n\t}", "public void addStorage(StackType option);", "public void save() {\n ProductData.saveData(tree);\n }", "private void save() {\r\n\t\tif (Store.save()) {\r\n\t\t\tSystem.out.println(\" > The store has been successfully saved in the file StoreData.\\n\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\" > An error occurred during saving.\\n\");\r\n\t\t}\r\n\t}", "public Space() {\n\t\tthis.id = \"\";\n\t\tthis.created = \"\";\n\t\tthis.modified = \"\";\n\t\tthis.name = \"(no name set)\";\n\t\tthis.description = \"(no description)\";\n\t\tthis.information = \"(no information)\";\n\t\tthis.parent = \"\";\n\t\tthis.shareable = true;\n\t\tthis.entities = new ArrayList<Entity>();\n\t\tthis.rules = new ArrayList<Rule>();\n\t}", "@Override\n\tpublic void setStorage() {\n\t\tcom.setStorage(\"256g SSD\");\n\t}", "public void setRootItem(Object newItem);", "private void store()\tthrows DAOSysException\t\t{\n\t\tif (_debug) System.out.println(\"AL:store()\");\n\t\tAnnualLeaseDAO dao = null;\n\t\ttry\t{\n\t\t\tdao = getDAO();\n\t\t\tdao.dbStore(getModel());\n\t\t} catch (Exception ex)\t{\n\t\t\tthrow new DAOSysException(ex.getMessage());\n\t\t}\n\t}", "public Space(int value)\n {\n this._valuesToPut = new ArrayList<>();\n this._defaultSpace = true;\n this._lock = true;\n AddValue(value);\n }", "public void addSubLocation(SubLocationHandler subLocationHandlerArray) { \n\t\tSQLiteDatabase db = this.getWritableDatabase();\n\t\tContentValues values = new ContentValues();\n\t\tvalues.put ( key_base_id, subLocationHandlerArray.base_id);\n\t\tvalues.put ( key_date_entry, subLocationHandlerArray.date_entry);\n\t\tvalues.put ( key_name, subLocationHandlerArray.name);\n\t\tvalues.put ( key_longitude, subLocationHandlerArray.longitude);\n\t\tvalues.put ( key_latitude, subLocationHandlerArray.latitude);\n\t\tvalues.put ( key_location_id, subLocationHandlerArray.location_id);\n\t\tdb.insert( table_subLocation, null, values);\n\t\tdb.close();\n\t}", "public void setSpace(Space space) {\n this.space = space;\n calculateMoves();\n }", "public void store() throws PersistenceException {\n }", "public int insert( byte[] space, int size )\n {\n caller = \"insert\";\n int position = findMemory( size );\n\n // If position = -1, then there is no available freeBlock large enough\n // to\n // Accommodate the space.\n if ( !( position == -1 ) )\n {\n // insert record at position\n for ( int i = 0; i < size; i++ )\n {\n memoryPool[position + i] = space[i];\n }\n\n // update the freeBlockList to match the updated memoryPool.\n updateFreeBlockList( position, size );\n }\n return position;\n }", "private void split(){\n // Slice horizontaly to get sub nodes width\n float subWidth = this.getBounds().width / 2;\n // Slice vertically to get sub nodes height\n float subHeight = this.getBounds().height / 2;\n float x = this.getBounds().x;\n float y = this.getBounds().y;\n int newLevel = this.level + 1;\n\n // Create the 4 nodes\n this.getNodes().add(0, new QuadTree(newLevel, new Rectangle(x + subWidth, y, subWidth, subHeight)));\n this.getNodes().add(1, new QuadTree(newLevel, new Rectangle(x, y, subWidth, subHeight)));\n this.getNodes().add(2, new QuadTree(newLevel, new Rectangle(x, y + subHeight, subWidth, subHeight)));\n this.getNodes().add(3, new QuadTree(newLevel, new Rectangle(x + subWidth, y + subHeight, subWidth, subHeight)));\n\n }", "org.landxml.schema.landXML11.TrafficVolumeDocument.TrafficVolume addNewTrafficVolume();", "public void changeSpaces(int extraSpaces) {\n int newSpaces = spaces + extraSpaces;\n //to accept the input:\n this.setSpaces(newSpaces);\n }", "public void updateStorage(Map<Resource, Integer> newStorage) {\n\n this.gameboardPanel.updateStorage(newStorage);\n\n }", "public void newFolder ()\n {\n newNode(null);\n }", "public void setSearchSpace(Dataset SearchSpace) {\r\n errorIfStarted();\r\n this.SearchSpace = new TreeSet<>(SearchSpace.getEntries());\r\n }", "@Override\n\tpublic void storeSession(IRI sessionID, OutputStream out)\n\t\t\tthrows NonReferenceableSessionException {\n\t\tOntologyStorage store = ONManager.get().getOntologyStore();\n\t\tfor (SessionOntologySpace so : getSessionSpaces(sessionID))\n\t\t\tfor (OWLOntology o : so.getOntologies())\n\t\t\t\tstore.store(o);\n\t}", "public void save() {\r\n IniReader.write(FILE_NAME, \"x\", x, \"y\", y, \"fullscreen\", fullscreen, \"controlType\", controlType, \"vol\", volMul,\r\n \"keyUpMouse\", getKeyUpMouseName(), \"keyDownMouse\", getKeyDownMouseName(), \"keyUp\", getKeyUpName(), \"keyDown\", keyDownName,\r\n \"keyLeft\", keyLeftName, \"keyRight\", keyRightName, \"keyShoot\", keyShootName, \"keyShoot2\", getKeyShoot2Name(),\r\n \"keyAbility\", getKeyAbilityName(), \"keyEscape\", getKeyEscapeName(), \"keyMap\", keyMapName, \"keyInventory\", keyInventoryName,\r\n \"keyTalk\", getKeyTalkName(), \"keyPause\", getKeyPauseName(), \"keyDrop\", getKeyDropName(), \"keySellMenu\", getKeySellMenuName(),\r\n \"keyBuyMenu\", getKeyBuyMenuName(), \"keyChangeShipMenu\", getKeyChangeShipMenuName(), \"keyHireShipMenu\", getKeyHireShipMenuName());\r\n }", "public com.walgreens.rxit.ch.cda.StrucDocSub insertNewSub(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocSub target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocSub)get_store().insert_element_user(SUB$2, i);\n return target;\n }\n }", "public String insertSub(Channel currentChannel)\n {\n return accessData.insertSub(currentChannel);\n }", "public void put(String key) {\n\t root = put(root, key, 0);\n\t }", "public RTWLocation subslot(String slot);", "private void storeSp(int s) {\n UNSAFE.putOrderedInt(this, spOffset, s);\n }", "private void saveMemory() {\n try {\n File varTmpDir = new File(\"data/\" + brainLocation + \".ser\");\n if (!varTmpDir.exists()) {\n varTmpDir.createNewFile();\n }\n FileOutputStream fileOut = new FileOutputStream(varTmpDir);\n ObjectOutputStream out = new ObjectOutputStream(fileOut);\n out.writeObject(longTermMemory);\n out.close();\n fileOut.close();\n System.out.println(\"SAVED LONG TERM MEMORIES IN \" + brainLocation);\n } catch (IOException i) {\n i.printStackTrace();\n }\n }", "public void addSubNode(StandardsNode node) {\n\t\tsubList.add(node);\n\t\tchildMap.put(((TeachersDomainStandardsNode) node).getId(), node);\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 }", "private void createNewStore(String storeName, Item item) {\n Store storeObj = new Store(storeName, null);\n item.setItemStoreId(storeObj.getStoreId());\n List<Item> itemList = new ArrayList<>();\n itemList.add(item);\n storeObj.setItems(itemList);\n storeList.add(storeObj);\n }", "private Node put(Node x, String key,Value val,int index){\n\t\t\n\t\tif(x==null) x=new Node();\n\t\t//check if you have hit the end\n\t\tif(index==key.length()){\n\t\t\tx.val=val;\n\t\t\treturn x;\n\t\t}\n\t\t\n\t\t//int pos=key.charAt(index)-48; // jaffa !! we are not just dealing with decimals.\n\t\tint pos=key.charAt(index);\n\t\tx.array[pos]=new Node();\n\t\tx.array[pos]=put(x.array[pos],key,val,(index+1));\n\t\treturn x;\n\t}", "public void add(String entry, int xposition, int yposition) throws IndexOutOfBoundsException {\n try {\n this.entries[yposition - 1][xposition - 1] = entry;\n } catch (ArrayIndexOutOfBoundsException e) {\n throw new IndexOutOfBoundsException(\"The x or y position provided must be within the the dimensions of the\"\n + \"saver table!\");\n }\n }", "@Override\n\tpublic void execute(Frame frame) {\n\t\tDSTORE._dstore(frame, 1);\n\t}", "private static void storeRectangle(Roi roi, MetadataStore store,\n int roiNum, int shape)\n {\n Rectangle bounds = roi.getBounds();\n store.setRectangleX(new Double(bounds.x), roiNum, shape);\n store.setRectangleY(new Double(bounds.y), roiNum, shape);\n store.setRectangleWidth(new Double(bounds.width), roiNum, shape);\n store.setRectangleHeight(new Double(bounds.height), roiNum, shape);\n }", "public Space getSpace() {\n return space;\n }", "@Override\n\tpublic void setStorageSpace(int amount) {\n\t\tif(network==null)return;\n\t\tnetwork.setBytesLimit(gibibytesToBytes(amount));\n\t\tNetwork.log(\"Set new storage amount\");\n\t}", "public void insert(Key key, Value value) {\r\n root.insert(key,value);\r\n size++;\r\n }", "public void subfield(char identifier, char[] data) {\n \t datafield.add(new Subfield(identifier, data));\n }", "public void setSpace(Point that){\r\n this.space = that;\r\n this.setValidMoves();\r\n }", "public void Save() {\r\n //solo se salvara el container\r\n vc.getContainer();\r\n }", "public void setSpace(int position, Box player){\r\n\t\tboard[position - 1] = player;\r\n\t\t\r\n\t}", "public void save() {\r\n\t\tGame.getInstance().getInventory().add(id);\r\n\t}", "public int getNewSpace() {\n if (!isValid()) return 0;\n int ret = 0;\n ret += (getMode().isCollection()) ? getTransportable().getSpaceTaken()\n : -getTransportable().getSpaceTaken();\n if (hasWrapped()) {\n ret += sum(wrapped, Cargo::getNewSpace);\n }\n return ret;\n }", "protected Space getSpace() {\n return space;\n }", "public abstract void split(Space s);", "public void setStorageGroup(PartialPath path) throws MetadataException {\n String[] nodeNames = path.getNodes();\n MetaFormatUtils.checkStorageGroup(path.getFullPath());\n if (nodeNames.length <= 1 || !nodeNames[0].equals(root.getName())) {\n throw new IllegalPathException(path.getFullPath());\n }\n IMNode cur = root;\n int i = 1;\n // e.g., path = root.a.b.sg, create internal nodes for a, b\n while (i < nodeNames.length - 1) {\n IMNode temp = cur.getChild(nodeNames[i]);\n if (temp == null) {\n cur.addChild(nodeNames[i], new InternalMNode(cur, nodeNames[i]));\n } else if (temp.isStorageGroup()) {\n // before create database, check whether the database already exists\n throw new StorageGroupAlreadySetException(temp.getFullPath());\n }\n cur = cur.getChild(nodeNames[i]);\n i++;\n }\n\n // synchronize check and add, we need addChild operation be atomic.\n // only write operations on mtree will be synchronized\n synchronized (this) {\n if (cur.hasChild(nodeNames[i])) {\n // node b has child sg\n if (cur.getChild(nodeNames[i]).isStorageGroup()) {\n throw new StorageGroupAlreadySetException(path.getFullPath());\n } else {\n throw new StorageGroupAlreadySetException(path.getFullPath(), true);\n }\n } else {\n IStorageGroupMNode storageGroupMNode =\n new StorageGroupMNode(\n cur, nodeNames[i], CommonDescriptor.getInstance().getConfig().getDefaultTTLInMs());\n\n IMNode result = cur.addChild(nodeNames[i], storageGroupMNode);\n\n if (result != storageGroupMNode) {\n throw new StorageGroupAlreadySetException(path.getFullPath(), true);\n }\n }\n }\n }", "public void setSpace(int location, Space space) {\n\t\tboardArray.set(location, space);\n\t}", "public void store(String namespace, String id, long version, String content) throws StageException;", "public static void putStation(String key, JSONArray entry){\n\t\tJSON.put(radioStationsMap, key, entry);\n\t}", "private String getKeySpace()\r\n\t\t{\r\n\t\t\tString firstKey;\r\n\t\t\tString lastKey;\r\n\t\t\tif (incompleteKeySpaces.isEmpty())\r\n\t\t\t{\r\n\t\t\t\trunningKeySpaces.add(highestKey);\r\n\t\t\t\tfirstKey = highestKey.toString();\r\n\t\t\t\thighestKey = highestKey.add(keySpaceSize);\r\n\t\t\t\tlastKey = highestKey.toString();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\trunningKeySpaces.add(incompleteKeySpaces.get(0));\r\n\t\t\t\tfirstKey = incompleteKeySpaces.get(0).toString();\r\n\t\t\t\tlastKey = incompleteKeySpaces.get(0).add(keySpaceSize).toString();\r\n\t\t\t\tincompleteKeySpaces.remove(0);\r\n\t\t\t}\r\n\t\t\tlog(\"Assigning keyspace: \" + firstKey);\r\n\t\t\treturn firstKey + \",\" + lastKey;\r\n\t\t}", "private void subDivideNode() {\n setOriginNode();\n _subdivided = true;\n _northWest = new QuadTree<Point>(getView(), _transitionSize);\n _northEast = new QuadTree<Point>(getView(), _transitionSize);\n _southWest = new QuadTree<Point>(getView(), _transitionSize);\n _southEast = new QuadTree<Point>(getView(), _transitionSize);\n Iterator<Point> it = _elements.iterator();\n while (it.hasNext()) {\n Point p = it.next();\n QuadTree<Point> qt = quadrant(p);\n qt.add(p);\n }\n _elements = null;\n _elementsSize = 0;\n }", "public void store(final String text, final String variableName);", "private void saveCurrentObject() {\n\t}", "public boolean hasSpace() {\r\n\t\treturn hasSpace;\r\n\t}", "public void appendNewShop(Shop newShop) {\n shops.add(newShop);\n }", "public void setStorageplace( int newValue ) {\n __setCache(\"storageplace\", new Integer(newValue));\n }", "public boolean put(int key, String value) {\n\t\t//YOUR CODE HERE\n\t\tif(root == null) {\n\t\t\tLeafNode leaf = new LeafNode(key, value);\n\t\t\troot = leaf;\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\tPair pair = add(key, value, this.root);\n\t\t\tif(pair != null) {\n\t\t\t\tInternalNode node = new InternalNode();\n\t\t\t\tnode.size = 1;\n\t\t\t\tnode.children[0] = root;\n\t\t\t\tnode.keys[1] = pair.newKey;\n\t\t\t\tnode.children[1] = pair.rightChild;\n\t\t\t\tthis.root = node;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public void store(final CastorConnection conn, final Identity identity,\r\n final ProposedEntity newentity,\r\n final ProposedEntity oldentity)\r\n throws PersistenceException {\n if (identity.size() != _ids.length) {\r\n throw new PersistenceException(\"Size of identity field mismatched!\");\r\n }\r\n\r\n _storeStatement.executeStatement(conn, identity, newentity, oldentity);\r\n\r\n // Must store values of whole extends hierarchy\r\n if (_extends != null) {\r\n _extends.store(conn, identity, newentity, oldentity);\r\n }\r\n }", "public void store(Item item) {\n this.items.add(item);\n }" ]
[ "0.5537048", "0.54188204", "0.53972304", "0.5340573", "0.5313366", "0.5242609", "0.50615674", "0.5051019", "0.504971", "0.5026851", "0.49915794", "0.4978384", "0.49736872", "0.49702793", "0.49139914", "0.48939186", "0.48285785", "0.4815401", "0.48065665", "0.48029345", "0.4799017", "0.47691938", "0.47650445", "0.4764781", "0.47625482", "0.4760519", "0.47325885", "0.4719328", "0.47149342", "0.46972618", "0.4650784", "0.46360904", "0.4626907", "0.46133992", "0.461124", "0.46082795", "0.45984837", "0.45874718", "0.45870155", "0.4583105", "0.45800585", "0.45798078", "0.45518202", "0.45365888", "0.45326155", "0.45256415", "0.45151433", "0.4496292", "0.44856262", "0.4480933", "0.44808307", "0.44790298", "0.4475018", "0.4473809", "0.44504684", "0.4444517", "0.4434107", "0.4424763", "0.4424069", "0.4423501", "0.4423073", "0.4419818", "0.44182217", "0.4415355", "0.44147974", "0.44131857", "0.44125867", "0.44078588", "0.4407423", "0.44064954", "0.44043002", "0.44030815", "0.4402699", "0.43986338", "0.43966913", "0.4396637", "0.4393537", "0.4393464", "0.43909308", "0.43892", "0.4383255", "0.43782702", "0.43766496", "0.437206", "0.4371361", "0.4369374", "0.43687242", "0.43661907", "0.43626928", "0.43597397", "0.4354704", "0.4353401", "0.4352643", "0.43478718", "0.43441695", "0.4341682", "0.43400234", "0.4338426", "0.4335851", "0.43287754" ]
0.46650493
30
Returns the database path.
public String getPath() { return this.path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getDatabaseDirectoryPath();", "public static String getPathDB() {\n return pathDB;\n }", "public String getDbpath() {\n return dbpath;\n }", "String getDbPath(String dbName);", "public String getPath() { return db.getPath(); }", "private static String getDBPath() {\r\n\t\ttry {\r\n\t\t\tString path = Consts.class.getProtectionDomain().getCodeSource().getLocation().getPath();\r\n\t\t\tString decoded = URLDecoder.decode(path, \"UTF-8\");\r\n\t\t\tif (decoded.contains(\".jar\")) {\r\n\t\t\t\tdecoded = decoded.substring(0, decoded.lastIndexOf('/'));\r\n\t\t\t\treturn decoded + \"/database/ManageElectDB.accdb\";\r\n\t\t\t} else {\r\n\t\t\t\tdecoded = decoded.substring(0, decoded.lastIndexOf(\"bin/\"));\r\n\t\t\t\treturn decoded + \"src/entity/ManageElectDB.accdb\";\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public String getDbPath() {\r\n return dbPath;\r\n }", "public String getDatabaseFileName();", "public String getDatabase() {\r\n \t\treturn properties.getProperty(KEY_DATABASE);\r\n \t}", "private String db4oDBFullPath(Context ctx) {\t\n\t\treturn ctx.getDir(\"data\", 0) + \"/\" + LOCAL_SERVER;\n\t\n\t}", "private String getDatabaseFilePath(NotesDatabase db) {\n try {\n return db.getFilePath();\n } catch (RepositoryException ex) {\n LOGGER.log(Level.WARNING, \"Unable to retrieve database's file path\", ex);\n return null;\n }\n }", "String getUserDatabaseFilePath();", "private String findCurrentDBPath(){\n String startingDir = System.getProperty(\"user.dir\");\t\t\t\t//get starting directory\n File database = new File(startingDir + \"/src/currentDatabase.txt\");\n String currentDatabasePath= null;\n try {\n if (database.exists()) {\n BufferedReader reader = new BufferedReader(new FileReader(database));\n String currentLine;\n while ((currentLine = reader.readLine()) != null) {\n currentDatabasePath = startingDir + \"/src/\" + currentLine.trim().toUpperCase();\n }\n reader.close();\n }\n else{\n System.out.println(\"***Error- currentDatabase.txt file doesn't exits.\");\n }\n }\n catch(Exception ex){\n System.out.println(ex);\n }\n return currentDatabasePath ;\n }", "java.lang.String getDatabaseName();", "java.lang.String getDatabaseName();", "java.lang.String getDatabaseName();", "java.lang.String getDatabaseName();", "public static String getDatabase() {\r\n return database;\r\n }", "public String getFriendsDatabasePath();", "public String getDatabaseLocation() {\n return txtDatabaseLocation().getText();\n }", "public String getDatabase();", "String getDatabase();", "public String getSqlPath() {\n return (String) get(4);\n }", "public static String getDatabaseExportDirectory() {\n\t\tif (xml == null) return \"\";\n\t\treturn databaseExportDir;\n\t}", "public String getDatabase() {\r\n return Database;\r\n }", "public String getDbName();", "public String getDB() {\n return database;\n }", "public String getDatabase() {\n return this.database;\n }", "protected String getDatabaseName() {\n\t\treturn database;\n\t}", "public String databaseName();", "public String getDb() {\n return db;\n }", "public String getDb() {\n return db;\n }", "public String getDB() {\n\t\treturn db;\r\n\t}", "@Override\n public String getDatabaseName() {\n return mappings.getDatabaseName();\n }", "public static File getDBPath(ConfigurationSource conf, String key) {\n final File dbDirPath =\n getDirectoryFromConfig(conf, key, \"OM\");\n if (dbDirPath != null) {\n return dbDirPath;\n }\n\n LOG.warn(\"{} is not configured. We recommend adding this setting. \"\n + \"Falling back to {} instead.\", key,\n HddsConfigKeys.OZONE_METADATA_DIRS);\n return ServerUtils.getOzoneMetaDirPath(conf);\n }", "public String getDatabase()\n {\n return m_database; \n }", "public String getDbName() {\r\n\t\tif (this.dbname == null)\r\n\t\t\treturn null;\r\n\r\n\t\treturn (String) this.dbname.getSelectedItem();\r\n\t}", "public abstract String getDatabaseName();", "public String getDatabaseName() {\n return dbName;\n }", "public String getDatabaseName() {\n return txtDatabaseName().getText();\n }", "public String getCallLogsDatabasePath();", "public static String getDatabaseURL(){\n return databaseURL;\n }", "public String getDatabaseName () {\n return databaseName;\n }", "public java.lang.String getDatabaseName() {\n java.lang.Object ref = databaseName_;\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 databaseName_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getDatabaseName() {\n java.lang.Object ref = databaseName_;\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 databaseName_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getDatabaseName() {\n java.lang.Object ref = databaseName_;\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 databaseName_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getDatabaseName() {\n java.lang.Object ref = databaseName_;\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 databaseName_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getSyslogPath() {\n return LoggerApplication.getInstance().getLogPath()+\"/db/\"+this.getName()+\"/\";\n }", "public String getDatabaseName()\n {\n return \"assetdr\";\n }", "public String getDatabaseName() {\n return databaseName;\n }", "Database getDataBase() {\n return database;\n }", "public static String getConnectionDB(){\n return \"jdbc:mysql://\" + hostname +\":\"+ port+\"/\" + database;\n }", "public String databaseName() {\n return this.databaseName;\n }", "public String getDatabaseName() {\n return this.databaseName;\n }", "public String getDatabaseName(){\n\treturn strDbName;\n }", "private String getDataDirectory() {\n Session session = getSession();\n String dataDirectory;\n try {\n dataDirectory = (String) session.createSQLQuery(DATA_DIRECTORY_QUERY).list().get(0);\n } finally {\n releaseSession(session);\n }\n return dataDirectory;\n }", "@Deprecated\n public String getChatDatabasePath();", "private String getPhysicalDbName() {\n String pdbName =TestConfiguration.getCurrent().getJDBCUrl();\n if (pdbName != null)\n pdbName=pdbName.substring(pdbName.lastIndexOf(\"oneuse\"),pdbName.length());\n else {\n // with JSR169, we don't *have* a protocol, and so, no url, and so\n // we'll have had a null.\n // But we know the name of the db is something like system/singleUse/oneuse#\n // So, let's see if we can look it up, if everything's been properly\n // cleaned, there should be just 1...\n pdbName = (String) AccessController.doPrivileged(new java.security.PrivilegedAction() {\n String filesep = getSystemProperty(\"file.separator\");\n public Object run() {\n File dbdir = new File(\"system\" + filesep + \"singleUse\");\n String[] list = dbdir.list();\n // Some JVMs return null for File.list() when the directory is empty\n if( list != null)\n {\n if(list.length > 1)\n {\n for( int i = 0; i < list.length; i++ )\n {\n if(list[i].indexOf(\"oneuse\")<0)\n continue;\n else\n {\n return list[i];\n }\n }\n // give up trying to be smart, assume it's 0\n return \"oneuse0\";\n }\n else\n return list[0];\n }\n return null;\n }\n });\n \n }\n return pdbName;\n }", "public static File getDatabaseExportDirectoryFile() {\n\t\tif (xml == null) return null;\n\t\treturn new File(basepath + databaseExportDir);\n\t}", "@java.lang.Override\n public java.lang.String getDatabaseName() {\n java.lang.Object ref = databaseName_;\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 databaseName_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getDatabaseName() {\n java.lang.Object ref = databaseName_;\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 databaseName_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getDatabaseName() {\n java.lang.Object ref = databaseName_;\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 databaseName_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getDatabaseName() {\n java.lang.Object ref = databaseName_;\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 databaseName_ = s;\n return s;\n }\n }", "public static void setDatabasePath(String filename) {\r\n databasePath = filename;\r\n database = new File(databasePath);\r\n }", "public String getDbName() {\n return dbName;\n }", "public String getDbName() {\n return dbName;\n }", "com.google.protobuf.ByteString\n getDatabaseNameBytes();", "com.google.protobuf.ByteString\n getDatabaseNameBytes();", "com.google.protobuf.ByteString\n getDatabaseNameBytes();", "com.google.protobuf.ByteString\n getDatabaseNameBytes();", "public static String getDbConfig(){\n return properties.getProperty(\"dbconfig\");\n }", "public String getMySQLDatabase() throws GuacamoleException {\n return getRequiredProperty(MySQLGuacamoleProperties.MYSQL_DATABASE);\n }", "public void setDbpath(String dbpath) {\n this.dbpath = dbpath;\n }", "public String getDataBaseName() {\r\n\t\treturn dataBaseName + \".db\";\r\n\t}", "@Nullable\n String getDefaultDatabase() throws CatalogException;", "public String getCurrentPath() {\n\t\treturn DataManager.getCurrentPath();\n\t}", "private String getPath() {\n\t\treturn context.getRealPath(\"WEB-INF/ConnectionData\");\n\t}", "private String getPath() {\n\t\treturn context.getRealPath(\"WEB-INF/ConnectionData\");\n\t}", "private String getPath() {\n\t\treturn context.getRealPath(\"WEB-INF/ConnectionData\");\n\t}", "private String getPath() {\n\t\treturn context.getRealPath(\"WEB-INF/ConnectionData\");\n\t}", "private File getAppDatabaseFile() {\n Log.i(\"getAppDatabase\", \"Getting app database\");\n try {\n File file = new File(this.context.getFilesDir(), SecretConstants.DATABASE_NAME);\n Log.i(\"getAppDatabase\", \"File name: \" + file.getName());\n FileOutputStream outputStream = new FileOutputStream(file);\n DropboxAPI.DropboxFileInfo info =\n MainActivity.mDBApi.getFile(file.getName(), null, outputStream, null);\n Log.i(\"getAppDatabase\", \"The file's rev is: \" + info.getMetadata().rev);\n return file;\n } catch (Exception e) {\n Log.e(\"getAppDatabase\", e.toString(), e);\n }\n return null;\n }", "public Driving getDB() {\n\t\treturn this.db;\n\t}", "String getVirtualDatabaseName() throws Exception;", "public static String getAdbLocation() {\n return \"adb\";\n }", "public String getDbName() {\n\t\treturn mDbName;\n\t}", "private String getPath() {\r\n\t\t\treturn context.getRealPath(\"WEB-INF/ConnectionData\");\r\n\t\t}", "@java.lang.Override\n public com.google.protobuf.ByteString\n getDatabaseNameBytes() {\n java.lang.Object ref = databaseName_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n databaseName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getDatabaseNameBytes() {\n java.lang.Object ref = databaseName_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n databaseName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getDatabaseNameBytes() {\n java.lang.Object ref = databaseName_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n databaseName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getDatabaseNameBytes() {\n java.lang.Object ref = databaseName_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n databaseName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public void setDatabaseDir(String databaseDir){\n this.databaseDir =databaseDir;\n }", "public com.google.protobuf.ByteString\n getDatabaseNameBytes() {\n java.lang.Object ref = databaseName_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n databaseName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getDatabaseNameBytes() {\n java.lang.Object ref = databaseName_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n databaseName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getDatabaseNameBytes() {\n java.lang.Object ref = databaseName_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n databaseName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getDatabaseNameBytes() {\n java.lang.Object ref = databaseName_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n databaseName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public Database getDatabase() {\n return dbHandle;\n }", "public Database getDatabase() {\n\t\treturn this.database;\n\t}", "public String getLocalBasePath() {\n\t\treturn DataManager.getLocalBasePath();\n\t}", "public File getOutputDb();", "public DB getDatabase(){\n\t\treturn database;\n\t}", "java.lang.String getDatabaseId();" ]
[ "0.82793695", "0.81663585", "0.79991955", "0.79234576", "0.7828631", "0.7676649", "0.7605234", "0.760484", "0.7313985", "0.72701347", "0.7267528", "0.7263885", "0.7102486", "0.70391595", "0.70391595", "0.70391595", "0.70391595", "0.6982891", "0.6929933", "0.6884172", "0.68596596", "0.68440664", "0.68281764", "0.66828907", "0.6632731", "0.66318405", "0.65735924", "0.6570161", "0.6459341", "0.64183396", "0.64079386", "0.64079386", "0.6325164", "0.6270449", "0.62174094", "0.6216584", "0.6208", "0.6202871", "0.61830807", "0.6168216", "0.61583126", "0.6156994", "0.61435574", "0.61341304", "0.61341304", "0.61341304", "0.61341304", "0.6133436", "0.61276037", "0.6118542", "0.60437536", "0.603365", "0.60330075", "0.6030924", "0.6023707", "0.6017648", "0.6009087", "0.6007873", "0.59968", "0.59440726", "0.59440726", "0.59440726", "0.59440726", "0.5933328", "0.59215164", "0.59215164", "0.59214306", "0.59214306", "0.59214306", "0.59214306", "0.5906669", "0.589543", "0.5895351", "0.5870294", "0.58681256", "0.5855846", "0.58410734", "0.58410734", "0.58410734", "0.58410734", "0.58363247", "0.5833907", "0.5823981", "0.58208406", "0.5801871", "0.57806844", "0.577847", "0.577847", "0.577847", "0.577847", "0.5778044", "0.5776409", "0.5776409", "0.5776409", "0.5776409", "0.57763517", "0.57659346", "0.57582873", "0.5724111", "0.5712081", "0.5711338" ]
0.0
-1
Updates min/max values of all features
public void updateFeaturesMinMax() throws DatabaseAccessException { Statement stmt; ResultSet rs; try { stmt = this.connection.createStatement(); rs = stmt.executeQuery("SELECT Id FROM Features;"); ArrayList<Integer> featureIds = new ArrayList<Integer>(); while (rs.next()) { featureIds.add(rs.getInt("Id")); } stmt.close(); for (Integer id : featureIds) { stmt = this.connection.createStatement(); rs = stmt.executeQuery("SELECT MIN(\"" + id + "\"), MAX(\"" + id + "\") FROM Objects;"); float min = rs.getFloat(1); float max = rs.getFloat(2); rs.close(); stmt.close(); PreparedStatement prepStmt = this.connection .prepareStatement("UPDATE Features SET Min=?, Max=? WHERE Id=?"); prepStmt.setFloat(1, min); prepStmt.setFloat(2, max); prepStmt.setInt(3, id); prepStmt.execute(); prepStmt.close(); } } catch (SQLException ex) { throw new DatabaseAccessException(Failure.WRITE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateMinMax( ) {\r\n if( (data == null) || (data.size() < 1) ) {\r\n min = 0.0;\r\n max = 0.0;\r\n return;\r\n }\r\n\r\n min = data.get( 0 );\r\n max = data.get( 0 );\r\n\r\n for( int i = 1; i < data.size(); i++ ) {\r\n if( min > data.get( i ) )\r\n min = data.get( i );\r\n if( max < data.get( i ) )\r\n max = data.get( i );\r\n }\r\n\r\n }", "private void updateMinMax(Instance instance){\n\n for (int j = 0; j < m_Train.numAttributes(); j++) {\n if(m_Train.classIndex() == j || m_Train.attribute(j).isNominal())\n\tcontinue;\n if (instance.value(j) < m_MinArray[j]) \n\tm_MinArray[j] = instance.value(j);\n if (instance.value(j) > m_MaxArray[j])\n\tm_MaxArray[j] = instance.value(j);\n } \n }", "@Override\r\n public void setMinMax(Double min, Double max) {\r\n this.minIn = min;\r\n this.maxIn = max;\r\n }", "public void allMinMax() {\n\t\tthis.theMaxX();\n\t\tthis.theMinX();\n\t\tthis.theMaxY();\n\t\tthis.theMinY();\n\t}", "@Override public void setMinMax(float minValue, float maxValue) {\n this.valueTrack.min = minValue; this.valueTrack.max = maxValue;\n }", "private void updateEncoders(){\r\n \r\n double min = Double.MAX_VALUE;\r\n double max = Double.MIN_VALUE;\r\n \r\n for(Encoder<T> encoder : encoders){\r\n if(encoder instanceof SimpleEncoder){\r\n SimpleEncoder<T> simpleEncoder = (SimpleEncoder<T>) encoder;\r\n if(simpleEncoder.getMin() < min)\r\n min = simpleEncoder.getMin();\r\n \r\n if(max < simpleEncoder.getMax())\r\n max=simpleEncoder.getMax();\r\n \r\n }\r\n }\r\n \r\n for(Encoder<T> encoder : encoders){\r\n if(encoder instanceof SimpleEncoder){\r\n SimpleEncoder<T> simpleEncoder = (SimpleEncoder<T>) encoder;\r\n simpleEncoder.setMin(min);\r\n simpleEncoder.setMax(max);\r\n }\r\n }\r\n \r\n }", "public void initMaxMin(){\n\t\tmax = dja.max();\n\t\tmin = dja.min();\n\t}", "public void setValues(float minValue, float maxValue) {\n _minValue = minValue;\n _maxValue = maxValue;\n _min.setValue(_minValue);\n _max.setValue(_maxValue);\n }", "public void setMinMax(double min, double max)\n {\n if (max == min)\n throw new IllegalArgumentException(\"Max value must be bigger than Min value!\");\n\n this.min = min;\n this.max = max;\n if (max < min)\n {\n this.max = min;\n this.min = max;\n }\n }", "@Override\n public void synchronizeMinMaxNFreshs() {\n\t\n }", "protected void calcMinMax() {\n }", "void setValues(final T value, final T min, final T max)\n {\n setValue(value, valueLabel);\n setValue(min, minValueLabel);\n setValue(max, maxValueLabel);\n }", "protected void updateValues(){\n double total = 0;\n for(int i = 0; i < values.length; i++){\n values[i] = \n operation(minimum + i * (double)(maximum - minimum) / (double)numSteps);\n \n total += values[i];\n }\n for(int i = 0; i < values.length; i++){\n values[i] /= total;\n }\n }", "public void setXDataRange(float min, float max);", "public void setValues(ArrayList<Double> allValues)\n {\n this.minimumValue = getMinNumber(allValues);\n this.maximumValue = getMaxNumber(allValues);\n this.allValues = allValues;\n }", "public void setRange(double min, double max) {\n super.setRange(min, max);\n }", "public void update() {\n\t\tif (max == null || max.length < info.size())\r\n\t\t\tmax = info.stream().mapToInt(i -> Math.max(1, i[1])).toArray();\r\n\r\n\t\tfull = improve(max);\r\n\t}", "public void initialiseExtremeValues() {\n for (int i = 0; i < numberOfObj; i++) {\n minimumValues[i] = Double.MAX_VALUE;\n maximumValues[i] = -Double.MAX_VALUE;\n }\n }", "@Override\n public double[] getMinMax() {\n if ( minMax == null ) {\n calculateMinMaxPositions();\n }\n return minMax;\n }", "@Override\n public FeatureValue updateAggrFeature(\n AggregatedFeatureConf aggregatedFeatureConf,\n Map<String, Feature> features,\n Feature aggrFeature) {\n if (aggregatedFeatureConf == null || features == null) return aggrFeature.getValue();\n // Extract the name of the field that needs to be maximized.\n String maximizeFieldName = extractMaximizeFieldName(aggregatedFeatureConf);\n // Extract the value of the record's maximize field.\n Double maximizeFieldValue = extractMaximizeFieldValue(maximizeFieldName, features);\n // If the maximize field value is null, return the original aggregated feature.\n if (maximizeFieldValue == null) return aggrFeature.getValue();\n // Extract the original maximum value.\n Double maximumValue = extractMaximumValue(aggrFeature);\n\n if (maximumValue == null || maximumValue < maximizeFieldValue) {\n List<String> contextFieldNames = extractContextFieldNames(aggregatedFeatureConf);\n MultiKeyFeature multiKeyFeature = new MultiKeyFeature();\n contextFieldNames.forEach(contextFieldName -> {\n Feature feature = features.get(contextFieldName);\n FeatureValue contextFieldValue = feature == null ? null : feature.getValue();\n multiKeyFeature.add(contextFieldName, contextFieldValue == null ? null : contextFieldValue.toString());\n });\n MultiKeyHistogram multiKeyHistogram = new MultiKeyHistogram();\n multiKeyHistogram.set(multiKeyFeature, maximizeFieldValue);\n aggrFeature.setValue(multiKeyHistogram);\n return multiKeyHistogram;\n } else {\n return aggrFeature.getValue();\n }\n }", "private void updateValue() {\n int minValue = 100; //Minimum value to be calculated, initialized to a large number\n value = 0; //Value reinitialized to 0\n for (Integer i : values) {\n if (i > value && i <= 21) {\n value = i; //Sets value to maximum value less than or equal to 21\n }\n if (i < minValue) {\n minValue = i; //Sets minimum value to lowest value in the list\n }\n }\n if (value == 0) {\n value = minValue; //Sets value to minValue if no values 21 or less\n }\n valueLabel.setText(\"Value: \" + value); //Sets text of value label\n if (value > 21) {\n bust(); //Busts if value greater than 21\n }\n }", "private int[] findMinMax(ArrayList<ArrayList<Integer>> objects, int featureNo) {\n\t\t\tint max = Integer.MIN_VALUE;\n\t\t\tint min = Integer.MAX_VALUE;\n\t\t\t\n\t\t\tfor(int b = 0; b < objects.size(); b++){\n\t\t\t\t\n\t\t\t\tmax = Math.max(objects.get(b).get(featureNo) , max);\n\t\t\t\tmin = Math.min(objects.get(b).get(featureNo) , min);\n\t\t\t}\n\t\t\t\n\t\t\treturn new int[]{max,min};\n\t\t}", "private void setStartValues() {\n startValues = new float[9];\n mStartMatrix = new Matrix(getImageMatrix());\n mStartMatrix.getValues(startValues);\n calculatedMinScale = minScale * startValues[Matrix.MSCALE_X];\n calculatedMaxScale = maxScale * startValues[Matrix.MSCALE_X];\n }", "public void setBounds(Double min, Double max) {\n Double aMin = Math.min(min, max);\n Double aMax = Math.max(min, max);\n if (aMin != this.min || aMax != this.max) {\n super.setMinimum(aMin);\n super.setMaximum(aMax);\n }\n fireStateChanged();\n }", "protected void calcMinMax() {\n if (this.mDataSets != null) {\n T t;\n this.mYMax = -3.4028235E38f;\n this.mYMin = Float.MAX_VALUE;\n this.mXMax = -3.4028235E38f;\n this.mXMin = Float.MAX_VALUE;\n Iterator<T> iterator = this.mDataSets.iterator();\n while (iterator.hasNext()) {\n this.calcMinMax((IDataSet)iterator.next());\n }\n this.mLeftAxisMax = -3.4028235E38f;\n this.mLeftAxisMin = Float.MAX_VALUE;\n this.mRightAxisMax = -3.4028235E38f;\n this.mRightAxisMin = Float.MAX_VALUE;\n T t2 = this.getFirstLeft(this.mDataSets);\n if (t2 != null) {\n this.mLeftAxisMax = t2.getYMax();\n this.mLeftAxisMin = t2.getYMin();\n for (IDataSet iDataSet : this.mDataSets) {\n if (iDataSet.getAxisDependency() != YAxis.AxisDependency.LEFT) continue;\n if (iDataSet.getYMin() < this.mLeftAxisMin) {\n this.mLeftAxisMin = iDataSet.getYMin();\n }\n if (!(iDataSet.getYMax() > this.mLeftAxisMax)) continue;\n this.mLeftAxisMax = iDataSet.getYMax();\n }\n }\n if ((t = this.getFirstRight(this.mDataSets)) != null) {\n this.mRightAxisMax = t.getYMax();\n this.mRightAxisMin = t.getYMin();\n for (IDataSet iDataSet : this.mDataSets) {\n if (iDataSet.getAxisDependency() != YAxis.AxisDependency.RIGHT) continue;\n if (iDataSet.getYMin() < this.mRightAxisMin) {\n this.mRightAxisMin = iDataSet.getYMin();\n }\n if (!(iDataSet.getYMax() > this.mRightAxisMax)) continue;\n this.mRightAxisMax = iDataSet.getYMax();\n }\n }\n }\n }", "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 void setYDataRange(float min, float max);", "private void setSpeedValues(){\n minSpeed = trackingList.get(0).getSpeed();\n maxSpeed = trackingList.get(0).getSpeed();\n averageSpeed = trackingList.get(0).getSpeed();\n\n double sumSpeed =0.0;\n for (TrackingEntry entry:trackingList) {\n\n sumSpeed += entry.getSpeed();\n\n //sets min Speed\n if (minSpeed > entry.getSpeed()){\n minSpeed = entry.getSpeed();\n }\n //sets max Speed\n if (maxSpeed < entry.getSpeed()) {\n maxSpeed = entry.getSpeed();\n }\n\n }\n\n averageSpeed = sumSpeed/trackingList.size();\n }", "public void fillVector(){\n int n = min.length;\n for (int i = 0; i < n; i++) {\n this.x[i] = min.x[i] + (max.x[i] - min.x[i])*rn.uniformDeviate();\n }\n }", "public void changeBounds(Point3D minDelta, Point3D maxDelta) {\n this.minBounds = this.minBounds.add(minDelta);\n this.maxBounds = this.maxBounds.add(maxDelta);\n\n if (minBounds == NO_MIN_BOUNDS) {\n this.minBounds = minDelta;\n }\n if (maxBounds == NO_MAX_BOUNDS) {\n this.maxBounds = maxDelta;\n }\n }", "private void setMinMax(List<IBasicExplanation> explanationList){\n\t\t\tminSE = scoringFunction.getScore(explanationList.get(0));\n\t\t\tmaxSE = scoringFunction.getScore(explanationList.get(explanationList.size() - 1));\n\t\t}", "public void refresh(){\n\t\tint i=0;\n\t\tEntity editedEntity=getEditedEntity();\n\t\tfor(FloatTrait t:swat.dk.getTraits(tt)){\n\t\t\t((Swat.Slider)((JComponent)slidersPanel.getComponent(i)).getComponent(1)).mSetValue(toSlider(getValue(editedEntity,t)));\n\t\t\ti++;\n\t\t}\n\t}", "private void findMinandMaxValues(SparklineValues values) {\n minY = values.getValues().stream().filter(value -> value.getValue() != null).mapToDouble(SparklineValues.SparklineValue::getValue).min().orElse(0.0);\n maxY = values.getValues().stream().filter(value -> value.getValue() != null).mapToDouble(SparklineValues.SparklineValue::getValue).max().orElse(0.0);\n\n if (Math.abs(minY) > 1E30 || Math.abs(maxY) > 1E30) {\n // something is probably wrong\n System.out.println(\"Unexpectedly small/large min or max: \");\n values.getValues().forEach(value -> {\n System.out.print(value.getValue() + \" \");\n });\n System.out.println();\n minY = -1.0;\n maxY = 1.0;\n }\n\n if (minY.equals(maxY)) {\n if (minY.equals(0.0)) {\n minY = -1.0;\n maxY = 1.0;\n } else {\n minY = minY - 0.1 * Math.abs(minY);\n maxY = maxY + 0.1 * Math.abs(maxY);\n }\n }\n }", "private void setAltitudeValues(){\n minAlt = trackingList.get(0).getAltitude();\n maxAlt = trackingList.get(0).getAltitude();\n averageAlt = trackingList.get(0).getAltitude();\n\n double sumAlt =0.0;\n\n for (TrackingEntry entry:trackingList) {\n\n sumAlt += entry.getAltitude();\n\n //sets min Speed\n if (minAlt > entry.getAltitude()){\n minAlt = entry.getAltitude();\n }\n //sets max Speed\n if (maxAlt < entry.getAltitude()) {\n maxAlt = entry.getAltitude();\n }\n\n }\n averageAlt = sumAlt/trackingList.size();\n }", "void update(double temperature, double maxTemperature, double minTemperature, int humidity);", "public void normalize() {\n // determine the maximum value\n \n Double max = getMaxValue();\n \n if(max!=null) {\n normalize(max);\n }\n }", "public MaxAndMin(){\n this.list=new ListOfData().getData();\n }", "public void setMax(){\n for (int i = 0; i < Nodes.size(); i++){\n this.MinDistance.add(Double.MAX_VALUE);\n }\n }", "private void normalize() {\r\n // GET MAX PRICE \r\n for (Alternative alt : alternatives) {\r\n if (alt.getPrice() > 0 && alt.getPrice() < minPrice) {\r\n minPrice = alt.getPrice();\r\n }\r\n }\r\n\r\n for (Alternative alt : alternatives) {\r\n // NORMALIZE PRICE - NON BENIFICIAL using max - min \r\n double price = alt.getPrice();\r\n double value = minPrice / price;\r\n alt.setPrice(value);\r\n // BENITIFICIAL v[i,j] = x[i,j] / x[max,j]\r\n double wood = alt.getWood();\r\n value = wood / maxWood;\r\n alt.setWood(value);\r\n\r\n double brand = alt.getBrand();\r\n value = wood / maxBrand;\r\n alt.setBrand(value);\r\n\r\n double origin = alt.getOrigin();\r\n value = origin / maxOrigin;\r\n alt.setOrigin(value);\r\n\r\n }\r\n }", "@Override\r\n public void map(Double minX, Double maxX, Double minY, Double maxY) {\r\n this.minX = minX;\r\n this.maxX = maxX;\r\n this.minY = minY;\r\n this.maxY = maxY;\r\n }", "public void setPowerRange(double min, double max) {\n\t\tsetOutputRange(new APPDriveData(min, 0, 0), new APPDriveData(max, 0, 0),\n\t\t\t\t(data1, data2) -> Double.compare(data1.power, data2.power));\n\t}", "private void onChange() {\n startTime = -1L;\n endTime = -1L;\n minLat = Double.NaN;\n maxLat = Double.NaN;\n minLon = Double.NaN;\n maxLon = Double.NaN;\n }", "public void setDistanceRange( float min_distance, float max_distance )\n {\n if ( min_distance > max_distance )\n {\n float temp = min_distance;\n min_distance = max_distance;\n max_distance = temp;\n }\n\n if ( min_distance == max_distance )\n max_distance = min_distance + 1;\n\n distance_slider.setMinimum( (int)(DISTANCE_SCALE_FACTOR * min_distance) );\n distance_slider.setMaximum( (int)(DISTANCE_SCALE_FACTOR * max_distance) );\n }", "public synchronized void setTargetRange(double minTarget, double maxTarget)\n {\n final String funcName = \"setTargetRange\";\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API, \"min=%f,max=%f\", minTarget, maxTarget);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API);\n }\n\n this.minTarget = minTarget;\n this.maxTarget = maxTarget;\n }", "private void calculateMaxTemperatureNormalisation() {\n maxTemperatureNormalisation = (temperatureMax - temperatureMin) / 2;\n }", "private void calculateMinMaxPositions() {\n boundingVolume = null;\n if ( minMax == null ) {\n minMax = new double[6];\n\n double minX = Double.MAX_VALUE;\n double minY = Double.MAX_VALUE;\n double minZ = Double.MAX_VALUE;\n double maxX = -Double.MAX_VALUE;\n double maxY = -Double.MAX_VALUE;\n double maxZ = -Double.MAX_VALUE;\n int i;\n\n for ( i = 0; i < getNumVertices(); i++ ) {\n double x = vertexPositions[3*i+0];\n double y = vertexPositions[3*i+1];\n double z = vertexPositions[3*i+2];\n\n if ( x < minX ) minX = x;\n if ( y < minY ) minY = y;\n if ( z < minZ ) minZ = z;\n if ( x > maxX ) maxX = x;\n if ( y > maxY ) maxY = y;\n if ( z > maxZ ) maxZ = z;\n }\n minMax[0] = minX;\n minMax[1] = minY;\n minMax[2] = minZ;\n minMax[3] = maxX;\n minMax[4] = maxY;\n minMax[5] = maxZ;\n }\n }", "public void recalculateStatistics() {\n\tthis.resetNodes();\n\tfor (LayoutNode n: this.getNodeList()) \n\t if (!n.isLocked()) \n\t\tupdateMinMax(n.getX(), n.getY());\n }", "public void setRangeProperties(\r\n int newValue,\r\n int newExtent,\r\n int newMin,\r\n int newMax,\r\n boolean adjusting) {\r\n\r\n\r\n if (newMin > newMax) {\r\n newMin = newMax;\r\n }\r\n if (newValue > newMax) {\r\n newMax = newValue;\r\n }\r\n if (newValue < newMin) {\r\n newMin = newValue;\r\n }\r\n\r\n /* Convert the addends to long so that extent can be\r\n * Integer.MAX_VALUE without rolling over the sum.\r\n * A JCK test covers this, see bug 4097718.\r\n */\r\n if (((long) newExtent + (long) newValue) > newMax) {\r\n newExtent = newMax - newValue;\r\n\r\n\r\n }\r\n if (newExtent < 0) {\r\n newExtent = 0;\r\n }\r\n boolean isChange =\r\n (newValue != getValue())\r\n || (newExtent != getExtent())\r\n || (newMin != min)\r\n || (newMax != max)\r\n || (adjusting != isAdjusting);\r\n if (isChange) {\r\n setValue0(newValue);\r\n setExtent0(newExtent);\r\n min = newMin;\r\n max = newMax;\r\n isAdjusting = adjusting;\r\n fireStateChanged();\r\n }\r\n }", "public void setValues(Parameter min, Parameter mag, Parameter wrapS, Parameter wrapT) {\n if (values == null) {\n values = new Parameter[4];\n }\n values[MIN_FILTER_INDEX] = min;\n values[MAG_FILTER_INDEX] = mag;\n values[WRAP_S_INDEX] = wrapS;\n values[WRAP_T_INDEX] = wrapT;\n validateValues();\n }", "@Override protected void updateAxisRange() {\n final Axis<X> xa = getXAxis();\n final Axis<Y> ya = getYAxis();\n List<X> xData = null;\n List<Y> yData = null;\n if(xa.isAutoRanging()) xData = new ArrayList<X>();\n if(ya.isAutoRanging()) yData = new ArrayList<Y>();\n if(xData != null || yData != null) {\n for(Series<X,Y> series : getData()) {\n for(Data<X,Y> data: series.getData()) {\n if(xData != null) {\n xData.add(data.getXValue());\n xData.add(xa.toRealValue(xa.toNumericValue(data.getXValue()) + getLength(data.getExtraValue())));\n }\n if(yData != null){\n yData.add(data.getYValue());\n }\n }\n }\n if(xData != null) xa.invalidateRange(xData);\n if(yData != null) ya.invalidateRange(yData);\n }\n }", "public abstract void setRange(double value, int start, int count);", "@Override\n protected void updateAxisRange(){\n Axis<X> xAxis = getXAxis();\n Axis<Y> yAxis = getYAxis();\n ArrayList<X> xList = null;\n ArrayList<Y> yList = null;\n if(xAxis.isAutoRanging()) { xList = new ArrayList<>(); }\n if(yAxis.isAutoRanging()) { yList = new ArrayList<>(); }\n\n if(xAxis != null || yAxis != null) {\n for (Series<X, Y> series : getData()) {\n for (Data<X, Y> data : series.getData()) {\n if(xList != null) {\n xList.add(data.getXValue());\n xList.add(xAxis.toRealValue(xAxis.toNumericValue(data.getXValue())\n + getLength(data.getExtraValue())));\n }\n if(yList != null) {\n yList.add(data.getYValue());\n }\n }\n }\n if(xList != null) { xAxis.invalidateRange(xList); }\n if(yList != null) { yAxis.invalidateRange(yList); }\n }\n\n }", "protected void updateMeasureValue(Object[] row) {\n for (int i = 0; i < aggregators.length; i++) {\n if (null != row[i]) {\n aggregators[i].agg(row[i]);\n }\n }\n calculateMaxMinUnique();\n }", "private void preprocessOutputs() {\n\t\tfor (int i = 0 ; i < numberOfOutputs; i++) {\n\t\t\tdouble minValue = Double.MAX_VALUE;\n\t\t\tdouble maxValue = 0;\n\t\t\tfor (int j = 0; j < numberOfRecords; j++) {\n\t\t\t\tif (records.get(j).output[i] < minValue) {\n\t\t\t\t\tminValue = records.get(j).output[i];\n\t\t\t\t}\n\t\t\t\tif (records.get(j).output[i] > maxValue) {\n\t\t\t\t\tmaxValue = records.get(j).output[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// set global minimums and maximums\n\t\t\toutputMinimums[i] = minValue;\n\t\t\toutputMaximums[i] = maxValue;\n\n\t\t\t// scale output to be between 0 and 1\n\t\t\tif (minValue < 0 || maxValue > 1) {\n\t\t\t\tfor (int j = 0; j < numberOfRecords; j++) {\n\n\t\t\t\t\tdouble oldOutput = records.get(j).output[i];\n\t\t\t\t\tdouble newOutput = (oldOutput - minValue) / (maxValue - minValue);\n\t\t\t\t\trecords.get(j).output[i] = newOutput;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void setFreqWindow(float minf, float maxf) {\n\t\tminFreq = minf;\n\t\tmaxFreq = maxf;\n\t}", "public DynamicPart minMax(float min, float max) {\n return this.min(min).max(max);\n }", "public SettingInteger setValidRange(int min, int max) { _minValue = min; _maxValue = max; return this; }", "public void setMaxFeatures(int maxFeatures) {\n this.maxFeatures = maxFeatures;\n }", "public void setMinAlturaCM(float max);", "public void setRange(int min, int max) {\n range = new PriceRange();\n range.setMaximum(max);\n range.setMinimum(min);\n }", "public synchronized void setOutputRange(double minOutput, double maxOutput)\n {\n final String funcName = \"setOutputRange\";\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API, \"min=%f,max=%f\", minOutput, maxOutput);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API);\n }\n\n if (maxOutput <= minOutput)\n {\n throw new IllegalArgumentException(\"maxOutput must be greater than minOutput\");\n }\n\n if (Math.abs(minOutput) == Math.abs(maxOutput))\n {\n outputLimit = maxOutput;\n }\n\n this.minOutput = minOutput;\n this.maxOutput = maxOutput;\n }", "public void temperatureMaxChanged(ValueChangeEvent event) {\n temperatureMax = Integer.valueOf(event.getNewValue().toString());\n updateTemperatureNormalisation();\n }", "private void populateMinMaxTime()\n {\n final ColumnHolder columnHolder = index.getColumnHolder(ColumnHolder.TIME_COLUMN_NAME);\n try (final NumericColumn column = (NumericColumn) columnHolder.getColumn()) {\n this.minTime = DateTimes.utc(column.getLongSingleValueRow(0));\n this.maxTime = DateTimes.utc(column.getLongSingleValueRow(column.length() - 1));\n }\n }", "public AdornmentTypeRange(final float min, final float max) {\n\t\tthis.maxFloat = max;\n\t\tthis.minFloat = min;\n\t}", "private void updateMax(int val) {\n overallMax.updateMax(val);\n for (HistoryItem item : watchers.values()) {\n item.max.updateMax(val);\n }\n }", "public void displayMaxValues() {\r\n if (deltaX > deltaXMax) {\r\n deltaXMax = deltaX;\r\n maxX.setText(Float.toString(deltaXMax));\r\n }\r\n if (deltaY > deltaYMax) {\r\n deltaYMax = deltaY;\r\n maxY.setText(Float.toString(deltaYMax));\r\n }\r\n if (deltaZ > deltaZMax) {\r\n deltaZMax = deltaZ;\r\n maxZ.setText(Float.toString(deltaZMax));\r\n }\r\n }", "public void autoscale()\n\t\t{\n\t\tdouble maxFC=1;\n\t\tdouble minP=-1;\n\t\t\n\t\tfor(int i=0;i<de.getNumGenes();i++)\n\t\t\t{\n\t\t\tdouble f=Math.abs(de.fc[i]);\n\t\t\tdouble p=de.logP[i];\n\t\t\tif(f>maxFC)\n\t\t\t\tmaxFC=f;\n\t\t\tif(p<minP)\n\t\t\t\tminP=p;\n\t\t\t}\n\t\tmaxFC*=1.2;\n\t\tminP*=1.2;\n\t\tscaleFC=1/maxFC;\n\t\tscaleP=-1/minP;\n\t\t}", "private void doSetRangeProps(\n double v,\n double e,\n double minimum,\n double maximum,\n int p)\n {\n double dblValue;\n\n if (minimum > maximum)\n {\n maximum = minimum;\n }\n if (maximum < minimum)\n {\n minimum = maximum;\n }\n if ((v + e) > maximum)\n {\n v = maximum - e;\n }\n if (v < minimum)\n {\n v = minimum;\n }\n\n precision = p;\n multiplier = Double.valueOf(Math.pow(10, p)).intValue();\n\n dblMinimum = minimum;\n setMinimum((int) (dblMinimum * multiplier));\n dblMaximum = maximum;\n setMaximum((int) (dblMaximum * multiplier));\n dblValue = v;\n setValue((int) (dblValue * multiplier));\n dblExtent = e;\n setExtent((int) (dblExtent * multiplier));\n }", "private void setMinThreshold() {\n minThreshold = value + value * postBoundChange / 100;\n }", "public void minMaxSamplingRate(MyInt min, MyInt max, MyInt preferred) {\r\n\r\n\t\tsuper.minMaxSamplingRate(min, max, preferred);\r\n\t\tsampleRate = preferred.getValue();\r\n\t\tdoInitialization();\r\n\t}", "@Override\n\tpublic void initializeInternal(Matrix inputs, Matrix labels)\n\t{\t\t\n\t\tfeatureMins = new double[inputs.cols()];\n\t\tfeatureMaxes = new double[inputs.cols()];\n\t\tfor(int i = 0; i < inputs.cols(); i++)\n\t\t{\n\t\t\tif(inputs.getValueCount(i) == 0 && !ignoredInputAttributes.contains(i))\n\t\t\t{\n\t\t\t\t// Compute the min and max\n\t\t\t\tfeatureMins[i] = inputs.findMin(i);\n\t\t\t\tfeatureMaxes[i] = inputs.findMax(i);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Don't do nominal attributes and ignored columns.\n\t\t\t\tfeatureMins[i] = Vector.getUnknownValue();\n\t\t\t\tfeatureMaxes[i] = Vector.getUnknownValue();\n\t\t\t}\n\t\t}\n\t\t\n\t\tlabelMins = new double[labels.cols()];\n\t\tlabelMaxes = new double[labels.cols()];\n\t\tfor(int i = 0; i < labels.cols(); i++)\n\t\t{\n\t\t\tif(labels.getValueCount(i) == 0)\n\t\t\t{\n\t\t\t\t// Compute the min and max\n\t\t\t\tlabelMins[i] = labels.findMin(i);\n\t\t\t\tlabelMaxes[i] = labels.findMax(i);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Don't do nominal attributes\n\t\t\t\tlabelMins[i] = Vector.getUnknownValue();\n\t\t\t\tlabelMaxes[i] = Vector.getUnknownValue();\n\t\t\t}\n\t\t}\n\n\t}", "public void setFilters(int min, int mag) {\r\n \t\r\n \tthis.minFilter = min;\r\n \tthis.magFilter = mag;\r\n \tGLES10.glTexParameterf(GLES10.GL_TEXTURE_2D, GLES10.GL_TEXTURE_MIN_FILTER, this.minFilter);\r\n \tGLES10.glTexParameterf(GLES10.GL_TEXTURE_2D, GLES10.GL_TEXTURE_MAG_FILTER, this.magFilter);\r\n }", "public BatchSummarizer setMinSupport(double minSupport) {\n this.minOutlierSupport = minSupport;\n return this;\n }", "public final void adjustLimits(int max) {\n this.invalid = false;\n if (this.value < 1) {\n this.value = 1;\n this.invalid = true;\n }\n if (max > 0) {\n if (this.value > max) {\n this.value = max;\n this.invalid = true;\n }\n }\n }", "public void setMaximumPoints(int maximum);", "public void clamp(double min, double max) {\n\n\t\tr = Math.max(Math.min(r, max), min);\n\t\tg = Math.max(Math.min(g, max), min);\n\t\tb = Math.max(Math.min(b, max), min);\n\n\t}", "private void updateValues() {\n \n //Find the spaces that can be solved.\n List<Number>updatableNumbers = numbers.stream()\n .filter(n -> n.getUsedValues() != null)\n .filter(n -> n.getUsedValues().size() == 8)\n .filter(n -> n.getValue() == 0)\n .collect(Collectors.toList());\n\n updatableNumbers.forEach(u -> {\n //Create a list of numbers 1-9\n List<Integer> intThrough9 = IntStream.rangeClosed(1, 9)\n .boxed()\n .collect(Collectors.toList());\n\n //Remove the used numbers from the list of 9 \n //to get expected value.\n intThrough9.removeAll(u.getUsedValues());\n u.setValue(intThrough9.get(0));\n }\n );\n }", "private void findExtremes( Vector<? extends AbstractWirelessDevice> coll )\r\n {\r\n for( AbstractWirelessDevice e: coll )\r\n {\r\n double x = e.getLocation().getX();\r\n double y = e.getLocation().getY();\r\n \r\n if( x < minX )\r\n minX = x;\r\n \r\n if( x > maxX )\r\n maxX = x;\r\n \r\n if( y < minY )\r\n minY = y;\r\n \r\n if( y > maxY )\r\n maxY = y;\r\n }\r\n }", "protected final void setMax() {\n\n\tint prevmax = this.max;\n\n\tint i1 = this.high;\n\tint i2 = left.max;\n\tint i3 = right.max;\n\n\tif ((i1 >= i2) && (i1 >= i3)) {\n\t this.max = i1;\n\t} else if ((i2 >= i1) && (i2 >= i3)) {\n\t this.max = i2;\n\t} else {\n\t this.max = i3;\n\t}\n\t\n\tif ((p != IntervalNode.nullIntervalNode) &&\n\t (prevmax != this.max)) {\n \t p.setMax();\n\t}\n }", "@Override\r\n public void merge(Integer minX, Integer maxX, Integer minY, Integer maxY) {\r\n if (this.minX == null) {\r\n this.minX = (minX == null) ? null : minX.doubleValue();\r\n }\r\n if (this.maxX == null) {\r\n this.maxX = (maxX == null) ? null : maxX.doubleValue();\r\n }\r\n if (this.minY == null) {\r\n this.minY = (minY == null) ? null : minY.doubleValue();\r\n }\r\n if (this.maxY == null) {\r\n this.maxY = (maxY == null) ? null : maxY.doubleValue();\r\n }\r\n }", "public void normalize() {\n double maxTotalTime = findMaxTotalTimeSeconds();\n int maxTotalMoves = findMaxTotalMoves();\n ResultMaxTotals maxTotals = new ResultMaxTotals(maxTotalTime, maxTotalMoves);\n\n updateNormalizedValues(maxTotals);\n }", "protected void calcMinMax(T t) {\n if (this.mYMax < t.getYMax()) {\n this.mYMax = t.getYMax();\n }\n if (this.mYMin > t.getYMin()) {\n this.mYMin = t.getYMin();\n }\n if (this.mXMax < t.getXMax()) {\n this.mXMax = t.getXMax();\n }\n if (this.mXMin > t.getXMin()) {\n this.mXMin = t.getXMin();\n }\n if (t.getAxisDependency() == YAxis.AxisDependency.LEFT) {\n if (this.mLeftAxisMax < t.getYMax()) {\n this.mLeftAxisMax = t.getYMax();\n }\n if (!(this.mLeftAxisMin > t.getYMin())) return;\n {\n this.mLeftAxisMin = t.getYMin();\n return;\n }\n } else {\n if (this.mRightAxisMax < t.getYMax()) {\n this.mRightAxisMax = t.getYMax();\n }\n if (!(this.mRightAxisMin > t.getYMin())) return;\n {\n this.mRightAxisMin = t.getYMin();\n return;\n }\n }\n }", "public void set(int min, int max, double score){\r\n\t\tchart[min][max] = score;\r\n\t}", "@Override\r\n public void merge(Double minX, Double maxX, Double minY, Double maxY) {\r\n if (this.minX == null) {\r\n this.minX = minX;\r\n }\r\n if (this.maxX == null) {\r\n this.maxX = maxX;\r\n }\r\n if (this.minY == null) {\r\n this.minY = minY;\r\n }\r\n if (this.maxY == null) {\r\n this.maxY = maxY;\r\n }\r\n }", "public void setMinMaxLabel() {\n minMaxLabel.setText(min + \" ≤ val ≤ \" + max);\n }", "private void updateBounds(final float[] values) {\n if (getDrawable() != null) {\n mBounds.set(values[Matrix.MTRANS_X],\n values[Matrix.MTRANS_Y],\n getDrawable().getIntrinsicWidth() * values[Matrix.MSCALE_X] + values[Matrix.MTRANS_X],\n getDrawable().getIntrinsicHeight() * values[Matrix.MSCALE_Y] + values[Matrix.MTRANS_Y]);\n }\n }", "void setMaxValue();", "private synchronized void updateNumberFormat()\n\t{\n\n\t\tfinal int sw = rangeSlider.getWidth();\n\t\tif ( sw > 0 )\n\t\t{\n\t\t\tfinal double vrange = range.getMaxBound() - range.getMinBound();\n\t\t\tfinal int digits = ( int ) Math.ceil( Math.log10( sw / vrange ) );\n\n\t\t\tblockUpdates = true;\n\n\t\t\tJSpinner.NumberEditor numberEditor = ( ( JSpinner.NumberEditor ) minSpinner.getEditor() );\n\t\t\tnumberEditor.getFormat().setMaximumFractionDigits( digits );\n\t\t\tnumberEditor.stateChanged( new ChangeEvent( minSpinner ) );\n\n\t\t\tnumberEditor = ( ( JSpinner.NumberEditor ) maxSpinner.getEditor() );\n\t\t\tnumberEditor.getFormat().setMaximumFractionDigits( digits );\n\t\t\tnumberEditor.stateChanged( new ChangeEvent( maxSpinner ) );\n\n\t\t\tblockUpdates = false;\n\t\t}\n\t}", "private void updateRaster (Color minColor, Color maxColor) {\n\t\tRectangle bounds = new Rectangle (0, 0, 100, 1);\n\t\tGradientPaint gp = new GradientPaint (0.0f, 0.0f, minColor, 100.0f, 0.0f, maxColor);\n\t\tColorModel cm = Toolkit.getDefaultToolkit().getColorModel();\n\t\tPaintContext pc = gp.createContext(cm, bounds, bounds, new AffineTransform (), null);\n\t\traster = pc.getRaster(0,0,100,1);\n\t}", "public static double normalizeMapminmax(double num) {\r\n \t\tint MAXsetvaluefaktor = 1;\r\n \t\tint MINsetvaluefaktor = 1;\r\n \r\n \t\tswitch (GAMETYPE) {\r\n \t\tcase SAYISALLOTO: {\r\n \t\t\tif (INPUTVALUETYPE == DIGITAL) {\r\n \t\t\t\tMAXsetvaluefaktor = SAYISALMINSETVALUE1;\r\n \t\t\t\tMINsetvaluefaktor = 0;\r\n \t\t\t} else if (INPUTVALUETYPE == RAWVALUE) {\r\n \t\t\t\tMAXsetvaluefaktor = SAYISALMAXSETVALUE49;\r\n \t\t\t\tMINsetvaluefaktor = SAYISALMINSETVALUE1;\r\n \t\t\t}\r\n \t\t\tbreak;\r\n \t\t}\r\n \t\tdefault: {\r\n \r\n \t\t}\r\n \t\t}\r\n \r\n \t\tdouble result = ((MAPMAX - MAPMIN) * (num - MINsetvaluefaktor));\r\n \t\tresult = result / (MAXsetvaluefaktor - MINsetvaluefaktor);\r\n \t\tresult = result + MAPMIN;\r\n \t\treturn result;\r\n \t}", "NumericRangeFilter(double p_min, double p_max) {\n maximum = p_max;\n minimum = p_min;\n }", "private static double minMaxNormalization(final double value) {\n return (((value - Configuration.ACTUAL_MIN) / (Configuration.ACTUAL_MAX - Configuration.ACTUAL_MIN)) * (Configuration.NORMALIZED_MAX - Configuration.NORMALIZED_MIN)) + Configuration.NORMALIZED_MIN;\n }", "public void update() {\n\t\t\tif (!max.getText().isEmpty()) {\n\t\t\t\tInteger maxVal = Integer.parseInt(max.getText());\n\t\t\t\tif (maxVal > 2) {\n\t\t\t\t\tboolean toUpdate = false;\n\t\t\t\t\tPlgProbabilityDistribution distr = null;\n\t\t\t\t\tif (((String)cb.getSelectedItem()).equals(PlgProbabilityDistribution.distributionToName(DISTRIBUTION.UNIFORM))) {\n\t\t\t\t\t\tdistr = PlgProbabilityDistribution.uniformDistributionFactory();\n\t\t\t\t\t\ttoUpdate = true;\n\t\t\t\t\t} else if (((String)cb.getSelectedItem()).equals(PlgProbabilityDistribution.distributionToName(DISTRIBUTION.BETA))) {\n\t\t\t\t\t\tif (!alpha.getText().isEmpty() && !beta.getText().isEmpty()) {\n\t\t\t\t\t\t\tDouble a = Double.parseDouble(alpha.getText());\n\t\t\t\t\t\t\tDouble b = Double.parseDouble(beta.getText());\n\t\t\t\t\t\t\tdistr = PlgProbabilityDistribution.betaDistributionFactory(a, b);\n\t\t\t\t\t\t\ttoUpdate = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (((String)cb.getSelectedItem()).equals(PlgProbabilityDistribution.distributionToName(DISTRIBUTION.NORMAL))) {\n\t\t\t\t\t\tdistr = PlgProbabilityDistribution.normalDistributionFactory();\n\t\t\t\t\t\ttoUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (toUpdate) {\n\t\t\t\t\t\tp.updateDistribution(dv, maxVal, distr);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public JQImageHeatMapFeature(JQImageMap imageMap, ArrayList<Double> allValues)\n {\n super(\"JWHeatMapFeature\");\n this.imageMap = imageMap;\n setComponent(imageMap);\n this.allValues = allValues;\n this.minimumValue = getMinNumber(allValues);\n this.maximumValue = getMaxNumber(allValues);\n }", "public void setAxisRange(double xMin,double xMax, double yMin, double yMax) {\n minXValue=xMin;\n maxXValue=xMax;\n minYValue=yMin;\n maxYValue=yMax;\n this.customAxis=true;\n addGraphPanel();\n\n }", "@Override\n public void setValue(int value) {\n int oldValue = getValue();\n if (oldValue == value) {\n return;\n }\n\n // Compute new value and extent to maintain upper value.\n int oldExtent = getExtent();\n int newValue = Math.min(Math.max(getMinimum(), value), oldValue + oldExtent);\n int newExtent = oldExtent + oldValue - newValue;\n\n // Set new value and extent, and fire a single change event.\n getModel().setRangeProperties(newValue, newExtent, getMinimum(), \n getMaximum(), getValueIsAdjusting());\n }", "public void setMaximum(int n) {\r\n int newMin = Math.min(n, min);\r\n int newValue = Math.min(n, getValue());\r\n int newExtent = Math.min(n - newValue, getExtent());\r\n setRangeProperties(newValue, newExtent, newMin, n, isAdjusting);\r\n }", "public void maximizeIntensity()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n\tdouble dbL = (double)(L-1);\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tintensity[row][col] = (short)Math.min(L-1, \r\n\t\t Math.round((L-1) * maxIntensity(hue[row][col]/dbL,\r\n\t\t saturation[row][col]/dbL)));\r\n\t }\r\n\t}\r\n }", "public void displayMaxValues() {\n if (deltaX > deltaXMax) {\n deltaXMax = deltaX;\n maxX.setText(_DF.format(deltaXMax));\n }\n if (deltaY > deltaYMax) {\n deltaYMax = deltaY;\n maxY.setText(_DF.format(deltaYMax));\n }\n if (deltaZ > deltaZMax) {\n deltaZMax = deltaZ;\n maxZ.setText(_DF.format(deltaZMax));\n }\n\n }", "public void setMaxMin(long maxMin) {\n\t\tthis.maxMin = maxMin;\r\n\t}" ]
[ "0.73796284", "0.7106098", "0.6913958", "0.67289114", "0.67020893", "0.6522194", "0.64763564", "0.6424152", "0.6314014", "0.63049483", "0.61951786", "0.61675465", "0.61581784", "0.5927169", "0.5886379", "0.5848939", "0.5843493", "0.5809575", "0.57722473", "0.5754968", "0.55902886", "0.557033", "0.55697536", "0.5553785", "0.5530967", "0.5530196", "0.55278033", "0.5513257", "0.55109614", "0.55095434", "0.5503155", "0.5500297", "0.54768765", "0.5444414", "0.5438764", "0.54247856", "0.54193705", "0.5408766", "0.5405415", "0.53983814", "0.5393982", "0.53719705", "0.5367287", "0.5342727", "0.5341408", "0.5318483", "0.5309758", "0.5308536", "0.53038687", "0.52913445", "0.52780914", "0.52622074", "0.5248278", "0.5243094", "0.5240207", "0.5239823", "0.52312434", "0.5227341", "0.52272975", "0.52080125", "0.52056307", "0.519558", "0.5194825", "0.5191711", "0.5180514", "0.5177642", "0.5172921", "0.51727366", "0.5165539", "0.5163548", "0.515008", "0.51423144", "0.5133706", "0.5130332", "0.5120689", "0.51166266", "0.51025766", "0.51016194", "0.5101153", "0.5093696", "0.5084108", "0.5078617", "0.5077073", "0.5068834", "0.50663567", "0.5063101", "0.5057512", "0.5046782", "0.5046621", "0.50410706", "0.5037031", "0.5036884", "0.5034273", "0.50338346", "0.50327444", "0.50326014", "0.5030633", "0.5020916", "0.5020672", "0.50147" ]
0.73343986
1
Returns the error message resulted in failing to verify the PKIMessage The error message is set if verify() returns false.
public String getErrorMessage() { return this.errMsg; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n errorMessage_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 if (bs.isValidUtf8()) {\n errorMessage_ = s;\n }\n return s;\n }\n }", "public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n }\n }", "public java.lang.String getErrmsg() {\n java.lang.Object ref = errmsg_;\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 if (bs.isValidUtf8()) {\n errmsg_ = s;\n }\n return s;\n }\n }", "public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@java.lang.Override\n public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getErrorMessage() {\n java.lang.Object ref = errorMessage_;\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 errorMessage_ = s;\n return s;\n }\n }", "public java.lang.String getErrmsg() {\n java.lang.Object ref = errmsg_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n errmsg_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@Override\n\tpublic String getMessage()\n\t{\n\t\treturn errMessage;\n\t}", "public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "String getInvalidMessage();", "public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public java.lang.String getErrorInfo() {\n java.lang.Object ref = errorInfo_;\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 errorInfo_ = s;\n return s;\n }\n }", "public java.lang.String getErrorInfo() {\n java.lang.Object ref = errorInfo_;\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 errorInfo_ = s;\n return s;\n }\n }", "public java.lang.String getErrorInfo() {\n java.lang.Object ref = errorInfo_;\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 errorInfo_ = s;\n return s;\n }\n }", "public java.lang.String getErrorInfo() {\n java.lang.Object ref = errorInfo_;\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 errorInfo_ = s;\n return s;\n }\n }", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "java.lang.String getErrorMessage();", "public java.lang.String getErrorInfo() {\n java.lang.Object ref = errorInfo_;\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 errorInfo_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getErrorInfo() {\n java.lang.Object ref = errorInfo_;\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 errorInfo_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getErrorInfo() {\n java.lang.Object ref = errorInfo_;\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 errorInfo_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getErrorInfo() {\n java.lang.Object ref = errorInfo_;\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 errorInfo_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public com.google.protobuf.ByteString\n getErrmsgBytes() {\n java.lang.Object ref = errmsg_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errmsg_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getErrorMessageBytes() {\n java.lang.Object ref = errorMessage_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errorMessage_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getErrorMsg() {\n return this.state == null ? null : this.state.msg;\n }", "public com.google.protobuf.ByteString\n getErrmsgBytes() {\n java.lang.Object ref = errmsg_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n errmsg_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "com.google.protobuf.ByteString\n getErrorMessageBytes();", "com.google.protobuf.ByteString\n getErrorMessageBytes();", "com.google.protobuf.ByteString\n getErrorMessageBytes();", "com.google.protobuf.ByteString\n getErrorMessageBytes();", "com.google.protobuf.ByteString\n getErrorMessageBytes();", "com.google.protobuf.ByteString\n getErrorMessageBytes();", "com.google.protobuf.ByteString\n getErrorMessageBytes();", "com.google.protobuf.ByteString\n getErrorMessageBytes();", "com.google.protobuf.ByteString\n getErrorMessageBytes();", "com.google.protobuf.ByteString\n getErrorMessageBytes();", "com.google.protobuf.ByteString\n getErrorMessageBytes();", "com.google.protobuf.ByteString\n getErrorMessageBytes();", "String getFailureMessage();", "public String getMessage() {\n\t\treturn mErrorMessageString;\n\t}", "public java.lang.String getErr() {\n java.lang.Object ref = err_;\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 if (bs.isValidUtf8()) {\n err_ = s;\n }\n return s;\n }\n }", "@Override\n\tpublic String getFailureMessage() {\n\t return null;\n\t}", "public String getErrorMessage() {\n\t\treturn this.message;\n\t}", "public java.lang.String getErr() {\n java.lang.Object ref = err_;\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 if (bs.isValidUtf8()) {\n err_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@Override\r\n\tpublic String getMessage() {\n\t\treturn \"Failed\";\r\n\t}", "public String getFailureMessage() {\n return this.failureMessage;\n }", "public String errorMessage()\n {\n return new String(errorMessageAsBytes());\n }", "public String getErrorMsg() {\n return this.emsg;\n }", "public java.lang.String getError() {\n java.lang.Object ref = error_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n error_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getErrorMessage() {\n\t\treturn null;\n\t}", "public String getErrorMessage() {\n\t\treturn null;\n\t}", "public java.lang.String getError() {\n java.lang.Object ref = error_;\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 if (bs.isValidUtf8()) {\n error_ = s;\n }\n return s;\n }\n }" ]
[ "0.62527764", "0.62507313", "0.622379", "0.62221736", "0.6213976", "0.62107307", "0.62107307", "0.62107307", "0.6209846", "0.6209846", "0.6209846", "0.6209846", "0.6209846", "0.6209846", "0.6209846", "0.6179831", "0.6179831", "0.6179831", "0.6179831", "0.6179831", "0.6179831", "0.6179831", "0.61794776", "0.61794776", "0.61794776", "0.6160468", "0.6121316", "0.6077405", "0.6077405", "0.6077405", "0.6077405", "0.6077405", "0.6077405", "0.6077405", "0.6077405", "0.6077405", "0.6075825", "0.6074384", "0.6074384", "0.6074384", "0.6074384", "0.6074384", "0.6074384", "0.6074384", "0.6074384", "0.60740936", "0.60740936", "0.60363543", "0.60202277", "0.60202277", "0.60175157", "0.60175157", "0.60175157", "0.60175157", "0.60020673", "0.60020673", "0.60020673", "0.60020673", "0.60020673", "0.60020673", "0.60020673", "0.60020673", "0.60020673", "0.60020673", "0.60020673", "0.60020673", "0.59768635", "0.59768635", "0.59768635", "0.59768635", "0.5972508", "0.5950303", "0.5950303", "0.59311414", "0.5917246", "0.59011143", "0.59011143", "0.59011143", "0.59011143", "0.59011143", "0.59011143", "0.59011143", "0.59011143", "0.59011143", "0.59011143", "0.59007007", "0.59007007", "0.5882367", "0.58759576", "0.58506715", "0.58312964", "0.58267397", "0.5815167", "0.57938313", "0.5792391", "0.57797104", "0.5775877", "0.57346016", "0.57314986", "0.57314986", "0.57226896" ]
0.0
-1
Returns the name of the authentication module that was successfully used to authenticate the message. The authentication module is set if verify() returns true.
public ICMPAuthenticationModule getUsedAuthenticationModule() { return this.authModule; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getAuthMethod() {\n return AUTH_NAME;\n }", "public String getAuthentication() {\r\n return authentication;\r\n }", "public String getName() {\n return Token2Constants.AUTHENTICATOR_NAME;\n }", "public boolean authenticationSucceeded() {\n\t\treturn authenticated;\n\t}", "java.lang.String getAuth();", "java.lang.String getAuth();", "java.lang.String getAuth();", "public Pokemon.RequestEnvelop.AuthInfo getAuth() {\n if (authBuilder_ == null) {\n return auth_;\n } else {\n return authBuilder_.getMessage();\n }\n }", "public java.lang.String getAuth() {\n java.lang.Object ref = auth_;\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 auth_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getAuth() {\n java.lang.Object ref = auth_;\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 auth_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getAuth() {\n java.lang.Object ref = auth_;\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 auth_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getAuth() {\n java.lang.Object ref = auth_;\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 auth_ = s;\n return s;\n }\n }", "public java.lang.String getAuth() {\n java.lang.Object ref = auth_;\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 auth_ = s;\n return s;\n }\n }", "public java.lang.String getAuth() {\n java.lang.Object ref = auth_;\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 auth_ = s;\n return s;\n }\n }", "public String getAuthenticationType() {\n return this.authenticationType;\n }", "public static String getCheckAuthentication() {\n\n\t\treturn baseURL + login_required_string + \"/rest/is-authenticated\";\n\t}", "public String get_snmpauthprotocol()\r\n\t{\r\n\t\treturn this.snmpauthprotocol;\r\n\t}", "protected String getAuthMethod() {\n return \"Token\" ;// TODO this.conf.getAuthMethod();\n }", "public String getAuthMethod() {\n\t\tString method = options.getProperty(\"auth-method\");\n\t\tif(method == null) {\n\t\t\tmethod = options.getProperty(\"Authentication-Method\");\n\t\t}\n\t\treturn trimedValue(method);\n\t}", "private ICMPAuthenticationModule getAuthModule(final String module, final String parameter, final PKIMessage pkimsg) {\n\t\tif(StringUtils.equals(module, CmpConfiguration.AUTHMODULE_HMAC)) {\n\t\t\tfinal HMACAuthenticationModule hmacmodule = new HMACAuthenticationModule(parameter);\n\t\t\thmacmodule.setSession(this.admin, this.userAdminSession, this.certificateStoreSession);\n\t\t\thmacmodule.setCaInfo(this.cainfo);\n\t\t\treturn hmacmodule;\n\t\t} else if(StringUtils.equals(module, CmpConfiguration.AUTHMODULE_ENDENTITY_CERTIFICATE)) {\n\t\t\tfinal EndEntityCertificateAuthenticationModule eemodule = new EndEntityCertificateAuthenticationModule(parameter);\n\t\t\teemodule.setSession(this.admin, this.caAdminSession, this.certificateStoreSession, this.authorizationSessoin, this.eeProfileSession, this.userAdminSession);\n\t\t\treturn eemodule;\n\t\t}\n\t\tif(!CmpConfiguration.getRAOperationMode()) {\n\t\t\tif(StringUtils.equals(module, CmpConfiguration.AUTHMODULE_REG_TOKEN_PWD)){\n\t\t\t\treturn new RegTokenPasswordExtractor();\n\t\t\t} else if(StringUtils.equals(module, CmpConfiguration.AUTHMODULE_DN_PART_PWD)) {\n\t\t\t\treturn new DnPartPasswordExtractor(parameter);\n\t\t\t}\n\t\t}\t\t\t\n\t\terrMsg = \"Unrecognized authentication module '\" + module + \"'\";\n\t\treturn null;\n\t}", "public com.google.protobuf.ProtocolStringList\n getAuthenticationList() {\n return authentication_;\n }", "SASL getSASL();", "public boolean verify(final PKIMessage msg, final String username) {\n\t\tif (log.isTraceEnabled()) {\n\t\t\tlog.trace(\">verify\");\n\t\t}\n\t\tboolean ret = false;\n\t\tfinal String authModules = CmpConfiguration.getAuthenticationModule();\n\t\tfinal String authparameters = CmpConfiguration.getAuthenticationParameters();\n\t\tfinal String modules[] = authModules.split(\";\");\n\t\tfinal String params[] = authparameters.split(\";\");\n\t\t\n\t\tICMPAuthenticationModule module = null;\n\t\tint i=0;\n\t\twhile (i<modules.length) {\n\t\t\tif (log.isDebugEnabled()) {\n log.debug(\"Trying to verify the message authentication by using: \" + modules[i] );\n log.debug(\"Authentication module parameter: \" + (params[i]!=null ? params[i]:\"null\") ); \n\t\t\t}\n\n\t\t\tmodule = getAuthModule(modules[i].trim(), params[i].trim(), msg);\n\t\t\tif((module != null) && module.verifyOrExtract(msg, username)) {\n\t\t\t\tthis.authModule = module;\n\t\t\t\tret = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ((module != null) && (module.getErrorMessage() != null)) {\n\t\t\t\terrMsg = module.getErrorMessage();\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\tif (log.isTraceEnabled()) {\n\t\t\tlog.trace(\"<verify: \"+ret);\n\t\t}\n\t\treturn ret;\n\t}", "public java.lang.CharSequence getModule() {\n return module;\n }", "public java.lang.CharSequence getModule() {\n return module;\n }", "public LoginMessageResponse getLoginResult() {\n return localLoginResult;\n }", "public boolean getDoAuthentication() {\n return doAuthentication;\n }", "boolean authNeeded();", "void onAuthenticationSucceeded(String token);", "public AuthenticationSuccessResponse getAuthenticationSuccessResponse() {\n log.trace(\"Entering & Leaving\");\n return authSuccessResponse;\n }", "public String getModuleName() {\n return moduleNameString;\n }", "public TaskProtobufWrapper.LoginPack getLoginPack() {\n if (loginPackBuilder_ == null) {\n if (packCase_ == 2) {\n return (TaskProtobufWrapper.LoginPack) pack_;\n }\n return TaskProtobufWrapper.LoginPack.getDefaultInstance();\n } else {\n if (packCase_ == 2) {\n return loginPackBuilder_.getMessage();\n }\n return TaskProtobufWrapper.LoginPack.getDefaultInstance();\n }\n }", "public final String getModuleName() {\n return MODULE_NAME;\n }", "java.lang.String getAuthentication(int index);", "protected String getLoginProcess() {\r\n return loginProcess;\r\n }", "boolean authenticate(String userName, String password);", "public boolean getVerifyField() {\n\treturn verify;\n }", "public String getModuleCode() {\r\n\t\treturn moduleCode;\r\n\t}", "public String getModuleCode() {\r\n\t\treturn moduleCode;\r\n\t}", "public AuthenticationState getAuthenticationState() {\n return authenticationState;\n }", "public LoginMessageResponse getLoginMessageResponse() {\n return localLoginMessageResponse;\n }", "public java.lang.String getAuthInfo() {\r\n return authInfo;\r\n }", "public String getName()\n {\n return MODULE_NAME;\n }", "public String getModuleName ()\n\n {\n\n // Returns moduleName when called.\n return moduleName;\n\n }", "public java.lang.String getAuthentication(int index) {\n return authentication_.get(index);\n }", "public java.lang.String getAuthentication(int index) {\n return authentication_.get(index);\n }", "protected String getAuthInfo ()\n\t{\n\t\treturn authInfo;\n\t}", "public com.google.protobuf.ProtocolStringList\n getAuthenticationList() {\n return authentication_.getUnmodifiableView();\n }", "public String getModuleId() throws BaseTechnicalError, RemoteException {\n\t return JazzQAConstants.MODULE_PEDVALIDACAO;\n\t}", "public boolean isVerifyingNames() {\n return verifyNames;\n }", "public String getSnmpv3Authprotocol() {\r\n return snmpv3Authprotocol;\r\n }", "public EPPNameVerificationStatus getStatus() {\n\t\treturn this.status;\n\t}", "AuthenticationToken authenticate(String username, CharSequence password) throws Exception;", "public AuthenticationManager getAuthenticationManager() {\n return authenticationManager;\n }", "CloudCredentialStatus verify(@Nonnull AuthenticatedContext authenticatedContext);", "public String getModuleName() {\r\n\t\treturn moduleName;\r\n\t}", "public String getModuleName() {\r\n\t\treturn moduleName;\r\n\t}", "public TaskProtobufWrapper.LoginPackOrBuilder getLoginPackOrBuilder() {\n if ((packCase_ == 2) && (loginPackBuilder_ != null)) {\n return loginPackBuilder_.getMessageOrBuilder();\n } else {\n if (packCase_ == 2) {\n return (TaskProtobufWrapper.LoginPack) pack_;\n }\n return TaskProtobufWrapper.LoginPack.getDefaultInstance();\n }\n }", "public TaskProtobufWrapper.LoginPack getLoginPack() {\n if (packCase_ == 2) {\n return (TaskProtobufWrapper.LoginPack) pack_;\n }\n return TaskProtobufWrapper.LoginPack.getDefaultInstance();\n }", "public String getAuthCode() {\n\t\treturn authCode;\n\t}", "public Integer getVerifyType() {\r\n return verifyType;\r\n }", "public String getVerifyCode() {\r\n return verifyCode;\r\n }", "@Override\n\t\t\tpublic boolean authenticate(String name, char[] password, String server) throws Exception {\n\t\t\t\treturn true;\n\t\t\t}", "public String getInputAuth()\n\t{\n\t\treturn inputAuth;\n\t}", "public String getAuthCode() {\n return authCode;\n }", "public String getLogin() {\n\t\treturn login.getText();\n\t}", "public String getAuthenticationRealm() {\n return this.realm;\n }", "public String getLoginName() {\r\n return loginName;\r\n }", "public String getLoginName() {\r\n return loginName;\r\n }", "public com.google.protobuf.ProtocolStringList\n getAuthenticationMechanismsList() {\n return authenticationMechanisms_;\n }", "public String getLoginName() {\n return loginName;\n }", "public String getLoginName() {\n return loginName;\n }", "public String getLoginName() {\n return loginName;\n }", "public String getLoginName() {\n return loginName;\n }", "public abstract String getLoginName();", "public JobServiceBusAuthentication getAuthentication() {\n return this.authentication;\n }", "public Pokemon.RequestEnvelop.AuthInfo getAuth() {\n return auth_;\n }", "@Override\n public String moduleName() {\n return MODULE_NAME;\n }", "public Token getName()\n {\n if (isVersion())\n {\n return getVersion();\n }\n\n return getModule();\n }", "protected String getModuleId() {\n\n return moduleId;\n }", "boolean isAuthenticated();", "public String getType()\n {\n return MODULE_TYPE;\n }", "TaskProtobufWrapper.LoginPack getLoginPack();", "public String getmoduleName() {\t\r\n\treturn ModuleName;\t\r\n}", "String getComponentVerifyTicket();", "public int getModuleId() {\n return moduleId_;\n }", "@Override\npublic boolean supports(Class<?> authentication) {\n return true;\n}", "public int getModuleId() {\n return moduleId_;\n }", "public int getModuleID ()\n\n {\n\n // Returns moduleID when called.\n return moduleID;\n\n }", "public VerificationType verificationType() {\n return this.verificationType;\n }", "public String getVerificationString() {\r\n return \"Are you sure you wish to refresh the bank? This operation will require remote initialization of all user presets and samples.\";\r\n }", "public java.lang.String getLoginName() {\r\n return loginName;\r\n }", "String getVerified();", "@Override\n public void onVerificationCompleted(PhoneAuthCredential credential) {\n Toast.makeText(activity, \"credentials : \"+credential, Toast.LENGTH_SHORT).show();\n Toast.makeText(activity, \"Sms : \"+smsCode, Toast.LENGTH_SHORT).show();\n Toast.makeText(activity, \"phone verification Id : \"+phoneVerificationId, Toast.LENGTH_SHORT).show();\n smsMessage = credential.getSmsCode();\n }", "public final Oid getMechanism() {\n/* 312 */ return Krb5MechFactory.GSS_KRB5_MECH_OID;\n/* */ }", "public com.genesys.internal.authentication.api.AuthenticationApi getAuthenticationApi() {\n return authenticationApi;\n }", "private static ExtensionAuthentication getAuthenticationExtension() {\n if (extensionAuth == null) {\n extensionAuth =\n Control.getSingleton()\n .getExtensionLoader()\n .getExtension(ExtensionAuthentication.class);\n }\n return extensionAuth;\n }", "public Pokemon.RequestEnvelop.AuthInfoOrBuilder getAuthOrBuilder() {\n if (authBuilder_ != null) {\n return authBuilder_.getMessageOrBuilder();\n } else {\n return auth_;\n }\n }", "com.google.protobuf.ProtocolStringList\n getAuthenticationList();", "public String get_snmpauthpassword()\r\n\t{\r\n\t\treturn this.snmpauthpassword;\r\n\t}" ]
[ "0.6004171", "0.57602245", "0.5535326", "0.5461074", "0.54180324", "0.54180324", "0.54180324", "0.54029125", "0.5352619", "0.5352619", "0.5352619", "0.53397757", "0.53397757", "0.53397757", "0.52620333", "0.5251151", "0.5244894", "0.52265155", "0.52221787", "0.5220359", "0.5203966", "0.5202201", "0.51915604", "0.51273566", "0.5115385", "0.5109674", "0.5103293", "0.50860435", "0.5079884", "0.5065521", "0.5053091", "0.5035809", "0.5023202", "0.50231886", "0.5014885", "0.50081664", "0.4984655", "0.49799266", "0.49799266", "0.4966727", "0.49514675", "0.49484724", "0.49475053", "0.49318773", "0.49034432", "0.48969784", "0.4884333", "0.48671958", "0.4866758", "0.48655102", "0.48532632", "0.4835759", "0.48204815", "0.48132828", "0.48132104", "0.48105824", "0.48105824", "0.4785311", "0.4771127", "0.47672647", "0.47604826", "0.47591645", "0.4747262", "0.47307628", "0.47287172", "0.47122228", "0.47048584", "0.47013012", "0.47013012", "0.4700469", "0.46940246", "0.46940246", "0.46940246", "0.46940246", "0.46938273", "0.4690741", "0.46852136", "0.4679845", "0.4661388", "0.4657848", "0.46518657", "0.46467888", "0.46355194", "0.46325052", "0.4631713", "0.4626925", "0.46218783", "0.46136922", "0.46116084", "0.46099535", "0.46082956", "0.46057716", "0.46040136", "0.45962486", "0.45928904", "0.45909208", "0.45871848", "0.45848176", "0.45838127", "0.45789257" ]
0.646751
0
Verifies the authenticity of msg
public boolean verify(final PKIMessage msg, final String username) { if (log.isTraceEnabled()) { log.trace(">verify"); } boolean ret = false; final String authModules = CmpConfiguration.getAuthenticationModule(); final String authparameters = CmpConfiguration.getAuthenticationParameters(); final String modules[] = authModules.split(";"); final String params[] = authparameters.split(";"); ICMPAuthenticationModule module = null; int i=0; while (i<modules.length) { if (log.isDebugEnabled()) { log.debug("Trying to verify the message authentication by using: " + modules[i] ); log.debug("Authentication module parameter: " + (params[i]!=null ? params[i]:"null") ); } module = getAuthModule(modules[i].trim(), params[i].trim(), msg); if((module != null) && module.verifyOrExtract(msg, username)) { this.authModule = module; ret = true; break; } if ((module != null) && (module.getErrorMessage() != null)) { errMsg = module.getErrorMessage(); } i++; } if (log.isTraceEnabled()) { log.trace("<verify: "+ret); } return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean verify(String message) {\n try {\n String[] messageParts = message.split(\" \"); //messageParts[0] is <HMAC>\n //base64-decode <HMAC>\n byte[] receivedHash = Base64.decode(messageParts[0]);\n String otherMessageParts = message\n .substring(message.indexOf(' ') + 1); //= \"!msg <message>\"\n byte[] actualHash = createHash(\n otherMessageParts); //= hash calculated by message content\n\n return MessageDigest.isEqual(receivedHash, actualHash);\n } catch (Exception e) {\n //message format did not fit\n return false;\n }\n }", "public boolean testVerify(byte[] message)\n {\n return false;\n }", "private static boolean VerifyInput(String encrypteddata) throws NoSuchAlgorithmException, UnsupportedEncodingException {\n //extract the data and signed message\n String[] data = encrypteddata.split(\"#\");\n String clientdataComputedhash = \"\";\n try {\n clientdataComputedhash = CalHash(data[0].getBytes());\n } catch (UnsupportedEncodingException ex) {\n System.out.println(\"Unsupported Encoding Exception\");\n }\n //compute the hash from the signed message\n byte[] clientHash = data[1].getBytes();\n String clientdecryptHash = RSAdecrypt(clientHash);\n boolean status = false;\n //status if the signature does not matches\n status = clientdecryptHash.equals(clientdataComputedhash);\n return status;\n }", "public boolean verifyMessage(ATMMessage atmMessage){\n if(!(this.currTimeStamp < atmMessage.getTimeStamp())) error (\"Time stamp does not match\");\r\n if(!(parameterGenerator.getPreviousNonce() == atmMessage.getResponseNonce())) error (\"Nonce does not match\");\r\n return true;\r\n \r\n }", "public boolean verify(RSACryptoSignature sig, RSAKeyForPublication pKey, byte [] msgHashBytes){\r\n\t\tlock.lock();\r\n\t\ttry {\r\n\t\t\tAsymmetricBlockCipher rsaEngine = new PKCS1Encoding(new RSABlindedEngine());\r\n\t\t\trsaEngine.init(false, pKey.getPublicKey());\r\n\t\t\tbyte [] sigBytes = sig.signature.s.decodeToBytes();\r\n\t\t\tbyte [] rawBytes = rsaEngine.processBlock(sigBytes, 0, sigBytes.length);\r\n\t\t\treturn test_equal(rawBytes,msgHashBytes);\r\n\t\t} catch (InvalidCipherTextException e) {\r\n\t\t\tthrow new RuntimeException(e);\r\n\t\t} finally {\r\n\t\t\tlock.unlock();\r\n\t\t}\r\n\t}", "private void validateFermatPacketSignature(FermatPacket fermatPacketReceive){\n\n System.out.println(\" WsCommunicationVPNClient - validateFermatPacketSignature\");\n\n /*\n * Validate the signature\n */\n boolean isValid = AsymmectricCryptography.verifyMessageSignature(fermatPacketReceive.getSignature(), fermatPacketReceive.getMessageContent(), vpnServerIdentity);\n\n System.out.println(\" WsCommunicationVPNClient - isValid = \" + isValid);\n\n /*\n * if not valid signature\n */\n if (!isValid){\n throw new RuntimeException(\"Fermat Packet received has not a valid signature, go to close this connection maybe is compromise\");\n }\n\n }", "private void validaciónDeRespuesta()\n\t{\n\t\ttry {\n\n\t\t\tString valorCifrado = in.readLine();\n\t\t\tString hmacCifrado = in.readLine();\n\t\t\tbyte[] valorDecifrado = decriptadoSimetrico(parseBase64Binary(valorCifrado), llaveSecreta, algSimetrica);\n\t\t\tString elString = printBase64Binary(valorDecifrado);\n\t\t\tbyte[] elByte = parseBase64Binary(elString);\n\n\t\t\tSystem.out.println( \"Valor decifrado: \"+elString + \"$\");\n\n\t\t\tbyte[] hmacDescifrado = decriptarAsimetrico(parseBase64Binary(hmacCifrado), llavePublica, algAsimetrica);\n\n\t\t\tString hmacRecibido =printBase64Binary(hmacDescifrado);\n\t\t\tbyte[] hmac = hash(elByte, llaveSecreta, HMACSHA512);\n\t\t\tString hmacGenerado = printBase64Binary(hmac);\n\n\n\n\n\t\t\tboolean x= hmacRecibido.equals(hmacGenerado);\n\t\t\tif(x!=true)\n\t\t\t{\n\t\t\t\tout.println(ERROR);\n\t\t\t\tSystem.out.println(\"Error, no es el mismo HMAC\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Se confirmo que el mensaje recibido proviene del servidor mediante el HMAC\");\n\t\t\t\tout.println(OK);\n\t\t\t}\n\n\n\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error con el hash\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public boolean verify();", "boolean verifySignature(byte[] message, byte[] signature, PublicKey publicKey) throws IOException;", "int validResponsableAuthentification(Responsable r, String password) throws NoSuchAlgorithmException;", "public abstract String decryptMsg(String msg);", "public lnrpc.Rpc.VerifyMessageResponse verifyMessage(lnrpc.Rpc.VerifyMessageRequest request) {\n return blockingUnaryCall(\n getChannel(), getVerifyMessageMethod(), getCallOptions(), request);\n }", "public static boolean verifyProposeSign(ProposeMessage msg){\n if (Crypto.verifySignature(msg.data, msg.sign, msg.pubkey)) {\n logger.info(\"verifyProposeSign success.\");\n return true;\n } else {\n logger.error(\"verifyProposeSign failed.\");\n return false;\n }\n }", "public abstract boolean verify();", "public static void verify() {\n\n\t\t\t\n\t\t\t\n\t\t\n\t}", "byte[] clientVerifyHash(String HashType, byte[] mastersecret, byte[] handshakemessages) throws NoSuchAlgorithmException, IOException{\n MessageDigest hasher = MessageDigest.getInstance(HashType);\r\n \r\n int padsize = 1;\r\n \r\n switch(HashType){\r\n case \"MD5\": \r\n padsize = 48;\r\n break;\r\n case \"SHA-1\":\r\n padsize = 40;\r\n break;\r\n }\r\n \r\n byte[] pad1 = new byte[padsize];\r\n byte[] pad2 = new byte[padsize];\r\n \r\n for (int i = 0; i < padsize; i++){\r\n pad1[i] = (0x36);\r\n pad2[i] = (0x5C);\r\n }\r\n \r\n baos.write(handshakemessages);\r\n baos.write(mastersecret);\r\n baos.write(pad1);\r\n \r\n byte[] before_HSM = baos.toByteArray();\r\n byte[] hashedHSM = hasher.digest(before_HSM);\r\n \r\n baos.reset();\r\n \r\n baos.write(mastersecret);\r\n baos.write(pad2);\r\n baos.write(hashedHSM);\r\n \r\n byte[] before_complete = baos.toByteArray();\r\n byte[] whole_hash = hasher.digest(before_complete);\r\n \r\n baos.reset();\r\n \r\n System.out.println(\"This is the client certificate verification: \" + Base64.getEncoder().encodeToString(whole_hash));\r\n \r\n return whole_hash;\r\n }", "public boolean verifiySignature() {\n\t\tString data = StringUtil.getStringFromKey(sender) + StringUtil.getStringFromKey(reciepient)\n\t\t\t\t+ Float.toString(value);\n\t\treturn StringUtil.verifyECDSASig(sender, data, signature);\n\t}", "private boolean validateServerMessage(ClientMessage clientMessage, ServerMessage serverMessage) {\n boolean isValid = false;\n try {\n byte[] hash = java.security.MessageDigest.getInstance(\"MD5\").digest(clientMessage.toString().getBytes());\n String encodedHash = new String(java.util.Base64.getEncoder().encode(hash));\n if ((serverMessage.getMessageType().equals(ServerMessage.MessageType.OK)) &&\n (encodedHash.equals(serverMessage.getPayload()))) {\n isValid = true;\n }\n } catch (java.security.NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n return isValid;\n }", "private static boolean verify(Socket s) {\r\n\t\t//TODO: Implement this.\r\n\t\treturn true;\r\n\t}", "private void getAUTH_REQUEST() throws Exception {\n\t\t\n\t\tboolean status = true;\n\t\tboolean status2 = false;\n\t\tString msg = \"\";\n\t\t\n\t\t//File filePK = new File(\"identity\");\n\t\n\t\ttry {\n\t\t\t\n\t\t\tmsg = br.readLine();\n\t\t\tGetTimestamp(\"Received Authorization Request from Client: \" + msg);\n\t\t\t\n\t\t\tJSONObject REQUEST = (JSONObject) parser.parse(msg);\n\t String identity = REQUEST.get(\"identity\").toString();\n\t\t\t\n\t\t\t\n\t if((identity.contains(\"aaron@krusty\"))) {\n\n\t \tGetTimestamp(\"Authorization Request from Client is approved: \");\n\n\t \tGetTimestamp(\"Client Publickey is stored: \" ) ;\n\n\t \tString tosend = encrypt1(getSharedKey(), getClientPublicKey());\n\n\t \tGetTimestamp(\"Server sharedkey is being encrypted with Client's publickey to be sent: \") ;\n\n\t \tJSONObject RESPONSE = new JSONObject();\n\t \tRESPONSE.put(\"command\",\"AUTH_RESPONSE\");\n\t \tRESPONSE.put(\"AES128\", tosend);\n\t \tRESPONSE.put(\"status\", status);\n\t \tRESPONSE.put(\"message\", \"public key found\");\n\n\t \tStringWriter out = new StringWriter();\n\t \tRESPONSE.writeJSONString(out);\n\n\t \tString AUTH_RESPONSE = out.toString();\n\t \tSystem.out.println(AUTH_RESPONSE);\n\n\t \tGetTimestamp(\"Sending Authorization Response to Client: \");\n\n\t \tpw.println(AUTH_RESPONSE);\n\t \tpw.flush();\n\n\n\n\t }\n\t else {\n\n\t \tSystem.out.println(\"Client \" + REQUEST.get(\"identity\") + \" has been rejected\");\n\n\t \tJSONObject RESPONSE = new JSONObject();\n\t \tRESPONSE.put(\"command\",\"AUTH_RESPONSE\");\n\t \tRESPONSE.put(\"status\", status2);\n\t \tRESPONSE.put(\"message\", \"public key not found\");\n\n\t \tStringWriter out = new StringWriter();\n\t \tRESPONSE.writeJSONString(out);\n\n\t \tString AUTH_RESPONSE = out.toString();\n\t \tSystem.out.println(AUTH_RESPONSE);\n\n\t \tpw.println(AUTH_RESPONSE);\n\t \tpw.flush();\n\n\t \tcloseConnection();\n\t }\n\t\t\t\t\n\t\t\t\n\t\t} catch (IOException ex) {\n\t\t\tLogger.getLogger(ServerTCP.class.getName()).log(Level.SEVERE, null, ex);\n\t\t}\n\t\tif (msg.equalsIgnoreCase(\"bye\")) {\n\t\t\tSystem.out.println(\"Client has signed out!\");\n\t\t\tcloseConnection();\n\n\t\t} else {\t\n\t\t\tgetMessage();\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate synchronized boolean auth(Connection con, JsonObject receivedMSG) throws NullPointerException {\n\t\tJSONObject auth = new JSONObject();\n\t\tString command;\n\t\tString info;\n\n\t\t// If already authenticated then reply with invalid message\n\t\tif (broadConnections.contains(con)) {\n\t\t\tInvalidMessage response = new InvalidMessage();\n\t\t\tresponse.setInfo(\"Already authenticated in this server\");\n\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\treturn true;\n\t\t}\n\t\t// Check if provided secret matches the setting\n\t\tString secret = receivedMSG.get(\"secret\").getAsString();\n\t\tif (!secret.equals(Settings.getSecret())) {\n\t\t\tcommand = AUTHENTICATION_FAIL;\n\t\t\t// String authFailMSG = toJsonString();\n\t\t\tinfo = \"the supplied secret is incorrect: \" + secret;\n\t\t\tauth.put(\"command\", command);\n\t\t\tauth.put(\"info\", info);\n\t\t\tcon.writeMsg(auth.toJSONString());\n\t\t\treturn false;\n\t\t}\n\t\tbroadConnections.add(con);\n\t\treturn true;\n\t}", "private byte[] handleAuthPt2(byte[] payload) { \n\t\tbyte[] message = ComMethods.decryptRSA(payload, my_n, my_d);\n\t\tComMethods.report(\"SecretServer has decrypted the User's message using SecretServer's private RSA key.\", simMode);\n\t\t\n\t\tif (!Arrays.equals(Arrays.copyOf(message, myNonce.length), myNonce)) {\n\t\t\tComMethods.report(\"ERROR ~ invalid third message in protocol.\", simMode);\n\t\t\treturn \"error\".getBytes();\n\t\t} else {\n\t\t\t// Authentication done!\n\t\t\tcurrentSessionKey = Arrays.copyOfRange(message, myNonce.length, message.length);\n\t\t\tactiveSession = true;\n\t\t\tcounter = 11;\n\n\t\t\t// use \"preparePayload\" from now on for all outgoing messages\n\t\t\tbyte[] responsePayload = preparePayload(\"understood\".getBytes());\n\t\t\tcounter = 13;\n\t\t\treturn responsePayload;\n\t\t} \n\t}", "public abstract String encryptMsg(String msg);", "@Override\n public boolean verifySignature(byte[] signature) {\n try {\n Element[] sig = derDecode(signature);\n CL04SignPublicPairingKeySerParameter pk = (CL04SignPublicPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(pairingKeySerParameter.getParameters());\n Element a = sig[0];\n Element b = sig[1];\n Element c = sig[2];\n List<Element> A = IntStream.range(3, 3 + messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n List<Element> B = IntStream.range(3 + messages.size(), 3 + 2 * messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n return aFormedCorrectly(pairing, a, A, pk) && bFormedCorrectly(pairing, a, b, A, B, pk) && cFormedCorrectly(pairing, a, b, c, B, pk);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return false;\n\n }", "public com.google.common.util.concurrent.ListenableFuture<lnrpc.Rpc.VerifyMessageResponse> verifyMessage(\n lnrpc.Rpc.VerifyMessageRequest request) {\n return futureUnaryCall(\n getChannel().newCall(getVerifyMessageMethod(), getCallOptions()), request);\n }", "private Boolean checkMessageisRight(byte[] macmessage, byte[] takenmessage, SecretKey encryptionkey) throws Exception\n {\n byte[] mac = macAlgorithm(encryptionkey, takenmessage);\n boolean ret = Arrays.equals(mac, macmessage);\n return ret;\n }", "boolean hasMsg();", "boolean verify(byte[] expected);", "public static boolean verify(byte[] message, byte[] proof, byte[] publicKey) {\n Objects.requireNonNull(message);\n Objects.requireNonNull(proof);\n Objects.requireNonNull(publicKey);\n\n if (proof.length != PROOF_BYTES) {\n throw new IllegalArgumentException(\"Invalid proof length:\" + proof.length);\n }\n\n if (publicKey.length != 32) {\n throw new IllegalArgumentException(\"Invalid public key length:\" + publicKey.length);\n }\n\n byte[] hash = new byte[PROOF_HASH_BYTES];\n Sodium.crypto_vrf_proof_to_hash(hash, proof);\n\n //Verify a proof per draft section 5.3. Return 0 on success, -1 on failure.\n int result = Sodium.crypto_vrf_verify(hash, publicKey, proof, message, message.length);\n return result == 0;\n }", "public boolean auth(boolean reauth) throws IOException {\r\n log.debug(\"auth Authentication method starts\");\r\n if(alreadyAuthorized && !reauth) {\r\n \tlog.debug(\"auth Already Authorized.\");\r\n \treturn true;\r\n }\r\n\r\n AuthCmdPayload sendPayload = new AuthCmdPayload();\r\n log.debug(\"auth Sending CmdPacket with AuthCmdPayload: cmd=\" + Integer.toHexString(sendPayload.getCommand())\r\n + \" len=\" + sendPayload.getPayload().getData().length);\r\n\r\n log.debug(\"auth AuthPayload initial bytes to send: {}\", DatatypeConverter.printHexBinary(sendPayload.getPayload().getData()));\r\n\r\n DatagramPacket recvPack = sendCmdPkt(10000, 2048, sendPayload);\r\n\r\n byte[] data = recvPack.getData();\r\n \r\n if(data.length <= 0) {\r\n log.error(\"auth Received 0 bytes on initial request.\");\r\n alreadyAuthorized = false;\r\n return false;\r\n }\r\n\r\n log.debug(\"auth recv encrypted data bytes (\" + data.length +\") after initial req: {}\", DatatypeConverter.printHexBinary(data));\r\n\r\n byte[] payload = null;\r\n try {\r\n log.debug(\"auth Decrypting encrypted data\");\r\n\r\n payload = decryptFromDeviceMessage(data);\r\n\r\n log.debug(\"auth Decrypted. len=\" + payload.length);\r\n\r\n } catch (Exception e) {\r\n log.error(\"auth Received datagram decryption error. Aborting method\", e);\r\n alreadyAuthorized = false;\r\n return false;\r\n }\r\n\r\n log.debug(\"auth Packet received payload bytes: \" + DatatypeConverter.printHexBinary(payload));\r\n\r\n key = subbytes(payload, 0x04, 0x14);\r\n\r\n log.debug(\"auth Packet received key bytes: \" + DatatypeConverter.printHexBinary(key));\r\n\r\n if (key.length % 16 != 0) {\r\n log.error(\"auth Received key len is not a multiple of 16! Aborting\");\r\n alreadyAuthorized = false;\r\n return false;\r\n }\r\n\r\n // recreate AES object with new key\r\n aes = new AES(iv, key);\r\n\r\n id = subbytes(payload, 0x00, 0x04);\r\n\r\n log.debug(\"auth Packet received id bytes: \" + DatatypeConverter.printHexBinary(id) + \" with ID len=\" + id.length);\r\n\r\n log.debug(\"auth End of authentication method\");\r\n alreadyAuthorized = true;\r\n\r\n return true;\r\n }", "public final boolean isSecureMessaging() {\n\treturn ((header[0] & (byte) 0x0F) == (byte) 0x0C);\n }", "public CryptoSchemeMsg () { }", "public boolean verifySignature() {\n\n String data = StringUtil.getStringFromKey(sender) + StringUtil.getStringFromKey(recipient) + Float.toString(value);\n return StringUtil.verifyECDSASig(sender, data, signature);\n }", "public String verify()\n\t{\n\t\t\treturn null;\n\t}", "private boolean verifyToken(final String token) {\n LOG.debug(token);\n if (!this.verificationToken.equals(token)) {\n LOG.error(Constants.VERIFICATION_TOKEN_INVALID);\n return false;\n }\n return true;\n }", "String getPublicKeyActorReceive();", "public void verifyUser() {\n\t\toutMessage.setAction(1);\n\t\toutMessage.setObject(this.getUser());\n\t\tmodelCtrl.sendServerMessage(outMessage);\n\t\tinMessage = modelCtrl.getServerResponse();\n\t\t//user is verified\n\t\tif (inMessage.getAction() == 1) {\n\t\t\taccept();\n\t\t}\n\t\t//user is not verified, return to start\n\t\telse {\n\t\t\tSystem.out.println(\"User is not verified\");\n\t\t\tdeny();\n\t\t\t\n\t\t}\n\t}", "boolean verifyDeveloperPayload(Purchase p) {\n String payload = p.getDeveloperPayload();\n String messageAfterDecrypt = \"not_empty_line\";\n String password = getString(R.string.check_token);\n ;\n try {\n messageAfterDecrypt = AESCrypt.decrypt(password, payload);\n //Log.e(TAG, \"messageAfterDecrypt \" + messageAfterDecrypt);\n //Log.e(TAG, \"email \" + email);\n } catch (GeneralSecurityException e) {\n e.printStackTrace();\n //handle error - could be due to incorrect password or tampered encryptedMsg\n }\n// if (messageAfterDecrypt.equals(email)){\n// return true;\n// }\n if (Utils.isEmailValid(messageAfterDecrypt)) {\n return true;\n }\n\n return false;\n }", "private boolean checkMsgIntegrity(Connection con, JsonObject json) throws NullPointerException {\n\t\tInvalidMessage response = new InvalidMessage();\n\t\tif (json.get(\"command\") == null) {\n\t\t\tresponse.setInfo(\"No command\");\n\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\treturn false;\n\t\t}\n\t\tswitch (json.get(\"command\").getAsString()) {\n\t\tcase LOGIN:\n\t\t\tif (json.get(\"username\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"Not providing correct username\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase REGISTER:\n\t\t\tif (json.get(\"username\").isJsonNull() || json.get(\"secret\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"Not providing correct username or secret\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase AUTHENTICATE:\n\t\t\tif (json.get(\"secret\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"Not providing secret\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase ACTIVITY_MESSAGE:\n\t\t\tif (json.get(\"username\").isJsonNull() || json.get(\"activity\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"Activity message not complete\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase SERVER_ANNOUNCE:\n\t\t\tif (json.get(\"hostname\").isJsonNull() || json.get(\"port\").isJsonNull() || json.get(\"load\").isJsonNull()\n\t\t\t\t\t|| json.get(\"id\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"Not providing correct server info\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase ACTIVITY_BROADCAST:\n\t\t\tif (json.get(\"activity\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"No activity\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase LOCK_REQUEST:\n\t\t\tif (json.get(\"username\").isJsonNull() || json.get(\"secret\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"Not providing username or secret correctly\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase LOCK_ALLOWED:\n\t\t\tif (json.get(\"username\").isJsonNull() || json.get(\"secret\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"Not providing username or secret correctly\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase LOCK_DENIED:\n\t\t\tif (json.get(\"username\").isJsonNull() || json.get(\"secret\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"Not providing username or secret correctly\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase LOGOUT:\n\t\t\treturn true;\n\t\tcase INVALID_MESSAGE:\n\t\t\tcon.closeCon();\n\t\t\treturn false;\n\t\tdefault:\n\t\t\tresponse.setInfo(\"No such command\");\n\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\tcon.closeCon();\n\t\t\treturn false;\n\t\t}\n\n\t}", "protected void verifyProtocol() throws IOException {\n try {\n outputStream.writeBytes(new RootRequest(repository).getRequestString(), \"US-ASCII\");\n outputStream.writeBytes(new UseUnchangedRequest().getRequestString(), \"US-ASCII\");\n outputStream.writeBytes(new ValidRequestsRequest().getRequestString(), \"US-ASCII\");\n outputStream.writeBytes(\"noop \\n\", \"US-ASCII\");\n } catch (UnconfiguredRequestException e) {\n throw new RuntimeException(\"Internal error verifying CVS protocol: \" + e.getMessage());\n }\n outputStream.flush();\n\n StringBuffer responseNameBuffer = new StringBuffer();\n int c;\n while ((c = inputStream.read()) != -1) {\n responseNameBuffer.append((char)c);\n if (c == '\\n') break;\n }\n\n String response = responseNameBuffer.toString();\n if (!response.startsWith(\"Valid-requests\")) {\n throw new IOException(\"Unexpected server response: \" + response);\n }\n }", "public void verifyMessage(lnrpc.Rpc.VerifyMessageRequest request,\n io.grpc.stub.StreamObserver<lnrpc.Rpc.VerifyMessageResponse> responseObserver) {\n asyncUnimplementedUnaryCall(getVerifyMessageMethod(), responseObserver);\n }", "public void verifyMessage(lnrpc.Rpc.VerifyMessageRequest request,\n io.grpc.stub.StreamObserver<lnrpc.Rpc.VerifyMessageResponse> responseObserver) {\n asyncUnaryCall(\n getChannel().newCall(getVerifyMessageMethod(), getCallOptions()), request, responseObserver);\n }", "ConnectionState getActorConnectionState(String publicKey) throws\n CantValidateConnectionStateException;", "private void verifyMessageDigestAttribute()\n throws CMSException\n {\n ASN1Primitive validMessageDigest = getSingleValuedSignedAttribute(\n CMSAttributes.messageDigest, \"message-digest\");\n if (validMessageDigest == null)\n {\n if (signedAttributeSet != null)\n {\n throw new CMSException(\"the message-digest signed attribute type MUST be present when there are any signed attributes present\");\n }\n }\n else\n {\n if (!(validMessageDigest instanceof ASN1OctetString))\n {\n throw new CMSException(\"message-digest attribute value not of ASN.1 type 'OCTET STRING'\");\n }\n\n ASN1OctetString signedMessageDigest = (ASN1OctetString)validMessageDigest;\n\n if (!Arrays.constantTimeAreEqual(resultDigest, signedMessageDigest.getOctets()))\n {\n throw new CMSSignerDigestMismatchException(\"message-digest attribute value does not match calculated value\");\n }\n }\n }", "public abstract boolean verifyInput();", "boolean isValid(JsonMessage message);", "boolean checkVerification();", "boolean hasMsgid();", "private byte[] handleAuthPt1(byte[] payload) {\n\t\tboolean userIdentified = false;\n\t\tbyte[] supposedUser = null;\n\n//\n\t\tSystem.out.println(\"payload received by SecretServer:\");\n\t\tComMethods.charByChar(payload,true);\n//\n\n\t\tuserNum = -1;\n\t\twhile (userNum < validUsers.length-1 && !userIdentified) {\n\t\t\tuserNum++;\n\t\t\tsupposedUser = validUsers[userNum].getBytes();\n\t\t\tuserIdentified = Arrays.equals(Arrays.copyOf(payload, supposedUser.length), supposedUser);\n\n//\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"\\\"\"+validUsers[userNum]+\"\\\" in bytes:\");\n\t\t\tComMethods.charByChar(validUsers[userNum].getBytes(),true);\n\t\t\tSystem.out.println(\"\\\"Arrays.copyOf(payload, supposedUser.length\\\" in bytes:\");\n\t\t\tComMethods.charByChar(Arrays.copyOf(payload, supposedUser.length),true);\n\t\t\tSystem.out.println();\n//\n\t\t}\n\n\t\tif (!userIdentified) {\n\t\t\tComMethods.report(\"SecretServer doesn't recognize name of valid user.\", simMode);\n\t\t\treturn \"error\".getBytes();\n\t\t} else {\n\t\t\t// Process second half of message, and verify format\n\t\t\tbyte[] secondHalf = Arrays.copyOfRange(payload, supposedUser.length, payload.length);\n//\n\tSystem.out.println(\"secondHalf = \"+secondHalf);\n//\n\t\t\tsecondHalf = ComMethods.decryptRSA(secondHalf, my_n, my_d);\n\n//\n\tSystem.out.println(\"secondHalf = \"+secondHalf);\n//\n\t\t\tComMethods.report(\"SecretServer has decrypted the second half of the User's message using SecretServer's private RSA key.\", simMode);\n\n\t\t\tif (!Arrays.equals(Arrays.copyOf(secondHalf, supposedUser.length), supposedUser)) {\n\t\t\t\t// i.e. plaintext name doesn't match the encrypted bit\n\t\t\t\tComMethods.report(\"ERROR ~ invalid first message in protocol.\", simMode);\t\t\t\t\n\t\t\t\treturn \"error\".getBytes();\n\t\t\t} else {\n\t\t\t\t// confirmed: supposedUser is legit. user\n\t\t\t\tcurrentUser = new String(supposedUser); \n\t\t\t\tuserSet = true;\n\t\t\t\tbyte[] nonce_user = Arrays.copyOfRange(secondHalf, supposedUser.length, secondHalf.length);\n\n\t\t\t\t// Second Message: B->A: E_kA(nonce_A || Bob || nonce_B)\n\t\t\t\tmyNonce = ComMethods.genNonce();\n\t\t\t\tComMethods.report(\"SecretServer has randomly generated a 128-bit nonce_srvr = \"+myNonce+\".\", simMode);\n\t\t\t\n\t\t\t\tbyte[] response = ComMethods.concatByteArrs(nonce_user, \"SecretServer\".getBytes(), myNonce);\n\t\t\t\tbyte[] responsePayload = ComMethods.encryptRSA(response, usersPubKeys1[userNum], BigInteger.valueOf(usersPubKeys2[userNum]));\n\t\t\t\treturn responsePayload;\n\t\t\t}\n\t\t}\n\t}", "private static boolean ValidateTokenSignature(String token, PublicKey publicKey) {\n \tboolean verified=true;\n try {\n \tJwts.parser().setSigningKey(publicKey).parseClaimsJws(token);\n } catch (Exception e) {\n verified=false;\n }\n return verified;\n }", "public static boolean validatePacketLength(ByteArrayBuffer buf, int authTagLen)\n {\n int length = buf.getLength();\n int neededLength = 8 /* sender SSRC */ + 4 /* index */ + authTagLen;\n\n if (length < neededLength) {\n return false;\n }\n return true;\n }", "@Test\r\n public void testVerify() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "Boolean sendMsg(String token, Long chatSessionId, String Content);", "private void respAuth() throws Exception {\n DataOutputStream dos = new DataOutputStream(os);\n dos.writeInt(1);\n dos.writeByte(Message.MSG_RESP_AUTH);\n if (haslogin) {\n dos.writeByte(Message.SUCCESS_AUTH);\n } else {\n dos.writeByte(Message.FAILED_AUTH);\n }\n }", "boolean hasRemsg();", "public synchronized boolean process(Connection con, String msg) {\n\t\tJsonObject receivedMSG;\n\n\t\ttry {\n\t\t\treceivedMSG = parser.parse(msg).getAsJsonObject();\n\t\t\t// System.out.println(\"string to json \" + receivedMSG);\n\t\t} catch (JsonSyntaxException e) {\n\t\t\treturn true;\n\t\t}\n\t\ttry {\n\t\t\t// Check the integrity of the message\n\t\t\tif (!checkMsgIntegrity(con, receivedMSG)) {\n\t\t\t\tcon.closeCon();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tString message = receivedMSG.get(\"command\").getAsString();\n\t\t\tswitch (message) {\n\t\t\tcase REGISTER:\n\t\t\t\treturn !register(con, receivedMSG);\n\t\t\tcase LOGIN:\n\t\t\t\treturn !login(con, receivedMSG);\n\t\t\tcase AUTHENTICATE:\n\t\t\t\treturn !auth(con, receivedMSG);\n\t\t\tcase INVALID_MESSAGE:\n\t\t\t\tcon.closeCon();\n\t\t\t\treturn false;\n\t\t\tcase SERVER_ANNOUNCE:\n\t\t\t\treturn !announce(con, receivedMSG);\n\t\t\tcase LOGOUT:\n\t\t\t\tcon.closeCon();\n\t\t\t\treturn false;\n\t\t\tcase LOCK_REQUEST:\n\t\t\t\treturn !lockRequest(con, receivedMSG);\n\t\t\tcase LOCK_DENIED:\n\t\t\t\treturn !lockProcess(con, receivedMSG);\n\t\t\tcase LOCK_ALLOWED:\n\t\t\t\treturn !lockProcess(con, receivedMSG);\n\t\t\tcase ACTIVITY_BROADCAST:\n\t\t\t\treturn !broadcast(con, receivedMSG);\n\t\t\tcase ACTIVITY_MESSAGE:\n\t\t\t\treturn !broadcast(con, receivedMSG);\n\t\t\tcase AUTHENTICATION_FAIL:\n\t\t\t\tcon.closeCon();\n\t\t\t\treturn false;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (NullPointerException e) {\n\t\t\te.printStackTrace();\n\t\t\tInvalidMessage invalid = new InvalidMessage();\n\t\t\tinvalid.setInfo(\"Not enough info in message,\" + \" possibly no authenticated user in ACTIVITY_BROADCAST ?\");\n\t\t\tcon.writeMsg(invalid.toJsonString());\n\t\t}\n\t\treturn false;\n\t}", "@Order(1)\n\t\t@Test\n\t\tpublic void sendMessageInvalidFromAndTo() throws IOException, ParseException {\n\t\t\t boolean response = Requests.createMessageBoolReturn(JSONUtils.createMessageObject(INVALID_USER_ID, INVALID_USER_ID, \"Test message\"));\n\t\t\t assertFalse(response);\n\t\t\t \n\t\t\t \n\t\t}", "boolean isHello(ProtocolMessage message);", "public boolean acceptOutboundMessage(Object msg)\r\n/* 27: */ throws Exception\r\n/* 28: */ {\r\n/* 29: 76 */ return this.matcher.match(msg);\r\n/* 30: */ }", "private void getMessage() throws Exception {\n\t\tGetTimestamp(\"Getting Message: \");\n\t\tString msg = \"\";\n\t\tString decmsg = \"\";\n\t\tbyte[] result;\n\t\ttry {\n\t\t\tmsg = br.readLine();\n\t\t\tJSONObject RESPONSE = new JSONObject();\n\t\t\tRESPONSE.put(\"payload\", msg);\n\t\t\tSystem.out.println(RESPONSE);\n\t\t\tdecmsg = decrypt(serversharedkey, msg);\n\t\t\tSystem.out.println(\"Decrypted Message from client is \" + decmsg);\n\n\t\t} catch (IOException ex) {\n\t\t\tLogger.getLogger(ServerTCP.class.getName()).log(Level.SEVERE, null, ex);\n\t\t}\n\t\tif (decmsg.equalsIgnoreCase(\"bye\")) {\n\t\t\tSystem.out.println(\"Client has signed out!\");\n\t\t\tcloseConnection();\n\n\t\t} else {\n\t\t\tsendMessage();\n\t\t}\n\n\t}", "private void verify(Document doc) throws Exception {\n secEngine.processSecurityHeader(doc, null, this, crypto);\n }", "public void verifyAlertMessage(String vExpMsg) {\n\t\tvActMessage = myD.findElement(By.id(\"hideMe\")).getText();\n\t\tSystem.out.println(\"Actual Message is :\" + vActMessage);\n\t\tSystem.out.println(\"Expected Message is :\" + vExpMsg);\n\t\tif (vActMessage.equals(vExpMsg)) {\n\t\t\tvResult = \"Pass\";\n\t\t} else {\n\t\t\tvResult = \"Fail\";\n\t\t}\n\t\tSystem.out.println(\"Test Case is a \"+ vResult);\n\t}", "public boolean verifySignature() {\r\n\t\t\r\n\t\tString data;\r\n\t\t\r\n\t\tif(isTypeCreation){\r\n\t\t\t\r\n\t\t\tdata = StringUtil.getStringFromKey(creator) + name +\r\n\t\t\t\t\tdescription + begin + end+end_subscription+\r\n\t\t\t\t\tlocation+min_capacity+max_capacity;\r\n\t\t\treturn StringUtil.verifyECDSASig(creator, data, signature);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdata = StringUtil.getStringFromKey(subscriber)+id_event;\r\n\t\t\treturn StringUtil.verifyECDSASig(subscriber, data, signature);\r\n\t\t}\r\n//\t\tSystem.out.println(\"signature \"+signature);\r\n\t\t\r\n\t}", "public CompletionStage<Result> verify()\n {\n IRequestValidator requestValidator=new CertVerifyRequestValidator();\n return handleRequest(request(),requestValidator, JsonKeys.CERT_VERIFY);\n }", "private void validateSentMessage(String receiver, boolean encrypted, boolean signed) {\n String encryptedText = encrypted ? ENCRYPTED_TEXT : UNENCRYPTED_TEXT;\n String signedText = signed ? SIGNED_TEXT : UNSIGNED_TEXT;\n\n // validate sender name\n Espresso.onView(withId(R.id.sn_message_sender))\n .check(matches(withText(containsString(PEER_NAME))));\n\n // validate message content\n Espresso.onView(withId(R.id.sn_message_content))\n .check(matches(withText(TEST_MESSAGE)));\n\n // validate receiver name or anybody\n Espresso.onView(withId(R.id.sn_message_receivers))\n .check(matches(withText(containsString(receiver))));\n\n // validate if message is encrypted\n Espresso.onView(withId(R.id.sn_message_encrypted))\n .check(matches(withText(containsString(encryptedText))));\n\n // validate if message is signed\n Espresso.onView(withId(R.id.sn_message_verified))\n .check(matches(withText(containsString(signedText))));\n }", "public String verify(){\n String res=\"\";\n int msglen=msgarr.length;\n for(int i=0;i<msglen;i++){\n treecodestr=treecodestr+codeTable[msgarr[i]+DIFF];\n }\n //Now compare treecodestr and filecodestr\n boolean same=treecodestr.equals(filecodestr);\n if(same){\n res=\":) -- This tree has not been modified.\";\n }else{\n res=\":( -- This tree has been modified.\";\n }\n System.out.println(res);\n return res;\n }", "public void assertMsgCheck() {\r\n\t\tassertEquals(successMsg.getText().substring(0,36), \"Success: You have modified products!\");\r\n\t\tSystem.out.println(\"Asserted that the msg has been displayed: \"+ successMsg.getText().substring(0,36));\r\n\t}", "@Override\n public boolean verify(String hostname, SSLSession session) {\n return true;\n }", "@Override\n public boolean verify(String hostname, SSLSession session) {\n return true;\n }", "private void verifyAuthWithServer() {\n mResetModel.connect(\n myBinding.editResetEmail.getText().toString());\n //This is an Asynchronous call. No statements after should rely on the\n //result of connect().\n }", "public boolean message( Who sender, Message msg ) throws Exception;", "public abstract void\n verifyOriginalPacket_(CertificateV2 trustedCertificate);", "private void _verifyAuthCode(Device device,String authCode){\r\n \t\tdevice.setModified(0); // reset modified to get current time.\r\n \t\tif (device.getStatus() != DeviceStatus.Authing.getStatus()) {\r\n \t\t\tthrow new RentException(RentErrorCode.ErrorStatusViolate,\r\n \t\t\t\t\t\"device auth status not match current status is \"+device.getStatus());\r\n \t\t}\r\n \t\t//\r\n \t\t// if device modified + timeout > current time then throw timeout exception.\r\n \t\t// check verify timeout\r\n \t\t//\r\n \t\tMap<String,Object> setting = applicationConfig.get(\"general\");\r\n \tlong time=java.util.Calendar.getInstance().getTimeInMillis()/1000;\r\n \t\tint timeout = (Integer)setting.get(\"auth_verify_timeout\");\r\n \tif (time > device.getModified() + timeout ) {\t\r\n \t\t\tthrow new RentException(RentErrorCode.ErrorAuthExpired,\r\n \t\t\t\t\t\"verify mobile auth code has been timeout\");\r\n \t}\r\n \t\r\n \t\t//\r\n \t\t// check retry count\r\n \t\t//\r\n \t\tint retryLimit = (Integer)setting.get(\"auth_retry_limit\");\r\n \t\tif(logger.isDebugEnabled()) {\r\n \t\t\tlogger.debug(\"retry limit is \"+retryLimit+\" current auth retry is \"+device.getAuthRetry());\r\n \t\t}\r\n \t\tif (device.getAuthRetry() > retryLimit) {\r\n \t\t\tthrow new RentException(RentErrorCode.ErrorExceedLimit,\r\n \t\t\t\t\t\"mobile verify auth retry too many time try:\"\r\n \t\t\t\t\t\t\t+ device.getAuthRetry() + \" > \" + retryLimit);\r\n \t\t}\r\n \r\n \t\t//\r\n \t\t// check auth code\r\n \t\t//\r\n \t\tString token = device.getToken();\r\n \t\tif (!authCode.equals(this.encodeUtility.decrypt(token, Device.ENCRYPT_KEY))) {\r\n \t\t\t//\r\n \t\t\t// if fail update retry status\r\n \t\t\t//\r\n \t\t\tlogger.debug(\"token not match, token is \"+token);\r\n \t\t\tint ret =deviceDao.updateStatusAndRetryCount(device.getId(), device.getUserId(),\r\n \t\t\t\t\tDeviceStatus.Authing.getStatus(),\r\n \t\t\t\t\tDeviceStatus.Init.getStatus(), device.getModified());\r\n \t\t\tif (ret != 1) {\r\n \t\t\t\tthrow new RentException(RentErrorCode.ErrorStatusViolate,\r\n \t\t\t\t\t\t\"update device status count is not 1\");\r\n \t\t\t}\r\n \t\t\tthrow new RentException(RentErrorCode.ErrorAuthFail,\r\n \t\t\t\t\t\"device id \"+device.getId()+\" enter auth code not match\");\r\n \r\n \t\t}\r\n \t\t\r\n \t\t//\r\n \t\t// update device and user in database.\r\n \t\t//\r\n \t\tlogger.debug(\"update device status to authed\");\r\n \t\tdeviceDao.updateStatusAndRetryCount(device.getId(),device.getUserId(),\r\n \t\t\t\tDeviceStatus.Authed.getStatus(),\r\n \t\t\t\tDeviceStatus.Authing.getStatus(),\r\n \t\t\t\tdevice.getModified());\r\n \t\tUser user = device.getUser();\r\n \t\tif (user.getStatus() == UserStatus.Init.getStatus()){\r\n \t\t\tlogger.debug(\"update user status to authed\");\r\n \t\t\tuser.setModified((long)0);\r\n \t\t\tuserDao.updateUserStatus(user.getId(), UserStatus.Authed.getStatus()\r\n \t\t\t\t\t, UserStatus.Init.getStatus(), user.getModified());\r\n \t\t}\r\n \t\t\r\n \t}", "public void testDeserializeMessage() throws Exception {\n String handlerId = \"u7p3$\";\n String requestId = \"i0-s@\";\n AccuracySerializableMessage message = new AccuracySerializableMessage(handlerId, requestId);\n\n long magicNumber = 43265472;\n message.setMagicNumber(magicNumber);\n\n Message message2 = new SerializableMessageSerializer().\n deserializeMessage(new ByteArrayInputStream(serialize(message)));\n\n assertNotNull(\"Message is not deserialized.\", message2);\n assertTrue(\"Incorrect message type.\", message2 instanceof AccuracySerializableMessage);\n\n assertEquals(\"Message data is corrupted.\", magicNumber,\n ((AccuracySerializableMessage) message2).getMagicNumber());\n }", "private void validate (Message m) {\n\n try {\n //get message counter property\n int counter = m.getIntProperty(FailoverQSender.MESSAGE_COUNTER);\n //The counter is set sequentially and must be received in right order.\n //Each message is committed after validated.\n if (counter != (commitCounter + 1)) {\n\t\t\t\t this.printData();\n\t\t\t\t throw new RuntimeException(\"validation failed.\");\n\t\t\t }\n\n log (\"messages validated. ready to commit ...\");\n } catch (JMSException jmse) {\n log (jmse);\n \n \tprintData();\n \n throw new RuntimeException(\"Exception occurred during validation: \" + jmse);\n }\n }", "private boolean verifyMessagePresence(){\n boolean overallResult = true;\n \n for(int ii = 0; ii < 3; ii = ii +1){\n if(121 == getHidden(ii)){\n overallResult = true;\n }else{\n overallResult = false;\n }\n }\n \n return overallResult;\n }", "CloudCredentialStatus verify(@Nonnull AuthenticatedContext authenticatedContext);", "@Override\n\tpublic void processMessage(Message msg) {\n\t\tif (msg.what == ProtocolConst.CMD_LOGIN_SUCESS) {\n\t\t\tsaveData();\n\t\t\tIntent intent = new Intent(this, TuliaoMainActivity.class);\n\t\t\tstartActivity(intent);\n\t\t\tcon.start_check_in();// 登录成功必须要定时发送数据包务端\n\t\t\t//用于掉线重新登录\n\t\t\tString pwd = password_input.getText().toString();\n\t\t\tcon.getTransportWorker().getSelf().setPwd(pwd);\n\t\t} else if (msg.what == ProtocolConst.CMD_LOGIN_SUCESS) {\n\t\t\tmakeTextShort(\"对不起,登录失败!\");\n\t\t}\n\t}", "public byte[] unwrap(byte[] incoming, int start, int len) throws SaslException {\n if (len == 0) {\n return EMPTY_BYTE_ARRAY;\n }\n byte[] mac = new byte[10];\n byte[] msg = new byte[len - 16];\n byte[] msgType = new byte[2];\n byte[] seqNum = new byte[4];\n System.arraycopy(incoming, start, msg, 0, msg.length);\n System.arraycopy(incoming, start + msg.length, mac, 0, 10);\n System.arraycopy(incoming, start + msg.length + 10, msgType, 0, 2);\n System.arraycopy(incoming, start + msg.length + 12, seqNum, 0, 4);\n byte[] expectedMac = getHMAC(peerKi, seqNum, msg, 0, msg.length);\n if (logger.isLoggable(Level.FINEST)) {\n traceOutput(DI_CLASS_NAME, \"unwrap\", \"DIGEST18:incoming: \", msg);\n traceOutput(DI_CLASS_NAME, \"unwrap\", \"DIGEST19:MAC: \", mac);\n traceOutput(DI_CLASS_NAME, \"unwrap\", \"DIGEST20:messageType: \", msgType);\n traceOutput(DI_CLASS_NAME, \"unwrap\", \"DIGEST21:sequenceNum: \", seqNum);\n traceOutput(DI_CLASS_NAME, \"unwrap\", \"DIGEST22:expectedMAC: \", expectedMac);\n }\n if (!Arrays.equals(mac, expectedMac)) {\n logger.log(Level.INFO, \"DIGEST23:Unmatched MACs\");\n return EMPTY_BYTE_ARRAY;\n }\n if (peerSeqNum != networkByteOrderToInt(seqNum, 0, 4)) {\n throw new SaslException(\"DIGEST-MD5: Out of order \" + \"sequencing of messages from server. Got: \" + networkByteOrderToInt(seqNum, 0, 4) + \" Expected: \" + peerSeqNum);\n }\n if (!Arrays.equals(messageType, msgType)) {\n throw new SaslException(\"DIGEST-MD5: invalid message type: \" + networkByteOrderToInt(msgType, 0, 2));\n }\n peerSeqNum++;\n return msg;\n }", "@Override\n public boolean verify(String hostname, SSLSession session) {\n return true;\n }", "public static boolean verify_hash(byte[] messageHash, SecretKeySpec keySpec)\n {\n\tboolean ret = false;\n\t\t\n\ttry {\n\t // Split the array into the message and the digest\n\t byte[] message = new byte[messageHash.length - HMAC_SHA1_LEN];\n\t byte[] hash = new byte[HMAC_SHA1_LEN];\n\t\t\t\n\t System.arraycopy(messageHash, 0, message, 0, message.length);\n\t System.arraycopy(messageHash, message.length, hash, 0, hash.length);\n\t\t\t\n\t // Initialize the MAC with the given key\n\t Mac mac = Mac.getInstance(\"HmacSHA1\");\n\t mac.init(keySpec);\n\t\t\t\n\t // Get the MAC of the message\n\t byte[] m = mac.doFinal(message);\n\t\t\t\n\t // compare the the MAC sent and the one calculated\n\t ret = Arrays.equals(m, hash);\n\t\t\t\n\t} catch (Exception e) {\n\t // if there is an error, we know that hash can't be correct\n\t ret = false;\n\t}\n\t\t\n\treturn ret;\n }", "@Test\n public void testRfc3163Example() throws Exception {\n mockRandom(new byte[]{18, 56, -105, 88, 121, -121, 71, -104});\n\n KeyStore emptyTrustStore = KeyStore.getInstance(KeyStore.getDefaultType());\n emptyTrustStore.load(null, null);\n final SaslServer saslServer = createSaslServer(SaslMechanismInformation.Names.IEC_ISO_9798_U_RSA_SHA1_ENC, \"\",\n getX509KeyManager(serverKeyStore, KEYSTORE_PASSWORD), emptyTrustStore);\n assertNotNull(saslServer);\n assertFalse(saslServer.isComplete());\n\n byte[] tokenBA1 = saslServer.evaluateResponse(new byte[0]);\n byte[] expectedTokenBA1 = CodePointIterator.ofString(\"MAoECBI4l1h5h0eY\").base64Decode().drain();\n assertArrayEquals(expectedTokenBA1, tokenBA1);\n assertFalse(saslServer.isComplete());\n\n byte[] tokenAB = CodePointIterator.ofString(\"MIIBAgQIIxh5I0h5RYegD4INc2FzbC1yLXVzLmNvbaFPFk1odHRwOi8vY2VydHMtci11cy5jb20vY2VydD9paD1odmNOQVFFRkJRQURnWUVBZ2hBR2hZVFJna0ZqJnNuPUVQOXVFbFkzS0RlZ2pscjCBkzANBgkqhkiG9w0BAQUFAAOBgQCkuC2GgtYcxGG1NEzLA4bh5lqJGOZySACMmc+mDrV7A7KAgbpO2OuZpMCl7zvNt/L3OjQZatiX8d1XbuQ40l+g2TJzJt06o7ogomxdDwqlA/3zp2WMohlI0MotHmfDSWEDZmEYDEA3/eGgkWyi1v1lEVdFuYmrTr8E4wE9hxdQrA==\").base64Decode().drain();\n try {\n saslServer.evaluateResponse(tokenAB);\n fail(\"Expected SaslException not thrown\");\n } catch (SaslException expected) {\n // The example specifies the client's certificate using a fake URL (http://certs-r-us.com/cert?ih=hvcNAQEFBQADgYEAghAGhYTRgkFj&sn=EP9uElY3KDegjlr)\n // We do not support certificate URL\n assertTrue(expected.getCause().getMessage().contains(\"Unexpected ASN.1 tag encountered\"));\n }\n assertFalse(saslServer.isComplete());\n }", "static @NonNull ByteBuffer getMsg(int typ, int len) {\n ByteBuffer res = ByteBuffer.wrap(new byte[len]); // Create Authentication Request template\n res.put((byte)((ATH_VER << 4) | typ)); // Set the Qi-Authentication version and the Request type\n return res; // Return the Authentication Request template\n }", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "public void verify() throws InternalSkiException {\n if (SERVER_KEY_VALUE==null || \"\".equals(SERVER_KEY_VALUE.trim())) {\n throw new InternalSkiException(\"Cannot validate server key!\");\n }\n\n byte[] tokenKey = getTokenKey();\n byte[] systemKey = getSystemKey();\n\n if (tokenKey==null || systemKey==null) {\n throw new InternalSkiException(\"Cannot validate token or system keys!\");\n }\n }", "public String getTextToVerify(){\n Reporter.log(\" verify message \"+ getMessage+\"<br>\");\n return getTextFromElement(getMessage);\n }", "public boolean verifyDigitalSignature(VidaasSignature vidaasSignature, String message)\n\t\t\tthrows GeneralSecurityException, IOException {\n\t\tbyte[] sigBytes;\n\t\tSystem.out.println(\"verifyDigitalSignature\");\n\t\t\n\t\tDate now = new Date();\n\t\tif (((now.getTime() - vidaasSignature.getTimestamp()) > (maxMessageAgeSeconds * 1000))\n\t\t\t\t&& (vidaasSignature.getTimestamp() != 0)) {\n\t\t\t// Message is too old\n\t\t\tmessageTooOld = true;\n\t\t} else {\n\t\t\t// Message has not yet expired\n\t\t\tmessageTooOld = false;\n\t\t\tString decodedUrl = decodeSignature(vidaasSignature.getSignature());\n\t\t\tSystem.out.println(\"Decoded:\" + decodedUrl);\n\t\t\tsigBytes = decodedUrl.getBytes();\n\t\t\treturn verifyDigitalSignature(sigBytes, vidaasSignature.getTimestampedMessage(message));\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "@Override\r\n\tprotected void doVerify() {\n\t\t\r\n\t}", "public static boolean verify(PublicKey validationKey, byte [] plainText, byte [] signature){\r\n\t\ttry {\r\n\t\t\tSignature verifier = Signature.getInstance(signatureAlgorithm);\r\n\t\t\tverifier.initVerify(validationKey);\r\n\t\t\tverifier.update(plainText);\r\n\t\t\treturn verifier.verify(signature);\r\n\t\t} catch(SignatureException | NoSuchAlgorithmException | InvalidKeyException e){\r\n\t\t\tlogger.log(Level.WARNING,\"Unable to verify incoming message \"+new String(Arrays.copyOf(plainText, 10))+\"...\",e);\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public interface ContentVerifier\n{\n /**\n * Return the algorithm identifier describing the signature\n * algorithm and parameters this verifier supports.\n *\n * @return algorithm oid and parameters.\n */\n AlgorithmIdentifier getAlgorithmIdentifier();\n\n /**\n * Returns a stream that will accept data for the purpose of calculating\n * a signature for later verification. Use org.bouncycastle.util.io.TeeOutputStream if you want to accumulate\n * the data on the fly as well.\n *\n * @return an OutputStream\n */\n OutputStream getOutputStream();\n\n /**\n * Return true if the expected value of the signature matches the data passed\n * into the stream.\n *\n * @param expected expected value of the signature on the data.\n * @return true if the signature verifies, false otherwise\n */\n boolean verify(byte[] expected);\n}", "private static void validate(byte[] iv, int authTagLength) {\n\n if (ByteUtils.safeBitLength(iv) != IV_BIT_LENGTH) {\n throw new JOSEException(String.format(\"IV length of %d bits is required, got %d\", IV_BIT_LENGTH, ByteUtils.safeBitLength(iv)));\n }\n\n if (authTagLength != AUTH_TAG_BIT_LENGTH) {\n throw new JOSEException(String.format(\"Authentication tag length of %d bits is required, got %d\", AUTH_TAG_BIT_LENGTH, authTagLength));\n }\n }", "private int handleMessage (String msg)\n {\n \tif (state == STATE_CONNECTION_OPEN && msg.equals (expectedRequest))\n \t\t\treturn STATE_REQUEST_RECEIVED;\n \t\n \tif (state == STATE_REQUEST_RECEIVED && msg.matches (expectedUserAgent))\n \t\treturn STATE_AGENT_RECEIVED;\n \t\n \tif (state == STATE_AGENT_RECEIVED && msg.equals (expectedAuthorisation))\n \t\treturn STATE_AUTORISATION_RECEIVED;\n \t\n \tif (state == STATE_AUTORISATION_RECEIVED && msg.equals (\"\"))\n \t\treturn STATE_HEADER_COMPLETE;\n \t\n \tif (state == STATE_HEADER_COMPLETE && msg.equals (expectedLocation))\n \t\treturn STATE_LOCATION_RECEIVED;\n \t\n \treturn STATE_INVALID_HEADER;\n }", "protected boolean isMessageValidated(String pMessageKey){\n\t\treturn wMessages.getMessage(pMessageKey).isMessageValidatedTrue();\n\t}" ]
[ "0.67110676", "0.6431759", "0.6316876", "0.62501246", "0.60756475", "0.5968038", "0.59010834", "0.58813876", "0.5840391", "0.5839106", "0.57832474", "0.57426834", "0.56980455", "0.5647378", "0.5559433", "0.5540938", "0.55047417", "0.55000556", "0.54852116", "0.54173565", "0.541499", "0.5414877", "0.5358837", "0.53432125", "0.53425246", "0.5325453", "0.5313876", "0.5309863", "0.53050536", "0.52921647", "0.5272319", "0.5261766", "0.5228005", "0.5212048", "0.519799", "0.5189231", "0.51806664", "0.51791644", "0.51635903", "0.51431817", "0.5132427", "0.5128295", "0.5112705", "0.51087934", "0.5106244", "0.50898373", "0.50775695", "0.50758857", "0.5075732", "0.50754", "0.5071932", "0.5053473", "0.50529194", "0.5048962", "0.5048541", "0.50476354", "0.5042842", "0.50352275", "0.50240403", "0.50226134", "0.5011528", "0.50039077", "0.49986547", "0.4996698", "0.49966806", "0.49880508", "0.49862188", "0.4982184", "0.4982184", "0.49806392", "0.4977951", "0.49731335", "0.49695516", "0.49672684", "0.4965276", "0.49638286", "0.49594086", "0.49549443", "0.4954826", "0.4949288", "0.4933026", "0.49318492", "0.49307042", "0.49296144", "0.49296144", "0.49296144", "0.49296144", "0.49296144", "0.49296144", "0.49296144", "0.49296144", "0.4929527", "0.49287784", "0.49243754", "0.49213222", "0.4918085", "0.49058816", "0.49052957", "0.4903669", "0.48971808" ]
0.6298597
3
Returns the authentication module whose name is 'module'
private ICMPAuthenticationModule getAuthModule(final String module, final String parameter, final PKIMessage pkimsg) { if(StringUtils.equals(module, CmpConfiguration.AUTHMODULE_HMAC)) { final HMACAuthenticationModule hmacmodule = new HMACAuthenticationModule(parameter); hmacmodule.setSession(this.admin, this.userAdminSession, this.certificateStoreSession); hmacmodule.setCaInfo(this.cainfo); return hmacmodule; } else if(StringUtils.equals(module, CmpConfiguration.AUTHMODULE_ENDENTITY_CERTIFICATE)) { final EndEntityCertificateAuthenticationModule eemodule = new EndEntityCertificateAuthenticationModule(parameter); eemodule.setSession(this.admin, this.caAdminSession, this.certificateStoreSession, this.authorizationSessoin, this.eeProfileSession, this.userAdminSession); return eemodule; } if(!CmpConfiguration.getRAOperationMode()) { if(StringUtils.equals(module, CmpConfiguration.AUTHMODULE_REG_TOKEN_PWD)){ return new RegTokenPasswordExtractor(); } else if(StringUtils.equals(module, CmpConfiguration.AUTHMODULE_DN_PART_PWD)) { return new DnPartPasswordExtractor(parameter); } } errMsg = "Unrecognized authentication module '" + module + "'"; return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public java.lang.CharSequence getModule() {\n return module;\n }", "public java.lang.CharSequence getModule() {\n return module;\n }", "public ICMPAuthenticationModule getUsedAuthenticationModule() {\n\t\treturn this.authModule;\n\t}", "public abstract String getModuleName( );", "String getModuleId();", "public DcModule getModule();", "public String module(String name)\n {\n return modules.get(name);\n }", "public String getModuleName ()\n\n {\n\n // Returns moduleName when called.\n return moduleName;\n\n }", "private String getModuleName() {\n \t\t// If there is an autoconnect page then it has the module name\n \t\tif (autoconnectPage != null) {\n \t\t\treturn autoconnectPage.getSharing().getRepository();\n \t\t}\n \t\tString moduleName = modulePage.getModuleName();\n \t\tif (moduleName == null) moduleName = project.getName();\n \t\treturn moduleName;\n \t}", "public final String getModuleName() {\n return MODULE_NAME;\n }", "Module module() {\n return module;\n }", "public int getModuleId();", "public String getmoduleName() {\t\r\n\treturn ModuleName;\t\r\n}", "private String name(String module)\n {\n return module.split(\"%%\")[1];\n }", "public String getName()\n {\n return MODULE_NAME;\n }", "public String getModuleName() {\n return moduleNameString;\n }", "public String getModuleName() {\n\t\treturn \"university-module-controller>TStaff\";\r\n\t}", "public Module getModule(String name) {\n\t\tif (this._modules == null)\n\t\t\treturn null;\n\t\treturn _modules.get(name);\n\t}", "public oracle.jbo.Row getModule() {\n return (oracle.jbo.Row) getAttributeInternal(MODULE);\n }", "public String getModuleName() {\r\n\t\treturn moduleName;\r\n\t}", "public String getModuleName() {\r\n\t\treturn moduleName;\r\n\t}", "protected String getModuleId() {\n\n return moduleId;\n }", "public Module module() {\n ////\n return module;\n }", "public Optional<T> getModule() {\n return Optional.ofNullable(this.module);\n }", "public int getModuleId() {\n return moduleId_;\n }", "public ModuleDecision getModule() {\n return module;\n }", "public String getAuthMethod() {\n return AUTH_NAME;\n }", "public String getType()\n {\n return MODULE_TYPE;\n }", "public Token getModule()\n {\n return getToken(WordToken.class, 1);\n }", "public int getModuleID ()\n\n {\n\n // Returns moduleID when called.\n return moduleID;\n\n }", "@Override\n public String moduleName() {\n return MODULE_NAME;\n }", "Module getModule(ModuleCode modCode) throws CommandException;", "private static ExtensionAuthentication getAuthenticationExtension() {\n if (extensionAuth == null) {\n extensionAuth =\n Control.getSingleton()\n .getExtensionLoader()\n .getExtension(ExtensionAuthentication.class);\n }\n return extensionAuth;\n }", "public Module findModule(String moduleName) {\n if(modules.containsKey(moduleName))\n return modules.get(moduleName);\n //TODO: search in joined mobiles\n return null;\n }", "public int getModuleId() {\n return moduleId_;\n }", "public String getModuleID() { return \"\"; }", "public String getModuleCode() {\r\n\t\treturn moduleCode;\r\n\t}", "public String getModuleCode() {\r\n\t\treturn moduleCode;\r\n\t}", "@Override\n\tpublic ModuleInfo getModule(String mac) throws HFModuleException {\n\t\tLog.d(\"HFModuleManager\", \"getModule\");\n//\t\tif (!this.isCloudChannelLive()) {\n//\t\t\tthrow new HFModuleException(HFModuleException.ERR_USER_OFFLINE,\n//\t\t\t\t\t\"User is not online\");\n//\t\t}\n\t\t\n\t\tModuleInfo mi = getHFModuleHelper().getRemoteModuleInfoByMac(mac);\n\t\tif (mi == null) {\n\t\t\tthrow new HFModuleException(\n\t\t\t\t\tHFModuleException.ERR_GET_REMOTE_MODULEINFO,\n\t\t\t\t\t\"get moduleinfo from remote err\");\n\t\t}\n\t\tif (mi.getModuleId() == null) {\n\t\t\treturn mi;\n\t\t}\n\t\t\n\t\tModuleIdPayload payload = new ModuleIdPayload();\n\t\tpayload.setModuleId(mi.getModuleId());\n\t\tModuleGetRequest request = new ModuleGetRequest(payload);\n\t\ttry {\n\t\t\tModuleInfoResponse response = cloudModuleManager.getModule(request);\n\t\t\tModuleInfo responseModuleInfo = response.getPayload();\n\t\t\tresponseModuleInfo.setLocalIp(mi.getLocalIp());\n\t\t\tgetHFModuleHelper().addRemoteModuleInfo(responseModuleInfo);\n\t\t\t\n\t\t\treturn responseModuleInfo;\n\t\t} catch (CloudException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\treturn mi;\n//\t\ttry {\n//\t\t\tString reqTemplate = \"{'PL':{'moduleId':'#moduleId#'},'CID':30031,'SID':'#SID#'}\";\n//\t\t\tString req = reqTemplate.replaceFirst(\"#moduleId#\", mi.getModuleId())\n//\t\t\t\t\t.replaceFirst(\"#SID#\", getsid());\n//\n//\t\t\tString rsp = HttpProxy.reqByHttpPost(req);\n//\t\t\tJSONObject jo = new JSONObject(rsp);\n//\n//\t\t\tif (jo.isNull(\"RC\")) {\n//\t\t\t\tthrow new HFModuleException(\n//\t\t\t\t\t\tHFModuleException.ERR_GET_REMOTE_MODULEINFO,\n//\t\t\t\t\t\t\"get moduleinfo from remote err\");\n//\t\t\t}\n//\t\t\tif (jo.getInt(\"RC\") == 1) {\n//\t\t\t\tJSONObject rspPL = jo.getJSONObject(\"PL\");\n//\t\t\t\tModuleInfo rspInfo = new ModuleInfo();\n//\t\t\t\trspInfo.fromJson(rspPL);\n//\n//\t\t\t\tif (mi != null) {\n//\t\t\t\t\trspInfo.setLocalIp(mi.getLocalIp());\n//\t\t\t\t}\n//\t\t\t\tgetHFModuleHelper().addRemoteModuleInfo(mi);\n//\t\t\t\treturn rspInfo;\n//\t\t\t} else {\n//\t\t\t\treturn mi;\n//\t\t\t}\n//\t\t} catch (JSONException e) {\n//\t\t\treturn mi;\n//\t\t}\n\t}", "public Long getModuleId() {\n return moduleId;\n }", "public String getModuleTypeClass();", "String getModuleDisplayName();", "public MetadataModule getPhysicalModule() {\n\t\treturn attributes.getModule();\n\t}", "public RubyModule getModule(String name) {\n return (RubyModule) objectClass.getConstantAt(name);\n }", "@Override\n\tpublic String getModuleName() {\n\t\treturn \"kereneducation\";\n\t}", "@Override\n\tpublic String getModuleName() {\n\t\treturn \"kereneducation\";\n\t}", "ModuleType type();", "public int getModuleType() {\n\t\treturn 0;\n\t}", "ModulePath getModulePath();", "public String getModuleName() {\n if (repository == null) {\n return baseName;\n } else {\n StringBuffer b = new StringBuffer();\n repository.getRelativePath(b);\n b.append(baseName);\n return b.toString();\n }\n }", "public ModuleReference getModule (String name) {\n ModuleReference ref = this.moduleTable.get(name);\n if (ref == null) {\n \tthrow new IllegalArgumentException(\"Module \\\"\" + name + \"\\\" does not exist.\");\n }\n \n return ref;\n }", "@Override\n\tpublic String getModuleName() {\n\t\treturn \"kerenrh\";\n\t}", "ModuleIdentifier getId();", "@Override\n\tpublic String getModuleName() {\n\t\treturn MenuType.GA_READ.getNodeName();\n\t}", "Optional<Module> getReadModule();", "public String getmoduleID() {\t\r\n\treturn ModuleID;\t\r\n}", "public ProgramModule getModule(String treeName, String name);", "Value require(String module);", "AbstractModule getGuiceModule();", "java.lang.String getAuthentication(int index);", "public int getSelectedModule() {\n\t\treturn selectedModule;\n\t}", "public int getCcdModule() {\n return ccdModule;\n }", "public String getAuthentication() {\r\n return authentication;\r\n }", "@Override\n public String getApiWrapperModuleName() {\n List<String> names = Splitter.on(\".\").splitToList(packageName);\n return names.get(0);\n }", "public JkModuleId moduleId() {\n return moduleId;\n }", "@Override\n protected String getModuleName() {\n return LUMEN_AGENT_NAME;\n }", "Object getPerm(String name);", "java.lang.String getAuth();", "java.lang.String getAuth();", "java.lang.String getAuth();", "public XmlModule getModule() {\n return module;\n }", "@Override\n public String getModuleName() {\n return \"kerencore\";\n }", "protected String getAuthMethod() {\n return \"Token\" ;// TODO this.conf.getAuthMethod();\n }", "public long getModuleId() {\r\n throw new UnsupportedOperationException(\"please override this method in sub-class.\");\r\n }", "public Token getName()\n {\n if (isVersion())\n {\n return getVersion();\n }\n\n return getModule();\n }", "@Override\n\tpublic java.lang.String getParallelModule() {\n\t\treturn _scienceApp.getParallelModule();\n\t}", "int getLoginType();", "String getModuleVersionNumber();", "public static Module getModule(String key) {\r\n Module module = null;\r\n module = (Module) SET.get(key);\r\n module.setSymbol(key);\r\n return module;\r\n }", "public static Module getModuleForIndex(int index) {\r\n return getModule((String) KEYS.get(index));\r\n }", "public String getName() {\n return Token2Constants.AUTHENTICATOR_NAME;\n }", "@Override\n\tpublic String getModuleName() {\n\t\treturn \"de.th_koeln.iws.sh2.OXPathValidatorJUnit\";\n\t}", "public static int getModule1L5() {\r\n return Module1L5;\r\n }", "@Override\n\tpublic String getModuleName() {\n\t\treturn \"nl.tue.fingerpaint.Fingerpaint\";\n\t}", "public String getAssetModuleId();", "String getFriendlyName(YAPIContext ctx) throws YAPI_Exception\n {\n if (_classname.equals(\"Module\")) {\n if (_logicalName.equals(\"\"))\n return _serial + \".module\";\n else\n return _logicalName + \".module\";\n } else {\n YPEntry moduleYP = ctx._yHash.resolveFunction(\"Module\", _serial);\n String module = moduleYP.getFriendlyName(ctx);\n int pos = module.indexOf(\".\");\n module = module.substring(0, pos);\n if (_logicalName.equals(\"\"))\n return module + \".\" + _funcId;\n else\n return module + \".\" + _logicalName;\n }\n }", "String getModID();", "String getModID();", "@Override\n public com.gensym.util.Symbol getContainingModule() throws G2AccessException {\n java.lang.Object retnValue = getAttributeValue (SystemAttributeSymbols.CONTAINING_MODULE_);\n return (com.gensym.util.Symbol)retnValue;\n }", "String getComponentAccessToken();", "public static synchronized final MaxModule getModule() {\n if (sModule == null) {\n sModule = new MMXModule();\n }\n return sModule;\n }", "@Override\n public String toString() {\n return String.format(\"Module '%s'\", getName());\n }", "public int getID()\n {\n return MODULE_ID;\n }", "public Module getModule(Long id) {\n\t\tRecord row = dslContext.selectFrom(table(CmsTable.MODULES.getTableName()))\n\t\t\t\t.where(field(\"id\").equal(id)).fetchOne();\n\t\t\n\t\treturn row == null ? null : row.map(new ModuleRecordMapper());\n\t}", "public Token getModuleVersion()\n {\n // ie: use Module 'x'\n if (!getToken(OperatorToken.class, 3).isNull())\n {\n return Token.NULL;\n }\n\n return getToken(NumberToken.class, 2);\n }", "@Override\n public int getModuleType() {\n return ModuleType.TYPE_CALLLOG;\n }", "private com.tangosol.coherence.Component get_Module()\n {\n return this;\n }", "private com.tangosol.coherence.Component get_Module()\n {\n return this;\n }", "private com.tangosol.coherence.Component get_Module()\n {\n return this;\n }", "private com.tangosol.coherence.Component get_Module()\n {\n return this;\n }" ]
[ "0.6534928", "0.65051234", "0.645674", "0.63632625", "0.6269496", "0.6214113", "0.612932", "0.6122649", "0.60982406", "0.6032232", "0.60314184", "0.6013856", "0.5995447", "0.59285694", "0.59035766", "0.5892119", "0.5821067", "0.5816286", "0.581196", "0.5793794", "0.5793794", "0.57601297", "0.5756284", "0.57541823", "0.57253134", "0.57246816", "0.5717831", "0.5713764", "0.56842154", "0.5679249", "0.5678687", "0.5671515", "0.5665151", "0.5659025", "0.565664", "0.56419957", "0.5612607", "0.5612607", "0.56007135", "0.5599432", "0.5582461", "0.55518997", "0.5514608", "0.54931694", "0.5477739", "0.5477739", "0.5448948", "0.5440448", "0.54352903", "0.54350126", "0.5411038", "0.5408562", "0.5406817", "0.53761536", "0.5360338", "0.5359317", "0.5345441", "0.5334457", "0.5303455", "0.52999353", "0.5298176", "0.5296811", "0.52924246", "0.5288655", "0.527527", "0.5259472", "0.52432233", "0.52369106", "0.52369106", "0.52369106", "0.52223647", "0.52063715", "0.5198406", "0.5181278", "0.5157176", "0.5132303", "0.5129651", "0.51278204", "0.5127596", "0.5119477", "0.5118507", "0.5116221", "0.5081501", "0.50754386", "0.50728846", "0.5038012", "0.5026181", "0.5026181", "0.5017668", "0.50172895", "0.50161624", "0.50145525", "0.501132", "0.5009681", "0.5005899", "0.50051045", "0.4996592", "0.4996592", "0.4996592", "0.4996592" ]
0.63173115
4
It loads a map from map file txt, accepts integers from the file and passes the integer value to the map constructor.
public static Map loadMap(String MapFile){ int Bottle =0; int Bottle1= 0; Map Object = new Map(0,0); try { Scanner scan = new Scanner(new File(MapFile)); FileReader fr = new FileReader(MapFile); while(scan.hasNextLine()){ if (scan.hasNextInt()){ Bottle = scan.nextInt(); Bottle1 = scan.nextInt(); } Object = new Map(Bottle,Bottle1); } fr.close(); } catch (Exception e){ System.out.println("Sorry Nothing Found"); System.out.println(e.toString()); e.printStackTrace(); } return Object; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Map readMap(File f)\n {\n Map map = new Map(1);\n try\n {\n MapReader run = new MapReader();\n Scanner mapReader = new Scanner(f);\n ArrayList<String[]> numberLines = new ArrayList<String[]>();\n int dim = mapReader.nextInt();\n mapReader.nextLine();\n for(int gh = 0 ; gh < dim; gh++)\n {\n String[] nums = mapReader.nextLine().split(\" \");\n numberLines.add(nums);\n }\n int[][] newMap = new int[numberLines.size()][numberLines.size()];\n \n for(int i = 0; i < numberLines.size();i++)\n {\n for(int h = 0; h < numberLines.get(i).length;h++)\n {\n newMap[i][h] = Integer.parseInt(numberLines.get(i)[h]);\n }\n }\n map.loadMap(newMap);\n \n TreeMap<Integer,ArrayList<Integer>> spawn1 = map.getSpawn1();\n TreeMap<Integer,ArrayList<Integer>> spawn2 = map.getSpawn2();\n \n String line = \"\";\n while(mapReader.hasNextLine() && (line = mapReader.nextLine()).contains(\"spawn1\"))\n {\n Scanner in = new Scanner(line);\n in.next();\n int x = in.nextInt();\n spawn1.put(x, new ArrayList<Integer>());\n while(in.hasNextInt())\n {\n spawn1.get(x).add(in.nextInt());\n }\n }\n \n if(!line.equals(\"\"))\n {\n Scanner in = new Scanner(line);\n in.next();\n int x = in.nextInt();\n spawn2.put(x, new ArrayList<Integer>());\n while(in.hasNextInt())\n {\n spawn2.get(x).add(in.nextInt());\n }\n }\n while(mapReader.hasNextLine() && (line = mapReader.nextLine()).contains(\"spawn2\"))\n {\n Scanner in = new Scanner(line);\n in.next();\n int x = in.nextInt();\n spawn2.put(x, new ArrayList<Integer>());\n while(in.hasNextInt())\n {\n spawn2.get(x).add(in.nextInt());\n }\n }\n }\n catch (Exception ex)\n {\n JOptionPane.showMessageDialog(null, \"Corrupted file!\");\n }\n return map;\n }", "public void loadMap(String filepath) {\n\n\t\ttry {\n\n\t\t\tInputStream in = getClass().getResourceAsStream(filepath);\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(in));\n\n\t\t\tnumCols = Integer.parseInt(br.readLine());\n\t\t\tnumRows = Integer.parseInt(br.readLine());\n\t\t\tmap = new int[numRows][numCols];\n\t\t\twidth = numCols * tileSize;\n\t\t\theight = numRows * tileSize;\n\n\t\t\tString delims = \"\\\\s+\";\n\t\t\tfor (int row = 0; row < numRows; row++) {\n\t\t\t\tString line = br.readLine();\n\t\t\t\tString[] tokens = line.split(delims);\n\t\t\t\tfor (int col = 0; col < numCols; col++) {\n\t\t\t\t\tmap[row][col] = Integer.parseInt(tokens[col]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public static Map readMap(MapName s)\n {\n Map map = new Map(1);\n try\n {\n MapReader run = new MapReader();\n System.out.println(s.toString());\n Scanner mapReader = new Scanner(run.getClass().getResourceAsStream(\"/\"+s.toString()+\".jwmap\"));\n ArrayList<String[]> numberLines = new ArrayList<String[]>();\n int dim = mapReader.nextInt();\n mapReader.nextLine();\n for(int gh = 0 ; gh < dim; gh++)\n {\n String[] nums = mapReader.nextLine().split(\" \");\n numberLines.add(nums);\n }\n int[][] newMap = new int[numberLines.size()][numberLines.size()];\n \n for(int i = 0; i < numberLines.size();i++)\n {\n for(int h = 0; h < numberLines.get(i).length;h++)\n {\n newMap[i][h] = Integer.parseInt(numberLines.get(i)[h]);\n }\n }\n map.loadMap(newMap);\n \n TreeMap<Integer,ArrayList<Integer>> spawn1 = map.getSpawn1();\n TreeMap<Integer,ArrayList<Integer>> spawn2 = map.getSpawn2();\n \n String line = \"\";\n while(mapReader.hasNextLine() && (line = mapReader.nextLine()).contains(\"spawn1\"))\n {\n Scanner in = new Scanner(line);\n in.next();\n int x = in.nextInt();\n spawn1.put(x, new ArrayList<Integer>());\n while(in.hasNextInt())\n {\n spawn1.get(x).add(in.nextInt());\n }\n }\n \n if(!line.equals(\"\"))\n {\n Scanner in = new Scanner(line);\n in.next();\n int x = in.nextInt();\n spawn2.put(x, new ArrayList<Integer>());\n while(in.hasNextInt())\n {\n spawn2.get(x).add(in.nextInt());\n }\n }\n while(mapReader.hasNextLine() && (line = mapReader.nextLine()).contains(\"spawn2\"))\n {\n Scanner in = new Scanner(line);\n in.next();\n int x = in.nextInt();\n spawn2.put(x, new ArrayList<Integer>());\n while(in.hasNextInt())\n {\n spawn2.get(x).add(in.nextInt());\n }\n }\n }\n catch (Exception ex)\n {\n JOptionPane.showMessageDialog(null, \"Corrupted file!\");\n }\n return map;\n }", "public MapData(String mapName) {\n this.mapName = mapName;\n readFile();\n}", "void readMap()\n {\n try {\n FileReader\t\tmapFile = new FileReader(file);\n StringBuffer\tbuf = new StringBuffer();\n int\t\t\t\tread;\n boolean\t\t\tdone = false;\n \n while (!done)\n {\n read = mapFile.read();\n if (read == -1)\n done = true;\n else\n buf.append((char) read);\n }\n \n mapFile.close();\n \n parseMap(buf.toString());\n \n } catch (Exception e) {\n ErrorHandler.displayError(\"Could not read the map file data.\", ErrorHandler.ERR_OPEN_FAIL);\n }\n }", "public static int[][] loadMap(String fileName) throws Exception{\n FileReader fr=new FileReader(fileName);\n int c;\n String str=\"\";\n List<String> strA=new ArrayList<>(); //list of lines\n //process out newlines from midline\n while((c=fr.read())!=-1){\n System.out.print((char)c); //show map\n if(!(((char)c=='\\n') || ((char)c=='\\r'))){str=str+(char)c;}\n else if(((char)c=='\\n' || (char)c=='\\r')){\n if(strA.size()<1) {strA.add(str);str=\"\";}\n else if(strA.size()>0 && strA.get(0).length()>str.length()){} //newline char found midline\n else {strA.add(str);str=\"\";}\n }\n else System.out.println(\"Err: \"+(char)c);\n }\n strA.add(str);\n System.out.println(\"\\nWidth: \"+str.length()+\"\\nHeight: \"+strA.size());\n //now that size is known, fill info array\n int[][] map=fillMap(strA);\n \n return map;\n }", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n public void loadMap(Map map, Class<?> keyClass, Class<?> valueClass)\n throws Exception {\n int length = readInt();\n\n for (int i = 0; i < length; i++) {\n Object key = keyClass.newInstance();\n Object value = valueClass.newInstance();\n\n if (keyClass.getName()\n .endsWith(\"String\")) {\n key = readString();\n } else {\n load(key);\n }\n\n if (valueClass.getName()\n .endsWith(\"String\")) {\n value = readString();\n } else {\n load(value);\n }\n\n map.put(key, value);\n }\n }", "public void initialilzeMapEntry(String file){\n\t\tmap.put(file, new LinkedList<HashMap<Integer, Integer>>());\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tprivate void readMapFromFile() {\r\n\t\ttry {\r\n\t\t\tType type = new TypeToken<HashMap<String, Country>>() {}.getType();\r\n\t\t\tthis.daoMap = (HashMap<String, Country>) gson.fromJson(new FileReader(path), type);\r\n\t\t} catch (JsonSyntaxException | JsonIOException | FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}", "Map(String input) {\n row = 0;\n col = 0;\n\n String line;\n Scanner fin = null;\n try\n {\n fin = new Scanner(new File(input));\n }\n catch (FileNotFoundException x)\n {\n System.out.println(\"Error: \" + x);\n System.exit(0);\n }\n // Take first line and get mapLength and mapHeight. Initialize map array\n line = fin.nextLine();\n String[] temp = line.split(\" \");\n maxR = Integer.parseInt(temp[0].toString());\n maxC = Integer.parseInt(temp[1].toString());\n map = new String[maxR][maxC];\n\n for(int j = 0; j < maxR; j++) {\n line = fin.nextLine();\n for(int i = 0; i < maxC; i++){\n map[j][i] = (line.charAt(i)) + \"\";\n }\n }\n }", "private void initMapData() {\n\n\t\ttry {\n\n\t\t\t@SuppressWarnings(\"resource\")\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(mapFile));\n\t\t\t\n\t\t\tfor (int row = 0; row < height; row++) {\n\t\t\t\t\n\t\t\t\t// read a line\n\t\t\t\tString line = br.readLine();\n\t\t\t\t\n\t\t\t\t// if length of this line is different from width, then throw\n\t\t\t\tif (line.length() != width)\n\t\t\t\t\tthrow new InvalidLevelFormatException();\n\t\t\t\t\n\t\t\t\t// split all single characters of this string into array\n\t\t\t\tchar[] elements = line.toCharArray();\n\t\t\t\t\n\t\t\t\t// save these single characters into mapData array\n\t\t\t\tfor (int col = 0; col < width; col++) {\n\t\t\t\t\tmapElementStringArray[row][col] = String.valueOf(elements[col]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public static MobilityMap parseMap( String filename ) throws FileNotFoundException\r\n {\r\n File f = new File( filename );\r\n return parseMap( f );\r\n }", "void parseMap(String mapData)\n {\n try {\n \n StringTokenizer\tst = new StringTokenizer(mapData);\n \n int\t\tsizeX, sizeY;\n int\t\tx = 0;\n int\t\ty = 0;\n int\t\te;\n char\tt;\n \n // Get the size of the map\n sizeX = Integer.parseInt(st.nextToken());\n sizeY = Integer.parseInt(st.nextToken());\n \n map = new MUXMap(sizeX, sizeY);\n \n // Loop thru each line\n while (st.hasMoreTokens())\n {\n String\t\t\tthisLine = st.nextToken();\n \n // Think the map is over if we hit this thing\n if (thisLine.equals(\"-1\") || thisLine.startsWith(\"-1 \"))\n break;\n \n for (x = 0; x < sizeX * 2; x+=2)\n {\n // Get terrain and elevation, then set the data in the map\n t = thisLine.charAt(x);\n e = Character.digit(thisLine.charAt(x + 1), 10);\n map.setHex(x/2, y, t, e);\n }\n \n // One more line down in y\n y++;\n } \n } catch (Exception e) {\n System.out.println(\"Error: readMap: \" + e);\n }\n \n }", "public MapProcessor(String mapFile) throws IOException\n {\n validateReflexMapFile(mapFile);\n\n if (reflexValidated)\n {\n //Set the map file parameter\n this.mapFile = mapFile;\n\n //Initialize the map scanner\n mapScanner = new Scanner(new File(mapFile));\n\n //Tell the user everything is honky dory for the scanner\n System.out.println(\"\\nLoaded your file: \" + mapFile);\n\n //The name of the file with the modification in the name\n String partialFileName = mapFile.substring(0, mapFile.length() - 4);\n\n //Initialize the file writer\n mapWriter = new FileWriter(partialFileName + \"_BrushShifted.map\");\n\n //Tell the user everything is honky dory for the writer\n System.out.println(\"Initialized empty map file for writing: \" + partialFileName + \"_BrushShifted.map\");\n\n lines = new String[lineCount()];\n System.out.println(\"Created array of lines with size \" + lines.length + \"\\n\");\n }\n }", "TiledMap loadMap(String path);", "public static boolean loadMap(String path) throws FileNotFoundException {\n\n// System.out.println(\" Enter map file address\");\n// String path = sc.next();\n\n // ---------------- Reading file-------------------------------\n File file_map = new File(path.trim());\n HashMap<String, List<String>> neighborsList = new HashMap<>();\n\n if (file_map.exists()) {\n Scanner myReader = new Scanner(file_map);\n\n while (myReader.hasNextLine()) {\n\n String data = myReader.nextLine();\n\n if (\"[Continents]\".equals(data.trim())) {\n System.out.println(\"==>\" + data.trim());\n data = myReader.nextLine();\n\n while (!data.equals(\"[Territories]\")) {\n System.out.println(data);\n String split[] = data.split(\"=\");\n String continent_name = split[0];\n String no_of_countries = split[1];\n continents.put(continent_name, Integer.parseInt(no_of_countries));\n data = myReader.nextLine();\n }\n }\n\n System.out.println(\"continents: \" + continents.toString());\n board.setContinents(continents);\n\n if (\"[Territories]\".equals(data)) {\n\n while (myReader.hasNextLine()) {\n String country_input = myReader.nextLine();\n\n String split[] = country_input.split(\",\");\n String country = split[0];\n int x = Integer.parseInt(split[1]);\n int y = Integer.parseInt(split[2]);\n String continent = split[3];\n List<String> neighbours = new ArrayList<>();\n\n for (int i = 4; i < split.length; i++) {\n neighbours.add(split[i]);\n }\n\n board.createTile(country, x, y, continent);\n neighborsList.put(country, neighbours);\n\n }\n }\n\n for (Map.Entry entry : neighborsList.entrySet()) {\n board.setNeighbourTile((List<String>) entry.getValue(), (String) entry.getKey());\n }\n\n\n }\n System.out.println(\"Risk Map Loaded!\");\n HashMap<String, Tile> map = board.getTiles();\n\n System.out.println(\"Map\" + map.keySet().toString());\n\n if (board.getContinents().size() == 0 || board.getTiles().size() == 0)\n return false;\n return true;\n\n } else {\n System.out.println(\"File does not exist! \");\n return false;\n }\n\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic VariableMapReader(String sdgFile) throws IOException {\n\t\tObjectInputStream defStream = new ObjectInputStream(new FileInputStream(new File(sdgFile+\"_def\")));\n\t\tObjectInputStream useStream = new ObjectInputStream(new FileInputStream(new File(sdgFile+\"_use\")));\n\t\tObjectInputStream modStream = new ObjectInputStream(new FileInputStream(new File(sdgFile+\"_mod\")));\n\t\tObjectInputStream refStream = new ObjectInputStream(new FileInputStream(new File(sdgFile+\"_ref\")));\n\t\tObjectInputStream ptoStream = new ObjectInputStream(new FileInputStream(new File(sdgFile+\"_pto\")));\n\n\t\ttry {\n\t\t\tdef = (Map<Integer, Set<Integer>>) defStream.readObject();\n\t\t\tuse = (Map<Integer, Set<Integer>>) useStream.readObject();\n\t\t\tmod = (Map<Integer, Set<Integer>>) modStream.readObject();\n\t\t\tref = (Map<Integer, Set<Integer>>) refStream.readObject();\n\t\t\tpto = (Map<Integer, Set<Integer>>) ptoStream.readObject();\n\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tdefStream.close();\n\t\tuseStream.close();\n\t\tmodStream.close();\n\t\trefStream.close();\n\t\tptoStream.close();\n\t}", "public GameLogic(String mapFile) throws FileNotFoundException,\n\t\t\tParseException {\n\t\tthis.map = new Map(mapFile);\n\n\t\t// Check if there is enough gold to win\n\t\tif (this.map.remainingGold() < this.map.getGoal()) {\n\t\t\tthrow new IllegalStateException(\n\t\t\t\t\t\"There isn't enough gold on this map for you to win\");\n\t\t}\n\n\t\tthis.players = new ArrayList<Player>();\n\t}", "public GameMap(int mapNum) {\n numRow = 0;\n numCol = 0;\n String path;\n switch(mapNum) {\n\n case 1:\n path = Constants.PATH_TO_MAP_11;\n break;\n case 2:\n path = Constants.PATH_TO_MAP_12;\n break;\n case 3:\n path = Constants.PATH_TO_MAP_21;\n break;\n case 4:\n path = Constants.PATH_TO_MAP_22;\n break;\n default: //this should never happen\n path = Constants.PATH_TO_MAP_11;\n }\n\n\n //the following line populates the double ArrayList of SquareAbstract (squares)\n List<String> readList = generateSquareStructureFromFile(path);\n\n //now we're gonna link all the squares (to build a graph) inside the generated square structure\n linkSquares(readList);\n\n generateRooms();\n\n populateRooms();\n }", "public Map(String inputFile) throws MapException, IOException, GraphException{\n\t\t\n\t\tthis.testLine = \"Luka<3<3\";\t\t\t// initiate testline to a string that will not be seen from input\n\t\tthis.changeCount = -1;\t\t\t\t// initiate the change counter used for recursive calls in other methods\n\t\tthis.input = inputFile;\t\t\t\t// set the input file\n\t\tthis.S = new Stack<Node>();\t\t\t// initiate the stack storing a path\n\t\t\n\t\t// make a file and make sure it exists, throw an exception otherwise\n\t\tFile inputFileTest = new File(this.input);\n\t\tif(!inputFileTest.exists()){\n\t\t\tthrow new MapException(\"File attempting to be input does not exist.\");\n\t\t}\n\t\t\t\t\n\t\t// create a buffered reader of the file\n\t\tBufferedReader inputScan = new BufferedReader(new FileReader(inputFileTest));\n\t\t\n\t\tint count = 0;\n\t\tString s;\t\t\t\t// 1st string for parsing\n\t\tString s2 = null;\t\t// 2nd string for parsing\n\t\t\n\t\t// loop through the first 4 lines of the input to parse necessary data\n\t\twhile (count < 4){\n\t\t\t\n\t\t\t//read a line of the file\n\t\t\ts = inputScan.readLine();\n\t\t\tcount++;\n\t\t\t\n\t\t\t//set width based on number on 2nd line\n\t\t\tif (count == 2){\n\t\t\t\tthis.width = Integer.parseInt(s.trim());\n\t\t\t}\n\t\t\t\n\t\t\t//set height based on number on 3nd line\n\t\t\tif (count == 3){\n\t\t\t\tthis.height = Integer.parseInt(s.trim());\n\t\t\t}\n\t\t\t\n\t\t\t//set changes based on number on 4th line\n\t\t\tif (count == 4){\n\t\t\t\tthis.changes = Integer.parseInt(s.trim());\n\t\t\t}\n\t\t}\n\t\t//create a graph based on width and height\n\t\tthis.graph = new Graph(this.width * this.height);\n\t\t\n\t\tint countNode = -1; \t\t\t\t// int to count the number of the node in the graph (corresponds to Node name)\n\t\t\n\t\t// read 2 lines of the file and store them in separate variables as long as it is not the end of the file\n\t\ts = inputScan.readLine();\n\t\tif (s!=null){\n\t\t\ts2 = inputScan.readLine();\n\t\t}\n\t\t\n\t\t// loop as long as there is 1 line to parse\n\t\twhile (s!=null){\n\t\t\t// prepare 2 string readers to use to parse both strings (if both exist, only 1 if not)\n\t\t\tStringReader in = new StringReader(s);\n\t\t\tStringReader in2 = null;\n\t\t\tif (s2!=null){\n\t\t\t\tin2 = new StringReader(s2);\n\t\t\t}\n\t\t\tint j = 0;\t\t\t\t\t\t\t// used to store int representation of characters in string 1\n\t\t\tint k = 0;\t\t\t\t\t\t\t// used to store int representation of characters in string 2\n\t\t\tint stringLength = s.length();\t\t// length of the strings (should be equal if input is valid)\n\t\t\t\n\t\t\t//loop through parsing the strings as long as they have characters to parse\n\t\t\twhile (j != -1){\n\t\t\t\tj = in.read();\n\t\t\t\tif(s2!=null){\n\t\t\t\t\tk = in2.read();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// break out of loop if end of string is reached\n\t\t\t\tif (j == -1){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tchar c = (char)j;\t\t\t\t// currently parsed char of string 1\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * If the parsed character of string 1 is a 0, then increment the currentNode counter\n\t\t\t\t * and set the start of the path equal to the currentNode. If the second string's parsed\n\t\t\t\t * character is not white space and the second string exists, insert an edge between the\n\t\t\t\t * currentNode, and the node in the same position of the next line with the busLine value\n\t\t\t\t * of the second string's parsed character.\n\t\t\t\t */\n\t\t\t\tif (c == '0'){\n\t\t\t\t\tcountNode++;\n\t\t\t\t\tthis.start = countNode;\n\t\t\t\t\tif (s2 !=null && (char)k != ' '){\n\t\t\t\t\t\tthis.graph.insertEdge(this.graph.getNode(countNode), this.graph.getNode(countNode+((stringLength+1)/2)), Character.toString((char)k));\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\t * If the parsed character of string 1 is a 1, then increment the currentNode counter\n\t\t\t\t * and set the end of the path equal to the currentNode. If the second string's parsed\n\t\t\t\t * character is not white space and the second string exists, insert an edge between the\n\t\t\t\t * currentNode, and the node in the same position of the next line with the busLine value\n\t\t\t\t * of the second string's parsed character.\n\t\t\t\t */\n\t\t\t\t\n\t\t\t\telse if (c == '1'){\n\t\t\t\t\tcountNode++;\n\t\t\t\t\tthis.end = countNode;\n\t\t\t\t\tif (s2 !=null && (char)k != ' '){\n\t\t\t\t\t\tthis.graph.insertEdge(this.graph.getNode(countNode), this.graph.getNode(countNode+((stringLength+1)/2)), Character.toString((char)k));\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\t * If the parsed character of string 1 is a +, then increment the currentNode counter.\n\t\t\t\t * If the second string's parsed character is not white space and the second string \n\t\t\t\t * exists, insert an edge between the currentNode, and the node in the same position \n\t\t\t\t * of the next line with the busLine value of the second string's parsed character.\n\t\t\t\t */\n\t\t\t\t\n\t\t\t\telse if (c == '+'){\n\t\t\t\t\tcountNode++;\n\t\t\t\t\tif (s2 !=null && (char)k != ' '){\n\t\t\t\t\t\tthis.graph.insertEdge(this.graph.getNode(countNode), this.graph.getNode(countNode+((stringLength+1)/2)), Character.toString(((char)k)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// If the parsed character of string 1 is white space, do nothing.\n\t\t\t\telse if (c == ' '){\n\t\t\t\t\t// do nothing\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * If the parsed character of string 1 is any other character, then it is a busLine name\n\t\t\t\t * and thus add an edge with this as the busLine connecting the currentNode and the node\n\t\t\t\t * immediately following. \n\t\t\t\t */\n\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\tthis.graph.insertEdge(this.graph.getNode(countNode), this.graph.getNode(countNode+1), Character.toString(c));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t// get the next lines if they exist\n\t\t\tif (s2!=null){\n\t\t\t\ts = inputScan.readLine();\n\t\t\t\tif (s!=null){\n\t\t\t\t\ts2 = inputScan.readLine();\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\ts = null;\n\t\t\t}\n\t\t\t// close the string readers\n\t\t\tin.close();\n\t\t\tif (in2!=null){\n\t\t\t\tin2.close();\n\t\t\t}\n\t\t}\n\t\t// close the buffered reader\n\t\tinputScan.close();\n\t}", "public Map makeMap(int mapID) throws IOException{\r\n switch (mapID){\r\n case 1:\r\n BufferedReader br1 = new BufferedReader(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream(\"maps\" + \"/\" + \"map1.json\")));\r\n map = json.fromJson(br1, Map.class);\r\n break;\r\n case 2:\r\n BufferedReader br2 = new BufferedReader(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream(\"maps\" + \"/\" + \"map2.json\")));\r\n map = json.fromJson(br2, Map.class);\r\n break;\r\n case 3:\r\n BufferedReader br3 = new BufferedReader(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream(\"maps\" + \"/\" + \"map3.json\")));\r\n map = json.fromJson(br3, Map.class);\r\n break;\r\n case 4:\r\n BufferedReader br4 = new BufferedReader(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream(\"maps\" + \"/\" + \"map4.json\")));\r\n map = json.fromJson(br4, Map.class);\r\n break;\r\n }\r\n\r\n return map;\r\n }", "public static Map readMap(String filename)\n throws IOException, ClassNotFoundException\n {\n ObjectInputStream in = null;\n try\n {\n //open the file\n in = new ObjectInputStream(new FileInputStream(filename));\n //read and return the object\n return (Map)in.readObject();\t\n }\n finally\n {\n //close the file\n if(in != null)\n in.close();\n } \n }", "public static void load(Context context) throws IOException {\n // read the file\n String raw = File.readFile(\"vaccine.txt\", context);\n\n // clear the map and load contents of file into the map\n map.clear();\n for (String line : raw.split(\"\\n\")) {\n if (line.equals(\"\")) {\n continue;\n }\n String[] data = line.split(\",\");\n if (data[0].equals(\"\") || data.length != 3) {\n continue;\n }\n map.put(data[0], Boolean.getBoolean(data[1]));\n dateMap.put(data[0], data[2]);\n }\n }", "private void genLoadMapCode(String name, String keyClassSimpleName, String valueClassSimpleName, boolean valueIsPersistable) {\n\n int tabLevel = 1;\n String tabs = tabs(tabLevel);\n\n String keyCppType = cppType(keyClassSimpleName);\n String valueCppType = cppType(valueClassSimpleName);\n\n String mapType = \"std::map< \" + keyCppType + \", \" + valueCppType + \" >\";\n\n load.println(\"\\t// \" + mapType + \" this->\" + name);\n genDebug(load, \"\\tstd::cout << \\\"load \" + mapType + \" \" + name + \"\\\" << std::endl;\");\n\n String vVarName = \"v\" + \"_\" + name;\n String lenVarName = vVarName + \"_length\";\n\n // read the length of the map\n load.println(tabs + \"int \" + lenVarName + \";\");\n\n load.println();\n load.println(tabs + INSTREAM_VAR_NAME + \".readInt(\" + lenVarName + \");\");\n\n genDebugDumpValue(load, lenVarName, tabs);\n\n load.println(tabs + mapType + \"& \" + vVarName + \" = this->\" + name + \";\");\n\n // initialize & pre-allocate the map\n // load.println( tabs + vVarName + \".reserve( \" + lenVarName + \" );\");\n\n load.println();\n load.println(tabs + \"for( int i = 0; i < \" + lenVarName + \"; i++ ){\");\n\n tabs = tabs(++tabLevel);\n\n // load key\n String keyVarName = vVarName + \"_key\";\n load.println(tabs + keyCppType + \" \" + keyVarName + \";\");\n load.println(tabs + genReadCode(keyVarName, keyCppType));\n\n // load value\n String valueVarName = vVarName + \"_value\";\n load.println(tabs + valueCppType + \" \" + valueVarName + \";\");\n\n if (valueIsPersistable) {\n load.println(tabs + valueVarName + \".load( \" + INSTREAM_VAR_NAME + \" );\");\n } else {\n load.println(tabs + genReadCode(valueVarName, valueCppType));\n }\n\n // add the new pair to the map\n load.println(tabs + vVarName + \".insert( std::make_pair( \" + keyVarName + \", \" + valueVarName + \" ));\");\n\n tabs = tabs(--tabLevel);\n load.println(tabs + \"}\");\n }", "public static void openFile(File map) throws IOException {\n\t\ttry {\n\t\t\tinput = new ObjectInputStream(new FileInputStream(map));\n\t\t\t\n\t\t} catch(IOException e) {\n\t\t\tSystem.err.println(\"Error: Unable to open map file.\");\n\t\t\tthrow e;\n\t\t}\n\t}", "public void loadMapsModule(){\n Element rootElement = FileOperator.fileReader(MAPS_FILE_PATH);\n if(rootElement!=null){\n Iterator i = rootElement.elementIterator();\n while (i.hasNext()) {\n Element element = (Element) i.next();\n GridMap map =new GridMap();\n map.decode(element);\n mapsList.add(map);\n }\n }\n }", "public IntMap()\r\n {\r\n this(16);\r\n }", "public City(String map_file) throws FileNotFoundException {\r\n\t\tthis.map = new RoadMap(map_file);\r\n\t\tthis.size_w = map.sizeX;\r\n\t\tthis.size_h = map.sizeY;\r\n\t\tcity_squares = new Gridpanel[getSize_h()][getSize_w()];\r\n\t}", "public Mapper() {\n\t\t\n\t\tmirMap = scanMapFile(\"mirMap.txt\");\n\t\tgeneMap = scanMapFile(\"geneMap.txt\");\n\t\t\n\t}", "private Map(int typeMap ) throws IllegalArgumentException\n {\n switch (typeMap){\n case 1:\n createMapOfFirstType();\n setAdjForFirstType();\n break;\n case 2:\n createMapOfSecondType();\n setAdjForSecondType();\n break;\n case 3:\n createMapOfThirdType();\n setAdjForThirdType();\n break;\n case 4:\n createMapOfFourthType();\n setAdjForFourthType();\n break;\n default:\n throw new IllegalArgumentException();\n }\n }", "public static void readFileToMap(Map<String, List<Integer>> hashMap, String path, int numFiles, int thisFileNum){\n try{\n FileReader file = new FileReader(path);\n BufferedReader textFile = new BufferedReader(file);\n\n String fileLine = \"\";\n String[] wordsInLine;\n List<Integer> occurences;\n List<Integer> temp;\n\n while((fileLine = textFile.readLine()) != null){\n wordsInLine = fileLine.split(\" \");\n cleanLine(wordsInLine);\n //add them to map\n for(String word : wordsInLine){\n\n if(word.length() > Table.maxWordLength){ //keeps track of the longest character\n Table.setMaxWordLength(word.length());\n }\n\n if(!hashMap.containsKey(word)){\n occurences = new ArrayList<>(); //creating a new value makes it so that one change wont affect every HashMap element\n occurences = setZerosList(numFiles);\n occurences.set(thisFileNum, 1);\n hashMap.put(word, occurences);\n }\n else{\n temp = hashMap.get(word); //this code makes a new list, and increments the word appearance by 1\n temp.set(thisFileNum, temp.get(thisFileNum)+1);\n hashMap.put(word, temp );\n }\n }\n }\n }\n catch (Exception e){\n //e.printStackTrace();\n return;\n }\n }", "public static void loadTargetTerm2IdMapping(File input) throws IOException {\n\t\t\tm_namesMap = new SimpleBidirectionalMap<String, Integer>();\n\t\t\tString encoding = FileUtils.getFileEncoding(input);\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(input), encoding));\n\t\t\tString line = reader.readLine();\n\t\t\tint lineNum = 1;\n\t\t\tboolean testFormat = false;\n\t\t\tif(StringUtils.checkIfNumber(line.split(\"\\t\")[0]))\n\t\t\t\ttestFormat = true;\n\t\t\twhile(line!= null) {\n\t\t\t\tif(line.equals(\"@@@\"))\n\t\t\t\t\tbreak;\n\t\t\t\tif(testFormat) {\n\t\t\t\t\tString num = line.split(\"\\t\")[0];\n\t\t\t\t\tSystem.out.println(\"key: \"+line.trim().substring(num.length()+1) + \" value: \" + Integer.parseInt(num));\n\t\t\t\t\tm_namesMap.put(line.trim().substring(num.length()+1), Integer.parseInt(num));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"key????\" + lineNum + \"instead of \" + line.split(\"\\t\")[0]);\n\t\t\t\t\tm_namesMap.put(line.trim(), lineNum);\n\t\t\t\t}\n\t\t\t\tline = reader.readLine();\n\t\t\t\tlineNum ++;\n\t\t\t}\n\t\t}", "public UPOSMapper(String mappingFile){\n map = new ConcurrentHashMap<>();\n try {\n for(String line: Files.readAllLines(Paths.get(mappingFile))){\n line = line.trim();\n if(line.isEmpty()) continue;\n String[] tags = line.split(\"\\t\");\n map.put(tags[0], tags[1]);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void createIDMap()\n {\n IDMap = new HashMap<>();\n idFile.open(\"idpassword.txt\");\n String line = idFile.getNextLine();\n\n\n\n while(line!=null) {\n String[] fields = line.split(\",\");\n IDMap.put(fields[0], fields[1]);\n\n line = idFile.getNextLine();\n\n }\n\n }", "public void initMap(String path) {\n \tgameState = StateParser.makeGame(path);\n\t\tintel = gameState.getCtrlIntel();\t\n\t\tsnakes = gameState.getSnake();\n\t\tmap = gameState.getMap();\n }", "private void load(Path fileName) throws IOException {\n try(BufferedReader reader = Files.newBufferedReader(fileName)) {\n String line = \"\";\n\n // Matches lines with the format:\n // key=value\n // where the key is any sequence of lowercase letters. (a to z)\n // where value may be any letters from a to z (case insensitive) 0 to 9 or the letters '-' and '.'.\n Pattern validLine = Pattern.compile(\"^(?<key>[a-z]+)=(?<value>[a-zA-Z0-9-.]+)$\");\n\n // Read the file line by line\n while((line = reader.readLine()) != null) {\n if(line.startsWith(\";\")) { // Ignore lines that start with ;\n continue;\n }\n\n // Remove any whitespace\n line = line.trim();\n\n // Continue if our line is empty\n if(\"\".equals(line)) {\n continue;\n }\n\n Matcher matcher = validLine.matcher(line);\n\n if(!matcher.matches() || matcher.groupCount() != 2) {\n System.err.println(\"Unable to parse line: \" + line);\n continue;\n }\n\n String key = matcher.group(\"key\");\n String value = matcher.group(\"value\");\n\n map.put(key, value);\n }\n }\n }", "public void readFile(String filename) throws IOException {\n BufferedReader buffer = new BufferedReader(new FileReader(filename));\n\n String line;\n int row = 0;\n isFirstLine = true;\n\n while ((line = buffer.readLine()) != null) {\n String[] vals = line.trim().split(\"\\\\s+\");\n int length = vals.length;\n \n if(isFirstLine) {\n \tfor(int col = 0; col < 2; col++) {\n \t\tif(col == 0)\n \t\t\trowSize = Integer.parseInt(vals[col]);\n \t\telse\n \t\t\tcolSize = Integer.parseInt(vals[col]);\n \t}\n \tskiMap = new int[rowSize][colSize];\n \tisFirstLine = false;\n }\n else {\n \tfor (int col = 0; col < length; col++) {\n \tskiMap[row][col] = Integer.parseInt(vals[col]);\n }\n \t row++;\n }\n }\n \n if(buffer != null)\n \tbuffer.close();\n }", "public TiledMap load(String id, String file) throws RuntimeException, SAXException, IOException, ParserConfigurationException {\r\n Document doc = UtilXML.loadDocument(file);\r\n\r\n if (!isTmxMap(doc))\r\n throw new RuntimeException(\"XML file isn't formatted as a TMX map!\");\r\n\r\n TiledMap map = createMap(id, doc);\r\n\r\n readTilesets(map, doc, file);\r\n readMapTileLayers(map, doc, file);\r\n readMapObjects(map, doc, file);\r\n return map;\r\n\r\n }", "public HashMap<String,String> readMapFile(String filename) throws IOException {\n\t\tHashMap<String,String> valueMap = new HashMap<String,String>();\t\t\n List<String> cols = new ArrayList<String>(); \n\t\t\n try{\n \t buf = new BufferedReader(new FileReader(filename)); \n\t String strRead; \n\t while ((strRead=buf.readLine())!=null) {\n\t \tcols = Arrays.asList(strRead.split(\"\\t\")); \t\n\t \tif(cols.size() != 2)\n\t \t\tcontinue; \t\n\t \tvalueMap.put(cols.get(0),cols.get(1)); \t\n\t \t }\n\t } catch(IOException e){\n\t e.printStackTrace();\n\t } finally {\n\t \tbuf.close(); \n\t }\n\t\t\t\n\t\treturn valueMap;\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tprivate void loadMap(){\r\n\t\t//Datei anlegen, falls nicht vorhanden\r\n\t\ttry {\r\n\t\t\tFile file = new File(homeFileLocation);\r\n\t\t\tif(!file.exists()){\r\n\t\t\t\tfile.createNewFile();\r\n\t\t\t\tSystem.out.println(\"Created new File.\");\r\n\r\n\t\t\t\t//Leere Map schreiben\r\n\t\t\t\tObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(homeFileLocation));\r\n\t\t\t\toos.writeObject(new HashMap<String, String>());\r\n\t\t\t\toos.flush();\r\n\t\t\t\toos.close();\r\n\r\n\t\t\t\tSystem.out.println(\"Wrote empty HashMap.\");\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\r\n\t\t//Map laden\r\n\t\ttry {\r\n\t\t\tObjectInputStream ois = new ObjectInputStream(new FileInputStream(homeFileLocation));\r\n\t\t\tthis.map = (HashMap<String, String>) ois.readObject();\r\n\t\t\tois.close();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void loadTilemap(File fileToLoad) \n {\n File levelFile = fileToLoad;\n boolean roverPainted = false; //Used to check if rover is painted twice\n try\n {\n Scanner scanner = new Scanner(levelFile);\n //Strict capture, instead of hasNextLine()\n // to enforce level grid size\n //Collect data for each column in row, then go to next row\n // 0 = surface, 1 = rover, 2 = rock, 3 = mineral\n for(int y = 0; y < Level.MAX_ROWS; y++)\n {\n for(int x = 0; x < Level.MAX_COLUMNS; x++)\n {\n if(scanner.hasNext())\n {\n tilemap[x][y] = scanner.nextInt();\n \n //Check if this tile paint was a rover\n if(tilemap[x][y] == 1)\n {\n //If rover has already been painted\n if(roverPainted)\n {\n System.out.println(\"WARNING: Multiple rovers exist. \"\n + \"Please fix level file. \");\n }\n roverPainted = true; //Set roverPainted to true\n }\n }\n else\n {\n tilemap[x][y] = 0;\n }\n }\n }\n scanner.close();\n repaint();\n }\n catch (FileNotFoundException e) \n {\n System.out.println(\"Invalid Level File\");\n e.printStackTrace();\n }\n }", "public void loadMap() {\n\n try {\n new File(this.mapName).mkdir();\n FileUtils.copyDirectory(\n new File(this.plugin.getDataFolder() + \"/maps/\" + this.mapName), new File(this.mapName));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n WorldCreator wc = new WorldCreator(this.mapName);\n World world = wc.createWorld();\n world.setAutoSave(false);\n world.setPVP(false);\n world.setDifficulty(Difficulty.PEACEFUL);\n world.setGameRuleValue(\"doDaylightCycle\", \"false\");\n world.setGameRuleValue(\"mobGriefing\", \"false\");\n world.setGameRuleValue(\"doMobSpawning\", \"false\");\n world.setGameRuleValue(\"doFireTick\", \"false\");\n world.setGameRuleValue(\"keepInventory\", \"true\");\n world.setGameRuleValue(\"commandBlockOutput\", \"false\");\n world.setSpawnFlags(false, false);\n\n try {\n final JsonParser parser = new JsonParser();\n final FileReader reader =\n new FileReader(this.plugin.getDataFolder() + \"/maps/\" + this.mapName + \"/config.json\");\n final JsonElement element = parser.parse(reader);\n this.map = JumpyJumpMap.fromJson(element.getAsJsonObject());\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "public void readMapFile(Scanner input) {\n this.height = input.nextInt();\n this.width = input.nextInt();\n if((this.height >= 20 && this.height <= 50) && (this.width >= 20 && this.width <= 50)) \n {\t \n\t while(input.hasNext())\n\t {\n\t this.map += input.next();\n\t }\n\t input.close();\n }\n else\n {\n \tSystem.err.println(\"Map you have chosen is corrupted, please report this map to your neareast administrator\");\n \tSystem.exit(1);\n }\n \t\n }", "private Map(int id) {\n\t\tthis.id = Integer.valueOf(id);\n\t\tSystem.out.println(\"Initializing map: \" + this.toString() + \" (\" + this.id + \")\");\n\t}", "public void initializeMaps() {\n\t\t//can use any map\n\n\t\t//left map\n\t int x = 0, y = 0;\n\t int Lvalue;\n\t \n\t try {\n\t \t//***change to your local path for the map you want to test\n\t \tBufferedReader input = new BufferedReader(new FileReader(\"/Users/NeeCee/Classes/4444/MirrorUniverse/maps/g6maps/lessEasyLeft.txt\"));\n\t \tString line;\n\t \twhile((line = input.readLine()) != null) {\n\t \t\tString[] vals = line.split(\" \");\n\t \t\tfor(String str : vals) {\n\t \t\t\tLvalue = Integer.parseInt(str);\n\t \t\t\tleftMap[x][y] = Lvalue;\n\t \t\t\t++y;\n\t \t\t}\n\t \t\t\n\t \t\t++x;\n\t \t\ty = 0;\n\t \t}\n\t \t\n\t \tinput.close();\n\t } catch (IOException ioex) {\n\t \tSystem.out.println(\"error reading in map for testing\");\n\t }\n\t \n\t //right map\n\t x = 0;\n\t y = 0;\n\t int Rvalue;\n\t \n\t try {\n\t \t//***change to your local path for the map you want to test\n\t \t//change to map you want to test\n\t \tBufferedReader input = new BufferedReader(new FileReader(\"/Users/NeeCee/Classes/4444/MirrorUniverse/maps/g6maps/lessEasyRight.txt\"));\n\t \tString line;\n\t \twhile((line = input.readLine()) != null) {\n\t \t\tString[] vals = line.split(\" \");\n\t \t\tfor(String str : vals) {\n\t \t\t\tRvalue = Integer.parseInt(str);\n\t \t\t\trightMap[x][y] = Rvalue;\n\t \t\t\t++y;\n\t \t\t}\n\t \t\t++x;\n\t \t\ty = 0;\n\t \t}\n\t \t\n\t \tinput.close();\n\t } catch (IOException ioex) {\n\t \tSystem.out.println(\"error reading in map for testing\");\n\t }\n\t \n\t //print each map for testing\n\t for(int i = 0; i < leftMap.length; i++ )\n\t \tfor(int j = 0; j < leftMap[i].length; j++ )\n\t \t\tSystem.out.println(leftMap[i][j]);\n\t System.out.println(\"*-----------------*\");\n\t for(int i = 0; i < rightMap.length; i++ )\n\t \tfor(int j = 0; j < rightMap[i].length; j++ )\n\t \t\tSystem.out.println(rightMap[i][j]);\n\t}", "public void loadStateFromFile(String fileName)\n\t{\n\t\ttry\n\t\t{\n\t\t\tFile f = new File(fileName);\n\t\t\tScanner input = new Scanner(f);\n\t\t\t_rows = input.nextInt();\n\t\t\t_cols = input.nextInt();\n\t\t\t_puzzle = new int[_rows][_cols];\n\t\t\tfor (int r_idx = 0; r_idx < _rows; r_idx++)\n\t\t\t\tfor (int c_idx = 0; c_idx<_cols; c_idx++)\n\t\t\t\t{\n\t\t\t\t\t_puzzle[r_idx][c_idx] = input.nextInt();\n\t\t\t\t\tif (_puzzle[r_idx][c_idx] == 0){\n\t\t\t\t\t\t_holes.add(new Coordinate(r_idx,c_idx));\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\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\tSystem.exit(-1);\n\t\t}\n\t}", "private void createMap(File inFile)\r\n\t\tthrows Exception\r\n\t{\n\t\tBufferedReader in = new BufferedReader(new FileReader(inFile));\r\n\r\n\t\t// Chromosomes\r\n\t\tString[] chrms = in.readLine().split(\",\");\r\n\t\t// Marker positions\r\n\t\tString[] mrkrs = in.readLine().split(\",\");\r\n\t\tin.close();\r\n\r\n\r\n\t\t// Now rewrite it in Flapjack map format\r\n\t\tBufferedWriter out = new BufferedWriter(new FileWriter(new File(wrkDir, \"map\")));\r\n\t\tout.write(\"# fjFile = MAP\");\r\n\t\tout.newLine();\r\n\r\n\t\tfor (int i = 0; i < chrms.length; i++)\r\n\t\t{\r\n\t\t\tMarker m = new Marker(i, chrms[i], mrkrs[i]);\r\n\t\t\tmarkers.add(m);\r\n\r\n\t\t\tout.write(m.name + \"\\t\" + m.chr + \"\\t\" + m.pos);\r\n\t\t\tout.newLine();\r\n\t\t}\r\n\t\tout.close();\r\n\r\n\t\tmarkers.stream().forEach(marker -> {\r\n\r\n\t\t\tSystem.out.println(marker.name);\r\n\r\n\t\t});\r\n\t}", "public Map<String, List<Set<Integer>>> readMappingsFromFile(String fname)\n\t\t\tthrows IOException {\n\t\tMap<String, List<Set<Integer>>> mappings = new HashMap<String, List<Set<Integer>>>();\n\n\t\tBufferedReader br = null;\n\n\t\tif (fname != null) {\n\t\t\tInputStream st = getClass().getResourceAsStream(fname);\n\t\t\tif (st != null) {\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(st));\n\t\t\t} else {\n\t\t\t\tSystem.err.println(\"Could not find \" + fname + \" in classpath\");\n\t\t\t}\n\t\t}\n\t\tString line = null;\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tString colsplit[] = line.split(\":\");\n\t\t\tString prefix = colsplit[0];\n\t\t\tString integers[] = colsplit[1].split(\"[, ]+\");\n\n\t\t\tList<Set<Integer>> mapping = null;\n\t\t\tif (!mappings.containsKey(prefix)) {\n\t\t\t\tmapping = new ArrayList<Set<Integer>>();\n\t\t\t\tmappings.put(prefix, mapping);\n\t\t\t}\n\t\t\tmapping = mappings.get(prefix);\n\n\t\t\tSet<Integer> given_mapping = new HashSet<Integer>();\n\t\t\tfor (String Int : integers) {\n\t\t\t\tif (Int.length() > 0) {\n\t\t\t\t\tgiven_mapping.add(Integer.parseInt(Int));\n\t\t\t\t}\n\t\t\t}\n\t\t\tmapping.add(given_mapping);\n\t\t\tmappings.put(prefix, mapping);\n\t\t}\n\t\tbr.close();\n\n\t\treturn mappings;\n\t}", "public void loadMap(){\n level= dataBase.getData(\"MAP\",\"PLAYER\");\n }", "@Override\r\n\tpublic Level LoadLevel(InputStream LevelLoad)throws IOException\r\n\t{\r\n\r\n\t\tBufferedReader read = new BufferedReader(new InputStreamReader(LevelLoad));\r\n\t\tString line;\r\n\t\tint column=0;\r\n\t\tint row=0;\r\n\t\tArrayList<String> ans= new ArrayList<String>();\r\n\t\twhile((line = read.readLine()) != null)\r\n\t\t{\r\n\t\t\tif (line.length() > row)\r\n\t\t\t{\r\n\t\t\t\trow = line.length();\r\n\t\t\t}\r\n\t\tcolumn++;\r\n\t\tans.add(line);\r\n\r\n\t\t}\r\n\t\tLevel level = new Level(column,row);\r\n\t\tcolumn = 0;\r\n\t\tfor(String resualt: ans)\r\n\t\t{\r\n\r\n\t\t\tfor(int i=0;i<resualt.length();i++)\r\n\t\t\t{\r\n\t\t\t\tswitch(resualt.charAt(i))\r\n\t\t\t\t{\r\n\t\t\t\t\tcase ' ':\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tItem item = new AbstractItems(new Position2D(column,i));\r\n\t\t\t\t\t\titem.setReprestive(' ');\r\n\t\t\t\t\t\tlevel.setUnmoveableMap(column,i,item);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcase '#':\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tItem item = new AbstractItems(new Position2D(column,i));\r\n\t\t\t\t\t\titem.setReprestive('#');\r\n\t\t\t\t\t\tlevel.setUnmoveableMap(column,i,item);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcase 'A':\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tItem item = new AbstractItems(new Position2D(column,i));\r\n\t\t\t\t\t\titem.setReprestive('A');\r\n\t\t\t\t\t\tlevel.setMoveableMap(column,i,item);\r\n\t\t\t\t\t\tlevel.setUnmoveableMap(column,i, new AbstractItems(new Position2D(column,i), ' '));\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcase '@':\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tItem item = new AbstractItems(new Position2D(column,i));\r\n\t\t\t\t\t\titem.setReprestive('@');\r\n\t\t\t\t\t\tlevel.setMoveableMap(column,i,item);\r\n\t\t\t\t\t\tlevel.setUnmoveableMap(column,i, new AbstractItems(new Position2D(column,i), ' '));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcase 'o':\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tItem item = new AbstractItems(new Position2D(column,i));\r\n\t\t\t\t\t\titem.setReprestive('o');\r\n\t\t\t\t\t\tlevel.setUnmoveableMap(column,i,item);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tcolumn++;\r\n\t\t}\r\n\r\n\r\n\t\treturn level;\r\n\t}", "@Override\r\n public Map getData(String fileName) {\r\n Map<String, Integer> map = new HashMap<>();\r\n \r\n File file = new File(fileName);\r\n \r\n try (BufferedReader bufferedReader =\r\n new BufferedReader(new FileReader(file))) {\r\n \r\n String line;\r\n while ((line = bufferedReader.readLine()) != null) {\r\n \r\n //if the word have already been in the map,\r\n //increases the number of occurances,\r\n //otherwise sets this number to 1\r\n //and puts a new value to the map\r\n String[] words = line.split(\" \");\r\n for (String word : words) {\r\n Integer value = map.get(word);\r\n if (value == null) {\r\n value = 1;\r\n } else {\r\n value++;\r\n }\r\n map.put(word, value);\r\n }\r\n }\r\n } catch(IOException e) {\r\n System.out.println(e.getMessage());\r\n return null;\r\n }\r\n \r\n return map;\r\n }", "public static void main (String[] args) throws MapException, GraphException {\n\t\n\tbs hi=new bs(\"map0.txt\");\n\t}", "public void loadTroubleMarker(HashMap<Integer, TroubleMarker> TroubleMarker_HASH){\r\n \r\n try {\r\n Scanner scanner = new Scanner(new File(file_position+\"TroubleMarker.csv\"));\r\n Scanner dataScanner = null;\r\n int index = 0;\r\n \r\n while (scanner.hasNextLine()) {\r\n dataScanner = new Scanner(scanner.nextLine());\r\n \r\n if(TroubleMarker_HASH.size() == 0){\r\n dataScanner = new Scanner(scanner.nextLine());\r\n }\r\n \r\n dataScanner.useDelimiter(\",\");\r\n TroubleMarker troubleMarker = new TroubleMarker(-1, -1);\r\n \r\n while (dataScanner.hasNext()) {\r\n String data = dataScanner.next();\r\n if (index == 0) {\r\n troubleMarker.setId(Integer.parseInt(data));\r\n } else if (index == 1) {\r\n troubleMarker.setAreaNumber(Integer.parseInt(data));\r\n } else {\r\n System.out.println(\"invalid data::\" + data);\r\n }\r\n index++;\r\n }\r\n \r\n TroubleMarker_HASH.put(troubleMarker.getId(), troubleMarker);\r\n index = 0;\r\n }\r\n \r\n scanner.close();\r\n \r\n } catch (FileNotFoundException ex) {\r\n System.out.println(\"Error: FileNotFound - loadTroubleMarker\");\r\n }\r\n \r\n }", "public void loadMap(Maps map) throws FileNotFoundException{\n ArrayList<Station> stat; \n stat = new ArrayList<>();\n \n try {\n String hodnoty; //do premennej hodnoty budem nacitavat riadky z textaka\n int stanica_na_zapis = 1; //counter pre stanice\n \n //---------------------------------------- zaciatok nacitavania\n hodnoty = br.readLine(); //nacitam riadok z textaka\n int x,y; //x, y budu sluzit pre nacitane suradnice\n String nazov; \n String[] split; //split je pole stringov...tu rozdelim riadok na jednotlive hodnoty\n split = hodnoty.split(\"\\\\s+\"); //delim podla medzery\n nazov = split[0]; //nazov stanice bude prvy string\n x = Integer.parseInt(split[1]); //nasleduje konverzia suradnic\n y = Integer.parseInt(split[2]);\n \n Station st = new Station(nazov,stanica_na_zapis,x,y); //vytvorim novu stanicu\n \n stat.add(st); //a pridam do zoznamu stanic\n \n while(!\"\".equals(hodnoty = br.readLine())){ //toto robim, az kym nie som na prazdnom riadku\n stanica_na_zapis++;\n split = hodnoty.split(\"\\\\s+\");\n nazov = split[0];\n x = Integer.parseInt(split[1]);\n y = Integer.parseInt(split[2]);\n st = new Station(nazov,stanica_na_zapis,x,y); \n stat.add(st);\n }\n } catch (IOException ex) {\n Logger.getLogger(Maps.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n stations_loaded = stat.size(); \n map.setStations(stat); //nakoniec ukladam nahrany zoznam stanic\n }", "private void loadWorld(String path) {\r\n StringBuilder builder = new StringBuilder();\r\n \r\n try {\r\n BufferedReader br = new BufferedReader(new FileReader(path));\r\n String line;\r\n while ((line = br.readLine()) != null) {\r\n builder.append(line + \"\\n\");\r\n }\r\n br.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n \r\n String file = builder.toString();\r\n String[] tokens = file.split(\"\\\\s+\");\r\n width = Integer.parseInt(tokens[0]);\r\n height = Integer.parseInt(tokens[1]);\r\n spawnX = Integer.parseInt(tokens[2]);\r\n spawnY = Integer.parseInt(tokens[3]);\r\n winX = Integer.parseInt(tokens[4]);\r\n winY = Integer.parseInt(tokens[5]);\r\n \r\n tiles = new int[width][height];\r\n for (int y = 0;y < height;y++) {\r\n for (int x = 0;x < width;x++) {\r\n tiles[x][y] = Integer.parseInt(tokens[(x + y * width) + 6]);\r\n }\r\n }\r\n \r\n assert (tiles != null);\r\n }", "public static void readFileBronze(String filename) throws FileNotFoundException{\n try {\n //Scanners and readers and everything??\n File text = new File(filename);\n Scanner inf = new Scanner(text);\n BufferedReader brTest = new BufferedReader(new FileReader(filename));\n String firstLine = brTest.readLine();\n String[] firstLineArray = new String[4];\n firstLineArray = firstLine.split(\" \");\n\n //Determines rows, cols, elevation, number of instructions.\n r = Integer.parseInt(firstLineArray[0]);\n c = Integer.parseInt(firstLineArray[1]);\n e = Integer.parseInt(firstLineArray[2]);\n n = Integer.parseInt(firstLineArray[3]);\n\n //Initializes map.\n map = new int[r][c];\n inf.nextLine();\n for (int i = 0; i < r; i++){\n for (int j = 0; j < c; j++) {\n map[i][j] = inf.nextInt();\n }\n }\n //System.out.println(inf.nextLine());\n //System.out.println(inf.nextLine());\n\n //Instructions.\n\n instructions = new int[n][3];\n for (int i = 0; i < n; i++){\n inf.nextLine();\n for (int j = 0; j < 3; j++){\n instructions[i][j] = inf.nextInt();\n }\n }\n //Exceptions.\n } catch (FileNotFoundException ex){\n System.out.println(\"Yikes\");\n } catch (IOException ex){\n System.out.println(\"Yikes\");\n }\n }", "private void mapValues() {\n\t\tmap.put(1, \"I\");\r\n\t\tmap.put(5, \"V\");\r\n\t\tmap.put(10, \"X\");\r\n\t\tmap.put(50, \"L\");\r\n\t\tmap.put(100, \"C\");\r\n\t\tmap.put(500, \"D\");\r\n\t\tmap.put(1000, \"M\");\r\n\t}", "public void load(String path) throws IOException, ClassNotFoundException {\n FileInputStream inputFile = new FileInputStream(path);\n ObjectInputStream objectInput = new ObjectInputStream(inputFile);\n\n map = (String[]) objectInput.readObject();\n\n objectInput.close();\n inputFile.close();\n }", "public AbstractIntHashMap(AbstractIntHashMap map) {\n if (map == null) {\n throw new IllegalArgumentException(\"m may not be null\");\n }\n\n //.... Determine parameters\n\n loadFactor = DEFAULT_LOADFACTOR;\n capacity = (int) (map.size() / loadFactor);\n if (capacity < DEFAULT_CAPACITY) {\n // Avoid underflow\n capacity = DEFAULT_CAPACITY;\n } else if (capacity % 2 == 0) {\n // Make sure we have an odd value\n capacity++;\n }\n\n //.... Standard initialization for the internal map elements\n\n maxLoad = (int) (loadFactor * capacity + 0.5f);\n //initialCap = capacity;\n\n objectCounter += 2;\n this.map = new MapElement[capacity];\n putAll(map);\n }", "public static void createMap() throws IOException {\n\n int no_of_continents;\n HashMap<String, List<String>> neighborsList = new HashMap<>();\n\n System.out.println(\"Enter the number of Continents\");\n if (sc.hasNextInt()) {\n no_of_continents = sc.nextInt();\n\n for (int i = 0; i < no_of_continents; i++) {\n\n System.out.println(\"Enter continent name\");\n String continent = sc.next();\n\n System.out.println(\"Enter no of countries in continent\");\n\n int no_of_countries = 0;\n if (sc.hasNextInt())\n no_of_countries = sc.nextInt();\n\n continents.put(continent, no_of_countries);\n }\n } else {\n System.out.println(\"Invalid input! Enter again :\");\n sc.next();\n }\n\n System.out.println(\"Enter no of countries\");\n int no_of_countries = sc.nextInt();\n List<String> neighbours = new ArrayList<>();\n\n for (int i = 0; i < no_of_countries; i++) {\n\n System.out.println(\"Enter country name\");\n String country = sc.next();\n\n System.out.println(\"Enter x and y co-ordinate\");\n int x = sc.nextInt();\n int y = sc.nextInt();\n\n System.out.println(\"Enter continent it belongs to\");\n String continent = sc.next();\n\n System.out.println(\"Enter no of adjacent countries\");\n int no_adj_c = sc.nextInt();\n while (no_adj_c != 0) {\n System.out.println(\"Enter adjacent country\");\n neighbours.add(sc.next());\n no_adj_c--;\n }\n\n board.createTile(country, x, y, continent);\n neighborsList.put(country, neighbours);\n }\n\n for (Map.Entry entry : neighborsList.entrySet()) {\n board.setNeighbourTile((List<String>) entry.getValue(), (String) entry.getKey());\n }\n\n System.out.println(\"Risk Map Loaded!\");\n System.out.println(\"Storing to file\");\n storeMap();\n\n }", "private static String[][] getMap(String inputFile, String[][] Map) {\n\t\tFile text = new File(inputFile);\t\r\n\t\tint j = 0;\r\n\r\n\t\ttry {\r\n\t\t\tScanner s = new Scanner(text);\r\n\t\t\tString nex = s.nextLine();\r\n\t\t\t\r\n\t\t\twhile(s.hasNextLine())\r\n\t\t\t{\r\n\t\t\tnex = s.nextLine();\r\n\t\t\tfor (int i = 0; i < nex.length(); i++)\r\n\t\t\t{\r\n\t\t\t\tchar c = nex.charAt(i);\r\n\t\t\t\tString d = Character.toString(c);\r\n\t\t\t\tMap[j][i] = d;\t\r\n\t\t\t}\r\n\t\t\tj++;\r\n\t\t\t}\t\r\n\t\t\ts.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\t\t\r\n\t\treturn Map;\r\n}", "@Override\r\n\tpublic Level LoadLevel(InputStream LevelLoad) throws IOException {\r\n\t\tBufferedReader read = new BufferedReader(new InputStreamReader(LevelLoad));\r\n\t\tString line;\r\n\t\tint column = 0;\r\n\t\tint row = 0;\r\n\t\tArrayList<String> ans = new ArrayList<String>();\r\n\t\tString name = read.readLine();\r\n\t\twhile ((line = read.readLine()) != null) {\r\n\t\t\tif (line.length() > row) {\r\n\t\t\t\trow = line.length();\r\n\t\t\t}\r\n\t\t\tcolumn++;\r\n\t\t\tans.add(line);\r\n\r\n\t\t}\r\n\t\tLevel level = new Level(column, row);\r\n\t\tlevel.setName(name);\r\n\t\tcolumn = 0;\r\n\t\tfor (String resualt : ans) {\r\n\t\t\tfor (int i = 0; i < resualt.length(); i++) {\r\n\t\t\t\tswitch (resualt.charAt(i)) {\r\n\t\t\t\tcase ' ': {\r\n\t\t\t\t\tItem item = new AbstractItems(new Position2D(column, i));\r\n\t\t\t\t\titem.setReprestive(' ');\r\n\t\t\t\t\tlevel.setUnmoveableMap(column, i, item);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase '#': {\r\n\t\t\t\t\tItem item = new AbstractItems(new Position2D(column, i));\r\n\t\t\t\t\titem.setReprestive('#');\r\n\t\t\t\t\tlevel.setUnmoveableMap(column, i, item);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase 'A': {\r\n\t\t\t\t\tItem item = new AbstractItems(new Position2D(column, i));\r\n\t\t\t\t\titem.setReprestive('A');\r\n\t\t\t\t\tlevel.setMoveableMap(column, i, item);\r\n\t\t\t\t\tlevel.setUnmoveableMap(column, i, new AbstractItems(new Position2D(column, i), ' '));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase '@': {\r\n\t\t\t\t\tItem item = new AbstractItems(new Position2D(column, i));\r\n\t\t\t\t\titem.setReprestive('@');\r\n\t\t\t\t\tlevel.setMoveableMap(column, i, item);\r\n\t\t\t\t\tlevel.setUnmoveableMap(column, i, new AbstractItems(new Position2D(column, i), ' '));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase 'o': {\r\n\t\t\t\t\tItem item = new AbstractItems(new Position2D(column, i));\r\n\t\t\t\t\titem.setReprestive('o');\r\n\t\t\t\t\tlevel.setUnmoveableMap(column, i, item);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tcolumn++;\r\n\t\t}\r\n\r\n\t\treturn level;\r\n\t}", "public MapArgumentReader(ArgumentReader reader, Map map) {\n\t\tsuper(reader.converter);\n\t\tthis.map = map;\n\t}", "public void load(String mapData){\n try {\n JSONObject obj = new JSONObject(mapData);\n int rows = (int)Math.round(obj.getDouble(\"rows\"));\n int cols = (int)Math.round(obj.getDouble(\"columns\"));\n loomoMap.buildMap(rows,cols);\n loomoMap.setMapName(obj.getString(\"name\"));\n loomoMap.setCellSize(obj.getDouble(\"cellSize\"));\n addLandmarkFromJSONMap(C.LANDMARK_OBSTACLE,obj,\"obstacles\");\n addLandmarkFromJSONMap(C.LANDMARK_DESTINATIONS,obj,\"destinations\");\n addLandmarkFromJSONMap(C.LANDMARK_HOME,obj,\"homeStations\");\n Destination hl = loomoMap.getLandmarks().get(\"homeA\");\n homeDestination = hl;\n loomoApplication.updateHomeLocation(this.homeDestination);\n loomoMap.printMap();\n } catch (Exception e){\n Log.d(TAG, \"loadMap: \"+ e.getMessage());\n }\n }", "public void setMapFile(String mapName) {\n map = Map.loadFromJSON(mapName);\n }", "public static Point[] readMap(int numPlayers, String fileName) throws IOException {\n int[] homes = new int[numPlayers];\n for (int i = 0; i < numPlayers; i++) {\n homes[i] = i;\n }\n for (int i = 0; i < numPlayers; i++) {\n int swap = pseudo(0, numPlayers - 1);\n int value = homes[i];\n homes[i] = homes[swap];\n homes[swap] = value;\n }\n BufferedReader br = new BufferedReader(new FileReader(\"map\" + File.separator + \"\"\n + numPlayers + File.separator\n + fileName));\n String line = br.readLine();\n while ((line != null) && (line.length() > 0) && (line.charAt(0) == '#')) {\n line = br.readLine();\n }\n int homeNum = 0;\n int neutralNum = numPlayers;\n Point[] points = new Point[Params.PLANETS];\n for (int i = 0; i < Params.PLANETS; i++) {\n points[i] = new Point(-1, -1);\n }\n for (int i = 0; i < Params.MAPY; i++) {\n if ((line == null) || (line.length() < Params.MAPX)) {\n throw new IOException(\"Insufficient map data.\");\n }\n int planetNum = 0;\n for (int j = 0; j < Params.MAPX; j++) {\n char c = line.charAt(j);\n if (c == EMPTY_SPACE) {\n continue;\n } else if (c == HOME_PLANET) {\n if (homeNum == numPlayers) {\n throw new IOException(\"Too many home planets.\");\n }\n planetNum = homes[homeNum];\n homeNum++;\n } else {\n planetNum = neutralNum;\n neutralNum++;\n }\n if (planetNum == Params.PLANETS) {\n throw new IOException(\"Too many neutral planets.\");\n }\n points[planetNum] = new Point(j, i);\n }\n line = br.readLine();\n }\n return points;\n }", "private void reLoadIndexesFromFileToIndexMap(File file) throws IOException {\n BufferedReader reader = new BufferedReader(new FileReader(file));\n for (String line = reader.readLine(); line != null; line = reader\n .readLine()) {\n String[] termIndex = line.split(\" \");\n String key = termIndex[0];\n LinkedList<TermPositions> value = new LinkedList<>();\n String postingList = termIndex[1];\n // split the posting lists 1:1,2,4;2:4\n String[] subPostings = postingList.split(\";\");\n for (String posting : subPostings) {\n String[] docPosting = posting.split(\":\");\n int docId = Integer.parseInt(docPosting[0]);\n String[] positions = docPosting[1].split(\",\");\n LinkedList<Integer> positionsList = new LinkedList<>();\n for (String position : positions) {\n positionsList.add(Integer.parseInt(position));\n }\n TermPositions termPositions = new TermPositions(docId, positionsList);\n value.add(termPositions);\n }\n indexMap.put(key, value);\n\n }\n\n }", "private void readFromFile() {\n\t\tPath filePath = Paths.get(inputFile);\n\n\t\ttry (BufferedReader reader = Files.newBufferedReader(filePath,\n\t\t\t\tCharset.forName(\"UTF-8\"));) {\n\t\t\tString line = null;\n\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tString[] splitLine = line.split(\",\");\n\t\t\t\tcurrentGen.setValue(Integer.parseInt(splitLine[0]),\n\t\t\t\t\t\tInteger.parseInt(splitLine[1]), true);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not find file provided.\");\n\t\t}\n\t}", "public void load(DataResource aData) {\n\t\tString errorMsg = \"%s - map could not be loaded\\n\";\n\t\tString successMsg = \"%s - map loaded\\n\";\n\t\t\n\t\tSystem.out.printf(\"%s - loading map from %s...\\n\", getClass().getName(), aData.getUrl().getFile());\n\t\t\n\t\tInputStream inStr = null;\n\t\t\n\t\ttry {\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(aData.getInputStream()));\n\t\t\tString line;\n\t\t\t\n\t\t\twhile ((line = br.readLine()) != null) {\n String[] columns = line.split(\"\\t\");\n \n if (columns.length == 3){\n \tif (!collocationMap.containsKey(columns[0])){\n \tMap<String, Integer> pair = new HashMap<String, Integer>();\n collocationMap.put(columns[0], pair);\n \t}\n \t\n \tcollocationMap.get(columns[0]).put(columns[1], Integer.valueOf(columns[2]));\n }\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.printf(successMsg, getClass().getName());\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.printf(errorMsg, getClass().getName());\n\t\t} catch (NullPointerException e) {\n\t\t\tSystem.out.printf(errorMsg, getClass().getName());\n\t\t} finally {\n\t\t\tif (inStr != null) {\n\t\t\t\ttry {\n\t\t\t\t\tinStr.close();\n\t\t\t\t} catch (IOException e) {}\n\t\t\t}\n\t\t}\n\t}", "public void open() {\r\n\t\tFile f = getOpenFile(\"Map Files\", \"tilemap\");\r\n\t\tif (f == null) return;\r\n\t\tfile = f;\r\n\t\tframe.setTitle(\"Tile Mapper - \"+file.getName());\r\n\t\tSystem.out.println(\"Opening \"+file.getAbsolutePath());\r\n\r\n\t\ttry {\r\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\r\n\t\t\tInputStream is = this.getClass().getClassLoader().getResourceAsStream(\"tilemapper/Map.xsd\");\r\n\t\t\tfactory.setSchema(SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(new StreamSource(is)));\r\n\r\n\t\t\tDocument dom = factory.newDocumentBuilder().parse(file);\r\n\r\n\t\t\t// we have a valid document\r\n\t\t\t//printNode(dom, \"\");\r\n\t\t\tNode mapNode = null;\r\n\t\t\tNodeList nodes = dom.getChildNodes();\r\n\t\t\tfor (int i=0; i<nodes.getLength(); i++) {\r\n\t\t\t\tNode node = nodes.item(i);\r\n\t\t\t\tif (node.getNodeName() == \"Map\") mapNode = node;\r\n\t\t\t}\r\n\t\t\tif (mapNode == null) return;\r\n\t\t\tmapPanel.parseDOM((Element)mapNode);\r\n\r\n\t\t} catch (ParserConfigurationException e) {\r\n\t\t\tSystem.out.println(\"The underlying parser does not support the requested features.\");\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (FactoryConfigurationError e) {\r\n\t\t\tSystem.out.println(\"Error occurred obtaining Document Builder Factory.\");\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public static void addtoHashMap (File filename){\n\t\tFileInputStream fin;\n\t\ttry{\n\t\t\tfin = new FileInputStream(filename);\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(fin));\n\t\t\tString n;\n\t\t\ttry{\n\t\t\t\twhile ((n = br.readLine()) != null){\n\t\t\t\t\tif(h.containsKey(n)){\n\t\t\t\t\t\tint i = (Integer) h.get(n);\n\t\t\t\t\t\th.put(n, (i+1));\n\t\t\t\t\t}else{\n\t\t\t\t\t\th.put(n, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}catch(IOException e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}catch(FileNotFoundException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "private void loadMap(String path) {\n\t\ttry {\n\t\t\tfor(Player p : players)\tp.clear();\n\t\t\tmap.players = players;\n\t\t\tmap.setPlayerNumber(playerNumber);\n\t\t\tfor(Player p : map.players) {\n\t\t\t\tp.setMap(map);\n\t\t\t\tp.setArmies(map.getInitialArmiesNumber());\n\t\t\t}\n\t\t\tmap.setPlayerNumber(map.players.size());\n\t\t\tmap.load(path);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void loadTranslationMapValues(String transMapName, String mapName, String mapKeyPrefix)\n {\n Properties props = null;\n props = PropertiesUtils.loadProperties(propertyFilePaths, transMapName);\n logger.debug(\"Loading Custom Map: \" + transMapName);\n loadTranslationMapValues(props, mapName, mapKeyPrefix);\n }", "private void loadMap(MultiHashMap map) {\n\r\n int numRows = sMapPairs.length;\r\n int maxCols = 0;\r\n for (int ii = 0; ii < sMapPairs.length; ii++) {\r\n if (sMapPairs[ii].length > maxCols) {\r\n maxCols = sMapPairs[ii].length;\r\n }\r\n }\r\n for (int ii = 0; ii < maxCols; ii++) {\r\n for (int jj = 0; jj < numRows; jj++) {\r\n if (ii < sMapPairs[jj].length) {\r\n map.put(sMapPairs[jj][ii].mKey, sMapPairs[jj][ii].mValue);\r\n //---------------------------------------------------------\r\n }\r\n }\r\n }\r\n assertTrue(map.size() == sMapPairs.length);\r\n }", "private void loadFromFile() {\n try {\n /* Load in the data from the file */\n FileInputStream fIn = openFileInput(FILENAME);\n BufferedReader inRead = new BufferedReader(new InputStreamReader(fIn));\n\n /*\n * access from the GSON file\n * Taken from lonelyTwitter lab code\n */\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Counter>>() {}.getType();\n counters = gson.fromJson(inRead, listType);\n\n } catch (FileNotFoundException e) {\n counters = new ArrayList<Counter>();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "L loadFromIndexByRange(Map<Number, IntRange> frameInfoMap, char... c);", "public Map(String level) {\n this.level = level;\n terrains = new String[]{\"r\", \"p\", \"m1\", \"m2\", \"m3\"};\n\n //if default random\n if (level.equals(\"default\")) {\n String[] defaultLevel = {\n \"p\", \"p\", \"m1\", \"p\", \"r\", \"p\", \"m3\", \"p\", \"p\",\n \"p\", \"m1\", \"p\", \"p\", \"r\", \"p\", \"p\", \"p\", \"m3\",\n \"m3\", \"p\", \"p\", \"p\", \"t\", \"p\", \"p\", \"p\", \"m1\",\n \"p\", \"m2\", \"p\", \"p\", \"r\", \"p\", \"m2\", \"p\", \"p\",\n \"p\", \"p\", \"m2\", \"p\", \"r\", \"p\", \"p\", \"p\", \"m2\"};\n int j = 0;\n for (int i = 0; i < tiles.length; i++) {\n for (int k = 0; k < tiles[0].length; k++, j++) {\n tiles[i][k] = new Tile(i, k, defaultLevel[j]);\n }\n }\n }\n\n // if random level\n if (level.equals(\"random\")) {\n for (int i = 0; i < tiles.length; i++) {\n for (int k = 0; k < tiles[0].length; k++) {\n String ter = terrains[(int) (Math.random() * (terrains.length - 1))];\n tiles[i][k] = new Tile(i, k, ter);\n }\n }\n tiles[2][4] = new Tile(2, 4, \"t\");\n }\n }", "@Override\n\tpublic Map loadMap() {\n\t\ttry {\n\t\t\treturn XMLDeserialiser.loadMap();\n\t\t} catch (XMLException e) {\n\t\t\tPopup.showInformation(\"Le fichier choisi n'est pas un plan valide.\");\n\t\t\treturn null;\n\t\t} catch (NoFileChosenException e) {\n\t\t\treturn null;\n\t\t}\n\t}", "protected synchronized Hashtable getMappingsFromFile() throws Exception {\n\n \t\n\t\tInputStream path = null;\n\n\t\tpath = getClass().getResourceAsStream(\"../../../config/mappings.txt\");\n\n\t\tSystem.out.println(\"Path is - \" + path);\n\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(path));\n/*\t\tStringBuilder sb = new StringBuilder();\n\t\tString line1 = null;\n\t\twhile ((line1 = reader.readLine()) != null) {\n\t\t\tsb.append(line1 + \"\\n\");\n\t\t}\n*/\t\t//System.out.println(\"String is - \" + sb.toString());\n\t\t\n/* \tFile f = new File(\"src/edu/ucsd/crbs/incf/components/services/emage/mappings.txt\");\n System.out.println(\"Mapping - \" + f.getAbsolutePath());\n\n*/ /*if(sb.toString().trim().equals(\"\") || sb.toString() == null ) {\n System.err.println(\"bisel.ReadMappings cannot find mapping file\");\n System.exit(1);\n }*/\n\n Hashtable mappings = new Hashtable(17, new Float(1.25).floatValue());\n\n\n //BufferedReader br = new BufferedReader(new FileReader(f));\n String line = reader.readLine();\n while(line != null) { \n StringTokenizer st = new StringTokenizer(line, \"*\");\n String aba = st.nextToken();\n String emap = st.nextToken();\n mappings.put(aba, emap);\n line = reader.readLine();\n }\n\n reader.close();\n return mappings;\n }", "public Context runMap() throws InstantiationException, IllegalAccessException, IOException {\n\t\tContext tempoContext = new Context();\n\t\tthis.setup(tempoContext);\n\t\t//Read the input file\n\t\tString[] inputLines = this.inputSplit.getLines();\n\t\t//Map process\n\t\tfor (int i=0; i<inputLines.length; i++) {\n\t\t\tthis.map(Integer.toString(i), inputLines[i], tempoContext);\n\t\t}\n\t\treturn tempoContext;\n\t}", "public InMemoryDictionary(File dictFile) {\n\t\t// TODO: Implement constructor\n\t}", "public void load(String code) {\n\n\t\tEngine.console.write(\"load method echo\");\n\t\tif (!code.matches(\"(\\\\d){4}\")) {\n\t\t\tEngine.console.write(\"code does not match regex for map ID\");\n\t\t\treturn;\n\t\t} else {\n\t\t\tEngine.console.write(\"code matches regex\");\n\t\t\ttry {\n\t\t\t\tFileInputStream fis = new FileInputStream(\"/boards/\" + code + \".map\");\n\t\t\t\tObjectInputStream ois = new ObjectInputStream(fis);\n\t\t\t\tBoard loaded = (Board) ois.readObject();\n\t\t\t\tEngine.activeBoard = loaded;\n\t\t\t\tEngine.console.write(\"loaded and assigned\");\n\t\t\t\tSystem.out.println(Engine.activeBoard);\n\t\t\t} catch (IOException ex) {\n\t\t\t\tEngine.console.write(\"File \" + code + \".map not found\", Console.ERROR);\n\t\t\t} catch (ClassNotFoundException ex) {\n\t\t\t\tEngine.console.write(\"Class not found\", Console.ERROR);\n\t\t\t}\n\t\t}\n\t}", "public ArrayList<Map> readMaps(ArrayList<TileSet> tileSets) throws IOException\r\n\t{\n\t\tPattern mapAttributesPattern = Pattern.compile(\"\\\\tmap_attributes\\\\s+\");\r\n\t\tArrayList<Map> maps = new ArrayList<>();\r\n\t\t\r\n\t\tFile mapAttributesFile = dir.toPath().resolve(\"data/maps/attributes.asm\").toFile();\r\n\t\tArrayList<String> mapAttributesScript = this.readScript(mapAttributesFile);\r\n\t\tHashMap<String, Map> mapsByName = new HashMap<>();\r\n\t\tHashMap<String, Map> mapsByConstName = new HashMap<>();\r\n\t\t\r\n\t\tfor (String line : mapAttributesScript) if (mapAttributesPattern.matcher(line).find())\r\n\t\t{\r\n\t\t\tString backup = line;\r\n\t\t\tline = this.commentPattern.matcher(line).replaceFirst(\"\");\r\n\t\t\tline = this.trailingWhitespacePattern.matcher(line).replaceFirst(\"\");\r\n\t\t\tline = mapAttributesPattern.matcher(line).replaceFirst(\"\");\r\n\t\t\tString[] args = this.commaSeparatorPattern.split(line);\r\n\t\t\t\r\n\t\t\tMap map = new Map();\r\n\t\t\tif (args.length != 4) throw new IOException(\"map_attributes did not contain 4 arguments: \\\"\" + backup + \"\\\"\");\r\n\t\t\tmap.setName(args[0]);\r\n\t\t\tmap.setConstName(args[1]);\r\n\t\t\t\r\n\t\t\tmaps.add(map);\r\n\t\t\tmapsByName.put(map.getName(), map);\r\n\t\t\tmapsByConstName.put(map.getConstName(), map);\r\n\t\t}\r\n\r\n\t\tPattern connectionPattern = Pattern.compile(\"\\\\tconnection\\\\s+\");\r\n\t\tMap currentMap = null;\r\n\t\tfor (String line : mapAttributesScript)\r\n\t\t{\r\n\t\t\tString backup = line;\r\n\t\t\tline = this.commentPattern.matcher(line).replaceFirst(\"\");\r\n\t\t\tline = this.trailingWhitespacePattern.matcher(line).replaceFirst(\"\");\r\n\t\t\t\r\n\t\t\tif (mapAttributesPattern.matcher(line).find())\r\n\t\t\t{\r\n\t\t\t\tline = mapAttributesPattern.matcher(line).replaceFirst(\"\");\r\n\t\t\t\tString[] args = this.commaSeparatorPattern.split(line);\r\n\t\t\t\tif (args.length != 4) throw new IOException(\"map_attributes did not contain 4 arguments: \\\"\" + backup + \"\\\"\");\r\n\t\t\t\t\r\n\t\t\t\tcurrentMap = mapsByConstName.get(args[1]);\r\n\t\t\t}\r\n\t\t\telse if (currentMap != null && connectionPattern.matcher(line).find())\r\n\t\t\t{\r\n\t\t\t\tline = connectionPattern.matcher(line).replaceFirst(\"\");\r\n\t\t\t\tString[] args = this.commaSeparatorPattern.split(line);\r\n\t\t\t\tif (args.length != 4) throw new IOException(\"connection did not contain 4 arguments: \\\"\" + backup + \"\\\"\");\r\n\t\t\t\t\r\n\t\t\t\tfor (Cardinal cardinal : Cardinal.values()) if (cardinal.name().equals(args[0].toUpperCase()))\r\n\t\t\t\t{\r\n\t\t\t\t\tMap connection = mapsByConstName.get(args[2]);\r\n\t\t\t\t\tif (connection == null) throw new IOException(\"Could not find a map with const name \" + args[2] + \": \\\"\" + backup + \"\\\"\");\r\n\t\t\t\t\tcurrentMap.getConnections().put(cardinal, new MapConnection(connection, Integer.parseInt(args[3])));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Get map sizes from constants/map_constants.asm\r\n\t\tPattern mapConstPattern = Pattern.compile(\"^\\\\tmap_const\\\\s+\");\r\n\t\tFile mapConstantsFile = dir.toPath().resolve(\"constants/map_constants.asm\").toFile();\r\n\t\tArrayList<String> mapConstantsScript = this.readScript(mapConstantsFile);\r\n\t\tfor (String line : mapConstantsScript) if (mapConstPattern.matcher(line).find())\r\n\t\t{\r\n\t\t\tString backup = line;\r\n\t\t\tline = this.commentPattern.matcher(line).replaceFirst(\"\");\r\n\t\t\tline = this.trailingWhitespacePattern.matcher(line).replaceFirst(\"\");\r\n\t\t\tline = mapConstPattern.matcher(line).replaceFirst(\"\");\r\n\t\t\tString[] args = this.commaSeparatorPattern.split(line);\r\n\t\t\t\r\n\t\t\tMap map = mapsByConstName.get(args[0]);\r\n\t\t\tif (map == null) throw new IOException(\"Could not find a map with name \" + args[0] + \": \\\"\" + backup + \"\\\"\");\r\n\t\t\tmap.setXCapacity(Integer.parseInt(args[1]));\r\n\t\t\tmap.setYCapacity(Integer.parseInt(args[2]));\r\n\t\t}\r\n\t\t\r\n\t\tArrayList<Constant> tileSetConstants = this.importConstants(this.dir.toPath().resolve(\"constants/tileset_constants.asm\").toFile());\r\n\t\t\r\n\t\tPattern mapPattern = Pattern.compile(\"^\\\\tmap\\\\s+\");\r\n\t\tFile mapDataFile = this.dir.toPath().resolve(\"data/maps/maps.asm\").toFile();\r\n\t\tArrayList<String> mapDataScript = this.readScript(mapDataFile);\r\n\t\tfor (String line : mapDataScript) if (mapPattern.matcher(line).find())\r\n\t\t{\r\n\t\t\tline = this.commentPattern.matcher(line).replaceFirst(\"\");\r\n\t\t\tline = this.trailingWhitespacePattern.matcher(line).replaceFirst(\"\");\r\n\t\t\tline = mapPattern.matcher(line).replaceFirst(\"\");\r\n\t\t\tString[] args = this.commaSeparatorPattern.split(line);\r\n\t\t\t\r\n\t\t\tfor (Map map : maps) if (map.getName().equals(args[0]))\r\n\t\t\t{\r\n\t\t\t\tString tileSetConstName = args[1];\r\n\t\t\t\tfor (int i = 0; i < tileSetConstants.size(); i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tConstant tileSetConstant = tileSetConstants.get(i);\r\n\t\t\t\t\tif (tileSetConstant.getName().equals(tileSetConstName))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmap.setTileSet(tileSets.get(tileSetConstant.getValue()));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tPattern blocksLabelPattern = Pattern.compile(\"_Blocks:\");\r\n\t\tFile blocksScriptFile = this.dir.toPath().resolve(\"data/maps/blocks.asm\").toFile();\r\n\t\tArrayList<String> blocksScript = this.readScript(blocksScriptFile);\r\n\t\tArrayList<Map> currentLabels = new ArrayList<>();\r\n\t\tfor (String line : blocksScript)\r\n\t\t{\r\n\t\t\tline = this.commentPattern.matcher(line).replaceFirst(\"\");\r\n\t\t\tline = this.trailingWhitespacePattern.matcher(line).replaceFirst(\"\");\r\n\t\t\t\r\n\t\t\tMatcher blocksLabelMatcher = blocksLabelPattern.matcher(line);\r\n\t\t\tMatcher incbinMatcher = this.incbinPattern.matcher(line);\r\n\t\t\t\r\n\t\t\tif (blocksLabelMatcher.find())\r\n\t\t\t{\r\n\t\t\t\tString mapName = blocksLabelMatcher.replaceFirst(\"\");\r\n\t\t\t\tfor (Map map : maps) if (map.getName().equals(mapName)) currentLabels.add(map);\r\n\t\t\t}\r\n\t\t\telse if (incbinMatcher.find())\r\n\t\t\t{\r\n\t\t\t\tif (currentLabels.size() == 0) continue;\r\n\t\t\t\tString filePath = incbinMatcher.replaceFirst(\"\");\r\n\t\t\t\tfilePath = filePath.replace(\"\\\"\", \"\");\r\n\t\t\t\tFile file = this.dir.toPath().resolve(filePath).toFile();\r\n\t\t\t\tif (!file.exists()) throw new FileNotFoundException(\"Could not find file \" + file.getAbsolutePath());\r\n\t\t\t\tbyte[] blockIndices = Files.readAllBytes(file.toPath());\r\n\t\t\t\tfor (Map map : currentLabels) if (!map.getTileSet().equals(currentLabels.get(0).getTileSet())) throw new IOException(\"Maps using the same blocks use different tile sets\");\r\n\t\t\t\tArrayList<Block> blockSetBlocks = currentLabels.get(0).getTileSet().getBlockSet().getBlocks();\r\n\t\t\t\tMapBlocks mapBlocksObject = new MapBlocks();\r\n\t\t\t\tmapBlocksObject.setXCapacity(currentLabels.get(0).getXCapacity());\r\n\t\t\t\tmapBlocksObject.setYCapacity(currentLabels.get(0).getYCapacity());\r\n\t\t\t\tBlock[] mapBlocks = new Block[blockIndices.length];\r\n\t\t\t\tfor (int i = 0; i < blockIndices.length; i++) mapBlocks[i] = blockSetBlocks.get(blockIndices[i]);\r\n\t\t\t\tmapBlocksObject.setBlocks(mapBlocks);\r\n\t\t\t\tmapBlocksObject.setName(file.getName().replace(\".blk\", \"\"));\r\n\t\t\t\tfor (Map map : currentLabels) map.setBlocks(mapBlocksObject);\r\n\t\t\t\tcurrentLabels.clear();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tFile mapsFolderIn = dir.toPath().resolve(\"maps/\").toFile();\r\n\t\tFile[] mapsFiles = mapsFolderIn.listFiles();\r\n\t\tfor (File file : mapsFiles) if (file.getName().endsWith(\".asm\"))\r\n\t\t{\r\n\t\t\tString mapName = file.getName().replaceAll(\".asm\", \"\");\r\n\t\t\tMap map = mapsByName.get(mapName);\r\n\t\t\tif (map == null) throw new IOException(\"Could not find a map with name \" + mapName);\r\n\t\t\tmap.setScript(this.readScript(file));\r\n\t\t}\r\n\t\t\r\n\t\tPattern warpEventPattern = Pattern.compile(\"\\\\twarp_event\\\\s+\");\r\n\t\tfor (Map map : maps) if (map.getScript() != null) for (String line : map.getScript()) if (warpEventPattern.matcher(line).find()) map.getWarps().add(new Warp());\r\n\t\t\r\n\t\tfor (Map map : maps)\r\n\t\t{\r\n\t\t\tint count = 0;\r\n\t\t\tif (map.getScript() != null) for (String line : map.getScript()) if (warpEventPattern.matcher(line).find())\r\n\t\t\t{\r\n\t\t\t\tString backup = line;\r\n\t\t\t\tline = this.commentPattern.matcher(line).replaceFirst(\"\");\r\n\t\t\t\tline = this.trailingWhitespacePattern.matcher(line).replaceFirst(\"\");\r\n\t\t\t\tline = warpEventPattern.matcher(line).replaceFirst(\"\");\r\n\t\t\t\tString[] args = this.commaSeparatorPattern.split(line);\r\n\t\t\t\t\r\n\t\t\t\tWarp warp = map.getWarps().get(count);\r\n\t\t\t\twarp.setX(Integer.parseInt(args[0]));\r\n\t\t\t\twarp.setY(Integer.parseInt(args[1]));\r\n\t\t\t\twarp.setMap(map);\r\n\t\t\t\tint destinationIndex = Integer.parseInt(args[3]) - 1;\r\n\r\n\t\t\t\tMap mapTo = mapsByConstName.get(args[2]);\r\n\t\t\t\tif (mapTo == null) throw new IOException(\"Could not find a map with name \" + args[2] + \": \\\"\" + backup + \"\\\"\");\r\n\t\t\t\tif (destinationIndex >= mapTo.getWarps().size()) throw new IllegalStateException();\r\n\t\t\t\tif (destinationIndex >= 0) warp.setDestination(mapTo.getWarps().get(destinationIndex));\r\n\t\t\t\t\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn maps;\r\n\t}", "protected static void readIn(Path p, HashMap<String, Double> myMap, FileSystem fs) throws IOException {\n\t FSDataInputStream inputStream = fs.open(p);\n\t BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));\n\t // Read in all the lines and push into hashmap\n\t String line;\n\t while((line = br.readLine()) != null) {\n\t \tString[] sectors = line.trim().split(\"\\t\");\n\t \tif (sectors.length != 2)\n\t \t\tthrow new Error(\"Parsing of file does not match specified input -- readIn\");\n\t \tif (myMap.containsKey(sectors[0]))\n\t \t\tthrow new Error(\"Node is trying to be added more than once\");\n\t \t\n\t \tmyMap.put(sectors[0], Double.parseDouble(sectors[1]));\n\t }\n\t br.close();\n\t fs.close();\n\t}", "private void loadTiles(String filename) {\n\t\ttry {\n\t\t\tScanner s;\n\n\t\t\tif (StealthGame.EXPORT)\n\t\t\t\ts = new Scanner(ResourceLoader.load(filename));\n\t\t\telse\n\t\t\t\ts = new Scanner(new File(filename));\n\n\t\t\tif (s.hasNextLine()) {\n\t\t\t\tname = s.nextLine();\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Room has no name\");\n\t\t\t}\n\t\t\txSize = s.nextInt();\n\t\t\tySize = s.nextInt();\n\t\t\ttiles = new Tile[xSize][ySize];\n\t\t\tint xPos = 0;\n\t\t\tint yPos = 0;\n\t\t\tint tileNum = 0;\n\n\t\t\t// List of doors to be given destinations\n\n\t\t\twhile (s.hasNext()) {\n\n\t\t\t\tif (s.hasNextInt()) {\n\t\t\t\t\tparseInt(s, xPos, yPos, tileNum);\n\n\t\t\t\t\txPos++;\n\t\t\t\t\ttileNum++;\n\n\t\t\t\t\tif (xPos >= xSize) {\n\t\t\t\t\t\txPos = 0;\n\t\t\t\t\t\tyPos++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Not a basic floor, door or wall\n\t\t\t\telse {\n\t\t\t\t\tString str = s.next();\n\t\t\t\t\tif (str.length() == 1) {\n\t\t\t\t\t\tparseChar(xPos, yPos, tileNum, str);\n\n\t\t\t\t\t\txPos++;\n\t\t\t\t\t\ttileNum++;\n\n\t\t\t\t\t\tif (xPos >= xSize) {\n\t\t\t\t\t\t\txPos = 0;\n\t\t\t\t\t\t\tyPos++;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (str.equals(\"door\")) {\n\t\t\t\t\t\t\tparseDoorDestination(s);\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\ts.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Room - Error loading file - IOException : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\n\t/**\n\t * Read data and store\n\t * @param data\n\t * \t\t\t\tThe map to store data read from ser file\n\t * @return Map<String, T>\n\t * \t\t\ta map of data that has all the ser file data\n\t * @throws ClassNotFoundException\n\t * @throws IOException\n\t */\n\tprotected Map<String, T> readFromFile(Map<String, T> data) throws ClassNotFoundException, IOException {\n\t\t\n\t\tInputStream file = new FileInputStream(filePath);\n\t\tInputStream buffer = new BufferedInputStream(file);\n\t\tObjectInput input = new ObjectInputStream(buffer);\n\n\t\t//deserialize the Map\n\t\tdata = (HashMap<String, T>) input.readObject();\n\t\tinput.close();\n\t\treturn data;\n\t}", "public void createMap() {\n\t\tArrayList<String>boardMap = new ArrayList<String>(); //boardmap on tiedostosta ladattu maailman malli\n\t\t\n\t\t//2. try catch blocki, ei jaksa laittaa metodeja heittämään poikkeuksia\n\t\ttry {\n\t\t\tboardMap = loadMap(); //ladataan data boardMap muuttujaan tiedostosta\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t\t\n\t\t// 3. j=rivit, i=merkit yksittäisellä rivillä\n\t\tfor(int j=0; j<boardMap.size();j++){ \t\t//..rivien lkm (boardMap.size) = alkioiden lkm. \n\t\t\tfor(int i=0; i<boardMap.get(j).length(); i++){\t\t//..merkkien lkm rivillä (alkion Stringin pituus .length)\n\t\t\t\tCharacter hexType = boardMap.get(j).charAt(i);\t//tuodaan tietyltä riviltä, yksittäinen MERKKI hexType -muuttujaan\n\t\t\t\tworld.add(new Hex(i, j, hexType.toString()));\t//Luodaan uusi HEXa maailmaan, Character -merkki muutetaan Stringiksi että Hex konstructori hyväksyy sen.\n\t\t\t}\n\t\t}\n\t\tconvertEmptyHex();\n\t}", "public Mapa(String ficheroMapa, String ficheroCamino) throws IOException\n{\n leerMapa(ficheroMapa);\n\n if(ficheroCamino != null)\n leerCamino(ficheroCamino);\n}", "public void populateMap(int playerNumber){\n\t\tint factor = 1;\n\t\t\n\t\t\n\t}", "public MapGenerator(GameMap map) {\n\n gameMap = map;\n setGuiHashMap();\n firstCountryFlag=true;\n validator = new MapValidator(gameMap);\n }", "public Map() {\n\n\t\t}", "public void load(String filePath){\r\n File loadFile = new File(filePath);\r\n if (!loadFile.exists()){\r\n System.out.println(\"I failed. There are no saved games.\");\r\n return;\r\n }\r\n FileInputStream fis = null;\r\n ObjectInputStream in = null;\r\n try {\r\n fis = new FileInputStream(filePath);\r\n in = new ObjectInputStream(fis);\r\n long versionUID = (long) in.readObject();\r\n if (versionUID != this.serialVersionUID) {\r\n throw new UnsupportedClassVersionError(\"Version mismatch for save game!\");\r\n }\r\n this.p = (Character) in.readObject();\r\n this.map = (SpecialRoom[][]) in.readObject();\r\n\r\n } catch (FileNotFoundException ex){\r\n System.out.println(\"The saved game was not found!\");\r\n ex.printStackTrace();\r\n } catch (IOException ex) {\r\n System.out.println(\"There was an error reading your save game :(\");\r\n ex.printStackTrace();\r\n System.out.println(\")\");\r\n } catch (ClassNotFoundException ex) {\r\n System.out.println(\"The version of the save game is not compatible with this game!\");\r\n ex.printStackTrace();\r\n } catch (UnsupportedClassVersionError ex) {\r\n System.out.println(ex.getMessage());\r\n ex.printStackTrace();\r\n } catch (Exception ex) {\r\n System.out.println(\"An unknown error occurred!\");\r\n }\r\n\r\n }", "public abstract void readFromFile(String key, String value);", "public void loadLevel(String tileMapPath)\r\n\t{\r\n\t\tTiledMap map= new TmxMapLoader().load(tileMapPath);\r\n\t\tcreateLights(map);\r\n\t}", "public void loadMapTiles(String[] paths) throws FileNotFoundException {\n\t\tthis.paths=paths;\n\t\tfor (int i = 0; i < tileMap.length; i++) {\n\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\n\t\t\t\tif (tileMap[i][j] < 0) {\n\t\t\t\t\ttiles[i][j] = null;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tTile tile = new Tile();\n\t\t\t\ttile.getPosition().setX(j*tileDimensions.getX());\n\t\t\t\ttile.getPosition().setY(i*tileDimensions.getY());\n\t\t\t\ttile.getDimensions().setX(tileDimensions.getX());\n\t\t\t\ttile.getDimensions().setY(tileDimensions.getY());\n\t\t\t\tFileInputStream fin = new FileInputStream(paths[tileMap[i][j]]);\n\t\t\t\tImage img = new Image(fin, tileDimensions.getX(), tileDimensions.getY(), false, false);\n\t\t\t\tSprite sprite = new Sprite(img);\n\t\t\t\ttile.setSprite(sprite);\n\t\t\t\ttiles[i][j] = tile;\n\t\t\t}\n\t\t}\n\t}", "public FMap(String rute) {\n super(rute);\n init(rute);\n }", "public TileWorldUtil(String fileName) {\n load(fileName);\n }", "public Map(SpriteLoader sprites) {\n\n this.sprites = sprites;\n\n }", "private void readData() {\n try (BufferedReader br = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream(fileName)))) {\n String line;\n while ((line = br.readLine()) != null) {\n String[] parts = line.split(\",\");\n int zip = Integer.parseInt(parts[0]);\n String name = parts[1];\n\n zipMap.put(zip, name);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void populateMaps() {\n\t\t//populate the conversion map.\n\t\tconvertMap.put(SPACE,(byte)0);\n\t\tconvertMap.put(VERTICAL,(byte)1);\n\t\tconvertMap.put(HORIZONTAL,(byte)2);\n\n\t\t//build the hashed numbers based on the training input. 1-9\n\t\tString trainingBulk[] = new String[]{train1,train2,train3,\"\"};\n\t\tbyte[][] trainer = Transform(trainingBulk);\n\t\tfor(int i=0; i < 9 ;++i) {\n\t\t\tint val = hashDigit(trainer, i);\n\t\t\tnumbers.put(val,i+1);\n\t\t}\n\t\t//train Zero\n\t\ttrainingBulk = new String[]{trainz1,trainz2,trainz3,\"\"};\n\t\tint zeroVal = hashDigit(Transform(trainingBulk), 0);\n\t\tnumbers.put(zeroVal,0);\n\n\n\t}" ]
[ "0.7292605", "0.7038616", "0.69150436", "0.6648618", "0.6618025", "0.65592605", "0.6546824", "0.65380377", "0.6510795", "0.64784336", "0.6449052", "0.6387763", "0.6369907", "0.6283092", "0.62696296", "0.6263968", "0.6227034", "0.6203549", "0.6099345", "0.6078452", "0.60298485", "0.60225403", "0.600066", "0.600051", "0.5997426", "0.59509987", "0.5938903", "0.5932884", "0.59325063", "0.5901295", "0.5900668", "0.5886336", "0.58767664", "0.58643", "0.5838934", "0.58309627", "0.57893324", "0.57863015", "0.57836676", "0.57772535", "0.57719934", "0.57330614", "0.5732924", "0.5712072", "0.569976", "0.56963587", "0.5693077", "0.56867903", "0.5676887", "0.5661269", "0.56542605", "0.5647944", "0.5601868", "0.5594643", "0.5593064", "0.5587701", "0.55844223", "0.55788714", "0.55782074", "0.55759364", "0.55746114", "0.55579436", "0.5545762", "0.55345356", "0.5519502", "0.5497403", "0.5497324", "0.54959303", "0.54949355", "0.54889244", "0.5487395", "0.5487139", "0.54723096", "0.5468789", "0.5446691", "0.5442714", "0.5439873", "0.5435887", "0.5435637", "0.54327935", "0.54256415", "0.5421826", "0.5406703", "0.5392352", "0.53897876", "0.53889364", "0.53753084", "0.53697896", "0.53690785", "0.53405046", "0.53345466", "0.53295374", "0.5327801", "0.53175443", "0.53065425", "0.53037864", "0.53016126", "0.5300495", "0.529514", "0.52949935" ]
0.785188
0
Returns the message's type.
public abstract int getType();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "MessageType getType();", "public String getMessageType()\r\n\t{\r\n\t\treturn this.messageType;\r\n\t}", "public java.lang.String getMessageType() {\r\n return messageType;\r\n }", "public String getMessageType() {\n return type.getMessage().getName();\n }", "public Utils.MessageType getMessageType() {\n return messageType;\n }", "MessageProto.MSG getType();", "public Integer getMessageType() {\n return messageType;\n }", "public MessageType getType() {\n return msgType;\n }", "public MessageType getMessageType() {\n\t\treturn messageType;\n\t}", "public messages.Basemessage.BaseMessage.Type getType() {\n return type_;\n }", "messages.Basemessage.BaseMessage.Type getType();", "public messages.Basemessage.BaseMessage.Type getType() {\n return type_;\n }", "public abstract MessageType getType();", "public abstract MessageType getType();", "public MessageType getType() {\n return m_type;\n }", "public MessageProto.MSG getType() {\n MessageProto.MSG result = MessageProto.MSG.valueOf(type_);\n return result == null ? MessageProto.MSG.UNRECOGNIZED : result;\n }", "public MessageProto.MSG getType() {\n MessageProto.MSG result = MessageProto.MSG.valueOf(type_);\n return result == null ? MessageProto.MSG.UNRECOGNIZED : result;\n }", "public static String getMessageType(TextMessage message) {\n JSONObject json = new JSONObject(message.getPayload());\n String type = json.keys().next();\n\n return type;\n }", "public MPTMessageType getMessageType()\n {\n \tint value = mMessage.getInt( B1_MESSAGE_TYPE );\n\n \treturn MPTMessageType.fromNumber( value );\n }", "public int getMsgType() {\n return msgType_;\n }", "public int getMsgType() {\n return msgType_;\n }", "public java.lang.String getMsgType() {\n java.lang.Object ref = msgType_;\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 msgType_ = s;\n return s;\n }\n }", "@Override\r\n\tpublic String getMessageType() {\n\t\treturn this.getClass().getName();\r\n\t}", "public java.lang.String getMsgType() {\n java.lang.Object ref = msgType_;\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 msgType_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public int getMessageType()\r\n {\r\n return msgType;\r\n }", "public MessageType getMessageType() {\n return messageType;\n }", "public int getMsgType() {\n\t\treturn msgType;\n\t}", "public com.eze.ezecli.ApiInput.MessageType getMsgType() {\n return msgType_;\n }", "public com.eze.ezecli.ApiInput.MessageType getMsgType() {\n return msgType_;\n }", "public org.graylog.plugins.dnstap.protos.DnstapOuterClass.Dnstap.Type getType() {\n org.graylog.plugins.dnstap.protos.DnstapOuterClass.Dnstap.Type result = org.graylog.plugins.dnstap.protos.DnstapOuterClass.Dnstap.Type.valueOf(type_);\n return result == null ? org.graylog.plugins.dnstap.protos.DnstapOuterClass.Dnstap.Type.MESSAGE : result;\n }", "com.mycompany.midtermproject2.proto.ServerMessageOuterClass.ServerMessage.MsgType getType();", "public org.graylog.plugins.dnstap.protos.DnstapOuterClass.Dnstap.Type getType() {\n org.graylog.plugins.dnstap.protos.DnstapOuterClass.Dnstap.Type result = org.graylog.plugins.dnstap.protos.DnstapOuterClass.Dnstap.Type.valueOf(type_);\n return result == null ? org.graylog.plugins.dnstap.protos.DnstapOuterClass.Dnstap.Type.MESSAGE : result;\n }", "public com.example.cs217b.ndn_hangman.MessageBuffer.Messages.MessageType getType() {\n return type_;\n }", "public com.example.cs217b.ndn_hangman.MessageBuffer.Messages.MessageType getType() {\n return type_;\n }", "public com.mycompany.midtermproject2.proto.ServerMessageOuterClass.ServerMessage.MsgType getType() {\n com.mycompany.midtermproject2.proto.ServerMessageOuterClass.ServerMessage.MsgType result = com.mycompany.midtermproject2.proto.ServerMessageOuterClass.ServerMessage.MsgType.valueOf(type_);\n return result == null ? com.mycompany.midtermproject2.proto.ServerMessageOuterClass.ServerMessage.MsgType.CHAT : result;\n }", "@java.lang.Override public entities.Torrent.Message.Type getType() {\n @SuppressWarnings(\"deprecation\")\n entities.Torrent.Message.Type result = entities.Torrent.Message.Type.valueOf(type_);\n return result == null ? entities.Torrent.Message.Type.UNRECOGNIZED : result;\n }", "@java.lang.Override\n public entities.Torrent.Message.Type getType() {\n @SuppressWarnings(\"deprecation\")\n entities.Torrent.Message.Type result = entities.Torrent.Message.Type.valueOf(type_);\n return result == null ? entities.Torrent.Message.Type.UNRECOGNIZED : result;\n }", "public abstract String getMessageType();", "public com.mycompany.midtermproject2.proto.ServerMessageOuterClass.ServerMessage.MsgType getType() {\n com.mycompany.midtermproject2.proto.ServerMessageOuterClass.ServerMessage.MsgType result = com.mycompany.midtermproject2.proto.ServerMessageOuterClass.ServerMessage.MsgType.valueOf(type_);\n return result == null ? com.mycompany.midtermproject2.proto.ServerMessageOuterClass.ServerMessage.MsgType.CHAT : result;\n }", "protected abstract MessageType getMessageType();", "public com.google.protobuf.ByteString\n getMsgTypeBytes() {\n java.lang.Object ref = msgType_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n msgType_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.czht.face.recognition.Czhtdev.MessageType getType() {\n com.czht.face.recognition.Czhtdev.MessageType result = com.czht.face.recognition.Czhtdev.MessageType.valueOf(type_);\n return result == null ? com.czht.face.recognition.Czhtdev.MessageType.MsgDefaultReply : result;\n }", "public com.czht.face.recognition.Czhtdev.MessageType getType() {\n com.czht.face.recognition.Czhtdev.MessageType result = com.czht.face.recognition.Czhtdev.MessageType.valueOf(type_);\n return result == null ? com.czht.face.recognition.Czhtdev.MessageType.MsgDefaultReply : result;\n }", "public proto.MessagesProtos.ClientRequest.MessageType getType() {\n\t\t\t@SuppressWarnings(\"deprecation\")\n\t\t\tproto.MessagesProtos.ClientRequest.MessageType result = proto.MessagesProtos.ClientRequest.MessageType.valueOf(type_);\n\t\t\treturn result == null ? proto.MessagesProtos.ClientRequest.MessageType.UNRECOGNIZED : result;\n\t\t}", "com.randomm.server.ProtoBufMessage.Message.InputType getType();", "@Override\n public Message getMessageType(Message message) {\n if (message.getHeader().getMessageType() == MESSAGE_TYPE) {\n return new AbilityMessage(message);\n } else {\n // Send it on to the next in the chain\n if (this.messageChain != null) {\n return this.messageChain.getMessageType(message);\n }\n }\n return null;\n }", "public proto.MessagesProtos.ClientRequest.MessageType getType() {\n\t\t\t\t@SuppressWarnings(\"deprecation\")\n\t\t\t\tproto.MessagesProtos.ClientRequest.MessageType result = proto.MessagesProtos.ClientRequest.MessageType.valueOf(type_);\n\t\t\t\treturn result == null ? proto.MessagesProtos.ClientRequest.MessageType.UNRECOGNIZED : result;\n\t\t\t}", "public com.randomm.server.ProtoBufMessage.Message.InputType getType() {\n return type_;\n }", "public com.randomm.server.ProtoBufMessage.Message.InputType getType() {\n return type_;\n }", "com.example.cs217b.ndn_hangman.MessageBuffer.Messages.MessageType getType();", "public com.google.protobuf.ByteString\n getMsgTypeBytes() {\n java.lang.Object ref = msgType_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n msgType_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "GetMessagesType(Message message) {\n super(message);\n }", "public String messageContentType() {\n return this.messageContentType;\n }", "public static MessageType getType(String type){\n\t\t\tMessageType msgType = PING;\n\t\t\tswitch(type){\n\t\t\tcase \"login\" : msgType = LOGIN; break;\n\t\t\tcase \"get\" : msgType = GET_TOPIC; break;\n\t\t\tcase \"new\" : msgType = NEW; break;\n\t\t\tcase \"ping\" : msgType = PING; break;\n\t\t\tcase \"select\" : msgType = SELECT; break;\n\t\t\tcase \"append\" : msgType = APPEND; break;\n\t\t\t}\n\t\t\treturn msgType;\n\t\t}", "org.graylog.plugins.dnstap.protos.DnstapOuterClass.Message.Type getType();", "entities.Torrent.Message.Type getType();", "public String getType() {\n Object ref = type_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n type_ = s;\n }\n return s;\n }\n }", "public String getType() {\n Object ref = type_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n type_ = s;\n }\n return s;\n }\n }", "public String getType() {\n Object ref = type_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n type_ = s;\n }\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getType() {\n Object ref = type_;\n if (!(ref instanceof String)) {\n String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n type_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getType() {\n try {\n return (String)replyHeaders.getHeader(HeaderSet.TYPE);\n } catch (IOException e) {\n return null;\n }\n }", "public OutlookAttachmentType getType()\n {\n return getConstant(\"Type\", OutlookAttachmentType.class);\n }", "com.nhcsys.webservices.getmessages.getmessagestypes.v1.SupportMessageType.Enum getType();", "public org.graylog.plugins.dnstap.protos.DnstapOuterClass.Message.Type getType() {\n org.graylog.plugins.dnstap.protos.DnstapOuterClass.Message.Type result = org.graylog.plugins.dnstap.protos.DnstapOuterClass.Message.Type.valueOf(type_);\n return result == null ? org.graylog.plugins.dnstap.protos.DnstapOuterClass.Message.Type.AUTH_QUERY : result;\n }", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "public String getType() {\n Object ref = type_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n type_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getType() {\n Object ref = type_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n type_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public org.graylog.plugins.dnstap.protos.DnstapOuterClass.Message.Type getType() {\n org.graylog.plugins.dnstap.protos.DnstapOuterClass.Message.Type result = org.graylog.plugins.dnstap.protos.DnstapOuterClass.Message.Type.valueOf(type_);\n return result == null ? org.graylog.plugins.dnstap.protos.DnstapOuterClass.Message.Type.AUTH_QUERY : result;\n }", "public java.lang.String getType() {\n java.lang.Object ref = type_;\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 if (bs.isValidUtf8()) {\n type_ = s;\n }\n return s;\n }\n }", "public java.lang.String getType() {\n java.lang.Object ref = type_;\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 if (bs.isValidUtf8()) {\n type_ = s;\n }\n return s;\n }\n }", "public java.lang.String getType() {\n java.lang.Object ref = type_;\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 if (bs.isValidUtf8()) {\n type_ = s;\n }\n return s;\n }\n }", "public java.lang.String getType() {\n java.lang.Object ref = type_;\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 if (bs.isValidUtf8()) {\n type_ = s;\n }\n return s;\n }\n }", "public String getType() {\n return (String) getObject(\"type\");\n }", "public static String getType() {\n\t\treturn type;\n\t}", "public final String type() {\n return type;\n }", "MessagesType createMessagesType();", "public java.lang.String getType() {\n java.lang.Object ref = type_;\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 type_ = s;\n return s;\n }\n }", "public java.lang.String getType() {\n java.lang.Object ref = type_;\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 type_ = s;\n return s;\n }\n }", "public java.lang.String getType() {\n java.lang.Object ref = type_;\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 type_ = s;\n return s;\n }\n }", "public java.lang.String getType() {\n java.lang.Object ref = type_;\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 type_ = s;\n return s;\n }\n }", "public java.lang.String getType() {\n java.lang.Object ref = type_;\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 type_ = s;\n return s;\n }\n }", "public java.lang.String getType() {\n java.lang.Object ref = type_;\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 if (bs.isValidUtf8()) {\n type_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();" ]
[ "0.8418045", "0.8411521", "0.8321378", "0.83184046", "0.82782096", "0.81800634", "0.80606467", "0.8023289", "0.80146337", "0.8014441", "0.80070764", "0.7989515", "0.79824865", "0.79824865", "0.79172283", "0.78643286", "0.7849148", "0.7772846", "0.77610254", "0.7714924", "0.7707823", "0.767203", "0.7641785", "0.7640022", "0.7609877", "0.7569109", "0.7541842", "0.75024235", "0.74921143", "0.7415723", "0.73710823", "0.7364829", "0.73630255", "0.7355921", "0.72285885", "0.7215027", "0.7184945", "0.7174773", "0.71476704", "0.7058756", "0.69759524", "0.696635", "0.69485086", "0.69460607", "0.69404286", "0.69248074", "0.69245046", "0.69065696", "0.6905777", "0.689922", "0.68756586", "0.6866823", "0.6847828", "0.6842185", "0.68392533", "0.68312544", "0.6759417", "0.6759417", "0.67442894", "0.6726965", "0.67255175", "0.6719141", "0.66932184", "0.6688455", "0.6681007", "0.6681007", "0.6681007", "0.6681007", "0.6681007", "0.6681007", "0.6681007", "0.6681007", "0.6681007", "0.6681007", "0.6681007", "0.6681007", "0.6681007", "0.66754836", "0.66754836", "0.66607827", "0.6643994", "0.6643994", "0.6643994", "0.6643994", "0.66243905", "0.66227305", "0.66075575", "0.6606466", "0.65952194", "0.65952194", "0.65952194", "0.65952194", "0.65952194", "0.65881723", "0.6584913", "0.6584913", "0.6584913", "0.6584913", "0.6584913", "0.6584913", "0.6584913" ]
0.0
-1
sets the left bitmap
public void setBitmapLeft(Bitmap b){ imgLeft = b; left.setBitmap(b); invalidate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setBitmapRight(Bitmap b){\n\t\timgRight = b;\n\t\tright.setBitmap(b);\n\t\tinvalidate();\n\t}", "public void setLeft(AVLNode<E> left) {\r\n\t\tthis.left = left;\r\n\t}", "public void setLeft(BinNode<E> l)\n {\n left = l;\n }", "public void setLeft() {\n\t\tstate = State.LEFT;\n\t}", "public void setLeft(Lane left) {\r\n\t\tthis.left = left;\r\n\t}", "public void adjustLeft() {\n\n for (int y = 0; y < MAP_HEIGHT; y++)\n for (int x = 0; x < MAP_WIDTH; x++) {\n tiles[x][y].x = tiles[x][y].x - 4;\n backGroundTiles[x][y].x = backGroundTiles[x][y].x - 4;\n grassTiles[x][y].x = grassTiles[x][y].x - 4;\n }\n }", "public static void setLeft(char left) {\n\t\t\tGamePreferences.left = left;\n\t\t}", "public void setXLeft(int left) {\n this.xLeft = left;\n }", "public void leftOff() {\r\n\t\tsetLeftColor(0, 0, 0);\r\n\t}", "public void rotateLeft() {\n // I fucked up? Rotations are reversed, just gonna switch em\n// tileLogic = getRotateLeft();\n tileLogic = getRotateRight();\n// rotateLeftTex();\n rotateRightTex();\n }", "public void setLeft(boolean left) {\n\t\tthis.left = left;\n\t}", "void setLeft(boolean left) {\n myLeft = left;\n }", "public void setLeft(final BinaryTreeNode<E> left) {\n this.left = left;\n }", "public void left(){\n\t\tmoveX=-1;\n\t\tmoveY=0;\n\t}", "public void moveLeft() {\n this.accelerateXL();\n this.moveX(this.getxSpeed());\n this.setPicX(0);\n this.setPicY(141);\n this.setLoopCells(true);\n }", "public void setLeft(TreeNode left) {\n\t\tthis.left = left;\n\t}", "public void setLeft(IAVLNode node) {\n\t\t\tthis.left = node; // to be replaced by student code\n\t\t}", "public void setLeft(IAVLNode node);", "public void setLeft(IAVLNode node);", "public void setLeft(Node left) {\n this.left = left;\n }", "void left() {\n startAnimation(leftSubCubes(), Axis.X, Direction.ANTICLOCKWISE);\n leftCubeSwap();\n }", "public void setLeft (Node l) {\r\n\t\tleft = l;\r\n\t}", "public UtilsPadding setLeft(Number left) {\n if (jsBase == null) {\n this.left = null;\n this.left1 = null;\n \n this.left = left;\n } else {\n this.left = left;\n if (!isChain) {\n js.append(jsBase);\n isChain = true;\n }\n \n js.append(String.format(Locale.US, \".left(%s)\", left));\n\n if (isRendered) {\n onChangeListener.onChange(String.format(Locale.US, jsBase + \".left(%s);\", left));\n js.setLength(0);\n }\n }\n return this;\n }", "public void setLeftNeighbor(Board leftNeighbor) {\r\n\t\tthis.leftNeighbor = leftNeighbor;\r\n\t}", "public void setLeft(int x) {\r\n leftSide = x;\r\n }", "public void leftPressed()\r\n {\r\n worldPanel.newMapPos(-zoom,0);\r\n miniMap.newMapPos(-1,0);\r\n }", "public void setLeftColor(int r, int g, int b) {\r\n\t\ttable.putNumber(\"leftR\", r);\r\n\t\ttable.putNumber(\"leftG\", g);\r\n\t\ttable.putNumber(\"leftB\", b);\r\n\t}", "private void resetBounds(boolean right) {\n if (right) {\n textureRegionBounds2 = textureRegionBounds1;\n textureRegionBounds1 = new Rectangle(-Constants.APP_WIDTH, 0, Constants.APP_WIDTH, Constants.APP_HEIGHT);\n } else {\n textureRegionBounds1 = textureRegionBounds2;\n textureRegionBounds2 = new Rectangle(Constants.APP_WIDTH, 0, Constants.APP_WIDTH, Constants.APP_HEIGHT);\n }\n\n }", "private void addLeftDrawable() {\n\n// mBusinessTitle.setCompoundDrawables(getDrawable(R.drawable.ic_assignment_black_24dp), null, null, null );\n//\n// mBusinessPhone.setCompoundDrawables(getDrawable(R.drawable.ic_settings_phone_black_24dp), null, null, null );\n//\n// mBusinessEmail.setCompoundDrawables(getDrawable(R.drawable.ic_mail_black_24dp), null, null, null );\n\n //change menu item save changes icon\n doneDrawable = getDrawable(R.drawable.ic_done_black_24dp);\n\n //change menu item reload icon\n updateDrawable = getDrawable(R.drawable.ic_edit_black_24dp);\n\n //add location drawable\n updateDrawable = new IconicsDrawable(this)\n .icon(GoogleMaterial.Icon.gmd_location_on)\n .color(getResources().getColor(R.color.editProfile_icon))\n .sizeDp(20);\n mAddLocation.setCompoundDrawables(getDrawable(R.drawable.ic_edit_black_24dp), null, null, null );\n\n mClearLocation.setBackground(getDrawable(R.drawable.ic_edit_black_24dp));\n }", "public void setLeft(boolean b){ left = b; }", "public void setLeft(boolean b){ left = b; }", "public void setLeft(BinaryTree<E> newLeft)\r\n\t// post: sets left subtree to newLeft\r\n\t// re-parents newLeft if not null\r\n\t{\r\n\t\tif (isEmpty()) return;\r\n\t\tif (left != null && left.parent() == this) left.setParent(null);\r\n\t\tleft = newLeft;\r\n\t\tleft.setParent(this);\r\n\t}", "private void animateLeft(){\n if(frame == 1){\n setImage(run1_l);\n }\n else if(frame == 2){\n setImage(run2_l);\n }\n else if(frame == 3){\n setImage(run3_l);\n }\n else if(frame == 4){\n setImage(run4_l);\n }\n else if(frame == 5){\n setImage(run5_l);\n }\n else if(frame == 6){\n setImage(run6_l);\n }\n else if(frame == 7){\n setImage(run7_l);\n }\n else if(frame == 8){\n setImage(run8_l);\n frame =1;\n return;\n }\n frame ++;\n }", "public void setLeftEye(Eye leftEye) {\n\t\tremoveSceneObject(this.leftEye);\n\t\t\n\t\t// ... and add the new one\n\t\tthis.leftEye = leftEye;\n\t\taddSceneObject(leftEye);\n\t}", "public void setLeftChild(BinaryNode leftChild) {\n\t\tthis.leftChild = leftChild;\n\t}", "protected void left() {\n move(positionX - 1, positionY);\n orientation = BattleGrid.RIGHT_ANGLE * 2;\n }", "public int getLeftImageId() {\n return leftImageId;\n }", "public void refreshLeft();", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }", "public boolean SetLeft(Tree ln){\n\tleft = ln ;\n\treturn true ;\n }" ]
[ "0.65295345", "0.63819075", "0.63686043", "0.6318216", "0.63034844", "0.62516046", "0.6151049", "0.6088505", "0.60588384", "0.6052909", "0.6051465", "0.6041365", "0.6022079", "0.59941417", "0.5991518", "0.59905255", "0.5982874", "0.59482723", "0.59482723", "0.59439474", "0.59298044", "0.5929271", "0.59072304", "0.58710384", "0.58482635", "0.5847123", "0.581657", "0.5806507", "0.5799089", "0.5793449", "0.5793449", "0.57471377", "0.57416046", "0.57285714", "0.571949", "0.5717781", "0.56969583", "0.5687536", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452", "0.5686452" ]
0.844237
0
sets the right bitmap
public void setBitmapRight(Bitmap b){ imgRight = b; right.setBitmap(b); invalidate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setBitmap(Bitmap bitmap) {\n\t\t\n\t}", "void setImage(Bitmap bitmap);", "private void setImage(Bitmap image) {\n }", "public void setBitmap(Bitmap bitmap){\n this.bitmap = Bitmap.createScaledBitmap(bitmap,(int)(bitmap.getWidth()*bitmapScale),(int)(bitmap.getHeight()*bitmapScale),false);\n //TODO:Update hitBox to scale to new bitmap\n }", "public abstract void setUpBitmap(Context context);", "public void setImage(Bitmap bitmap) {\n this.bitmap = bitmap;\n }", "public void resultImgSet(Bitmap bitmap) {\n fpResultImg.setImageBitmap(bitmap);\n }", "@Override\n\tpublic void setImageBitmap(Bitmap bm) {\n\t\tif (mImage==mOriginal) {\n\t\t\tmOriginal=null;\n\t\t} else {\n\t\t\tmOriginal.recycle();\n\t\t\tmOriginal=null;\n\t\t}\n\t\tif (mImage != null) {\n\t\t\tmImage.recycle();\n\t\t\tmImage=null;\n\t\t}\n\t\tmImage = bm;\n\t\tmOriginal = bm;\n\t\ttry{\n\t\tmImageHeight = mImage.getHeight();\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tmImageHeight=0;\n\t\t}\n\t\tmImageWidth = mImage.getWidth();\n\t\tmAspect = (float)mImageWidth / mImageHeight;\n\t\tsetInitialImageBounds();\n\t}", "public void mo8098a(Bitmap bitmap, Bitmap bitmap2) {\n if (bitmap2 != null) {\n C2342x.m9083a((View) this, (Drawable) new BitmapDrawable(getContext().getResources(), bitmap2));\n } else {\n C2342x.m9082a((View) this, 0);\n }\n if (bitmap != null) {\n this.f6228b = bitmap.getWidth();\n this.f6229c = bitmap.getHeight();\n this.f6227a.setImageBitmap(Bitmap.createBitmap(bitmap));\n return;\n }\n this.f6227a.setImageDrawable(null);\n }", "void setNextBitmap( Bitmap bitmap ) {\n\t\tsetNextBitmap( bitmap, true );\n\t}", "Bitmap m7900a(Bitmap bitmap);", "void setNextBitmap( Bitmap bitmap, boolean update ) {\n\t\tsetNextBitmap( bitmap, update, null );\n\t}", "private void setBitmapViewFull(Bitmap bitmap) {\n\n\t\t\tmCanvas.drawBitmap(bitmap, 0, 0, null);\n\t\t\tmCanvas.drawBitmap(bitmap, null, screenRect, null);\n\n\t\t\tif (DEBUG) {\n\t\t\t\tmCanvas.drawRect(recordRect, mRectPaint);\n\t\t\t\tmCanvas.drawRect(playRect, mRectPaint);\n\t\t\t}\n\t\t\tinvalidate();\n\t\t}", "private void setPic()\n {\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(currentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n int scaleFactor = Math.min(photoW/384, photoH/512);\n\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n\n Bitmap bitmap = BitmapFactory.decodeFile(currentPhotoPath, bmOptions);\n imageCapture.setImageBitmap(bitmap);\n }", "private void setPic() {\n int targetW = mainImageView.getWidth();\n int targetH = mainImageView.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n// bmOptions.inPurgeable = true;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n mainImageView.setImageBitmap(bitmap);\n\n// bmOptions.inBitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n// mainImageView.setImageBitmap(bmOptions.inBitmap);\n }", "void mo12205a(Bitmap bitmap);", "public void setBitmapIn(Bitmap bitmapIn) {\r\n\t\tthis.bitmapIn = bitmapIn;\r\n\t}", "void setNextBitmap( Bitmap bitmap, boolean update, Matrix matrix ) {\n\t\tlogger.log( \"setNextBitmap\", bitmap, update, matrix );\n\n\t\tif ( null != mBitmapChangeListener ) mBitmapChangeListener.onBitmapChange( bitmap, update, matrix );\n\n\t\tif ( !mBitmap.equals( bitmap ) ) {\n\t\t\tlogger.warning( \"[recycle] original Bitmap: \" + mBitmap );\n\t\t\tmBitmap.recycle();\n\t\t\tmBitmap = null;\n\t\t}\n\t\tmBitmap = bitmap;\n\t}", "public void setBitmapLeft(Bitmap b){\n\t\timgLeft = b;\n\t\tleft.setBitmap(b);\n\t\tinvalidate();\n\t}", "private void setPic() {\n int targetW = img_clip.getWidth();\n int targetH = img_clip.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n img_clip.setImageBitmap(bitmap);\n }", "@Override\r\n\tpublic void setImageBitmap(Bitmap source) {\n//\r\n//\t\tMatrix matrix = new Matrix();\r\n//\t\tmatrix.postScale(ratio, ratio);\r\n//\t\tsource = Bitmap.createBitmap(source, 0, 0, width, height, matrix, true);\r\n//\r\n//\t\twidth = source.getWidth();\r\n//\t\theight = source.getHeight();\r\n//\r\n//\t\tx = (width - ConfigSize.SIZE_THUMB) / 2;\r\n//\t\ty = (height - ConfigSize.SIZE_THUMB) / 2;\r\n//\r\n//\t\tsource = Bitmap.createBitmap(source, x, y, ConfigSize.SIZE_THUMB,\r\n//\t\t\t\tConfigSize.SIZE_THUMB);\r\n\r\n\t\tsuper.setImageBitmap(source);\r\n\t}", "public void setImg(){\n if(PicSingleton.getInstance().getPicToShape() != null){\n\n mResultImg.setImageDrawable(PicSingleton.getInstance().getPicShaped());\n }\n }", "public void setImageBitmapInto(Bitmap bitmap, View view) {\n ((ImageView) view).setImageBitmap(bitmap);\n }", "public void showbitmap2() {\n \t\tImageView i = (ImageView)findViewById(R.id.frame2);\n \t\ti.setImageBitmap(mBitmap2);\n \t}", "protected void setPic() {\n }", "private void setPic() {\n int targetW = imageView.getMaxWidth();\n int targetH = imageView.getMaxHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n Bitmap bitmap = BitmapFactory.decodeFile(currentPhotoPath, bmOptions);\n bitmap = Bitmap.createScaledBitmap(bitmap, 1280, 960,false);\n Log.d(\"demo\", \"setPic: \"+ bitmap.getWidth()+\" \"+bitmap.getHeight());\n Log.d(\"demo\", \"setPic: \"+ bitmap.getByteCount()/1000);\n imageView.setImageBitmap(bitmap);\n }", "public void drawResultBitmap(Bitmap barcode) {\n resultBitmap = barcode;\n invalidate();\n }", "private void setPic() {\n int targetW = imageView.getWidth();\n int targetH = imageView.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n imageView.setImageBitmap(bitmap);\n imageView.invalidate();\n }", "public void showbitmap3() {\n \n \t}", "void lSetImage(Image img);", "private Bitmap setPic() {\n int targetH = 0; //mImageView.getHeight();\n int targetW = 0; //mImageView.getWidth();\n\n\n\t\t/* Get the size of the image */\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n if( photoH > photoW ){\n /*Se definen las dimensiones de la imagen que se desea generar*/\n targetH = Const.MedidasReduccionImagen.PEQUENA_PORTRAIT.heigh; // 640;\n targetW = Const.MedidasReduccionImagen.PEQUENA_PORTRAIT.width; //480;\n }else{\n targetH = Const.MedidasReduccionImagen.PEQUENA_LANDSCAPE.heigh; //480;\n targetW = Const.MedidasReduccionImagen.PEQUENA_LANDSCAPE.width; //640;\n }\n\n\t\t/* Figure out which way needs to be reduced less */\n int scaleFactor = 0;\n if ((targetW > 0) || (targetH > 0)) {\n scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n }\n\n\t\t/* Set bitmap options to scale the image decode target */\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n\t\t/* Decode the JPEG file into a Bitmap */\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\n return bitmap;\n }", "public void setImage(Bitmap image) {\n this.image = image;\n }", "public void drawResultBitmap(Bitmap barcode) {\n resultBitmap = barcode;\n invalidate();\n }", "public void drawResultBitmap(Bitmap barcode) {\n resultBitmap = barcode;\n invalidate();\n }", "private void markBitmap(int frameNo){\n int bit = frameNo/32;\n int mask = frameNo%32;\n bitMap[bit] = bitMap[bit]|MASK[mask];\n }", "public void showbitmap4() {\n \n \t}", "private void populateFromSprite() {\n long start = System.currentTimeMillis();\n int bitSetIndex = 0;\n BufferedImage bImage = (BufferedImage) sprite.m_image;\n //BufferedImage img = ImageIO.read(new File(\"assets/LoopBitmap.bmp\"));\n int color;\n // Loop through image according to scale\n for(int i = 0; i < sprite.getWidth(); i+=scale) {\n for(int j = 0; j < sprite.getHeight(); j+= scale) {\n // Get color at pixel i, j, if black set Bitmap index to true.\n color = bImage.getRGB(i, j);\n if(color == Color.BLACK.getRGB()) { //tempColor.equals(Color.black)) {\n this.set(bitSetIndex, true);\n //System.out.println(\"'BLACK' Color = \"+color + \" i=\"+ i + \", j=\"+j);\n }\n bitSetIndex++;\n }\n }\n long end = System.currentTimeMillis();\n// System.out.println(\">>>>>>>>>>>>>>>>>>>>>>>>>>>>\");\n// System.out.println(\"BITMAP DONE :)\");\n// System.out.println(\"Time to build = \"+(end-start)+\"ms\");\n// System.out.println(\">>>>>>>>>>>>>>>>>>>>>>>>>>>>\");\n }", "private void setPic() {\n int targetW =200;\n int targetH = 300;\n\n\n\t\t/* Get the size of the image */\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n\t\t/* Figure out which way needs to be reduced less */\n int scaleFactor = 1;\n if ((targetW > 0) || (targetH > 0)) {\n scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n }\n\n\t\t/* Set bitmap options to scale the image decode target */\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n\t\t/* Decode the JPEG file into a Bitmap */\n bitmap1 = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\n Log.e(\"bitmap\", \"\" + bitmap1);\n mAdapter = new MyAdapter(Goonlineactivity2.this,TITLES,ICONS,NAME,EMAIL,PROFILE); // Creating the Adapter of MyAdapter class(which we are going to see in a bit)\n // And passing the titles,icons,header view name, header view email,\n // and header view profile picture\n\n mRecyclerView.setAdapter(mAdapter);\n //profile11.setImageBitmap(bitmap1);\n\n \t\t/* Associate the Bitmap to the ImageView */\n\n }", "public void setImage(Bitmap bitmap) {\n\t\tif (bitmap == null)\n\t\t\tthis.image = null;\n\t\telse if (this.image == null)\n\t\t\tthis.image = new Image(this.getId(), bitmap);\n\t\telse\n\t\t\tthis.image.setBitmap(bitmap);\n\t}", "private void setPic() {\n int targetW = imageIV.getWidth();\n int targetH = imageIV.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n imageIV.setImageBitmap(bitmap);\n }", "void setImage(BufferedImage valueImage, BufferedImage BackImage);", "private void setPic() {\n int targetW = mImageView.getWidth();\n int targetH = mImageView.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW / targetW, photoH / targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\n// Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n mImageView.setImageBitmap(bitmap);\n }", "private void setPic() {\n int targetW =20;// mImageView.getWidth();\n int targetH =20;// mImageView.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;//设置仅加载位图边界信息(相当于位图的信息,但没有加载位图)\n\n //返回为NULL,即不会返回bitmap,但可以返回bitmap的横像素和纵像素还有图片类型\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n mImageView.setImageBitmap(bitmap);\n }", "private void setPic() {\n int targetW = 210;\n int targetH = 320;\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(previewPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n Bitmap bitmap = BitmapFactory.decodeFile(previewPhotoPath, bmOptions);\n bitmap = RotateBitmap(bitmap,270);\n preview.setImageBitmap(bitmap);\n }", "public void run() {\n sight.setImageBitmap(bmp);\n // old = null;\n }", "private void setPic() {\n\t\tint targetW = Constant.sRealWidth;\n\t\tint targetH = Constant.sRealHeight;\n\n\t\t/* Get the size of the image */\n\t\tBitmapFactory.Options bmOptions = new BitmapFactory.Options();\n\t\tbmOptions.inJustDecodeBounds = true;\n\t\tBitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\t\tint photoW = bmOptions.outWidth;\n\t\tint photoH = bmOptions.outHeight;\n\t\t\n\t\t/* Figure out which way needs to be reduced less */\n\t\tint scaleFactor = 1;\n\t\tif ((targetW > 0) || (targetH > 0)) {\n\t\t\tscaleFactor = Math.min(photoW/targetW, photoH/targetH);\t\n\t\t}\n\n\t\t/* Set bitmap options to scale the image decode target */\n\t\tbmOptions.inJustDecodeBounds = false;\n\t\tbmOptions.inSampleSize = scaleFactor;\n\t\tbmOptions.inPurgeable = true;\n\n\t\t/* Decode the JPEG file into a Bitmap */\n\t\tBitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\t\t\n\t\tint rotate = ViewUtils.handleRotateBitmap(mCurrentPhotoPath);\n\t\tif (rotate != 0) {\n\t\t\tbitmap = ViewUtils.rotaingBitmap(\n\t\t\t\t\trotate, bitmap);\n\t\t}\n\t\t/* Associate the Bitmap to the ImageView */\n\t\tmPictureView.setImageBitmap(bitmap);\n\t}", "void setBitsPerPixel(int bitsPerPixel);", "public void setBmp(int bmpId) {\n bmp_on = BitmapFactory.decodeResource(GameView.game.get().getResources(), bmpId);\n src = new Rect(0, 0, bmp_on.getWidth(), bmp_on.getHeight());\n\n r = new Rect((int) ((x - width / 2)), (int) ((y - height / 2)),\n (int) ((x + width / 2)), (int) ((y + height / 2)));\n }", "private void setImage(int w, int h){\r\n l1= new BufferedImage(w,h,BufferedImage.TYPE_INT_ARGB);\r\n l1.createGraphics();\r\n g=(Graphics2D)l1.getGraphics (); \r\n }", "private void setImageBitmap(ImageView imageView, Bitmap bitmap,\n boolean isTran) {\n if (isTran) {\n final TransitionDrawable td = new TransitionDrawable(\n new Drawable[] {\n new ColorDrawable(android.R.color.transparent),\n new BitmapDrawable(mContext.getResources(), bitmap) });\n td.setCrossFadeEnabled(true);\n imageView.setImageDrawable(td);\n td.startTransition(300);\n } else {\n imageView.setImageBitmap(bitmap);\n }\n }", "private void callbitmapmethod() {\n\t\ttry {\n\t\t\tencode.clear();\n\t\t\tfor (int i = 0; i < queueItemforApproval.size(); i++) {\n\t\t\t\t/**/\n\t\t\t\tQueueString en = new QueueString();\n\t\t\t\tif (queueItemforApproval.get(i).bitmap != null) {\n\t\t\t\t\tSystem.out.println(\"bitmap is:\"\n\t\t\t\t\t\t\t+ queueItemforApproval.get(i).bitmap);\n\t\t\t\t\ten.path = convertintobase64(queueItemforApproval.get(i).bitmap);\n\t\t\t\t\tSystem.out.println(\"path is :\" + en.path);\n\t\t\t\t\t// Bitmap bitmap = decodeBase64(en.path, i);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"bitmap is null\");\n\t\t\t\t}\n\t\t\t\tencode.add(en);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override\n\t\t\t\tpublic void onObtainBitmap(Bitmap bitmap, ImageView imageView) {\n\t\t\t\t\timageView.setImageBitmap(bitmap);\n\t\t\t\t}", "@Override\n void draw(Canvas canvas) {\n canvas.drawBitmap(appearance, getX(), getY(), null);\n }", "public void setImage(String bitmap) {\n\t\tif (bitmap == null)\n\t\t\tthis.image = null;\n\t\telse if (this.image == null)\n\t\t\tthis.image = new Image(this.getId(), bitmap);\n\t\telse\n\t\t\tthis.image.setBitmap(bitmap);\n\t}", "private void recreateBitmap() {\n if (sprite != null) {\n sprite.recycle();\n }\n sprite = Bitmap.createBitmap(specState.targetWidth,\n specState.targetHeight,\n Bitmap.Config.ARGB_8888);\n spriteDrawable = new BitmapDrawable(getResources(), sprite);\n spriteDrawable.getPaint().setFilterBitmap(false);\n preview.setImageDrawable(spriteDrawable);\n }", "public Bitmap mo8554a(BitmapPool bitmapPool, Bitmap bitmap, int i, int i2) {\n float f;\n C12932j.m33818b(bitmapPool, \"pool\");\n C12932j.m33818b(bitmap, \"srcBmp\");\n Bitmap bitmap2 = bitmapPool.get(i, i2, bitmap.getConfig());\n C12932j.m33815a((Object) bitmap2, \"pool.get(outWidth, outHeight, srcBmp.config)\");\n Matrix matrix = new Matrix();\n int i3 = this.f7488e;\n float f2 = (float) i;\n float f3 = (float) i2;\n matrix.setScale(1.0f - ((((float) i3) * 2.0f) / f2), 1.0f - ((((float) i3) * 2.0f) / f3), f2 / 2.0f, f3 / 2.0f);\n C1334a aVar = this.f7487d;\n if (aVar instanceof C1336b) {\n f = ((C1336b) aVar).mo6551b() * ((float) Math.min(i, i2));\n } else if (aVar instanceof C1335a) {\n f = ((C1335a) aVar).mo6547b();\n } else {\n throw new NoWhenBranchMatchedException();\n }\n C7780a aVar2 = new C7780a();\n aVar2.mo19991c(0.0f);\n aVar2.mo19994e(0.0f);\n aVar2.mo19993d(f2);\n aVar2.mo19985a(f3);\n aVar2.mo19989b(f);\n Path a = C7780a.m18885a(aVar2, null, 1, null);\n Canvas canvas = new Canvas(bitmap2);\n canvas.drawPath(a, this.f7485b);\n canvas.drawBitmap(bitmap, matrix, this.f7486c);\n return bitmap2;\n }", "@WorkerThread @UiThread\n public void setBitmap(String url, Bitmap bitmap) {\n synchronized (this) {\n this.bitmaps.put(url, bitmap);\n }\n\n // Tell all registered views that a bitmap changed\n notifyViews(Event.BITMAP_CHANGED);\n }", "private android.graphics.Bitmap getMaskBitmap() {\n /*\n r20 = this;\n r0 = r20;\n r1 = r0.f5066b;\n if (r1 == 0) goto L_0x0009;\n L_0x0006:\n r1 = r0.f5066b;\n return r1;\n L_0x0009:\n r1 = r0.f5069f;\n r2 = r20.getWidth();\n r1 = r1.m6537a(r2);\n r2 = r0.f5069f;\n r3 = r20.getHeight();\n r2 = r2.m6539b(r3);\n r3 = m6543a(r1, r2);\n r0.f5066b = r3;\n r4 = new android.graphics.Canvas;\n r3 = r0.f5066b;\n r4.<init>(r3);\n r3 = com.facebook.shimmer.ShimmerFrameLayout.C18663.f5049a;\n r5 = r0.f5069f;\n r5 = r5.f5059i;\n r5 = r5.ordinal();\n r3 = r3[r5];\n r5 = 4611686018427387904; // 0x4000000000000000 float:0.0 double:2.0;\n r7 = 2;\n if (r3 == r7) goto L_0x0074;\n L_0x003b:\n r3 = com.facebook.shimmer.ShimmerFrameLayout.C18663.f5050b;\n r8 = r0.f5069f;\n r8 = r8.f5051a;\n r8 = r8.ordinal();\n r3 = r3[r8];\n r8 = 0;\n switch(r3) {\n case 2: goto L_0x0055;\n case 3: goto L_0x0051;\n case 4: goto L_0x004f;\n default: goto L_0x004b;\n };\n L_0x004b:\n r9 = r1;\n r3 = 0;\n L_0x004d:\n r10 = 0;\n goto L_0x0058;\n L_0x004f:\n r3 = r2;\n goto L_0x0053;\n L_0x0051:\n r8 = r1;\n r3 = 0;\n L_0x0053:\n r9 = 0;\n goto L_0x004d;\n L_0x0055:\n r10 = r2;\n r3 = 0;\n r9 = 0;\n L_0x0058:\n r19 = new android.graphics.LinearGradient;\n r12 = (float) r8;\n r13 = (float) r3;\n r14 = (float) r9;\n r15 = (float) r10;\n r3 = r0.f5069f;\n r16 = r3.m6538a();\n r3 = r0.f5069f;\n r17 = r3.m6540b();\n r18 = android.graphics.Shader.TileMode.REPEAT;\n r11 = r19;\n r11.<init>(r12, r13, r14, r15, r16, r17, r18);\n r3 = r19;\n goto L_0x009c;\n L_0x0074:\n r3 = r1 / 2;\n r8 = r2 / 2;\n r16 = new android.graphics.RadialGradient;\n r10 = (float) r3;\n r11 = (float) r8;\n r3 = java.lang.Math.max(r1, r2);\n r8 = (double) r3;\n r12 = java.lang.Math.sqrt(r5);\n r8 = r8 / r12;\n r12 = (float) r8;\n r3 = r0.f5069f;\n r13 = r3.m6538a();\n r3 = r0.f5069f;\n r14 = r3.m6540b();\n r15 = android.graphics.Shader.TileMode.REPEAT;\n r9 = r16;\n r9.<init>(r10, r11, r12, r13, r14, r15);\n r3 = r16;\n L_0x009c:\n r8 = r0.f5069f;\n r8 = r8.f5052b;\n r9 = r1 / 2;\n r9 = (float) r9;\n r10 = r2 / 2;\n r10 = (float) r10;\n r4.rotate(r8, r9, r10);\n r9 = new android.graphics.Paint;\n r9.<init>();\n r9.setShader(r3);\n r5 = java.lang.Math.sqrt(r5);\n r3 = java.lang.Math.max(r1, r2);\n r10 = (double) r3;\n r5 = r5 * r10;\n r3 = (int) r5;\n r3 = r3 / r7;\n r5 = -r3;\n r6 = (float) r5;\n r1 = r1 + r3;\n r7 = (float) r1;\n r2 = r2 + r3;\n r8 = (float) r2;\n r5 = r6;\n r4.drawRect(r5, r6, r7, r8, r9);\n r1 = r0.f5066b;\n return r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.shimmer.ShimmerFrameLayout.getMaskBitmap():android.graphics.Bitmap\");\n }", "private void setPhotoAttcher() {\n\n }", "private void drawBitmap(Canvas canvas, Bitmap map, float x, float y) {\n\t\tint mapWidth = map.getWidth();\n\t\tint mapHeight = map.getHeight();\n\t\tfloat boardPosX = x - mapWidth / 2;\n\t\tfloat boardPosY = y - mapHeight / 2;\n\t\tcanvas.drawBitmap(map, boardPosX, boardPosY, null);\n\t}", "public void setDefaultBitmap(Bitmap bitmap) {\n mController.setDefaultBitmap(bitmap);\n }", "@Override\r\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\r\n Bitmap b=(Bitmap)data.getExtras().get(\"data\");\r\n i1.setImageBitmap(b);\r\n\r\n }", "private void setPic() {\n int targetW = mImageView.getWidth();\n int targetH = mImageView.getHeight();\n\n\t\t/* Get the size of the image */\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n\t\t/* Figure out which way needs to be reduced less */\n int scaleFactor = 1;\n if ((targetW > 0) || (targetH > 0)) {\n scaleFactor = Math.min(photoW / targetW, photoH / targetH);\n }\n\n\t\t/* Set bitmap options to scale the image decode target */\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n\t\t/* Decode the JPEG file into a Bitmap */\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\n\t\t/* Associate the Bitmap to the ImageView */\n mImageView.setImageBitmap(bitmap);\n mTextView.setText(mCurrentPhotoPath);\n\n // SendImage(mCurrentPhotoPath);\n\n // AsyncCallWS task = new AsyncCallWS();\n // Call execute\n // task.execute();\n }", "private void setImage() {\n BitmapFactory.Options options = new BitmapFactory.Options();\n Bitmap originalBm = BitmapFactory.decodeFile(tempFile.getAbsolutePath(), options);\n // Log.d(TAG, \"setImage : \" + tempFile.getAbsolutePath());\n\n myImage.setImageBitmap(originalBm);\n\n /**\n * tempFile 사용 후 null 처리를 해줘야 합니다.\n * (resultCode != RESULT_OK) 일 때 tempFile 을 삭제하기 때문에\n * 기존에 데이터가 남아 있게 되면 원치 않은 삭제가 이뤄집니다.\n */\n System.out.println(\"setImage : \" + tempFile.getAbsolutePath());\n fileSource = tempFile.getAbsolutePath();\n myImageSource = fileSource;\n check++;\n tempFile = null;\n\n }", "void setImage(BufferedImage i);", "Bitmap getBitmap(){\n Bitmap bm = frame;\n frame = null;\n return bm;\n }", "public static void setBitmap(ImageView view, Bitmap bitmap, float[] radii) {\n DebugUtils.__checkError(view == null || bitmap == null, \"Invalid parameters - view == null || bitmap == null\");\n setBitmap(view, view.getDrawable(), bitmap, radii);\n }", "public Money (Bitmap res,int w, int h){\n\n x = 100;\n y = 100;\n dx = 30;\n spritesheet = res;\n height = h;\n width = w;\n row = 0;\n for (int i = 0; i < numbers; i++){\n imageMoney[i] = Bitmap.createBitmap(res, i*32 ,0,32,64);\n\n }\n\n randomize();\n\n\n //setBitmap(GamePanel.getArray().get(0),GamePanel.getArray().get(1));\n //name = \"King\";\n //spritesheet = BitmapFactory.decodeResource(getResources(), R.drawable.diamond);\n //y = GamePanel.HEIGHT;\n\n //number1 =res1;\n //number2 = res2;\n //startTime = System.nanoTime();\n }", "public static void setPetBitmapImage(int actual, Bitmap petImage) {\n user.getPets().get(actual).setProfileImage(petImage);\n }", "private Bitmap ensureGLCompatibleBitmap(Bitmap bitmap) {\n\t\tif (bitmap == null || bitmap.getConfig() != null) {\n\t\t\treturn bitmap;\n\t\t}\n\t\tBitmap newBitmap = bitmap.copy(Config.ARGB_8888, false);\n\t\tbitmap.recycle();\n\t\tSystem.gc();\n\t\t//Log.i(TAG, \"***bitmap**\" + (bitmap == null) + \" \" + (newBitmap == null));\n\t\treturn newBitmap;\n\t}", "@WorkerThread @UiThread\n public void setBitmapsLowRes(String url, Bitmap bitmap) {\n synchronized (this) {\n this.bitmapsLowRes.put(url, bitmap);\n }\n\n // Tell all registered views that a bitmap changed\n notifyViews(Event.BITMAP_LOWRES_CHANGED);\n }", "public void setImageGenResults(HashMap<String, View> viewMap, HashMap<String, Bitmap> imageMap) {\n if (map != null) {\n// calling addImages is faster as separate addImage calls for each bitmap.\n map.addImages(imageMap);\n }\n// need to store reference to views to be able to use them as hitboxes for click events.\n this.viewMap = viewMap;\n\n }", "@Override\n\t\t\tprotected void onDraw(Canvas canvas) {\n\t\t\t\t\n\t\t\t\tcanvas.drawColor(0xffff9900); // Orange\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// this gets us the view size relative to the bitmap\n\t\t\t\t// getWidth and getHeight() return int so we case denom to float\n\t\t\t\t\n\t\t\t\tfloat scaleX = this.getWidth() / ((float) mBitmap.getWidth());\n\t\t\t\tfloat scaleY = this.getHeight() / ((float) mBitmap.getHeight());\n\t\t\t\t// Log.d(\"MainActivity\",\"Scale:\"+scaleX+\",\"+scaleY);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// we can scale the canvas. \n\t\t\t\t// think about changes the rulers to the external \n\t\t\t\t// \n\t\t\t\t// this would double the bitmap size two times \n\t\t\t\t// \n\t\t\t\t// canvas.scale(2,2)\n\t\t\t\t// canvas.scale(2,2)\n\t\t\t\t\n\t\t\t\t// with canvas its possible to remember the settings using canvas.save(); \n\t\t\t\t\n\t\t\t\t\n\t\t\t\tcanvas.save();\n\t\t\t\tcanvas.scale(scaleX, scaleY);\n\t\t\t\t\n\t\t\t\t// Here we try to add the bitmap to the canvas\n\t\t\t\t// canvas.drawBitmap(b,0,0,null)\n\t\t\t\t// Note: here b is a local variable declared above\n\t\t\t\t// if we try to use local variables that were declared outside of the anonymous inner class\n\t\t\t\t// we have 2 ways to make that work \n\t\t\t\t// 1. we can make the declaration final. e.g. \n\t\t\t\t// \n\t\t\t\t// final Bitmap b = Bitmap.createBitmap(4,4,Bitmap.Config.ARGB_8888); \n\t\t\t\t// \n\t\t\t\t// for pointers that means that means that b is fated to always point to the \n\t\t\t\t// same java object. \n\t // \n\t\t\t\t// The other thing we can do is make the bitmap an instance variable\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//\n\t\t\t\t// For Android 4.x we also need to pass a paint\n\t\t\t\t// to turn off filtering -\n\t\t\t\tmPaint.setFilterBitmap(false); // Experiment with false vs true\n\t\t\t\tcanvas.drawBitmap(mBitmap, 0, 0, mPaint);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// canvas.restore() works in concert with canvas.save() \n\t\t\t\t// restores the prior settings\n\t\t\t\tcanvas.restore();\n\n\t\t\t\t// this draws a circle around our penguin\n\t\t\t\t// the circle has to be drawn before we draw the penguin otherwise\n\t\t\t\t// the penguin will be hidden behind the circle\n\t\t\t\t\n\t\t\t\tmPaint.setColor(0x80ffffff); \t\t\t\t\t// White\n\t\t\t\tmPaint.setStyle(Style.FILL_AND_STROKE);\n\n\t\t\t\t\n\t\t\t\t// here we're drawing the penguin\n\t\t\t\t// initially the penguin wasn't visible because the scale was too large\n\t\t\t\t// one fix is to reverse the scale\n\t\t\t\t// \n\t\t\t\t// $ canvas.scale(1/scaleX, 1/scaleY); \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// canvas allows us to rotate. We do this in degrees. \n\t\t\t\t// by default the canvas rotates around 0,0\n\t\t\t\t\n\t\t\t\t// we use this calculation to determine how much to rotate the penguin\n\t\t\t\t// SystemClock.uptimeMillis() does not include time asleep\n\t\t\t\t// good clock to use if you want to count how long a user has seen something\n\t\t\t\t// \n\t\t\t\t// we take the SystemClock divided / 10.0f \n\t\t\t\t\n\t\t\t\t// Note: instead of moving the penguin, we first translate the canvas and then \n\t\t\t\t// rotate the penguin relative to the canvas\n\t\t\t\t\n\t\t\t\tfloat angle = SystemClock.uptimeMillis() / 10.0f;\n\t\t\t\tcanvas.translate(x,y); \n\t\t\t\n\t\t\t\n\n\t\t\t\t// move the circle to be drawn after we translate the canvas\n\t\t\t\tcanvas.drawBitmap(mPenguin, 0, 0, null);\n\t\t\t\t\n\t\t\t\t// here we add movement\n\t\t\t\t// we're adding gravity. \n\t\t\t\t// we check to see if the penguin is too low, and if he is \n\t\t\t\t// then we change the sign of 'gravity'\n\t\t\t\t\n\t\t\t\t// want to bounce on bottom of screen\n\t\t\t\t// canvas.getHeight doesn't work \n\t\t\t\t// Log.d(\"TAG\", \"Canvas: \" + canvas.getHeight()) + \" View: \" + this.getHeight())\n\t\t\t\t// the canvas is not as large as the view because things like status bars take up \n\t\t\t\t// part of the view\n\t\t\t\t// \n\t\t\t\t// the penguin is drawn from the topleft corner. To get the bottom corner we have to \n\t\t\t\t// add 2*mPHheight\n\t\t\t\t\n\t\t\t\tif(y + 2*mPHheight + vy+1 >= this.getHeight()){ \n\t\t\t\t\tvy = -0.8f * vy; //make sure I stay with float 0 \n\t\t\t\t} else { \n\t\t\t\t\t// only accelerate if not bouncing\n\t\t\t\t\tvy = vy + 2; \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tx = x + vx; \n\t\t\t\ty = y + vy; \n\t\t\t\t\n\t\t\t\t// we use postInvalidate to animate the penguin\n\t\t\t\t// postInvalidate means 'please redraw me' \n\t\t\t\t// you can call this method from anywhere\n\t\t\t\t// for example if you have a thread where you get a new sensor measurement, \n\t\t\t\t// you can call post invalidate on your view\n\t\t\t\n\t\t\t\t\n\t\t\t\t// In 20ms (1/50th second) this view will need to be redrawn\n\t\t\t\tpostInvalidateDelayed(20);\n\t\t\t}", "public void setImage(Image newImage)\n {\n if (newImage == null)\n {\n setFill(null);\n }\n else\n {\n setFill(new ImageFill(newImage));\n }\n }", "private void setPicToView(Intent picdata) {\n Bundle extras = picdata.getExtras();\n if (extras != null) {\n Bitmap photo = extras.getParcelable(\"data\");\n Drawable drawable = new BitmapDrawable(getResources(), photo);\n groupSetAvatar.setImageDrawable(drawable);\n // uploadUserAvatar(Bitmap2Bytes(photo));\n saveBitmapFile(picdata);\n\n }\n\n }", "private void createBitMap() {\n bitMap = bitMap.copy(bitMap.getConfig(), true);\n Canvas canvas = new Canvas(bitMap);\n Paint paint = new Paint();\n paint.setAntiAlias(true);\n paint.setColor(Color.BLACK);\n paint.setStyle(Paint.Style.STROKE);\n paint.setStrokeWidth(4.5f);\n canvas.drawCircle(50, 50, 30, paint);\n winningBitMap = winningBitMap.copy(winningBitMap.getConfig(), true);\n Canvas canvas2 = new Canvas(winningBitMap);\n paint.setAntiAlias(true);\n paint.setColor(Color.GREEN);\n paint.setStyle(Paint.Style.FILL);\n paint.setStrokeWidth(4.5f);\n canvas2.drawCircle(50, 50, 30, paint);\n bitMapWin = winningBitMap.copy(winningBitMap.getConfig(), true);\n Canvas canvas3 = new Canvas(bitMapWin);\n paint.setAntiAlias(true);\n paint.setColor(Color.MAGENTA);\n paint.setStyle(Paint.Style.FILL);\n paint.setStrokeWidth(4.5f);\n canvas3.drawCircle(50, 50, 30, paint);\n bitMapCat = winningBitMap.copy(winningBitMap.getConfig(), true);\n Canvas canvas4 = new Canvas(bitMapCat);\n paint.setAntiAlias(true);\n paint.setColor(Color.DKGRAY);\n paint.setStyle(Paint.Style.FILL);\n paint.setStrokeWidth(4.5f);\n canvas4.drawCircle(50, 50, 30, paint);\n }", "@Override\n\tprotected void onDraw(Canvas canvas) {\n\t\tsuper.onDraw(canvas);\n\n\t\tcanvas.drawBitmap(bitmap_new, 0, 0, paint);\n\t}", "private void loadBitmap() {\n\n BitmapDrawable bitmapDrawable = (BitmapDrawable) this.getDrawable();\n\n if (bitmapDrawable != null)\n image = bitmapDrawable.getBitmap();\n }", "public void mo8780a(boolean z) {\n try {\n this.f1291g = z;\n if (z) {\n this.f1290f.setColor(-1);\n } else {\n this.f1290f.setColor(ViewCompat.MEASURED_STATE_MASK);\n }\n invalidate();\n } catch (Throwable th) {\n SDKLogHandler.m2563a(th, \"WaterMarkerView\", \"changeBitmap\");\n th.printStackTrace();\n }\n }", "@Override\n public void run() {\n imgFinger.setImageBitmap(bitmap);\n }", "@Override\n protected void onPostExecute(Bitmap Re) {\n t34.setImageBitmap(Re);\n }", "public void setPreview(Bitmap bitmap) {\n m_thumbnail.setImageBitmap(bitmap);\n crossFadeThumbnail();\n }", "public static void setBitmapRange(LongBuffer bitmap, int start, int end) {\n if (isBackedBySimpleArray(bitmap)) {\n Util.setBitmapRange(bitmap.array(), start, end);\n return;\n }\n if (start == end) {\n return;\n }\n int firstword = start / 64;\n int endword = (end - 1) / 64;\n if (firstword == endword) {\n bitmap.put(firstword, bitmap.get(firstword) | ((~0L << start) & (~0L >>> -end)));\n\n return;\n }\n bitmap.put(firstword, bitmap.get(firstword) | (~0L << start));\n for (int i = firstword + 1; i < endword; i++) {\n bitmap.put(i, ~0L);\n }\n bitmap.put(endword, bitmap.get(endword) | (~0L >>> -end));\n }", "public void changePhoto() {\r\n\t\tisPictFetche = false;\r\n\t\tlaPhoto = new Photo();\r\n\t\tlaPhotoCandidate = new Photo();\r\n\t}", "public void setPixels(short[] r, short[] g, short[] b) {\n for (int i = 0; i < pixels.length; ++i)\n pixels[i] = 0xFF000000 /* opaque */| ((r[i] & 0xFF) << 16)\n | ((g[i] & 0xFF) << 8) | (b[i] & 0xFF);\n if (source != null)\n source.newPixels(pixels, cModel, 0, width);\n }", "public synchronized void method_219() {\n if(this.field_730 != null) {\n this.field_730.setPixels(0, 0, this.field_723, this.field_724, this.field_728, this.pixels, 0, this.field_723);\n this.field_730.imageComplete(2);\n }\n }", "private void change_im_tool4(int boo){\r\n if(boo == 0){ //IMAGEN SI EL USUARIO ESTA INHABILITADO\r\n im_tool4.setImage(new Image(getClass().getResourceAsStream(\"/Images/img07.png\")));\r\n }else{ //IMAGEN PARA HABILITAR AL USUARIO\r\n im_tool4.setImage(new Image(getClass().getResourceAsStream(\"/Images/img06.png\")));\r\n }\r\n }", "public void changeImage() {\r\n this.image = ColourDoor.image2;\r\n }", "public void setTexture(Bitmap texture) {\n photo = texture;\n int alt = texture.getWidth();\n int ample = texture.getHeight();\n int max = Math.max(alt, ample);\n float ratio = (float) ample / (float) alt;\n if (max > limit) {\n if (max == ample) {\n photoWidth = limit;\n photoHeight = (int) (limit * ratio);\n } else if (max == alt) {\n photoWidth = (int) (limit / ratio);\n photoHeight = limit;\n }\n }\n }", "public void setImg(String mapSelect){\n\t\ttry {\n\t\t if (mapSelect.equals(\"map01.txt\")){\n\t\t\timg = ImageIO.read(new File(\"space.jpg\"));\n\t\t\timg2 = ImageIO.read(new File(\"metal.png\"));\n\n\t\t }\t\n\t\t if (mapSelect.equals(\"map02.txt\")){\n\t\t\t\timg = ImageIO.read(new File(\"forest.jpg\"));\n\t\t\t\timg2 = ImageIO.read(new File(\"leaf.png\"));\n\t\t\t\timg3 = ImageIO.read(new File(\"log.png\"));\n\t\t }\n\t\t if (mapSelect.equals(\"map03.txt\")){\n\t\t\t\timg = ImageIO.read(new File(\"spinx.jpg\"));\n\t\t\t\timg2 = ImageIO.read(new File(\"pyramid.png\"));\n\t\t\t\timg3 = ImageIO.read(new File(\"sandy.png\"));\n\t\t\t\t\n\t\t }\n\t\t if (mapSelect.equals(\"map04.txt\")){\n\t\t\t\timg = ImageIO.read(new File(\"doublebg.png\"));\n\t\t\t\timg2 = ImageIO.read(new File(\"cloud.png\"));\n\t\t\t\t\n\t\t }\n\t\t\t\n\t\t}\n\t\t catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\t\n\t\t}\n\t}", "public Bitmap getBitmap(){\n return bitmap;\n }", "public void put(@NonNull final String key, final Bitmap value) {\n put(key, value, -1);\n }", "private void setUpImage() {\n Bitmap icon = BitmapFactory.decodeResource( this.getResources(), R.drawable.hotel_icon );\n map.addImage( MARKER_IMAGE_ID, icon );\n }", "@Override\n protected void processLogic() {\n mBitmap = Bitmap.createBitmap(SystemUtils.getScreenWidth(), SystemUtils.getScreenHeight(), Config.ARGB_8888);\n mCanvas = new Canvas(mBitmap);\n mCanvas.drawColor(Color.WHITE);\n ivGraffit.setImageBitmap(mBitmap);\n mPaint = new Paint();\n mPaint.setColor(Color.GREEN);\n // 设置线宽\n mPaint.setStrokeWidth(15);\n mPaint.setAntiAlias(true);\n\n }", "@Override\r\n public void run() {\n imageView1.setImageBitmap(bitmap);\r\n }", "public void m2261I() {\n try {\n if (this.f2513n != null) {\n this.f2513n.setImageDrawable(C5150d.m3784a(mo61159b().getResources(), \"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA39pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozODRkZTAxYi00OWRkLWM4NDYtYThkNC0wZWRiMDMwYTZlODAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QkE0Q0U2MUY2QzA0MTFFNUE3MkJGQjQ1MTkzOEYxQUUiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QkE0Q0U2MUU2QzA0MTFFNUE3MkJGQjQ1MTkzOEYxQUUiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjlkZjAyMGU0LTNlYmUtZTY0ZC04YjRiLWM5ZWY4MTU4ZjFhYyIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOmU1MzEzNDdlLTZjMDEtMTFlNS1hZGZlLThmMTBjZWYxMGRiZSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PngNsEEAAANeSURBVHjatFfNS1tBEH+pUZOQ0B4i3sTSxHMRFNQoFBEP7dHgvyDiKWgguQra9F+oxqNiwOTQ+oFI1ZM3jSf1YK5FL41ooaKZzu+x+4gv2bx9Rgd+JNn5zO7s7IzH0CQiCvLHZ8YnxkfGe8ZbwS4zSowTxi/GT4/Hc2u8BLHjCOM745b06VboRJpx7GN8ZfyDxUqlQgcHB5RMJmloaIg6Ozupra3NBL5jDTzIQFYQdDOw5db5B8YxLDw+PtLKygr19PQQWDqIRqOUzWZNXUHH2rvBgr2M39C6uLig/v5+bcd2QLdUKskgYLNX57yvIL2zs0OhUOjZziU6Ojro8PBQBnGl3Alm+BknkMI54mybdS4BW3t7ezKIInzVCwDJYm4Zon4p5xLYzfPzcxlEpl7S3SNpmjlznZwQiXn/5CjEnTUzt5GBsbExamlpUfLBg0wjG8vLy3IXlqTzEAoH7m4kElEqTk1Nmfd7bW2tbhBYAw8ykFXZgQ9RJ1CsQghgEr/29/eVStPT09XFhdbX18nr9Vr81tZWyuVyFh+yMzMzSnvwJWjyDS+MYic2NzeV17O7u9vg2m79jsfjBv9bg7PbxOrqqjExMWHxIdvV1aW0V+VrFDtwhFCGh4cbnl0mk6kp+BsbGybsBNlGtkZGRqToEQK4xjfUc6csXlhYcHyFFhcXHe3Al6BrQz427e3tWldpfn5e6Rw83cIkHyvXAUAZb4SdsKZbPe0BaB+Bz+cjTiDlDmxtbZkybo9AKwn9fj9tb2875gBkINvIFnzJJMQ1PMV9GBgYUF6bQCBgFAoFY3x8/Ml6KpUy0un0kzXIQBY6KqrydapViPL5fM0/Rfcj+fhuJw5CqxBpleJYLEY3NzeW8dnZ2RoZrEmCLHQcSvGdWYrFe7CEFTwUqqjR85XLZUokEkoZ8CADWe3HqKoTcnyOdW5KI5m+vj56eHiQz3G0bkNyeXn5ag3J2dmZ/PffVC1Z8bVast3d3eqWLKDVlAaDwaadh8Nhvaa0XluOHg7n9lzn0MWRarfltp0oysEErRqGDTeDCbK9ajApuh7TxGiWERlrjWZzc3M0ODhYM5phDTzbaHb/rNHMFkhUNK13LobTv6K2RJ3se1yO519s4/k7wf5jG89/6I7n/wUYAGo3YtcprD4sAAAAAElFTkSuQmCC\"));\n this.f2513n.setScaleType(ScaleType.FIT_CENTER);\n }\n } catch (Exception e) {\n C5017f.m3256a(mo61159b(), C5015d.EXCEPTION, \"MraidMode.showDefaultCloseButton\", e.getMessage(), \"\");\n }\n }", "public void set(RenderedImage im) {\n this.im = im;\n ic.set(im);\n }", "private void change_im_val(int boo, ImageView im_obj){\r\n if(boo == 200){ //IMAGEN SI EL VEHICULO ES CORRECTO\r\n im_obj.setImage(new Image(getClass().getResourceAsStream(\"/Images/img57a.png\")));\r\n }else{ //IMAGEN PARA LA BUSQUEDA DE UN VEHICULO\r\n im_obj.setImage(new Image(getClass().getResourceAsStream(\"/Images/img61a.png\")));\r\n }\r\n }", "private android.graphics.Bitmap m14713a(com.clevertap.android.sdk.C3072b1 r18, com.clevertap.android.sdk.C3072b1 r19) {\n /*\n r17 = this;\n r0 = r17\n r1 = r18\n r2 = r19\n int[] r10 = r0.f10958m\n r11 = 0\n if (r2 != 0) goto L_0x000e\n java.util.Arrays.fill(r10, r11)\n L_0x000e:\n r12 = 3\n r13 = 2\n r14 = 1\n if (r2 == 0) goto L_0x005e\n int r3 = r2.f10976g\n if (r3 <= 0) goto L_0x005e\n if (r3 != r13) goto L_0x0037\n boolean r3 = r1.f10975f\n if (r3 != 0) goto L_0x002c\n com.clevertap.android.sdk.c1 r3 = r0.f10961p\n int r4 = r3.f11004l\n int[] r5 = r1.f10980k\n if (r5 == 0) goto L_0x0033\n int r3 = r3.f11002j\n int r5 = r1.f10977h\n if (r3 != r5) goto L_0x0033\n goto L_0x0032\n L_0x002c:\n int r3 = r0.f10959n\n if (r3 != 0) goto L_0x0032\n r0.f10969x = r14\n L_0x0032:\n r4 = 0\n L_0x0033:\n r0.m14716a(r10, r2, r4)\n goto L_0x005e\n L_0x0037:\n if (r3 != r12) goto L_0x005e\n android.graphics.Bitmap r3 = r0.f10963r\n if (r3 != 0) goto L_0x0041\n r0.m14716a(r10, r2, r11)\n goto L_0x005e\n L_0x0041:\n int r4 = r2.f10973d\n int r5 = r0.f10966u\n int r9 = r4 / r5\n int r4 = r2.f10971b\n int r7 = r4 / r5\n int r4 = r2.f10972c\n int r8 = r4 / r5\n int r2 = r2.f10970a\n int r6 = r2 / r5\n int r5 = r0.f10968w\n int r2 = r7 * r5\n int r4 = r2 + r6\n r2 = r3\n r3 = r10\n r2.getPixels(r3, r4, r5, r6, r7, r8, r9)\n L_0x005e:\n r17.m14715a(r18)\n int r2 = r1.f10973d\n int r3 = r0.f10966u\n int r2 = r2 / r3\n int r4 = r1.f10971b\n int r4 = r4 / r3\n int r5 = r1.f10972c\n int r5 = r5 / r3\n int r6 = r1.f10970a\n int r6 = r6 / r3\n r3 = 8\n int r7 = r0.f10959n\n if (r7 != 0) goto L_0x0077\n r7 = 1\n goto L_0x0078\n L_0x0077:\n r7 = 0\n L_0x0078:\n r3 = 0\n r8 = 1\n r9 = 8\n L_0x007c:\n if (r11 >= r2) goto L_0x0100\n boolean r15 = r1.f10974e\n if (r15 == 0) goto L_0x0098\n r15 = 4\n if (r3 < r2) goto L_0x0095\n int r8 = r8 + 1\n if (r8 == r13) goto L_0x0094\n if (r8 == r12) goto L_0x0091\n if (r8 == r15) goto L_0x008e\n goto L_0x0095\n L_0x008e:\n r3 = 1\n r9 = 2\n goto L_0x0095\n L_0x0091:\n r3 = 2\n r9 = 4\n goto L_0x0095\n L_0x0094:\n r3 = 4\n L_0x0095:\n int r15 = r3 + r9\n goto L_0x009a\n L_0x0098:\n r15 = r3\n r3 = r11\n L_0x009a:\n int r3 = r3 + r4\n int r12 = r0.f10967v\n if (r3 >= r12) goto L_0x00f0\n int r12 = r0.f10968w\n int r3 = r3 * r12\n int r16 = r3 + r6\n int r13 = r16 + r5\n int r14 = r3 + r12\n if (r14 >= r13) goto L_0x00ad\n int r13 = r3 + r12\n L_0x00ad:\n int r3 = r0.f10966u\n int r12 = r11 * r3\n int r14 = r1.f10972c\n int r12 = r12 * r14\n int r14 = r13 - r16\n int r14 = r14 * r3\n int r14 = r14 + r12\n r3 = r16\n L_0x00bc:\n if (r3 >= r13) goto L_0x00f0\n r19 = r2\n int r2 = r0.f10966u\n r16 = r4\n r4 = 1\n if (r2 != r4) goto L_0x00d2\n byte[] r2 = r0.f10957l\n byte r2 = r2[r12]\n r2 = r2 & 255(0xff, float:3.57E-43)\n int[] r4 = r0.f10946a\n r2 = r4[r2]\n goto L_0x00d8\n L_0x00d2:\n int r2 = r1.f10972c\n int r2 = r0.m14712a(r12, r14, r2)\n L_0x00d8:\n if (r2 == 0) goto L_0x00dd\n r10[r3] = r2\n goto L_0x00e6\n L_0x00dd:\n boolean r2 = r0.f10969x\n if (r2 != 0) goto L_0x00e6\n if (r7 == 0) goto L_0x00e6\n r2 = 1\n r0.f10969x = r2\n L_0x00e6:\n int r2 = r0.f10966u\n int r12 = r12 + r2\n int r3 = r3 + 1\n r2 = r19\n r4 = r16\n goto L_0x00bc\n L_0x00f0:\n r19 = r2\n r16 = r4\n int r11 = r11 + 1\n r2 = r19\n r3 = r15\n r4 = r16\n r12 = 3\n r13 = 2\n r14 = 1\n goto L_0x007c\n L_0x0100:\n boolean r2 = r0.f10964s\n if (r2 == 0) goto L_0x0123\n int r1 = r1.f10976g\n if (r1 == 0) goto L_0x010b\n r2 = 1\n if (r1 != r2) goto L_0x0123\n L_0x010b:\n android.graphics.Bitmap r1 = r0.f10963r\n if (r1 != 0) goto L_0x0115\n android.graphics.Bitmap r1 = r17.m14718q()\n r0.f10963r = r1\n L_0x0115:\n android.graphics.Bitmap r1 = r0.f10963r\n r3 = 0\n int r7 = r0.f10968w\n r5 = 0\n r6 = 0\n int r8 = r0.f10967v\n r2 = r10\n r4 = r7\n r1.setPixels(r2, r3, r4, r5, r6, r7, r8)\n L_0x0123:\n android.graphics.Bitmap r9 = r17.m14718q()\n r3 = 0\n int r7 = r0.f10968w\n r5 = 0\n r6 = 0\n int r8 = r0.f10967v\n r1 = r9\n r2 = r10\n r4 = r7\n r1.setPixels(r2, r3, r4, r5, r6, r7, r8)\n return r9\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.clevertap.android.sdk.C3068a1.m14713a(com.clevertap.android.sdk.b1, com.clevertap.android.sdk.b1):android.graphics.Bitmap\");\n }", "public void InitParam(Bitmap[] bm, int vitesse, int intru, int laserColor) {\n screenSizeX = getResources().getDisplayMetrics().widthPixels;\n screenSizeY = getResources().getDisplayMetrics().heightPixels;\n\n //On recupere toutes nos images\n this.bm = bm;\n\n //On recupere la couleur du laser\n this.laserColor = laserColor;\n\n //Et celui qui est l'intru\n this.intru = intru;\n\n //On creer nos tableau avec comme longueur notre nombre d'images\n pathMeasure = new PathMeasure[this.bm.length];\n pathLength = new float[this.bm.length];\n pos = new float[this.bm.length][2]; // ici 2 positions, x et y\n animPath = new Path[this.bm.length];\n distance = new float[this.bm.length];\n resultBitmap = new Bitmap[this.bm.length];\n\n //On boucle pour instancier chaque objets de nos tableaux\n for(int j=0;j<this.bm.length;j++){\n\n animPath[j]= getRandomPath();\n pathMeasure[j] = new PathMeasure(animPath[j],false);\n pathLength[j] = pathMeasure[j].getLength();\n\n resultBitmap[j] = Bitmap.createBitmap(bm[j], 0, 0,\n bm[j].getWidth() - 1, bm[j].getHeight() - 1);\n }\n\n //On definit le pas\n step = vitesse;\n\n // On creer la matrice\n matrix = new Matrix();\n\n //Parametre dans le cas ou l'ecran est touché / pour les laser\n fired=false;\n touchedPosition = new float[2];\n distGaucheRest = new float[2];\n distGaucheRest[0]=0;\n distGaucheRest[1]=screenSizeY;\n fireGauchePas = new float[2];\n fireGauchePas[0]=0;\n fireGauchePas[1]=0;\n\n distDroitRest = new float[2];\n distDroitRest[0]=screenSizeX;\n distDroitRest[1]=screenSizeY;\n fireDroitPas = new float[2];\n fireDroitPas[0]=0;\n fireDroitPas[1]=0;\n\n //Au cas ou le vaiseau explose\n xplosed=false;\n countBeforeXplose=0;\n\n }" ]
[ "0.77171695", "0.7408676", "0.7143649", "0.7128524", "0.70470613", "0.6838244", "0.67303723", "0.668977", "0.66225064", "0.65202844", "0.649522", "0.63892263", "0.6364041", "0.63386315", "0.6286176", "0.6278663", "0.6268197", "0.6267158", "0.62643653", "0.6234867", "0.6223742", "0.619805", "0.61948335", "0.6193582", "0.6177966", "0.6169951", "0.6148415", "0.6148165", "0.61008406", "0.60971504", "0.6065214", "0.6065132", "0.60631424", "0.60631424", "0.6061213", "0.605123", "0.6045955", "0.60442764", "0.60421515", "0.6034041", "0.60283166", "0.6007333", "0.60034627", "0.600175", "0.59616107", "0.59592736", "0.59422326", "0.5921008", "0.5892526", "0.58915925", "0.58856636", "0.58836967", "0.58795345", "0.583994", "0.58280945", "0.58250165", "0.58132917", "0.5799516", "0.57963896", "0.57938224", "0.57905346", "0.5770526", "0.57641274", "0.5759032", "0.5732038", "0.5729356", "0.57265013", "0.56776804", "0.56423503", "0.5624629", "0.5612478", "0.5609995", "0.5608557", "0.56068975", "0.5604233", "0.56035453", "0.5594628", "0.55932796", "0.55920243", "0.5591843", "0.5582648", "0.5580267", "0.55787426", "0.55719715", "0.5571494", "0.5569586", "0.5539885", "0.5534382", "0.5529813", "0.5527432", "0.5526835", "0.55253464", "0.5514279", "0.5513763", "0.55137473", "0.55009234", "0.54966927", "0.54868734", "0.54819757", "0.54770947" ]
0.7150767
2
called whenever the image is dragged
public void requestDragFocus(Piece p, float grabX, float grabY) { if (p != null) { _dragFocus = p; // the piece that is dragged _grabPointX = grabX; // the x point which it was grabbed at _grabPointY = grabY; // the y point which it was grabbed at // the boundaries to make sure it stays in the square leftX = _dragFocus.getXClip(); leftY = _dragFocus.getYClip(); rightX = _dragFocus.getXClip()+_dragFocus.getW() - (_dragFocus.getBitmap().getWidth()); rightY = _dragFocus.getYClip()+_dragFocus.getH() - (_dragFocus.getBitmap().getHeight()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onDragged();", "@Override\n\t\t\tpublic void mouseDragged(MouseEvent e) {\n\t\t\t}", "@Override\n\t\tpublic void mouseDragged(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mouseDragged(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void mouseDragged(MouseEvent e) {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void mouseDragged(MouseEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void mouseDragged(MouseEvent e) {\n\t\t\r\n\t}", "protected abstract boolean dragged();", "@Override\n public void mouseDragged(MouseEvent e) {\n\n }", "@Override\n \tpublic void mouseDragged(MouseEvent e) {\n \t}", "public void mouseDragged(MouseEvent e){}", "public void mouseDragged (MouseEvent e) {}", "@Override\r\n public void mouseDragged(MouseEvent e) {\n }", "public void onDragEnded();", "@Override\r\n\tpublic void mouseDragged(MouseEvent e) {\n\r\n\t}", "@Override\r\n\tpublic void mouseDragged(MouseEvent e) {\n\r\n\t}", "@Override\n\t\tpublic void mouseDragged(MouseEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\t\t\n\t}", "public void mouseDragged(MouseEvent e) {}", "@Override\n public void mouseDragged(MouseEvent arg0) {\n \n }", "@Override\r\n\t\t\tpublic void mouseDragged(MouseEvent arg0) {\n\t\t\t}", "@Override\r\n\t\t\tpublic void mouseDragged(MouseEvent arg0) {\n\r\n\t\t\t}", "public void mouseDragged(MouseEvent e) {\n\t\t\r\n\t}", "public void mouseDragged(MouseEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void mouseDragged(MouseEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void mouseDragged(MouseEvent arg0) {\n\t\t\r\n\t}", "public boolean onDragStarted();", "@Override\n\t\tpublic void mouseDragged(MouseEvent e) {\n\n\t\t}", "@Override\n public void onDragStarted(int position) {\n }", "@Override\r\n\tpublic void mouseDragged(MouseEvent arg0) {\n\r\n\t}", "public void mouseDragged(MouseEvent e) {\n\n }", "@Override\n\tpublic void mouseDragged(MouseEvent arg0) {\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent arg0) {\n\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent arg0) {\n\n\t}", "public void mouseDragged(MouseEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent arg0)\n\t{\n\t\t\n\t}", "public void mouseDragged(MouseEvent e) {\n\t}", "public void mouseDragged(MouseEvent e) {\n }", "@Override\n \tpublic void roiDragged(ROIEvent evt) {\n \t\t\n \t}", "@Override\n public void drag(int x, int y)\n {\n }", "private void dragPaint() {\n\n\t\t//buffer die image ooit\n\t\tinvalidate();\n\t\trepaint();\n\t}", "public void mouseDragged(MouseEvent e) {\n\t \t\t\n\t \t}", "@Override\n public void mouseDragged(java.awt.event.MouseEvent e) {\n }", "public void mouseDragged( MouseEvent event ){}", "public void mouseDragged(MouseEvent e)\n {}", "public synchronized void mouseDragged(MouseEvent event) {\n /*FIXME*/\n /* Not needed if picture does not change. */\n\n _display.repaint();\n }", "public void mouseDragged(MouseEvent event) { }", "@DISPID(-2147412077)\n @PropGet\n java.lang.Object ondragstart();", "public void mouseDragged( MouseEvent e ) {\n }", "@Override\n\tpublic void dragDropped() {\n\n\t}", "void dragDetected(DragDetectEvent e);", "public void dragGestureRecognized(DragGestureEvent dgev) {\n\t\t\n\t\ttry {\n\t\t\tdgev.startDrag(DragSource.DefaultCopyDrop,img.getImage(),new Point(img.getIconWidth()/2, img.getIconHeight()/2),(Transferable) trnsf.newInstance(),new DragSourceAdapter(){});\n\t\t} catch (InvalidDnDOperationException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (InstantiationException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalAccessException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (InvocationTargetException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t//System.out.print(\"recongnized\");\n\t}", "public void mouseDragged(MouseEvent me) {\n\n\t\t\t}", "@Override\r\n\tpublic void mouseDragged(MouseEvent me) {\r\n\t\tdrag(me.getX(), me.getY());\r\n\t}", "@Override\r\n\tpublic void mouseDragged(MouseEvent e) {\r\n\t\tLOG.fine(\"Dragged [\" + e.getX() + \", \" + e.getY() + \"]...\");\r\n\t\t\r\n\t\tif (shapeManipulator != null) {\r\n\t\t\tshapeManipulator.mouseDragged(e);\r\n\t\t}\r\n\t}", "public void mouseDragged(MouseEvent event) {\n painterJPanelMouseDragged(event);\n }", "@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\t\tco.mouseDragged(e);\n\t}", "public void handle(DragEvent event) {\n Integer cIndex = GridPane.getColumnIndex(n);\n Integer rIndex = GridPane.getRowIndex(n);\n int x = cIndex == null ? 0 : cIndex;\n int y = rIndex == null ? 0 : rIndex;\n\n int nodeX = GridPane.getColumnIndex(currentlyDraggedImage);\n int nodeY = GridPane.getRowIndex(currentlyDraggedImage);\n\n if (currentlyDraggedType == draggableType) {\n // The drag-and-drop gesture entered the target\n // show the user that it is an actual gesture target\n if (!draggableType.equals(DRAGGABLE_TYPE.ITEM)) {\n if (canBuildingPlace(nodeX, nodeY, x, y))\n n.setOpacity(0.7);\n } else if (event.getGestureSource() != n && event.getDragboard().hasImage()) {\n n.setOpacity(0.7);\n }\n }\n event.consume();\n }", "@DISPID(-2147412077)\n @PropPut\n void ondragstart(\n java.lang.Object rhs);", "@Override\n\tpublic void mouseDragged(int arg0, int arg1, int arg2, int arg3) {\n\n\t}", "void resetDragImage();", "@Override\n\tpublic void touchDragged(int screenX, int screenY, int pointer) {\n\t\t\n\t}", "public void mouseDragged(MouseEvent event)\n\t\t{}", "void mouseDragged(double x, double y, MouseEvent e );", "@Override\n\t\tpublic void mouseDragged(MouseEvent e) {\n\t\t\tif(telaAtiva!=null){\n\t\t\t\ttelaAtiva.mouseDragged(e);\n\t\t\t}\n\t\t}", "@Override\n public void mouseDragged(MouseEvent evt) {\n setLocation(evt.getXOnScreen() - posX, evt.getYOnScreen() - posY);\n }", "public abstract void mouseDragged(MouseDraggedEvent mp);", "@Override\r\n public void mouseDragged(MouseEvent e) {\r\n int deltaX = e.getXOnScreen() - screenX;\r\n int deltaY = e.getYOnScreen() - screenY; \r\n \r\n setLocation(myX + deltaX, myY + deltaY);\r\n }", "@Override\n\tpublic void nativeMouseDragged(NativeMouseEvent e) {\n\t\t\n\t}", "public void mouseDragged (MouseEvent e) { if(task!=null) task.mouseDragged(e); }", "@Override\r\n public void move(ImageView image, Double xInitial) {\n\r\n }", "public void mouseDragged(MouseEvent e) {\n if (mouseDraggedCmd != null) {\n mouseDraggedCmd.execute();\n }\n }", "@Override\n\t\tpublic void mouseDragged(MouseEvent e) {\n\t\t\tmouseMoved(e);\n\t\t\tint moveX= (int) e.getPoint().getX();//abscisse actuelle de ma souris \n\t\t\tint moveY= (int) e.getPoint().getY();//ordonnee actuelle de ma souris \n\t\t\tif (avantX>moveX){//l'abscisse est plus grand qu'avant ca veut dire qu'on est allr vers la droite avec la souris.\n\t\t\t\tmX++;\n\t\t\t}\n\t\t\telse if (avantX<moveX){//l'abscisse est plus petit qu'avant ca veut dire qu'on est alle vers la gauche avec la souris.\n\t\t\t\tmX--;\n\t\t\t}\n\t\t\tif (avantY>moveY){//l'ordonnee est plus petit qu'avant ca veut dire qu'on est alle vers le haut avec la souris.\n\t\t\t\tmY++;\n\t\t\t}\n\t\t\telse if (avantY<moveY ){//l'ordonnee est plus grand qu'avant ca veut dire qu'on est alle vers le bas avec la souris.\n\t\t\t\tmY--;\n\t\t\t}\n\t\t\t//j'enregistre les positions actuelles.\n\t\t\tavantX=moveX;\n\t\t\tavantY=moveY;\n\t\t\tdeplacementMinimap();\n\t\t}", "@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\n\t\tmouseClicked(e);\n\t\t\n\t}", "public void mouseDragged(MouseEvent me) {\n updateDrag(me.getPoint());\n }", "@Override\r\n\tpublic void mouseDragged(MouseEvent e) {\n\t\tl1.setText(\"You dragged the mouse\");\r\n\t}", "@Override\r\n\tpublic void drag(EditorInterface i, MouseEvent e) {\r\n\t\t\r\n\t\tthis.x = e.getX();\r\n\t\tthis.y = e.getY();\r\n\t}", "@Override\n\tpublic void onDragEnd(boolean success) {\n\t\t\n\t}", "static void setNotDraging(){isDraging=false;}", "private void initPieceDragged(ImageView imageView) {\n imageView.setOnMouseDragged(event -> {\n imageView.setX(event.getX() - marginX);\n imageView.setY(event.getY() - marginY);\n });\n }", "public void mouseDragged(MouseEvent e) {\n if(jtf[mmlp1][mmlp2].getBackground()==Color.yellow || isRightClick)\n setNotDraging();// agar khane zard rang bashad wa ya rast klik shawad-\n else //-nemitan bar ruye an draging kard.\n setDraging();\n }", "boolean onMouseDragged(double mouseX, double mouseY, double prevMouseX, double prevMouseY);", "@FXML\n private void mouseDown(MouseEvent event) {\n preDragX = event.getX();\n preDragY = event.getY();\n }", "Draggable(String fn, int x, int y) {\n\t\tfileName = fn;\n\t\timg = EZ.addImage(fn, x, y);\n\t\tisDragging = false;\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\t\tdx=dx+(e.getX()-x);\n\t\tdy=dy+(e.getY()-y);\n\t\t\n\t\tx=e.getX();\n\t\ty=e.getY();\n\t}", "@Override\r\n\t\t\t\t\tpublic void dragOperationChanged(DropTargetEvent event) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}", "public synchronized void mouseDragged(MouseEvent event) {\n if (_pressedCard != null) {\n _display.drag(event.getX(), event.getY(), _pressedCard);\n }\n _display.repaint();\n }", "void onStartDrag(RecyclerView.ViewHolder viewHolder);", "void onStartDrag(RecyclerView.ViewHolder viewHolder);" ]
[ "0.8045257", "0.7505113", "0.7494676", "0.7494676", "0.7494676", "0.7490699", "0.7490699", "0.7481952", "0.7420416", "0.74189496", "0.74089366", "0.7402358", "0.740199", "0.74002147", "0.73977965", "0.73977965", "0.73945504", "0.7391589", "0.73876673", "0.73876673", "0.73876673", "0.73876673", "0.73876673", "0.7382273", "0.73690766", "0.7364877", "0.7364218", "0.7342699", "0.7342699", "0.73346347", "0.73346347", "0.7331861", "0.73246866", "0.732278", "0.7306405", "0.72956425", "0.7290685", "0.7277267", "0.7277267", "0.7277267", "0.7277267", "0.7277267", "0.7277267", "0.7277267", "0.72762007", "0.72762007", "0.7271573", "0.7262342", "0.72413725", "0.7241287", "0.72335225", "0.72303736", "0.7227281", "0.720509", "0.7186262", "0.714424", "0.71330345", "0.71240765", "0.7123633", "0.70908254", "0.7090596", "0.70640093", "0.7056432", "0.702478", "0.70066273", "0.6973121", "0.69346666", "0.6929105", "0.691179", "0.6911391", "0.68673867", "0.6854929", "0.68457913", "0.6841082", "0.68322676", "0.6814731", "0.68009675", "0.67595094", "0.67561835", "0.67557025", "0.67351246", "0.6730335", "0.6729255", "0.67257416", "0.6703028", "0.6668692", "0.66655433", "0.66618377", "0.6648623", "0.66365427", "0.66240495", "0.66195923", "0.66101885", "0.66032565", "0.65967184", "0.65926844", "0.6590583", "0.65748465", "0.6572286", "0.6570355", "0.6570355" ]
0.0
-1
Allocates a new receive buffer whose capacity is probably large enough to read all inbound data and small enough not to waste its space.
public interface RecvByteBufAllocator { /** * Creates a new handle. The handle provides the actual operations and keeps the internal information which is * required for predicting an optimal buffer capacity. */ Handle newHandle(); interface Handle { /** * Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small * enough not to waste its space. */ ByteBuf allocate(ByteBufAllocator alloc); /** * Similar to {@link #allocate(ByteBufAllocator)} except that it does not allocate anything but just tells the * capacity. */ int guess(); /** * Records the the actual number of read bytes in the previous read operation so that the allocator allocates * the buffer with potentially more correct capacity. * * @param actualReadBytes the actual number of read bytes in the previous read operation */ void record(int actualReadBytes); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void fillReceiveBuffer(final int requestedSize) {\n ByteBuffer readBuffer = receiveBuffer;\n if (requestedSize > receiveBuffer.capacity()) {\n readBuffer = socketService.getByteBuffer(requestedSize);\n readBuffer.put(receiveBuffer).flip();\n socketService.releaseByteBuffer(receiveBuffer);\n }\n receiveBuffer = null;\n socketHandle.read(readBuffer).addDeferrable(this, true);\n }", "public byte[] allocReadIOBuffer(int minSize)\n/* */ {\n/* 154 */ _verifyAlloc(this._readIOBuffer);\n/* 155 */ return this._readIOBuffer = this._bufferRecycler.allocByteBuffer(0, minSize);\n/* */ }", "public byte[] allocReadIOBuffer()\n/* */ {\n/* 146 */ _verifyAlloc(this._readIOBuffer);\n/* 147 */ return this._readIOBuffer = this._bufferRecycler.allocByteBuffer(0);\n/* */ }", "protected void ensureBufferSpace(int expectedAdditions) {\n final int bufferLen = (buffer == null ? 0 : buffer.length);\n if (elementsCount + expectedAdditions > bufferLen) {\n final int newSize = resizer.grow(bufferLen, elementsCount, expectedAdditions);\n assert newSize >= elementsCount + expectedAdditions : \"Resizer failed to\" + \" return sensible new size: \"\n + newSize + \" <= \" + (elementsCount + expectedAdditions);\n\n this.buffer = Arrays.copyOf(buffer, newSize);\n }\n }", "@VisibleForTesting\n static int drainBuffer(BufferedReader br, StringBuffer storageBuf, int maxLength, int bytesRead, boolean readAll)\n throws IOException {\n int bReadSession = 0;\n int chunkSize = 1024;\n if (br.ready()) {\n char[] buf = new char[1024];\n int bReadCurrent;\n boolean wantsToReadFurther;\n do {\n bReadCurrent = br.read(buf, 0, chunkSize);\n if (storageBuf != null && bytesRead < maxLength && bReadCurrent != -1) {\n storageBuf.append(buf, 0, bReadCurrent);\n }\n if (bReadCurrent != -1) {\n bReadSession += bReadCurrent;\n }\n wantsToReadFurther = bReadCurrent != -1 && (readAll || bReadCurrent == chunkSize);\n } while (br.ready() && wantsToReadFurther);\n }\n return bReadSession;\n }", "protected abstract long getCurrentBufferCapacity(long paramLong);", "public int getBufferSize() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int getBufferSize() {\n\t\treturn 0;\n\t}", "private final byte[] readBuffer( int size ) throws IOException {\n byte[] buffer = new byte[ size ];\n\n int read = 0;\n while ( read < size ) {\n int next = dataSource.read( buffer, read, size - read );\n if ( next < 0 ) throw new IOException( \"End of Stream\" );\n read += next;\n\t}\n return buffer;\n }", "private static void buffer() {\n\t\tSystem.out.println(\"bafor\"+Runtime.getRuntime().freeMemory());\n\t\tByteBuffer mBuffer=ByteBuffer.allocate(10240000);\n\t\tSystem.out.println(\"bafor\"+Runtime.getRuntime().freeMemory());\n// mBuffer.clear();\n System.out.println(\"bafor\"+Runtime.getRuntime().freeMemory());\n\t}", "public int getReceiveBufferSize() {\n return soRcvBuf;\n }", "private void grow(int minCapacity) {\n // overflow-conscious code\n int oldCapacity = buf.length;\n int newCapacity = oldCapacity << 1;\n if (newCapacity - minCapacity < 0) {\n newCapacity = minCapacity;\n }\n if (newCapacity - MAX_ARRAY_SIZE > 0) {\n newCapacity = hugeCapacity(minCapacity);\n }\n buf = Arrays.copyOf(buf, newCapacity);\n }", "@Override\n public int getBufferSize() {\n return 0;\n }", "public ConsumptionStatus consumeBuffer() {\n\t\tif (status == ConsumptionStatus.BUFFERED){\n\t\t\tString buffered = newBuffer;\n\t\t\tnewBuffer = null;\n\t\t\tstatus = ConsumptionStatus.EMPTY;\n\t\t\tconsumeLine(buffered);\n\t\t\treturn status;\n\t\t}else {\n\t\t\tthrow new IllegalStateException(\"There is no buffer to consume.\");\n\t\t}\n\t}", "int getBufferSize();", "public ByteBuf capacity(int newCapacity)\r\n/* 745: */ {\r\n/* 746:754 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 747:755 */ return super.capacity(newCapacity);\r\n/* 748: */ }", "public ByteRingBuffer(int maxSize){\n buffer= new byte[maxSize];\n readIndex = 0;\n writeIndex = -1;\n size=0;\n }", "private int ensureBuffer(int offset, int length) throws IOException {\n\t\tfinal int lastPos = offset + length - 1;\n\t\tfinal int desiredSize = ((lastPos / BUFFER_SIZE) + 1) * BUFFER_SIZE;\n\t\tfinal int currentSize = this.buffer.length;\n\n\t\tif (desiredSize > currentSize) {\n\t\t\tfinal byte[] readBuffer = new byte[desiredSize - currentSize];\n\t\t\tfinal int count = this.in.read(readBuffer);\n\n\t\t\tif (count > 0) {\n\t\t\t\tfinal byte[] newBuffer = new byte[currentSize + count];\n\t\t\t\tSystem.arraycopy(this.buffer, 0, newBuffer, 0, currentSize);\n\t\t\t\tSystem.arraycopy(readBuffer, 0, newBuffer, currentSize, count);\n\t\t\t\tthis.buffer = newBuffer;\n\t\t\t}\n\t\t\treturn (lastPos < this.buffer.length) ? length : length - (lastPos - this.buffer.length + 1);\n\t\t}\n\t\treturn length;\n\t}", "protected ByteBuffer createIntermediateBuffer(int minSize) {\n int capacity = Utils.getIntegerNetProperty(\n \"jdk.httpclient.websocket.intermediateBufferSize\", 16384);\n return ByteBuffer.allocate(Math.max(minSize, capacity));\n }", "public byte[] receive (long timeout)\n throws IOException, IllegalArgumentException\n {\n int byteArraySize = getNextMessageSize (timeout);\n if (byteArraySize <= 0) {\n return null;\n }\n else {\n return receiveBuffer (timeout);\n }\n }", "protected int populateBuffer()\n {\n interlock.beginReading();\n // System.out.println(\"populateBuffer: 2\");\n return byteBuffer.limit();\n }", "private ByteBuf nextBufferForFrame(int bytesToRead) {\n ByteBuf buf = buffers.getFirst();\n ByteBuf frame;\n\n if (buf.readableBytes() > bytesToRead) {\n frame = buf.retain().readSlice(bytesToRead);\n totalSize -= bytesToRead;\n } else {\n frame = buf;\n buffers.removeFirst();\n totalSize -= frame.readableBytes();\n }\n\n return frame;\n }", "private void ensureCapacity(int newCapacity) {\n\t\t\t data = Arrays.copyOf(data, newCapacity * 2);\n\t\t\t this.capacity = newCapacity * 2;\n\t\t }", "protected void initBuffer() throws IOException {\n if (buf != null) {\r\n Util.disposeDirectByteBuffer(buf);\r\n }\r\n // this check is overestimation:\r\n int size = bufferNumLength << Main.log2DataLength;\r\n assert (size > 0);\r\n if (Main.debug) { System.out.println(\"Allocating direct buffer of \"+bufferNumLength+\" ints.\"); }\r\n buf = ByteBuffer.allocateDirect(size).order(Main.byteOrder);\r\n buf.clear();\r\n }", "private ByteBuf nextBufferForFrame(int bytesToRead) {\n ByteBuf buf = buffers.getFirst();\n ByteBuf frame;\n\n if (buf.readableBytes() > bytesToRead) {\n frame = buf.retain().readSlice(bytesToRead);\n totalSize -= bytesToRead;\n } else {\n frame = buf;\n buffers.removeFirst();\n totalSize -= frame.readableBytes();\n }\n\n return frame;\n }", "private ByteBuffer grow(int length) {\n if (!mBuffers.isEmpty()) {\n ByteBuffer b = mBuffers.peekLast();\n if (b.limit() + length < b.capacity()) {\n b.mark();\n b.position(b.limit());\n b.limit(b.limit() + length);\n remaining += length;\n return b.order(order);\n }\n }\n\n ByteBuffer ret = obtain(length);\n ret.mark();\n ret.limit(length);\n add(ret);\n\n return ret.order(order);\n }", "public void resize( final AtomicInteger _newMaxMessageSize ) {\n\n // if we're asking for a smaller (or same) sized buffer, just leave...\n int newMaxMessageSize = _newMaxMessageSize.get();\n if( newMaxMessageSize <= maxMessageSize ) return;\n\n // allocate new buffer of the right size...\n maxMessageSize = newMaxMessageSize;\n ByteBuffer newBuffer = allocateBuffer();\n\n // copy any bytes we already have into the new one...\n newBuffer.put( buffer );\n newBuffer.flip();\n buffer = newBuffer;\n }", "private static void assertEnsureBufferSizeExpandsToMaxBufferSize(final boolean exceedMaxBufferSize) {\n final int length = 0;\n\n final long presumableFreeMemory = getPresumableFreeMemory();\n // 2GiB + 32 KiB + length\n // 2GiB: Buffer to allocate\n // 32KiB: Some headroom\n // length: Existing buffer\n final long estimatedMemory = (1L << 31) + 32 * 1024 + length;\n assumeTrue(presumableFreeMemory > estimatedMemory, \"Not enough free memory for the test\");\n\n final int max = Integer.MAX_VALUE - 8;\n\n // Check the conservative maximum buffer size can actually be exceeded by the VM\n // otherwise the test is not valid.\n if (exceedMaxBufferSize) {\n assumeCanAllocateBufferSize(max + 1);\n // Free-memory.\n // This may not be necessary as the byte[] is now out of scope\n System.gc();\n }\n\n final BaseNCodec ncodec = new NoOpBaseNCodec();\n final Context context = new Context();\n\n // Allocate the initial buffer\n context.buffer = new byte[length];\n context.pos = length;\n // Compute the extra to reach or exceed the max buffer size\n int extra = max - length;\n if (exceedMaxBufferSize) {\n extra++;\n }\n ncodec.ensureBufferSize(extra, context);\n assertTrue(context.buffer.length >= length + extra);\n }", "abstract public Buffer createBufferFromData(byte[] data, int size);", "private void ensureCapacity() {\n if(size() >= (0.75 * data.length)) // size() == curSize\n resize(2 * size());\n }", "private void fillBuf(int need) throws IOException {\n\n\t\tif (count > pos) {\n\t\t\tSystem.arraycopy(buf, pos, buf, 0, count - pos);\n\t\t\tcount -= pos;\n\t\t\tneed -= count;\n\t\t\tpos = 0;\n\t\t} else {\n\t\t\tcount = 0;\n\t\t\tpos = 0;\n\t\t}\n\n\t\twhile (need > 0) {\n\n\t\t\tint len = in.read(buf, count, buf.length - count);\n\t\t\tif (len <= 0) {\n\t\t\t\tthrow new EOFException();\n\t\t\t}\n\t\t\tcount += len;\n\t\t\tneed -= len;\n\t\t}\n\n\t}", "private void readMoreBytesFromStream() throws IOException {\n if (!innerStreamHasMoreData) {\n return;\n }\n\n int bufferSpaceAvailable = buffer.length - bytesInBuffer;\n if (bufferSpaceAvailable <= 0) {\n return;\n }\n\n int bytesRead =\n stream.read(buffer, bytesInBuffer, bufferSpaceAvailable);\n\n if (bytesRead == -1) {\n innerStreamHasMoreData = false;\n } else {\n bytesInBuffer += bytesRead;\n }\n }", "protected synchronized void populateQueue() throws IOException {\n\t\twhile (m_queueLength < m_queue.length) {\n\t\t\tint off = (m_queuePosition + m_queueLength) % m_queue.length;\n\t\t\tint len = Math.min(m_queue.length - m_queueLength, m_queue.length\n\t\t\t\t\t- off);\n\n\t\t\tint i = m_reader.read(m_queue, off, len);\n\t\t\tif (i == -1) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tm_queueLength += i;\n\t\t}\n\t}", "public Buffer(int capacity) {\r\n\t\t\r\n\t\tthis.data = new int[capacity];\r\n\t\tthis.capacity = capacity;\r\n\t\tthis.size = 0;\r\n\t\tthis.cursor = 0;\r\n\t\t\r\n\t\tinitialize();\r\n\t}", "public byte[] allocBase64Buffer()\n/* */ {\n/* 175 */ _verifyAlloc(this._base64Buffer);\n/* 176 */ return this._base64Buffer = this._bufferRecycler.allocByteBuffer(3);\n/* */ }", "public int getReceiveBufferSize()\r\n/* 99: */ {\r\n/* 100: */ try\r\n/* 101: */ {\r\n/* 102:131 */ return this.javaSocket.getReceiveBufferSize();\r\n/* 103: */ }\r\n/* 104: */ catch (SocketException e)\r\n/* 105: */ {\r\n/* 106:133 */ throw new ChannelException(e);\r\n/* 107: */ }\r\n/* 108: */ }", "protected abstract Buffer doCreateBuffer(int size)\n throws BadParameterException, NoSuccessException;", "protected abstract void getAtLeastBytes(ByteBuffer inputBuffer, int len) throws IOException;", "abstract void allocateBuffers();", "private void createIntBuffer(long sizeOfBuffer) {\n\t\t\tFile bufferFile = createMappedBufferFile();\n\t\t\ttry {\n\t\t\t\trandomAccessFile = new RandomAccessFile(bufferFile,\n\t\t\t\t\t\treadWriteMode);\n\t\t\t\toutChan = randomAccessFile.getChannel();\n\t\t\t\tlong size = (sizeOfBuffer > 0) ? sizeOfBuffer\n\t\t\t\t\t\t: MAXIMUM_BYTES_PER_BLOCK;\n\t\t\t\tintBuffer = outChan.map(MapMode.READ_WRITE, 0, size)\n\t\t\t\t\t\t.asIntBuffer();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public PacketInputStream ()\n {\n _buffer = ByteBuffer.allocate(INITIAL_BUFFER_CAPACITY);\n }", "public int readBufferSize_() {\n return readBufferSize_;\n }", "private int _readMore(InputStream in, byte[] readBuffer, int inputPtr, int inputEnd, int maxRead)\n/* */ throws IOException\n/* */ {\n/* 1580 */ int i = 0;\n/* 1581 */ while (inputPtr < inputEnd) {\n/* 1582 */ readBuffer[(i++)] = readBuffer[(inputPtr++)];\n/* */ }\n/* 1584 */ inputPtr = 0;\n/* 1585 */ inputEnd = i;\n/* 1586 */ maxRead = Math.min(maxRead, readBuffer.length);\n/* */ do\n/* */ {\n/* 1589 */ int length = maxRead - inputEnd;\n/* 1590 */ if (length == 0) {\n/* */ break;\n/* */ }\n/* 1593 */ int count = in.read(readBuffer, inputEnd, length);\n/* 1594 */ if (count < 0) {\n/* 1595 */ return inputEnd;\n/* */ }\n/* 1597 */ inputEnd += count;\n/* 1598 */ } while (inputEnd < 3);\n/* 1599 */ return inputEnd;\n/* */ }", "public RingBuffer(int capacity){\n structure = new LinkedList<E>();\n this.capacity = capacity;\n }", "private final int copyBufferedBytes(ByteList dst, int len) {\n int bytesCopied = 0;\n \n dst.ensure(Math.min(len, bufferedInputBytesRemaining()));\n \n if (bytesCopied < len && ungotc != -1) {\n ++bytesCopied;\n dst.append((byte) ungotc);\n ungotc = -1;\n }\n \n //\n // Copy out any buffered bytes\n //\n if (bytesCopied < len && buffer.hasRemaining()) {\n int n = Math.min(buffer.remaining(), len - bytesCopied);\n dst.append(buffer, n);\n bytesCopied += n;\n }\n \n return bytesCopied;\n }", "ByteBuf allocate(ByteBufAllocator alloc);", "private DataInputStream readBuffer( DataInputStream in, int count ) throws IOException{\n byte[] buffer = new byte[ count ];\n int read = 0;\n while( read < count ){\n int input = in.read( buffer, read, count-read );\n if( input < 0 )\n throw new EOFException();\n read += input;\n }\n \n ByteArrayInputStream bin = new ByteArrayInputStream( buffer );\n DataInputStream din = new DataInputStream( bin );\n return din;\n }", "public void trimToSize() {\n if (size() != this.buffer.length) {\n this.buffer = toArray();\n }\n }", "private byte[] consumePayload() throws IOException {\n byte[] payload = new byte[(int) payloadLength];\n int count = 0;\n while (payloadLength > 0L) {\n payload[count] = (byte) this.read();\n count++;\n }\n return payload;\n }", "private void ensureReadNonBuffered() throws IOException, BadDescriptorException {\n if (reading) {\n if (buffer.hasRemaining()) {\n Ruby localRuntime = getRuntime();\n if (localRuntime != null) {\n throw localRuntime.newIOError(\"sysread for buffered IO\");\n } else {\n throw new IOException(\"sysread for buffered IO\");\n }\n }\n } else {\n // libc flushes writes on any read from the actual file, so we flush here\n flushWrite();\n buffer.clear();\n buffer.flip();\n reading = true;\n }\n }", "public IBuffer newBuffer();", "private void receive() {\r\n\t\ttry {\r\n\t\t\trcvpkt = filter.read();\t\t\t\t\t\t\t// Simulates Transfer-Failures and Errors in the received data\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic int remainingCapacity() {\n\t\treturn 0;\n\t}", "private void reallocate(){\n capacity = 2 * capacity;\n theData = Arrays.copyOf(theData, capacity);\n }", "protected MpscOffHeapFixedSizeRingBuffer(final ByteBuffer buff, final int capacity,\n final boolean isProducer, final boolean isConsumer, final boolean initialize,\n final int messageSize) {\n\n int actualCapacity = Pow2.roundToPowerOfTwo(capacity);\n this.messageSize = messageSize + MESSAGE_INDICATOR_SIZE;\n this.buffy = alignedSlice(4 * JvmInfo.CACHE_LINE_SIZE + (actualCapacity * (this.messageSize)),\n JvmInfo.CACHE_LINE_SIZE, buff);\n\n long alignedAddress = UnsafeDirectByteBuffer.getAddress(buffy);\n // Layout of the RingBuffer (assuming 64b cache line):\n // consumerIndex(8b), pad(56b) |\n // pad(64b) |\n // producerIndex(8b), consumerIndexCache(8b), pad(48b) |\n // pad(64b) |\n // buffer (capacity * messageSize)\n this.consumerIndexAddress = alignedAddress;\n this.producerIndexAddress = this.consumerIndexAddress + 2 * JvmInfo.CACHE_LINE_SIZE;\n this.consumerIndexCacheAddress = this.producerIndexAddress + 8;\n this.bufferAddress = alignedAddress + HEADER_SIZE;\n this.mask = actualCapacity - 1;\n // producer owns tail and headCache\n if (isProducer && initialize) {\n soConsumerIndexCache(0);\n soProducerIndex(0);\n // mark all messages as null\n for (int i = 0; i < actualCapacity; i++) {\n final long offset = offsetForIndex(i);\n readyIndicator(offset);\n }\n }\n // consumer owns head and tailCache\n if (isConsumer && initialize) {\n soConsumerIndex(0);\n }\n }", "private E newBufferPoll(E[] nextBuffer, long index)\r\n/* 200: */ {\r\n/* 201:451 */ long offset = newBufferAndOffset(nextBuffer, index);\r\n/* 202:452 */ E n = UnsafeRefArrayAccess.lvElement(nextBuffer, offset);\r\n/* 203:453 */ if (n == null) {\r\n/* 204:455 */ throw new IllegalStateException(\"new buffer must have at least one element\");\r\n/* 205: */ }\r\n/* 206:457 */ UnsafeRefArrayAccess.soElement(nextBuffer, offset, null);\r\n/* 207:458 */ soConsumerIndex(index + 2L);\r\n/* 208:459 */ return n;\r\n/* 209: */ }", "private int fillBuffer() throws IOException {\r\n int n = super.read(buffer, 0, BUF_SIZE);\r\n if (n >= 0) {\r\n file_pos +=n;\r\n buf_end = n;\r\n buf_pos = 0;\r\n }\r\n return n;\r\n }", "synchronized A consume() {\n try {\r\n if ((noMore && slack >= 0) || consumedAll) {\r\n notifyAll();\r\n consumedAll = true;\r\n return null;\r\n }\r\n while (slack != -1) {\r\n wait();\r\n }\r\n A tmp;\r\n\r\n int bSize = CodecUtil.slackOrSize(consumerBuffer, codec);\r\n if(bSize < 0 && endOfStream) {\r\n bSize = Math.abs(bSize);\r\n }\r\n if (bSize <= 0) {\r\n slack = Math.abs(bSize);\r\n notifyAll();\r\n return null;\r\n }\r\n tmp = codec.from(consumerBuffer);\r\n totConsumed += bSize;\r\n notifyAll();\r\n return tmp;\r\n }\r\n catch (InterruptedException e) {\r\n }\r\n return null;\r\n }", "private void receive() throws IOException {\n byte[] lengthBuffer = new byte[4];\n dataInput.readFully(lengthBuffer);\n int length = Utilities.getIntFromByte(lengthBuffer, 0);\n pipedOutputStream.write(Utilities.getBytes(length));\n\n //now read the data indicated by length and write it to buffer\n byte[] buffer = new byte[length];\n dataInput.readFully(buffer);\n pipedOutputStream.write(buffer);\n pipedOutputStream.flush();\n clientBlocker();\n }", "void setBufferSize(int bufferSize);", "private static void AssureRecieve(ClientManager clientManager, tangible.RefObject<byte[]> buffer, long size) {\n int bytesRecieved = 0;\n int totalBytesReceived = 0;\n\n do {\n try {\n bytesRecieved = clientManager.getClientSocket().getInputStream().read(buffer.argvalue, totalBytesReceived, (int) (size - totalBytesReceived));\n totalBytesReceived += bytesRecieved;\n\n clientManager.AddToClientsBytesRecieved(bytesRecieved);\n\n if (SocketServer.getIsServerCounterEnabled()) {\n SocketServer.getPerfStatsColl().incrementBytesReceivedPerSecStats(bytesRecieved);\n SocketServer.getPerfStatsColl().incrementByteReceivePerSecStatsBy(bytesRecieved);\n }\n } catch (Exception se) {\n }\n } while (totalBytesReceived < size && bytesRecieved > 0);\n if (buffer.argvalue.length != size) {\n byte[] bite = new byte[totalBytesReceived];\n System.arraycopy(buffer.argvalue, 0, bite, 0, totalBytesReceived);\n buffer.argvalue = bite;\n }\n\n }", "private int getInput() {\n final boolean debug = false;\n int toRead;\n int result;\n int nread;\n\n // if (checkForDeadChannel()) return EINVAL;\n\n // Skipped pushback processing code for stacked Channels\n\n\n // See if we can fill an existing buffer. If we can, read only\n // as much as will fit in it. Otherwise allocate a new buffer,\n // add it to the input queue and attempt to fill it to the max.\n\n ChannelBuffer buf = inQueueTail;\n\n if ((buf != null) && (buf.nextAdded < buf.bufLength)) {\n if (debug) {\n System.out.println(\"smaller than buffer\");\n }\n toRead = buf.bufLength - buf.nextAdded;\n\t} else {\n if (debug) {\n System.out.println(\"fits in existing buffer\");\n }\n\n buf = saveInBuf;\n saveInBuf = null;\n\n // Check the actual buffersize against the requested\n // buffersize. Buffers which are smaller than requested are\n // squashed. This is done to honor dynamic changes of the\n // buffersize made by the user.\n\n if ((buf != null) && ((buf.bufLength - buf.BUFFER_PADDING) < bufSize)) {\n buf = null;\n }\n if (buf == null) {\n if (debug) {\n System.out.println(\"allocated ChannelBuffer of size \" + bufSize);\n }\n buf = new ChannelBuffer(bufSize);\n }\n buf.next = null;\n\n // Use the actual size of the buffer to determine\n // the number of bytes to read from the channel and not the\n // size for new buffers. They can be different if the\n // buffersize was changed between reads.\n\n toRead = buf.bufLength - buf.nextAdded;\n if (debug) {\n System.out.println(\"toRead set to \" + toRead);\n }\n\n if (inQueueTail == null) {\n inQueueHead = buf;\n } else {\n inQueueTail.next = buf;\n }\n\n inQueueTail = buf;\n }\n\n // If EOF is set, we should avoid calling the driver because on some\n // platforms it is impossible to read from a device after EOF.\n\n if (eofCond) {\n if (debug) {\n System.out.println(\"eofCond was true, no error return\");\n }\n return 0;\n }\n\n // FIXME: We do not handle non-blocking or this CHANNEL_TIMER_FEV flag yet\n\n if (/*CHANNEL_TIMER_FEV &&*/\n !blocking) {\n return TclPosixException.EWOULDBLOCK;\n } else {\n result = 0;\n\n // Can we even use this for a brain-dead nonblocking IO check?\n int numAvailable = /*input.available();*/ 0;\n\n if (!blocking && (numAvailable < toRead)) {\n result = TclPosixException.EWOULDBLOCK;\n nread = -1;\n } else {\n try {\n if (debug) {\n System.out.println(\"now to read \" + toRead + \" bytes\");\n }\n\n nread = input.read(buf.buf, buf.nextAdded, toRead);\n\n // read() returns -1 on EOF\n if (nread == -1) {\n if (debug) {\n System.out.println(\"got EOF from read() call\");\n }\n nread = 0;\n }\n } catch (IOException ex) {\n // FIXME: How do we recover from IO errors here?\n // I think we need to set result to a POSIX error\n ex.printStackTrace(System.err);\n nread = -1;\n }\n }\n }\n\n if (nread > 0) {\n if (debug) {\n System.out.println(\"nread is \" + nread);\n }\n buf.nextAdded += nread;\n\n // should avoid calling the driver because on some platforms we\n // will block in the low level reading code even though the\n // channel is set into nonblocking mode.\n\n if (nread < toRead) {\n blocked = true;\n }\n } else if (nread == 0) {\n eofCond = true;\n encodingEnd = true;\n if (debug) {\n System.out.println(\"nread is zero, eofCond set, encodingEnd set\");\n }\n } else if (nread < 0) {\n if (debug) {\n System.out.println(\"nread is \" + nread);\n }\n if ((result == TclPosixException.EWOULDBLOCK) ||\n (result == TclPosixException.EAGAIN)) {\n blocked = true;\n\t result = TclPosixException.EAGAIN;\n\t }\n // FIXME: Called needs to raise a TclException\n //Tcl_SetErrno(result);\n return result;\n }\n if (debug) {\n System.out.println(\"no error return\");\n }\n return 0;\n }", "private void recycleBuffer(ChannelBuffer buf, boolean mustDiscard) {\n\n if (mustDiscard)\n return;\n\n // Only save buffers which are at least as big as the requested\n // buffersize for the channel. This is to honor dynamic changes\n // of the buffersize made by the user.\n\n if ((buf.bufLength - buf.BUFFER_PADDING) < bufSize) {\n return;\n }\n\n if (inQueueHead == null) {\n inQueueHead = buf;\n inQueueTail = buf;\n\n buf.nextRemoved = buf.BUFFER_PADDING;\n buf.nextAdded = buf.BUFFER_PADDING;\n buf.next = null;\n return;\n }\n if (saveInBuf == null) {\n saveInBuf = buf;\n\n buf.nextRemoved = buf.BUFFER_PADDING;\n buf.nextAdded = buf.BUFFER_PADDING;\n buf.next = null;\n return;\n }\n }", "static void readBytes(ByteBufAllocator allocator, ByteBuffer buffer, int position, int length, OutputStream out) throws IOException {\n if (buffer.hasArray()) {\n out.write((byte[])buffer.array(), (int)(position + buffer.arrayOffset()), (int)length);\n return;\n }\n int chunkLen = Math.min((int)length, (int)8192);\n buffer.clear().position((int)position);\n if (length <= 1024 || !allocator.isDirectBufferPooled()) {\n ByteBufUtil.getBytes((ByteBuffer)buffer, (byte[])ByteBufUtil.threadLocalTempArray((int)chunkLen), (int)0, (int)chunkLen, (OutputStream)out, (int)length);\n return;\n }\n ByteBuf tmpBuf = allocator.heapBuffer((int)chunkLen);\n try {\n byte[] tmp = tmpBuf.array();\n int offset = tmpBuf.arrayOffset();\n ByteBufUtil.getBytes((ByteBuffer)buffer, (byte[])tmp, (int)offset, (int)chunkLen, (OutputStream)out, (int)length);\n return;\n }\n finally {\n tmpBuf.release();\n }\n }", "private final int copyBufferedBytes(byte[] dst, int off, int len) {\n int bytesCopied = 0;\n \n if (ungotc != -1 && len > 0) {\n dst[off++] = (byte) ungotc;\n ungotc = -1;\n ++bytesCopied;\n }\n \n final int n = Math.min(len - bytesCopied, buffer.remaining());\n buffer.get(dst, off, n);\n bytesCopied += n;\n \n return bytesCopied;\n }", "@SuppressWarnings( \"unused\" )\n public int capacity() {\n return buffer.capacity() - buffer.limit();\n }", "public interface ProductionBuffer {\n\t\n\tpublic int getMaxBufferSize();\n\t\n\tpublic int getCurrentBufferSize();\n\t\n\tpublic boolean isFull();\n\t\n\tpublic boolean isEmpty();\n\t\n\t//Add to the back of the buffer\n\tpublic boolean add(BufferSlot bs);\n\t\n\t//Remove from the front of the buffer\n\tpublic BufferSlot remove();\n\t\n\t//empties the buffer\n\tpublic void clear();\n\n}", "protected OffHeapFixedMessageSizeRingBuffer(final ByteBuffer buff,\n final int capacity,\n final boolean isProducer,\n final boolean isConsumer,\n final boolean initialize,\n final int primitiveMessageSize,\n final Object[] references,\n final int referenceMessageSize) {\n if (references != null && references.length < referenceMessageSize) {\n throw new IllegalArgumentException(\"Reference array of length \" + references.length\n + \" is insufficient to store a single message of size \" + referenceMessageSize);\n }\n\n int actualCapacity = Pow2.roundToPowerOfTwo(capacity);\n // message size is aligned to indicator size, this ensure atomic writes of indicator\n this.messageSize = (int) Pow2.align(primitiveMessageSize + MESSAGE_INDICATOR_SIZE, MESSAGE_INDICATOR_SIZE);\n this.buffy = alignedSlice(HEADER_SIZE + (actualCapacity * (this.messageSize)), CACHE_LINE_SIZE, buff);\n\n long alignedAddress = UnsafeDirectByteBuffer.getAddress(buffy);\n if (alignedAddress % CACHE_LINE_SIZE != 0) {\n throw new IllegalStateException(\"buffer is expected to be cache line aligned by now\");\n }\n // Layout of the RingBuffer (assuming 64b cache line):\n // consumerIndex(8b), pad(56b) |\n // pad(64b) |\n // producerIndex(8b), pad(56b) |\n // pad(64b) |\n // buffer (capacity * messageSize)\n this.consumerIndexAddress = alignedAddress;\n this.producerIndexAddress = this.consumerIndexAddress + 2l * CACHE_LINE_SIZE;\n this.bufferAddress = alignedAddress + HEADER_SIZE;\n this.mask = actualCapacity - 1;\n\n this.references = references;\n this.referenceMessageSize = referenceMessageSize;\n\n // producer owns tail and headCache\n if (isProducer && initialize) {\n soProducerIndex(0);\n // mark all messages as READY\n for (int i = 0; i < actualCapacity; i++) {\n final long offset = offsetForIndex(i);\n readReleaseState(offset);\n }\n }\n // consumer owns head\n if (isConsumer && initialize) {\n soConsumerIndex(0);\n }\n }", "private ByteBuffer allocateFromPool(int length, boolean isFragmented) {\n return (isFragmented ? this.fragmentedBufferPool : this.unfragmentedBufferPool).get(length);\n}", "private void initReadBlockingTask(int size){ \n for (int i=0; i < size; i++){\n getReadTasks().offer(newReadBlockingTask(false));\n }\n }", "private int readChunkSize(int desired) {\n return Math.min(availableFirst(), desired);\n }", "private static void assumeCanAllocateBufferSize(final int size) {\n byte[] bytes = null;\n try {\n bytes = new byte[size];\n } catch (final OutOfMemoryError ignore) {\n // ignore\n }\n assumeTrue(bytes != null, \"Cannot allocate array of size: \" + size);\n }", "public ArrayRingBuffer(int capacity) {\n Buffer_num = capacity;\n rb =(T[]) new Object[Buffer_num];\n fillCount = 0;\n first = 0;\n last = 0;\n }", "@Override\n public synchronized void receive(ByteBuffer src) {\n super.receive(src);\n if (!src.hasRemaining())\n return; // nothing to receive\n receiveOutbound(src);\n }", "ByteBuffer allocate() {\n\t\tvar b = ByteBuffer.allocate(size).order(LITTLE_ENDIAN);\n\t\tb.putInt(ordinal());\n\t\treturn b;\n\t}", "@Override\n\tpublic void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {\n\t\tByteBuf buf = (ByteBuf) msg;\n\t\tSystem.out.println(\"有新的数据,长度:\" + buf.readableBytes());\n\n\t\tif (msgbuf.getDatalen() > 0) {\n\t\t\tint ablelen = buf.readableBytes();\n\n\t\t\tint leftlen = msgbuf.getDatalen() - msgbuf.getDatarev();\n\t\t\tSystem.out.println(\"接着上次预读取:\" + leftlen + \"长度数据\");\n\n\t\t\tif (leftlen > ablelen) {\n\n\t\t\t\tSystem.out.println(\"数据长度小于所要的长度,全部写入\");\n\n\t\t\t\tint oldlimit=msgbuf.getDatabuf().limit();\n\t\t\t\tmsgbuf.getDatabuf().limit(msgbuf.getDatarev()+ablelen);\n\t\t\t\tbuf.getBytes(0, msgbuf.getDatabuf());\n\t\t\t\tmsgbuf.setDatarev(msgbuf.getDatarev() + ablelen);\n\t\t\t\tmsgbuf.getDatabuf().limit(oldlimit);\n\t\t\t} else {\n\n\t\t\t\tbuf.getBytes(0, msgbuf.getDatabuf());\n\n\t\t\t\tSystem.out.println(\"预取长度小于缓冲长度,获取全部包,分发消息\");\n\n\t\t\t\t// 读完了数据,处理了\n\t\t\t\treadFinished(ctx, msgbuf.getDatabuf());\n\t\t\t\tmsgbuf.reSet();\n\n\t\t\t\tif (leftlen < ablelen) {\n\n\t\t\t\t\tSystem.out.println(String.format(\"leftlen长%d,缓冲长度%d,还有数据,接着读下一个包\", leftlen, ablelen));\n\t\t\t\t\tprepareRead(ctx, buf, leftlen);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(String.format(\"leftlen长%d,缓冲长度%d,没有数据了\", leftlen, ablelen));\n\t\t\t\t}\n\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"msgbuf没有指定长度,按新包处理\");\n\t\t\tprepareRead(ctx, buf, 0);\n\t\t}\n\t\t\n\t\tbuf.clear();\n\t}", "public void consume() throws InterruptedException {\n\n\t\tRandom random = new Random();\n\t\twhile (true) {\n\t\t\tsynchronized (lock) {\n\t\t\t\twhile (buffer.size() == 0) {\n\t\t\t\t\tlock.wait();\n\t\t\t\t}\n\n\t\t\t\tSystem.out.println(\"Consumed : \" + buffer.removeFirst());\n\t\t\t\tlock.notify();\n\n\t\t\t}\n\t\t\tThread.sleep(random.nextInt(1000));\n\t\t}\n\n\t}", "public ByteBuf capacity(int newCapacity)\r\n/* 87: */ {\r\n/* 88:122 */ checkNewCapacity(newCapacity);\r\n/* 89: */ \r\n/* 90:124 */ int oldCapacity = this.array.length;\r\n/* 91:125 */ byte[] oldArray = this.array;\r\n/* 92:126 */ if (newCapacity > oldCapacity)\r\n/* 93: */ {\r\n/* 94:127 */ byte[] newArray = allocateArray(newCapacity);\r\n/* 95:128 */ System.arraycopy(oldArray, 0, newArray, 0, oldArray.length);\r\n/* 96:129 */ setArray(newArray);\r\n/* 97:130 */ freeArray(oldArray);\r\n/* 98: */ }\r\n/* 99:131 */ else if (newCapacity < oldCapacity)\r\n/* 100: */ {\r\n/* 101:132 */ byte[] newArray = allocateArray(newCapacity);\r\n/* 102:133 */ int readerIndex = readerIndex();\r\n/* 103:134 */ if (readerIndex < newCapacity)\r\n/* 104: */ {\r\n/* 105:135 */ int writerIndex = writerIndex();\r\n/* 106:136 */ if (writerIndex > newCapacity) {\r\n/* 107:137 */ writerIndex(writerIndex = newCapacity);\r\n/* 108: */ }\r\n/* 109:139 */ System.arraycopy(oldArray, readerIndex, newArray, readerIndex, writerIndex - readerIndex);\r\n/* 110: */ }\r\n/* 111: */ else\r\n/* 112: */ {\r\n/* 113:141 */ setIndex(newCapacity, newCapacity);\r\n/* 114: */ }\r\n/* 115:143 */ setArray(newArray);\r\n/* 116:144 */ freeArray(oldArray);\r\n/* 117: */ }\r\n/* 118:146 */ return this;\r\n/* 119: */ }", "private final int copyBufferedBytes(ByteBuffer dst) {\n final int bytesToCopy = dst.remaining();\n \n if (ungotc != -1 && dst.hasRemaining()) {\n dst.put((byte) ungotc);\n ungotc = -1;\n }\n \n if (buffer.hasRemaining() && dst.hasRemaining()) {\n \n if (dst.remaining() >= buffer.remaining()) {\n //\n // Copy out any buffered bytes\n //\n dst.put(buffer);\n \n } else {\n //\n // Need to clamp source (buffer) size to avoid overrun\n //\n ByteBuffer tmp = buffer.duplicate();\n tmp.limit(tmp.position() + dst.remaining());\n dst.put(tmp);\n buffer.position(tmp.position());\n }\n }\n \n return bytesToCopy - dst.remaining();\n }", "public int getBufferSize() {\n return count;\n }", "void setStreamBuffer(int size) {\r\n\t\tif(size>0)\r\n\t\t\tbuffer = new byte[size];\r\n\t\telse\r\n\t\t\tbuffer = new byte[this.size];\r\n\t}", "public static ByteBuf readBytes(ByteBufAllocator alloc, ByteBuf buffer, int length) {\n boolean release = true;\n ByteBuf dst = alloc.buffer((int)length);\n try {\n buffer.readBytes((ByteBuf)dst);\n release = false;\n ByteBuf byteBuf = dst;\n return byteBuf;\n }\n finally {\n if (release) {\n dst.release();\n }\n }\n }", "public InMemoryQueueService(){\n this.ringBufferQueue = new QueueMessage[10000];\n }", "synchronized void receive(int preknownDataLength) throws EOFException, IOException {\n byte[] buffer = new byte[preknownDataLength];\n dataInput.readFully(buffer);\n pipedOutputStream.write(buffer);\n }", "private void ensureCapacity(int count) {\n\t\tint capacity = getCapacity();\n\t\t\n\t\tint newLength = length + count;\n\t\tif (capacity >= newLength)\n\t\t\treturn;\n\n\t\t// Double capacity\n\t\tcapacity <<= 1;\n\t\t\n\t\tif (newLength > capacity)\n\t\t\tcapacity = newLength;\n\n\t\tchar[] newBuffer = new char[capacity];\n\t\tSystem.arraycopy(buffer, 0, newBuffer, 0, length);\n\t\tbuffer = newBuffer;\n\t}", "byte[] allocateArray(int initialCapacity)\r\n/* 53: */ {\r\n/* 54: 87 */ return new byte[initialCapacity];\r\n/* 55: */ }", "private void growQueue() {\n Runnable[] oldQ = queue;\n int oldSize = oldQ.length;\n int newSize = oldSize << 1;\n if (newSize > MAXIMUM_QUEUE_CAPACITY)\n throw new RejectedExecutionException(\"Queue capacity exceeded\");\n Runnable[] newQ = queue = new Runnable[newSize];\n\n int b = base;\n int bf = b + oldSize;\n int oldMask = oldSize - 1;\n int newMask = newSize - 1;\n do {\n int oldIndex = b & oldMask;\n Runnable t = oldQ[oldIndex];\n if (t != null && !casSlotNull(oldQ, oldIndex, t))\n t = null;\n setSlot(newQ, b & newMask, t);\n } while (++b != bf);\n pool.signalWork();\n }", "int getBytesInBufferAvailable() {\n if (this.count == this.pos) return 0;\n else return this.buf.length - this.pos;\n }", "public ByteBuffer toBuffer() {\n return ByteBuffer.wrap(buf, 0, count);\n }", "public int getBufferSize() {\n\t\treturn buffer.length;\n\t}", "private final int bufferedOutputSpaceRemaining() {\n return !reading ? buffer.remaining() : 0;\n }", "public void setMaxCapacity(int max) {\n\t\tbuffer = new Object[max];\n\t\tbufferSize = 0;\n\t}", "private void updateBlockBuffer() {\n for (Block b : blockBuffer) {\n if (++b.ttl > BLOCK_CACHE_THRESH) {\n blockBuffer.remove(b);\n }\n }\n\n prevBlockBufferSize = blockBuffer.size();\n }", "public SocketChannelConfig setReceiveBufferSize(int receiveBufferSize)\r\n/* 202: */ {\r\n/* 203: */ try\r\n/* 204: */ {\r\n/* 205:211 */ this.javaSocket.setReceiveBufferSize(receiveBufferSize);\r\n/* 206: */ }\r\n/* 207: */ catch (SocketException e)\r\n/* 208: */ {\r\n/* 209:213 */ throw new ChannelException(e);\r\n/* 210: */ }\r\n/* 211:215 */ return this;\r\n/* 212: */ }", "public EntityBuffer(int bufferCapacity) {\n\t\tbuffer = new DataPostbox<EntityContainer>(bufferCapacity);\n\t}", "public final void freeBuffers()\n {\n if (_ioContext != null) {\n byte[] buf = _inputBuffer;\n if (buf != null) {\n _inputBuffer = null;\n _ioContext.releaseReadIOBuffer(buf);\n }\n }\n }", "public void honourFreeBufferCount() {\n // Check if there are enough free launchers\n int freeCount = getFreeLaunchers().size();\n\n while (freeCount < freeBufferCount) {\n if (getTotalLaunchers().size() > maxCount) {\n log.warn(\"Specified Maximum Concurrency has been exceeded, but scaling up will be permitted. If this \" +\n \"message appears often increase maximum concurrency.\");\n }\n\n log.info(\"Scaling UP: REASON -> [Free Count] \" + freeCount + \" < [Free Gap] \" + freeBufferCount);\n scaleUp(\"honourFreeBufferCount\");\n freeCount = getFreeLaunchers().size();\n }\n }", "int readNonBlocking(byte[] buffer, int offset, int length);", "public RtpPacket(int capacity, boolean allocateDirect) { \t\n buffer = allocateDirect ? \n ByteBuffer.allocateDirect(capacity) :\n ByteBuffer.allocate(capacity);\n }", "public Buffer getEmptyBuffer()\n {\n // System.out.println(getClass().getName()+\":: getEmptyBuffer\");\n\n switch (protocol)\n {\n case ProtocolPush:\n if (!isEmptyBufferAvailable() && reset)\n return null;\n reset = false;\n return circularBuffer.getEmptyBuffer();\n case ProtocolSafe:\n synchronized (circularBuffer)\n {\n reset = false;\n while (!reset && !isEmptyBufferAvailable())\n {\n try\n {\n circularBuffer.wait();\n } catch (Exception e)\n {\n }\n }\n if (reset)\n return null;\n Buffer buffer = circularBuffer.getEmptyBuffer();\n circularBuffer.notifyAll();\n return buffer;\n }\n\n default:\n throw new RuntimeException();\n }\n }" ]
[ "0.7594373", "0.67068505", "0.6383847", "0.58835226", "0.58726704", "0.58000237", "0.5676667", "0.5650768", "0.5618627", "0.56044924", "0.5592351", "0.55782473", "0.55764717", "0.5573167", "0.55502677", "0.5522942", "0.5519637", "0.55084664", "0.55040056", "0.55004615", "0.5493012", "0.5491762", "0.5479324", "0.54331917", "0.5433028", "0.5389157", "0.5365129", "0.53527325", "0.52891827", "0.52887684", "0.52852404", "0.5285107", "0.5272165", "0.5262742", "0.5259167", "0.5256927", "0.5256728", "0.52547246", "0.524862", "0.52409965", "0.5176155", "0.5173623", "0.5154521", "0.51455337", "0.51412827", "0.5134158", "0.5133172", "0.51280314", "0.51178396", "0.51133513", "0.51097023", "0.5092724", "0.50716454", "0.506998", "0.5066479", "0.50656444", "0.5047971", "0.50431466", "0.5024056", "0.50222385", "0.50018317", "0.4994747", "0.49822307", "0.49801847", "0.49755165", "0.49664056", "0.49584624", "0.49580184", "0.4952888", "0.49434707", "0.49373886", "0.4933089", "0.49328032", "0.49264666", "0.4917561", "0.49169293", "0.49164286", "0.49096876", "0.49090385", "0.49050373", "0.490139", "0.4898125", "0.48931617", "0.48863146", "0.48773846", "0.48736072", "0.48709488", "0.4862142", "0.48604017", "0.4856384", "0.48551476", "0.4849799", "0.48438928", "0.4836556", "0.4832151", "0.4826028", "0.4825428", "0.48216116", "0.48213345", "0.48211813" ]
0.6075832
3
Creates a new handle. The handle provides the actual operations and keeps the internal information which is required for predicting an optimal buffer capacity.
Handle newHandle();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic AssetManageReqHandle create(long handleId) {\n\t\tAssetManageReqHandle assetManageReqHandle = new AssetManageReqHandleImpl();\n\n\t\tassetManageReqHandle.setNew(true);\n\t\tassetManageReqHandle.setPrimaryKey(handleId);\n\n\t\treturn assetManageReqHandle;\n\t}", "protected abstract T newObject(Handle<T> paramHandle);", "public void allocate(ResourceHandle resource) {\n }", "public VkHandle(ByteBuffer nativePtr) throws UnsupportedOperationException {\n setHandle(nativePtr);\n }", "Recycler.DefaultHandle<T> newHandle()\r\n/* 582: */ {\r\n/* 583:623 */ return new Recycler.DefaultHandle(this);\r\n/* 584: */ }", "protected VkHandle(){ \n this(0);\n }", "public VkHandle(long nativeHandle) { \n this.nativeHandle = nativeHandle;\n }", "abstract public Buffer createBuffer();", "protected abstract Buffer doCreateBuffer(int size)\n throws BadParameterException, NoSuccessException;", "public void initHandle() {\n if(handle == null) {\n /* try {\n handle = ContextHolder.getInstance().getHandlePool().borrowObject();\n } catch (Exception e) {\n handle = new cublasHandle();\n JCublas2.cublasCreate(handle);\n handleFromPool = false;\n }*/\n handle = new cublasHandle();\n JCublas2.cublasCreate(handle);\n handleFromPool = false;\n // associateHandle();\n }\n\n }", "public GlBuffer allocate(final int usage, final int target, final boolean freeLocal){\n\t\t//android.util.//Log.d(TAG,\"createVBO(\"+usage+\",\"+target+\",\"+freeLocal+\")\");\n\t\tif(this.handle == UNBIND_HANDLE){\n\t\t\tfinal int[] handles = new int[1];\n\n\t\t\t//Create buffer on server\n\t\t\tGLES20.glGenBuffers(1, handles, 0);\n\t\t\tthis.handle = handles[0];\n\t\t\tthis.target = target;\n\n\t\t\tGlOperation.checkGlError(TAG, \"glGenBuffers\");\n\n\t\t\t//Bind it\n\t\t\tGLES20.glBindBuffer(target, this.handle);\n\t\t\tif(this.buffer == null){\n\t\t\t\tthis.commit(false);\n\t\t\t}\n\t\t\t//Push data into it\n\t\t\tthis.buffer.position(0);\n\t\t\tGLES20.glBufferData(target, this.size, this.buffer, usage);\n\t\t\t//Unbind it\n\t\t\tGLES20.glBindBuffer(target, UNBIND_HANDLE);\n\n\t\t\t//Check error on bind only\n\t\t\tGlOperation.checkGlError(TAG, \"glBufferData\");\n\n\t\t\t//Free local buffer is queried\n\t\t\tif(mManagedBuffer && freeLocal){\n\t\t\t\tswitch(this.datatype){\n\t\t\t\t\tcase TYPE_BYTE :\n\t\t\t\t\t\tByteBufferPool.getInstance().returnDirectBuffer((ByteBuffer)this.buffer);\n\t\t\t\t\t\tmManagedBuffer = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TYPE_SHORT :\n\t\t\t\t\t\tByteBufferPool.getInstance().returnDirectBuffer((ShortBuffer)this.buffer);\n\t\t\t\t\t\tmManagedBuffer = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TYPE_INT :\n\t\t\t\t\t\tByteBufferPool.getInstance().returnDirectBuffer((IntBuffer)this.buffer);\n\t\t\t\t\t\tmManagedBuffer = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault :\n\t\t\t\t\t\tByteBufferPool.getInstance().returnDirectBuffer((FloatBuffer)this.buffer);\n\t\t\t\t\t\tmManagedBuffer = false;\n\t\t\t\t}\n\t\t\t\tthis.buffer = null;\n\t\t\t}\n\n\t\t\tmode = MODE_VBO;\n\n if(GlOperation.getVersion()[0] >= 3 && this.vertexAttribHandles != null\n && this.vertexAttribHandles.length > 0){\n GLES30.glGenVertexArrays(1, handles, 0);\n mVaoHandle = handles[0];\n GlOperation.checkGlError(TAG, \"glGenVertexArrays\");\n\n GLES30.glBindVertexArray(mVaoHandle);\n GLES20.glBindBuffer(target, this.handle);\n\n for(int index=0; index < this.vertexAttribHandles.length; index++){\n GLES20.glEnableVertexAttribArray(this.vertexAttribHandles[index]);\n GLES20.glVertexAttribPointer(this.vertexAttribHandles[index], this.chunks[index].components,\n this.chunks[index].datatype, this.chunks[index].normalized, stride, this.chunks[index].offset);\n }\n GlOperation.checkGlError(TAG, \"glVertexAttribPointer\");\n\n GLES20.glBindBuffer(target, UNBIND_HANDLE);\n GLES30.glBindVertexArray(UNBIND_HANDLE);\n\n mode = MODE_VAO;\n }\n\t\t}\n\t\telse{\n\t\t Log.w(TAG, \"multiple allocation detected !\");\n }\n\n\t\treturn this;\n\t}", "@NativeType(\"bgfx_indirect_buffer_handle_t\")\n public static short bgfx_create_indirect_buffer(@NativeType(\"uint32_t\") int _num) {\n long __functionAddress = Functions.create_indirect_buffer;\n return invokeC(_num, __functionAddress);\n }", "private native void initialiseHandle(ArcomESS handle);", "protected Tool createHandleTracker(DrawingView view, Handle handle) {\n return new HandleTracker(view, handle);\n }", "public IBuffer newBuffer();", "int getHandle();", "int getHandle();", "int getHandle();", "public Builder clearHandle() {\n bitField0_ = (bitField0_ & ~0x00000002);\n handle_ = 0;\n onChanged();\n return this;\n }", "public MxNDArray create(Pointer handle) {\n return new MxNDArray(this, handle);\n }", "public byte[] getCurrentHandle();", "public Builder setHandle(int value) {\n bitField0_ |= 0x00000002;\n handle_ = value;\n onChanged();\n return this;\n }", "public synchronized T doCreate() throws PoolException {\n if (maxSize == INFINITE || inUse < maxSize) {\n T item = create();\n inUse++;\n return item;\n } else {\n throw new PoolException(\"pool at capacity: \" + inUse + \" item(s) checked out. \" + getStack().size() + \" items in getStack().\");\n }\n }", "public Builder clearHandle() {\n bitField0_ = (bitField0_ & ~0x00000001);\n handle_ = 0;\n onChanged();\n return this;\n }", "public Builder clearHandle() {\n bitField0_ = (bitField0_ & ~0x00000001);\n handle_ = 0;\n onChanged();\n return this;\n }", "public int getHandle() {\n return handle_;\n }", "public int getHandle() {\n return handle_;\n }", "public int getHandle() {\n return handle_;\n }", "public Builder setHandle(int value) {\n bitField0_ |= 0x00000001;\n handle_ = value;\n onChanged();\n return this;\n }", "public Builder setHandle(int value) {\n bitField0_ |= 0x00000001;\n handle_ = value;\n onChanged();\n return this;\n }", "public int getHandle() {\n return handle_;\n }", "public int getHandle() {\n return handle_;\n }", "public int getHandle() {\n return handle_;\n }", "public static native long meCreate2( int pCapacity);", "public Handle(int position) {\n this.position = position;\n }", "@Override\n public void dispose(){\n if(handle <= 0) return;\n free(handle);\n handle = 0;\n }", "public EntityBuffer(int bufferCapacity) {\n\t\tbuffer = new DataPostbox<EntityContainer>(bufferCapacity);\n\t}", "protected IOContext _createContext(Object srcRef, boolean resourceManaged)\n/* */ {\n/* 1513 */ return new IOContext(_getBufferRecycler(), srcRef, resourceManaged);\n/* */ }", "private int handleCreate(int name) {\n\t\tString FileName = readVirtualMemoryString(name, MAXSTRLEN);\n\t\t//check to make sure file name is valid\n\t\tif(FileName == null)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\t//find a free file descriptor\n\t\tint fileIndex = -1;\n\t\tfor(int i = 2; i < 16; i++)\n\t\t{\n\t\t\tif(fileDescriptors[i] == null)\n\t\t\t{\n\t\t\t\tfileIndex = i;\n\t\t\t}\n\t\t}\n\t\t//error if there is no free file descriptor\n\t\tif(fileIndex == -1)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\n\t\tOpenFile file = ThreadedKernel.fileSystem.open(FileName, true);\n\t\t//error if file cannot be created\n\t\tif(file == null)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\t//create the file with the associated file descriptor\n\t\telse\n\t\t{\n\t\t\tfileDescriptors[fileIndex] = file;\n\t\t\treturn fileIndex;\n\t\t}\n\t}", "public void setHandle(String handle) {\r\n this.handle = handle;\r\n }", "protected abstract long getCurrentBufferCapacity(long paramLong);", "AllocAlternative createAllocAlternative();", "@NativeType(\"bgfx_frame_buffer_handle_t\")\n public static short bgfx_create_frame_buffer_from_handles(@NativeType(\"bgfx_texture_handle_t const *\") ShortBuffer _handles, @NativeType(\"bool\") boolean _destroyTextures) {\n return nbgfx_create_frame_buffer_from_handles((byte)_handles.remaining(), memAddress(_handles), _destroyTextures);\n }", "protected TransactionOperation( String handle ) {\n this.handle = handle;\n }", "public static abstract interface Handle<T>\r\n/* 161: */ {\r\n/* 162: */ public abstract void recycle(T paramT);\r\n/* 163: */ }", "protected Structs(final long nativeHandle) {\n super(nativeHandle, new Disposer() {\n @Override\n public void disposeNative(long handle) {\n disposeNativeHandle(handle);\n }\n });\n }", "public int getHandle() {\n return m_handle;\n }", "abstract void allocateBuffers();", "public void createHandles() {\n\t\tList<Handle> handles = new ArrayList<Handle>();\n\n\t\tHandle centerHandle = new Handle(center, \"center\", MotionRestriction.None);\n\t\tHandle XRadiusHandle = new Handle(new Point2D.Double(center.x + radiusx, center.y), \"XRadius\", MotionRestriction.Horizontal);\n\t\tHandle YRadiusHandle = new Handle(new Point2D.Double(center.x, center.y + radiusy), \"YRadius\", MotionRestriction.Vertical);\n\n\t\thandles.add(centerHandle);\n\t\thandles.add(XRadiusHandle);\n\t\thandles.add(YRadiusHandle);\n\n\t\taddHandles(handles);\n\t}", "public void createHandles() {\n\t\tList<Handle> handles = new ArrayList<Handle>();\n\n\t\tHandle centerHandle = new Handle(center, \"center\", MotionRestriction.None);\n\t\tHandle XRadiusHandle = new Handle(new Point2D.Double(center.x + radiusx, center.y), \"XRadius\", MotionRestriction.Horizontal);\n\t\tHandle YRadiusHandle = new Handle(new Point2D.Double(center.x, center.y + radiusy), \"YRadius\", MotionRestriction.Vertical);\n\n\t\thandles.add(centerHandle);\n\t\thandles.add(XRadiusHandle);\n\t\thandles.add(YRadiusHandle);\n\n\t\taddHandles(handles);\n\t}", "protected abstract Buffer doCreateBuffer(byte[] data)\n throws BadParameterException, NoSuccessException;", "private native void finaliseHandle();", "void add(Recycler.DefaultHandle<?> handle)\r\n/* 275: */ {\r\n/* 276:300 */ Recycler.DefaultHandle.access$1102(handle, this.id);\r\n/* 277: */ \r\n/* 278:302 */ Link tail = this.tail;\r\n/* 279: */ int writeIndex;\r\n/* 280:304 */ if ((writeIndex = tail.get()) == Recycler.LINK_CAPACITY)\r\n/* 281: */ {\r\n/* 282:305 */ if (!reserveSpace(this.availableSharedCapacity, Recycler.LINK_CAPACITY)) {\r\n/* 283:307 */ return;\r\n/* 284: */ }\r\n/* 285:310 */ this.tail = (tail = tail.next = new Link(null));\r\n/* 286: */ \r\n/* 287:312 */ writeIndex = tail.get();\r\n/* 288: */ }\r\n/* 289:314 */ tail.elements[writeIndex] = handle;\r\n/* 290:315 */ Recycler.DefaultHandle.access$502(handle, null);\r\n/* 291: */ \r\n/* 292: */ \r\n/* 293:318 */ tail.lazySet(writeIndex + 1);\r\n/* 294: */ }", "public final Handle estimatorHandle() {\n if (this.estimatorHandle == null) {\n this.estimatorHandle = this.channel.config().getMessageSizeEstimator().newHandle();\n }\n return this.estimatorHandle;\n }", "ManagementLockObject create();", "public void setCurrentHandle( byte[] currentHandle );", "private static native long create_0(int mode);", "public DataBuffer createDataBuffer() {\n DataBuffer dataBuffer = null;\n\n int size = getBufferSize();\n switch (dataType) {\n case DataBuffer.TYPE_BYTE:\n dataBuffer = new DataBufferByte(size, numBanks);\n break;\n case DataBuffer.TYPE_USHORT:\n dataBuffer = new DataBufferUShort(size, numBanks);\n break;\n case DataBuffer.TYPE_SHORT:\n dataBuffer = new DataBufferShort(size, numBanks);\n break;\n case DataBuffer.TYPE_INT:\n dataBuffer = new DataBufferInt(size, numBanks);\n break;\n case DataBuffer.TYPE_FLOAT:\n dataBuffer = new DataBufferFloat(size, numBanks);\n break;\n case DataBuffer.TYPE_DOUBLE:\n dataBuffer = new DataBufferDouble(size, numBanks);\n break;\n }\n\n return dataBuffer;\n }", "public final T get()\r\n/* 120: */ {\r\n/* 121:147 */ if (this.maxCapacityPerThread == 0) {\r\n/* 122:148 */ return newObject(NOOP_HANDLE);\r\n/* 123: */ }\r\n/* 124:150 */ Stack<T> stack = (Stack)this.threadLocal.get();\r\n/* 125:151 */ DefaultHandle<T> handle = stack.pop();\r\n/* 126:152 */ if (handle == null)\r\n/* 127: */ {\r\n/* 128:153 */ handle = stack.newHandle();\r\n/* 129:154 */ handle.value = newObject(handle);\r\n/* 130: */ }\r\n/* 131:156 */ return handle.value;\r\n/* 132: */ }", "ByteBuffer allocate() {\n\t\tvar b = ByteBuffer.allocate(size).order(LITTLE_ENDIAN);\n\t\tb.putInt(ordinal());\n\t\treturn b;\n\t}", "ManagementLockObject create(Context context);", "protected StorageProxy createStorageProxy(int nativeStorageHandle, int status)\n {\n return new StorageProxyImpl(nativeStorageHandle, status);\n }", "public Buffer(int capacity) {\r\n\t\t\r\n\t\tthis.data = new int[capacity];\r\n\t\tthis.capacity = capacity;\r\n\t\tthis.size = 0;\r\n\t\tthis.cursor = 0;\r\n\t\t\r\n\t\tinitialize();\r\n\t}", "Promise.Completable<PooledObject<T>> createNew();", "synchronized ExerciseBuffer pinNew(String filename, PageFormatter fmtr) {\n\t ExerciseBuffer buff = chooseUnpinnedBuffer();\n if (buff == null)\n return null;\n Block blk=buff.assignToNew(filename, fmtr); // return the newly created block\n numAvailable--;\n buff.pin();\n \n if(bufferHashTable.containsValue(buff)){ //if value (buffer) is already exist then remove that key (blk) \n bufferHashTable.remove(blk); \n \n }\n bufferHashTable.put(blk, buff); // adding new key (blk) to HashTable\n \n return buff;\n }", "public String getHandle() {\r\n return handle;\r\n }", "public GlBuffer free(){\n\t\t//android.util.//Log.d(TAG,\"free()\");\n final int[] handles = new int[1];\n if(this.handle != UNBIND_HANDLE){\n handles[0] = this.handle;\n this.handle = UNBIND_HANDLE;\n GLES20.glDeleteBuffers(1, handles, 0);\n GlOperation.checkGlError(TAG, \"glDeleteBuffers\");\n }\n\n if(mVaoHandle != UNBIND_HANDLE){\n handles[0] = mVaoHandle;\n mVaoHandle = UNBIND_HANDLE;\n GLES30.glDeleteVertexArrays(1, handles, 0);\n GlOperation.checkGlError(TAG, \"glDeleteVertexArrays\");\n }\n\n\t\tif(mManagedBuffer && this.buffer != null){\n\t\t\tswitch(this.datatype){\n\t\t\t\tcase TYPE_BYTE :\n\t\t\t\t\tByteBufferPool.getInstance().returnDirectBuffer((ByteBuffer)this.buffer);\n\t\t\t\t\tmManagedBuffer = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TYPE_SHORT :\n\t\t\t\t\tByteBufferPool.getInstance().returnDirectBuffer((ShortBuffer)this.buffer);\n\t\t\t\t\tmManagedBuffer = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TYPE_INT :\n\t\t\t\t\tByteBufferPool.getInstance().returnDirectBuffer((IntBuffer)this.buffer);\n\t\t\t\t\tmManagedBuffer = false;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tByteBufferPool.getInstance().returnDirectBuffer((FloatBuffer)this.buffer);\n\t\t\t\t\tmManagedBuffer = false;\n\t\t\t}\n\t\t\tthis.buffer = null;\n\t\t}\n\t\tthis.size = 0;\n\t\treturn this;\n\t}", "public static Buffer createBuffer() throws BadParameterException,\n NoSuccessException {\n\treturn createBuffer((String)null);\n }", "public static Buffer createBuffer(int size) throws BadParameterException, \n NoSuccessException {\n\treturn createBuffer(null, size);\n }", "public static native void destroyHandle();", "public abstract T create() throws PoolException;", "private static MockFileChannel newMockFileChannel(\n long size,\n int localBufferCapacity) {\n return newMockFileChannel(\n true,\n true,\n false,\n size,\n localBufferCapacity);\n }", "SFTPv3FileHandle(SFTPv3Client client, byte[] h)\r\n\t{\r\n\t\tthis.client = client;\r\n\t\tthis.fileHandle = h;\r\n\t}", "public int getHandle()\n\t{\n\t\treturn mHandle;\n\t}", "public interface RecvByteBufAllocator {\n\n /**\n * Creates a new handle. The handle provides the actual operations and keeps the internal information which is\n * required for predicting an optimal buffer capacity.\n */\n Handle newHandle();\n\n interface Handle {\n /**\n * Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small\n * enough not to waste its space.\n */\n ByteBuf allocate(ByteBufAllocator alloc);\n\n /**\n * Similar to {@link #allocate(ByteBufAllocator)} except that it does not allocate anything but just tells the\n * capacity.\n */\n int guess();\n\n /**\n * Records the the actual number of read bytes in the previous read operation so that the allocator allocates\n * the buffer with potentially more correct capacity.\n *\n * @param actualReadBytes the actual number of read bytes in the previous read operation\n */\n void record(int actualReadBytes);\n }\n}", "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 }", "public static Output from(Pointer handle) {\n\t\tif (handle == null)\n\t\t\treturn null;\n\t\treturn new Output(handle);\n\t}", "public Productor(BufferContoler buff, Semaphore mutex, Semaphore empty, Semaphore full) {\n\t\tthis.buffer = buff;\n\t\tthis.mutex = mutex;\n\t\tthis.empty = empty;\n\t\tthis.full = full;\n\n\t}", "default Handler asHandler() {\n return new HandlerBuffer(this);\n }", "public static void bgfx_destroy_dynamic_index_buffer(@NativeType(\"bgfx_dynamic_index_buffer_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_dynamic_index_buffer;\n invokeCV(_handle, __functionAddress);\n }", "<C> ContentHandle<C> newHandle(Class<C> type);", "public String getHandle() {\n return this.handle;\n }", "private static BufferPoolMXBean createBufferPoolMXBean(BufferPool paramBufferPool)\n/* */ {\n/* 227 */ new BufferPoolMXBean() {\n/* */ private volatile ObjectName objname;\n/* */ \n/* */ public ObjectName getObjectName() {\n/* 231 */ ObjectName localObjectName = this.objname;\n/* 232 */ if (localObjectName == null) {\n/* 233 */ synchronized (this) {\n/* 234 */ localObjectName = this.objname;\n/* 235 */ if (localObjectName == null) {\n/* 236 */ localObjectName = Util.newObjectName(\"java.nio:type=BufferPool,name=\" + this.val$pool\n/* 237 */ .getName());\n/* 238 */ this.objname = localObjectName;\n/* */ }\n/* */ }\n/* */ }\n/* 242 */ return localObjectName;\n/* */ }\n/* */ \n/* */ public String getName() {\n/* 246 */ return this.val$pool.getName();\n/* */ }\n/* */ \n/* */ public long getCount() {\n/* 250 */ return this.val$pool.getCount();\n/* */ }\n/* */ \n/* */ public long getTotalCapacity() {\n/* 254 */ return this.val$pool.getTotalCapacity();\n/* */ }\n/* */ \n/* */ public long getMemoryUsed() {\n/* 258 */ return this.val$pool.getMemoryUsed();\n/* */ }\n/* */ };\n/* */ }", "public byte[] allocReadIOBuffer()\n/* */ {\n/* 146 */ _verifyAlloc(this._readIOBuffer);\n/* 147 */ return this._readIOBuffer = this._bufferRecycler.allocByteBuffer(0);\n/* */ }", "private OperationInfo getOperationInfo(QueryHandle handle) throws HandleNotFoundException {\n OperationInfo opInfo = activeHandleCache.getIfPresent(handle);\n if (opInfo != null) {\n return opInfo;\n }\n throw new HandleNotFoundException(\"Invalid handle provided\");\n }", "@Override\n\tpublic Structure createNew() {\n\t\treturn new FloorSwitch();\n\t}", "PiHandle handle();", "@Inline\n public static Address alloc(Address classHandle) {\n int objSize = VMHelper.getTypeSize(classHandle);\n int allocationHandle = VMHelper.getAllocationHandle(classHandle);\n return alloc(objSize, allocationHandle);\n }", "public static void bgfx_destroy_indirect_buffer(@NativeType(\"bgfx_indirect_buffer_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_indirect_buffer;\n invokeCV(_handle, __functionAddress);\n }", "public RingBuffer(int capacity){\n structure = new LinkedList<E>();\n this.capacity = capacity;\n }", "protected void initBuffer() throws IOException {\n if (buf != null) {\r\n Util.disposeDirectByteBuffer(buf);\r\n }\r\n // this check is overestimation:\r\n int size = bufferNumLength << Main.log2DataLength;\r\n assert (size > 0);\r\n if (Main.debug) { System.out.println(\"Allocating direct buffer of \"+bufferNumLength+\" ints.\"); }\r\n buf = ByteBuffer.allocateDirect(size).order(Main.byteOrder);\r\n buf.clear();\r\n }", "public ItemReference alloc();", "public LongStorage newSizeOf() {\n return new LongStorage(\n TH.THTensor_(newSizeOf)(this)\n );\n }", "public SwapChain(\n final DeviceContext deviceContext,\n final long surface,\n final long windowHandle\n ) {\n this.deviceContext = deviceContext;\n this.surface = surface;\n this.windowHandle = windowHandle;\n this.swapchain = VK_NULL_HANDLE;\n this.extent = VkExtent2D.malloc();\n this.cleanedUp = true;\n\n recreate();\n }", "@Override\n protected void releaseBuffer() {\n }", "private void handleCreateCommand() throws IOException,\r\n ClassNotFoundException,\r\n InstantiationException,\r\n IllegalAccessException {\r\n final String className = (String) m_in.readObject();\r\n Class klass = Class.forName(className, false, m_loader);\r\n final Object instance = klass.newInstance();\r\n final String handle = RemoteProxy.wrapInstance(instance);\r\n m_out.writeObject(handle);\r\n m_out.flush();\r\n }", "public static int createTextureHandle() {\n int[] textureDataHandle = new int[1];\n glGenTextures(1, textureDataHandle, 0);\n if (textureDataHandle[0] != 0) {\n return textureDataHandle[0];\n } else {\n throw new RuntimeException(\"Error generating texture handle.\");\n }\n }", "public void insert(Handle handle) {\n if (logicalSize + 1 > table.length / 2) {\n table = this.expandTable(table);\n }\n table = this.insertHelper(table, handle);\n logicalSize++;\n }", "CreateHandler()\n {\n }", "public void setHandle(ByteBuffer nativeBuffer){\n long handleAddr = getNativeAddress(nativeBuffer);\n if(handleAddr == this.nativeHandle){\n return;\n }\n nativeHandle = handleAddr;\n }" ]
[ "0.618816", "0.6158916", "0.5980845", "0.5843198", "0.5664781", "0.5611101", "0.5587276", "0.5491085", "0.54277444", "0.54200786", "0.53962666", "0.53875715", "0.53845215", "0.53820896", "0.53348345", "0.53101593", "0.53101593", "0.53101593", "0.52162194", "0.51811033", "0.5177267", "0.51683986", "0.516243", "0.51598483", "0.51598483", "0.51472616", "0.51472616", "0.51472616", "0.5115689", "0.5115689", "0.5109189", "0.5109189", "0.5109189", "0.50862676", "0.50248694", "0.4996778", "0.49955434", "0.4995062", "0.49643773", "0.49615598", "0.49199998", "0.49187392", "0.4915187", "0.48988897", "0.48806402", "0.48733094", "0.48704672", "0.48681456", "0.48636052", "0.48636052", "0.4853021", "0.4843866", "0.48437", "0.48431727", "0.483431", "0.48240837", "0.48134667", "0.48068285", "0.4806659", "0.4803115", "0.47946584", "0.4787131", "0.47817093", "0.4779598", "0.47692114", "0.4762624", "0.4762604", "0.47601894", "0.47566655", "0.4753214", "0.47347656", "0.4717035", "0.47169143", "0.4715477", "0.47009027", "0.46843067", "0.46837986", "0.46826822", "0.467392", "0.4667811", "0.46581233", "0.46500516", "0.46319506", "0.46282414", "0.46276397", "0.46191204", "0.4615998", "0.46149164", "0.46127126", "0.46092921", "0.46017373", "0.45927545", "0.45872837", "0.45713946", "0.456932", "0.45631155", "0.4555207", "0.45485672", "0.45396537", "0.45376518" ]
0.7163859
0
Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small enough not to waste its space.
ByteBuf allocate(ByteBufAllocator alloc);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void fillReceiveBuffer(final int requestedSize) {\n ByteBuffer readBuffer = receiveBuffer;\n if (requestedSize > receiveBuffer.capacity()) {\n readBuffer = socketService.getByteBuffer(requestedSize);\n readBuffer.put(receiveBuffer).flip();\n socketService.releaseByteBuffer(receiveBuffer);\n }\n receiveBuffer = null;\n socketHandle.read(readBuffer).addDeferrable(this, true);\n }", "public byte[] allocReadIOBuffer(int minSize)\n/* */ {\n/* 154 */ _verifyAlloc(this._readIOBuffer);\n/* 155 */ return this._readIOBuffer = this._bufferRecycler.allocByteBuffer(0, minSize);\n/* */ }", "public interface RecvByteBufAllocator {\n\n /**\n * Creates a new handle. The handle provides the actual operations and keeps the internal information which is\n * required for predicting an optimal buffer capacity.\n */\n Handle newHandle();\n\n interface Handle {\n /**\n * Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small\n * enough not to waste its space.\n */\n ByteBuf allocate(ByteBufAllocator alloc);\n\n /**\n * Similar to {@link #allocate(ByteBufAllocator)} except that it does not allocate anything but just tells the\n * capacity.\n */\n int guess();\n\n /**\n * Records the the actual number of read bytes in the previous read operation so that the allocator allocates\n * the buffer with potentially more correct capacity.\n *\n * @param actualReadBytes the actual number of read bytes in the previous read operation\n */\n void record(int actualReadBytes);\n }\n}", "@VisibleForTesting\n static int drainBuffer(BufferedReader br, StringBuffer storageBuf, int maxLength, int bytesRead, boolean readAll)\n throws IOException {\n int bReadSession = 0;\n int chunkSize = 1024;\n if (br.ready()) {\n char[] buf = new char[1024];\n int bReadCurrent;\n boolean wantsToReadFurther;\n do {\n bReadCurrent = br.read(buf, 0, chunkSize);\n if (storageBuf != null && bytesRead < maxLength && bReadCurrent != -1) {\n storageBuf.append(buf, 0, bReadCurrent);\n }\n if (bReadCurrent != -1) {\n bReadSession += bReadCurrent;\n }\n wantsToReadFurther = bReadCurrent != -1 && (readAll || bReadCurrent == chunkSize);\n } while (br.ready() && wantsToReadFurther);\n }\n return bReadSession;\n }", "public byte[] allocReadIOBuffer()\n/* */ {\n/* 146 */ _verifyAlloc(this._readIOBuffer);\n/* 147 */ return this._readIOBuffer = this._bufferRecycler.allocByteBuffer(0);\n/* */ }", "public ByteRingBuffer(int maxSize){\n buffer= new byte[maxSize];\n readIndex = 0;\n writeIndex = -1;\n size=0;\n }", "public byte[] receive (long timeout)\n throws IOException, IllegalArgumentException\n {\n int byteArraySize = getNextMessageSize (timeout);\n if (byteArraySize <= 0) {\n return null;\n }\n else {\n return receiveBuffer (timeout);\n }\n }", "public int getReceiveBufferSize() {\n return soRcvBuf;\n }", "private final byte[] readBuffer( int size ) throws IOException {\n byte[] buffer = new byte[ size ];\n\n int read = 0;\n while ( read < size ) {\n int next = dataSource.read( buffer, read, size - read );\n if ( next < 0 ) throw new IOException( \"End of Stream\" );\n read += next;\n\t}\n return buffer;\n }", "protected ByteBuffer createIntermediateBuffer(int minSize) {\n int capacity = Utils.getIntegerNetProperty(\n \"jdk.httpclient.websocket.intermediateBufferSize\", 16384);\n return ByteBuffer.allocate(Math.max(minSize, capacity));\n }", "abstract public Buffer createBufferFromData(byte[] data, int size);", "@Override\n\tpublic int getBufferSize() {\n\t\treturn 0;\n\t}", "private ByteBuf nextBufferForFrame(int bytesToRead) {\n ByteBuf buf = buffers.getFirst();\n ByteBuf frame;\n\n if (buf.readableBytes() > bytesToRead) {\n frame = buf.retain().readSlice(bytesToRead);\n totalSize -= bytesToRead;\n } else {\n frame = buf;\n buffers.removeFirst();\n totalSize -= frame.readableBytes();\n }\n\n return frame;\n }", "public int getBufferSize() {\n\t\treturn 0;\n\t}", "int getBufferSize();", "@Override\n public int getBufferSize() {\n return 0;\n }", "private ByteBuf nextBufferForFrame(int bytesToRead) {\n ByteBuf buf = buffers.getFirst();\n ByteBuf frame;\n\n if (buf.readableBytes() > bytesToRead) {\n frame = buf.retain().readSlice(bytesToRead);\n totalSize -= bytesToRead;\n } else {\n frame = buf;\n buffers.removeFirst();\n totalSize -= frame.readableBytes();\n }\n\n return frame;\n }", "protected abstract long getCurrentBufferCapacity(long paramLong);", "private int ensureBuffer(int offset, int length) throws IOException {\n\t\tfinal int lastPos = offset + length - 1;\n\t\tfinal int desiredSize = ((lastPos / BUFFER_SIZE) + 1) * BUFFER_SIZE;\n\t\tfinal int currentSize = this.buffer.length;\n\n\t\tif (desiredSize > currentSize) {\n\t\t\tfinal byte[] readBuffer = new byte[desiredSize - currentSize];\n\t\t\tfinal int count = this.in.read(readBuffer);\n\n\t\t\tif (count > 0) {\n\t\t\t\tfinal byte[] newBuffer = new byte[currentSize + count];\n\t\t\t\tSystem.arraycopy(this.buffer, 0, newBuffer, 0, currentSize);\n\t\t\t\tSystem.arraycopy(readBuffer, 0, newBuffer, currentSize, count);\n\t\t\t\tthis.buffer = newBuffer;\n\t\t\t}\n\t\t\treturn (lastPos < this.buffer.length) ? length : length - (lastPos - this.buffer.length + 1);\n\t\t}\n\t\treturn length;\n\t}", "public ConsumptionStatus consumeBuffer() {\n\t\tif (status == ConsumptionStatus.BUFFERED){\n\t\t\tString buffered = newBuffer;\n\t\t\tnewBuffer = null;\n\t\t\tstatus = ConsumptionStatus.EMPTY;\n\t\t\tconsumeLine(buffered);\n\t\t\treturn status;\n\t\t}else {\n\t\t\tthrow new IllegalStateException(\"There is no buffer to consume.\");\n\t\t}\n\t}", "@Override\n\tpublic Receive createReceive() {\n\t\treturn receiveBuilder()\n\t\t\t\t.match(LargeMessage.class, this::handle)\n\t\t\t\t.match(byte[].class, this::handle)\n\t\t\t\t.match(BytesMessage.class, this::handle)\n\t\t\t\t.matchAny(object -> this.log().info(\"Received unknown message: \\\"{}\\\"\", object.toString()))\n\t\t\t\t.build();\n\t}", "protected abstract Buffer doCreateBuffer(int size)\n throws BadParameterException, NoSuccessException;", "public int getReceiveBufferSize()\r\n/* 99: */ {\r\n/* 100: */ try\r\n/* 101: */ {\r\n/* 102:131 */ return this.javaSocket.getReceiveBufferSize();\r\n/* 103: */ }\r\n/* 104: */ catch (SocketException e)\r\n/* 105: */ {\r\n/* 106:133 */ throw new ChannelException(e);\r\n/* 107: */ }\r\n/* 108: */ }", "public static Buffer createBuffer(int size) throws BadParameterException, \n NoSuccessException {\n\treturn createBuffer(null, size);\n }", "private void createIntBuffer(long sizeOfBuffer) {\n\t\t\tFile bufferFile = createMappedBufferFile();\n\t\t\ttry {\n\t\t\t\trandomAccessFile = new RandomAccessFile(bufferFile,\n\t\t\t\t\t\treadWriteMode);\n\t\t\t\toutChan = randomAccessFile.getChannel();\n\t\t\t\tlong size = (sizeOfBuffer > 0) ? sizeOfBuffer\n\t\t\t\t\t\t: MAXIMUM_BYTES_PER_BLOCK;\n\t\t\t\tintBuffer = outChan.map(MapMode.READ_WRITE, 0, size)\n\t\t\t\t\t\t.asIntBuffer();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public Buffer(int capacity) {\r\n\t\t\r\n\t\tthis.data = new int[capacity];\r\n\t\tthis.capacity = capacity;\r\n\t\tthis.size = 0;\r\n\t\tthis.cursor = 0;\r\n\t\t\r\n\t\tinitialize();\r\n\t}", "protected void ensureBufferSpace(int expectedAdditions) {\n final int bufferLen = (buffer == null ? 0 : buffer.length);\n if (elementsCount + expectedAdditions > bufferLen) {\n final int newSize = resizer.grow(bufferLen, elementsCount, expectedAdditions);\n assert newSize >= elementsCount + expectedAdditions : \"Resizer failed to\" + \" return sensible new size: \"\n + newSize + \" <= \" + (elementsCount + expectedAdditions);\n\n this.buffer = Arrays.copyOf(buffer, newSize);\n }\n }", "private ByteBuffer grow(int length) {\n if (!mBuffers.isEmpty()) {\n ByteBuffer b = mBuffers.peekLast();\n if (b.limit() + length < b.capacity()) {\n b.mark();\n b.position(b.limit());\n b.limit(b.limit() + length);\n remaining += length;\n return b.order(order);\n }\n }\n\n ByteBuffer ret = obtain(length);\n ret.mark();\n ret.limit(length);\n add(ret);\n\n return ret.order(order);\n }", "public RingBuffer(int capacity){\n structure = new LinkedList<E>();\n this.capacity = capacity;\n }", "public ByteBuf capacity(int newCapacity)\r\n/* 745: */ {\r\n/* 746:754 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 747:755 */ return super.capacity(newCapacity);\r\n/* 748: */ }", "protected int populateBuffer()\n {\n interlock.beginReading();\n // System.out.println(\"populateBuffer: 2\");\n return byteBuffer.limit();\n }", "private void receive() throws IOException {\n byte[] lengthBuffer = new byte[4];\n dataInput.readFully(lengthBuffer);\n int length = Utilities.getIntFromByte(lengthBuffer, 0);\n pipedOutputStream.write(Utilities.getBytes(length));\n\n //now read the data indicated by length and write it to buffer\n byte[] buffer = new byte[length];\n dataInput.readFully(buffer);\n pipedOutputStream.write(buffer);\n pipedOutputStream.flush();\n clientBlocker();\n }", "public interface ProductionBuffer {\n\t\n\tpublic int getMaxBufferSize();\n\t\n\tpublic int getCurrentBufferSize();\n\t\n\tpublic boolean isFull();\n\t\n\tpublic boolean isEmpty();\n\t\n\t//Add to the back of the buffer\n\tpublic boolean add(BufferSlot bs);\n\t\n\t//Remove from the front of the buffer\n\tpublic BufferSlot remove();\n\t\n\t//empties the buffer\n\tpublic void clear();\n\n}", "public Builder setReadBufferSize(int readBufferSize) {\n readBufferSize_ = Arguments.requirePositiveOrZero(readBufferSize, \"readBufferSize\");\n return this;\n }", "public IBuffer newBuffer();", "public RcClient readBufferSize(int readBufferSize) {\n this.readBufferSize = readBufferSize;\n return this;\n }", "private void grow(int minCapacity) {\n // overflow-conscious code\n int oldCapacity = buf.length;\n int newCapacity = oldCapacity << 1;\n if (newCapacity - minCapacity < 0) {\n newCapacity = minCapacity;\n }\n if (newCapacity - MAX_ARRAY_SIZE > 0) {\n newCapacity = hugeCapacity(minCapacity);\n }\n buf = Arrays.copyOf(buf, newCapacity);\n }", "private DataInputStream readBuffer( DataInputStream in, int count ) throws IOException{\n byte[] buffer = new byte[ count ];\n int read = 0;\n while( read < count ){\n int input = in.read( buffer, read, count-read );\n if( input < 0 )\n throw new EOFException();\n read += input;\n }\n \n ByteArrayInputStream bin = new ByteArrayInputStream( buffer );\n DataInputStream din = new DataInputStream( bin );\n return din;\n }", "protected abstract void getAtLeastBytes(ByteBuffer inputBuffer, int len) throws IOException;", "public SocketChannelConfig setReceiveBufferSize(int receiveBufferSize)\r\n/* 202: */ {\r\n/* 203: */ try\r\n/* 204: */ {\r\n/* 205:211 */ this.javaSocket.setReceiveBufferSize(receiveBufferSize);\r\n/* 206: */ }\r\n/* 207: */ catch (SocketException e)\r\n/* 208: */ {\r\n/* 209:213 */ throw new ChannelException(e);\r\n/* 210: */ }\r\n/* 211:215 */ return this;\r\n/* 212: */ }", "public ByteBuffer toBuffer() {\n return ByteBuffer.wrap(buf, 0, count);\n }", "private final int copyBufferedBytes(ByteList dst, int len) {\n int bytesCopied = 0;\n \n dst.ensure(Math.min(len, bufferedInputBytesRemaining()));\n \n if (bytesCopied < len && ungotc != -1) {\n ++bytesCopied;\n dst.append((byte) ungotc);\n ungotc = -1;\n }\n \n //\n // Copy out any buffered bytes\n //\n if (bytesCopied < len && buffer.hasRemaining()) {\n int n = Math.min(buffer.remaining(), len - bytesCopied);\n dst.append(buffer, n);\n bytesCopied += n;\n }\n \n return bytesCopied;\n }", "private static void assertEnsureBufferSizeExpandsToMaxBufferSize(final boolean exceedMaxBufferSize) {\n final int length = 0;\n\n final long presumableFreeMemory = getPresumableFreeMemory();\n // 2GiB + 32 KiB + length\n // 2GiB: Buffer to allocate\n // 32KiB: Some headroom\n // length: Existing buffer\n final long estimatedMemory = (1L << 31) + 32 * 1024 + length;\n assumeTrue(presumableFreeMemory > estimatedMemory, \"Not enough free memory for the test\");\n\n final int max = Integer.MAX_VALUE - 8;\n\n // Check the conservative maximum buffer size can actually be exceeded by the VM\n // otherwise the test is not valid.\n if (exceedMaxBufferSize) {\n assumeCanAllocateBufferSize(max + 1);\n // Free-memory.\n // This may not be necessary as the byte[] is now out of scope\n System.gc();\n }\n\n final BaseNCodec ncodec = new NoOpBaseNCodec();\n final Context context = new Context();\n\n // Allocate the initial buffer\n context.buffer = new byte[length];\n context.pos = length;\n // Compute the extra to reach or exceed the max buffer size\n int extra = max - length;\n if (exceedMaxBufferSize) {\n extra++;\n }\n ncodec.ensureBufferSize(extra, context);\n assertTrue(context.buffer.length >= length + extra);\n }", "public int readBufferSize_() {\n return readBufferSize_;\n }", "public void resize( final AtomicInteger _newMaxMessageSize ) {\n\n // if we're asking for a smaller (or same) sized buffer, just leave...\n int newMaxMessageSize = _newMaxMessageSize.get();\n if( newMaxMessageSize <= maxMessageSize ) return;\n\n // allocate new buffer of the right size...\n maxMessageSize = newMaxMessageSize;\n ByteBuffer newBuffer = allocateBuffer();\n\n // copy any bytes we already have into the new one...\n newBuffer.put( buffer );\n newBuffer.flip();\n buffer = newBuffer;\n }", "@Override\n public synchronized void receive(ByteBuffer src) {\n super.receive(src);\n if (!src.hasRemaining())\n return; // nothing to receive\n receiveOutbound(src);\n }", "private byte[] consumePayload() throws IOException {\n byte[] payload = new byte[(int) payloadLength];\n int count = 0;\n while (payloadLength > 0L) {\n payload[count] = (byte) this.read();\n count++;\n }\n return payload;\n }", "@Nonnull\r\n\tpublic static <T> Observable<List<T>> buffer(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\tfinal int bufferSize) {\r\n\t\treturn new Buffer.WithSizeSkip<T>(source, bufferSize, bufferSize);\r\n\t}", "void setBufferSize(int bufferSize);", "public void trimToSize() {\n if (size() != this.buffer.length) {\n this.buffer = toArray();\n }\n }", "abstract public Buffer createBuffer();", "protected MpscOffHeapFixedSizeRingBuffer(final ByteBuffer buff, final int capacity,\n final boolean isProducer, final boolean isConsumer, final boolean initialize,\n final int messageSize) {\n\n int actualCapacity = Pow2.roundToPowerOfTwo(capacity);\n this.messageSize = messageSize + MESSAGE_INDICATOR_SIZE;\n this.buffy = alignedSlice(4 * JvmInfo.CACHE_LINE_SIZE + (actualCapacity * (this.messageSize)),\n JvmInfo.CACHE_LINE_SIZE, buff);\n\n long alignedAddress = UnsafeDirectByteBuffer.getAddress(buffy);\n // Layout of the RingBuffer (assuming 64b cache line):\n // consumerIndex(8b), pad(56b) |\n // pad(64b) |\n // producerIndex(8b), consumerIndexCache(8b), pad(48b) |\n // pad(64b) |\n // buffer (capacity * messageSize)\n this.consumerIndexAddress = alignedAddress;\n this.producerIndexAddress = this.consumerIndexAddress + 2 * JvmInfo.CACHE_LINE_SIZE;\n this.consumerIndexCacheAddress = this.producerIndexAddress + 8;\n this.bufferAddress = alignedAddress + HEADER_SIZE;\n this.mask = actualCapacity - 1;\n // producer owns tail and headCache\n if (isProducer && initialize) {\n soConsumerIndexCache(0);\n soProducerIndex(0);\n // mark all messages as null\n for (int i = 0; i < actualCapacity; i++) {\n final long offset = offsetForIndex(i);\n readyIndicator(offset);\n }\n }\n // consumer owns head and tailCache\n if (isConsumer && initialize) {\n soConsumerIndex(0);\n }\n }", "public static Buffer createBuffer(String sagaFactoryClassname, int size) throws BadParameterException, \n NoSuccessException {\n\tBufferFactory factory = getFactory(sagaFactoryClassname);\n return factory.doCreateBuffer(size);\n }", "int readNonBlocking(byte[] buffer, int offset, int length);", "public DataBuffer createDataBuffer() {\n DataBuffer dataBuffer = null;\n\n int size = getBufferSize();\n switch (dataType) {\n case DataBuffer.TYPE_BYTE:\n dataBuffer = new DataBufferByte(size, numBanks);\n break;\n case DataBuffer.TYPE_USHORT:\n dataBuffer = new DataBufferUShort(size, numBanks);\n break;\n case DataBuffer.TYPE_SHORT:\n dataBuffer = new DataBufferShort(size, numBanks);\n break;\n case DataBuffer.TYPE_INT:\n dataBuffer = new DataBufferInt(size, numBanks);\n break;\n case DataBuffer.TYPE_FLOAT:\n dataBuffer = new DataBufferFloat(size, numBanks);\n break;\n case DataBuffer.TYPE_DOUBLE:\n dataBuffer = new DataBufferDouble(size, numBanks);\n break;\n }\n\n return dataBuffer;\n }", "private byte[] truncate(ByteBuffer buffer, int length) {\n assert length < buffer.remaining();\n byte[] array = new byte[length];\n buffer.get(array);\n return array;\n }", "private void fillBuf(int need) throws IOException {\n\n\t\tif (count > pos) {\n\t\t\tSystem.arraycopy(buf, pos, buf, 0, count - pos);\n\t\t\tcount -= pos;\n\t\t\tneed -= count;\n\t\t\tpos = 0;\n\t\t} else {\n\t\t\tcount = 0;\n\t\t\tpos = 0;\n\t\t}\n\n\t\twhile (need > 0) {\n\n\t\t\tint len = in.read(buf, count, buf.length - count);\n\t\t\tif (len <= 0) {\n\t\t\t\tthrow new EOFException();\n\t\t\t}\n\t\t\tcount += len;\n\t\t\tneed -= len;\n\t\t}\n\n\t}", "public ArrayRingBuffer(int capacity) {\n Buffer_num = capacity;\n rb =(T[]) new Object[Buffer_num];\n fillCount = 0;\n first = 0;\n last = 0;\n }", "private void readMoreBytesFromStream() throws IOException {\n if (!innerStreamHasMoreData) {\n return;\n }\n\n int bufferSpaceAvailable = buffer.length - bytesInBuffer;\n if (bufferSpaceAvailable <= 0) {\n return;\n }\n\n int bytesRead =\n stream.read(buffer, bytesInBuffer, bufferSpaceAvailable);\n\n if (bytesRead == -1) {\n innerStreamHasMoreData = false;\n } else {\n bytesInBuffer += bytesRead;\n }\n }", "private final int copyBufferedBytes(ByteBuffer dst) {\n final int bytesToCopy = dst.remaining();\n \n if (ungotc != -1 && dst.hasRemaining()) {\n dst.put((byte) ungotc);\n ungotc = -1;\n }\n \n if (buffer.hasRemaining() && dst.hasRemaining()) {\n \n if (dst.remaining() >= buffer.remaining()) {\n //\n // Copy out any buffered bytes\n //\n dst.put(buffer);\n \n } else {\n //\n // Need to clamp source (buffer) size to avoid overrun\n //\n ByteBuffer tmp = buffer.duplicate();\n tmp.limit(tmp.position() + dst.remaining());\n dst.put(tmp);\n buffer.position(tmp.position());\n }\n }\n \n return bytesToCopy - dst.remaining();\n }", "public abstract boolean receive(byte[] buffer, int size, int timeout) throws InterruptedIOException;", "public Buffer getEmptyBuffer()\n {\n // System.out.println(getClass().getName()+\":: getEmptyBuffer\");\n\n switch (protocol)\n {\n case ProtocolPush:\n if (!isEmptyBufferAvailable() && reset)\n return null;\n reset = false;\n return circularBuffer.getEmptyBuffer();\n case ProtocolSafe:\n synchronized (circularBuffer)\n {\n reset = false;\n while (!reset && !isEmptyBufferAvailable())\n {\n try\n {\n circularBuffer.wait();\n } catch (Exception e)\n {\n }\n }\n if (reset)\n return null;\n Buffer buffer = circularBuffer.getEmptyBuffer();\n circularBuffer.notifyAll();\n return buffer;\n }\n\n default:\n throw new RuntimeException();\n }\n }", "private void receive() {\r\n\t\ttry {\r\n\t\t\trcvpkt = filter.read();\t\t\t\t\t\t\t// Simulates Transfer-Failures and Errors in the received data\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "protected byte[] receive() throws CommunicationException {\n try {\n byte[] result = new byte[0];\n int count;\n do {\n byte[] frame = new byte[FRAME_SIZE];\n count = in.read(frame);\n result = Bytes.concat(result, Arrays.copyOf(frame, count));\n } while (count >= FRAME_SIZE);\n log.info(\"Receive: {} bytes | {} | {}\", result.length, BytesUtils.bytesToHex(result, ' '), new String(result));\n return result;\n } catch (IOException e) {\n throw new CommunicationException(\"Receiving error\", e);\n }\n }", "private int _readMore(InputStream in, byte[] readBuffer, int inputPtr, int inputEnd, int maxRead)\n/* */ throws IOException\n/* */ {\n/* 1580 */ int i = 0;\n/* 1581 */ while (inputPtr < inputEnd) {\n/* 1582 */ readBuffer[(i++)] = readBuffer[(inputPtr++)];\n/* */ }\n/* 1584 */ inputPtr = 0;\n/* 1585 */ inputEnd = i;\n/* 1586 */ maxRead = Math.min(maxRead, readBuffer.length);\n/* */ do\n/* */ {\n/* 1589 */ int length = maxRead - inputEnd;\n/* 1590 */ if (length == 0) {\n/* */ break;\n/* */ }\n/* 1593 */ int count = in.read(readBuffer, inputEnd, length);\n/* 1594 */ if (count < 0) {\n/* 1595 */ return inputEnd;\n/* */ }\n/* 1597 */ inputEnd += count;\n/* 1598 */ } while (inputEnd < 3);\n/* 1599 */ return inputEnd;\n/* */ }", "public <T> ArrayBlockingQueue<T> create(int size){\n return new ArrayBlockingQueue<T>(size);\n }", "public RealBuffer copyOf()\n {\n float[] copy = Arrays.copyOf(mSamples, mSamples.length);\n\n return new RealBuffer(copy);\n }", "private RecordBuffer prepareRecordBuffer(ScanStrategy strategy, NetFlow flowInterface) {\n if (strategy == null) {\n throw new IllegalArgumentException(\"Expected ScanStrategy instance, got null\");\n }\n\n if (flowInterface == null) {\n throw new IllegalArgumentException(\"Expected NetFlow instance, got null\");\n }\n\n // Depending on different strategy we either skip file directly, return full buffer or records,\n // or return filtering buffer, if there is a FilterScan.\n boolean isCompressed = header.isCompressed();\n int recordSize = flowInterface.recordSize();\n\n if (strategy.skipScan()) {\n log.info(\"Skip scan based on strategy \" + strategy);\n return new EmptyRecordBuffer();\n } else if (strategy.fullScan()) {\n log.info(\"Full scan based on strategy \" + strategy + \", ignoreCorrupt=\" + ignoreCorrupt);\n // wrap into closeable iterator\n return new ScanRecordBuffer(in, strategy.getRecordMaterializer(), recordSize, byteOrder,\n isCompressed, bufferLength, ignoreCorrupt);\n } else {\n log.info(\"Filter scan based on strategy \" + strategy + \", ignoreCorrupt=\" + ignoreCorrupt);\n return new FilterRecordBuffer(in, strategy.getRecordMaterializer(), recordSize, byteOrder,\n isCompressed, bufferLength, ignoreCorrupt);\n }\n }", "private void ensureCapacity(int newCapacity) {\n\t\t\t data = Arrays.copyOf(data, newCapacity * 2);\n\t\t\t this.capacity = newCapacity * 2;\n\t\t }", "private static void buffer() {\n\t\tSystem.out.println(\"bafor\"+Runtime.getRuntime().freeMemory());\n\t\tByteBuffer mBuffer=ByteBuffer.allocate(10240000);\n\t\tSystem.out.println(\"bafor\"+Runtime.getRuntime().freeMemory());\n// mBuffer.clear();\n System.out.println(\"bafor\"+Runtime.getRuntime().freeMemory());\n\t}", "private E newBufferPoll(E[] nextBuffer, long index)\r\n/* 200: */ {\r\n/* 201:451 */ long offset = newBufferAndOffset(nextBuffer, index);\r\n/* 202:452 */ E n = UnsafeRefArrayAccess.lvElement(nextBuffer, offset);\r\n/* 203:453 */ if (n == null) {\r\n/* 204:455 */ throw new IllegalStateException(\"new buffer must have at least one element\");\r\n/* 205: */ }\r\n/* 206:457 */ UnsafeRefArrayAccess.soElement(nextBuffer, offset, null);\r\n/* 207:458 */ soConsumerIndex(index + 2L);\r\n/* 208:459 */ return n;\r\n/* 209: */ }", "@Override\n\tpublic void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {\n\t\tByteBuf buf = (ByteBuf) msg;\n\t\tSystem.out.println(\"有新的数据,长度:\" + buf.readableBytes());\n\n\t\tif (msgbuf.getDatalen() > 0) {\n\t\t\tint ablelen = buf.readableBytes();\n\n\t\t\tint leftlen = msgbuf.getDatalen() - msgbuf.getDatarev();\n\t\t\tSystem.out.println(\"接着上次预读取:\" + leftlen + \"长度数据\");\n\n\t\t\tif (leftlen > ablelen) {\n\n\t\t\t\tSystem.out.println(\"数据长度小于所要的长度,全部写入\");\n\n\t\t\t\tint oldlimit=msgbuf.getDatabuf().limit();\n\t\t\t\tmsgbuf.getDatabuf().limit(msgbuf.getDatarev()+ablelen);\n\t\t\t\tbuf.getBytes(0, msgbuf.getDatabuf());\n\t\t\t\tmsgbuf.setDatarev(msgbuf.getDatarev() + ablelen);\n\t\t\t\tmsgbuf.getDatabuf().limit(oldlimit);\n\t\t\t} else {\n\n\t\t\t\tbuf.getBytes(0, msgbuf.getDatabuf());\n\n\t\t\t\tSystem.out.println(\"预取长度小于缓冲长度,获取全部包,分发消息\");\n\n\t\t\t\t// 读完了数据,处理了\n\t\t\t\treadFinished(ctx, msgbuf.getDatabuf());\n\t\t\t\tmsgbuf.reSet();\n\n\t\t\t\tif (leftlen < ablelen) {\n\n\t\t\t\t\tSystem.out.println(String.format(\"leftlen长%d,缓冲长度%d,还有数据,接着读下一个包\", leftlen, ablelen));\n\t\t\t\t\tprepareRead(ctx, buf, leftlen);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(String.format(\"leftlen长%d,缓冲长度%d,没有数据了\", leftlen, ablelen));\n\t\t\t\t}\n\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"msgbuf没有指定长度,按新包处理\");\n\t\t\tprepareRead(ctx, buf, 0);\n\t\t}\n\t\t\n\t\tbuf.clear();\n\t}", "public PacketInputStream ()\n {\n _buffer = ByteBuffer.allocate(INITIAL_BUFFER_CAPACITY);\n }", "private int getInput() {\n final boolean debug = false;\n int toRead;\n int result;\n int nread;\n\n // if (checkForDeadChannel()) return EINVAL;\n\n // Skipped pushback processing code for stacked Channels\n\n\n // See if we can fill an existing buffer. If we can, read only\n // as much as will fit in it. Otherwise allocate a new buffer,\n // add it to the input queue and attempt to fill it to the max.\n\n ChannelBuffer buf = inQueueTail;\n\n if ((buf != null) && (buf.nextAdded < buf.bufLength)) {\n if (debug) {\n System.out.println(\"smaller than buffer\");\n }\n toRead = buf.bufLength - buf.nextAdded;\n\t} else {\n if (debug) {\n System.out.println(\"fits in existing buffer\");\n }\n\n buf = saveInBuf;\n saveInBuf = null;\n\n // Check the actual buffersize against the requested\n // buffersize. Buffers which are smaller than requested are\n // squashed. This is done to honor dynamic changes of the\n // buffersize made by the user.\n\n if ((buf != null) && ((buf.bufLength - buf.BUFFER_PADDING) < bufSize)) {\n buf = null;\n }\n if (buf == null) {\n if (debug) {\n System.out.println(\"allocated ChannelBuffer of size \" + bufSize);\n }\n buf = new ChannelBuffer(bufSize);\n }\n buf.next = null;\n\n // Use the actual size of the buffer to determine\n // the number of bytes to read from the channel and not the\n // size for new buffers. They can be different if the\n // buffersize was changed between reads.\n\n toRead = buf.bufLength - buf.nextAdded;\n if (debug) {\n System.out.println(\"toRead set to \" + toRead);\n }\n\n if (inQueueTail == null) {\n inQueueHead = buf;\n } else {\n inQueueTail.next = buf;\n }\n\n inQueueTail = buf;\n }\n\n // If EOF is set, we should avoid calling the driver because on some\n // platforms it is impossible to read from a device after EOF.\n\n if (eofCond) {\n if (debug) {\n System.out.println(\"eofCond was true, no error return\");\n }\n return 0;\n }\n\n // FIXME: We do not handle non-blocking or this CHANNEL_TIMER_FEV flag yet\n\n if (/*CHANNEL_TIMER_FEV &&*/\n !blocking) {\n return TclPosixException.EWOULDBLOCK;\n } else {\n result = 0;\n\n // Can we even use this for a brain-dead nonblocking IO check?\n int numAvailable = /*input.available();*/ 0;\n\n if (!blocking && (numAvailable < toRead)) {\n result = TclPosixException.EWOULDBLOCK;\n nread = -1;\n } else {\n try {\n if (debug) {\n System.out.println(\"now to read \" + toRead + \" bytes\");\n }\n\n nread = input.read(buf.buf, buf.nextAdded, toRead);\n\n // read() returns -1 on EOF\n if (nread == -1) {\n if (debug) {\n System.out.println(\"got EOF from read() call\");\n }\n nread = 0;\n }\n } catch (IOException ex) {\n // FIXME: How do we recover from IO errors here?\n // I think we need to set result to a POSIX error\n ex.printStackTrace(System.err);\n nread = -1;\n }\n }\n }\n\n if (nread > 0) {\n if (debug) {\n System.out.println(\"nread is \" + nread);\n }\n buf.nextAdded += nread;\n\n // should avoid calling the driver because on some platforms we\n // will block in the low level reading code even though the\n // channel is set into nonblocking mode.\n\n if (nread < toRead) {\n blocked = true;\n }\n } else if (nread == 0) {\n eofCond = true;\n encodingEnd = true;\n if (debug) {\n System.out.println(\"nread is zero, eofCond set, encodingEnd set\");\n }\n } else if (nread < 0) {\n if (debug) {\n System.out.println(\"nread is \" + nread);\n }\n if ((result == TclPosixException.EWOULDBLOCK) ||\n (result == TclPosixException.EAGAIN)) {\n blocked = true;\n\t result = TclPosixException.EAGAIN;\n\t }\n // FIXME: Called needs to raise a TclException\n //Tcl_SetErrno(result);\n return result;\n }\n if (debug) {\n System.out.println(\"no error return\");\n }\n return 0;\n }", "protected OffHeapFixedMessageSizeRingBuffer(final ByteBuffer buff,\n final int capacity,\n final boolean isProducer,\n final boolean isConsumer,\n final boolean initialize,\n final int primitiveMessageSize,\n final Object[] references,\n final int referenceMessageSize) {\n if (references != null && references.length < referenceMessageSize) {\n throw new IllegalArgumentException(\"Reference array of length \" + references.length\n + \" is insufficient to store a single message of size \" + referenceMessageSize);\n }\n\n int actualCapacity = Pow2.roundToPowerOfTwo(capacity);\n // message size is aligned to indicator size, this ensure atomic writes of indicator\n this.messageSize = (int) Pow2.align(primitiveMessageSize + MESSAGE_INDICATOR_SIZE, MESSAGE_INDICATOR_SIZE);\n this.buffy = alignedSlice(HEADER_SIZE + (actualCapacity * (this.messageSize)), CACHE_LINE_SIZE, buff);\n\n long alignedAddress = UnsafeDirectByteBuffer.getAddress(buffy);\n if (alignedAddress % CACHE_LINE_SIZE != 0) {\n throw new IllegalStateException(\"buffer is expected to be cache line aligned by now\");\n }\n // Layout of the RingBuffer (assuming 64b cache line):\n // consumerIndex(8b), pad(56b) |\n // pad(64b) |\n // producerIndex(8b), pad(56b) |\n // pad(64b) |\n // buffer (capacity * messageSize)\n this.consumerIndexAddress = alignedAddress;\n this.producerIndexAddress = this.consumerIndexAddress + 2l * CACHE_LINE_SIZE;\n this.bufferAddress = alignedAddress + HEADER_SIZE;\n this.mask = actualCapacity - 1;\n\n this.references = references;\n this.referenceMessageSize = referenceMessageSize;\n\n // producer owns tail and headCache\n if (isProducer && initialize) {\n soProducerIndex(0);\n // mark all messages as READY\n for (int i = 0; i < actualCapacity; i++) {\n final long offset = offsetForIndex(i);\n readReleaseState(offset);\n }\n }\n // consumer owns head\n if (isConsumer && initialize) {\n soConsumerIndex(0);\n }\n }", "private void ensureReadNonBuffered() throws IOException, BadDescriptorException {\n if (reading) {\n if (buffer.hasRemaining()) {\n Ruby localRuntime = getRuntime();\n if (localRuntime != null) {\n throw localRuntime.newIOError(\"sysread for buffered IO\");\n } else {\n throw new IOException(\"sysread for buffered IO\");\n }\n }\n } else {\n // libc flushes writes on any read from the actual file, so we flush here\n flushWrite();\n buffer.clear();\n buffer.flip();\n reading = true;\n }\n }", "private final int copyBufferedBytes(byte[] dst, int off, int len) {\n int bytesCopied = 0;\n \n if (ungotc != -1 && len > 0) {\n dst[off++] = (byte) ungotc;\n ungotc = -1;\n ++bytesCopied;\n }\n \n final int n = Math.min(len - bytesCopied, buffer.remaining());\n buffer.get(dst, off, n);\n bytesCopied += n;\n \n return bytesCopied;\n }", "@Override\n public Receive createReceive() {\n return receiveBuilder()\n .match(StartMessage.class, this::handle)\n .match(BatchMessage.class, this::handle)\n .match(Terminated.class, this::handle)\n .match(RegistrationMessage.class, this::handle)\n .match(Availability.class, this::handle)\n .match(Result.class, this::handle)\n .matchAny(object -> this.log().info(\"Received unknown message: \\\"{}\\\"\", object.toString()))\n .build();\n }", "private void initReadBlockingTask(int size){ \n for (int i=0; i < size; i++){\n getReadTasks().offer(newReadBlockingTask(false));\n }\n }", "public PacketBuilder(int capacity) {\n\t\tbuffer = ByteBuffer.allocate(capacity);\n\t}", "public void setMaxCapacity(int max) {\n\t\tbuffer = new Object[max];\n\t\tbufferSize = 0;\n\t}", "synchronized A consume() {\n try {\r\n if ((noMore && slack >= 0) || consumedAll) {\r\n notifyAll();\r\n consumedAll = true;\r\n return null;\r\n }\r\n while (slack != -1) {\r\n wait();\r\n }\r\n A tmp;\r\n\r\n int bSize = CodecUtil.slackOrSize(consumerBuffer, codec);\r\n if(bSize < 0 && endOfStream) {\r\n bSize = Math.abs(bSize);\r\n }\r\n if (bSize <= 0) {\r\n slack = Math.abs(bSize);\r\n notifyAll();\r\n return null;\r\n }\r\n tmp = codec.from(consumerBuffer);\r\n totConsumed += bSize;\r\n notifyAll();\r\n return tmp;\r\n }\r\n catch (InterruptedException e) {\r\n }\r\n return null;\r\n }", "private int readChunkSize(int desired) {\n return Math.min(availableFirst(), desired);\n }", "public byte[] getBuffer( int size )\n {\n byte [] result = null;\n \n if (size < 0)\n {\n throw new INTERNAL (\"Unable to cache and create buffer of negative size. Possible overflow issue.\");\n }\n \n final int log = calcLog(size);\n \n if (log > maxManagedBufferSize)\n {\n try\n {\n if (time < 0)\n {\n // Defaults to returning asked for size\n result = new byte[size];\n }\n else\n {\n synchronized(this)\n {\n // Using cache so do below determination\n if (bufferMax == null || bufferMax.length < size)\n {\n // Autocache really large values for speed\n bufferMax = new byte[size];\n }\n // Else return the cached buffer\n result = bufferMax;\n bufferMax = null;\n }\n }\n }\n catch (OutOfMemoryError e)\n {\n throw new NO_MEMORY(e.toString());\n }\n }\n else\n {\n int index = (log > MIN_CACHE ? log - MIN_CACHE : 0);\n final Collection s = bufferPool[index];\n result = doFetchBuffer(s);\n \n if (result == null)\n {\n // .. = 1 << MIN_CACHE + 1\n // 64 = 1 << 5 + 1\n // 128 = 1 << 6 + 1\n // 255 = 1 << 7 + 1\n // 512 = 1 << 8 + 1\n // 1024 = 1 << 9 + 1\n // 2048 = 1 << 10 + 1\n result = new byte[ ( log > MIN_CACHE ? 1 << log + 1 : 1024 ) - 1];\n }\n }\n return result;\n }", "public EntityBuffer(int bufferCapacity) {\n\t\tbuffer = new DataPostbox<EntityContainer>(bufferCapacity);\n\t}", "protected void initBuffer() throws IOException {\n if (buf != null) {\r\n Util.disposeDirectByteBuffer(buf);\r\n }\r\n // this check is overestimation:\r\n int size = bufferNumLength << Main.log2DataLength;\r\n assert (size > 0);\r\n if (Main.debug) { System.out.println(\"Allocating direct buffer of \"+bufferNumLength+\" ints.\"); }\r\n buf = ByteBuffer.allocateDirect(size).order(Main.byteOrder);\r\n buf.clear();\r\n }", "@Override\n public ByteBuffer readInput(int minBytes) throws IOException {\n if (minBytes <= byteBuffer.remaining())\n return byteBuffer;\n else\n throw new EOFException(\"Cannot read more bytes - end of buffer reached\");\n }", "public static void checkShortCircuitReadBufferSize(final Configuration conf) {\n final int defaultSize = HConstants.DEFAULT_BLOCKSIZE * 2;\n final int notSet = -1;\n // DFSConfigKeys.DFS_CLIENT_READ_SHORTCIRCUIT_BUFFER_SIZE_KEY is only defined in h2\n final String dfsKey = \"dfs.client.read.shortcircuit.buffer.size\";\n int size = conf.getInt(dfsKey, notSet);\n // If a size is set, return -- we will use it.\n if (size != notSet) return;\n // But short circuit buffer size is normally not set. Put in place the hbase wanted size.\n int hbaseSize = conf.getInt(\"hbase.\" + dfsKey, defaultSize);\n conf.setIfUnset(dfsKey, Integer.toString(hbaseSize));\n }", "private void recycleBuffer(ChannelBuffer buf, boolean mustDiscard) {\n\n if (mustDiscard)\n return;\n\n // Only save buffers which are at least as big as the requested\n // buffersize for the channel. This is to honor dynamic changes\n // of the buffersize made by the user.\n\n if ((buf.bufLength - buf.BUFFER_PADDING) < bufSize) {\n return;\n }\n\n if (inQueueHead == null) {\n inQueueHead = buf;\n inQueueTail = buf;\n\n buf.nextRemoved = buf.BUFFER_PADDING;\n buf.nextAdded = buf.BUFFER_PADDING;\n buf.next = null;\n return;\n }\n if (saveInBuf == null) {\n saveInBuf = buf;\n\n buf.nextRemoved = buf.BUFFER_PADDING;\n buf.nextAdded = buf.BUFFER_PADDING;\n buf.next = null;\n return;\n }\n }", "public byte[] readBytes() {\n\t\tif (bufferIndex == bufferLast)\n\t\t\treturn null;\n\n\t\tsynchronized (buffer) {\n\t\t\tint length = bufferLast - bufferIndex;\n\t\t\tbyte outgoing[] = new byte[length];\n\t\t\tSystem.arraycopy(buffer, bufferIndex, outgoing, 0, length);\n\n\t\t\tbufferIndex = 0; // rewind\n\t\t\tbufferLast = 0;\n\t\t\treturn outgoing;\n\t\t}\n\t}", "@SuppressWarnings( \"unused\" )\n public int capacity() {\n return buffer.capacity() - buffer.limit();\n }", "private static void AssureRecieve(ClientManager clientManager, tangible.RefObject<byte[]> buffer, long size) {\n int bytesRecieved = 0;\n int totalBytesReceived = 0;\n\n do {\n try {\n bytesRecieved = clientManager.getClientSocket().getInputStream().read(buffer.argvalue, totalBytesReceived, (int) (size - totalBytesReceived));\n totalBytesReceived += bytesRecieved;\n\n clientManager.AddToClientsBytesRecieved(bytesRecieved);\n\n if (SocketServer.getIsServerCounterEnabled()) {\n SocketServer.getPerfStatsColl().incrementBytesReceivedPerSecStats(bytesRecieved);\n SocketServer.getPerfStatsColl().incrementByteReceivePerSecStatsBy(bytesRecieved);\n }\n } catch (Exception se) {\n }\n } while (totalBytesReceived < size && bytesRecieved > 0);\n if (buffer.argvalue.length != size) {\n byte[] bite = new byte[totalBytesReceived];\n System.arraycopy(buffer.argvalue, 0, bite, 0, totalBytesReceived);\n buffer.argvalue = bite;\n }\n\n }", "private int fillBuffer() throws IOException {\r\n int n = super.read(buffer, 0, BUF_SIZE);\r\n if (n >= 0) {\r\n file_pos +=n;\r\n buf_end = n;\r\n buf_pos = 0;\r\n }\r\n return n;\r\n }", "public int receive (byte []buffer, int offset, int length)\n throws IOException,IllegalArgumentException,IndexOutOfBoundsException\n {\n if (length == 0) {\n return 0;\n }\n if (offset < 0) {\n throw new java.lang.IndexOutOfBoundsException();\n }\n if (length < 0) {\n throw new java.lang.IndexOutOfBoundsException();\n }\n if ((offset + length) > buffer.length) {\n throw new java.lang.IndexOutOfBoundsException();\n }\n return receiveNative (buffer, offset, length, 0);\n }", "synchronized void receive(int preknownDataLength) throws EOFException, IOException {\n byte[] buffer = new byte[preknownDataLength];\n dataInput.readFully(buffer);\n pipedOutputStream.write(buffer);\n }", "public int getMaxBufferSize() {\n return maxBufferSize;\n }", "@Override\n\tpublic void setBufferSize(int size) {\n\t}", "public ByteBuf capacity(int newCapacity)\r\n/* 87: */ {\r\n/* 88:122 */ checkNewCapacity(newCapacity);\r\n/* 89: */ \r\n/* 90:124 */ int oldCapacity = this.array.length;\r\n/* 91:125 */ byte[] oldArray = this.array;\r\n/* 92:126 */ if (newCapacity > oldCapacity)\r\n/* 93: */ {\r\n/* 94:127 */ byte[] newArray = allocateArray(newCapacity);\r\n/* 95:128 */ System.arraycopy(oldArray, 0, newArray, 0, oldArray.length);\r\n/* 96:129 */ setArray(newArray);\r\n/* 97:130 */ freeArray(oldArray);\r\n/* 98: */ }\r\n/* 99:131 */ else if (newCapacity < oldCapacity)\r\n/* 100: */ {\r\n/* 101:132 */ byte[] newArray = allocateArray(newCapacity);\r\n/* 102:133 */ int readerIndex = readerIndex();\r\n/* 103:134 */ if (readerIndex < newCapacity)\r\n/* 104: */ {\r\n/* 105:135 */ int writerIndex = writerIndex();\r\n/* 106:136 */ if (writerIndex > newCapacity) {\r\n/* 107:137 */ writerIndex(writerIndex = newCapacity);\r\n/* 108: */ }\r\n/* 109:139 */ System.arraycopy(oldArray, readerIndex, newArray, readerIndex, writerIndex - readerIndex);\r\n/* 110: */ }\r\n/* 111: */ else\r\n/* 112: */ {\r\n/* 113:141 */ setIndex(newCapacity, newCapacity);\r\n/* 114: */ }\r\n/* 115:143 */ setArray(newArray);\r\n/* 116:144 */ freeArray(oldArray);\r\n/* 117: */ }\r\n/* 118:146 */ return this;\r\n/* 119: */ }", "public int getMaxBufferSize() {\r\n return maxBufferSize;\r\n }", "public InMemoryQueueService(){\n this.ringBufferQueue = new QueueMessage[10000];\n }" ]
[ "0.72177523", "0.62623674", "0.6019303", "0.57656986", "0.5759958", "0.5663622", "0.56524754", "0.5607777", "0.560289", "0.55889267", "0.55781174", "0.55470073", "0.5534051", "0.5515581", "0.5493077", "0.54751796", "0.5458943", "0.54286075", "0.5423685", "0.5384768", "0.5373317", "0.5370475", "0.5307387", "0.5290832", "0.5269668", "0.52652574", "0.5253444", "0.5229464", "0.5220978", "0.521467", "0.5212491", "0.5201399", "0.515963", "0.5157967", "0.51522124", "0.514684", "0.51444393", "0.51438785", "0.5138609", "0.5138577", "0.5118515", "0.51158607", "0.5115677", "0.5077247", "0.50664866", "0.50660795", "0.5053806", "0.5025835", "0.5022455", "0.501216", "0.5010392", "0.50077623", "0.49854803", "0.49656513", "0.49654788", "0.49627864", "0.49566388", "0.49460942", "0.49449664", "0.4942558", "0.49406034", "0.4939608", "0.49366975", "0.49280944", "0.49130428", "0.49080515", "0.49078298", "0.49037224", "0.4903435", "0.49026167", "0.48926625", "0.48923597", "0.48922938", "0.48864", "0.48746485", "0.48697382", "0.48586327", "0.48437494", "0.48391593", "0.4829286", "0.48291072", "0.48247027", "0.48215812", "0.48154753", "0.48153332", "0.48090938", "0.48084217", "0.4799125", "0.47876227", "0.4783244", "0.4783104", "0.47793525", "0.47757852", "0.47707966", "0.47685593", "0.47684625", "0.47616136", "0.47604895", "0.47553226", "0.4751352" ]
0.4834252
79
Records the the actual number of read bytes in the previous read operation so that the allocator allocates the buffer with potentially more correct capacity.
void record(int actualReadBytes);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected int populateBuffer()\n {\n interlock.beginReading();\n // System.out.println(\"populateBuffer: 2\");\n return byteBuffer.limit();\n }", "public final int bytesConsumed() {\n/* 218 */ return this.bytesConsumed;\n/* */ }", "public int getBufferSize() {\n return count;\n }", "private final int bufferedOutputSpaceRemaining() {\n return !reading ? buffer.remaining() : 0;\n }", "public int nioBufferCount()\r\n/* 697: */ {\r\n/* 698:706 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 699:707 */ return super.nioBufferCount();\r\n/* 700: */ }", "int getBytesRead() {\n \treturn _read + _o;\n }", "private int fillBuffer() throws IOException {\r\n int n = super.read(buffer, 0, BUF_SIZE);\r\n if (n >= 0) {\r\n file_pos +=n;\r\n buf_end = n;\r\n buf_pos = 0;\r\n }\r\n return n;\r\n }", "int getBytesInBufferAvailable() {\n if (this.count == this.pos) return 0;\n else return this.buf.length - this.pos;\n }", "public int readBufferSize_() {\n return readBufferSize_;\n }", "public int size() { return buffer.length; }", "public long currentReadBytes()\r\n/* 209: */ {\r\n/* 210:398 */ return this.currentReadBytes.get();\r\n/* 211: */ }", "private final int bufferedInputBytesRemaining() {\n return reading ? (buffer.remaining() + (ungotc != -1 ? 1 : 0)) : 0;\n }", "public int getRecordSize() {\n\t\treturn this.buffer.getRecordSize();\n\t\t}", "public long cumulativeReadBytes()\r\n/* 229: */ {\r\n/* 230:426 */ return this.cumulativeReadBytes.get();\r\n/* 231: */ }", "public long lastReadLength() {\n return lastReadLength;\n }", "public int getReadLength() {\r\n \t\treturn readLength;\r\n \t}", "public int getBufferSize() {\n\t\treturn 0;\n\t}", "public long lastReadBytes()\r\n/* 199: */ {\r\n/* 200:384 */ return this.lastReadBytes;\r\n/* 201: */ }", "public long getByteCount()\n {\n return written;\n }", "public final int getRecordSize()\n\t{\n\t\treturn tarBuffer.getRecordSize();\n\t}", "@Override\n public abstract long getReceivedBytesCount();", "int getBufferSize();", "@Override\n public int available() throws IOException {\n return fileSize - nextChunkPos + (count - pos);\n }", "@Override\n\tpublic int getBufferSize() {\n\t\treturn 0;\n\t}", "public int getNbr_read() {\r\n\t\treturn nbrRead;\r\n\t}", "int getNumBufferedBytes() {\n ChannelBuffer buf;\n int IOQueued;\n for (IOQueued = 0, buf = inQueueHead;\n buf != null; buf = buf.next) {\n IOQueued += buf.nextAdded - buf.nextRemoved;\n }\n return IOQueued;\n }", "public int getBufferSize() {\n\t\treturn buffer.length;\n\t}", "public native long getReceivedByteCount()\n throws IOException, IllegalArgumentException;", "public int nioBufferCount()\r\n/* 295: */ {\r\n/* 296:309 */ return 1;\r\n/* 297: */ }", "protected void ensureBufferSpace(int expectedAdditions) {\n final int bufferLen = (buffer == null ? 0 : buffer.length);\n if (elementsCount + expectedAdditions > bufferLen) {\n final int newSize = resizer.grow(bufferLen, elementsCount, expectedAdditions);\n assert newSize >= elementsCount + expectedAdditions : \"Resizer failed to\" + \" return sensible new size: \"\n + newSize + \" <= \" + (elementsCount + expectedAdditions);\n\n this.buffer = Arrays.copyOf(buffer, newSize);\n }\n }", "private void readMoreBytesFromStream() throws IOException {\n if (!innerStreamHasMoreData) {\n return;\n }\n\n int bufferSpaceAvailable = buffer.length - bytesInBuffer;\n if (bufferSpaceAvailable <= 0) {\n return;\n }\n\n int bytesRead =\n stream.read(buffer, bytesInBuffer, bufferSpaceAvailable);\n\n if (bytesRead == -1) {\n innerStreamHasMoreData = false;\n } else {\n bytesInBuffer += bytesRead;\n }\n }", "@SuppressWarnings( \"unused\" )\n public int capacity() {\n return buffer.capacity() - buffer.limit();\n }", "public long getReadCounter () {\n\t\treturn readCounter;\n\t}", "@Override\n public int size() {\n return (totalSize - offset);\n }", "@Override\n public int getBufferSize() {\n return 0;\n }", "public int getCurrentSize() {\n return count;\n }", "@Override\n\tpublic int available() throws IOException {\n\t\treturn buf.readableBytes();\n\t}", "private void updateByteCount(int n) {\n\t\tif (byteCount + n > (buffer.length << 3)) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tbyteCount += n;\n\t\tif (byteCount == (buffer.length << 3)) {\n\t\t\tflush();\n\t\t}\n\t}", "protected final int readBytes()\n throws IOException\n {\n _inputPtr = 0;\n _inputEnd = 0;\n if (_inputSource != null) {\n int count = _inputSource.read(_inputBuffer, 0, _inputBuffer.length);\n if (count > 0) {\n _inputEnd = count;\n }\n return count;\n }\n return -1;\n }", "public long length() {\r\n return 1 + 4 + buffer.length;\r\n }", "@Override\n\tpublic int recordSize() {\n\t\treturn 42;\n\t}", "protected int readNumRecordsHeader() throws IOException {\n file.seek(NUM_RECORDS_HEADER_LOCATION);\n return file.readInt();\n }", "public void write() {\n/* 1062 */ this.cbSize = size();\n/* 1063 */ super.write();\n/* */ }", "@Override\n public long getSize() {\n return allocatedSize;\n }", "@Override\n\tpublic int read() {\n\t\treturn super.read();\n\t}", "public int getRecordSize()\n {\n return 4 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 4;\n }", "public native long memoryConsumed();", "@Override\n\tpublic long bytesRead() {\n\t\treturn 0;\n\t}", "public static int size_reading() {\n return (16 / 8);\n }", "public int availableBytes()\n throws IOException {\n\n // Do not know the available byte count\n return -1;\n }", "private int readBufferedContentInto(ByteBuffer byteBuffer) {\n long bytesToSkip = positionForNextRead - positionInGrpcStream;\n\n if (bytesToSkip >= bufferedContent.size()) {\n positionInGrpcStream += bufferedContent.size();\n invalidateBufferedContent();\n return 0;\n }\n\n if (bytesToSkip > 0) {\n positionInGrpcStream += bytesToSkip;\n bufferedContent = bufferedContent.substring(Math.toIntExact(bytesToSkip));\n }\n\n int bytesToWrite = Math.min(byteBuffer.remaining(), bufferedContent.size());\n put(bufferedContent, 0, bytesToWrite, byteBuffer);\n positionInGrpcStream += bytesToWrite;\n positionForNextRead += bytesToWrite;\n\n if (bytesToWrite < bufferedContent.size()) {\n bufferedContent = bufferedContent.substring(bytesToWrite);\n } else {\n invalidateBufferedContent();\n }\n\n return bytesToWrite;\n }", "@VisibleForTesting\n static int drainBuffer(BufferedReader br, StringBuffer storageBuf, int maxLength, int bytesRead, boolean readAll)\n throws IOException {\n int bReadSession = 0;\n int chunkSize = 1024;\n if (br.ready()) {\n char[] buf = new char[1024];\n int bReadCurrent;\n boolean wantsToReadFurther;\n do {\n bReadCurrent = br.read(buf, 0, chunkSize);\n if (storageBuf != null && bytesRead < maxLength && bReadCurrent != -1) {\n storageBuf.append(buf, 0, bReadCurrent);\n }\n if (bReadCurrent != -1) {\n bReadSession += bReadCurrent;\n }\n wantsToReadFurther = bReadCurrent != -1 && (readAll || bReadCurrent == chunkSize);\n } while (br.ready() && wantsToReadFurther);\n }\n return bReadSession;\n }", "private int ensureBuffer(int offset, int length) throws IOException {\n\t\tfinal int lastPos = offset + length - 1;\n\t\tfinal int desiredSize = ((lastPos / BUFFER_SIZE) + 1) * BUFFER_SIZE;\n\t\tfinal int currentSize = this.buffer.length;\n\n\t\tif (desiredSize > currentSize) {\n\t\t\tfinal byte[] readBuffer = new byte[desiredSize - currentSize];\n\t\t\tfinal int count = this.in.read(readBuffer);\n\n\t\t\tif (count > 0) {\n\t\t\t\tfinal byte[] newBuffer = new byte[currentSize + count];\n\t\t\t\tSystem.arraycopy(this.buffer, 0, newBuffer, 0, currentSize);\n\t\t\t\tSystem.arraycopy(readBuffer, 0, newBuffer, currentSize, count);\n\t\t\t\tthis.buffer = newBuffer;\n\t\t\t}\n\t\t\treturn (lastPos < this.buffer.length) ? length : length - (lastPos - this.buffer.length + 1);\n\t\t}\n\t\treturn length;\n\t}", "protected abstract long getCurrentBufferCapacity(long paramLong);", "long sizeInc() {\n\t\treturn Storage.adrToOffset(adr) + size;\n\t}", "public ByteBuf capacity(int newCapacity)\r\n/* 745: */ {\r\n/* 746:754 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 747:755 */ return super.capacity(newCapacity);\r\n/* 748: */ }", "private int loadData() {\n if (position >= numRecords * 2)\n return -1;\n int bufferPos = 0;\n int capacity = byteBuffer.capacity();\n while (bufferPos < capacity && position < numRecords * 2) {\n long curRecordAddress = sortedArray.get(position);\n int recordLen = Platform.getInt(null, curRecordAddress);\n // length + keyprefix + record length\n int length = Integer.BYTES + Long.BYTES + recordLen;\n if (length > capacity) {\n logger.error(\"single record size exceeds PMem read buffer. Please increase buffer size.\");\n }\n if (bufferPos + length <= capacity) {\n long curKeyPrefix = sortedArray.get(position + 1);\n if (length > bytes.length) {\n bytes = new byte[length];\n }\n Platform.putLong(bytes, Platform.BYTE_ARRAY_OFFSET, curKeyPrefix);\n Platform.copyMemory(null, curRecordAddress, bytes, Platform.BYTE_ARRAY_OFFSET + Long.BYTES, length - Long.BYTES);\n byteBuffer.put(bytes, 0, length);\n bufferPos += length;\n position += 2;\n } else {\n break;\n }\n }\n return bufferPos;\n }", "public native long memoryRemaining();", "public int getBufferLength() {\n return this.bufferLength;\n }", "public int available() throws IOException {\n int ret = 0;\n for(IoBuffer buf : data) {\n ret += buf.remaining();\n }\n return ret;\n }", "public int getRecordSize()\r\n\t{\r\n\t\treturn recordSize;\r\n\t}", "public long getRecordSize ( ) {\r\n\t\treturn 113;\r\n\t}", "@Override\n public long ramBytesUsed() {\n ensureOpen();\n return sizeInBytes.get();\n }", "public synchronized int getNumRecords() {\n return memIndex.size();\n }", "public int getBufferSize() {\n return this.response.getBufferSize();\n }", "public long cumulativeWrittenBytes()\r\n/* 224: */ {\r\n/* 225:419 */ return this.cumulativeWrittenBytes.get();\r\n/* 226: */ }", "public long currentWrittenBytes()\r\n/* 214: */ {\r\n/* 215:405 */ return this.currentWrittenBytes.get();\r\n/* 216: */ }", "int getByteCount() {\n\t\treturn byteCount;\n\t}", "public int read() throws IOException {\n if (!started) {\n start();\n }\n if (buffer == null)\n return -1;\n if (bufpos == buflen) {\n buffer = refreshBuffer();\n if (buffer == null)\n return -1;\n }\n return 0xFF & buffer[bufpos++];\n }", "public int getSize() throws Exception {\n return header.getSize()+super.getSize();\n }", "public int getRecordLength()\n {\n return recordLength;\n }", "public synchronized int getOutputCount() {\n return buffers.length;\n }", "public ByteBuf readBytes(int length)\r\n/* 459: */ {\r\n/* 460:472 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 461:473 */ return super.readBytes(length);\r\n/* 462: */ }", "private int readChunkSize(int desired) {\n return Math.min(availableFirst(), desired);\n }", "public ByteBuf retain(int increment)\r\n/* 929: */ {\r\n/* 930:934 */ this.leak.record();\r\n/* 931:935 */ return super.retain(increment);\r\n/* 932: */ }", "@Override\n public int read() throws IOException {\n int r = -1;\n \n if (encryptedDataBuffer!=null && pos>=encryptedDataBuffer.length && !closed)\n fillBuffer();\n \n if (encryptedDataBuffer!=null && pos<encryptedDataBuffer.length)\n r = (int)encryptedDataBuffer[pos++]; // next element in the buffer\n return r;\n }", "@Override\n public int read() throws IOException {\n if (pos >= count) {\n fill();\n if (pos >= count) {\n return -1;\n }\n }\n checkIfClosed();\n return buf[pos++] & 0xFF;\n }", "@Override\r\n\tpublic int getBufferPercentage() {\n\t\treturn 0;\r\n\t}", "public synchronized long size() {\n return IDX_START_OF_CONTENT + (slots * bytesPerSlot);\n }", "@Override\n public int read(byte[] bytes, int offset, int count) throws IOException {\n return updateBytesRead(super.read(bytes, offset, count));\n }", "public int getProcessedDataOffset() { return 0; }", "public int getCurrentRecordCount() {\n return mStoredRecordCount;\n }", "@Override\n\tpublic int remainingCapacity() {\n\t\treturn 0;\n\t}", "public int amountOfBuffs() {\r\n return buffs.size();\r\n }", "public int readBytes(GatheringByteChannel out, int length)\r\n/* 508: */ throws IOException\r\n/* 509: */ {\r\n/* 510:520 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 511:521 */ return super.readBytes(out, length);\r\n/* 512: */ }", "public int numberOfBytes() {\n return this.data.size();\n }", "public interface RecvByteBufAllocator {\n\n /**\n * Creates a new handle. The handle provides the actual operations and keeps the internal information which is\n * required for predicting an optimal buffer capacity.\n */\n Handle newHandle();\n\n interface Handle {\n /**\n * Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small\n * enough not to waste its space.\n */\n ByteBuf allocate(ByteBufAllocator alloc);\n\n /**\n * Similar to {@link #allocate(ByteBufAllocator)} except that it does not allocate anything but just tells the\n * capacity.\n */\n int guess();\n\n /**\n * Records the the actual number of read bytes in the previous read operation so that the allocator allocates\n * the buffer with potentially more correct capacity.\n *\n * @param actualReadBytes the actual number of read bytes in the previous read operation\n */\n void record(int actualReadBytes);\n }\n}", "long sizeInBytes() throws IOException;", "@Override\n public int getCurrentRecordsProcessed() {\n return 0;\n }", "@Override\n\tpublic int getBufferPercentage() {\n\t\treturn 0;\n\t}", "public long lastWrittenBytes()\r\n/* 204: */ {\r\n/* 205:391 */ return this.lastWrittenBytes;\r\n/* 206: */ }", "public abstract long bytesWritten();", "@Override\n\tpublic long size() {\n\t\treturn this.currentLength.get();\n\t}", "public String getBufferEndCounter() {\r\n\t\treturn bufferEndCounter;\r\n\t}", "long getSize() throws IOException {\n return fileRWAccessSize.get();\n }", "public int read() throws IOException {\n int result = super.read();\n if(iMaxSet) {\n iRemainder--;\n } else {\n iRemainder = available();\n }\n return result;\n }", "@Override\n protected int update(byte[] array, int off, int count) throws IOException {\n int mark = (int)limit;\n \n if(count >= limit) {\n append(array, off, mark);\n finished = true;\n limit = 0;\n return count - mark;\n } \n if(count > 0) {\n append(array, off, count);\n limit -= count; \n }\n return 0;\n }", "public ByteBuf capacity(int newCapacity)\r\n/* 87: */ {\r\n/* 88:122 */ checkNewCapacity(newCapacity);\r\n/* 89: */ \r\n/* 90:124 */ int oldCapacity = this.array.length;\r\n/* 91:125 */ byte[] oldArray = this.array;\r\n/* 92:126 */ if (newCapacity > oldCapacity)\r\n/* 93: */ {\r\n/* 94:127 */ byte[] newArray = allocateArray(newCapacity);\r\n/* 95:128 */ System.arraycopy(oldArray, 0, newArray, 0, oldArray.length);\r\n/* 96:129 */ setArray(newArray);\r\n/* 97:130 */ freeArray(oldArray);\r\n/* 98: */ }\r\n/* 99:131 */ else if (newCapacity < oldCapacity)\r\n/* 100: */ {\r\n/* 101:132 */ byte[] newArray = allocateArray(newCapacity);\r\n/* 102:133 */ int readerIndex = readerIndex();\r\n/* 103:134 */ if (readerIndex < newCapacity)\r\n/* 104: */ {\r\n/* 105:135 */ int writerIndex = writerIndex();\r\n/* 106:136 */ if (writerIndex > newCapacity) {\r\n/* 107:137 */ writerIndex(writerIndex = newCapacity);\r\n/* 108: */ }\r\n/* 109:139 */ System.arraycopy(oldArray, readerIndex, newArray, readerIndex, writerIndex - readerIndex);\r\n/* 110: */ }\r\n/* 111: */ else\r\n/* 112: */ {\r\n/* 113:141 */ setIndex(newCapacity, newCapacity);\r\n/* 114: */ }\r\n/* 115:143 */ setArray(newArray);\r\n/* 116:144 */ freeArray(oldArray);\r\n/* 117: */ }\r\n/* 118:146 */ return this;\r\n/* 119: */ }", "public long lastReadThroughput()\r\n/* 189: */ {\r\n/* 190:370 */ return this.lastReadThroughput;\r\n/* 191: */ }", "public byte[] allocReadIOBuffer()\n/* */ {\n/* 146 */ _verifyAlloc(this._readIOBuffer);\n/* 147 */ return this._readIOBuffer = this._bufferRecycler.allocByteBuffer(0);\n/* */ }" ]
[ "0.6838334", "0.6750948", "0.65591335", "0.6548127", "0.6412514", "0.63901734", "0.6362348", "0.6265807", "0.62506044", "0.62202233", "0.6139472", "0.6123994", "0.6093656", "0.6088947", "0.60835797", "0.60438704", "0.6036929", "0.60299754", "0.6025093", "0.60212064", "0.5971326", "0.595296", "0.59227425", "0.5914006", "0.58842933", "0.587215", "0.58593446", "0.5842689", "0.5832368", "0.58192825", "0.580165", "0.5786747", "0.5764475", "0.5763422", "0.5755424", "0.57540697", "0.5740835", "0.5737133", "0.5727598", "0.57158875", "0.5694696", "0.5671112", "0.5667866", "0.56410044", "0.5637078", "0.56359637", "0.5632371", "0.5620214", "0.56074196", "0.5600873", "0.55987644", "0.55869925", "0.5577044", "0.55762076", "0.5572237", "0.55715436", "0.5563888", "0.55592257", "0.55560756", "0.5543595", "0.55414367", "0.5541373", "0.5538056", "0.55195117", "0.5519056", "0.550942", "0.5507695", "0.5500157", "0.54980403", "0.549629", "0.5480128", "0.54789966", "0.54763097", "0.54698867", "0.54653156", "0.54643744", "0.5460003", "0.54588735", "0.54567415", "0.5452039", "0.54486936", "0.54302907", "0.5428862", "0.54130936", "0.5403952", "0.54002327", "0.5398625", "0.5396912", "0.53929955", "0.53912336", "0.5390802", "0.53904015", "0.5389679", "0.53812075", "0.5379331", "0.53773546", "0.53740317", "0.53705007", "0.5362469", "0.5348081" ]
0.6996694
0
/ renamed from: a
private C11138i<T> m28808a() { C11138i<T> iVar = this.f28973g; if (iVar != null) { return iVar; } C11138i<T> a = this.f28969c.mo32447a(this.f28971e, this.f28970d); this.f28973g = a; return a; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: a
public static TypeAdapterFactory m28807a(C11261a<?> aVar, Object obj) { return new C11210c(obj, aVar, aVar.getType() == aVar.getRawType(), null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
This interface defines the process output handler which is used to update the fax job based on the process output information.
public interface ProcessOutputHandler { /** * Updates the fax job based on the data from the process output. * * @param faxClientSpi * The fax client SPI * @param faxJob * The fax job object * @param processOutput * The process output * @param faxActionType * The fax action type */ public void updateFaxJob(FaxClientSpi faxClientSpi,FaxJob faxJob,ProcessOutput processOutput,FaxActionType faxActionType); /** * This function extracts the fax job status from the process output. * * @param faxClientSpi * The fax client SPI * @param processOutput * The process output * @return The fax job status */ public FaxJobStatus getFaxJobStatus(FaxClientSpi faxClientSpi,ProcessOutput processOutput); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void processOutput() {\n\n\t}", "public abstract void onProcess();", "public void invokeOutFlowHandlers(ProcessContext processContext) throws GFacException;", "@Override\n\t\t\tpublic void onProcess(int process) {\n\t\t\t}", "public void updateFaxJob(FaxClientSpi faxClientSpi,FaxJob faxJob,ProcessOutput processOutput,FaxActionType faxActionType);", "public interface WorkProcessChangesHandler {\n\t\t/**\n\t\t * Called when new processes are added to existing Jobs. This method \n\t\t * can be called multiple times. It is called for each Job whose process(es)\n\t\t * were added. \n\t\t * \n\t\t * @param newJobProcessMap - Map containing new processes\n\t\t * @param newJobProcessMapToUpdate - local Process Map to update\n\t\t */\n\t\tpublic void onNewWorkProcesses(IDuccWork work, ICommandLine commandLine, Map<DuccId, IDuccProcess> newWorkProcessMap, Map<DuccId, IDuccProcess> newWorkProcessMapToUpdate);\n\t\t/**\n\t\t * Called when removed processes are detected. This method can be called \n\t\t * multiple times. It is called for each Job whose process(es) where removed.\n\t\t * \n\t\t * @param removedJobProcessMap - Map containing removed processes \n\t\t * @param newJobProcessMapToUpdate - local Process Map to update\n\t\t */\n\t\tpublic void onRemovedWorkProcesses(DuccId jobId, Map<DuccId, IDuccProcess> removedWorkProcessMap, Map<DuccId, IDuccProcess> newWorkProcessMapToUpdate);\n\t\t/**\n\t\t * Called when a Process in both Process Maps has a different internal state. That\n\t\t * can be due to assigned PID, status, etc. This method is called once per each\n\t\t * process that has a different state in both Maps. \n\t\t * \n\t\t * @param left - Process with a new internal state\n\t\t * @param right - local Process which must be sync'ed with left\n\t\t */\n\t\tpublic void onProcessChanges(IDuccWork job, IDuccProcess left, IDuccProcess right);\n\t}", "@Override\r\n\tpublic void onOutput(OutputEvent arg0) {\n\t\toutput = arg0.getMsg();\r\n\t}", "public interface Outputable {\n void onOutput(String output, int id);\n}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "public void process() {\n\t}", "public void process() {\n\n }", "public void process();", "public void reInvokeOutFlowHandlers(ProcessContext processContext) throws GFacException;", "default void process(Input input, Output response) { }", "public boolean processOutput();", "@Override\n\tpublic void process() {\n\t\tInterface2.super.process();\n\t}", "public interface OutputProcessor {\n\n void process(Reader reader, Writer writer) throws IOException;\n\n}", "public interface OutputHandler\n{\n\n public abstract void printKeyAttributes(GraphMLWriteContext graphmlwritecontext, XmlWriter xmlwriter);\n\n public abstract void printKeyOutput(GraphMLWriteContext graphmlwritecontext, XmlWriter xmlwriter);\n\n public abstract void printDataAttributes(GraphMLWriteContext graphmlwritecontext, XmlWriter xmlwriter);\n\n public abstract void printDataOutput(GraphMLWriteContext graphmlwritecontext, XmlWriter xmlwriter);\n}", "@Override\n protected String process() {\n process.print();\n return \"hello world!!\";\n }", "public void processEnd();", "public abstract int process(Buffer input, Buffer output);", "public interface PostInterface {\n void processFinish(String output);\n}", "public abstract void process() throws IOException;", "public interface Process extends Serializable\n{\n\tpublic static final String NAME = \"Process Name\";\n\tpublic static final String TYPE = \"Process Type\";\n\t\n\tpublic static final String previousProcess = \"previousProcess\";\n\t\n\n\t/* initialization */\n\tpublic void init(Process process,Network network);\n\tpublic void init(Process process,List inputPorts,List outputPorts,Network network);\n\tpublic Network getNetwork();\n\tpublic Map getProperties();\n\tpublic void updateProperties(Map properties);\n\tpublic String getID();\n\t\n\t\n\n\t/* activity */\n\tpublic void preFire();\n\tpublic boolean isFireable(Map data);\n\tpublic void fire(Map data);\n\tpublic Map getData();\n\tpublic void updateData(Map change);\n\n\n\t/* communication management */\n\tpublic InputPort getInputPort(int index);\n\tpublic InputPort inputPortObject(int index);\n\tpublic int getInputPortCount();\n\tpublic List getInputPortList();\n\tpublic OutputPort getOutputPort(int index);\n\tpublic OutputPort outputPortObject(int index);\n\tpublic int getOutputPortCount();\n\tpublic List getOutputPortList();\n\n\tpublic void setPreviousProcess(Process pro1);\n\tpublic void setPrevProcessObj(Process prevProcessObj);\n}", "@Override\n\tpublic void processData() {\n\t\t\n\t}", "@Override\r\n\tprotected void processExecute() {\n\r\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\n\tpublic void process() throws Exception {\n\n\t}", "public FaxJobStatus getFaxJobStatus(FaxClientSpi faxClientSpi,ProcessOutput processOutput);", "public interface DHTProcess<T> {\n\n //主动处理\n void activeProcess(T t);\n\n //被动处理\n void passiveProcess(T t);\n\n}", "void process();", "void process();", "@Override\n\tpublic void processItemInformation(ProcessItemInformationObjectEvent e, String message) {\n\t\t\n\t}", "public interface ProcessHandler<T> {\n public T handle(Map<String, Object> kvs);\n}", "@Override\n\tprotected void processInput() {\n\t}", "public interface ProcessRegisterCallback {\n void call(Object process, ProcessExecutorParams params, ImmutableMap<String, String> context);\n }", "protected abstract void updateFaxJobFromInputDataImpl(T inputData,FaxJob faxJob);", "public void processInput() {\n\n\t}", "public interface Output {\n void writeAction(int transactionId, int actionId, int transactionRunCount);\n\n void writeWait(int transactionId, int actionId, int transactionRunCount);\n\n void writeTransactionRestart(int transactionId, int transactionRunCount);\n\n void writeFreeText(String s);\n\n void finish(BPlusTree tree, Order order);\n}", "@Override\r\n\t\t\tpublic void processFinish(String output) {\n\t\t\t\ttry {\r\n\t\t\t\t\tjsonObj = new JSONObject(output);\r\n\t\t\t\t\tJSONArray Data = jsonObj.getJSONArray(\"mnots\");\t\t\r\n\t\t\t\t\tDBHelper.storePromo(getApplicationContext(),Data);\r\n\t\t\t\t\tgetPys(\"\");\r\n\t\t\t\t\treceivedPys(\"\");\r\n\t\t\t\t} catch (JSONException 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\t\r\n\t\t\t}", "void postProcess();", "void postProcess();", "@Override\n public void emitOutput() {\n }", "@Override\n\tpublic void processing() {\n\n\t}", "@Override\n\tpublic String process() {\n\t\treturn null;\n\t}", "public abstract List<C_result> processJob(C_request processing_cmd);", "public void managerOutputModified(ManagerEvent e);", "@Override\n public void processElement(ProcessContext processContext) {\n processContext.output(processContext.element().getKey());\n }", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t}", "@Override\r\n\tpublic void process() {\n\t\tSystem.out.println(\"this is singleBOx \" + this.toString());\r\n\t}", "public abstract boolean process();", "public abstract void runProcess();", "public interface ProcessContext extends Serializable {\r\n /**\r\n * answer with the current summary state of the processing context\r\n */\r\n Object getState();\r\n\r\n /**\r\n * Set the summary state of the processing context\r\n *\r\n * @param state to be set\r\n */\r\n void setState(Object state);\r\n}", "@Override\n\tpublic void process(Exchange arg0) throws Exception {\n\t\t\n\t}", "public abstract void process(int input);", "@Override\r\n\t\t\t\tpublic void autEndProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void autEndProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "public interface IProcessor {\n\n Object onMsgHandle(int cmdId, Object... arg);\n}", "public Consumer<String> outputHandler() {\n return outputHandler;\n }", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "public void execute() throws ProcessException\r\n {\r\n \tdouble input = inputVar.getData().getDoubleValue(); \t\r\n \t\r\n \tswitch (interpolationMethod)\r\n \t{\r\n \t\tcase 1:\r\n \t\t\tcomputeInterpolatedValue1D(input);\r\n \t\t\tbreak; \t\t\t\r\n \t}\r\n \t\r\n \t//System.out.println(getName() + \": \" + input + \" -> \" + outputVars[0].getData().getDoubleValue());\r\n }", "@Override\n\tpublic void pipeOutput() {\n\n\t}", "void requestOutput();", "public void pidWrite(double output) {\n set(output);\n }", "public abstract void processJob() throws Exception;", "@Override\n public void onProcessError(Object item, Exception e) {\n logger.error(\"onProcessError\");\n }", "default Output processResponse(Input input, Output response) {\n process(input, response);\n return response;\n }", "@Override\n protected void usePIDOutput(double output) {\n liftmotor.pidWrite(output);\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=OUTPUT\n }", "public void processStreamInput() {\n }", "public interface ProcessCall\n{\n\t/**\n\t * Start the process.\n\t * Called when pressing the ... button in ...\n\t * It should only return false, if the function could not be performed\n\t * as this causes the process to abort.\n\t *\n\t * @param ctx Context\n\t * @param pi\t\t\t\tProcess Info\n\t * @return true if the next process should be performed\n\t */\n\tpublic boolean startProcess (Properties ctx, ProcessInfo pi, Trx trx);\n\n}", "@Override\n\t\tprotected ProcessManager service(ProcessAwareServerHttpConnectionManagedObject<ByteBuffer> connection)\n\t\t\t\tthrows IOException {\n\n\t\t\t// Configure process awareness\n\t\t\tconnection.setProcessAwareContext(processAwareContext);\n\n\t\t\t// Service the connection\n\t\t\tHttpRequest request = connection.getRequest();\n\t\t\tHttpResponse response = connection.getResponse();\n\n\t\t\t// Provider Server and Date\n\t\t\tHttpResponseHeaders headers = response.getHeaders();\n\t\t\theaders.addHeader(NAME_SERVER, VALUE_SERVER);\n\t\t\theaders.addHeader(NAME_DATE, this.dateHttpHeader);\n\n\t\t\t// Determine request\n\t\t\tString requestUri = request.getUri();\n\t\t\tswitch (requestUri) {\n\n\t\t\tcase \"/plaintext\":\n\t\t\t\tresponse.setContentType(TEXT_PLAIN, null);\n\t\t\t\tresponse.getEntity().write(HELLO_WORLD);\n\t\t\t\tthis.send(connection);\n\t\t\t\tbreak;\n\n\t\t\tcase \"/json\":\n\t\t\t\tresponse.setContentType(APPLICATION_JSON, null);\n\t\t\t\tthis.objectMapper.writeValue(response.getEntityWriter(), new Message(\"Hello, World!\"));\n\t\t\t\tthis.send(connection);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t// Unknown request\n\t\t\t\tresponse.setStatus(HttpStatus.NOT_FOUND);\n\t\t\t\tthis.send(connection);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// No process management\n\t\t\treturn null;\n\t\t}", "@Override\n public void sendResultToOutput(JobTask jobTask, JobTaskResult jobTaskResult) {\n\n }", "public interface IProcessor {\n\t/**\n\t * The container for the logic of the <code>Processor</code>.\n\t * \n\t * @param r\n\t * the target <code>Record</code>\n\t */\n\tpublic void process(Record r);\n\t\n\tpublic void close();\n}", "public void processing();", "public interface csIProcessingSetupListener {\n public void setupComplete( csIProcessing proc );\n}", "public interface RenderingProcess extends Process {\n\n /**\n * Given a target query and a target grid geometry returns the query to be used to read the\n * input data of the process involved in rendering. This method will be called only if the input\n * data is a feature collection.\n * \n * @param targetQuery\n * @param gridGeometry\n * @return The transformed query, or null if no inversion is possible/meaningful\n */\n Query invertQuery(Map<String, Object> input, Query targetQuery, GridGeometry gridGeometry) throws ProcessException;\n\n /**\n * Given a target query and a target grid geometry returns the grid geometry to be used to read\n * the input data of the process involved in rendering. This method will be called only if the\n * input data is a grid coverage or a grid coverage reader\n * \n * @param targetQuery\n * @param gridGeometry\n * @return The transformed query, or null if no inversion is possible/meaningful\n */\n GridGeometry invertGridGeometry(Map<String, Object> input, Query targetQuery,\n GridGeometry targetGridGeometry) throws ProcessException;\n}", "public void onProcessChanges(IDuccWork job, IDuccProcess left, IDuccProcess right);", "public interface RecordHandler {\n\n /**\n * Process an individual file change record.\n *\n * @param filePath the file path that changed\n * @param status the change.\n */\n void handle(String filePath, Status status) throws IOException, TransformException;\n }", "public void onFinishedParsingInput() {\n // To output line to file: outputLine(string);\n }", "public void process(Object value) {}", "public void processItem(OUT item)throws CrawlerException{\n processor.process(item);\n }", "public abstract Process getProcess();", "@Override\n\tvoid output() {\n\t\t\n\t}", "void storeJob(Job job, JobStatus status, Map<String, Object> jobOutput, String[] standardOutput);", "@Override\r\n public void processFinish(ArrayList<MovieElements> output) {\n }", "public void onOutputReceived(MoneroOutputWallet output);", "byte[] writeEvent(ProcessInstance processInstance, Object value) throws IOException;", "public interface ResultProcessor {\n void handleResults(Run results);\n}", "@Override\n\t\t\tpublic void commandOutput(int id, String line) {\n\t\t\t\tRootTools.log(\"Command\", \"ID: \" + id + \", \" + line);\n\t\t\t\tMessage message = callback\n\t\t\t\t\t\t.obtainMessage(Constants.OUTPUT_UPDATED);\n\t\t\t\tmessage.obj = line;\n\t\t\t\tcallback.sendMessage(message);\n\n\t\t\t}", "@Override\n\tprotected Output<Param<?>> executeInternal(Input input) {\n\t\tExecutionContext eCtx = handleNewDomainRoot(input.getContext());\n\t\n\t\tParam<Object> actionParam = findParamByCommandOrThrowEx(eCtx);\n\t\t\n\t\tfinal Param<?> outputParam;\n\t\tif(containsFunctionHandler(input)) {\n\t\t\toutputParam = executeFunctionHanlder(input, FunctionHandler.class);\n\t\t} else { \n\t\t\tsetStateNew(eCtx, input.getContext().getCommandMessage(), actionParam);\n\t\t\toutputParam = actionParam;\n\t\t}\n\t\treturn Output.instantiate(input, eCtx, outputParam);\n\t}", "@Override\n public void receivedReply(final ListProcessesReply reply) {\n }", "@Override\n\tpublic Result doProcessing() {\n\t\treturn doProcessing1();\n\t}", "public void setOutput(LineStroker output) {\n this.output = output;\n }" ]
[ "0.67187226", "0.6656104", "0.6551847", "0.6494084", "0.64333487", "0.62312794", "0.6113339", "0.6054026", "0.6018855", "0.6015622", "0.597306", "0.5910726", "0.58135676", "0.5778075", "0.5742474", "0.5677849", "0.56502175", "0.5643894", "0.56414866", "0.5621802", "0.5616756", "0.5582103", "0.5552658", "0.55421543", "0.55340284", "0.55330557", "0.5514884", "0.5514884", "0.5514884", "0.5482783", "0.54798216", "0.5475418", "0.54647064", "0.54647064", "0.5440631", "0.54393137", "0.5398289", "0.5398222", "0.5398163", "0.5397203", "0.5396517", "0.5391135", "0.5387956", "0.5387956", "0.53864527", "0.53802276", "0.53513163", "0.53352636", "0.53274834", "0.53264266", "0.53249496", "0.53249496", "0.5322411", "0.53163016", "0.5310618", "0.53053445", "0.5302214", "0.52908635", "0.5290698", "0.5290698", "0.52771074", "0.52643025", "0.5246709", "0.5246709", "0.5246709", "0.5246709", "0.5246709", "0.52336425", "0.52274925", "0.5224511", "0.52241737", "0.5223942", "0.52184093", "0.52170306", "0.5214146", "0.5211745", "0.5208495", "0.5206356", "0.5202452", "0.51803756", "0.51733536", "0.51703703", "0.5152129", "0.5138106", "0.51292634", "0.5127967", "0.51276803", "0.51272297", "0.51060873", "0.5091839", "0.5080218", "0.5069051", "0.5061849", "0.50596017", "0.50571316", "0.50534004", "0.5052538", "0.5045058", "0.5043671", "0.5039077" ]
0.8290934
0
Updates the fax job based on the data from the process output.
public void updateFaxJob(FaxClientSpi faxClientSpi,FaxJob faxJob,ProcessOutput processOutput,FaxActionType faxActionType);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract void updateFaxJobFromInputDataImpl(T inputData,FaxJob faxJob);", "public void updateFaxJobFromInputData(T inputData,FaxJob faxJob)\n {\n if(!this.initialized)\n {\n throw new FaxException(\"Fax bridge not initialized.\");\n }\n \n //get fax job\n this.updateFaxJobFromInputDataImpl(inputData,faxJob);\n }", "public interface ProcessOutputHandler\n{\n /**\n * Updates the fax job based on the data from the process output.\n * \n * @param faxClientSpi\n * The fax client SPI\n * @param faxJob\n * The fax job object\n * @param processOutput\n * The process output\n * @param faxActionType\n * The fax action type\n */\n public void updateFaxJob(FaxClientSpi faxClientSpi,FaxJob faxJob,ProcessOutput processOutput,FaxActionType faxActionType);\n \n /**\n * This function extracts the fax job status from the process output.\n * \n * @param faxClientSpi\n * The fax client SPI\n * @param processOutput\n * The process output\n * @return The fax job status\n */\n public FaxJobStatus getFaxJobStatus(FaxClientSpi faxClientSpi,ProcessOutput processOutput);\n}", "public void updateData() {\n\n ProgramWorker pw = new ProgramWorker();\n pw.execute();\n\n }", "JobResponse.Update update();", "public FaxJobStatus getFaxJobStatus(FaxClientSpi faxClientSpi,ProcessOutput processOutput);", "public final void process() {\n parseReport();\n checkThreshold();\n updateQualityXML();\n }", "public void updateJob(int numeroticket, int chunkjustdone) {\n\t\tif (this.ticket == numeroticket)\n\t\t{\n\t\t\t//System.out.println(\"moi worker \" + id + \" ne doit plus faire \" + chunkjustdone);\n\t\t\tthis.chunkDone[chunkjustdone] = true;\n\t\t\t\n\t\t}\n\t}", "public void processOutput() {\n\n\t}", "public void updateData() {}", "public abstract List<C_result> processJob(C_request processing_cmd);", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "private synchronized void update() {\n int numberOfPoints = buffer.get(0).size();\n if (numberOfPoints == 0) return;\n\n for (int i = 0; i < getNumberOfSeries(); i++) {\n final List<Double> bufferSeries = buffer.get(i);\n final List<Double> dataSeries = data.get(i);\n dataSeries.clear();\n dataSeries.addAll(bufferSeries);\n bufferSeries.clear();\n }\n\n //D.info(SineSignalGenerator.this, \"Update triggered, ready: \" + getNumberOfSeries() + \" series, each: \" + data[0].length + \" points\");\n bufferIdx = 0;\n\n // Don't want to create event, just \"ping\" listeners\n setDataReady(true);\n setDataReady(false);\n }", "@Override\n\tpublic void processData() {\n\t\t\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\n\tpublic int updateProcess(Project project) {\n\t\treturn pm.updateProcess(project);\n\t}", "public void process() {\n\t}", "@Override\n\tpublic void processing() {\n\n\t}", "public void onProcessChanges(IDuccWork job, IDuccProcess left, IDuccProcess right);", "@Override\n public String call() throws Exception {\n String[] proParameters = {FILE_EXE_IO, \"GET\", topicName, \"0\", \"SYSTAB_SOURCE.MASTER\"}; // TODO - Check if really all 0\n\n if(util.validationNotNull(proParameters)){\n // Build the process\n ProcessBuilder pb = new ProcessBuilder(proParameters); // GET & SYSTAB_SOURCE.MASTER - needed implement to read from readerIO\n pb.directory(new File(FILE_PATH_IO));\n Process p = pb.start();\n\n StringBuilder lineText = new StringBuilder(); // Maybe only string ?\n if(stepNumber.isEmpty()){ // No need to append the stepNumber as it doesn't was insert\n lineText.append(topicName).append(\" \"); // Append the name of topic and leave a space to append the new value\n } else {\n lineText.append(stepNumber).append(\" \").append(topicName).append(\" \"); // Append the name of topic and leave a space to append the new value\n }\n\n try(BufferedReader IOBr = new BufferedReader(new InputStreamReader(p.getInputStream()))){ // Try with resource (auto close)\n String line = IOBr.readLine();\n // Start reading in loop until there isn't any more\n while (line != null) {\n lineText.append(line); // Add the new value\n line = IOBr.readLine(); // Only read one line\n if (!IOBr.ready()) {\n break;\n }\n }\n } catch (IOException e){\n e.printStackTrace();\n }\n return lineText.toString(); // Return the topicName + new value\n }\n return \"Null values\";\n }", "public void execute() throws ProcessException\r\n {\r\n \tdouble input = inputVar.getData().getDoubleValue(); \t\r\n \t\r\n \tswitch (interpolationMethod)\r\n \t{\r\n \t\tcase 1:\r\n \t\t\tcomputeInterpolatedValue1D(input);\r\n \t\t\tbreak; \t\t\t\r\n \t}\r\n \t\r\n \t//System.out.println(getName() + \": \" + input + \" -> \" + outputVars[0].getData().getDoubleValue());\r\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 }", "@Override\n\tpublic void processUpdate(ITabActivity act) {\n\t\t\n\t}", "public void getData()\n\t{\n\t\tif (jobEntry.getName() != null) wName.setText( jobEntry.getName() );\n\t\twName.selectAll();\n\t\tif (jobEntry.getZipFilename()!= null) wZipFilename.setText( jobEntry.getZipFilename() );\n\t\tif (jobEntry.getWildcardSource()!= null) wWildcardSource.setText( jobEntry.getWildcardSource() );\n\n\t\tif (jobEntry.getWildcard()!= null) wWildcard.setText( jobEntry.getWildcard() );\n\t\tif (jobEntry.getWildcardExclude()!= null) wWildcardExclude.setText( jobEntry.getWildcardExclude() );\n\t\tif (jobEntry.getSourceDirectory()!= null) wTargetDirectory.setText( jobEntry.getSourceDirectory() );\n\t\tif (jobEntry.getMoveToDirectory()!= null) wMovetoDirectory.setText( jobEntry.getMoveToDirectory() );\n\n\t\tif (jobEntry.afterunzip>=0)\n\t\t{\n\t\t\twAfterUnZip.select(jobEntry.afterunzip );\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\twAfterUnZip.select(0 ); // NOTHING\n\t\t}\n\t\t\n\t\twAddFileToResult.setSelection(jobEntry.isAddFileToResult());\n\t\twArgsPrevious.setSelection(jobEntry.getDatafromprevious());\n\t\twAddDate.setSelection(jobEntry.isDateInFilename());\n\t\twAddTime.setSelection(jobEntry.isTimeInFilename());\n\t\t\n\t\tif (jobEntry.getDateTimeFormat()!= null) wDateTimeFormat.setText( jobEntry.getDateTimeFormat() );\n\t\twSpecifyFormat.setSelection(jobEntry.isSpecifyFormat());\n\t\t\n\t\twRootZip.setSelection(jobEntry.isCreateRootFolder());\n\t\twCreateFolder.setSelection(jobEntry.isCreateFolder());\n\t\t\n \tif (jobEntry.getLimit()!= null) \n\t\t\twNrErrorsLessThan.setText( jobEntry.getLimit());\n\t\telse\n\t\t\twNrErrorsLessThan.setText(\"10\");\n \t\n\t\tif(jobEntry.getSuccessCondition()!=null)\n\t\t{\n\t\t\tif(jobEntry.getSuccessCondition().equals(jobEntry.SUCCESS_IF_AT_LEAST_X_FILES_UN_ZIPPED))\n\t\t\t\twSuccessCondition.select(1);\n\t\t\telse if(jobEntry.getSuccessCondition().equals(jobEntry.SUCCESS_IF_ERRORS_LESS))\n\t\t\t\twSuccessCondition.select(2);\n\t\t\telse\n\t\t\t\twSuccessCondition.select(0);\t\n\t\t}else wSuccessCondition.select(0);\n\t\t\n\t\twAddOriginalTimestamp.setSelection(jobEntry.isOriginalTimestamp());\n\t\twSetModificationDateToOriginal.setSelection(jobEntry.isOriginalModificationDate());\n\t\twIfFileExists.select(jobEntry.getIfFileExist());\n\t\twcreateMoveToDirectory.setSelection(jobEntry.isCreateMoveToDirectory());\n\t}", "public void runSJF() {\n\n //init\n ArrayList<Processus> localProcess = new ArrayList<>(); //Creation of a local list of process\n for (Processus cpy : listOfProcess) { //Copy the list of process in the local list\n localProcess.add(cpy);\n }\n int size = listOfProcess.size(); //variable used to save the initial size of the list of process\n\n Processus executedProc = null; //ExecutedProc is the current process that is being execute\n Processus tmpProc = localProcess.get(0); //The tmpProc is the previous process executed\n\n //Variable we need to calcul\n double occupancyRate = 0;\n double averageWaitingTime = 0;\n double averageReturnTime = 0;\n int currentTime = 0;\n int occupancyTime = 0;\n\n //beginning of the algo\n while (!localProcess.isEmpty()) { //As long as there are processes that are not done yet we keep going on\n\n //Determines the next process that will be executed\n for (Processus proc : localProcess) { //flow all remaining processes\n if (proc.getTime() <= currentTime) { //check if the currentTime of the process is below the currentTime\n if (localProcess.size() == 1) { //if there is only one process left\n executedProc = proc;\n } else if ((proc.getRessource(proc.getCurrentStep()) <= tmpProc.getRessource(tmpProc.getCurrentStep())) || (proc.getTime() < tmpProc.getTime())) {//shortest process selected\n executedProc = proc;\n tmpProc = proc;\n }\n }\n }\n\n //Check if the current process is assigned\n if (executedProc != null) {\n\n //execute the current ressource\n int tmpTime = 0;\n while (executedProc.getRessource(executedProc.getCurrentStep()) > tmpTime) { //As long as there is a resource\n for (Processus proc : localProcess) {\n if (proc.getTime() <= currentTime && !proc.equals(executedProc)) { //checking if there is another process waiting\n proc.setWaitingTime(1);\n }\n }\n currentTime++; //currentTime is updating at each loop\n occupancyTime++; //occupancyTime is updating at each loop\n tmpTime++;\n }\n\n executedProc.setCurrentStep(executedProc.getCurrentStep() + 1); //Update the currentStep to the next one (index of the lists of UC and inOut)\n\n if (executedProc.getCurrentStep() >= executedProc.getlistOfResource().size()) {//if it is the end of the process\n averageReturnTime += executedProc.getExecutedTime(); //update the average return time by adding the time that the process took\n localProcess.remove(executedProc); //remove the process from the list of process that needs to run\n }\n\n if (executedProc.getCurrentStep() <= executedProc.getListOfInOut().size()) { //If there is another inOut, it set the new time\n executedProc.setTime(executedProc.getInOut(executedProc.getCurrentStep() - 1) + currentTime);\n }\n\n executedProc = null;\n } else {\n currentTime++;\n }\n }\n //end of the algo\n\n //Calculation of the variables\n occupancyRate = ((double) occupancyTime / (double) currentTime) * 100;\n for (Processus proc : listOfProcess) {\n averageWaitingTime += proc.getWaitingTime();\n }\n averageWaitingTime = averageWaitingTime / size;\n averageReturnTime = averageReturnTime / size;\n\n //Updating the global variables\n currentAverageReturnTime = averageReturnTime;\n logger.trace(\"Current average return time : \" + currentAverageReturnTime);\n currentAverageWaitingTime = averageWaitingTime;\n logger.trace(\"Current average waiting time : \" + currentAverageWaitingTime);\n currentOccupancyRate = occupancyRate;\n logger.trace(\"Current occupancy rate : \" + currentOccupancyRate);\n currentOccupancyTime = occupancyTime;\n logger.trace(\"Current occupancy time : \" + currentOccupancyTime);\n\n restList(); //reset the list to the origin values so the user can test another algo\n }", "public void updateData(Trick completedTrick);", "@Override\n public void processData(ProgramInput input)\n throws IOException, InterruptedException, RESTClientException {\n AirlyAPIClient AirlyAPI = new AirlyAPIClient(input.getAPIKey());\n MapPoint data;\n if(input.getSensorId() == null)\n data = AirlyAPI.getMeasurementsForMapPoint(input.getLatitude(), input.getLongitude());\n else\n data = AirlyAPI.getMeasurementsFromSpecificSensor(input.getSensorId());\n if(isObjectEmpty(data)) notifyViews(\"EmptyObject\", Boolean.TRUE);\n else notifyViews(\"EmptyObject\", Boolean.FALSE);\n notifyViews(\"SensorData\", data);\n if(input.isHistory()) notifyViews(\"HistoryMode\", true);\n else notifyViews(\"HistoryMode\", false);\n }", "@Override\r\n\t\t\tpublic void processFinish(String output) {\n\t\t\t\ttry {\r\n\t\t\t\t\tjsonObj = new JSONObject(output);\r\n\t\t\t\t\tJSONArray Data = jsonObj.getJSONArray(\"mnots\");\t\t\r\n\t\t\t\t\tDBHelper.storePromo(getApplicationContext(),Data);\r\n\t\t\t\t\tgetPys(\"\");\r\n\t\t\t\t\treceivedPys(\"\");\r\n\t\t\t\t} catch (JSONException 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\t\r\n\t\t\t}", "@Override\n\tpublic void update()\n\t{\n\t\tfor (int i = 0; i < 16 && !processQueue.isEmpty(); i++)\n\t\t{\n\t\t\tProcessEntry entry = processQueue.remove();\n\t\t\tprocessPacket(entry.packet, entry.sourceClient);\n\t\t}\n\t\t\n\t\t// Flush pending packets\n\t\tclientChannels.flush();\n\t}", "protected void processJobSubmissionResponse(JobSubmissionResponseTO result) {\n\t\tList<Integer> jobID = result.getJobIDs();\n\t\tUserModel userModel = OurGridPortal.getUserModel();\n\t\tfor (Integer integer : jobID) {\n\t\t\tuserModel.addJobId(getJobViewId(), integer);\n\t\t}\n\t\t\n\t}", "@Override\r\n\tpublic void updateData() {\n\t\t\r\n\t}", "public void updateInfo() {\n\t}", "private void updateFile() {\n try {\n this.taskStorage.save(this.taskList);\n this.aliasStorage.save(this.parser);\n } catch (IOException e) {\n System.out.println(\"Master i am unable to save the file!\");\n }\n }", "public void incrementFileProcess() {\n this.setCurrFileName(files.elementAt(\n this.currFileProgressValue).toString());\n this.currFileProgressValue++;\n this.pbarFileProcess.setValue(this.currFileProgressValue);\n this.lblFileProcessCaption.setText(processCaption+\" \"+currFileProgressValue+\" of \"+\n maxfiles); \n }", "public void updateTask() {}", "@Override\r\n\t\t\t\tpublic void autEndProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void autEndProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "public boolean update(ConProcess conProcess) throws AppException;", "public void updateChart(){\n for(Pair<Number,Number> p : sss.getPopulationQueue()){\n this.population.getData().add(new XYChart.Data<>(p.getKey(),p.getValue()));\n }\n for(Pair<Number,Number> p : sss.getDeathsQueue()){\n this.deaths.getData().add(new XYChart.Data<>(p.getKey(),p.getValue()));\n }\n for(Pair<Number,Number> p : sss.getInfectionsQueue()){\n this.infections.getData().add(new XYChart.Data<>(p.getKey(),p.getValue()));\n }\n for(Pair<Number,Number> p : sss.getHealsQueue()){\n this.heals.getData().add(new XYChart.Data<>(p.getKey(),p.getValue()));\n }\n sss.clearPopulationQueue();\n sss.clearDeathsQueue();\n sss.clearInfectionsQueue();\n sss.clearHealsQueue();\n }", "public Object doProcess() {\n List<Result> retv = new ArrayList<Result>();\n try {\n current_time = NTPDate.currentTimeMillis();\n current_time_nano = Utils.nanoNow();\n\n try {\n currentProcs = ProcFSUtil.getCurrentProcsHash();\n } catch (Throwable t) {\n if (logger.isLoggable(Level.FINER)) {\n logger.log(Level.FINER, \" [ myMon ] ProcFSUtil.getCurrentProcsHash exc\", t);\n }\n }\n final Result result = getResult();\n if(result != null) {\n result.addSet(\"Max Memory\", Runtime.getRuntime().maxMemory() / MEGABYTE_FACTOR);\n result.addSet(\"Memory\", Runtime.getRuntime().totalMemory() / MEGABYTE_FACTOR);\n result.addSet(\"Free Memory\", Runtime.getRuntime().freeMemory() / MEGABYTE_FACTOR);\n retv.add(result);\n }\n\n Result r = fillMLCPUTimeStats();\n if (r != null)\n retv.add(r);\n\n r = fillParamStats();\n if (r != null)\n retv.add(r);\n\n r = fillProcsStats();\n if (r != null)\n retv.add(r);\n\n if (currentProcs != null && currentProcs.size() > 0) {\n prevProcs = currentProcs;\n }\n\n r = fillPMSStats();\n if (r != null)\n retv.add(r);\n\n r = fillMLLUSHelperStats();\n if (r != null)\n retv.add(r);\n\n r = fillPWStats();\n if (r != null)\n retv.add(r);\n\n r = fillTCWStats();\n if (r != null)\n retv.add(r);\n\n if (IS_MAC) {\n r = fillFromMAC();\n if (r != null)\n retv.add(r);\n }\n } catch (Throwable t) {\n if (logger.isLoggable(Level.FINER)) {\n logger.log(Level.FINER, \"[ myMon ] [ HANDLED ] got ex main loop ... \", t);\n }\n return null;\n } finally {\n last_time_nano = current_time_nano;\n }\n\n currentProcs = null;\n if (logger.isLoggable(Level.FINEST)) {\n logger.log(Level.FINEST, \" [ myMon ] Returning ... \\n\" + retv);\n }\n return retv;\n }", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "private void exeRefresh()\n\t{\n\t this.setCursor(cl_dat.M_curWTSTS_pbst);\n\t\tgetDSPMSG(\"Before\");\n\t\tcl_dat.M_flgLCUPD_pbst = true;\n\t\tsetMSG(\"Decreasing Stock Master\",'N');\n\t\tdecSTMST();\n\t\tsetMSG(\"Updating Stock Master\",'N');\n\t\texeSTMST();\n\t\tupdCDTRN(\"D\"+cl_dat.M_strCMPCD_pbst,\"FGXXRCT\");\t\n\t\tupdCDTRN(\"D\"+cl_dat.M_strCMPCD_pbst,\"FGXXISS\");\n\t\t/*if(chkREFRCT.isSelected())\n\t\t{\n\t\t\tsetMSG(\"Refreshing Receipt Masters.\",'N');\n\t\t\t\n\t\t}\n\t\tif(chkREFISS.isSelected())\n\t\t{\n\t\t\tsetMSG(\"Refreshing Issue Masters.\",'N');\n\t\t\t\n\t\t}*/\n\t\tgetDSPMSG(\"After\");\n\t\tif(cl_dat.M_flgLCUPD_pbst)\n\t\t\tsetMSG(\"Data refreshed successfully\",'N');\n\t\telse\n\t\t\tsetMSG(\"Data not refreshed successfully\",'E');\n\t\tthis.setCursor(cl_dat.M_curDFSTS_pbst);\n\t\n\t}", "private void processUpdates(SystemMetadata newSystemMetadata)\n throws RetryableException, UnrecoverableException, SynchronizationFailed {\n\n logger.debug(task.taskLabel() + \" entering processUpdates...\");\n\n //XXX is cloning the identifier necessary?\n Identifier pid = D1TypeBuilder.cloneIdentifier(newSystemMetadata.getIdentifier());\n\n logger.info(buildStandardLogMessage(null, \"Start ProcessUpdate\"));\n logger.debug(task.taskLabel() + \" Getting sysMeta from HazelCast map\");\n // TODO: assume that if hasReservation indicates the id exists, that \n // hzSystemMetadata will not be null...can we make this assumption?\n SystemMetadata hzSystemMetadata = hzSystemMetaMap.get(pid);\n SystemMetadataValidator validator = null;\n String errorTracker = \"\";\n try {\n errorTracker = \"validateSysMeta\";\n \tvalidator = new SystemMetadataValidator(hzSystemMetadata);\n validator.validateEssentialProperties(newSystemMetadata, nodeCommunications.getMnRead());\n\n // if here, we know that the new system metadata is referring to the same\n // object, and we can consider updating other values.\n NodeList nl = nodeCommunications.getNodeRegistryService().listNodes();\n boolean isV1Object = AuthUtils.isCNAuthorityForSystemMetadataUpdate(nl, newSystemMetadata);\n errorTracker = \"processUpdate\";\n if (task.getNodeId().contentEquals(hzSystemMetadata.getAuthoritativeMemberNode().getValue())) {\n\n if (isV1Object) {\n \t// (no seriesId in V1 to validate)\n processV1AuthoritativeUpdate(newSystemMetadata, hzSystemMetadata);\n \n } else {\n \tvalidateSeriesId(newSystemMetadata,hzSystemMetadata);\n \tprocessV2AuthoritativeUpdate(newSystemMetadata, validator);\n \n }\n } else {\n \t// not populating anything other than replica information\n processPossibleNewReplica(newSystemMetadata, hzSystemMetadata, isV1Object);\n }\n logger.info(buildStandardLogMessage(null, \" Completed ProcessUpdate\"));\n } catch (InvalidSystemMetadata e) {\n if (validator == null) {\n throw new UnrecoverableException(\"In processUpdates, bad SystemMetadata from the HzMap\", e);\n } else {\n throw new UnrecoverableException(\"In processUpdates, could not find authoritativeMN in the NodeList\", e);\n }\n } catch (NotAuthorized e) {\n \tif (errorTracker.equals(\"validateSysMeta\")) {\n \t\tthrow SyncFailedTask.createSynchronizationFailed(task.getPid(), \"In processUpdates, while validating the checksum\", e);\n \t} else {\n \t\tthrow SyncFailedTask.createSynchronizationFailed(task.getPid(), \"NotAuthorized to use the seriesId. \", e);\n \t}\n } catch (IdentifierNotUnique | InvalidRequest | InvalidToken | NotFound e) {\n \n throw SyncFailedTask.createSynchronizationFailed(task.getPid(), \"In processUpdates, while validating the checksum\", e);\n } catch (ServiceFailure e) {\n extractRetryableException(e);\n throw new UnrecoverableException(\"In processUpdates, while validating the checksum:, e\");\n } catch (NotImplemented e) {\n throw new UnrecoverableException(\"In processUpdates, while validating the checksum:, e\");\n }\n }", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\t\tpublic void onProcess(int process) {\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t}", "public abstract void onProcess();", "public void SetJobByFileLine(String[] jobInfo) {\r\n this.setJobID(Integer.parseInt(jobInfo[0]));\r\n this.setJobPriority(Integer.parseInt(jobInfo[1]));\r\n this.setJobInTime(Integer.parseInt(jobInfo[2]));\r\n this.setJobInstructionNum(Integer.parseInt(jobInfo[3]));\r\n Log.Info(\"检测后备作业\", String.format(\"正在加载后备作业:%d,优先级:%d,进入时间:%d,指令数:%d\", jobID, jobPriority, jobInTime, jobInstructionNum));\r\n instructions = new ArrayList<>(jobInstructionNum);\r\n this.data = new short[jobInstructionNum];\r\n }", "public void processProduct() {\n Product product = self.getCurrentProduct();\n ServiceManager sm = self.getServiceManager();\n boolean failure = false;\n\n if (product != null) {\n //update the product's location\n product.setLocation(self.getLocation());\n env.updateProduct(product);\n\n //process product if the current service equals the needed service and is available,\n //otherwise, just forward the product to the output-buffer without further action.\n if (sm.checkProcessingAllowed(product.getCurrentStepId())) {\n int processingSteps = sm.getCapability().getProcessingTime() * env.getStepTimeScaler();\n for (int i = 1; i <= processingSteps; i++) {\n if (i % env.getStepTimeScaler() == 0) {\n self.increaseWorkload();\n syncUpdateWithCheck(false);\n } else {\n waitStepWithCheck();\n }\n }\n failure = sm.checkFailure(getRandom());\n }\n\n //block until enough space on output-buffer\n while (!self.getOutputBuffer().tryPutProduct(product) && !getResetFlag()) {\n waitStepWithCheck();\n }\n // update product, no sync – does not change pf\n product.finishCurrentStep();\n product.setLocation(self.getOutputLocation());\n env.updateProduct(product);\n // move product to output-buffer + break a service (optional)\n self.setCurrentProduct(null);\n self.increaseFinishCount();\n syncUpdateWithCheck(failure);\n }\n }", "private void processCalculation(String line) {\n\t\t//TODO: fill\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tmCpuinfo = ShellHelper.getProc(CPU_INFO_PROC);\n\t\t\t\tupdateCpuStats();\n\t\t\t\tfor (LogicalCpu c : mLogicalCpus) {\n\t\t\t\t\tc.updateFrequency();\n\t\t\t\t\tc.updateGovernor();\n\t\t\t\t\tc.updateTimeInFrequency();\n\t\t\t\t\tc.updateTotalTransitions();\n\t\t\t\t}\n\t\t\t}", "@Override\n\tpublic Result doProcessing() {\n\t\treturn doProcessing1();\n\t}", "JobResponse refresh();", "public abstract void processJob() throws Exception;", "private void updatesForBuild78()\r\n {\r\n runningBuildNumber = \"78\";\r\n u78(\"mNetNetworkHistory\", \" \");\r\n u78(\"filteredCatcherPorts\", \" \");\r\n u78(\"connectToHistory\", \" \");\r\n u78(\"searchTermHistory\", \",\");\r\n }", "public void processing();", "public void onNewWorkProcesses(IDuccWork work, ICommandLine commandLine, Map<DuccId, IDuccProcess> newWorkProcessMap, Map<DuccId, IDuccProcess> newWorkProcessMapToUpdate);", "@Override\n\t\tprotected void process() throws Exception {\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing - Initializing Models...\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tGlobalVars.initialize();\n\n\t\t\t// Processing Step 1. - CoreNLP\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing CoreNLP.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tString processed_text = Filter\n\t\t\t\t\t.filterdata(GlobalVars.pipeline, text);\n\n\t\t\t// Processing Step 2. - Openie\"\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing Openie.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tStringBuilder openIEOutput = new StringBuilder();\n\t\t\tString temp = \"\";\n\t\t\tfor (String sentence : processed_text.split(\"\\\\. \")) {\n\n\t\t\t\tSeq<Instance> extractions = GlobalVars.openIE.extract(sentence);\n\n\t\t\t\tInstance[] arr = new Instance[extractions.length()];\n\t\t\t\textractions.copyToArray(arr);\n\n\t\t\t\tfor (Instance inst : arr) {\n\t\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\t\tsb.append(inst.sentence() + \"\\n\");\n\t\t\t\t\tDouble conf = inst.confidence();\n\t\t\t\t\tString stringConf = conf.toString().substring(0, 4);\n\t\t\t\t\tsb.append(stringConf).append(\" (\")\n\t\t\t\t\t\t\t.append(inst.extr().arg1().text()).append(\"; \")\n\t\t\t\t\t\t\t.append(inst.extr().rel().text()).append(\"; \");\n\n\t\t\t\t\ttemp += inst.extr().arg1().text() + \"\\n\"\n\t\t\t\t\t\t\t+ inst.extr().rel().text() + \"\\n\";\n\n\t\t\t\t\tPart[] arr2 = new Part[inst.extr().arg2s().length()];\n\t\t\t\t\tinst.extr().arg2s().copyToArray(arr2);\n\t\t\t\t\t/*\n\t\t\t\t\t * for (Part arg : arr2) { sb.append(arg.text()).append(\"\");\n\t\t\t\t\t * System.out.println(\"%\" + arg.text() + \"%\"); }\n\t\t\t\t\t */\n\t\t\t\t\tif (arr2.length != 0) {\n\t\t\t\t\t\tSystem.out.println(\"Hats: \" + arr2[0]);\n\t\t\t\t\t\ttemp += arr2[0] + \"\\n\";\n\t\t\t\t\t\tsb.append(arr2[0]);\n\t\t\t\t\t\tsb.append(\")\\n\\n\");\n\t\t\t\t\t\topenIEOutput.append(sb.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Processing Step 3. - Rewrite\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing Rewrite.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\t// Load load = new Load();\n\t\t\t// result = load.Loadfilter(openIEOutput.toString());\n\t\t\tresult = temp;\n\t\t}", "public void appendAjxPatch() {\n if (this.isRunning) {\n Ajx3BundleAppendPatchTask ajx3BundleAppendPatchTask = new Ajx3BundleAppendPatchTask(this.mGroups, this, this.mDownloadType);\n mTask = ajx3BundleAppendPatchTask;\n ajx3BundleAppendPatchTask.execute(new String[]{\"\"});\n }\n }", "@Override\r\n\tprotected void process() {\n\t\tconsultarSustentoProxy.setCodigoActvidad(codigo_actividad);\r\n\t\tconsultarSustentoProxy.setCodigoCliente(codigo_cliente);\r\n\t\tconsultarSustentoProxy.setCodigoPLan(codigo_plan);\r\n\t\tconsultarSustentoProxy.execute();\r\n\t}", "private void ReplaceJob()\r\n\t{\n\t\tif (check_Gui_Field_value() == true)\r\n\t\t{ //file exist yes/no\r\n\t\t\tif (check_file_existence(frm1txtSelectFile.getText()) == true)\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\tStSourceFileName = frm1txtSelectFile.getText();\r\n\r\n\t\t\t\tSplit_Seek_value(); //erase old file + split seek\r\n\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\t//check if file/folder/other.\r\n\t\t\t\t\tif (check_file_status(frm1txtSelectFile.getText().toString()) == true)\r\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//snr s = new snr();\r\n\t\t\t\t\t\tsnr r = new snr();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tr.setParameters(StSourceFileName,StStrSplit[0]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tr.getparameters();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tr.setParametersGui();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tl = new log(\"info\",\"Replace Button\" ,\"opened the a Seek and Replace Window\");\r\n\r\n\t\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\t\t}\r\n\t\t\r\n\t}", "private void handlePhexVersionAdjustments()\r\n {\n if ( ( runningPhexVersion == null || runningPhexVersion.length() == 0 ) &&\r\n ( runningBuildNumber == null || runningBuildNumber.length() == 0 ) )\r\n {\r\n // this seems to be the first time phex is running...\r\n // in this case we are not updating... we use default values...\r\n \r\n // unfortunatly there is a bug causing no set version number to be available\r\n // between 56 and 78\r\n // since b78 updates can be performed on any version without problems we execute\r\n // them always if no version is set.\r\n updatesForBuild78();\r\n }\r\n else\r\n {\r\n // dropped update support of Phex 0.7 (2005-03-02)\r\n // dropped update support of Phex 0.8 (2005-11-19)\r\n // dropped update support of build 36 (2005-11-19)\r\n // dropped update support of build 42 (2005-11-19)\r\n // dropped update support of build 56 (2005-11-19)\r\n \r\n // update from Phex build <= 35\r\n if ( runningBuildNumber == null || runningBuildNumber.length() == 0 )\r\n {\r\n runningBuildNumber = \"35\";\r\n }\r\n if ( VersionUtils.compare( \"78\", runningBuildNumber ) > 0 )\r\n {\r\n updatesForBuild78();\r\n }\r\n if ( VersionUtils.compare( \"81\", runningBuildNumber ) > 0 )\r\n {\r\n updatesForBuild81();\r\n }\r\n if ( VersionUtils.compare( \"87\", runningBuildNumber ) > 0 )\r\n {\r\n updatesForBuild87();\r\n }\r\n if ( VersionUtils.compare( \"88\", runningBuildNumber ) > 0 )\r\n {\r\n updatesForBuild88();\r\n }\r\n if ( VersionUtils.compare( \"92\", runningBuildNumber ) > 0 )\r\n {\r\n updatesForBuild92();\r\n }\r\n }\r\n \r\n runningBuildNumber = Environment.getInstance().getProperty(\r\n \"build.number\" );\r\n runningPhexVersion = Res.getStr( \"Program.Version\" );\r\n save();\r\n }", "@Override\n\tpublic void finish() throws DPFTRuntimeException {\n\t\tDPFTLogger.info(this, \"Updating Outbound Control Records...\");\n\t\tDPFTOutboundDboSet rSet = (DPFTOutboundDboSet) this.getPreviousAction().getResultSet();\n\t\tDPFTOutboundControlDboSet ctrlSet = rSet.getControlTableRecords(\"process_status='\" + GlobalConstants.DPFT_OBND_STAT_RUN + \"'\");\n\t\tctrlSet.taskComplete();\n\t\tctrlSet.close();\n\t\t\n\t\t//send Notification\n\t\tString cmp_code = ctrlSet.getDbo(0).getString(\"camp_code\");\n\t\tfor(String sf: success_ftp_files){\n\t\t\tObject[] params = {sf, this.getOutFileRemoteDir()};\n\t\t\tDPFTUtil.pushNotification(\n\t\t\t\t\tDPFTUtil.getCampaignOwnerEmail(cmp_code), \n\t\t\t\t\tnew DPFTMessage(\"CUSTOM\", \"TFB00011I\", params)\n\t\t\t);\n\t\t}\n\t\tsuccess_ftp_files.clear();\n\t}", "void updateData();", "void updateInformation();", "@Override\r\n\tpublic void process() {\n\t\tSystem.out.println(\"this is singleBOx \" + this.toString());\r\n\t}", "@Override\r\n\tprotected void processExecute() {\n\r\n\t}", "private void fillSaxData() {\n\t\tpd = ProgressDialog.show(this, null, \"Loading Shack Messages...\", true, true); \r\n\r\n\t\t// use the class run() method to do work\r\n\t\tThread thread = new Thread(this); \r\n\t\tthread.start();\r\n\t}", "protected abstract void updateInfos();", "@Override\n public void update(Workout e) {\n\n }", "@Override\n\tpublic void update(ExportProduct exportProduct) {\n\t\t\n\t}", "public void update( )\n {\n JasperPortletHome.getInstance( ).update( this );\n }", "public void operate(FlowProcess flowProcess, FunctionCall<NullContext> funcCall) {\n Tuple tuple = funcCall.getArguments().getTuple();\n TupleEntryCollector collector = funcCall.getOutputCollector();\n Tuple outTuple = new Tuple();\n String inKey = tuple.getString(0);\n String inValue = tuple.getString(1);\n int outKey;\n int outValue;\n HashMap<String, Integer> index = ExportPinterestPrefsWorkflow.getIndex();\n int highestID = ExportPinterestPrefsWorkflow.getHighestID();\n if( index.containsKey(inKey) ){\n outKey = index.get(inKey);\n } else { //new id-string mapping\n outKey = highestID;\n index.put(inKey, outKey);\n highestID += 1;\n }\n if( index.containsKey(inValue) ){\n outValue = index.get(inValue);\n } else { //new id-string mapping\n outValue = highestID;\n index.put(inValue, outValue);\n highestID += 1;\n }\n outTuple.add(outKey);\n outTuple.add(outValue+\"\\t1.0\");\n collector.add(outTuple);\n ExportPinterestPrefsWorkflow.setHighestID(highestID);\n ExportPinterestPrefsWorkflow.setIndex(index);//todo not sure this is needed if index is a reference to enclosing class's index it's already modified. If it's a deep copy yikes, copied with every get?????\n }", "public void getData() {\n if ( jobEntry.getName() != null ) {\n wName.setText( jobEntry.getName() );\n }\n wIncType.setText(jobEntry.getIncType());\n wIncField.setText(jobEntry.getIncField());\n wDataFormat.setText(jobEntry.getDataFormat());\n wStartValue.setText(jobEntry.getStartValue());\n wEndValue.setText(jobEntry.getEndValue());\n\n wName.selectAll();\n wName.setFocus();\n }", "void storeJob(Job job, JobStatus status, Map<String, Object> jobOutput, String[] standardOutput);", "public void atualizar(Processo bean) {\n\t\t\n\t}", "private void updateForecastRequest() {\n\t\tMyApplication.instance.getServiceManager().getForecastServiceUpdater()\n\t\t\t\t.updateForecastFromServer(new ForecastCallBack() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void forecastLoaded(List<YahooForcast> forecasts) {\n\t\t\t\t\t\tforecastUpdatedFromServiceUpdater(forecasts);\n\t\t\t\t\t}\n\t\t\t\t}, woeid);\n\t}", "@Override\r\n\tpublic void doProcessing() throws InterruptedException {\r\n\t\tMelody.getContext().handleProcessorStateUpdates();\r\n\r\n\t\tsynchronized (getTargetElement().getOwnerDocument()) {\r\n\t\t\tgetTargetElement().setAttribute(\r\n\t\t\t\t\tgetTargetAttributeName().getValue(), getNewValue());\r\n\t\t}\r\n\t}", "public void processKeystrokes() {\n\t\t// Only send an update if the keystroke count object is not null and we have\n\t\t// keystroke activity\n\t\t//\n\t\tif (this.hasData()) {\n\t\t\t\n\t\t\tthis.endUnendedFiles();\n\n\t\t\t//\n\t\t\t// Send the info now\n\t\t\t//\n\t\t\tthis.sendKeystrokeData(this);\n\t\t}\n\t}", "public void updateProcess(int length, int[] array, int current, int check) {\n setRectangleWidth(GRAPH_SIZE / length);\n\n // update labels\n comparedLabel.setText(\"Comparisons: \" + getCompared());\n arrayAccessedLabel.setText(\"Array Accessed : \" + getArrayAccessed());\n sortingProcessLabel.setText(getSortingProcessMsg());\n\n //canvas = new GraphVisualizer(rectangle_width, length, array, current, check);\n canvas.setLength(length);\n canvas.setArray(array);\n canvas.setRectangle_width(GRAPH_SIZE / length);\n canvas.setCurrent(current);\n canvas.setCheck(check);\n\n canvas.repaint();\n }", "public void process() {\n\n }", "@Override\n\tpublic void update(DhtmlxGridForm f) throws Exception {\n\t\t\n\t}", "public FileFormatFormData update(FileFormatFormData formData)\r\n\t\t\tthrows ProcessingException;", "@Override\n protected void runComponent() {\n File outputDirectory = this.runExternal();\n // Attach the output files to the component output with addOutputFile(..>)\n\n if (outputDirectory.isDirectory() && outputDirectory.canRead()) {\n File file0 = new File(outputDirectory.getAbsolutePath() + \"/output.csv\");\n if (file0 != null && file0.exists()) {\n Integer nodeIndex0 = 0;\n Integer fileIndex0 = 0;\n String label0 = \"tab-delimited\";\n this.addOutputFile(file0, nodeIndex0, fileIndex0, label0);\n \n } else {\n this.addErrorMessage(\"An unknown error has occurred.\");\n }\n }\n \n // Send the component output back to the workflow.\n System.out.println(this.getOutput());\n }", "@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}", "@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}", "@Override\n\tprotected void updateOtherProgress() {\n\t\t\n\t\ttempList.clear();\n\t\titeration++;\n\t\tJMetalLogger.logger.info(iteration + \" iteration...\");\n\t\t\n//\t\ttry {\n//\t\t\tnew SolutionListOutput(getPopulation()).printObjectivesToFile(\"results/media/FUN\"+iteration+\".tsv\");\n//\t\t} catch (IOException e) {\n//\t\t\te.printStackTrace();\n//\t\t}\n\t}", "@Override\r\n public void calculate() {\r\n TextOutput();\r\n }", "private void requestData() {\n Jc11x5Factory.getInstance().getJobPriceList(mHandler);\n }", "@Override\n\tpublic void process() throws Exception {\n\n\t}", "public RunProcDefJob() {\n\t}" ]
[ "0.67601734", "0.63859767", "0.63451636", "0.58458203", "0.5647142", "0.5482608", "0.5456585", "0.5121926", "0.5120989", "0.5116078", "0.51144135", "0.5064515", "0.5062548", "0.5057331", "0.5019858", "0.5019858", "0.5019858", "0.50064886", "0.4999733", "0.4996169", "0.4995377", "0.49948388", "0.49902374", "0.49530086", "0.49436924", "0.49138516", "0.48713183", "0.48699442", "0.48632595", "0.48618558", "0.4861283", "0.48380333", "0.48307762", "0.4821845", "0.4814662", "0.4809401", "0.48028082", "0.48003873", "0.48003873", "0.4796924", "0.47965768", "0.4789668", "0.47798684", "0.47798684", "0.47798684", "0.47798684", "0.47798684", "0.4777836", "0.4769736", "0.47677302", "0.47677302", "0.47677302", "0.4758999", "0.4758993", "0.4758993", "0.475878", "0.47521868", "0.47476712", "0.4741812", "0.47391006", "0.47348738", "0.4730549", "0.4727043", "0.47141105", "0.47134703", "0.47127625", "0.4710826", "0.47050676", "0.47005048", "0.46942678", "0.4683027", "0.46777493", "0.4676804", "0.46755165", "0.46683416", "0.46606338", "0.46568078", "0.46565253", "0.46555987", "0.46544304", "0.46527824", "0.4644864", "0.4643911", "0.46418133", "0.46392477", "0.46357083", "0.46236604", "0.46180946", "0.4615685", "0.46018872", "0.45953965", "0.45940426", "0.4593141", "0.4590266", "0.4590266", "0.4589093", "0.45860744", "0.45848352", "0.45842764", "0.45803267" ]
0.7492923
0
This function extracts the fax job status from the process output.
public FaxJobStatus getFaxJobStatus(FaxClientSpi faxClientSpi,ProcessOutput processOutput);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getJobStatus(int jNo);", "public interface ProcessOutputHandler\n{\n /**\n * Updates the fax job based on the data from the process output.\n * \n * @param faxClientSpi\n * The fax client SPI\n * @param faxJob\n * The fax job object\n * @param processOutput\n * The process output\n * @param faxActionType\n * The fax action type\n */\n public void updateFaxJob(FaxClientSpi faxClientSpi,FaxJob faxJob,ProcessOutput processOutput,FaxActionType faxActionType);\n \n /**\n * This function extracts the fax job status from the process output.\n * \n * @param faxClientSpi\n * The fax client SPI\n * @param processOutput\n * The process output\n * @return The fax job status\n */\n public FaxJobStatus getFaxJobStatus(FaxClientSpi faxClientSpi,ProcessOutput processOutput);\n}", "public JobStatus getStatus();", "org.apache.xmlbeans.XmlString xgetStatus();", "private String statusExtractorV2(Printer printer) {\n Document document = getStatusDocument(printer.getUrl());\n\n String text = document.text();\n String preProcessed = text.substring(text.indexOf(\"Host Name\"));\n return preProcessed.substring(preProcessed.indexOf(\"System Status\")+14,preProcessed.indexOf(\"Toner Status \")-1);\n }", "public java.lang.String getLast_processstatus() {\n return last_processstatus;\n }", "private String statusExtractorV1(Printer printer) {\n Document document = getStatusDocument(printer.getUrl());\n\n String text = document.text();\n String status;\n String preProcessed = text.substring(text.indexOf(\"Host Name\"));\n if(\"Aficio SP 8200DN\".equals(printer.getModel()))\n status = preProcessed.substring(preProcessed.indexOf(\"Printer\")+8,preProcessed.indexOf(\"Toner\")-1);\n else\n status = preProcessed.substring(preProcessed.indexOf(\"Printer\")+8,preProcessed.indexOf(\"Copier\")-1);\n return status;\n }", "public String getJobStatus() {\n return this.jobStatus;\n }", "public String getJobStatus() {\n return this.jobStatus;\n }", "@Override\n\tpublic int getJobStatus() {\n\t\treturn model.getJobStatus();\n\t}", "public boolean getStatusNameFromXmlData(Document document,MeshHeader meshHeader,Exchange exhExchange) throws SCNotifyRequestProcessingException {\n\t\tlogger.debug(\"(.) getStatusNameFromXmlData method of ServiceChannelNotificationProcessBean class \");\n\t\tString status=\"\";\n\t\tString internalStatus=\"\";\n\t\tboolean statusExist=false;\n\t\tif(document !=null){\n\t\t\t\n\t\t\tXPath xPath = XPathFactory.newInstance().newXPath();\n\t\tNodeList nodeTypeList;\n\t\ttry {\n\t\t\tnodeTypeList = (NodeList) xPath.compile((String)NotificationMasterConstants.XPATH_SC_STATUS).evaluate(document,\n\t\t\t\t\t\t\t\tXPathConstants.NODESET);\n\t\t\t//checking if \n\t\t\tif(nodeTypeList !=null && nodeTypeList.getLength()>0){\n\t\t\t\tNode node =nodeTypeList.item(0);\t\t\t\t\t\t\t\t\n\t\t\t\tstatus=node.getTextContent();\n\t\t\t\tlogger.debug(\" Status Value === \"+status);\n\t\t\t\tstatusExist=true;\n\t\t\t\tinternalStatus=\tgetInternalStatusFromCacheData(status.trim(), SACConstant.SERVICECHANEL_KEY2ACT_STATUS_MAPPING_KEY, meshHeader);\n\t\t\t\t\n\t\t\t\taddElmentToXmlDocument(document, NotificationMasterConstants.INTERNAL_STATUS_NODE,internalStatus,NotificationMasterConstants.XPATH_SC_INTERNAL_STATUS);\n\n\t\t\t}\n\t\t\texhExchange.getIn().setBody(documentToString(document));\n\n\t\t} catch (XPathExpressionException | TransformerException e) {\n\t\t\tlogger.error(\"Error in Evavluating Xpath Expression to get status value \",e);\n\t\t}}\n\t\treturn statusExist;\n\t}", "@DISPID(15)\n\t// = 0xf. The runtime will prefer the VTID if present\n\t@VTID(25)\n\tjava.lang.String status();", "public String getJobStatus(Job job) throws IOException,\n\t\t\tClassNotFoundException {\n\t\tjob = get(Job.class, job.getID());\n\t\treturn job.getStatus();\n\t}", "public int[] getStatus() throws FTD2XXException {\n IntByReference lpdwAmountInRxQueue = new IntByReference();\n IntByReference lpdwAmountInTxQueue = new IntByReference();\n IntByReference lpdwEventStatus = new IntByReference();\n ensureFTStatus(ftd2xx.FT_GetStatus(ftHandle, lpdwAmountInRxQueue, lpdwAmountInTxQueue, lpdwEventStatus));\n\n return new int[] { lpdwAmountInRxQueue.getValue(), lpdwAmountInTxQueue.getValue(), lpdwEventStatus.getValue() };\n }", "public String getProcessCompleted()\r\n\t{\r\n\t\treturn processCompleted;\r\n\t}", "public void updateProcessStatus(VpmsComputeResult result) {\n\t// SPR3290 code deleted\n\tNbaStringTokenizer tokens = new NbaStringTokenizer(result.getResult().trim(), NbaVpmsAdaptor.VPMS_DELIMITER[1]); // NBA021\n\tString aToken;// = tokens.nextToken(); // First token is empty - don't need it. // NBA021\n\twhile (tokens.hasMoreTokens()) {\n\t\t\taToken = tokens.nextToken();\n\t\t\tStringTokenizer bToken = new StringTokenizer(aToken, NbaVpmsAdaptor.VPMS_DELIMITER[0]); // NBA021\n\t\t\tString statusType = bToken.nextToken();\n\t\t\tString statusValue = bToken.nextToken();\n\t\t\tif (statusType.equals(\"PASS\"))\n\t\t\t\tsetPassStatus(statusValue);\n\t\t\telse if (statusType.equals(\"FAIL\"))\n\t\t\t\tsetFailStatus(statusValue);\n\t\t\telse if (statusType.equals(\"HOST\"))\n\t\t\t\tsetHostErrorStatus(statusValue);\n\t\t\telse if (statusType.equals(\"AWD\"))\n\t\t\t\tsetAwdErrorStatus(statusValue);\n\t\t\telse if (statusType.equals(\"VPMS\"))\n\t\t\t\tsetVpmsErrorStatus(statusValue);\n\t\t\telse if (statusType.equals(\"SQL\"))\n\t\t\t\tsetSqlErrorStatus(statusValue);\n\t\t\t//SPR1050 Added contract error status -- start\n\t\t\telse if (statusType.equals(\"OTHER\")) // NBA004 renamed to Other status\n\t\t\t\tsetOtherStatus(statusValue);\n\t\t\t//SPR1050 Added contract error status -- end\n\n\t\t\t//beign NBA020\n\t\t\telse if (statusType.equals(\"CASEACTION\"))\n\t\t\t\tsetCaseAction(statusValue);\n\t\t\telse if (statusType.equals(\"CASEPRIORITY\"))\n\t\t\t\tsetCasePriority(statusValue);\n\t\t\telse if (statusType.equals(\"WIACTION\"))\n\t\t\t\tsetWIAction(statusValue);\n\t\t\telse if (statusType.equals(\"WIPRIORITY\"))\n\t\t\t\tsetWIPriority(statusValue);\n\t\t\t//end NBA020\n\t\t\t//\tbegin NBA068 Added Alternate status -- start\n\t\t\telse if (statusType.equals(\"ALTERNATE\"))\n\t\t\t\tsetAlternateStatus(statusValue);\n\t\t\t//NBA068 -- end\n\t\t\t//ACN012 BEGIN\n\t\t\telse if (statusType.equals(\"CACHE\")) {\n\t\t\t\tsetCache(Boolean.valueOf(statusValue).booleanValue());\n\t\t\t}\n\t\t\t//ACN012 END\n\t\t\telse if (statusType.equals(\"LCMQ\")) {//AXAL3.7.20\n\t\t\t\tsetLicenseCaseMangerQueue(statusValue);//AXAL3.7.20\n\t\t\t}\n\t //Begin NBA186 \n\t\t\telse if (statusType.equals(\"RULE\")) {\n\t\t\t\tsetRule(Integer.parseInt(statusValue));\n\t\t\t} else if (statusType.equals(\"LEVEL\")) {\n\t\t\t\tsetLevel(Integer.parseInt(statusValue));\n\t\t\t}\n\t\t\t//End NBA186\n\t\t\t//Begin AXAL3.7.20R,CR57950 and 57951\n\t\t\t/*else if (statusType.equals(\"RGMQ\")) {\n\t\t\t\tsetReg60CaseMangerQueue(statusValue);\n\t\t\t}*/\n\t\t\t//End AXAL3.7.20R,CR57950 and 57951\n\t\t\t//Begin ALS5260\n\t\t\telse if (statusType.equals(\"REASON\") && !NbaVpmsConstants.IGNORE.equals(statusValue)) {\n\t\t\t\tsetReason(statusValue);\n\t\t\t}\n\t\t\t//End ALS5260\n\t\t\t//Begin CR57950 and 57951\n\t\t\telse if(statusType.equals(\"RPCM\")) {\n\t\t\t\tsetReplCMQueue(statusValue);\n\t\t\t//End CR57950 and 57951\n\t\t\t} else if(statusType.equals(\"XCMQ\")) { //CR59174\n\t\t\t\tsetExchangeCaseMgrQueue(statusValue); //CR59174\n\t\t\t}\t//CR59174\n\t\t}\n}", "public Integer getJobStatus() {\n return jobStatus;\n }", "public StatusCheckDataObject getJob_StatusCheck() {\r\n return job_StatusCheck;\r\n }", "public int getQueueStatus() throws FTD2XXException {\n IntByReference reference = new IntByReference();\n ensureFTStatus(ftd2xx.FT_GetQueueStatus(ftHandle, reference));\n return reference.getValue();\n }", "public Integer getPROCESS_STATUS() {\n return PROCESS_STATUS;\n }", "String status();", "String status();", "public ResultStatus getExecutionProgressStatus();", "java.lang.String getStatus();", "java.lang.String getStatus();", "java.lang.String getStatus();", "java.lang.String getStatus();", "com.polytech.spik.protocol.SpikMessages.Status getStatus();", "com.polytech.spik.protocol.SpikMessages.Status getStatus();", "private static void statusCommand() {\n String lineFormat = \"%-8s | %-15s | %s\\n\";\n\n List<Job> neededJobs = fetchNeededJobs();\n\n // table header\n if (neededJobs.size() < 2) {\n System.out.printf(lineFormat, \"STATE\", \"START TIME\", \"JOB DIRECTORY\");\n for (int i = 0; i < 78; i++) {\n System.out.print(((9 == i || 27 == i) ? \"+\" : \"-\"));\n }\n System.out.println();\n }\n\n // table rows\n ObjectCounter<JobState> counter = new ObjectCounter<JobState>();\n for (Job job : neededJobs) {\n Date startDate = job.getStartDate();\n JobState state = job.getState();\n counter.add(state);\n String startDateStr = (null == startDate) ? \"N/A\" : new SimpleDateFormat(\"yyyyMMdd HHmmss\").format(startDate);\n System.out.printf(lineFormat, state.toString(), startDateStr, job.getDir());\n }\n\n // table footer\n System.out.println();\n String sumFormat = \"%6d %s\\n\";\n System.out.printf(sumFormat, heritrix.getJobs().size(), \"TOTAL JOBS\");\n for (JobState state : JobState.values()) {\n if (counter.getMap().keySet().contains(state)) {\n System.out.printf(sumFormat, counter.get(state), state.toString());\n }\n }\n }", "public ProcessModelStatus getStatus() {\r\n return this.status;\r\n }", "public abstract List<C_result> processJob(C_request processing_cmd);", "public String getlbr_NFeStatus();", "private void processStatus(Element statusElement) {\n\t\tNode statusNode=statusElement.getFirstChild();\n\t\tString statusText=statusNode.getTextContent();\n\t\tint status=Integer.parseInt(statusText);\n\t\t//System.err.println(\"status was \"+status+\" at \"+System.currentTimeMillis());\n\t\tif(status!=0) {\n\t\t\tlog.error(\"Status code was \"+status+\" after last command\");\n\t\t} else {\n\t\t\tlog.info(\"Status code 0 after last command\");\n\t\t}\n\t}", "com.google.protobuf.ByteString getStatus();", "public String geraStatus() {\r\n\t\tString statusComplemento = \"\";\r\n\t\tif (this.temProcesso() == false) {\r\n\t\t\treturn \"Nenhum processo\\n\";\r\n\t\t} else {\r\n\t\t\tfor (int i = 0; i < this.escalonadores.size(); i++) {\r\n\t\t\t\tif (i > 0) {\r\n\t\t\t\t\tstatusComplemento += \" \";\r\n\t\t\t\t}\r\n\t\t\t\tstatusComplemento += i + 1 + \" - \";\r\n\t\t\t\tif (this.escalonadores.get(i).temProcesso()) {\r\n\t\t\t\t\tstatusComplemento += this.escalonadores.get(i).geraStatusComplemento();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstatusComplemento += \"\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn statusComplemento;\r\n\t}", "private String readProcess (final Process p) {\n \tString message=null;\n \tfinal BufferedReader in =new BufferedReader ( new InputStreamReader(p.getErrorStream()));\n \tString line;\n \ttry {\n\t\t\twhile((line = in.readLine()) != null)\n\t\t\t{\n\t\t\t\tmessage =line;\n\t\t\t\tif((line = in.readLine()) != null && line.startsWith(\"\\tat\"))\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\n\t\t\t\tmessage =message.substring(message.indexOf(':')+2);\n\t\t\t\t\n\t\t} catch (IOException e) {\n\t\t\tlogfile.severe(e.getMessage());\n\t\t}\n\t\treturn message;\n }", "protected String getStatus()\n { return call_state; \n }", "public String getStatus() {\n\t\tString result = getName() + \"\\n-----------------------------\\n\\n\";\n\t\tfor(int i = 0; i < lines.size(); i++) {\n\t\t\tresult = result + lines.get(i).getStatus() + \"\\n\";\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "public String determineTaskDoneStatusFromFileLine(String line) {\n int indexOfFirstSquareBracket = line.indexOf(\"[\");\n String doneStatus = String.valueOf(line.charAt(indexOfFirstSquareBracket + 1));\n assert (doneStatus.equals(\"V\") || doneStatus.equals(\"X\")) : \"Done status can only be X or V\";\n return doneStatus;\n }", "public String getStatus() {\n return isDone ? \"1\" : \"0\";\n }", "public String getToolcheckstatus() {\r\n return toolcheckstatus;\r\n }", "private void parseForRecords() {\r\n\t\tApacheAgentExecutionContext c = (ApacheAgentExecutionContext)this.fContext;\r\n\t\tString text = c.getStatusPageContent();\r\n\t\tif(text == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tswitch(c.getApacheVersion()) {\r\n\t\t\tcase VERSION_IBM_6_0_X:\r\n\t\t\t\trecords = ApacheUtils.parseExtendedStatus_ibm_6_0(text);\r\n\t\t\tbreak;\r\n\t\t\tcase VERSION_ORACLE_1_3_X:\r\n\t\t\tcase VERSION_IBM_1_3_X:\r\n\t\t\t\trecords = ApacheUtils.parseExtendedStatus_1_3_x(text);\r\n\t\t\tbreak;\r\n\t\t\tcase VERSION_ORACLE_2_0_X:\r\n\t\t\tcase VERSION_IBM_2_0_X:\r\n\t\t\t\trecords = ApacheUtils.parseExtendedStatus_1_3_x(text);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tif(records == null) {\r\n\t\t\tfContext.error(new InvalidDataPattern());\r\n\t\t}\r\n\t}", "String getStatus();", "String getStatus();", "String getStatus();", "String getStatus();", "String getStatus();", "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}", "public String getProcessCompletedIn()\r\n\t{\r\n\t\treturn processCompletedIn;\r\n\t}", "void inProcessing(String statusMsg);", "private int getJobState(java.io.PrintWriter r9) throws java.lang.Exception {\n /*\n r8 = this;\n java.lang.String r0 = \"force timeout jobs\"\n r8.checkPermission(r0)\n r0 = 0\n L_0x0006:\n java.lang.String r1 = r8.getNextOption()\n r2 = r1\n if (r1 == 0) goto L_0x005a\n int r1 = r2.hashCode()\n r3 = 1512(0x5e8, float:2.119E-42)\n r4 = 1\n r5 = -1\n if (r1 == r3) goto L_0x0027\n r3 = 1333469547(0x4f7b216b, float:4.2132713E9)\n if (r1 == r3) goto L_0x001d\n L_0x001c:\n goto L_0x0031\n L_0x001d:\n java.lang.String r1 = \"--user\"\n boolean r1 = r2.equals(r1)\n if (r1 == 0) goto L_0x001c\n r1 = r4\n goto L_0x0032\n L_0x0027:\n java.lang.String r1 = \"-u\"\n boolean r1 = r2.equals(r1)\n if (r1 == 0) goto L_0x001c\n r1 = 0\n goto L_0x0032\n L_0x0031:\n r1 = r5\n L_0x0032:\n if (r1 == 0) goto L_0x0050\n if (r1 == r4) goto L_0x0050\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>()\n java.lang.String r3 = \"Error: unknown option '\"\n r1.append(r3)\n r1.append(r2)\n java.lang.String r3 = \"'\"\n r1.append(r3)\n java.lang.String r1 = r1.toString()\n r9.println(r1)\n return r5\n L_0x0050:\n java.lang.String r1 = r8.getNextArgRequired()\n int r0 = android.os.UserHandle.parseUserArg(r1)\n goto L_0x0006\n L_0x005a:\n r1 = -2\n if (r0 != r1) goto L_0x0061\n int r0 = android.app.ActivityManager.getCurrentUser()\n L_0x0061:\n java.lang.String r1 = r8.getNextArgRequired()\n java.lang.String r3 = r8.getNextArgRequired()\n int r4 = java.lang.Integer.parseInt(r3)\n long r5 = android.os.Binder.clearCallingIdentity()\n com.android.server.job.JobSchedulerService r7 = r8.mInternal // Catch:{ all -> 0x007f }\n int r7 = r7.getJobState(r9, r1, r0, r4) // Catch:{ all -> 0x007f }\n r8.printError(r7, r1, r0, r4) // Catch:{ all -> 0x007f }\n android.os.Binder.restoreCallingIdentity(r5)\n return r7\n L_0x007f:\n r7 = move-exception\n android.os.Binder.restoreCallingIdentity(r5)\n throw r7\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.server.job.JobSchedulerShellCommand.getJobState(java.io.PrintWriter):int\");\n }", "com.lvl6.proto.EventQuestProto.QuestProgressResponseProto.QuestProgressStatus getStatus();", "public final interfaceshared.proxies.ProcessingStatus getProcessingStatus()\r\n\t{\r\n\t\treturn getProcessingStatus(getContext());\r\n\t}", "StatusLine getStatusLine();", "public boolean CC_CompleteJobTicketPrintStatus(java.lang.String accessToken, java.lang.String jobNumber) throws java.rmi.RemoteException;", "public String calculateStatus(){\n\t\tHashMap<String,String> SubSystemsStatus = this.SubsystemStatus.getSubSystemsStatus();\n\t\tString SubSystemList[] = this.SubsystemStatus.getSubsystems();\n\t\tint SHUTDOWN = 0, OPERATIONAL = 0, STARTING1 = 0, STARTING2 = 0, STOPPING = 0;\n\t\tfor(String subsystem : SubSystemList){\n\t\t\tString status = SubSystemsStatus.get(subsystem);\n\t\t\t//System.out.println(\"subsystem \" + subsystem + \" status \" + status);\n\t\t\tif (status != null) {\n\t\t\t\tif (status.equalsIgnoreCase(\"UNAVAILABLE\")) {\n\t\t\t\treturn \"UNAVAILABLE\";\n\t\t\t\t}else if (status.equalsIgnoreCase(\"ERROR\")) {\n\t\t\t\t\treturn \"ERROR\";\n\t\t\t\t} else if (status.equalsIgnoreCase(\"SHUTDOWN\")) {\n\t\t\t\t\tSHUTDOWN++;\n\t\t\t\t} else if (status.equalsIgnoreCase(\"OPERATIONAL\")) {\n\t\t\t\t\tOPERATIONAL++;\n\t\t\t\t}\n\n\t\t\t\tif (status.equalsIgnoreCase(\"ONLINE\")\n\t\t\t\t\t\t|| status.equalsIgnoreCase(\"OPERATIONAL\")) {\n\t\t\t\t\tSTARTING1++;\n\t\t\t\t} else if (status.equalsIgnoreCase(\"INITIALIZING_PASS1\")\n\t\t\t\t\t\t|| status.equalsIgnoreCase(\"INITIALIZING_PASS2\")\n\t\t\t\t\t\t|| status.equalsIgnoreCase(\"SHUTDOWN\")\n\t\t\t\t\t\t|| status.equalsIgnoreCase(\"ONLINE\")\n\t\t\t\t\t\t|| status.equalsIgnoreCase(\"OPERATIONAL\")) {\n\t\t\t\t\tSTARTING2++;\n\t\t\t\t} else if (status.equalsIgnoreCase(\"SHUTTINGDOWN_PASS1\")\n\t\t\t\t\t\t|| status.equalsIgnoreCase(\"PRESHUTDOWN\")\n\t\t\t\t\t\t|| status.equalsIgnoreCase(\"SHUTTINGDOWN_PASS2\")\n\t\t\t\t\t\t|| status.equalsIgnoreCase(\"SHUTDOWN\")\n\t\t\t\t\t\t|| status.equalsIgnoreCase(\"OPERATIONAL\")) {\n\t\t\t\t\tSTOPPING++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(SHUTDOWN == SubSystemList.length){\n\t\t\treturn \"SHUTDOWN\";\n\t\t}else if(OPERATIONAL == SubSystemList.length){\n\t\t\treturn \"OPERATIONAL\";\n\t\t}else if(STARTING1 == SubSystemList.length || STARTING2 == SubSystemList.length){\n\t\t\treturn \"STARTING\";\n\t\t}else if(STOPPING == SubSystemList.length){\n\t\t\treturn \"STOPPING\";\n\t\t}else {\n\t\t\treturn \"TRANSITING\";\n\t\t}\n\t}", "public String getStatus() throws LRException\n\t{\n\t\tgetBackground();\n\t\treturn background.getStatus();\n\t}", "com.google.protobuf.ByteString\n getStatusBytes();", "com.google.protobuf.ByteString\n getStatusBytes();", "protected DrmJobStatus demoGetStatus() {\n return new DrmJobStatus.Builder()\n // the external job id\n .extJobId(\"EXT_01\")\n // the name of the job queue\n .queueId(\"job_queue_id\")\n // the date the job was submitted to the queue (Don't set this if the job has not been submitted)\n .submitTime(new Date())\n // the date the job started running on the queue (Don't set this if the job has not yet started)\n .startTime(new Date())\n // the date the job completed running (Don't set this if the job has not yet completed)\n .endTime(new Date())\n // the status code\n .jobState(DrmJobState.DONE)\n // the exit code of the job, '0' indicates success\n .exitCode(0)\n // the max memory usage in bytes (can also pass in a string such as \"2 Gb\")\n .memory(2000L)\n // the max swap space used by the job, can accept numBytes or a String (see above)\n .maxSwap(\"2 Gb\")\n // the CPU usage of the job\n .cpuTime(new CpuTime(1000L, TimeUnit.MILLISECONDS))\n // the max number of threads used by the job (Don't call this if not known)\n .maxThreads(1)\n // the max number of processes used by the job (Don't call this if not known)\n .maxProcesses(1)\n .build();\n }", "private String collectResultFromProcess(Process proc) {\n StringBuilder sb_result = new StringBuilder();\n\n BufferedReader stdInput = new BufferedReader(new InputStreamReader(proc.getInputStream()));\n BufferedReader stdError = new BufferedReader(new InputStreamReader(proc.getErrorStream()));\n String result_line = null;\n\n try {\n while ((result_line = stdInput.readLine()) != null) {\n sb_result.append(result_line);\n sb_result.append(\"\\n\");\n }\n\n while ((result_line = stdError.readLine()) != null) {\n sb_result.append(result_line);\n sb_result.append(\"\\n\");\n }\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n\n return sb_result.toString();\n }", "public JobStatus getJobStatus(String mdpjobid) {\n log.info(\"get job mdpjobid=\"+mdpjobid);\n JobStatus js = threaMap.get(mdpjobid);\n\n if(js == null) {\n js = new JobStatus();\n js.setMdpJobId(mdpjobid);\n js.setCompleteMessage(\"Not found MDP Job\");\n }else {\n js.getCompleteMessage();\n }\n\n log.info(mdpjobid+\"=\"+js.getCompleteMessage());\n\n if(!js.getCompleteMessage().equalsIgnoreCase(\"Process\")) {\n threaMap.remove(mdpjobid);\n }\n\n return js;\n }", "protected NbaProcessStatusProvider getWiStatus() {\t\t//SPR2992 changed method signature\n\t\treturn wiStatus;\n\t}", "com.google.protobuf.ByteString\n getStatusBytes();", "public String getXpeActionStatus() {\n return (String) getAttributeInternal(XPEACTIONSTATUS);\n }", "TaskStatus getStatus();", "public int getStatus()\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(STATUS$12, 0);\n if (target == null)\n {\n return 0;\n }\n return target.getIntValue();\n }\n }", "public String status() {\n\t\tString output = \"+OK \" + mails.size() + \" \" + getSize();\n\t\treturn output;\n\t}", "private String collectResultFromProcess(Process proc)\r\n\t{\r\n\t\tStringBuilder sb_result = new StringBuilder();\r\n\t\t\r\n BufferedReader stdInput = new BufferedReader(new InputStreamReader(proc.getInputStream()));\r\n BufferedReader stdError = new BufferedReader(new InputStreamReader(proc.getErrorStream()));\r\n String result_line = null;\r\n \r\n try\r\n {\r\n\t while ((result_line = stdInput.readLine()) != null) \r\n\t {\r\n\t sb_result.append(result_line);\r\n\t sb_result.append(\"\\n\");\r\n\t }\r\n\t \r\n\t while ((result_line = stdError.readLine()) != null) \r\n\t {\r\n\t sb_result.append(result_line);\r\n\t sb_result.append(\"\\n\");\r\n\t }\r\n } catch(IOException ioe)\r\n {\r\n \tioe.printStackTrace();\r\n }\r\n \r\n return sb_result.toString();\r\n\t}", "public synchronized Status getStatus() {\n return execStatus;\n }", "public void receiveResultuPD_Order_Print_Status(\n com.xteam.tourismpay.PFTMXStub.UPD_Order_Print_StatusResponse result) {\n }", "public void receiveResultgetSystemStatus(\n com.exacttarget.wsdl.partnerapi.SystemStatusResponseMsgDocument result\n ) {\n }", "String getStatusMessage( );", "public void updateFaxJob(FaxClientSpi faxClientSpi,FaxJob faxJob,ProcessOutput processOutput,FaxActionType faxActionType);", "com.google.rpc.Status getStatus();", "com.google.rpc.Status getStatus();", "public String getRebillStatus()\n\t{\n\t\tif(response.containsKey(\"status\")) {\n\t\t\treturn response.get(\"status\");\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public org.apache.xmlbeans.XmlInt xgetStatus()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlInt target = null;\n target = (org.apache.xmlbeans.XmlInt)get_store().find_element_user(STATUS$12, 0);\n return target;\n }\n }", "public String jobOperatorQueryJobExecutionStatus(long key, String requestedStatus){\r\n\t\t\r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement statement = null;\r\n\t\tResultSet rs = null;\r\n\t\tString status;\r\n\t\tObjectInputStream objectIn = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tconn = getConnection();\r\n\t\t\tstatement = conn.prepareStatement(\"select \" + requestedStatus + \" from executioninstancedata where id = ?\");\r\n\t\t\tstatement.setObject(1, key);\r\n\t\t\trs = statement.executeQuery();\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tbyte[] buf = rs.getBytes(requestedStatus);\r\n\t\t\t\tif (buf != null) {\r\n\t\t\t\t\tobjectIn = new ObjectInputStream(new ByteArrayInputStream(buf));\r\n\t\t\t\t}\r\n\t\t\t\tstatus = (String) objectIn.readObject();\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new PersistenceException(e);\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} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tcleanupConnection(conn, rs, statement);\r\n\t\t}\r\n\t\t\r\n\t\t//return status;\r\n\t\treturn \"FIGURING OUT HOW TO GET A STRING FROM A BLOB\";\r\n\t}", "protected String status() {\n if (!hasStarted() && !hasRun()) {\n return \" not run yet\";\n } else if (hasStarted() && !hasRun()) {\n return \" failed to run\";\n } else if (!hasStarted() && hasRun()) {\n return \" ILLEGAL STATE\";\n } else if (exceptionThrown == null) {\n return \" returned: \" + StringsPlume.toStringAndClass(retval);\n } else {\n return \" threw: \" + exceptionThrown;\n }\n }", "public av m18471e() {\n return this.status;\n }", "private long getAppProcessTime(int pid) {\n FileInputStream in = null;\n String ret = null;\n try {\n in = new FileInputStream(\"/proc/\" + pid + \"/stat\");\n byte[] buffer = new byte[1024];\n ByteArrayOutputStream os = new ByteArrayOutputStream();\n int len = 0;\n while ((len = in.read(buffer)) != -1) {\n os.write(buffer, 0, len);\n }\n ret = os.toString();\n os.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (in != null) {\n try {\n in.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n if (ret == null) {\n return 0;\n }\n\n String[] s = ret.split(\" \");\n if (s == null || s.length < 17) {\n return 0;\n }\n\n long utime = string2Long(s[13]);\n long stime = string2Long(s[14]);\n long cutime = string2Long(s[15]);\n long cstime = string2Long(s[16]);\n\n return utime + stime + cutime + cstime;\n }", "private long getAppProcessTime(int pid) {\n FileInputStream in = null;\n String ret = null;\n try {\n in = new FileInputStream(\"/proc/\" + pid + \"/stat\");\n byte[] buffer = new byte[1024];\n ByteArrayOutputStream os = new ByteArrayOutputStream();\n int len = 0;\n while ((len = in.read(buffer)) != -1) {\n os.write(buffer, 0, len);\n }\n ret = os.toString();\n os.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (in != null) {\n try {\n in.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n if (ret == null) {\n return 0;\n }\n\n String[] s = ret.split(\" \");\n if (s == null || s.length < 17) {\n return 0;\n }\n\n long utime = string2Long(s[13]);\n long stime = string2Long(s[14]);\n long cutime = string2Long(s[15]);\n long cstime = string2Long(s[16]);\n\n return utime + stime + cutime + cstime;\n }", "int getStatus();", "int getStatus();", "int getStatus();", "int getStatus();", "int getStatus();", "int getStatus();", "int getStatus();", "int getStatus();", "int getStatus();", "int getStatus();", "int getStatus();", "public String getWorkflowStatus() {\r\n return (String) getAttributeInternal(WORKFLOWSTATUS);\r\n }", "String getDataStatus();", "EntryStatus getStatus();", "public int getAdminMigrationStatus(Context context) throws Exception\r\n\t{\r\n\r\n\t\tString cmd = \"print program eServiceSystemInformation.tcl select property[MigrationR212VariantConfiguration].value dump\";\r\n\t String result =\tMqlUtil.mqlCommand(context, mqlCommand, cmd);\r\n\r\n\t if(result.equalsIgnoreCase(\"PreMigrationInProcess\"))\r\n\t\t{\r\n\t\t\treturn 1;\r\n\t\t}else if(result.equalsIgnoreCase(\"PreMigrationComplete\"))\r\n\t\t{\r\n\t\t\treturn 2;\r\n\t\t}else if(result.equalsIgnoreCase(\"FeatureObjectsNotFound\")) //else if(result.equalsIgnoreCase(\"GBOMInProcess\"))\r\n\t\t{\r\n\t\t\treturn 3;\r\n\t\t}else if(result.equalsIgnoreCase(\"FeatureInProcess\")) //else if(result.equalsIgnoreCase(\"GBOMInProcess\"))\r\n\t\t{\r\n\t\t\treturn 4;\r\n\t\t}else if(result.equalsIgnoreCase(\"FeatureComplete\")) //(result.equalsIgnoreCase(\"GBOMComplete\"))\r\n\t\t{\r\n\t\t\treturn 5;\r\n\t\t}else if(result.equalsIgnoreCase(\"GBOMObjectsNotFound\")) //(result.equalsIgnoreCase(\"FeatureInProcess\"))\r\n\t\t{\r\n\t\t\treturn 6;\r\n\t\t}else if(result.equalsIgnoreCase(\"GBOMInProcess\")) //(result.equalsIgnoreCase(\"FeatureInProcess\"))\r\n\t\t{\r\n\t\t\treturn 7;\r\n\t\t}else if(result.equalsIgnoreCase(\"GBOMComplete\")) //(result.equalsIgnoreCase(\"FeatureComplete\"))\r\n\t\t{\r\n\t\t\treturn 8;\r\n\t\t}else if(result.equalsIgnoreCase(\"RuleObjectsNotFound\")) //(result.equalsIgnoreCase(\"FeatureInProcess\"))\r\n\t\t{\r\n\t\t\treturn 9;\r\n\t\t}else if(result.equalsIgnoreCase(\"RuleInProcess\"))\r\n\t\t{\r\n\t\t\treturn 10;\r\n\t\t}else if(result.equalsIgnoreCase(\"RuleComplete\"))\r\n\t\t{\r\n\t\t\treturn 11;\r\n\t\t}else if(result.equalsIgnoreCase(\"ProductConfigurationObjectsNotFound\")) //(result.equalsIgnoreCase(\"FeatureInProcess\"))\r\n\t\t{\r\n\t\t\treturn 12;\r\n\t\t}else if(result.equalsIgnoreCase(\"UpdatePCBOMXMLInProcess\"))\r\n\t\t{\r\n\t\t\treturn 13;\r\n\t\t}else if(result.equalsIgnoreCase(\"UpdatePCBOMXMLComplete\"))\r\n\t\t{\r\n\t\t\treturn 14;\r\n\t\t}\r\n\t return 0;\r\n\r\n\t}", "Map<String, Object> startCheckByProcessDefinedCode(long processDefinitionCode);" ]
[ "0.60001665", "0.5657387", "0.55317146", "0.5504599", "0.5499523", "0.54816407", "0.54274565", "0.54201126", "0.54201126", "0.5346557", "0.5295921", "0.5268637", "0.52340037", "0.5208302", "0.52070266", "0.51406235", "0.5104415", "0.51033866", "0.5096682", "0.5087649", "0.5058794", "0.5058794", "0.50525475", "0.5048166", "0.5048166", "0.5048166", "0.5048166", "0.5019236", "0.5019236", "0.5017845", "0.49921426", "0.4976443", "0.49761376", "0.49756944", "0.496573", "0.4963993", "0.49635234", "0.49430165", "0.4910466", "0.49042103", "0.48982742", "0.4883979", "0.4875136", "0.486743", "0.486743", "0.486743", "0.486743", "0.486743", "0.48613495", "0.48572972", "0.4855513", "0.48506317", "0.48496917", "0.48432964", "0.48302674", "0.48297483", "0.48180568", "0.48180485", "0.4817224", "0.4817224", "0.48109165", "0.48089072", "0.4788577", "0.47839168", "0.4775945", "0.47618392", "0.47599223", "0.47534183", "0.47442678", "0.47393337", "0.4721282", "0.47173375", "0.47141376", "0.47027898", "0.47010306", "0.46874046", "0.46874046", "0.4686021", "0.46817908", "0.46788174", "0.46627444", "0.4659249", "0.46530852", "0.46530852", "0.4652197", "0.4652197", "0.4652197", "0.4652197", "0.4652197", "0.4652197", "0.4652197", "0.4652197", "0.4652197", "0.4652197", "0.4652197", "0.46507993", "0.46409458", "0.46371037", "0.46313825", "0.46242625" ]
0.70517063
0
TODO Autogenerated method stub lOGICAL OPERATORS ARE PERFORMED ON 2 RELATIONAL EXPRESIONS AND Operator && When && (AND) operator is used : the out is going to be TRUE only when both the relation expression is true
public static void main(String[] args) { int x=300; int y=500; int z=500; //((x<y) && (x<z)) // logical expression in Java // (true && true) // the output is going to be true //((x==y) && (x>z)) //( false && False) // the final output is going to be False //((x>y) && (x<z)) //( false && true) // the final output is going to be False if((x==y)&&(x>z)) // compound condition { System.out.println("execute the block of code"); } boolean results= ((x<y)&&(x<z)); // true System.out.println(results); //OR operator || // In case of OR operator, //if anyone of the relational expression is true, the final output is going to be true // x=400; // y=500; // z=400; //((x<y) || (x==z)) // ( true || true) ----> true // false || true ----> TRUE // false || false----> false // True || False --->true int age= 30; if((age==30)||(age>18)) { System.out.println("give the licence to customer"); } // Not operator ! - if the original value of the expression is true, and if we use ! operator on it, //the output will be changed to False int x1=100; int y1=50; if(!(x1==y1)) // x1 not equal to y1 ---true // !(x==y) { System.out.println("the output is true"); } // x>y --> 100>50 --->true //!(x>y) ---!(100>50) ---> False // 100 is not greater than 50 ---> false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void andify(List<ExternalizedStateComponent> inputs, ExternalizedStateComponent output, ExternalizedStateConstant trueProp) {\n\t\tfor(ExternalizedStateComponent c : inputs) {\n\t\t\tif(c instanceof ExternalizedStateConstant && !((ExternalizedStateConstant)c).getValue()) {\n\t\t\t\t//Connect false (c) to the output\n\t\t\t\toutput.addInput(c);\n\t\t\t\tc.addOutput(output);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t//For reals... just skip over any true constants\n\t\tExternalizedStateAnd and = new ExternalizedStateAnd();\n\t\tfor(ExternalizedStateComponent in : inputs) {\n\t\t\tif(!(in instanceof ExternalizedStateConstant)) {\n\t\t\t\tin.addOutput(and);\n\t\t\t\tand.addInput(in);\n\t\t\t}\n\t\t}\n\t\t//What if they're all true? (Or inputs is empty?) Then no inputs at this point...\n\t\tif(and.getInputs().isEmpty()) {\n\t\t\t//Hook up to \"true\"\n\t\t\ttrueProp.addOutput(output);\n\t\t\toutput.addInput(trueProp);\n\t\t\treturn;\n\t\t}\n\t\t//If there's just one, on the other hand, don't use the and gate\n\t\tif(and.getInputs().size() == 1) {\n\t\t\tExternalizedStateComponent in = and.getSingleInput();\n\t\t\tin.removeOutput(and);\n\t\t\tand.removeInput(in);\n\t\t\tin.addOutput(output);\n\t\t\toutput.addInput(in);\n\t\t\treturn;\n\t\t}\n\t\tand.addOutput(output);\n\t\toutput.addInput(and);\n\t}", "IRequirement and(IRequirement requirement);", "public Object visitLogicalAndExpression(GNode n) {\n if (dostring) {\n Object a = dispatch(n.getGeneric(0));\n Object b = dispatch(n.getGeneric(1));\n \n if (a instanceof Long && b instanceof Long) {\n return (Long) a & (Long) b;\n }\n else {\n return parens(a) + \" && \" + parens(b);\n }\n }\n else {\n BDD a, b, bdd;\n \n a = ensureBDD(dispatch(n.getGeneric(0)));\n b = ensureBDD(dispatch(n.getGeneric(1)));\n \n bdd = a.andWith(b);\n \n return bdd;\n }\n }", "@Override\n public ILogical and(ILogical operador) {\n return operador.andBinary(this);\n }", "Expr join() throws IOException {\n\t\tExpr e = equality();\n\t\twhile (look.tag == Tag.AND) {\n\t\t\tToken tok = look;\n\t\t\tmove();\n\t\t\te = new And(tok, e, equality());\n\t\t}\n\t\treturn e;\n\t}", "private Object eval(AndExpr expr) {\n if (expr.getExpr().size() == 1) {\n return eval(expr.getExpr().get(0));\n }\n\n boolean result = true;\n for (RelExpr e : expr.getExpr()) {\n Object res = eval(e);\n if (res instanceof Boolean) {\n result = result && (Boolean) res;\n } else {\n throw new RaydenScriptException(\"Expression error: Part expression result is not a boolean. Type: '\" + res.getClass() + \"'\");\n }\n\n if (!result) {\n return false;\n }\n }\n return true;\n }", "public static void main(String[] args) {\nboolean a, b, c;\na =true;\nb = false;\nc =a && b;\n\nSystem.out.println(\"c = a&&B:\" + c);\nc = a||b;\nSystem.out.println(\"c = a||b:\" + c);\nc = a==b;\nSystem.out.println(\"c = a==b:\" + c);\nc = a!=b;\nSystem.out.println(\"c = a!=b:\" + c);\n\n\n\n\t}", "Expr bool() throws IOException {\n\t\tExpr e = join();\n\t\twhile (look.tag == Tag.OR) {\n\t\t\tToken tok = look;\n\t\t\tmove();\n\t\t\te = new Or(tok, e,join());\n\t\t}\n\t\treturn e;\n\t}", "public final void rule__BoolOperation__Group_8_1__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalBSQL2Java.g:1881:1: ( ( '&' ) )\n // InternalBSQL2Java.g:1882:1: ( '&' )\n {\n // InternalBSQL2Java.g:1882:1: ( '&' )\n // InternalBSQL2Java.g:1883:2: '&'\n {\n before(grammarAccess.getBoolOperationAccess().getAmpersandKeyword_8_1_0()); \n match(input,33,FOLLOW_2); \n after(grammarAccess.getBoolOperationAccess().getAmpersandKeyword_8_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 void outABinAndExp(ABinAndExp node) throws TypeException{\n\tPExp l = node.getL();\n\tPExp r = node.getR();\n\tType typel = typemap.get(l);\n\tType typer = typemap.get(r);\n\tif(areBoolean(typel,typer)) typemap.put(node, typel);\n\telse throw new TypeException(\"[line \" + golite.weeder.LineNumber.getLineNumber(node) + \"] Binary and used without two Booleans.\");\n }", "public void testX1andX2orNotX1() {\n \tCircuit circuit = new Circuit();\n \t\n \tBoolean b1 = Boolean.TRUE;\n \tBoolean b2 = Boolean.FALSE;\n \tAnd and = (And) circuit.getFactory().getGate(Gate.AND);\n\t\tNot not = (Not) circuit.getFactory().getGate(Gate.NOT);\n\t\tOr or = (Or) circuit.getFactory().getGate(Gate.OR);\n\t\tand.setLeftInput(b1);\n\t\tand.setRightInput(b2);\n\t\tand.eval();\n\t\tnot.setInput(b1);\n\t\tnot.eval();\n\t\tor.setLeftInput(and.getOutput());\n\t\tor.setRightInput(not.getOutput());\n\t\tassertEquals(Boolean.FALSE, or.eval());\n\t\tassertEquals(Boolean.FALSE, circuit.eval());\n//\t\t==========================================\n\t\tb1 = Boolean.FALSE;\n \tb2 = Boolean.TRUE;\n// \tand.eval();\n// \tnot.eval();\n \tassertEquals(Boolean.FALSE, circuit.eval());\n// \t============================================\n \tDouble d1 = 0.0;\n \tDouble d2 = 1.0;\n \tand.setLeftInput(d1);\n\t\tand.setRightInput(d2);\n\t\tnot.setInput(d1);\n\t\tor.setLeftInput(and.getOutput());\n\t\tor.setRightInput(not.getOutput());\n \tassertEquals( new Double(1.0), or.eval());\n// \t============================================\n \td1 = 0.5;\n \td2 = 0.5;\n \tand.setLeftInput(d1);\n\t\tand.setRightInput(d2);\n \tand.eval();\n \tnot.setInput(d1);\n \tnot.eval();\n\t\tor.setLeftInput(and.getOutput());\n\t\tor.setRightInput(not.getOutput());\n \tassertEquals( new Double(0.625), or.eval());\n// \t============================================\n \ttry {\n \td1 = 0.5;\n \td2 = 2.0;\n \tand.setLeftInput(d1);\n \t\tand.setRightInput(d2);\n \tand.eval();\n \tnot.setInput(d1);\n \tnot.eval();\n \t\tor.setLeftInput(and.getOutput());\n \t\tor.setRightInput(not.getOutput());\n \tassertEquals( new Double(0.625), or.eval());\n \t} catch (IllegalArgumentException e) {\n \t\tSystem.err.println(\"IllegalArgumentException: \" + e.getMessage());\n \t}\n\n }", "@Override\n public Void visit(LogicalExpression nd, SuccessorInfo i) {\n Expression left = nd.getLeft();\n writeSuccessor(nd, First.of(left));\n if (\"&&\".equals(nd.getOperator()))\n visitWithSuccessors(left, First.of(nd.getRight()), i.getSuccessors(false));\n else visitWithSuccessors(left, i.getSuccessors(true), First.of(nd.getRight()));\n nd.getRight().accept(this, i);\n return null;\n }", "public String getAndOr();", "@Override\n public R visit(ConditionalAndExpression n, A argu) {\n R _ret = null;\n n.valueLogical.accept(this, argu);\n n.nodeListOptional.accept(this, argu);\n return _ret;\n }", "public MType visit(AndExpression n, MType argu) {\n \tMType _ret = new MBoolean();\n \tn.f0.accept(this, argu);\n \tn.f1.accept(this, argu);\n \tn.f2.accept(this, argu);\n \treturn _ret;\n }", "@Test\n \tpublic void whereClauseIndirectPointingRelation() {\n \t\tnode23.addJoin(new PointingRelation(node42, NAME));\n \t\tcheckWhereCondition(\n //\t\t\t\tjoin(\"=\", \"_rank23.component_ref\", \"_rank42.component_ref\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'p'\"),\n \t\t\t\tjoin(\"=\", \"_component23.name\", \"'\" + NAME + \"'\"),\n \t\t\t\tjoin(\"<\", \"_rank23.pre\", \"_rank42.pre\"),\n \t\t\t\tjoin(\"<\", \"_rank42.pre\", \"_rank23.post\")\n \t\t);\n \t}", "@OperationMeta(opType = OperationType.INFIX)\n public static boolean and(boolean b1, boolean b2) {\n return b1 & b2;\n }", "public void and (int dirOp1, int dirOp2, int dirRes) {\n //traduce casos de direccionamiento indirecto\n dirOp1 = traduceDirIndirecto(dirOp1);\n dirOp2 = traduceDirIndirecto(dirOp2);\n if (ManejadorMemoria.isConstante(dirOp1)){ // OPERANDO 1 CTE\n String valor1 = this.directorioProcedimientos.getConstantes().get(dirOp1).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirOp2)){ // OPERANDO 2 GLOBAL\n String valor2 = this.registroGlobal.getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes,auxOperacion(dirOp1,dirOp2,valor1,valor2,Codigos.AND));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n } else if (ManejadorMemoria.isConstante(dirOp2)){ // OPERANDO 2 CTE\n String valor2 = this.directorioProcedimientos.getConstantes().get(dirOp2).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes,auxOperacion(dirOp1,dirOp2,valor1,valor2,Codigos.AND));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n } else { // OPERANDO 2 LOCAL\n String valor2 =this.pilaRegistros.peek().getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n } else { //RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n }\n } else if (ManejadorMemoria.isGlobal(dirOp1)){ // OPERANDO 1 GLOBAL\n String valor1 = this.registroGlobal.getValor(dirOp1);\n if (ManejadorMemoria.isGlobal(dirOp2)){ // OPERANDO 2 GLOBAL\n String valor2 = this.registroGlobal.getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n } else if (ManejadorMemoria.isConstante(dirOp2)){ // OPERANDO 2 CTE\n String valor2 = this.directorioProcedimientos.getConstantes().get(dirOp2).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n } else { // OPERANDO 2 LOCAL\n String valor2 = this.pilaRegistros.peek().getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n }\n } else { // OPERANDO 1 LOCAL\n String valor1 = this.pilaRegistros.peek().getValor(dirOp1);\n if (ManejadorMemoria.isGlobal(dirOp2)){ // OPERANDO 2 GLOBAL\n String valor2 = this.registroGlobal.getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n } else { // RES 2 LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n } else if (ManejadorMemoria.isConstante(dirOp2)){ // OPERANDO 2 CTE\n String valor2 = this.directorioProcedimientos.getConstantes().get(dirOp2).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n } else { //OPERANDO 2 LOCAL\n String valor2 = this.pilaRegistros.peek().getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)){ // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.AND));\n }\n }\n }\n }", "public Operation zCombinedAnd(Operation op)\r\n {\r\n if (op.equals(this))\r\n {\r\n return this;\r\n }\r\n return null;\r\n }", "private Term parseLogicalAnd(final boolean required) throws ParseException {\n Term t1 = parseComparison(required);\n while (t1 != null) {\n /*int tt =*/ _tokenizer.next();\n if (isSpecial(\"&&\") || isKeyword(\"and\")) {\n Term t2 = parseComparison(true);\n if ((t1.isB() && t2.isB()) || !isTypeChecking()) {\n t1 = new Term.AndB(t1, t2);\n } else {\n reportTypeErrorB2(\"'&&' or 'and'\");\n }\n } else {\n _tokenizer.pushBack();\n break;\n }\n }\n return t1;\n }", "public void execute() {\n\t\tnot_a.in.set(a.get());\n\t\tnot_b.in.set(b.get());\n\n\t\t/* we now execute both of the NOT gates. Each one should\n\t\t * write a value to their output.\n\t\t */\n\t\tnot_a.execute();\n\t\tnot_b.execute();\n\n\n\t\t/* ----- IMPORTANT NOTE 2: -----\n\t\t *\n\t\t * We need to perform NOT twice in this component - since XOR\n\t\t * uses the NOT value of each of the inputs a,b. But we MUST\n\t\t * NOT use the same object twice! Instead, we use two\n\t\t * different NOT objects.\n\t\t *\n\t\t * In a program, this is of course a silly design. But\n\t\t * remember that we are trying to simulate hardware here - and\n\t\t * each component (such as a NOT gate) can only generate one\n\t\t * result per clock tick. So if we want to negate two different\n\t\t * signals for the same calculation, we need two differnt gates.\n\t\t */\n\n\n\t\t/* we now connect various wires to each AND gate. Each AND\n\t\t * checks for \"this value is true, the other is false\"; it does\n\t\t * this by doing the AND of one of the inputs, and the NOT of\n\t\t * the other.\n\t\t *\n\t\t * Note that it's perfectly OK to connect the same input to\n\t\t * two different devices - we just run wires to two different\n\t\t * physical places.\n\t\t */\n\t\tand1.a.set(a.get());\n\t\tand1.b.set(not_b.out.get());\n\n\t\tand2.a.set(not_a.out.get());\n\t\tand2.b.set(b.get());\n\n\t\t/* we execute the two AND gates *AFTER* their inputs are\n\t\t * in place.\n\t\t */\n\t\tand1.execute();\n\t\tand2.execute();\n\n\n\t\t/* the value of XOR is \"this and not that, or not this and that\" -\n\t\t * or, more formally,\n\t\t * (A ~B) + (~A B)\n\t\t * So our last step is to OR the result of the two AND gates\n\t\t * together. Its output is the output from our XOR gate.\n\t\t */\n\t\tor.a.set(and1.out.get());\n\t\tor.b.set(and2.out.get());\n\t\tor.execute();\n\t\tout.set(or.out.get());\n\t}", "private Expr or() { // This uses the same recursive matching structure as other binary operators.\n Expr expr = and(); // OR takes precedence over AND.\n while(match(OR)) {\n Token operator = previous();\n Expr right = and();\n expr = new Expr.Logical(expr, operator, right);\n }\n return expr;\n }", "boolean isSetFurtherRelations();", "public final void rule__BoolOperation__Group_17__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalBSQL2Java.g:1935:1: ( ( '&' ) )\n // InternalBSQL2Java.g:1936:1: ( '&' )\n {\n // InternalBSQL2Java.g:1936:1: ( '&' )\n // InternalBSQL2Java.g:1937:2: '&'\n {\n before(grammarAccess.getBoolOperationAccess().getAmpersandKeyword_17_0()); \n match(input,33,FOLLOW_2); \n after(grammarAccess.getBoolOperationAccess().getAmpersandKeyword_17_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 }", "@Override\n\tpublic Object visit(ASTCondAnd node, Object data) {\n\t\tnode.jjtGetChild(0).jjtAccept(this, data);\n\t\tSystem.out.print(\" and \");\n\t\tnode.jjtGetChild(1).jjtAccept(this, data);\n\t\treturn null;\n\t}", "public static BinaryExpression andAlso(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "private double logicalAnd() {\n\t\tdouble q = p<=0.5?p:1-p;\n\t\treturn num * configMap.get('r') + (num-1) * configMap.get('l') + num * configMap.get('f') + configMap.get('t') + q * configMap.get('m') + p * configMap.get('a');\n\t}", "@Test\n \tpublic void whereClauseForNodeIndirectPrecedence() {\n \t\tnode23.addJoin(new Precedence(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<\", \"_node23.right_token\", \"_node42.left_token\")\n \t\t);\n \t}", "public static BinaryExpression and(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "private void checkLogicOperands(Set<FlowAbstraction> in, Unit d, Set<FlowAbstraction> out) {\n checkBinaryOperation(in, d, out);\n }", "public LogicGateAND() {\r\n\t\t// Initialize input and output ports\r\n\t\tsuper(Operators.AND, new IDynamicInterface(2), new IFixedInterface(new IPort()));\r\n\t}", "@Override\n public JsonNode visit(JmesPathAndExpression andExpression, JsonNode input) throws InvalidTypeException {\n JsonNode lhsNode = andExpression.getLhsExpr().accept(this, input);\n JsonNode rhsNode = andExpression.getRhsExpr().accept(this, input);\n if (lhsNode == BooleanNode.TRUE) {\n return rhsNode;\n } else {\n return lhsNode;\n }\n }", "public static void main(String[] args) { , or , not\n // truth table -> t=1 f=0\n // a =t b= f c = a and b => a.b =0=>f\n\n // except 0 every no. is treated as true\n // int a=1 int b=2 a and b => a.b\n // and -> a=1 , b=2, a and b => a.b\n\n\n // and\n boolean a= false;\n boolean b= false;\n\n boolean c= a && b; // a.b\n System.out.println(c);\n\n //or\n boolean f= true;\n boolean d= true;\n\n boolean e= f || d; // a+b\n System.out.println(e);\n\n // not\n boolean g =true;\n boolean h= !g;\n System.out.println(h);\n\n }", "public final void ruleOpAnd() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:445:2: ( ( '&&' ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:446:1: ( '&&' )\n {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:446:1: ( '&&' )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:447:1: '&&'\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getOpAndAccess().getAmpersandAmpersandKeyword()); \n }\n match(input,14,FOLLOW_14_in_ruleOpAnd886); if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getOpAndAccess().getAmpersandAmpersandKeyword()); \n }\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 LogicalOperator() {\n this.logical = Logical.And;\n }", "@Override\n\tpublic void outAFalseExpr(AFalseExpr node) {\n\t\til.append(new PUSH(cp, false));\n\t}", "private Object eval(OrExpr expr) {\n if (expr.getExpr().size() == 1) {\n return eval(expr.getExpr().get(0));\n }\n\n boolean result = false;\n for (AndExpr e : expr.getExpr()) {\n Object res = eval(e);\n if (res instanceof Boolean) {\n result = result || (Boolean) res;\n } else {\n throw new RaydenScriptException(\"Expression error: Part expression result is not a boolean. Type: '\" + res.getClass() + \"'\");\n }\n\n if (result) {\n return true;\n }\n }\n return false;\n }", "@Test\n public void testAnd() {\n if (true && addValue()) {\n assertThat(flag, equalTo(1));\n }\n\n // first expression is not satisfied conditions, then second expression not invoke\n if (false && addValue()) {\n assertThat(flag, equalTo(1));\n }\n }", "private void and() {\n // PROGRAM 1: Student must complete this method\n //loop through the output array\n for (int i = 0; i < output.length; i++) {\n //take the and of index i of inputA and inputB and place result in output[i]\n output[i] = inputA[i] & inputB[i];\n }\n }", "public boolean containsIncomingRelations();", "public boolean ctx_on(RTContainer n){\n\t\tif(n.getFulfillmentConditions().size()>0)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "@Test\n public void trueAndFalseCombined() {\n assertFalse(getPredicateInstance(false, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(false, null, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(true, false, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(true, true, false).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(true, true, false, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n }", "public void and(Condition c){\n result.retainAll(c.result);\n Collections.sort(result);\n }", "public void visita(And and) {\n and.getOperando(0).accept(this);\r\n Resultado resIzq = new Resultado(resParcial.getResultado());\r\n if (resIzq.equals(Resultado.COD_TRUE)) {\r\n resIzq.setEjemplo(resParcial.getEjemplo());\r\n } else {\r\n resIzq.setContraejemplo(resParcial.getContraejemplo());\r\n }\r\n and.getOperando(1).accept(this);\r\n Resultado resDer = new Resultado(resParcial.getResultado());\r\n if (resDer.equals(Resultado.COD_TRUE)) {\r\n resDer.setEjemplo(resParcial.getEjemplo());\r\n } else {\r\n resDer.setContraejemplo(resParcial.getContraejemplo());\r\n }\r\n Resultado resAND;\r\n try {\r\n boolean part1 = Boolean.parseBoolean(resIzq.getResultado());\r\n boolean part2 = Boolean.parseBoolean(resDer.getResultado());\r\n part1 = part1 && part2;\r\n resAND = new Resultado(String.valueOf(part1));\r\n if (part1) {\r\n resAND.setEjemplo(resIzq.getEjemplo());\r\n } else if (part2) {\r\n resAND.setContraejemplo(resIzq.getContraejemplo());\r\n } else {\r\n resAND.setContraejemplo(resDer.getContraejemplo());\r\n }\r\n } catch (Exception e) {\r\n if ((resIzq.getResultado().equals(Resultado.COD_FALSE)) ||\r\n (resDer.getResultado().equals(Resultado.COD_FALSE))) {\r\n resAND = new Resultado(Resultado.COD_FALSE);\r\n } else {\r\n resAND = new Resultado(Resultado.COD_MAYBEF);\r\n }\r\n }\r\n resParcial = resAND;\r\n\r\n }", "Expression andExpression() throws SyntaxException {\r\n\t\tToken first = t;\r\n\t\tExpression e0 = eqExpression();\r\n\t\twhile(isKind(OP_AND)) {\r\n\t\t\tToken op = consume();\r\n\t\t\tExpression e1 = eqExpression();\r\n\t\t\te0 = new ExpressionBinary(first, e0, op, e1);\r\n\t\t}\r\n\t\treturn e0;\r\n\t}", "public final void rule__BoolOperation__Group__15__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalBSQL2Java.g:1557:1: ( ( '&' ) )\n // InternalBSQL2Java.g:1558:1: ( '&' )\n {\n // InternalBSQL2Java.g:1558:1: ( '&' )\n // InternalBSQL2Java.g:1559:2: '&'\n {\n before(grammarAccess.getBoolOperationAccess().getAmpersandKeyword_15()); \n match(input,33,FOLLOW_2); \n after(grammarAccess.getBoolOperationAccess().getAmpersandKeyword_15()); \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 void visit(ConditionalAndExpression n) {\n n.f0.accept(this);\n n.f1.accept(this);\n }", "boolean check(Env env) {\n boolean leftOK = leftOperand.check (env);\n boolean rightOK = rightOperand.check (env);\n return leftOK && rightOK;\n }", "protected void sequence_AND(ISerializationContext context, AND semanticObject) {\n\t\tif (errorAcceptor != null) {\n\t\t\tif (transientValues.isValueTransient(semanticObject, SiddhiPackage.eINSTANCE.getAND_And()) == ValueTransient.YES)\n\t\t\t\terrorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SiddhiPackage.eINSTANCE.getAND_And()));\n\t\t}\n\t\tSequenceFeeder feeder = createSequencerFeeder(context, semanticObject);\n\t\tfeeder.accept(grammarAccess.getANDAccess().getAndAndKeyword_0(), semanticObject.getAnd());\n\t\tfeeder.finish();\n\t}", "private static void orify(Collection<ExternalizedStateComponent> inputs, ExternalizedStateComponent output, ExternalizedStateConstant falseProp) {\n\t\t//TODO: Look for already-existing ors with the same inputs?\n\t\t//Or can this be handled with a GDL transformation?\n\n\t\t//Special case: An input is the true constant\n\t\tfor(ExternalizedStateComponent in : inputs) {\n\t\t\tif(in instanceof ExternalizedStateConstant && ((ExternalizedStateConstant) in).getValue()) {\n\t\t\t\t//True constant: connect that to the component, done\n\t\t\t\tin.addOutput(output);\n\t\t\t\toutput.addInput(in);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t//Special case: An input is \"or\"\n\t\t//I'm honestly not sure how to handle special cases here...\n\t\t//What if that \"or\" gate has multiple outputs? Could that happen?\n\n\t\t//For reals... just skip over any false constants\n\t\tExternalizedStateOr or = new ExternalizedStateOr();\n\t\tfor(ExternalizedStateComponent in : inputs) {\n\t\t\tif(!(in instanceof ExternalizedStateConstant)) {\n\t\t\t\tin.addOutput(or);\n\t\t\t\tor.addInput(in);\n\t\t\t}\n\t\t}\n\t\t//What if they're all false? (Or inputs is empty?) Then no inputs at this point...\n\t\tif(or.getInputs().isEmpty()) {\n\t\t\t//Hook up to \"false\"\n\t\t\tfalseProp.addOutput(output);\n\t\t\toutput.addInput(falseProp);\n\t\t\treturn;\n\t\t}\n\t\t//If there's just one, on the other hand, don't use the or gate\n\t\tif(or.getInputs().size() == 1) {\n\t\t\tExternalizedStateComponent in = or.getSingleInput();\n\t\t\tin.removeOutput(or);\n\t\t\tor.removeInput(in);\n\t\t\tin.addOutput(output);\n\t\t\toutput.addInput(in);\n\t\t\treturn;\n\t\t}\n\t\tor.addOutput(output);\n\t\toutput.addInput(or);\n\t}", "protected final void operationAND(final int data) {\r\n this.ac &= data;\r\n this.zeroFlag = this.ac == 0;\r\n this.signFlag = this.ac >= 0x80;\r\n }", "public static Object logicAnd(Object val1, Object val2) {\n\t\tif (isBool(val1) && isBool(val2)) {\n\t\t\treturn ((Boolean) val1) && ((Boolean) val2);\n\t\t}\n\t\tthrow new OrccRuntimeException(\"type mismatch in logicAnd\");\n\t}", "public void setAnd(boolean and) {\n reqIsAnd = and;\n }", "@DialogField(fieldLabel = \"Use AND Logic\",\n fieldDescription = \"Check box to search for tags using AND logic, otherwise search will use OR logic.\")\n @Switch(offText = \"No\", onText = \"Yes\")\n public boolean isComposeWithAnd() {\n return get(PARAM_COMPOSE_WITH_AND, false);\n }", "@Test\n \tpublic void whereClauseDirectPointingRelation() {\n \t\tnode23.addJoin(new PointingRelation(node42, NAME, 1));\n \t\tcheckWhereCondition(\n //\t\t\t\tjoin(\"=\", \"_rank23.component_ref\", \"_rank42.component_ref\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'p'\"),\n \t\t\t\tjoin(\"=\", \"_component23.name\", \"'\" + NAME + \"'\"),\n \t\t\t\tjoin(\"=\", \"_rank23.pre\", \"_rank42.parent\")\n \n \t\t);\n \t}", "private AbstractExpression<Boolean> constructJunction(CriteriaBuilderImpl cb, Object q, Tree junctionDef) {\n \t\tfinal List<AbstractExpression<Boolean>> predictions = Lists.newArrayList();\n \n \t\tfor (int i = 0; i < junctionDef.getChildCount(); i++) {\n \t\t\tfinal Tree childDef = junctionDef.getChild(i);\n \t\t\tif ((childDef.getType() == JpqlParser.LOR) || (childDef.getType() == JpqlParser.LAND)) {\n \t\t\t\tpredictions.add(this.constructJunction(cb, q, childDef));\n \t\t\t}\n \t\t\telse {\n \t\t\t\tpredictions.add(this.getExpression(cb, q, childDef, Boolean.class));\n \t\t\t}\n \t\t}\n \n \t\tif (predictions.size() == 1) {\n \t\t\treturn predictions.get(0);\n \t\t}\n \n \t\tif (junctionDef.getType() == JpqlParser.LOR) {\n \t\t\treturn cb.or(predictions.toArray(new Predicate[predictions.size()]));\n \t\t}\n \n \t\tfinal Predicate[] predicates = new Predicate[predictions.size()];\n \n \t\tfor (int i = 0; i < predictions.size(); i++) {\n \t\t\tfinal AbstractExpression<Boolean> expression = predictions.get(i);\n \t\t\tif (expression instanceof PredicateImpl) {\n \t\t\t\tpredicates[i] = (Predicate) expression;\n \t\t\t}\n \t\t\telse {\n \t\t\t\tpredicates[i] = new PredicateImpl(expression);\n \t\t\t}\n \t\t}\n \n \t\treturn cb.and(predicates);\n \t}", "void visit(final AndCondition andCondition);", "public String visit(AndExpression n, Object argu) \n\t{\n\t\tString _ret=null;\n\t String e0 = n.f0.accept(this, argu);\n\t String e1 = n.f2.accept(this, argu);\n\t \n\t if (e0.equals(\"boolean\") && e1.equals(\"boolean\"))\n\t {\n\t \t_ret = \"boolean\";\n\t }\n\t return _ret;\n\t}", "@ZenCodeType.Operator(ZenCodeType.OperatorType.AND)\n default IData and(IData other) {\n \n return notSupportedOperator(OperatorType.AND);\n }", "public void visit(AndExpression n) {\n n.f0.accept(this);\n n.f1.accept(this);\n }", "@Test\n \tpublic void whereClauseForNodeIndirectDominance() {\n \t\tnode23.addJoin(new Dominance(node42));\n \t\tcheckWhereCondition(\n //\t\t\t\tjoin(\"=\", \"_rank23.component_ref\", \"_rank42.component_ref\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'d'\"),\n \t\t\t\t\"_component23.name IS NULL\",\n \t\t\t\tjoin(\"<\", \"_rank23.pre\", \"_rank42.pre\"),\n \t\t\t\tjoin(\"<\", \"_rank42.pre\", \"_rank23.post\")\n \t\t);\n \t}", "Boolean conditionResult();", "@Override\n public R visit(ConditionalOrExpression n, A argu) {\n R _ret = null;\n n.conditionalAndExpression.accept(this, argu);\n n.nodeListOptional.accept(this, argu);\n return _ret;\n }", "boolean isActiveOperandSet();", "public static BinaryExpression andAssign(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "public void testAND2() throws Exception {\n\t\tObject retval = execLexer(\"AND\", 226, \"&\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.FAIL, retval);\n\t\tObject expecting = \"FAIL\";\n\n\t\tassertEquals(\"testing rule \"+\"AND\", expecting, actual);\n\t}", "public final void operator() throws RecognitionException {\r\n try {\r\n // D:\\\\entornotrabajo\\\\workspace-sgo\\\\persistance\\\\src\\\\main\\\\java\\\\es\\\\caser\\\\persistance\\\\sql\\\\antlr\\\\SQLGrammar.g:129:2: ( AND | OR )\r\n int alt23=2;\r\n int LA23_0 = input.LA(1);\r\n\r\n if ( (LA23_0==AND) ) {\r\n alt23=1;\r\n }\r\n else if ( (LA23_0==OR) ) {\r\n alt23=2;\r\n }\r\n else {\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 23, 0, input);\r\n\r\n throw nvae;\r\n }\r\n switch (alt23) {\r\n case 1 :\r\n // D:\\\\entornotrabajo\\\\workspace-sgo\\\\persistance\\\\src\\\\main\\\\java\\\\es\\\\caser\\\\persistance\\\\sql\\\\antlr\\\\SQLGrammar.g:129:4: AND\r\n {\r\n match(input,AND,FOLLOW_AND_in_operator527); \r\n out(\" and \");\r\n\r\n }\r\n break;\r\n case 2 :\r\n // D:\\\\entornotrabajo\\\\workspace-sgo\\\\persistance\\\\src\\\\main\\\\java\\\\es\\\\caser\\\\persistance\\\\sql\\\\antlr\\\\SQLGrammar.g:130:4: OR\r\n {\r\n match(input,OR,FOLLOW_OR_in_operator534); \r\n out(\" or \");\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n finally {\r\n }\r\n return ;\r\n }", "public final EObject ruleAnd() throws RecognitionException {\n EObject current = null;\n\n Token lv_operator_2_0=null;\n EObject this_RelationalExpression_0 = null;\n\n EObject lv_right_3_0 = null;\n\n\n enterRule(); \n \n try {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3903:28: ( (this_RelationalExpression_0= ruleRelationalExpression ( () ( (lv_operator_2_0= '&&' ) ) ( (lv_right_3_0= ruleRelationalExpression ) ) )* ) )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3904:1: (this_RelationalExpression_0= ruleRelationalExpression ( () ( (lv_operator_2_0= '&&' ) ) ( (lv_right_3_0= ruleRelationalExpression ) ) )* )\n {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3904:1: (this_RelationalExpression_0= ruleRelationalExpression ( () ( (lv_operator_2_0= '&&' ) ) ( (lv_right_3_0= ruleRelationalExpression ) ) )* )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3905:5: this_RelationalExpression_0= ruleRelationalExpression ( () ( (lv_operator_2_0= '&&' ) ) ( (lv_right_3_0= ruleRelationalExpression ) ) )*\n {\n \n newCompositeNode(grammarAccess.getAndAccess().getRelationalExpressionParserRuleCall_0()); \n \n pushFollow(FOLLOW_ruleRelationalExpression_in_ruleAnd8765);\n this_RelationalExpression_0=ruleRelationalExpression();\n\n state._fsp--;\n\n \n current = this_RelationalExpression_0; \n afterParserOrEnumRuleCall();\n \n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3913:1: ( () ( (lv_operator_2_0= '&&' ) ) ( (lv_right_3_0= ruleRelationalExpression ) ) )*\n loop35:\n do {\n int alt35=2;\n int LA35_0 = input.LA(1);\n\n if ( (LA35_0==59) ) {\n alt35=1;\n }\n\n\n switch (alt35) {\n \tcase 1 :\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3913:2: () ( (lv_operator_2_0= '&&' ) ) ( (lv_right_3_0= ruleRelationalExpression ) )\n \t {\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3913:2: ()\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3914:5: \n \t {\n\n \t current = forceCreateModelElementAndSet(\n \t grammarAccess.getAndAccess().getBooleanOperationLeftAction_1_0(),\n \t current);\n \t \n\n \t }\n\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3919:2: ( (lv_operator_2_0= '&&' ) )\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3920:1: (lv_operator_2_0= '&&' )\n \t {\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3920:1: (lv_operator_2_0= '&&' )\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3921:3: lv_operator_2_0= '&&'\n \t {\n \t lv_operator_2_0=(Token)match(input,59,FOLLOW_59_in_ruleAnd8792); \n\n \t newLeafNode(lv_operator_2_0, grammarAccess.getAndAccess().getOperatorAmpersandAmpersandKeyword_1_1_0());\n \t \n\n \t \t if (current==null) {\n \t \t current = createModelElement(grammarAccess.getAndRule());\n \t \t }\n \t \t\tsetWithLastConsumed(current, \"operator\", lv_operator_2_0, \"&&\");\n \t \t \n\n \t }\n\n\n \t }\n\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3934:2: ( (lv_right_3_0= ruleRelationalExpression ) )\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3935:1: (lv_right_3_0= ruleRelationalExpression )\n \t {\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3935:1: (lv_right_3_0= ruleRelationalExpression )\n \t // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:3936:3: lv_right_3_0= ruleRelationalExpression\n \t {\n \t \n \t \t newCompositeNode(grammarAccess.getAndAccess().getRightRelationalExpressionParserRuleCall_1_2_0()); \n \t \t \n \t pushFollow(FOLLOW_ruleRelationalExpression_in_ruleAnd8826);\n \t lv_right_3_0=ruleRelationalExpression();\n\n \t state._fsp--;\n\n\n \t \t if (current==null) {\n \t \t current = createModelElementForParent(grammarAccess.getAndRule());\n \t \t }\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"right\",\n \t \t\tlv_right_3_0, \n \t \t\t\"RelationalExpression\");\n \t \t afterParserOrEnumRuleCall();\n \t \t \n\n \t }\n\n\n \t }\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop35;\n }\n } while (true);\n\n\n }\n\n\n }\n\n leaveRule(); \n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }", "public FluentExp<Boolean> and (SQLExpression<Boolean> expr)\n {\n return Ops.and(this, expr);\n }", "private Data iff(Node line, Namespace namespace) {\n\n\t\tNode cond = line.next;\n\t\tNode a = cond.next;\n\t\tNode b = a.next;\n\t\t\n\t\tif (Boolean.TRUE.equals(e.eval(cond, namespace).value)) {\n\t\t\treturn e.eval(a, namespace);\n\t\t} else if (b != null) {\n\t\t\treturn e.eval(b, namespace);\n\t\t}\n\t\t\n\t\treturn NO_RESULT;\n\t}", "public Object visitBitwiseAndExpression(GNode n) {\n Object a, b, result;\n \n nonboolean = true;\n \n dostring = true;\n \n a = dispatch(n.getGeneric(0));\n b = dispatch(n.getGeneric(1));\n \n dostring = false;\n \n if (a instanceof Long && b instanceof Long) {\n result = (Long) a & (Long) b;\n }\n else {\n result = parens(a) + \" & \" + parens(b);\n }\n \n return result;\n }", "@Test\n \tpublic void whereClauseForNodeDirectPrecedence() {\n \t\tnode23.addJoin(new Precedence(node42, 1));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"=\", \"_node23.right_token\", \"_node42.left_token\", -1)\n \t\t);\n \t}", "public static RuntimeValue and(RuntimeValue left, RuntimeValue right) throws RuntimeException {\n if (isDiscreteBoolSamples(left, right)) {\n return new RuntimeValue(\n RuntimeValue.Type.DISCRETE_BOOL_SAMPLE,\n Operators.and(left.getDiscreteBoolSample(), right.getDiscreteBoolSample())\n );\n }\n\n throw new RuntimeException(\"AND-ing incompatible types\");\n }", "public final void rule__PredicateAnd__Group_1__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3667:1: ( ( '&&' ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3668:1: ( '&&' )\n {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3668:1: ( '&&' )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3669:1: '&&'\n {\n before(grammarAccess.getPredicateAndAccess().getAmpersandAmpersandKeyword_1_1()); \n match(input,28,FOLLOW_28_in_rule__PredicateAnd__Group_1__1__Impl7218); \n after(grammarAccess.getPredicateAndAccess().getAmpersandAmpersandKeyword_1_1()); \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 }", "private void checkBinaryOperation(Set<FlowAbstraction> in, Unit d, Set<FlowAbstraction> out) {\n if (d instanceof AbstractDefinitionStmt) {\n AbstractDefinitionStmt def = (AbstractDefinitionStmt) d;\n Value leftSide = def.getLeftOp();\n Value rightSide = def.getRightOp();\n if(leftSide instanceof Local && rightSide instanceof AbstractBinopExpr) {\n AbstractBinopExpr expr = (AbstractBinopExpr) rightSide;\n FlowAbstraction taint1 = isInTaintedSet(expr.getOp1(), in);\n FlowAbstraction taint2 = isInTaintedSet(expr.getOp2(), in);\n if(taint1 != null || taint2 != null) {\n taint(leftSide, d, out);\n }\n }\n }\n }", "public boolean isConjunction() {\r\n\t\treturn conjunction;\r\n\t}", "public Snippet visit(ConditionalAndExpression n, Snippet argu) {\n\t Snippet _ret= new Snippet(\"\",\"\",null,false);\n\t Snippet f0 = n.identifier.accept(this, argu);\n\t n.nodeToken.accept(this, argu);\n\t Snippet f2 = n.identifier1.accept(this, argu);\n\t _ret.returnTemp = f0.returnTemp+\" && \"+f2.returnTemp;\n\t return _ret;\n\t }", "@Override\n protected boolean runInEQ() {\n return true;\n }", "public boolean getInputsRelated(){\n return inputsRelated;\n }", "@Override\n\tpublic void visit(BitwiseAnd arg0) {\n\t\t\n\t}", "@OperationMeta(opType = OperationType.INFIX)\n public static boolean implies(boolean b1, boolean b2) {\n return !b1 || b2;\n }", "public final EObject ruleBitwiseAndExpression() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_2=null;\r\n EObject this_LogicalRelationExpression_0 = null;\r\n\r\n EObject lv_rightOperand_3_0 = null;\r\n\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2870:28: ( (this_LogicalRelationExpression_0= ruleLogicalRelationExpression ( () otherlv_2= '&' ( (lv_rightOperand_3_0= ruleLogicalRelationExpression ) ) )* ) )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2871:1: (this_LogicalRelationExpression_0= ruleLogicalRelationExpression ( () otherlv_2= '&' ( (lv_rightOperand_3_0= ruleLogicalRelationExpression ) ) )* )\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2871:1: (this_LogicalRelationExpression_0= ruleLogicalRelationExpression ( () otherlv_2= '&' ( (lv_rightOperand_3_0= ruleLogicalRelationExpression ) ) )* )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2872:5: this_LogicalRelationExpression_0= ruleLogicalRelationExpression ( () otherlv_2= '&' ( (lv_rightOperand_3_0= ruleLogicalRelationExpression ) ) )*\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n newCompositeNode(grammarAccess.getBitwiseAndExpressionAccess().getLogicalRelationExpressionParserRuleCall_0()); \r\n \r\n }\r\n pushFollow(FOLLOW_ruleLogicalRelationExpression_in_ruleBitwiseAndExpression6592);\r\n this_LogicalRelationExpression_0=ruleLogicalRelationExpression();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n \r\n current = this_LogicalRelationExpression_0; \r\n afterParserOrEnumRuleCall();\r\n \r\n }\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2880:1: ( () otherlv_2= '&' ( (lv_rightOperand_3_0= ruleLogicalRelationExpression ) ) )*\r\n loop46:\r\n do {\r\n int alt46=2;\r\n int LA46_0 = input.LA(1);\r\n\r\n if ( (LA46_0==52) ) {\r\n alt46=1;\r\n }\r\n\r\n\r\n switch (alt46) {\r\n \tcase 1 :\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2880:2: () otherlv_2= '&' ( (lv_rightOperand_3_0= ruleLogicalRelationExpression ) )\r\n \t {\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2880:2: ()\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2881:5: \r\n \t {\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t current = forceCreateModelElementAndSet(\r\n \t grammarAccess.getBitwiseAndExpressionAccess().getBitwiseAndExpressionLeftOperandAction_1_0(),\r\n \t current);\r\n \t \r\n \t }\r\n\r\n \t }\r\n\r\n \t otherlv_2=(Token)match(input,52,FOLLOW_52_in_ruleBitwiseAndExpression6613); if (state.failed) return current;\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t \tnewLeafNode(otherlv_2, grammarAccess.getBitwiseAndExpressionAccess().getAmpersandKeyword_1_1());\r\n \t \r\n \t }\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2890:1: ( (lv_rightOperand_3_0= ruleLogicalRelationExpression ) )\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2891:1: (lv_rightOperand_3_0= ruleLogicalRelationExpression )\r\n \t {\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2891:1: (lv_rightOperand_3_0= ruleLogicalRelationExpression )\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2892:3: lv_rightOperand_3_0= ruleLogicalRelationExpression\r\n \t {\r\n \t if ( state.backtracking==0 ) {\r\n \t \r\n \t \t newCompositeNode(grammarAccess.getBitwiseAndExpressionAccess().getRightOperandLogicalRelationExpressionParserRuleCall_1_2_0()); \r\n \t \t \r\n \t }\r\n \t pushFollow(FOLLOW_ruleLogicalRelationExpression_in_ruleBitwiseAndExpression6634);\r\n \t lv_rightOperand_3_0=ruleLogicalRelationExpression();\r\n\r\n \t state._fsp--;\r\n \t if (state.failed) return current;\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t \t if (current==null) {\r\n \t \t current = createModelElementForParent(grammarAccess.getBitwiseAndExpressionRule());\r\n \t \t }\r\n \t \t\tset(\r\n \t \t\t\tcurrent, \r\n \t \t\t\t\"rightOperand\",\r\n \t \t\tlv_rightOperand_3_0, \r\n \t \t\t\"LogicalRelationExpression\");\r\n \t \t afterParserOrEnumRuleCall();\r\n \t \t \r\n \t }\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop46;\r\n }\r\n } while (true);\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 }", "public boolean getOR() {\n return OR;\n }", "@Override\n public Node typeCheck() {\n if (!(FOOLlib.isSubtype(left.typeCheck(), new BoolTypeNode()) &&\n FOOLlib.isSubtype(right.typeCheck(), new BoolTypeNode()))) {\n if(operator.equals(\"and\") || operator.equals(\"&&\")) {\n System.out.println(\"Non boolean in AND\");\n }\n else {\n System.out.println(\"Non boolean in OR\");\n }\n System.exit(0);\n }\n //se i tipi sono corretti restituisco bool\n return new BoolTypeNode();\n }", "private boolean isIncluded(ArrayList<Instance> inputs, Instance ins){\n boolean isAdded = false;\n for (Instance i: inputs){\n if (i == ins)\n return true;\n Concept temp = i.getConcept();\n while (true){\n if (temp == null)\n break;\n if (temp == ins.getConcept())\n return true;\n temp = temp.getSuperConcept(); \n }\n }\n return isAdded;\n }", "public static BinaryExpression andAlso(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }", "@Override\n\tpublic void visit(BitwiseAnd arg0) {\n\n\t}", "public static void main(String args[]) {\n boolean hasSATscore = true;\n boolean hasHighSchoolTranscript = true;\n boolean isInternational=false;\n boolean hasTOFELscore=false;\n\n /*\n * logical_step2: Check if the applicant is eligible to apply to the university\n * logical_step_details: the applicant must have a SAT score, a high school transcript and must have TOEFL score\n * if is an international student.\n * question_1: What does the following block of code do?\n * answer 1: Check if the applicant is eligible to apply to the university\n * question_2: What is the data type of the variable isElig?\n * answer 2: isElig is a Boolean data type\n * question_3: What is the value of: !isInternational. (value assigned above)\n * answer_3: the value of !isInternational is true\n * question_4: What is the output the following block of code?\n * answer_4: the code displays the following statement \"You eligibility requirement has been evaluated to :true\"\n */\n\n /*\n * stm_comment: isElig contains result of logical operation between the variables. logical and (&&), logical or(||) and not operator is used \n * question_1: Please explain how the value of isElig evaluated.\n * answer_1: isElig contains result of logical operation between the variables\n * question_2: Please state the operators used in the code block below.\n * answer_2: logical and (&&), logical or(||) and not operator is used .\n *\n */\n\n boolean isElig = hasSATscore && hasHighSchoolTranscript && (!isInternational || (isInternational && hasTOFELscore));\n System.out.println(\" Your eligibility requirement has been evaluated to :\" +isElig );\n\n\n }", "public final void rule__AstExpressionAnd__OperatorAlternatives_1_1_0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2818:1: ( ( '&&' ) | ( 'and' ) )\n int alt13=2;\n int LA13_0 = input.LA(1);\n\n if ( (LA13_0==17) ) {\n alt13=1;\n }\n else if ( (LA13_0==18) ) {\n alt13=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 13, 0, input);\n\n throw nvae;\n }\n switch (alt13) {\n case 1 :\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2819:1: ( '&&' )\n {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2819:1: ( '&&' )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2820:1: '&&'\n {\n before(grammarAccess.getAstExpressionAndAccess().getOperatorAmpersandAmpersandKeyword_1_1_0_0()); \n match(input,17,FOLLOW_17_in_rule__AstExpressionAnd__OperatorAlternatives_1_1_06085); \n after(grammarAccess.getAstExpressionAndAccess().getOperatorAmpersandAmpersandKeyword_1_1_0_0()); \n\n }\n\n\n }\n break;\n case 2 :\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2827:6: ( 'and' )\n {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2827:6: ( 'and' )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2828:1: 'and'\n {\n before(grammarAccess.getAstExpressionAndAccess().getOperatorAndKeyword_1_1_0_1()); \n match(input,18,FOLLOW_18_in_rule__AstExpressionAnd__OperatorAlternatives_1_1_06105); \n after(grammarAccess.getAstExpressionAndAccess().getOperatorAndKeyword_1_1_0_1()); \n\n }\n\n\n }\n break;\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 final EObject ruleAndOperator() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_1=null;\r\n Token otherlv_2=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:4468:28: ( ( () (otherlv_1= 'and' | otherlv_2= '&&' ) ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4469:1: ( () (otherlv_1= 'and' | otherlv_2= '&&' ) )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4469:1: ( () (otherlv_1= 'and' | otherlv_2= '&&' ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4469:2: () (otherlv_1= 'and' | otherlv_2= '&&' )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4469:2: ()\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4470:5: \r\n {\r\n if ( state.backtracking==0 ) {\r\n\r\n current = forceCreateModelElement(\r\n grammarAccess.getAndOperatorAccess().getAndOperatorAction_0(),\r\n current);\r\n \r\n }\r\n\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:4475:2: (otherlv_1= 'and' | otherlv_2= '&&' )\r\n int alt53=2;\r\n int LA53_0 = input.LA(1);\r\n\r\n if ( (LA53_0==51) ) {\r\n alt53=1;\r\n }\r\n else if ( (LA53_0==52) ) {\r\n alt53=2;\r\n }\r\n else {\r\n if (state.backtracking>0) {state.failed=true; return current;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 53, 0, input);\r\n\r\n throw nvae;\r\n }\r\n switch (alt53) {\r\n case 1 :\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4475:4: otherlv_1= 'and'\r\n {\r\n otherlv_1=(Token)match(input,51,FOLLOW_51_in_ruleAndOperator9750); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_1, grammarAccess.getAndOperatorAccess().getAndKeyword_1_0());\r\n \r\n }\r\n\r\n }\r\n break;\r\n case 2 :\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4480:7: otherlv_2= '&&'\r\n {\r\n otherlv_2=(Token)match(input,52,FOLLOW_52_in_ruleAndOperator9768); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_2, grammarAccess.getAndOperatorAccess().getAmpersandAmpersandKeyword_1_1());\r\n \r\n }\r\n\r\n }\r\n break;\r\n\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 }", "private boolean canJoinTuples() {\n if (predicate == null)\n return true;\n\n environment.clear();\n environment.addTuple(leftSchema, leftTuple);\n environment.addTuple(rightSchema, rightTuple);\n\n return predicate.evaluatePredicate(environment);\n }", "public boolean getOR() {\n return OR;\n }", "public void setAndOr (String AndOr);", "public final EObject ruleLogicalAndExpression() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_2=null;\r\n EObject this_LogicalNotExpression_0 = null;\r\n\r\n EObject lv_rightOperand_3_0 = null;\r\n\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2637:28: ( (this_LogicalNotExpression_0= ruleLogicalNotExpression ( () otherlv_2= '&&' ( (lv_rightOperand_3_0= ruleLogicalNotExpression ) ) )* ) )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2638:1: (this_LogicalNotExpression_0= ruleLogicalNotExpression ( () otherlv_2= '&&' ( (lv_rightOperand_3_0= ruleLogicalNotExpression ) ) )* )\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2638:1: (this_LogicalNotExpression_0= ruleLogicalNotExpression ( () otherlv_2= '&&' ( (lv_rightOperand_3_0= ruleLogicalNotExpression ) ) )* )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2639:5: this_LogicalNotExpression_0= ruleLogicalNotExpression ( () otherlv_2= '&&' ( (lv_rightOperand_3_0= ruleLogicalNotExpression ) ) )*\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n newCompositeNode(grammarAccess.getLogicalAndExpressionAccess().getLogicalNotExpressionParserRuleCall_0()); \r\n \r\n }\r\n pushFollow(FOLLOW_ruleLogicalNotExpression_in_ruleLogicalAndExpression6039);\r\n this_LogicalNotExpression_0=ruleLogicalNotExpression();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n \r\n current = this_LogicalNotExpression_0; \r\n afterParserOrEnumRuleCall();\r\n \r\n }\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2647:1: ( () otherlv_2= '&&' ( (lv_rightOperand_3_0= ruleLogicalNotExpression ) ) )*\r\n loop42:\r\n do {\r\n int alt42=2;\r\n int LA42_0 = input.LA(1);\r\n\r\n if ( (LA42_0==48) ) {\r\n alt42=1;\r\n }\r\n\r\n\r\n switch (alt42) {\r\n \tcase 1 :\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2647:2: () otherlv_2= '&&' ( (lv_rightOperand_3_0= ruleLogicalNotExpression ) )\r\n \t {\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2647:2: ()\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2648:5: \r\n \t {\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t current = forceCreateModelElementAndSet(\r\n \t grammarAccess.getLogicalAndExpressionAccess().getLogicalAndExpressionLeftOperandAction_1_0(),\r\n \t current);\r\n \t \r\n \t }\r\n\r\n \t }\r\n\r\n \t otherlv_2=(Token)match(input,48,FOLLOW_48_in_ruleLogicalAndExpression6060); if (state.failed) return current;\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t \tnewLeafNode(otherlv_2, grammarAccess.getLogicalAndExpressionAccess().getAmpersandAmpersandKeyword_1_1());\r\n \t \r\n \t }\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2657:1: ( (lv_rightOperand_3_0= ruleLogicalNotExpression ) )\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2658:1: (lv_rightOperand_3_0= ruleLogicalNotExpression )\r\n \t {\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2658:1: (lv_rightOperand_3_0= ruleLogicalNotExpression )\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2659:3: lv_rightOperand_3_0= ruleLogicalNotExpression\r\n \t {\r\n \t if ( state.backtracking==0 ) {\r\n \t \r\n \t \t newCompositeNode(grammarAccess.getLogicalAndExpressionAccess().getRightOperandLogicalNotExpressionParserRuleCall_1_2_0()); \r\n \t \t \r\n \t }\r\n \t pushFollow(FOLLOW_ruleLogicalNotExpression_in_ruleLogicalAndExpression6081);\r\n \t lv_rightOperand_3_0=ruleLogicalNotExpression();\r\n\r\n \t state._fsp--;\r\n \t if (state.failed) return current;\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t \t if (current==null) {\r\n \t \t current = createModelElementForParent(grammarAccess.getLogicalAndExpressionRule());\r\n \t \t }\r\n \t \t\tset(\r\n \t \t\t\tcurrent, \r\n \t \t\t\t\"rightOperand\",\r\n \t \t\tlv_rightOperand_3_0, \r\n \t \t\t\"LogicalNotExpression\");\r\n \t \t afterParserOrEnumRuleCall();\r\n \t \t \r\n \t }\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop42;\r\n }\r\n } while (true);\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\n public boolean impliesCondition(ConditionPart part, List<MatchingPart> leadingParts) {\n return SubsetEvaluator.isSubset(part.getCondition(), Conditions.equal(getValue()));\n }", "public void visit(ExclusiveOrExpression n) {\n n.f0.accept(this);\n n.f1.accept(this);\n }", "public And(Formula f1, Formula f2) {\n\t\tsuper(f1, f2);\n\t}", "public boolean isOperand(){\n return false;\n }", "public static BinaryExpression and(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }", "boolean distinct(Node qNode) {\n switch (type()) {\n\n case UNION:\n //case OPTION:\n boolean success = false;\n for (Exp ee : this) {\n success = ee.distinct(qNode) || success;\n }\n if (success) {\n return true;\n }\n break;\n\n case AND:\n case BGP:\n case GRAPH:\n\n for (int i = 0; i < size(); i++) {\n Exp exp = get(i);\n switch (exp.type()) {\n case EDGE:\n case PATH:\n case XPATH:\n case EVAL:\n //Edge edge = exp.getEdge();\n if (exp.contains(qNode)) {\n add(i + 1, Exp.create(ACCEPT, qNode));\n return true;\n }\n break;\n\n case AND:\n case GRAPH:\n case UNION:\n //case OPTION:\n if (exp.distinct(qNode)) {\n return true;\n }\n\n break;\n\n }\n }\n }\n\n return false;\n }", "public Type visit(If n) {\n\t\tif (!(n.e.accept(this) instanceof BooleanType)) {\n\t\t\t//Erro:\n\t\t\tSystem.out.println(\"A condição do if deve ser do tipo Boolean\");\n\t\t}\n\n\t\tn.s1.accept(this);\n\t\tn.s2.accept(this);\n\t\treturn new BooleanType();\n\t}" ]
[ "0.60093015", "0.59919006", "0.5842405", "0.5758164", "0.5694268", "0.5645351", "0.5625509", "0.56147057", "0.55822325", "0.5572603", "0.5571026", "0.55516416", "0.55398375", "0.5522207", "0.5502901", "0.5496837", "0.5495677", "0.54543895", "0.54356337", "0.5428853", "0.54109895", "0.54037595", "0.5394066", "0.5381857", "0.53807724", "0.5379268", "0.5365503", "0.53537583", "0.5338719", "0.533132", "0.5320392", "0.53197104", "0.53155214", "0.5307027", "0.5306786", "0.5304539", "0.5300728", "0.52929825", "0.5288139", "0.52875274", "0.5273653", "0.5264697", "0.5263406", "0.52539754", "0.5246975", "0.52380514", "0.5226241", "0.52233756", "0.52218115", "0.5203623", "0.5202874", "0.5199706", "0.5198106", "0.5197699", "0.51916414", "0.5188522", "0.51883614", "0.5187224", "0.5184861", "0.51758194", "0.51596993", "0.5150181", "0.51397926", "0.51343435", "0.51025903", "0.50995994", "0.5095855", "0.5094331", "0.50924635", "0.50898427", "0.50805163", "0.50738496", "0.50688195", "0.5064763", "0.50607836", "0.5060649", "0.5046512", "0.50448996", "0.50336516", "0.50245684", "0.50010055", "0.49954718", "0.49938044", "0.4986876", "0.4986471", "0.49738014", "0.4970807", "0.49641386", "0.4956264", "0.494894", "0.49466616", "0.49442717", "0.49418715", "0.4938193", "0.4936976", "0.49367094", "0.49253854", "0.49225858", "0.49147704", "0.49117142", "0.48992667" ]
0.0
-1
The class holding records for this type
@Override public Class<SessionPollRecord> getRecordType() { return SessionPollRecord.class; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RecordRecord() {\n\t\tsuper(org.jooq.examples.cubrid.demodb.tables.Record.RECORD);\n\t}", "public Class<?> getRecordClass() \n\t{\n\t return recordClass ;\n\t}", "public DataRecord() {\n super(DataTable.DATA);\n }", "@Override\n public Class<Record> getRecordType() {\n return Record.class;\n }", "@Override\n public Class<Record> getRecordType() {\n return Record.class;\n }", "@Override\n public Class<Record> getRecordType() {\n return Record.class;\n }", "@Override\n public Class<Record> getRecordType() {\n return Record.class;\n }", "public Record() {\n data = new int[DatabaseManager.fieldNames.length];\n }", "@Override\n public Class<PgClassRecord> getRecordType() {\n return PgClassRecord.class;\n }", "@Override\n public Class<ModelRecord> getRecordType() {\n return ModelRecord.class;\n }", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn __RECORD_TYPE;\n\t}", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn __RECORD_TYPE;\n\t}", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn __RECORD_TYPE;\n\t}", "public ARecord() {\n super(A.A);\n }", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn org.jooq.Record.class;\n\t}", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn org.jooq.Record.class;\n\t}", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn org.jooq.Record.class;\n\t}", "public ObjectRecord() {\n\t\tsuper(org.jooq.test.hsqldb.generatedclasses.tables.Object.OBJECT);\n\t}", "public WERecordDataModel()\n\t{\n\t\tsuper();\n\t\tsetEqFileName(RECORD_NAME);\n\t\tinitMessages();\n\t}", "public Record toRecord() {\n return new Record().setColumns(this);\n }", "DataHRecordData() {}", "@Override\n public Class<ResourcesRecord> getRecordType() {\n return ResourcesRecord.class;\n }", "public GO_RecordType() {\n }", "@Override\n public Class<QsRecord> getRecordType() {\n return QsRecord.class;\n }", "public ItemRecord() {\n super(Item.ITEM);\n }", "public Record getRecord() {\n return record;\n }", "public Record getRecord() {\n return record;\n }", "@Override\n\tpublic Class<Record> getRecordType() {\n\t\treturn Record.class;\n\t}", "@Override\n\tpublic Class<Record> getRecordType() {\n\t\treturn Record.class;\n\t}", "@Override\n public Class<LinearmodelRecord> getRecordType() {\n return LinearmodelRecord.class;\n }", "@JsonProperty(\"Records\") abstract List<?> getRecords();", "public Item_Record() {\n super(Item_.ITEM_);\n }", "@Override\n public Class<MytableRecord> getRecordType() {\n return MytableRecord.class;\n }", "@Override\n protected Class<RecordType> getBoundType() {\n return RecordType.class;\n }", "@Override\n public Class<PatientRecord> getRecordType() {\n return PatientRecord.class;\n }", "public interface CollectionRecord {\n\n\t/**\n\t * Gets the id attribute of the CollectionRecord object\n\t *\n\t * @return The id value\n\t */\n\tpublic String getId();\n\n\n\t/**\n\t * Gets the setSpec attribute of the CollectionRecord object\n\t *\n\t * @return The setSpec value\n\t */\n\tpublic String getSetSpec();\n\n\n\t/**\n\t * Gets the metadataHandle attribute of the CollectionRecord object\n\t *\n\t * @param collectionSetSpec setSpec (e.g., \"dcc\")\n\t * @return The metadataHandle value\n\t * @exception Exception if there is a webservice error\n\t */\n\tpublic String getMetadataHandle(String collectionSetSpec) throws Exception;\n\n\n\t/**\n\t * Gets the handleServiceBaseUrl attribute of the CollectionRecord object\n\t *\n\t * @return The handleServiceBaseUrl value\n\t */\n\tpublic String getHandleServiceBaseUrl();\n\n\t/* \tpublic String getNativeFormat();\n\tpublic DcsDataRecord getDcsDataRecord();\n\tpublic MetaDataFramework getMetaDataFramework();\n\tpublic Document getLocalizedDocument(); */\n}", "@Override\n\tpublic Class<QuotesRecord> getRecordType() {\n\t\treturn QuotesRecord.class;\n\t}", "@Override\n public Class<AnalysisRecord> getRecordType() {\n return AnalysisRecord.class;\n }", "public Record() {\n this.symptoms = new LinkedHashSet<>();\n this.diagnoses = new LinkedHashSet<>();\n this.prescriptions = new LinkedHashSet<>();\n }", "public OpenERPRecordSet() {\r\n\t\trecords = new Vector<OpenERPRecord>();\r\n\t}", "@Override\n public Class<QuestionForBuddysRecord> getRecordType() {\n return QuestionForBuddysRecord.class;\n }", "public QuestionsRecord() {\n\t\tsuper(sooth.entities.tables.Questions.QUESTIONS);\n\t}", "public Data() {\n this.customers = new HashMap<>();\n this.orders = new HashMap<>();\n this.siteVisits = new HashMap<>();\n this.imageUploads = new HashMap<>();\n }", "public GenericData.Record serialize() {\n return null;\n }", "public GenericTcalRecord() {\n this(-1);\n }", "public StudentRecord() {\n\t\tscores = new ArrayList<>();\n\t\taverages = new double[5];\n\t}", "@Override\n public Class<CarmodelRecord> getRecordType() {\n return CarmodelRecord.class;\n }", "@Override\n public Class<MemberRecord> getRecordType() {\n return MemberRecord.class;\n }", "public BookRecord() {\n super(Book.BOOK);\n }", "@Override\n public Class<SearchLogsRecord> getRecordType() {\n return SearchLogsRecord.class;\n }", "@Override\n public Class<EasytaxTaxationsRecord> getRecordType() {\n return EasytaxTaxationsRecord.class;\n }", "public SalesRecords() {\n super();\n }", "public SongRecord(){\n\t}", "@Override\n public Class<LangsRecord> getRecordType() {\n return LangsRecord.class;\n }", "public PersonRecord(){\n\t\tlistNames = new ArrayList<String>();\n\t}", "@Override\n public Class<RoomRecord> getRecordType() {\n return RoomRecord.class;\n }", "@Override\n public Class<CalcIndicatorAccRecordInstanceRecord> getRecordType() {\n return CalcIndicatorAccRecordInstanceRecord.class;\n }", "public ArrayList<Record> getRecords() {\r\n\t\treturn records;\r\n\t}", "@Override\n public Class<CourseRecord> getRecordType() {\n return CourseRecord.class;\n }", "@Override\n public Class<CabTripDataRecord> getRecordType() {\n return CabTripDataRecord.class;\n }", "@Override\n public Class<TripsRecord> getRecordType() {\n return TripsRecord.class;\n }", "public Item_Record(Integer _Id_, String name_, String description_, String code_, Double price_, Double retailPrice_, Double costPrice_, Object _Search_, String[] _Types_, String _LastModified_, Integer _Version_) {\n super(Item_.ITEM_);\n\n set(0, _Id_);\n set(1, name_);\n set(2, description_);\n set(3, code_);\n set(4, price_);\n set(5, retailPrice_);\n set(6, costPrice_);\n set(7, _Search_);\n set(8, _Types_);\n set(9, _LastModified_);\n set(10, _Version_);\n }", "@Override\r\n\tpublic List<T> getRecords() {\n\t\treturn null;\r\n\t}", "@Override\n public Class<StudentCourseRecord> getRecordType() {\n return StudentCourseRecord.class;\n }", "@Override\n public Class<ZTest1Record> getRecordType() {\n return ZTest1Record.class;\n }", "public OfcRecordRecord() {\n\t\tsuper(org.openforis.collect.persistence.jooq.tables.OfcRecord.OFC_RECORD);\n\t}", "public Class<gDBR> getRecordClass() \n {\n return this.rcdClass;\n }", "public RecordingRepository() {\r\n recordings = new ArrayList<>();\r\n recordingMap = new HashMap<>();\r\n recordingsByMeetingIDMap = new HashMap<>();\r\n update();\r\n }", "@Override\n public Class<GchCarLifeBbsRecord> getRecordType() {\n return GchCarLifeBbsRecord.class;\n }", "@Override\n\tpublic java.lang.Class<nesi.jobs.tables.records.HourlyRecordRecord> getRecordType() {\n\t\treturn nesi.jobs.tables.records.HourlyRecordRecord.class;\n\t}", "@Override\n public Class<AccountRecord> getRecordType() {\n return AccountRecord.class;\n }", "public ExperimentRecord() {\n super(Experiment.EXPERIMENT);\n }", "public MealRecord() {\n\t\tsuper(Meal.MEAL);\n\t}", "@Override\n public Class<StaffRecord> getRecordType() {\n return StaffRecord.class;\n }", "public LateComingRecord() {\n\t\t}", "@Override\n public Class<AssessmentStudenttrainingworkflowRecord> getRecordType() {\n return AssessmentStudenttrainingworkflowRecord.class;\n }", "public UsersRecord() {\n super(Users.USERS);\n }", "@Override\n public Class<MyMenuRecord> getRecordType() {\n return MyMenuRecord.class;\n }", "public DataPersistence() {\n storage = new HashMap<>();\n idCounter = 0;\n }", "public AnswerRecord() {\n super(Answer.ANSWER);\n }", "public DatasetReader()\n\t{\n\t\treviews = new ArrayList<Review>();\n\t\tratings = new HashMap<Double,List<Double>>();\n\t\tproducts = new HashMap<String, Map<String,Double>>();\n\t\tproductRatings = new HashMap<String, List<Double>>();\n\t\treInstanceList = new ArrayList<ReviewInstance>();\n\t\treInstanceMap = new HashMap<String, ReviewInstance>();\n\t}", "@Override\n public Class<JournalEntryLineRecord> getRecordType() {\n return JournalEntryLineRecord.class;\n }", "@Override\n public Class<CommentsRecord> getRecordType() {\n return CommentsRecord.class;\n }", "@Override\n public Class<SpeedAlertsHistoryRecord> getRecordType() {\n return SpeedAlertsHistoryRecord.class;\n }", "@Override\n public Class<RatingsRecord> getRecordType() {\n return RatingsRecord.class;\n }", "@Override\n public Class<TOpLogsRecord> getRecordType() {\n return TOpLogsRecord.class;\n }", "@Override\n\tpublic java.lang.Class<net.user1.union.zz.common.model.tables.records.ZzcronRecord> getRecordType() {\n\t\treturn __RECORD_TYPE;\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic RelationClass() {\n\t\t\n\t\tParser pars = new Parser(FILE_NAME); \t\t\t\t\t\t\t\n\t\tint bucketlength = 0;\n\t\tbucketlength = (int) (pars.getNumOfLines()*BUCKET_MULTIPLIER);\n\t\tbuckets = (Node<k,v>[]) new Node<?,?>[bucketlength];\n\t\tpars.process(this);\t\t\t\t\t\t\t\t\t\t\t\t\n\t}", "@Override\n\tpublic java.lang.Class<persistencia.tables.records.AsientoRecord> getRecordType() {\n\t\treturn persistencia.tables.records.AsientoRecord.class;\n\t}", "@Override\n public Class<StatsRecord> getRecordType() {\n return StatsRecord.class;\n }", "@Override\n\tpublic Class<QuestionRecord> getRecordType() {\n\t\treturn QuestionRecord.class;\n\t}", "public MetricSchemaRecord() { }", "public PedidoRecord() {\n super(Pedido.PEDIDO);\n }", "@Override\n public Class<DynamicSchemaRecord> getRecordType() {\n return DynamicSchemaRecord.class;\n }", "public PersonRecord() {}", "@Override\n\tpublic Class<RentalRecord> getRecordType() {\n\t\treturn RentalRecord.class;\n\t}", "public PagesRecord() {\n super(Pages.PAGES);\n }", "@Override\n public Class<AbsenceRecord> getRecordType() {\n return AbsenceRecord.class;\n }", "@Override\n public Class<RedpacketConsumingRecordsRecord> getRecordType() {\n return RedpacketConsumingRecordsRecord.class;\n }", "@Override\n\tpublic java.lang.Class<jooq.model.tables.records.TBasicSalaryRecord> getRecordType() {\n\t\treturn jooq.model.tables.records.TBasicSalaryRecord.class;\n\t}", "public YearlyRecord() {\n this.wordToCount = new HashMap<String, Integer>();\n this.wordToRank = new HashMap<String, Integer>();\n this.countToWord = new HashMap<Integer, Set<String>>();\n }" ]
[ "0.68004626", "0.66954035", "0.64103794", "0.6398801", "0.6398801", "0.6398801", "0.6398801", "0.6393993", "0.6354873", "0.6192012", "0.61258304", "0.61258304", "0.61258304", "0.6104736", "0.60470754", "0.60470754", "0.60470754", "0.6040716", "0.6029211", "0.6020949", "0.6008978", "0.60082155", "0.6006576", "0.59716636", "0.59703285", "0.5949182", "0.5949182", "0.59396815", "0.59396815", "0.5936131", "0.5935658", "0.5895888", "0.5895527", "0.5893964", "0.5884042", "0.58751285", "0.58681023", "0.5865894", "0.5864961", "0.5855157", "0.5851545", "0.58495414", "0.58392423", "0.58338994", "0.58154637", "0.58069575", "0.57927567", "0.578939", "0.57841045", "0.5779981", "0.5753099", "0.5741735", "0.57333666", "0.57321835", "0.5731796", "0.57317585", "0.572287", "0.5720141", "0.5712233", "0.56939065", "0.56927073", "0.5685293", "0.56847894", "0.5683809", "0.56834316", "0.56828403", "0.56666017", "0.56607187", "0.56579894", "0.5648655", "0.56438047", "0.5620551", "0.561873", "0.5609984", "0.55931836", "0.55871445", "0.5586237", "0.55789423", "0.55779636", "0.55737203", "0.55702287", "0.55692416", "0.5561011", "0.5559403", "0.5543905", "0.5541634", "0.5536858", "0.5522634", "0.5517553", "0.5517258", "0.5512109", "0.5509594", "0.55070907", "0.5496529", "0.54921997", "0.5491354", "0.5486711", "0.5481696", "0.54758567", "0.5471066", "0.54659206" ]
0.0
-1
Create a public.session_poll table reference
public SessionPoll() { this("session_poll", null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createPollTables(DataSource ds) {\n\t\tConnection con = null;\n\t\ttry {\n\t\t\tcon = ds.getConnection();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tPreparedStatement pst = null;\n\t\ttry {\n\t\t\tpst = con.prepareStatement(\n\t\t\t\t\t\"CREATE TABLE Polls\\r\\n\" + \"(id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,\\r\\n\"\n\t\t\t\t\t\t\t+ \"title VARCHAR(150) NOT NULL,\\r\\n\" + \"message CLOB(2048) NOT NULL\\r\\n\" + \")\");\n\t\t\tpst.execute();\n\n\t\t} catch (SQLException ex) {\n\t\t\tif (!ex.getSQLState().equals(\"X0Y32\"))\n\t\t\t\tex.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tpst.close();\n\t\t\t} catch (SQLException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tpst = con.prepareStatement(\n\t\t\t\t\t\"CREATE TABLE PollOptions\\r\\n\" + \"(id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,\\r\\n\"\n\t\t\t\t\t\t\t+ \"optionTitle VARCHAR(100) NOT NULL,\\r\\n\" + \"optionLink VARCHAR(150) NOT NULL,\\r\\n\"\n\t\t\t\t\t\t\t+ \"pollID BIGINT,\\r\\n\" + \"votesCount BIGINT,\\r\\n\"\n\t\t\t\t\t\t\t+ \"FOREIGN KEY (pollID) REFERENCES Polls(id)\\r\\n\" + \")\");\n\t\t\tpst.executeUpdate();\n\n\t\t} catch (SQLException ex) {\n\t\t\tif (!ex.getSQLState().equals(\"X0Y32\"))\n\t\t\t\tex.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tpst.close();\n\t\t\t} catch (SQLException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tcon.close();\n\t\t} catch (SQLException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "protected void createTableListenings() {\n\t\tString query = \n\t\t\t\t\"CREATE TABLE IF NOT EXISTS Listenings (\" \t\t\t\t\t\t\t+\n\t\t\t\t\"user\t\t\tVARCHAR(128),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"track\t\t\tVARCHAR(259),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"playcount\t\tINTEGER,\" \t\t\t\t\t\t\t\t\t\t\t+ \n\t\t\t\t\"FOREIGN KEY (user) REFERENCES Persons(lfm_username),\" \t\t\t\t+\n\t\t\t\t\"FOREIGN KEY (listens_to) REFERENCES Recordings(unique_track)\"\t\t+\n\t\t\t\t\");\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t;\n\t\tcreateTable(query);\n\t}", "public SessionPoll(String alias) {\n\t\tthis(alias, SESSION_POLL);\n\t}", "private void addDataToPollTables(DataSource ds) {\n\t\tConnection con = null;\n\t\ttry {\n\t\t\tcon = ds.getConnection();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tStatement pst = null;\n\t\ttry {\n\t\t\tpst = con.createStatement();\n\t\t\tResultSet rs = pst.executeQuery(\"SELECT * FROM Polls\");\n\t\t\tif (!rs.next()) {\n\t\t\t\t//@formatter:off\n\t\t\t\tpst.executeUpdate(\"INSERT INTO Polls(title, message) VALUES('Glasanje za omiljeni bend:', 'Od sljedećih bendova, koji Vam je bend najdraži? Kliknite na link kako biste glasali!')\", Statement.RETURN_GENERATED_KEYS);\n\t\t\t\t\n\t\t\t\trs = pst.getGeneratedKeys();\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif(rs != null && rs.next()) {\n\t\t\t\t\t\tlong id1 = rs.getLong(1);\n\t\t\t\t\t\tpst.executeUpdate(\"INSERT INTO PollOptions(optionTitle, optionLink, pollID, votesCount) VALUES('The Mamas And The Papas', 'https://www.youtube.com/watch?v=N-aK6JnyFmk', \"+id1+\", 27)\");\n\t\t\t\t\t\tpst.executeUpdate(\"INSERT INTO PollOptions(optionTitle, optionLink, pollID, votesCount) VALUES('The Everly Brothers', 'https://www.youtube.com/watch?v=tbU3zdAgiX8', \"+id1+\", 25)\");\n\t\t\t\t\t\tpst.executeUpdate(\"INSERT INTO PollOptions(optionTitle, optionLink, pollID, votesCount) VALUES('The Beach Boys', 'https://www.youtube.com/watch?v=2s4slliAtQU', \"+id1+\", 150)\");\n\t\t\t\t\t\tpst.executeUpdate(\"INSERT INTO PollOptions(optionTitle, optionLink, pollID, votesCount) VALUES('The Marcels', 'https://www.youtube.com/watch?v=qoi3TH59ZEs', \"+id1+\", 33)\");\n\t\t\t\t\t\tpst.executeUpdate(\"INSERT INTO PollOptions(optionTitle, optionLink, pollID, votesCount) VALUES('The Four Seasons', 'https://www.youtube.com/watch?v=y8yvnqHmFds', \"+id1+\", 20)\");\n\t\t\t\t\t\tpst.executeUpdate(\"INSERT INTO PollOptions(optionTitle, optionLink, pollID, votesCount) VALUES('The Platters', 'https://www.youtube.com/watch?v=H2di83WAOhU', \"+id1+\", 60)\");\n\t\t\t\t\t\tpst.executeUpdate(\"INSERT INTO PollOptions(optionTitle, optionLink, pollID, votesCount) VALUES('The Beatles', 'https://www.youtube.com/watch?v=z9ypq6_5bsg', \"+id1+\", 150)\");\n\t\t\t\t\t}\n\t\t\t\t} finally {\n//\t\t\t\t\ttry {\n//\t\t\t\t\t\trs.close();\n//\t\t\t\t\t} catch (Exception ignorable) {\n//\t\t\t\t\t}\n\t\t\t\t\ttry { rs.close(); } catch(SQLException ex) {\n\t\t\t\t\t\tex.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpst.executeUpdate(\"INSERT INTO Polls(title, message) VALUES('Favourite month od year:', 'What month of the year do you like the most? Refer to pics on link if unsure and pick one to vote!')\", Statement.RETURN_GENERATED_KEYS);\n\t\t\t\trs = pst.getGeneratedKeys();\n\t\t\t\ttry {\n\t\t\t\t\tif(rs != null && rs.next()) {\n\t\t\t\t\t\tlong id2 = rs.getLong(1);\n\t\t\t\t\t\tString[] months = new String[] {\"january\", \"february\", \"march\", \"april\", \"may\", \"june\", \"july\", \"august\", \"september\", \"october\", \"november\", \"december\"};\n\t\t\t\t\t\tfor(String m: months) {\n\t\t\t\t\t\t\tpst.executeUpdate(\"INSERT INTO PollOptions(optionTitle, optionLink, pollID, votesCount) VALUES('\"+m+\"', 'https://unsplash.com/search/photos/\"+m+\"', \"+id2+\", \"+new Random().nextInt(90)+\")\");\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t} finally {\n//\t\t\t\t\ttry {\n//\t\t\t\t\t\trs.close();\n//\t\t\t\t\t} catch (Exception ignorable) {\n//\t\t\t\t\t}\n\t\t\t\t\ttry { rs.close(); } catch(SQLException ex) {\n\t\t\t\t\t\tex.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//@formatter:on\n\t\t\t}\n\t\t} catch (SQLException ex) {\n\t\t\tex.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tpst.close();\n\t\t\t} catch (SQLException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tcon.close();\n\t\t} catch (SQLException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "private void createLoginTable() {\r\n jdbcExecutor.executeQuery(new Work() {\r\n @Override\r\n public void execute(Connection connection) throws SQLException {\r\n connection.createStatement().executeUpdate(\"CREATE TABLE login ( id numeric(19,0), user_id numeric(19,0), timestamp TIMESTAMP )\");\r\n }\r\n });\r\n }", "private void createTable() {\n try (Statement st = this.conn.createStatement()) {\n st.execute(\"CREATE TABLE IF NOT EXISTS users (user_id SERIAL PRIMARY KEY, name VARCHAR(100) NOT NULL, \"\n + \"login VARCHAR(100) UNIQUE NOT NULL, email VARCHAR(100) NOT NULL, createDate TIMESTAMP NOT NULL);\");\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic String createTable() {\n\t\t\t\treturn \"CREATE TABLE history_table_view(id number(8) primary key not null ,sqltext text, pointid varchar2(1024), type varchar2(100))\";\n\t}", "private EventHistoryTable() {}", "@Override\n\tpublic Class<SessionPollRecord> getRecordType() {\n\t\treturn SessionPollRecord.class;\n\t}", "private void createStocksTable() {\n\t\ttry {\n\t\t\tStatement stmt = this.conn.createStatement();\n\t\t\tstmt.executeUpdate(\"CREATE TABLE stocks \"\n\t\t\t\t\t+ \"(id BIGINT GENERATED ALWAYS AS IDENTITY, \" + \"owner INT, \"\n\t\t\t\t\t+ \"shareAmount INT, \" + \"purchasePrice DOUBLE, \" + \"symb VARCHAR(10), \"\n\t\t\t\t\t+ \"timePurchased BIGINT)\");\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"Created table stocks\");\n\t\t} catch (SQLException sqle) {\n\t\t\tSystem.err.println(\"Creation of stocks table FAILED\");\n\t\t\tSystem.err.println(sqle);\n\t\t}\n\t}", "@Override\n public String getDescription() {\n return \"Poll creation\";\n }", "public static void createTable() {\n\n // Create statement\n Statement statement = null;\n try {\n statement = Database.getDatabase().getConnection().createStatement();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n // Attempt to create table\n try {\n statement.execute(\n \"CREATE TABLE \" + Constants.SANITATION_TABLE + \"(\" +\n \"requestID INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),\" +\n \"nodeID VARCHAR(100) References \" + Constants.LOCATION_TABLE + \" (nodeID), \" +\n \"priority VARCHAR(10), \" +\n \"status VARCHAR(100), \" +\n \"description VARCHAR(100), \" +\n \"requesterID INT REFERENCES \" + Constants.USERS_TABLE + \"(userID), \" +\n \"requestTime TIMESTAMP, \" +\n \"servicerID INT REFERENCES \" + Constants.USERS_TABLE + \"(userID), \" +\n \"claimedTime TIMESTAMP, \" +\n \"completedTime TIMESTAMP, \" +\n \"CONSTRAINT priority_enum CHECK (priority in ('LOW', 'MEDIUM', 'HIGH')), \" +\n \"CONSTRAINT status_enum CHECK (status in ('INCOMPLETE', 'COMPLETE')))\"\n );\n } catch (SQLException | NullPointerException e) {\n e.printStackTrace();\n }\n }", "public void createTapTable(TableConfig tableConfig) throws ConfigurationException;", "public void createTable() {\r\n\t\tclient.createTable();\r\n\t}", "private void statsTable() {\n try (Connection connection = hikari.getConnection()) {\n try (PreparedStatement statement = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS `\" + TABLE_STATS + \"` \" +\n \"(id INT NOT NULL AUTO_INCREMENT UNIQUE, \" +\n \"uuid varchar(255) PRIMARY KEY, \" +\n \"name varchar(255), \" +\n \"kitSelected varchar(255), \" +\n \"points INT, \" +\n \"kills INT, \" +\n \"deaths INT, \" +\n \"killstreaks INT, \" +\n \"currentKillStreak INT, \" +\n \"inGame BOOLEAN)\")) {\n statement.execute();\n statement.close();\n connection.close();\n }\n } catch (SQLException e) {\n LogHandler.getHandler().logException(\"TableCreator:statsTable\", e);\n }\n }", "void votedOnPoll(String pollId);", "private void createStressTestControlTable() {\n Column runId = new Column(\"RUN_ID\");\n runId.setMappedType(\"INTEGER\");\n runId.setPrimaryKey(true);\n runId.setRequired(true);\n Column clientCommitSleepMs = new Column(\"CLIENT_COMMIT_SLEEP_MS\");\n clientCommitSleepMs.setMappedType(\"BIGINT\");\n Column clientCommitRows = new Column(\"CLIENT_COMMIT_ROWS\");\n clientCommitRows.setMappedType(\"BIGINT\");\n Column serverCommitSleepMs = new Column(\"SERVER_COMMIT_SLEEP_MS\");\n serverCommitSleepMs.setMappedType(\"BIGINT\");\n Column serverCommitRows = new Column(\"SERVER_COMMIT_ROWS\");\n serverCommitRows.setMappedType(\"BIGINT\");\n Column payloadColumns = new Column(\"PAYLOAD_COLUMNS\");\n payloadColumns.setMappedType(\"INTEGER\");\n Column initialSeedSize = new Column(\"INITIAL_SEED_SIZE\");\n initialSeedSize.setMappedType(\"BIGINT\");\n Column duration = new Column(\"DURATION_MINUTES\");\n duration.setMappedType(\"BIGINT\");\n\n Table table = new Table(STRESS_TEST_CONTROL, runId, clientCommitSleepMs, clientCommitRows, serverCommitSleepMs, serverCommitRows,\n payloadColumns, initialSeedSize, duration);\n engine.getDatabasePlatform().createTables(true, true, table);\n }", "protected void createTableRecordings() {\n\t\tString query = \n\t\t\t\t\"CREATE TABLE IF NOT EXISTS Recordings (\" \t\t\t\t\t\t\t+\n\t\t\t\t\"artist_name\tVARCHAR(128),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"track_name\t\tVARCHAR(128),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"CONSTRAINT unique_track PRIMARY KEY (artist_name, track_name)\" \t+\n\t\t\t\t\");\"\n\t\t\t\t;\n\t\tcreateTable(query);\n\t}", "void sessionCreated(SessionEvent se);", "private void createStressTestStatusTable() {\n Column runId = new Column(\"RUN_ID\");\n runId.setMappedType(\"INTEGER\");\n runId.setPrimaryKey(true);\n runId.setRequired(true);\n Column nodeId = new Column(\"NODE_ID\");\n nodeId.setMappedType(\"VARCHAR\");\n nodeId.setPrimaryKey(true);\n nodeId.setRequired(true);\n nodeId.setSize(\"50\");\n Column status = new Column(\"STATUS\");\n status.setMappedType(\"VARCHAR\");\n status.setSize(\"10\");\n status.setRequired(true);\n status.setDefaultValue(\"NEW\");\n Column startTime = new Column(\"START_TIME\");\n startTime.setMappedType(\"TIMESTAMP\");\n Column endTime = new Column(\"END_TIME\");\n endTime.setMappedType(\"TIMESTAMP\");\n\n Table table = new Table(STRESS_TEST_STATUS, runId, nodeId, status, startTime, endTime);\n\n engine.getDatabasePlatform().createTables(true, true, table);\n }", "TableInstance createTableInstance();", "public void initializeExpense() {\n try {\n\n Connection connection = connect();\n\n PreparedStatement createExpenseTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS expense (\"\n + \"id INTEGER PRIMARY KEY, \"\n + \"user_username varchar,\"\n + \"category_name varchar,\"\n + \"amount float,\"\n + \"time varchar,\"\n + \"FOREIGN KEY (user_username) REFERENCES user(username),\"\n + \"FOREIGN KEY(category_name) REFERENCES category(name)\"\n + \");\"\n );\n createExpenseTable.execute();\n createExpenseTable.close();\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n\n }", "public void initializeCategory() {\n try {\n Connection connection = connect();\n PreparedStatement createCategoryTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS category (\"\n + \"id INTEGER PRIMARY KEY,\"\n + \"categoryUser varchar,\"\n + \"name varchar(100),\"\n + \"FOREIGN KEY (categoryUser) REFERENCES user(username));\"\n );\n createCategoryTable.execute();\n createCategoryTable.close();\n\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "public void init() {\n\n\t\tConnection connection = null;\n\t\tStatement statement = null;\n\n\t\ttry {\n\n\t\t\tconnection = DatabaseInteractor.getConnection();\n\t\t\tstatement = connection.createStatement();\n\n\t\t} catch (SQLException exception) {\n\t\t\texception.printStackTrace();\n\t\t\treturn;\n\t\t} catch (ClassNotFoundException exception) {\n\t\t\texception.printStackTrace();\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\n\t\t\tDatabaseInteractor.createTable(StringConstants.USERS_TABLE, statement);\n\t\t\tDatabaseInteractor.createTable(StringConstants.QUESTIONS_TABLE, statement);\n\t\t\tDatabaseInteractor.createTable(StringConstants.ANSWERS_TABLE, statement);\n\t\t\tDatabaseInteractor.createTable(StringConstants.TOPICS_TABLE, statement);\n\t\t\tDatabaseInteractor.createTable(StringConstants.USER_QUESTION_VOTES_TABLE, statement);\n\t\t\tDatabaseInteractor.createTable(StringConstants.USER_ANSWER_VOTES_TABLE, statement);\n\t\t\tDatabaseInteractor.createTable(StringConstants.USER_TOPIC_RANKS_TABLE, statement);\n\n\t\t} catch (ClassNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "HealthCheck createHealthCheck(TableName tableName);", "public void createTables() throws Exception{\n\t\tcreate_table(\"tab_global\", \"param\", 1);\n\t\t\n\t\tPut put = new Put(Bytes.toBytes(\"row_userid\"));\n\t\tlong id = 0;\n\t\tput.add(Bytes.toBytes(\"param\"), \n\t\t\t\tBytes.toBytes(\"userid\"), \n\t\t\t\tBytes.toBytes(id));\n\t\tHTable ht = new HTable(conf, \"tab_global\");\n\t\tht.put(put);\n\t\t\n\t\tcreate_table(\"tab_user2id\", \"info\", 1);\n\t\tcreate_table(\"tab_id2user\", \"info\", 1);\n\t\t\n\t\t//table_follow\t{userid}\tname:{userid}\n\t\tcreate_table(\"tab_follow\", \"name\", 1);\n\t\t\n\t\t//table_followed\trowkey:{userid}_{userid} CF:userid\n\t\tcreate_table(\"tab_followed\", \"userid\", 1);\n\t\t\n\t\t//tab_post\trowkey:postid\tCF:post:username post:content post:ts\n\t\tcreate_table(\"tab_post\", \"post\", 1);\n\t\tput = new Put(Bytes.toBytes(\"row_postid\"));\n\t\tid = 0;\n\t\tput.add(Bytes.toBytes(\"param\"), \n\t\t\t\tBytes.toBytes(\"postid\"), \n\t\t\t\tBytes.toBytes(id));\n\t\tht.put(put);\n\t\t\n\t\t//tab_inbox\t\trowkey:userid+postid\tCF:postid\n\t\tcreate_table(\"tab_inbox\", \"postid\", 1);\n\t\tht.close();\n\t}", "private void createTableArea() {\n\t\tthis.tableModel = new MessagesTableModel();\n\t\tthis.conversation = new JTable(this.tableModel);\n\t\tthis.conversation.setRowSelectionAllowed(false);\n\t\tthis.conversation.getColumn(\"Pseudo\").setMaxWidth(150);\n\t\tthis.conversation.getColumn(\"Message\").setWidth(200);\n\t\tthis.conversation.getColumn(\"Heure\").setMaxWidth(50);\n\t\tthis.conversation.getColumn(\"Message\").setCellRenderer(new WrapTableCellRenderer());\n\t\tthis.conversation.getColumn(\"Pseudo\").setCellRenderer(new ColorTableCellRenderer());\n\t\tthis.scrollPane = new JScrollPane(conversation);\n\t}", "TABLE createTABLE();", "public static void createTicket(Ticket ticket) {\n try {\n Connection conn = Main.conn;\n PreparedStatement statement = conn.prepareStatement(\"INSERT INTO bs_tickets (username, admin, status, question, server, date_created, date_accepted, date_resolved) VALUES (?, ?, ?, ?, ?, ?, ?, ?)\");\n\n statement.setString(1, ticket.username);\n statement.setString(2, ticket.admin);\n statement.setString(3, ticket.status);\n statement.setString(4, ticket.question);\n statement.setString(5, ticket.server);\n statement.setInt(6, ticket.date_created);\n statement.setInt(7, ticket.date_accepted);\n statement.setInt(8, ticket.date_resolved);\n\n statement.executeUpdate();\n }\n catch (SQLException e) {\n e.printStackTrace();\n }\n }", "@ManyToOne(fetch = FetchType.LAZY)\n @JoinColumn(name = \"pollid\", referencedColumnName = \"pollid\", nullable = false)\n public Poll getPoll() {\n\treturn this.poll;\n }", "protected void createLiveLessonTableForSignUp(String username) {\n Optional<LiveLessonTable> tableWithSameName=liveLessonDao.getAllLiveLessonTable().stream().filter(table -> table.getUsername().equals(username)).findAny();\n if(tableWithSameName.isPresent())\n return;\n liveLessonDao.saveLiveLessonTable(new LiveLessonTable(username, new ArrayList<LiveLesson>()));\n }", "private void createDBProcedure() {\r\n try {\r\n Class.forName(myDriver);\r\n Connection conn = DriverManager.getConnection(myUrl, myUser, myPass);\r\n for (File sentiment : sentimentsFoldersList) {\r\n try {\r\n String queryCreate\r\n = \"CREATE TABLE \" + sentiment.getName().toUpperCase()\r\n + \" (WORD VARCHAR(50), COUNT_RES INT, PERC_RES FLOAT, COUNT_TWEET INT, PRIMARY KEY(WORD) )\";\r\n Statement st_create = conn.createStatement();\r\n st_create.executeUpdate(queryCreate);\r\n System.out.println(\"TABLE \" + sentiment.getName().toLowerCase() + \" CREATED\");\r\n st_create.close();\r\n } catch (SQLException ex) {\r\n if (ex.getErrorCode() == 955) {\r\n System.out.println(\"TABLE \" + sentiment.getName().toLowerCase() + \" WAS ALREADY PRESENT...\");\r\n }\r\n }\r\n }\r\n conn.close();\r\n } catch (ClassNotFoundException | SQLException ex) {\r\n System.out.println(ex.toString());\r\n }\r\n }", "@Override\r\n\tpublic void createTable(Connection con) throws SQLException {\r\n\t\tString sql = \"CREATE TABLE \" + tableName\r\n\t\t\t\t+ \"(pc_id integer, class_id varchar(20), level integer,\"\r\n\t\t\t\t+ \" PRIMARY KEY (pc_id,class_id,level) )\";\r\n\r\n\t\tif (DbUtils.doesTableExist(con, tableName)) {\r\n\r\n\t\t} else {\r\n\t\t\ttry (PreparedStatement ps = con.prepareStatement(sql);) {\r\n\t\t\t\tps.execute();\r\n\t\t\t}\r\n \r\n\t\t}\r\n\r\n\r\n\r\n\t\tString[] newInts = new String[] { \r\n\t\t\t\t\"hp_Increment\",};\r\n\t\tDAOUtils.createInts(con, tableName, newInts);\r\n\r\n\t}", "@Override\n public void sessionCreated(IoSession session) {\n }", "public void initializeTestingPoll( MessageReceivedEvent event ) {\n\n final Message message = event.getChannel().sendMessage(\"Creating testing poll...\").complete();\n final List<String> options = new ArrayList<>();\n options.add( \"Option A\" ); options.add( \"Option B\");\n final List<Integer> votes = Collections.nCopies(options.size(), 0);\n // Generates a testing poll, given a special ID set to 00000. //\n if ( this.pollDao.getPoll( \"00000\") == null ) {\n\n final DiscordPoll poll = new DiscordPoll();\n poll.setId( \"00000\" );\n poll.setText( \"TESTING POLL\");\n poll.setOwnerId( event.getJDA().getSelfUser().getIdLong() );\n poll.setServerId(event.getGuild().getIdLong());\n poll.setChannelId(event.getChannel().getIdLong());\n poll.setMessageId(message.getIdLong());\n boolean success = this.pollDao.createPoll(poll) && this.pollDao.setOptions( \"00000\", options);\n\n final String display = DiscordPollFormatter.getDisplayMessage(poll, options, votes);\n event.getChannel().editMessageById(poll.getMessageId(), display).queue();\n if (!success) {\n event.getChannel().sendMessage(\"Unable to create poll. Type \\\"!help\\\" for help.\").queue();\n }\n\n } else {\n // Defines information useful for testing. //\n final DiscordPoll poll = this.pollDao.getPoll( \"00000\");\n poll.setText( \"TESTING POLL\");\n poll.setOwnerId( event.getJDA().getSelfUser().getIdLong() );\n poll.setServerId(event.getGuild().getIdLong());\n poll.setChannelId(event.getChannel().getIdLong());\n poll.setMessageId(message.getIdLong());\n boolean success = this.pollDao.setOptions( \"00000\", options) && this.pollDao.updatePoll( poll );\n\n final String display = DiscordPollFormatter.getDisplayMessage(poll, options, votes);\n event.getChannel().editMessageById(poll.getMessageId(), display).queue();\n if (!success) {\n event.getChannel().sendMessage(\"Unable to update poll. Type \\\"!help\\\" for help.\").queue();\n }\n }\n\n }", "public AppointmentTable() {\n reminders = new HashMap<>();\n followup = new HashMap<>();\n }", "private void createTempDatabase() {\n\t\thandler = new ERXmlDocumentHandler(doc);\n\t\tList<String> filter = initFilter(subjectId);\n\t\tparseEntitys(filter);\n\t}", "public static VoteSession createFakeVoteSession() {\n\t\tLocalDateTime dt = LocalDateTime.now();\n return VoteSession.builder()\n \t\t.voteSessionId(faker.number().randomNumber())\n .dateTimeToStart(dt)\n .dateTimeToEnd(dt.plusMinutes(1))\n .status(\"standby\")\n .voteTopicId(VoteTopicUtils.createFakeVoteTopic())\n .build();\n \n }", "private void initTables() {\n insert(\"CREATE TABLE IF NOT EXISTS `player_info` (`player` VARCHAR(64) PRIMARY KEY NOT NULL, `json` LONGTEXT)\");\n }", "public void sessionCreated(IoSession session) {\r\n\t\tServerLogger.log(\"Session created...\" + session, Constants.DEBUG);\r\n\t\tsession.getConfig().setIdleTime(IdleStatus.BOTH_IDLE, 5);\r\n\t}", "private void createTableOrdersWaiting() throws SQLException\r\n {\r\n String sqlQuery = \r\n \"CREATE TABLE orders \" +\r\n \"(id auto_increment INT NOT NULL PRIMARY KEY, \" +\r\n \"custname VARCHAR(25) NOT NULL, \" +\r\n \"tablenumber INT NOT NULL, \" +\r\n \"foodname VARCHAR(100) NOT NULL, \" + \r\n \"beveragename VARCHAR(100) NOT NULL, \" + \r\n \"served BOOLEAN NOT NULL, \" + \r\n \"billed BOOLEAN NOT NULL, \" + \r\n \"time DATETIME DEFAULT CURRENT_TIMESTAMP)\";\r\n myStmt.executeUpdate(sqlQuery);\r\n }", "private AlarmDeviceTable() {}", "com.google.spanner.v1.Session getSessionTemplate();", "public NetworkTableListenerPoller(NetworkTableInstance inst) {\n m_inst = inst;\n m_handle = NetworkTablesJNI.createListenerPoller(inst.getHandle());\n }", "LiveStockDatabase(LiveStock liveStock){\r\n\t\tthis.liveStock = liveStock;\r\n\t}", "void updateTapTableReferences(TableConfig cfgTable, boolean createOnly) throws ConfigurationException;", "public static void init_traffic_table() throws SQLException{\n\t\treal_traffic_updater.create_traffic_table(Date_Suffix);\n\t\t\n\t}", "public void initializeBalance() {\n try {\n Connection connection = connect();\n\n PreparedStatement createBalanceTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS balance (\"\n + \"id INTEGER PRIMARY KEY,\"\n + \"user_username varchar(100),\"\n + \"amount float, \"\n + \"time varchar,\"\n + \"FOREIGN KEY (user_username) REFERENCES User(username));\"\n );\n createBalanceTable.execute();\n createBalanceTable.close();\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "@Override\n public void onCreate(SQLiteDatabase db) {\n // Listing 14.5 - Writing first part of onCreate(SQLiteDatabase)\n //db.execSQL(\"create table \" + SessionTable.NAME);\n // 14.6 - Creating session table\n //******************************************************************************************\n db.execSQL(\"create table \" + TABLE_NAME\n + \"(\" + \" _id integer primary key autoincrement\"\n + \", \" + SessionDbSchema.SessionTable.Cols.UUID\n + \", \" + SessionDbSchema.SessionTable.Cols.DATE\n + \", \" + SessionDbSchema.SessionTable.Cols.CUSTOMERID\n + \", \" + SessionDbSchema.SessionTable.Cols.SERVICE\n + \", \" + SessionDbSchema.SessionTable.Cols.SESSIONDATE\n + \", \" + SessionDbSchema.SessionTable.Cols.DESCR\n + \", \" + SessionDbSchema.SessionTable.Cols.COMPLETED\n + \", \" + SessionDbSchema.SessionTable.Cols.PAID\n + \", \" + SessionDbSchema.SessionTable.Cols.SIGN\n + \")\"\n );\n }", "public void initializeUser() {\n try {\n Connection connection = connect();\n\n PreparedStatement createCategoryTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS user (\"\n + \"id INTEGER PRIMARY KEY, \"\n + \"username VARCHAR(100),\"\n + \"password VARCHAR(100),\"\n + \"UNIQUE(username, password)\"\n + \");\"\n );\n createCategoryTable.execute();\n createCategoryTable.close();\n\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "public void setAsPollUserCreated() {\n LinearLayout linearLayout = (LinearLayout)findViewById(R.id.poll_object_main_layout);\n linearLayout.setBackgroundResource(R.drawable.poll_created_border);\n }", "private synchronized void addNewWatchList()\r\n {\r\n\r\n // Create a NEW header Vector\r\n Vector headers = new Vector();\r\n headers.removeAllElements();\r\n for (int i = 0; i < StockData.columns.length; i++)\r\n {\r\n headers.addElement(StockData.columns[i]);\r\n }\r\n\r\n // Now get the Count of the Lists already available\r\n int watchListCount = tabPane.getTabCount();\r\n // Create a new DATA Vector and add at least one item to it\r\n Vector data = new Vector();\r\n data.removeAllElements();\r\n\r\n data.addElement(new StockData());\r\n\r\n // Create our table Model with the headers and data\r\n StockDataTableModel tableModel = new StockDataTableModel(headers, data);\r\n\r\n // Create a new Table with the tablemodel\r\n JTable table = new HGTable(tableModel);\r\n\r\n // This method will add a timer ( via the index ) the table and tableModel\r\n // the appropriate vector containers.\r\n addDataToVectorContainers(table, tableModel, watchListCount);\r\n // This Method will add the Popup menu to the this table\r\n addPopupMenuToTable(table);\r\n // Create a new JSCrollPane with the the Table\r\n JScrollPane scrollPane = new JScrollPane();\r\n scrollPane.getViewport().add(table);\r\n JPanel panel = new JPanel(new BorderLayout());\r\n\r\n // Create a new Vertical Panel to place our menu and JScrollPane Table\r\n JPanel lblPanel = createVerticalPanel(true);\r\n\r\n lblPanel.add(createDropDownMenu());\r\n panel.add(lblPanel, BorderLayout.NORTH);\r\n panel.add(scrollPane, BorderLayout.CENTER);\r\n\r\n // Build a defailt label for the TabPane\r\n String watchListName = getString(\"WatchListTableModule.edit.watch_list_basic_name\") + watchListCount;\r\n\r\n tabPane.addTab(watchListName, null, panel, new String(\"Click here to view \" + watchListName));\r\n\r\n watchListCount = tabPane.getTabCount();\r\n // Set the WatchList title via Properties\r\n // Set the WatchList count Property\r\n appProps.setProperty(watchListName, watchListName);\r\n appProps.setProperty(getString(\"WatchListTableModule.application_watchlist_count_key_title\"), \"\" + watchListCount);\r\n\r\n //// Request Focus on our tab pane\r\n //tabPane.requestFocus();\r\n // Set our selected index to the new Tab\r\n int index = tabPane.getTabCount() - 1;\r\n setNewTitle(index);\r\n\r\n tabPane.setSelectedIndex(0);\r\n tabPane.repaint();\r\n\r\n }", "public void createSubscription(Subscription sub);", "public static final String getAuthCollabOverKWTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_authcollabkw_\" +shortname +\r\n\t\t\"(keyword varchar(255) NOT NULL, \" + \r\n\t\t\"author varchar(70) NOT NULL, \" + \r\n\t\t\" collabauth varchar(70) NOT NULL, \" +\r\n\t\t\"collabcnt int NOT NULL\" +\r\n\t\t\" ) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "tbls createtbls();", "@Override\n public void createUsersTable() {\n\n\n Session session = sessionFactory.openSession();\n Transaction transaction = session.beginTransaction();\n session.createSQLQuery(\"CREATE TABLE IF NOT EXISTS Users \" +\n \"(Id BIGINT PRIMARY KEY AUTO_INCREMENT, FirstName TINYTEXT , \" +\n \"LastName TINYTEXT , Age TINYINT)\").executeUpdate();\n transaction.commit();\n session.close();\n\n\n }", "public static void prepDb(Configuration conf) throws Exception {\n\n Connection conn = null;\n Statement stmt = null;\n try {\n conn = getConnection(conf);\n stmt = conn.createStatement();\n stmt.execute(\"CREATE TABLE TXNS (\" +\n \" TXN_ID bigint PRIMARY KEY,\" +\n \" TXN_STATE char(1) NOT NULL,\" +\n \" TXN_STARTED bigint NOT NULL,\" +\n \" TXN_LAST_HEARTBEAT bigint NOT NULL,\" +\n \" TXN_USER varchar(128) NOT NULL,\" +\n \" TXN_HOST varchar(128) NOT NULL,\" +\n \" TXN_TYPE integer)\");\n\n stmt.execute(\"CREATE TABLE TXN_COMPONENTS (\" +\n \" TC_TXNID bigint NOT NULL REFERENCES TXNS (TXN_ID),\" +\n \" TC_DATABASE varchar(128) NOT NULL,\" +\n \" TC_TABLE varchar(128),\" +\n \" TC_PARTITION varchar(767),\" +\n \" TC_OPERATION_TYPE char(1) NOT NULL,\" +\n \" TC_WRITEID bigint)\");\n stmt.execute(\"CREATE TABLE COMPLETED_TXN_COMPONENTS (\" +\n \" CTC_TXNID bigint NOT NULL,\" +\n \" CTC_DATABASE varchar(128) NOT NULL,\" +\n \" CTC_TABLE varchar(128),\" +\n \" CTC_PARTITION varchar(767),\" +\n \" CTC_TIMESTAMP timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,\" +\n \" CTC_WRITEID bigint,\" +\n \" CTC_UPDATE_DELETE char(1) NOT NULL)\");\n stmt.execute(\"CREATE TABLE NEXT_TXN_ID (\" + \" NTXN_NEXT bigint NOT NULL)\");\n stmt.execute(\"INSERT INTO NEXT_TXN_ID VALUES(1)\");\n\n stmt.execute(\"CREATE TABLE TXN_TO_WRITE_ID (\" +\n \" T2W_TXNID bigint NOT NULL,\" +\n \" T2W_DATABASE varchar(128) NOT NULL,\" +\n \" T2W_TABLE varchar(256) NOT NULL,\" +\n \" T2W_WRITEID bigint NOT NULL)\");\n stmt.execute(\"CREATE TABLE NEXT_WRITE_ID (\" +\n \" NWI_DATABASE varchar(128) NOT NULL,\" +\n \" NWI_TABLE varchar(256) NOT NULL,\" +\n \" NWI_NEXT bigint NOT NULL)\");\n\n stmt.execute(\"CREATE TABLE MIN_HISTORY_LEVEL (\" +\n \" MHL_TXNID bigint NOT NULL,\" +\n \" MHL_MIN_OPEN_TXNID bigint NOT NULL,\" +\n \" PRIMARY KEY(MHL_TXNID))\");\n\n stmt.execute(\"CREATE TABLE HIVE_LOCKS (\" +\n \" HL_LOCK_EXT_ID bigint NOT NULL,\" +\n \" HL_LOCK_INT_ID bigint NOT NULL,\" +\n \" HL_TXNID bigint NOT NULL,\" +\n \" HL_DB varchar(128) NOT NULL,\" +\n \" HL_TABLE varchar(128),\" +\n \" HL_PARTITION varchar(767),\" +\n \" HL_LOCK_STATE char(1) NOT NULL,\" +\n \" HL_LOCK_TYPE char(1) NOT NULL,\" +\n \" HL_LAST_HEARTBEAT bigint NOT NULL,\" +\n \" HL_ACQUIRED_AT bigint,\" +\n \" HL_USER varchar(128) NOT NULL,\" +\n \" HL_HOST varchar(128) NOT NULL,\" +\n \" HL_HEARTBEAT_COUNT integer,\" +\n \" HL_AGENT_INFO varchar(128),\" +\n \" HL_BLOCKEDBY_EXT_ID bigint,\" +\n \" HL_BLOCKEDBY_INT_ID bigint,\" +\n \" PRIMARY KEY(HL_LOCK_EXT_ID, HL_LOCK_INT_ID))\");\n stmt.execute(\"CREATE INDEX HL_TXNID_INDEX ON HIVE_LOCKS (HL_TXNID)\");\n\n stmt.execute(\"CREATE TABLE NEXT_LOCK_ID (\" + \" NL_NEXT bigint NOT NULL)\");\n stmt.execute(\"INSERT INTO NEXT_LOCK_ID VALUES(1)\");\n\n stmt.execute(\"CREATE TABLE COMPACTION_QUEUE (\" +\n \" CQ_ID bigint PRIMARY KEY,\" +\n \" CQ_DATABASE varchar(128) NOT NULL,\" +\n \" CQ_TABLE varchar(128) NOT NULL,\" +\n \" CQ_PARTITION varchar(767),\" +\n \" CQ_STATE char(1) NOT NULL,\" +\n \" CQ_TYPE char(1) NOT NULL,\" +\n \" CQ_TBLPROPERTIES varchar(2048),\" +\n \" CQ_WORKER_ID varchar(128),\" +\n \" CQ_START bigint,\" +\n \" CQ_RUN_AS varchar(128),\" +\n \" CQ_HIGHEST_WRITE_ID bigint,\" +\n \" CQ_META_INFO varchar(2048) for bit data,\" +\n \" CQ_HADOOP_JOB_ID varchar(32))\");\n\n stmt.execute(\"CREATE TABLE NEXT_COMPACTION_QUEUE_ID (NCQ_NEXT bigint NOT NULL)\");\n stmt.execute(\"INSERT INTO NEXT_COMPACTION_QUEUE_ID VALUES(1)\");\n\n stmt.execute(\"CREATE TABLE COMPLETED_COMPACTIONS (\" +\n \" CC_ID bigint PRIMARY KEY,\" +\n \" CC_DATABASE varchar(128) NOT NULL,\" +\n \" CC_TABLE varchar(128) NOT NULL,\" +\n \" CC_PARTITION varchar(767),\" +\n \" CC_STATE char(1) NOT NULL,\" +\n \" CC_TYPE char(1) NOT NULL,\" +\n \" CC_TBLPROPERTIES varchar(2048),\" +\n \" CC_WORKER_ID varchar(128),\" +\n \" CC_START bigint,\" +\n \" CC_END bigint,\" +\n \" CC_RUN_AS varchar(128),\" +\n \" CC_HIGHEST_WRITE_ID bigint,\" +\n \" CC_META_INFO varchar(2048) for bit data,\" +\n \" CC_HADOOP_JOB_ID varchar(32))\");\n\n stmt.execute(\"CREATE TABLE AUX_TABLE (\" +\n \" MT_KEY1 varchar(128) NOT NULL,\" +\n \" MT_KEY2 bigint NOT NULL,\" +\n \" MT_COMMENT varchar(255),\" +\n \" PRIMARY KEY(MT_KEY1, MT_KEY2))\");\n\n stmt.execute(\"CREATE TABLE WRITE_SET (\" +\n \" WS_DATABASE varchar(128) NOT NULL,\" +\n \" WS_TABLE varchar(128) NOT NULL,\" +\n \" WS_PARTITION varchar(767),\" +\n \" WS_TXNID bigint NOT NULL,\" +\n \" WS_COMMIT_ID bigint NOT NULL,\" +\n \" WS_OPERATION_TYPE char(1) NOT NULL)\"\n );\n\n stmt.execute(\"CREATE TABLE REPL_TXN_MAP (\" +\n \" RTM_REPL_POLICY varchar(256) NOT NULL, \" +\n \" RTM_SRC_TXN_ID bigint NOT NULL, \" +\n \" RTM_TARGET_TXN_ID bigint NOT NULL, \" +\n \" PRIMARY KEY (RTM_REPL_POLICY, RTM_SRC_TXN_ID))\"\n );\n\n stmt.execute(\"CREATE TABLE MATERIALIZATION_REBUILD_LOCKS (\" +\n \" MRL_TXN_ID BIGINT NOT NULL, \" +\n \" MRL_DB_NAME VARCHAR(128) NOT NULL, \" +\n \" MRL_TBL_NAME VARCHAR(256) NOT NULL, \" +\n \" MRL_LAST_HEARTBEAT BIGINT NOT NULL, \" +\n \" PRIMARY KEY(MRL_TXN_ID))\"\n );\n\n try {\n stmt.execute(\"CREATE TABLE \\\"APP\\\".\\\"SEQUENCE_TABLE\\\" (\\\"SEQUENCE_NAME\\\" VARCHAR(256) NOT \" +\n\n \"NULL, \\\"NEXT_VAL\\\" BIGINT NOT NULL)\"\n );\n } catch (SQLException e) {\n if (e.getMessage() != null && e.getMessage().contains(\"already exists\")) {\n LOG.info(\"SEQUENCE_TABLE table already exist, ignoring\");\n } else {\n throw e;\n }\n }\n\n try {\n stmt.execute(\"CREATE TABLE \\\"APP\\\".\\\"NOTIFICATION_SEQUENCE\\\" (\\\"NNI_ID\\\" BIGINT NOT NULL, \" +\n\n \"\\\"NEXT_EVENT_ID\\\" BIGINT NOT NULL)\"\n );\n } catch (SQLException e) {\n if (e.getMessage() != null && e.getMessage().contains(\"already exists\")) {\n LOG.info(\"NOTIFICATION_SEQUENCE table already exist, ignoring\");\n } else {\n throw e;\n }\n }\n\n try {\n stmt.execute(\"CREATE TABLE \\\"APP\\\".\\\"NOTIFICATION_LOG\\\" (\\\"NL_ID\\\" BIGINT NOT NULL, \" +\n \"\\\"DB_NAME\\\" VARCHAR(128), \\\"EVENT_ID\\\" BIGINT NOT NULL, \\\"EVENT_TIME\\\" INTEGER NOT\" +\n\n \" NULL, \\\"EVENT_TYPE\\\" VARCHAR(32) NOT NULL, \\\"MESSAGE\\\" CLOB, \\\"TBL_NAME\\\" \" +\n \"VARCHAR\" +\n \"(256), \\\"MESSAGE_FORMAT\\\" VARCHAR(16))\"\n );\n } catch (SQLException e) {\n if (e.getMessage() != null && e.getMessage().contains(\"already exists\")) {\n LOG.info(\"NOTIFICATION_LOG table already exist, ignoring\");\n } else {\n throw e;\n }\n }\n\n stmt.execute(\"INSERT INTO \\\"APP\\\".\\\"SEQUENCE_TABLE\\\" (\\\"SEQUENCE_NAME\\\", \\\"NEXT_VAL\\\") \" +\n \"SELECT * FROM (VALUES ('org.apache.hadoop.hive.metastore.model.MNotificationLog', \" +\n \"1)) tmp_table WHERE NOT EXISTS ( SELECT \\\"NEXT_VAL\\\" FROM \\\"APP\\\"\" +\n \".\\\"SEQUENCE_TABLE\\\" WHERE \\\"SEQUENCE_NAME\\\" = 'org.apache.hadoop.hive.metastore\" +\n \".model.MNotificationLog')\");\n\n stmt.execute(\"INSERT INTO \\\"APP\\\".\\\"NOTIFICATION_SEQUENCE\\\" (\\\"NNI_ID\\\", \\\"NEXT_EVENT_ID\\\")\" +\n \" SELECT * FROM (VALUES (1,1)) tmp_table WHERE NOT EXISTS ( SELECT \" +\n \"\\\"NEXT_EVENT_ID\\\" FROM \\\"APP\\\".\\\"NOTIFICATION_SEQUENCE\\\")\");\n } catch (SQLException e) {\n try {\n conn.rollback();\n } catch (SQLException re) {\n LOG.error(\"Error rolling back: \" + re.getMessage());\n }\n\n // Another thread might have already created these tables.\n if (e.getMessage() != null && e.getMessage().contains(\"already exists\")) {\n LOG.info(\"Txn tables already exist, returning\");\n return;\n }\n\n // This might be a deadlock, if so, let's retry\n if (e instanceof SQLTransactionRollbackException && deadlockCnt++ < 5) {\n LOG.warn(\"Caught deadlock, retrying db creation\");\n prepDb(conf);\n } else {\n throw e;\n }\n } finally {\n deadlockCnt = 0;\n closeResources(conn, stmt, null);\n }\n }", "public static final String getTopicTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_topic_\" +shortname +\r\n\t\t\"(tid varchar(50) NOT NULL, \" +\r\n\t\t\" keyword varchar(255) NOT NULL, \" + \r\n\t\t\" istop tinyint UNSIGNED ZEROFILL, \" + // Is this keyword a top keyword for this topic\r\n\t\t\" PRIMARY KEY (tid,keyword)) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "public void setupDB()\r\n\t{\n\tjdbcTemplateObject.execute(\"DROP TABLE IF EXISTS employee1 \");\r\n\r\n\tjdbcTemplateObject.\r\n\texecute(\"CREATE TABLE employee1\"\r\n\t+ \"(\" + \"name VARCHAR(255), id SERIAL)\");\r\n\t}", "public PollData() {\n\n\n super(TYPE_NAME);\n }", "int createTable(HbaseObj t);", "public void createSession(int uid);", "synchronized public Session newSysSession() {\n\n Session session = new Session(sysSession.database,\n sysSession.getUser(), false, false,\n sessionIdCount, null, 0);\n\n session.currentSchema =\n sysSession.database.schemaManager.getDefaultSchemaHsqlName();\n\n sessionMap.put(sessionIdCount, session);\n\n sessionIdCount++;\n\n return session;\n }", "public String getPollId() {\n return pollId;\n }", "public synchronized void criarTabela(){\n \n String sql = \"CREATE TABLE IF NOT EXISTS CPF(\\n\"\n + \"id integer PRIMARY KEY AUTOINCREMENT,\\n\"//Autoincrement\n// + \"codDocumento integer,\\n\"\n + \"numCPF integer\\n\"\n + \");\";\n \n try (Connection c = ConexaoJDBC.getInstance();\n Statement stmt = c.createStatement()) {\n // create a new table\n stmt.execute(sql);\n stmt.close();\n c.close();\n } catch (SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage()); \n// System.out.println(e.getMessage());\n }\n System.out.println(\"Table created successfully\");\n }", "private void createStatementForServiceInformationMessages() {\n val epl = \"insert into ServiceInformationMessage(publisherID, serviceName, accuracy, measurementTime, availableAttributes, sourceLocationLatitude, sourceLocationLongitude, sourceLocationAltitude, sourceLocationAccuracy, sourceLocationTimestamp, gatewaySpeed, measurementInterval, numericalResolution) select publisherID, serviceName, avg(accuracy), avg(measurementTime), avg(availableAttributes), avg(sourceLocationLatitude), avg(sourceLocationLongitude), avg(sourceLocationAltitude), avg(sourceLocationAccuracy), avg(sourceLocationTimestamp),avg(gatewaySpeed), avg(measurementInterval), avg(numericalResolution) from Message.win:time(\" + TIME_WINDOW + \") group by publisherID, serviceName\";\n epsStatementServiceInformationMessages = epAdmin.createEPL(epl);\n epsStatementServiceInformationMessages.start();\n }", "void add(InternalSession session);", "private void createTemporaryTable(Session session, final Dialect dialect, final String tempTable) {\n\t\tsession.doWork(connection -> {\n\t\t\t// check if table exists\n if (!getConfiguration().isUsingPostgreSQL()) {\n try {\n Statement s = connection.createStatement();\n s.execute(\"select id from \" + tempTable + \" where id = 1\");\n\n s.close();\n // table already exists\n return;\n } catch (Exception ex) {\n // we expect this on the first time\n }\n }\n\n TemporaryTableDialect ttDialect = TemporaryTableDialect.getTempTableDialect(dialect);\n\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tsb.append(ttDialect.getCreateTemporaryTableString());\n\t\t\tsb.append(' ').append(tempTable).append(\" (id \");\n\t\t\tsb.append(dialect.getTypeName(Types.BIGINT));\n\t\t\tsb.append(\" not null)\");\n\t\t\tsb.append(ttDialect.getCreateTemporaryTablePostfix());\n\n Statement s = connection.createStatement();\n s.execute(sb.toString());\n s.close();\n\t\t});\n\t}", "@Override\n\tpublic Session createSession(SessionBasicInfo sessionBasicInfo) {\n\t\tSession session = sessionStore.createSession( sessionBasicInfo);\n\t\tif(session == null)\n\t\t\treturn null;\n\t\tsession._setSessionStore(this);\n\t\tsession.putNewStatus();\n\t\t\n\t\treturn session;\n\t}", "public static Session createSession(SessionFactory factory){\n Session s;\n\n if((s = (Session) _sessionRef.get()) == null) {\n s = factory.openSession();\n _sessionRef.set(s);\n }\n else{\n if(!s.isConnected())s.reconnect();\n }\n\n return s; \n }", "private Connection createTable() {\n\t\tSystem.out.println(\"We are creating a table\");\n\t\ttry (\n\t\t\t\t// Step 1: Allocate a database \"Connection\" object\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:\" + PORT_NUMBER + \"/experiences?user=root&password=root\"); // MySQL\n\t\t\t\t// Step 2: Allocate a \"Statement\" object in the Connection\n\t\t\t\tStatement stmt = conn.createStatement();\n\t\t\t\t) {\n\t\t\t// Step 3 - create our database\n\t\t\tString sql2 = \"CREATE TABLE IF NOT EXISTS t1 ( \" +\n\t\t\t\t\t\"question1 varchar(500), \" +\n\t\t\t\t\t\"question2 varchar(500), \" +\n\t\t\t\t\t\"question3 varchar(500), \" +\n\t\t\t\t\t\"question4 varchar(500), \" +\n\t\t\t\t\t\"question5 varchar(500), \" +\n\t\t\t\t\t\"question6 varchar(500), \" +\n\t\t\t\t\t\"question7 varchar(500), \" +\n\t\t\t\t\t\"question8 varchar(500), \" +\n\t\t\t\t\t\"question9 varchar(500));\";\n\t\t\tstmt.execute(sql2);\n\t\t\treturn conn;\n\t\t\t\n\t\t\t\n\n\t\t} catch(SQLException ex) {\n\t\t\tex.printStackTrace();\n\t\t\treturn null;}\n\t\t}", "public void addTicket(phonecallTicket ticket){\n try {\n \n System.out.println(\"Number of tickets? \" + (total()+1));\n String insert =\"INSERT INTO JEREMY.TICKET \"\n + \"(ID,NAME,PHONE,TAG,DATE,PROBLEM,NOTES,STATUS) \"\n + \"VALUES \"\n \n + \"(\" + (total() +1) +\",'\"\n +ticket.who+\"','\"\n +ticket.phone+\"','\"\n +ticket.tag+\"',' \"\n +ticket.date+\"',' \"\n +ticket.problem+\"',' \"\n +ticket.notes+\"','\"\n +\"NEW\"+\"')\";\n \n System.out.println(insert);\n \n stmt.executeUpdate(insert);\n \n rs = stmt.executeQuery(\"SELECT * FROM JEREMY.TICKET\");\n total();\n } catch (Exception e) {\n System.out.println(\"SQL problem \" + e);\n }\n tickets.add(ticket);\n }", "StreamTable()\n {\n }", "public PaymentStatusPoll() {\n }", "public void sessionCreated(IoSession session) { }", "private void createCheckingAccountsTable() {\n\t\ttry {\n\t\t\tStatement stmt = this.conn.createStatement();\n\t\t\tstmt.executeUpdate(\"CREATE TABLE checkingAccounts \"\n\t\t\t\t\t+ \"(id BIGINT GENERATED ALWAYS AS IDENTITY ( START WITH 1000000001, INCREMENT BY 1 ), \" + \"owner INT, \"\n\t\t\t\t\t+ \"balance DOUBLE, \" + \"intRate DOUBLE, \"\n\t\t\t\t\t+ \"timeCreated BIGINT, \" + \"lastPaidInterest DOUBLE, \"\n\t\t\t\t\t+ \"dateOfLastPaidInterest BIGINT)\");\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"Created table checkingAccounts\");\n\t\t} catch (SQLException sqle) {\n\t\t\tSystem.err.println(\"Creation of checkingAccounts table FAILED\");\n\t\t\tSystem.err.println(sqle);\n\t\t}\n\t}", "public FakeScheduledInterviewDao() {\n data = new HashMap<Long, ScheduledInterview>();\n }", "public void setPingTable(String pingTable)\n {\n _pingTable = pingTable;\n \n if (pingTable != null)\n _pingQuery = \"select 1 from \" + pingTable + \" where 1=0\";\n else\n _pingQuery = null;\n }", "Session createSession(Long courseId, Long studentId, Session session);", "private void createDB() {\n try {\n Statement stat = conn.createStatement();\n stat.execute(\"CREATE TABLE settings (name TEXT, state);\");\n stat.execute(\"CREATE TABLE expressions (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n stat.execute(\"CREATE TABLE summaries (id INTEGER PRIMARY KEY ASC, expression_id INTEGER, title TEXT, abstract TEXT);\");\n stat.execute(\"CREATE TABLE history (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n } catch (SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n System.exit(0);\n }\n }", "com.weizhu.proto.WeizhuProtos.Session getSession();", "public void createTableIfAbsent() {\n try (Statement statement = connection.createStatement()) {\n\n statement.executeUpdate(\"CREATE TABLE IF NOT EXISTS `BookReview`(\" +\n \" id INTEGER PRIMARY KEY AUTOINCREMENT,\" +\n \" title VARCHAR(100),\" +\n \" author_id INTEGER,\" +\n \" FOREIGN KEY (`author_id`) REFERENCES `authors`(`id`)\" +\n \")\");\n\n } catch (SQLException e) {\n throw new BookDaoException(e);\n }\n }", "public void createTable(String tableName) {\n //SQL Statement\n String query = \"call aTable\";\n\n try {\n //connection\n stmt = con.createStatement();\n //execute query\n stmt.executeUpdate(query);\n System.out.println(\"\\n--Table \" + tableName + \" created--\");\n } catch (SQLException ex) {\n System.out.println(\"\\n--Query did not execute--\");\n ex.printStackTrace();\n }\n }", "private void setupDb(){\n try {\n openConnection();\n s.executeUpdate(\"CREATE TABLE IF NOT EXISTS LIB (NAME text UNIQUE , TYPE text, LANGUAGE text, INTRUSIVE text, OPENSOURCE text)\");\n }catch (SQLException e) {\n System.err.println(e.getMessage());\n }finally {\n if (c != null){\n close(c);\n }\n }\n }", "BTable createBTable();", "FromTable createFromTable();", "private void loadPersistantWatchLists()\r\n {\r\n\r\n debug(\"loadPersistantWatchLists() called - \");\r\n\r\n expungeAllHistoricFiles();\r\n\r\n final int watchListCount =\r\n ParseData.parseNum(appProps.getProperty(getString(\"WatchListTableModule.application_watchlist_count_key_title\")), 0);\r\n\r\n for (int index = 0; index < watchListCount; index++)\r\n {\r\n // Create a NEW header Vector\r\n Vector headers = new Vector();\r\n headers.removeAllElements();\r\n for (int i = 0; i < StockData.columns.length; i++)\r\n {\r\n headers.addElement(StockData.columns[i]);\r\n }\r\n\r\n // Create a new DATA Vector\r\n Vector data = new Vector();\r\n data.removeAllElements();\r\n // Are we in DEMO mode ior in Live Mode\r\n // Populate the Vectors\r\n if (DEMO_MODE)\r\n {\r\n getDemoData(data);\r\n }\r\n else\r\n {\r\n //getDemoData(data);\r\n getLiveData(data, index);\r\n }\r\n\r\n // Create a new Table Model with our headers and data\r\n StockDataTableModel tableModel = new StockDataTableModel(headers, data);\r\n\r\n // Create a new Table with our Tablemodel\r\n JTable table = new HGTable(tableModel);\r\n\r\n // This method will add a timer ( via the index ) the table and tableModel\r\n // the appropriate vector containers.\r\n addDataToVectorContainers(table, tableModel, index);\r\n // This Method will add the Popup menu to the this table\r\n addPopupMenuToTable(table);\r\n // Create a new ScrollPane and add our table to it\r\n JScrollPane scrollPane = new JScrollPane();\r\n scrollPane.getViewport().add(table);\r\n JPanel panel = new JPanel(new BorderLayout());\r\n\r\n // Creae a new Vertical Panel and add our Menu and JScrollPane Table\r\n JPanel lblPanel = createVerticalPanel(true);\r\n\r\n lblPanel.add(createDropDownMenu());\r\n panel.add(lblPanel, BorderLayout.NORTH);\r\n panel.add(scrollPane, BorderLayout.CENTER);\r\n\r\n // Create a default name for that tab and tab name lookup\r\n String tabName = getString(\"WatchListTableModule.edit.watch_list_basic_name\") + index;\r\n // Get the WatchList title via Properties\r\n // Get the Property\r\n tabName = appProps.getProperty(tabName, tabName);\r\n tabPane.addTab(tabName, null, panel, new String(\"Click here to view \" + tabName));\r\n\r\n // Set the selected index to the first in the list\r\n tabPane.setSelectedIndex(0);\r\n // Repaint the tabpane with the current data\r\n tabPane.repaint();\r\n\r\n // Load the Historical Data on the Util Event Thread as \r\n // to get our primary data up and going as fast as possible\r\n // So we can get out of here - This Inner class thread\r\n // invokes class instance method loadHistoricData(index);\r\n // NOTE: Startup Initial delay of 5 seconds, give the application,\r\n // Time to load.\r\n TimerTask historicDataTask = new LoadHistoricListDataTask(index);\r\n Timer timer = new Timer(true);\r\n timer.schedule(historicDataTask, ONE_SECOND ); // ONE_SECOND * 6);\r\n\r\n this.setStatusBar(\"Loading watch list [\" + index + \"] complete.\");\r\n }\r\n\r\n this.MODULE_READY = true;\r\n\r\n this.monitorTask = new WatchListMonitorTask();\r\n Timer timer = new Timer(true); // Non-Deamon\r\n timer.scheduleAtFixedRate(monitorTask, MONITOR_DELAY, MONITOR_DELAY);\r\n\r\n debug(\"loadPersistantWatchLists() complete - \");\r\n\r\n }", "private static void createHistoryEntry(int docId, String username, String eventType) {\r\n History history = new History();\r\n history.setDocId(docId);\r\n history.setDate(DateBean.toCompactString());\r\n history.setUsername(username);\r\n history.setEvent(eventType);\r\n HistoryDAO historyDao = (HistoryDAO) Context.getInstance().getBean(HistoryDAO.class);\r\n historyDao.store(history);\r\n }", "public PeerTable() {\n super();\n }", "public void trackNewSession() {\n if(isTelemetryEnabled()){\n new CreateDataTask(CreateDataTask.DataType.NEW_SESSION).execute();\n }\n }", "public void initDb() {\n String createVac = \"create table if not exists vacancies(id serial primary key,\"\n + \"name varchar(1500) NOT NULL UNIQUE, url varchar (1500), description text, dateVac timestamp);\";\n try (Statement st = connection.createStatement()) {\n st.execute(createVac);\n } catch (SQLException e) {\n LOG.error(e.getMessage());\n }\n }", "boolean hasVotedOnPoll(String pollId);", "public void createTables() {\n\t\t// A try catch is needed in case the sql statement is invalid\n\t\ttry {\n\t\t\t// Create connection and statement\n\t\t\tconnection = connector.getConnection();\n\t\t\tstatement = connection.createStatement();\n\n\t\t\t// Create tables if they do not exist already\n\t\t\tString user_sql = \"CREATE TABLE IF NOT EXISTS \" + user_table + \" (id INTEGER NOT NULL AUTO_INCREMENT,\"\n\t\t\t\t\t+ \" username VARCHAR(10) UNIQUE NOT NULL,\" + \" password VARCHAR(15) NOT NULL,\"\n\t\t\t\t\t+ \" name VARCHAR(20) NOT NULL,\" + \" lastname VARCHAR(20) NOT NULL,\"\n\t\t\t\t\t+ \" email VARCHAR(40) UNIQUE NOT NULL,\" + \" isAdmin BOOLEAN NOT NULL,\" + \" PRIMARY KEY (id))\";\n\n\t\t\tString player_sql = \"CREATE TABLE IF NOT EXISTS \" + player_table + \" (id INTEGER NOT NULL AUTO_INCREMENT,\"\n\t\t\t\t\t+ \" idTeam INTEGER NOT NULL,\" + \" name VARCHAR(20) NOT NULL,\" + \" lastname VARCHAR(20) NOT NULL,\"\n\t\t\t\t\t+ \" dateOfBirth DATE NOT NULL,\" + \" height INTEGER NOT NULL,\" + \" PRIMARY KEY (id))\";\n\n\t\t\tString team_sql = \"CREATE TABLE IF NOT EXISTS \" + team_table + \" (id INTEGER NOT NULL AUTO_INCREMENT,\"\n\t\t\t\t\t+ \" name VARCHAR(20) UNIQUE NOT NULL,\" + \" coach VARCHAR(20) UNIQUE NOT NULL,\"\n\t\t\t\t\t+ \" city VARCHAR(20) NOT NULL,\" + \" dateFoundation DATE NOT NULL,\" + \" PRIMARY KEY (id))\";\n\n\t\t\tString match_sql = \"CREATE TABLE IF NOT EXISTS \" + match_table + \" (id INTEGER NOT NULL AUTO_INCREMENT,\"\n\t\t\t\t\t+ \" idHome INTEGER NOT NULL,\" + \" idAway INTEGER NOT NULL,\" + \" matchDate DATE NOT NULL,\"\n\t\t\t\t\t+ \" referee VARCHAR(20) NOT NULL,\" + \" PRIMARY KEY (id))\";\n\n\t\t\tString stats_sql = \"CREATE TABLE IF NOT EXISTS \" + stats_table + \" (id INTEGER NOT NULL AUTO_INCREMENT,\"\n\t\t\t\t\t+ \" idMatch INTEGER NOT NULL,\" + \" goalsHome INTEGER NOT NULL,\" + \" goalsAway INTEGER NOT NULL,\"\n\t\t\t\t\t+ \" numberOfCorners INTEGER NOT NULL,\" + \" numberOfFouls INTEGER NOT NULL,\" + \" PRIMARY KEY (id))\";\n\n\t\t\t// Inform the user that the table has been created just the first\n\t\t\t// time\n\t\t\tif (statement.executeUpdate(user_sql) > 0) {\n\t\t\t\tSystem.out.println(\"User table succesfully created\");\n\t\t\t}\n\t\t\tif (statement.executeUpdate(player_sql) > 0) {\n\t\t\t\tSystem.out.println(\"Player table succesfully created\");\n\t\t\t}\n\t\t\tif (statement.executeUpdate(team_sql) > 0) {\n\t\t\t\tSystem.out.println(\"Team table succesfully created\");\n\t\t\t}\n\t\t\tif (statement.executeUpdate(match_sql) > 0) {\n\t\t\t\tSystem.out.println(\"Match table succesfully created\");\n\t\t\t}\n\t\t\tif (statement.executeUpdate(stats_sql) > 0) {\n\t\t\t\tSystem.out.println(\"Stats table succesfully created\");\n\t\t\t}\n\t\t\t// Closing the connection\n\t\t\tstatement.close();\n\t\t\tconnection.close();\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "public void create() {\n\n\t\tthis.data = new Object[lb.getBoardLen()+3][3];\n\t\tdata[0][0] = \"RANK\";\n\t\tdata[0][1] = \"PLAYER\";\n\t\tdata[0][2] = \"POINTS\";\n\t\t\n\t\tfor (int i = 1; i <= lb.getBoardLen(); i++) {\n\t\t\tdata[i][0] = \"#\" + Integer.toString(i);\n\t\t\tdata[i][1] = lb.getUserPointsList().get(i-1).username;\n\t\t\tdata[i][2] = Integer.toString(lb.getUserPointsList().get(i-1).points);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tif (Sfunctions.sUserPull(user.getUsername(), user.getPassword()).getWeek() == -1) {\n\t\t\tdata[lb.getBoardLen() + 1][0] = \"\";\n\t\t\tdata[lb.getBoardLen() + 1][1] = \"THE SEASON HAS ENDED.\";\n\t\t\tdata[lb.getBoardLen() + 1][2] = \"\";\n\t\t\tdata[lb.getBoardLen() + 2][0] = \"\";\n\t\t\tdata[lb.getBoardLen() + 2][1] = \"THANKS FOR PLAYING!\";\n\t\t\tdata[lb.getBoardLen() + 2][2] = \"\";\n\t\t}\n\t\telse {\n\t\t\tdata[lb.getBoardLen() + 1][0] = \"\";\n\t\t\tdata[lb.getBoardLen() + 1][1] = \"\";\n\t\t\tdata[lb.getBoardLen() + 1][2] = \"\";\n\t\t\tdata[lb.getBoardLen() + 2][0] = \"\";\n\t\t\tdata[lb.getBoardLen() + 2][1] = \"\";\n\t\t\tdata[lb.getBoardLen() + 2][2] = \"\";\n\t\t}\n\t\n\tJTable table = new JTable(data, headers);\n\ttable.setBackground(new Color(104, 0, 0));\n\ttable.setForeground(Color.WHITE);\n\ttable.setFont(textFont);\n\ttable.setShowGrid(false);\n\ttable.setEnabled(false);\n\n\t//Depending on where the ME is\n\tme_row = getRowByValue(table, user.getUsername());\n\ttable.setRowSelectionInterval(me_row, me_row);\n\t\n\t\n\n\t\n\tTableColumn column = null;\n\tfor (int i = 0; i < 3; i++) {\n\t column = table.getColumnModel().getColumn(i);\n\t if (i == 0) {\n\t \t\tcolumn.setPreferredWidth(60);\n\t }\n\t if (i == 1) {\n\t column.setPreferredWidth(210); //third column is bigger\n\t } else {\n\t \t\tcolumn.setPreferredWidth(80);\n\t }\n\t}\n\n\t\n\tthis.add(table);\n\tthis.setBackground(new Color(104, 0, 0));\n\t}", "public TableCreation(Table table) {\n this.table = table;\n }", "@Id\n @GenericGenerator(name = \"polloptionautoinc\", strategy = \"org.hibernate.id.enhanced.SequenceStyleGenerator\",\n\t\t parameters = {\n\t\t\t @Parameter(name = \"sequence_name\", value = \"polloptionautoinc\"),\n\t\t\t @Parameter(name = \"optimizer\", value = \"hilo\"),\n\t\t\t @Parameter(name = \"initial_value\", value = \"1\"),\n\t\t\t @Parameter(name = \"increment_size\", value = \"1\") }\n )\n @GeneratedValue(generator = \"polloptionautoinc\")\n @Column(name = \"polloptionid\")\n public Long getPollOptionId() {\n\treturn this.pollOptionId;\n }", "@Override\n public void createSchema(Properties props)\n {\n Statement statement;\n try\n {\n statement = connection.createStatement();\n \n //Drop Indexes\n dropIndex(statement, \"CONFFRIENDSHIP_INVITEEID\", \"CONFFRIENDSHIP\");\n dropIndex(statement, \"CONFFRIENDSHIP_INVITERID\", \"CONFFRIENDSHIP\");\n dropIndex(statement, \"PENDFRIENDSHIP_INVITEEID\", \"PENDFRIENDSHIP\");\n dropIndex(statement, \"PENDFRIENDSHIP_INVITERID\", \"PENDFRIENDSHIP\");\n dropIndex(statement, \"MANIPULATION_RID\", \"MANIPULATION\");\n dropIndex(statement, \"MANIPULATION_CREATORID\", \"MANIPULATION\");\n dropIndex(statement, \"RESOURCES_WALLUSERID\", \"RESOURCES\");\n dropIndex(statement, \"RESOURCE_CREATORID\", \"RESOURCES\");\n \n //Drop Tables\n dropTable(statement, \"CONFFRIENDSHIP\");\n dropTable(statement, \"PENDFRIENDSHIP\");\n dropTable(statement, \"MANIPULATION\");\n dropTable(statement, \"RESOURCES\");\n dropTable(statement, \"USERS\");\n \n //Create Tables\n statement.executeUpdate(\"CREATE TABLE CONFFRIENDSHIP \" + \"(INVITERID INTEGER NOT NULL, \" + \"INVITEEID INTEGER NOT NULL, \" + \"PRIMARY KEY (INVITERID, INVITEEID))\");\n statement.executeUpdate(\"CREATE TABLE PENDFRIENDSHIP \" + \"(INVITERID INTEGER NOT NULL, \" + \"INVITEEID INTEGER NOT NULL, \" + \"PRIMARY KEY (INVITERID, INVITEEID))\");\n statement.executeUpdate(\"CREATE TABLE MANIPULATION \" + \"(MID INTEGER NOT NULL, \" + \"MODIFIERID INTEGER NOT NULL, \" + \"RID INTEGER NOT NULL, \" + \"CREATORID INTEGER NOT NULL, \" + \"TIMESTAMP VARCHAR(200), \" + \"TYPE VARCHAR(200), \" + \"CONTENT VARCHAR(200), \" + \"PRIMARY KEY (MID,RID))\");\n statement.executeUpdate(\"CREATE TABLE RESOURCES \" + \"(RID INTEGER NOT NULL , \" + \"CREATORID INTEGER NOT NULL, \" + \"WALLUSERID INTEGER NOT NULL, \" + \"TYPE VARCHAR(200), \" + \"BODY VARCHAR(200), \" + \"DOC VARCHAR(200), \" + \"PRIMARY KEY (RID))\");\n statement.executeUpdate(\"CREATE TABLE USERS \" + \"(USERID INTEGER NOT NULL , \" + \"USERNAME VARCHAR(200), \" + \"PW VARCHAR(200), \" + \"FNAME VARCHAR(200), \" + \"LNAME VARCHAR(200), \" + \"GENDER VARCHAR(200),\" + \"DOB VARCHAR(200), \" + \"JDATE VARCHAR(200), \" + \"LDATE VARCHAR(200), \" + \"ADDRESS VARCHAR(200),\" + \"EMAIL VARCHAR(200), \" + \"TEL VARCHAR(200), \" + \"PRIMARY KEY (USERID))\");\n \n //Add Foreign Keys\n statement.executeUpdate(\"ALTER TABLE CONFFRIENDSHIP \" + \"ADD CONSTRAINT CONFFRIENDSHIP_USERS_FK1 FOREIGN KEY (INVITERID)\" + \"REFERENCES USERS (USERID) ON DELETE CASCADE\");\n statement.executeUpdate(\"ALTER TABLE CONFFRIENDSHIP \" + \"ADD CONSTRAINT CONFFRIENDSHIP_USERS_FK2 FOREIGN KEY (INVITEEID)\" + \"REFERENCES USERS (USERID) ON DELETE NO ACTION\");\n statement.executeUpdate(\"ALTER TABLE PENDFRIENDSHIP \" + \"ADD CONSTRAINT PENDFRIENDSHIP_USERS_FK1 FOREIGN KEY (INVITERID)\" + \"REFERENCES USERS (USERID) ON DELETE CASCADE\");\n statement.executeUpdate(\"ALTER TABLE PENDFRIENDSHIP \" + \"ADD CONSTRAINT PENDFRIENDSHIP_USERS_FK2 FOREIGN KEY (INVITEEID)\" + \"REFERENCES USERS (USERID) ON DELETE NO ACTION\");\n statement.executeUpdate(\"ALTER TABLE MANIPULATION \" + \"ADD CONSTRAINT MANIPULATION_RESOURCES_FK1 FOREIGN KEY (RID)\" + \"REFERENCES RESOURCES (RID) ON DELETE CASCADE\");\n statement.executeUpdate(\"ALTER TABLE MANIPULATION \" + \"ADD CONSTRAINT MANIPULATION_USERS_FK1 FOREIGN KEY (CREATORID)\" + \"REFERENCES USERS (USERID) ON DELETE NO ACTION\");\n statement.executeUpdate(\"ALTER TABLE MANIPULATION \" + \"ADD CONSTRAINT MANIPULATION_USERS_FK2 FOREIGN KEY (MODIFIERID)\" + \"REFERENCES USERS (USERID) ON DELETE NO ACTION\");\n statement.executeUpdate(\"ALTER TABLE RESOURCES \" + \"ADD CONSTRAINT RESOURCES_USERS_FK1 FOREIGN KEY (CREATORID)\" + \"REFERENCES USERS (USERID) ON DELETE CASCADE\");\n statement.executeUpdate(\"ALTER TABLE RESOURCES \" + \"ADD CONSTRAINT RESOURCES_USERS_FK2 FOREIGN KEY (WALLUSERID)\" + \"REFERENCES USERS (USERID) ON DELETE NO ACTION\");\n \n //Create Indexes\n buildIndexes(null);\n }\n catch (SQLException ex)\n {\n Logger.getLogger(WindowsAzureClientInit.class.getName()).log(Level.SEVERE, null, ex);\n System.out.println(\"Error in creating schema!\");\n }\n }", "@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 createTables(){\n Map<String, String> name_type_map = new HashMap<>();\n List<String> primaryKey = new ArrayList<>();\n try {\n name_type_map.put(KEY_SINK_NAME, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_SINK_ADDRESS, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_SINK_DETAIL, MyDatabase.TYPE_VARCHAR);\n primaryKey.add(KEY_SINK_ADDRESS);\n myDatabase.createTable(TABLE_SINK, name_type_map, primaryKey, null);\n }catch (MySQLException e){ //数据表已存在\n e.print();\n }\n try {\n name_type_map.clear();\n name_type_map.put(KEY_NODE_NAME, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_PARENT, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_DETAIL, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_ADDRESS,MyDatabase.TYPE_VARCHAR);\n primaryKey.clear();\n primaryKey.add(KEY_NODE_PARENT);\n primaryKey.add(KEY_NODE_ADDRESS);\n myDatabase.createTable(TABLE_NODE, name_type_map, primaryKey, null);\n }catch (MySQLException e){\n e.print();\n }\n\n try {\n name_type_map.clear();\n name_type_map.put(KEY_NODE_ADDRESS, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_PARENT, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_DATA_TIME, MyDatabase.TYPE_TIMESTAMP);\n name_type_map.put(KEY_DATA_VAL, MyDatabase.TYPE_FLOAT);\n primaryKey.clear();\n primaryKey.add(KEY_DATA_TIME);\n primaryKey.add(KEY_NODE_ADDRESS);\n primaryKey.add(KEY_NODE_PARENT);\n myDatabase.createTable(TABLE_DATA, name_type_map, primaryKey, null);\n }catch (MySQLException e) {\n e.print();\n }\n }", "public String getPingTable()\n {\n return _pingTable;\n }" ]
[ "0.6074723", "0.6046247", "0.52312446", "0.5206694", "0.5036366", "0.49823362", "0.49671003", "0.4897851", "0.4856532", "0.48380658", "0.4804503", "0.47577676", "0.46816722", "0.467888", "0.4672079", "0.46647292", "0.4653573", "0.46346152", "0.46016806", "0.45995703", "0.4585356", "0.45797795", "0.45698252", "0.4564632", "0.45640647", "0.45390248", "0.452049", "0.44946703", "0.44941357", "0.448974", "0.44867298", "0.44590992", "0.44479126", "0.44324207", "0.443112", "0.4428864", "0.44213992", "0.44210392", "0.44187045", "0.4417964", "0.44024894", "0.4402222", "0.44010928", "0.43928462", "0.4390489", "0.43824658", "0.43697375", "0.43663144", "0.4351792", "0.43488526", "0.4347165", "0.43436936", "0.43431306", "0.4342391", "0.43389174", "0.43361953", "0.43338397", "0.43159786", "0.43145683", "0.4314269", "0.43128738", "0.4311763", "0.43100035", "0.4302063", "0.43017405", "0.43011802", "0.42913884", "0.42801192", "0.4269188", "0.4268666", "0.4266817", "0.4263571", "0.42622212", "0.42607355", "0.4260298", "0.425284", "0.42479518", "0.42455778", "0.42378867", "0.4233432", "0.4232108", "0.42317373", "0.42240947", "0.42234313", "0.42192975", "0.42191893", "0.4217899", "0.42175022", "0.42159444", "0.42112267", "0.42052636", "0.41987738", "0.41928977", "0.4189141", "0.41868123", "0.41849115", "0.4180726", "0.41743866", "0.41730902", "0.41691506" ]
0.60665196
1
Create an aliased public.session_poll table reference
public SessionPoll(String alias) { this(alias, SESSION_POLL); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void createTableListenings() {\n\t\tString query = \n\t\t\t\t\"CREATE TABLE IF NOT EXISTS Listenings (\" \t\t\t\t\t\t\t+\n\t\t\t\t\"user\t\t\tVARCHAR(128),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"track\t\t\tVARCHAR(259),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"playcount\t\tINTEGER,\" \t\t\t\t\t\t\t\t\t\t\t+ \n\t\t\t\t\"FOREIGN KEY (user) REFERENCES Persons(lfm_username),\" \t\t\t\t+\n\t\t\t\t\"FOREIGN KEY (listens_to) REFERENCES Recordings(unique_track)\"\t\t+\n\t\t\t\t\");\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t;\n\t\tcreateTable(query);\n\t}", "private void createPollTables(DataSource ds) {\n\t\tConnection con = null;\n\t\ttry {\n\t\t\tcon = ds.getConnection();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tPreparedStatement pst = null;\n\t\ttry {\n\t\t\tpst = con.prepareStatement(\n\t\t\t\t\t\"CREATE TABLE Polls\\r\\n\" + \"(id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,\\r\\n\"\n\t\t\t\t\t\t\t+ \"title VARCHAR(150) NOT NULL,\\r\\n\" + \"message CLOB(2048) NOT NULL\\r\\n\" + \")\");\n\t\t\tpst.execute();\n\n\t\t} catch (SQLException ex) {\n\t\t\tif (!ex.getSQLState().equals(\"X0Y32\"))\n\t\t\t\tex.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tpst.close();\n\t\t\t} catch (SQLException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tpst = con.prepareStatement(\n\t\t\t\t\t\"CREATE TABLE PollOptions\\r\\n\" + \"(id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,\\r\\n\"\n\t\t\t\t\t\t\t+ \"optionTitle VARCHAR(100) NOT NULL,\\r\\n\" + \"optionLink VARCHAR(150) NOT NULL,\\r\\n\"\n\t\t\t\t\t\t\t+ \"pollID BIGINT,\\r\\n\" + \"votesCount BIGINT,\\r\\n\"\n\t\t\t\t\t\t\t+ \"FOREIGN KEY (pollID) REFERENCES Polls(id)\\r\\n\" + \")\");\n\t\t\tpst.executeUpdate();\n\n\t\t} catch (SQLException ex) {\n\t\t\tif (!ex.getSQLState().equals(\"X0Y32\"))\n\t\t\t\tex.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tpst.close();\n\t\t\t} catch (SQLException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tcon.close();\n\t\t} catch (SQLException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "public SessionPoll() {\n\t\tthis(\"session_poll\", null);\n\t}", "public String getNextTableSqlAlias() {\n return \"t\"+(aliasCounter++);\n }", "public static final String getAuthCollabOverKWTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_authcollabkw_\" +shortname +\r\n\t\t\"(keyword varchar(255) NOT NULL, \" + \r\n\t\t\"author varchar(70) NOT NULL, \" + \r\n\t\t\" collabauth varchar(70) NOT NULL, \" +\r\n\t\t\"collabcnt int NOT NULL\" +\r\n\t\t\" ) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "@Deprecated\n\tpublic synchronized void addmp(String table_name, String mp) {\n\t\tschema_counter++;\n\t\tschemaPart.append(\t\"schema: \" + \n\t\t\tString.valueOf(schema_counter) + // #2 : stream_id\n\t\t\t\" \" + \n\t\t\ttable_name + // #3 : table name \n\t\t\t\" \" + \n\t\t\tmp + //#4 : data\n\t\t\t\"\\n\" );\n\t\tschemaCounter.put(table_name, schema_counter);\n\t\t// track the measurement schemas\n\t\tmeasurementPointCounter.put(table_name, 0);\n\t}", "void updateTapTableReferences(TableConfig cfgTable, boolean createOnly) throws ConfigurationException;", "private String generateSqlServerTemporaryTableName() {\n return \"temp\" + temporaryTableCounter.getAndIncrement();\n }", "private void addDataToPollTables(DataSource ds) {\n\t\tConnection con = null;\n\t\ttry {\n\t\t\tcon = ds.getConnection();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tStatement pst = null;\n\t\ttry {\n\t\t\tpst = con.createStatement();\n\t\t\tResultSet rs = pst.executeQuery(\"SELECT * FROM Polls\");\n\t\t\tif (!rs.next()) {\n\t\t\t\t//@formatter:off\n\t\t\t\tpst.executeUpdate(\"INSERT INTO Polls(title, message) VALUES('Glasanje za omiljeni bend:', 'Od sljedećih bendova, koji Vam je bend najdraži? Kliknite na link kako biste glasali!')\", Statement.RETURN_GENERATED_KEYS);\n\t\t\t\t\n\t\t\t\trs = pst.getGeneratedKeys();\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif(rs != null && rs.next()) {\n\t\t\t\t\t\tlong id1 = rs.getLong(1);\n\t\t\t\t\t\tpst.executeUpdate(\"INSERT INTO PollOptions(optionTitle, optionLink, pollID, votesCount) VALUES('The Mamas And The Papas', 'https://www.youtube.com/watch?v=N-aK6JnyFmk', \"+id1+\", 27)\");\n\t\t\t\t\t\tpst.executeUpdate(\"INSERT INTO PollOptions(optionTitle, optionLink, pollID, votesCount) VALUES('The Everly Brothers', 'https://www.youtube.com/watch?v=tbU3zdAgiX8', \"+id1+\", 25)\");\n\t\t\t\t\t\tpst.executeUpdate(\"INSERT INTO PollOptions(optionTitle, optionLink, pollID, votesCount) VALUES('The Beach Boys', 'https://www.youtube.com/watch?v=2s4slliAtQU', \"+id1+\", 150)\");\n\t\t\t\t\t\tpst.executeUpdate(\"INSERT INTO PollOptions(optionTitle, optionLink, pollID, votesCount) VALUES('The Marcels', 'https://www.youtube.com/watch?v=qoi3TH59ZEs', \"+id1+\", 33)\");\n\t\t\t\t\t\tpst.executeUpdate(\"INSERT INTO PollOptions(optionTitle, optionLink, pollID, votesCount) VALUES('The Four Seasons', 'https://www.youtube.com/watch?v=y8yvnqHmFds', \"+id1+\", 20)\");\n\t\t\t\t\t\tpst.executeUpdate(\"INSERT INTO PollOptions(optionTitle, optionLink, pollID, votesCount) VALUES('The Platters', 'https://www.youtube.com/watch?v=H2di83WAOhU', \"+id1+\", 60)\");\n\t\t\t\t\t\tpst.executeUpdate(\"INSERT INTO PollOptions(optionTitle, optionLink, pollID, votesCount) VALUES('The Beatles', 'https://www.youtube.com/watch?v=z9ypq6_5bsg', \"+id1+\", 150)\");\n\t\t\t\t\t}\n\t\t\t\t} finally {\n//\t\t\t\t\ttry {\n//\t\t\t\t\t\trs.close();\n//\t\t\t\t\t} catch (Exception ignorable) {\n//\t\t\t\t\t}\n\t\t\t\t\ttry { rs.close(); } catch(SQLException ex) {\n\t\t\t\t\t\tex.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpst.executeUpdate(\"INSERT INTO Polls(title, message) VALUES('Favourite month od year:', 'What month of the year do you like the most? Refer to pics on link if unsure and pick one to vote!')\", Statement.RETURN_GENERATED_KEYS);\n\t\t\t\trs = pst.getGeneratedKeys();\n\t\t\t\ttry {\n\t\t\t\t\tif(rs != null && rs.next()) {\n\t\t\t\t\t\tlong id2 = rs.getLong(1);\n\t\t\t\t\t\tString[] months = new String[] {\"january\", \"february\", \"march\", \"april\", \"may\", \"june\", \"july\", \"august\", \"september\", \"october\", \"november\", \"december\"};\n\t\t\t\t\t\tfor(String m: months) {\n\t\t\t\t\t\t\tpst.executeUpdate(\"INSERT INTO PollOptions(optionTitle, optionLink, pollID, votesCount) VALUES('\"+m+\"', 'https://unsplash.com/search/photos/\"+m+\"', \"+id2+\", \"+new Random().nextInt(90)+\")\");\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t} finally {\n//\t\t\t\t\ttry {\n//\t\t\t\t\t\trs.close();\n//\t\t\t\t\t} catch (Exception ignorable) {\n//\t\t\t\t\t}\n\t\t\t\t\ttry { rs.close(); } catch(SQLException ex) {\n\t\t\t\t\t\tex.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//@formatter:on\n\t\t\t}\n\t\t} catch (SQLException ex) {\n\t\t\tex.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tpst.close();\n\t\t\t} catch (SQLException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tcon.close();\n\t\t} catch (SQLException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "public static final String getTopicTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_topic_\" +shortname +\r\n\t\t\"(tid varchar(50) NOT NULL, \" +\r\n\t\t\" keyword varchar(255) NOT NULL, \" + \r\n\t\t\" istop tinyint UNSIGNED ZEROFILL, \" + // Is this keyword a top keyword for this topic\r\n\t\t\" PRIMARY KEY (tid,keyword)) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "private EventHistoryTable() {}", "public void setPingTable(String pingTable)\n {\n _pingTable = pingTable;\n \n if (pingTable != null)\n _pingQuery = \"select 1 from \" + pingTable + \" where 1=0\";\n else\n _pingQuery = null;\n }", "public static final String getAuthKWRelTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_authkw_\" +shortname +\r\n\t\t\"(author varchar(70) NOT NULL, \" +\r\n\t\t\" keyword varchar(255) NOT NULL, \" + \r\n\t\t\" PRIMARY KEY (keyword,author)) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "TableOrAlias createTableOrAlias();", "AliasStatement createAliasStatement();", "public void setTableName(String tmp) {\n this.tableName = tmp;\n }", "private void createLoginTable() {\r\n jdbcExecutor.executeQuery(new Work() {\r\n @Override\r\n public void execute(Connection connection) throws SQLException {\r\n connection.createStatement().executeUpdate(\"CREATE TABLE login ( id numeric(19,0), user_id numeric(19,0), timestamp TIMESTAMP )\");\r\n }\r\n });\r\n }", "AliasVariable createAliasVariable();", "public SpeedAlertsHistory(String alias) {\n this(DSL.name(alias), SPEED_ALERTS_HISTORY);\n }", "@Override\n\tpublic String createTable() {\n\t\t\t\treturn \"CREATE TABLE history_table_view(id number(8) primary key not null ,sqltext text, pointid varchar2(1024), type varchar2(100))\";\n\t}", "@Deprecated\n\tpublic static Table<String, String, String> make(final String name_) {\n\t\treturn builder(name_).build();\n\t}", "public PgTablespace(String alias) {\n this(DSL.name(alias), PG_TABLESPACE);\n }", "protected abstract FlowRule.Builder setDefaultTableIdForFlowObjective(Builder ruleBuilder);", "private void createTemporaryTable(Session session, final Dialect dialect, final String tempTable) {\n\t\tsession.doWork(connection -> {\n\t\t\t// check if table exists\n if (!getConfiguration().isUsingPostgreSQL()) {\n try {\n Statement s = connection.createStatement();\n s.execute(\"select id from \" + tempTable + \" where id = 1\");\n\n s.close();\n // table already exists\n return;\n } catch (Exception ex) {\n // we expect this on the first time\n }\n }\n\n TemporaryTableDialect ttDialect = TemporaryTableDialect.getTempTableDialect(dialect);\n\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tsb.append(ttDialect.getCreateTemporaryTableString());\n\t\t\tsb.append(' ').append(tempTable).append(\" (id \");\n\t\t\tsb.append(dialect.getTypeName(Types.BIGINT));\n\t\t\tsb.append(\" not null)\");\n\t\t\tsb.append(ttDialect.getCreateTemporaryTablePostfix());\n\n Statement s = connection.createStatement();\n s.execute(sb.toString());\n s.close();\n\t\t});\n\t}", "public AgentTable(String alias) {\n this(alias, AGENT);\n }", "void votedOnPoll(String pollId);", "public void setNextAnchor(java.sql.Timestamp tmp) {\n this.nextAnchor = tmp;\n }", "public Mytable(String alias) {\n this(DSL.name(alias), MYTABLE);\n }", "TableInstance createTableInstance();", "String getTempTableName(String name);", "public PgTablespace(Name alias) {\n this(alias, PG_TABLESPACE);\n }", "HealthCheck createHealthCheck(TableName tableName);", "private AlarmDeviceTable() {}", "public R2dbcMessageHandlerSpec tableName(String tableName) {\n\t\tthis.reactiveMessageHandler.setTableName(tableName);\n\t\treturn this;\n\t}", "public AppointmentTable() {\n reminders = new HashMap<>();\n followup = new HashMap<>();\n }", "public DynamicSchemaTable(String alias) {\n this(alias, DYNAMIC_SCHEMA);\n }", "void gen_table_names(Connection c, PreparedStatement pst ) throws ClassNotFoundException, SQLException\n\t{\n\t String lambda_term_query = \"select subgoal_names from view2subgoals where view = '\"+ name +\"'\";\n\n\t\t\n\t pst = c.prepareStatement(lambda_term_query);\n\t \n\t ResultSet rs = pst.executeQuery();\n\t \n\t if(!rs.wasNull())\n\t {\n\t \twhile(rs.next())\n\t\t {\n\t\t \t\t \t\n\t\t \ttable_names.add(rs.getString(1));\n\t\t }\n\t }\n\t \n\t else\n\t {\n\t \tlambda_term_query = \"select subgoal from web_view_table where renamed_view = '\"+ name +\"'\";\n\n\t\t\t\n\t\t pst = c.prepareStatement(lambda_term_query);\n\t\t \n\t\t ResultSet r = pst.executeQuery();\n\n\t\t while(r.next())\n\t\t {\n\t\t \t\t \t\n\t\t \ttable_names.add(r.getString(1));\n\t\t }\n\t }\n\t \n\t \n\t \n\n\t}", "private String buildStaticViewString(Stream strm, String name) {\n\t\tString viewString = \"CREATE TEMP TABLE \"+name;\n\t\tviewString += \" AS \";\n\t\tviewString += \"SELECT * FROM \" + generateStreamData(strm, name, false) + \";\\r\\n\";\n\t\treturn viewString;\n\t}", "com.google.spanner.v1.Session getSessionTemplate();", "TableId table();", "@Test\n public void testAliasedTableColumns()\n {\n assertEquals(\n runner.execute(\"SELECT * FROM orders AS t (a, b, c, d, e, f, g, h, i)\"),\n runner.execute(\"SELECT * FROM orders\"));\n }", "private String getTableAlias(String stageName) {\n String tableAlias = stageToTableAliasMap.get(stageName);\n\n if (tableAlias == null) {\n throw new SQLEngineException(String.format(\"Unable to determine table alias for stage '%s'\", stageName));\n }\n\n return tableAlias;\n }", "public LoggingTable(String alias) {\n\t\tthis(alias, LOGGING);\n\t}", "public SpeedAlertsHistory(Name alias) {\n this(alias, SPEED_ALERTS_HISTORY);\n }", "public String getTableDbName() {\r\n return \"t_testplans\";\r\n }", "void registerAlias( String beanName, String alias );", "FromTable createFromTable();", "public void createTapTable(TableConfig tableConfig) throws ConfigurationException;", "@ManyToOne(fetch = FetchType.LAZY)\n @JoinColumn(name = \"pollid\", referencedColumnName = \"pollid\", nullable = false)\n public Poll getPoll() {\n\treturn this.poll;\n }", "interface SessionsPresentersColumns {\n String SESSION_ID = \"session_id\";\n String PRESENTER_ID = \"presenter_id\";\n }", "public interface PoliticalPartyTableSchema {\n\n\tString POLITICAL_PARTY_TABLE = \"political_parties\";\n\t\n\tString POLITICAL_PARTY_ID_COL = \"political_party_id\";\n\tString POLITICAL_PARTY_NAME_COL = \"political_party_name\";\n}", "FromTableJoin createFromTableJoin();", "String getConnectionAlias();", "String getConnectionAlias();", "public String getPingTable()\n {\n return _pingTable;\n }", "@SqlUpdate(\"update update_user_jobs inner join \" +\n \"(select id from update_user_jobs where timeout_at < current_timestamp() order by timeout_at asc limit 1) \" +\n \"as t1 using(id) set timeout_at = :timeoutAt, owner = connection_id()\")\n long acquireUntil(@Bind(\"timeoutAt\") Timestamp timeoutAt);", "public String getTableDbName() {\r\n return \"enterprise_offer\";\r\n }", "private void appendPrimaryTableName() {\n super.appendTableName(Constants.FROM, joinQueryInputs.primaryTableName);\n }", "private void renameAnalyticsPeriodBoundaryTableToPeriodBoundary()\r\n {\r\n\r\n String sql =\r\n \"INSERT INTO periodboundary(periodboundaryid, uid, code, created, lastupdated, lastupdatedby, boundarytarget, analyticsperiodboundarytype, offsetperiods, offsetperiodtypeid, programindicatorid) \" +\r\n \"SELECT analyticsperiodboundaryid, uid, code, created, lastupdated, lastupdatedby, boundarytarget, analyticsperiodboundarytype, offsetperiods, offsetperiodtypeid, programindicatorid \" +\r\n \"FROM analyticsperiodboundary; \" +\r\n \"DROP TABLE analyticsperiodboundary;\";\r\n\r\n executeSql( sql );\r\n\r\n }", "public PgPublicationTables(String alias) {\n this(DSL.name(alias), PG_PUBLICATION_TABLES);\n }", "public PgPublicationTables(Name alias) {\n this(alias, PG_PUBLICATION_TABLES);\n }", "public void setLastAnchor(java.sql.Timestamp tmp) {\n this.lastAnchor = tmp;\n }", "public interface Sqlable {\n\n Map<String, Object> getSqlMap();\n\n String getTableName();\n\n}", "public static String tableName() {\r\n return \"TB_UPP_CHECK_STORE_DIVERGENCE\";\r\n }", "@Test\n public void testMaskFlinkSql() {\n String unmasked = \"CREATE TABLE `table_1`(\\n\"\n + \" PRIMARY KEY (`id`) NOT ENFORCED,\\n\"\n + \" `id` INT,\\n\"\n + \" `name` STRING,\\n\"\n + \" `age` INT)\\n\"\n + \" WITH (\\n\"\n + \" 'inlong.metric.labels' = 'groupId=1&streamId=1&nodeId=1',\\n\"\n + \" 'connector' = 'mysql-cdc-inlong',\\n\"\n + \" 'hostname' = 'localhost',\\n\"\n + \" 'database-name' = 'test',\\n\"\n + \" 'port' = '3306',\\n\"\n + \" 'server-id' = '10011',\\n\"\n + \" 'scan.incremental.snapshot.enabled' = 'true',\\n\"\n + \" 'username' = 'root',\\n\"\n + \" 'password' = 'inlong',\\n\"\n + \" 'table-name' = 'user'\\n\"\n + \")\";\n\n String masked = \"CREATE TABLE `table_1`(\\n\"\n + \" PRIMARY KEY (`id`) NOT ENFORCED,\\n\"\n + \" `id` INT,\\n\"\n + \" `name` STRING,\\n\"\n + \" `age` INT)\\n\"\n + \" WITH (\\n\"\n + \" 'inlong.metric.labels' = 'groupId=1&streamId=1&nodeId=1',\\n\"\n + \" 'connector' = 'mysql-cdc-inlong',\\n\"\n + \" 'hostname' = 'localhost',\\n\"\n + \" 'database-name' = 'test',\\n\"\n + \" 'port' = '3306',\\n\"\n + \" 'server-id' = '10011',\\n\"\n + \" 'scan.incremental.snapshot.enabled' = 'true',\\n\"\n + \" 'username' = 'root',\\n\"\n + \" 'password' = '******',\\n\"\n + \" 'table-name' = 'user'\\n\"\n + \")\";\n StringBuilder buffer = new StringBuilder(unmasked);\n MaskDataUtils.mask(buffer);\n assertEquals(masked, buffer.toString());\n }", "String jobTableName();", "static String getTableName(Configuration conf) {\n String layout = conf.get(MRUtils.TABLE_LAYOUT_PROP,\n RdfCloudTripleStoreConstants.TABLE_LAYOUT.SPO.toString());\n String prefix = conf.get(MRUtils.TABLE_PREFIX_PROPERTY,\n RdfCloudTripleStoreConstants.TBL_PRFX_DEF);\n return RdfCloudTripleStoreUtils.layoutPrefixToTable(\n RdfCloudTripleStoreConstants.TABLE_LAYOUT.valueOf(layout), prefix);\n }", "Table fetchSchema(LogSequenceNumber lsn, String tableName);", "public interface SettingsEventQuery {\r\n public static final String[] COLUMNS = {\"keyField\", \"keyValue\"};\r\n public static final String CREATE_TABLE = (\"CREATE TABLE IF NOT EXISTS Settings(\" + COLUMNS[0] + \" TEXT, \" + COLUMNS[1] + \" TEXT )\");\r\n public static final String DROP_TABLE = \"DROP TABLE IF EXISTS Settings\";\r\n public static final int KEY_FIELD = 0;\r\n public static final int KEY_VALUE = 1;\r\n public static final String TABLE = \"Settings\";\r\n }", "public String appendLockHint(LockOptions lockOptions, String tableName){\n \t\treturn tableName;\n \t}", "SessionBeanDescriptor createSessionBeanDescriptor();", "@Transactional\n public abstract OnmsDistPoller createDistPollerIfNecessary(String dpName, String dpAddr);", "String pvIDTableName();", "public Mytable(Name alias) {\n this(alias, MYTABLE);\n }", "private void createStocksTable() {\n\t\ttry {\n\t\t\tStatement stmt = this.conn.createStatement();\n\t\t\tstmt.executeUpdate(\"CREATE TABLE stocks \"\n\t\t\t\t\t+ \"(id BIGINT GENERATED ALWAYS AS IDENTITY, \" + \"owner INT, \"\n\t\t\t\t\t+ \"shareAmount INT, \" + \"purchasePrice DOUBLE, \" + \"symb VARCHAR(10), \"\n\t\t\t\t\t+ \"timePurchased BIGINT)\");\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"Created table stocks\");\n\t\t} catch (SQLException sqle) {\n\t\t\tSystem.err.println(\"Creation of stocks table FAILED\");\n\t\t\tSystem.err.println(sqle);\n\t\t}\n\t}", "private String createLabelTableSQL()\n\t{\n\t\treturn \"LABEL ON TABLE \" + getFullPath() + \" IS '\" + SQLToolbox.cvtToSQLFieldColHdg(function.getLabel()) + \"'\";\n\t}", "private void statsTable() {\n try (Connection connection = hikari.getConnection()) {\n try (PreparedStatement statement = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS `\" + TABLE_STATS + \"` \" +\n \"(id INT NOT NULL AUTO_INCREMENT UNIQUE, \" +\n \"uuid varchar(255) PRIMARY KEY, \" +\n \"name varchar(255), \" +\n \"kitSelected varchar(255), \" +\n \"points INT, \" +\n \"kills INT, \" +\n \"deaths INT, \" +\n \"killstreaks INT, \" +\n \"currentKillStreak INT, \" +\n \"inGame BOOLEAN)\")) {\n statement.execute();\n statement.close();\n connection.close();\n }\n } catch (SQLException e) {\n LogHandler.getHandler().logException(\"TableCreator:statsTable\", e);\n }\n }", "private String getCloneSetLinkTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CLONE_SET_LINK(\");\n \t\tbuilder.append(\"CLONE_SET_LINK_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"BEFORE_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"AFTER_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"BEFORE_REVISION_ID LONG,\");\n \t\tbuilder.append(\"AFTER_REVISION_ID LONG,\");\n \t\tbuilder.append(\"CHANGED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"ADDED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"DELETED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"CO_CHANGED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"CODE_FRAGMENT_LINKS TEXT NOT NULL\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "String pvTableName();", "public String generateTemporaryTableName(String baseTableName) {\n \t\treturn \"HT_\" + baseTableName;\n \t}", "private void reloadPlanTable() {\n\t\t\r\n\t}", "public PgTable(final String name) {\n this.name = name;\n }", "private String getSQL() {\n return \" SELECT * FROM PFEventNotification \";\n }", "public WebhookTriggerSeries(Name alias) {\n this(alias, WEBHOOK_TRIGGER_SERIES);\n }", "protected void createTableRecordings() {\n\t\tString query = \n\t\t\t\t\"CREATE TABLE IF NOT EXISTS Recordings (\" \t\t\t\t\t\t\t+\n\t\t\t\t\"artist_name\tVARCHAR(128),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"track_name\t\tVARCHAR(128),\" \t\t\t\t\t\t\t\t\t\t+\n\t\t\t\t\"CONSTRAINT unique_track PRIMARY KEY (artist_name, track_name)\" \t+\n\t\t\t\t\");\"\n\t\t\t\t;\n\t\tcreateTable(query);\n\t}", "public static void buildOfficeTable() {\n\t\tif (TableExists(\"office\"))\n\t\t\treturn;// if office table has been built, no need to build again\n\t\tConnect connectLocal = new Connect(\"local\", localDatabase);\n\t\tConnection localConnection = connectLocal.getConnection();\n\t\tConnect connectServer = new Connect(\"server\", serverDatabase);\n\t\tConnection serverConnection = connectServer.getConnection();\n\t\tResultSet rs;\n\t\tList<String> emails = new ArrayList<>();\n\t\ttry {\n\t\t\tStatement stmtserver = serverConnection.createStatement();\n\t\t\trs = stmtserver.executeQuery(\n\t\t\t\t\tString.format(\"select email from USER where office is not null and email is not null\"));\n\t\t\twhile (rs.next()) {\n\t\t\t\temails.add(rs.getString(1));\n\t\t\t}\n\t\t\tStatement stmtlocal = localConnection.createStatement();\n\t\t\t//System.out.println(emails.size());\n\t\t\tfor (int i = 0; i < emails.size(); i++) {\n\t\t\t\trs = stmtserver.executeQuery(String.format(\n\t\t\t\t\t\t\"select INFRASTRUCTURE.name from USER, INFRASTRUCTURE\"\n\t\t\t\t\t\t\t\t+ \" where USER.office=INFRASTRUCTURE.SEMANTIC_ENTITY_ID and USER.email='%s'\",\n\t\t\t\t\t\temails.get(i)));\n\t\t\t\twhile (rs.next()) {\n\t\t\t\t\tstmtlocal.executeUpdate(String.format(\"insert into office(email,office) value('%s','%s')\",\n\t\t\t\t\t\t\temails.get(i), rs.getString(1)));\n\t\t\t\t}\n\t\t\t}\n\t\t\trs.close();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tconnectLocal.close();\n\t\tconnectServer.close();\n\t}", "public DqcTableRuleConfig(String alias) {\n this(DSL.name(alias), DQC_TABLE_RULE_CONFIG);\n }", "RepeatStatement createRepeatStatement();", "public NetworkTableListenerPoller(NetworkTableInstance inst) {\n m_inst = inst;\n m_handle = NetworkTablesJNI.createListenerPoller(inst.getHandle());\n }", "SqlTables(String tableName){\n\t\t\t this.tableName = tableName; \n\t\t}", "private void appendFullTableNameAndAlias(String stageName) {\n builder.append(getFullTableName(stageName)).append(AS).append(getTableAlias(stageName));\n }", "@Override\n\tpublic Class<SessionPollRecord> getRecordType() {\n\t\treturn SessionPollRecord.class;\n\t}", "public RequiredTimeTable getRoomSharingTable(Session session, User editingUser) {\n \treturn new RequiredTimeTable(getRoomSharingModel(session, editingUser, null));\n }", "@VisibleForTesting\n protected static String quoteAlias(String alias) {\n return String.format(\"`%s`\", alias);\n }", "public String getJunctionTableName(String table1)\n\t{\n\t\treturn \"Junct_\"\n\t\t\t\t+ table1 \n\t\t\t\t+ \"_\"\n\t\t\t\t+ this.getDBTableName(); \n\t}", "private void processCreateAlias() throws HsqlException {\n\n String alias;\n String methodFQN;\n\n try {\n alias = tokenizer.getSimpleName();\n } catch (HsqlException e) {\n if (session.isProcessingScript()) {\n alias = null;\n } else {\n throw e;\n }\n }\n\n tokenizer.getThis(Token.T_FOR);\n\n methodFQN = upgradeMethodFQN(tokenizer.getSimpleName());\n\n if (alias != null) {\n database.getAliasMap().put(alias, methodFQN);\n }\n }", "public R2dbcMessageHandlerSpec tableNameExpression(Expression tableNameExpression) {\n\t\tthis.reactiveMessageHandler.setTableNameExpression(tableNameExpression);\n\t\treturn this;\n\t}", "public QbUpdate inTable(String table);", "@Override\n\tprotected void setupV2Tables(Connection connection) throws SQLException {\n\n\t\tStatement create = connection.createStatement();\n\n\t\t// Prefix tables to mh_\n\t\ttry {\n\t\t\tResultSet rs = create.executeQuery(\"SELECT * from Daily LIMIT 0\");\n\t\t\trs.close();\n\t\t\tcreate.executeUpdate(\"RENAME TABLE Players TO mh_Players\");\n\t\t\tcreate.executeUpdate(\"RENAME TABLE Daily TO mh_Daily\");\n\t\t\tcreate.executeUpdate(\"RENAME TABLE Weekly TO mh_Weekly\");\n\t\t\tcreate.executeUpdate(\"RENAME TABLE Monthly TO mh_Monthly\");\n\t\t\tcreate.executeUpdate(\"RENAME TABLE Yearly TO mh_Yearly\");\n\t\t\tcreate.executeUpdate(\"RENAME TABLE AllTime TO mh_AllTime\");\n\t\t\tcreate.executeUpdate(\"RENAME TABLE Achievements TO mh_Achievements\");\n\n\t\t\tcreate.executeUpdate(\"DROP TRIGGER IF EXISTS DailyInsert\");\n\t\t\tcreate.executeUpdate(\"DROP TRIGGER IF EXISTS DailyUpdate\");\n\n\t\t} catch (SQLException e) {\n\t\t}\n\n\t\t// Create new empty tables if they do not exist\n\t\tString lm = plugin.getConfigManager().learningMode ? \"1\" : \"0\";\n\t\tcreate.executeUpdate(\n\t\t\t\t\"CREATE TABLE IF NOT EXISTS mh_Players (UUID CHAR(40) PRIMARY KEY, NAME CHAR(20), PLAYER_ID INTEGER NOT NULL AUTO_INCREMENT, \"\n\t\t\t\t\t\t+ \"KEY PLAYER_ID (PLAYER_ID), LEARNING_MODE INTEGER NOT NULL DEFAULT \" + lm\n\t\t\t\t\t\t+ \", MUTE_MODE INTEGER NOT NULL DEFAULT 0)\");\n\t\tString dataString = \"\";\n\t\tfor (StatType type : StatType.values())\n\t\t\tdataString += \", \" + type.getDBColumn() + \" INTEGER NOT NULL DEFAULT 0\";\n\t\tcreate.executeUpdate(\n\t\t\t\t\"CREATE TABLE IF NOT EXISTS mh_Daily (ID CHAR(7) NOT NULL, PLAYER_ID INTEGER REFERENCES mh_Players(PLAYER_ID) ON DELETE CASCADE\"\n\t\t\t\t\t\t+ dataString + \", PRIMARY KEY(ID, PLAYER_ID))\");\n\t\tcreate.executeUpdate(\n\t\t\t\t\"CREATE TABLE IF NOT EXISTS mh_Weekly (ID CHAR(6) NOT NULL, PLAYER_ID INTEGER REFERENCES mh_Players(PLAYER_ID) ON DELETE CASCADE\"\n\t\t\t\t\t\t+ dataString + \", PRIMARY KEY(ID, PLAYER_ID))\");\n\t\tcreate.executeUpdate(\n\t\t\t\t\"CREATE TABLE IF NOT EXISTS mh_Monthly (ID CHAR(6) NOT NULL, PLAYER_ID INTEGER REFERENCES mh_Players(PLAYER_ID) ON DELETE CASCADE\"\n\t\t\t\t\t\t+ dataString + \", PRIMARY KEY(ID, PLAYER_ID))\");\n\t\tcreate.executeUpdate(\n\t\t\t\t\"CREATE TABLE IF NOT EXISTS mh_Yearly (ID CHAR(4) NOT NULL, PLAYER_ID INTEGER REFERENCES mh_Players(PLAYER_ID) ON DELETE CASCADE\"\n\t\t\t\t\t\t+ dataString + \", PRIMARY KEY(ID, PLAYER_ID))\");\n\t\tcreate.executeUpdate(\n\t\t\t\t\"CREATE TABLE IF NOT EXISTS mh_AllTime (PLAYER_ID INTEGER REFERENCES mh_Players(PLAYER_ID) ON DELETE CASCADE\"\n\t\t\t\t\t\t+ dataString + \", PRIMARY KEY(PLAYER_ID))\");\n\t\tcreate.executeUpdate(\"CREATE TABLE IF NOT EXISTS mh_Achievements \"\n\t\t\t\t+ \"(PLAYER_ID INTEGER REFERENCES mh_Players(PLAYER_ID) ON DELETE CASCADE, \"\n\t\t\t\t+ \"ACHIEVEMENT VARCHAR(64) NOT NULL, DATE DATETIME NOT NULL, \"\n\t\t\t\t+ \"PROGRESS INTEGER NOT NULL, PRIMARY KEY(PLAYER_ID, ACHIEVEMENT))\");\n\t\tcreate.executeUpdate(\"CREATE TABLE IF NOT EXISTS mh_Bounties (\" //\n\t\t\t\t+ \"BOUNTYOWNER_ID INTEGER NOT NULL, \"//\n\t\t\t\t+ \"MOBTYPE CHAR(6), \"//\n\t\t\t\t+ \"WANTEDPLAYER_ID INTEGER NOT NULL, \"//\n\t\t\t\t+ \"NPC_ID INTEGER, \"//\n\t\t\t\t+ \"MOB_ID CHAR(40), \"//\n\t\t\t\t+ \"WORLDGROUP CHAR(20) NOT NULL, \"//\n\t\t\t\t+ \"CREATED_DATE BIGINT NOT NULL, \"//\n\t\t\t\t+ \"END_DATE BIGINT NOT NULL, \"//\n\t\t\t\t+ \"PRIZE FLOAT NOT NULL, \"//\n\t\t\t\t+ \"MESSAGE CHAR(64), \"//\n\t\t\t\t+ \"STATUS INTEGER NOT NULL DEFAULT 0, \" + \"PRIMARY KEY (WORLDGROUP,BOUNTYOWNER_ID,WANTEDPLAYER_ID), \"\n\t\t\t\t+ \"FOREIGN KEY(BOUNTYOWNER_ID) REFERENCES mh_Players(PLAYER_ID) ON DELETE CASCADE, \"\n\t\t\t\t+ \"FOREIGN KEY(WANTEDPLAYER_ID) REFERENCES mh_Players(PLAYER_ID) ON DELETE CASCADE\" + \")\");\n\n\t\tcreate.close();\n\t\tconnection.commit();\n\n\t\t// Setup Database triggers\n\t\tsetupTriggerV2(connection);\n\n\t\tperformTableMigrateFromV1toV2(connection);\n\t\tconnection.close();\n\t}", "private String getCorrectCallLogTableName() {\n Uri uri = CallLog.Calls.CONTENT_URI;\n String testTableName = CallLog.Calls._ID + \" in (select \" + CallLog.Calls._ID +\n \" from calls group by \" + CallLog.Calls.NUMBER + \")\";\n\n Cursor cursor = null;\n try {\n if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.READ_CALL_LOG) != PackageManager.PERMISSION_GRANTED) {\n\n }\n cursor = getContext().getContentResolver().query(uri,\n new String[]{CallLog.Calls._ID}, testTableName, null, null);\n cursor.moveToNext();\n } catch (Exception e) {\n if (e.getMessage().toLowerCase().contains(\"no such table\")) {\n return \"logs\";\n } else if (BuildConfig.DEBUG) {\n Log.d(TAG, \"Exception while checking table name\", e);\n }\n } finally {\n Util.close(cursor);\n }\n return \"calls\";\n }" ]
[ "0.510877", "0.5086602", "0.5020474", "0.47995132", "0.4749471", "0.45399758", "0.4512812", "0.45094064", "0.44806656", "0.44693735", "0.44424686", "0.44227105", "0.44104153", "0.43719268", "0.4329224", "0.4328783", "0.4267735", "0.4256508", "0.42561564", "0.42498362", "0.4246285", "0.4240358", "0.4238282", "0.42214435", "0.4220693", "0.41987723", "0.41870815", "0.41865292", "0.4186381", "0.4174694", "0.4173858", "0.41701415", "0.41674498", "0.41632342", "0.41628948", "0.4151426", "0.41503224", "0.4140444", "0.41388637", "0.41080964", "0.41032284", "0.40966046", "0.40944153", "0.4091005", "0.4082795", "0.40826333", "0.4080585", "0.4079574", "0.4076399", "0.40762845", "0.4063988", "0.4056701", "0.40552017", "0.40552017", "0.404847", "0.40451398", "0.40326145", "0.40299878", "0.40290466", "0.40267143", "0.40152845", "0.40061304", "0.40059304", "0.39973965", "0.3992514", "0.39918476", "0.3986112", "0.39775258", "0.39772156", "0.39741316", "0.3972846", "0.39616883", "0.39615372", "0.39532554", "0.39325", "0.39302093", "0.3927324", "0.39272806", "0.39241615", "0.3924053", "0.3915468", "0.39147723", "0.39081353", "0.39030492", "0.3894793", "0.3888933", "0.388049", "0.3878602", "0.38730806", "0.38664505", "0.3865378", "0.38604727", "0.38578242", "0.38548112", "0.38543576", "0.3846221", "0.38454396", "0.3840457", "0.38339013", "0.38209456" ]
0.55095077
0
Method for adding items to an array in order
public static void inventory(String name, String[] array1) { // Adds input to the next available spot in the specified array for (int i = 0; i < array1.length; i++) { if (array1[i] == null) { array1[i] = name; break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void insert(int newItem){\n itemArray[count] = newItem;\n count++;\n }", "@Override\n public void add(T t) {\n checkIfArrayFull();\n\n arrayList[elementsInArray] = t;\n elementsInArray++;\n }", "public void addItems(K[] items) {\n\n\t\tfor (K item : items) {\n\t\t\tInteger count = (duplicates.get(item));\n\t\t\tduplicates.put(item, ((count != null) ? count += 1 : 1));\n\t\t}\n\t}", "public void addNewItem(OrderItem newOrderItem){\n itemsInOrder.add(newOrderItem);\n }", "@Override\n public void add(int index, T element) {\n Object[] newArray = new Object[size + 1];\n for (int i = 0; i < index; i++) {\n newArray[i] = data[i];\n }\n newArray[index] = element;\n for (int i = index + 1; i < newArray.length; i++) {\n newArray[i] = data[i - 1];\n }\n data = newArray;\n size++;\n }", "public void addAll(T[] arr, int from, int length);", "public void add( Comparable newVal ) {\n \t//if _data is full, expand the array\n \tif (_size == _data.length){\n\t \texpand();\n \t}\n \t\n\tset(_lastPos + 1, newVal);\n \t//increases _lastPos and _size\n \t_lastPos++;\n \t_size++;\n }", "public static void addToOrder(ArrayList order){\n String itemOrdered = orderItem();\n switch (itemOrdered) {\n case \"D\":\n order.add(orderDrink());\n break;\n case \"B\":\n order.add(orderBurger());\n break;\n case \"P\":\n order.add(orderPizza());\n break;\n default:\n break;\n }\n }", "private void arrivedAdd(Passenger in) {\n\t\tif(counter >= capacity) {\n\t\t\tcapacity *= 2;\n\t\t\tPassenger[] temp = new Passenger[capacity];\n\t\t\tfor(int i = 0; i < arrivedOrder.length; i++) {\n\t\t\t\ttemp[i] = arrivedOrder[i];\n\t\t\t}\n\t\t\tarrivedOrder = temp;\n\t\t}\n\t\tarrivedOrder[counter] = in;\n\t}", "void add(int index, int value) {\n int[] newItems = new int[size++];\n\n System.arraycopy(items, 0, newItems, 0, index);\n\n newItems[index] = value;\n\n System.arraycopy(items, index, newItems, index + 1, items.length - index);\n\n items = newItems;\n }", "void addToEnd(Object[] by);", "public void Add(int[] item) {\n Add(item.length * 4);\n\n\n for (int i = 0; i < item.length; i++) {\n AddInt(item[i]);\n }\n mLenght += Integer.SIZE / 8 * item.length;\n mBackOffset = mLenght;\n }", "@Override\n\tpublic boolean add(E item) {\n\t\tif (this.numberOfElements == this.size) {\n\t\t\tE[] newArrayList = (E[]) new Object[this.size * 2];\n\t\t\tint i = 0;\n\t\t\twhile (i < this.size) {\n\t\t\t\tnewArrayList[i] = this.arrayList[i];\n\t\t\t\ti += 1;\n\t\t\t}\n\t\t\tthis.arrayList = newArrayList;\n\t\t\tthis.size = this.size * 2;\n\t\t}\n\t\tthis.arrayList[this.numberOfElements] = item;\n\t\tthis.numberOfElements += 1;\n\t\treturn true;\n\t}", "static void insert(int[] A, int itemsIntArray, int newItem) {\r\n\t\tint loc = itemsIntArray - 1;\r\n\t\t\r\n\t\t /* Move items bigger than newItem up one space;\r\n\t Stop when a smaller item is encountered or when the\r\n\t beginning of the array (loc == 0) is reached. */\r\n\t\t\r\n\t\twhile (A[loc] > newItem && loc >= 0) {\r\n\t\t\tA[loc+1] = A[loc];\r\n\t\t\tloc--;\r\n\t\t}\r\n\t\tA[loc+1] = newItem;\r\n\t}", "public void addAll(T[] arr);", "@Override\n public boolean add(int index, T object) {\n T[] newArray;\n if (array[array.length - 1] != null) {\n newArray = (T[]) new Object[array.length * 2];\n } else {\n newArray = (T[]) new Object[array.length];\n }\n for (int i = 0; i < index; i++) {\n newArray[i] = array[i];\n\n }\n newArray[index] = object;\n for (int i = index + 1; i < array.length; i++) {\n newArray[i] = array[i - 1];\n }\n this.size++;\n this.array = newArray;\n return true;\n }", "public void add(Object o){\n if (n<sequence.length){\n// sequence[n]=o;\n// n++;\n sequence[n++]=o;\n }\n }", "@Override\n // worst-case complexity: O(n), since it might need to resize itself\n // amortised average-case complexity: O(1), since resizing happens too\n // too infrequent to affect the actual complexity\n public void add(T item) {\n if (size >= arr.length)\n arr = resize(arr, EXPAND_FACTOR);\n // we add the item to the end and then increment the size\n arr[size++] = item;\n }", "@Override\n public void add(int index, T t) {\n checkIfArrayFull();\n\n if(index >= arrayList.length) {\n System.out.println(\"The index is out of bounds for this list\");\n System.exit(-1);\n }\n\n Object ob = arrayList[index];\n arrayList[index] = t;\n\n Object ob2;\n\n /*The loop cycles through the array starting at index. ob2 is given the value of arrayList at i+1 position.\n The arrayList at i+1 position is assigned the value of ob. Then the ob variable is assigned the value of ob2. */\n for(int i = index; i < arrayList.length - 1; i++) {\n ob2 = arrayList[i+1];\n arrayList[i+1] = ob;\n ob = ob2;\n }\n\n elementsInArray++;\n }", "private String[] addItemToArray(String item, String[] myArray) {\n if (!ApiFunctions.isEmpty(item)) {\n if (ApiFunctions.isEmpty(myArray)) {\n return myArray = new String[] { item };\n }\n else {\n String[] temp = new String[myArray.length + 1];\n System.arraycopy(myArray, 0, temp, 0, myArray.length);\n temp[temp.length - 1] = item;\n return temp;\n }\n }\n else {\n return null;\n }\n }", "void append(E[] elements);", "@Override\n public void add(Object item)\n {\n if (size == list.length)\n {\n Object [] itemInListCurrently = deepCopy();\n list = new Object[size * 2];\n\n System.arraycopy(itemInListCurrently, 0, list, 0, size);\n }\n\n list[size++] = item;\n }", "@Override\n public void addFirst(T item) {\n if (size >= array.length) {\n resize(size * 2);\n array[nextFirst] = item;\n nextFirst = minusOne(nextFirst);\n } else {\n array[nextFirst] = item;\n nextFirst = minusOne(nextFirst);\n }\n size += 1;\n }", "public void add( Object value )\n\t{\n\t\tint n = size();\n\t\tif (addIndex >= n)\n\t\t{\n\t\t\tif (n == 0)\n\t\t\t\tn = 8;\n\t\t\telse\n\t\t\t\tn *= 2;\n\t\t\tObject narray = Array.newInstance( array.getClass().getComponentType(), n );\n\t\t\tSystem.arraycopy( array, 0, narray, 0, addIndex );\n\t\t\tarray = narray;\n\t\t}\n\t\tArray.set( array, addIndex++, value );\n\t}", "private void addItems(RegularItem...pItems)\r\n\t{\r\n\t\tfor (RegularItem item : pItems) {\r\n\t\t\tassert item != null;\r\n\t\t\taItems.add(item);\r\n\t\t};\r\n\t}", "public void add(int index, Object item)\n {\n items[index] = item;\n numItems++;\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic void add(T item){\n\t\t\n\n\t\tif(currentsize == data.length-1){\n\t\t\tgrow();\n\t\t}\n\n\t\t\n\t\tdata[currentsize] = item;\n\t\tcurrentsize++;\n\n\n\t}", "@Override\n public void add(int i, E e) throws IndexOutOfBoundsException {\n checkIndex(i, size + 1);\n if (size == data.length) // not enough capacity\n throw new IllegalStateException(\"Array is full\");\n for (int k = size - 1; k >= i; k--) // start by shifting rightmost\n data[k + 1] = data[k];\n data[i] = e; // ready to place the new element\n size++;\n }", "private SignatureDTO[] add(SignatureDTO[] array, SignatureDTO element) {\n Class type = (array != null ? array.getClass() : (element != null ? element.getClass() : SignatureDTO.class));\n SignatureDTO[] newArray = (SignatureDTO[]) copyArrayGrow1(array, type);\n newArray[newArray.length - 1] = element;\n return newArray;\n }", "public ListArrayBasedPlus(int size)\n {\n items = new Object[size];\n numItems = 0;\n }", "public void add(E value){\n if (maxIndex != array.length-1){\n array[++maxIndex] = value;\n }else {\n Object[] tmpArray = new Object[array.length+ capacity];\n for (int i = 0; i < array.length; i++) {\n tmpArray[i] = array[i];\n }\n array = tmpArray;\n array[++maxIndex] = value;\n }\n }", "@Override\n public void add(int i, E e) throws IndexOutOfBoundsException,\n IllegalStateException {\n if (i == size){\n addLast(e);\n }\n else {\n validIndex(i);\n checkSize();\n for (int j = size - 1; j >= i; j--) {\n data[j + 1] = data[j];\n }\n data[i] = e;\n size++;\n }\n }", "@Override\n public boolean add(T object) {\n T[] newArray;\n if (array[array.length - 1] != null) {\n newArray = (T[]) new Object[array.length * 2];\n } else {\n newArray = (T[]) new Object[array.length];\n }\n for (int i = 0; i < array.length; i++) {\n newArray[i] = array[i];\n }\n newArray[size] = object;\n this.size++;\n this.array = newArray;\n return true;\n }", "void add(int value) {\n size++;\n\n int[] newItems = new int[size];\n\n System.arraycopy(items, 0, newItems, 0, items.length);\n\n newItems[newItems.length - 1] = value;\n\n items = newItems;\n }", "public void add(int toBeAdded) {\n\t\tif (this.myCount==this.myValues.length){\n\t\t\tSystem.err.println(\"No more space in array\");\n\t\t\tSystem.exit(1);\n\t\t}\n \tthis.myValues[this.myCount] = toBeAdded;\n this.myCount++;\n }", "public void push(Item s) {\n\t\tif (N == arr.length)\n\t\t\tresize (arr.length*2);\t\n\t\tarr[N++] = s;\n\t}", "public void add(Item nextItemToAdd) {\n items.add(nextItemToAdd);\n Collections.sort(items);\n fireIntervalAdded(nextItemToAdd, indexOf(nextItemToAdd), indexOf(nextItemToAdd));\n }", "public void add(int i, T t) {\n if (size == elements.length) // checks potential overflow\n ensureCapacity(); // increase capacity\n size++; // increment size of list\n if (i < 0 || i >= size) // if there is no index i in list\n throw new IndexOutOfBoundsException(\"Treated index: \" + i + \" | Size of the Dynamic Array \" + size()); // cause IndexOutOfBoundException\n for (int j = size - 1; j > i; j--) { // treat elements of list with indexes in range [i+1, n]\n elements[j] = elements[j - 1]; // element shifts to right\n }\n elements[i] = t; // store element at index i\n }", "@JRubyMethod(name = \"push\", rest = true)\n public RubyArray push_m(IRubyObject[] items) {\n for (int i = 0; i < items.length; i++) {\n append(items[i]);\n }\n \n return this;\n }", "public synchronized void add(E value) {\n this.array.add(value);\n }", "public void enqueue(Item item) {\n if (item == null) throw new NullPointerException();\n\n if (size == array.length) {\n Item[] temp = (Item[]) new Object[array.length * 2];\n System.arraycopy( array, 0, temp, 0, array.length);\n array = temp;\n temp = null;\n }\n array[size] = item;\n size++;\n if(size>1) { \n int x=StdRandom.uniform(size);\n Item temp=array[x];\n array[x]=array[size-1];\n array[size-1]=temp;\n }\n\n }", "private void addAtIndex(int index, FoodItem item) {\n // store the \"pushed\" forward item\n FoodItem toMoveNext = this._stock[index];\n // and set the new item in index\n this._stock[index] = new FoodItem(item);\n\n // \"push\" forward in the array each item, until no more items to push.\n for (int i = index+1; i < _noOfItems+1; i++) {\n FoodItem tempToMoveNext = _stock[i];\n _stock[i] = toMoveNext;\n toMoveNext = tempToMoveNext;\n }\n\n // we added a new item for _stock, so now increase the noOfItem:\n this._noOfItems++;\n }", "public void insert(int item) {\n\t\tif(items.length == count) {\n\t\t\t// Create a new Array (Twice the Size)\n\t\t\tint[] newItems = new int[count*2];\n\t\t\t// Copy all the existing items\n\t\t\tfor (int i = 0; i < count; i++)\n\t\t\t\tnewItems[i] = items[i];\n\t\t\t// Set \"items\" to this new array\n\t\t\t\titems = newItems;\n\t\t}\n\t\t// Add the new element at the end.\n\t\titems[count++] = item;\n\t}", "@Override\n\tpublic void add(int index, Object e) throws IndexOutOfBoundsException\n\t{\n\t\t//just to check if the index is valid\n\t\tif ( index < 0 || index > size )\n \t\tthrow new IndexOutOfBoundsException();\n\t\t//check arraylist size\n\t\tif (size == myArray.length)\n\t\t\tresizeUp();\n\t\t//move all the proceeding elements to make room for the desired element\n\t\tfor ( int i = size; i > index; i-- )\n \t\tmyArray[i] = myArray[i-1];\n \t//plug the element\n\t\tmyArray[index] = e;\n \t++this.size;\n\n\t\t\n\t}", "@Override\n public void add(T element) throws Exception\n {\n \n if (!(element instanceof Comparable))\n {\n throw new Exception(\"Bad things happened\");\n }\n \n Comparable comparableElement = (Comparable) element;\n \n //expand array if full\n \n if (tail == myArray.length)\n {\n expandArray();\n }\n \n //search for correct spot\n int insertPosition;\n for (insertPosition = 0; insertPosition < tail && comparableElement.compareTo(myArray[insertPosition]) > 0; insertPosition++)\n {\n //empty on purpose\n }\n \n //shift elements over\n \n for (int i = tail; i > insertPosition; i--)\n {\n myArray[i] = myArray[i - 1];\n }\n \n //place the element\n \n myArray[insertPosition] = element;\n tail++;\n }", "public void arrayInsert(MyArrayList myArrayList, Results results, int value) {\r\n int old_size = myArrayList.size();\r\n myArrayList.insertSorted(value);\r\n int new_size = myArrayList.size();\r\n if(old_size + 1 == new_size) {\r\n results.storeNewResult(\"ArrayInsert test case: PASSED\");\r\n }\r\n else {\r\n results.storeNewResult(\"ArrayInsert test case: FAILED\");\r\n }\r\n }", "void add(int index, Object element);", "@Override\n public boolean add(T item) {\n // if the last spot in the array is unoccupied, item is simply added to the first empty spot\n if (arr[arr.length-1]!=null) {\n arr[size + 1] = item;\n size++;\n }\n // if array is full, number of spots is doubled and item is added\n if (arr[arr.length-1]== null){\n grow();\n arr[size+1] = item;\n size++;\n }\n return true;\n }", "public void enqueue(T item) {\r\n\r\n\t\t++item_count;\r\n\t\tif(item_count==arr.length)\r\n\t\t\tdoubleArray();\r\n\t\tarr[++back%arr.length]=item;\r\n\t}", "@Override\n public void enqueue(E e) {\n array.addLast(e);\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic void add(int pos, T item){\n\n\t\tif(pos > data.length){\n\t\t\tcurrentsize = currentsize*2;\n\t\t}\n\n\t\n\t\tfor(int i = currentsize; i > pos; i--){\n\t\t\tdata[i] = data[i-1];\n\t\t}\n\t\tdata[pos]= item;\n\t\tcurrentsize++;\n\t}", "public void add(int Item) {\n\t\t\tif (nowLength < MAXSIZE) {\n\t\t\t\tray[nowLength] = Item;\n\t\t\t\tnowLength++;\n\t\t\t}\n\t}", "public void addSNArray(StickyNote toAdd);", "@Override\n\tpublic boolean add(Object e)\n\t{\n\t\tif (size == myArray.length)\n\t\t\tresizeUp();\n\t\tmyArray[size] = e;\n\t\tsize++;\n\t\treturn false;\n\t}", "@Override\n public void add(int i, E e) throws IndexOutOfBoundsException {\n if (i < 0 || i > size) {\n throw new IndexOutOfBoundsException();\n }\n\n if (size == 0) {\n storage = e;\n } else if (size < 5) {\n if (size == 1) {\n E oldStorage = (E) storage;\n storage = new Object[5];\n ((E[]) storage)[0] = oldStorage;\n }\n\n for (int cnt = size - 1; cnt >= i; cnt--) {\n ((E[]) storage)[cnt + 1] = ((E[]) storage)[cnt];\n }\n ((E[]) storage)[i] = e;\n } else {\n if (size == 5) {\n storage = new ArrayList<E>(Arrays.asList((E[]) storage));\n }\n ((ArrayList<E>) storage).add(i, e);\n }\n\n size++;\n }", "public void enqueue(Item item){\n if (item == null){ throw new NullPointerException(\"Cannot add a null item\"); }\n\n // fill the nulls\n if(itemCount < array.length) {\n for(int i=0;i<array.length;i++) {\n if(array[i] == null) {\n array[i] = item;\n break;\n }\n }\n }\n // resize when too big\n if(itemCount == array.length){\n resize(2*itemCount);\n array[itemCount] = item;\n }\n itemCount++; // Item added!!\n }", "@Override\n public void add(int index, E value) {\n // todo: Students must code\n ensureCapacity();\n int pos = calculate(index); // True position in array\n\n // if there are no elements, set head to the position (index 0, position ??)\n // *protects against divide by zero in modulus*\n if(size() == 0) {\n data[pos] = value;\n head = pos;\n tail = pos;\n // tail = (pos+1)%data.length;\n }\n // if the logical position is the head, then insert right before head and reassign head-variable\n // *tail stays the same*\n else if(index == 0) {\n int i = (head-1);\n if (i < 0) i = data.length-1;\n head = i;\n data[head] = value;\n }\n else{\n // shift all array contents after pos right 1\n for(int i = (pos + size() - index); i > pos; i--)\n data[i % data.length] = data[(i-1) % data.length];\n data[pos] = value;\n tail = (tail + 1) % data.length;\n }\n curSize++;\n }", "public void addAll(Object[] toAdd) {\r\n\t\tAssert.isNotNull(toAdd);\r\n\t\tdata.addAll(Arrays.asList(toAdd));\r\n\r\n\t\tfireAdd(toAdd);\r\n\t}", "private void insert(int pos, T elem) {\n for (int i = size; i >= pos + 1; i--) {\n arr[i] = arr[i-1];\n }\n arr[pos] = elem;\n }", "@SafeVarargs\n public final void add(int position, Item... items) {\n add(position, asList(items));\n }", "public int addItem(Item i);", "@SuppressWarnings(\"unchecked\")\n\tpublic static <T> T[] insertItemToArray(T[] array, int index, T item) {\n\t\tT[] re = (T[]) Array.newInstance(array.getClass().getComponentType(), Array.getLength(array)+1);\n\t\tSystem.arraycopy(array, 0, re, 0, index);\n\t\tre[index] = item;\n\t\tSystem.arraycopy(array, index, re, index+1, array.length-index);\n\t\treturn re;\n\t}", "@Override\n public boolean addItem(T item) {\n //Make sure the Set does not already contain the item\n if(!this.contains(item)) {\n //Make sure there is enough room for the item. If there isn't\n //resize the array\n if(numItems == arr.length)\n this.ensureCap();\n //Add the item to the end and increment numItems\n arr[numItems++] = item;\n //return true\n return true;\n }\n //if item was already in set, return false\n return false;\n }", "public void addItemToList(String[] item) {\n \t\n \tcurrentTaskItems.add(item);\n }", "public void extendArray() {\n int index = size();\n Object[] temp = new Object[index + 1];\n for (int i=0; i < index; i++) {\n temp[i] = AL[i];\n }\n AL = temp;\n }", "public int insertItem(DataItem newItem)\n\t{\n\t\tnumItems++;\n\t\tlong newKey = newItem.dData;\n\t\t\n\t\tfor(int j=ORDER-2; j>=0; j--)\n\t\t{\n\t\t\tif(itemArray[j] == null)\n\t\t\t\tcontinue;\n\t\t\telse\n\t\t\t{\n\t\t\t\tlong itsKey = itemArray[j].dData;\n\t\t\t\tif(newKey < itsKey)\n\t\t\t\t\titemArray[j+1] = itemArray[j];\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\titemArray[j+1] = newItem;\n\t\t\t\t\treturn j+1;\n\t\t\t\t}\n\t\t\t}//end else (not null)\n\t\t}//end for\n\t\titemArray[0] = newItem;\n\t\treturn 0;\n\t}", "@Override\n public boolean add(T e) {\n if (elements.add(e)) {\n ordered.add(e);\n return true;\n } else {\n return false;\n }\n }", "public void push(T element){\n\t\tarray[noOfElements] = element;\n\t\tnoOfElements ++;\t\t\n\t}", "public void add(E a)\n {\n if (size == data.length) { // if the list is at capacity...\n // create a new, larger array\n E[] newData = (E[])(new Object[2*data.length]);\n \n // copy over all of the old elements\n for (int i = 0; i < size; i++)\n newData[i] = data[i];\n \n // redirect the old data reference\n data = newData;\n }\n\n // insert the new element\n data[size] = a;\n size++;\n }", "private static void testAdd(ArrayList list, int[] content) {\n System.out.print(\"Adding to the list: \");\n for (int index = 0; index < content[index]; index++) {\n list.addToEnd(content);\n } // end for\n System.out.println();\n displayList(list);\n }", "private void addToQueue (Parcel[] packagesAssigned){\n\n }", "public void addToEnd(T obj) {\r\n \t\t// Check obj is not null\r\n \t\tif(obj == null) {\r\n \t\t\treturn;\r\n \t\t}\r\n \t\t// Check if items is full\r\n \t\tif(numItems == items.length) {\r\n \t\t\tdoubleArrayLength();\r\n \t\t}\r\n \t\titems[numItems++] = obj;\r\n \t}", "public int addItem(Itemset i);", "public void add(T element) {\n if (size + 1 >= capacity) {\n if (capacity == 0) capacity = 1;\n else capacity *= 2; // double the array size\n T[] tempArrayList = (T[]) new Object[capacity];\n for (int i = 0; i < size; i++) tempArrayList[i] = genericArrayList[i];\n genericArrayList = tempArrayList; // genericArray has extra null at the end\n }\n genericArrayList[size++] = element;\n }", "public void add( Comparable newVal )\n {\n for( int p = 0; p < _data.size(); p++ ) {\n if ( newVal.compareTo( _data.get(p) ) < 0 ) {\n //newVal < oal[p]\n _data.add( p, newVal );\n return; //Q:why not break?\n }\n }\n _data.add( newVal ); //newVal > every item in oal, so add to end\n }", "@Override\n public void push(Integer value) {\n ar[pos++] = value; \n }", "@Override\n\tpublic boolean add(T insertItem) {\n\t\t// TODO Just add the item to the array\n\t\tif (isFull()) {\n\t\t\treturn false;\n\t\t}\n\t\tdata[size++] = insertItem;\n\t\treturn true;\n\t}", "public void add( Order item ) {\n\t\tsuper.internalAdd(item);\n\t}", "@Override\n public void add(final int index, final T element) {\n this.checkIndexToAdd(index);\n\n if (this.size > this.data.length - 1) {\n this.doubleArraySizeBy(2);\n }\n\n for (int i = this.size; i > index; i--) {\n this.data[i] = this.data[i - 1];\n }\n\n this.data[index] = element;\n this.size++;\n }", "public void incrementOrder() {\n mOrder++;\n }", "public static int[] addElement(int[] a, int e) {\n\t a = Arrays.copyOf(a, a.length + 1);\n\t a[a.length - 1] = e;\n\t return a;\n\t}", "private <T> void shiftArrayElements(T[] orderedArray, int i) {\n\t\tfor (int j = orderedArray.length - 1; i < j; j--) {\r\n\t\t\torderedArray[j] = orderedArray[j - 1];\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic boolean add(T obj, int index) {\n\t\tif (index < 0 || index > size) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (size >= array.length)\r\n\t\t\tallocate();\r\n\t\tSystem.arraycopy(array, index, array, index + 1, size - index);\r\n\t\tarray[index] = obj;\r\n\t\tsize++;\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic int insert_all(Object[] ob) {\n\t\treturn 0;\n\t}", "@Override\n public final boolean add(final Integer element) {\n // First, check to see that the array can support another element\n ensureCapacity(size);\n // Add the element to the next available slot\n arrayList[size++] = element;\n return true;\n }", "@Override\n public void addLast(T item) {\n if (size >= array.length) {\n resize(size * 2);\n array[nextLast] = item;\n nextLast = plusOne(nextLast);\n } else {\n array[nextLast] = item;\n nextLast = plusOne(nextLast);\n }\n size += 1;\n }", "@Override\n public synchronized void add(E element) {\n if (this.pointer == this.capacity) {\n int newCapacity = this.capacity + (this.capacity >> 1);\n Object[] arr = Arrays.copyOf(this.container, newCapacity);\n this.capacity = newCapacity;\n this.container = arr;\n }\n this.container[this.pointer++] = element;\n }", "void add(int index, T element);", "void add(int index, T element);", "void append(E[] elements, int off, int len);", "@Override\n\tpublic void add(int idx, E element) {\n\t\tif (element == null)\n\t\t\tthrow new NullPointerException();\n\t\tif (idx < 0 || idx > size())\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (element.equals(list[i]))\n\t\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\t// Element is added to the end of the list\n\t\tif (idx == size)\n\t\t\tlist[idx] = element;\n\n\t\t// Element is added at the beginning or middle\n\t\telse {\n\t\t\tfor (int i = size; i > idx; i--) {\n\t\t\t\tlist[i] = list[i - 1];\n\t\t\t}\n\t\t\tlist[idx] = element;\n\t\t}\n\n\t\tsize++;\n\t\tif (size == list.length)\n\t\t\tgrowArray();\n\n\t}", "void addItem (Item toAdd){\n\t\t\tthis.items.add(toAdd);}", "public void append(Item value) {\n throw new OurBadException(\" Item '\" + this.serialize() + \"' is not an array.\");\n }", "public void add(Message aMessage) \n { \n elements[tail] = aMessage; \n tail = (tail + 1) % elements.length; \n count++; \n }", "public void fillSorted()\n {\n for (int i=0; i<list.length; i++)\n list[i] = i + 2;\n }", "static void addOrder(orders orders) {\n }", "private void addNumberToArrayByIndex(Number[] array, Number number, int index) {\n if (index >= array.length) {\n array = arrayExtension(array);\n }\n array[index] = number;\n }", "public abstract void add(T element, int index);", "public void push(Object item) {\r\n\t\tdata.add(item);\r\n\r\n\t}", "private void addOrderByItem(Object theNode) {\n getOrderByItems().add(theNode);\n }", "private void testAddAtIndex(){\n System.out.println(\"------ TESTING : add(int index, int element) ------\");\n try{\n // The insertion will add values to the front\n // the sequence should be iSize-1....,1,0\n for(int i = 0; i < iSize ; i++){\n if(!iTestList.add(0,i))\n throw new RuntimeException(\"FAILED -> add(index,element) not working correctly\");\n }\n // we should test the out of edge cases\n // if we try the following code and the return value is true or if the\n // program crashes then there is a problem\n if(iTestList.add(iSize+10, 999 )){\n throw new RuntimeException(\"FAILED -> index should not be > SIZE\");\n }\n if(iTestList.add(-2,999 )){\n throw new RuntimeException(\"FAILED -> index should not be < 0\");\n }\n }catch(Exception e){\n System.out.println(e.getMessage());\n }\n }" ]
[ "0.6615831", "0.64801306", "0.6331203", "0.6248477", "0.62377095", "0.62214464", "0.6206648", "0.6204346", "0.61972404", "0.6184358", "0.6167735", "0.6160769", "0.6121079", "0.6108576", "0.6101751", "0.6097365", "0.6080764", "0.6057246", "0.6050325", "0.60439503", "0.6038021", "0.6033534", "0.5979748", "0.597264", "0.5969456", "0.5968563", "0.5968189", "0.59618855", "0.5951707", "0.59486234", "0.5943994", "0.593587", "0.5923957", "0.5913538", "0.59096724", "0.5906976", "0.5890411", "0.5865737", "0.58642435", "0.5831239", "0.5823137", "0.5819563", "0.5819168", "0.5817909", "0.58062285", "0.5806199", "0.57972324", "0.5786053", "0.5773526", "0.5753368", "0.57374585", "0.57355344", "0.57347685", "0.5731077", "0.57232827", "0.57143116", "0.5706118", "0.56867045", "0.56668943", "0.5666115", "0.566435", "0.5659566", "0.5656221", "0.56532085", "0.5638171", "0.5634607", "0.5630213", "0.5629175", "0.5626547", "0.5626352", "0.5624974", "0.5622867", "0.5621595", "0.5615111", "0.5615033", "0.56063795", "0.55992514", "0.559598", "0.5592716", "0.5590549", "0.5581442", "0.55792934", "0.55786103", "0.5569557", "0.55637115", "0.55586183", "0.55545247", "0.5552753", "0.5552753", "0.5549166", "0.5542813", "0.55421644", "0.55253804", "0.5521064", "0.55198604", "0.5518261", "0.55100995", "0.550869", "0.5504148", "0.55014104", "0.54975164" ]
0.0
-1
Method for accounting number of items bought if item is not unique to customer
public static void addSame(int num, String name, int[] array1, String[] array2) { // Adds count to the appropriate array index for (int i = 0; i < array1.length; i++) { if (name.equals(array2[i])) { array1[i] = array1[i] + num; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void incrementAmountBought() {\n amountBought++;\n }", "int getNumOfBuyOrders();", "public int getAmountBought() {\n //System.out.println(clientName + \" has bought \" + amountBought + \" shares of \" + companyName);\n return amountBought;\n }", "int getPurchasableOffersCount();", "int getNumOfSellOrders();", "public void itemsSold() {\n quanitySnacks--;\n }", "public int totalAllocatedOrders();", "public void buyItem() {\n List<Gnome> cart = user.getCart();\n String message = \"\";\n List<Gnome> bought = shopFacade.buyGnomes(cart);\n if (!bought.isEmpty()) {\n message = bought.size() + \" items bought\";\n } else {\n message = \"Could not buy any items\";\n }\n userFacade.assignBought(user, bought);\n user.getCart().removeAll(bought);\n cart.removeAll(bought);\n userFacade.setCartToUser(user.getUsername(), cart);\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Gnomes\", message);\n FacesContext.getCurrentInstance().addMessage(null, msg);\n }", "public int totalOrdersTaken();", "public int howManyAvailable(Item i){/*NOT IMPLEMENTED*/return 0;}", "int getBuyQuantity();", "@Test\n\tpublic void getCostForDuplicateItem() {\n\t\tfinal BasketItemImpl bi = new BasketItemImpl();\n\t\tbi.addBasketItem(\"banana\", 2);\n\t\tbi.addBasketItem(\"banana\", 4);\n\t\tbi.addBasketItem(\"lemon\", 3);\n\n\t\tfinal int fc = bi.getAllBasketItems().get(\"banana\");\n\t\tassertTrue(Integer.compare(6, fc) == 0);\n\n\t}", "public synchronized int getNumberOfItems(){\n int totalItems=0;\n \n for(ShoppingCartItem item : getItems()){\n //we sum the quantity of products for each item\n totalItems += item.getQuantity();\n }\n \n return totalItems;\n }", "public void addBuy() {\r\n\t\tbuys++;\r\n\t\tnotifyObservers();\r\n\t}", "public int quantity(final T item) {\n if (items.containsKey(item)) {\n return items.get(item);\n } else {\n return 0;\n }\n }", "@Override\r\n\tpublic int countCart(String userid, int pnum) {\n\t\treturn 0;\r\n\t}", "private int checkItemQuantity() {\n\n int desiredQuantity = initialQuantity;\n MenusItem tempItem = null;\n tempItem = ItemCart.getInstance().checkItem(menusItem);\n\n if(tempItem != null){\n desiredQuantity = tempItem.getDesiredQuantity();\n }\n\n\n return desiredQuantity;\n }", "private int countProductsInCart_UPDATED() {\n System.out.println(\"-=====================Shopping Cart List========================================-\");\n int count, value;\n count = 0;\n List<WebElement> cakes = getDriver().findElements(By.xpath(\"//*[text()='Edit Your Cake']\"));\n List<WebElement> sthAndCnC = getDriver().findElements(By.xpath(\"//*[starts-with(@id, 'basketBody_') and @type='number']\"));\n System.out.println(\" === adding \" + cakes.size() + \" cakes to count\");\n count += cakes.size();\n for (WebElement product : sthAndCnC) {\n if ((!product.getAttribute(\"value\").equals(\"\")) && (product.getAttribute(\"value\") != null)) {\n String checkForLB = product.getAttribute(\"data-qtyincrement\");\n if (checkForLB.contains(\"0.\")) { //To validate for LB(s) items\n value = 1;\n } else {\n value = Integer.valueOf(product.getAttribute(\"value\"));\n }\n System.out.println(\"=== adding \" + value + \" cnc or sth item to cart\");\n count += value;\n } else {\n System.out.println(\"=== error adding product quantity\");\n }\n }\n System.out.println(\" === Count was: \" + count);\n System.out.println(\"-=====================Shopping Cart List========================================-\");\n return count;\n }", "@Override\n\tpublic int buy(Weapon item) {\n\t\treturn 0;\n\t}", "public Integer getBuyCount() {\n return buyCount;\n }", "public int getAddItems(int totalCollected, int totalItemInGame);", "public int getNewItemCount(Item catalogItem) {\n int count = 0;\n for (Item item : newItemsToAdd) {\n if (item.getDerivedFromItem() == catalogItem) {\n count++;\n }\n }\n if (getCurrent().getDerivedFromItem() == catalogItem) {\n count++;\n }\n return count;\n }", "public int calculateDiscount(ArrayList<Product> basket) {\n\n int discount = 0;\n\n\n // Voor elk product in de basket tel je 1 bij elke type op\n for (Product product : this.allProducts) {\n\n int counter = 0;\n\n for (Product basketProduct : basket) {\n\n if (basketProduct.equals(product)){\n counter++;\n System.out.println(\"wat doet ie heej\");\n }\n }\n }\n\n// for (int i = 0; i < basket.size(); i++)\n// if (basket.get(i).getNameProduct() == \"Robijn\") {\n// System.out.println(\"Dit product is gelijk aan Robijn\");\n// countItemRobijn += 1;\n// } else if (basket.get(i).getNameProduct() == \"Brinta\") {\n// System.out.println(\"Dit product is gelijk aan Brinta\");\n// countItemBrinta += 1;\n// } else if (basket.get(i).getNameProduct() == \"Chinese Groenten\") {\n// System.out.println(\"Dit product is gelijk aan Chinese Groenten\");\n// countItemChineseGroenten += 1;\n// } else if (basket.get(i).getNameProduct() == \"Kwark\") {\n// System.out.println(\"Dit product is gelijk aan Kwark\");\n// countItemKwark += 1;\n// } else if (basket.get(i).getNameProduct() == \"Luiers\") {\n// System.out.println(\"Dit product is gelijk aan Luiers\");\n// countItemLuiers += 1;\n// }\n// System.out.println(countItemRobijn);\n// System.out.println(countItemBrinta);\n// System.out.println(countItemChineseGroenten);\n// System.out.println(countItemKwark);\n// System.out.println(countItemLuiers);\n\n return discount;\n }", "@Test\n public void amountGreatherThanItemsPrice() {\n Coupon coupon = couponService.calculateCoupon(Arrays.asList(MLA1),PRICE_MLA1+PRICE_MLA2);\n assertEquals(1, coupon.itemsIds().size());\n assertEquals(MLA1, coupon.itemsIds().get(0));\n assertEquals(PRICE_MLA1, coupon.total());\n }", "protected final static int getPurchases(final Profile prf) {\n return Coltil.size(prf.availableClothings) + Coltil.size(prf.availableHats)\r\n \t\t+ Coltil.size(prf.availableJumpModes) + Coltil.size(prf.availableAssists)\r\n \t\t+ Coltil.size(prf.availableSpecialAnimals) + Coltil.size(prf.availableBirds) - 1;\r\n }", "@Test\n\tpublic void getCostForItem() {\n\t\tfinal BasketItemImpl bi = new BasketItemImpl();\n\t\tbi.addBasketItem(\"banana\", 2);\n\t\tbi.addBasketItem(\"lemon\", 3);\n\n\t\tfinal int fc = bi.getAllBasketItems().get(\"banana\");\n\t\tassertTrue(Integer.compare(2, fc) == 0);\n\n\t}", "long countUnprocessedOrders();", "@Override\n\tpublic int getBuyCountentCount(int contentId, int userId) {\n\t\treturn trxMapper.getCountBuyCountent(contentId,userId);\n\t}", "int getDeliveriesCount();", "public static void buyCandy3() {\n int funds = 100;\n int itemsBought = 0;\n for (int price = 10; funds >= price; price += 10) {\n //System.out.println(\"price \" + price);\n itemsBought++;\n funds -= price;\n }\n //4 items bought.\n System.out.println(itemsBought + \" items bought.\");\n //Change: $0.00\n System.out.println(\"Change: $\" + funds);\n }", "boolean canBuy( final Item item )\n {\n return !ship.contains( item ) && item.getPrice() <= credits;\n }", "public Integer getPurchases() {\n return purchases;\n }", "private void buy() {\n if (asset >= S_I.getPirce()) {\n Item item = S_I.buy();\n asset -= item.getPrice();\n S_I.setAsset(asset);\n } else {\n System.out.println(\"cannot afford\");\n }\n }", "public static int totalSupply() {\n return totalSupplyGet();\n }", "public int getNoOfItemsSold(String productid) {\n\t\treturn 0;\r\n\t}", "public void addAmountBought(int amountBought) {\n this.amountBought += amountBought;\n }", "private void condenseShoppingCart()\n {\n for(int d = 0; d < PersistentData.ArryShoppingCartItemNo.size(); d++)\n {\n int numberofItems = 0;\n\n boolean itemNoAlreadyCondensed = false;\n if(CondensedShoppingCart.contains(PersistentData.ArryShoppingCartItemNo.get(d)))\n {\n itemNoAlreadyCondensed = true;\n }\n if(itemNoAlreadyCondensed == false)\n {\n for(int y = 0; y < PersistentData.ArryShoppingCartItemNo.size(); y++)\n {\n if(PersistentData.ArryShoppingCartItemNo.get(d) == PersistentData.ArryShoppingCartItemNo.get(y))\n {\n numberofItems++;\n }\n }\n CondensedShoppingCart.add(PersistentData.ArryShoppingCartItemNo.get(d));\n ShoppingCartItemQuantities.add(numberofItems);\n }\n }\n }", "public int getPurchasedListCount()\r\n\t{\r\n\t\treturn m_purechaseList.size();\r\n\t}", "public Integer getInterestedInItemsCount();", "public static void main(String[] args) throws InterruptedException {\n Item item1 = new Item(\"Coca-cola\", 200);\n System.out.println(\"Price before discount: \" + item1.getPrice());\n System.out.println(\"Price after discount: \" + item1.calculateDiscount()); //should be same price, 200, there's no doscount for this type\n\n ItemWithDiscount item2 = new ItemWithDiscount(\"Coca-cola Zero\", 2.0);\n System.out.println(\"\\nPrice before discount: \" + item2.getPrice());\n item2.setDiscount(10);\n System.out.println(\"Price after discount: \" + item2.calculateDiscount()); // 2 - 0.2 = 1.8\n\n\n //CHECK BUY PAY DISCOUNT\n BuyMorePayLess item04 = new BuyMorePayLess(\"Milk\", 10);\n BuyMorePayLess item05 = new BuyMorePayLess(\"Milk\", 10);\n BuyMorePayLess item06 = new BuyMorePayLess(\"Milk\", 1);\n item04.setBuyPayOffer(3,2);\n item04.calculateDiscount();\n\n //Check TakeItAll discount\n ItemTakeItAll item07 = new ItemTakeItAll(\"Tuna\",5.00);\n ItemTakeItAll item08 = new ItemTakeItAll(\"Tuna\",5.00);\n\n// item07.setDiscount(10);\n item07.setMinimumNumber(1);\n System.out.println(\"##################\" + item07.calculateDiscount());\n\n // USERS\n LoyalCustomer customer01 = new LoyalCustomer(\"Giorgi Tsipuria\", \"giobaski\", \"123\",\n \"Gonsiori 33\",\"55945239\");\n\n //B A S K E T S\n Basket basket01 = new Basket(\"Tartu 46\", \"Kairi\", customer01);\n basket01.insertItem(item1); //200 -> 200\n basket01.insertItem(item2); // 2.0 -> 1.8\n System.out.println(\"Total payment in basket: \" + basket01.caclulatePayment()); //201.8 + 201.8 * 0.1 = 221.98\n\n\n\n\n\n //1. Create Store\n Store store = new Store(\"Raua 16\");\n\n //2. sign into store\n Cashier currentCashier = store.cashierAuthentication();\n\n //3.\n Menu currentMenu = store.openMenu();\n\n //4. new basket\n currentMenu.openNewBasket(customer01);\n\n\n //5.Cashier starts adding items into new basket\n System.out.println(currentMenu.getBasket());\n currentMenu.getBasket().insertItem(item1);\n currentMenu.getBasket().insertItem(item2);\n\n\n System.out.println(\"######Basket By ID:\");\n currentMenu.printBasketInfoById(2);\n System.out.println(\"########\");\n\n\n //6. Calculate total price for the current basket\n currentMenu.getBasket().caclulatePayment();\n System.out.println(currentMenu.getBasket());\n System.out.println(\"currents items: \");\n System.out.println(currentMenu.getBasket().getItems());\n\n //7. Logout cashier\n Thread.sleep(10000);\n currentMenu.exit();\n\n\n // Additional features\n System.out.println(\"points of the loyal customer: \" + customer01.getPoints());\n\n System.out.println(\"Bonus for cashier: \" + currentCashier.calculateBonus() + \" Euros\");\n\n\n\n\n\n\n }", "@Test\n\tvoid purchaseTest() {\n\t\ttestCrew.setMoney(10000);\n\t\tfor(MedicalItem item: itemList) {\n\t\t\tint currentMoney = testCrew.getMoney();\n\t\t\titem.purchase(testCrew);\n\t\t\tassertEquals(testCrew.getMoney(), currentMoney - item.getPrice());\n\t\t\tassertTrue(testCrew.getMedicalItems().get(0).getClass().isAssignableFrom(item.getClass()));\n\t\t\ttestCrew.removeFromMedicalItems(testCrew.getMedicalItems().get(0));\n\t\t}\n\t}", "@Override\n\tpublic Double calculateTotalPurchasedItems(List<OnlineShoppingCartItem> onlineShoppingCartItem) {\n\t\tretailCustomerUserBill.setOnlineShoppingCartItem(onlineShoppingCartItem);\n\t\treturn getTotalBillCost(onlineShoppingCartItem);\n\t}", "private void updateItemQuantityAndTotal(Item item){\r\n\t\tItem oldItem = items.get(item.getItemIdentifier());\r\n\t\toldItem.increaseQuantity(new Amount(1));\r\n\t\titems.put(oldItem.getItemIdentifier(), oldItem);\r\n\t\ttotal.updateTotal(item);\r\n\t}", "int getSellQuantity();", "public int getItemCount(int itemId) {\n\t\tint count = 0;\n\t\tif (summonedFamiliar.familiarType == FamiliarType.BOB) {\n\t\t\tfor (int i = 0; i < burdenedItems.length; i++) {\n\t\t\t\tif ((burdenedItems[i] - 1) == itemId) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "public int purchase (CustomerOrder customerOrder){\n int price = 0;\n for (OrderedAmountPreProduct orderedAmountPreProduct : customerOrder.getOrderedAmountPreProducts()) {\n price += orderedAmountPreProduct.getProduct().getPrice() * orderedAmountPreProduct.getQte();\n }\n return price;\n\n\n }", "public int countElectronicsByMaker(String maker)\n { \n \tint count = 0;\n \tfor( Gizmo g : purchases )\n \t{\n \t\tif( g.getMaker().equals( maker ) && g.isElectronic()==true )\n \t\t\tcount = count + 1; //or count++\n \t}\n \treturn count; \t\n }", "private boolean checkStock(){\n int i;\n int inventorySize = inventory.size();\n int count = 0;\n for(i = 0; i < inventorySize; i++){\n count = count + inventory.get(i).getStock();\n\n }\n //System.out.println(\"Count was: \" + count);\n if(count < 1){\n return false;\n }else{\n return true;\n }\n }", "boolean examinePaidItems(){\n\t\t\tint count = 0;\n\t\t\tif (!this.items.isEmpty()){\n\t\t\t\tfor (int i = 0; i < this.items.size(); i++){\n\t\t\t\t\tif (this.items.get(i).montaryValue != 0){\n\t\t\t\t\t\tSystem.out.print(this.items.get(i).itemName + \" ($\" + (this.items.get(i).montaryValue * -1) + \"), \");\n\t\t\t\t\t\tcount++;}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!this.receptacle.isEmpty()){//if the location has containers.\n\t\t\t\tfor (int k = 0; k < this.receptacle.size(); k++){//loops through the containers in the location\n\t\t\t\t\tif (!(this.receptacle.get(k) instanceof SpecialtyContainer)){//some containers are hidden, like the depths of the cove. \n\t\t\t\t\t\tfor (int j = 0; j < this.receptacle.get(k).contents.size(); j++){//looks for the items in the non hidden containers\n\t\t\t\t\t\t\tif (this.receptacle.get(k).contents.get(j).montaryValue < 0){//if the item needs to be bought\n\t\t\t\t\t\t\t\tSystem.out.print(this.receptacle.get(k).contents.get(j).itemName + \" ($\" + \n\t\t\t\t\t\t\t\t\t\t(this.receptacle.get(k).contents.get(j).montaryValue * -1) + \"), \");\n\t\t\t\t\t\t\t\tcount++;}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tif (count == 0){//it didn't find any items you need to pay for.\n\t\t\t\tSystem.out.println(\"There's nothing here that costs money.\");\n\t\t\t\treturn false;}\n\t\t\treturn true;\n\t\t}", "public void carry(Item item)\n {\n\n // Check if item to be added doesn't go over carry limit.\n if (!((getPerson(PLAYER).getWeight() + item.getWeight()) > getPerson(PLAYER).getCarryLimit())){\n getPerson(PLAYER).getInventory().getItems().add(item); \n\n removeRoomItem(item);\n System.out.println();\n System.out.println(item.getName() + \" has been added to your bag.\");\n System.out.println(\"You are carrying \" + getPerson(PLAYER).getWeight()+ \"kg.\");\n }\n else {\n System.out.println(\"Your bag is too heavy to add more items.\");\n }\n\n }", "private static void printCustomerItemViewsForPurchase(\r\n Map<String, List<String>> sessionsFromCustomer,\r\n Map<String, List<View>> viewsFromSessions,\r\n Map<String, List<Buy>> buysFromSessions\r\n )\r\n {\r\n System.out.println(\"Number of Views for Purchased Product by Customer\");\r\n\r\n // Encapsulates all sessions with purchases.\r\n List<String> sessionPurchaseMadeList = getSessionsWithPurchases(\r\n sessionsFromCustomer, buysFromSessions);\r\n\r\n // Maps customers to sessions with purchases.\r\n Map<String, List<String>> customerMapSessionPurchased = mapCustomerProductsPurchased(\r\n sessionsFromCustomer, sessionPurchaseMadeList);\r\n\r\n\r\n // For every customer, we will find all the items purchased,\r\n // then calculate how many sessions these items were found in.\r\n for (Map.Entry<String, List<String>> entry: customerMapSessionPurchased.entrySet()) {\r\n List<String> productList1 = getItemsPurchasedByCustomer(entry.getValue(), buysFromSessions);\r\n if (productList1.size() >= 1) {\r\n\r\n\r\n \r\n System.out.println(entry.getKey());\r\n\r\n List<String> productList = getItemsPurchasedByCustomer(entry.getValue(), buysFromSessions);\r\n for (String product: productList) {\r\n int totTimesViewed = 0;\r\n // Iterate through all sessions involving views, but only check if the current product is viewed\r\n // only if it pertains to the customer in question.\r\n for (Map.Entry<String, List<View>> entryView: viewsFromSessions.entrySet()) {\r\n boolean hasProduct = false;\r\n if (sessionsFromCustomer.get(entry.getKey()).contains(entryView.getKey())) {\r\n for (View viewItem: entryView.getValue()) {\r\n if (viewItem.getProduct().equals(product)) {\r\n hasProduct = true;\r\n break;\r\n }\r\n }\r\n }\r\n if (hasProduct) {\r\n totTimesViewed += 1;\r\n }\r\n }\r\n System.out.printf(\"\\t%s %d\\n\", product, totTimesViewed);\r\n }\r\n }\r\n}\r\n\r\n\r\n }", "int getDeliveredCount();", "private boolean checkCost(int owner, ItemType item) {\n\t\t\t\t\treturn false;\n\t\t\t\t}", "public void buy() throws CannotAffordException {\r\n\t\tGame game = Game.getInstance();\r\n\t\tgame.decreaseBudget(price);\r\n\t\tgame.getInventory().add(id);\r\n\t}", "public Transaction scan(Item item) {\n \tif(ValidationUtil.validateItem(item, this.pricingRules)) {\n\t Long quantity = shoppingBasket.get(item);\n\t if(quantity != null) {\n\t quantity++;\n\t } else {\n\t quantity = 1L;\n\t }\n\t\n\t shoppingBasket.put(item, quantity);\n \t}\n return this;\n }", "@Override\n\tpublic int totalItem() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic void showConfirmation(Customer customer, List<Item> items, double totalPrice, int loyaltyPointsEarned) {\n\t}", "int getActAmountCount();", "@Override\n\tpublic int numerOfItems() {\n\t\treturn usersDAO.numerOfItems();\n\t}", "public int checkout(String items) throws ProductNotFoundException {\n Integer totalPrice = 0;\n\n HashMap<Character, Product> productTotalList = new HashMap<Character, Product>();\n for (Character c : items.toCharArray()) {\n if (productList.containsKey(c)) {\n Product product = (Product)productList.get(c);\n if (productTotalList.containsKey(c)) {\n Product totalProduct = productTotalList.get(c);\n totalProduct.setTotalNumberOfProducts(product.getTotalNumberOfProducts() + 1);\n }\n else {\n product.setTotalNumberOfProducts(product.getTotalNumberOfProducts() + 1);\n productTotalList.put(c, product);\n }\n }\n else {\n throw new ProductNotFoundException(\"Product '\" + c + \"' not found.\");\n }\n }\n\n for (Map.Entry<Character,Product> entry : productTotalList.entrySet()) {\n Product product = entry.getValue();\n totalPrice += product.calculateTotalPrice();\n }\n\n return totalPrice;\n }", "@Override\n\tpublic int getBuyQty(Stock2 s, ICashAccount ac) {\n double useableMny = 0;\n int buyMnt = 0;\n int maxMnt = 0;\n \n Map<String, StockBuySellEntry> lstTrades = TradeStrategyImp.getLstTradeForStocks();\n StockBuySellEntry sbs = lstTrades.get(s.getID());\n\t if (sbs != null && !sbs.is_buy_point)\n\t {\n\t \tbuyMnt = sbs.quantity;\n\t \tlog.info(\"stock:\" + s.getID() + \" with qty:\" + sbs.quantity + \" already, buy same back\");\n\t }\n\t else if (ac != null) {\n useableMny = ac.getMaxMnyForTrade();\n maxMnt = (int)(useableMny/s.getCur_pri()) / 100 * 100;\n \n \tbuyMnt = maxMnt;\n log.info(\"getBuyQty, useableMny:\" + useableMny + \" buyMnt:\" + buyMnt + \" maxMnt:\" + maxMnt);\n }\n\t\treturn buyMnt;\n\t}", "@Test\n public void amountEqualsItemPrice() {\n Coupon coupon = couponService.calculateCoupon(Arrays.asList(MLA1),PRICE_MLA1);\n assertEquals(1, coupon.itemsIds().size());\n assertEquals(MLA1, coupon.itemsIds().get(0));\n assertEquals(PRICE_MLA1, coupon.total());\n }", "int getItemsCount();", "int getItemsCount();", "private void buyItem(ShopItem item) {\n int gold = world.getCharacter().getGold().get();\n if (world.isSurvivalMode() && item.getName().equals(\"Potion\")){\n this.potionNum = 0;\n System.out.println(\"This shop has 0 Potion left.\");\n }\n if (world.isBerserkerMode() && \n (item.getName().equals(\"Helmet\")\n || item.getName().equals(\"Shield\")\n || item.getName().equals(\"Armour\"))){\n this.defenseNum = 0;\n System.out.println(\"This shop has 0 defensive item left.\");\n }\n if (item.getPrice() > gold) {\n System.out.println(\"You don't have enough money.\");\n }\n loadItem(item.getName());\n world.getCharacter().setGold(gold - item.getPrice());\n System.out.println(\"You have bought Item : \" + item.getName() + \".\");\n }", "public int getQuantity(Product p){\n int count = 0;\n for (Product i : cartContents)\n {\n if (i.getProductID().equals(p.getProductID()))\n {\n count++;\n }\n }\n return count;\n }", "@Override\n\tpublic int countByItemId(int itemId) {\n\t\treturn customerBrowseMapper.countByItemId(itemId);\n\t}", "long getTotalProductsCount();", "public int getTotalItems()\n {\n return totalItems;\n }", "@Override\n\tpublic int getTotalItem() {\n\t\treturn 0;\n\t}", "@Override\n public void buy(double limitPrice, int quantity) {\n Boolean allBought = false;\n Iterator iter1 = sellOrders.entrySet().iterator();\n while(iter1.hasNext()) {\n HashMap.Entry entry = (HashMap.Entry) iter1.next();\n if(limitPrice >= (Double)entry.getKey()) {\n if(quantity <= (Integer)entry.getValue()) {\n allBought = true;\n sellOrders.put((Double)entry.getKey(),(Integer)entry.getValue()-quantity) ;\n }\n else {\n quantity = quantity - (Integer)entry.getValue();\n sellOrders.put((Double)entry.getKey(),0);\n }\n }\n\n }\n if(!allBought) {\n\n if (buyOrders.containsKey(limitPrice))\n buyOrders.put(limitPrice, buyOrders.get(limitPrice) + quantity);\n else\n buyOrders.put(limitPrice, quantity);\n }\n cleanUp();\n\n }", "public void customerPurchase(int number) {\n assert number<=availableNumber: \"Customer cannot buy more than available number of the stock.\";\n this.refresh(number);\n availableNumber -= number;\n }", "@Override\n\tpublic int countCustomers() {\n\t\treturn 0;\n\t}", "@Override\n public int getItemCount() {\n if(order_data.size() > 0)\n {\n return order_data.size() + 1;\n }\n else if(order_data.size() > 0)\n {\n return order_data.size() + 2;\n }\n else if(order_data.size() == 0)\n {\n return 1;\n }\n else\n {\n return 2;\n }\n\n }", "public void buySellChrystite(boolean buy, Player customer) {\n if (buy && crysQuantity == 0) {\n GameController.errorMessageBox(\"Not enough Crystite in the store.\");\n } else {\n if (buy) {\n crysQuantity--;\n if (customer.getMoney() >= crysCost) {\n customer.addSubMoney(-crysCost);\n customer.addSubCrystite(1);\n if (crysQuantity == 0) {\n crysCost = 100;\n } else {\n crysCost += 10;\n }\n } else {\n GameController.errorMessageBox(\"You do not have enough money for this item\");\n }\n } else {\n if (customer.getCrystite() >= 1) {\n customer.addSubMoney(crysCost-15);\n if (crysQuantity == 0) {\n crysCost = 100;\n } else {\n crysCost -= 10;\n }\n customer.addSubCrystite(-1);\n crysQuantity++;\n } else {\n GameController.errorMessageBox(\"You do not have enough money for this item\");\n }\n }\n }\n }", "public void setPurchases(Integer purchases) {\n this.purchases = this.purchases + purchases;\n }", "public static int reserveItem(Basket basket, String item, int quantity){\n StockItem stockItem = stockList.get(item);\n if(stockItem == null){\n System.out.println(\"We don't sell \"+ item);\n return 0;\n }\n if(stockList.reserveStock(item, quantity) != 0){\n basket.addToBasket(stockItem, quantity);\n return quantity;\n }\n System.out.println(\"Unable to reserve: '\"+item+\"' with quantity \"+ quantity + (quantity == 1 ? \" pc.\" : \" pcs.\"));\n return 0; //if get here means have no sufficient stock to sell.\n }", "@Test\n public void testGetItemCount() {\n \n System.out.println(\"GetItemCount\");\n \n ShoppingCart instance = new ShoppingCart();\n Product p1 = new Product(\"Galletas\", 1.2);\n \n instance.addItem(p1);\n \n assertEquals(instance.getItemCount(), 1, 0.0);\n \n Product p2 = new Product(\"Raton\", 85.6);\n Product p3 = new Product(\"Teclado\", 5.5);\n \n instance.addItem(p2);\n instance.addItem(p3);\n \n assertEquals(instance.getItemCount(), 3, 0.0);\n \n \n }", "public void addItem(LineItem item)\r\n {\r\n\t ChangeEvent event = new ChangeEvent(this);\r\n\t if(items.contains(item))\r\n\t {\r\n\t\t \r\n\t\t counter = 0;\r\n\t\t items.add(item);\r\n\t\t //tem.addQuantity();\r\n\t\t //tem.getQuantity();\r\n\t\t for(int i = 0; i < items.size(); i++)\r\n\t\t {\r\n\t\t\t if(items.get(i).equals(item))\r\n\t\t\t {\r\n\t\t\t counter++;\r\n\t\t\t }\r\n\t\t }\r\n\t\t for (ChangeListener listener : listeners)\r\n\t\t listener.stateChanged(event);\r\n\t\t System.out.print(\"\\r Quantity of \" + item.toString() + \": \"+ counter);\r\n\t\t \r\n\t }\r\n\t else\r\n\t {\r\n\t\t counter = 1;\r\n\t// item.addQuantity();\r\n\t// item.getQuantity();\r\n\t\t items.add(item);\r\n\t// System.out.println(item.getQuantity());\r\n\t\t for (ChangeListener listener : listeners)\r\n\t\t listener.stateChanged(event);\r\n\t \t\r\n\t \tSystem.out.print(\"\\n Quantity of \" + item.toString() + \": \"+ counter);\r\n\t \r\n\t\t \r\n\t }\r\n\t\t\r\n \r\n }", "public int numberOfItems()\n {\n return dessertList.size();\n }", "public int numberProduct() {\n\t\tint number = 0;\n\t\tfor (ItemCart item : listItemcart) {\n\t\t\tnumber += item.getQuantity();\n\t\t}\n\t\treturn number;\n\t}", "Items(double cost){\n\tthis.cost=cost;\n\titemId++;\n\tcurrentID=itemId;\n}", "public int sizeOfFeeAccrBVOItemArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(FEEACCRBVOITEM$2);\n }\n }", "public void buy(Item item) {\n // remove money from wallet\n try { \n wallet.removeMoney(item.getPrice());\n // remove item from room\n currentRoom.removeItem(item);\n // add item to inventory\n addToInventory(item);\n } catch (IllegalArgumentException e) {\n System.err.println(\"You don't have enough money to purchase \" + item.getDescription());\n }\n\n\n }", "int getCustomersCount();", "public int addItem(Item item, int n) {\r\n if(isContradicting(item)){\r\n System.out.println(CONTRADICTING_MSG1+ item.getType()+CONTRADICTING_MSG2);\r\n return CONTRADICTING;\r\n }\r\n if (super.addItem(item, n) == ZERO) {\r\n if (unitMap.containsKey(item.getType())) {\r\n if ((n+ unitMap.get(item.getType()))* item.getVolume() > capacity * FIFTY_PERCENT) {\r\n return checkNewN(item,n, true);\r\n }\r\n //if less then 50%\r\n else {\r\n unitMap.put(item.getType(),unitMap.get(item.getType()) + n);\r\n availableCapacity -= item.getVolume() * n;\r\n return ZERO;\r\n }\r\n }\r\n //item not in map:\r\n else{\r\n if ((item.getVolume() * n) > capacity * 0.5){\r\n return checkNewN(item,n, false);\r\n }\r\n //if less then 50\r\n else {\r\n unitMap.put(item.getType(), n);\r\n availableCapacity -= item.getVolume() * n;\r\n return ZERO;\r\n }\r\n }\r\n }\r\n //no place in locker:\r\n else return NO_ITEMS_ADDED;\r\n }", "public double getTotalWeight() {\n\t\tdouble totalWeight = 0;\n\t\tfor (Item item : purchaseList.getCurrentPurchases()) {\n\t\t\tif(purchaseList.isBagged(item)) {\n\t\t\t\ttotalWeight += item.getWeight();\n\t\t\t}\n\t\t}\n\t\treturn totalWeight;\n\t}", "public int occurenceOf(T item){\n if(item==null)\n return 0;\n\n int count = 0;\n\n for(T i:items){\n if (i.equals(item)){\n count++;\n } // end i equals item\n } // end loop items\n\n return count;\n }", "@Override\n\tpublic int getItemCount() {\n\t\tint size = 0;\n\n\t\tif(cellBankCustomerProducts != null){\n\t\t\tsize += cellBankCustomerProducts.size();\n\t\t}\n\t\tif(cellBankCustomerPersons != null){\n\t\t\tsize += cellBankCustomerPersons.size();\n\t\t}\n\n\t\treturn size + 1;\n\t}", "public boolean buy( final Item item )\n {\n if( canBuy( item ) )\n {\n Gdx.app.log( Tyrian.LOG, \"Buying item: \" + item );\n ship.install( item );\n credits -= item.getPrice();\n Gdx.app.log( Tyrian.LOG, \"Credits available: \" + credits );\n return true;\n }\n else\n {\n Gdx.app.log( Tyrian.LOG, \"No credits to buy item: \" + item );\n return false;\n }\n }", "private void btnCheckOutActionPerformed(java.awt.event.ActionEvent evt) {\n\n if (temp_Purchhist != null && temp_Purchhist.size() > 0) {\n\n for (CustomerPurchase cp : temp_Purchhist) {\n\n for (Product ap : ae.getProdDir().getProductCatalog()) {\n if (ap instanceof AdvertiserProduct) {\n AdvertiserProduct p = (AdvertiserProduct) ap;\n if (cp.getProductPurchased().getProductId() == p.getProductId()) {\n\n int temp1 = cp.getQuantity();\n int temp2 = p.getTotal_sold();\n int temp3 = temp1 + temp2;\n p.setTotal_sold(temp3);\n break;\n }\n }\n }\n }\n for (CustomerPurchase p : temp_Purchhist) {\n ae.getPurchHist().getPurchaseList().add(p);\n pe.getPurchHist().getPurchaseList().add(p);\n Customer c = (Customer) ua.getPerson();\n c.getPurchaseHistory().getPurchaseList().add(p);\n }\n ArrayList<CustomerPurchase> trans = temp_Purchhist;\n JOptionPane.showMessageDialog(null, \"You have successfully checked out. Proceed To Payment?\");\n isCheckedOut = true;\n temp_Purchhist = new ArrayList<CustomerPurchase>();\n\n populateTable();\n populatePurchaseTable();\n UserTransactionJPanel utj = new UserTransactionJPanel(upc, trans, ua, ae, pe, system);\n upc.add(\"User Transaction\", utj);\n CardLayout layout = (CardLayout) upc.getLayout();\n layout.next(upc);\n\n } else {\n\n JOptionPane.showConfirmDialog(null, \"Improper check out\");\n\n }\n\n }", "public int getLengthAvailableProducts(Player customer){\n\t\treturn this.getAvailableProducts(customer).size();\n\t}", "public int Customers()\r\n\t{\r\n\t\treturn customers.size();\r\n\t}", "@Override\n public int summarizeQuantity() {\n int sum = 0;\n\n for ( AbstractItem element : this.getComponents() ) {\n sum += element.summarizeQuantity();\n }\n\n return sum;\n }", "private static void modifyItemNumberInCart() {\r\n\t\tString itemName = getValidItemNameInput(scanner);\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.print(\" Please enter the number of the item you would like to change to: \");\r\n\t\tint numberOfTheItems = getUserIntInput();\r\n\t\tfor (Iterator<Map.Entry<Product, Integer>> it = cart.getCartProductsEntries().iterator(); it.hasNext();){\r\n\t\t Map.Entry<Product, Integer> item = it.next();\r\n\t\t if( item.getKey().getName().equals(itemName) ) {\r\n\t\t\t\tif (numberOfTheItems == 0) {\r\n\t\t\t\t\tit.remove();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcart.changeProductCount(item.getKey(), numberOfTheItems);\r\n\t\t\t\t}\r\n\t\t }\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\" Item number modified successfully\");\r\n\t\tSystem.out.println();\r\n\t}", "public InventoryItem(){\r\n this.itemName = \"TBD\";\r\n this.sku = 0;\r\n this.price = 0.0;\r\n this.quantity = 0;\r\n nItems++;\r\n }", "public boolean buyItem(Product n){\n\n if (balance.buyItem(n.getPrice()) == true & n.getQuantity() != 0 & vending_balance != 0) {\n validPurchase = true; // valid purchase was made\n vending_balance = 0; // resets vending balance to 0\n n.setQuantity(); // product quantity is -1\n return true;\n }\n\n else { // if quantity is 0 or balance is does not meet or exceed product's price\n return false;\n }\n }", "@Test(dependsOnMethods = {\"searchItem\"})\n\tpublic void purchaseItem() {\n\t\tclickElement(By.xpath(item.addToCar));\n\t\twaitForText(By.id(item.cartButton), \"1\");\n\t\tclickElement(By.id(item.cartButton));\n\t\t// on checkout screen validating the title and price of item is same as what we selected on search result page by text.\n\t\tAssert.assertTrue(isPresent(locateElement(By.xpath(item.priceLocator(price)))));\n\t\tAssert.assertTrue(isPresent(locateElement(By.xpath(item.titlelocator(title)))));\t\n\t}", "public int inventorySize (TheGroceryStore g);", "public int purchasePoints() {\n return purchasePoints;\n }", "public int getTotalCustomers()\n {\n return totalCustomers;\n }" ]
[ "0.68937135", "0.67390436", "0.66539675", "0.660445", "0.6486979", "0.64661276", "0.6439615", "0.64248985", "0.64179194", "0.63592356", "0.6346966", "0.6307789", "0.6284942", "0.626687", "0.62385035", "0.6229141", "0.617621", "0.6102673", "0.6093176", "0.60738885", "0.6058658", "0.6021277", "0.5996782", "0.59736246", "0.59674954", "0.59581", "0.5943475", "0.59151304", "0.59107786", "0.58996093", "0.5883962", "0.5850675", "0.58432394", "0.58393174", "0.5833039", "0.58194494", "0.5815852", "0.5813455", "0.58118397", "0.5810803", "0.58005327", "0.5791653", "0.5791499", "0.5786424", "0.5783923", "0.57699895", "0.5766379", "0.575725", "0.57549286", "0.57499707", "0.5748698", "0.57466286", "0.5740986", "0.57273644", "0.572058", "0.57134545", "0.5705964", "0.5704647", "0.5703247", "0.56924105", "0.569047", "0.5683611", "0.56824523", "0.56824523", "0.56764495", "0.56690985", "0.566801", "0.5660359", "0.565335", "0.56493366", "0.5648222", "0.56433773", "0.560703", "0.56021446", "0.5600565", "0.55944204", "0.5590706", "0.5581815", "0.55699706", "0.5568469", "0.55678403", "0.55464596", "0.5543095", "0.5539509", "0.5534594", "0.5531203", "0.55280125", "0.55231977", "0.5521544", "0.55182314", "0.5513901", "0.55057305", "0.55053014", "0.5497952", "0.5491195", "0.5487949", "0.54877365", "0.5482475", "0.5470388", "0.5464567", "0.54528123" ]
0.0
-1
Method for accounting number of items bought if item is unique to customer
public static void addUnique(int num, String name, int[] array1, String[] array2, int[] array3) { // Adds count to the appropriate array index for (int i = 0; i < array1.length; i++) { if (name.equals(array2[i])) { array1[i] = array1[i] + num; array3[i] = array3[i] + 1; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void incrementAmountBought() {\n amountBought++;\n }", "int getNumOfBuyOrders();", "int getPurchasableOffersCount();", "public int getAmountBought() {\n //System.out.println(clientName + \" has bought \" + amountBought + \" shares of \" + companyName);\n return amountBought;\n }", "int getNumOfSellOrders();", "public int totalAllocatedOrders();", "public int totalOrdersTaken();", "public void itemsSold() {\n quanitySnacks--;\n }", "public int howManyAvailable(Item i){/*NOT IMPLEMENTED*/return 0;}", "int getBuyQuantity();", "@Override\r\n\tpublic int countCart(String userid, int pnum) {\n\t\treturn 0;\r\n\t}", "public void buyItem() {\n List<Gnome> cart = user.getCart();\n String message = \"\";\n List<Gnome> bought = shopFacade.buyGnomes(cart);\n if (!bought.isEmpty()) {\n message = bought.size() + \" items bought\";\n } else {\n message = \"Could not buy any items\";\n }\n userFacade.assignBought(user, bought);\n user.getCart().removeAll(bought);\n cart.removeAll(bought);\n userFacade.setCartToUser(user.getUsername(), cart);\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Gnomes\", message);\n FacesContext.getCurrentInstance().addMessage(null, msg);\n }", "public void addBuy() {\r\n\t\tbuys++;\r\n\t\tnotifyObservers();\r\n\t}", "public synchronized int getNumberOfItems(){\n int totalItems=0;\n \n for(ShoppingCartItem item : getItems()){\n //we sum the quantity of products for each item\n totalItems += item.getQuantity();\n }\n \n return totalItems;\n }", "@Test\n\tpublic void getCostForDuplicateItem() {\n\t\tfinal BasketItemImpl bi = new BasketItemImpl();\n\t\tbi.addBasketItem(\"banana\", 2);\n\t\tbi.addBasketItem(\"banana\", 4);\n\t\tbi.addBasketItem(\"lemon\", 3);\n\n\t\tfinal int fc = bi.getAllBasketItems().get(\"banana\");\n\t\tassertTrue(Integer.compare(6, fc) == 0);\n\n\t}", "public int quantity(final T item) {\n if (items.containsKey(item)) {\n return items.get(item);\n } else {\n return 0;\n }\n }", "private int countProductsInCart_UPDATED() {\n System.out.println(\"-=====================Shopping Cart List========================================-\");\n int count, value;\n count = 0;\n List<WebElement> cakes = getDriver().findElements(By.xpath(\"//*[text()='Edit Your Cake']\"));\n List<WebElement> sthAndCnC = getDriver().findElements(By.xpath(\"//*[starts-with(@id, 'basketBody_') and @type='number']\"));\n System.out.println(\" === adding \" + cakes.size() + \" cakes to count\");\n count += cakes.size();\n for (WebElement product : sthAndCnC) {\n if ((!product.getAttribute(\"value\").equals(\"\")) && (product.getAttribute(\"value\") != null)) {\n String checkForLB = product.getAttribute(\"data-qtyincrement\");\n if (checkForLB.contains(\"0.\")) { //To validate for LB(s) items\n value = 1;\n } else {\n value = Integer.valueOf(product.getAttribute(\"value\"));\n }\n System.out.println(\"=== adding \" + value + \" cnc or sth item to cart\");\n count += value;\n } else {\n System.out.println(\"=== error adding product quantity\");\n }\n }\n System.out.println(\" === Count was: \" + count);\n System.out.println(\"-=====================Shopping Cart List========================================-\");\n return count;\n }", "private int checkItemQuantity() {\n\n int desiredQuantity = initialQuantity;\n MenusItem tempItem = null;\n tempItem = ItemCart.getInstance().checkItem(menusItem);\n\n if(tempItem != null){\n desiredQuantity = tempItem.getDesiredQuantity();\n }\n\n\n return desiredQuantity;\n }", "public Integer getBuyCount() {\n return buyCount;\n }", "public int getNewItemCount(Item catalogItem) {\n int count = 0;\n for (Item item : newItemsToAdd) {\n if (item.getDerivedFromItem() == catalogItem) {\n count++;\n }\n }\n if (getCurrent().getDerivedFromItem() == catalogItem) {\n count++;\n }\n return count;\n }", "protected final static int getPurchases(final Profile prf) {\n return Coltil.size(prf.availableClothings) + Coltil.size(prf.availableHats)\r\n \t\t+ Coltil.size(prf.availableJumpModes) + Coltil.size(prf.availableAssists)\r\n \t\t+ Coltil.size(prf.availableSpecialAnimals) + Coltil.size(prf.availableBirds) - 1;\r\n }", "public int getAddItems(int totalCollected, int totalItemInGame);", "public int calculateDiscount(ArrayList<Product> basket) {\n\n int discount = 0;\n\n\n // Voor elk product in de basket tel je 1 bij elke type op\n for (Product product : this.allProducts) {\n\n int counter = 0;\n\n for (Product basketProduct : basket) {\n\n if (basketProduct.equals(product)){\n counter++;\n System.out.println(\"wat doet ie heej\");\n }\n }\n }\n\n// for (int i = 0; i < basket.size(); i++)\n// if (basket.get(i).getNameProduct() == \"Robijn\") {\n// System.out.println(\"Dit product is gelijk aan Robijn\");\n// countItemRobijn += 1;\n// } else if (basket.get(i).getNameProduct() == \"Brinta\") {\n// System.out.println(\"Dit product is gelijk aan Brinta\");\n// countItemBrinta += 1;\n// } else if (basket.get(i).getNameProduct() == \"Chinese Groenten\") {\n// System.out.println(\"Dit product is gelijk aan Chinese Groenten\");\n// countItemChineseGroenten += 1;\n// } else if (basket.get(i).getNameProduct() == \"Kwark\") {\n// System.out.println(\"Dit product is gelijk aan Kwark\");\n// countItemKwark += 1;\n// } else if (basket.get(i).getNameProduct() == \"Luiers\") {\n// System.out.println(\"Dit product is gelijk aan Luiers\");\n// countItemLuiers += 1;\n// }\n// System.out.println(countItemRobijn);\n// System.out.println(countItemBrinta);\n// System.out.println(countItemChineseGroenten);\n// System.out.println(countItemKwark);\n// System.out.println(countItemLuiers);\n\n return discount;\n }", "int getDeliveriesCount();", "@Override\n\tpublic int getBuyCountentCount(int contentId, int userId) {\n\t\treturn trxMapper.getCountBuyCountent(contentId,userId);\n\t}", "public int getPurchasedListCount()\r\n\t{\r\n\t\treturn m_purechaseList.size();\r\n\t}", "public int countElectronicsByMaker(String maker)\n { \n \tint count = 0;\n \tfor( Gizmo g : purchases )\n \t{\n \t\tif( g.getMaker().equals( maker ) && g.isElectronic()==true )\n \t\t\tcount = count + 1; //or count++\n \t}\n \treturn count; \t\n }", "@Override\n\tpublic int buy(Weapon item) {\n\t\treturn 0;\n\t}", "long countUnprocessedOrders();", "public Integer getPurchases() {\n return purchases;\n }", "public Integer getInterestedInItemsCount();", "@Test\n public void amountGreatherThanItemsPrice() {\n Coupon coupon = couponService.calculateCoupon(Arrays.asList(MLA1),PRICE_MLA1+PRICE_MLA2);\n assertEquals(1, coupon.itemsIds().size());\n assertEquals(MLA1, coupon.itemsIds().get(0));\n assertEquals(PRICE_MLA1, coupon.total());\n }", "private static void printCustomerItemViewsForPurchase(\r\n Map<String, List<String>> sessionsFromCustomer,\r\n Map<String, List<View>> viewsFromSessions,\r\n Map<String, List<Buy>> buysFromSessions\r\n )\r\n {\r\n System.out.println(\"Number of Views for Purchased Product by Customer\");\r\n\r\n // Encapsulates all sessions with purchases.\r\n List<String> sessionPurchaseMadeList = getSessionsWithPurchases(\r\n sessionsFromCustomer, buysFromSessions);\r\n\r\n // Maps customers to sessions with purchases.\r\n Map<String, List<String>> customerMapSessionPurchased = mapCustomerProductsPurchased(\r\n sessionsFromCustomer, sessionPurchaseMadeList);\r\n\r\n\r\n // For every customer, we will find all the items purchased,\r\n // then calculate how many sessions these items were found in.\r\n for (Map.Entry<String, List<String>> entry: customerMapSessionPurchased.entrySet()) {\r\n List<String> productList1 = getItemsPurchasedByCustomer(entry.getValue(), buysFromSessions);\r\n if (productList1.size() >= 1) {\r\n\r\n\r\n \r\n System.out.println(entry.getKey());\r\n\r\n List<String> productList = getItemsPurchasedByCustomer(entry.getValue(), buysFromSessions);\r\n for (String product: productList) {\r\n int totTimesViewed = 0;\r\n // Iterate through all sessions involving views, but only check if the current product is viewed\r\n // only if it pertains to the customer in question.\r\n for (Map.Entry<String, List<View>> entryView: viewsFromSessions.entrySet()) {\r\n boolean hasProduct = false;\r\n if (sessionsFromCustomer.get(entry.getKey()).contains(entryView.getKey())) {\r\n for (View viewItem: entryView.getValue()) {\r\n if (viewItem.getProduct().equals(product)) {\r\n hasProduct = true;\r\n break;\r\n }\r\n }\r\n }\r\n if (hasProduct) {\r\n totTimesViewed += 1;\r\n }\r\n }\r\n System.out.printf(\"\\t%s %d\\n\", product, totTimesViewed);\r\n }\r\n }\r\n}\r\n\r\n\r\n }", "public static void buyCandy3() {\n int funds = 100;\n int itemsBought = 0;\n for (int price = 10; funds >= price; price += 10) {\n //System.out.println(\"price \" + price);\n itemsBought++;\n funds -= price;\n }\n //4 items bought.\n System.out.println(itemsBought + \" items bought.\");\n //Change: $0.00\n System.out.println(\"Change: $\" + funds);\n }", "@Test\n\tpublic void getCostForItem() {\n\t\tfinal BasketItemImpl bi = new BasketItemImpl();\n\t\tbi.addBasketItem(\"banana\", 2);\n\t\tbi.addBasketItem(\"lemon\", 3);\n\n\t\tfinal int fc = bi.getAllBasketItems().get(\"banana\");\n\t\tassertTrue(Integer.compare(2, fc) == 0);\n\n\t}", "private void condenseShoppingCart()\n {\n for(int d = 0; d < PersistentData.ArryShoppingCartItemNo.size(); d++)\n {\n int numberofItems = 0;\n\n boolean itemNoAlreadyCondensed = false;\n if(CondensedShoppingCart.contains(PersistentData.ArryShoppingCartItemNo.get(d)))\n {\n itemNoAlreadyCondensed = true;\n }\n if(itemNoAlreadyCondensed == false)\n {\n for(int y = 0; y < PersistentData.ArryShoppingCartItemNo.size(); y++)\n {\n if(PersistentData.ArryShoppingCartItemNo.get(d) == PersistentData.ArryShoppingCartItemNo.get(y))\n {\n numberofItems++;\n }\n }\n CondensedShoppingCart.add(PersistentData.ArryShoppingCartItemNo.get(d));\n ShoppingCartItemQuantities.add(numberofItems);\n }\n }\n }", "boolean canBuy( final Item item )\n {\n return !ship.contains( item ) && item.getPrice() <= credits;\n }", "int getDeliveredCount();", "public static int totalSupply() {\n return totalSupplyGet();\n }", "private boolean checkStock(){\n int i;\n int inventorySize = inventory.size();\n int count = 0;\n for(i = 0; i < inventorySize; i++){\n count = count + inventory.get(i).getStock();\n\n }\n //System.out.println(\"Count was: \" + count);\n if(count < 1){\n return false;\n }else{\n return true;\n }\n }", "@Override\n\tpublic int countByItemId(int itemId) {\n\t\treturn customerBrowseMapper.countByItemId(itemId);\n\t}", "@Test\n\tvoid purchaseTest() {\n\t\ttestCrew.setMoney(10000);\n\t\tfor(MedicalItem item: itemList) {\n\t\t\tint currentMoney = testCrew.getMoney();\n\t\t\titem.purchase(testCrew);\n\t\t\tassertEquals(testCrew.getMoney(), currentMoney - item.getPrice());\n\t\t\tassertTrue(testCrew.getMedicalItems().get(0).getClass().isAssignableFrom(item.getClass()));\n\t\t\ttestCrew.removeFromMedicalItems(testCrew.getMedicalItems().get(0));\n\t\t}\n\t}", "int getActAmountCount();", "int getItemsCount();", "int getItemsCount();", "public void addAmountBought(int amountBought) {\n this.amountBought += amountBought;\n }", "public int getItemCount(int itemId) {\n\t\tint count = 0;\n\t\tif (summonedFamiliar.familiarType == FamiliarType.BOB) {\n\t\t\tfor (int i = 0; i < burdenedItems.length; i++) {\n\t\t\t\tif ((burdenedItems[i] - 1) == itemId) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "long getTotalProductsCount();", "public int purchase (CustomerOrder customerOrder){\n int price = 0;\n for (OrderedAmountPreProduct orderedAmountPreProduct : customerOrder.getOrderedAmountPreProducts()) {\n price += orderedAmountPreProduct.getProduct().getPrice() * orderedAmountPreProduct.getQte();\n }\n return price;\n\n\n }", "public int getQuantity(Product p){\n int count = 0;\n for (Product i : cartContents)\n {\n if (i.getProductID().equals(p.getProductID()))\n {\n count++;\n }\n }\n return count;\n }", "@Override\n\tpublic int numerOfItems() {\n\t\treturn usersDAO.numerOfItems();\n\t}", "private void updateItemQuantityAndTotal(Item item){\r\n\t\tItem oldItem = items.get(item.getItemIdentifier());\r\n\t\toldItem.increaseQuantity(new Amount(1));\r\n\t\titems.put(oldItem.getItemIdentifier(), oldItem);\r\n\t\ttotal.updateTotal(item);\r\n\t}", "boolean examinePaidItems(){\n\t\t\tint count = 0;\n\t\t\tif (!this.items.isEmpty()){\n\t\t\t\tfor (int i = 0; i < this.items.size(); i++){\n\t\t\t\t\tif (this.items.get(i).montaryValue != 0){\n\t\t\t\t\t\tSystem.out.print(this.items.get(i).itemName + \" ($\" + (this.items.get(i).montaryValue * -1) + \"), \");\n\t\t\t\t\t\tcount++;}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!this.receptacle.isEmpty()){//if the location has containers.\n\t\t\t\tfor (int k = 0; k < this.receptacle.size(); k++){//loops through the containers in the location\n\t\t\t\t\tif (!(this.receptacle.get(k) instanceof SpecialtyContainer)){//some containers are hidden, like the depths of the cove. \n\t\t\t\t\t\tfor (int j = 0; j < this.receptacle.get(k).contents.size(); j++){//looks for the items in the non hidden containers\n\t\t\t\t\t\t\tif (this.receptacle.get(k).contents.get(j).montaryValue < 0){//if the item needs to be bought\n\t\t\t\t\t\t\t\tSystem.out.print(this.receptacle.get(k).contents.get(j).itemName + \" ($\" + \n\t\t\t\t\t\t\t\t\t\t(this.receptacle.get(k).contents.get(j).montaryValue * -1) + \"), \");\n\t\t\t\t\t\t\t\tcount++;}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tif (count == 0){//it didn't find any items you need to pay for.\n\t\t\t\tSystem.out.println(\"There's nothing here that costs money.\");\n\t\t\t\treturn false;}\n\t\t\treturn true;\n\t\t}", "int getCustomersCount();", "private void buy() {\n if (asset >= S_I.getPirce()) {\n Item item = S_I.buy();\n asset -= item.getPrice();\n S_I.setAsset(asset);\n } else {\n System.out.println(\"cannot afford\");\n }\n }", "@Test\n public void amountEqualsItemPrice() {\n Coupon coupon = couponService.calculateCoupon(Arrays.asList(MLA1),PRICE_MLA1);\n assertEquals(1, coupon.itemsIds().size());\n assertEquals(MLA1, coupon.itemsIds().get(0));\n assertEquals(PRICE_MLA1, coupon.total());\n }", "int getSellQuantity();", "@Override\n\tpublic Double calculateTotalPurchasedItems(List<OnlineShoppingCartItem> onlineShoppingCartItem) {\n\t\tretailCustomerUserBill.setOnlineShoppingCartItem(onlineShoppingCartItem);\n\t\treturn getTotalBillCost(onlineShoppingCartItem);\n\t}", "public static void main(String[] args) throws InterruptedException {\n Item item1 = new Item(\"Coca-cola\", 200);\n System.out.println(\"Price before discount: \" + item1.getPrice());\n System.out.println(\"Price after discount: \" + item1.calculateDiscount()); //should be same price, 200, there's no doscount for this type\n\n ItemWithDiscount item2 = new ItemWithDiscount(\"Coca-cola Zero\", 2.0);\n System.out.println(\"\\nPrice before discount: \" + item2.getPrice());\n item2.setDiscount(10);\n System.out.println(\"Price after discount: \" + item2.calculateDiscount()); // 2 - 0.2 = 1.8\n\n\n //CHECK BUY PAY DISCOUNT\n BuyMorePayLess item04 = new BuyMorePayLess(\"Milk\", 10);\n BuyMorePayLess item05 = new BuyMorePayLess(\"Milk\", 10);\n BuyMorePayLess item06 = new BuyMorePayLess(\"Milk\", 1);\n item04.setBuyPayOffer(3,2);\n item04.calculateDiscount();\n\n //Check TakeItAll discount\n ItemTakeItAll item07 = new ItemTakeItAll(\"Tuna\",5.00);\n ItemTakeItAll item08 = new ItemTakeItAll(\"Tuna\",5.00);\n\n// item07.setDiscount(10);\n item07.setMinimumNumber(1);\n System.out.println(\"##################\" + item07.calculateDiscount());\n\n // USERS\n LoyalCustomer customer01 = new LoyalCustomer(\"Giorgi Tsipuria\", \"giobaski\", \"123\",\n \"Gonsiori 33\",\"55945239\");\n\n //B A S K E T S\n Basket basket01 = new Basket(\"Tartu 46\", \"Kairi\", customer01);\n basket01.insertItem(item1); //200 -> 200\n basket01.insertItem(item2); // 2.0 -> 1.8\n System.out.println(\"Total payment in basket: \" + basket01.caclulatePayment()); //201.8 + 201.8 * 0.1 = 221.98\n\n\n\n\n\n //1. Create Store\n Store store = new Store(\"Raua 16\");\n\n //2. sign into store\n Cashier currentCashier = store.cashierAuthentication();\n\n //3.\n Menu currentMenu = store.openMenu();\n\n //4. new basket\n currentMenu.openNewBasket(customer01);\n\n\n //5.Cashier starts adding items into new basket\n System.out.println(currentMenu.getBasket());\n currentMenu.getBasket().insertItem(item1);\n currentMenu.getBasket().insertItem(item2);\n\n\n System.out.println(\"######Basket By ID:\");\n currentMenu.printBasketInfoById(2);\n System.out.println(\"########\");\n\n\n //6. Calculate total price for the current basket\n currentMenu.getBasket().caclulatePayment();\n System.out.println(currentMenu.getBasket());\n System.out.println(\"currents items: \");\n System.out.println(currentMenu.getBasket().getItems());\n\n //7. Logout cashier\n Thread.sleep(10000);\n currentMenu.exit();\n\n\n // Additional features\n System.out.println(\"points of the loyal customer: \" + customer01.getPoints());\n\n System.out.println(\"Bonus for cashier: \" + currentCashier.calculateBonus() + \" Euros\");\n\n\n\n\n\n\n }", "public int getNoOfItemsSold(String productid) {\n\t\treturn 0;\r\n\t}", "public int occurenceOf(T item){\n if(item==null)\n return 0;\n\n int count = 0;\n\n for(T i:items){\n if (i.equals(item)){\n count++;\n } // end i equals item\n } // end loop items\n\n return count;\n }", "private boolean checkCost(int owner, ItemType item) {\n\t\t\t\t\treturn false;\n\t\t\t\t}", "public int Customers()\r\n\t{\r\n\t\treturn customers.size();\r\n\t}", "@Override\n\tpublic int getBuyQty(Stock2 s, ICashAccount ac) {\n double useableMny = 0;\n int buyMnt = 0;\n int maxMnt = 0;\n \n Map<String, StockBuySellEntry> lstTrades = TradeStrategyImp.getLstTradeForStocks();\n StockBuySellEntry sbs = lstTrades.get(s.getID());\n\t if (sbs != null && !sbs.is_buy_point)\n\t {\n\t \tbuyMnt = sbs.quantity;\n\t \tlog.info(\"stock:\" + s.getID() + \" with qty:\" + sbs.quantity + \" already, buy same back\");\n\t }\n\t else if (ac != null) {\n useableMny = ac.getMaxMnyForTrade();\n maxMnt = (int)(useableMny/s.getCur_pri()) / 100 * 100;\n \n \tbuyMnt = maxMnt;\n log.info(\"getBuyQty, useableMny:\" + useableMny + \" buyMnt:\" + buyMnt + \" maxMnt:\" + maxMnt);\n }\n\t\treturn buyMnt;\n\t}", "@Override\n\tpublic void showConfirmation(Customer customer, List<Item> items, double totalPrice, int loyaltyPointsEarned) {\n\t}", "public abstract long countByCustomer(Customer customer);", "public abstract long countByCustomer(Customer customer);", "public int getTotalItems()\n {\n return totalItems;\n }", "public Transaction scan(Item item) {\n \tif(ValidationUtil.validateItem(item, this.pricingRules)) {\n\t Long quantity = shoppingBasket.get(item);\n\t if(quantity != null) {\n\t quantity++;\n\t } else {\n\t quantity = 1L;\n\t }\n\t\n\t shoppingBasket.put(item, quantity);\n \t}\n return this;\n }", "public int checkout(String items) throws ProductNotFoundException {\n Integer totalPrice = 0;\n\n HashMap<Character, Product> productTotalList = new HashMap<Character, Product>();\n for (Character c : items.toCharArray()) {\n if (productList.containsKey(c)) {\n Product product = (Product)productList.get(c);\n if (productTotalList.containsKey(c)) {\n Product totalProduct = productTotalList.get(c);\n totalProduct.setTotalNumberOfProducts(product.getTotalNumberOfProducts() + 1);\n }\n else {\n product.setTotalNumberOfProducts(product.getTotalNumberOfProducts() + 1);\n productTotalList.put(c, product);\n }\n }\n else {\n throw new ProductNotFoundException(\"Product '\" + c + \"' not found.\");\n }\n }\n\n for (Map.Entry<Character,Product> entry : productTotalList.entrySet()) {\n Product product = entry.getValue();\n totalPrice += product.calculateTotalPrice();\n }\n\n return totalPrice;\n }", "@Override\n\tpublic int countCustomers() {\n\t\treturn 0;\n\t}", "public int sizeOfFeeAccrBVOItemArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(FEEACCRBVOITEM$2);\n }\n }", "public void setPurchases(Integer purchases) {\n this.purchases = this.purchases + purchases;\n }", "public void customerPurchase(int number) {\n assert number<=availableNumber: \"Customer cannot buy more than available number of the stock.\";\n this.refresh(number);\n availableNumber -= number;\n }", "public void addItem(LineItem item)\r\n {\r\n\t ChangeEvent event = new ChangeEvent(this);\r\n\t if(items.contains(item))\r\n\t {\r\n\t\t \r\n\t\t counter = 0;\r\n\t\t items.add(item);\r\n\t\t //tem.addQuantity();\r\n\t\t //tem.getQuantity();\r\n\t\t for(int i = 0; i < items.size(); i++)\r\n\t\t {\r\n\t\t\t if(items.get(i).equals(item))\r\n\t\t\t {\r\n\t\t\t counter++;\r\n\t\t\t }\r\n\t\t }\r\n\t\t for (ChangeListener listener : listeners)\r\n\t\t listener.stateChanged(event);\r\n\t\t System.out.print(\"\\r Quantity of \" + item.toString() + \": \"+ counter);\r\n\t\t \r\n\t }\r\n\t else\r\n\t {\r\n\t\t counter = 1;\r\n\t// item.addQuantity();\r\n\t// item.getQuantity();\r\n\t\t items.add(item);\r\n\t// System.out.println(item.getQuantity());\r\n\t\t for (ChangeListener listener : listeners)\r\n\t\t listener.stateChanged(event);\r\n\t \t\r\n\t \tSystem.out.print(\"\\n Quantity of \" + item.toString() + \": \"+ counter);\r\n\t \r\n\t\t \r\n\t }\r\n\t\t\r\n \r\n }", "public int numberOfItems()\n {\n return dessertList.size();\n }", "public void carry(Item item)\n {\n\n // Check if item to be added doesn't go over carry limit.\n if (!((getPerson(PLAYER).getWeight() + item.getWeight()) > getPerson(PLAYER).getCarryLimit())){\n getPerson(PLAYER).getInventory().getItems().add(item); \n\n removeRoomItem(item);\n System.out.println();\n System.out.println(item.getName() + \" has been added to your bag.\");\n System.out.println(\"You are carrying \" + getPerson(PLAYER).getWeight()+ \"kg.\");\n }\n else {\n System.out.println(\"Your bag is too heavy to add more items.\");\n }\n\n }", "@Test\n public void testGetItemCount() {\n \n System.out.println(\"GetItemCount\");\n \n ShoppingCart instance = new ShoppingCart();\n Product p1 = new Product(\"Galletas\", 1.2);\n \n instance.addItem(p1);\n \n assertEquals(instance.getItemCount(), 1, 0.0);\n \n Product p2 = new Product(\"Raton\", 85.6);\n Product p3 = new Product(\"Teclado\", 5.5);\n \n instance.addItem(p2);\n instance.addItem(p3);\n \n assertEquals(instance.getItemCount(), 3, 0.0);\n \n \n }", "@Override\n public int getItemCount() {\n if(order_data.size() > 0)\n {\n return order_data.size() + 1;\n }\n else if(order_data.size() > 0)\n {\n return order_data.size() + 2;\n }\n else if(order_data.size() == 0)\n {\n return 1;\n }\n else\n {\n return 2;\n }\n\n }", "public void buy() throws CannotAffordException {\r\n\t\tGame game = Game.getInstance();\r\n\t\tgame.decreaseBudget(price);\r\n\t\tgame.getInventory().add(id);\r\n\t}", "private void btnCheckOutActionPerformed(java.awt.event.ActionEvent evt) {\n\n if (temp_Purchhist != null && temp_Purchhist.size() > 0) {\n\n for (CustomerPurchase cp : temp_Purchhist) {\n\n for (Product ap : ae.getProdDir().getProductCatalog()) {\n if (ap instanceof AdvertiserProduct) {\n AdvertiserProduct p = (AdvertiserProduct) ap;\n if (cp.getProductPurchased().getProductId() == p.getProductId()) {\n\n int temp1 = cp.getQuantity();\n int temp2 = p.getTotal_sold();\n int temp3 = temp1 + temp2;\n p.setTotal_sold(temp3);\n break;\n }\n }\n }\n }\n for (CustomerPurchase p : temp_Purchhist) {\n ae.getPurchHist().getPurchaseList().add(p);\n pe.getPurchHist().getPurchaseList().add(p);\n Customer c = (Customer) ua.getPerson();\n c.getPurchaseHistory().getPurchaseList().add(p);\n }\n ArrayList<CustomerPurchase> trans = temp_Purchhist;\n JOptionPane.showMessageDialog(null, \"You have successfully checked out. Proceed To Payment?\");\n isCheckedOut = true;\n temp_Purchhist = new ArrayList<CustomerPurchase>();\n\n populateTable();\n populatePurchaseTable();\n UserTransactionJPanel utj = new UserTransactionJPanel(upc, trans, ua, ae, pe, system);\n upc.add(\"User Transaction\", utj);\n CardLayout layout = (CardLayout) upc.getLayout();\n layout.next(upc);\n\n } else {\n\n JOptionPane.showConfirmDialog(null, \"Improper check out\");\n\n }\n\n }", "int getCouponListCount();", "@Override\n\tpublic int totalItem() {\n\t\treturn 0;\n\t}", "public void buySellChrystite(boolean buy, Player customer) {\n if (buy && crysQuantity == 0) {\n GameController.errorMessageBox(\"Not enough Crystite in the store.\");\n } else {\n if (buy) {\n crysQuantity--;\n if (customer.getMoney() >= crysCost) {\n customer.addSubMoney(-crysCost);\n customer.addSubCrystite(1);\n if (crysQuantity == 0) {\n crysCost = 100;\n } else {\n crysCost += 10;\n }\n } else {\n GameController.errorMessageBox(\"You do not have enough money for this item\");\n }\n } else {\n if (customer.getCrystite() >= 1) {\n customer.addSubMoney(crysCost-15);\n if (crysQuantity == 0) {\n crysCost = 100;\n } else {\n crysCost -= 10;\n }\n customer.addSubCrystite(-1);\n crysQuantity++;\n } else {\n GameController.errorMessageBox(\"You do not have enough money for this item\");\n }\n }\n }\n }", "public int getLengthAvailableProducts(Player customer){\n\t\treturn this.getAvailableProducts(customer).size();\n\t}", "static void countSymbols(String item){\n \n if (cntSymbols.containsKey(item))\n cntSymbols.put(item, cntSymbols.get(item) + 1);\n else\n cntSymbols.put(item, 1);\n \n }", "@Test\n public void testGetPurchaseCount() {\n System.out.println(\"getPurchaseCount\");\n //CashRegister instance = new CashRegister();\n //Test the inital state = should have NO items\n assertEquals(0, instance.getPurchaseCount());\n \n //now set up a test of two items\n instance.scanItem(0.55);\n instance.scanItem(1.27);\n int expResult = 2;\n int result = instance.getPurchaseCount();\n assertEquals(expResult, result);\n }", "@Override\n public void buy(double limitPrice, int quantity) {\n Boolean allBought = false;\n Iterator iter1 = sellOrders.entrySet().iterator();\n while(iter1.hasNext()) {\n HashMap.Entry entry = (HashMap.Entry) iter1.next();\n if(limitPrice >= (Double)entry.getKey()) {\n if(quantity <= (Integer)entry.getValue()) {\n allBought = true;\n sellOrders.put((Double)entry.getKey(),(Integer)entry.getValue()-quantity) ;\n }\n else {\n quantity = quantity - (Integer)entry.getValue();\n sellOrders.put((Double)entry.getKey(),0);\n }\n }\n\n }\n if(!allBought) {\n\n if (buyOrders.containsKey(limitPrice))\n buyOrders.put(limitPrice, buyOrders.get(limitPrice) + quantity);\n else\n buyOrders.put(limitPrice, quantity);\n }\n cleanUp();\n\n }", "private void buyItem(ShopItem item) {\n int gold = world.getCharacter().getGold().get();\n if (world.isSurvivalMode() && item.getName().equals(\"Potion\")){\n this.potionNum = 0;\n System.out.println(\"This shop has 0 Potion left.\");\n }\n if (world.isBerserkerMode() && \n (item.getName().equals(\"Helmet\")\n || item.getName().equals(\"Shield\")\n || item.getName().equals(\"Armour\"))){\n this.defenseNum = 0;\n System.out.println(\"This shop has 0 defensive item left.\");\n }\n if (item.getPrice() > gold) {\n System.out.println(\"You don't have enough money.\");\n }\n loadItem(item.getName());\n world.getCharacter().setGold(gold - item.getPrice());\n System.out.println(\"You have bought Item : \" + item.getName() + \".\");\n }", "public int purchasePoints() {\n return purchasePoints;\n }", "public int numberProduct() {\n\t\tint number = 0;\n\t\tfor (ItemCart item : listItemcart) {\n\t\t\tnumber += item.getQuantity();\n\t\t}\n\t\treturn number;\n\t}", "int getTransactionsCount();", "@Override\n public int summarizeQuantity() {\n int sum = 0;\n\n for ( AbstractItem element : this.getComponents() ) {\n sum += element.summarizeQuantity();\n }\n\n return sum;\n }", "public int getTotalCustomers()\n {\n return totalCustomers;\n }", "@Override\n\tpublic int getTotalItem() {\n\t\treturn 0;\n\t}", "int getTotalDepositCount();", "@Override\n\tpublic int getItemCount() {\n\t\tint size = 0;\n\n\t\tif(cellBankCustomerProducts != null){\n\t\t\tsize += cellBankCustomerProducts.size();\n\t\t}\n\t\tif(cellBankCustomerPersons != null){\n\t\t\tsize += cellBankCustomerPersons.size();\n\t\t}\n\n\t\treturn size + 1;\n\t}", "long getOwnedEntryCount();", "long countNumberOfProductsInDatabase();", "public static int countByitem(long requestId) {\n\t\treturn getPersistence().countByitem(requestId);\n\t}", "long countByExample(PurchasePaymentExample example);" ]
[ "0.6904966", "0.68046385", "0.6729949", "0.66210735", "0.6516071", "0.64479005", "0.6430657", "0.6381086", "0.6304272", "0.628445", "0.6282561", "0.6278664", "0.6278089", "0.6272061", "0.62683386", "0.6174818", "0.6137137", "0.6123441", "0.60890925", "0.60458624", "0.6045447", "0.60323536", "0.6012955", "0.60026324", "0.5967238", "0.5952079", "0.5944676", "0.59287125", "0.5920402", "0.59090155", "0.58948594", "0.5890002", "0.58889675", "0.5865208", "0.5848881", "0.58310294", "0.58148986", "0.5814122", "0.5807237", "0.5794241", "0.578385", "0.57766086", "0.5769658", "0.5758957", "0.5758957", "0.5757185", "0.5751976", "0.5748124", "0.57365453", "0.57174313", "0.5717168", "0.5711777", "0.5705416", "0.5700349", "0.5699337", "0.56982255", "0.5686782", "0.5686017", "0.5685251", "0.5684364", "0.5677605", "0.567671", "0.566213", "0.56548107", "0.5651574", "0.5623324", "0.5623324", "0.56155264", "0.5608715", "0.5608015", "0.5606864", "0.5606824", "0.5592845", "0.5588832", "0.558085", "0.55796033", "0.55785525", "0.5569507", "0.55639315", "0.555512", "0.55513996", "0.55505025", "0.555047", "0.554449", "0.5540042", "0.55339646", "0.55324566", "0.5528118", "0.5526288", "0.552593", "0.55194134", "0.5511185", "0.5505535", "0.55026037", "0.5493724", "0.54935235", "0.54896396", "0.54861134", "0.54857814", "0.5481443", "0.54773337" ]
0.0
-1
Method to see if item is unique from a customer
public static boolean isUnique(String name, String[] array1) { // Searches through the store item arrays and see if it's the same for (int i = 0; i < array1.length; i++) { if (name.equals(array1[i])) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isIsUnique();", "@objid (\"ef9777b4-ed2a-4341-bb22-67675cddb70a\")\n boolean isIsUnique();", "boolean isUnique();", "public boolean isUnique();", "public boolean containsCustomer(String c){\n\t\tfor (int i = 0; i < this.list.size(); i++){\n\t\t\tif( c.equals(list.get(i).getUsername()) ){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public Boolean isUnique(String search) {\n\t\tfor (int i = 0; i < CarerAccounts.size(); i++) {\n if (CarerAccounts.get(i).getUsername().equals(search)){\n return false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "boolean hasCustomer();", "boolean hasCustomer();", "@Override\n public boolean isExists(Buyer buyer) {\n return false;\n }", "private boolean duplicationCheck(String userName) {\n\t\tboolean ret = true;\n\t\tif(obs.isEmpty()) {\n\t\t\tret = true;\n\t\t}\n\t\telse {\n\t\t\tfor(int i=0; i<obs.size(); i++) {\n\t\t\t\tif(obs.get(i).getUserName().compareTo(userName) == 0) {\n\t\t\t\t\tret = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tret = true;\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "boolean hasCustomerClient();", "boolean isUnique(TextField inputPartNumber);", "@Override\n\tpublic boolean isCustomerExists(int customerId) {\n\t\treturn false;\n\t}", "public boolean isExplicitUniqueCheckRequired();", "public boolean uniqueToThisGlobalCustomer(String inputCustomerNumber, String inputUnit, String inputSystem)\n\t{\n\t\tboolean result = true;\n\t\tICLDRecordDaoImp iCLDRecordDao;\n\t\tCLDRecordDataModel model = new CLDRecordDataModel();\n\t\tiCLDRecordDao = daoFactory.getCLDRecordDao(session, model);\n\n\t\tStringBuilder whereCLD = new StringBuilder();\n\t\twhereCLD.append(\" CLDCNO = '\" + inputCustomerNumber + \"'\");\n\t\twhereCLD.append(\" AND CLDSYS = '\" + inputSystem + \"'\");\n\t\twhereCLD.append(\" AND CLDCOUN = '\" + inputUnit + \"'\");\n\t\twhereCLD.append(\" AND CLDGCID <> '\" + globalCustomerNumberID + \"'\");\n\n\t\tresult = iCLDRecordDao.checkIfThisCLDRecordIsInTheDB(whereCLD.toString());\n\t\treturn result;\n\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Customer)) {\n return false;\n }\n Customer other = (Customer) object;\n if ((this.cusId == null && other.cusId != null) || (this.cusId != null && !this.cusId.equals(other.cusId))) {\n return false;\n }\n return true;\n }", "public boolean sameCustomer(String name, int mobile, String email) {\n if (this.getName().equalsIgnoreCase(name)&&\n this.getMobile()==mobile&&\n this.getEmail().equalsIgnoreCase(email)) {return true;}\n else {return false;}\n }", "public boolean equals(Customer inCustomer)\n\t{\n\t\tif(custID.equals(inCustomer.custID))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t}", "public static boolean isCustomer(int i)\r\n\t{\r\n\t\t// attempt to find the customerID in the customers ArrayList\r\n\t\ttry\r\n\t\t{\r\n\t\t\tfindCustomer(i);\r\n\t\t}\r\n\t\tcatch(CustomerNotFoundException e)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public boolean uniqueInThisGlobalCustomer(String inputCustomerNumber, String inputUnit, String inputSystem, String sequence)\n\t{\n\t\tboolean result = true;\n\t\tICLDRecordDaoImp iCLDRecordDao;\n\t\tCLDRecordDataModel model = new CLDRecordDataModel();\n\t\tiCLDRecordDao = daoFactory.getCLDRecordDao(session, model);\n\n\t\tStringBuilder whereCLD = new StringBuilder();\n\t\twhereCLD.append(\" CLDCNO = '\" + inputCustomerNumber + \"'\");\n\t\twhereCLD.append(\" AND CLDSYS = '\" + inputSystem + \"'\");\n\t\twhereCLD.append(\" AND CLDCOUN = '\" + inputUnit + \"'\");\n\t\twhereCLD.append(\" AND CLDGCID = '\" + globalCustomerNumberID + \"'\");\n\t\twhereCLD.append(\" AND CLDSEQ <> '\" + sequence + \"'\");\n\n\t\tresult = iCLDRecordDao.checkIfThisCLDRecordIsInTheDB(whereCLD.toString());\n\t\treturn result;\n\t}", "public boolean hasCustomer() {\n return customer_ != null;\n }", "public boolean isCustomerInList(Customer cust) {\n\t\t\tfor (int i = 0; i < customers.size(); i++) {\n\t\t\t\tif (cust.equals(customers.get(i))) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "private boolean isUniqueVin(String vin) {\n for (Car c: cars) {\n if (vin.equals(c.getVin())) {\n return false;\n }\n }\n // did not match any car == unique\n return true;\n }", "protected boolean containsCustomer() {\n return customer.getOptional().isPresent();\n }", "private boolean checkCustomerID(int CusIDPty, int CusID) {\n\t\tint getCusIDPtyValue = 0 ; \t\t\r\n\t\ttry {\r\n\t\t\tgetCusIDPtyValue = SDKSession.getCameraPropertyClint().getCurrentPropertyValue(CusIDPty);\r\n\t\t} catch (IchInvalidSessionException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IchSocketException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IchCameraModeException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IchDevicePropException 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\t\t\t\t\r\n\t\tif ((getCusIDPtyValue & 0xffff) == (CusID & 0xffff) ) {\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 boolean validateForDuplicateItemField(OleDiscoveryExportProfile oleDiscoveryExportProfile) {\n List<String> MARCItemlist = new ArrayList<String>();\n for (int i = 0; i < oleDiscoveryExportProfile.getOleDiscoveryExportMappingFields().size(); i++) {\n MARCItemlist.add(oleDiscoveryExportProfile.getOleDiscoveryExportMappingFields().get(i).getItemField());\n }\n for (int j = 0; j < oleDiscoveryExportProfile.getOleDiscoveryExportMappingFields().size(); j++) {\n int count = 0;\n for (int k = 0; k < MARCItemlist.size(); k++) {\n if (oleDiscoveryExportProfile.getOleDiscoveryExportMappingFields().get(j).getItemField().equalsIgnoreCase(MARCItemlist.get(k))) {\n count++;\n }\n }\n if (count > 1) {\n this.putFieldError(OLEConstants.OleDiscoveryExportProfile.OLE_EXP_ITEM_FIELD, OLEConstants.OleDiscoveryExportProfile.OLE_EXP_ITEM_DUPLICATE_ERROR);\n return false;\n }\n }\n return true;\n }", "public boolean checkCustId(Connection conn, String cust_no) {\r\n\t\ttry {\r\n\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\tResultSet rset = stmt.executeQuery(\"select custno from customer_XXXX\");\r\n\t\t\twhile (rset.next()) {\r\n\t\t\t\tif (cust_no == rset.getString(1))\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean removeCustomer(String c){\n\t\tif(containsCustomer(c)){\n\t\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\t\tif( c.equals(list.get(i).getUsername()) ){\n\t\t\t\t\tlist.remove(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean validaCompra() {\n\n List<Purchase> purchasesList = billingClient.queryPurchases(INAPP).getPurchasesList();\n if (purchasesList != null && !purchasesList.isEmpty()) {\n for (Purchase purchase : purchasesList) {\n if (purchase.getSku().equals(skuId)) {\n return true;\n }\n }\n }\n return false;\n\n }", "public Boolean isUniqueUsingAPI(String value) {\n\t\t// We put each character of our value in a Set that don't allows duplicated values\n\t\tSet<String> items = new HashSet<String>(Arrays.asList(value.toUpperCase().replaceAll(\"\\\\s\",\"\").split(\"\")));\n\t\t\n\t\t// If the size of our set is different that the length of our string that means that on the string are duplicated values.\n\t\treturn value.length() == items.size();\n\t}", "static boolean isDuplicated(String mac) {\n for (DeviceDetail detail : deviceDetails) {\n if (detail.macAddress.equals(mac)) {\n return true;\n }\n }\n return false;\n }", "boolean isUniqueAttribute();", "private boolean isFlightDataUnique(Flight flight) throws SQLException {\n\n\t\t// return flight database content through given list\n\t\tArrayList<Flight> listOfFlights = flightdb.fetchDatabaseContent();\n\n\t\tif (!listOfFlights.isEmpty() && listOfFlights.contains(flight)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "boolean hasCustomerClientLink();", "public boolean isDuplicate(IDecodedDeviceRequest<?> request) throws SiteWhereException;", "public boolean checkIfCustomerAccountExist(BankAccount bankAccount) {\r\n\t\tboolean check = false;\r\n\t\t\r\n\t\tfor(int i = 0; i < customerBankAccountList.size() - 1; i++) {\r\n\t\t\t\r\n\t\t\tif( customerBankAccountList.contains(customer) ) {\r\n\t\t\t\tcheck = true;\r\n\t\t\t}\r\n\t\t}// End of For Loop\r\n\t\t\r\n\t\treturn check;\r\n\t}", "@Override\n\t\tpublic boolean CheckIfRealPerson(Customer customer) {\n\t\t\tRandom r=new Random();\n\t\t\tint sayi=r.nextInt(3);\n\t\t\tif(sayi==1) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "@Test\n\t@DisplayName(\"test you can not register a duplicate customer\")\n\tvoid testCustomers() {\n\t\ts.addACustomer(new Customer(\"Gary\", \"Smith\"));\n\t\ts.addACustomer(new Customer(\"Gary\", \"Smith\"));\n\t\tassertEquals(1, s.getCustomers().size());\n\t}", "private boolean isNameUnique(String name) {\n boolean isUnique = true;\n for (User user : this.users) {\n if (user.getName().equals(name)) {\n isUnique = false;\n break;\n }\n }\n return isUnique;\n }", "public boolean isExisting() throws Exception\r\n\t\t{\r\n\t\tRouteGroup myR = (RouteGroup) myRouteGroup.get();\r\n\t\tthis.UUID = myR.getUUID();\r\n\t\t\r\n\t\tVariables.getLogger().debug(\"Item \"+this.name+\" already exist in the CUCM\");\r\n\t\treturn true;\r\n\t\t}", "public boolean isLicenseUnique(String license)\r\n {\r\n \r\n \r\n boolean isUnique = true;\r\n if (brokerLog.isEmpty())\r\n {\r\n isUnique = true;\r\n }else\r\n {\r\n int lowIndex = 0 ;\r\n int middleIndex;\r\n int highIndex = (brokerLog.size());\r\n String middleIndexValue;\r\n\r\n while (lowIndex <= highIndex && highIndex >= 1)\r\n {\r\n middleIndex = ((lowIndex + highIndex) / 2);\r\n String testBrokerLicense = \r\n brokerLog.get(middleIndex).getBrokerLicense();\r\n if(license.compareToIgnoreCase(testBrokerLicense)> 0)\r\n {\r\n lowIndex = middleIndex + 1;\r\n \r\n }\r\n if(license.compareToIgnoreCase(testBrokerLicense) < 0)\r\n {\r\n highIndex = middleIndex - 1;\r\n \r\n }\r\n if(license.compareToIgnoreCase(testBrokerLicense) == 0)\r\n \r\n {\r\n lowIndex = highIndex + 1;\r\n isUnique = false;\r\n }\r\n if(license.compareToIgnoreCase(testBrokerLicense) != 0 && \r\n lowIndex == highIndex)\r\n {\r\n lowIndex = highIndex + 1;\r\n isUnique = true;\r\n }\r\n \r\n }\r\n }\r\n return isUnique;\r\n }", "private boolean checkDuplicate(String macAddress) {\n\t\tfor (int i=0; i<bluetoothDevices.size(); i++) {\n\t\t\tif (macAddress.equals(bluetoothDevices.get(i).macAddress)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Customer)) {\r\n return false;\r\n }\r\n Customer other = (Customer) object;\r\n return (this.id != null || other.id == null) && (this.id == null || this.id.equals(other.id));\r\n }", "@Override\n public boolean equals(Object o) {\n if (o == this)\n return true;\n if (!(o instanceof CustomerInternal)) {\n return false;\n }\n CustomerInternal customerInternal = (CustomerInternal) o;\n return Objects.equals(isrName, customerInternal.isrName) \n && Objects.equals(departmentName, customerInternal.departmentName)\n && Objects.equals(id, customerInternal.id)\n && Objects.equals(name, customerInternal.name)\n && Objects.equals(address, customerInternal.address);\n }", "public boolean hasCustomer() {\n return customerBuilder_ != null || customer_ != null;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Customer)) {\n return false;\n }\n Customer other = (Customer) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Customer)) {\n return false;\n }\n Customer other = (Customer) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "public Boolean getUniqueItems()\n\t{\n\t\treturn uniqueItems;\n\t}", "boolean hasID(int id) {\r\n for (Customer customer : customers) {\r\n if (customer != null && customer.getID() == id) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "public boolean isUnique(String userName) {\n return userRepository.findByLogin(userName) == null ? true : false;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isUserIdTaken(String userEmailId);", "public boolean isDistinct() {\r\n return distinct;\r\n }", "public boolean isDistinct() {\r\n return distinct;\r\n }", "public boolean isDistinct() {\r\n return distinct;\r\n }", "public boolean isDistinct() {\r\n return distinct;\r\n }", "public boolean isDistinct() {\r\n return distinct;\r\n }", "public boolean isDistinct() {\r\n return distinct;\r\n }", "public boolean isDistinct() {\r\n return distinct;\r\n }", "public boolean isDistinct() {\r\n return distinct;\r\n }", "public boolean isDistinct() {\r\n return distinct;\r\n }", "public boolean isDistinct() {\r\n return distinct;\r\n }", "public boolean isDistinct() {\r\n return distinct;\r\n }", "public boolean isDistinct() {\r\n return distinct;\r\n }", "public boolean isDistinct() {\r\n return distinct;\r\n }", "public boolean isDistinct() {\r\n return distinct;\r\n }", "public boolean isDistinct() {\r\n return distinct;\r\n }", "public boolean isDistinct() {\r\n return distinct;\r\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }", "public boolean isDistinct() {\n return distinct;\n }" ]
[ "0.6961384", "0.69023854", "0.6881014", "0.6793802", "0.64714926", "0.6411531", "0.63008857", "0.63008857", "0.6268046", "0.6265835", "0.6223301", "0.6209938", "0.61917305", "0.6129591", "0.61016667", "0.6067712", "0.60583055", "0.60218257", "0.60205376", "0.6015497", "0.60149187", "0.6010015", "0.5990083", "0.59620553", "0.59328794", "0.59314406", "0.59303236", "0.5914716", "0.59109443", "0.5891973", "0.58611125", "0.5841598", "0.58362037", "0.58359396", "0.5831792", "0.5823484", "0.5788803", "0.5742215", "0.5732011", "0.5720527", "0.5706803", "0.5699034", "0.5696264", "0.5681403", "0.5672883", "0.564326", "0.564326", "0.56354314", "0.56313485", "0.5631272", "0.56291646", "0.56252563", "0.5623257", "0.5623257", "0.5623257", "0.5623257", "0.5623257", "0.5623257", "0.5623257", "0.5623257", "0.5623257", "0.5623257", "0.5623257", "0.5623257", "0.5623257", "0.5623257", "0.5623257", "0.5623257", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213", "0.56205213" ]
0.0
-1
Create a sale Permissions Needed: SALES_ADMIN
@Test public void createCatalogSaleTest() { CatalogSale catalogSale = null; // CatalogSale response = api.createCatalogSale(catalogSale); // TODO: test validations }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void create(Sale sale) {\n sale_dao.create(sale);\n }", "public void updateAccountingSystem(Sale sale)\n {\n \n }", "@SuppressWarnings(\"unchecked\")\n\tpublic boolean makeNewSale() throws PreconditionException {\n\t\t/* check precondition */\n\t\tif (true) \n\t\t{ \n\t\t\t/* Logic here */\n\t\t\t//return primitive type\t\n\t\t\tSale s = null;\n\t\t\ts = (Sale) EntityManager.createObject(\"Sale\");\n\t\t\ts.setBelongedCashDesk(currentCashDesk);\n\t\t\tcurrentCashDesk.addContainedSales(s);\n\t\t\ts.setIsComplete(false);\n\t\t\ts.setIsReadytoPay(false);\n\t\t\tthis.setCurrentSale(s);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new PreconditionException();\t\t\t\t\n\t\t}\n\t\t//all relevant vars : s this\n\t\t//all relevant entities : Sale \n\t}", "@Test\n public void testGetPermissionsRole() throws Exception\n {\n permission = permissionManager.getPermissionInstance(\"GREET_PEOPLE\");\n permissionManager.addPermission(permission);\n Permission permission2 = permissionManager.getPermissionInstance(\"ADMINISTER_DRUGS\");\n permissionManager.addPermission(permission2);\n Role role = securityService.getRoleManager().getRoleInstance(\"VET_TECH\");\n securityService.getRoleManager().addRole(role);\n ((DynamicModelManager) securityService.getModelManager()).grant(role, permission);\n PermissionSet permissions = ((DynamicRole) role).getPermissions();\n assertEquals(1, permissions.size());\n assertTrue(permissions.contains(permission));\n assertFalse(permissions.contains(permission2));\n }", "public void accountSale(long storeID, final SaleTO sale) throws ProductOutOfStockException, NotInDatabaseException, UpdateException;", "private static void createAdmin(SecurityService service,\n\t\t\tString securityDomainId, Actor requestingActor, Actor adminActor,\n\t\t\tString groupId) {\n\t\tBooleanResultResponse boolResp = service.createAceActionByActorIdByRoleId(securityDomainId, adminActor, \"USRGADM\", groupId, requestingActor);\n\t\tSystem.out.println(\"after inserting admins>>>>\" + boolResp);\n\t}", "ISModifyProvidedRole createISModifyProvidedRole();", "ISModifyRequiredRole createISModifyRequiredRole();", "@Test\n public void testCreateOnBehalfUser_asTechnologyManager() throws Exception {\n container.login(supplierAdminUser.getKey(), ROLE_TECHNOLOGY_MANAGER);\n VOUserDetails result = idService\n .createOnBehalfUser(customer.getOrganizationId(), \"abcdef\");\n checkCreatedUser(result, customer, \"abcdef\", false);\n checkUserRoleAssignment(result, ROLE_ORGANIZATION_ADMIN);\n }", "public void addMSCAdminToPR(ApprovalRequest ar, Approvable lic) {\r\n\t\tLog.customer.debug(\"%s ::: addMSCAdminToPR - %s\", className, lic);\r\n\t\tProcureLineItemCollection plic = (ProcureLineItemCollection) lic;\r\n\t\tString TaxRole = \"MSC Administrator\";\r\n\t\tString TaxReason = \"Tax Reason\";\r\n\t\tboolean flag1 = true;\r\n\t\tObject obj = Role.getRole(TaxRole);\r\n\t\t// plic.setFieldValue(\"ProjectID\",\"F\");\r\n\t\tLog.customer.debug(\"%s ::: isMSCAdminRequired - plic bfore create %s\",\r\n\t\t\t\tclassName, plic.toString());\r\n\t\tApprovalRequest approvalrequest1 = ApprovalRequest.create(plic,\r\n\t\t\t\t((ariba.user.core.Approver) (obj)), flag1, \"RuleReasons\",\r\n\t\t\t\tTaxReason);\r\n\t\tLog.customer.debug(\"%s ::: approvalrequest1 got activated- %s\",\r\n\t\t\t\tclassName);\r\n\r\n\t\tBaseVector basevector1 = plic.getApprovalRequests();\r\n\t\tLog.customer.debug(\"%s ::: basevector1 got activated- %s\", className);\r\n\r\n\t\tBaseVector basevector2 = approvalrequest1.getDependencies();\r\n\t\tLog.customer.debug(\"%s ::: basevector2 got activated- %s\", className);\r\n\r\n\t\tbasevector2.add(0, ar);\r\n\t\tLog.customer.debug(\"%s ::: ar added to basevector2 %s\", className);\r\n\r\n\t\tapprovalrequest1.setFieldValue(\"Dependencies\", basevector2);\r\n\t\tar.setState(2);\r\n\t\tLog.customer.debug(\"%s ::: ar.setState- %s\", className);\r\n\r\n\t\tar.updateLastModified();\r\n\t\tLog.customer.debug(\"%s ::: ar.updatelastmodified- %s\", className);\r\n\r\n\t\tbasevector1.removeAll(ar);\r\n\t\tLog.customer.debug(\"%s ::: basevecotr1 .removeall %s\", className);\r\n\r\n\t\tbasevector1.add(0, approvalrequest1);\r\n\t\tLog.customer.debug(\"%s ::: basevector1 .add- %s\", className);\r\n\r\n\t\tplic.setApprovalRequests(basevector1);\r\n\t\tLog.customer.debug(\"%s ::: ir .setApprovalRequests got activated- %s\",\r\n\t\t\t\tclassName);\r\n\r\n\t\tjava.util.List list = ListUtil.list();\r\n\t\tjava.util.Map map = MapUtil.map();\r\n\t\tboolean flag6 = approvalrequest1.activate(list, map);\r\n\r\n\t\tLog.customer.debug(\"%s ::: New TaxAR Activated - %s\", className);\r\n\t\tLog.customer.debug(\"%s ::: State (AFTER): %s\", className);\r\n\t\tLog.customer.debug(\"%s ::: Approved By: %s\", className);\r\n\r\n\t}", "public void saveSysRole(SysRole sysRole);", "@PreAuthorize(\"hasRole('ADMINISTRATOR') OR \"\r\n \t\t\t+ \"((hasRole('EMPLOYEE') OR isAnonymous()) AND \"\r\n \t\t\t+ \"(#userDTO.type.typeLabel == 'CUSTOMERLEGAL' OR #userDTO.type.typeLabel == 'CUSTOMERINDIVIDUAL'))\")\r\n \tpublic SystemUserDTO create(SystemUserDTO userDTO);", "@Test\n\tpublic void testAdminCreate() {\n\t\tAccount acc1 = new Account(00000, \"ADMIN\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"ADMIN\", 00000, 0, \"A\"));\n\t\ttransactions.add(1, new Transaction(05, \"new acc\", 00001, 100.00, \"A\"));\n\t\ttransactions.add(2, new Transaction(00, \"ADMIN\", 00000, 0, \"A\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (outContent.toString().contains(\"Account Created\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"unable to create account as admin\", testResult);\n\t}", "@Override\n public void createNewRole(final String roleName, final String roleDescription,\n final String unAssignedPermission, final int partnerType) {\n\n DriverConfig.setLogString(\"Processing a new role creation with required fields.\", true);\n\n WaitUtil.waitUntil(200);\n\n final WebElement roleManagement = retrieveElementByAttributeValue(DriverConfig.getDriver(),\n TAG_ANCHOR, ATTR_TITLE, roleConfig.get(ROLE_MANAGEMENT_VAL));\n roleManagement.click();\n logger.info(\"check if create new role is displayed.\");\n isDisplayedByLinkText(DriverConfig.getDriver(), roleConfig.get(CREATE_NEW_ROLE_VAL),\n MEDIUM_TIMEOUT);\n DriverConfig.setLogString(\"select create new role link.\", true);\n final WebElement createNewRole = retrieveElementByLinkText(DriverConfig.getDriver(),\n roleConfig.get(CREATE_NEW_ROLE_VAL), MEDIUM_TIMEOUT);\n createNewRole.click();\n DriverConfig.setLogString(\"enter details in create role form.\", true);\n final String dynamicRoleName = enterRoleName(roleName);\n selectPartnerType(partnerType);\n enterRoleDescription(roleDescription);\n DriverConfig.setLogString(\"select permissions for the role.\", true);\n sendPermissions(DriverConfig.getDriver(), unAssignedPermission);\n DriverConfig.setLogString(\"save & verify the role access.\", true);\n saveAndVerifyRole(DriverConfig.getDriver(), dynamicRoleName);\n }", "@Test(groups = \"wso2.ds.dashboard\", description = \"Assigning dashboard view and edit permission\", dependsOnMethods = \"testAddUserAssignRoles\")\n public void testAddDashboardAndAssignRolesBySetting()\n throws XPathExpressionException, MalformedURLException, InterruptedException {\n addLoginRole(USERNAME_EDITOR);\n addCreateRole(USERNAME_EDITOR);\n addOwnernRole(USERNAME_EDITOR);\n login(USERNAME_EDITOR, PASSWORD_EDITOR);\n deleteDashboards();\n addDashBoardWithLandingPage(dashboardTitle, DASHBOARD_DESCRIPTION);\n getDriver().findElement(By.cssSelector(\"#\" + DASHBOARD_TITLE.toLowerCase() + \" a.ues-edit\")).click();\n allowPersonalizeDashboard();\n redirectToLocation(DS_HOME_CONTEXT, DS_DASHBOARDS_CONTEXT);\n WebElement dashboardItem = getDriver().findElement(By.id(dashboardTitle.toLowerCase()));\n dashboardItem.findElement(By.cssSelector(\".ues-edit\")).click();\n getDriver().findElement(By.id(\"dashboard-settings\")).click();\n getDriver().executeScript(\"scroll(0, 200);\");\n // Add viewer role\n WebElement viewerTextbox = getDriver().findElement(By.id(\"ues-share-view\"));\n viewerTextbox.sendKeys(\"dashboardViewer\");\n viewerTextbox.sendKeys(Keys.TAB);\n // Add editor role\n WebElement editorTextbox = getDriver().findElement(By.id(\"ues-share-edit\"));\n editorTextbox.sendKeys(\"dashboardEditor\");\n editorTextbox.sendKeys(Keys.TAB);\n // Remove all other roles\n getDriver().findElement(By.cssSelector(\".ues-shared-view > .ues-shared-role > .remove-button\")).click();\n getDriver().findElement(By.cssSelector(\".ues-shared-edit > .ues-shared-role > .remove-button\")).click();\n getDriver().findElement(By.id(\"ues-dashboard-saveBtn\")).click();\n }", "@Test\n\tpublic void testIsPermitted_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tList<Permission> permissions = new Vector();\n\n\t\tboolean[] result = fixture.isPermitted(permissions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "ch.crif_online.www.webservices.crifsoapservice.v1_00.BusinessIndustryLicense addNewBusinessIndustryLicenses();", "UserPermissionsType createUserPermissionsType();", "@Test\n\tpublic void testCheckPermissions_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tCollection<Permission> permissions = new Vector();\n\n\t\tfixture.checkPermissions(permissions);\n\n\t\t// add additional test code here\n\t}", "public void setSale(int sale) {\n\t\tthis.sale = sale;\r\n\t}", "public void createSupplier(User user){\n BCryptPasswordEncoder encoder= new BCryptPasswordEncoder();\n user.setPassword(encoder.encode(user.getPassword()));\n //creating roles\n Role userRole = new Role(\"SUPPLIER\");//we create a role type client\n //a user can then take a list of roles\n List<Role> roles = new ArrayList<>();//list of roles\n roles.add(userRole);//add client role type to the list\n user.setRoles(roles);//set a user to a role type\n userRepository.save(user);//save( save is a crudrepository method) the user to the database.\n }", "public void grantAdministrate(User user) throws ServiceException{\n }", "public void createProjectRoleTermsOfUse(int projectId, int resourceRoleId, long termsOfUseId, int sortOrder,\r\n int groupIndex) throws TermsOfUsePersistenceException;", "@Before\n public void setUp() {\n permissionsS.add(EntityUtil.getSamplePermission());\n }", "@Test\n\tpublic void testCheckPermissions_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tCollection<Permission> permissions = new Vector();\n\n\t\tfixture.checkPermissions(permissions);\n\n\t\t// add additional test code here\n\t}", "@Test\r\n public void testAdminSaveSubscriptionAuthorized() throws Exception {\r\n saveJoePublisher();\r\n saveSamSyndicator();\r\n DatatypeFactory fac = DatatypeFactory.newInstance();\r\n List<Subscription> subs = new ArrayList<Subscription>();\r\n Subscription s = new Subscription();\r\n\r\n s.setMaxEntities(10);\r\n s.setBrief(false);\r\n GregorianCalendar gcal = new GregorianCalendar();\r\n gcal.setTimeInMillis(System.currentTimeMillis());\r\n gcal.add(Calendar.HOUR, 1);\r\n s.setExpiresAfter(fac.newXMLGregorianCalendar(gcal));\r\n s.setSubscriptionFilter(new SubscriptionFilter());\r\n s.getSubscriptionFilter().setFindBusiness(new FindBusiness());\r\n s.getSubscriptionFilter().getFindBusiness().setFindQualifiers(new FindQualifiers());\r\n s.getSubscriptionFilter().getFindBusiness().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);\r\n s.getSubscriptionFilter().getFindBusiness().getName().add(new Name(UDDIConstants.WILDCARD, null));\r\n subs.add(s);\r\n Holder<List<Subscription>> items = new Holder<List<Subscription>>();\r\n items.value = subs;\r\n publisher.adminSaveSubscription(authInfoJoe(), TckPublisher.getSamPublisherId(), items);\r\n for (int i = 0; i < items.value.size(); i++) {\r\n tckSubscription.deleteSubscription(authInfoSam(), items.value.get(i).getSubscriptionKey());\r\n }\r\n\r\n deleteJoePublisher();\r\n deleteSamSyndicator();\r\n\r\n }", "@Test\r\n public void test_createProjectRoleTermsOfUse() throws Exception {\r\n instance.createProjectRoleTermsOfUse(projectId, resourceRoleId, termsOfUseId, sortOrder, groupIndex);\r\n\r\n assertTrue(\"'createProjectRoleTermsOfUse' should be correct.\",\r\n hasProjectRoleTermsOfUse(connection, projectId, resourceRoleId, termsOfUseId, groupIndex));\r\n }", "public Boolean CreateStoreAdmin(String a, String b, Store s) {\n for (int i = 0 ; i <= SAlist.getStoreAdmins().size() -1 ; i++)\n {\n if (SAlist.getStoreAdmins().get(i).getID().equals(a))\n {\n System.out.println(\"ID alreday exists\");\n return false;\n }\n }\n StoreAdmin admin = new StoreAdmin(a, b, s);\n SAlist.getStoreAdmins().add(admin);\n try {\n SerialiseList();\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n return true;\n }", "@Test\n\tpublic void testCheckPermission_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tfixture.checkPermission(permission);\n\n\t\t// add additional test code here\n\t}", "@Override\n\tprotected void createEditPolicies()\n\t{\n\t\t\n\t}", "public static void apiManagementCreateProductPolicy(\n com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {\n manager\n .productPolicies()\n .createOrUpdateWithResponse(\n \"rg1\",\n \"apimService1\",\n \"5702e97e5157a50f48dce801\",\n PolicyIdName.POLICY,\n new PolicyContractInner()\n .withValue(\n \"<policies>\\r\\n\"\n + \" <inbound>\\r\\n\"\n + \" <rate-limit calls=\\\"{{call-count}}\\\" renewal-period=\\\"15\\\"></rate-limit>\\r\\n\"\n + \" <log-to-eventhub logger-id=\\\"16\\\">\\r\\n\"\n + \" @( string.Join(\\\",\\\", DateTime.UtcNow,\"\n + \" context.Deployment.ServiceName, context.RequestId, context.Request.IpAddress,\"\n + \" context.Operation.Name) ) \\r\\n\"\n + \" </log-to-eventhub>\\r\\n\"\n + \" <quota-by-key calls=\\\"40\\\" counter-key=\\\"cc\\\" renewal-period=\\\"3600\\\"\"\n + \" increment-count=\\\"@(context.Request.Method == &quot;POST&quot; ? 1:2)\\\" />\\r\\n\"\n + \" <base />\\r\\n\"\n + \" </inbound>\\r\\n\"\n + \" <backend>\\r\\n\"\n + \" <base />\\r\\n\"\n + \" </backend>\\r\\n\"\n + \" <outbound>\\r\\n\"\n + \" <base />\\r\\n\"\n + \" </outbound>\\r\\n\"\n + \"</policies>\")\n .withFormat(PolicyContentFormat.XML),\n null,\n com.azure.core.util.Context.NONE);\n }", "@Test\n\tpublic void testIsPermitted_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tList<Permission> permissions = null;\n\n\t\tboolean[] result = fixture.isPermitted(permissions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "OperacionColeccion createOperacionColeccion();", "public boolean isCreateRight() {\r\n if (getUser() != null) {\r\n return getUser().hasPermission(\"/vocabularies\", \"c\");\r\n }\r\n return false;\r\n }", "@Test\n\tpublic void testIsPermittedAll_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tCollection<Permission> permissions = new Vector();\n\n\t\tboolean result = fixture.isPermittedAll(permissions);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "@Override\n public boolean createCustomerBySales(SalesCustomerBean salescustomer) {\n // TODO Auto-generated method stub\n salescustomer.setGendate(C_Util_Date.generateDate());\n salescustomer.setStatus(\"NEW\");\n insertorupdate = in_salescustdao.createSalesCustomer(salescustomer);\n return insertorupdate;\n }", "@Test\n\tpublic void testIsPermitted_7()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "@Test\n\tpublic void testIsPermitted_6()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "@PreAuthorize(\"checkPermission('Legal Entity', 'Manage Legal Entities', {'view','create'})\")\n @GetMapping(\n produces = {\"application/json\"})\n @ResponseStatus(HttpStatus.OK)\n public void sampleEndpointThatRequiresUserToHavePermissionsToViewCreateLegalEnitites() {\n LOGGER.info(\"Preauthorize annotation have checked that user has permissions to view/create legal entities\");\n // continue custom implementation ...\n }", "public void createIndividualAcl(Individual i);", "public void startNewSale() {\n sale = new Sale(cashRegister);\n }", "@Test\n public void testAuthorization() throws Throwable {\n Method defineCustomer = EZShop.class.getMethod(\"receiveCashPayment\", Integer.class, double.class);\n testAccessRights(defineCustomer, new Object[] {saleId, toBePaid},\n new Role[] {Role.SHOP_MANAGER, Role.ADMINISTRATOR, Role.CASHIER});\n }", "public void resetCreationRights() {\r\n creationRights = false;\r\n \r\n try {\r\n String[] roles = processModel.getCreationRoles();\r\n \r\n for (int i = 0; i < roles.length; i++) {\r\n if (roles[i].equals(currentRole))\r\n creationRights = true;\r\n }\r\n } catch (Exception e) {\r\n creationRights = false;\r\n }\r\n }", "@Test\n public void testSetPolicy2() throws Exception {\n setupPermission(PathUtils.ROOT_PATH, getTestUser().getPrincipal(), true, JCR_READ, JCR_READ_ACCESS_CONTROL, JCR_MODIFY_ACCESS_CONTROL);\n setupPermission(null, getTestUser().getPrincipal(), true, JCR_READ_ACCESS_CONTROL, JCR_MODIFY_ACCESS_CONTROL);\n\n setupPermission(getTestRoot(), null, EveryonePrincipal.getInstance(), false, JCR_NAMESPACE_MANAGEMENT);\n }", "CreateACLResult createACL(CreateACLRequest createACLRequest);", "void createUserAccounts(Set<Role> roles, User u);", "public void bookSale(Sale sale)\n {\n //books the sale\n }", "@Test\n public void testCheckExistsPermission() throws Exception\n {\n permission = permissionManager.getPermissionInstance(\"OPEN_OFFICE\");\n permissionManager.addPermission(permission);\n assertTrue(permissionManager.checkExists(permission));\n Permission permission2 = permissionManager.getPermissionInstance(\"CLOSE_OFFICE\");\n assertFalse(permissionManager.checkExists(permission2));\n }", "public void grantPermission(String objectId, String objectType, User user, List<String> actions) throws UserManagementException;", "Salesman() {\n super();\n super.setType(EMPLOYEE_TYPE);\n this.setAnnualSales(-1);\n }", "@Test\n\tpublic void testIsPermitted_3()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tList<Permission> permissions = new Vector();\n\n\t\tboolean[] result = fixture.isPermitted(permissions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "PermissionType createPermissionType();", "@Override\n\tpublic Role createNewSelfSourcedRole(String title, String location,\n\t\t\tDate start, Date end, String description, Double salary) {\n\t\tofferman.createNewSelfSourcedRole(title, location, start, end, description, salary);\n\t\treturn null;\n\t}", "public void grantAdminOnIndividualToSystemUser(Individual i, SystemUser user);", "@Test\n\tpublic void testIsPermitted_9()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "@Test\n\tpublic void testCheckPermissions_4()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tCollection<Permission> permissions = new Vector();\n\n\t\tfixture.checkPermissions(permissions);\n\n\t\t// add additional test code here\n\t}", "public void CreateAdminUser (String administratorUserName, String administratorPassword, \n String administratorFirstName, String administratorLastName, String administratorEmail) {\n User user = identityService.newUser(administratorUserName);\n user.setFirstName(administratorFirstName);\n user.setLastName(administratorLastName);\n user.setPassword(administratorPassword);\n user.setEmail(administratorEmail);\n identityService.saveUser(user);\n\n LOGGER.info(\"Creating the camunda admin group\");\n // create Administrator Group\n if(identityService.createGroupQuery().groupId(Groups.CAMUNDA_ADMIN).count() == 0) {\n Group camundaAdminGroup = identityService.newGroup(Groups.CAMUNDA_ADMIN);\n camundaAdminGroup.setName(\"camunda BPM Administrators\");\n camundaAdminGroup.setType(Groups.GROUP_TYPE_SYSTEM);\n identityService.saveGroup(camundaAdminGroup);\n }\n\n LOGGER.info(\"Creating Admin group authrorizations for all built-in resources\");\n // create Admin authorizations on all built-in resources\n for (Resource resource : Resources.values()) {\n if(authorizationService.createAuthorizationQuery().groupIdIn(Groups.CAMUNDA_ADMIN).resourceType(resource).resourceId(ANY).count() == 0) {\n AuthorizationEntity userAdminAuth = new AuthorizationEntity(AUTH_TYPE_GRANT);\n userAdminAuth.setGroupId(Groups.CAMUNDA_ADMIN);\n userAdminAuth.setResource(resource);\n userAdminAuth.setResourceId(ANY);\n userAdminAuth.addPermission(ALL);\n authorizationService.saveAuthorization(userAdminAuth);\n }\n }\n identityService.createMembership(administratorUserName, \"camunda-admin\");\n }", "private void generatePermissions() \n\n\tthrows java.io.FileNotFoundException, java.io.IOException {\n\n\tif (!writeOnCommit) return;\n\n\t// otherwise proceed to write policy file\n\n\tMap roleToSubjectMap = null;\n SecurityRoleMapperFactory factory=SecurityRoleMapperFactoryGen.getSecurityRoleMapperFactory();\n\tif (rolePermissionsTable != null) {\n\t // Make sure a role to subject map has been defined for the Policy Context\n\t if (factory != null) {\n // the rolemapper is stored against the\n // appname, for a web app get the appname for this contextid\n SecurityRoleMapper srm = factory.getRoleMapper(CONTEXT_ID);\n\t\tif (srm != null) {\n\t\t roleToSubjectMap = srm.getRoleToSubjectMapping();\n\t\t}\n\t\tif (roleToSubjectMap != null) {\n\t\t // make sure all liked PC's have the same roleToSubjectMap\n\t\t Set linkSet = (Set) fact.getLinkTable().get(CONTEXT_ID);\n\t\t if (linkSet != null) {\n\t\t\tIterator it = linkSet.iterator();\n\t\t\twhile (it.hasNext()) {\n\t\t\t String contextId = (String)it.next();\n\t\t\t if (!CONTEXT_ID.equals(contextId)) {\n\t\t\t\tSecurityRoleMapper otherSrm = factory.getRoleMapper(contextId);\n\t\t\t\tMap otherRoleToSubjectMap = null;\n\n\t\t\t\tif (otherSrm != null) {\n\t\t\t\t otherRoleToSubjectMap = otherSrm.getRoleToSubjectMapping();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (otherRoleToSubjectMap != roleToSubjectMap) {\n String defMsg=\"Linked policy contexts have different roleToSubjectMaps (\"+CONTEXT_ID+\")<->(\"+contextId+\")\";\n String msg=localStrings.getLocalString(\"pc.linked_with_different_role_maps\",defMsg,new Object []{CONTEXT_ID,contextId});\n\t\t\t\t logger.log(Level.SEVERE,msg); \n\t\t\t\t throw new RuntimeException(defMsg);\n\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t }\n\t\t}\n\t }\n\t}\n\n\tif (roleToSubjectMap == null && rolePermissionsTable != null) {\n String defMsg=\"This application has no role mapper factory defined\";\n String msg=localStrings.getLocalString(\"pc.role_map_not_defined_at_commit\",defMsg,new Object []{CONTEXT_ID});\n\t logger.log(Level.SEVERE,msg);\n\t throw new RuntimeException\n\t\t(localStrings.getLocalString\n\t\t (\"enterprise.deployment.deployment.norolemapperfactorydefine\",defMsg));\n\t}\n\n\tPolicyParser parser = new PolicyParser(false);\n\n\t// load unchecked grants in parser\n\tif (uncheckedPermissions != null) {\n\t Enumeration pEnum = uncheckedPermissions.elements();\n\t if (pEnum.hasMoreElements()) {\n\t\tGrantEntry grant = new GrantEntry();\n\t\twhile (pEnum.hasMoreElements()) {\n\t\t Permission p = (Permission) pEnum.nextElement();\n\t\t PermissionEntry entry = \n\t\t\tnew PermissionEntry(p.getClass().getName(),\n\t\t\t\t\t p.getName(),p.getActions());\n\t\t grant.add(entry);\n\t\t}\n\t\tparser.add(grant);\n\t }\n\t}\n\n\t// load role based grants in parser\n\tif (rolePermissionsTable != null) {\n\t Iterator roleIt = rolePermissionsTable.keySet().iterator();\n\t while (roleIt.hasNext()) {\n\t\tboolean withPrincipals = false;\n\t\tString roleName = (String) roleIt.next();\n\t\tPermissions rolePerms = getRolePermissions(roleName);\n\t\tSubject rolePrincipals = (Subject) roleToSubjectMap.get(roleName);\n\t\tif (rolePrincipals != null) {\n\t\t Iterator pit = rolePrincipals.getPrincipals().iterator();\n\t\t while (pit.hasNext()){\n\t\t\tPrincipal prin = (Principal) pit.next();\n\t\t\tassert prin instanceof java.security.Principal;\n\t\t\tif (prin instanceof java.security.Principal) {\n\t\t\t withPrincipals = true;\n\t\t\t PrincipalEntry prinEntry = \n\t\t\t\tnew PrincipalEntry(prin.getClass().getName(),\n\t\t\t\t\t\t escapeName(prin.getName()));\n\t\t\t GrantEntry grant = new GrantEntry();\n\t\t\t grant.principals.add(prinEntry);\n\t\t\t Enumeration pEnum = rolePerms.elements();\n\t\t\t while (pEnum.hasMoreElements()) {\n\t\t\t\tPermission perm = (Permission) pEnum.nextElement();\n\t\t\t\tPermissionEntry permEntry = \n\t\t\t\t new PermissionEntry(perm.getClass().getName(),\n\t\t\t\t\t\t\tperm.getName(),\n\t\t\t\t\t\t\tperm.getActions());\n\t\t\t\tgrant.add(permEntry);\n\t\t\t }\n\t\t\t parser.add(grant);\n\t\t\t}\n\t\t\telse {\n String msg = localStrings.getLocalString(\"pc.non_principal_mapped_to_role\",\n \"non principal mapped to role \"+roleName,new Object[]{prin,roleName});\n\t\t\t logger.log(Level.WARNING,msg);\n\t\t\t}\n\t\t }\n\t\t} \n\t\tif (!withPrincipals) {\n String msg = localStrings.getLocalString(\"pc.no_principals_mapped_to_role\",\n \"no principals mapped to role \"+roleName, new Object []{ roleName});\n\t\t logger.log(Level.WARNING,msg);\n\t\t}\n\t }\n\t}\n\n\twriteOnCommit = createPolicyFile(true,parser,writeOnCommit);\n\n\t// load excluded perms in excluded parser\n\tif (excludedPermissions != null) {\n\n\t PolicyParser excludedParser = new PolicyParser(false);\n\n\t Enumeration pEnum = excludedPermissions.elements();\n\t if (pEnum.hasMoreElements()) {\n\t\tGrantEntry grant = new GrantEntry();\n\t\twhile (pEnum.hasMoreElements()) {\n\t\t Permission p = (Permission) pEnum.nextElement();\n\t\t PermissionEntry entry = \n\t\t\tnew PermissionEntry(p.getClass().getName(),\n\t\t\t\t\t p.getName(),p.getActions());\n\t\t grant.add(entry);\n\t\t}\n\t\texcludedParser.add(grant);\n\t }\n\n\t writeOnCommit = createPolicyFile(false,excludedParser,writeOnCommit);\n\t} \n\n\tif (!writeOnCommit) wasRefreshed = false;\n }", "@Test\n\tpublic void testCheckPermissions_3()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tCollection<Permission> permissions = null;\n\n\t\tfixture.checkPermissions(permissions);\n\n\t\t// add additional test code here\n\t}", "@Override\r\n public void setsaleId(int saleid) {\n this.saleId = saleid;\r\n }", "@Test\n\tpublic void testIsPermittedAll_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tCollection<Permission> permissions = new Vector();\n\n\t\tboolean result = fixture.isPermittedAll(permissions);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "public void startSale() {\n sale = new Sale();\n }", "@Test\n void checkManagerWithPermissionGetAlert(){\n LinkedList<PermissionEnum.Permission> list=new LinkedList<>();\n list.add(PermissionEnum.Permission.RequestBidding);\n tradingSystem.AddNewManager(EuserId,EconnID,storeID,NofetID);\n tradingSystem.EditManagerPermissions(EuserId,EconnID,storeID,NofetID,list);\n Response Alert=new Response(\"Alert\");\n store.sendAlertOfBiddingToManager(Alert);\n //??\n }", "QuoteRole createQuoteRole();", "@Test\n\tpublic void testGetPermissions_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\n\t\tSet<Permission> result = fixture.getPermissions();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "@Test\n\tpublic void testAddRole_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tString roleName = \"\";\n\n\t\tfixture.addRole(roleName);\n\n\t\t// add additional test code here\n\t}", "@Test\n public void testCreateProductShouldThrowForbiddenWhenMemberUserAccess() throws Exception {\n testResponseData(RequestInfo.builder()\n .request(post(PRODUCT_ENDPOINT))\n .token(memberToken)\n .body(productRequest)\n .httpStatus(HttpStatus.FORBIDDEN)\n .build());\n }", "@Test\n\tpublic void testIsPermitted_8()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(null);\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "@Override\n public boolean createSalesCallLog(SalesCallLog salescalllog) {\n salescalllog.setGendate(C_Util_Date.generateDate());\n return in_salescalllogdao.createSalesCallLog(salescalllog);\n }", "public void testCreateRoles1() throws Exception {\r\n SeleniumTestBase mySeleniumTestBase = new SeleniumTestBase(browser);\r\n mySeleniumTestBase.addNewRole(\"Role1\", \"user1\", \"Login to admin console\");\r\n }", "int insert(SysRoleUser record);", "@PreAuthorize(\"hasRole('ADMIN')\")\n public ProductDto retrieveAuthorizedProducts() { \n return new ProductDto(\"1\", \"iPhone\", 999.99f);\n }", "public MetaRole createMetaRole(String sName, String sAdmin) throws IOException;", "@Override\n @Transactional\n public AjaxResult createRole(RoleCreatePojo roleCreatePojo) {\n\n User loginUser = SpringUtils.getBean(LoginTokenService.class).getLoginUser(ServletUtils.getRequest());\n roleCreatePojo.getSysRole().setCreateBy(loginUser.getNickname());\n // 处理各类不能为空的字段\n if(null == roleCreatePojo.getSysRole().getRoleSort())\n roleCreatePojo.getSysRole().setRoleSort(\"1\");\n if(null == roleCreatePojo.getSysRole().getStatus())\n roleCreatePojo.getSysRole().setStatus(\"0\");\n if(null == roleCreatePojo.getSysRole().getCreateTime())\n roleCreatePojo.getSysRole().setCreateTime(Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant()));\n if(null == roleCreatePojo.getSysRole().getRemark())\n roleCreatePojo.getSysRole().setRemark(roleCreatePojo.getSysRole().getRoleName());\n\n // 新增角色\n SysRole sysRole = roleCreatePojo.getSysRole();\n sysRoleMapper.insert(sysRole);\n Long roleId = sysRole.getRoleId();\n\n // 新增角色对应的menu\n if(null != roleCreatePojo.getMenuList() && 0 != roleCreatePojo.getMenuList().size()) {\n List<SysRoleMenu> sysRoleMenus = new ArrayList<>();\n roleCreatePojo.getMenuList().forEach(item -> {\n SysRoleMenu sysRoleMenu = new SysRoleMenu();\n sysRoleMenu.setRoleId(roleId);\n sysRoleMenu.setMenuId(item);\n\n sysRoleMenus.add(sysRoleMenu);\n });\n sysRoleMenuMapper.batchRoleMenu(sysRoleMenus);\n }\n\n return AjaxResult.success();\n }", "int insert(SysRole record);", "@Test\n\tpublic void testGetPermissions_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\n\t\tSet<Permission> result = fixture.getPermissions();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "@Test\n\tpublic void testGetSetPermission() throws Exception {\n\t Namespace n = new Namespace(this.fdb, \"\", this.fdb.getUsername());\n\t n.getItem();\n\t String newName = UUID.randomUUID().toString();\n\t Namespace newNamespace = n.createNamespace(newName, \"Created for the purposes of testing\");\n\t // Lets set a strange permission on the namespace so we know what we're checking when \n\t // we get it back\n\t Permission p = new Permission(Policy.OPEN, new String[]{\"fluiddb\"});\n\t newNamespace.setPermission(Namespace.Actions.CREATE, p);\n\t \n\t // OK... lets try getting the newly altered permission back\n\t Permission checkP = newNamespace.getPermission(Namespace.Actions.CREATE);\n\t assertEquals(p.GetPolicy(), checkP.GetPolicy());\n\t assertEquals(p.GetExceptions()[0], checkP.GetExceptions()[0]);\n\t \n\t // Housekeeping to clean up after ourselves...\n\t newNamespace.delete();\n\t}", "private void addApplicationsPermissionsToRegistry() throws APIManagementException {\n Registry tenantGovReg = getRegistry();\n String permissionResourcePath = CarbonConstants.UI_PERMISSION_NAME + RegistryConstants.PATH_SEPARATOR + APPLICATION_ROOT_PERMISSION;\n try {\n if (!tenantGovReg.resourceExists(permissionResourcePath)) {\n String loggedInUser = CarbonContext.getThreadLocalCarbonContext().getUsername();\n UserRealm realm = (UserRealm) CarbonContext.getThreadLocalCarbonContext().getUserRealm();\n // Logged in user is not authorized to create the permission.\n // Temporarily change the user to the admin for creating the permission\n PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(realm.getRealmConfiguration().getAdminUserName());\n tenantGovReg = CarbonContext.getThreadLocalCarbonContext().getRegistry(RegistryType.USER_GOVERNANCE);\n Collection appRootNode = tenantGovReg.newCollection();\n appRootNode.setProperty(\"name\", \"Applications\");\n tenantGovReg.put(permissionResourcePath, appRootNode);\n PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(loggedInUser);\n }\n } catch (org.wso2.carbon.user.core.UserStoreException e) {\n throw new APIManagementException(\"Error while reading user store information.\", e);\n } catch (org.wso2.carbon.registry.api.RegistryException e) {\n throw new APIManagementException(\"Error while creating new permission in registry\", e);\n }\n }", "public void saveJpmProductSaleNew(JpmProductSaleNew jpmProductSaleNew);", "public void startSale(){\n this.sale = new Sale();\n this.inventory = new Inventory();\n this.accounting = new Accounting();\n }", "public void addUserToAccessControlList(Site site, String permission) {\n \t\n \tString gcalid = getGoogleCalendarID( site);\n \tif (gcalid == null){\n \t\tM_log.error(\"Google calendar id not found in site properties for site: \" + site.getId());\n \t\treturn;\n \t}\n \t\n \tString currentUserId = getCurrentUserId();\n \t\n \tCalendar client;\n \t\n \tPreferences prefs = (PreferencesEdit)m_preferencesService.getPreferences(currentUserId);\n\t\tResourceProperties props = prefs.getProperties(GOOGLE_CALENDAR_PREFS);\n\t\tString googleCalendarPrefPropValue = props.getProperty(gcalid);\n\t\tboolean isSuper = securityService.isSuperUser(currentUserId);\n \t\n\t\t// if the current user is a valid user in the site or a superuser\n\t\t// and if the current user is not in google calendar acl (access control list)\n\t\t// OR if their permissions have changed\n\t\t// add the current user to the google calendar acl (access control list)\t\t\n\t\tif (site.getMember(currentUserId) != null \n\t\t\t\t&& ( googleCalendarPrefPropValue == null || !googleCalendarPrefPropValue.equals(permission) )\n\t\t\t\t|| isSuper ) {\n\t\t\t\n\t\t\t// Site creator \n\t\t\tString siteCreatorEmailAddress = site.getCreatedBy().getEmail();\n\t\t\t\n\t\t\t// no email associated with the site owner results in the call to Google to fail.\n\t\t\tif ( null == siteCreatorEmailAddress || siteCreatorEmailAddress.isEmpty() ) {\n\t\t\t\t// TODO: error message to the user here?\n\t\t\t\tM_log.error(\"Missing email address for site creator - unable to create google calender. Site \" + site.getId() + \" creator \" + site.getCreatedBy().getSortName() );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Create ACL using site creator email\n\t\t\tGoogleCredential credential = getGoogleCredential(siteCreatorEmailAddress);\n\t\t\t\n\t\t\tif (credential == null) {\n\t\t\t\tM_log.error(\"addUserToAccessControlList: bad credentials for \" + site.getId() + \" creator \" + siteCreatorEmailAddress);\n\t\t\t\treturn; // user not authorized\n\t\t\t}\n\n\t\t\tclient = getGoogleClient( credential );\n\t\t\t\t\n\t\t\tString currentUserEmailAddress = getUserEmailAddress();\n\t\t\tAclRule rule = new AclRule();\n\t\t\tScope scope = new Scope();\n\n\t\t\tscope.setType(SakaiGCalendarServiceStaticVariables.RULE_SCOPE_TYPE_USER);\n\t\t\tscope.setValue(currentUserEmailAddress);\n\t\t\trule.setScope(scope);\n\t\t\t\n\t\t\t// Determine Google calendar permissions based on Sakai permissions\n\t\t\tif ( permission.equals(org.sakaiproject.site.api.SiteService.SECURE_UPDATE_SITE_MEMBERSHIP)) {\n\t\t\t\trule.setRole(SakaiGCalendarServiceStaticVariables.RULE_ROLE_OWNER);\n\t\t\t}\n\t\t\telse if ( permission.equals(SakaiGCalendarServiceStaticVariables.SECURE_GCAL_EDIT)) {\n\t\t\t\trule.setRole(SakaiGCalendarServiceStaticVariables.RULE_ROLE_WRITER);\n\t\t\t}\n\t\t\telse if ( permission.equals(SakaiGCalendarServiceStaticVariables.SECURE_GCAL_VIEW_ALL) || isSuper) {\n\t\t\t\trule.setRole(SakaiGCalendarServiceStaticVariables.RULE_ROLE_READER);\n\t\t\t}\n\t\t\telse if ( permission.equals(SakaiGCalendarServiceStaticVariables.SECURE_GCAL_VIEW)) {\n\t\t\t\trule.setRole(SakaiGCalendarServiceStaticVariables.RULE_ROLE_FREEBUSYREADER);\n\t\t\t}\n\t\t\telse {\n\t\t\t\trule.setRole(SakaiGCalendarServiceStaticVariables.RULE_ROLE_FREEBUSYREADER); // should never fall through\n\t\t\t}\n\t\t\t// TODO: although this seems to work, we should update the role if it already exists AND we should test the return\n\t\t\ttry {\n\t\t\t\tAclRule createdRule = client.acl().insert(gcalid, rule).execute();\n\t\t\t} catch (IOException e) {\n\t\t\t\tM_log.error(\"addUserToAccessControlList for site \" + site.getId() + \" \" + e.getMessage());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Save gcalid in user preferences (so we know the user has been added to the google calendar ACL)\t\t\n\t\t\tsaveGCalProperty(currentUserId, gcalid, permission);\n \t}\n }", "ResourceRole createResourceRole();", "public int modifySale(SaleVO vo) {\n\t\treturn sale.Modify(vo);\r\n\t}", "public void savePermission(Permission newEntity) throws DAOException;", "public void testCreateRoles3() throws Exception {\r\n SeleniumTestBase mySeleniumTestBase = new SeleniumTestBase(browser);\r\n mySeleniumTestBase.addNewRole(\"Role3\", \"user3\", \"manage-security\");\r\n\r\n }", "boolean setSiteRights(SiteAdminRights r, boolean b);", "@Override\n\tpublic int insert(ShiroRolesPermissionsPoEntity entity) {\n\t\treturn 0;\n\t}", "x0401.oecdStandardAuditFileTaxPT1.ProductDocument.Product addNewProduct();", "com.soa.SolicitarCreditoDocument.SolicitarCredito addNewSolicitarCredito();", "@Test\n\tpublic void testAddRoles_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tSet<String> roleNames = new HashSet();\n\n\t\tfixture.addRoles(roleNames);\n\n\t\t// add additional test code here\n\t}", "@Override\n protected String requiredPutPermission() {\n return \"admin\";\n }", "@Test\n\tpublic void testIsPermitted_4()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tList<Permission> permissions = new Vector();\n\n\t\tboolean[] result = fixture.isPermitted(permissions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "public void addPermissions(IPermission[] permissions) throws AuthorizationException;", "@Test\n\tpublic void testAddRoles_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tSet<String> roleNames = new HashSet();\n\n\t\tfixture.addRoles(roleNames);\n\n\t\t// add additional test code here\n\t}", "@Test\n\tpublic void testIsPermitted_5()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tboolean result = fixture.isPermitted(permission);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "@Test(expected = org.jsecurity.authz.UnauthorizedException.class)\n\tpublic void testCheckPermission_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tfixture.checkPermission(permission);\n\n\t\t// add additional test code here\n\t}", "@Test\n\tpublic void testIsPermittedAll_3()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tCollection<Permission> permissions = new Vector();\n\n\t\tboolean result = fixture.isPermittedAll(permissions);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "@Override\n\tpublic void insert(SysUserRole sysUserRole) {\n\t\tsysUserRoleService.insert(sysUserRole);\n\t}", "public int addSale(SaleVO vo) {\n\t\treturn sale.Add(vo);\r\n\t}", "public void startSale() {\r\n System.out.println(\"[CashRegister] startSale\");\r\n System.out.println(\"\");\r\n\r\n //receipt = new Receipt(customerId); \r\n receipt = new Receipt(\"100\");\r\n\r\n //addItemToSale(productId, quantity);\r\n addItemToSale(\"A101\", 10);\r\n\r\n addItemToSale(\"B205\", 6);\r\n\r\n addItemToSale(\"C222\", 12);\r\n\r\n }" ]
[ "0.58384126", "0.5542626", "0.55071056", "0.5457213", "0.5392109", "0.53751636", "0.5367562", "0.53609335", "0.52552354", "0.522335", "0.5212633", "0.5202215", "0.517512", "0.51554173", "0.51404405", "0.5132153", "0.5116211", "0.5108389", "0.5087952", "0.50862247", "0.50715333", "0.5055347", "0.5052035", "0.50398594", "0.5037004", "0.50190324", "0.50054795", "0.50010866", "0.49930784", "0.4987247", "0.49766862", "0.4970318", "0.49535188", "0.49390015", "0.49388504", "0.49344295", "0.49244064", "0.49221355", "0.4920586", "0.49098635", "0.49039882", "0.48929468", "0.4885984", "0.48855236", "0.48710328", "0.4857011", "0.48539466", "0.48456797", "0.48453906", "0.48391086", "0.48349175", "0.48331994", "0.48311296", "0.48237848", "0.4820262", "0.48138815", "0.4808537", "0.48070446", "0.480564", "0.4795464", "0.47933447", "0.47858396", "0.47833148", "0.47718477", "0.47704977", "0.47526115", "0.4752217", "0.47512537", "0.47448638", "0.4738963", "0.47378278", "0.47334528", "0.47298616", "0.47195074", "0.471866", "0.4718052", "0.47151718", "0.47150388", "0.47149834", "0.47126073", "0.4710148", "0.47071126", "0.47042134", "0.47009817", "0.4698735", "0.46959582", "0.46914655", "0.4691158", "0.46890783", "0.46887374", "0.46873114", "0.46862164", "0.4683734", "0.4679138", "0.467911", "0.46777213", "0.46720558", "0.46697566", "0.46680412", "0.46675768" ]
0.5270539
8
Delete a sale Permissions Needed: SALES_ADMIN
@Test public void deleteCatalogSaleTest() { Integer id = null; // Void response = api.deleteCatalogSale(id); // TODO: test validations }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void delete(Sale sale) {\n sale_dao.delete(sale);\n }", "@Override\r\n\tpublic void deleteBySSO(String sso) {\n\t\t\r\n\t}", "public void delete(SecRole entity);", "public int deleteAllPermissions() throws DAOException;", "int deleteByExample(SysRoleDOExample example);", "@Override\n protected String requiredDeletePermission() {\n return \"admin\";\n }", "public void deleteSales(int saleId) throws SQLException, SaleDoesnotExistException, ConnectionCorruptionException {\n if (salesLogContains(saleId)) {\n Sale saleToRemove = DatabaseSelectHelper.getSaleById(saleId);\n salesLog.remove(saleToRemove);\n salesCounter--;\n } else {\n\n throw new SaleDoesnotExistException();\n }\n\n }", "void deleteAllPaymentTerms() throws CommonManagementException;", "int deleteByExample(EpermissionDOExample example);", "public void deleteStudent(String rollNo) {\n\t\t\r\n\t}", "@Override\n\tpublic void deleteRole(MaintenanceDTO dto) {\n\t\tmd.deleteRole(dto);\n\t}", "public void delete(final Warranty warranty) {\n\t\tfinal Authority a = new Authority();\n\t\tfinal UserAccount user = LoginService.getPrincipal();\n\t\ta.setAuthority(Authority.ADMIN);\n\t\tAssert.isTrue(user.getAuthorities().contains(a));\n\n\t\tAssert.isTrue(warranty.isFinalMode() == false);\n\n\t\tthis.warrantyRepository.delete(warranty);\n\n\t}", "void deletePortal(Portal portal);", "public void deleteIndividualAcl(Individual i);", "@Test\n\tpublic void deleteOrderLineSalesOrder() {\n\t\t// TODO: JUnit - Populate test inputs for operation: deleteOrderLineSalesOrder \n\t\tInteger orderline_id = 0;\n\t\tInteger related_salesorder_id = 0;\n\t\tOrderLine response = null;\n\t\tresponse = service.deleteOrderLineSalesOrder(orderline_id, related_salesorder_id);\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: deleteOrderLineSalesOrder\n\t}", "public void supprimerRole(Long idRoUt);", "public static void scriptDelete() {\n List<BeverageEntity> beverages = (List<BeverageEntity>) adminFacade.getAllBeverages();\n for (int i = 0; i < beverages.size(); i++) {\n System.out.println(\"delete : \" + beverages.get(i));\n adminFacade.removeBeverage(beverages.get(i));\n }\n List<DecorationEntity> decos = (List<DecorationEntity>) adminFacade.getAllDecorations();\n for (int i = 0; i < decos.size(); i++) {\n System.out.println(\"delete : \" + decos.get(i));\n adminFacade.removeDecoration(decos.get(i));\n }\n\n /* Check that there isn't any other cocktails, and delete remaining */\n List<CocktailEntity> cocktails = (List<CocktailEntity>) adminFacade.getAllCocktails();\n if (cocktails.size() > 0) {\n System.err.println(\"Les cocktails n'ont pas été tous supprimés... \"\n + cocktails.size() + \" cocktails restants :\");\n }\n for (int i = 0; i < cocktails.size(); i++) {\n CocktailEntity cocktail = adminFacade.getCocktailFull(cocktails.get(i));\n System.err.println(cocktail.getName() + \" : \"\n + cocktail.getDeliverables());\n adminFacade.removeCocktail(cocktail);\n }\n\n /* Remove client accounts */\n List<ClientAccountEntity> clients = (List<ClientAccountEntity>) adminFacade.getAllClients();\n for (int i = 0; i < clients.size(); i++) {\n adminFacade.removeClient(clients.get(i));\n }\n\n /* Remove addresses */\n List<AddressEntity> addresses = (List<AddressEntity>) adminFacade.getAllAddresses();\n for (int i = 0; i < addresses.size(); i++) {\n adminFacade.removeAddress(addresses.get(i));\n }\n\n /* TODO :\n * * Remove orders\n */\n }", "@Override\n public int deleteSalesOrder(SalesOrder salesOrder) throws Exception\n {\n if(salesOrder == null)\n return 0;\n\n PreparedStatement query = _da.getCon().prepareStatement(\"DELETE FROM SalesOrder WHERE orderId = ?\");\n query.setLong(1, salesOrder.getOrderId());\n _da.setSqlCommandText(query);\n\n return _da.callCommand();\n }", "private void deleteRoleAccess(Role inheritFromToDelete,\n List<? extends InheritedAccessEnabled> roleAccessList, AccessTypeInjector injector) {\n try {\n OBContext.setAdminMode(false);\n String inheritFromId = inheritFromToDelete.getId();\n List<InheritedAccessEnabled> iaeToDelete = new ArrayList<InheritedAccessEnabled>();\n for (InheritedAccessEnabled ih : roleAccessList) {\n String inheritedFromId = ih.getInheritedFrom() != null ? ih.getInheritedFrom().getId() : \"\";\n if (!StringUtils.isEmpty(inheritedFromId) && inheritFromId.equals(inheritedFromId)) {\n iaeToDelete.add(ih);\n }\n }\n for (InheritedAccessEnabled iae : iaeToDelete) {\n iae.setInheritedFrom(null);\n roleAccessList.remove(iae);\n Role owner = injector.getRole(iae);\n if (!owner.isTemplate()) {\n // Perform this operation for not template roles, because for template roles is already\n // done\n // in the event handler\n injector.removeReferenceInParentList(iae);\n }\n OBDal.getInstance().remove(iae);\n }\n } finally {\n OBContext.restorePreviousMode();\n }\n }", "void deleteAllAccesses(Role role) {\n for (AccessTypeInjector accessType : getAccessTypeOrderByPriority(true)) {\n List<? extends InheritedAccessEnabled> roleAccessList = accessType.getAccessList(role);\n List<InheritedAccessEnabled> iaeToDelete = new ArrayList<InheritedAccessEnabled>();\n for (InheritedAccessEnabled iae : roleAccessList) {\n // Not inherited accesses should not be deleted\n if (iae.getInheritedFrom() != null) {\n iaeToDelete.add(iae);\n }\n }\n for (InheritedAccessEnabled iae : iaeToDelete) {\n accessType.clearInheritFromFieldInChilds(iae, true);\n iae.setInheritedFrom(null);\n roleAccessList.remove(iae);\n OBDal.getInstance().remove(iae);\n }\n }\n OBDal.getInstance().commitAndClose();\n }", "@Override\r\n\tpublic void deleteRolePermissions(int[] ids) {\n\t\tfor(int i=0;i<ids.length;i++){\r\n\t\t\trolePermissionMapper.deleteByPrimaryKey(ids[i]);\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic int delUserRole(long urId) {\n\t\treturn 0;\r\n\t}", "@Delete({\n \"delete from A_USER_ROLE\",\n \"where id = #{id,jdbcType=INTEGER}\"\n })\n int deleteByPrimaryKey(Integer id);", "@Override\r\n\tpublic int delPermission(int id) {\n\t\treturn 0;\r\n\t}", "int deleteByExample(SysAuthenticationExample example);", "int deleteByExample(RoleSystemauthorityExample example);", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"role\"})\n public void _4_3_1_delExistRole() throws Exception {\n this.mockMvc.perform(delete(\"/api/v1.0/companies/\"+\n r_2.getCompany()+\n \"/departments/\"+\n r_2.getDepartment()+\n \"/roles/\"+\n r_2.getId())\n .header(AUTHORIZATION, ACCESS_TOKEN))\n .andDo(print())\n .andExpect(status().isOk());\n thrown.expect(NameNotFoundException.class);\n repository.findRole(r_2.getId());\n }", "@DeleteMapping(\"/\")\n\tpublic ResponseEntity<Object> deleteAdministrator(HttpServletRequest request){\n\t\tAdministrator admin = service.findByEmail(SessionManager.getInstance().getSessionEmail(request.getSession()));\n\t\tservice.delete(admin);\n\t\treturn new ResponseEntity<>(HttpStatus.OK);\n\t}", "public void deleteRoleData() throws DataLayerException\r\n\t{\r\n\t\troleDao.deleteAll();\r\n\t}", "@Test\n\tpublic void testAdminDelete() {\n\t\tAccount acc1 = new Account(00000, \"ADMIN\", true, 1000.00, 0, false);\n\t\tAccount acc2 = new Account(00001, \"temp\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\t\taccounts.add(acc2);\n\n\t\ttransactions.add(0, new Transaction(10, \"ADMIN\", 00000, 0, \"A\"));\n\t\ttransactions.add(1, new Transaction(06, \"temp\", 00001, 0, \"A\"));\n\t\ttransactions.add(2, new Transaction(00, \"ADMIN\", 00000, 0, \"A\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (outContent.toString().contains(\"Account Deleted\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"unable to delete account as admin\", testResult);\n\t}", "int deleteByExample(TUserPermissionExample example);", "@Override\n\tpublic void delete(UserRole vo) {\n\n\t}", "Integer deleteByRoleAndPermission(@Param(\"roleId\") Integer roleId,\n @Param(\"permissionId\") Integer permissionId);", "public int deleteByExample(SysRoleMenuExample example) throws SQLException {\r\n int rows = sqlMapClient.delete(\"SYS_ROLE_MENU.ibatorgenerated_deleteByExample\", example);\r\n return rows;\r\n }", "@Override\n\tpublic void deleteRole(long id) {\n\t\t\n\t}", "@Override\r\n\tpublic String delete() {\n\t\tList<Object> paramList=new ArrayList<Object>();\r\n\t\tparamList.add(admin.getAdminAccount());\r\n\t\tboolean mesg=false;\r\n\t\tif(adminDao.doDelete(paramList)==1)\r\n\t\t\tmesg=true;\r\n\t\tthis.setResultMesg(mesg, \"ɾ³ý\");\r\n\t\treturn SUCCESS;\r\n\t}", "@Transactional\n\t@Override\n\tpublic boolean deleteSalesorder(SalesorderModel salesorder)\n\t\t\tthrows Exception {\n\t\treturn false;\n\t}", "@Override\n public void deleteAllPrivies() {\n }", "@Test\n public void deleteAppPermissionTest() throws ApiException {\n String appId = null;\n String username = null;\n Boolean naked = null;\n // api.deleteAppPermission(appId, username, naked);\n\n // TODO: test validations\n }", "void delete(Accessprofile accessprofile);", "@Override\r\n\t@PreAuthorize(\"hasRole('ROLE_ADMIN')\")\r\n\tvoid delete(Long id);", "@Override\n\tpublic int delete(int student) {\n\n\t\treturn 0;\n\t}", "public void removePermissions(IPermission[] permissions) throws AuthorizationException;", "@Override\n\tpublic void delete(int ShopLoyaltyCardId) {\n\t\t\n\t}", "List<MenuPermissionEntity> deleteByUserGroup(UserGroupEntity userGroup);", "@Override\n\tpublic void removeCalendar(CalendarEdit edit) throws PermissionException {\n\t\t\n\t}", "public void deleteStudent(){\r\n\t\t\r\n\t}", "public void deleteMenu() {\n deleteMenuGroupError = true;\n String input = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(\"menu_id\");\n menu_id = Integer.parseInt(input);\n setMenu_id(menu_id);\n if (menu.deleteMenu()) {\n createMenuError = false;\n updateMenuError = false;\n deleteMenuError = true;\n } else {\n deleteMenuError = false;\n }\n }", "@DeleteMapping(\"/product-sales-summaries/{id}\")\n @Timed\n public ResponseEntity<Void> deleteProductSalesSummary(@PathVariable Long id) {\n log.debug(\"REST request to delete ProductSalesSummary : {}\", id);\n productSalesSummaryRepository.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(\"productSalesSummary\", id.toString())).build();\n }", "public void removeAdminRight(Admin admin) throws ServiceException{\n }", "public void removeAdminRole()\r\n {\r\n getSemanticObject().removeProperty(swpres_adminRole);\r\n }", "public void delete(Integer idRol);", "@Override\r\n\tpublic int delRole(int id) {\n\t\treturn 0;\r\n\t}", "@Test\r\n public void test_removeAllProjectRoleTermsOfUse_2() throws Exception {\r\n instance.createProjectRoleTermsOfUse(projectId, resourceRoleId, termsOfUseId, sortOrder, groupIndex);\r\n\r\n instance.removeAllProjectRoleTermsOfUse(Integer.MAX_VALUE);\r\n\r\n assertTrue(\"'removeAllProjectRoleTermsOfUse' should be correct.\",\r\n hasProjectRoleTermsOfUse(connection, projectId, resourceRoleId, termsOfUseId, groupIndex));\r\n\r\n }", "public void eliminar(Producto producto) throws IWDaoException;", "int deleteByExample(PensionRoleMenuExample example);", "public void declinePermission(String objectId, User user) throws UserManagementException;", "int deleteByPrimaryKey(Long socialSecurityAccountId);", "@Test\n @DisplayName(\"delete returns 403 when user is not admin\")\n void delete_Returns403_WhenUserIsNotAdmin() {\n Anime savedAnime = animeRepository.save(AnimeCreator.createAnimeToBeSaved());\n devDojoRepository.save(USER);\n \n ResponseEntity<Void> animeResponseEntity = testRestTemplateRoleUser.exchange(\n \"/animes/admin/{id}\",\n HttpMethod.DELETE,\n null,\n Void.class,\n savedAnime.getId()\n );\n\n Assertions.assertThat(animeResponseEntity).isNotNull();\n \n Assertions.assertThat(animeResponseEntity.getStatusCode()).isEqualTo(HttpStatus.FORBIDDEN);\n }", "@Override\r\n\tpublic int delRoleAuth(long raId) {\n\t\treturn 0;\r\n\t}", "DeleteACLResult deleteACL(DeleteACLRequest deleteACLRequest);", "@Override\n\tpublic boolean deleteAdminUnitLevel(Integer slc, Integer adminUnitCode,\n\t\t\tint entityType) throws Exception {\n\t\t// TODO Auto-generated method stub\n\t\treturn organizationDAO.deleteAdminUnitLevel(slc, adminUnitCode, entityType);\n\t}", "@Test\n public void testNoResidualPermissionsOnUninstall_part2() throws Exception {\n assertAllPermissionsRevoked();\n }", "@Override\r\n\tpublic void deletePsermission(Permission permission) {\n\t\tpermissionDao.deletePsermission(permission);\r\n\t}", "int deleteByPrimaryKey(Integer sell_type_id);", "int deleteByExample(SystemRoleUserMapperExample example);", "@Test\n public void testDeleteProductShouldThrowForbiddenWhenMemberUserAccess() throws Exception {\n testResponseData(RequestInfo.builder()\n .request(delete(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(memberToken)\n .httpStatus(HttpStatus.FORBIDDEN)\n .build());\n }", "public void revokePermission(String objectId, User user, List<String> actions) throws UserManagementException;", "private void deleteTodoMenu(User u) {\n\t\t\n\t}", "public void deleteAdmin(Long idAdmin);", "int deleteByExample(UUserRoleExample example);", "@SkipValidation\n public String deleteImportantNews() {\n Map session = ActionContext.getContext().getSession();\n EmployeesVO oEmp = (EmployeesVO) session.get(\"EMPLOYEE_OBJECT\");\n\n // To Delete Important News.\n important.setUpdatedBy(oEmp);\n impService.deleteImportantNews(important);\n addActionMessage(getText(\"Deleted Successfully\"));\n\n return SUCCESS;\n }", "@PutMapping(\"/delete\")\n public ResultEntity<List<ItemDTO>> deleteItemById(@RequestBody DeleteDTO dto, Principal principal,\n Authentication authentication)\n {\n dto.setModifierId(principal.getName());\n boolean isAdmin= SecurityUtil.hasRole(authentication, \"admin\");\n return itemService.deleteItemById(ConstantUtil.TYPE_SALE_RENT,dto,isAdmin);\n }", "public void deleteAllToken() throws BusinessException;", "int deleteByPrimaryKey(Long permsId);", "public void deleteaccItem(String acc_no, String library_id, String sub_library_id) {\n Session session = HibernateUtil.getSessionFactory().openSession();\n Transaction tx = null;\n //Object acqdocentry = null;\n\n try {\n tx = session.beginTransaction();\n \n Query query = session.createQuery(\"DELETE FROM AccessionRegister WHERE accessionNo = :accessionNo and id.libraryId = :libraryId and id.sublibraryId = :subLibraryId\");\n\n query.setString(\"accessionNo\", acc_no);\n query.setString(\"libraryId\", library_id);\n query.setString(\"subLibraryId\", sub_library_id);\n query.executeUpdate();\n tx.commit();\n \n }catch (RuntimeException e) {\n\n tx.rollback();\n e.printStackTrace();\n } finally {\n session.close();\n }\n }", "int deleteByPrimaryKey(Integer roleResId);", "private void removePolicy(){\n\texcludedPermissions = null;\n\tuncheckedPermissions = null;\n\trolePermissionsTable = null;\n\tremovePolicyFile(true);\n\tremovePolicyFile(false);\n\tremovePolicyContextDirectory();\n\tinitLinkTable();\n\tpolicy = null;\n\twriteOnCommit = true;\n }", "@Override\n public int delete( J34SiscomexPaises j34SiscomexPaises ) {\n return super.doDelete(j34SiscomexPaises);\n }", "@Test\r\n public void test_removeAllProjectRoleTermsOfUse_1() throws Exception {\r\n instance.createProjectRoleTermsOfUse(projectId, resourceRoleId, termsOfUseId, sortOrder, groupIndex);\r\n\r\n instance.removeAllProjectRoleTermsOfUse(projectId);\r\n\r\n assertFalse(\"'removeAllProjectRoleTermsOfUse' should be correct.\",\r\n hasProjectRoleTermsOfUse(connection, projectId, resourceRoleId, termsOfUseId, groupIndex));\r\n resourceRoleId = 1;\r\n termsOfUseId = 2;\r\n groupIndex = 2;\r\n assertFalse(\"'removeAllProjectRoleTermsOfUse' should be correct.\",\r\n hasProjectRoleTermsOfUse(connection, projectId, resourceRoleId, termsOfUseId, groupIndex));\r\n }", "int deleteByExample(GroupRoleUserRelExample example);", "void deleteExpense(Expense target) throws NoUserSelectedException;", "public void testDeleteByMenuId() {\n\t\tboolean settings = dao.deleteByMenuId(999);\r\n\t\tassertTrue(settings);\r\n\r\n\t\t// Try with an existing settings\r\n\t\tsettings = dao.deleteByMenuId(Menu.MENUID_PERSONAL);\r\n\t\tassertTrue(settings);\r\n\t\t\r\n\t\t// Verify that the search document has been deleted\r\n\t\tSearchDocument sdocument = dao.findByMenuId(Menu.MENUID_PERSONAL);\r\n\t\tassertNull(sdocument);\r\n\t}", "@Override\n\tpublic void deleteUserRole(UserDto userDto, RoleDto role) {\n\t\t\n\t}", "@Secured( { \"ROLE_ADMIN\",\"ROLE_PUBLISH\",\"ROLE_WRITE\" })\n\tpublic void delete (Credit credit);", "public void eliminar(Producto producto) throws BusinessErrorHelper;", "@Override\r\n\tpublic int deletePurchase(PurchaseVo vo) {\n\t\treturn 0;\r\n\t}", "int deleteByExample(UserRoleExample example);", "int deleteByExample(UserRoleExample example);", "public Integer deletePaymentType(PaymentTypeObject paymentTypeObject) throws AppException;", "public int deleteByPK(Long pk){\n \tif(pk==null)\n \t\treturn 0;\n\t\tint rows = super.delete(\"Rolesvalue.deleteByPK\", pk);\n\t\treturn rows;\n }", "int deleteByExample(BsUserRoleExample example);", "@Test\n\tpublic void deleteByAdministratorTest() throws ParseException {\n\t\t\n\t\tSystem.out.println(\"-----Delete announcement by administrator test. Positive 0 to 1, Negative 2 to 4.\");\n\t\t\n\t\tObject testingData[][]= {\n\t\t\t\t//Positive cases\n\t\t\t\t{\"announcement1-1\", \"admin\", null},\n\t\t\t\t{\"announcement1-2\", \"admin\", null},\n\t\t\t\t\n\t\t\t\t//Negative cases\n\t\t\t\t//Without announcement\n\t\t\t\t{null, \"admin\", NullPointerException.class},\n\t\t\t\t//Without user\n\t\t\t\t{\"announcement2-1\", null, IllegalArgumentException.class},\n\t\t\t\t//With not admin\n\t\t\t\t{\"announcement2-1\", \"user1\", IllegalArgumentException.class}\n\t\t\t\t};\n\t\t\n\t\t\n\t\tfor (int i = 0; i< testingData.length; i++) {\n\t\t\ttemplateDeleteByAdministratorTest(\n\t\t\t\t\ti,\n\t\t\t\t\t(Integer) this.getEntityIdNullable((String) testingData[i][0]),\n\t\t\t\t\t(String) testingData[i][1],\n\t\t\t\t\t(Class<?>) testingData[i][2]\n\t\t\t\t\t);\n\t\t}\n\t}", "@RequestMapping(path = \"/sigQuotaLocalite/delete/{codesigQuotaLocalite}\", method = RequestMethod.GET)\n public String deleteSigQuotaLocalite(Model model,@PathVariable(name = \"codesigQuotaLocalite\") String codesigQuotaLocalite) { \n User user = (User)SecurityContextHolder.getContext().getAuthentication().getPrincipal();\n model.addAttribute(\"user\", user);\n sigQuotaLocaliteService.delete(codesigQuotaLocalite);\n\n return \"redirect:/admin/sigQuotaLocalite\";\n\t\t\n }", "@PreAuthorize(\"hasRole('ROLE_ROOT')\")\n\tpublic void deleteFileUploads();", "@Test\n\tpublic void test04_05_DeleteADisabledUserByAdministrator() {\n\t\tinfo(\"Test 4: Delete a disabled user by administrator\");\n\t\tString name=txData.getContentByArrayTypeRandom(1)+getRandomNumber();\n\t\tcreateNewUser();\n\t\tdisableUser();\n\t\t/*Step Number: 1\n\t\t*Step Name: Step 1: Open User Management\n\t\t*Step Description: \n\t\t\t- Log in as admin.\n\t\t\t- Go to Administration \n\t\t\t-\n\t\t\t-> Community \n\t\t\t-\n\t\t\t-> Manage Community.\n\t\t\t- Choose the tab \"User Management\".\n\t\t*Input Data: \n\t\t\t\n\t\t*Expected Outcome: \n\t\t\t- The list of users is displayed: enabled and disabled\n\t\t\t- The column \"Action\" is displayed with 2 icons: Edit and Delete.*/\n\t\tuserAndGroup.goToEditUserInfo(username);\n\t\tuserAndGroup.editUserInfo_AccountTab(\"\", \"\",name, \"\");\n\t\t\n\t\t/*Step number: 2\n\t\t*Step Name: Step 2: Delete a disabled user\n\t\t*Step Description: \n\t\t\t- From a Disabled user, click on the icon \"Delete\".\n\t\t*Input Data: \n\t\t\t\n\t\t*Expected Outcome: \n\t\t\t- The disabled user is removed from the list*/ \n\t\tuserAndGroup.deleteUser(username);\n\t}", "public interface SysRoleRepository extends WiselyRepository<SysRole,Long> , PagingAndSortingRepository<SysRole,Long>, JpaRepository<SysRole,Long> {\r\n\r\n public SysRole findByName(String name);\r\n\r\n @Query(value = \"select role_permission from sys_role where id in (:roleId)\",nativeQuery = true)\r\n public List<String> findRolePermisssionbyid(@Param(\"roleId\") List<Long> id );\r\n\r\n @Query(value = \"select * from sys_role where id in (:roleId)\",nativeQuery = true)\r\n public List<SysRole> findRoleById(@Param(\"roleId\") List<Long> id );\r\n\r\n @Modifying\r\n @Transactional\r\n @Query(value = \"delete from sys_user_roles where roles_id = ?\",nativeQuery = true)\r\n public Integer deleteUserRole(Long roleId);\r\n\r\n}", "public void deleteStudent(Student student) {\n\t\t\r\n\t}", "@DeleteProvider(type=ActionsAccountsSqlProvider.class, method=\"deleteByExample\")\n int deleteByExample(ActionsAccountsExample example);", "void deleteAveria(Long idAveria) throws BusinessException;" ]
[ "0.6801549", "0.6075102", "0.59524894", "0.59497076", "0.5823419", "0.5742642", "0.5665595", "0.5614002", "0.56070775", "0.56009436", "0.5571148", "0.5555926", "0.55162704", "0.5480341", "0.54796666", "0.54475224", "0.5442224", "0.54231936", "0.54119974", "0.54106385", "0.5403197", "0.5374923", "0.53733224", "0.53716695", "0.5370976", "0.53616524", "0.53595924", "0.5358854", "0.53535545", "0.53431743", "0.53380334", "0.5335799", "0.53338236", "0.5305208", "0.5305011", "0.5303012", "0.5298078", "0.5297078", "0.5282046", "0.52773196", "0.526552", "0.5264252", "0.52585214", "0.52323675", "0.5221787", "0.52216226", "0.5219664", "0.52101576", "0.5195471", "0.51918", "0.5191445", "0.5190437", "0.51891375", "0.51888454", "0.51703775", "0.51678014", "0.5163694", "0.514929", "0.5141114", "0.5129416", "0.51249003", "0.5123004", "0.512292", "0.51208365", "0.5111235", "0.51111794", "0.5106845", "0.5103961", "0.5100481", "0.50978553", "0.5096832", "0.5088527", "0.50796103", "0.50779045", "0.5077621", "0.50750077", "0.5072691", "0.5067725", "0.5065248", "0.50614285", "0.50602597", "0.50595814", "0.50579125", "0.5052798", "0.5051173", "0.5040559", "0.50392365", "0.50328845", "0.50328845", "0.5024774", "0.5019798", "0.501836", "0.5013469", "0.5003647", "0.50016695", "0.49999073", "0.49989492", "0.4988783", "0.49785045", "0.49774295" ]
0.53351074
32
Get a single sale Permissions Needed: SALES_USER or SALES_ADMIN
@Test public void getCatalogSaleTest() { Integer id = null; // CatalogSale response = api.getCatalogSale(id); // TODO: test validations }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<SecRight> getAllRights(int type);", "public int getSale() {\n\t\treturn sale;\r\n\t}", "public int getPermission(Integer resourceId);", "int getPermissionRead();", "String getPermission();", "public List<Permission> getPermissions(User user) throws UserManagementException;", "int getPremiumSmsPermission(String packageName);", "public int getAccessLevel() {\n return 0;\r\n }", "abstract public void getPermission();", "public IGrantSet getPermissions()\n throws OculusException;", "public org.tempuri.GetUserAccessRightResponseGetUserAccessRightResult getUserAccessRight(java.lang.String msg, java.lang.String systemCode, java.lang.String companyCode) throws java.rmi.RemoteException;", "@NonNull\n Set<String> getGrantedPermissions(@NonNull String packageName, @UserIdInt int userId);", "public static String getSells() {\n if(DatabaseMethods.sales_analaysis()){\r\n return DatabaseMethods.get_total_sales();\r\n }\r\n else{\r\n return null; \r\n }\r\n \r\n\t}", "public String getRights() {\n/* 287 */ return getRights((String)null);\n/* */ }", "public Permission getPermission(String objectId, User user, Boolean pending) throws UserManagementException;", "public List<String> getPermission(int userId, String crp);", "SalesInvoicesType getSalesInvoices();", "public String getLoyaltyType() {\n if (compositePOSTransaction.getLoyaltyCard() != null\n && compositePOSTransaction.getLoyaltyCard().getStoreType() != null)\n return res.getString(compositePOSTransaction.getLoyaltyCard().getStoreType());\n else\n return null;\n }", "@Test\n public void testSysPer(){\n List<SysPermission> permissions = sysPermissionService.findByUserId(9L);\n System.out.println(\"permissions:\" + permissions.size());\n }", "public PermissionHandler getHandler() {\r\n return Permissions.Security;\r\n }", "@Test\n\tpublic void testGetPermissions_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\n\t\tSet<Permission> result = fixture.getPermissions();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "com.google.ads.googleads.v6.resources.CustomerUserAccess getCustomerUserAccess();", "com.cantor.drop.aggregator.model.CFTrade.SecurityIdType getSecIdType();", "public List<String> grantpermission() {\n\t\tList<Integer> userids = new ArrayList<>();\n\t\tuserids = crud1.grantPermission();\n\t\tList<String> username = new ArrayList<>();\n\t\tfor (Integer x : userids) {\n\n\t\t\tusername.add(crud1.findById(x).get().getUsername());\n\t\t}\n\t\treturn username;\n\t}", "@Test\n\tpublic void testGetPermissions_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\n\t\tSet<Permission> result = fixture.getPermissions();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "@Override\n protected String requiredGetPermission() {\n return \"user\";\n }", "public org.tempuri.GetUserAccessRightWithUserDetailsResponseGetUserAccessRightWithUserDetailsResult getUserAccessRightWithUserDetails(java.lang.String msg, java.lang.String systemCode, java.lang.String companyCode) throws java.rmi.RemoteException;", "public boolean hasReadAccessRight(String srname)\n {\n DataSource dataSource =null;\n\t\tboolean found=false;\n\n if(groupListHasReadAccessRight(srname)==true)\n {\n found=true; \n }\n else\n {\n found = DataSourceListHasReadAccessRight(srname);\n }\n\n\t\treturn found || ! DataSource.isVSManaged(srname);\n\t}", "public Permissions[] getPermissionsNeeded(ContainerRequestContext context) throws Exception {\n Secured auth = resourceInfo.getResourceMethod().getAnnotation(Secured.class);\n\n // If there's no authentication required on method level, check class level.\n if (auth == null) {\n auth = resourceInfo.getResourceClass().getAnnotation(Secured.class);\n }\n\n // Else, there's no permission required, thus we chan continue;\n if (auth == null) {\n log.log(Level.INFO, \"AUTHENTICATION: Method: \" + context.getMethod() + \", no permission required\");\n return new Permissions[0];\n }\n\n return auth.value();\n }", "@Test\n public void testGetPermissionsRole() throws Exception\n {\n permission = permissionManager.getPermissionInstance(\"GREET_PEOPLE\");\n permissionManager.addPermission(permission);\n Permission permission2 = permissionManager.getPermissionInstance(\"ADMINISTER_DRUGS\");\n permissionManager.addPermission(permission2);\n Role role = securityService.getRoleManager().getRoleInstance(\"VET_TECH\");\n securityService.getRoleManager().addRole(role);\n ((DynamicModelManager) securityService.getModelManager()).grant(role, permission);\n PermissionSet permissions = ((DynamicRole) role).getPermissions();\n assertEquals(1, permissions.size());\n assertTrue(permissions.contains(permission));\n assertFalse(permissions.contains(permission2));\n }", "public String getRights(String lang) {\n/* 296 */ return getLangAlt(lang, \"rights\");\n/* */ }", "int getPremiumSmsPermissionForSubscriber(int subId, String packageName);", "public List<RightInfoDTO> findUserRights(String userNo) throws DataAccessException;", "public String getRights() {\r\n return rights;\r\n }", "Object getPerm(String name, Object def);", "public Sale getSaleAt(int position) {\n return sales.get(position);\n }", "public java.util.List<org.eclipse.stardust.engine.api.runtime.Permission>\n getPermissions()\n throws org.eclipse.stardust.common.error.WorkflowException;", "public List getSysRoles(SysRole sysRole);", "public abstract OwUIAccessRightsModul getEditAccessRightsSubModul(OwObject object_p) throws Exception;", "List<BillingPermissionsProperties> permissions();", "public int getSalesRep_ID();", "public int getSalesRep_ID();", "public int getCountAllSecRoles();", "Object getPerm(String name);", "public interface ISysRoleService {\n Set<String> selectRolePermissionByUserId(Long userId);\n}", "@Override\n\tpublic List<UserRole> buscarUserRoleSemPermissoes() {\n\t\t// TODO Auto-generated method stub\n\t\tQuery query = getCurrentSession().createQuery(\"select ur from UserRole ur where ur.permissions\");\n\t\treturn query.list();\n\t}", "@Override\n\tpublic List<Permission> fetchMenuPermissionByOrganisation(\n\t\t\tOrganisation organisation, String val) {\n\t\treturn this.permissionDao.fetchMenuPermissionByOrganisation(organisation, val);\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic Security getByUserName(Security login) {\n\t\tSecurity security = null;\n\t\t\n\t\tCriteria crit = getSession().createCriteria(getPersistentClass());\n\t\tcrit.setFetchMode(\"contact\", FetchMode.JOIN);\n\t\tcrit.setFetchMode(\"contact.employees\", FetchMode.JOIN);\n\t\tcrit.setFetchMode(\"contact.employees.resourceprofiles\", FetchMode.JOIN);\n\t\tcrit.add(Restrictions.eq(\"login\", login.getLogin()));\n\t\tList<Security> list = crit.list();\n\t\t\n\t\tif (list != null && !list.isEmpty()) {\n\t\t\tsecurity = list.get(0);\n\t\t}\n\t\t\n\t\treturn security;\n\t}", "protected UserServicePermission getPermissionOverride(\n\t\t\tServicePermissionRuleContext<S> context)\n\t\t{\n\t\t\tif (context.getSession().isUserInRole(CommonConstants.TECH_ADMIN))\n\t\t\t{\n\t\t\t\treturn UserServicePermission.getEnabled();\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic Security getByLogin (Security login) {\n\t\tSecurity security = null;\n\t\t\n\t\tCriteria crit = getSession().createCriteria(getPersistentClass());\n\t\tcrit.setFetchMode(\"contact\", FetchMode.JOIN);\n\t\tcrit.setFetchMode(\"contact.employees\", FetchMode.JOIN);\n\t\tcrit.setFetchMode(\"contact.employees.resourceprofiles\", FetchMode.JOIN);\n\t\tcrit.add(Restrictions.eq(\"login\", login.getLogin()));\n\t\tList<Security> list = crit.list();\n\t\t\n\t\tif (list != null && !list.isEmpty()) {\n\t\t\tsecurity = list.get(0);\n\t\t}\n\t\t\n\t\treturn security;\n\t}", "public FacebookPermissionsE permission(){\n\t\treturn this.permission;\n\t}", "java.lang.String getPermissions(int index);", "boolean isHasPermissions();", "@Override\n public Role getRole(InheritedAccessEnabled access) {\n Preference preference = (Preference) access;\n if (preference.getVisibleAtRole() == null) {\n return null;\n }\n String roleId = preference.getVisibleAtRole().getId();\n return OBDal.getInstance().get(Role.class, roleId);\n }", "@Override\n public JSONObject viewSLCustomersByAdmin() {\n\n return in_salescustdao.viewSLCustomerByAdmin();\n }", "String getRole();", "String getRole();", "@SuppressWarnings(\"unused\")\n\tprivate VistaPermisosRolesWrapper getOpcionesPorRol(Rol rol) {\n\t\treturn null;\n\t}", "@Override\r\n public int getsaleId() {\n return this.saleId;\r\n }", "public List<Permission> getUserPermission() {\n\t\treturn securityContext.getAuthorizationContext().getPermissions();\n\t}", "@RequiresApi(api = Build.VERSION_CODES.M)\n public void getNecessaryPermissions() {\n final String TAG_getNecessaryPermissions = \" getNecessartPermissions(): \";\n Log.d(TAG, TAG_getNecessaryPermissions + \" called\");\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_SMS) != PackageManager.PERMISSION_GRANTED) {\n //if permission is not granted then show an education UI to give reason to user\n if (shouldShowRequestPermissionRationale(Manifest.permission.READ_SMS)) {\n Toast.makeText(this, \"Please allow permission!\", Toast.LENGTH_SHORT).show();\n }\n //and then let the system request permission from user for your app.\n //results in callback to onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)\n requestPermissions(new String[]{Manifest.permission.READ_SMS, Manifest.permission.READ_CONTACTS}, REQUESTCODEFORPERMISSIONS_READSMS_READCONTACTS_ENDOFPERMISSIONS);\n }\n }", "boolean hasCustomerUserAccess();", "public AccessRights getAccessRights() {\r\n\t\treturn accessRights;\r\n\t}", "Permission selectByPrimaryKey(String id);", "public String getOverseasRoyalty() {\n return (String)getAttributeInternal(OVERSEASROYALTY);\n }", "public boolean SimpleSecurity (SecurityLevel subLevel, SecurityLevel objLevel) {\n\t\tif(SecurityLevel.dominates(subLevel,objLevel,Type.READ)) {\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private Security getSecurityFromCursor(Cursor cursor){\n String getCNames[] = cursor.getColumnNames();\n Log.d(\"readAllSecurity\", \"Getting Column names:\" );\n for (String s : getCNames)\n {\n Log.d(\"readAllSecurity\", s);\n }\n Log.d(\"readAllSecurity\", \"Done!\" );\n Log.d(\"readAllSecurity\", \"ID-a:\" );\n Log.d(\"readAllSecurity\",Integer.toString(cursor.getColumnIndex(SECURITY_ID)));\n Log.d(\"readAllSecurity\", \"ID-b:\" );\n int id = cursor.getInt(cursor.getColumnIndex(SECURITY_ID));\n Log.d(\"readAllSecurity\", Integer.toString(id) );\n\n Log.d(\"readAllSecurity\", \"ID-c:\" );\n int id3 = cursor.getInt(cursor.getColumnIndex(SECURITY_ID));\n Log.d(\"readAllSecurity\", Integer.toString(id3) );\n\n\n String wanted = cursor.getString(cursor.getColumnIndex(SECURITY_WANTED_STATUS));\n String wantedDate = cursor.getString(cursor.getColumnIndex(SECURITY_DATE_OF_BEING_WANTED));\n String acquitted = cursor.getString(cursor.getColumnIndex(SECURITY_DATE_OF_BEING_ACQUITTED));\n String close_investigationDate = cursor.getString(cursor.getColumnIndex(SECURITY_DATE_OF_CLOSE_OF_INVESTIGATION));\n String crimeName = cursor.getString(cursor.getColumnIndex(SECURITY_NAME_OF_CRIME_CONVICTED_ON));\n String num_registerdOffences = cursor.getString(cursor.getColumnIndex(SECURITY_NUMBER_OF_REGISTERED_OFFENCES));\n String listOfCrimes = cursor.getString(cursor.getColumnIndex(SECURITY_LIST_OF_CRIMES));\n String dateOfArrest = cursor.getString(cursor.getColumnIndex(SECURITY_DATE_OF_LAST_ARREST));\n\n return new Security(id,wanted, wantedDate, acquitted, close_investigationDate, crimeName, num_registerdOffences, listOfCrimes, dateOfArrest);\n }", "public String getPermission()\r\n {\r\n return permission;\r\n }", "int getPermissionWrite();", "public List<SysObjRights> getHashRights(String objType)\n\t{\n\t\t\n\t\treturn null;\n\t}", "public int getUserNumber() throws AdminPersistenceException {\n return getCount(\"ST_User\", \"id\", \"accessLevel <> ?\", \"R\");\n }", "public abstract List<String> getAdditionalAccessions();", "@SuppressWarnings(\"unchecked\")\n\tpublic Security getByEmployee (Employee employee) {\n\t\tSecurity security = null;\n\t\t\n\t\tCriteria crit = getSession().createCriteria(getPersistentClass());\n\t\t\n\t\tcrit.createCriteria(Security.CONTACT)\n\t\t\t.createCriteria(Contact.EMPLOYEES)\n\t\t\t.add(Restrictions.eq(Employee.IDEMPLOYEE, employee.getIdEmployee()));\n\t\t\n\t\tList<Security> list = crit.list();\n\t\t\n\t\tif (list != null && !list.isEmpty()) {\n\t\t\tsecurity = list.get(0);\n\t\t}\n\t\t\n\t\treturn security;\n\t}", "public Permission[] getPermissionsField() {\n\treturn super.getPermissions(null);\n }", "public Properties getPermissionsReport() {\n /* TO DO: */\n return null;\n }", "public Integer getPermissionTypeId() {\n return permissionTypeId;\n }", "public boolean isAccessGranted() {\n try {\n PackageManager packageManager = getPackageManager();\n ApplicationInfo applicationInfo = packageManager.getApplicationInfo(getPackageName(), 0);\n AppOpsManager appOpsManager = (AppOpsManager) getSystemService(Context.APP_OPS_SERVICE);\n int mode;\n assert appOpsManager != null;\n mode = appOpsManager.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS,\n applicationInfo.uid, applicationInfo.packageName);\n return (mode == AppOpsManager.MODE_ALLOWED);\n\n } catch (PackageManager.NameNotFoundException e) {\n return false;\n }\n }", "Permission selectByPrimaryKey(Integer id);", "public ResourceInformation.Permissions getEffectivePermissions() {\n\t\tif (effectivePermissions == null)\n\t\t\tfetchInfo();\n\t\treturn effectivePermissions;\n\t}", "public String getAccess();", "private void fetchPermissionsFromUser() {\n Log.d(TAG, \"in fetch permisssion s\");\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"in fetch permisssion s ACCESS_COARSE_LOCATION\");\n // Should we show an explanation?\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.READ_CONTACTS)) {\n\n // Show an expanation 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 Log.d(TAG, \"in fetch permisssion s ACCESS_COARSE_LOCATION show request\");\n\n } else {\n\n // No explanation needed, we can request the permission.\n Log.d(TAG, \"in fetch permisssion s ACCESS_COARSE_LOCATION with return request\");\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},\n MY_PERMISSIONS_REQUEST_ACCESS_COARSE_LOCATION);\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 }\n\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"in fetch permisssion s ACCESS_FINE_LOCATION\");\n // Should we show an explanation?\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.ACCESS_FINE_LOCATION)) {\n Log.d(TAG, \"in fetch permisssion s ACCESS_FINE_LOCATION erequest\");\n // Show an expanation 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\n } else {\n\n // No explanation needed, we can request the permission.\n Log.d(TAG, \"in fetch permisssion s ACCESS_FINE_LOCATION with return requet\");\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\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 }\n\n\n }", "public Sale find_Sale(Integer sale_id, Integer branch_id) {\n return sale_dao.find(sale_id, branch_id);\n }", "@GetMapping(\"/sale\")\n public ResultEntity<List<ItemDTO>> getAllSale()\n {\n return itemService.getItemsBySubCategory(ConstantUtil.TYPE_SALE_RENT,\"Sale\");\n }", "public boolean accesspermission()\n {\n AppOpsManager appOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);\n int mode = 0;\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {\n mode = appOps.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS,\n Process.myUid(),context.getPackageName());\n }\n if (mode == AppOpsManager.MODE_ALLOWED) {\n\n return true;\n }\n return false;\n\n }", "public List<Permission> getPermissionsPending(User user) throws UserManagementException;", "public List<String> getUserPermissions(String login) throws IOException;", "public static LearningObjectInstancePermissions getPermissions(HttpServletRequest request)\n {\n return (LearningObjectInstancePermissions) request.getSession().getAttribute(getSessionKey(request, Constants.SessionKeys.Permissions));\n }", "Loan getLoanById(String clientCode, String loanId);", "public List getSysUserTypes(SysUserType sysUserType);", "@Override\n public boolean hasAccessPermission(String user, NamespaceKey key, DatasetConfig datasetConfig) {\n return userPredicate.test(user);\n }", "public String getSaleConsultantCode() {\n\t\treturn saleConsultantCode;\n\t}", "public Permission getPermission() {\n return permission;\n }", "Set<Right> getRightsFor(User user, Pad pad);", "public String getDigitalRoyalty() {\n return (String)getAttributeInternal(DIGITALROYALTY);\n }", "public int getSalesPurchase() {\n return salesPurchase;\n }", "public String getSaleConsultantName() {\n\t\treturn saleConsultantName;\n\t}", "@RequestMapping(value = \"/getPermissionForUserMenu\", method = RequestMethod.GET)\n\tpublic ResponseEntity<?> getPermissionForUserMenu() throws JsonParseException, JsonMappingException, IOException {\n\t\tMap<String, Object> result = permissionAuthorize.getPermissionForUserMenu(SecurityUtil.getIdUser());\n\t\t// return.\n\t\treturn new ResponseEntity<Map<String, Object>>(result, HttpStatus.OK);\n\t}", "@PreAuthorize(\"checkPermission('Legal Entity', 'Manage Legal Entities', {'view','create'})\")\n @GetMapping(\n produces = {\"application/json\"})\n @ResponseStatus(HttpStatus.OK)\n public void sampleEndpointThatRequiresUserToHavePermissionsToViewCreateLegalEnitites() {\n LOGGER.info(\"Preauthorize annotation have checked that user has permissions to view/create legal entities\");\n // continue custom implementation ...\n }", "@Override\n\tpublic long getPermissionTypeId() {\n\t\treturn _permissionType.getPermissionTypeId();\n\t}", "List<Permission> getPermissions();", "public AccessLevel getAccessLevel(){\n return this.accessLevel;\n }" ]
[ "0.5425804", "0.5300734", "0.51998556", "0.5186482", "0.51217896", "0.51054037", "0.5051343", "0.5028513", "0.5003312", "0.49326438", "0.4916547", "0.49154103", "0.49040258", "0.4894703", "0.48825517", "0.48765105", "0.48735276", "0.48534754", "0.4850936", "0.48050347", "0.47976083", "0.4796592", "0.47946718", "0.4782239", "0.47800556", "0.47762582", "0.4775716", "0.47532135", "0.47498846", "0.4747041", "0.4739998", "0.47325513", "0.4729728", "0.47296587", "0.47235215", "0.4706505", "0.47041968", "0.47002903", "0.46945706", "0.46797043", "0.46779338", "0.46779338", "0.4673064", "0.46535787", "0.46512818", "0.46497664", "0.4646687", "0.46463847", "0.46334946", "0.46301365", "0.46270975", "0.4626033", "0.4604264", "0.45959723", "0.45802298", "0.45733348", "0.45733348", "0.45696697", "0.45653877", "0.4560154", "0.4556641", "0.45505574", "0.45449683", "0.45429027", "0.4541907", "0.45415047", "0.45394763", "0.4536275", "0.45359755", "0.45339847", "0.45322838", "0.45310658", "0.45283136", "0.45274433", "0.45218503", "0.45216075", "0.45197985", "0.45194304", "0.4516456", "0.4515232", "0.45122576", "0.4507664", "0.45075545", "0.45051846", "0.4502392", "0.44933397", "0.44898093", "0.44875008", "0.4479081", "0.4470665", "0.44683197", "0.44668478", "0.44659966", "0.44613916", "0.44602823", "0.4456551", "0.4456029", "0.44520485", "0.44517928", "0.44498405", "0.44481248" ]
0.0
-1
List and search sales Permissions Needed: SALES_USER or SALES_ADMIN
@Test public void getCatalogSalesTest() { Integer size = null; Integer page = null; String order = null; // PageResourceCatalogSale response = api.getCatalogSales(size, page, order); // TODO: test validations }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<SecRight> getAllRights(int type);", "public int getCountAllSecRoles();", "public List<RightInfoDTO> findUserRights(String userNo) throws DataAccessException;", "public List getSysRoles(SysRole sysRole);", "boolean allGranted(String roles);", "@Test\n public void testSysPer(){\n List<SysPermission> permissions = sysPermissionService.findByUserId(9L);\n System.out.println(\"permissions:\" + permissions.size());\n }", "public List<Permission> getPermissions(User user) throws UserManagementException;", "@Test\n\tvoid findAllAllFiltersAllRights() {\n\n\t\tfinal TableItem<UserOrgVo> tableItem = resource.findAll(\"ing\", \"dig rha\", \"iRsT\", newUriInfoAsc(\"id\"));\n\t\tAssertions.assertEquals(2, tableItem.getRecordsTotal());\n\t\tAssertions.assertEquals(2, tableItem.getRecordsFiltered());\n\n\t\t// Check the users\n\t\tfinal UserOrgVo user = tableItem.getData().get(0);\n\t\tAssertions.assertEquals(\"fdoe2\", user.getId());\n\t\tAssertions.assertEquals(\"jdoe5\", tableItem.getData().get(1).getId());\n\n\t\t// Check the other attributes\n\t\tAssertions.assertEquals(\"ing\", user.getCompany());\n\t\tAssertions.assertEquals(\"First2\", user.getFirstName());\n\t\tAssertions.assertEquals(\"Doe2\", user.getLastName());\n\t\tAssertions.assertEquals(\"[email protected]\", user.getMails().get(0));\n\t\tAssertions.assertTrue(user.isCanWrite());\n\t\tfinal List<GroupVo> groups = new ArrayList<>(user.getGroups());\n\t\tAssertions.assertEquals(2, groups.size());\n\t\tAssertions.assertEquals(\"Biz Agency\", groups.get(0).getName());\n\t\tAssertions.assertEquals(\"DIG RHA\", groups.get(1).getName());\n\t}", "@Override\n public JSONObject viewSLCustomersByAdmin() {\n\n return in_salescustdao.viewSLCustomerByAdmin();\n }", "@Override\n\tpublic List<UserRole> buscarUserRoleSemPermissoes() {\n\t\t// TODO Auto-generated method stub\n\t\tQuery query = getCurrentSession().createQuery(\"select ur from UserRole ur where ur.permissions\");\n\t\treturn query.list();\n\t}", "List<UserRole> searchUserRole(UserRole userRole);", "public List<SecGroupright> getAllGroupRights();", "@PostFilter(\"hasRole('ADMINISTRATOR') OR \"\r\n \t\t\t+ \"(hasRole('EMPLOYEE') AND \"\r\n \t\t\t+ \"(filterObject.type.typeLabel == 'CUSTOMERLEGAL' OR \"\r\n \t\t\t+ \"filterObject.type.typeLabel == 'CUSTOMERINDIVIDUAL')) OR \"\r\n \t\t\t+ \"((hasRole('CUSTOMERLEGAL') OR hasRole('CUSTOMERINDIVIDUAL')) AND \"\r\n \t\t\t+ \"(filterObject.username == principal.username)) OR \"\r\n \t\t\t+ \"(hasRole('REVISIONER') AND filterObject.type.typeLabel == 'REVISIONER')\")\r\n \tpublic List<SystemUserDTO> getSystemUsersByTypeList(List<UserTypeEnumDTO> types);", "public List<SsoAuthDO> queryByRoleName(String roleName) throws DataAccessException;", "@Test\n\tvoid findAllForMyCompanyFilter() {\n\t\tinitSpringSecurityContext(\"assist\");\n\n\t\tfinal TableItem<UserOrgVo> tableItem = resource.findAll(\"ing\", null, null, newUriInfoAsc(\"id\"));\n\t\tAssertions.assertEquals(8, tableItem.getRecordsTotal());\n\t\tAssertions.assertEquals(8, tableItem.getRecordsFiltered());\n\t\tAssertions.assertEquals(8, tableItem.getData().size());\n\n\t\t// Check the users\n\t\tAssertions.assertEquals(\"fdoe2\", tableItem.getData().get(0).getId());\n\t\tAssertions.assertTrue(tableItem.getData().get(0).isCanWrite());\n\n\t\t// Check the groups\n\t\tAssertions.assertEquals(0, tableItem.getData().get(0).getGroups().size());\n\t}", "List<BillingPermissionsProperties> permissions();", "public List getSysUserTypes(SysUserType sysUserType);", "@Test\n\tvoid findAllForMyCompany() {\n\t\tinitSpringSecurityContext(\"assist\");\n\t\tfinal TableItem<UserOrgVo> tableItem = resource.findAll(null, null, null, newUriInfoAsc(\"id\"));\n\t\tAssertions.assertEquals(9, tableItem.getRecordsTotal());\n\t\tAssertions.assertEquals(9, tableItem.getRecordsFiltered());\n\t\tAssertions.assertEquals(9, tableItem.getData().size());\n\n\t\t// Check the users\n\t\tAssertions.assertEquals(\"fdoe2\", tableItem.getData().get(0).getId());\n\t\tAssertions.assertTrue(tableItem.getData().get(0).isCanWrite());\n\n\t\t// Check the groups\n\t\tAssertions.assertEquals(0, tableItem.getData().get(0).getGroups().size());\n\t}", "@GetMapping(\"/sale\")\n public ResultEntity<List<ItemDTO>> getAllSale()\n {\n return itemService.getItemsBySubCategory(ConstantUtil.TYPE_SALE_RENT,\"Sale\");\n }", "java.util.List<java.lang.String>\n getPermissionsList();", "private String getUserRoleListQuery() throws APIManagementException {\n StringBuilder rolesQuery = new StringBuilder();\n rolesQuery.append('(');\n rolesQuery.append(APIConstants.NULL_USER_ROLE_LIST);\n String[] userRoles = APIUtil.getListOfRoles(userNameWithoutChange);\n String skipRolesByRegex = APIUtil.getSkipRolesByRegex();\n if (StringUtils.isNotEmpty(skipRolesByRegex)) {\n List<String> filteredUserRoles = new ArrayList<>(Arrays.asList(userRoles));\n String[] regexList = skipRolesByRegex.split(\",\");\n for (int i = 0; i < regexList.length; i++) {\n Pattern p = Pattern.compile(regexList[i]);\n Iterator<String> itr = filteredUserRoles.iterator();\n while(itr.hasNext()) {\n String role = itr.next();\n Matcher m = p.matcher(role);\n if (m.matches()) {\n itr.remove();\n }\n }\n }\n userRoles = filteredUserRoles.toArray(new String[0]);\n }\n if (userRoles != null) {\n for (String userRole : userRoles) {\n rolesQuery.append(\" OR \");\n rolesQuery.append(ClientUtils.escapeQueryChars(APIUtil.sanitizeUserRole(userRole.toLowerCase())));\n }\n }\n rolesQuery.append(\")\");\n if(log.isDebugEnabled()) {\n \tlog.debug(\"User role list solr query \" + APIConstants.PUBLISHER_ROLES + \"=\" + rolesQuery.toString());\n }\n return APIConstants.PUBLISHER_ROLES + \"=\" + rolesQuery.toString();\n }", "public String getRights() {\r\n return rights;\r\n }", "public List<String> grantpermission() {\n\t\tList<Integer> userids = new ArrayList<>();\n\t\tuserids = crud1.grantPermission();\n\t\tList<String> username = new ArrayList<>();\n\t\tfor (Integer x : userids) {\n\n\t\t\tusername.add(crud1.findById(x).get().getUsername());\n\t\t}\n\t\treturn username;\n\t}", "public interface ISysRoleService {\n Set<String> selectRolePermissionByUserId(Long userId);\n}", "SalesInvoicesType getSalesInvoices();", "public List<String> getUserPermissions(String login) throws IOException;", "public final void getSaleDocList() {\n showLoadingIndicator(true);\n SaleDocListViewModel saleDocListViewModel = this.viewModel;\n if (saleDocListViewModel == null) {\n Intrinsics.throwUninitializedPropertyAccessException(\"viewModel\");\n }\n String authString = getAuthString();\n String deviceId = AppUtils.getDeviceId(this);\n Intrinsics.checkExpressionValueIsNotNull(deviceId, \"AppUtils.getDeviceId(this)\");\n saleDocListViewModel.getSaleDocList(authString, deviceId, \"android\", String.valueOf(BuildConfig.VERSION_CODE), getRequestBody());\n }", "List<ObjectType> getObjectTypes() throws AccessDeniedException;", "public List<String> getAuthorizedSeriesSecurityGroups() {\n return getAuthorizedSeriesSecurityGroups(RoleType.READ);\n }", "public abstract List<String> getAdditionalAccessions();", "boolean anyGranted(String roles);", "@Test\n\tvoid findAllNoRight() {\n\t\tinitSpringSecurityContext(\"any\");\n\n\t\tfinal TableItem<UserOrgVo> tableItem = resource.findAll(null, null, null, newUriInfoAsc(\"id\"));\n\t\tAssertions.assertEquals(0, tableItem.getRecordsTotal());\n\t\tAssertions.assertEquals(0, tableItem.getRecordsFiltered());\n\t\tAssertions.assertEquals(0, tableItem.getData().size());\n\t}", "@Override\n\tpublic List<Function> findMenu() {\n\t\tUser user = BosContext.getLoginUser();\n\t\tif(user.getUsername().equals(\"admin\")){\n\t\t\treturn functionDao.findAllMenu();\n\t\t}else{\n\t\t\treturn functionDao.findMenuByUserId(user.getId());\n\t\t}\n\t\t\n\t}", "@Test\n\tpublic void testGetPermissions_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\n\t\tSet<Permission> result = fixture.getPermissions();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "public Vector findAll(String login, Boolean isAdmin) throws Exception {\n \nDebugSupport.printlnTest(\"RegionObject findAll started\");\t\n\tQuery query;\n\n if (!isAdmin.booleanValue()) {\n query = new Query(QUERY_SELECT_View, DataUtil.RESULT_JdbcObjectVector);\n query.append(\"AND o.loiginid=?\", login);\n } else {\n query = new Query(QUERY_SELECT_Admin, DataUtil.RESULT_JdbcObjectVector);\n }\n\n query.append(\"ORDER BY regname\");\n\n Vector vec= findVector(query);\n return vec;\n}", "@Override\n public List<RightsDTO> getAllRights() {\n return transactionHandler.execute((final Factory factory) -> RightsServiceLogic\n .getAllRights(factory.findService(UserRightRepository.class)));\n }", "public List<Yng_Security> findAll() {\n\t\treturn securityDao.findAll();\r\n\t}", "@Override\r\n\tpublic List<SalesDto> queryAllSales() {\n\t\treturn salesMapper.queryAllSales();\r\n\t}", "@ApiModelProperty(value = \"The list of Software Statement roles\")\n\n\n public List<String> getRoles() {\n return roles;\n }", "@Test\n\tvoid findAllNoWrite() {\n\t\tinitSpringSecurityContext(\"mlavoine\");\n\t\tfinal TableItem<UserOrgVo> tableItem = resource.findAll(null, null, \"fdoe2\", newUriInfoAsc(\"id\"));\n\t\tAssertions.assertEquals(1, tableItem.getRecordsTotal());\n\t\tAssertions.assertEquals(1, tableItem.getRecordsFiltered());\n\t\tAssertions.assertEquals(1, tableItem.getData().size());\n\n\t\t// Check the users\n\t\tAssertions.assertEquals(\"fdoe2\", tableItem.getData().get(0).getId());\n\t\tAssertions.assertFalse(tableItem.getData().get(0).isCanWrite());\n\n\t\t// Check the groups\n\t\tAssertions.assertEquals(1, tableItem.getData().get(0).getGroups().size());\n\t\tAssertions.assertEquals(\"Biz Agency\", tableItem.getData().get(0).getGroups().get(0).getName());\n\t\tAssertions.assertFalse(tableItem.getData().get(0).getGroups().get(0).isCanWrite());\n\t}", "public List<String> getPermission(int userId, String crp);", "@Test\n public void testGetPermissionsRole() throws Exception\n {\n permission = permissionManager.getPermissionInstance(\"GREET_PEOPLE\");\n permissionManager.addPermission(permission);\n Permission permission2 = permissionManager.getPermissionInstance(\"ADMINISTER_DRUGS\");\n permissionManager.addPermission(permission2);\n Role role = securityService.getRoleManager().getRoleInstance(\"VET_TECH\");\n securityService.getRoleManager().addRole(role);\n ((DynamicModelManager) securityService.getModelManager()).grant(role, permission);\n PermissionSet permissions = ((DynamicRole) role).getPermissions();\n assertEquals(1, permissions.size());\n assertTrue(permissions.contains(permission));\n assertFalse(permissions.contains(permission2));\n }", "public boolean hasReadAccessRight(String srname)\n {\n DataSource dataSource =null;\n\t\tboolean found=false;\n\n if(groupListHasReadAccessRight(srname)==true)\n {\n found=true; \n }\n else\n {\n found = DataSourceListHasReadAccessRight(srname);\n }\n\n\t\treturn found || ! DataSource.isVSManaged(srname);\n\t}", "List<SysRole> getUserRoles(int userId);", "@Override\n\tpublic List<Permission> fetchMenuPermissionByOrganisation(\n\t\t\tOrganisation organisation, String val) {\n\t\treturn this.permissionDao.fetchMenuPermissionByOrganisation(organisation, val);\n\t}", "private List<UserPermissionBO> getAuthorizedData(String username, String password) throws MalformedURLException {\n URL wsdlUrl = new URL(login_wsUrl);\n QName qname = new QName(\"http://webservice.vps.viettel.com/\", \"AuthorizedDataService\");\n Service service = Service.create(wsdlUrl, qname);\n AuthorizedDataService ads = service.getPort(AuthorizedDataService.class);\n AuthorizedData authorizedData = ads.getAuthorizedData(username, \"CTCT\", password);\n com.viettel.vps.webservice.SysUserBO user = authorizedData.getUser();\n List<UserPermissionBO> businessUserPermissions = authorizedData.getBusinessUserPermissions();\n\n return businessUserPermissions;\n }", "List<Permission> getPermissions();", "public java.util.List<org.eclipse.stardust.engine.api.runtime.Permission>\n getPermissions()\n throws org.eclipse.stardust.common.error.WorkflowException;", "public org.tempuri.GetUserAccessRightResponseGetUserAccessRightResult getUserAccessRight(java.lang.String msg, java.lang.String systemCode, java.lang.String companyCode) throws java.rmi.RemoteException;", "@Path(\"/ListUserPermissions/{userName}\")\n @Produces({\"application/xml\", \"text/xml\", \"application/json\", \"text/yaml\", \"text/x-yaml\", \"application/x-yaml\"})\n @GET\n public ListUserPermissionsResponse listUserPermissions(@PathParam(\"userName\") String userName) {\n \n ListUserPermissionsResponse response = new ListUserPermissionsResponse();\n Connector connection = null;\n AccumuloConnectionFactory.Priority priority = AccumuloConnectionFactory.Priority.ADMIN;\n try {\n Map<String,String> trackingMap = connectionFactory.getTrackingMap(Thread.currentThread().getStackTrace());\n connection = connectionFactory.getConnection(priority, trackingMap);\n \n SecurityOperations ops = connection.securityOperations();\n \n List<datawave.webservice.response.objects.SystemPermission> systemPermissions = new ArrayList<>();\n SystemPermission[] allSystemPerms = SystemPermission.values();\n for (SystemPermission next : allSystemPerms) {\n if (ops.hasSystemPermission(userName, next)) {\n systemPermissions.add(new datawave.webservice.response.objects.SystemPermission(next.name()));\n }\n }\n \n List<datawave.webservice.response.objects.TablePermission> tablePermissions = new ArrayList<>();\n TableOperations tops = connection.tableOperations();\n SortedSet<String> tables = tops.list();\n TablePermission[] allTablePerms = TablePermission.values();\n for (String next : tables) {\n for (TablePermission nextPerm : allTablePerms) {\n if (ops.hasTablePermission(userName, next, nextPerm)) {\n tablePermissions.add(new datawave.webservice.response.objects.TablePermission(next, nextPerm.name()));\n }\n }\n }\n \n List<datawave.webservice.response.objects.NamespacePermission> namespacePermissions = new ArrayList<>();\n NamespaceOperations nops = connection.namespaceOperations();\n SortedSet<String> namespaces = nops.list();\n NamespacePermission[] allNamespacePerms = NamespacePermission.values();\n for (String next : namespaces) {\n for (NamespacePermission nextPerm : allNamespacePerms) {\n if (ops.hasNamespacePermission(userName, next, nextPerm)) {\n namespacePermissions.add(new datawave.webservice.response.objects.NamespacePermission(next, nextPerm.name()));\n }\n }\n }\n \n UserPermissions userPermissions = new UserPermissions();\n userPermissions.setSystemPermissions(systemPermissions);\n userPermissions.setTablePermissions(tablePermissions);\n userPermissions.setNamespacePermissions(namespacePermissions);\n response.setUserPermissions(userPermissions);\n \n return response;\n } catch (AccumuloSecurityException e) {\n log.error(e.getMessage(), e);\n response.addException(e);\n throw new UnauthorizedException(e, response);\n } catch (Exception e) {\n log.error(e.getMessage(), e);\n response.addException(e);\n throw new AccumuloWebApplicationException(e, response);\n } finally {\n try {\n connectionFactory.returnConnection(connection);\n } catch (Exception e) {\n log.error(e.getMessage(), e);\n }\n }\n }", "@Override\n public List<ArrayList<String>> queryAdminPersonalData(Token token) {\n\n List<ArrayList<Object>> objList = null;\n\n try {\n objList = queryAdminPersonalData2(token);\n } catch (SCRSException e) {\n System.out.println(e.getMessage());\n return null;\n }\n\n List<ArrayList<String>> result = UtilMethods.convertObjListToStringList(objList);\n\n return result;\n\n }", "public interface PermissionService {\n List<User> findRoleUsers(String roleId);\n\n void roleAssignUsers(String roleId, String assignUsers, String removeUsers);\n\n void roleAssignMenu(String roleId, String menuIds);\n\n List<Menu> findRoleMenus(String roleId);\n}", "List<Permission> selectAll();", "@Test\n\tpublic void testGetPermissions_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\n\t\tSet<Permission> result = fixture.getPermissions();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "public ArrayList<SaleVO> showSale() {\n\t\treturn sale.show();\r\n\t}", "public int printSaleReportToConsole() {\n int result = 0;\n Enumeration<String> keyEnum = storageSale.keys();\n int totalNumberOfSalesOfProduct = 0;\n String key = null;\n float totalValue = 0;\n while (keyEnum.hasMoreElements()) {\n key = keyEnum.nextElement();\n totalNumberOfSalesOfProduct = getTotalNumberOfSales(key);\n totalValue = getValueOfSales(key);\n System.out.println(\"REPORT: SALE ---> Product: \" + key + \" total number of sales: \"\n + totalNumberOfSalesOfProduct + \" total value: \" + totalValue);\n result++;\n }\n return result;\n }", "public List<SecRole> getRolesByUser(SecUser aUser);", "public interface PermissionService {\n\n List<SysPermission> queryAll();\n\n int countByName(String name);\n\n int insert(SysPermission permission);\n\n SysPermission queryById(Long id);\n\n int update(SysPermission permission);\n\n int delete(Long id);\n\n List<Long> queryPermissionIdsByRoleId(Long roleId);\n\n List<SysPermission> queryPermissionsByUser(SysUser user);\n}", "public List<SysObjRights> getHashRights(String objType)\n\t{\n\t\t\n\t\treturn null;\n\t}", "@Override\r\n\tpublic List<Permission> queryPermissionsByUsers(User dbUser) {\n\t\treturn permissionDao.queryPermissionsByUsers(dbUser);\r\n\t}", "java.lang.String getPermissions(int index);", "public List<Sale> getSalesLog() {\n return salesLog;\n }", "public Vector findAllEdit(String login, Boolean isAdmin, String planstate)\n throws Exception {\n Query query = null;\n\n if (!isAdmin.booleanValue()) {\n\n if (planstate.equals(Checks.POSITION_PLANSTATE_Fact)) {\n query = new Query(QUERY_SELECT_EditFact, RESULT_JdbcObjectVector);\n\n } else if (planstate.equals(Checks.POSITION_PLANSTATE_Plan)) {\n query = new Query(QUERY_SELECT_EditPlan, RESULT_JdbcObjectVector);\n } else {\n query = new Query(QUERY_SELECT_Edit, RESULT_JdbcObjectVector);\n }\n query.append(\"AND o.loiginid=?\", login);\n } else {\n query = new Query(QUERY_SELECT_Admin, DataUtil.RESULT_JdbcObjectVector);\n }\n\n query.append(\"ORDER BY regname\");\n\n return findVector(query);\n}", "public List<IPermissionOwner> getAllPermissionOwners();", "@Test\n public void getAdminsTest() throws ApiException {\n String scope = null;\n AdminResponse response = api.getAdmins(scope);\n\n // TODO: test validations\n }", "java.lang.String getQueryAuthorizations();", "public Enumeration permissions();", "public List<Permission> queryAllPermission() {\n\t\treturn permissionMapper.queryAllPermission();\n\t}", "@JsonProperty(\"SalesAccessChannels\")\n public List<SalesAccessChannelsEnum> getSalesAccessChannels() {\n return salesAccessChannels;\n }", "@PostFilter(\"hasRole('ADMINISTRATOR') OR \"\r\n \t\t\t+ \"(hasRole('EMPLOYEE') AND \"\r\n \t\t\t+ \"(filterObject.type.typeLabel == 'CUSTOMERLEGAL' OR \"\r\n \t\t\t+ \"filterObject.type.typeLabel == 'CUSTOMERINDIVIDUAL')) OR \"\r\n \t\t\t+ \"((hasRole('CUSTOMERLEGAL') OR hasRole('CUSTOMERINDIVIDUAL')) AND \"\r\n \t\t\t+ \"(filterObject.username == principal.username)) OR \"\r\n \t\t\t+ \"(hasRole('REVISIONER') AND filterObject.type.typeLabel == 'REVISIONER')\")\r\n \tpublic List<SystemUserDTO> getSystemUsersByParams(String firstName,\r\n\t\t\tString lastName, UserTypeEnumDTO type);", "@Query(\"select a from Account a where a.role = 'Admin'\")\n List<Account> getAllAdmins();", "@Test\n\tvoid findAllMyCompany() {\n\t\tinitSpringSecurityContext(\"mmartin\");\n\n\t\tfinal TableItem<UserOrgVo> tableItem = resource.findAll(\"ligoj\", null, null, newUriInfoAsc(\"id\"));\n\n\t\t// 7 users from company 'ligoj', 0 from delegate\n\t\tAssertions.assertEquals(7, tableItem.getRecordsTotal());\n\t\tAssertions.assertEquals(7, tableItem.getRecordsFiltered());\n\n\t\t// Check the users\n\t\tAssertions.assertEquals(\"alongchu\", tableItem.getData().get(0).getId());\n\t}", "List<UserContentAccess> findContentAccess();", "public Map<String, Boolean> hasPermission(String login, List<String> permissions);", "public List<SalePurchase> viewAllSPEntries(){\n\t\tList<SalePurchase> list = new ArrayList<>(salePurchaseEntries.values());\n\t\treturn list;\n\t}", "@Override\n public List<RightsDTO> getRightsByUCN(final String ucn) {\n return transactionHandler.execute((final Factory factory) -> RightsServiceLogic\n .getRights(ucn, factory.findService(EmployeeRepository.class)));\n }", "private ImmutableSet<Permission> getPermissions(XMLConfiguration cfg) {\n List<Permission> permissionList = Lists.newArrayList();\n\n for (Object o : cfg.getList(APP_PERMISSIONS)) {\n String name = (String) o;\n permissionList.add(new Permission(AppPermission.class.getName(), name));\n }\n for (Object o : cfg.getList(NET_PERMISSIONS)) {\n //TODO: TO BE FLESHED OUT WHEN NETWORK PERMISSIONS ARE SUPPORTED\n break;\n }\n\n List<HierarchicalConfiguration> fields =\n cfg.configurationsAt(JAVA_PERMISSIONS);\n for (HierarchicalConfiguration sub : fields) {\n String classname = sub.getString(\"classname\");\n String name = sub.getString(\"name\");\n String actions = sub.getString(\"actions\");\n\n if (classname != null && name != null) {\n permissionList.add(new Permission(classname, name, actions));\n }\n }\n return ImmutableSet.copyOf(permissionList);\n }", "List<Agent> listPOSAgentsHaveCredential();", "@PreAuthorize(\"hasRole('ADMIN')\")\n public ProductDto retrieveAuthorizedProducts() { \n return new ProductDto(\"1\", \"iPhone\", 999.99f);\n }", "public org.tempuri.GetUserAccessRightWithUserDetailsResponseGetUserAccessRightWithUserDetailsResult getUserAccessRightWithUserDetails(java.lang.String msg, java.lang.String systemCode, java.lang.String companyCode) throws java.rmi.RemoteException;", "private List<String> findValuesFromAuthorizationData(String tableName,\n String columnName,\n RoleType role) {\n\n tableName = NCIAConfig.getProtectionElementPrefix() + tableName;\n columnName = NCIAConfig.getProtectionElementPrefix() + columnName;\n\n List<String> returnValues = new ArrayList<String>();\n\n for (TableProtectionElement tpe : securityRights) {\n if (tableName.equals(tpe.getTableName()) &&\n columnName.equals(tpe.getAttributeName()) &&\n tpe.hasRole(role)) {\n\n String value = tpe.getAttributeValue();\n\n if (value != null) {\n // Strip off the prefix\n returnValues.add(value.replace(\n NCIAConfig.getProtectionElementPrefix(), \"\"));\n }\n }\n }\n\n return returnValues;\n }", "private void checkRights() {\n image.setEnabled(true);\n String user = fc.window.getUserName();\n \n for(IDataObject object : objects){\n ArrayList<IRights> rights = object.getRights();\n \n if(rights != null){\n boolean everybodyperm = false;\n \n for(IRights right : rights){\n String name = right.getName();\n \n //user found, therefore no other check necessary.\n if(name.equals(user)){\n if(!right.getOwner()){\n image.setEnabled(false);\n }else{\n image.setEnabled(true);\n }\n return;\n //if no user found, use everybody\n }else if(name.equals(BUNDLE.getString(\"Everybody\"))){\n everybodyperm = right.getOwner();\n }\n }\n image.setEnabled(everybodyperm);\n if(!everybodyperm){\n return;\n }\n }\n }\n }", "public List<String> getAllSIDs() {\n\t\tSet<String> r = new HashSet<String>();\n\t\tfor (Set<String> set : grantedPermissions.values())\n\t\t\tr.addAll(set);\n\t\tr.remove(\"anonymous\");\n\n\t\tString[] data = r.toArray(new String[r.size()]);\n\t\tArrays.sort(data);\n\t\treturn Arrays.asList(data);\n\t}", "@Override\n public String getUserGroupsQuery()\n {\n return \"SELECT ROLE_NAME FROM INFORMATION_SCHEMA.ROLE_AUTHORIZATION_DESCRIPTORS WHERE GRANTEE=? AND ROLE_NAME!=GRANTEE;\";\n }", "@Override\r\n\tpublic List<UserCredential> viewAllEmployees(String authToken) throws ManualException{\r\n\t\tfinal\tSession session=sessionFactory.openSession();\r\n\t\tList<UserCredential> userlist =null;\r\n\r\n\t\t/* check for authToken of admin */\r\n\t\tsession.beginTransaction();\r\n\t\t\r\n\t\ttry{\r\n\t\t\tAuthTable authtable=session.get(AuthTable.class, authToken);\r\n\t\n\t\t\tUser user = authtable.getUser();\r\n\t\t\tif(user.getUsertype().equals(\"Admin\")){\r\n\t\t\t\tString hql=\"from user\";\r\n\t\t\t\tQuery q=session.createQuery(hql);\r\n\t\t\t\tuserlist=(List)q.list();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tManualException ex = new ManualException(\"user.list.empty\",env.getProperty(\"user.list.empty\"));\r\n\t\t\tuserlist=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 userlist;\r\n\t\t}\r\n\t}", "@Override\n\tpublic List<Object> getSaleList(Search search) throws Exception {\n\t\treturn null;\n\t}", "public List <String> getPermittedUsers() throws BusinessServiceException{\r\n\r\n\t\treturn financeManagerBO.getPermittedUsers();\t\t\r\n\t}", "public List<UserDataRights> searcUserDataRights(Long userId, Long orgId, String resourceUrl) {\n\t\treturn userResourceViewMapper.searchDataRightsList(userId, orgId, resourceUrl);\r\n\t}", "@Query(\"select ad from AccountDetail ad where ad.role = 'USER'\")\n List<AccountDetail> getAllAdminAccounts();", "@Override\n\tpublic List<OrderVO> orderListForAdmin(SearchCriteria scri) throws Exception {\n\t\treturn session.selectList(\"orderMapper.orderListForAdmin\", scri);\n\t}", "List<User_Role> selectAll();", "public List<String> getAuthorizedSeriesSecurityGroups(RoleType role) {\n return findValuesFromAuthorizationData(PROT_ELEM_GENERAL_SERIES,\n PROT_ELEM_SECURITY_GROUP,\n role);\n }", "public Properties getPermissionsReport() {\n /* TO DO: */\n return null;\n }", "@GetMapping\n @PreAuthorize(\"hasAnyRole('ROLE_ADMIN','ROLE_ADMIN_TRAINEE')\")\n public List<Student> getAllStudents() {\n\n return STUDENTS;\n }", "List<SysUser> selectAll();", "@NonNull\n Set<String> getGrantedPermissions(@NonNull String packageName, @UserIdInt int userId);", "public Boolean hasLogAccess(XPath xpath, Document doc) throws XPathExpressionException\r\n\t{\n\t\tif(auth.allows(\"admin\")) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public List<String> getPermissions() {\n AppMethodBeat.m2504i(92672);\n List permissions = this.properties.getPermissions();\n AppMethodBeat.m2505o(92672);\n return permissions;\n }", "@Override\r\n\tpublic List<Integer> queryPermissionsByRoleid(Integer roleid) {\n\t\treturn permissionDao.queryPermissionsByRoleid(roleid);\r\n\t}", "@Test(priority=3)\r\n\tpublic void displaySalesOptions() {\r\n\t\t\r\n\t\tboolean expected=true;\r\n\t\tboolean actual=filterReturnsList.displaySalesList();\r\n\t\tassertEquals(actual, expected);\r\n\t}" ]
[ "0.5962965", "0.5745667", "0.5569361", "0.5562167", "0.54879814", "0.54778606", "0.5447059", "0.5440729", "0.54252326", "0.53228664", "0.5314805", "0.5285351", "0.5266197", "0.52500945", "0.52492315", "0.5219188", "0.5151813", "0.51444787", "0.5139248", "0.5121682", "0.5100492", "0.50976026", "0.50877964", "0.5082463", "0.50752777", "0.50656486", "0.5061967", "0.50618947", "0.50544024", "0.505087", "0.50427884", "0.5042233", "0.5035624", "0.5019167", "0.5018549", "0.50066006", "0.4975716", "0.49751213", "0.49638194", "0.49625352", "0.49464804", "0.49456877", "0.4943784", "0.49252892", "0.4922807", "0.49124908", "0.49111307", "0.49101305", "0.4910013", "0.4903571", "0.48970607", "0.48938835", "0.48874968", "0.48731098", "0.4864532", "0.4852648", "0.4845639", "0.48383024", "0.48362064", "0.48352337", "0.48153654", "0.48009548", "0.4790328", "0.47896415", "0.4783397", "0.47806937", "0.4775948", "0.47734237", "0.47665244", "0.4764619", "0.47645703", "0.47526285", "0.47489324", "0.47433704", "0.47423863", "0.4741662", "0.47408652", "0.47401848", "0.47309157", "0.47275788", "0.47206533", "0.47158095", "0.47150266", "0.47086096", "0.47025034", "0.46927172", "0.4689106", "0.4687056", "0.46839666", "0.46833447", "0.46817565", "0.46812794", "0.46810445", "0.46779728", "0.46760073", "0.46743137", "0.46683094", "0.46672285", "0.4661369", "0.4656903" ]
0.4708543
84
Update a sale Permissions Needed: SALES_ADMIN
@Test public void updateCatalogSaleTest() { Integer id = null; CatalogSale catalogSale = null; // CatalogSale response = api.updateCatalogSale(id, catalogSale); // TODO: test validations }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateAccountingSystem(Sale sale)\n {\n \n }", "public int modifySale(SaleVO vo) {\n\t\treturn sale.Modify(vo);\r\n\t}", "@Override\n\tpublic int update(ShiroRolesPermissionsPoEntity entity) {\n\t\treturn 0;\n\t}", "public void update(Sale sale) {\n sale_dao.update(sale);\n }", "boolean setSiteRights(SiteAdminRights r, boolean b);", "@Override\r\n\tpublic int updPermission(Permission perms) {\n\t\treturn 0;\r\n\t}", "public Integer updateProductSales(Long productId) throws Exception;", "public void accountSale(long storeID, final SaleTO sale) throws ProductOutOfStockException, NotInDatabaseException, UpdateException;", "public void updatePermissions(IPermission[] permissions) throws AuthorizationException;", "public void updateInventory(SaleDTO sale) {\n\t\tfor (ItemListDTO itemS : sale.getItems()) {\n\t\t\tfor (ItemData item : items) {\n\t\t\t\tif (itemS.getIdItem() == item.idItem) {\n\t\t\t\t\titem.quantitySold = itemS.getQuantity()+item.quantitySold;\n\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "private void updatePolicyPermissions(SubscriptionThrottlePolicyDTO body) throws APIManagementException {\n APIProvider apiProvider = RestApiCommonUtil.getLoggedInUserProvider();\n SubscriptionThrottlePolicyPermissionDTO policyPermissions = body.getPermissions();\n if (policyPermissions != null) {\n if (policyPermissions.getRoles().size() > 0) {\n String roles = StringUtils.join(policyPermissions.getRoles(), \",\");\n String permissionType;\n if (policyPermissions.getPermissionType() ==\n SubscriptionThrottlePolicyPermissionDTO.PermissionTypeEnum.ALLOW) {\n permissionType = APIConstants.TIER_PERMISSION_ALLOW;\n } else {\n permissionType = APIConstants.TIER_PERMISSION_DENY;\n }\n apiProvider.updateThrottleTierPermissions(body.getPolicyName(), permissionType, roles);\n } else {\n throw new APIManagementException(ExceptionCodes.ROLES_CANNOT_BE_EMPTY);\n }\n } else {\n apiProvider.deleteTierPermissions(body.getPolicyName());\n }\n }", "private void updateStudentSecurityInfo() {\n\t\t\n\t\tstudent.setPassword(sPasswordPF1.getPassword());\n\t\tstudent.setSecuirtyAnswer1(sSecurityQ1TF.getText());\n\t\tstudent.setSecurityQuestion1((String)sSecurityList1.getSelectedItem());\n\t\tstudent.setSecurityAnswer2(sSecurityQ2TF.getText());\n\t\tstudent.setSecurityQuestion2((String)sSecurityList1.getSelectedItem());\n\t\t\n\t\t//Update Student security information in database\n\t\t\n\t}", "public int update(SsoAuthDO ssoAuth) throws DataAccessException;", "public void setSale(int sale) {\n\t\tthis.sale = sale;\r\n\t}", "int updateByPrimaryKey(SysRoleUser record);", "public void saveSysRole(SysRole sysRole);", "int updateByPrimaryKey(SysRole record);", "int updateByPrimaryKey(SysRoleFunction record);", "@Override\n\tpublic void updateByExample(Permissions obj, PermissionsDbObjExample ex)\n\t\t\tthrows RuntimeException {\n\t\t\n\t}", "public void updateSalerCustomerByForbidden(int uid) {\n\t\tthis.salerCustomerMapper.updateSalerCustomerByForbidden(uid);\n\t}", "int updateByPrimaryKey(PlatformAdminRoleUser record);", "int updateByPrimaryKey(SysRoleDO record);", "private void updateEISAndEAS(){\n eas.registerPayment(paymentDTO);\n eis.updateInventory(saleDTO);\n }", "public void addMSCAdminToPR(ApprovalRequest ar, Approvable lic) {\r\n\t\tLog.customer.debug(\"%s ::: addMSCAdminToPR - %s\", className, lic);\r\n\t\tProcureLineItemCollection plic = (ProcureLineItemCollection) lic;\r\n\t\tString TaxRole = \"MSC Administrator\";\r\n\t\tString TaxReason = \"Tax Reason\";\r\n\t\tboolean flag1 = true;\r\n\t\tObject obj = Role.getRole(TaxRole);\r\n\t\t// plic.setFieldValue(\"ProjectID\",\"F\");\r\n\t\tLog.customer.debug(\"%s ::: isMSCAdminRequired - plic bfore create %s\",\r\n\t\t\t\tclassName, plic.toString());\r\n\t\tApprovalRequest approvalrequest1 = ApprovalRequest.create(plic,\r\n\t\t\t\t((ariba.user.core.Approver) (obj)), flag1, \"RuleReasons\",\r\n\t\t\t\tTaxReason);\r\n\t\tLog.customer.debug(\"%s ::: approvalrequest1 got activated- %s\",\r\n\t\t\t\tclassName);\r\n\r\n\t\tBaseVector basevector1 = plic.getApprovalRequests();\r\n\t\tLog.customer.debug(\"%s ::: basevector1 got activated- %s\", className);\r\n\r\n\t\tBaseVector basevector2 = approvalrequest1.getDependencies();\r\n\t\tLog.customer.debug(\"%s ::: basevector2 got activated- %s\", className);\r\n\r\n\t\tbasevector2.add(0, ar);\r\n\t\tLog.customer.debug(\"%s ::: ar added to basevector2 %s\", className);\r\n\r\n\t\tapprovalrequest1.setFieldValue(\"Dependencies\", basevector2);\r\n\t\tar.setState(2);\r\n\t\tLog.customer.debug(\"%s ::: ar.setState- %s\", className);\r\n\r\n\t\tar.updateLastModified();\r\n\t\tLog.customer.debug(\"%s ::: ar.updatelastmodified- %s\", className);\r\n\r\n\t\tbasevector1.removeAll(ar);\r\n\t\tLog.customer.debug(\"%s ::: basevecotr1 .removeall %s\", className);\r\n\r\n\t\tbasevector1.add(0, approvalrequest1);\r\n\t\tLog.customer.debug(\"%s ::: basevector1 .add- %s\", className);\r\n\r\n\t\tplic.setApprovalRequests(basevector1);\r\n\t\tLog.customer.debug(\"%s ::: ir .setApprovalRequests got activated- %s\",\r\n\t\t\t\tclassName);\r\n\r\n\t\tjava.util.List list = ListUtil.list();\r\n\t\tjava.util.Map map = MapUtil.map();\r\n\t\tboolean flag6 = approvalrequest1.activate(list, map);\r\n\r\n\t\tLog.customer.debug(\"%s ::: New TaxAR Activated - %s\", className);\r\n\t\tLog.customer.debug(\"%s ::: State (AFTER): %s\", className);\r\n\t\tLog.customer.debug(\"%s ::: Approved By: %s\", className);\r\n\r\n\t}", "void changePermissions(Training training, User user, Permission permission, String token) throws AuthenticationException;", "int updateByPrimaryKeySelective(SysRoleUser record);", "public void setAdminRights (String email, int rights){\r\n try (Connection connection = jdbcUtils.getConnection();){\r\n preparedStatement = connection.prepareStatement(SET_ADMIN_RIGHTS_SQL);\r\n preparedStatement.setInt(IS_ADMIN_SET_ADMIN_RIGHTS_SQL_NUMBER, IS_ADMIN);\r\n preparedStatement.setInt(IS_ADMIN_SET_ADMIN_RIGHTS_SQL_NUMBER, rights);\r\n preparedStatement.setString(EMAIL_SET_ADMIN_RIGHTS_SQL_NUMBER, email);\r\n preparedStatement.executeUpdate();\r\n } catch (SQLException ex) {\r\n configLog.init();\r\n logger.info(LOG_SQL_EXCEPTION_MESSAGE + AdminDao.class.getName());\r\n Logger.getLogger(AdminDao.class.getName()).log(Level.SEVERE, null, ex);\r\n throw new RuntimeException();\r\n }\r\n }", "int updateByPrimaryKey(EpermissionDO record);", "int updateByPrimaryKeySelective(SysRole record);", "@Override\r\n public void setsaleId(int saleid) {\n this.saleId = saleid;\r\n }", "void updatePurchaseOrderLinkedSaleOrderStatus(long pohId);", "@Override\n protected String requiredPutPermission() {\n return \"admin\";\n }", "int updateByPrimaryKeySelective(SysRoleFunction record);", "int updateByPrimaryKeySelective(PlatformAdminRoleUser record);", "public abstract OwUIAccessRightsModul getEditAccessRightsSubModul(OwObject object_p) throws Exception;", "public void grantAdminOnIndividualToSystemUser(Individual i, SystemUser user);", "public void grantAdministrate(User user) throws ServiceException{\n }", "int updateByPrimaryKeySelective(SysRoleDO record);", "int updateByPrimaryKey(Permission record);", "int updateByPrimaryKey(Permission record);", "boolean adminUpdate(int userId, int statusId, int reimbId);", "private void updateInventory(Sale newSale)\n {\n ArrayList<SaleItem> tempSaleItems = newSale.getSaleItems();\n for(int i = 0; i < tempSaleItems.size(); i++)\n {\n //Get saleItem quantity\n double saleNum = tempSaleItems.get(i).getQuantity();\n //Loop through ingredients\n ArrayList<Ingredient> tempIng = tempSaleItems.get(i).getIngredients();\n for(int j = 0; j < tempIng.size(); j++)\n {\n //get this ingredient name and quantity\n String thisName = tempIng.get(j).getName();\n double thisQty = tempIng.get(j).getQuantity();\n\n //get InventorySingleton qty\n double oldQty = InventorySingleton.get(this).getIngredientQuantity(thisName);\n double newQty = oldQty - (thisQty*saleNum);\n //Update Inventory Singleton and Database\n InventorySingleton.get(this).setIngredientQuantity(thisName, newQty);\n inventoryDBUpdate();\n }\n }\n }", "public void setSales(Integer sales) {\n this.sales = this.sales + sales;\n }", "ISModifyProvidedRole createISModifyProvidedRole();", "@Test\n public void testGetPermissionsRole() throws Exception\n {\n permission = permissionManager.getPermissionInstance(\"GREET_PEOPLE\");\n permissionManager.addPermission(permission);\n Permission permission2 = permissionManager.getPermissionInstance(\"ADMINISTER_DRUGS\");\n permissionManager.addPermission(permission2);\n Role role = securityService.getRoleManager().getRoleInstance(\"VET_TECH\");\n securityService.getRoleManager().addRole(role);\n ((DynamicModelManager) securityService.getModelManager()).grant(role, permission);\n PermissionSet permissions = ((DynamicRole) role).getPermissions();\n assertEquals(1, permissions.size());\n assertTrue(permissions.contains(permission));\n assertFalse(permissions.contains(permission2));\n }", "@Override\r\n\tpublic int editRolePermission(RolePermission rolePermission) {\n\t\treturn rolePermissionMapper.updateByPrimaryKeySelective(rolePermission);\r\n\t}", "@Override\r\n\tpublic int updRole(Role role) {\n\t\treturn 0;\r\n\t}", "private void changePermissionsInUI(int position) {\n if (permissions.get(position).equals(\"Viewer\")) {\n permissions.set(position, \"Editor\");\n items.set(position, users.get(position) + \": Editor\");\n Toast.makeText(RoomSettingsActivity.this, users.get(position) + \" has been changed to an Editor\", Toast.LENGTH_SHORT).show();\n } else if (permissions.get(position).equals(\"Editor\")) {\n permissions.set(position, \"Viewer\");\n items.set(position, users.get(position) + \": Viewer\");\n Toast.makeText(RoomSettingsActivity.this, users.get(position) + \" has been changed to a Viewer\", Toast.LENGTH_SHORT).show();\n }\n }", "int updateByPrimaryKeySelective(EpermissionDO record);", "public void doPermissions(RunData data, Context context)\n\t{\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState(((JetspeedRunData)data).getJs_peid());\n\n\t\t// cancel copy if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_COPY_FLAG)))\n\t\t{\n\t\t\tinitCopyContext(state);\n\t\t}\n\n\t\t// cancel move if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_MOVE_FLAG)))\n\t\t{\n\t\t\tinitMoveContext(state);\n\t\t}\n\n\t\t// should we save here?\n\t\tstate.setAttribute(STATE_LIST_SELECTIONS, new TreeSet());\n\n\t\t// get the current home collection id and the related site\n\t\tString collectionId = (String) state.getAttribute (STATE_HOME_COLLECTION_ID);\n\t\tReference ref = EntityManager.newReference(ContentHostingService.getReference(collectionId));\n\t\tString siteRef = SiteService.siteReference(ref.getContext());\n\n\t\t// setup for editing the permissions of the site for this tool, using the roles of this site, too\n\t\tstate.setAttribute(PermissionsHelper.TARGET_REF, siteRef);\n\n\t\t// ... with this description\n\t\tstate.setAttribute(PermissionsHelper.DESCRIPTION, rb.getString(\"setpermis1\")\n\t\t\t\t+ SiteService.getSiteDisplay(ref.getContext()));\n\n\t\t// ... showing only locks that are prpefixed with this\n\t\tstate.setAttribute(PermissionsHelper.PREFIX, \"content.\");\n\n\t\t// get into helper mode with this helper tool\n\t\tstartHelper(data.getRequest(), \"sakai.permissions.helper\");\n\n\t}", "@Override\n\tpublic void update(UserRole vo) {\n\n\t}", "@Test\n public void testUpdateProductShouldThrowForbiddenWhenMemberUserAccess() throws Exception {\n testResponseData(RequestInfo.builder()\n .request(put(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(memberToken)\n .body(productRequest)\n .httpStatus(HttpStatus.FORBIDDEN)\n .build());\n }", "UpdateACLResult updateACL(UpdateACLRequest updateACLRequest);", "int updateNavegacionSalida(final Long srvcId);", "public void updateTierPermissions(String tierName, String permissionType, String roles) throws APIManagementException {\n apiMgtDAO.updateTierPermissions(tierName, permissionType, roles, tenantId);\n }", "private Sale adjustSale(AdjustmentToSale adjSale, Sale sale) {\n float newVal = 0f;\n switch (adjSale.getOper()) {\n case SUM:\n newVal = sale.getValue() + adjSale.getValue();\n break;\n case MULTIPLY:\n newVal = sale.getValue() * adjSale.getValue();\n break;\n case SUBTRACT:\n newVal = sale.getValue() - adjSale.getValue();\n if (newVal < 0)\n newVal = 0.0f;\n break;\n default:\n newVal = sale.getValue();\n break;\n }\n return new Sale(sale.getProductType(), newVal);\n }", "public TSalesPosAttr updateTSalesPosAttr(final TSalesPosAttr tSalesPosAttr) {\n\t\tLOGGER.info(\"=========== Update TSalesPosAttr ===========\");\n\t\treturn genericDAO.update(tSalesPosAttr);\n\t}", "void setPremiumSmsPermissionForSubscriber(int subId, String packageName, int permission);", "int updateByPrimaryKey(SystemRoleUserMapperMo record);", "public boolean isUpdateRight() {\r\n if (getUser() != null) {\r\n return getUser().hasPermission(\"/vocabularies\", \"u\");\r\n }\r\n return false;\r\n }", "private void revokeUserLoginAndUpdateNotes(long studentID) throws Exception {\n int fee = getPendingFee(studentID);\n fee += 25;\n\n String url = MASTER_URL + MEMBERS + studentID + \".api\";\n\n URL obj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) obj.openConnection();\n con.setDoOutput(true);\n // request method\n con.setRequestMethod(\"PUT\");\n\n // request headers\n con.setRequestProperty(\"token\", USER_TOKEN);\n con.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\n String data = \"user[description]=Owes $\" + fee;\n\n OutputStreamWriter writer = new OutputStreamWriter(con.getOutputStream());\n\n writer.write(data);\n writer.close();\n\n con.getResponseCode();\n\n revokeLogin(studentID);\n\n }", "void setAnnualSales(int annualSales) {\n this.annualSales = annualSales;\n }", "@Test\n public void updateAppPermissionTest() throws ApiException {\n String appId = null;\n String username = null;\n Permission body = null;\n Boolean naked = null;\n // Permission response = api.updateAppPermission(appId, username, body, naked);\n\n // TODO: test validations\n }", "public void savePermission(Permission newEntity) throws DAOException;", "private void updatePermissions(String userId, String siteId, List<SignupMeeting> meetings) {\n\t\tfor (SignupMeeting meeting : meetings) {\n\t\t\tboolean attend = isAllowToAttend(userId, siteId, meeting);\n\t\t\tboolean update = isAllowToUpdate(userId, siteId, meeting);\n\t\t\tboolean delete = isAllowToDelete(userId, siteId, meeting);\n\t\t\tPermission permission = new Permission(attend, update, delete);\n\t\t\tmeeting.setPermission(permission);\n\t\t}\n\n\t}", "int updateByPrimaryKey(PensionRoleMenu record);", "int updateByPrimaryKeySelective(Permission record);", "private boolean adjustSale(List<Sale> sales, OperationType operationType, BigDecimal sellingPrice) {\r\n\t\tboolean isValidAdjustment = true;\r\n\t\tswitch (operationType) {\r\n\t\tcase ADD:\r\n\t\t\tsales.stream().forEach(sale -> sale.setPricePerUnit(sale.getPricePerUnit().add(sellingPrice)));\r\n\t\t\tbreak;\r\n\t\tcase MULTIPLY:\r\n\t\t\tsales.stream().forEach(sale -> sale.setPricePerUnit(sale.getPricePerUnit().multiply(sellingPrice)));\r\n\t\t\tbreak;\r\n\t\tcase SUBTRACT:\r\n\t\t\tsales.stream().forEach(sale -> sale.setPricePerUnit(sale.getPricePerUnit().subtract(sellingPrice)));\r\n\t\t\tbreak; \r\n\t\tdefault:\r\n\t\t\tisValidAdjustment = false;\r\n\t\t\tSystem.out.println(\"Unsupported operation encountered during processing.\");\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn isValidAdjustment;\r\n\t}", "@Test\n\tpublic void testUpdateActionIsPerformedWhenPermissionInheritedAndUserAuthenticatedAndAllowed()\n\t\t\tthrows Throwable {\n\t\tcheck(getAllowedUser(), HttpStatus.SC_OK);\n\t}", "@Override\n\tpublic void doUpdatePerm(String roleId, String addIds, String delIds) throws Exception {\n\t\tRole role=(Role) repertory.findById(Role.class, roleId);\n\t\tif(role==null){\n\t\t\tthrow new Exception(\"角色未找到\");\n\t\t}\n\t\tString[] addIdsArray=addIds.split(StringVeriable.STR_SPLIT);\n\t\t/**删除权限的操作*/\n\t\tString[] delIdsArray=delIds.split(StringVeriable.STR_SPLIT);\n\t\t/**增加权限的操作*/\n\t\tfor(String addId:addIdsArray){\n\t\t\tif(StringUtil.isEmpty(addId)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tPermission perm=(Permission) repertory.getEntityByHql(\" from Permission where perCode='\"+addId+\"' and perType='\"+PermType.TYPE_MENU+\"'\");\n\t\t\t//权限已经存在,直接建立关系\n\t\t\tif(perm!=null){\n\t\t\t\tString insertSql=\"insert into ROLE_PERM(roleId,perId) values('\"+role.getRoleId()+\"','\"+perm.getPerId()+\"')\";\n\t\t\t\trepertory.executeSql(insertSql);\n\t\t\t}else{\n\t\t\t\tperm=new Permission();\n\t\t\t\tperm.setPerCode(addId);\n\t\t\t\tperm.setPerType(PermType.TYPE_MENU);\n\t\t\t\trepertory.save(perm);\n\t\t\t\t//先提交到数据库存在进行并联\n\t\t\t\trepertory.flush();\n\t\t\t\tString insertSql=\"insert into ROLE_PERM(roleId,perId) values('\"+role.getRoleId()+\"','\"+perm.getPerId()+\"')\";\n\t\t\t\trepertory.executeSql(insertSql);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tfor(String delId:delIdsArray){\n\t\t\tif(StringUtil.isEmpty(delId)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tPermission perm=(Permission) repertory.getEntityByHql(\" from Permission where perCode='\"+delId+\"' and perType='\"+PermType.TYPE_MENU+\"'\");\n\t\t\tif(perm!=null){\n\t\t\t\t//解除关系\n\t\t\t\tString delSql=\"delete from ROLE_PERM where perId='\"+perm.getPerId()+\"' and roleId='\"+role.getRoleId()+\"'\";\n\t\t\t\trepertory.executeSql(delSql);\n\t\t\t}\n\t\t}\n\t}", "public void updatePremiumNumberOfStays(Long premiumId, Integer numberOfStays);", "@Test\n void saveOrUpdateSuccess() {\n String newRoleName = \"readOnly\";\n UserRoles toUpdate = (UserRoles) genericDao.getById(3);\n toUpdate.setRoleName(newRoleName);\n genericDao.saveOrUpdate(toUpdate);\n UserRoles retrievedRole = (UserRoles) genericDao.getById(3);\n assertEquals(newRoleName, retrievedRole.getRoleName());\n log.info(\"update role success test\");\n\n }", "int updateByPrimaryKey(User_Role record);", "public static void updateProduct(Supermarket supermarket, Product product, String action) throws SQLException {\r\n\t\tPreparedStatement statement = null;\r\n\t\tString query;\r\n\t\ttry {\r\n\t\t\tif(action.equals(\"add\")) {\r\n\t\t\t\tquery = \"UPDATE CS_\"+supermarket.getSuper_name()+\" SET PRODUCT_EXIST=?, PRODUCT_PRICE=? WHERE PRODUCT_NAME=? and PRODUCT_COMPANY=?\";\r\n\t\t\t\tstatement = JdbcCommon.connection.prepareStatement(query);\r\n\t\t\t\tstatement.setBoolean(1, true);\r\n\t\t\t\tstatement.setDouble(2,product.getProduct_price());\r\n\t\t\t\tstatement.setString(3, product.getProduct_name());\r\n\t\t\t\tstatement.setString(4, product.getProduct_company());\r\n\t\t\t\tstatement.executeUpdate();\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tquery = \"UPDATE CS_\"+supermarket.getSuper_name()+\" SET PRODUCT_EXIST=?, PRODUCT_PRICE=? WHERE PRODUCT_NAME=? and PRODUCT_COMPANY=?\";\r\n\t\t\t\tstatement = JdbcCommon.connection.prepareStatement(query);\r\n\t\t\t\tstatement.setBoolean(1, false);\r\n\t\t\t\tstatement.setDouble(2,0);\r\n\t\t\t\tstatement.setString(3, product.getProduct_name());\r\n\t\t\t\tstatement.setString(4, product.getProduct_company());\r\n\t\t\t\tstatement.executeUpdate();\t\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {e.printStackTrace();}\r\n\t\tstatement.close();\r\n\t}", "Update withSecurityProfile(SecurityProfile securityProfile);", "int updateByPrimaryKey(SsSocialSecurityAccount record);", "@Test\n public void testSetPolicy2() throws Exception {\n setupPermission(PathUtils.ROOT_PATH, getTestUser().getPrincipal(), true, JCR_READ, JCR_READ_ACCESS_CONTROL, JCR_MODIFY_ACCESS_CONTROL);\n setupPermission(null, getTestUser().getPrincipal(), true, JCR_READ_ACCESS_CONTROL, JCR_MODIFY_ACCESS_CONTROL);\n\n setupPermission(getTestRoot(), null, EveryonePrincipal.getInstance(), false, JCR_NAMESPACE_MANAGEMENT);\n }", "@Test\n public void setPermissions() {\n cleanEntity0();\n\n entity0.setPermissions(permissionsS);\n assertEquals(permissionsS, ReflectionTestUtils.getField(entity0, \"permissions\"));\n }", "public void setSalesID(final long newSalesID) {\n this.salesID = newSalesID;\n }", "public void put(long tl2_requires_likes_given) {\n String url = (\"https://discourse.example.com//admin/site_settings/tl2_requires_likes_given\");\n Map<String, Object> content = new HashMap<>();\n content.put(\"tl2_requires_likes_given\", (tl2_requires_likes_given));\n requestPut(url, null, content, Void.class);\n }", "Transfer updateAuthorizationData(Long id, Transfer.Status status, AuthorizationLevel nextLevel, Calendar processDate);", "private void changeDownloadPermission(boolean canDownload){\n if (getMainItem() instanceof BoxFile) {\n executeRequest(mFileApi.getCreateSharedLinkRequest(getMainItem().getId()).setCanDownload(canDownload));\n }\n else if (getMainItem() instanceof BoxFolder) {\n executeRequest(mFolderApi.getCreateSharedLinkRequest(getMainItem().getId()).setCanDownload(canDownload));\n }\n else if (getMainItem() instanceof BoxBookmark) {\n Toast.makeText(this, \"Bookmarks do not have a permission that can be changed.\", Toast.LENGTH_LONG).show();\n }\n }", "License update(License license);", "@Test(groups = \"wso2.ds.dashboard\", description = \"Assigning dashboard view and edit permission\", dependsOnMethods = \"testAddUserAssignRoles\")\n public void testAddDashboardAndAssignRolesBySetting()\n throws XPathExpressionException, MalformedURLException, InterruptedException {\n addLoginRole(USERNAME_EDITOR);\n addCreateRole(USERNAME_EDITOR);\n addOwnernRole(USERNAME_EDITOR);\n login(USERNAME_EDITOR, PASSWORD_EDITOR);\n deleteDashboards();\n addDashBoardWithLandingPage(dashboardTitle, DASHBOARD_DESCRIPTION);\n getDriver().findElement(By.cssSelector(\"#\" + DASHBOARD_TITLE.toLowerCase() + \" a.ues-edit\")).click();\n allowPersonalizeDashboard();\n redirectToLocation(DS_HOME_CONTEXT, DS_DASHBOARDS_CONTEXT);\n WebElement dashboardItem = getDriver().findElement(By.id(dashboardTitle.toLowerCase()));\n dashboardItem.findElement(By.cssSelector(\".ues-edit\")).click();\n getDriver().findElement(By.id(\"dashboard-settings\")).click();\n getDriver().executeScript(\"scroll(0, 200);\");\n // Add viewer role\n WebElement viewerTextbox = getDriver().findElement(By.id(\"ues-share-view\"));\n viewerTextbox.sendKeys(\"dashboardViewer\");\n viewerTextbox.sendKeys(Keys.TAB);\n // Add editor role\n WebElement editorTextbox = getDriver().findElement(By.id(\"ues-share-edit\"));\n editorTextbox.sendKeys(\"dashboardEditor\");\n editorTextbox.sendKeys(Keys.TAB);\n // Remove all other roles\n getDriver().findElement(By.cssSelector(\".ues-shared-view > .ues-shared-role > .remove-button\")).click();\n getDriver().findElement(By.cssSelector(\".ues-shared-edit > .ues-shared-role > .remove-button\")).click();\n getDriver().findElement(By.id(\"ues-dashboard-saveBtn\")).click();\n }", "void setPremiumSmsPermission(String packageName, int permission);", "@PreAuthorize(\"hasRole('ROLE_USER')\")\r\n\tpublic void updateUserAccount(UserAccount account);", "int updateByPrimaryKeySelective(PensionRoleMenu record);", "private void updateSoldProductInfo() { public static final String COL_SOLD_PRODUCT_CODE = \"sells_code\";\n// public static final String COL_SOLD_PRODUCT_SELL_ID = \"sells_id\";\n// public static final String COL_SOLD_PRODUCT_PRODUCT_ID = \"sells_product_id\";\n// public static final String COL_SOLD_PRODUCT_PRICE = \"product_price\";\n// public static final String COL_SOLD_PRODUCT_QUANTITY = \"quantity\";\n// public static final String COL_SOLD_PRODUCT_TOTAL_PRICE = \"total_price\";\n// public static final String COL_SOLD_PRODUCT_PENDING_STATUS = \"pending_status\";\n//\n\n for (ProductListModel product : products){\n soldProductInfo.storeSoldProductInfo(new SoldProductModel(\n printInfo.getInvoiceTv(),\n printInfo.getInvoiceTv(),\n product.getpCode(),\n product.getpPrice(),\n product.getpSelectQuantity(),\n printInfo.getTotalAmountTv(),\n paymentStatus+\"\"\n ));\n\n }\n }", "public void upd2(Connection con, loginProfile prof) throws qdbException, qdbErrMessage, SQLException {\n res_id = mod_res_id;\n res_type = RES_TYPE_MOD;\n res_upd_user = prof.usr_id;\n\n super.checkTimeStamp(con);\n\n if (res_status.equalsIgnoreCase(RES_STATUS_ON) || res_status.equalsIgnoreCase(RES_STATUS_DATE)) {\n // Check if the question is ordered in 1,2,3....\n if (!checkQorder(con)) {\n //Questions are not in the correct order.\n throw new qdbErrMessage(\"MOD001\");\n }\n }\n\n //if the module is standard test or dynamic test\n //make sure that you can only turn the module online\n //if the test has question/criteria defined in it\n if (res_status.equalsIgnoreCase(RES_STATUS_ON)) {\n if (mod_type.equalsIgnoreCase(MOD_TYPE_TST)) {\n if (dbResourceContent.getResourceContentCount(con, mod_res_id) == 0) {\n res_status = RES_STATUS_OFF;\n }\n } else if (mod_type.equalsIgnoreCase(MOD_TYPE_DXT)) {\n if (dbModuleSpec.getModuleSpecCount(con, mod_res_id) == 0) {\n res_status = RES_STATUS_OFF;\n }\n }\n }\n\n super.updateStatus(con);\n\n // permission records have to be cleared no matter mod_instructor is specified or not\n dbResourcePermission.delUserRoleIsNull(con, mod_res_id);\n if (mod_instructor_ent_id_lst != null) {\n for (int i = 0; i < mod_instructor_ent_id_lst.length; i++) {\n dbResourcePermission.save(con, mod_res_id, mod_instructor_ent_id_lst[i], null, true, true, false);\n }\n }\n\n //Dennis, 2000-12-13, impl release control\n //If the new status == DATE, update the eff_start/end_datetime in Module\n //if(res_status.equalsIgnoreCase(RES_STATUS_DATE))\n //2001-01-05, all status will have eff datetime\n updateEffDatetime(con);\n }", "@Test\n\tvoid update() {\n\t\tfinal UserOrgEditionVo userEdit = new UserOrgEditionVo();\n\t\tuserEdit.setId(\"flast1\");\n\t\tuserEdit.setFirstName(\"FirstA\");\n\t\tuserEdit.setLastName(\"LastA\");\n\t\tuserEdit.setCompany(\"ing\");\n\t\tuserEdit.setMail(\"[email protected]\");\n\t\tfinal List<String> groups = new ArrayList<>();\n\t\tgroups.add(\"dig rha\");\n\t\tuserEdit.setGroups(groups);\n\t\tinitSpringSecurityContext(\"fdaugan\");\n\t\tresource.update(userEdit);\n\t\tfinal TableItem<UserOrgVo> tableItem = resource.findAll(null, null, \"flast1\", newUriInfoAsc(\"id\"));\n\t\tAssertions.assertEquals(1, tableItem.getRecordsTotal());\n\t\tAssertions.assertEquals(1, tableItem.getRecordsFiltered());\n\t\tAssertions.assertEquals(1, tableItem.getData().size());\n\n\t\tfinal UserOrgVo user = tableItem.getData().get(0);\n\t\tAssertions.assertEquals(\"flast1\", user.getId());\n\t\tAssertions.assertEquals(\"Firsta\", user.getFirstName());\n\t\tAssertions.assertEquals(\"Lasta\", user.getLastName());\n\t\tAssertions.assertEquals(\"ing\", user.getCompany());\n\t\tAssertions.assertEquals(\"[email protected]\", user.getMails().get(0));\n\t\tAssertions.assertEquals(1, user.getGroups().size());\n\t\tAssertions.assertEquals(\"DIG RHA\", user.getGroups().get(0).getName());\n\n\t\t// Rollback attributes\n\t\tuserEdit.setId(\"flast1\");\n\t\tuserEdit.setFirstName(\"First1\");\n\t\tuserEdit.setLastName(\"Last1\");\n\t\tuserEdit.setCompany(\"ing\");\n\t\tuserEdit.setMail(\"[email protected]\");\n\t\tuserEdit.setGroups(null);\n\t\tresource.update(userEdit);\n\t}", "public int updateByPrimaryKey(SysRoleMenu record) throws SQLException {\r\n int rows = sqlMapClient.update(\"SYS_ROLE_MENU.ibatorgenerated_updateByPrimaryKey\", record);\r\n return rows;\r\n }", "int updateByPrimaryKey(BsUserRole record);", "private void setPrivilagesToModifyUser(User user){\n\t\tsetFields(false);\n\t\tif (!LoginWindowController.loggedUser.getPermissions().equals(\"administrator\"))\n\t\t{\n\t\t\tif (LoginWindowController.loggedUser.getId() != user.getId()){\n\t\t\t\tif ((user.getPermissions().equals(\"manager\")) \n\t\t\t\t\t\t|| (user.getPermissions().equals(\"administrator\"))){\n\t\t\t\t\tsetFields(true);\n\t\t\t\t}\n\t\t\t\tif (user.getPermissions().equals(\"pracownik\")){\n\t\t\t\t\tsetFields(false);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tsetFields(false);\n\t\t\t\tdeleteMenuItem.setDisable(true);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (LoginWindowController.loggedUser.getId() == user.getId()){\n\t\t\t\tdeleteMenuItem.setDisable(true);\n\t\t\t\tuserPermissionsBox.setDisable(true);\n\t\t\t}\n\t\t}\n\t}", "void userChangeByAdmin(AdminUserDTO adminUserDTO) throws RecordExistException;", "@Ignore\n @Test public void modifySecretSeries_success() throws Exception {\n }", "int updateByPrimaryKey(UserRole record);", "int updateByPrimaryKey(UserRole record);", "@Override\r\n\tpublic void updatePsermission(Permission permission) {\n\t\tpermissionDao.updatePsermission(permission);\r\n\t}", "public static int updateSalemanLocation(int salemanId, double saleLat,\r\n\t\t\tdouble saleLng) {\r\n\r\n\t\tint row = 0;\r\n\r\n\t\ttry (Connection con = Connect.getConnection();) {\r\n\r\n\t\t\tCallableStatement cst = con\r\n\t\t\t\t\t.prepareCall(\"CALL update_saleman_location(?, ?, ?)\");\r\n\t\t\tcst.setInt(1, salemanId);\r\n\t\t\tcst.setDouble(2, saleLat);\r\n\t\t\tcst.setDouble(3, saleLng);\r\n\r\n\t\t\trow = cst.executeUpdate();\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\tlogger.error(\"\", e);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn row;\r\n\t}", "int updateExencion(final Long srvcId);" ]
[ "0.69769335", "0.5970946", "0.59365225", "0.58797055", "0.5728999", "0.5719415", "0.57161576", "0.5662299", "0.56141716", "0.548403", "0.5469036", "0.5424728", "0.54051447", "0.53985786", "0.5368918", "0.53183126", "0.5311137", "0.52834004", "0.5246379", "0.5213769", "0.52131534", "0.5209522", "0.51815265", "0.5181339", "0.5179757", "0.51710224", "0.51399684", "0.5130402", "0.5110539", "0.51051265", "0.5102917", "0.51002556", "0.50866175", "0.5082151", "0.50790155", "0.50731933", "0.50422865", "0.5039119", "0.5005074", "0.5005074", "0.49970192", "0.49964696", "0.4986319", "0.49756244", "0.49643493", "0.4960798", "0.4954256", "0.4953359", "0.49460936", "0.49359414", "0.4933373", "0.49328142", "0.4932033", "0.49289072", "0.492642", "0.49235207", "0.4921528", "0.49173477", "0.49155846", "0.49047908", "0.4901075", "0.49007487", "0.4896987", "0.48889962", "0.4882242", "0.48810348", "0.48690072", "0.48657858", "0.48533285", "0.48508236", "0.4847395", "0.4845517", "0.48445472", "0.48436764", "0.4840914", "0.48404562", "0.4839599", "0.48380834", "0.48281613", "0.48260525", "0.48229516", "0.48142645", "0.48105356", "0.48037294", "0.4802766", "0.48006636", "0.4793584", "0.4791348", "0.47907463", "0.4789685", "0.47879624", "0.4787303", "0.4785672", "0.47845745", "0.4783843", "0.47838357", "0.47838357", "0.47815827", "0.47777465", "0.47766638" ]
0.5325395
15
TODO Autogenerated method stub
@Override protected void onPreExecute() { super.onPreExecute(); dialog = new Dialog(Calendario.this); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.dialog_wait); dialog.getWindow().setBackgroundDrawableResource( R.drawable.dialog_rounded_corner_light_black); dialog.show(); dialog.setCancelable(true); dialog.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { // TODO Auto-generated method stub cancel(true); finish(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onCancel(DialogInterface dialog) { cancel(true); finish(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub mResult = ManagerData.getTurniForDataAndLuogoAndCategoria( getIntent().getLongExtra("data", 0), getIntent() .getStringExtra("luogo"), getIntent() .getStringExtra("categoria"));
@Override protected Void doInBackground(Void... params) { mResult = ManagerData.getTurniForDataAndFunzione(getIntent() .getLongExtra("dataFrom", 0), getIntent().getLongExtra("dataTo", 0), getIntent() .getStringExtra("personale"), funzione); if (!((Boolean) mResult.get("connectionError"))) listTurni = (ArrayList<Turno>) mResult.get("params"); return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n Trabajo newTrabajo = (Trabajo) data.getSerializableExtra(\"resultado\");\n\n if(newTrabajo.getId() != 0) { // Si NO es un Trabajo Nuevo Vacío, osea que no hayan Cancelado la operación\n Toast.makeText(getBaseContext(), \"Nuevo Trabajo: \" + newTrabajo.getDescripcion(), Toast.LENGTH_LONG).show();\n\n // Insertamos en la Categoría correspondiente el Nuevo Trabajo\n Categoria.CATEGORIAS_MOCK[newTrabajo.getCategoria().getId()].addTrabajo(newTrabajo);\n\n // Incorporamos a la \"listaTrabajos\" el Nuevo Trabajo\n this.listaTotalTrabajos();\n\n //Se notifica al adaptador de que el ArrayList que tiene asociado ha sufrido cambios (forzando asi a ir al metodo getView())\n adaptador.notifyDataSetChanged();\n }\n }", "@Override\n public void handleResult(Intent data) {\n }", "public void comprueba_maquina(String id) {\n JSONObject data = new JSONObject();\n\n try {\n data.put(Tags.ID_MAQUINA, id);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n Call<String> call = RetrofitClient.getClient().create(UserServices.class)\n .get_maquina(ApiUtils.getAuthenticationWhith(data));\n call.enqueue(new Callback<String>() {\n @Override\n public void onResponse(Call<String> call, Response<String> response) {\n try {\n JSONObject json = new JSONObject(response.body());\n String result = json.getString(Tags.RESULT);\n if (result.contains(Tags.OK)) {\n String id = json.getString(Tags.ID_MAQUINA);\n String nombre = json.getString(Tags.NOMBRE);\n System.out.println(\"Nombre de la máquina : \"+nombre);\n System.out.println(\"Pk de la máquina : \"+id);\n\n Intent temporizador = new Intent(LectorActivity.this, TemporizadorActivity.class);\n temporizador.putExtra(\"nombre_actividad\",nombre);\n temporizador.putExtra(\"id_maquina\",id);\n startActivity(temporizador);\n finish();\n }else{\n //intentalo de nuevo dialog Intentar de nuvo-> iniciarQrDetector();\n Toast.makeText(LectorActivity.this,\"Try again\",Toast.LENGTH_LONG).show();\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n\n @Override\n public void onFailure(Call<String> call, Throwable t) {\n\n }\n });\n }", "public String[] getPreguntasNivelCategoria(String idCategoria, String idNivel, String IndicePreg){\n //Creamos el conector de bases de datos\n AdmiSQLiteOpenHelper admin = new AdmiSQLiteOpenHelper(this, \"administracion\", null, 1 );\n // Abre la base de datos en modo lectura y escritura\n SQLiteDatabase BasesDeDatos = admin.getWritableDatabase();\n Cursor consultaId = BasesDeDatos.rawQuery(\"SELECT id, co_respuesta, co_categoria, co_nivel, pregunta, respuesta FROM t_preguntas WHERE co_categoria = \"+idCategoria+\" AND co_nivel = \" + idNivel , null);\n\n String contTotalPreg = getPreguntasTotal( idCategoria, idNivel );\n\n\n //Declaro arreglos. todo aqui debo definir el total de indices\n Integer[ ] iPregunta = new Integer[ Integer.parseInt(contTotalPreg) ];\n String[ ] sPreguntas = new String[ Integer.parseInt(contTotalPreg) ];\n String[ ] sRespuesta = new String[ Integer.parseInt(contTotalPreg) ];\n String[ ] sComplemento = new String[2];\n\n try {\n\n if (consultaId != null) {\n consultaId.moveToFirst();\n int indice = 0;\n\n do {\n // todo Asignamos el valor en nuestras variables para usarlos en lo que necesitemos\n iPregunta[indice] = consultaId.getInt(consultaId.getColumnIndex(\"id\"));\n sPreguntas[indice] = consultaId.getString(consultaId.getColumnIndex(\"pregunta\"));\n sRespuesta[indice] = consultaId.getString(consultaId.getColumnIndex(\"respuesta\"));\n indice++;\n\n\n } while ( consultaId.moveToNext() );\n\n //Todo -> Aqui PRegunta // Establecer Pregunta y Respuestas Dinamico todo\n labelPregunta.setText( sPreguntas[ Integer.parseInt( IndicePreg ) ] );\n\n int numero = (int)( Math.random()*4+1 );\n\n //todo aqui las preguntas complementarias Mosca aqui idea algo crazy\n sComplemento = getComplementoPreguntas( Integer.toString( iPregunta[Integer.parseInt( IndicePreg )] ) );\n\n if ( numero == 1 ){\n btnOpcion1.setText( sRespuesta[ Integer.parseInt( IndicePreg ) ] );\n btnOpcion1.setId( iPregunta[Integer.parseInt( IndicePreg )] );\n\n btnOpcion2.setText( sComplemento[0] );\n btnOpcion2.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n btnOpcion3.setText( sComplemento[1] );\n btnOpcion3.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n btnOpcion4.setText( sComplemento[2] );\n btnOpcion4.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n\n }\n\n if ( numero == 2 ){\n btnOpcion2.setText( sRespuesta[ Integer.parseInt( IndicePreg ) ] );\n btnOpcion2.setId( iPregunta[Integer.parseInt( IndicePreg )] );\n\n btnOpcion1.setText( sComplemento[0] );\n btnOpcion1.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n btnOpcion3.setText( sComplemento[1] );\n btnOpcion3.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n btnOpcion4.setText( sComplemento[2] );\n btnOpcion4.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n\n }\n\n if ( numero == 3 ){\n btnOpcion3.setText( sRespuesta[ Integer.parseInt( IndicePreg ) ] );\n btnOpcion3.setId( iPregunta[Integer.parseInt( IndicePreg )] );\n\n btnOpcion1.setText( sComplemento[0] );\n btnOpcion1.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n btnOpcion2.setText( sComplemento[1] );\n btnOpcion2.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n btnOpcion4.setText( sComplemento[2] );\n btnOpcion4.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n }\n\n if ( numero == 4 ){\n btnOpcion4.setText( sRespuesta[ Integer.parseInt( IndicePreg ) ] );\n btnOpcion4.setId( iPregunta[Integer.parseInt( IndicePreg )] );\n\n btnOpcion1.setText( sComplemento[0] );\n btnOpcion1.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n btnOpcion2.setText( sComplemento[1] );\n btnOpcion2.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n btnOpcion3.setText( sComplemento[2] );\n btnOpcion3.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n\n }\n\n }else{\n System.out.println( \" ------------- No hay datos ------------------\" );\n System.out.println();\n }\n\n } catch ( Exception e ) {\n System.err.println( e.getClass().getName() + \": \" + e.getMessage() );\n System.exit(0);\n }\n\n //Cerramos el cursor y la conexion con la base de datos\n consultaId.close();\n BasesDeDatos.close();\n\n return sPreguntas;\n }", "public void dificultad(View vista) {\n String dific = (String) ((Button) vista).getText();\n int dificultad = 1;\n if (dific.equals(getString(R.string.medio))) dificultad = 2;\n if (dific.equals(getString(R.string.dificil))) dificultad = 3;\n\n Intent in = new Intent(this, Gestion.class);\n in.putExtra(\"DIFICULTAD\", dificultad);\n /* en lugar de startActivity uso startActivityForResult. Esta comienza la actividad y\n recoge el resultado de una actividad que ya halla finalizado.\n parametros: in, el intento\n 1, el codigo de solicitud si >= 0, este código se devolverá en\n onActivityResult() cuando finalice la actividad.\n */\n // startActivity(in);\n startActivityForResult(in, 1);\n }", "protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n try {\n String parametro = data.getStringExtra(\"parametro\");\n String valor = data.getStringExtra(\"valor\");\n Id = valor;\n String descripcion = data.getStringExtra(\"descripcion\");\n if (requestCode == 1) {\n EditText tecnico = (EditText) findViewById(R.id.tecnico);\n tecnico.setText(descripcion);\n }\n }catch (Exception e){\n e.printStackTrace();\n }\n }", "@Override\n public void onClick(DialogInterface dialogInterface, int i) {\n Intent returnIntent = new Intent();\n returnIntent.putParcelableArrayListExtra(\"palautettu_opeteltavat\", opeteltavatsanat);\n returnIntent.putExtra(\"jatketaanko\",false);\n setResult(Activity.RESULT_OK, returnIntent);\n finish();\n }", "public List<tipoDetalle> obtenerDetallesBD(){\n List<tipoDetalle> detalles=new ArrayList<>();\n try{\n //Obteniendo el ID del auto desde la activity de Mostrar_datos\n String idAuto;\n Bundle extras=getIntent().getExtras();\n if(extras!=null)\n {\n idAuto=extras.getString(\"id_auto\");\n Log.e(\"auto\",\"el auto id es= \"+idAuto);\n ResultSet rs = (ResultSet) TNT.mostrarDetalles(idAuto);\n while (rs.next()){\n detalles.add(new tipoDetalle(rs.getString(\"id\"), rs.getString(\"nombre\"), rs.getString(\"fecha_entrada\"), rs.getString(\"fecha_salida\"), rs.getString(\"fecha_terminacion\"), rs.getString(\"estado\"), rs.getString(\"descripcion\"), rs.getString(\"costo\")));\n }\n }\n }catch(SQLException e){\n Toast.makeText(getApplicationContext(),e.getMessage(),Toast.LENGTH_SHORT).show();\n }\n return detalles;\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if(requestCode==77){\n if(resultCode==RESULT_OK){\n if (data!=null){\n String nombre = data.getStringExtra(\"nombre\");\n String cantidad = data.getStringExtra(\"cantidad\");\n\n // int cantnum = Integer.parseInt(cantidad);\n\n Listado list = new Listado(nombre, Integer.parseInt(cantidad));\n\n listado.add(list);\n adapter.notifyItemInserted(listado.size());\n } else if (resultCode==MainActivity.RESULT_CANCELED){\n Toast.makeText(this, \"INTRODUCE DATOS\", Toast.LENGTH_SHORT).show();\n }\n }\n }\n\n }", "private void getDataFromIntent(){\n Bundle extras = getIntent().getExtras();\n //para recibir los datos de una manera segura, se hace una verificacion\n //para ver si los extras no son nulos\n if (extras!=null){\n //en caso de tener datos en el extra, se obtendran y guardaran en variables para su uso deseado\n String data = extras.getString(\"data\");\n boolean isTrue = extras.getBoolean(\"boolean\");\n if (isTrue){\n tvData.setText(data);\n Toast.makeText(this, \"Se recibio un booleano desde MainActivity.\", Toast.LENGTH_SHORT).show();\n }\n else{\n Toast.makeText(this, \"No se recibio nada :c\", Toast.LENGTH_LONG).show();\n }\n //en caso de no tener daos dentro dle extra, entrara a esta parte de la condicion\n }else{\n Toast.makeText(this, \"No hay datos extras\", Toast.LENGTH_SHORT).show();\n }\n\n }", "protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if(resultCode==RESULT_OK&&requestCode==ACTIVITY_DOS){\n\n String nom=data.getExtras().getString(\"nombreIntent\");\n String loc=data.getExtras().getString(\"localidadIntent\");\n String pro=data.getExtras().getString(\"provinciaIntent\");\n boolean bueno = data.getExtras().getBoolean(\"eleccionIntent\");\n if(bueno==true) {\n notificationExtendida(nom, \"De \" + loc + \", (\"+pro+\")\",nom,loc,pro,1);\n }else{\n msg1.setText(nom);\n msg2.setText(loc);\n msg3.setText(pro);\n }\n }\n else{\n Toast.makeText(getApplicationContext(),\"ERROR EN LA APLICACION\", Toast.LENGTH_SHORT).show();\n }\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data){\n if (resultCode == Activity.RESULT_OK && requestCode == 1) {\n palabras=data.getParcelableArrayListExtra(\"palabras\");\n adaptador.notifyDataSetChanged();\n //NO ME MUESTRA LOS CAMBIOS\n adaptador = new Adaptador(this, R.layout.elemento, palabras);\n lt.setAdapter(adaptador);\n //guardamos en el xml\n xml();\n }else{\n tostada(\"miausnasda\");\n }\n adaptador.notifyDataSetChanged();\n }", "public void vistaApoyo (View view){\n Intent interfaz = new Intent(this,MainApoyo.class);\n Intent enviar = new Intent( view.getContext(), MainNivelesReto.class );\n //Metodo que me permite crear variable\n enviar.putExtra(\"IdCategoria\", getIntent().getStringExtra(\"IdCategoria\") );\n startActivity(interfaz);\n finish();\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if(requestCode == 78 && resultCode == RESULT_OK ){\n\n user = data.getExtras().getString(\"usuarioP\");\n pass = data.getExtras().getString(\"contraseñaP\");\n correo = data.getExtras().getString(\"correoP\");\n\n // tTemporal2.setText(\"vengo de perfil\" + user + \"\\n\" + pass);\n }\n\n super.onActivityResult(requestCode, resultCode, data);\n }", "private void getDataBahasa(){\n\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.lihat_program_like(\"Bahasa\");\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1= response.body().getStatus();\n if (value1.equals(\"1\")){\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else {\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "public void vistaInterfazNiveles (View view){\n Intent interfaz = new Intent(this,MainActivity.class);\n //Intancio el Objeto Intent que necesito enviar la información\n Intent enviar = new Intent( view.getContext(), MainNivelesReto.class );\n //Metodo que me permite crear variable\n enviar.putExtra(\"IdCategoria\", getIntent().getStringExtra(\"IdCategoria\") );\n startActivity(interfaz);\n finish();\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent intent) {\n // TODO Auto-generated method stub\n if ((requestCode == request_code) && (resultCode == RESULT_OK)) {\n\n // Toast.makeText(this, intent.getStringExtra(\"resultado\"), Toast.LENGTH_LONG).show();\n inEquipo.setText(intent.getStringExtra(\"resultado\"));\n }\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (requestCode == INTENTO_NUEVO_CLIENTE) {\n if (resultCode == RESULT_OK) {\n\n // obtengo los datos del cliente lo meto en un objeto cliente y lo meto en el arrylist\n\n String nombre=data.getStringExtra(\"nombre\");\n int cantidad=Integer.parseInt(data.getStringExtra(\"cantidad\"));\n String fecha=data.getStringExtra(\"fecha\");\n // creo un objeto cliente\n listaCuentas.add(new Cliente(nombre,cantidad,fecha));\n rellenarListview(listaCuentas);\n\n // mientras escribo el archivo\n }\n if (resultCode == RESULT_CANCELED) {\n // no hago nada\n\n\n }\n\n\n }\n }", "private void getDataDai(){\n\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.lihat_program_like(\"Dai\");\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1= response.body().getStatus();\n if (value1.equals(\"1\")){\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else {\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "public void retornaParaTelaAnterior() {\n Intent intentMessage=new Intent();\n setResult(CODE_NOVO_GASTO, intentMessage);\n finish();\n }", "@Override\n protected void onActivityResult(int peticion, int codigo, @Nullable Intent puntuacion) {\n if (peticion != 1 || codigo != RESULT_OK) return;\n\n int resultado = puntuacion.getIntExtra(\"PUNTUACION\", 0);\n\n if (resultado > record) {\n record = resultado;\n // lo mostramos en el textview\n TextView caja = (TextView) findViewById(R.id.record);\n caja.setText(\"Record: \" + resultado);\n // guardamos el record\n guardaRecord();\n }\n String puntuacionPartida = \"Tu puntuacion es \" + resultado;\n Toast miToast = Toast.makeText(this, puntuacionPartida, Toast.LENGTH_SHORT);\n miToast.setGravity(Gravity.CENTER, 0, 0);\n miToast.show();\n\n super.onActivityResult(peticion, codigo, puntuacion);\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(getApplicationContext(), ActivitySonidoImagenText.class);\n //guardamos el id del boton\n intent.putExtra(\"category\", mCategory);\n intent.putExtra(\"boton\", v.getId());\n startActivityForResult(intent, RESULT_OK);\n //Log.d(\"ID DEL BOTON\", String.valueOf(v.getId()));\n }", "private void getDataModern(){\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.lihat_jenis(\"Modern\");\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1 = response.body().getStatus();\n if (value1.equals(\"1\")){\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else {\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "@Override\n\t\t\t public void resultLoaded(int err, String reason, String result) {\n\t\t\t \n\t\t\t\t dialog.cancel();\n\t\t\t\t \n\t\t\t\t if (err == 0) {//成功获取数据的情况\n\t\t\t\t\t \n\t\t\t\t\t try {\n\t\t\t\t\t\t \n\t\t\t\t\tJSONObject resultObject=new JSONObject(result);\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t if(resultObject.isNull(\"result\")){//判断车次是否存在\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tToast.makeText(getActivity(), \"航班不存在...\", Toast.LENGTH_SHORT).show();\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\n\t\t\t\t\t\t //成功获取到数据,在此处仅专递数据,并不对数据进行处理\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tBundle bundle=new Bundle();\n\t\t\t\t\t\t\t\tbundle.putString(\"result\", result);//将JSON数据直接传递过去\n\t\t\t\t\t\t\t\tbundle.putString(\"date\", flightDataShow.getText().toString().trim());//将日期传递过去\n\t\t\t\t\t\t\t\tIntent intent=new Intent(getActivity(),FlightResultActivity.class);\n\t\t\t\t\t\t\t\tintent.putExtra(\"FlightBundle\", bundle);\n\t\t\t\t\t\t\t\t startActivity(intent);\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\n\t\t\t \t\t} catch (JSONException 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\t\t\t\t\t\t \n\t\t\t\t\t} else {//非成功获取数据\n\t\t\t\t\t\t\n\t\t\t\t\t\t Toast.makeText(getActivity(), \"数据获取失败...\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t \n\t\t\t }", "private void getDataTakfidul(){\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.lihat_program_like(\"Takhfidul Qur'an\");\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1 = response.body().getStatus();\n if (value1.equals(\"1\")){\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else {\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "private void getDataLainya(){\n\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.lihat_jenis(\"Komprehensif\");\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1= response.body().getStatus();\n if (value1.equals(\"1\")){\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else {\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "@Override\n protected void onActivityResult(int requestCode,\n int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (resultCode==RESULT_OK) {\n Bundle datos = data.getExtras();\n Institucion inst = (Institucion) datos.getSerializable(\"institucion\");\n if (requestCode == SOLICITUD_NUEVA) {\n mDatos.add(inst);\n adapterInst.notifyItemInserted(mDatos.size()-1);\n }\n else {\n int operacion = datos.getInt(\"operacion\");\n int pos = mDatos.indexOf(inst);\n if (operacion == OPERACION_ELIMINACION) {\n mDatos.remove(pos);\n adapterInst.notifyItemRemoved(pos);\n }\n else {\n mDatos.set(pos,inst);\n adapterInst.notifyItemChanged(pos);\n }\n }\n muestraMensaje(R.string.mensaje_exito_operacion);\n }\n }", "public void onActivityResult(int requestCode, int resultCode, Intent data) {\n\n if (requestCode == 1001) {\n if (resultCode == getActivity().RESULT_OK) {\n //fetch the integer we passed into the dialog result which corresponds to the list position\n\n int nResult = data.getIntExtra(ResultsDialogActivity.POSITION, -99);\n\n\n if (nResult != -99) {\n try {\n mStrImageUrl = \"\";\n YelpResultsData.Business biz = mYelpResultsData.businesses.get(nResult);\n mNameField.setText(biz.name);\n mAddressField.setText(biz.location.address.get(0));\n mPhoneField.setText(PhoneNumberUtils.formatNumber(biz.phone));\n mYelpField.setText(biz.url);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n fetchPhoto(mPhotoView);\n }\n }\n if (resultCode == getActivity().RESULT_CANCELED) {\n //do nothing\n }\n }\n }", "public static void getCamis(Context context,View view,ListView listViewData){\n\n String dba=((Inspections)listViewData.getItemAtPosition(listViewData.getPositionForView(view))).getDba();\n String camis=((Inspections)listViewData.getItemAtPosition(listViewData.getPositionForView(view))).getCamis();\n\n if (AppConstant.DEBUG) Log.i(className+\">\",\"Camis:\"+camis);\n\n //Another way of getting data\n //TextView c = (TextView) view.findViewById(R.id.txt_dba);\n\n\n //We want to pass in the previous report - will be used in analytics\n Intent intent = new Intent(context,InspectionActivity.class);\n intent.putExtra(\"CAMIS\",camis);\n intent.putExtra(\"DBA\",dba);\n\n //We want to see if last report was favorites\n\n if(Reports.getLastReportRun().getReportName().equals(Reports.FAVORITE_RESTAURANTS)){\n if (AppConstant.DEBUG) Log.i(className+\">\",\"last report was favorite\");\n intent.putExtra(\"FAVORITES\",true);\n }\n\n\n context.startActivity(intent);\n\n //Need to pass this in as bundle - just a cipher - we\n Reports r=new Reports();\n r.setReportName(Reports.GET_BY_CAMIS);\n Bundle bundle=new Bundle();\n bundle.putParcelable(Reports.PARCEBLABLE_TEXT_FOR_EXTRA,r);\n\n Intent serviceToRun;\n serviceToRun =new Intent(context, DataProvider.class);\n serviceToRun.putExtra(\"DataToGet\",\"CAMIS\");\n serviceToRun.putExtra(\"CAMIS\",camis);\n //Maybe get rid of this and just use the data to get\n serviceToRun.putExtras(bundle);\n\n context.startService(serviceToRun);\n }", "@Override\n public void onClick(View view) {\n context.startActivity(FirebaseDBReadSingleActivity.getActIntent((Activity) context).putExtra(\"data\", daftarBarang.get(position)));\n }", "@Override\n public void onClick(View view) {\n context.startActivity(FirebaseDBReadSingleActivity.getActIntent((Activity) context).putExtra(\"data\", daftarBarang.get(position)));\n }", "@Override\n public void onActivityResult (int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n switch (requestCode)\n {\n case Values.REQ_ACT_2:\n {\n // si el resultado que viene del activity2 es OK\n if (resultCode == RESULT_OK)\n {\n // ponemos el texto que viene en el intent del activity2 en el edit text del activity1\n tvHello.setText(data.getStringExtra(Values.CLAVE_INTENT));\n\n // GUARDAR DATOS\n editor = sharedPref.edit();\n String valor = data.getStringExtra(Values.CLAVE_INTENT);\n editor.putString(getString(R.string.clave), valor);\n editor.apply();\n }\n break;\n }\n\n }\n\n\n }", "@Override\r\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tIntent datosSustento = new Intent(context,DatosSustentoActivity.class);\r\n\t\t\t\t\tdatosSustento.putExtra(DatosSustentoActivity.TIPO_ACCION, DatosSustentoActivity.ACCION_ACTUALIZAR);\r\n\t\t\t\t\tdatosSustento.putExtra(DatosSustentoActivity.CODIGO_CLIENTE, codigo_cliente);\r\n\t\t\t\t\tdatosSustento.putExtra(DatosSustentoActivity.CODIGO_PLAN, codigo_plan);\r\n\t\t\t\t\tdatosSustento.putExtra(DatosSustentoActivity.CODIGO_ACTIVIDAD, codigo_actividad);\t\t\t\t\t\r\n\t\t\t\t\tdatosSustento.putExtra(DatosSustentoActivity.CODIGO_SUSTENTO, sustentoTemporal.getCodigoSustento());\r\n\t\t\t\t\tdatosSustento.putExtra(DatosSustentoActivity.DESCRIPCION_SUSTENTO, sustentoTemporal.getDescripcionActividad());\r\n\t\t\t\t\tdatosSustento.putExtra(DatosSustentoActivity.TIPO_SUSTENTO, sustentoTemporal.getTipoActividad());\r\n\t\t\t\t\tdatosSustento.putExtra(DatosSustentoActivity.FECHA_VISITA, sustentoTemporal.getFechaVisita());\t\t\t\t\t\r\n\t\t\t\t\tcontext.startActivity(datosSustento);\r\n\t\t\t\t}", "private void solicitarDatos() {\n Intent intent = Henson.with(this).gotoAlumnoActivity().edad(mAlumno.getEdad()).nombre(\n mAlumno.getNombre()).build();\n startActivityForResult(intent, RC_ALUMNO);\n }", "public void onActivityResult(int i, int i2, Intent intent) {\n C1846e eVar;\n Bundle extras = intent.getExtras();\n if (!CheckActivityResult(i, i2, intent)) {\n this._isCheck = extras.getBoolean(\"PantilterCheckRange\");\n String string = extras.getString(\"PantilterMode\");\n C2028e a = C2253z.m9680a((Context) null, false);\n if (a != null) {\n eVar = a.mo5285i();\n if (eVar != null && this._isCheck) {\n string = eVar.mo4656E();\n }\n } else {\n eVar = null;\n }\n if (string != null && !string.equalsIgnoreCase(\"\")) {\n if (string.equalsIgnoreCase(\"manual\")) {\n Intent intent2 = new Intent(this._context, LiveViewMoviePantilterManualMovieActivity.class);\n Activity activity = (Activity) this._context;\n activity.finish();\n activity.startActivity(intent2);\n activity.overridePendingTransition(0, 0);\n } else if (string.equalsIgnoreCase(\"preset\") || string.equalsIgnoreCase(\"presethome\") || string.equalsIgnoreCase(\"presetpausehome\")) {\n Intent intent3 = new Intent(this._context, LiveViewMoviePantilterPresetActivity.class);\n Activity activity2 = (Activity) this._context;\n activity2.finish();\n activity2.startActivity(intent3);\n activity2.overridePendingTransition(0, 0);\n } else if (string.equalsIgnoreCase(\"party\") || string.equalsIgnoreCase(\"partypause\") || string.equalsIgnoreCase(\"movingobj\") || string.equalsIgnoreCase(\"mvobj\") || string.equalsIgnoreCase(\"movingobjpause\")) {\n Intent intent4 = new Intent(this._context, LiveViewMoviePantilterAutoMovieActivity.class);\n Activity activity3 = (Activity) this._context;\n activity3.finish();\n activity3.startActivity(intent4);\n activity3.overridePendingTransition(0, 0);\n } else if (eVar == null || eVar.mo4656E().equalsIgnoreCase(\"\") || !eVar.mo4656E().equalsIgnoreCase(\"noconnect\")) {\n if (eVar != null && !eVar.mo4656E().equalsIgnoreCase(\"\") && eVar.mo4656E().equalsIgnoreCase(\"error\") && this._isCheck) {\n C2331d.m10114a((Activity) this, C2328a.ON_PANTILTER_ERROR, (Bundle) null);\n }\n } else if (this._isCheck) {\n C2331d.m10114a((Activity) this, C2328a.ON_PANTILTER_NO_CONNECT, (Bundle) null);\n }\n }\n if (this.f12125b != null) {\n this.f12125b.mo8864c(this._isPictureRecMode);\n }\n }\n }", "@Override\n protected void onItemClickListener(int adapterPosition, int layoutPosition) {\n\n\n CondicaoPagamento condpgto = adaptercondpgto.getItems().get(adapterPosition);\n if (selecionandoCondPgto) {\n Intent data = new Intent();\n data.putExtra(\"condpgto_id\", condpgto.getIdcodicaopagamento());\n setResult(RESULT_OK, data);\n finish();\n } else {\n idcondpgto = condpgto.getIdcodicaopagamento();\n nomecondpgto = condpgto.getDescricao();\n\n }\n\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == PICK_CONTACT_REQUEST) {\n // Make sure the request was successful\n if (resultCode == RESULT_OK) {\n Bundle extras = data.getExtras();\n long id = extras.getLong(\"id\");\n try {\n dbo.open();\n }\n catch (SQLException ex){\n\n }\n Usuario user = dbo.findAccount((int)id);\n miembrosGpo.add(user);\n nombres.add(user.getNombre() + \" \" + user.getApellidos());\n\n adapter.notifyDataSetChanged();\n\n if (existente){\n dbo.addPersonToGroup(grupo, user);\n }\n\n System.out.println(\"lala\");\n }\n }\n }", "private void obterDadosActivityLista() {\r\n bNnovo = getIntent().getExtras().getBoolean(\"novo\");\r\n }", "@Override\n protected void onPostExecute (String Resultado)\n {\n super.onPostExecute(Resultado);\n try{\n Log.e(\"Salida\", Resultado);\n Toast.makeText(contexto, Resultado,Toast.LENGTH_SHORT).show();\n //Se mandan esos datos a otra actividad lista en formato string\n //Intent i = new Intent(contexto, MapsActivity.class);\n\n\n }catch (Throwable t){\n Log.e(\"Falla\",t.toString());\n }\n }", "private void getDataSalaf(){\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.lihat_jenis(\"Salaf\");\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1 = response.body().getStatus();\n if (value1.equals(\"1\")){\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else {\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "private void obtener(){\n Bundle bundle = getIntent().getExtras();\n id = bundle.getString(\"id\");\n nombre = bundle.getString(\"nombre\");\n apellido = bundle.getString(\"apellido\");\n telefono = bundle.getInt(\"telefono\");\n //seteo de datos\n editTextN.setText(nombre);\n editTextA.setText(apellido);\n editTextT.setText(String.valueOf(telefono));\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (resultCode == RESULT_OK) {\n switch (requestCode) {\n case 0:\n searchDate();\n break;\n case 1://客户类型选择\n lxEditText.setText(data.getExtras().getString(\"name\"));\n mTypes = data.getExtras().getString(\"id\");\n if (mTypes.equals(\"0\") || mTypes.equals(\"5\")) {\n llDj.setVisibility(View.GONE);\n } else {\n llDj.setVisibility(View.VISIBLE);\n }\n typeid = \"\";\n tvDj.setText(\"\");\n String name = data.getExtras().getString(\"name\");\n if (name.equals(\"客户\") || name.equals(\"渠道\")) {\n xmjdCheckBox.setEnabled(true);\n } else {\n xmjdCheckBox.setEnabled(false);\n }\n break;\n case 2:\n jdEditText.setText(data.getExtras().getString(\"dictmc\"));\n jdId = data.getExtras().getString(\"id\");\n break;\n case 3://客户等级\n typeid = data.getStringExtra(\"CHOICE_RESULT_ID\");\n tvDj.setText(data.getStringExtra(\"CHOICE_RESULT_TEXT\"));\n break;\n case 4://区域\n areatypeid = data.getStringExtra(\"id\");\n tvQy.setText(data.getStringExtra(\"name\"));\n break;\n case 5:\n tvDq.setText(data.getStringExtra(\"text\"));\n /*areaid 省ID\n cityid 市ID\n countyid 县区ID*/\n areaid = data.getStringExtra(\"provinceId\");\n cityid = data.getStringExtra(\"cityId\");\n countyid = data.getStringExtra(\"areaId\");\n break;\n\n }\n\n }\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent();\n intent.setClass(getApplicationContext(), Atividade2.class);\n //envio do parametro chamado parametro1\n intent.putExtra(\"parametro1\", \"este é um parametro\");\n startActivity(intent);\n }", "@Override\r\n\tpublic void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\r\n\r\n\t\tif (HeadhunterPublic.RESULT_ACTIVITY_CODE == requestCode) {\r\n\t\t\tswitch (resultCode) {\r\n\t\t\tcase HeadhunterPublic.RESULT_REWARDINOF_OK: {\r\n\t\t\t\t// 获取悬赏任务详细界面传递过来的数据\r\n\t\t\t\tBundle bundle = data.getExtras();\r\n\t\t\t\tif (null != bundle) {\r\n\t\t\t\t\tString strTaskId = bundle\r\n\t\t\t\t\t\t\t.getString(HeadhunterPublic.REWARD_DATATRANSFER_TASKID);\r\n\t\t\t\t\tif(null == strTaskId){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(strTaskId.isEmpty()){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// 获取收藏状态\r\n\t\t\t\t\tString strCollectionStatus = bundle\r\n\t\t\t\t\t\t\t.getString(HeadhunterPublic.REWARD_DATATRANSFER_COLLECTIONFLAG);\r\n\t\t\t\t\t// 获取应聘状态\r\n\t\t\t\t\tString strCandidateStatus = bundle\r\n\t\t\t\t\t\t\t.getString(HeadhunterPublic.REWARD_DATATRANSFER_CANDIDATEFLAG);\r\n\t\t\t\t\t// 获取是否已读状态\r\n//\t\t\t\t\tString strReadStatus = bundle\r\n//\t\t\t\t\t\t\t.getString(HeadhunterPublic.REWARD_DATATRANSFER_REWARDREAD);\r\n\t\t\t\t\t// 获取公司收藏状态\r\n//\t\t\t\t\tString strCompanyCollectionStatus = bundle\r\n//\t\t\t\t\t\t\t.getString(HeadhunterPublic.REWARD_DATATRANSFER_COMPANYCOLLECTIONFLAG);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(null == m_listRewardInfo){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tint nChooseItem = m_rifAdapter.getChooseItem();\r\n//\t\t\t\t\tint nChooseItem = m_nChooseItem;\r\n\t\t\t\t\tif(nChooseItem < 0 || nChooseItem > m_listRewardInfo.size() - 1){\r\n\t\t\t\t\t\treturn;\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\tRewardData rld = m_listRewardInfo.get(nChooseItem);\r\n\t\t\t\t\tif (null != rld) {\r\n\t\t\t\t\t\tboolean bChange = false;\r\n\t\t\t\t\t\t// 更新应聘状态\r\n\t\t\t\t\t\tif(null != strCandidateStatus){\r\n\t\t\t\t\t\t\tif(!strCandidateStatus.isEmpty()){\r\n\t\t\t\t\t\t\t\trld.setAction_1(strCandidateStatus);\r\n\t\t\t\t\t\t\t\tbChange = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// 更新收藏状态\r\n\t\t\t\t\t\tif(null != strCollectionStatus){\r\n\t\t\t\t\t\t\tif(!strCollectionStatus.isEmpty()){\r\n\t\t\t\t\t\t\t\trld.setAction_3(strCollectionStatus);\r\n\t\t\t\t\t\t\t\tbChange = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// 更新是否已读状态\r\n//\t\t\t\t\t\tif(null != strReadStatus){\r\n//\t\t\t\t\t\t\tif(!strReadStatus.isEmpty()){\r\n//\t\t\t\t\t\t\t\trld.setAction_5(strReadStatus);\r\n//\t\t\t\t\t\t\t\t// 保存已读的任务ID\r\n//\t\t\t\t\t\t\t\tsaveReadRewardID(strTaskId);\r\n//\t\t\t\t\t\t\t\tif(null != m_rifAdapter){\r\n//\t\t\t\t\t\t\t\t\tm_rifAdapter.notifyDataSetChanged();\r\n//\t\t\t\t\t\t\t\t}\r\n//\t\t\t\t\t\t\t}\r\n//\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// 更新公司收藏状态\r\n//\t\t\t\t\t\tif(null != strCompanyCollectionStatus &&\r\n//\t\t\t\t\t\t\t\t!strCompanyCollectionStatus.isEmpty()){\r\n//\t\t\t\t\t\t\trld.setM27_status(strCompanyCollectionStatus);\r\n//\t\t\t\t\t\t\tbChange = true;\r\n//\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(bChange){\r\n\t\t\t\t\t\t\t// 把状态更新到缓存中\r\n\t\t\t\t\t\t\tupRewardData(rld);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase HeadhunterPublic.RESULT_REWARDSEARCH_OK: {\r\n\t\t\t\t// 获取悬赏任务搜索设置界面传递过来的数据\r\n\t\t\t\tBundle bundle = data.getExtras();\r\n\t\t\t\tif (null != bundle) {\r\n\t\t\t\t\tm_filters = (RewardFilterCondition) bundle\r\n\t\t\t\t\t\t\t.getSerializable(HeadhunterPublic.REWARDSEARCH_DATATRANSFER_FILTERS);\r\n\r\n\t\t\t\t\tm_bIsSearch = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tm_nListStatus = LISTVIEW_STATUS_ONREFRESH;\r\n\t\t\t\t\tm_lvReward.setLoading();\r\n\t\t\t\t\t\r\n\t\t\t\t\t// 获取悬赏任务列表\r\n\t\t\t\t\tstartGetData(HeadhunterPublic.REWARD_DIRECTIONTYPE_NEW, \"\",\r\n\t\t\t\t\t\t\tm_nRequestType);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase -1: // 登录成功\r\n\t\t\t\t{\r\n\t\t\t\t\t// 检查手机是否认证\r\n//\t\t\t\t\tcheckMobileAuthStatus();\r\n\t\t\t\t\tshowPublishRewardActivity();\r\n\t\t\t\t}\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}else if(2 == requestCode){\r\n\t\t\tif(-1 == resultCode){\r\n\t\t\t\t// 进入悬赏发布界面\r\n\t\t\t\tshowPublishRewardActivity();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t}", "private void getIntentData() {\n\t\ttry{\n\t\t\tIN_CATEGORYID = getIntent().getStringExtra(CATEGORY_ID) == null ? \"0\" : getIntent().getStringExtra(CATEGORY_ID);\n\t\t\tIN_ARTICLENAME = getIntent().getStringExtra(ARTICLENAME) == null ? \"\" : getIntent().getStringExtra(ARTICLENAME) ;\n\t\t\tIN_ARTICLEID = getIntent().getStringExtra(ARTICLEID) == null ? \"\" : getIntent().getStringExtra(ARTICLEID);\n\t\t}catch(Exception e){\n\t\t}\n\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {\n\t\tIntent intent;\n\t\tif (\"0\".equals(dpjDinDanAdapter.getData().get(position).getUnion_type())) {\n\t\t\tintent = new Intent(getActivity(), TuiKuanDinDanDetailActivity.class);\n\t\t\tintent.putExtra(\"order_id\", dpjDinDanAdapter.getData().get(position).getOrder_id());\n\t\t\tstartActivityForResult(intent, 100);\n\t\t}else if (\"3\".equals(dpjDinDanAdapter.getData().get(position).getUnion_type())) {\n\t\t\tintent = new Intent(getActivity(), CCQDinDanDetailActivity.class);\n\t\t\tintent.putExtra(\"order_id\", dpjDinDanAdapter.getData().get(position).getOrder_id());\n\t\t\tstartActivityForResult(intent, 200);\n\t\t}else if (\"2\".equals(dpjDinDanAdapter.getData().get(position).getUnion_type())) {\n\t\t\tintent = new Intent(getActivity(), XiaofeiMaidanDetailActivity.class);\n\t\t\tintent.putExtra(\"order_id\", dpjDinDanAdapter.getData().get(position).getOrder_id());\n\t\t\tstartActivityForResult(intent, 300);\n\t\t}\n\t}", "public void btnContinuarInterfaz(View view){\n\n String IdCategoria = getIntent().getStringExtra(\"IdCategoria\");\n String IdNivel = getIntent().getStringExtra(\"IdNivel\");\n String contPregPut = getIntent().getStringExtra(\"IndicePreg\");\n String iContador = getIntent().getStringExtra(\"iContador\");\n String IndicePreg = getIntent().getStringExtra(\"IndicePreg\");\n\n String contTotalPreg = getPreguntasTotal(IdCategoria, IdNivel );\n\n int nuevoIndice = Integer.parseInt(IndicePreg);;\n int nuevoIContador = Integer.parseInt(iContador);\n\n if ( Integer.parseInt(contPregPut) < Integer.parseInt(contTotalPreg) ){\n nuevoIndice++; //no tocar el indice\n nuevoIContador++;\n\n }else{\n\n if ( Integer.parseInt(contPregPut) >= Integer.parseInt(contTotalPreg) ){\n // Toast.makeText(this, \"Entro\", Toast.LENGTH_SHORT).show();\n System.out.println( \" ------------- Limite total de las preguntas ------------------\" );\n System.out.println();\n\n }else{\n nuevoIndice = Integer.parseInt(contTotalPreg) - 1;\n nuevoIContador = nuevoIContador;\n }\n }\n\n //Metodo que me permite crear variable\n Intent interfaz = new Intent(this,MainRetoSaber.class);\n interfaz.putExtra(\"IdCategoria\", IdCategoria );\n interfaz.putExtra(\"IdNivel\", IdNivel );\n interfaz.putExtra(\"iContador\", String.valueOf(nuevoIContador) );\n interfaz.putExtra(\"IndicePreg\", String.valueOf(nuevoIndice) );\n interfaz.putExtra(\"IdEstudio\", consultarEstudioUltimaId() ); // todo posible error\n //Activa la intent y envia el objeto con la variable.\n startActivity(interfaz);\n finish();\n\n }", "@Override\r\n public void onClick(View v) {\n String robodata=\"robot data\";\r\n String stringdata = \"throwing\";\r\n Intent mysqlintent = new Intent(collect_Data.this,mysql.class); //defining the intent.\r\n mysqlintent.putExtra(robodata, stringdata); //putting the data into the intent\r\n startActivity(mysqlintent); //launching the mysql activity\r\n }", "@Override\n public void onResponse(Call<Response_cek> call, Response<Response_cek> response) {\n data = response.body().getResult();\n\n\n\n if (data.size()==0) {\n if (quiz_tampung.equals(\"1\")){\n Intent intent = new Intent(getApplicationContext(), menu_quiz_1.class);\n Bundle b = new Bundle();\n // Toast.makeText(getApplicationContext() ,\"Anda Sudah Quiz\", Toast.LENGTH_LONG).show();\n //Menyisipkan tipe data String ke dalam obyek bundle\n b.putString(\"id\", nis.getText().toString());\n b.putString(\"nama\", nama.getText().toString());\n // b.putString(\"kls\", txt_kls.getText().toString());\n // b.putString(\"vidio\", txtvidio.getText().toString());\n intent.putExtras(b);\n startActivity(intent);\n }else {\n Intent intent = new Intent(getApplicationContext(), menu_quiz_2.class);\n Bundle b = new Bundle();\n // Toast.makeText(getApplicationContext() ,\"Anda Sudah Quiz\", Toast.LENGTH_LONG).show();\n //Menyisipkan tipe data String ke dalam obyek bundle\n b.putString(\"id\", nis.getText().toString());\n b.putString(\"nama\", nama.getText().toString());\n // b.putString(\"kls\", txt_kls.getText().toString());\n // b.putString(\"vidio\", txtvidio.getText().toString());\n intent.putExtras(b);\n startActivity(intent);\n }\n\n }else {\n Toast.makeText(menu_quiz.this, \"Sudah Quiz\", Toast.LENGTH_SHORT).show();\n\n }\n }", "@Override\r\n\tpublic void onGetDataCompleted(final List listResult, String strQueryType, Context context) {\n\t\tif(this == context)\r\n\t\t{\t\t\t\r\n\t\t\t\r\n\t\t\tif(strQueryType.equals(\"Login\")){\r\n\t\t\t\t\r\n\t\t\t\tif(listResult.isEmpty())\r\n\t\t\t\t{\r\n\t\t\t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(context);\r\n\t\t\t\t builder\r\n\t\t\t\t .setMessage(\"아이디나 패스워드가 일치하지 않습니다.\")\r\n\t\t\t\t .setIcon(android.R.drawable.ic_dialog_alert)\r\n\t\t\t\t .setNegativeButton(\"확인\", new DialogInterface.OnClickListener() \r\n\t\t\t\t {\r\n\t\t\t\t public void onClick(DialogInterface dialog, int which) \r\n\t\t\t\t { \r\n\t\t\t\t \t\tetID.setText(\"\");\r\n\t\t\t\t \t\tetPassword.setText(\"\");\r\n\t\t\t\t \tdialog.dismiss(); \r\n\t\t\t\t }\r\n\t\t\t\t }); \r\n\t\t\t\t \r\n\t\t\t\t\tAlertDialog alert = builder.create();\r\n\t\t\t\t\t alert.show();\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tdbHelper.InsertUserInfo(etID.getText().toString(), etPassword.getText().toString(), listResult);\r\n\t\t\t\t\tif(listResult.size() > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tObject obj = listResult.get(0);\r\n\t\t\t\t\t\tHashMap<String, Object> hash = (HashMap)obj;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tCommon.serverTime = hash.get(\"sysDateTime\").toString();\r\n\t\t\t\t\t\tCommon.IDX_LOGIN = hash.get(\"id\").toString();\r\n\t\t\t\t\t\tCommon.IDX_NAME = hash.get(\"name\").toString();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSharedPreferences sharedPrefer = getSharedPreferences(getResources().getString(R.string.information_string), Context.MODE_PRIVATE);\r\n\t\t\t\t \tSharedPreferences.Editor sharedEditor = sharedPrefer.edit();\r\n\t\t\t\t \tsharedEditor.putString(getResources().getString(R.string.latestlogin), Common.serverTime);\r\n\t\t\t\t \tsharedEditor.putString(getResources().getString(R.string.account_id), etID.getText().toString());\r\n\t\t\t\t \tsharedEditor.commit();\r\n\t\t\t\t \t\r\n\t\t\t\t \tCursor curVersion = dbHelper.GetVersion();\r\n\t\t\t\t \tif(curVersion.getCount() > 0)\r\n\t\t\t\t \t{\r\n\t\t\t\t \t\tStartDownloadSequence_CATEGORY();\r\n\t\t\t\t \t\t//StartDownloadSequence_ITEM();\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}\r\n\t\t\t\r\n\t\t\tif(strQueryType.equals(\"GetCategory\")){\r\n\t\t\t\tif(!listResult.isEmpty()){\r\n\t\t\t\t\t\r\n\t\t\t\t\tprgDlg = new ProgressDialog(this);\r\n\t\t\t\t\tprgDlg.setMessage(\"Category정보 보관중...\");\r\n\t\t\t\t\tprgDlg.setCanceledOnTouchOutside(false);\r\n\t\t\t\t\tprgDlg.show();\r\n\t\t\t\t\t\r\n\t\t\t\t\tThread thread = new Thread(new Runnable()\r\n\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\t\tdbHelper.InsertCategory(listResult);\r\n\t\t\t\t\t\t\tMessage msg = Message.obtain();\r\n\t\t\t\t\t\t\tmsg.obj = \"CategorySave\";\r\n\t\t\t\t\t\t\thandler.sendMessage(msg);\r\n\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\t\r\n\t\t\t\t\tthread.start();\r\n\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{\r\n\t\t\t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(context);\r\n\t\t\t\t builder\r\n\t\t\t\t .setMessage(\"Category정보 불러오는중 오류가 발생하였습니다.\")\r\n\t\t\t\t .setIcon(android.R.drawable.ic_dialog_alert)\r\n\t\t\t\t .setNegativeButton(\"확인\", new DialogInterface.OnClickListener() \r\n\t\t\t\t {\r\n\t\t\t\t public void onClick(DialogInterface dialog, int which) \r\n\t\t\t\t { \r\n\t\t\t\t \t\tetID.setText(\"\");\r\n\t\t\t\t \t\tetPassword.setText(\"\");\r\n\t\t\t\t \tdialog.dismiss(); \r\n\t\t\t\t } \r\n\t\t\t\t }); \r\n\t\t\t\t \r\n\t\t\t\t\tAlertDialog alert = builder.create();\r\n\t\t\t\t\t alert.show();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(strQueryType.equals(\"GetCompany\")){\r\n\t\t\t\tif(!listResult.isEmpty()){\r\n\t\t\t\t\t\r\n\t\t\t\t\tprgDlg = new ProgressDialog(this);\r\n\t\t\t\t\tprgDlg.setMessage(\"Company정보 보관중...\");\r\n\t\t\t\t\tprgDlg.setCanceledOnTouchOutside(false);\r\n\t\t\t\t\tprgDlg.show();\r\n\t\t\t\t\t\r\n\t\t\t\t\tThread thread = new Thread(new Runnable()\r\n\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\t\tdbHelper.InsertCompany(listResult);\r\n\t\t\t\t\t\t\tMessage msg = Message.obtain();\r\n\t\t\t\t\t\t\tmsg.obj = \"CompanySave\";\r\n\t\t\t\t\t\t\thandler.sendMessage(msg);\r\n\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\t\r\n\t\t\t\t\tthread.start();\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{\r\n\t\t\t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(context);\r\n\t\t\t\t builder\r\n\t\t\t\t .setMessage(\"Company정보 불러오는중 오류가 발생하였습니다.\")\r\n\t\t\t\t .setIcon(android.R.drawable.ic_dialog_alert)\r\n\t\t\t\t .setNegativeButton(\"확인\", new DialogInterface.OnClickListener() \r\n\t\t\t\t {\r\n\t\t\t\t public void onClick(DialogInterface dialog, int which) \r\n\t\t\t\t { \r\n\t\t\t\t \t\tetID.setText(\"\");\r\n\t\t\t\t \t\tetPassword.setText(\"\");\r\n\t\t\t\t \tdialog.dismiss(); \r\n\t\t\t\t }\r\n\t\t\t\t }); \r\n\t\t\t\t \r\n\t\t\t\t\tAlertDialog alert = builder.create();\r\n\t\t\t\t\t alert.show();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(strQueryType.equals(\"GetProductItem\")){\r\n\t\t\t\t\r\n\t\t\t\tif(!listResult.isEmpty()){\r\n\t\t\t\t\t\r\n\t\t\t\t\tprgDlg = new ProgressDialog(this);\r\n\t\t\t\t\tprgDlg.setMessage(\"상품정보 보관중...\");\r\n\t\t\t\t\tprgDlg.setCanceledOnTouchOutside(false);\r\n\t\t\t\t\tprgDlg.show();\r\n\t\t\t\t\t\r\n\t\t\t\t\tThread thread = new Thread(new Runnable()\r\n\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\t\tif(dbHelper.InsertItem(listResult))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tSharedPreferences sharedPrefer = getSharedPreferences(getResources().getString(R.string.information_string), Context.MODE_PRIVATE);\r\n\t\t\t\t\t\t \tSharedPreferences.Editor sharedEditor = sharedPrefer.edit();\r\n\t\t\t\t\t\t \tsharedEditor.putString(getResources().getString(R.string.masterversion), Common.serverTime);\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t \tsharedEditor.commit();\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\tMessage msg = Message.obtain();\r\n\t\t\t\t\t\t\t\tmsg.obj = \"ProductItemSave\";\r\n\t\t\t\t\t\t\t\thandler.sendMessage(msg);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthread.start();\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{\r\n\t\t\t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(context);\r\n\t\t\t\t builder\r\n\t\t\t\t .setMessage(\"상품정보 불러오는중 오류가 발생하였습니다.\")\r\n\t\t\t\t .setIcon(android.R.drawable.ic_dialog_alert)\r\n\t\t\t\t .setNegativeButton(\"확인\", new DialogInterface.OnClickListener() \r\n\t\t\t\t {\r\n\t\t\t\t public void onClick(DialogInterface dialog, int which) \r\n\t\t\t\t { \r\n\t\t\t\t \t\tetID.setText(\"\");\r\n\t\t\t\t \t\tetPassword.setText(\"\");\r\n\t\t\t\t \tdialog.dismiss(); \r\n\t\t\t\t }\r\n\t\t\t\t }); \r\n\t\t\t\t \r\n\t\t\t\t\tAlertDialog alert = builder.create();\r\n\t\t\t\t\t alert.show();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public void onClick(View view) {\n Intent i = new Intent(getActivity(), CadastroDespesaItem.class);\n i.putExtra(\"Reembolso\", Reembolso);\n Bundle params = new Bundle();\n params.putString(\"CU_LOGIN\", prpUsuario_Logado);\n params.putString(\"CU_ID\", prpUsuario_ID);\n params.putString(\"TIPO_PESQUISA\", _gsTIPOPESQUISA);\n i.putExtras(params);\n\n startActivity(i);\n }", "public void recuperarDados() {\n\n id = getArguments().getString(\"id\");\n nome = getArguments().getString(\"nome\");\n raca = getArguments().getString(\"raca\");\n idade = getArguments().getString(\"idade\");\n sexo = getArguments().getString(\"sexo\");\n cor = getArguments().getString(\"cor\");\n\n imgPerfil = getArguments().getString(\"imgPerfil\");\n img01 = getArguments().getString(\"img01\");\n img02 = getArguments().getString(\"img02\");\n img03 = getArguments().getString(\"img03\");\n tipo = getArguments().getString(\"tipo\");\n Log.e(\"id\", \"idedit\"+id);\n Log.e(\"nome\", \"nomeedit\"+nome);\n\n\n\n assert sexo != null;\n if (sexo.equals(\"Macho\")) {\n machoAnimal.setChecked(true);\n } else {\n femeaAnimal.setChecked(true);\n }\n\n nomeAnimal.setText(nome);\n idadeAnimal.setText(idade);\n corAnimal.setText(cor);\n\n\n if (imgPerfil != null)\n Picasso.get().load(imgPerfil).into(perfilImagem);\n\n /* if (img01 != null)\n Picasso.get().load(img01).into(imagem01);\n\n if (img02 != null)\n Picasso.get().load(img02).into(imagem02);\n\n if (img03 != null)\n Picasso.get().load(img03).into(imagem03);*/\n\n }", "private List<String[]> trovaPazienti(Long idMedico) {\r\n\r\n\t\t\tLog.i(\"trovaPazienti\", \"fase iniziale\");\r\n\r\n\t\t\tSoapObject request = new SoapObject(getString(R.string.NAMESPACE),\r\n\t\t\t\t\t\"trovaPazienti\");\r\n\t\t\trequest.addProperty(\"idMedico\", idMedico);\r\n\r\n\t\t\tSoapSerializationEnvelope envelope = new SoapSerializationEnvelope(\r\n\t\t\t\t\tSoapEnvelope.VER10);\r\n\t\t\tenvelope.setAddAdornments(false);\r\n\t\t\tenvelope.implicitTypes = true;\r\n\t\t\tenvelope.setOutputSoapObject(request);\r\n\r\n\t\t\tHttpTransportSE androidHttpTransport = new HttpTransportSE(\r\n\t\t\t\t\tgetString(R.string.URL));\r\n\r\n\t\t\tandroidHttpTransport.debug = true;\r\n\r\n\t\t\tList<String[]> pazienti = new ArrayList<String[]>();\r\n\r\n\t\t\ttry {\r\n\t\t\t\tString soapAction = \"\\\"\" + getString(R.string.NAMESPACE)\r\n\t\t\t\t\t\t+ \"trovaPazienti\" + \"\\\"\";\r\n\t\t\t\tandroidHttpTransport.call(soapAction, envelope);\r\n\r\n\t\t\t\tLog.i(\"trovaPazienti\", \"inviata richiesta\");\r\n\r\n\t\t\t\tSoapPrimitive response = (SoapPrimitive) envelope.getResponse();\r\n\r\n\t\t\t\tLog.i(\"trovaPazienti\", \"ricevuta risposta\");\r\n\r\n\t\t\t\tString responseData = response.toString();\r\n\r\n\t\t\t\tJSONObject obj = new JSONObject(responseData);\r\n\r\n\t\t\t\tLog.i(\"response\", obj.toString());\r\n\r\n\t\t\t\tJSONArray arr = obj.getJSONArray(\"mieiPazienti\");\r\n\r\n\t\t\t\tfor (int i = 0; i < arr.length(); i++) {\r\n\t\t\t\t\tString[] paziente = new String[2];\r\n\t\t\t\t\tJSONObject objPaz = new JSONObject(arr.getString(i));\r\n\t\t\t\t\tpaziente[0] = objPaz.get(\"idPaziente\").toString();\r\n\t\t\t\t\tpaziente[1] = objPaz.get(\"nome\").toString() + \" \"\r\n\t\t\t\t\t\t\t+ objPaz.get(\"cognome\").toString();\r\n\t\t\t\t\tpazienti.add(paziente);\r\n\t\t\t\t}\r\n\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tLog.e(\"WS Error->\", e.toString());\r\n\t\t\t}\r\n\t\t\treturn pazienti;\r\n\t\t}", "@Override\n\tpublic void onClick(View arg0) {\n\t\tswitch (arg0.getId()) {\n\t\tcase R.id.img_shake_back:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tcase R.id.img_shake_icon:\n\t\t\tshake();\n\t\t\tbreak;\n\t\tcase R.id.shake_dialog_makesure:\n\t\t\tIntent intent = new Intent();\n\t\t\tDataMap map = new DataMap();\n\t\t\tMap<String, Object> dataMap = new HashMap<String, Object>();\n\t\t\tdataMap.put(\"groupName\", dataPackage.getName());\n\t\t\tdataMap.put(\"groupPrice\", dataPackage.getTotal_price());\n\t\t\tdataMap.put(\"sendPrice\", dataPackage.getPrice_on_delivery());\n\t\t\tdataMap.put(\"type\", dataPackage.getCategory());\n\t\t\tdataMap.put(\"resId\", dataPackage.getRestaurant_id());\n\t\t\tdataMap.put(\"pacId\", dataPackage.getId());\n\t\t\tdataMap.put(\"basePrice\", dataPackage.getDelivery_starting_fee());\n\t\t\tmap.setMap(dataMap);\n\t\t\tDataList dataList = new DataList();\n\t\t\tintent.putExtra(\"map\", map);\n\t\t\tList<Dish> dishs = (List<Dish>) dataPackage.getDishes();\n\t\t\tList<Map<String, Object>> child = new ArrayList<Map<String, Object>>();\n\t\t\tfor (int j = 0; j < dishs.size(); j++) {\n\t\t\t\tMap<String, Object> childData = new HashMap<String, Object>();\n\t\t\t\tDish dish = dishs.get(j);\n\t\t\t\tchildData.put(\"childName\", dish.getName());\n\t\t\t\tchildData.put(\"childNumber\", dish.getNumber());\n\t\t\t\tchildData.put(\"childPrice\", dish.getPrice());\n\t\t\t\tchildData.put(\"childDetail\", dish.getDetail());\n\t\t\t\tchildData.put(\"childId\", dish.getDish_id());\n\t\t\t\ttry {\n\t\t\t\t\tchildData.put(\"childImg\", dish.getImg());\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\tchild.add(childData);\n\t\t\t}\n\t\t\tdataList.setList(child);\n\t\t\tintent.putExtra(\"data\", dataList);\n\t\t\tintent.setClass(this, YiJianZhaiMakeSureActivity.class);\n\t\t\tthis.startActivity(intent);\n\t\t\tif (dialog != null) {\n\t\t\t\tdialog.dismiss();\n\t\t\t}\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tcase R.id.shake_dialog_continue:\n\t\t\tdialog.dismiss();\n\t\t\tshake();\n\t\t\tbreak;\n\t\t}\n\t}", "public Cursor takeData(){\n return databaseR.query(taula_productes, new String[]{\n _id, CodiArticle, Desc, PVP, stock\n },\n null, null,\n null, null,_id);\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n\n super.onActivityResult(requestCode, resultCode, data);\n if (requestCode == REQUEST_CODE) {\n if (resultCode == RESULT_CANCELED) {\n Toast.makeText(this, \"Пользователь вышел из SecondActivity\", Toast.LENGTH_SHORT).show();\n } else if (resultCode == RESULT_OK) {\n\n // gets chosen menu and put it to textView\n if (data != null) {\n String text = data.getStringExtra(\"result\");\n if (text != null) {\n TextView tv = findViewById(R.id.order);\n tv.setText(text);\n }\n }\n }\n }\n // gets date that was chosen by user\n if (requestCode == REQUEST_CODE_TIME) {\n if (resultCode == RESULT_OK) {\n if (data != null) {\n String text = data.getStringExtra(\"result\");\n if (text != null) {\n TextView tv = findViewById(R.id.chosenTime);\n tv.setText(text);\n }\n }\n }\n }\n }", "private void getDataKitabKuning(){\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.lihat_program_like(\"Kitab Kuning\");\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1 = response.body().getStatus();\n if (value1.equals(\"1\")){\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else {\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent intent) {\n\t\t//@SuppressWarnings(\"unused\")\n\t\t//String dataclass = data.getComponent().getShortClassName();\n\t\tif (requestCode == REQUEST_CODE) {\n\t\t\tif (resultCode == Activity.RESULT_OK) {\n\t\t\t\tcontents = intent.getStringExtra(\"SCAN_RESULT\");\n\t\t\t\tString cmaquina = \"\",nmaquina = \"\",cbarra = \"\",estado = \"\";\n\t\t\t\tString familia = \"\",centro = \"\";\n\t\t\t\t\n\t\t\t\tDataBase objDB = new DataBase(this, \"DBInspeccion\", null, 1);\n\t\t\t\tSQLiteDatabase _db = objDB.getWritableDatabase();\n\t\t\t\t\n\t\t\t\tString sql = \"Select c_maquina,c_descripcion,c_codigobarras,c_estado,c_familiainspeccion,\"\n\t\t\t\t\t\t\t + \"c_centrocosto from MTP_MAQUINAS where c_codigobarras = '\"+ contents + \"' \";\n\t\t\t\t\n\t\t\t\tCursor c = _db.rawQuery(sql, null);\n\t\t\t\tif (c.moveToFirst()) {\n\t\t\t\t\tcmaquina = c\n\t\t\t\t\t\t\t.getString(0);\n\t\t\t\t\tnmaquina = c.getString(1);\n\t\t\t\t\tcbarra = c.getString(2);\n\t\t\t\t\testado = c.getString(3);\n\t\t\t\t\tfamilia = c.getString(4);\n\t\t\t\t\tcentro = c.getString(5);\n\t\t\t\t\t\n\t\t\t\t\tSharedPreferences preferences = PreferenceManager.\n\t\t\t\t\t\t\tgetDefaultSharedPreferences(MainInspeccionT.this);\n\t\t\t\t\tEditor editor = preferences.edit();\n\t\t\t\t\teditor.putString(\"cmaquina\", cmaquina);\n\t\t\t\t\teditor.putString(\"maquina\", nmaquina);\n\t\t\t\t\teditor.putString(\"codbarra\", cbarra);\n\t\t\t\t\teditor.putString(\"estado\", estado);\n\t\t\t\t\teditor.putString(\"familia\", familia);\n\t\t\t\t\teditor.putString(\"centro\", centro);\n\t\t\t\t\t\n\t\t\t\t\teditor.commit();\n\t\t\t\t\tToast.makeText(this, \"Máquina: \" + cmaquina + \" - \" + nmaquina + \". Cod. Familia: \"\n\t\t\t\t\t\t\t\t\t\t + familia + \".\", Toast.LENGTH_SHORT).show();\n\t\t\t\t} else {\n\t\t\t\t\tToast.makeText(this, \"Máquina no disponible para ese código.\", Toast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t\tc.close();\n\t\t\t\t_db.close();\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}", "@Override\n public void onClick(View view) {\n double lat1, lat2 = 0, lon1, lon2 = 0;\n //System.out.println(\"El id de la localidad es: \"+listaCanasta.get(recyclerViewPersonas.getChildAdapterPosition(view)).getIdLocalidad());\n for(int i=0 ; i<listaLocalidades.size(); i++){\n if(listaCanasta.get(recyclerViewPersonas.getChildAdapterPosition(view)).getIdLocalidad() ==listaLocalidades.get(i).getIdLocalidad()){\n lat2=listaLocalidades.get(i).getLat();\n lon2=listaLocalidades.get(i).getLon();\n loc=listaLocalidades.get(i); // guardo todos los datos de la localidad en loc\n }\n }\n\n lat1 = -34.69045539694708; //FIJO LA rIOJA 2128\n lon1 = -58.40965694530948;//FIJO LA// rIOJA 2128\n\n //la lat2 y long2 depende la localidad elegida en el combobox\n\n distancia=distance(lat1,lat2,lon1,lon2);\n //-----------------------------------\n\n Intent intent= new Intent(getContext(), AddPalomasACanasta.class);\n intent.putExtra(\"palomar\",palomar);\n intent.putExtra(\"canasta\",listaCanasta.get(recyclerViewPersonas.getChildAdapterPosition(view)));\n //Toast.makeText(getActivity(), \"la distancia es: \"+distancia, Toast.LENGTH_SHORT).show();\n intent.putExtra(\"distancia\",distancia);\n intent.putExtra(\"listaLinea\",nombreEnSpinnerLinea);\n intent.putExtra(\"listaLoc\",listaLocalidades);\n\n\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n Intent i=new Intent(getApplicationContext(),pagos.class);\n String user=bl.getString(\"user\");\n //pasar a la nueva ventana el user del usuario\n i.putExtra(\"user\",String.valueOf(user));\n //pasar a la nueva ventana el saldo del usuario\n i.putExtra(\"saldo\",etSaldo.getText().toString());\n //lanzar la nueva ventana\n startActivity(i);\n }", "public void clickDisconPadre(View v){\n\n Intent i = new Intent();\n i.putExtra(\"user\", usuario);\n setResult(RESULT_OK, i);\n finish();\n\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,int position, long id) {\n matricola = ((TextView) view.findViewById(R.id.Matricola)).getText().toString();\n contribuente = ((TextView) view.findViewById(R.id.Contribuente)).getText().toString();\n if (globalVariable.getXMLdata(matricola) == null) {\n new MyAsyncTask().execute(globalVariable.getUsername(), globalVariable.getPassword(), \"\", matricola);\n }\n else\n {\n Intent i = new Intent(Contribuente.this, Comune.class);\n // send album id to tracklist activity to get list of songs under that album\n //String contribuente = ((TextView) findViewById(R.id.Contribuente)).getText().toString();\n i.putExtra(\"contribuente\", contribuente.trim());\n i.putExtra(\"XML\",globalVariable.getXMLdata(matricola));\n startActivity(i);\n }\n\n\n }", "@Override\n public void onClick(View v) {\n Intent intent=new Intent(activity.getApplicationContext(),ServisTalebi.class);\n intent.putExtra(\"id\",talep.getId().toString());\n intent.putExtra(\"baslik\",talep.getBaslik().toString());\n intent.putExtra(\"aciklama\",talep.getAciklama().toString());\n intent.putExtra(\"durum\",talep.getDurum().toString());\n intent.putExtra(\"yorum\",talep.getYorum().toString());\n\n activity.startActivity(intent);\n\n\n }", "@Override\n public void onItemClick(int position)\n {\n /* DNI_Seleccionado = ListaUsuariosPrincipal.get(position).getDNI();\n\n Intent Activity2 = new Intent(MainActivity.this, MapsActivity.class);\n // Le paso los datos del Chofer a la segunda activity para mostrarla\n finish();\n Activity2.putExtra(\"DNI_Seleccionado\", DNI_Seleccionado);\n startActivity(Activity2);\n*/\n // Obtengo la informacion del item seleccionado\n double lat = -36;\n double longi = -58;\n\n Intent Activity2 = new Intent(MainActivity.this, MapsActivity.class);\n // Le paso los datos del Chofer a la segunda activity para mostrarla\n finish();\n Activity2.putExtra(\"lat\", lat);\n Activity2.putExtra(\"longi\", longi);\n startActivity(Activity2);\n }", "@Override\n\t\t\t\t\t\tpublic void gotResult(int code, String arg1, Set<String> arg2) {\n\t\t\t\t\t\t\tSystem.out.println(\"code\"+code);\n\t\t\t\t\t\t\tLog.i(\"注册极光结果放回\", String.valueOf(code));\n\t//\t\t\t\t\t\tToast.makeText(RegisterAcountActivity.this, code, 0).show();\n\t\t\t\t\t\t}", "private void getMoviesData() {\n movieId = getIntent().getIntExtra(MOVIE_ID, 0);\n }", "static long m43010a(Intent intent) {\n if (intent == null) {\n return -1;\n }\n return intent.getLongExtra(\"com.tonyodev.fetch.extra_id\", -1);\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent();\n intent.putExtra(\"type\", type);\n intent.putExtra(\"name\", edit_name.getText().toString());\n intent.putExtra(\"day\", edit_day.getText().toString());\n intent.putExtra(\"money\", edit_money.getText().toString());\n intent.putExtra(\"reason\", reason);\n intent.putExtra(\"position\",position);\n intent.putExtra(\"Yes_or_No\",\"Yes\");\n setResult(RESULT_OK, intent);\n\n finish();\n }", "@Override\n protected boolean onLongItemClickListener(int adapterPosition, int layoutPosition) {\n CondicaoPagamento condpgto = adaptercondpgto.getItems().get(adapterPosition);\n idcondpgto = condpgto.getIdcodicaopagamento();\n nomecondpgto = condpgto.getDescricao();\n\n\n\n\n return true;\n }", "public void receberValores() {\n Bundle b = getIntent().getExtras();\n if (b != null) {\n cpf3 = b.getString(\"valor2\");\n renda = b.getDouble(\"valor3\");\n data = b.getString(\"valor4\");\n data2 = b.getString(\"valor5\");\n }\n }", "public EntityAisle getByMatricule(int matricule ){\n\n\n DatabaseHelper databaseHelper = DatabaseHelper.getInstance(this.mExecutionContext);\n SQLiteDatabase sqLiteDatabase = databaseHelper.getReadableDatabase();\n\n EntityAisle result = null;\n\n Cursor cursor = null;\n try {\n\n cursor = sqLiteDatabase.query(ConfigDAO.TABLE_AISLE, null, ConfigDAO.COLUMN_RAYON_ID +\" = \" + matricule , null, null, null, null, null);\n\n /**\n // If you want to execute raw query then uncomment below 2 lines. And comment out above line.\n\n String SELECT_QUERY = String.format(\"SELECT %s, %s, %s, %s, %s FROM %s\", Config.COLUMN_Employee_ID, Config.COLUMN_Employee_NAME, Config.COLUMN_Employee_REGISTRATION, Config.COLUMN_Employee_EMAIL, Config.COLUMN_Employee_PHONE, Config.TABLE_Employee);\n cursor = sqLiteDatabase.rawQuery(SELECT_QUERY, null);\n */\n\n if(cursor!=null)\n if(cursor.moveToFirst()){\n List<EntityAisle> AisleList = new ArrayList<>();\n do {\n int id = cursor.getInt(cursor.getColumnIndex(ConfigDAO.COLUMN_RAYON_ID));\n String name = cursor.getString(cursor.getColumnIndex(ConfigDAO.COLUMN_RAYON_NAME));\n\n\n\n AisleList.add(new EntityAisle(id, name));\n } while (cursor.moveToNext());\n result = AisleList.get(0);\n return result;\n }\n } catch (Exception e){\n Log.i(TAG, \"getAllAisle: \"+e.getMessage());\n Toast.makeText(this.mExecutionContext, \"Operation failed\", Toast.LENGTH_SHORT).show();\n } finally {\n if(cursor!=null)\n cursor.close();\n sqLiteDatabase.close();\n }\n\n return result;\n }", "public void cargarDato(String rut){\n\n //iniciar barra de progreso\n progress = new ProgressDialog(this);\n progress.setCancelable(false);\n progress.setMessage(\"Cargando datos del cliente seleccionado...\");\n progress.show();\n\n //inciar consulta\n Gson gson = new GsonBuilder().setLenient().create();\n\n Retrofit retrofit = new Retrofit.Builder()\n .baseUrl(URL)\n .addConverterFactory(GsonConverterFactory.create(gson))\n .build();\n\n RegisterAPI api = retrofit.create(RegisterAPI.class);\n Call<ClienteG> call = api.verClienteG(rut);\n\n //ejecutar consulta\n call.enqueue(new Callback<ClienteG>() {\n @Override\n public void onResponse(Call<ClienteG> call, Response<ClienteG> response) {\n progress.dismiss();\n //obtener datos de consulta\n Integer value = response.body().getValueCliente();\n //si el resultado de la conulta es 1 entonces significa que se realizo correctamente\n if(value.equals(1)){\n //obtener datos de cliente\n List<ResultClienteG> cliente = response.body().getResultClienteG();\n\n //llenar EditText con datos de la consulta\n rutClienteInfo.setText(cliente.get(0).getRUTCLIENTE());\n nombreClienteInfo.setText(cliente.get(0).getNOMBRECLIENTE());\n nombresitioInfo.setText(cliente.get(0).getNOMBRESITIO());\n nombreAreaInfo.setText(cliente.get(0).getNOMBREAREA());\n tipoPersonalInfo.setText(cliente.get(0).getCARGO());\n contrasenaInfo.setText(cliente.get(0).getCONTRASENA());\n\n }\n }\n\n //en caso de fallar mostrar mensaje por pantalla y regresar a la actividad anterior\n @Override\n public void onFailure(Call<ClienteG> call, Throwable t) {\n progress.dismiss();\n Toast.makeText(getApplicationContext(),\"Fallo conexion a internet\",Toast.LENGTH_SHORT).show();\n\n Intent intent = new Intent(getApplicationContext(), gestionarClienteActivity.class);\n startActivity(intent);\n\n }\n });\n\n\n\n }", "private void getCariSemua(){\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.cari_semua_like(txt_kodeMK.getSelectedItem().toString(),txt_kelas.getSelectedItem().toString());\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1 = response.body().getStatus();\n if (value1.equals(\"1\")) {\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls, getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else{\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\tif (requestCode == 2 && resultCode == RESULT_OK) {\n\t\t\tid = data.getStringExtra(\"id\");\n\t\t\ttagname_cn = data.getStringExtra(\"tagname_cn\");\n\t\t\ttagname_en = data.getStringExtra(\"tagname_en\");\n\t\t\tHashMap<String, String> map = new HashMap<String, String>();\n\t\t\t map.put(\"type\", \"\"+1);\n\t\t\t map.put(\"id\", id);\n\t\t\t map.put(\"tagname_cn\", tagname_cn);\n\t\t\t map.put(\"tagname_en\", tagname_en);\n\t\t\t mArray.add(myresumeEditGoodListAdapter.getCount()-1,map);\n\t\t\t myresumeEditGoodListAdapter.mArray = mArray;\n\t\t\t myresumeEditGoodListAdapter.notifyDataSetChanged();\n\t\t\t ListViewSetHeightUtil.setListViewHeightBasedOnChildren(myresumeEditGoodListView);\n\t\t}\n\t\t\n\t}", "@Override\n\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (bean.data.get(position).status.equals(\"8\")) {\n\t\t\t\t\t\t\t\tBuilder ad = new Builder(MylogisticakActivity.this);\n\t\t\t\t\t\t\t\tad.setTitle(\"温馨提示\");\n\t\t\t\t\t\t\t\tad.setMessage(\"确定选择线下交易吗?\");\n\t\t\t\t\t\t\t\tad.setNegativeButton(\"确认\", new DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface arg0, int arg1) {\n\t\t\t\t\t\t\t\t\t\t\tif (!bean.data.get(position).userToId.equals(\"\")) {\n\t\t\t\t\t\t\t\t\t\t\t\tint iid=bean.data.get(position).recId;\n\t\t\t\t\t\t\t\t\t\t\t\tString userToId=bean.data.get(position).userToId;\n//\t\t\t\t\t\t\t\t\t\t\t\taddPostResult(iid);\n//\t\t\t\t\t\t\t\t\t\t\t\tToastUtil.shortToast(context, \"查看报价\");;\n\t\t\t\t\t\t\t\t\t\t\t\tgetaddsurplus(iid,userToId);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tad.setPositiveButton(\"取消\", new DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface arg0, int arg1) {\n\t\t\t\t\t\t\t\t\t\targ0.dismiss();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tad.create().show();\n\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tBuilder ad = new Builder(MylogisticakActivity.this);\n\t\t\t\t\t\t\tad.setTitle(\"温馨提示\");\n\t\t\t\t\t\t\tad.setMessage(\"是否要删除\");\n\t\t\t\t\t\t\tad.setNegativeButton(\"确认\", new DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface arg0, int arg1) {\n\t\t\t\t\t\t\t\t\tint iid=bean.data.get(position).recId;\n\t\t\t\t\t\t\t\t\taddPostResult(iid);\n//\t\t\t\t\t\t\t\t\tToastUtil.shortToast(context, \"查看报价\");;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tad.setPositiveButton(\"取消\", new DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface arg0, int arg1) {\n\t\t\t\t\t\t\t\t\targ0.dismiss();\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\tad.create().show();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "public Cursor getCategoriaId(String idCategoria){\n //Creamos el conector de bases de datos\n AdmiSQLiteOpenHelper admin = new AdmiSQLiteOpenHelper(this, \"administracion\", null, 1 );\n // Abre la base de datos en modo lectura y escritura\n SQLiteDatabase BasesDeDatos = admin.getWritableDatabase();\n Cursor consultaId = BasesDeDatos.rawQuery(\"SELECT id, nom_categoria, desp_categoria FROM t_categoria WHERE activo = 1 AND id =\" + idCategoria, null);\n // consultaId.close();\n // BasesDeDatos.close();\n return consultaId;\n }", "@Override\n public void onClick(View v) {\n String nom =\"\";\n String prenom = \"\";\n String mail = \"\";\n String tel = \"\";\n String mdp = \"\";\n String confMdp = \"\";\n\n // Recuperation des données saisies\n try {\n nom = nomInscription.getText().toString();\n prenom = prenomInscription.getText().toString();\n mail = mailInscription.getText().toString();\n tel = telInscription.getText().toString();\n mdp = mdpInscription.getText().toString();\n confMdp = mdpConfirmation.getText().toString();\n\n Utilisateur connexionUtilisateurs = new Utilisateur(nom,prenom,mail,tel,mdp);\n controle.setConnexionUtilisateurs(connexionUtilisateurs);\n }catch (Exception e){\n Log.d(\"Recup\", \"****************** Erreur reuperation donnees inscription\\n****\" + e);\n }\n\n // Controle des données saisie\n if((nom.equals(\"\"))||(prenom.equals(\"\"))||(mail.equals(\"\"))||(tel.equals(\"\"))||(mdp.equals(\"\"))||(confMdp.equals(\"\"))){\n Toast.makeText(InscriptionActivity.this,\"Saisie incorrect\",Toast.LENGTH_SHORT).show();\n }else if (!(mdp.equals(confMdp))){\n Toast.makeText(InscriptionActivity.this,\"mots de passe incorrect\",Toast.LENGTH_SHORT).show();\n }else if (tel.length() != 10){\n Toast.makeText(InscriptionActivity.this,\"Numéro de téléphone incorrect\",Toast.LENGTH_SHORT).show();\n }else if (!isValiEmail(mail)){\n Toast.makeText(InscriptionActivity.this,\"Format de l'adresse mail incorrect\",Toast.LENGTH_SHORT).show();\n }else {\n // si la saisie est correcte, envoie les informations à la base de données pour l'inscription\n afficheResult(nom,prenom,mail,tel,mdp);\n Utilisateur user = new Utilisateur(nom,prenom,mail,tel,mdp);\n AccesDistant accesDistant = new AccesDistant();\n Log.d(\"envoi inscript\",\"*************\" + user.inscriptionConvertToJSONArray());\n accesDistant.envoi(\"inscription\", user.inscriptionConvertToJSONArray());\n\n // Bouton pour aller vers la page home\n Intent intent = new Intent(InscriptionActivity.this,HomeActivity.class);\n startActivity(intent);\n }\n\n }", "@Override\n public void onClick(View v) {\n ArrayList<HashMap<String, String>> result;\n result = food_repo.get_food_by_name(name.getText().toString());\n ArrayList<String> names = new ArrayList<String>();\n ArrayList<String> datas = new ArrayList<String>();\n ArrayList<String> ids = new ArrayList<String>();\n for (int i = 0; i < result.size(); i++) {\n names.add(result.get(i).get(\"name\"));\n datas.add(result.get(i).toString());\n ids.add(result.get(i).get(\"id\"));\n }\n Intent go_to_confirm = new Intent(getItSelf(), NormalExpandDietSearch.class);\n go_to_confirm.putExtra(\"data\", datas);\n go_to_confirm.putExtra(\"name\", names);\n go_to_confirm.putExtra(\"id\", ids);\n go_to_confirm.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(go_to_confirm);\n finish();\n }", "Turno consultarTurno();", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n //if qrcode reader\n if(code == 1){\n IntentResult qrcode = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);\n if (qrcode != null) {\n if (qrcode.getContents() != null) {\n String cut = qrcode.getContents();\n int corte = cut.indexOf(\"=\") + 1;\n final String code = cut.substring(corte, corte + 44);\n Intent readQRcode = new Intent(activity, VerNFe.class);\n readQRcode.putExtra(\"code\", code);\n overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);\n startActivity(readQRcode);\n } else {\n Toast.makeText(activity, R.string.toast_cancel_read_qrcode, Toast.LENGTH_SHORT).show();\n }\n drawerLayout.closeDrawers();\n } else {\n super.onActivityResult(requestCode, resultCode, data);\n }\n }\n //if barcode reader\n else if (code == 2){\n IntentResult barcode = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);\n if (barcode != null) {\n if (barcode.getContents() != null) {\n String codigo_de_barras = barcode.getContents();\n Descontos d = new Descontos();\n d.pegaProdutoPorCodigoDeBarras(codigo_de_barras);\n } else {\n Toast.makeText(this, \"Leitura do código de barras cancelado\", Toast.LENGTH_SHORT).show();\n }\n } else {\n Toast.makeText(this, \"Erro ao ler código de barras do Produto\", Toast.LENGTH_LONG).show();\n }\n }\n\n }", "@Override\n\t public void onClick(View view) {\n\t \tIntent i;\n\t \tif (botonPrincipal.equals(\"2\"))\n\t \t{\n\t \t\ti = new Intent(getApplicationContext(), Dispositivo.class);\n\t \t}\n\t \telse\n\t \t{\n\t \t\ti = new Intent(getApplicationContext(), SetPersianas.class);\n\t \t}\n\t \t\t\t\ti.putExtra(\"codigo_dispositivo\" , cod_disp[position-1]);\n\t \t\t\t\ti.putExtra(\"estado_dispositivo\" , est_disp[position-1]);\n\t \t\t\t\ti.putExtra(\"descripcion_dispositivo\", desc_disp[position-1]);\n\t \t\t\t\ti.putExtra(\"tipo_dispositivo\", tipo_disp[position-1]);\n\t \t\t\t\ti.putExtra(\"codigo_habitacion\", cod_hab);\n\t \t\t\t\ti.putExtra(\"habitacion\", hab_dom);\n\t \t\t\t\ti.putExtra(\"botonPrincipal\",botonPrincipal);\n\t startActivity(i);\n\t finish();\n\t }", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\t switch (requestCode) { \n\t case 1: \n\t if (data == null) { \n\t return; \n\t } \n\t Uri result = data.getData(); \n\t String contactId = result.getLastPathSegment(); \n\t String phone = \"\"; \n\t String[] projection = new String[] { Phone.CONTACT_ID,Phone.NUMBER}; \n\t Cursor cursor = getContentResolver().query(Phone.CONTENT_URI, \n\t projection, // select sentence \n\t Phone.CONTACT_ID + \" = ?\", // where sentence \n\t new String[] { contactId }, // where values \n\t Phone.CONTACT_ID); // order by \n\t \n\t if (null!=cursor&&cursor.moveToFirst()) { \n\t phone = cursor.getString(cursor.getColumnIndex(Phone.NUMBER)); \n\t CommonUtils.sendMSG(MemberCenter.this, phone, String.format(\"亲,发现好星之家酒店的客户端很好用,可以用手机预定酒店,\" +\n\t\t \t\t\"安卓下载地址:%s 苹果下载地址%s\", MainActivity.proPhone.andUrl,MainActivity.proPhone.ioUrl));\n\t }else\n\t {\n\t \t CommonUtils.showToast(getApplicationContext(), \"获取联系人失败\");\n\t }\n\t break; \n\t } \n\t}", "@Override\r\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tif (data == null)\r\n\t\t\treturn;\r\n\t\tBundle bundle = data.getExtras();\r\n\r\n\t\tswitch (requestCode) {\r\n\t\tcase 0:\r\n\t\t\t// String otherneed = bundle.getString(\"otherneed\");\r\n\t\t\tticketnumber = bundle.getStringArray(\"ticketnumber\");\r\n\t\t\ttickettype = bundle.getStringArray(\"tickettype\");\r\n\t\t\tnumberofticket = bundle.getIntArray(\"numberofticket\");\r\n\t\t\tnumberposition = bundle.getInt(\"numberposition\");\r\n\t\t\t// tickettypecode = bundle.getInt(\"tickettypecode\");\r\n\t\t\tshowTextView_show_number();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\n\t\tif (requestCode == 333 && resultCode == RESULT_OK) {\n\t\t\tDtb_OneNewsObject c = (Dtb_OneNewsObject) data.getExtras().get(\n\t\t\t\t\t\"congviec\");\n\t\t\t// sua lai thong tin sqlite\n\t\t\tqlb.editNews(c);\n\t\t\t// hien thi lai tin\n\t\t\tdisplayDataUpListView();\n\t\t}\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t}", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == ACTIVITY_ONE_REQUEST && resultCode == RESULT_OK) {\n if (data.hasExtra(ACTIVITY_ONE_RESULT)) {\n String result = data.getExtras().getString(ACTIVITY_ONE_RESULT);\n Toast.makeText(MainActivity.this, result, Toast.LENGTH_SHORT).show();\n requestResult.setText(result);\n }\n }\n if (requestCode == ACTIVITY_TWO_REQUEST && resultCode == RESULT_OK) {\n /**\n * Possibly of returning two different results from Activity Two\n */\n if (data.hasExtra(ACTIVITY_TWO_RESULT)) {\n String result = data.getExtras().getString(ACTIVITY_TWO_RESULT);\n Toast.makeText(MainActivity.this, result, Toast.LENGTH_SHORT).show();\n requestResult.setText(result);\n }\n if (data.hasExtra(ACTIVITY_TWO_RESULT_DIFFERENT)) {\n String result = data.getExtras().getString(ACTIVITY_TWO_RESULT_DIFFERENT);\n Toast.makeText(MainActivity.this, result, Toast.LENGTH_SHORT).show();\n requestResult.setText(result);\n }\n }\n }", "private void goToResultActivity() {\n try {\n stopCountdown();\n if (isOnline()) {\n List<Contact> testDetails = db.getPracticeTestDetailByID(Integer.parseInt(mSchoolId), Integer.parseInt(mStudentId), Integer.parseInt(testId));\n ansString = \"\";\n extraParam = \"2 Date :: \" + currentDateandTimeTemp;\n if (testDetails != null && testDetails.size() > 0) {\n ansString = testDetails.get(0).getTestAnsString();\n testTicks = testDetails.get(0).getTestTicks();\n if (ansString == null || ansString.isEmpty()) {\n ansString = \"\";\n extraParam = \"-1\";\n }\n if (testTicks == null || testTicks.isEmpty()) {\n testTicks = \"\";\n }\n /* if (ansString != null && !ansString.isEmpty()) {*/\n Log.e(\"ansString\", ansString);\n frame_progress.setVisibility(View.VISIBLE);\n progressBar.setVisibility(View.VISIBLE);\n String mStudentId = Datastorage.GetStudentId(getApplicationContext());\n String mSchoolId = Datastorage.GetSchoolId(getApplicationContext());\n String mYearId = Datastorage.GetCurrentYearId(getApplicationContext());\n String deviceId = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);\n String mDeviceDetail = Build.DEVICE + \"|||\" + Build.MODEL + \"|||\" + Build.ID\n + \"|||\" + Build.PRODUCT + \"|||\" + Build.VERSION.SDK\n + \"|||\" + Build.VERSION.RELEASE + \"|||\" + Build.VERSION.INCREMENTAL;\n Call<AppService> call = ((MyApplication) getApplicationContext()).getmRetrofitInterfaceAppService()\n .SetPracticeTestAnsV3(mStudentId, mSchoolId, mYearId, testId, ansString, SchoolDetails.appname + \"\", Constants.CODEVERSION, Constants.PLATFORM, extraParam, testTicks, deviceId, mDeviceDetail);\n call.enqueue(new Callback<AppService>() {\n @Override\n public void onResponse(Call<AppService> call, Response<AppService> response) {\n try {\n progressBar.setVisibility(View.GONE);\n frame_progress.setVisibility(View.GONE);\n AppService tmps = response.body();\n if (tmps != null && tmps.getResponse() != null && !tmps.getResponse().isEmpty()\n && tmps.getResponse().equalsIgnoreCase(\"1\") && !tmps.getStrResult().isEmpty()) {\n db.deleteTestRecords(rowTestID);\n Intent i = new Intent(PracticeTestQAActivity.this, PracticeTestResultActivity.class);\n i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n // i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);\n i.putExtra(\"testId\", testId);\n i.putExtra(\"testName\", testName);\n i.putExtra(\"refereshflag\", \"1\");\n startActivity(i);\n PracticeTestQAActivity.this.finish();\n onClickAnimation();\n Toast.makeText(PracticeTestQAActivity.this, tmps.getStrResult(), Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(PracticeTestQAActivity.this, tmps.getStrResult(), Toast.LENGTH_SHORT).show();\n }\n } catch (Exception ex) {\n btn_next.setEnabled(true);\n progressBar.setVisibility(View.GONE);\n frame_progress.setVisibility(View.GONE);\n Constants.writelog(\"PracticeTestQAActivity\", \"setTestAns 2062:\" + ex.getMessage());\n } finally {\n ansString = \"\";\n }\n }\n\n @Override\n public void onFailure(Call<AppService> call, Throwable t) {\n progressBar.setVisibility(View.GONE);\n btn_next.setEnabled(true);\n frame_progress.setVisibility(View.GONE);\n Constants.writelog(\"PracticeTestQAActivity\", \"setTestAns 1589:\" + t.getMessage());\n }\n });\n /* }else {\n Intent i = new Intent(PracticeTestQAActivity.this, PracticeTestResultActivity.class);\n i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n // i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);\n i.putExtra(\"testId\", testId);\n i.putExtra(\"testName\", testName);\n i.putExtra(\"refereshflag\", \"1\");\n startActivity(i);\n PracticeTestQAActivity.this.finish();\n onClickAnimation();\n }*/\n } else {\n Intent i = new Intent(PracticeTestQAActivity.this, PracticeTestResultActivity.class);\n i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n // i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);\n i.putExtra(\"testId\", testId);\n i.putExtra(\"testName\", testName);\n i.putExtra(\"refereshflag\", \"1\");\n startActivity(i);\n PracticeTestQAActivity.this.finish();\n onClickAnimation();\n }\n } else {\n btn_next.setEnabled(true);\n progressBar.setVisibility(View.GONE);\n frame_progress.setVisibility(View.GONE);\n Toast.makeText(this, SchoolDetails.MsgNoInternet, Toast.LENGTH_SHORT).show();\n }\n } catch (Exception e) {\n btn_next.setEnabled(true);\n Constants.writelog(\"PracticeTestQAActivity\", \"goToResultActivity 1787:\" + e.getMessage());\n }\n }", "public void datosBundle()\n {\n //creamos un Bundle para recibir los datos de MascotasFavoritas al presionar el boton de atras en la ActionBar\n Bundle datosBundleAtras = getActivity().getIntent().getExtras();\n //preguntamos si este objeto viene con datos o esta vacio\n if(datosBundleAtras!=null)\n {//si hay datos estos se los agregamos a un ArrayList de mascotas\n mascotas = (ArrayList<Mascota>) datosBundleAtras.getSerializable(\"listamascotasatras\");\n }else{\n //si el bundle No trae datos entonces se inicializara la lista con datos\n validarBundle=1;\n //return;\n }\n }", "@Override\n\tprotected void onResponseSuccess(ReqTag tag, Object data) {\n\t\tsuper.onResponseSuccess(tag, data);\n\t\tswitch (tag.getReqId()) {\n\t\tcase REQUEST_USERINFOS:\n\t\t\tmoneyData = (MoneyData)data;\n\t\t\t\n\t\t\tsetText(R.id.tv_money, CommonUtils.getPriceFormatNo¥(ArithmeticUtil.div(moneyData.getKetixian()+\"\", \"10000\").doubleValue()));\n\t\t\tsetText(R.id.tv_total, CommonUtils.getPriceFormatNo¥(ArithmeticUtil.div(moneyData.getCount()+\"\", \"10000\").doubleValue()));\n\t\t\tsetText(R.id.tv_tixian_finish, CommonUtils.getPriceFormatNo¥(ArithmeticUtil.div(moneyData.getAlready()+\"\", \"10000\").doubleValue()));\n\t\t\tsetText(R.id.tv_tixian_ing, CommonUtils.getPriceFormatNo¥(ArithmeticUtil.div(moneyData.getWithdrawalsIng()+\"\", \"10000\").doubleValue()));\n\t\t\t\n\t\t\tif(moneyData.getDetail()!=null && moneyData.getDetail().size()>0){\n\t\t\t\tListView listview = (ListView) findViewById(R.id.listview);\n\t\t\t\tlistview.setAdapter(new CommonAdapter<MoneyDetailData>(context, moneyData.getDetail(), R.layout.item_money) {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void convert(BaseViewHolder holder,\n\t\t\t\t\t\t\tMoneyDetailData itemData, int position, ViewGroup parent) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tholder.setText(R.id.tv_title, itemData.getTitle(),\"暂无信息\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tholder.setText(R.id.tv_sub_title, itemData.getDetail(),\"暂无信息\");\n\t\t\t\t\t\tholder.setText(R.id.tv_time, \"成交:\"+itemData.getTime(),\"暂无信息\");\n\t\t\t\t\t\tholder.setText(R.id.tv_money, itemData.getFlowingWater());\n\t\t\t\t\t\tif(!TextUtils.isEmpty(itemData.getFlowingWater())){\n\t\t\t\t\t\t\tTextView tv_money = holder.getView(R.id.tv_money);\n\t\t\t\t\t\t\tif(itemData.getFlowingWater().startsWith(\"+\")){\n\t\t\t\t\t\t\t\ttv_money.setTextColor(Color.parseColor(\"#14c431\"));\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\ttv_money.setTextColor(Color.parseColor(\"#ffcd00\"));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\r\n\tpublic void finish() {\n\t\tIntent I = new Intent();\r\n\t\tI.putExtra(\"songs_path\", sour);\r\n\t\tI.putExtra(\"songs_index\", index);\r\n\t\tI.putExtra(\"path_detail\", p);\r\n\t\tI.putExtra(\"name_song\", name_song);\r\n\t\tI.putExtra(\"length\", ind);\r\n\t\t//Toast.makeText(this, sour, 1000).show();\r\n\t\tsetResult(RESULT_OK,I);\r\n\t\tsuper.finish();\r\n\t}", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n\n Intent intent = new Intent(MainActivity.this, PontoTuristico.class);\n intent.putExtra(\"TITULO\", PontoTuristico.get(i).getNome());\n startActivity(intent);\n }", "@Override\n\tprotected void onActivityResult(int arg0, int arg1, Intent arg2) {\n\t\tsuper.onActivityResult(arg0, arg1, arg2);\n\t\tif(arg0==1&&arg1==RESULT_OK){\n\t\t\tif(arg2.getStringExtra(\"name\")==null)\n\t\t\t\treturn;\n\t\t\tarea=arg2.getStringExtra(\"name\");\n\t\t\tcode=arg2.getStringExtra(\"code\");\n\t\t\tcity=arg2.getStringExtra(\"city\");\n\t\t\tet_region.setText(arg2.getStringExtra(\"name\"));\n\t\t\tiv_loc.setVisibility(View.VISIBLE);\n\t\t}\n\t\tif(arg0==2&&arg1==RESULT_OK){\n\t\t\tif (arg2 == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\t ContentResolver reContentResolverol = getContentResolver(); \n\t\t\t\t Uri contactData = arg2.getData();\n\t\t\t\t //查询就是输入URI等参数,其中URI是必须的,其他是可选的,如果系统能找到URI对应的ContentProvider将返回一个Cursor对象.\n\t\t\t\t @SuppressWarnings(\"deprecation\")\n\t\t\t\t\t\t\tCursor cursor = managedQuery(contactData, null, null, null, null); \n\t\t\t\t cursor.moveToFirst(); \n\t\t\t\t //获得DATA表中的名字\n\t\t\t\t name = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)); \n\t\t\t\t //条件为联系人ID\n\t\t\t\t et_name.setText(name);\n\t\t\t\t String contactId = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID)); \n\t\t\t\t // 获得DATA表中的电话号码,条件为联系人ID,因为手机号码可能会有多个\n\t\t\t\t Cursor phone = reContentResolverol.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, \n\t\t\t\t null, \n\t\t\t\t ContactsContract.CommonDataKinds.Phone.CONTACT_ID + \" = \" + contactId, \n\t\t\t\t null, \n\t\t\t\t null); \n\t\t\t\t while (phone.moveToNext()) { \n\t\t\t\t phone_number = phone.getString(phone.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)); \n\t\t\t\t if(!phone_number.equals(\"\"))\n\t\t\t\t et_phone.setText(phone_number);\n\t\t\t\t } \n\t\t\t\t \n\t\t}\n\t}", "@Override public void onClick(View view) {\n Intent nuevo_lugar = new Intent(getApplicationContext(), EdicionLugarActivity.class);\n nuevo_lugar.putExtra(\"_id\", \"UID\");\n startActivity(nuevo_lugar);\n }", "private void getIntentData() {\r\n if (getIntent() != null && getIntent().getExtras() != null) {\r\n // Handling intent data from DirectoryDetailsActivity class\r\n if (Constant.ALBUM_TYPE.equalsIgnoreCase(getIntent().getExtras().getString(Constant.TYPE))) {\r\n position = getIntent().getIntExtra(Constant.POSITION, 0);\r\n nameKey = getIntent().getStringExtra(Constant.KEY_NAME);\r\n } else if (Constant.LIST_TYPE.equalsIgnoreCase(getIntent().getExtras().getString(Constant.TYPE))) {\r\n imageDataModel = getIntent().getParcelableExtra(Constant.DATA);\r\n } else if (Constant.SECURE_TAB.equalsIgnoreCase(getIntent().getExtras().getString(Constant.TYPE))) {\r\n imageDataModel = getIntent().getParcelableExtra(Constant.DATA);\r\n } else {\r\n // Handling other intent data like camera intent\r\n Uri uri = getIntent().getData();\r\n GalleryHelper.getImageFolderMap(this);\r\n File file = new File(getRealPathFromURI(uri));\r\n nameKey = FileUtils.getParentName(file.getParent());\r\n GalleryHelperBaseOnId.getMediaFilesOnIdBasis(this, GalleryHelper.imageFolderMap.get(nameKey).get(0).getBucketId());\r\n }\r\n }\r\n }", "@Override\n public void onClick(View v) {\n\n\n Intent int1 = new Intent(getApplicationContext(), lista.class);\n int1.putExtra(\"variableInvitado\", Sesion);\n startActivity(int1 );\n }", "private Dati getDatiRMP() {\n /* variabili e costanti locali di lavoro */\n Dati dati = null;\n Modulo modRMP = RMPModulo.get();\n Modulo modPiatto = PiattoModulo.get();\n Modulo modCategoria = CategoriaModulo.get();\n Query query;\n Filtro filtro;\n\n try { // prova ad eseguire il codice\n\n query = new QuerySelezione(modRMP);\n query.addCampo(modRMP.getCampoChiave());\n query.addCampo(modRMP.getCampo(RMP.CAMPO_PIATTO));\n query.addCampo(modRMP.getCampo(RMP.CAMPO_MENU));\n query.addCampo(modPiatto.getCampo(Piatto.CAMPO_NOME_ITALIANO));\n query.addCampo(modCategoria.getCampo(Categoria.CAMPO_SIGLA));\n filtro = new Filtro();\n filtro.add(this.getFiltroMenu());\n filtro.add(this.getFiltroPiattiComandabili());\n query.setFiltro(filtro);\n dati = modRMP.query().querySelezione(query);\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n /* valore di ritorno */\n return dati;\n }", "public Maquina cargarDetalle(int idMaquina)\r\n/* 49: */ {\r\n/* 50:103 */ return this.maquinaDao.cargarDetalle(idMaquina);\r\n/* 51: */ }", "@Override\n public void onClick(View v) {\n\n Intent intent = new Intent(chitietsanpham.this, thanhtoandathang.class);\n // Intent intent = new Intent(mContext,chitietsanpham.class);\n intent.putExtra(\"name\",name);\n // intent.putExtra(\"image\",mData.get(position).getPhoto());\n intent.putExtra(\"gia\",gia1);\n startActivity(intent);\n }", "public void goToCrearMomentoActivity(int i, Momento momento){\n Intent intent = new Intent(getApplicationContext(),CrearMomentoActivity.class);\n Bundle bundle = new Bundle();\n bundle.putInt(\"opcion\",i);\n intent.putExtra(\"opcion\",i);\n intent.putExtra(\"momento\",momento);\n startActivity(intent);\n }", "public void getOrdini(){\n caricamento = ProgressDialog.show(getActivity(), \"Cerco i tuoi ordini!\",\r\n \"Connessione con il server in corso...\", true);\r\n caricamento.show();\r\n\r\n JSONObject postData = new JSONObject();\r\n try {\r\n postData.put(\"id_utente\", Parametri.id);\r\n\r\n } catch (Exception e) {\r\n caricamento.dismiss();\r\n return;\r\n }\r\n\r\n Connessione conn = new Connessione(postData, \"POST\");\r\n conn.addListener(this);\r\n //In Parametri.IP c'è la path a cui va aggiunta il nome della pagina.php\r\n conn.execute(Parametri.IP + \"/SistudiaMieiOrdiniAndroid.php\");\r\n\r\n }", "@Override\n\t\t\t\t\t\t\t\t\t\tpublic void onItemClick(\n\t\t\t\t\t\t\t\t\t\t\t\tAdapterView<?> arg0, View arg1,\n\t\t\t\t\t\t\t\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\t\t\t\t\t\t\t\tfinal Utente mUtente = turno\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getVolontari().get(arg2);\n\n\t\t\t\t\t\t\t\t\t\t\tif (mUtente.getNumeroTelefonico()\n\t\t\t\t\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(\"null\")) {\n\t\t\t\t\t\t\t\t\t\t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCalendario.this);\n\t\t\t\t\t\t\t\t\t\t\t\tbuilder.setTitle(getString(R.string.CONTATTO));\n\t\t\t\t\t\t\t\t\t\t\t\tbuilder.setMessage(getString(R.string.NESSUN_NUMERO));\n\t\t\t\t\t\t\t\t\t\t\t\tbuilder.setCancelable(false);\n\t\t\t\t\t\t\t\t\t\t\t\tbuilder.setNeutralButton(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tgetString(R.string.CHIUDI),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew android.content.DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpublic void onClick(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDialogInterface dialog,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tint id) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\tbuilder.create().show();\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCalendario.this);\n\t\t\t\t\t\t\t\t\t\t\t\tbuilder.setTitle(\"Contatto\");\n\t\t\t\t\t\t\t\t\t\t\t\tbuilder.setMessage(getString(R.string.PROFILO_PHONE1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \" \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ mUtente.getNome()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \" \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ mUtente.getCognome()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \" \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ getString(R.string.PROFILO_PHONE2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \" \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ mUtente\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getNumeroTelefonico());\n\t\t\t\t\t\t\t\t\t\t\t\tbuilder.setCancelable(false);\n\t\t\t\t\t\t\t\t\t\t\t\tbuilder.setPositiveButton(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Chiama\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew android.content.DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpublic void onClick(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDialogInterface dialog,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tint id) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tIntent intent = new Intent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tIntent.ACTION_CALL);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tintent.setData(Uri.parse(\"tel:\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ mUtente\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getNumeroTelefonico()));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartActivityForResult(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tintent,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t0);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\tbuilder.setNegativeButton(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Chiudi\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew android.content.DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpublic void onClick(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDialogInterface dialog,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tint id) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\tbuilder.create().show();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}" ]
[ "0.607684", "0.5928138", "0.5877889", "0.579735", "0.57228696", "0.5721483", "0.5720888", "0.56896913", "0.5673008", "0.5650479", "0.5649531", "0.56180495", "0.5601059", "0.55742174", "0.5572657", "0.5557141", "0.55561775", "0.5556097", "0.5547072", "0.55409753", "0.55331206", "0.5508424", "0.5498854", "0.5496124", "0.5492838", "0.5480298", "0.54796916", "0.5474934", "0.5469299", "0.5465168", "0.5465168", "0.5441633", "0.543677", "0.5433294", "0.542294", "0.54119897", "0.53933644", "0.53916144", "0.537918", "0.537856", "0.5375003", "0.5374466", "0.5365534", "0.5362731", "0.535879", "0.53459114", "0.5344213", "0.5325339", "0.53126764", "0.5310128", "0.52996117", "0.52980113", "0.52871364", "0.52842844", "0.52761066", "0.5273838", "0.5273411", "0.52609766", "0.5252141", "0.52503645", "0.52426434", "0.52356434", "0.52308047", "0.5201429", "0.51988953", "0.51921445", "0.5183923", "0.51777667", "0.516611", "0.5153086", "0.514974", "0.51411563", "0.5139905", "0.5139228", "0.5133785", "0.5133533", "0.51317227", "0.5121751", "0.51175284", "0.51087964", "0.51079696", "0.5104431", "0.51039827", "0.50990903", "0.50988007", "0.50985104", "0.5098069", "0.50913936", "0.5089806", "0.5080481", "0.5074838", "0.507441", "0.5072839", "0.5070578", "0.50648326", "0.5062422", "0.504886", "0.50455505", "0.5043867", "0.5036163" ]
0.6201409
0
TODO Autogenerated method stub
@Override protected void onPostExecute(Void result) { super.onPostExecute(result); dialog.dismiss(); // START ONPOST if ((Boolean) mResult.get("connectionError")) { Dialog noConnection = new Dialog(Calendario.this); noConnection.requestWindowFeature(Window.FEATURE_NO_TITLE); noConnection.setContentView(R.layout.dialog_no_connection); noConnection.getWindow().setBackgroundDrawableResource( R.drawable.dialog_rounded_corner_light_black); noConnection.show(); noConnection.setCancelable(true); noConnection.setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { // TODO Auto-generated method stub finish(); } }); } else { LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); LinearLayout mContainerOra = (LinearLayout) findViewById(R.id.container_lista_ora); for (int i = 0; i < 21; i++) { int time = 800 + 50 * i; View rowOra = inflater.inflate(R.layout.row_ora, null, false); if (time % 100 == 0) { ((TextView) rowOra.findViewById(R.id.text_ora)) .setText(" " + (time / 100) + ":00 "); } else { ((TextView) rowOra.findViewById(R.id.text_ora)) .setText(" " + (time / 100) + ":30 "); } rowOra.setLayoutParams(new LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, 0.5f)); mContainerOra.addView(rowOra); } mAllAScrollView = new ArrayList<ScrollView>(); ObservableScrollView mScroll = (ObservableScrollView) findViewById(R.id.scrollView2); mScroll.setScrollViewListener(Calendario.this); mAllAScrollView.add(mScroll); ArrayList<Long> mListaGiorni = getListaGiorni(); ArrayList<View> list = new ArrayList<View>(); SimpleDateFormat dateFormatter = new SimpleDateFormat( "dd.MM.yyyy", Locale.getDefault()); ArrayList<Turno> listaOrariForGiorno = new ArrayList<Turno>(); for (int i = 0; i < mListaGiorni.size(); i++) // # giorni { listaOrariForGiorno.clear(); for (int j = 0; j < listTurni.size(); j++) { if (dateFormatter .format(mListaGiorni.get(i)) .toString() .equalsIgnoreCase( dateFormatter.format( listTurni.get(j).getData()) .toString())) listaOrariForGiorno.add(listTurni.get(j)); } View base = createBaseColoumn(mListaGiorni.get(i), parseTurno(listaOrariForGiorno)); list.add(base); } String[] funzioneTokenized = ((FunzioneObj) (getIntent() .getSerializableExtra("funzione"))).getFunzione() .split(":"); View complex = createComplexColoumn( funzioneTokenized[funzioneTokenized.length - 1], list); complex.setLayoutParams(new LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, 0.5f)); LinearLayout mContainer = (LinearLayout) findViewById(R.id.container_complex_coloumn); mContainer.addView(complex); } // END ONPOST }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onCancel(DialogInterface dialog) { finish(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onClick(View v) { if (turno.getVolontari() != null) { final Dialog dialog = new Dialog(Calendario.this); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.dialog_turno); dialog.getWindow().setBackgroundDrawableResource( R.drawable.dialog_rounded_corner); ((ListView) dialog .findViewById(R.id.lista_volontari)) .setAdapter(new RowVolontario( getApplicationContext(), turno .getVolontari())); ((ListView) dialog .findViewById(R.id.lista_volontari)) .setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick( AdapterView<?> arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub final Utente mUtente = turno .getVolontari().get(arg2); if (mUtente.getNumeroTelefonico() .equalsIgnoreCase("null")) { AlertDialog.Builder builder = new AlertDialog.Builder( Calendario.this); builder.setTitle(getString(R.string.CONTATTO)); builder.setMessage(getString(R.string.NESSUN_NUMERO)); builder.setCancelable(false); builder.setNeutralButton( getString(R.string.CHIUDI), new android.content.DialogInterface.OnClickListener() { public void onClick( DialogInterface dialog, int id) { dialog.dismiss(); } }); builder.create().show(); } else { AlertDialog.Builder builder = new AlertDialog.Builder( Calendario.this); builder.setTitle("Contatto"); builder.setMessage(getString(R.string.PROFILO_PHONE1) + " " + mUtente.getNome() + " " + mUtente.getCognome() + " " + getString(R.string.PROFILO_PHONE2) + " " + mUtente .getNumeroTelefonico()); builder.setCancelable(false); builder.setPositiveButton( "Chiama", new android.content.DialogInterface.OnClickListener() { public void onClick( DialogInterface dialog, int id) { dialog.dismiss(); Intent intent = new Intent( Intent.ACTION_CALL); intent.setData(Uri.parse("tel:" + mUtente .getNumeroTelefonico())); startActivityForResult( intent, 0); } }); builder.setNegativeButton( "Chiudi", new android.content.DialogInterface.OnClickListener() { public void onClick( DialogInterface dialog, int id) { dialog.dismiss(); } }); builder.create().show(); } } }); dialog.show(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onItemClick( AdapterView<?> arg0, View arg1, int arg2, long arg3) { final Utente mUtente = turno .getVolontari().get(arg2); if (mUtente.getNumeroTelefonico() .equalsIgnoreCase("null")) { AlertDialog.Builder builder = new AlertDialog.Builder( Calendario.this); builder.setTitle(getString(R.string.CONTATTO)); builder.setMessage(getString(R.string.NESSUN_NUMERO)); builder.setCancelable(false); builder.setNeutralButton( getString(R.string.CHIUDI), new android.content.DialogInterface.OnClickListener() { public void onClick( DialogInterface dialog, int id) { dialog.dismiss(); } }); builder.create().show(); } else { AlertDialog.Builder builder = new AlertDialog.Builder( Calendario.this); builder.setTitle("Contatto"); builder.setMessage(getString(R.string.PROFILO_PHONE1) + " " + mUtente.getNome() + " " + mUtente.getCognome() + " " + getString(R.string.PROFILO_PHONE2) + " " + mUtente .getNumeroTelefonico()); builder.setCancelable(false); builder.setPositiveButton( "Chiama", new android.content.DialogInterface.OnClickListener() { public void onClick( DialogInterface dialog, int id) { dialog.dismiss(); Intent intent = new Intent( Intent.ACTION_CALL); intent.setData(Uri.parse("tel:" + mUtente .getNumeroTelefonico())); startActivityForResult( intent, 0); } }); builder.setNegativeButton( "Chiudi", new android.content.DialogInterface.OnClickListener() { public void onClick( DialogInterface dialog, int id) { dialog.dismiss(); } }); builder.create().show(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onScrollChanged(ObservableScrollView scrollView, int x, int y, int oldx, int oldy) { for (ScrollView child : mAllAScrollView) child.scrollTo(x, y); }
{ "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